@lovrabet/rabetbase-cli 2.3.12-beta.1 → 2.3.13-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x28eae8,_0xb50a03){const _0x529c4e=a113_0xcd52,_0x52d7e4=_0x28eae8();while(!![]){try{const _0x397eac=parseInt(_0x529c4e(0x1af))/0x1+-parseInt(_0x529c4e(0x1c0))/0x2+parseInt(_0x529c4e(0x1c4))/0x3+-parseInt(_0x529c4e(0x1c7))/0x4*(parseInt(_0x529c4e(0x1be))/0x5)+-parseInt(_0x529c4e(0x1b6))/0x6*(parseInt(_0x529c4e(0x1c1))/0x7)+parseInt(_0x529c4e(0x1b8))/0x8+parseInt(_0x529c4e(0x1c6))/0x9;if(_0x397eac===_0xb50a03)break;else _0x52d7e4['push'](_0x52d7e4['shift']());}catch(_0x597d48){_0x52d7e4['push'](_0x52d7e4['shift']());}}}(a113_0x27c6,0xd11d2));import a113_0x1673a7 from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a113_0x10693d from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x2e2f0e){const _0x1dba8a=a113_0xcd52;return _0x2e2f0e[_0x1dba8a(0x1c3)](_0x24b299=>{const _0xd40be1=_0x1dba8a;if(_0x24b299?.[_0xd40be1(0x1c8)]===_0xd40be1(0x1b0))throw CliErrors['cancelled'](_0xd40be1(0x1ab));throw _0x24b299;});}export function startSpinner(_0x29b379){const _0x4a26e5=a113_0xcd52;return a113_0x10693d({'text':_0x29b379,'color':_0x4a26e5(0x1c9)})[_0x4a26e5(0x1b7)]();}function a113_0xcd52(_0x1e0e26,_0x111e1d){_0x1e0e26=_0x1e0e26-0x1a4;const _0x27c6ae=a113_0x27c6();let _0xcd52a0=_0x27c6ae[_0x1e0e26];return _0xcd52a0;}export function stopSpinner(_0x5b69df,_0x2fa887,_0x432cce){const _0x3616b6=a113_0xcd52;_0x432cce?_0x5b69df[_0x3616b6(0x1b4)](_0x2fa887):_0x5b69df['fail'](_0x2fa887);}export async function askConfirm(_0x5d6629){return onCancel(confirm({'message':_0x5d6629,'theme':{'prefix':''}}));}export async function askJsUrl(_0x3d6583){const _0x69abef=a113_0xcd52;while(!![]){const _0x3d83a7=await onCancel(input({'message':'\x20\x20JS\x20URL:','default':_0x3d6583,'theme':{'prefix':''}}));if(_0x3d83a7['trim']()==='')throw CliErrors[_0x69abef(0x1b1)](_0x69abef(0x1ab));if(!/^https:\/\/.+\.js(\?.*)?$/[_0x69abef(0x1b3)](_0x3d83a7[_0x69abef(0x1a6)]())){console[_0x69abef(0x1c2)](a113_0x1673a7[_0x69abef(0x1bb)](_0x69abef(0x1a5)));continue;}const _0xb9aee2=startSpinner('\x20\x20Checking\x20JS\x20URL\x20reachability...');try{const _0x38eec4=await isUrlReachable(_0x3d83a7[_0x69abef(0x1a6)]());stopSpinner(_0xb9aee2,'JS\x20URL\x20checked',_0x38eec4);if(!_0x38eec4){console['error'](a113_0x1673a7[_0x69abef(0x1bb)](_0x69abef(0x1ad)));continue;}return _0x3d83a7[_0x69abef(0x1a6)]();}catch(_0x2bb2b2){stopSpinner(_0xb9aee2,_0x69abef(0x1b5),![]);throw _0x2bb2b2;}}}export async function askCssUrl(_0x23155b){const _0x1dee34=a113_0xcd52;while(!![]){const _0x203e8d=await onCancel(input({'message':_0x1dee34(0x1a4),'default':_0x23155b,'theme':{'prefix':''}}));if(_0x203e8d['trim']()==='')throw CliErrors[_0x1dee34(0x1b1)](_0x1dee34(0x1ab));if(!/^https:\/\/.+\.css(\?.*)?$/[_0x1dee34(0x1b3)](_0x203e8d[_0x1dee34(0x1a6)]())){console[_0x1dee34(0x1c2)](a113_0x1673a7[_0x1dee34(0x1bb)](_0x1dee34(0x1ae)));continue;}const _0x590030=startSpinner('\x20\x20Checking\x20CSS\x20URL\x20reachability...');try{const _0x51d5fd=await isUrlReachable(_0x203e8d[_0x1dee34(0x1a6)]());stopSpinner(_0x590030,_0x1dee34(0x1a7),_0x51d5fd);if(!_0x51d5fd){console[_0x1dee34(0x1c2)](a113_0x1673a7['red'](_0x1dee34(0x1c5)));continue;}return _0x203e8d[_0x1dee34(0x1a6)]();}catch(_0x505293){stopSpinner(_0x590030,_0x1dee34(0x1a8),![]);throw _0x505293;}}}export async function selectPages(_0x2fd970,_0x43357b){const _0x5f23c3=a113_0xcd52,_0x1caf63=_0x2fd970['map'](_0x5122e1=>{const _0x2b7083=a113_0xcd52,_0xbf9622=_0x43357b['has'](_0x5122e1[_0x2b7083(0x1aa)]);return{'name':_0x5122e1[_0x2b7083(0x1a9)]+'\x20\x20'+a113_0x1673a7[_0x2b7083(0x1b2)](_0x5122e1[_0x2b7083(0x1aa)])+'\x20\x20'+(_0xbf9622?a113_0x1673a7[_0x2b7083(0x1b2)](_0x2b7083(0x1ac)):a113_0x1673a7[_0x2b7083(0x1ca)]('[new]')),'value':_0x5122e1[_0x2b7083(0x1aa)],'checked':!_0xbf9622,'disabled':_0xbf9622};});if(_0x1caf63[_0x5f23c3(0x1b9)]===0x0)throw new Error(_0x5f23c3(0x1cb));const _0x44b957=await onCancel(checkbox({'message':'\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','choices':_0x1caf63,'loop':![],'theme':{'prefix':''}}));if(_0x44b957[_0x5f23c3(0x1b9)]===0x0)throw new Error('No\x20menus\x20selected.');return _0x2fd970[_0x5f23c3(0x1ba)](_0x5631af=>_0x44b957[_0x5f23c3(0x1bc)](_0x5631af['path']));}export function isInteractive(){return process['stdin']['isTTY']===!![];}export function requireInteractive(){const _0x43a3af=a113_0xcd52;if(!isInteractive())throw new Error(_0x43a3af(0x1bd)+_0x43a3af(0x1bf));}function a113_0x27c6(){const _0x2f1557=['green','No\x20local\x20pages\x20found.','\x20\x20CSS\x20URL:','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','trim','CSS\x20URL\x20checked','CSS\x20URL\x20check\x20failed','label','path','Cancelled.','[already\x20on\x20platform]','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','714794LptLSh','ExitPromptError','cancelled','gray','test','succeed','JS\x20URL\x20check\x20failed','6IKWJTt','start','3404648MJJDIV','length','filter','red','includes','This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20','40ZbtAwZ','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','735834JaPvLs','2614339TyEWDr','error','catch','2761995MToTmj','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','3268764LcUyae','413156ATqYsG','name','cyan'];a113_0x27c6=function(){return _0x2f1557;};return a113_0x27c6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a114_0x19eca7=a114_0x1e59;function a114_0x1e59(_0x160ca3,_0x1fa522){_0x160ca3=_0x160ca3-0x158;const _0xa75059=a114_0xa750();let _0x1e59e2=_0xa75059[_0x160ca3];return _0x1e59e2;}(function(_0x4f922b,_0xb02aa0){const _0x2b849c=a114_0x1e59,_0xf52ec7=_0x4f922b();while(!![]){try{const _0x341646=parseInt(_0x2b849c(0x167))/0x1+parseInt(_0x2b849c(0x162))/0x2*(-parseInt(_0x2b849c(0x168))/0x3)+parseInt(_0x2b849c(0x16b))/0x4+-parseInt(_0x2b849c(0x159))/0x5+parseInt(_0x2b849c(0x16e))/0x6*(parseInt(_0x2b849c(0x169))/0x7)+-parseInt(_0x2b849c(0x164))/0x8*(-parseInt(_0x2b849c(0x15c))/0x9)+parseInt(_0x2b849c(0x163))/0xa;if(_0x341646===_0xb02aa0)break;else _0xf52ec7['push'](_0xf52ec7['shift']());}catch(_0x384b44){_0xf52ec7['push'](_0xf52ec7['shift']());}}}(a114_0xa750,0xd00d2));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process['cwd'](),a114_0x19eca7(0x15a));function a114_0xa750(){const _0x5e730e=['endsWith','replaceAll','63701eFSILQ','153VzMTUL','5154856Wqjuuk','split','1361356YFnpLV','join','.tsx','6KVILXG','path','1827090lkFHAW','src/pages','replace','9ShUjBp','slice','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','match','isDirectory','filter','42382BZmZcg','4660220kAljYw','5534936GyQoAz'];a114_0xa750=function(){return _0x5e730e;};return a114_0xa750();}export function extractTitleFromComment(_0x152321){const _0x38e827=a114_0x19eca7;try{const _0x4ad66a=readFileSync(_0x152321,'utf-8'),_0x34a5bd=_0x4ad66a[_0x38e827(0x15f)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x34a5bd&&_0x34a5bd[0x1]){const _0x22df0f=_0x34a5bd[0x1],_0x3e08af=_0x22df0f[_0x38e827(0x15f)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x3e08af&&_0x3e08af[0x1])return _0x3e08af[0x1]['trim']();}let _0x76840d=null;const _0xddba7=_0x4ad66a[_0x38e827(0x15f)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0xddba7&&_0xddba7[0x1]&&(_0x76840d=_0xddba7[0x1]);if(!_0x76840d){const _0x48fccb=_0x4ad66a[_0x38e827(0x15f)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x48fccb&&_0x48fccb[0x1]&&(_0x76840d=_0x48fccb[0x1]);}if(_0x76840d){const _0x11c92a=new RegExp('\x5cb'+_0x76840d+_0x38e827(0x15e)),_0x4b0fea=_0x4ad66a[_0x38e827(0x15f)](_0x11c92a);if(_0x4b0fea&&_0x4b0fea[0x1])return _0x4b0fea[0x1];return _0x76840d;}return null;}catch(_0x438f32){return null;}}export function getLocalPages(_0x45bbe9=pagesDir,_0x26652e=pagesDir){const _0x1c0919=a114_0x19eca7;let _0x2cffe0=[];const _0x541662=readdirSync(_0x45bbe9);return _0x541662['forEach'](_0x4d1545=>{const _0x1e5148=a114_0x1e59,_0x563fd6=join(_0x45bbe9,_0x4d1545),_0x354358=statSync(_0x563fd6);if(_0x354358&&_0x354358[_0x1e5148(0x160)]())_0x2cffe0=_0x2cffe0['concat'](getLocalPages(_0x563fd6,_0x26652e));else{if(_0x4d1545[_0x1e5148(0x165)](_0x1e5148(0x16d))){let _0x2e4ac1=relative(_0x26652e,_0x563fd6);_0x2e4ac1['endsWith']('index.tsx')?_0x2e4ac1=_0x2e4ac1[_0x1e5148(0x15b)](/index\.tsx$/,''):_0x2e4ac1=_0x2e4ac1[_0x1e5148(0x15b)](/\.tsx$/,'');_0x2e4ac1[_0x1e5148(0x165)](sep)&&(_0x2e4ac1=_0x2e4ac1[_0x1e5148(0x15d)](0x0,-0x1));const _0x57b858=_0x2e4ac1[_0x1e5148(0x16a)](sep)[_0x1e5148(0x16c)]('/'),_0x361705=extractTitleFromComment(_0x563fd6),_0x5ae73=_0x361705||_0x57b858;_0x2cffe0['push']({'path':_0x57b858[_0x1e5148(0x166)]('$',':'),'label':_0x5ae73});}}}),_0x2cffe0[_0x1c0919(0x161)](_0x5bb218=>_0x5bb218[_0x1c0919(0x158)]!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x327794,_0x182f47){const _0x24f00f=a115_0x371f,_0x482c37=_0x327794();while(!![]){try{const _0x4b086d=-parseInt(_0x24f00f(0x80))/0x1+-parseInt(_0x24f00f(0x82))/0x2+-parseInt(_0x24f00f(0x88))/0x3+parseInt(_0x24f00f(0x86))/0x4+-parseInt(_0x24f00f(0x7c))/0x5+-parseInt(_0x24f00f(0x78))/0x6+parseInt(_0x24f00f(0x7f))/0x7;if(_0x4b086d===_0x182f47)break;else _0x482c37['push'](_0x482c37['shift']());}catch(_0x16e647){_0x482c37['push'](_0x482c37['shift']());}}}(a115_0x2200,0x40e36));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a115_0x371f(_0x3a5d1c,_0x527d72){_0x3a5d1c=_0x3a5d1c-0x78;const _0x2200e0=a115_0x2200();let _0x371fc4=_0x2200e0[_0x3a5d1c];return _0x371fc4;}import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';export function validateJsUrl(_0x13c9ee){const _0xef4206=a115_0x371f,_0x31de6f=[];return!isValidJsHttpsUrl(_0x13c9ee)&&_0x31de6f[_0xef4206(0x79)](_0xef4206(0x83)),{'ok':_0x31de6f[_0xef4206(0x84)]===0x0,'errors':_0x31de6f};}export function validateCssUrl(_0x902efa){const _0x14cafe=a115_0x371f,_0x1fec82=[];return!isValidCssHttpsUrl(_0x902efa)&&_0x1fec82['push']('CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'),{'ok':_0x1fec82[_0x14cafe(0x84)]===0x0,'errors':_0x1fec82};}export async function validateJsUrlReachable(_0x4468a6){const _0x911640=a115_0x371f,_0x3c1284=validateJsUrl(_0x4468a6);if(!_0x3c1284['ok'])return _0x3c1284;const _0x184abb=await isUrlReachable(_0x4468a6);if(!_0x184abb)_0x3c1284[_0x911640(0x7b)][_0x911640(0x79)](_0x911640(0x85));return{'ok':_0x3c1284['errors']['length']===0x0,'errors':_0x3c1284[_0x911640(0x7b)]};}export async function validateCssUrlReachable(_0x216244){const _0x49cd99=a115_0x371f,_0xeb1c13=validateCssUrl(_0x216244);if(!_0xeb1c13['ok'])return _0xeb1c13;const _0x214988=await isUrlReachable(_0x216244);if(!_0x214988)_0xeb1c13[_0x49cd99(0x7b)][_0x49cd99(0x79)]('CSS\x20URL\x20is\x20unreachable');return{'ok':_0xeb1c13['errors'][_0x49cd99(0x84)]===0x0,'errors':_0xeb1c13[_0x49cd99(0x7b)]};}export function buildCompareRows(_0x3b1d4b,_0x57da27){const _0x219366=a115_0x371f;return _0x3b1d4b[_0x219366(0x7e)](_0x57c547=>({'label':_0x57c547[_0x219366(0x7a)],'path':_0x57c547[_0x219366(0x7d)],'local':!![],'online':_0x57da27[_0x219366(0x81)](_0x57c547['path'])}));}export async function doCreateMenus(_0x10be21,_0x1ea3da,_0x487cb1,_0x3f2e72){const _0x52fd64=a115_0x371f,_0x451c7a=await createMenus(_0x10be21,_0x1ea3da,_0x487cb1,_0x3f2e72);return{'created':_0x451c7a[_0x52fd64(0x84)],'failed':0x0,'labels':_0x487cb1['map'](_0x5e8d13=>_0x5e8d13['label']),'menus':_0x451c7a};}function a115_0x2200(){const _0xe12781=['819858DbCRli','2850612xKEyko','push','label','errors','1206125hxXPbN','path','map','9038519ShhNDD','294135XEyOhR','has','169664hbFhxK','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','length','JS\x20URL\x20is\x20unreachable','1372580jIGOwo','resources'];a115_0x2200=function(){return _0xe12781;};return a115_0x2200();}export function filterMenusWithResources(_0x476e19){const _0x3a5fcd=a115_0x371f;return _0x476e19['filter'](_0x46b681=>_0x46b681[_0x3a5fcd(0x87)][_0x3a5fcd(0x84)]>0x0);}export async function fetchMenuData(_0x466cf7,_0x544f45){const _0x32da1e=getLocalPages(),_0x30d92c=await getOnlineMenuList(_0x466cf7,_0x544f45),_0x360341=new Set(_0x30d92c['map'](_0x158b4b=>_0x158b4b['path']));return{'localPages':_0x32da1e,'onlineMenuList':_0x30d92c,'onlinePaths':_0x360341};}export async function fetchOnlineMenuList(_0x5d18a7,_0x1e201e){return getOnlineMenuList(_0x5d18a7,_0x1e201e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a116_0x33ea24=a116_0x2d4b;function a116_0x2d4b(_0x518a2b,_0x533ca8){_0x518a2b=_0x518a2b-0x13f;const _0x3019d8=a116_0x3019();let _0x2d4bd0=_0x3019d8[_0x518a2b];return _0x2d4bd0;}(function(_0xd33f6d,_0x3c4741){const _0x48343c=a116_0x2d4b,_0x21fc45=_0xd33f6d();while(!![]){try{const _0xbc3a6=-parseInt(_0x48343c(0x184))/0x1+parseInt(_0x48343c(0x168))/0x2+-parseInt(_0x48343c(0x16a))/0x3+-parseInt(_0x48343c(0x167))/0x4+-parseInt(_0x48343c(0x19e))/0x5+parseInt(_0x48343c(0x15a))/0x6+parseInt(_0x48343c(0x164))/0x7*(parseInt(_0x48343c(0x193))/0x8);if(_0xbc3a6===_0x3c4741)break;else _0x21fc45['push'](_0x21fc45['shift']());}catch(_0x223c51){_0x21fc45['push'](_0x21fc45['shift']());}}}(a116_0x3019,0x68835));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':a116_0x33ea24(0x140),'required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':'sort','type':a116_0x33ea24(0x140),'description':'Sibling\x20sort\x20value\x20(non-negative\x20integer)'};export const MENU_PARENT_ID_FLAG={'name':'parent-id','type':'string','description':'Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node'};export const MENU_EXPECT_PARENT_ID_FLAG={'name':'expect-parent-id','type':a116_0x33ea24(0x177),'description':'Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level'};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a116_0x33ea24(0x1a6),'type':'string','description':'Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches'},{'name':'expected-children-count','type':a116_0x33ea24(0x140),'description':a116_0x33ea24(0x17c)}];export function validateExactId(_0x5aca82){const _0x3e726f=a116_0x33ea24,_0x5ce2c6=_0x5aca82[_0x3e726f(0x17b)]('id');if(!Number['isSafeInteger'](_0x5ce2c6)||_0x5ce2c6<=0x0)throw CliErrors[_0x3e726f(0x192)](_0x3e726f(0x1a1));return _0x5ce2c6;}export function validateSort(_0x28ebc0,_0x371473=a116_0x33ea24(0x18e)){const _0x51fe01=a116_0x33ea24;if(!hasFlag(_0x28ebc0,_0x371473))return undefined;const _0xe92323=_0x28ebc0[_0x51fe01(0x17b)](_0x371473);if(!Number[_0x51fe01(0x154)](_0xe92323)||_0xe92323<0x0||_0xe92323>MAX_MENU_SORT)throw menuError(_0x51fe01(0x180),'--'+_0x371473+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x51fe01(0x15e));return _0xe92323;}export function nextSiblingSort(_0x4c06ce,_0x12edd5,_0x151669){const _0x8c528f=a116_0x33ea24,_0x4e9064=getChildren(_0x4c06ce,_0x12edd5)[_0x8c528f(0x1a0)](_0x453776=>_0x453776['sort'])[_0x8c528f(0x160)](_0x21bd97=>typeof _0x21bd97===_0x8c528f(0x140));if(_0x4e9064[_0x8c528f(0x18a)]===0x0)return 0x0;const _0x1c24b8=Math['max'](..._0x4e9064);if(_0x1c24b8>=MAX_MENU_SORT)throw menuError(_0x8c528f(0x14c),_0x8c528f(0x18b)+_0x151669+_0x8c528f(0x16c)+_0x1c24b8+'.',_0x8c528f(0x144)+MAX_MENU_SORT+_0x8c528f(0x155));return _0x1c24b8+0x1;}export function requireExplicitYes(_0x1708e6){const _0x61daaf=a116_0x33ea24;if(_0x1708e6[_0x61daaf(0x17d)](_0x61daaf(0x1a4)))return;if(!_0x1708e6[_0x61daaf(0x17d)](_0x61daaf(0x186)))throw menuError(_0x61daaf(0x14e),_0x61daaf(0x146),_0x61daaf(0x141));}export async function fetchMutationSnapshot(_0xcb20a7,_0x23d623,_0x18bb4c){const _0xb3792c=a116_0x33ea24;try{return await fetchMenuSnapshot(_0xcb20a7['appCode'],_0xcb20a7[_0xb3792c(0x163)]);}catch(_0x3f0dc0){throw mapMenuApiError(_0x3f0dc0,_0xb3792c(0x17e)+_0x23d623,_0x18bb4c);}}export async function recheckMutationSnapshot(_0x3137ab,_0x5e9318,_0x187e8d,_0x1a5e55){const _0x3f2190=a116_0x33ea24;let _0x3c295a;try{_0x3c295a=await fetchMenuSnapshot(_0x3137ab[_0x3f2190(0x13f)],_0x3137ab[_0x3f2190(0x163)]);}catch(_0x49840a){const _0x3e958=mapMenuApiError(_0x49840a,_0x3f2190(0x16d)+_0x187e8d,_0x1a5e55);throw menuFailure(_0x3e958,_0x5e9318,{'stage':_0x3f2190(0x159),'failed':_0x1a5e55==null?{}:{'id':_0x1a5e55}});}if(_0x3c295a['hash']!==_0x5e9318[_0x3f2190(0x19b)]){const _0x5dc052=menuError(_0x3f2190(0x15c),_0x3f2190(0x169)+_0x187e8d+_0x3f2190(0x14d),_0x3f2190(0x14a));throw menuFailure(_0x5dc052,_0x5e9318,{'stage':_0x3f2190(0x159),'failed':{..._0x1a5e55==null?{}:{'id':_0x1a5e55},'expectedSnapshotHash':_0x5e9318[_0x3f2190(0x19b)],'currentSnapshotHash':_0x3c295a[_0x3f2190(0x1a5)]}});}return _0x3c295a;}export function parseParentId(_0x22bd9a,_0x597b99,_0x2dd690={}){const _0xe28fe1=a116_0x33ea24;if(!hasFlag(_0x22bd9a,_0x597b99)){if(_0x2dd690[_0xe28fe1(0x175)])throw CliErrors[_0xe28fe1(0x170)](_0x597b99);return undefined;}const _0x18c17a=_0x22bd9a['str'](_0x597b99)['trim']();if(_0x18c17a[_0xe28fe1(0x191)]()===_0xe28fe1(0x1a2))return null;if(!/^\d+$/[_0xe28fe1(0x143)](_0x18c17a))throw CliErrors[_0xe28fe1(0x192)]('--'+_0x597b99+_0xe28fe1(0x194));const _0x1bc1e8=Number(_0x18c17a);if(!Number['isSafeInteger'](_0x1bc1e8)||_0x1bc1e8<=0x0)throw CliErrors[_0xe28fe1(0x192)]('--'+_0x597b99+_0xe28fe1(0x194));return _0x1bc1e8;}export function requireMenu(_0x1ed6fe,_0x202264){const _0x53ad62=a116_0x33ea24,_0x141cd9=_0x1ed6fe[_0x53ad62(0x181)][_0x53ad62(0x158)](_0x202264);if(!_0x141cd9)throw menuError('menu_not_found','Online\x20menu\x20not\x20found:\x20'+_0x202264,_0x53ad62(0x182));return _0x141cd9;}export function requireFolder(_0x18a7b8,_0x3cad5d){const _0x19b14f=a116_0x33ea24,_0x403eb1=requireMenu(_0x18a7b8,_0x3cad5d);if(_0x403eb1['type']!=='folder')throw menuError(_0x19b14f(0x179),'Menu\x20'+_0x3cad5d+_0x19b14f(0x16e)+(_0x403eb1[_0x19b14f(0x16f)]||'unknown')+_0x19b14f(0x17f),_0x19b14f(0x147));return _0x403eb1;}export function assertExpectedState(_0x447677,_0x78020d){const _0x5344e7=a116_0x33ea24;if(hasFlag(_0x447677,'expect-parent-id')){const _0x58ada2=parseParentId(_0x447677,_0x5344e7(0x189),{'required':!![]});if(_0x78020d[_0x5344e7(0x19f)]!==_0x58ada2)throw stateDrift(_0x5344e7(0x185)+_0x78020d['id']+'\x20parent\x20changed:\x20expected\x20'+formatParent(_0x58ada2)+_0x5344e7(0x174)+formatParent(_0x78020d[_0x5344e7(0x19f)])+'.');}if(hasFlag(_0x447677,'expect-path')){const _0x492212=_0x447677[_0x5344e7(0x142)](_0x5344e7(0x1a6));if(_0x78020d['path']!==_0x492212)throw stateDrift(_0x5344e7(0x185)+_0x78020d['id']+_0x5344e7(0x161)+JSON['stringify'](_0x492212)+',\x20current\x20'+JSON[_0x5344e7(0x145)](_0x78020d[_0x5344e7(0x18c)])+'.');}if(hasFlag(_0x447677,_0x5344e7(0x157))){const _0x2a576f=_0x447677['num'](_0x5344e7(0x157));if(!Number[_0x5344e7(0x154)](_0x2a576f)||_0x2a576f<0x0)throw CliErrors['validation']('--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.');if(_0x78020d[_0x5344e7(0x1a3)]!==_0x2a576f)throw stateDrift('Menu\x20'+_0x78020d['id']+_0x5344e7(0x172)+_0x2a576f+',\x20current\x20'+_0x78020d[_0x5344e7(0x1a3)]+'.');}}export function assertVerified(_0xda211b,_0x32a221,_0x2ea015=a116_0x33ea24(0x152)){if(!_0xda211b)throw menuError('menu_verification_failed',_0x32a221,_0x2ea015);}export function mutationResult(_0x5989c0){const _0xab9d04=a116_0x33ea24;return{'operation':_0x5989c0[_0xab9d04(0x195)],'selector':_0x5989c0[_0xab9d04(0x16b)],'before':_0x5989c0[_0xab9d04(0x150)],'after':_0x5989c0[_0xab9d04(0x166)],'dryRun':_0x5989c0[_0xab9d04(0x149)],'backend':_0x5989c0[_0xab9d04(0x153)],..._0x5989c0['plannedActions']?{'plannedActions':_0x5989c0[_0xab9d04(0x18d)]}:{},..._0x5989c0[_0xab9d04(0x188)]?{'targets':_0x5989c0['targets']}:{},..._0x5989c0[_0xab9d04(0x197)]?{'deleteOrder':_0x5989c0[_0xab9d04(0x197)]}:{},'snapshotHash':_0x5989c0[_0xab9d04(0x19b)],..._0x5989c0[_0xab9d04(0x183)]?{'cascade':_0x5989c0['cascade']}:{},..._0x5989c0[_0xab9d04(0x151)]?{'planFile':_0x5989c0[_0xab9d04(0x151)]}:{},'succeeded':_0x5989c0[_0xab9d04(0x14f)]??[],'failed':_0x5989c0[_0xab9d04(0x148)]??[],'warnings':_0x5989c0[_0xab9d04(0x190)]??[],'verification':_0x5989c0[_0xab9d04(0x15b)],'error':_0x5989c0[_0xab9d04(0x199)]};}export function menuDryRunResult(_0x13c49a,_0x167b75){return{..._0x13c49a,..._0x167b75};}export function menuFailure(_0x2a8fad,_0x59504d,_0x354f8b){const _0x404f80=a116_0x33ea24,_0xe12baa=mutationResult({..._0x59504d,'after':_0x354f8b[_0x404f80(0x166)]===undefined?_0x59504d[_0x404f80(0x166)]:_0x354f8b['after'],'backend':_0x354f8b[_0x404f80(0x153)]??_0x59504d[_0x404f80(0x153)],'dryRun':![],'succeeded':_0x354f8b['succeeded']??[],'failed':[{..._0x354f8b[_0x404f80(0x148)]??{},'stage':_0x354f8b[_0x404f80(0x173)],'code':_0x2a8fad[_0x404f80(0x14b)],'message':_0x2a8fad['message']}],'warnings':[..._0x59504d[_0x404f80(0x190)],..._0x354f8b[_0x404f80(0x190)]??[]],'verification':_0x354f8b[_0x404f80(0x15b)],'error':{'code':_0x2a8fad[_0x404f80(0x14b)],'message':_0x2a8fad[_0x404f80(0x19c)],..._0x2a8fad['hint']?{'hint':_0x2a8fad[_0x404f80(0x178)]}:{}}});return Object[_0x404f80(0x18f)](_0x2a8fad,'data',{'value':_0xe12baa,'enumerable':!![],'configurable':!![]}),_0x2a8fad;}export function asVerificationError(_0x6e6d34,_0x351b87){const _0x5d187d=a116_0x33ea24;if(_0x6e6d34 instanceof CliError&&_0x6e6d34[_0x5d187d(0x14b)]==='menu_verification_failed')return _0x6e6d34;const _0x27fca7=_0x6e6d34 instanceof Error?_0x6e6d34[_0x5d187d(0x19c)]:String(_0x6e6d34);return menuError(_0x5d187d(0x19d),''+_0x351b87+(_0x27fca7?':\x20'+_0x27fca7:''),'The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.');}export function describeMenuErrorCause(_0x2caad5,_0x47154e,_0x19ad5b){const _0x3639d4=a116_0x33ea24,_0x1e30e4=mapMenuApiError(_0x2caad5,_0x47154e,_0x19ad5b);return{'causeCode':_0x1e30e4[_0x3639d4(0x14b)],'causeMessage':_0x1e30e4['message']};}export function hasFlag(_0x597ce3,_0xe909b8){const _0x1eeb57=a116_0x33ea24;return Object[_0x1eeb57(0x171)][_0x1eeb57(0x156)]['call'](_0x597ce3[_0x1eeb57(0x17a)],_0xe909b8)&&_0x597ce3[_0x1eeb57(0x17a)][_0xe909b8]!==undefined;}function a116_0x3019(){const _0x4514db=[',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','hasOwnProperty','expected-children-count','get','pre-write-recheck','4993284sIwzKL','verification','menu_state_drift','menu_mutation_failed','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','Failed\x20to\x20','filter','\x20path\x20changed:\x20expected\x20','\x20menu\x20','cookie','3809302QJooRc','Permission\x20denied\x20while\x20attempting\x20to\x20','after','623556PkSyTg','1299236xkyquy','Online\x20menu\x20state\x20changed\x20before\x20','1635894XZGwUm','selector','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','recheck\x20online\x20menu\x20facts\x20before\x20','\x20is\x20type\x20\x22','type','flagMissing','prototype','\x20child\x20count\x20changed:\x20expected\x20','stage',',\x20current\x20','required','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','string','hint','menu_parent_not_folder','rawFlags','num','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','bool','read\x20online\x20menu\x20facts\x20before\x20','\x22,\x20not\x20folder.','menu_sort_invalid','byId','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','cascade','57459fmebWr','Menu\x20','yes','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','targets','expect-parent-id','length','Cannot\x20append\x20a\x20','path','plannedActions','sort','defineProperty','warnings','toLowerCase','validation','8mXISGB','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','operation','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','deleteOrder','api_error','error','menu_permission_denied','snapshotHash','message','menu_verification_failed','4196435qiProI','parentId','map','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','root','childrenCount','dry-run','hash','expect-path','appCode','number','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','str','test','Reorder\x20sibling\x20menus\x20below\x20','stringify','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','failed','dryRun','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','code','menu_sort_overflow',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','menu_confirmation_required','succeeded','before','planFile','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','backend','isSafeInteger'];a116_0x3019=function(){return _0x4514db;};return a116_0x3019();}export function toApiParentId(_0x8d80de){return _0x8d80de??0x0;}export function formatParent(_0x1bd2f2){const _0x2576d7=a116_0x33ea24;return _0x1bd2f2==null?_0x2576d7(0x1a2):String(_0x1bd2f2);}export function menuError(_0x472749,_0x2b54e1,_0xd2b47e){return new CliError(_0x472749,0x1,_0x2b54e1,_0xd2b47e);}export function mapMenuApiError(_0x599e76,_0x176136,_0x13169e){const _0x30ee52=a116_0x33ea24;if(_0x599e76 instanceof CliError&&_0x599e76['code']!==_0x30ee52(0x198))return _0x599e76;const _0x54edb9=_0x599e76 instanceof Error?_0x599e76['message']:String(_0x599e76);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x30ee52(0x143)](_0x54edb9))return menuError(_0x30ee52(0x19a),_0x30ee52(0x165)+_0x176136+(_0x13169e?_0x30ee52(0x162)+_0x13169e:'')+'.',_0x30ee52(0x196));return menuError(_0x30ee52(0x15d),_0x30ee52(0x15f)+_0x176136+(_0x13169e?'\x20menu\x20'+_0x13169e:'')+':\x20'+_0x54edb9,_0x30ee52(0x176));}function stateDrift(_0x23254b){const _0x20343b=a116_0x33ea24;return menuError(_0x20343b(0x15c),_0x23254b,_0x20343b(0x187));}
|
|
1
|
+
const a116_0x3a3f7b=a116_0x4435;(function(_0x4f2707,_0x3db567){const _0x613391=a116_0x4435,_0x4ef2bd=_0x4f2707();while(!![]){try{const _0xf05f5b=-parseInt(_0x613391(0x11f))/0x1+-parseInt(_0x613391(0x152))/0x2*(-parseInt(_0x613391(0x159))/0x3)+parseInt(_0x613391(0x133))/0x4*(parseInt(_0x613391(0x128))/0x5)+-parseInt(_0x613391(0x164))/0x6+-parseInt(_0x613391(0x146))/0x7*(-parseInt(_0x613391(0x102))/0x8)+parseInt(_0x613391(0x104))/0x9+-parseInt(_0x613391(0x140))/0xa;if(_0xf05f5b===_0x3db567)break;else _0x4ef2bd['push'](_0x4ef2bd['shift']());}catch(_0x57237b){_0x4ef2bd['push'](_0x4ef2bd['shift']());}}}(a116_0x299e,0xcaba4));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':a116_0x3a3f7b(0x108),'required':!![],'description':a116_0x3a3f7b(0x14c)};export const MENU_SORT_FLAG={'name':a116_0x3a3f7b(0x109),'type':a116_0x3a3f7b(0x108),'description':a116_0x3a3f7b(0x118)};export const MENU_PARENT_ID_FLAG={'name':a116_0x3a3f7b(0x13f),'type':a116_0x3a3f7b(0x11c),'description':'Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node'};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a116_0x3a3f7b(0x11e),'type':a116_0x3a3f7b(0x11c),'description':a116_0x3a3f7b(0x113)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a116_0x3a3f7b(0x12a),'type':a116_0x3a3f7b(0x11c),'description':a116_0x3a3f7b(0x106)},{'name':a116_0x3a3f7b(0x158),'type':a116_0x3a3f7b(0x108),'description':a116_0x3a3f7b(0x120)}];export function validateExactId(_0x51d390){const _0xef268f=a116_0x3a3f7b,_0x421726=_0x51d390[_0xef268f(0x14b)]('id');if(!Number[_0xef268f(0x123)](_0x421726)||_0x421726<=0x0)throw CliErrors[_0xef268f(0x107)](_0xef268f(0x15e));return _0x421726;}export function validateSort(_0x114d35,_0x64c750=a116_0x3a3f7b(0x109)){const _0x544c25=a116_0x3a3f7b;if(!hasFlag(_0x114d35,_0x64c750))return undefined;const _0x42e5ae=_0x114d35['num'](_0x64c750);if(!Number[_0x544c25(0x123)](_0x42e5ae)||_0x42e5ae<0x0||_0x42e5ae>MAX_MENU_SORT)throw menuError(_0x544c25(0x10a),'--'+_0x64c750+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x544c25(0x148));return _0x42e5ae;}export function nextSiblingSort(_0x59fb41,_0xa80605,_0x31b8b5){const _0xaed73c=a116_0x3a3f7b,_0x5b20dc=getChildren(_0x59fb41,_0xa80605)[_0xaed73c(0x10b)](_0x26e460=>_0x26e460[_0xaed73c(0x109)])[_0xaed73c(0x10c)](_0xf7864=>typeof _0xf7864===_0xaed73c(0x108));if(_0x5b20dc[_0xaed73c(0x142)]===0x0)return 0x0;const _0x4f132f=Math['max'](..._0x5b20dc);if(_0x4f132f>=MAX_MENU_SORT)throw menuError(_0xaed73c(0x10d),'Cannot\x20append\x20a\x20'+_0x31b8b5+'\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20'+_0x4f132f+'.',_0xaed73c(0x15f)+MAX_MENU_SORT+',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.');return _0x4f132f+0x1;}export function requireExplicitYes(_0x40ae4a){const _0x39707a=a116_0x3a3f7b;if(_0x40ae4a[_0x39707a(0x161)](_0x39707a(0x14a)))return;if(!_0x40ae4a[_0x39707a(0x161)](_0x39707a(0x132)))throw menuError(_0x39707a(0x105),'This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.',_0x39707a(0x101));}export async function fetchMutationSnapshot(_0x50f640,_0x7bc79a,_0x55fddc){const _0x2a85a6=a116_0x3a3f7b;try{return await fetchMenuSnapshot(_0x50f640[_0x2a85a6(0x14f)],_0x50f640[_0x2a85a6(0x137)]);}catch(_0x410221){throw mapMenuApiError(_0x410221,_0x2a85a6(0x163)+_0x7bc79a,_0x55fddc);}}export async function recheckMutationSnapshot(_0x2d497e,_0x38ccf1,_0xba4748,_0x46a9e0){const _0x2097e9=a116_0x3a3f7b;let _0x4b8e20;try{_0x4b8e20=await fetchMenuSnapshot(_0x2d497e[_0x2097e9(0x14f)],_0x2d497e[_0x2097e9(0x137)]);}catch(_0x5d682e){const _0x15861a=mapMenuApiError(_0x5d682e,_0x2097e9(0x145)+_0xba4748,_0x46a9e0);throw menuFailure(_0x15861a,_0x38ccf1,{'stage':_0x2097e9(0x151),'failed':_0x46a9e0==null?{}:{'id':_0x46a9e0}});}if(_0x4b8e20[_0x2097e9(0x121)]!==_0x38ccf1[_0x2097e9(0x117)]){const _0xf02bd2=menuError('menu_state_drift',_0x2097e9(0x11d)+_0xba4748+_0x2097e9(0x12f),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.');throw menuFailure(_0xf02bd2,_0x38ccf1,{'stage':_0x2097e9(0x151),'failed':{..._0x46a9e0==null?{}:{'id':_0x46a9e0},'expectedSnapshotHash':_0x38ccf1[_0x2097e9(0x117)],'currentSnapshotHash':_0x4b8e20[_0x2097e9(0x121)]}});}return _0x4b8e20;}function a116_0x4435(_0x5546d7,_0x3160e1){_0x5546d7=_0x5546d7-0xfe;const _0x299e9e=a116_0x299e();let _0x44356a=_0x299e9e[_0x5546d7];return _0x44356a;}function a116_0x299e(){const _0x55ab9f=['hint','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','path','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','failed','snapshotHash','Sibling\x20sort\x20value\x20(non-negative\x20integer)','code','root','parentId','string','Online\x20menu\x20state\x20changed\x20before\x20','expect-parent-id','141410XtdhJA','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','hash','selector','isSafeInteger','verification','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','rawFlags','get','10YhnXPk','succeeded','expect-path','deleteOrder','\x20is\x20type\x20\x22','warnings',',\x20current\x20',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','type','\x20parent\x20changed:\x20expected\x20','yes','2788504rXksKf','after','before','byId','cookie','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','backend','menu_mutation_failed','planFile','toLowerCase','menu_not_found','stage','parent-id','37992930BLsQUJ','\x22,\x20not\x20folder.','length','test','message','recheck\x20online\x20menu\x20facts\x20before\x20','280gwdVZV','\x20menu\x20','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','menu_verification_failed','dry-run','num','Exact\x20online\x20menu\x20id','folder','operation','appCode','targets','pre-write-recheck','8536JQCEMB','Menu\x20','menu_permission_denied','str','\x20child\x20count\x20changed:\x20expected\x20','required','expected-children-count','1113vqiJgx','error','stringify','childrenCount','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','Reorder\x20sibling\x20menus\x20below\x20','dryRun','bool','hasOwnProperty','read\x20online\x20menu\x20facts\x20before\x20','2770806uJOJFn','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','call','defineProperty','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','254656sAOpsI','cascade','8837244RoyMjI','menu_confirmation_required','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','validation','number','sort','menu_sort_invalid','map','filter','menu_sort_overflow','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','api_error','menu_parent_not_folder'];a116_0x299e=function(){return _0x55ab9f;};return a116_0x299e();}export function parseParentId(_0x3dce37,_0x3ff5fa,_0x33b587={}){const _0x2810dc=a116_0x3a3f7b;if(!hasFlag(_0x3dce37,_0x3ff5fa)){if(_0x33b587[_0x2810dc(0x157)])throw CliErrors['flagMissing'](_0x3ff5fa);return undefined;}const _0x41e887=_0x3dce37[_0x2810dc(0x155)](_0x3ff5fa)['trim']();if(_0x41e887[_0x2810dc(0x13c)]()===_0x2810dc(0x11a))return null;if(!/^\d+$/['test'](_0x41e887))throw CliErrors['validation']('--'+_0x3ff5fa+_0x2810dc(0x112));const _0x360f5e=Number(_0x41e887);if(!Number['isSafeInteger'](_0x360f5e)||_0x360f5e<=0x0)throw CliErrors['validation']('--'+_0x3ff5fa+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');return _0x360f5e;}export function requireMenu(_0x5190dc,_0x1ef4ca){const _0x40ea30=a116_0x3a3f7b,_0x16046a=_0x5190dc[_0x40ea30(0x136)][_0x40ea30(0x127)](_0x1ef4ca);if(!_0x16046a)throw menuError(_0x40ea30(0x13d),'Online\x20menu\x20not\x20found:\x20'+_0x1ef4ca,_0x40ea30(0x15d));return _0x16046a;}export function requireFolder(_0x1f6e43,_0x3122e8){const _0x226c9a=a116_0x3a3f7b,_0x228a6b=requireMenu(_0x1f6e43,_0x3122e8);if(_0x228a6b[_0x226c9a(0x130)]!==_0x226c9a(0x14d))throw menuError(_0x226c9a(0x110),_0x226c9a(0x153)+_0x3122e8+_0x226c9a(0x12c)+(_0x228a6b[_0x226c9a(0x130)]||'unknown')+_0x226c9a(0x141),'Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.');return _0x228a6b;}export function assertExpectedState(_0x151ee0,_0x1e07fa){const _0x340a88=a116_0x3a3f7b;if(hasFlag(_0x151ee0,'expect-parent-id')){const _0x37337e=parseParentId(_0x151ee0,_0x340a88(0x11e),{'required':!![]});if(_0x1e07fa['parentId']!==_0x37337e)throw stateDrift('Menu\x20'+_0x1e07fa['id']+_0x340a88(0x131)+formatParent(_0x37337e)+_0x340a88(0x12e)+formatParent(_0x1e07fa[_0x340a88(0x11b)])+'.');}if(hasFlag(_0x151ee0,_0x340a88(0x12a))){const _0x10b1a6=_0x151ee0[_0x340a88(0x155)](_0x340a88(0x12a));if(_0x1e07fa[_0x340a88(0x114)]!==_0x10b1a6)throw stateDrift(_0x340a88(0x153)+_0x1e07fa['id']+'\x20path\x20changed:\x20expected\x20'+JSON[_0x340a88(0x15b)](_0x10b1a6)+_0x340a88(0x12e)+JSON[_0x340a88(0x15b)](_0x1e07fa[_0x340a88(0x114)])+'.');}if(hasFlag(_0x151ee0,_0x340a88(0x158))){const _0x292cdd=_0x151ee0[_0x340a88(0x14b)]('expected-children-count');if(!Number[_0x340a88(0x123)](_0x292cdd)||_0x292cdd<0x0)throw CliErrors['validation'](_0x340a88(0x138));if(_0x1e07fa[_0x340a88(0x15c)]!==_0x292cdd)throw stateDrift(_0x340a88(0x153)+_0x1e07fa['id']+_0x340a88(0x156)+_0x292cdd+_0x340a88(0x12e)+_0x1e07fa['childrenCount']+'.');}}export function assertVerified(_0x32ddd8,_0x16e7cd,_0x3eb082=a116_0x3a3f7b(0x115)){const _0x1e38b9=a116_0x3a3f7b;if(!_0x32ddd8)throw menuError(_0x1e38b9(0x149),_0x16e7cd,_0x3eb082);}export function mutationResult(_0x5956f6){const _0x395d47=a116_0x3a3f7b;return{'operation':_0x5956f6[_0x395d47(0x14e)],'selector':_0x5956f6[_0x395d47(0x122)],'before':_0x5956f6[_0x395d47(0x135)],'after':_0x5956f6['after'],'dryRun':_0x5956f6[_0x395d47(0x160)],'backend':_0x5956f6[_0x395d47(0x139)],..._0x5956f6['plannedActions']?{'plannedActions':_0x5956f6['plannedActions']}:{},..._0x5956f6['targets']?{'targets':_0x5956f6[_0x395d47(0x150)]}:{},..._0x5956f6[_0x395d47(0x12b)]?{'deleteOrder':_0x5956f6[_0x395d47(0x12b)]}:{},'snapshotHash':_0x5956f6[_0x395d47(0x117)],..._0x5956f6[_0x395d47(0x103)]?{'cascade':_0x5956f6['cascade']}:{},..._0x5956f6[_0x395d47(0x13b)]?{'planFile':_0x5956f6[_0x395d47(0x13b)]}:{},'succeeded':_0x5956f6[_0x395d47(0x129)]??[],'failed':_0x5956f6[_0x395d47(0x116)]??[],'warnings':_0x5956f6['warnings']??[],'verification':_0x5956f6[_0x395d47(0x124)],'error':_0x5956f6[_0x395d47(0x15a)]};}export function menuDryRunResult(_0x256871,_0x391f0e){return{..._0x256871,..._0x391f0e};}export function menuFailure(_0x3e7a67,_0x90d146,_0x272271){const _0x2cb00b=a116_0x3a3f7b,_0x204814=mutationResult({..._0x90d146,'after':_0x272271[_0x2cb00b(0x134)]===undefined?_0x90d146['after']:_0x272271[_0x2cb00b(0x134)],'backend':_0x272271['backend']??_0x90d146['backend'],'dryRun':![],'succeeded':_0x272271[_0x2cb00b(0x129)]??[],'failed':[{..._0x272271[_0x2cb00b(0x116)]??{},'stage':_0x272271[_0x2cb00b(0x13e)],'code':_0x3e7a67['code'],'message':_0x3e7a67[_0x2cb00b(0x144)]}],'warnings':[..._0x90d146[_0x2cb00b(0x12d)],..._0x272271[_0x2cb00b(0x12d)]??[]],'verification':_0x272271[_0x2cb00b(0x124)],'error':{'code':_0x3e7a67[_0x2cb00b(0x119)],'message':_0x3e7a67[_0x2cb00b(0x144)],..._0x3e7a67[_0x2cb00b(0x111)]?{'hint':_0x3e7a67[_0x2cb00b(0x111)]}:{}}});return Object[_0x2cb00b(0x100)](_0x3e7a67,'data',{'value':_0x204814,'enumerable':!![],'configurable':!![]}),_0x3e7a67;}export function asVerificationError(_0x191006,_0x30cba1){const _0x371f7b=a116_0x3a3f7b;if(_0x191006 instanceof CliError&&_0x191006[_0x371f7b(0x119)]==='menu_verification_failed')return _0x191006;const _0x7cb42c=_0x191006 instanceof Error?_0x191006[_0x371f7b(0x144)]:String(_0x191006);return menuError(_0x371f7b(0x149),''+_0x30cba1+(_0x7cb42c?':\x20'+_0x7cb42c:''),_0x371f7b(0x10e));}export function describeMenuErrorCause(_0x2047a2,_0x503db2,_0x14716d){const _0x232998=a116_0x3a3f7b,_0xfa9f62=mapMenuApiError(_0x2047a2,_0x503db2,_0x14716d);return{'causeCode':_0xfa9f62[_0x232998(0x119)],'causeMessage':_0xfa9f62['message']};}export function hasFlag(_0x3011ed,_0x131711){const _0x708a05=a116_0x3a3f7b;return Object['prototype'][_0x708a05(0x162)][_0x708a05(0xff)](_0x3011ed[_0x708a05(0x126)],_0x131711)&&_0x3011ed[_0x708a05(0x126)][_0x131711]!==undefined;}export function toApiParentId(_0x4ab18e){return _0x4ab18e??0x0;}export function formatParent(_0x3c601a){const _0x4f9f30=a116_0x3a3f7b;return _0x3c601a==null?_0x4f9f30(0x11a):String(_0x3c601a);}export function menuError(_0xdc19ed,_0x478812,_0xf5688b){return new CliError(_0xdc19ed,0x1,_0x478812,_0xf5688b);}export function mapMenuApiError(_0x12faac,_0x482d89,_0x32aa3b){const _0x32a16c=a116_0x3a3f7b;if(_0x12faac instanceof CliError&&_0x12faac['code']!==_0x32a16c(0x10f))return _0x12faac;const _0x47cc24=_0x12faac instanceof Error?_0x12faac['message']:String(_0x12faac);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x32a16c(0x143)](_0x47cc24))return menuError(_0x32a16c(0x154),'Permission\x20denied\x20while\x20attempting\x20to\x20'+_0x482d89+(_0x32aa3b?'\x20menu\x20'+_0x32aa3b:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x32a16c(0x13a),'Failed\x20to\x20'+_0x482d89+(_0x32aa3b?_0x32a16c(0x147)+_0x32aa3b:'')+':\x20'+_0x47cc24,_0x32a16c(0x125));}function stateDrift(_0x41f2f6){const _0x24d45b=a116_0x3a3f7b;return menuError('menu_state_drift',_0x41f2f6,_0x24d45b(0xfe));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x9afe3e,_0xa5c8a4){const _0xb12b14=a117_0x25d8,_0xa2a9a2=_0x9afe3e();while(!![]){try{const _0x3da5ce=-parseInt(_0xb12b14(0x1fd))/0x1*(-parseInt(_0xb12b14(0x1e3))/0x2)+-parseInt(_0xb12b14(0x200))/0x3*(-parseInt(_0xb12b14(0x1f9))/0x4)+-parseInt(_0xb12b14(0x201))/0x5*(-parseInt(_0xb12b14(0x202))/0x6)+-parseInt(_0xb12b14(0x1fb))/0x7*(-parseInt(_0xb12b14(0x1eb))/0x8)+-parseInt(_0xb12b14(0x204))/0x9*(parseInt(_0xb12b14(0x203))/0xa)+parseInt(_0xb12b14(0x1f2))/0xb+-parseInt(_0xb12b14(0x1f0))/0xc;if(_0x3da5ce===_0xa5c8a4)break;else _0xa2a9a2['push'](_0xa2a9a2['shift']());}catch(_0x5e9df7){_0xa2a9a2['push'](_0xa2a9a2['shift']());}}}(a117_0xf586,0xba8b8));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a117_0x40c973,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x46ad61,_0x26fd78){const _0x23e244=a117_0x25d8,_0x1380b5=getEnv();logger['info']('get-online-menu-list',isProduction(_0x1380b5)?_0x23e244(0x207)+_0x46ad61+')':'Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20'+_0x46ad61+')');const _0x4866d2=await fetchMenuSnapshot(_0x46ad61,_0x26fd78,{'verbose':!![]});return logger[_0x23e244(0x1e9)](_0x23e244(0x1ed),_0x23e244(0x1f5)+_0x4866d2[_0x23e244(0x208)]+'\x20online\x20menus\x20successfully'),_0x4866d2['menus']['map'](toProcessedMenuItem);}function a117_0x25d8(_0x42c30a,_0x2174a4){_0x42c30a=_0x42c30a-0x1e3;const _0xf586b0=a117_0xf586();let _0x25d807=_0xf586b0[_0x42c30a];return _0x25d807;}function a117_0xf586(){const _0xba84bf=['Creating\x20menu:\x20','Start\x20batch\x20menu\x20creation,\x20total\x20','all','2722lOPwmQ','map','import','\x20menu','Create\x20menu\x20\x22','stringify','info','update-menu-cdn-url','111856UJfLnZ','procode','get-online-menu-list','label','Delete\x20','33193608dyXWYV','create-menu','10765315kRYqQv','loadScriptMode','Updating\x20menu\x20asset\x20links:\x20','Fetched\x20','Regroup\x20','create-menus','Batch\x20menu\x20creation\x20completed,\x20total\x20','100iXXYBv','menuGroups','658edtNqI','Menu\x20assets\x20synced:\x20','1116VDPZEg','resources','\x20menu\x20group(s)','41997CsQSCP','18195HQHHYJ','1434BhQqin','10RcGXKY','13511907tsmyhU','length','Menu\x20created\x20successfully:\x20','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','total','Update\x20menu\x20','path','Update\x20menu\x20assets\x20\x22'];a117_0xf586=function(){return _0xba84bf;};return a117_0xf586();}export async function createMenu(_0xb954b8,_0x4a4157,_0x25906f){const _0x1b4b85=a117_0x25d8;logger[_0x1b4b85(0x1e9)]('create-menu',_0x1b4b85(0x20c)+_0x25906f[_0x1b4b85(0x1ee)]+'\x20('+_0x25906f[_0x1b4b85(0x20a)]+')');const _0x394f28={'appCode':_0xb954b8,'type':_0x1b4b85(0x1ec),'sort':0x0,'extend':{'loadScriptMode':_0x1b4b85(0x1e5),'resources':_0x25906f[_0x1b4b85(0x1fe)]?JSON['stringify'](_0x25906f[_0x1b4b85(0x1fe)]):undefined},..._0x25906f},_0x77effe=await createMenuRecord(_0x394f28,_0x4a4157,_0x1b4b85(0x1e7)+_0x25906f[_0x1b4b85(0x1ee)]+'\x22');return logger['info'](_0x1b4b85(0x1f1),_0x1b4b85(0x206)+_0x25906f['label']),_0x77effe;}async function createSingleMenu(_0xfad6c7,_0x407235,_0x54c2c7,_0x25d47b){const _0x4c2de6=a117_0x25d8,_0xbec4d={'appCode':_0xfad6c7,'type':'procode','sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x25d47b?JSON[_0x4c2de6(0x1e8)](_0x25d47b):undefined},'label':_0x54c2c7[_0x4c2de6(0x1ee)],'path':_0x54c2c7[_0x4c2de6(0x20a)]},_0x8df3c6=await createMenuRecord(_0xbec4d,_0x407235,'Create\x20menu\x20\x22'+_0x54c2c7[_0x4c2de6(0x1ee)]+'\x22');return logger[_0x4c2de6(0x1e9)]('create-menu',_0x4c2de6(0x206)+_0x54c2c7['label']),_0x8df3c6;}export async function createMenus(_0x11394d,_0x1b7cb9,_0x205481,_0xabfef9){const _0x4e47e6=a117_0x25d8;logger[_0x4e47e6(0x1e9)](_0x4e47e6(0x1f7),_0x4e47e6(0x20d)+_0x205481[_0x4e47e6(0x205)]);const _0x185c94=await Promise[_0x4e47e6(0x20e)](_0x205481[_0x4e47e6(0x1e4)](_0x662a34=>createSingleMenu(_0x11394d,_0x1b7cb9,_0x662a34,_0xabfef9)));return logger[_0x4e47e6(0x1e9)]('create-menus',_0x4e47e6(0x1f8)+_0x205481[_0x4e47e6(0x205)]),_0x185c94;}export async function updateMenuCdnUrl(_0x541449,_0x2b5ca7,_0x43dfe6){const _0x3fed11=a117_0x25d8;logger[_0x3fed11(0x1e9)]('update-menu-cdn-url',_0x3fed11(0x1f4)+_0x43dfe6[_0x3fed11(0x1ee)]+'\x20('+_0x43dfe6['path']+')');const _0x251ddd={'id':_0x43dfe6['id'],'appCode':_0x541449,'extend':{..._0x43dfe6['extend']??{},..._0x43dfe6[_0x3fed11(0x1f3)]?{'loadScriptMode':_0x43dfe6[_0x3fed11(0x1f3)]}:{},'resources':_0x43dfe6[_0x3fed11(0x1fe)]?JSON[_0x3fed11(0x1e8)](_0x43dfe6[_0x3fed11(0x1fe)]):undefined}},_0x203417=await updateMenuRecord(_0x251ddd,_0x2b5ca7,_0x3fed11(0x20b)+_0x43dfe6[_0x3fed11(0x1ee)]+'\x22');return logger[_0x3fed11(0x1e9)](_0x3fed11(0x1ea),_0x3fed11(0x1fc)+_0x43dfe6[_0x3fed11(0x1ee)],undefined),_0x203417;}export async function createMenuEntity(_0x2b3b43,_0x1c6c49,_0x5297fe){const _0x223f83=a117_0x25d8;return createMenuRecord({'appCode':_0x2b3b43,..._0x5297fe},_0x1c6c49,_0x223f83(0x1e7)+_0x5297fe[_0x223f83(0x1ee)]+'\x22');}export async function updateMenuEntity(_0x55ab71,_0x464466,_0x2aec83){const _0x47589e=a117_0x25d8;return updateMenuRecord({'appCode':_0x55ab71,..._0x2aec83},_0x464466,_0x47589e(0x209)+_0x2aec83['id']);}export async function batchDeleteMenuEntities(_0x54dd8f,_0x5d0fc6){const _0x1fa258=a117_0x25d8;return batchDeleteMenuRecords(_0x5d0fc6,_0x54dd8f,_0x1fa258(0x1ef)+_0x5d0fc6[_0x1fa258(0x205)]+_0x1fa258(0x1e6)+(_0x5d0fc6[_0x1fa258(0x205)]===0x1?'':'s'));}export async function startMenuRegroup(_0x11d52a,_0x250761){const _0x4aa8d6=a117_0x25d8;return a117_0x40c973(_0x250761,_0x11d52a,_0x4aa8d6(0x1f6)+_0x250761[_0x4aa8d6(0x1fa)][_0x4aa8d6(0x205)]+_0x4aa8d6(0x1ff));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a118_0xb9de51=a118_0x14ae;(function(_0x31e81e,_0x42fd34){const _0x103eb6=a118_0x14ae,_0x2e7c8d=_0x31e81e();while(!![]){try{const _0x4edfbe=parseInt(_0x103eb6(0x14d))/0x1*(parseInt(_0x103eb6(0x171))/0x2)+parseInt(_0x103eb6(0x167))/0x3+-parseInt(_0x103eb6(0x150))/0x4+-parseInt(_0x103eb6(0x16b))/0x5+-parseInt(_0x103eb6(0x143))/0x6*(parseInt(_0x103eb6(0x156))/0x7)+-parseInt(_0x103eb6(0x148))/0x8*(-parseInt(_0x103eb6(0x165))/0x9)+parseInt(_0x103eb6(0x14e))/0xa;if(_0x4edfbe===_0x42fd34)break;else _0x2e7c8d['push'](_0x2e7c8d['shift']());}catch(_0x384671){_0x2e7c8d['push'](_0x2e7c8d['shift']());}}}(a118_0x3899,0xa601b));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';const MENU_SYNC_PARAM_KEYS=new Set([a118_0xb9de51(0x16a),a118_0xb9de51(0x149)]);function a118_0x3899(){const _0x5e7f5d=['push','17ciUptg','2510450VCFOHY','path','4705580LZfnKP','pages','Invalid\x20--params:\x20','join','\x0a\x20\x20Available\x20local\x20paths:\x20','string','457191ApBRKA','trim','dryRun','map','keys','message','--params.','info','object','has','setLogPath','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','length','No\x20local\x20pages\x20matched\x20paths:\x20','1747899UZjiTR','CSS\x20URL\x20is\x20unreachable:\x20','896004MNsMaq','Invalid\x20--params.','parse','jsUrl','2516920GRpgrm','procode','Menu\x20sync\x20completed','import','menu-sync','cwd','152490IAYjmo','42NIlBvb',':\x20expected\x20a\x20non-empty\x20string.','Start\x20non-interactive\x20menu\x20sync','filter','isArray','40pnboTX','cssUrl','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','Invalid\x20--params\x20JSON.'];a118_0x3899=function(){return _0x5e7f5d;};return a118_0x3899();}function validateParams(_0x2441b3){const _0x5a5f43=a118_0xb9de51,_0x1fc03c=[];return _0x2441b3[_0x5a5f43(0x16a)]&&!isValidJsHttpsUrl(_0x2441b3['jsUrl'])&&_0x1fc03c[_0x5a5f43(0x14c)]({'field':'jsUrl','message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x2441b3[_0x5a5f43(0x149)]&&!isValidCssHttpsUrl(_0x2441b3[_0x5a5f43(0x149)])&&_0x1fc03c['push']({'field':_0x5a5f43(0x149),'message':_0x5a5f43(0x14a)}),_0x1fc03c;}function a118_0x14ae(_0x52bb39,_0xbb4c4f){_0x52bb39=_0x52bb39-0x143;const _0x38999e=a118_0x3899();let _0x14ae67=_0x38999e[_0x52bb39];return _0x14ae67;}export async function runMenuSyncCore(_0x30695f,_0x3190a5,_0x189758=[],_0x13fead,_0x3eba21={}){const _0x27b8a3=a118_0xb9de51,_0x596b05=parseMenuSyncParams(_0x13fead),_0x3748c0=[...new Set(_0x189758[_0x27b8a3(0x159)](_0xca74c9=>_0xca74c9[_0x27b8a3(0x157)]())[_0x27b8a3(0x146)](Boolean))],_0x2d46a2=_0x596b05['jsUrl'],_0x217007=_0x596b05[_0x27b8a3(0x149)],_0x59e01b=[];if(_0x2d46a2)_0x59e01b[_0x27b8a3(0x14c)](_0x2d46a2);if(_0x217007)_0x59e01b[_0x27b8a3(0x14c)](_0x217007);const _0x5efee8=validateParams(_0x596b05);if(_0x5efee8['length']>0x0){const _0x4c1394=_0x5efee8[_0x27b8a3(0x159)](_0x4b4e06=>_0x27b8a3(0x15c)+_0x4b4e06['field']+':\x20'+_0x4b4e06[_0x27b8a3(0x15b)])[_0x27b8a3(0x153)](';\x20');throw new Error(_0x27b8a3(0x152)+_0x4c1394);}logger[_0x27b8a3(0x160)](process[_0x27b8a3(0x170)]()),logger[_0x27b8a3(0x15d)](_0x27b8a3(0x16f),_0x27b8a3(0x145),{'appCode':_0x30695f,'selectedCount':_0x3748c0[_0x27b8a3(0x163)],'jsUrl':_0x2d46a2,'cssUrl':_0x217007});if(_0x2d46a2){const _0x3aa9b0=await isUrlReachable(_0x2d46a2);if(!_0x3aa9b0)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x2d46a2);}if(_0x217007){const _0x3dd640=await isUrlReachable(_0x217007);if(!_0x3dd640)throw new Error(_0x27b8a3(0x166)+_0x217007);}const _0x3190c2=getLocalPages();if(_0x3190c2['length']===0x0){if(_0x3748c0[_0x27b8a3(0x163)]>0x0)throw new Error(_0x27b8a3(0x164)+_0x3748c0[_0x27b8a3(0x153)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x3eba21[_0x27b8a3(0x158)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x3f28fc=await getOnlineMenuList(_0x30695f,_0x3190a5),_0x5436f2=new Set(_0x3f28fc['map'](_0x244224=>_0x244224['path']));let _0x152b4f;if(_0x3748c0[_0x27b8a3(0x163)]>0x0){const _0x1baa83=new Map(_0x3190c2[_0x27b8a3(0x159)](_0x47e18e=>[_0x47e18e['path'],_0x47e18e])),_0x459644=_0x3748c0[_0x27b8a3(0x146)](_0x440fa2=>!_0x1baa83[_0x27b8a3(0x15f)](_0x440fa2));if(_0x459644[_0x27b8a3(0x163)]>0x0){const _0x15b1cb=_0x3190c2[_0x27b8a3(0x159)](_0xe8550a=>_0xe8550a[_0x27b8a3(0x14f)])[_0x27b8a3(0x153)](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x459644[_0x27b8a3(0x153)](',\x20')+_0x27b8a3(0x154)+_0x15b1cb);}const _0x5c3833=_0x3748c0[_0x27b8a3(0x146)](_0x4b39c4=>_0x5436f2[_0x27b8a3(0x15f)](_0x4b39c4));if(_0x5c3833['length']>0x0)throw new Error(_0x27b8a3(0x162)+_0x5c3833[_0x27b8a3(0x153)](',\x20'));_0x152b4f=_0x3748c0[_0x27b8a3(0x159)](_0x43e0a6=>_0x1baa83['get'](_0x43e0a6));}else _0x152b4f=_0x3190c2[_0x27b8a3(0x146)](_0x4af1aa=>!_0x5436f2[_0x27b8a3(0x15f)](_0x4af1aa[_0x27b8a3(0x14f)]));if(_0x152b4f[_0x27b8a3(0x163)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x3eba21['dryRun']===!![],'targetPages':[],'plannedMenus':[]};const _0x485e58=_0x152b4f[_0x27b8a3(0x159)](_0xe10cf=>({'type':_0x27b8a3(0x16c),'path':_0xe10cf[_0x27b8a3(0x14f)],'label':_0xe10cf['label'],'loadScriptMode':_0x27b8a3(0x16e),'resources':[..._0x59e01b]}));if(_0x3eba21['dryRun'])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x152b4f,'plannedMenus':_0x485e58};const _0x7c0b7e=await createMenus(_0x30695f,_0x3190a5,_0x152b4f,_0x59e01b[_0x27b8a3(0x163)]>0x0?_0x59e01b:undefined);return logger['info'](_0x27b8a3(0x16f),_0x27b8a3(0x16d),{'count':_0x152b4f['length'],'resources':_0x59e01b}),{'created':_0x7c0b7e[_0x27b8a3(0x163)],'skipped':![],'dryRun':![],'targetPages':_0x152b4f,'plannedMenus':_0x485e58,'menus':_0x7c0b7e};}export function parseMenuSyncParams(_0xef5a64){const _0x2db99f=a118_0xb9de51;if(!_0xef5a64||typeof _0xef5a64!=='string')return{};let _0x2310c0;try{_0x2310c0=JSON[_0x2db99f(0x169)](_0xef5a64);}catch{throw new Error(_0x2db99f(0x14b));}if(typeof _0x2310c0!==_0x2db99f(0x15e)||_0x2310c0===null||Array[_0x2db99f(0x147)](_0x2310c0))throw new Error(_0x2db99f(0x161));const _0x3dcece=_0x2310c0;if(Object['hasOwn'](_0x3dcece,_0x2db99f(0x151)))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x5f480a=Object[_0x2db99f(0x15a)](_0x3dcece)['filter'](_0x6cf646=>!MENU_SYNC_PARAM_KEYS['has'](_0x6cf646));if(_0x5f480a[_0x2db99f(0x163)]>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x5f480a['join'](',\x20')+'.');for(const _0x1ba905 of MENU_SYNC_PARAM_KEYS){const _0x55378a=_0x3dcece[_0x1ba905];if(_0x55378a!==undefined&&(typeof _0x55378a!=='string'||_0x55378a[_0x2db99f(0x157)]()===''))throw new Error(_0x2db99f(0x168)+_0x1ba905+_0x2db99f(0x144));}return{'jsUrl':typeof _0x3dcece[_0x2db99f(0x16a)]===_0x2db99f(0x155)?_0x3dcece[_0x2db99f(0x16a)][_0x2db99f(0x157)]():undefined,'cssUrl':typeof _0x3dcece[_0x2db99f(0x149)]===_0x2db99f(0x155)?_0x3dcece[_0x2db99f(0x149)][_0x2db99f(0x157)]():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x357da0,_0x3557d7){const _0x3455b1=a120_0x4de1,_0x14eb09=_0x357da0();while(!![]){try{const _0x58c0be=-parseInt(_0x3455b1(0x132))/0x1+-parseInt(_0x3455b1(0x108))/0x2*(-parseInt(_0x3455b1(0x114))/0x3)+parseInt(_0x3455b1(0x11e))/0x4+parseInt(_0x3455b1(0x112))/0x5+-parseInt(_0x3455b1(0x12d))/0x6*(-parseInt(_0x3455b1(0x113))/0x7)+-parseInt(_0x3455b1(0xf7))/0x8+-parseInt(_0x3455b1(0x117))/0x9;if(_0x58c0be===_0x3557d7)break;else _0x14eb09['push'](_0x14eb09['shift']());}catch(_0x347ad0){_0x14eb09['push'](_0x14eb09['shift']());}}}(a120_0x2ee3,0xbfa81));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x142146){const _0x4ad356=a120_0x4de1,_0x3b62c5=[];return _0x142146['jsUrl']&&!isValidJsHttpsUrl(_0x142146[_0x4ad356(0x12e)])&&_0x3b62c5[_0x4ad356(0x123)]({'field':_0x4ad356(0x12e),'message':_0x4ad356(0x104)}),_0x142146[_0x4ad356(0x10e)]&&!isValidCssHttpsUrl(_0x142146[_0x4ad356(0x10e)])&&_0x3b62c5[_0x4ad356(0x123)]({'field':_0x4ad356(0x10e),'message':_0x4ad356(0xf3)}),_0x3b62c5;}function a120_0x2ee3(){const _0x4a7a88=['with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','endsWith','\x20existing\x20JS\x20resources\x20for\x20\x22','push','paths','isArray','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','mode','status','string','selection','menu-update','extend','258RkumaO','jsUrl','toLowerCase','\x20existing\x20CSS\x20resources\x20for\x20\x22','message','216277yDnaIx','value','object','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','Invalid\x20--params:\x20menu\x20update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','loadScriptMode',').\x20','4122776thGNip','replace','menu\x20update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','JS\x20URL\x20is\x20unreachable:\x20','trim','map','menu\x20update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','.js','allSettled','info','patch','all','menu\x20update\x20cannot\x20patch\x20','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','unshift','label','332030HYNDDO','join','fulfilled','length','.\x20Allowed\x20values:\x20replace,\x20patch','some','cssUrl','menuIds','Invalid\x20--mode:\x20','resources','1390085ppaGIX','4991LgccFx','21UFzoHn','filter','parse','6562251ubNVwH','cwd','path','--params.','setLogPath','Start\x20non-interactive\x20menu\x20update','dryRun','3100028ClWwxX','\x22\x20('];a120_0x2ee3=function(){return _0x4a7a88;};return a120_0x2ee3();}export async function runMenuUpdateCore(_0x3f7371,_0x596717,_0x42b71b,_0x226931={}){const _0xfb0ef7=a120_0x4de1,_0x31c31d=parseUpdateParamsFlag(_0x42b71b),_0x3333fc=normalizeMode(_0x226931[_0xfb0ef7(0x127)]);validateSelection(_0x226931[_0xfb0ef7(0x12a)]);const _0x5dd467=[];if(_0x31c31d[_0xfb0ef7(0x12e)])_0x5dd467[_0xfb0ef7(0x123)](_0x31c31d[_0xfb0ef7(0x12e)]);if(_0x31c31d['cssUrl'])_0x5dd467[_0xfb0ef7(0x123)](_0x31c31d[_0xfb0ef7(0x10e)]);const _0x2104a7=validateParams(_0x31c31d);if(_0x2104a7[_0xfb0ef7(0x10b)]>0x0){const _0x4b0020=_0x2104a7[_0xfb0ef7(0xfc)](_0x5521ee=>_0xfb0ef7(0x11a)+_0x5521ee['field']+':\x20'+_0x5521ee[_0xfb0ef7(0x131)])[_0xfb0ef7(0x109)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x4b0020);}if(_0x5dd467[_0xfb0ef7(0x10b)]===0x0)throw new Error(_0xfb0ef7(0xf4)+_0xfb0ef7(0x105));logger[_0xfb0ef7(0x11b)](process[_0xfb0ef7(0x118)]()),logger[_0xfb0ef7(0x100)](_0xfb0ef7(0x12b),_0xfb0ef7(0x11c),{'appCode':_0x3f7371,'jsUrl':_0x31c31d['jsUrl'],'cssUrl':_0x31c31d['cssUrl'],'mode':_0x3333fc,'dryRun':_0x226931[_0xfb0ef7(0x11d)]===!![]});if(_0x31c31d[_0xfb0ef7(0x12e)]){const _0x41359b=await isUrlReachable(_0x31c31d[_0xfb0ef7(0x12e)]);if(!_0x41359b)throw new Error(_0xfb0ef7(0xfa)+_0x31c31d[_0xfb0ef7(0x12e)]);}if(_0x31c31d[_0xfb0ef7(0x10e)]){const _0x350f44=await isUrlReachable(_0x31c31d[_0xfb0ef7(0x10e)]);if(!_0x350f44)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x31c31d[_0xfb0ef7(0x10e)]);}const _0x1add2d=await getOnlineMenuList(_0x3f7371,_0x596717),_0x4754b6=_0x1add2d[_0xfb0ef7(0x115)](_0x39c1bd=>_0x39c1bd[_0xfb0ef7(0x111)]['length']>0x0),_0x4a143a=selectMenusForUpdate(_0x4754b6,_0x226931['selection']);if(_0x4a143a[_0xfb0ef7(0x10b)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x226931['dryRun']===!![]};const _0x3eb5a8=_0x4a143a[_0xfb0ef7(0xfc)](_0x2456c1=>buildMenuUpdateDiff(_0x2456c1,_0x31c31d,_0x3333fc,_0x226931['force']===!![],_0x226931['loadScriptMode']));if(_0x226931['dryRun'])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x3eb5a8};const _0x32aa51=await Promise[_0xfb0ef7(0xff)](_0x4a143a[_0xfb0ef7(0xfc)]((_0x2d607e,_0x2a6880)=>updateMenuCdnUrl(_0x3f7371,_0x596717,{'id':_0x2d607e['id'],'label':_0x2d607e[_0xfb0ef7(0x107)],'path':_0x2d607e['path'],'resources':_0x3eb5a8[_0x2a6880]['after'][_0xfb0ef7(0x111)],'extend':_0x2d607e[_0xfb0ef7(0x12c)]??null,'loadScriptMode':_0x226931[_0xfb0ef7(0xf5)]}))),_0xca127f=_0x32aa51[_0xfb0ef7(0x115)](_0x59c077=>_0x59c077[_0xfb0ef7(0x128)]===_0xfb0ef7(0x10a))[_0xfb0ef7(0xfc)](_0x31192d=>_0x31192d[_0xfb0ef7(0xf1)]),_0x2acf27=_0x32aa51['filter'](_0xb1bdc3=>_0xb1bdc3[_0xfb0ef7(0x128)]==='rejected')[_0xfb0ef7(0x10b)];return logger[_0xfb0ef7(0x100)]('menu-update','Menu\x20update\x20completed',{'count':_0x4a143a[_0xfb0ef7(0x10b)],'resources':_0x5dd467}),{'updated':_0xca127f[_0xfb0ef7(0x10b)],'failed':_0x2acf27,'skipped':![],'menus':_0xca127f};}function validateSelection(_0x9f7b52){const _0x2262fe=a120_0x4de1;if(!_0x9f7b52)throw new Error(_0x2262fe(0xf9));if(_0x9f7b52[_0x2262fe(0x102)]&&(_0x9f7b52[_0x2262fe(0x10f)][_0x2262fe(0x10b)]>0x0||_0x9f7b52['paths'][_0x2262fe(0x10b)]>0x0))throw new Error('--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.');if(!_0x9f7b52['all']&&_0x9f7b52[_0x2262fe(0x10f)][_0x2262fe(0x10b)]===0x0&&_0x9f7b52[_0x2262fe(0x124)]['length']===0x0)throw new Error('menu\x20update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x178340,_0x4cb89b){const _0x1101b8=a120_0x4de1;validateSelection(_0x4cb89b);if(_0x4cb89b[_0x1101b8(0x102)])return _0x178340;const _0x74c525=new Set(_0x178340[_0x1101b8(0xfc)](_0x4898bb=>_0x4898bb['id'])),_0x354e45=new Set(_0x178340['map'](_0x109e35=>_0x109e35[_0x1101b8(0x119)])),_0xe27032=_0x4cb89b[_0x1101b8(0x10f)][_0x1101b8(0x115)](_0x2ed021=>!_0x74c525['has'](_0x2ed021)),_0x26703e=_0x4cb89b[_0x1101b8(0x124)][_0x1101b8(0x115)](_0x67f6e=>!_0x354e45['has'](_0x67f6e));if(_0xe27032['length']>0x0||_0x26703e[_0x1101b8(0x10b)]>0x0){const _0x480d32=[..._0xe27032[_0x1101b8(0xfc)](_0x3639df=>String(_0x3639df)),..._0x26703e][_0x1101b8(0x109)](',\x20');throw new Error('menu\x20update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x480d32);}const _0x3cab98=new Set(_0x4cb89b[_0x1101b8(0x10f)]),_0x45714e=new Set(_0x4cb89b[_0x1101b8(0x124)]);return _0x178340['filter'](_0x51eafc=>_0x3cab98['has'](_0x51eafc['id'])||_0x45714e['has'](_0x51eafc['path']));}function normalizeMode(_0x28c564){const _0x4b7f63=a120_0x4de1;if(!_0x28c564)return _0x4b7f63(0x101);if(_0x28c564===_0x4b7f63(0xf8)||_0x28c564===_0x4b7f63(0x101))return _0x28c564;throw new Error(_0x4b7f63(0x110)+_0x28c564+_0x4b7f63(0x10c));}function buildMenuUpdateDiff(_0x58f665,_0x3a9f5e,_0x16d95e,_0x40c28f,_0x4689b9){const _0x3b81fd=a120_0x4de1,_0x245118=[..._0x58f665[_0x3b81fd(0x111)]];_0x16d95e==='patch'&&assertUnambiguousPatchResources(_0x58f665,_0x245118,_0x3a9f5e);const _0x1cde75=_0x16d95e===_0x3b81fd(0x101)?patchResources(_0x245118,_0x3a9f5e):replaceResources(_0x3a9f5e),_0xbdb309=[],_0x13e5dd=_0x245118[_0x3b81fd(0x10d)](isJsResource),_0x5549a4=_0x1cde75[_0x3b81fd(0x10d)](isJsResource);if(_0x13e5dd&&!_0x5549a4){const _0x27f24f='menu\x20update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x58f665[_0x3b81fd(0x107)]+'\x22\x20('+_0x58f665[_0x3b81fd(0x119)]+_0x3b81fd(0xf6)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0x40c28f)throw new Error(_0x27f24f);_0xbdb309[_0x3b81fd(0x123)](_0x27f24f);}const _0x40340b=_0x245118[_0x3b81fd(0x10d)](isCssResource),_0x15ac83=_0x1cde75[_0x3b81fd(0x10d)](isCssResource);_0x40340b&&!_0x15ac83&&_0xbdb309[_0x3b81fd(0x123)](_0x3b81fd(0xfd)+_0x58f665['label']+_0x3b81fd(0x11f)+_0x58f665['path']+').');const _0x146abd=typeof _0x58f665[_0x3b81fd(0x12c)]?.[_0x3b81fd(0xf5)]==='string'?_0x58f665[_0x3b81fd(0x12c)][_0x3b81fd(0xf5)]:null,_0x2c764a=_0x4689b9?{'loadScriptMode':_0x146abd}:{},_0x54f451=_0x4689b9?{'loadScriptMode':_0x4689b9}:{};return{'id':_0x58f665['id'],'label':_0x58f665['label'],'path':_0x58f665['path'],'mode':_0x16d95e,'before':{'resources':_0x245118,..._0x2c764a},'after':{'resources':_0x1cde75,..._0x54f451},'warnings':_0xbdb309};}function replaceResources(_0x4a5886){const _0x4d6ef7=a120_0x4de1;return[_0x4a5886[_0x4d6ef7(0x12e)],_0x4a5886['cssUrl']][_0x4d6ef7(0x115)](_0x23415e=>!!_0x23415e);}function assertUnambiguousPatchResources(_0x2712a0,_0x390967,_0x55bfaa){const _0x46f614=a120_0x4de1,_0x2de01d=_0x390967[_0x46f614(0x115)](isJsResource)['length'];if(_0x55bfaa[_0x46f614(0x12e)]&&_0x2de01d>0x1)throw new Error(_0x46f614(0x103)+_0x2de01d+_0x46f614(0x122)+_0x2712a0['label']+_0x46f614(0x11f)+_0x2712a0[_0x46f614(0x119)]+')\x20'+_0x46f614(0x126));const _0x3fae49=_0x390967[_0x46f614(0x115)](isCssResource)[_0x46f614(0x10b)];if(_0x55bfaa[_0x46f614(0x10e)]&&_0x3fae49>0x1)throw new Error(_0x46f614(0x103)+_0x3fae49+_0x46f614(0x130)+_0x2712a0[_0x46f614(0x107)]+_0x46f614(0x11f)+_0x2712a0[_0x46f614(0x119)]+')\x20'+_0x46f614(0x120));}function patchResources(_0x393b7e,_0x39097c){const _0x350275=a120_0x4de1;let _0x8058cf=![],_0x419767=![];const _0x58902e=[];for(const _0x2f8d68 of _0x393b7e){if(isJsResource(_0x2f8d68)){if(_0x39097c['jsUrl']&&!_0x8058cf)_0x58902e[_0x350275(0x123)](_0x39097c['jsUrl']),_0x8058cf=!![];else!_0x39097c[_0x350275(0x12e)]&&_0x58902e[_0x350275(0x123)](_0x2f8d68);continue;}if(isCssResource(_0x2f8d68)){if(_0x39097c['cssUrl']&&!_0x419767)_0x58902e[_0x350275(0x123)](_0x39097c[_0x350275(0x10e)]),_0x419767=!![];else!_0x39097c[_0x350275(0x10e)]&&_0x58902e[_0x350275(0x123)](_0x2f8d68);continue;}_0x58902e['push'](_0x2f8d68);}return _0x39097c[_0x350275(0x12e)]&&!_0x8058cf&&_0x58902e[_0x350275(0x106)](_0x39097c[_0x350275(0x12e)]),_0x39097c[_0x350275(0x10e)]&&!_0x419767&&_0x58902e[_0x350275(0x123)](_0x39097c[_0x350275(0x10e)]),_0x58902e;}function isJsResource(_0x467503){const _0x470da1=a120_0x4de1;return stripQuery(_0x467503)[_0x470da1(0x12f)]()[_0x470da1(0x121)](_0x470da1(0xfe));}function a120_0x4de1(_0x41c98d,_0x52dddd){_0x41c98d=_0x41c98d-0xf1;const _0x2ee3a1=a120_0x2ee3();let _0x4de1d1=_0x2ee3a1[_0x41c98d];return _0x4de1d1;}function isCssResource(_0x45d549){const _0x2d2f96=a120_0x4de1;return stripQuery(_0x45d549)[_0x2d2f96(0x12f)]()[_0x2d2f96(0x121)]('.css');}function stripQuery(_0x1847d1){return _0x1847d1['split']('?')[0x0]??_0x1847d1;}function parseUpdateParamsFlag(_0x3b2f0b){const _0x3ddcea=a120_0x4de1;if(!_0x3b2f0b||typeof _0x3b2f0b!==_0x3ddcea(0x129))return{};try{const _0xb7f730=JSON[_0x3ddcea(0x116)](_0x3b2f0b);if(typeof _0xb7f730!==_0x3ddcea(0xf2)||_0xb7f730===null||Array[_0x3ddcea(0x125)](_0xb7f730))return{};return{'jsUrl':typeof _0xb7f730[_0x3ddcea(0x12e)]===_0x3ddcea(0x129)?_0xb7f730['jsUrl'][_0x3ddcea(0xfb)]():undefined,'cssUrl':typeof _0xb7f730[_0x3ddcea(0x10e)]===_0x3ddcea(0x129)?_0xb7f730[_0x3ddcea(0x10e)][_0x3ddcea(0xfb)]():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x4e36b5,_0x29a94f){const _0x2a8db7=a120_0x1e04,_0x4dfbe0=_0x4e36b5();while(!![]){try{const _0x2562db=parseInt(_0x2a8db7(0x125))/0x1+parseInt(_0x2a8db7(0x12c))/0x2+-parseInt(_0x2a8db7(0x124))/0x3*(-parseInt(_0x2a8db7(0x11e))/0x4)+-parseInt(_0x2a8db7(0x116))/0x5+-parseInt(_0x2a8db7(0x13d))/0x6*(-parseInt(_0x2a8db7(0x10c))/0x7)+parseInt(_0x2a8db7(0x108))/0x8+-parseInt(_0x2a8db7(0x132))/0x9*(parseInt(_0x2a8db7(0x101))/0xa);if(_0x2562db===_0x29a94f)break;else _0x4dfbe0['push'](_0x4dfbe0['shift']());}catch(_0x56a259){_0x4dfbe0['push'](_0x4dfbe0['shift']());}}}(a120_0x7e03,0xe9658));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x23639d){const _0x2d432e=a120_0x1e04,_0x1e2ce9=[];return _0x23639d[_0x2d432e(0x118)]&&!isValidJsHttpsUrl(_0x23639d[_0x2d432e(0x118)])&&_0x1e2ce9[_0x2d432e(0x137)]({'field':_0x2d432e(0x118),'message':_0x2d432e(0x134)}),_0x23639d['cssUrl']&&!isValidCssHttpsUrl(_0x23639d['cssUrl'])&&_0x1e2ce9[_0x2d432e(0x137)]({'field':_0x2d432e(0x126),'message':_0x2d432e(0x140)}),_0x1e2ce9;}export async function runMenuUpdateCore(_0x3d52dc,_0x48afdf,_0x50e0ee,_0x4559c2={}){const _0x5b1de9=a120_0x1e04,_0x2661a3=parseUpdateParamsFlag(_0x50e0ee),_0x677e61=normalizeMode(_0x4559c2[_0x5b1de9(0x13f)]);validateSelection(_0x4559c2['selection']);const _0x244558=[];if(_0x2661a3['jsUrl'])_0x244558[_0x5b1de9(0x137)](_0x2661a3['jsUrl']);if(_0x2661a3[_0x5b1de9(0x126)])_0x244558[_0x5b1de9(0x137)](_0x2661a3[_0x5b1de9(0x126)]);const _0x36d926=validateParams(_0x2661a3);if(_0x36d926['length']>0x0){const _0x46f79a=_0x36d926[_0x5b1de9(0xfd)](_0x496e2c=>_0x5b1de9(0x13c)+_0x496e2c[_0x5b1de9(0x138)]+':\x20'+_0x496e2c[_0x5b1de9(0xfc)])[_0x5b1de9(0x103)](';\x20');throw new Error(_0x5b1de9(0xfe)+_0x46f79a);}if(_0x244558[_0x5b1de9(0x12b)]===0x0)throw new Error(_0x5b1de9(0x13e)+_0x5b1de9(0x121));logger[_0x5b1de9(0x12a)](process['cwd']()),logger[_0x5b1de9(0x110)]('menu-update',_0x5b1de9(0x10e),{'appCode':_0x3d52dc,'jsUrl':_0x2661a3[_0x5b1de9(0x118)],'cssUrl':_0x2661a3[_0x5b1de9(0x126)],'mode':_0x677e61,'dryRun':_0x4559c2[_0x5b1de9(0x102)]===!![]});if(_0x2661a3[_0x5b1de9(0x118)]){const _0x4950ef=await isUrlReachable(_0x2661a3[_0x5b1de9(0x118)]);if(!_0x4950ef)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x2661a3[_0x5b1de9(0x118)]);}if(_0x2661a3[_0x5b1de9(0x126)]){const _0xafa976=await isUrlReachable(_0x2661a3[_0x5b1de9(0x126)]);if(!_0xafa976)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x2661a3[_0x5b1de9(0x126)]);}const _0x1370a0=await getOnlineMenuList(_0x3d52dc,_0x48afdf),_0x93f228=_0x1370a0[_0x5b1de9(0x123)](_0x106e0f=>_0x106e0f[_0x5b1de9(0x104)][_0x5b1de9(0x12b)]>0x0),_0x2b8ce5=selectMenusForUpdate(_0x93f228,_0x4559c2['selection']);if(_0x2b8ce5[_0x5b1de9(0x12b)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x4559c2[_0x5b1de9(0x102)]===!![]};const _0x4f4e14=_0x2b8ce5['map'](_0x28bbb5=>buildMenuUpdateDiff(_0x28bbb5,_0x2661a3,_0x677e61,_0x4559c2['force']===!![],_0x4559c2[_0x5b1de9(0xfb)]));if(_0x4559c2[_0x5b1de9(0x102)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x4f4e14};const _0x6864a9=await Promise[_0x5b1de9(0x10d)](_0x2b8ce5[_0x5b1de9(0xfd)]((_0x2a81ed,_0x2d739d)=>updateMenuCdnUrl(_0x3d52dc,_0x48afdf,{'id':_0x2a81ed['id'],'label':_0x2a81ed[_0x5b1de9(0x115)],'path':_0x2a81ed[_0x5b1de9(0x10b)],'resources':_0x4f4e14[_0x2d739d][_0x5b1de9(0x129)][_0x5b1de9(0x104)],'extend':_0x2a81ed[_0x5b1de9(0x11a)]??null,'loadScriptMode':_0x4559c2[_0x5b1de9(0xfb)]}))),_0x5daa43=_0x6864a9[_0x5b1de9(0x123)](_0x41e375=>_0x41e375[_0x5b1de9(0x127)]===_0x5b1de9(0x117))[_0x5b1de9(0xfd)](_0x19ba5d=>_0x19ba5d[_0x5b1de9(0x136)]),_0x73270=_0x6864a9['filter'](_0x7448e8=>_0x7448e8[_0x5b1de9(0x127)]==='rejected')[_0x5b1de9(0x12b)];return logger[_0x5b1de9(0x110)](_0x5b1de9(0x105),_0x5b1de9(0x128),{'count':_0x2b8ce5[_0x5b1de9(0x12b)],'resources':_0x244558}),{'updated':_0x5daa43[_0x5b1de9(0x12b)],'failed':_0x73270,'skipped':![],'menus':_0x5daa43};}function a120_0x7e03(){const _0x393929=['parse','menu\x20update\x20cannot\x20patch\x20','menuIds','label','8075480eRtpxK','fulfilled','jsUrl','some','extend','.css',').\x20','has','752212OItaOe','unshift','\x22\x20(','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','string','filter','15VfFLCm','1662173GrzuSy','cssUrl','status','Menu\x20update\x20completed','after','setLogPath','length','3489672SYqBAn','toLowerCase','trim','.\x20Allowed\x20values:\x20replace,\x20patch','menu\x20update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','endsWith','60183MzYGeZ','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','.js','value','push','field','replace','patch','Invalid\x20--mode:\x20','--params.','7484646MPkAJy','Invalid\x20--params:\x20menu\x20update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','mode','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','loadScriptMode','message','map','Invalid\x20--params:\x20','paths','all','4610YyMvtz','dryRun','join','resources','menu-update','menu\x20update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','menu\x20update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','472640lwfOIe','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','\x20existing\x20JS\x20resources\x20for\x20\x22','path','7mZGkmz','allSettled','Start\x20non-interactive\x20menu\x20update','isArray','info','\x20existing\x20CSS\x20resources\x20for\x20\x22'];a120_0x7e03=function(){return _0x393929;};return a120_0x7e03();}function validateSelection(_0x2407c5){const _0x11c949=a120_0x1e04;if(!_0x2407c5)throw new Error('menu\x20update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x2407c5[_0x11c949(0x100)]&&(_0x2407c5[_0x11c949(0x114)][_0x11c949(0x12b)]>0x0||_0x2407c5[_0x11c949(0xff)][_0x11c949(0x12b)]>0x0))throw new Error(_0x11c949(0x133));if(!_0x2407c5[_0x11c949(0x100)]&&_0x2407c5[_0x11c949(0x114)]['length']===0x0&&_0x2407c5[_0x11c949(0xff)][_0x11c949(0x12b)]===0x0)throw new Error('menu\x20update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x622991,_0x596b62){const _0x57f671=a120_0x1e04;validateSelection(_0x596b62);if(_0x596b62[_0x57f671(0x100)])return _0x622991;const _0xd84c32=new Set(_0x622991[_0x57f671(0xfd)](_0x2ebbea=>_0x2ebbea['id'])),_0x330887=new Set(_0x622991[_0x57f671(0xfd)](_0x182f55=>_0x182f55[_0x57f671(0x10b)])),_0x426d7c=_0x596b62[_0x57f671(0x114)]['filter'](_0x35fa3d=>!_0xd84c32['has'](_0x35fa3d)),_0x3dec97=_0x596b62['paths'][_0x57f671(0x123)](_0x138cd3=>!_0x330887[_0x57f671(0x11d)](_0x138cd3));if(_0x426d7c[_0x57f671(0x12b)]>0x0||_0x3dec97[_0x57f671(0x12b)]>0x0){const _0x229a6a=[..._0x426d7c[_0x57f671(0xfd)](_0x247876=>String(_0x247876)),..._0x3dec97][_0x57f671(0x103)](',\x20');throw new Error(_0x57f671(0x107)+_0x229a6a);}const _0x23b2e5=new Set(_0x596b62['menuIds']),_0x29886d=new Set(_0x596b62[_0x57f671(0xff)]);return _0x622991['filter'](_0x488232=>_0x23b2e5[_0x57f671(0x11d)](_0x488232['id'])||_0x29886d[_0x57f671(0x11d)](_0x488232[_0x57f671(0x10b)]));}function normalizeMode(_0x3dd823){const _0x5b4f5e=a120_0x1e04;if(!_0x3dd823)return _0x5b4f5e(0x13a);if(_0x3dd823===_0x5b4f5e(0x139)||_0x3dd823===_0x5b4f5e(0x13a))return _0x3dd823;throw new Error(_0x5b4f5e(0x13b)+_0x3dd823+_0x5b4f5e(0x12f));}function buildMenuUpdateDiff(_0x397d43,_0x3d1110,_0xdaae1a,_0x3832fa,_0x154b08){const _0x4ecc77=a120_0x1e04,_0x12232a=[..._0x397d43['resources']];_0xdaae1a===_0x4ecc77(0x13a)&&assertUnambiguousPatchResources(_0x397d43,_0x12232a,_0x3d1110);const _0x2aa170=_0xdaae1a===_0x4ecc77(0x13a)?patchResources(_0x12232a,_0x3d1110):replaceResources(_0x3d1110),_0x51068c=[],_0xd0f845=_0x12232a[_0x4ecc77(0x119)](isJsResource),_0x205424=_0x2aa170[_0x4ecc77(0x119)](isJsResource);if(_0xd0f845&&!_0x205424){const _0x172a9=_0x4ecc77(0x130)+_0x397d43[_0x4ecc77(0x115)]+_0x4ecc77(0x120)+_0x397d43[_0x4ecc77(0x10b)]+_0x4ecc77(0x11c)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0x3832fa)throw new Error(_0x172a9);_0x51068c[_0x4ecc77(0x137)](_0x172a9);}const _0x2b2699=_0x12232a[_0x4ecc77(0x119)](isCssResource),_0x38de7b=_0x2aa170[_0x4ecc77(0x119)](isCssResource);_0x2b2699&&!_0x38de7b&&_0x51068c[_0x4ecc77(0x137)](_0x4ecc77(0x106)+_0x397d43[_0x4ecc77(0x115)]+_0x4ecc77(0x120)+_0x397d43['path']+').');const _0x1950c7=typeof _0x397d43[_0x4ecc77(0x11a)]?.[_0x4ecc77(0xfb)]===_0x4ecc77(0x122)?_0x397d43[_0x4ecc77(0x11a)][_0x4ecc77(0xfb)]:null,_0x53fb01=_0x154b08?{'loadScriptMode':_0x1950c7}:{},_0x18107d=_0x154b08?{'loadScriptMode':_0x154b08}:{};return{'id':_0x397d43['id'],'label':_0x397d43[_0x4ecc77(0x115)],'path':_0x397d43[_0x4ecc77(0x10b)],'mode':_0xdaae1a,'before':{'resources':_0x12232a,..._0x53fb01},'after':{'resources':_0x2aa170,..._0x18107d},'warnings':_0x51068c};}function replaceResources(_0x1f85d1){const _0x57b856=a120_0x1e04;return[_0x1f85d1['jsUrl'],_0x1f85d1[_0x57b856(0x126)]]['filter'](_0x2887ee=>!!_0x2887ee);}function assertUnambiguousPatchResources(_0x2ebb32,_0x39c5d1,_0xafda1){const _0x22eaa4=a120_0x1e04,_0x47de24=_0x39c5d1[_0x22eaa4(0x123)](isJsResource)[_0x22eaa4(0x12b)];if(_0xafda1[_0x22eaa4(0x118)]&&_0x47de24>0x1)throw new Error(_0x22eaa4(0x113)+_0x47de24+_0x22eaa4(0x10a)+_0x2ebb32[_0x22eaa4(0x115)]+_0x22eaa4(0x120)+_0x2ebb32[_0x22eaa4(0x10b)]+')\x20'+_0x22eaa4(0x109));const _0x21fbea=_0x39c5d1['filter'](isCssResource)[_0x22eaa4(0x12b)];if(_0xafda1[_0x22eaa4(0x126)]&&_0x21fbea>0x1)throw new Error(_0x22eaa4(0x113)+_0x21fbea+_0x22eaa4(0x111)+_0x2ebb32[_0x22eaa4(0x115)]+_0x22eaa4(0x120)+_0x2ebb32[_0x22eaa4(0x10b)]+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function a120_0x1e04(_0x54470d,_0xcea2dc){_0x54470d=_0x54470d-0xfb;const _0x7e03b4=a120_0x7e03();let _0x1e0473=_0x7e03b4[_0x54470d];return _0x1e0473;}function patchResources(_0x19aa77,_0x52706b){const _0x8049d8=a120_0x1e04;let _0xd63514=![],_0x8dbfba=![];const _0x40b1b5=[];for(const _0x174757 of _0x19aa77){if(isJsResource(_0x174757)){if(_0x52706b[_0x8049d8(0x118)]&&!_0xd63514)_0x40b1b5[_0x8049d8(0x137)](_0x52706b['jsUrl']),_0xd63514=!![];else!_0x52706b[_0x8049d8(0x118)]&&_0x40b1b5['push'](_0x174757);continue;}if(isCssResource(_0x174757)){if(_0x52706b[_0x8049d8(0x126)]&&!_0x8dbfba)_0x40b1b5[_0x8049d8(0x137)](_0x52706b['cssUrl']),_0x8dbfba=!![];else!_0x52706b[_0x8049d8(0x126)]&&_0x40b1b5[_0x8049d8(0x137)](_0x174757);continue;}_0x40b1b5[_0x8049d8(0x137)](_0x174757);}return _0x52706b['jsUrl']&&!_0xd63514&&_0x40b1b5[_0x8049d8(0x11f)](_0x52706b['jsUrl']),_0x52706b[_0x8049d8(0x126)]&&!_0x8dbfba&&_0x40b1b5[_0x8049d8(0x137)](_0x52706b[_0x8049d8(0x126)]),_0x40b1b5;}function isJsResource(_0x14b948){const _0x2900f5=a120_0x1e04;return stripQuery(_0x14b948)[_0x2900f5(0x12d)]()[_0x2900f5(0x131)](_0x2900f5(0x135));}function isCssResource(_0x509fcd){const _0x1de8b6=a120_0x1e04;return stripQuery(_0x509fcd)['toLowerCase']()['endsWith'](_0x1de8b6(0x11b));}function stripQuery(_0x461d4d){return _0x461d4d['split']('?')[0x0]??_0x461d4d;}function parseUpdateParamsFlag(_0x14f2ff){const _0x3de7a5=a120_0x1e04;if(!_0x14f2ff||typeof _0x14f2ff!==_0x3de7a5(0x122))return{};try{const _0x405fbe=JSON[_0x3de7a5(0x112)](_0x14f2ff);if(typeof _0x405fbe!=='object'||_0x405fbe===null||Array[_0x3de7a5(0x10f)](_0x405fbe))return{};return{'jsUrl':typeof _0x405fbe[_0x3de7a5(0x118)]===_0x3de7a5(0x122)?_0x405fbe[_0x3de7a5(0x118)]['trim']():undefined,'cssUrl':typeof _0x405fbe[_0x3de7a5(0x126)]==='string'?_0x405fbe[_0x3de7a5(0x126)][_0x3de7a5(0x12e)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b8351,_0x4dd78e){const _0x412aeb=a121_0x4b4e,_0xdd488=_0x2b8351();while(!![]){try{const _0x220801=-parseInt(_0x412aeb(0x8e))/0x1+parseInt(_0x412aeb(0x8d))/0x2+-parseInt(_0x412aeb(0x87))/0x3+parseInt(_0x412aeb(0x8c))/0x4*(-parseInt(_0x412aeb(0x86))/0x5)+parseInt(_0x412aeb(0x89))/0x6*(parseInt(_0x412aeb(0x83))/0x7)+parseInt(_0x412aeb(0x8a))/0x8*(parseInt(_0x412aeb(0x8f))/0x9)+parseInt(_0x412aeb(0x90))/0xa*(-parseInt(_0x412aeb(0x8b))/0xb);if(_0x220801===_0x4dd78e)break;else _0xdd488['push'](_0xdd488['shift']());}catch(_0x296b4d){_0xdd488['push'](_0xdd488['shift']());}}}(a121_0x3d3a,0xde277));function a121_0x4b4e(_0x42f8ee,_0xd6f7f2){_0x42f8ee=_0x42f8ee-0x83;const _0x3d3a4d=a121_0x3d3a();let _0x4b4ef5=_0x3d3a4d[_0x42f8ee];return _0x4b4ef5;}export function isValidJsHttpsUrl(_0x34edf9){const _0x43f229=a121_0x4b4e;return/^https:\/\/.+\.js(\?.*)?$/[_0x43f229(0x84)](_0x34edf9[_0x43f229(0x85)]());}export function isValidCssHttpsUrl(_0x2a7e0e){const _0x5ca4ff=a121_0x4b4e;return/^https:\/\/.+\.css(\?.*)?$/[_0x5ca4ff(0x84)](_0x2a7e0e[_0x5ca4ff(0x85)]());}function a121_0x3d3a(){const _0x1187b9=['3121760rFsvky','479131MyTdRn','18NyUqOb','1572580wFHxcb','36197NdPaPh','test','trim','15335NwxGqo','2862060ZceNkm','HEAD','1824ngizRQ','1433704OHYRMX','55RQYPqv','472urOwPx'];a121_0x3d3a=function(){return _0x1187b9;};return a121_0x3d3a();}export async function isUrlReachable(_0x2392b2){const _0x4a086e=a121_0x4b4e;try{const _0x1a5f5b=await fetch(_0x2392b2,{'method':_0x4a086e(0x88)});return _0x1a5f5b['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a122_0x5d5642=a122_0x3e10;(function(_0x164200,_0x35a469){const _0x192510=a122_0x3e10,_0x117092=_0x164200();while(!![]){try{const _0x5426c2=-parseInt(_0x192510(0x98))/0x1*(parseInt(_0x192510(0xd7))/0x2)+parseInt(_0x192510(0xb2))/0x3*(-parseInt(_0x192510(0xe4))/0x4)+-parseInt(_0x192510(0xac))/0x5+parseInt(_0x192510(0xe2))/0x6+parseInt(_0x192510(0xda))/0x7*(parseInt(_0x192510(0xd9))/0x8)+parseInt(_0x192510(0xd4))/0x9*(parseInt(_0x192510(0x9a))/0xa)+-parseInt(_0x192510(0xdc))/0xb*(-parseInt(_0x192510(0xaa))/0xc);if(_0x5426c2===_0x35a469)break;else _0x117092['push'](_0x117092['shift']());}catch(_0x559955){_0x117092['push'](_0x117092['shift']());}}}(a122_0x32fa,0x21352));import a122_0x385f9e from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';function a122_0x3e10(_0x5ed05a,_0x2f416e){_0x5ed05a=_0x5ed05a-0x98;const _0x32fa67=a122_0x32fa();let _0x3e1051=_0x32fa67[_0x5ed05a];return _0x3e1051;}import{isInProject}from'../../context.js';function a122_0x32fa(){const _0x248fe4=['gray','write','213IkgnYF','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','created','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','cyan','string','validation','Would\x20create\x20','Sync\x20local\x20pages\x20as\x20platform\x20menus','Created\x20','filter','message','onlinePaths','cookie','sync','/smartapi/menu/create','yes','\x20menu(s)\x20created','\x20and\x20CSS:\x20','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','\x20menu(s)...','rawFlags','menu','Menu\x20creation\x20failed','flag','✓\x20Menu\x20sync\x20completed:\x20','\x20\x20Continue\x20with\x20creation?','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','params','\x20menu(s)','\x20\x20Cancelled.','failed','\x20created.','Menu\x20sync\x20completed:\x20','76941jgFQbz','\x20\x20✓\x20Selected:\x20','\x20local\x20microfrontend\x20menu(s).','12076VXgORn','cssUrl','447800dHmLVM','7EzodMI','appcode','3707prpoGE','Online\x20menu\x20list\x20fetched','length','\x20failed.','boolean','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','811296FlvXwX','map','2668FaepTR','33CfCKtP','\x20menu(s)\x20with\x20JS:\x20','290UOhlNJ','yellow','Menu\x20sync\x20skipped','appCode','Pre-fill\x20JS/CSS\x20URLs.\x20','\x20created,\x20','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','paths','str','trim','size','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','selectedAppName','POST','Failed\x20to\x20fetch\x20online\x20menu\x20list','6852xPGNZP','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','1244550hIFFsN','skipped','targetPages','onlineMenuList'];a122_0x32fa=function(){return _0x248fe4;};return a122_0x32fa();}export const menuSync={'service':a122_0x5d5642(0xc8),'command':a122_0x5d5642(0xc0),'description':a122_0x5d5642(0xba),'risk':a122_0x5d5642(0xb1),'flags':[{'name':a122_0x5d5642(0xce),'type':a122_0x5d5642(0xb7),'description':a122_0x5d5642(0x9e)+'JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}'},{'name':a122_0x5d5642(0xa2),'type':'string','description':a122_0x5d5642(0xe1)},{'name':a122_0x5d5642(0xc2),'type':a122_0x5d5642(0xe0),'description':a122_0x5d5642(0xc5)}],async 'dryRun'(_0x93a8b2){const _0x1ba7c5=a122_0x5d5642;ensureRunnableContext(_0x93a8b2[_0x1ba7c5(0xc7)],_0x93a8b2['selectedAppName']);const _0x48e3a1=await runMenuSyncCore(_0x93a8b2[_0x1ba7c5(0x9d)],_0x93a8b2[_0x1ba7c5(0xbf)],parsePaths(_0x93a8b2[_0x1ba7c5(0xa3)](_0x1ba7c5(0xa2))),_0x93a8b2['str']('params'),{'dryRun':!![]});return{'method':_0x1ba7c5(0xa8),'url':_0x1ba7c5(0xc1),'body':_0x48e3a1,'description':_0x48e3a1[_0x1ba7c5(0xad)]?'No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.':_0x1ba7c5(0xb9)+_0x48e3a1[_0x1ba7c5(0xae)][_0x1ba7c5(0xde)]+_0x1ba7c5(0xd6)};},async 'execute'(_0x119fe4){const _0x2e99cd=a122_0x5d5642;ensureRunnableContext(_0x119fe4[_0x2e99cd(0xc7)],_0x119fe4[_0x2e99cd(0xa7)]);const _0xa5a480=_0x119fe4[_0x2e99cd(0xca)](_0x2e99cd(0xc2)),_0x2ad374=_0x119fe4[_0x2e99cd(0xa3)](_0x2e99cd(0xce)),_0x537010=parsePaths(_0x119fe4[_0x2e99cd(0xa3)](_0x2e99cd(0xa2))),_0x31a146=parseMenuSyncParams(_0x2ad374);if(_0xa5a480){const _0x5aa4e1=await runMenuSyncCore(_0x119fe4[_0x2e99cd(0x9d)],_0x119fe4[_0x2e99cd(0xbf)],_0x537010,_0x2ad374);if(_0x5aa4e1[_0x2e99cd(0xad)]){const _0x4609dc=getLocalPages();_0x4609dc[_0x2e99cd(0xde)]===0x0?writeCliSideChannelLine(_0x2e99cd(0xa1)):writeCliSideChannelLine('✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform');}else writeCliSideChannelLine(_0x2e99cd(0xcb)+_0x5aa4e1[_0x2e99cd(0xb4)]+_0x2e99cd(0xc3));return{'ok':!![],'data':_0x5aa4e1,'message':_0x5aa4e1[_0x2e99cd(0xad)]?_0x2e99cd(0x9c):_0x2e99cd(0xd3)+_0x5aa4e1[_0x2e99cd(0xb4)]+_0x2e99cd(0xd2)};}if(_0x537010[_0x2e99cd(0xde)]>0x0)throw CliErrors[_0x2e99cd(0xb8)](_0x2e99cd(0xb5),_0x2e99cd(0xa6));if(!isInteractive()&&_0x2ad374)throw CliErrors[_0x2e99cd(0xb8)](_0x2e99cd(0xa0),'Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');requireInteractive();const _0x528641=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x454c69,_0x2d5421,_0x803f91;try{const _0x1500dd=await fetchMenuData(_0x119fe4['appCode'],_0x119fe4[_0x2e99cd(0xbf)]);_0x454c69=_0x1500dd['localPages'],_0x2d5421=_0x1500dd[_0x2e99cd(0xbe)],_0x803f91=_0x1500dd[_0x2e99cd(0xaf)],stopSpinner(_0x528641,_0x2e99cd(0xdd),!![]);}catch(_0x205c25){stopSpinner(_0x528641,_0x2e99cd(0xa9),![]);throw CliErrors[_0x2e99cd(0xb8)](_0x205c25 instanceof Error?_0x205c25[_0x2e99cd(0xbd)]:'Failed\x20to\x20fetch\x20online\x20menu\x20list');}if(_0x454c69['length']===0x0)return writeCliSideChannelLine(a122_0x385f9e[_0x2e99cd(0x9b)](_0x2e99cd(0xcd))),{'ok':!![]};const _0x12ab2d=buildCompareRows(_0x454c69,_0x2d5421);writeCliSideChannelLine(renderCompareTable(_0x12ab2d)),writeCliSideChannelLine('');const _0x45b752=await selectPages(_0x454c69,_0x2d5421);writeCliSideChannelLine(''),writeCliSideChannelLine(a122_0x385f9e[_0x2e99cd(0xb6)](_0x2e99cd(0xd5)+_0x45b752['length']+'\x20page(s)'));const _0x266ac1=_0x31a146['jsUrl']&&_0x31a146['cssUrl'];if(!_0x266ac1){writeCliSideChannelLine(renderSyncSummary(_0x45b752,_0x2d5421[_0x2e99cd(0xa5)]>0x0));const _0x1d48f9=await askConfirm(_0x2e99cd(0xcc));if(!_0x1d48f9)return writeCliSideChannelLine(a122_0x385f9e[_0x2e99cd(0xb0)](_0x2e99cd(0xd0))),{'ok':!![]};}let _0x3bd0ac=_0x31a146['jsUrl'],_0x5d8ed9=_0x31a146[_0x2e99cd(0xd8)];!_0x3bd0ac&&(_0x3bd0ac=await askJsUrl());!_0x5d8ed9&&(_0x5d8ed9=await askCssUrl());const _0x4a8cbf=await askConfirm('\x20\x20Create\x20'+_0x45b752[_0x2e99cd(0xde)]+_0x2e99cd(0x99)+_0x3bd0ac+_0x2e99cd(0xc4)+_0x5d8ed9+'?');if(!_0x4a8cbf)return writeCliSideChannelLine(a122_0x385f9e[_0x2e99cd(0xb0)](_0x2e99cd(0xd0))),{'ok':!![]};const _0x1990c2=[_0x3bd0ac,_0x5d8ed9],_0x69e489=startSpinner('Creating\x20'+_0x45b752[_0x2e99cd(0xde)]+_0x2e99cd(0xc6));try{const _0x217778=await doCreateMenus(_0x119fe4['appCode'],_0x119fe4[_0x2e99cd(0xbf)],_0x45b752,_0x1990c2);return stopSpinner(_0x69e489,_0x2e99cd(0xbb)+_0x217778[_0x2e99cd(0xb4)]+_0x2e99cd(0xcf),!![]),{'ok':!![],'data':_0x217778,'message':_0x2e99cd(0xd3)+_0x217778[_0x2e99cd(0xb4)]+_0x2e99cd(0x9f)+_0x217778[_0x2e99cd(0xd1)]+_0x2e99cd(0xdf)};}catch(_0x13654e){stopSpinner(_0x69e489,'Menu\x20creation\x20failed',![]);throw CliErrors[_0x2e99cd(0xb8)](_0x13654e instanceof Error?_0x13654e['message']:_0x2e99cd(0xc9));}}};function ensureRunnableContext(_0x5cad2c,_0x9c700f){const _0x3d031f=a122_0x5d5642,_0x568eca=_0x5cad2c[_0x3d031f(0xdb)]?String(_0x5cad2c[_0x3d031f(0xdb)])[_0x3d031f(0xa4)]():'';if(!isInProject()&&!_0x9c700f&&!_0x568eca)throw CliErrors[_0x3d031f(0xb8)](_0x3d031f(0xab)+_0x3d031f(0xb3));}function parsePaths(_0xfcb8a0){const _0x217bce=a122_0x5d5642;return[...new Set(_0xfcb8a0['split'](',')[_0x217bce(0xe3)](_0x351a23=>_0x351a23[_0x217bce(0xa4)]())[_0x217bce(0xbc)](Boolean))];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a123_0x12d5(){const _0xb796cd=['map','params','mode','patch\x20replaces\x20a\x20supplied\x20type\x20only\x20when\x20the\x20existing\x20target\x20is\x20unambiguous','appcode','string','selectedAppName','rawFlags','Explicitly\x20change\x20the\x20microfrontend\x20resource\x20loading\x20mode','validation','66039flbtGq','\x20menu(s)\x20with\x20JS:\x20','\x20menu(s)...','16913580zFxXyG','paths','load-mode','\x20\x20Cancelled.','menu\x20update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','trim','import','appCode','150LCPtut','Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20','8140072HNutgA','\x20and\x20CSS:\x20','843657fMzCpS','message','cssUrl','label','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','\x20\x20Found\x20','\x20menu(s)\x20updated','object','11MdUqaw','\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found','update','7olpwza','flag','force','Updating\x20','14780WZjfEj','some','941476kHgdUo','patch','length','No\x20menus\x20with\x20existing\x20resources\x20would\x20be\x20updated.','yes','/smartapi/menu/update','Explicitly\x20update\x20every\x20menu\x20that\x20has\x20resources','isArray','Fetching\x20online\x20menu\x20list...','Resource\x20update\x20mode:\x20replace\x20rewrites\x20resources\x20from\x20supplied\x20URLs;\x20','10100pwzuOp','Invalid\x20--mode.\x20Allowed\x20values:\x20replace,\x20patch','cookie','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','updated','\x20menu\x20resource\x20set(s).','\x20menu(s)\x20failed','1917KtdskF','jsUrl','✓\x20Menu\x20update\x20completed:\x20','stringify','all','28gOoWHz','Failed\x20to\x20fetch\x20online\x20menu\x20list','menu-ids','yellow','failed','skipped','parse','Menu\x20update\x20failed','Updated\x20','high-risk-write','Menu\x20update\x20completed:\x20','str','bool','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','\x20updated.','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','Invalid\x20--load-mode.\x20Allowed\x20values:\x20import,\x20script,\x20fetch','\x20failed.','\x20\x20Update\x20','Would\x20update\x20','boolean','replace'];a123_0x12d5=function(){return _0xb796cd;};return a123_0x12d5();}function a123_0x7148(_0x5f36cc,_0x3012f5){_0x5f36cc=_0x5f36cc-0x98;const _0x12d539=a123_0x12d5();let _0x7148db=_0x12d539[_0x5f36cc];return _0x7148db;}const a123_0x58d070=a123_0x7148;(function(_0x2fef44,_0x2b1696){const _0x3c6d41=a123_0x7148,_0x593e20=_0x2fef44();while(!![]){try{const _0x20fe05=parseInt(_0x3c6d41(0xc2))/0x1+parseInt(_0x3c6d41(0xd3))/0x2+parseInt(_0x3c6d41(0xb3))/0x3*(-parseInt(_0x3c6d41(0xe9))/0x4)+-parseInt(_0x3c6d41(0xd1))/0x5*(-parseInt(_0x3c6d41(0xbe))/0x6)+parseInt(_0x3c6d41(0xcd))/0x7*(parseInt(_0x3c6d41(0xc0))/0x8)+parseInt(_0x3c6d41(0xe4))/0x9*(-parseInt(_0x3c6d41(0xdd))/0xa)+parseInt(_0x3c6d41(0xca))/0xb*(-parseInt(_0x3c6d41(0xb6))/0xc);if(_0x20fe05===_0x2b1696)break;else _0x593e20['push'](_0x593e20['shift']());}catch(_0x4adb4c){_0x593e20['push'](_0x593e20['shift']());}}}(a123_0x12d5,0x991ae));import a123_0x3de6a9 from'chalk';import{filterMenusWithResources,fetchOnlineMenuList}from'../../commands/menu/shared/logic.js';import{renderUpdateSummary}from'../../commands/menu/shared/compare-table.js';import{askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{runMenuUpdateCore}from'../../commands/menu/shared/update-core.js';import{selectMenusForUpdate}from'../../commands/menu/shared/update-core.js';import{isInProject}from'../../context.js';export const menuUpdate={'service':'menu','command':a123_0x58d070(0xcc),'description':'Update\x20CDN\x20asset\x20URLs\x20for\x20selected\x20online\x20menus\x20with\x20existing\x20resources','risk':a123_0x58d070(0x9c),'flags':[{'name':a123_0x58d070(0xaa),'type':a123_0x58d070(0xae),'description':a123_0x58d070(0xbf)+a123_0x58d070(0xc6)},{'name':a123_0x58d070(0xab),'type':a123_0x58d070(0xae),'description':a123_0x58d070(0xdc)+a123_0x58d070(0xac),'enum':[a123_0x58d070(0xa8),a123_0x58d070(0xd4)],'default':'patch'},{'name':'force','type':a123_0x58d070(0xa7),'description':'Allow\x20replace\x20mode\x20to\x20remove\x20existing\x20JS\x20resources'},{'name':a123_0x58d070(0xeb),'type':a123_0x58d070(0xae),'description':a123_0x58d070(0xe0)},{'name':'paths','type':a123_0x58d070(0xae),'description':'Exact\x20comma-separated\x20menu\x20paths\x20to\x20update'},{'name':a123_0x58d070(0xe8),'type':a123_0x58d070(0xa7),'description':a123_0x58d070(0xd9)},{'name':a123_0x58d070(0xb8),'type':a123_0x58d070(0xae),'enum':[a123_0x58d070(0xbc),'script','fetch'],'description':a123_0x58d070(0xb1)}],async 'dryRun'(_0x432810){const _0x4193f4=a123_0x58d070;ensureRunnableContext(_0x432810[_0x4193f4(0xb0)],_0x432810[_0x4193f4(0xaf)]);const _0xc5ec50=await runMenuUpdateCore(_0x432810[_0x4193f4(0xbd)],_0x432810[_0x4193f4(0xdf)],_0x432810['str'](_0x4193f4(0xaa)),{'mode':parseMode(_0x432810[_0x4193f4(0x9e)](_0x4193f4(0xab))),'dryRun':!![],'force':_0x432810[_0x4193f4(0x9f)]('force'),'selection':parseSelection(_0x432810),'loadScriptMode':parseLoadScriptMode(_0x432810[_0x4193f4(0x9e)](_0x4193f4(0xb8)))});return{'method':'POST','url':_0x4193f4(0xd8),'body':_0xc5ec50,'description':_0xc5ec50[_0x4193f4(0x98)]?_0x4193f4(0xd6):_0x4193f4(0xa6)+(_0xc5ec50['diffs']?.[_0x4193f4(0xd5)]??0x0)+_0x4193f4(0xe2)};},async 'execute'(_0x11008b){const _0x5e8157=a123_0x58d070;ensureRunnableContext(_0x11008b[_0x5e8157(0xb0)],_0x11008b[_0x5e8157(0xaf)]);const _0x41cd35=_0x11008b[_0x5e8157(0xce)](_0x5e8157(0xd7)),_0x56db1c=_0x11008b[_0x5e8157(0x9e)](_0x5e8157(0xaa)),_0x1bb05a=parseMode(_0x11008b[_0x5e8157(0x9e)](_0x5e8157(0xab))),_0x18c6cb=_0x11008b[_0x5e8157(0x9f)](_0x5e8157(0xcf)),_0x3f0c0d=parseLoadScriptMode(_0x11008b[_0x5e8157(0x9e)](_0x5e8157(0xb8))),_0x5c8bae=parseParams(_0x56db1c),_0xf360db=!!(_0x5c8bae[_0x5e8157(0xe5)]||_0x5c8bae[_0x5e8157(0xc4)]);if(_0x41cd35||_0xf360db&&!isInteractive()){const _0x435b4b=await runMenuUpdateCore(_0x11008b[_0x5e8157(0xbd)],_0x11008b['cookie'],_0x56db1c,{'mode':_0x1bb05a,'force':_0x18c6cb,'selection':parseSelection(_0x11008b),'loadScriptMode':_0x3f0c0d});return _0x435b4b[_0x5e8157(0x98)]?writeCliSideChannelLine('!\x20No\x20menus\x20with\x20existing\x20resources\x20found'):(writeCliSideChannelLine(_0x5e8157(0xe6)+_0x435b4b[_0x5e8157(0xe1)]+_0x5e8157(0xc8)),_0x435b4b[_0x5e8157(0xed)]>0x0&&writeCliSideChannelLine('!\x20'+_0x435b4b[_0x5e8157(0xed)]+_0x5e8157(0xe3))),{'ok':_0x435b4b[_0x5e8157(0xed)]===0x0,'data':_0x435b4b,'message':_0x435b4b[_0x5e8157(0x98)]?'Menu\x20update\x20skipped':'Menu\x20update\x20completed:\x20'+_0x435b4b[_0x5e8157(0xe1)]+'\x20updated,\x20'+_0x435b4b[_0x5e8157(0xed)]+_0x5e8157(0xa4)};}requireInteractive();const _0x1134bf=startSpinner(_0x5e8157(0xdb));let _0x232f22;try{_0x232f22=await fetchOnlineMenuList(_0x11008b[_0x5e8157(0xbd)],_0x11008b[_0x5e8157(0xdf)]),stopSpinner(_0x1134bf,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x2234cb){stopSpinner(_0x1134bf,'Failed\x20to\x20fetch\x20online\x20menu\x20list',![]);throw CliErrors[_0x5e8157(0xb2)](_0x2234cb instanceof Error?_0x2234cb[_0x5e8157(0xc3)]:_0x5e8157(0xea));}const _0x4e0f8f=filterMenusWithResources(_0x232f22),_0x49fded=parseSelection(_0x11008b,![]),_0x91d24e=_0x49fded?selectMenusForUpdate(_0x4e0f8f,_0x49fded):_0x4e0f8f;if(_0x91d24e['length']===0x0)return writeCliSideChannelLine(a123_0x3de6a9[_0x5e8157(0xec)](_0x5e8157(0xcb))),{'ok':!![]};writeCliSideChannelLine(''),writeCliSideChannelLine(a123_0x3de6a9['cyan'](_0x5e8157(0xc7)+_0x91d24e[_0x5e8157(0xd5)]+'\x20menu(s)\x20with\x20existing\x20resources')),writeCliSideChannelLine(renderUpdateSummary(_0x91d24e['map'](_0x58937f=>_0x58937f[_0x5e8157(0xc5)]),[_0x5c8bae[_0x5e8157(0xe5)],_0x5c8bae[_0x5e8157(0xc4)]])),writeCliSideChannelLine('');let _0x416017=_0x5c8bae[_0x5e8157(0xe5)],_0x6a4f4a=_0x5c8bae[_0x5e8157(0xc4)];!_0x416017&&(_0x416017=await askJsUrl());!_0x6a4f4a&&(_0x6a4f4a=await askCssUrl());const _0x22da26=await askConfirm(_0x5e8157(0xa5)+_0x91d24e[_0x5e8157(0xd5)]+_0x5e8157(0xb4)+_0x416017+_0x5e8157(0xc1)+_0x6a4f4a+'?');if(!_0x22da26)return writeCliSideChannelLine(a123_0x3de6a9['gray'](_0x5e8157(0xb9))),{'ok':!![]};const _0x55e7ca=startSpinner(_0x5e8157(0xd0)+_0x91d24e[_0x5e8157(0xd5)]+_0x5e8157(0xb5));try{const _0x403e43=await runMenuUpdateCore(_0x11008b[_0x5e8157(0xbd)],_0x11008b['cookie'],JSON[_0x5e8157(0xe7)]({'jsUrl':_0x416017,'cssUrl':_0x6a4f4a}),{'mode':_0x1bb05a,'force':_0x18c6cb,'selection':{'all':![],'menuIds':_0x91d24e[_0x5e8157(0xa9)](_0x2d4462=>_0x2d4462['id']),'paths':[]},'loadScriptMode':_0x3f0c0d});return stopSpinner(_0x55e7ca,_0x5e8157(0x9b)+_0x403e43[_0x5e8157(0xe1)]+'\x20menu(s)',_0x403e43[_0x5e8157(0xed)]===0x0),{'ok':_0x403e43[_0x5e8157(0xed)]===0x0,'data':_0x403e43,'message':_0x403e43[_0x5e8157(0xed)]>0x0?_0x5e8157(0x9d)+_0x403e43[_0x5e8157(0xe1)]+'\x20updated,\x20'+_0x403e43[_0x5e8157(0xed)]+'\x20failed.':_0x5e8157(0x9d)+_0x403e43[_0x5e8157(0xe1)]+_0x5e8157(0xa1)};}catch(_0x104689){stopSpinner(_0x55e7ca,_0x5e8157(0x9a),![]);throw CliErrors[_0x5e8157(0xb2)](_0x104689 instanceof Error?_0x104689[_0x5e8157(0xc3)]:_0x5e8157(0x9a));}}};function ensureRunnableContext(_0x22d99f,_0x50a82b){const _0x4c4eaf=a123_0x58d070,_0x3641be=_0x22d99f[_0x4c4eaf(0xad)]?String(_0x22d99f[_0x4c4eaf(0xad)])[_0x4c4eaf(0xbb)]():'';if(!isInProject()&&!_0x50a82b&&!_0x3641be)throw CliErrors[_0x4c4eaf(0xb2)]('menu\x20update\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20'+'Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.');}function parseMode(_0x3471a4){const _0x47d9a2=a123_0x58d070;if(!_0x3471a4)return _0x47d9a2(0xd4);if(_0x3471a4===_0x47d9a2(0xa8)||_0x3471a4===_0x47d9a2(0xd4))return _0x3471a4;throw CliErrors[_0x47d9a2(0xb2)](_0x47d9a2(0xde));}function parseSelection(_0xbdf400,_0x554519=!![]){const _0x488319=a123_0x58d070,_0x4b6cf4=_0xbdf400['bool'](_0x488319(0xe8)),_0xf2b64e=parseMenuIds(_0xbdf400[_0x488319(0x9e)]('menu-ids')),_0x829cf5=parseCsv(_0xbdf400[_0x488319(0x9e)](_0x488319(0xb7))),_0x50ea20=_0xf2b64e[_0x488319(0xd5)]>0x0||_0x829cf5[_0x488319(0xd5)]>0x0;if(_0x4b6cf4&&_0x50ea20)throw CliErrors[_0x488319(0xb2)](_0x488319(0xa2));if(!_0x4b6cf4&&!_0x50ea20){if(!_0x554519)return undefined;throw CliErrors[_0x488319(0xb2)](_0x488319(0xba));}return{'all':_0x4b6cf4,'menuIds':_0xf2b64e,'paths':_0x829cf5};}function parseMenuIds(_0x1a65ca){const _0x47b47c=a123_0x58d070,_0xb1d835=parseCsv(_0x1a65ca),_0x4eb73d=_0xb1d835['map'](Number);if(_0x4eb73d[_0x47b47c(0xd2)](_0x2a89d7=>!Number['isSafeInteger'](_0x2a89d7)||_0x2a89d7<=0x0))throw CliErrors[_0x47b47c(0xb2)](_0x47b47c(0xa0));return[...new Set(_0x4eb73d)];}function parseCsv(_0x20b830){const _0x22fc43=a123_0x58d070;return[...new Set(_0x20b830['split'](',')['map'](_0x5f2f26=>_0x5f2f26[_0x22fc43(0xbb)]())['filter'](Boolean))];}function parseLoadScriptMode(_0x812cd6){const _0x2854a2=a123_0x58d070;if(!_0x812cd6)return undefined;if(_0x812cd6===_0x2854a2(0xbc)||_0x812cd6==='script'||_0x812cd6==='fetch')return _0x812cd6;throw CliErrors['validation'](_0x2854a2(0xa3));}function parseParams(_0x334a62){const _0x30fb4e=a123_0x58d070;if(!_0x334a62)return{};try{const _0x1c6586=JSON[_0x30fb4e(0x99)](_0x334a62);if(typeof _0x1c6586!==_0x30fb4e(0xc9)||_0x1c6586===null||Array[_0x30fb4e(0xda)](_0x1c6586))return{};return{'jsUrl':typeof _0x1c6586[_0x30fb4e(0xe5)]==='string'?_0x1c6586[_0x30fb4e(0xe5)][_0x30fb4e(0xbb)]():undefined,'cssUrl':typeof _0x1c6586[_0x30fb4e(0xc4)]===_0x30fb4e(0xae)?_0x1c6586[_0x30fb4e(0xc4)][_0x30fb4e(0xbb)]():undefined};}catch{return{};}}
|
|
1
|
+
const a123_0x34ba12=a123_0x4eeb;(function(_0x1ae9ba,_0x497e88){const _0x4d7dd9=a123_0x4eeb,_0x5b3de7=_0x1ae9ba();while(!![]){try{const _0x18480f=parseInt(_0x4d7dd9(0x131))/0x1*(-parseInt(_0x4d7dd9(0x175))/0x2)+-parseInt(_0x4d7dd9(0x16c))/0x3+-parseInt(_0x4d7dd9(0x16e))/0x4*(-parseInt(_0x4d7dd9(0x15d))/0x5)+-parseInt(_0x4d7dd9(0x13d))/0x6*(-parseInt(_0x4d7dd9(0x128))/0x7)+parseInt(_0x4d7dd9(0x17d))/0x8*(parseInt(_0x4d7dd9(0x13a))/0x9)+parseInt(_0x4d7dd9(0x12e))/0xa+-parseInt(_0x4d7dd9(0x129))/0xb;if(_0x18480f===_0x497e88)break;else _0x5b3de7['push'](_0x5b3de7['shift']());}catch(_0x533d6b){_0x5b3de7['push'](_0x5b3de7['shift']());}}}(a123_0x2387,0xe42fc));import a123_0x3af0e7 from'chalk';import{filterMenusWithResources,fetchOnlineMenuList}from'../../commands/menu/shared/logic.js';import{renderUpdateSummary}from'../../commands/menu/shared/compare-table.js';import{askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';function a123_0x2387(){const _0x5b6d65=['force','jsUrl','load-mode','isArray','No\x20menus\x20with\x20existing\x20resources\x20would\x20be\x20updated.','rawFlags','!\x20No\x20menus\x20with\x20existing\x20resources\x20found','cssUrl','\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found','update','fetch','Would\x20update\x20','updated','str','high-risk-write','\x20menu\x20resource\x20set(s).','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','Invalid\x20--mode.\x20Allowed\x20values:\x20replace,\x20patch','\x20\x20Found\x20','boolean','script','validation','Updating\x20','yellow','Update\x20CDN\x20asset\x20URLs\x20for\x20selected\x20online\x20menus\x20with\x20existing\x20resources','some','stringify','selectedAppName','3650865cYLNoW','menu-ids','appCode','appcode','\x20failed.','bool','\x20menu(s)...','Allow\x20replace\x20mode\x20to\x20remove\x20existing\x20JS\x20resources','filter','\x20and\x20CSS:\x20','Updated\x20','\x20\x20Update\x20','Failed\x20to\x20fetch\x20online\x20menu\x20list','patch','POST','690111eBgVCo','diffs','4YEihEf','patch\x20replaces\x20a\x20supplied\x20type\x20only\x20when\x20the\x20existing\x20target\x20is\x20unambiguous','Explicitly\x20update\x20every\x20menu\x20that\x20has\x20resources','Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20','Menu\x20update\x20failed','\x20menu(s)\x20with\x20JS:\x20','Invalid\x20--load-mode.\x20Allowed\x20values:\x20import,\x20script,\x20fetch','2500136tdCEvm','✓\x20Menu\x20update\x20completed:\x20','paths','\x20menu(s)\x20with\x20existing\x20resources','Online\x20menu\x20list\x20fetched','\x20menu(s)','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','skipped','8WpFeBG','\x20updated.','string','\x20updated,\x20','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','255297UiaBLP','16192264asOzPb','menu\x20update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','params','parse','import','14425630kwDprO','replace','menu\x20update\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','1RFvAUh','length','all','object','Menu\x20update\x20skipped','\x20menu(s)\x20updated','map','gray','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','983889xFEVAI','cookie','trim','264wjGnWE','failed','mode'];a123_0x2387=function(){return _0x5b6d65;};return a123_0x2387();}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{runMenuUpdateCore}from'../../commands/menu/shared/update-core.js';import{selectMenusForUpdate}from'../../commands/menu/shared/update-core.js';import{isInProject}from'../../context.js';export const menuUpdate={'service':'menu','command':a123_0x34ba12(0x149),'description':a123_0x34ba12(0x159),'risk':a123_0x34ba12(0x14e),'flags':[{'name':a123_0x34ba12(0x12b),'type':'string','description':a123_0x34ba12(0x171)+a123_0x34ba12(0x151)},{'name':a123_0x34ba12(0x13f),'type':a123_0x34ba12(0x17f),'description':'Resource\x20update\x20mode:\x20replace\x20rewrites\x20resources\x20from\x20supplied\x20URLs;\x20'+a123_0x34ba12(0x16f),'enum':[a123_0x34ba12(0x12f),'patch'],'default':a123_0x34ba12(0x16a)},{'name':a123_0x34ba12(0x140),'type':a123_0x34ba12(0x154),'description':a123_0x34ba12(0x164)},{'name':a123_0x34ba12(0x15e),'type':a123_0x34ba12(0x17f),'description':a123_0x34ba12(0x150)},{'name':a123_0x34ba12(0x177),'type':'string','description':'Exact\x20comma-separated\x20menu\x20paths\x20to\x20update'},{'name':a123_0x34ba12(0x133),'type':a123_0x34ba12(0x154),'description':a123_0x34ba12(0x170)},{'name':a123_0x34ba12(0x142),'type':a123_0x34ba12(0x17f),'enum':[a123_0x34ba12(0x12d),a123_0x34ba12(0x155),'fetch'],'description':'Explicitly\x20change\x20the\x20microfrontend\x20resource\x20loading\x20mode'}],async 'dryRun'(_0x2ddce6){const _0x4450db=a123_0x34ba12;ensureRunnableContext(_0x2ddce6[_0x4450db(0x145)],_0x2ddce6[_0x4450db(0x15c)]);const _0x2e52d6=await runMenuUpdateCore(_0x2ddce6[_0x4450db(0x15f)],_0x2ddce6[_0x4450db(0x13b)],_0x2ddce6[_0x4450db(0x14d)]('params'),{'mode':parseMode(_0x2ddce6['str'](_0x4450db(0x13f))),'dryRun':!![],'force':_0x2ddce6['bool'](_0x4450db(0x140)),'selection':parseSelection(_0x2ddce6),'loadScriptMode':parseLoadScriptMode(_0x2ddce6[_0x4450db(0x14d)](_0x4450db(0x142)))});return{'method':_0x4450db(0x16b),'url':'/smartapi/menu/update','body':_0x2e52d6,'description':_0x2e52d6[_0x4450db(0x17c)]?_0x4450db(0x144):_0x4450db(0x14b)+(_0x2e52d6[_0x4450db(0x16d)]?.[_0x4450db(0x132)]??0x0)+_0x4450db(0x14f)};},async 'execute'(_0x39d560){const _0x268348=a123_0x34ba12;ensureRunnableContext(_0x39d560[_0x268348(0x145)],_0x39d560[_0x268348(0x15c)]);const _0x4732b2=_0x39d560['flag']('yes'),_0xb024af=_0x39d560[_0x268348(0x14d)](_0x268348(0x12b)),_0x101548=parseMode(_0x39d560[_0x268348(0x14d)](_0x268348(0x13f))),_0x444891=_0x39d560[_0x268348(0x162)]('force'),_0x56de84=parseLoadScriptMode(_0x39d560[_0x268348(0x14d)]('load-mode')),_0x264683=parseParams(_0xb024af),_0x310c50=!!(_0x264683['jsUrl']||_0x264683[_0x268348(0x147)]);if(_0x4732b2||_0x310c50&&!isInteractive()){const _0x57fd97=await runMenuUpdateCore(_0x39d560[_0x268348(0x15f)],_0x39d560[_0x268348(0x13b)],_0xb024af,{'mode':_0x101548,'force':_0x444891,'selection':parseSelection(_0x39d560),'loadScriptMode':_0x56de84});return _0x57fd97['skipped']?writeCliSideChannelLine(_0x268348(0x146)):(writeCliSideChannelLine(_0x268348(0x176)+_0x57fd97['updated']+_0x268348(0x136)),_0x57fd97[_0x268348(0x13e)]>0x0&&writeCliSideChannelLine('!\x20'+_0x57fd97[_0x268348(0x13e)]+'\x20menu(s)\x20failed')),{'ok':_0x57fd97[_0x268348(0x13e)]===0x0,'data':_0x57fd97,'message':_0x57fd97[_0x268348(0x17c)]?_0x268348(0x135):'Menu\x20update\x20completed:\x20'+_0x57fd97[_0x268348(0x14c)]+'\x20updated,\x20'+_0x57fd97[_0x268348(0x13e)]+_0x268348(0x161)};}requireInteractive();const _0x16737b=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x470d9e;try{_0x470d9e=await fetchOnlineMenuList(_0x39d560['appCode'],_0x39d560[_0x268348(0x13b)]),stopSpinner(_0x16737b,_0x268348(0x179),!![]);}catch(_0x349599){stopSpinner(_0x16737b,_0x268348(0x169),![]);throw CliErrors['validation'](_0x349599 instanceof Error?_0x349599['message']:'Failed\x20to\x20fetch\x20online\x20menu\x20list');}const _0x22f23d=filterMenusWithResources(_0x470d9e),_0x5f4545=parseSelection(_0x39d560,![]),_0x493fe6=_0x5f4545?selectMenusForUpdate(_0x22f23d,_0x5f4545):_0x22f23d;if(_0x493fe6[_0x268348(0x132)]===0x0)return writeCliSideChannelLine(a123_0x3af0e7[_0x268348(0x158)](_0x268348(0x148))),{'ok':!![]};writeCliSideChannelLine(''),writeCliSideChannelLine(a123_0x3af0e7['cyan'](_0x268348(0x153)+_0x493fe6[_0x268348(0x132)]+_0x268348(0x178))),writeCliSideChannelLine(renderUpdateSummary(_0x493fe6['map'](_0x2bfa75=>_0x2bfa75['label']),[_0x264683[_0x268348(0x141)],_0x264683[_0x268348(0x147)]])),writeCliSideChannelLine('');let _0x6a559=_0x264683[_0x268348(0x141)],_0x2cdf38=_0x264683['cssUrl'];!_0x6a559&&(_0x6a559=await askJsUrl());!_0x2cdf38&&(_0x2cdf38=await askCssUrl());const _0x132552=await askConfirm(_0x268348(0x168)+_0x493fe6[_0x268348(0x132)]+_0x268348(0x173)+_0x6a559+_0x268348(0x166)+_0x2cdf38+'?');if(!_0x132552)return writeCliSideChannelLine(a123_0x3af0e7[_0x268348(0x138)]('\x20\x20Cancelled.')),{'ok':!![]};const _0x247d16=startSpinner(_0x268348(0x157)+_0x493fe6['length']+_0x268348(0x163));try{const _0x1135b8=await runMenuUpdateCore(_0x39d560[_0x268348(0x15f)],_0x39d560[_0x268348(0x13b)],JSON[_0x268348(0x15b)]({'jsUrl':_0x6a559,'cssUrl':_0x2cdf38}),{'mode':_0x101548,'force':_0x444891,'selection':{'all':![],'menuIds':_0x493fe6['map'](_0x1a0775=>_0x1a0775['id']),'paths':[]},'loadScriptMode':_0x56de84});return stopSpinner(_0x247d16,_0x268348(0x167)+_0x1135b8[_0x268348(0x14c)]+_0x268348(0x17a),_0x1135b8[_0x268348(0x13e)]===0x0),{'ok':_0x1135b8[_0x268348(0x13e)]===0x0,'data':_0x1135b8,'message':_0x1135b8['failed']>0x0?'Menu\x20update\x20completed:\x20'+_0x1135b8[_0x268348(0x14c)]+_0x268348(0x180)+_0x1135b8[_0x268348(0x13e)]+_0x268348(0x161):'Menu\x20update\x20completed:\x20'+_0x1135b8[_0x268348(0x14c)]+_0x268348(0x17e)};}catch(_0x3b7d48){stopSpinner(_0x247d16,_0x268348(0x172),![]);throw CliErrors[_0x268348(0x156)](_0x3b7d48 instanceof Error?_0x3b7d48['message']:_0x268348(0x172));}}};function ensureRunnableContext(_0x333b87,_0x1d40a8){const _0x3aea78=a123_0x34ba12,_0x4ba7a3=_0x333b87[_0x3aea78(0x160)]?String(_0x333b87[_0x3aea78(0x160)])[_0x3aea78(0x13c)]():'';if(!isInProject()&&!_0x1d40a8&&!_0x4ba7a3)throw CliErrors['validation'](_0x3aea78(0x130)+_0x3aea78(0x139));}function a123_0x4eeb(_0x2f9b6e,_0x12b994){_0x2f9b6e=_0x2f9b6e-0x128;const _0x238742=a123_0x2387();let _0x4eebe7=_0x238742[_0x2f9b6e];return _0x4eebe7;}function parseMode(_0x3fecdc){const _0x3f2aea=a123_0x34ba12;if(!_0x3fecdc)return _0x3f2aea(0x16a);if(_0x3fecdc===_0x3f2aea(0x12f)||_0x3fecdc===_0x3f2aea(0x16a))return _0x3fecdc;throw CliErrors[_0x3f2aea(0x156)](_0x3f2aea(0x152));}function parseSelection(_0x5c1934,_0x556ce9=!![]){const _0x5a00f0=a123_0x34ba12,_0x53e077=_0x5c1934[_0x5a00f0(0x162)]('all'),_0x4481ec=parseMenuIds(_0x5c1934[_0x5a00f0(0x14d)](_0x5a00f0(0x15e))),_0x38b0af=parseCsv(_0x5c1934[_0x5a00f0(0x14d)](_0x5a00f0(0x177))),_0x5cb3ea=_0x4481ec['length']>0x0||_0x38b0af[_0x5a00f0(0x132)]>0x0;if(_0x53e077&&_0x5cb3ea)throw CliErrors[_0x5a00f0(0x156)](_0x5a00f0(0x181));if(!_0x53e077&&!_0x5cb3ea){if(!_0x556ce9)return undefined;throw CliErrors[_0x5a00f0(0x156)](_0x5a00f0(0x12a));}return{'all':_0x53e077,'menuIds':_0x4481ec,'paths':_0x38b0af};}function parseMenuIds(_0x3ae575){const _0xf1b479=a123_0x34ba12,_0x3ec638=parseCsv(_0x3ae575),_0x39d3af=_0x3ec638[_0xf1b479(0x137)](Number);if(_0x39d3af[_0xf1b479(0x15a)](_0x56339c=>!Number['isSafeInteger'](_0x56339c)||_0x56339c<=0x0))throw CliErrors[_0xf1b479(0x156)](_0xf1b479(0x17b));return[...new Set(_0x39d3af)];}function parseCsv(_0x4b4ec2){const _0x4d01b1=a123_0x34ba12;return[...new Set(_0x4b4ec2['split'](',')[_0x4d01b1(0x137)](_0x5b561a=>_0x5b561a[_0x4d01b1(0x13c)]())[_0x4d01b1(0x165)](Boolean))];}function parseLoadScriptMode(_0x1257ad){const _0x5debbf=a123_0x34ba12;if(!_0x1257ad)return undefined;if(_0x1257ad==='import'||_0x1257ad===_0x5debbf(0x155)||_0x1257ad===_0x5debbf(0x14a))return _0x1257ad;throw CliErrors[_0x5debbf(0x156)](_0x5debbf(0x174));}function parseParams(_0x267510){const _0x2e1930=a123_0x34ba12;if(!_0x267510)return{};try{const _0x31544f=JSON[_0x2e1930(0x12c)](_0x267510);if(typeof _0x31544f!==_0x2e1930(0x134)||_0x31544f===null||Array[_0x2e1930(0x143)](_0x31544f))return{};return{'jsUrl':typeof _0x31544f[_0x2e1930(0x141)]===_0x2e1930(0x17f)?_0x31544f[_0x2e1930(0x141)][_0x2e1930(0x13c)]():undefined,'cssUrl':typeof _0x31544f[_0x2e1930(0x147)]===_0x2e1930(0x17f)?_0x31544f[_0x2e1930(0x147)]['trim']():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a124_0x2808(){const _0x9447bf=['number','description','30504oqZOWf','4827729paiyhj','type','WEBHOOK','Item\x20','504633BIZsln','EMAIL','Notification\x20channel\x20type','696510HJQbaM','\x20is\x20missing\x20required\x20field\x20\x22','WECOM','validation','read','4008SknSMn','DINGTALK','3763285mwjwjD','appCode','string','List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','channelType','7174104rRtRkQ','Invalid\x20--type:\x20','includes','configName','\x20notification\x20config(s)','Found\x20','5852acZwcO','updateTime','trim','notification','7nLjjLH','config-list','length','8289ddFAOn','map','6qqJSbu','8bmeUvI'];a124_0x2808=function(){return _0x9447bf;};return a124_0x2808();}const a124_0x3ed1a0=a124_0xb625;(function(_0x18a3b8,_0x40e0d6){const _0x3598b8=a124_0xb625,_0x349f1c=_0x18a3b8();while(!![]){try{const _0x32b9d7=-parseInt(_0x3598b8(0x1e0))/0x1*(-parseInt(_0x3598b8(0x1d7))/0x2)+-parseInt(_0x3598b8(0x1dc))/0x3+-parseInt(_0x3598b8(0x1d8))/0x4*(-parseInt(_0x3598b8(0x1ea))/0x5)+parseInt(_0x3598b8(0x1ef))/0x6*(parseInt(_0x3598b8(0x1f9))/0x7)+parseInt(_0x3598b8(0x1e8))/0x8*(-parseInt(_0x3598b8(0x1d5))/0x9)+parseInt(_0x3598b8(0x1e3))/0xa+-parseInt(_0x3598b8(0x1f5))/0xb*(parseInt(_0x3598b8(0x1db))/0xc);if(_0x32b9d7===_0x40e0d6)break;else _0x349f1c['push'](_0x349f1c['shift']());}catch(_0x1e4da6){_0x349f1c['push'](_0x349f1c['shift']());}}}(a124_0x2808,0xd2564));function a124_0xb625(_0x1da1de,_0x1385cd){_0x1da1de=_0x1da1de-0x1d5;const _0x280868=a124_0x2808();let _0xb62588=_0x280868[_0x1da1de];return _0xb62588;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{listNotificationChannelConfigs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const NOTIFICATION_CHANNEL_TYPES=['EMAIL','FEISHU',a124_0x3ed1a0(0x1e9),a124_0x3ed1a0(0x1e5),a124_0x3ed1a0(0x1de)];export const notificationConfigList={'service':a124_0x3ed1a0(0x1f8),'command':a124_0x3ed1a0(0x1fa),'description':a124_0x3ed1a0(0x1ed),'risk':a124_0x3ed1a0(0x1e7),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a124_0x3ed1a0(0x1dd),'type':a124_0x3ed1a0(0x1ec),'description':a124_0x3ed1a0(0x1e2),'enum':NOTIFICATION_CHANNEL_TYPES,'default':a124_0x3ed1a0(0x1e1)}],async 'validate'(_0x1bcd0e){readChannelType(_0x1bcd0e);},async 'execute'(_0x1533bf){const _0x1f8511=a124_0x3ed1a0,_0x59624d=readChannelType(_0x1533bf),_0x15c23d=await listNotificationChannelConfigs(_0x1533bf[_0x1f8511(0x1eb)],_0x59624d),_0x35f769=_0x15c23d[_0x1f8511(0x1d6)](projectNotificationConfig);return{'ok':!![],'data':{'appCode':_0x1533bf[_0x1f8511(0x1eb)],'channelType':_0x59624d,'count':_0x35f769[_0x1f8511(0x1fb)],'configs':_0x35f769},'message':_0x1f8511(0x1f4)+_0x35f769['length']+'\x20'+_0x59624d+_0x1f8511(0x1f3)};}};function readChannelType(_0x3fc75f){const _0x28c81d=a124_0x3ed1a0,_0x2ffe10=_0x3fc75f['str'](_0x28c81d(0x1dd))[_0x28c81d(0x1f7)]()||_0x28c81d(0x1e1);if(!NOTIFICATION_CHANNEL_TYPES[_0x28c81d(0x1f1)](_0x2ffe10))throw CliErrors[_0x28c81d(0x1e6)](_0x28c81d(0x1f0)+_0x2ffe10,'Allowed\x20values:\x20'+NOTIFICATION_CHANNEL_TYPES['join'](',\x20')+'.');return _0x2ffe10;}function projectNotificationConfig(_0x18d549,_0x55e88d){const _0x4f01fd=a124_0x3ed1a0;return{'id':typeof _0x18d549['id']===_0x4f01fd(0x1d9)?_0x18d549['id']:null,'configCode':requireConfigString(_0x18d549,'configCode',_0x55e88d),'configName':requireConfigString(_0x18d549,_0x4f01fd(0x1f2),_0x55e88d),'channelType':requireConfigString(_0x18d549,_0x4f01fd(0x1ee),_0x55e88d),'description':normalizeNullableString(_0x18d549[_0x4f01fd(0x1da)]),'createTime':normalizeNullableString(_0x18d549['createTime']),'updateTime':normalizeNullableString(_0x18d549[_0x4f01fd(0x1f6)])};}function requireConfigString(_0x3cf066,_0x42d9eb,_0x45f4e0){const _0x3f749e=a124_0x3ed1a0,_0x5f5222=_0x3cf066[_0x42d9eb];if(typeof _0x5f5222!==_0x3f749e(0x1ec)||_0x5f5222[_0x3f749e(0x1f7)]()==='')throw CliErrors['apiError']('Invalid\x20notification\x20config\x20response.',_0x3f749e(0x1df)+(_0x45f4e0+0x1)+_0x3f749e(0x1e4)+_0x42d9eb+'\x22.');return _0x5f5222['trim']();}function normalizeNullableString(_0x286656){const _0x1610d8=a124_0x3ed1a0;return typeof _0x286656===_0x1610d8(0x1ec)?_0x286656:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2eadcd,_0x2df53b){const _0xbbb66e=a125_0x1ea8,_0x31732e=_0x2eadcd();while(!![]){try{const _0x14a8cb=-parseInt(_0xbbb66e(0x1e8))/0x1+-parseInt(_0xbbb66e(0x1e7))/0x2+-parseInt(_0xbbb66e(0x1e4))/0x3*(parseInt(_0xbbb66e(0x1ea))/0x4)+-parseInt(_0xbbb66e(0x1e3))/0x5*(parseInt(_0xbbb66e(0x1eb))/0x6)+-parseInt(_0xbbb66e(0x1e6))/0x7*(-parseInt(_0xbbb66e(0x1ec))/0x8)+-parseInt(_0xbbb66e(0x1e9))/0x9+parseInt(_0xbbb66e(0x1e5))/0xa*(parseInt(_0xbbb66e(0x1ed))/0xb);if(_0x14a8cb===_0x2df53b)break;else _0x31732e['push'](_0x31732e['shift']());}catch(_0x565d32){_0x31732e['push'](_0x31732e['shift']());}}}(a125_0x181c,0xde43d));function a125_0x181c(){const _0x47422c=['3322823CclGVq','895644eMRabr','1253171rltFCV','1411452yAMPFg','1284duUUiw','30TexyGJ','8yeDRVW','3394061AfYcxT','1100170sfhWdC','11538LyHJDX','150jYKGcG'];a125_0x181c=function(){return _0x47422c;};return a125_0x181c();}import{notificationConfigList}from'../../commands/notification/config-list.js';function a125_0x1ea8(_0xd500c5,_0x768e7b){_0xd500c5=_0xd500c5-0x1e3;const _0x181c22=a125_0x181c();let _0x1ea8f2=_0x181c22[_0xd500c5];return _0x1ea8f2;}export const notificationDefinitions=[notificationConfigList];
|