@lovrabet/rabetbase-cli 2.5.1-beta.1 → 2.5.1-beta.3
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/api/generate-sdk-config-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/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.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/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.d.ts +1 -1
- package/lib/commands/config/init.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/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.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-restore.d.ts +107 -0
- package/lib/commands/dataset/field-restore.js +1 -0
- 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/dataset/user-deleted-field-list.d.ts +36 -0
- package/lib/commands/dataset/user-deleted-field-list.js +1 -0
- 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-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.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/table-diff-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/deployment/auto-sync.d.ts +28 -0
- package/lib/commands/deployment/auto-sync.js +1 -0
- package/lib/commands/deployment/index.d.ts +2 -0
- package/lib/commands/deployment/index.js +1 -0
- package/lib/commands/deployment/sync.d.ts +2 -0
- package/lib/commands/deployment/sync.js +1 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/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/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.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/external-link-update.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/rename.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/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.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/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.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/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.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/upgrade.js +1 -1
- package/lib/commands/registry.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/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/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.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/deployment-sync.d.ts +10 -0
- package/lib/config/deployment-sync.js +1 -0
- package/lib/config/domain-config.d.ts +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-routing.js +1 -1
- package/lib/config/schema.d.ts +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.d.ts +2 -0
- 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/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.d.ts +2 -0
- 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.d.ts +35 -16
- 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/kb-search-client.d.ts +30 -0
- package/lib/core/kb-search-client.js +1 -0
- 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.d.ts +5 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.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/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/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
- package/skills/rabetbase/SKILL.md +12 -6
- package/skills/rabetbase/references/rabetbase-config.md +4 -1
- package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +9 -9
- package/skills/rabetbase/references/rabetbase-dataset-business-groups.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-field-restore.md +59 -0
- package/skills/rabetbase/references/rabetbase-dataset-user-deleted-field-list.md +47 -0
- package/skills/rabetbase/references/rabetbase-deployment-sync.md +92 -0
- package/skills/rabetbase/references/rabetbase-doctor.md +1 -1
- package/skills/rabetbase/references/rabetbase-init.md +2 -0
- package/skills/rabetbase/references/rabetbase-kb.md +7 -7
- package/skills/rabetbase.manifest.json +6 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1fac32,_0x19f9eb){const _0x3b5680=a130_0x3d45,_0x1f4136=_0x1fac32();while(!![]){try{const _0x5e6a55=-parseInt(_0x3b5680(0x156))/0x1*(parseInt(_0x3b5680(0x152))/0x2)+-parseInt(_0x3b5680(0x15a))/0x3*(-parseInt(_0x3b5680(0x172))/0x4)+parseInt(_0x3b5680(0x15c))/0x5+-parseInt(_0x3b5680(0x160))/0x6*(-parseInt(_0x3b5680(0x167))/0x7)+parseInt(_0x3b5680(0x14e))/0x8*(parseInt(_0x3b5680(0x169))/0x9)+parseInt(_0x3b5680(0x168))/0xa*(parseInt(_0x3b5680(0x157))/0xb)+-parseInt(_0x3b5680(0x14c))/0xc;if(_0x5e6a55===_0x19f9eb)break;else _0x1f4136['push'](_0x1f4136['shift']());}catch(_0xff87a6){_0x1f4136['push'](_0x1f4136['shift']());}}}(a130_0x5107,0x611a3));import a130_0x1d1a85 from'chalk';function a130_0x3d45(_0x4b0292,_0x29c558){_0x4b0292=_0x4b0292-0x149;const _0x510787=a130_0x5107();let _0x3d451d=_0x510787[_0x4b0292];return _0x3d451d;}import{checkbox,input,confirm}from'@inquirer/prompts';import a130_0xdd5249 from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{CliErrors}from'../../../errors.js';function a130_0x5107(){const _0xe285f8=['3Mczris','\x20\x20CSS\x20URL:','38405xLYBxm','CSS\x20URL\x20checked','test','stdin','2193762FYHjwk','error','No\x20local\x20pages\x20found.','has','ExitPromptError','name','Cancelled.','7DPalUl','2547530GjTGtB','23211drCLfW','cyan','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','catch','path','fail','succeed','trim','630052SjNjVR','JS\x20URL\x20check\x20failed','[already\x20on\x20platform]','gray','[new]','1880784gDUrur','red','968DmnIxk','green','CSS\x20URL\x20check\x20failed','cancelled','4DqsGfq','This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20','start','label','271585LkcfVu','11OEPDpB','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','length'];a130_0x5107=function(){return _0xe285f8;};return a130_0x5107();}function onCancel(_0x5e139e){const _0x448e1=a130_0x3d45;return _0x5e139e[_0x448e1(0x16d)](_0x3072f8=>{const _0x8ef4dd=_0x448e1;if(_0x3072f8?.[_0x8ef4dd(0x165)]===_0x8ef4dd(0x164))throw CliErrors[_0x8ef4dd(0x151)](_0x8ef4dd(0x166));throw _0x3072f8;});}export function startSpinner(_0x41a614){const _0x17cdc0=a130_0x3d45;return a130_0xdd5249({'text':_0x41a614,'color':_0x17cdc0(0x16a)})[_0x17cdc0(0x154)]();}export function stopSpinner(_0x258f81,_0x3a7c47,_0x256a1b){const _0x270e4c=a130_0x3d45;_0x256a1b?_0x258f81[_0x270e4c(0x170)](_0x3a7c47):_0x258f81[_0x270e4c(0x16f)](_0x3a7c47);}export async function askConfirm(_0x1696aa){return onCancel(confirm({'message':_0x1696aa,'theme':{'prefix':''}}));}export async function askJsUrl(_0x8e6730){const _0x3f7db5=a130_0x3d45;while(!![]){const _0x52f442=await onCancel(input({'message':'\x20\x20JS\x20URL:','default':_0x8e6730,'theme':{'prefix':''}}));if(_0x52f442[_0x3f7db5(0x171)]()==='')throw CliErrors[_0x3f7db5(0x151)](_0x3f7db5(0x166));if(!/^https:\/\/.+\.js(\?.*)?$/[_0x3f7db5(0x15e)](_0x52f442[_0x3f7db5(0x171)]())){console[_0x3f7db5(0x161)](a130_0x1d1a85['red'](_0x3f7db5(0x158)));continue;}const _0x317b06=startSpinner('\x20\x20Checking\x20JS\x20URL\x20reachability...');try{const _0x12176e=await isUrlReachable(_0x52f442[_0x3f7db5(0x171)]());stopSpinner(_0x317b06,'JS\x20URL\x20checked',_0x12176e);if(!_0x12176e){console['error'](a130_0x1d1a85['red'](_0x3f7db5(0x16b)));continue;}return _0x52f442[_0x3f7db5(0x171)]();}catch(_0x39d3ce){stopSpinner(_0x317b06,_0x3f7db5(0x173),![]);throw _0x39d3ce;}}}export async function askCssUrl(_0x40c4de){const _0x5ae1d8=a130_0x3d45;while(!![]){const _0x5b4fc6=await onCancel(input({'message':_0x5ae1d8(0x15b),'default':_0x40c4de,'theme':{'prefix':''}}));if(_0x5b4fc6[_0x5ae1d8(0x171)]()==='')throw CliErrors[_0x5ae1d8(0x151)](_0x5ae1d8(0x166));if(!/^https:\/\/.+\.css(\?.*)?$/['test'](_0x5b4fc6['trim']())){console[_0x5ae1d8(0x161)](a130_0x1d1a85[_0x5ae1d8(0x14d)]('\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'));continue;}const _0x3bf236=startSpinner('\x20\x20Checking\x20CSS\x20URL\x20reachability...');try{const _0x55b1ef=await isUrlReachable(_0x5b4fc6[_0x5ae1d8(0x171)]());stopSpinner(_0x3bf236,_0x5ae1d8(0x15d),_0x55b1ef);if(!_0x55b1ef){console[_0x5ae1d8(0x161)](a130_0x1d1a85[_0x5ae1d8(0x14d)]('\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable'));continue;}return _0x5b4fc6[_0x5ae1d8(0x171)]();}catch(_0x689ca5){stopSpinner(_0x3bf236,_0x5ae1d8(0x150),![]);throw _0x689ca5;}}}export async function selectPages(_0x257a72,_0x1f4ee3){const _0x30a245=a130_0x3d45,_0x35647f=_0x257a72['map'](_0x44134e=>{const _0x19b512=a130_0x3d45,_0x20625d=_0x1f4ee3[_0x19b512(0x163)](_0x44134e[_0x19b512(0x16e)]);return{'name':_0x44134e[_0x19b512(0x155)]+'\x20\x20'+a130_0x1d1a85[_0x19b512(0x14a)](_0x44134e[_0x19b512(0x16e)])+'\x20\x20'+(_0x20625d?a130_0x1d1a85[_0x19b512(0x14a)](_0x19b512(0x149)):a130_0x1d1a85[_0x19b512(0x14f)](_0x19b512(0x14b))),'value':_0x44134e[_0x19b512(0x16e)],'checked':!_0x20625d,'disabled':_0x20625d};});if(_0x35647f[_0x30a245(0x159)]===0x0)throw new Error(_0x30a245(0x162));const _0x5f0219=await onCancel(checkbox({'message':_0x30a245(0x16c),'choices':_0x35647f,'loop':![],'theme':{'prefix':''}}));if(_0x5f0219[_0x30a245(0x159)]===0x0)throw new Error('No\x20menus\x20selected.');return _0x257a72['filter'](_0x11c365=>_0x5f0219['includes'](_0x11c365['path']));}export function isInteractive(){const _0x38c664=a130_0x3d45;return process[_0x38c664(0x15f)]['isTTY']===!![];}export function requireInteractive(){const _0x303722=a130_0x3d45;if(!isInteractive())throw new Error(_0x303722(0x153)+'Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x189b78=a131_0x2330;(function(_0x3de392,_0x54ec6a){const _0x3caf14=a131_0x2330,_0xa7105b=_0x3de392();while(!![]){try{const _0x55ee0f=-parseInt(_0x3caf14(0x12e))/0x1+-parseInt(_0x3caf14(0x13e))/0x2+parseInt(_0x3caf14(0x13a))/0x3*(parseInt(_0x3caf14(0x12f))/0x4)+-parseInt(_0x3caf14(0x134))/0x5*(-parseInt(_0x3caf14(0x13f))/0x6)+-parseInt(_0x3caf14(0x140))/0x7+parseInt(_0x3caf14(0x137))/0x8+parseInt(_0x3caf14(0x131))/0x9;if(_0x55ee0f===_0x54ec6a)break;else _0xa7105b['push'](_0xa7105b['shift']());}catch(_0x228301){_0xa7105b['push'](_0xa7105b['shift']());}}}(a131_0x2a56,0x426bc));import{readdirSync,statSync,readFileSync}from'fs';function a131_0x2330(_0x344ed4,_0x53b4d3){_0x344ed4=_0x344ed4-0x12c;const _0x2a5659=a131_0x2a56();let _0x2330bc=_0x2a5659[_0x344ed4];return _0x2330bc;}import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process['cwd'](),a131_0x189b78(0x142));function a131_0x2a56(){const _0x5c16f2=['trim','465089PsAEwF','974968zYmqYH','join','7047909RNKXhh','replace','match','5IXYZCO','filter','endsWith','3635400NUwxfC','forEach','utf-8','3JiguRm','path','index.tsx','push','951942PGufWY','519936ICYrRR','2483628doYRRW','replaceAll','src/pages','slice','split'];a131_0x2a56=function(){return _0x5c16f2;};return a131_0x2a56();}export function extractTitleFromComment(_0x4db937){const _0x19fe01=a131_0x189b78;try{const _0x189c5d=readFileSync(_0x4db937,_0x19fe01(0x139)),_0x475156=_0x189c5d[_0x19fe01(0x133)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x475156&&_0x475156[0x1]){const _0x25fb38=_0x475156[0x1],_0x604275=_0x25fb38[_0x19fe01(0x133)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x604275&&_0x604275[0x1])return _0x604275[0x1][_0x19fe01(0x12d)]();}let _0x4b3ea1=null;const _0x5251cf=_0x189c5d[_0x19fe01(0x133)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x5251cf&&_0x5251cf[0x1]&&(_0x4b3ea1=_0x5251cf[0x1]);if(!_0x4b3ea1){const _0x195502=_0x189c5d[_0x19fe01(0x133)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x195502&&_0x195502[0x1]&&(_0x4b3ea1=_0x195502[0x1]);}if(_0x4b3ea1){const _0x2cc84c=new RegExp('\x5cb'+_0x4b3ea1+'\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]'),_0x2cde08=_0x189c5d[_0x19fe01(0x133)](_0x2cc84c);if(_0x2cde08&&_0x2cde08[0x1])return _0x2cde08[0x1];return _0x4b3ea1;}return null;}catch(_0x396a45){return null;}}export function getLocalPages(_0x38ee5e=pagesDir,_0x3bd916=pagesDir){const _0x51d612=a131_0x189b78;let _0x4ddda1=[];const _0x457c8a=readdirSync(_0x38ee5e);return _0x457c8a[_0x51d612(0x138)](_0x2c8bcc=>{const _0x290cec=_0x51d612,_0x3f39b0=join(_0x38ee5e,_0x2c8bcc),_0x1fc922=statSync(_0x3f39b0);if(_0x1fc922&&_0x1fc922['isDirectory']())_0x4ddda1=_0x4ddda1['concat'](getLocalPages(_0x3f39b0,_0x3bd916));else{if(_0x2c8bcc[_0x290cec(0x136)]('.tsx')){let _0xc19e26=relative(_0x3bd916,_0x3f39b0);_0xc19e26[_0x290cec(0x136)](_0x290cec(0x13c))?_0xc19e26=_0xc19e26[_0x290cec(0x132)](/index\.tsx$/,''):_0xc19e26=_0xc19e26[_0x290cec(0x132)](/\.tsx$/,'');_0xc19e26[_0x290cec(0x136)](sep)&&(_0xc19e26=_0xc19e26[_0x290cec(0x143)](0x0,-0x1));const _0x135d1e=_0xc19e26[_0x290cec(0x12c)](sep)[_0x290cec(0x130)]('/'),_0x1742f6=extractTitleFromComment(_0x3f39b0),_0x4b8a3a=_0x1742f6||_0x135d1e;_0x4ddda1[_0x290cec(0x13d)]({'path':_0x135d1e[_0x290cec(0x141)]('$',':'),'label':_0x4b8a3a});}}}),_0x4ddda1[_0x51d612(0x135)](_0x47c0b2=>_0x47c0b2[_0x51d612(0x13b)]!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a132_0x5107(){const _0x28f3fd=['1433724gfYZzs','1462782rzuRdo','push','5104310gWaZqK','2209960auBECg','filter','length','1594406DkXlLU','errors','has','resources','4296KFQWVx','20419SMNVfi','label','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','path','420332wfaPXA','CSS\x20URL\x20is\x20unreachable'];a132_0x5107=function(){return _0x28f3fd;};return a132_0x5107();}(function(_0x2d9e1a,_0x408b9b){const _0x1b5a66=a132_0x2c40,_0x2816af=_0x2d9e1a();while(!![]){try{const _0xc0d951=-parseInt(_0x1b5a66(0x1fb))/0x1+-parseInt(_0x1b5a66(0x1f2))/0x2+-parseInt(_0x1b5a66(0x1fe))/0x3+-parseInt(_0x1b5a66(0x1ef))/0x4+parseInt(_0x1b5a66(0x200))/0x5+parseInt(_0x1b5a66(0x1fd))/0x6+parseInt(_0x1b5a66(0x1f7))/0x7*(parseInt(_0x1b5a66(0x1f6))/0x8);if(_0xc0d951===_0x408b9b)break;else _0x2816af['push'](_0x2816af['shift']());}catch(_0x3f6fe6){_0x2816af['push'](_0x2816af['shift']());}}}(a132_0x5107,0x8ad32));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';export function validateJsUrl(_0x4586de){const _0x4add4b=a132_0x2c40,_0x4655b8=[];return!isValidJsHttpsUrl(_0x4586de)&&_0x4655b8['push'](_0x4add4b(0x1f9)),{'ok':_0x4655b8[_0x4add4b(0x1f1)]===0x0,'errors':_0x4655b8};}function a132_0x2c40(_0x5970a4,_0x4b1040){_0x5970a4=_0x5970a4-0x1ef;const _0x51071c=a132_0x5107();let _0x2c40d9=_0x51071c[_0x5970a4];return _0x2c40d9;}export function validateCssUrl(_0x129295){const _0x291b09=a132_0x2c40,_0xd9d3ed=[];return!isValidCssHttpsUrl(_0x129295)&&_0xd9d3ed[_0x291b09(0x1ff)]('CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'),{'ok':_0xd9d3ed[_0x291b09(0x1f1)]===0x0,'errors':_0xd9d3ed};}export async function validateJsUrlReachable(_0x1a9c9c){const _0x362263=a132_0x2c40,_0x3e94f8=validateJsUrl(_0x1a9c9c);if(!_0x3e94f8['ok'])return _0x3e94f8;const _0x184a77=await isUrlReachable(_0x1a9c9c);if(!_0x184a77)_0x3e94f8[_0x362263(0x1f3)][_0x362263(0x1ff)]('JS\x20URL\x20is\x20unreachable');return{'ok':_0x3e94f8[_0x362263(0x1f3)][_0x362263(0x1f1)]===0x0,'errors':_0x3e94f8['errors']};}export async function validateCssUrlReachable(_0xd23d8c){const _0x7246b0=a132_0x2c40,_0xa446eb=validateCssUrl(_0xd23d8c);if(!_0xa446eb['ok'])return _0xa446eb;const _0x90c6cb=await isUrlReachable(_0xd23d8c);if(!_0x90c6cb)_0xa446eb['errors'][_0x7246b0(0x1ff)](_0x7246b0(0x1fc));return{'ok':_0xa446eb[_0x7246b0(0x1f3)][_0x7246b0(0x1f1)]===0x0,'errors':_0xa446eb[_0x7246b0(0x1f3)]};}export function buildCompareRows(_0xfd751e,_0x122947){const _0x2da3b9=a132_0x2c40;return _0xfd751e['map'](_0x58fd58=>({'label':_0x58fd58[_0x2da3b9(0x1f8)],'path':_0x58fd58[_0x2da3b9(0x1fa)],'local':!![],'online':_0x122947[_0x2da3b9(0x1f4)](_0x58fd58[_0x2da3b9(0x1fa)])}));}export async function doCreateMenus(_0x45f300,_0x21d692,_0x28b4b7,_0x26ac98){const _0x1681d2=a132_0x2c40,_0x87300d=await createMenus(_0x45f300,_0x21d692,_0x28b4b7,_0x26ac98);return{'created':_0x87300d[_0x1681d2(0x1f1)],'failed':0x0,'labels':_0x28b4b7['map'](_0x287c4a=>_0x287c4a[_0x1681d2(0x1f8)]),'menus':_0x87300d};}export function filterMenusWithResources(_0x72e6a9){const _0xd62240=a132_0x2c40;return _0x72e6a9[_0xd62240(0x1f0)](_0x1a437a=>_0x1a437a[_0xd62240(0x1f5)][_0xd62240(0x1f1)]>0x0);}export async function fetchMenuData(_0x1751e7,_0x11ebfb){const _0x1c876b=a132_0x2c40,_0x1ba842=getLocalPages(),_0x349cfe=await getOnlineMenuList(_0x1751e7,_0x11ebfb),_0xb5d5be=new Set(_0x349cfe['map'](_0x32b92e=>_0x32b92e[_0x1c876b(0x1fa)]));return{'localPages':_0x1ba842,'onlineMenuList':_0x349cfe,'onlinePaths':_0xb5d5be};}export async function fetchOnlineMenuList(_0x13e48e,_0x17ae57){return getOnlineMenuList(_0x13e48e,_0x17ae57);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a128_0x4085a2=a128_0x52e5;(function(_0x221d2d,_0x30e535){const _0x504439=a128_0x52e5,_0x187885=_0x221d2d();while(!![]){try{const _0x1f3120=parseInt(_0x504439(0x9b))/0x1+parseInt(_0x504439(0x9a))/0x2*(-parseInt(_0x504439(0x73))/0x3)+-parseInt(_0x504439(0x69))/0x4*(-parseInt(_0x504439(0x82))/0x5)+-parseInt(_0x504439(0xa9))/0x6+-parseInt(_0x504439(0x8c))/0x7*(-parseInt(_0x504439(0x80))/0x8)+parseInt(_0x504439(0xb5))/0x9+-parseInt(_0x504439(0x85))/0xa;if(_0x1f3120===_0x30e535)break;else _0x187885['push'](_0x187885['shift']());}catch(_0x394643){_0x187885['push'](_0x187885['shift']());}}}(a128_0x3bb7,0x45ee2));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':a128_0x4085a2(0x91),'required':!![],'description':a128_0x4085a2(0xd2)};export const MENU_SORT_FLAG={'name':'sort','type':a128_0x4085a2(0x91),'description':a128_0x4085a2(0x7f)};export const MENU_PARENT_ID_FLAG={'name':a128_0x4085a2(0x7d),'type':a128_0x4085a2(0x74),'description':a128_0x4085a2(0x92)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a128_0x4085a2(0xa0),'type':a128_0x4085a2(0x74),'description':a128_0x4085a2(0x89)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':'expect-path','type':a128_0x4085a2(0x74),'description':'Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches'},{'name':'expected-children-count','type':a128_0x4085a2(0x91),'description':a128_0x4085a2(0x8e)}];function a128_0x52e5(_0x1493b6,_0x1dbd29){_0x1493b6=_0x1493b6-0x66;const _0x3bb796=a128_0x3bb7();let _0x52e54c=_0x3bb796[_0x1493b6];return _0x52e54c;}export function validateExactId(_0x346532){const _0x21bda5=a128_0x4085a2,_0x3c6748=_0x346532[_0x21bda5(0x6e)]('id');if(!Number[_0x21bda5(0xa1)](_0x3c6748)||_0x3c6748<=0x0)throw CliErrors[_0x21bda5(0x67)](_0x21bda5(0x90));return _0x3c6748;}export function validateSort(_0x1e34af,_0x201427=a128_0x4085a2(0x87)){const _0x53b8b7=a128_0x4085a2;if(!hasFlag(_0x1e34af,_0x201427))return undefined;const _0x1b18b2=_0x1e34af[_0x53b8b7(0x6e)](_0x201427);if(!Number[_0x53b8b7(0xa1)](_0x1b18b2)||_0x1b18b2<0x0||_0x1b18b2>MAX_MENU_SORT)throw menuError(_0x53b8b7(0x9d),'--'+_0x201427+_0x53b8b7(0xc8)+MAX_MENU_SORT+'.','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.');return _0x1b18b2;}export function nextSiblingSort(_0xa83f58,_0x55e9d4,_0x296922){const _0x2999b6=a128_0x4085a2,_0x169838=getChildren(_0xa83f58,_0x55e9d4)[_0x2999b6(0xbd)](_0xe8433d=>_0xe8433d[_0x2999b6(0x87)])[_0x2999b6(0x7e)](_0x3a37b5=>typeof _0x3a37b5===_0x2999b6(0x91));if(_0x169838[_0x2999b6(0x71)]===0x0)return 0x0;const _0x14543e=Math[_0x2999b6(0x66)](..._0x169838);if(_0x14543e>=MAX_MENU_SORT)throw menuError(_0x2999b6(0xa2),_0x2999b6(0xc2)+_0x296922+_0x2999b6(0xaf)+_0x14543e+'.','Reorder\x20sibling\x20menus\x20below\x20'+MAX_MENU_SORT+',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.');return _0x14543e+0x1;}export function requireExplicitYes(_0x4c0df2){const _0xbf6e1c=a128_0x4085a2;if(_0x4c0df2[_0xbf6e1c(0x75)]('dry-run'))return;if(!_0x4c0df2['bool']('yes'))throw menuError(_0xbf6e1c(0xd0),_0xbf6e1c(0x88),_0xbf6e1c(0xc7));}export async function fetchMutationSnapshot(_0x3bc472,_0x3e4422,_0x579ffe){const _0x5d69b0=a128_0x4085a2;try{return await fetchMenuSnapshot(_0x3bc472[_0x5d69b0(0xa5)],_0x3bc472['cookie']);}catch(_0x30193b){throw mapMenuApiError(_0x30193b,'read\x20online\x20menu\x20facts\x20before\x20'+_0x3e4422,_0x579ffe);}}export async function recheckMutationSnapshot(_0x36d5ea,_0xe49da0,_0x3b2228,_0x3e788f){const _0x5301cb=a128_0x4085a2;let _0x2af68d;try{_0x2af68d=await fetchMenuSnapshot(_0x36d5ea[_0x5301cb(0xa5)],_0x36d5ea[_0x5301cb(0xab)]);}catch(_0x320137){const _0x453da4=mapMenuApiError(_0x320137,_0x5301cb(0xb2)+_0x3b2228,_0x3e788f);throw menuFailure(_0x453da4,_0xe49da0,{'stage':_0x5301cb(0xb8),'failed':_0x3e788f==null?{}:{'id':_0x3e788f}});}if(_0x2af68d[_0x5301cb(0xba)]!==_0xe49da0[_0x5301cb(0xa4)]){const _0x108c26=menuError('menu_state_drift',_0x5301cb(0x68)+_0x3b2228+';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.',_0x5301cb(0xb1));throw menuFailure(_0x108c26,_0xe49da0,{'stage':_0x5301cb(0xb8),'failed':{..._0x3e788f==null?{}:{'id':_0x3e788f},'expectedSnapshotHash':_0xe49da0[_0x5301cb(0xa4)],'currentSnapshotHash':_0x2af68d['hash']}});}return _0x2af68d;}export function parseParentId(_0x49cc9b,_0x584a1a,_0xc8d57e={}){const _0x1822e3=a128_0x4085a2;if(!hasFlag(_0x49cc9b,_0x584a1a)){if(_0xc8d57e[_0x1822e3(0xac)])throw CliErrors[_0x1822e3(0xb9)](_0x584a1a);return undefined;}const _0xdaa948=_0x49cc9b[_0x1822e3(0x6f)](_0x584a1a)[_0x1822e3(0xa6)]();if(_0xdaa948[_0x1822e3(0x70)]()===_0x1822e3(0x7b))return null;if(!/^\d+$/['test'](_0xdaa948))throw CliErrors[_0x1822e3(0x67)]('--'+_0x584a1a+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');const _0x1cd2ab=Number(_0xdaa948);if(!Number[_0x1822e3(0xa1)](_0x1cd2ab)||_0x1cd2ab<=0x0)throw CliErrors['validation']('--'+_0x584a1a+_0x1822e3(0xcb));return _0x1cd2ab;}export function requireMenu(_0x17f099,_0x1e1304){const _0x18b34c=a128_0x4085a2,_0x52c0ed=_0x17f099[_0x18b34c(0xce)]['get'](_0x1e1304);if(!_0x52c0ed)throw menuError('menu_not_found',_0x18b34c(0xca)+_0x1e1304,_0x18b34c(0xc5));return _0x52c0ed;}export function requireFolder(_0x59aa77,_0x479a91){const _0x3f30f3=a128_0x4085a2,_0x3e09ac=requireMenu(_0x59aa77,_0x479a91);if(_0x3e09ac[_0x3f30f3(0xad)]!=='folder')throw menuError(_0x3f30f3(0xc3),_0x3f30f3(0x6b)+_0x479a91+_0x3f30f3(0x6a)+(_0x3e09ac[_0x3f30f3(0xad)]||_0x3f30f3(0x94))+_0x3f30f3(0x9e),_0x3f30f3(0x76));return _0x3e09ac;}export function assertExpectedState(_0x491cd2,_0x56a170){const _0x3bedeb=a128_0x4085a2;if(hasFlag(_0x491cd2,_0x3bedeb(0xa0))){const _0xf661bb=parseParentId(_0x491cd2,_0x3bedeb(0xa0),{'required':!![]});if(_0x56a170['parentId']!==_0xf661bb)throw stateDrift(_0x3bedeb(0x6b)+_0x56a170['id']+_0x3bedeb(0x8f)+formatParent(_0xf661bb)+_0x3bedeb(0x77)+formatParent(_0x56a170[_0x3bedeb(0xc9)])+'.');}if(hasFlag(_0x491cd2,'expect-path')){const _0x2bfe58=_0x491cd2[_0x3bedeb(0x6f)](_0x3bedeb(0xa3));if(_0x56a170[_0x3bedeb(0xb4)]!==_0x2bfe58)throw stateDrift(_0x3bedeb(0x6b)+_0x56a170['id']+_0x3bedeb(0xb7)+JSON['stringify'](_0x2bfe58)+_0x3bedeb(0x77)+JSON[_0x3bedeb(0xd1)](_0x56a170[_0x3bedeb(0xb4)])+'.');}if(hasFlag(_0x491cd2,_0x3bedeb(0x83))){const _0x4b77bb=_0x491cd2[_0x3bedeb(0x6e)](_0x3bedeb(0x83));if(!Number[_0x3bedeb(0xa1)](_0x4b77bb)||_0x4b77bb<0x0)throw CliErrors['validation'](_0x3bedeb(0x8a));if(_0x56a170[_0x3bedeb(0xbc)]!==_0x4b77bb)throw stateDrift(_0x3bedeb(0x6b)+_0x56a170['id']+_0x3bedeb(0xbf)+_0x4b77bb+',\x20current\x20'+_0x56a170[_0x3bedeb(0xbc)]+'.');}}export function assertVerified(_0x2ccd10,_0x53fc19,_0x136c76='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){const _0x5301af=a128_0x4085a2;if(!_0x2ccd10)throw menuError(_0x5301af(0x86),_0x53fc19,_0x136c76);}export function mutationResult(_0xb11b30){const _0x158262=a128_0x4085a2;return{'operation':_0xb11b30[_0x158262(0xb0)],'selector':_0xb11b30[_0x158262(0x93)],'before':_0xb11b30[_0x158262(0x84)],'after':_0xb11b30['after'],'dryRun':_0xb11b30[_0x158262(0xc4)],'backend':_0xb11b30[_0x158262(0x96)],..._0xb11b30[_0x158262(0x99)]?{'plannedActions':_0xb11b30[_0x158262(0x99)]}:{},..._0xb11b30[_0x158262(0x97)]?{'targets':_0xb11b30[_0x158262(0x97)]}:{},..._0xb11b30[_0x158262(0x7c)]?{'deleteOrder':_0xb11b30['deleteOrder']}:{},'snapshotHash':_0xb11b30[_0x158262(0xa4)],..._0xb11b30[_0x158262(0xbb)]?{'cascade':_0xb11b30['cascade']}:{},..._0xb11b30[_0x158262(0xb6)]?{'planFile':_0xb11b30[_0x158262(0xb6)]}:{},'succeeded':_0xb11b30['succeeded']??[],'failed':_0xb11b30['failed']??[],'warnings':_0xb11b30[_0x158262(0x78)]??[],'verification':_0xb11b30[_0x158262(0x79)],'error':_0xb11b30[_0x158262(0xbe)]};}export function menuDryRunResult(_0xdf77b0,_0x25e9f7){return{..._0xdf77b0,..._0x25e9f7};}export function menuFailure(_0x681425,_0x1639e7,_0x567368){const _0x3468af=a128_0x4085a2,_0x39e008=mutationResult({..._0x1639e7,'after':_0x567368[_0x3468af(0xcd)]===undefined?_0x1639e7[_0x3468af(0xcd)]:_0x567368[_0x3468af(0xcd)],'backend':_0x567368[_0x3468af(0x96)]??_0x1639e7[_0x3468af(0x96)],'dryRun':![],'succeeded':_0x567368[_0x3468af(0xb3)]??[],'failed':_0x567368[_0x3468af(0x81)]??[{..._0x567368[_0x3468af(0xa7)]??{},'stage':_0x567368[_0x3468af(0xcf)],'code':_0x681425[_0x3468af(0xc1)],'message':_0x681425['message']}],'warnings':[..._0x1639e7[_0x3468af(0x78)],..._0x567368[_0x3468af(0x78)]??[]],'verification':_0x567368[_0x3468af(0x79)],'error':{'code':_0x681425[_0x3468af(0xc1)],'message':_0x681425[_0x3468af(0x95)],..._0x681425[_0x3468af(0xcc)]?{'hint':_0x681425[_0x3468af(0xcc)]}:{}}});return Object[_0x3468af(0x7a)](_0x681425,_0x3468af(0x8b),{'value':_0x39e008,'enumerable':!![],'configurable':!![]}),_0x681425;}export function asVerificationError(_0x2093ba,_0x45d54d){const _0x5cdea6=a128_0x4085a2;if(_0x2093ba instanceof CliError&&_0x2093ba[_0x5cdea6(0xc1)]==='menu_verification_failed')return _0x2093ba;const _0x218459=_0x2093ba instanceof Error?_0x2093ba[_0x5cdea6(0x95)]:String(_0x2093ba);return menuError('menu_verification_failed',''+_0x45d54d+(_0x218459?':\x20'+_0x218459:''),'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(_0xaac314,_0x38873a,_0x3eccc3){const _0x1a04d7=a128_0x4085a2,_0xd1b144=mapMenuApiError(_0xaac314,_0x38873a,_0x3eccc3);return{'causeCode':_0xd1b144[_0x1a04d7(0xc1)],'causeMessage':_0xd1b144['message']};}export function hasFlag(_0x9f41d1,_0x160482){const _0xecf18e=a128_0x4085a2;return Object[_0xecf18e(0xa8)][_0xecf18e(0xc6)][_0xecf18e(0xaa)](_0x9f41d1[_0xecf18e(0x98)],_0x160482)&&_0x9f41d1[_0xecf18e(0x98)][_0x160482]!==undefined;}export function toApiParentId(_0x4a5a24){return _0x4a5a24??0x0;}function a128_0x3bb7(){const _0x2bf640=['unknown','message','backend','targets','rawFlags','plannedActions','144372lxiwHN','154345GhFoJo','test','menu_sort_invalid','\x22,\x20not\x20folder.','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','expect-parent-id','isSafeInteger','menu_sort_overflow','expect-path','snapshotHash','appCode','trim','failed','prototype','3003486dYOekA','call','cookie','required','type','menu_permission_denied','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','operation','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','recheck\x20online\x20menu\x20facts\x20before\x20','succeeded','path','2904669oiZNou','planFile','\x20path\x20changed:\x20expected\x20','pre-write-recheck','flagMissing','hash','cascade','childrenCount','map','error','\x20child\x20count\x20changed:\x20expected\x20','api_error','code','Cannot\x20append\x20a\x20','menu_parent_not_folder','dryRun','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','hasOwnProperty','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','parentId','Online\x20menu\x20not\x20found:\x20','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','hint','after','byId','stage','menu_confirmation_required','stringify','Exact\x20online\x20menu\x20id','max','validation','Online\x20menu\x20state\x20changed\x20before\x20','4iKqQut','\x20is\x20type\x20\x22','Menu\x20','\x20menu\x20','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','num','str','toLowerCase','length','Permission\x20denied\x20while\x20attempting\x20to\x20','15OWZhaO','string','bool','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.',',\x20current\x20','warnings','verification','defineProperty','root','deleteOrder','parent-id','filter','Sibling\x20sort\x20value\x20(non-negative\x20integer)','1895456WsYzPI','failedRecords','1786565gtRSvr','expected-children-count','before','1603180JURGac','menu_verification_failed','sort','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','data','14jSMaTo','menu_state_drift','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','\x20parent\x20changed:\x20expected\x20','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','number','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','selector'];a128_0x3bb7=function(){return _0x2bf640;};return a128_0x3bb7();}export function formatParent(_0x304bc7){return _0x304bc7==null?'root':String(_0x304bc7);}export function menuError(_0x484f94,_0x4e7748,_0x400a5a){return new CliError(_0x484f94,0x1,_0x4e7748,_0x400a5a);}export function mapMenuApiError(_0x51ddad,_0x4d22b1,_0x33aab9){const _0x33896f=a128_0x4085a2;if(_0x51ddad instanceof CliError&&_0x51ddad[_0x33896f(0xc1)]!==_0x33896f(0xc0))return _0x51ddad;const _0x2e63e6=_0x51ddad instanceof Error?_0x51ddad[_0x33896f(0x95)]:String(_0x51ddad);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x33896f(0x9c)](_0x2e63e6))return menuError(_0x33896f(0xae),_0x33896f(0x72)+_0x4d22b1+(_0x33aab9?_0x33896f(0x6c)+_0x33aab9:'')+'.',_0x33896f(0x6d));return menuError('menu_mutation_failed','Failed\x20to\x20'+_0x4d22b1+(_0x33aab9?_0x33896f(0x6c)+_0x33aab9:'')+':\x20'+_0x2e63e6,_0x33896f(0x9f));}export function isMenuResponseLoss(_0x292a68){const _0x143f28=a128_0x4085a2,_0x590ce6=_0x292a68 instanceof Error?_0x292a68[_0x143f28(0x95)]:String(_0x292a68);if(_0x292a68 instanceof CliError)return _0x292a68[_0x143f28(0xc1)]===_0x143f28(0xc0)&&/^Request (?:failed|timeout):/i[_0x143f28(0x9c)](_0x590ce6);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x143f28(0x9c)](_0x590ce6);}function stateDrift(_0x3e2280){const _0x398d02=a128_0x4085a2;return menuError(_0x398d02(0x8d),_0x3e2280,'Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.');}
|
|
1
|
+
const a133_0x39716a=a133_0x20f6;(function(_0x2c1bf7,_0x3b0159){const _0x55f190=a133_0x20f6,_0x26bdbc=_0x2c1bf7();while(!![]){try{const _0x497af2=parseInt(_0x55f190(0x100))/0x1+parseInt(_0x55f190(0xcc))/0x2+-parseInt(_0x55f190(0xef))/0x3+-parseInt(_0x55f190(0xfd))/0x4+parseInt(_0x55f190(0xc8))/0x5+-parseInt(_0x55f190(0xe5))/0x6+parseInt(_0x55f190(0xe1))/0x7;if(_0x497af2===_0x3b0159)break;else _0x26bdbc['push'](_0x26bdbc['shift']());}catch(_0x154141){_0x26bdbc['push'](_0x26bdbc['shift']());}}}(a133_0xd188,0x7b059));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':a133_0x39716a(0xdc),'required':!![],'description':a133_0x39716a(0x102)};export const MENU_SORT_FLAG={'name':a133_0x39716a(0xfe),'type':'number','description':a133_0x39716a(0xc4)};export const MENU_PARENT_ID_FLAG={'name':'parent-id','type':a133_0x39716a(0xc7),'description':'Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node'};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a133_0x39716a(0xb3),'type':a133_0x39716a(0xc7),'description':a133_0x39716a(0xdb)};function a133_0xd188(){const _0x5f44c1=['selector','backend','cascade','map','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','number','menu_verification_failed','menu_permission_denied','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','5057024FDsHfl','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','deleteOrder','\x22,\x20not\x20folder.','2654070osGNAh','plannedActions','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','targets','root','\x20is\x20type\x20\x22','pre-write-recheck','verification','childrenCount','menu_sort_invalid','1467102yMoxBm','validation','rawFlags','\x20child\x20count\x20changed:\x20expected\x20','trim','required','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','expect-path','appCode','data','stage','type','dryRun','warnings','2786712lXzxxb','sort','menu_sort_overflow','696317toHEte','Reorder\x20sibling\x20menus\x20below\x20','Exact\x20online\x20menu\x20id','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','menu_parent_not_folder','max','path','hint','unknown','succeeded','test','operation','recheck\x20online\x20menu\x20facts\x20before\x20','Menu\x20','after','planFile','isSafeInteger','Failed\x20to\x20','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','menu_state_drift','call','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','\x20menu\x20','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','menu_mutation_failed','api_error','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','expect-parent-id','stringify','hash','snapshotHash','bool',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','Online\x20menu\x20not\x20found:\x20','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','code','toLowerCase','message','num','flagMissing','read\x20online\x20menu\x20facts\x20before\x20','failedRecords','filter','hasOwnProperty','Sibling\x20sort\x20value\x20(non-negative\x20integer)','cookie','expected-children-count','string','2412935rkSUdw','\x20parent\x20changed:\x20expected\x20','prototype','yes','461236tzeJgU',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','\x20path\x20changed:\x20expected\x20','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','get','failed','str',',\x20current\x20','dry-run','parentId','menu_not_found'];a133_0xd188=function(){return _0x5f44c1;};return a133_0xd188();}export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a133_0x39716a(0xf6),'type':'string','description':'Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches'},{'name':a133_0x39716a(0xc6),'type':a133_0x39716a(0xdc),'description':a133_0x39716a(0xe0)}];export function validateExactId(_0x1465a9){const _0x5b4bf4=a133_0x39716a,_0x4fef11=_0x1465a9[_0x5b4bf4(0xbe)]('id');if(!Number[_0x5b4bf4(0x110)](_0x4fef11)||_0x4fef11<=0x0)throw CliErrors['validation'](_0x5b4bf4(0xaf));return _0x4fef11;}export function validateSort(_0x151e3f,_0x11e9ad='sort'){const _0x6d8de0=a133_0x39716a;if(!hasFlag(_0x151e3f,_0x11e9ad))return undefined;const _0x5e7ec0=_0x151e3f[_0x6d8de0(0xbe)](_0x11e9ad);if(!Number[_0x6d8de0(0x110)](_0x5e7ec0)||_0x5e7ec0<0x0||_0x5e7ec0>MAX_MENU_SORT)throw menuError(_0x6d8de0(0xee),'--'+_0x11e9ad+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x6d8de0(0x112));return _0x5e7ec0;}export function nextSiblingSort(_0x59a4d0,_0x583430,_0x1ff82d){const _0x331bc4=a133_0x39716a,_0x47b8c5=getChildren(_0x59a4d0,_0x583430)[_0x331bc4(0xda)](_0x2dc474=>_0x2dc474[_0x331bc4(0xfe)])[_0x331bc4(0xc2)](_0x3854ac=>typeof _0x3854ac===_0x331bc4(0xdc));if(_0x47b8c5['length']===0x0)return 0x0;const _0x540475=Math[_0x331bc4(0x105)](..._0x47b8c5);if(_0x540475>=MAX_MENU_SORT)throw menuError(_0x331bc4(0xff),'Cannot\x20append\x20a\x20'+_0x1ff82d+'\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20'+_0x540475+'.',_0x331bc4(0x101)+MAX_MENU_SORT+_0x331bc4(0xb8));return _0x540475+0x1;}export function requireExplicitYes(_0xb95b06){const _0xf34b6=a133_0x39716a;if(_0xb95b06[_0xf34b6(0xb7)](_0xf34b6(0xd4)))return;if(!_0xb95b06[_0xf34b6(0xb7)](_0xf34b6(0xcb)))throw menuError('menu_confirmation_required','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.',_0xf34b6(0xad));}export async function fetchMutationSnapshot(_0xd9bb81,_0x1a297b,_0x137f65){const _0xb071b7=a133_0x39716a;try{return await fetchMenuSnapshot(_0xd9bb81[_0xb071b7(0xf7)],_0xd9bb81[_0xb071b7(0xc5)]);}catch(_0x45b236){throw mapMenuApiError(_0x45b236,_0xb071b7(0xc0)+_0x1a297b,_0x137f65);}}export async function recheckMutationSnapshot(_0x21be00,_0x39b715,_0x498850,_0x2ab5f9){const _0x10c5e8=a133_0x39716a;let _0x120df6;try{_0x120df6=await fetchMenuSnapshot(_0x21be00[_0x10c5e8(0xf7)],_0x21be00[_0x10c5e8(0xc5)]);}catch(_0x2a6ff3){const _0x1aaca6=mapMenuApiError(_0x2a6ff3,_0x10c5e8(0x10c)+_0x498850,_0x2ab5f9);throw menuFailure(_0x1aaca6,_0x39b715,{'stage':'pre-write-recheck','failed':_0x2ab5f9==null?{}:{'id':_0x2ab5f9}});}if(_0x120df6[_0x10c5e8(0xb5)]!==_0x39b715['snapshotHash']){const _0x176801=menuError(_0x10c5e8(0x113),'Online\x20menu\x20state\x20changed\x20before\x20'+_0x498850+_0x10c5e8(0xcd),_0x10c5e8(0xdf));throw menuFailure(_0x176801,_0x39b715,{'stage':_0x10c5e8(0xeb),'failed':{..._0x2ab5f9==null?{}:{'id':_0x2ab5f9},'expectedSnapshotHash':_0x39b715[_0x10c5e8(0xb6)],'currentSnapshotHash':_0x120df6['hash']}});}return _0x120df6;}export function parseParentId(_0xd0943c,_0x4840e8,_0xec4df4={}){const _0x39b94d=a133_0x39716a;if(!hasFlag(_0xd0943c,_0x4840e8)){if(_0xec4df4[_0x39b94d(0xf4)])throw CliErrors[_0x39b94d(0xbf)](_0x4840e8);return undefined;}const _0x1b560a=_0xd0943c[_0x39b94d(0xd2)](_0x4840e8)[_0x39b94d(0xf3)]();if(_0x1b560a[_0x39b94d(0xbc)]()===_0x39b94d(0xe9))return null;if(!/^\d+$/[_0x39b94d(0x10a)](_0x1b560a))throw CliErrors[_0x39b94d(0xf0)]('--'+_0x4840e8+_0x39b94d(0xf5));const _0x594f46=Number(_0x1b560a);if(!Number[_0x39b94d(0x110)](_0x594f46)||_0x594f46<=0x0)throw CliErrors[_0x39b94d(0xf0)]('--'+_0x4840e8+_0x39b94d(0xf5));return _0x594f46;}export function requireMenu(_0x25878e,_0xef7728){const _0x51c5a2=a133_0x39716a,_0x56c7dc=_0x25878e['byId'][_0x51c5a2(0xd0)](_0xef7728);if(!_0x56c7dc)throw menuError(_0x51c5a2(0xd6),_0x51c5a2(0xb9)+_0xef7728,_0x51c5a2(0xe7));return _0x56c7dc;}export function requireFolder(_0x52bf32,_0x520bfd){const _0x53d43f=a133_0x39716a,_0x4f03f7=requireMenu(_0x52bf32,_0x520bfd);if(_0x4f03f7[_0x53d43f(0xfa)]!=='folder')throw menuError(_0x53d43f(0x104),_0x53d43f(0x10d)+_0x520bfd+_0x53d43f(0xea)+(_0x4f03f7['type']||_0x53d43f(0x108))+_0x53d43f(0xe4),_0x53d43f(0xb2));return _0x4f03f7;}export function assertExpectedState(_0xaf74b1,_0x1e8628){const _0x4a2033=a133_0x39716a;if(hasFlag(_0xaf74b1,'expect-parent-id')){const _0x26d661=parseParentId(_0xaf74b1,_0x4a2033(0xb3),{'required':!![]});if(_0x1e8628[_0x4a2033(0xd5)]!==_0x26d661)throw stateDrift(_0x4a2033(0x10d)+_0x1e8628['id']+_0x4a2033(0xc9)+formatParent(_0x26d661)+_0x4a2033(0xd3)+formatParent(_0x1e8628[_0x4a2033(0xd5)])+'.');}if(hasFlag(_0xaf74b1,_0x4a2033(0xf6))){const _0x283aac=_0xaf74b1['str'](_0x4a2033(0xf6));if(_0x1e8628['path']!==_0x283aac)throw stateDrift('Menu\x20'+_0x1e8628['id']+_0x4a2033(0xce)+JSON['stringify'](_0x283aac)+_0x4a2033(0xd3)+JSON[_0x4a2033(0xb4)](_0x1e8628[_0x4a2033(0x106)])+'.');}if(hasFlag(_0xaf74b1,_0x4a2033(0xc6))){const _0x539468=_0xaf74b1['num'](_0x4a2033(0xc6));if(!Number[_0x4a2033(0x110)](_0x539468)||_0x539468<0x0)throw CliErrors[_0x4a2033(0xf0)](_0x4a2033(0xba));if(_0x1e8628[_0x4a2033(0xed)]!==_0x539468)throw stateDrift(_0x4a2033(0x10d)+_0x1e8628['id']+_0x4a2033(0xf2)+_0x539468+_0x4a2033(0xd3)+_0x1e8628[_0x4a2033(0xed)]+'.');}}export function assertVerified(_0x3e5828,_0x53d117,_0x58b9bd='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){const _0x556f7c=a133_0x39716a;if(!_0x3e5828)throw menuError(_0x556f7c(0xdd),_0x53d117,_0x58b9bd);}export function mutationResult(_0x53417b){const _0xd8002f=a133_0x39716a;return{'operation':_0x53417b[_0xd8002f(0x10b)],'selector':_0x53417b[_0xd8002f(0xd7)],'before':_0x53417b['before'],'after':_0x53417b[_0xd8002f(0x10e)],'dryRun':_0x53417b[_0xd8002f(0xfb)],'backend':_0x53417b[_0xd8002f(0xd8)],..._0x53417b[_0xd8002f(0xe6)]?{'plannedActions':_0x53417b[_0xd8002f(0xe6)]}:{},..._0x53417b[_0xd8002f(0xe8)]?{'targets':_0x53417b[_0xd8002f(0xe8)]}:{},..._0x53417b[_0xd8002f(0xe3)]?{'deleteOrder':_0x53417b['deleteOrder']}:{},'snapshotHash':_0x53417b[_0xd8002f(0xb6)],..._0x53417b['cascade']?{'cascade':_0x53417b[_0xd8002f(0xd9)]}:{},..._0x53417b[_0xd8002f(0x10f)]?{'planFile':_0x53417b[_0xd8002f(0x10f)]}:{},'succeeded':_0x53417b[_0xd8002f(0x109)]??[],'failed':_0x53417b[_0xd8002f(0xd1)]??[],'warnings':_0x53417b[_0xd8002f(0xfc)]??[],'verification':_0x53417b[_0xd8002f(0xec)],'error':_0x53417b['error']};}export function menuDryRunResult(_0xe3279e,_0x1996a3){return{..._0xe3279e,..._0x1996a3};}function a133_0x20f6(_0x375ab9,_0x409b9e){_0x375ab9=_0x375ab9-0xad;const _0xd188e=a133_0xd188();let _0x20f6c1=_0xd188e[_0x375ab9];return _0x20f6c1;}export function menuFailure(_0x3268b0,_0x1b58aa,_0x5beb2d){const _0x5b50ee=a133_0x39716a,_0x2ba201=mutationResult({..._0x1b58aa,'after':_0x5beb2d[_0x5b50ee(0x10e)]===undefined?_0x1b58aa['after']:_0x5beb2d[_0x5b50ee(0x10e)],'backend':_0x5beb2d[_0x5b50ee(0xd8)]??_0x1b58aa[_0x5b50ee(0xd8)],'dryRun':![],'succeeded':_0x5beb2d[_0x5b50ee(0x109)]??[],'failed':_0x5beb2d[_0x5b50ee(0xc1)]??[{..._0x5beb2d[_0x5b50ee(0xd1)]??{},'stage':_0x5beb2d[_0x5b50ee(0xf9)],'code':_0x3268b0[_0x5b50ee(0xbb)],'message':_0x3268b0[_0x5b50ee(0xbd)]}],'warnings':[..._0x1b58aa['warnings'],..._0x5beb2d[_0x5b50ee(0xfc)]??[]],'verification':_0x5beb2d[_0x5b50ee(0xec)],'error':{'code':_0x3268b0[_0x5b50ee(0xbb)],'message':_0x3268b0[_0x5b50ee(0xbd)],..._0x3268b0[_0x5b50ee(0x107)]?{'hint':_0x3268b0[_0x5b50ee(0x107)]}:{}}});return Object['defineProperty'](_0x3268b0,_0x5b50ee(0xf8),{'value':_0x2ba201,'enumerable':!![],'configurable':!![]}),_0x3268b0;}export function asVerificationError(_0x27b35a,_0x445815){const _0x42ab3=a133_0x39716a;if(_0x27b35a instanceof CliError&&_0x27b35a[_0x42ab3(0xbb)]===_0x42ab3(0xdd))return _0x27b35a;const _0x33f8cd=_0x27b35a instanceof Error?_0x27b35a[_0x42ab3(0xbd)]:String(_0x27b35a);return menuError('menu_verification_failed',''+_0x445815+(_0x33f8cd?':\x20'+_0x33f8cd:''),_0x42ab3(0xe2));}export function describeMenuErrorCause(_0x344fd3,_0xaa44bd,_0x39b298){const _0xba5a4d=a133_0x39716a,_0x169b38=mapMenuApiError(_0x344fd3,_0xaa44bd,_0x39b298);return{'causeCode':_0x169b38[_0xba5a4d(0xbb)],'causeMessage':_0x169b38[_0xba5a4d(0xbd)]};}export function hasFlag(_0x1c5b14,_0x59dfe9){const _0x401852=a133_0x39716a;return Object[_0x401852(0xca)][_0x401852(0xc3)][_0x401852(0x114)](_0x1c5b14[_0x401852(0xf1)],_0x59dfe9)&&_0x1c5b14[_0x401852(0xf1)][_0x59dfe9]!==undefined;}export function toApiParentId(_0x1c0387){return _0x1c0387??0x0;}export function formatParent(_0x47e080){const _0x587752=a133_0x39716a;return _0x47e080==null?_0x587752(0xe9):String(_0x47e080);}export function menuError(_0x13c528,_0x50ba7f,_0x4def23){return new CliError(_0x13c528,0x1,_0x50ba7f,_0x4def23);}export function mapMenuApiError(_0x14fc84,_0x1957b4,_0x3fd987){const _0xab9172=a133_0x39716a;if(_0x14fc84 instanceof CliError&&_0x14fc84[_0xab9172(0xbb)]!==_0xab9172(0xb1))return _0x14fc84;const _0x50ef52=_0x14fc84 instanceof Error?_0x14fc84[_0xab9172(0xbd)]:String(_0x14fc84);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0xab9172(0x10a)](_0x50ef52))return menuError(_0xab9172(0xde),'Permission\x20denied\x20while\x20attempting\x20to\x20'+_0x1957b4+(_0x3fd987?_0xab9172(0xae)+_0x3fd987:'')+'.',_0xab9172(0xcf));return menuError(_0xab9172(0xb0),_0xab9172(0x111)+_0x1957b4+(_0x3fd987?_0xab9172(0xae)+_0x3fd987:'')+':\x20'+_0x50ef52,_0xab9172(0x103));}export function isMenuResponseLoss(_0xe8a362){const _0x1b0cbc=a133_0x39716a,_0x376ebc=_0xe8a362 instanceof Error?_0xe8a362[_0x1b0cbc(0xbd)]:String(_0xe8a362);if(_0xe8a362 instanceof CliError)return _0xe8a362[_0x1b0cbc(0xbb)]===_0x1b0cbc(0xb1)&&/^Request (?:failed|timeout):/i[_0x1b0cbc(0x10a)](_0x376ebc);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x1b0cbc(0x10a)](_0x376ebc);}function stateDrift(_0x3ed2f2){return menuError('menu_state_drift',_0x3ed2f2,'Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x59b2c4,_0x552207){const _0x7030f8=a134_0x5928,_0x6f15e3=_0x59b2c4();while(!![]){try{const _0x58c10c=-parseInt(_0x7030f8(0x15f))/0x1+parseInt(_0x7030f8(0x165))/0x2+-parseInt(_0x7030f8(0x15d))/0x3+parseInt(_0x7030f8(0x17c))/0x4*(-parseInt(_0x7030f8(0x163))/0x5)+parseInt(_0x7030f8(0x158))/0x6*(parseInt(_0x7030f8(0x17b))/0x7)+-parseInt(_0x7030f8(0x15b))/0x8+parseInt(_0x7030f8(0x15c))/0x9;if(_0x58c10c===_0x552207)break;else _0x6f15e3['push'](_0x6f15e3['shift']());}catch(_0x3506bd){_0x6f15e3['push'](_0x6f15e3['shift']());}}}(a134_0x214a,0xda2a3));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 a134_0x50799c,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x3ed6bf,_0x2fe3a1){const _0x51fd61=a134_0x5928,_0x3924e3=getEnv();logger[_0x51fd61(0x16b)]('get-online-menu-list',isProduction(_0x3924e3)?_0x51fd61(0x164)+_0x3ed6bf+')':_0x51fd61(0x16c)+_0x3ed6bf+')');const _0x3acd96=await fetchMenuSnapshot(_0x3ed6bf,_0x2fe3a1,{'verbose':!![]});return logger[_0x51fd61(0x16b)]('get-online-menu-list',_0x51fd61(0x171)+_0x3acd96[_0x51fd61(0x162)]+'\x20online\x20menus\x20successfully'),_0x3acd96[_0x51fd61(0x178)][_0x51fd61(0x175)](toProcessedMenuItem);}export async function createMenu(_0x11ef51,_0x358785,_0x290f52){const _0x4ac926=a134_0x5928;logger[_0x4ac926(0x16b)](_0x4ac926(0x179),_0x4ac926(0x16f)+_0x290f52[_0x4ac926(0x161)]+'\x20('+_0x290f52[_0x4ac926(0x17e)]+')');const _0x355c62={'appCode':_0x11ef51,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x4ac926(0x15e),'resources':_0x290f52['resources']?JSON[_0x4ac926(0x166)](_0x290f52[_0x4ac926(0x167)]):undefined},..._0x290f52},_0x5d0809=await createMenuRecord(_0x355c62,_0x358785,_0x4ac926(0x180)+_0x290f52[_0x4ac926(0x161)]+'\x22');return logger[_0x4ac926(0x16b)](_0x4ac926(0x179),_0x4ac926(0x16d)+_0x290f52[_0x4ac926(0x161)]),_0x5d0809;}function a134_0x5928(_0xa227c8,_0x3f632c){_0xa227c8=_0xa227c8-0x157;const _0x214abc=a134_0x214a();let _0x592881=_0x214abc[_0xa227c8];return _0x592881;}async function createSingleMenu(_0x543e56,_0x478a56,_0x4f38e6,_0x2a54dc){const _0x31589a=a134_0x5928,_0x3f8c59={'appCode':_0x543e56,'type':_0x31589a(0x16e),'sort':0x0,'extend':{'loadScriptMode':_0x31589a(0x15e),'resources':_0x2a54dc?JSON[_0x31589a(0x166)](_0x2a54dc):undefined},'label':_0x4f38e6['label'],'path':_0x4f38e6[_0x31589a(0x17e)]},_0x568da6=await createMenuRecord(_0x3f8c59,_0x478a56,_0x31589a(0x180)+_0x4f38e6[_0x31589a(0x161)]+'\x22');return logger[_0x31589a(0x16b)](_0x31589a(0x179),_0x31589a(0x16d)+_0x4f38e6[_0x31589a(0x161)]),_0x568da6;}export async function createMenus(_0x22e4e1,_0x552372,_0x32585a,_0x1d2eea){const _0x28b839=a134_0x5928;logger[_0x28b839(0x16b)]('create-menus','Start\x20batch\x20menu\x20creation,\x20total\x20'+_0x32585a[_0x28b839(0x176)]);const _0x1d74fe=await Promise[_0x28b839(0x174)](_0x32585a[_0x28b839(0x175)](_0x2faa98=>createSingleMenu(_0x22e4e1,_0x552372,_0x2faa98,_0x1d2eea)));return logger[_0x28b839(0x16b)](_0x28b839(0x17f),_0x28b839(0x160)+_0x32585a[_0x28b839(0x176)]),_0x1d74fe;}export async function updateMenuCdnUrl(_0x409d33,_0x586b3d,_0x2444d1){const _0x1bb4d5=a134_0x5928;logger['info']('update-menu-cdn-url',_0x1bb4d5(0x17d)+_0x2444d1[_0x1bb4d5(0x161)]+'\x20('+_0x2444d1[_0x1bb4d5(0x17e)]+')');const _0x10f356={'id':_0x2444d1['id'],'appCode':_0x409d33,'extend':{..._0x2444d1[_0x1bb4d5(0x15a)]??{},..._0x2444d1[_0x1bb4d5(0x170)]?{'loadScriptMode':_0x2444d1['loadScriptMode']}:{},'resources':_0x2444d1[_0x1bb4d5(0x167)]?JSON[_0x1bb4d5(0x166)](_0x2444d1[_0x1bb4d5(0x167)]):undefined}},_0x25339f=await updateMenuRecord(_0x10f356,_0x586b3d,_0x1bb4d5(0x16a)+_0x2444d1[_0x1bb4d5(0x161)]+'\x22');return logger[_0x1bb4d5(0x16b)](_0x1bb4d5(0x17a),_0x1bb4d5(0x168)+_0x2444d1['label'],undefined),_0x25339f;}function a134_0x214a(){const _0x22097e=['create-menus','Create\x20menu\x20\x22','\x20menu','174RhqpnI','\x20menu\x20group(s)','extend','601160PVBTio','26508285mgyjHj','3033231fnlgck','import','1173CBLRLm','Batch\x20menu\x20creation\x20completed,\x20total\x20','label','total','190iyIpcu','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','921992UTpOeO','stringify','resources','Menu\x20assets\x20synced:\x20','Regroup\x20','Update\x20menu\x20assets\x20\x22','info','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','Menu\x20created\x20successfully:\x20','procode','Creating\x20menu:\x20','loadScriptMode','Fetched\x20','menuGroups','Delete\x20','all','map','length','Update\x20menu\x20','menus','create-menu','update-menu-cdn-url','10479QcRRxs','154608DajRTu','Updating\x20menu\x20asset\x20links:\x20','path'];a134_0x214a=function(){return _0x22097e;};return a134_0x214a();}export async function createMenuEntity(_0x4e5b1c,_0x1cd1a7,_0xa4768f){const _0x577c1a=a134_0x5928;return createMenuRecord({'appCode':_0x4e5b1c,..._0xa4768f},_0x1cd1a7,_0x577c1a(0x180)+_0xa4768f['label']+'\x22');}export async function updateMenuEntity(_0x400f97,_0x596317,_0x313c47){const _0x282099=a134_0x5928;return updateMenuRecord({'appCode':_0x400f97,..._0x313c47},_0x596317,_0x282099(0x177)+_0x313c47['id']);}export async function batchDeleteMenuEntities(_0x38bdc9,_0x29df78){const _0x44d5ed=a134_0x5928;return batchDeleteMenuRecords(_0x29df78,_0x38bdc9,_0x44d5ed(0x173)+_0x29df78[_0x44d5ed(0x176)]+_0x44d5ed(0x157)+(_0x29df78[_0x44d5ed(0x176)]===0x1?'':'s'));}export async function startMenuRegroup(_0x4a0410,_0x4662ea){const _0x57124a=a134_0x5928;return a134_0x50799c(_0x4662ea,_0x4a0410,_0x57124a(0x169)+_0x4662ea[_0x57124a(0x172)][_0x57124a(0x176)]+_0x57124a(0x159));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a135_0x2e6a(){const _0x48b079=['No\x20local\x20pages\x20matched\x20paths:\x20','keys','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','Menu\x20sync\x20completed','push','Start\x20non-interactive\x20menu\x20sync','string','JS\x20URL\x20is\x20unreachable:\x20','40LZsIVL','path','cwd','756200AkLKOw','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','12DJPQMR','Invalid\x20--params\x20JSON.','get','procode','8pbWnGY','444831LjfVJY','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','cssUrl','object',':\x20expected\x20a\x20non-empty\x20string.','--params.','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','parse','map','join','Invalid\x20--params:\x20','1611460FGVIzj','info','length','jsUrl','has','216440DyDiMf','Invalid\x20--params.','dryRun','label','913194tNOHbb','1995453bFKwpb','filter','3276EulgRy','\x0a\x20\x20Available\x20local\x20paths:\x20','CSS\x20URL\x20is\x20unreachable:\x20','setLogPath','menu-sync','trim','55oFBooS','pages','isArray'];a135_0x2e6a=function(){return _0x48b079;};return a135_0x2e6a();}const a135_0x16f585=a135_0x38fc;(function(_0x434d52,_0x4263f2){const _0x589182=a135_0x38fc,_0x5cb2a6=_0x434d52();while(!![]){try{const _0x56942e=-parseInt(_0x589182(0x100))/0x1+parseInt(_0x589182(0xf9))/0x2+-parseInt(_0x589182(0x114))/0x3+-parseInt(_0x589182(0xf6))/0x4*(parseInt(_0x589182(0x110))/0x5)+-parseInt(_0x589182(0xfb))/0x6*(parseInt(_0x589182(0x117))/0x7)+-parseInt(_0x589182(0xff))/0x8*(-parseInt(_0x589182(0x115))/0x9)+parseInt(_0x589182(0x10b))/0xa*(parseInt(_0x589182(0xeb))/0xb);if(_0x56942e===_0x4263f2)break;else _0x5cb2a6['push'](_0x5cb2a6['shift']());}catch(_0x2ee374){_0x5cb2a6['push'](_0x5cb2a6['shift']());}}}(a135_0x2e6a,0x36526));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a135_0x38fc(_0x39d50b,_0x163364){_0x39d50b=_0x39d50b-0xe6;const _0x2e6a0d=a135_0x2e6a();let _0x38fcbf=_0x2e6a0d[_0x39d50b];return _0x38fcbf;}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([a135_0x16f585(0x10e),'cssUrl']);function validateParams(_0x39a6e2){const _0x3a0b10=a135_0x16f585,_0x5a2f28=[];return _0x39a6e2[_0x3a0b10(0x10e)]&&!isValidJsHttpsUrl(_0x39a6e2[_0x3a0b10(0x10e)])&&_0x5a2f28[_0x3a0b10(0xf2)]({'field':'jsUrl','message':_0x3a0b10(0xfa)}),_0x39a6e2[_0x3a0b10(0x102)]&&!isValidCssHttpsUrl(_0x39a6e2['cssUrl'])&&_0x5a2f28[_0x3a0b10(0xf2)]({'field':_0x3a0b10(0x102),'message':_0x3a0b10(0xf0)}),_0x5a2f28;}export async function runMenuSyncCore(_0x303b30,_0x3dd8a6,_0x465c4d=[],_0x3bce69,_0x15d624={}){const _0x3bd52d=a135_0x16f585,_0x968fca=parseMenuSyncParams(_0x3bce69),_0x5147cc=[...new Set(_0x465c4d['map'](_0x12dd99=>_0x12dd99[_0x3bd52d(0xea)]())[_0x3bd52d(0x116)](Boolean))],_0x1c905f=_0x968fca[_0x3bd52d(0x10e)],_0x2f5088=_0x968fca[_0x3bd52d(0x102)],_0x48912a=[];if(_0x1c905f)_0x48912a['push'](_0x1c905f);if(_0x2f5088)_0x48912a[_0x3bd52d(0xf2)](_0x2f5088);const _0x152bdb=validateParams(_0x968fca);if(_0x152bdb[_0x3bd52d(0x10d)]>0x0){const _0x52f6de=_0x152bdb['map'](_0x1c964f=>_0x3bd52d(0x105)+_0x1c964f['field']+':\x20'+_0x1c964f['message'])[_0x3bd52d(0x109)](';\x20');throw new Error(_0x3bd52d(0x10a)+_0x52f6de);}logger[_0x3bd52d(0xe8)](process[_0x3bd52d(0xf8)]()),logger[_0x3bd52d(0x10c)](_0x3bd52d(0xe9),_0x3bd52d(0xf3),{'appCode':_0x303b30,'selectedCount':_0x5147cc['length'],'jsUrl':_0x1c905f,'cssUrl':_0x2f5088});if(_0x1c905f){const _0x21983b=await isUrlReachable(_0x1c905f);if(!_0x21983b)throw new Error(_0x3bd52d(0xf5)+_0x1c905f);}if(_0x2f5088){const _0x4e1920=await isUrlReachable(_0x2f5088);if(!_0x4e1920)throw new Error(_0x3bd52d(0xe7)+_0x2f5088);}const _0x250613=getLocalPages();if(_0x250613[_0x3bd52d(0x10d)]===0x0){if(_0x5147cc[_0x3bd52d(0x10d)]>0x0)throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x5147cc[_0x3bd52d(0x109)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x15d624['dryRun']===!![],'targetPages':[],'plannedMenus':[]};}const _0x2875b6=await getOnlineMenuList(_0x303b30,_0x3dd8a6),_0x163fb5=new Set(_0x2875b6['map'](_0x85cb78=>_0x85cb78[_0x3bd52d(0xf7)]));let _0x33f504;if(_0x5147cc[_0x3bd52d(0x10d)]>0x0){const _0x175405=new Map(_0x250613[_0x3bd52d(0x108)](_0x244fbf=>[_0x244fbf['path'],_0x244fbf])),_0x277773=_0x5147cc[_0x3bd52d(0x116)](_0x131cee=>!_0x175405[_0x3bd52d(0x10f)](_0x131cee));if(_0x277773[_0x3bd52d(0x10d)]>0x0){const _0x400e6f=_0x250613[_0x3bd52d(0x108)](_0x19a608=>_0x19a608['path'])['join'](',\x20');throw new Error(_0x3bd52d(0xee)+_0x277773[_0x3bd52d(0x109)](',\x20')+_0x3bd52d(0xe6)+_0x400e6f);}const _0x53a597=_0x5147cc[_0x3bd52d(0x116)](_0x5f2021=>_0x163fb5[_0x3bd52d(0x10f)](_0x5f2021));if(_0x53a597[_0x3bd52d(0x10d)]>0x0)throw new Error(_0x3bd52d(0x106)+_0x53a597[_0x3bd52d(0x109)](',\x20'));_0x33f504=_0x5147cc['map'](_0x3cb0bc=>_0x175405[_0x3bd52d(0xfd)](_0x3cb0bc));}else _0x33f504=_0x250613[_0x3bd52d(0x116)](_0x3e58f6=>!_0x163fb5[_0x3bd52d(0x10f)](_0x3e58f6[_0x3bd52d(0xf7)]));if(_0x33f504[_0x3bd52d(0x10d)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x15d624[_0x3bd52d(0x112)]===!![],'targetPages':[],'plannedMenus':[]};const _0x8e2f92=_0x33f504[_0x3bd52d(0x108)](_0x2d02e5=>({'type':_0x3bd52d(0xfe),'path':_0x2d02e5[_0x3bd52d(0xf7)],'label':_0x2d02e5[_0x3bd52d(0x113)],'loadScriptMode':'import','resources':[..._0x48912a]}));if(_0x15d624[_0x3bd52d(0x112)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x33f504,'plannedMenus':_0x8e2f92};const _0x5be6e9=await createMenus(_0x303b30,_0x3dd8a6,_0x33f504,_0x48912a[_0x3bd52d(0x10d)]>0x0?_0x48912a:undefined);return logger['info'](_0x3bd52d(0xe9),_0x3bd52d(0xf1),{'count':_0x33f504[_0x3bd52d(0x10d)],'resources':_0x48912a}),{'created':_0x5be6e9[_0x3bd52d(0x10d)],'skipped':![],'dryRun':![],'targetPages':_0x33f504,'plannedMenus':_0x8e2f92,'menus':_0x5be6e9};}export function parseMenuSyncParams(_0x4f9d94){const _0x175eb0=a135_0x16f585;if(!_0x4f9d94||typeof _0x4f9d94!==_0x175eb0(0xf4))return{};let _0x2a03ff;try{_0x2a03ff=JSON[_0x175eb0(0x107)](_0x4f9d94);}catch{throw new Error(_0x175eb0(0xfc));}if(typeof _0x2a03ff!==_0x175eb0(0x103)||_0x2a03ff===null||Array[_0x175eb0(0xed)](_0x2a03ff))throw new Error(_0x175eb0(0x101));const _0x31a865=_0x2a03ff;if(Object['hasOwn'](_0x31a865,_0x175eb0(0xec)))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x4f6fc8=Object[_0x175eb0(0xef)](_0x31a865)[_0x175eb0(0x116)](_0x21d06b=>!MENU_SYNC_PARAM_KEYS[_0x175eb0(0x10f)](_0x21d06b));if(_0x4f6fc8[_0x175eb0(0x10d)]>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x4f6fc8['join'](',\x20')+'.');for(const _0x430d29 of MENU_SYNC_PARAM_KEYS){const _0x4c4474=_0x31a865[_0x430d29];if(_0x4c4474!==undefined&&(typeof _0x4c4474!==_0x175eb0(0xf4)||_0x4c4474[_0x175eb0(0xea)]()===''))throw new Error(_0x175eb0(0x111)+_0x430d29+_0x175eb0(0x104));}return{'jsUrl':typeof _0x31a865['jsUrl']===_0x175eb0(0xf4)?_0x31a865[_0x175eb0(0x10e)][_0x175eb0(0xea)]():undefined,'cssUrl':typeof _0x31a865[_0x175eb0(0x102)]===_0x175eb0(0xf4)?_0x31a865['cssUrl']['trim']():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x153d3a,_0x950da7){const _0x14a52b=a132_0x21dc,_0x2bcf8c=_0x153d3a();while(!![]){try{const _0x26f563=-parseInt(_0x14a52b(0x8e))/0x1*(parseInt(_0x14a52b(0x84))/0x2)+parseInt(_0x14a52b(0x81))/0x3*(parseInt(_0x14a52b(0x7d))/0x4)+parseInt(_0x14a52b(0x72))/0x5+-parseInt(_0x14a52b(0x8c))/0x6+-parseInt(_0x14a52b(0x8d))/0x7+-parseInt(_0x14a52b(0x7f))/0x8+parseInt(_0x14a52b(0x70))/0x9*(parseInt(_0x14a52b(0x75))/0xa);if(_0x26f563===_0x950da7)break;else _0x2bcf8c['push'](_0x2bcf8c['shift']());}catch(_0x149b74){_0x2bcf8c['push'](_0x2bcf8c['shift']());}}}(a132_0x5ce5,0x718c5));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(_0x305db0){const _0x3ed3b9=a132_0x21dc,_0x317f4c=[];return _0x305db0[_0x3ed3b9(0xa0)]&&!isValidJsHttpsUrl(_0x305db0['jsUrl'])&&_0x317f4c[_0x3ed3b9(0xad)]({'field':'jsUrl','message':_0x3ed3b9(0x87)}),_0x305db0[_0x3ed3b9(0xa1)]&&!isValidCssHttpsUrl(_0x305db0['cssUrl'])&&_0x317f4c[_0x3ed3b9(0xad)]({'field':_0x3ed3b9(0xa1),'message':_0x3ed3b9(0x77)}),_0x317f4c;}export async function runMenuUpdateCore(_0x262ccf,_0x225eef,_0x4f3799,_0x39f9d9={}){const _0x416f2d=a132_0x21dc,_0x49d067=parseUpdateParamsFlag(_0x4f3799),_0x1a6d0e=normalizeMode(_0x39f9d9[_0x416f2d(0x94)]);validateSelection(_0x39f9d9[_0x416f2d(0x80)]);const _0x208310=[];if(_0x49d067[_0x416f2d(0xa0)])_0x208310[_0x416f2d(0xad)](_0x49d067['jsUrl']);if(_0x49d067['cssUrl'])_0x208310[_0x416f2d(0xad)](_0x49d067[_0x416f2d(0xa1)]);const _0x57a5a4=validateParams(_0x49d067);if(_0x57a5a4['length']>0x0){const _0x57015c=_0x57a5a4['map'](_0x53fd0b=>_0x416f2d(0x6b)+_0x53fd0b[_0x416f2d(0x89)]+':\x20'+_0x53fd0b['message'])[_0x416f2d(0x79)](';\x20');throw new Error(_0x416f2d(0xac)+_0x57015c);}if(_0x208310[_0x416f2d(0x7b)]===0x0)throw new Error(_0x416f2d(0x6c)+_0x416f2d(0xb2));logger[_0x416f2d(0x98)](process['cwd']()),logger[_0x416f2d(0xa8)](_0x416f2d(0x6f),_0x416f2d(0x95),{'appCode':_0x262ccf,'jsUrl':_0x49d067[_0x416f2d(0xa0)],'cssUrl':_0x49d067[_0x416f2d(0xa1)],'mode':_0x1a6d0e,'dryRun':_0x39f9d9['dryRun']===!![]});if(_0x49d067[_0x416f2d(0xa0)]){const _0x5a76e2=await isUrlReachable(_0x49d067[_0x416f2d(0xa0)]);if(!_0x5a76e2)throw new Error(_0x416f2d(0x9d)+_0x49d067[_0x416f2d(0xa0)]);}if(_0x49d067[_0x416f2d(0xa1)]){const _0x44da5d=await isUrlReachable(_0x49d067['cssUrl']);if(!_0x44da5d)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x49d067[_0x416f2d(0xa1)]);}const _0x1dc400=await getOnlineMenuList(_0x262ccf,_0x225eef),_0x98738d=_0x1dc400[_0x416f2d(0x97)](_0x51cde7=>_0x51cde7[_0x416f2d(0x71)][_0x416f2d(0x7b)]>0x0),_0x272e5f=selectMenusForUpdate(_0x98738d,_0x39f9d9[_0x416f2d(0x80)]);if(_0x272e5f['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x39f9d9[_0x416f2d(0x9e)]===!![]};const _0xfdf874=_0x272e5f[_0x416f2d(0x78)](_0x55a0d9=>buildMenuUpdateDiff(_0x55a0d9,_0x49d067,_0x1a6d0e,_0x39f9d9[_0x416f2d(0x7e)]===!![],_0x39f9d9['loadScriptMode']));if(_0x39f9d9['dryRun'])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0xfdf874};const _0x3bc843=await Promise[_0x416f2d(0x73)](_0x272e5f[_0x416f2d(0x78)]((_0x227a3e,_0x40afab)=>updateMenuCdnUrl(_0x262ccf,_0x225eef,{'id':_0x227a3e['id'],'label':_0x227a3e['label'],'path':_0x227a3e[_0x416f2d(0x7a)],'resources':_0xfdf874[_0x40afab][_0x416f2d(0xa9)][_0x416f2d(0x71)],'extend':_0x227a3e['extend']??null,'loadScriptMode':_0x39f9d9[_0x416f2d(0x88)]}))),_0x1dd9ba=_0x3bc843[_0x416f2d(0x97)](_0xf158b4=>_0xf158b4[_0x416f2d(0x8b)]==='fulfilled')[_0x416f2d(0x78)](_0x138d77=>_0x138d77[_0x416f2d(0xb0)]),_0x340c4e=_0x3bc843[_0x416f2d(0x97)](_0x1a1ab5=>_0x1a1ab5[_0x416f2d(0x8b)]===_0x416f2d(0x85))[_0x416f2d(0x7b)];return logger[_0x416f2d(0xa8)](_0x416f2d(0x6f),_0x416f2d(0xa4),{'count':_0x272e5f[_0x416f2d(0x7b)],'resources':_0x208310}),{'updated':_0x1dd9ba[_0x416f2d(0x7b)],'failed':_0x340c4e,'skipped':![],'menus':_0x1dd9ba};}function validateSelection(_0xe95751){const _0x426c49=a132_0x21dc;if(!_0xe95751)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0xe95751[_0x426c49(0x6e)]&&(_0xe95751[_0x426c49(0x83)][_0x426c49(0x7b)]>0x0||_0xe95751[_0x426c49(0x96)][_0x426c49(0x7b)]>0x0))throw new Error('--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.');if(!_0xe95751[_0x426c49(0x6e)]&&_0xe95751[_0x426c49(0x83)][_0x426c49(0x7b)]===0x0&&_0xe95751[_0x426c49(0x96)][_0x426c49(0x7b)]===0x0)throw new Error(_0x426c49(0xa7));}function a132_0x5ce5(){const _0xb7f944=['length','.css','48896toChWa','force','4189680ZpRwlO','selection','174LQoKPn',').\x20','menuIds','2VYERLr','rejected','trim','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','loadScriptMode','field','menu\x20asset-update\x20cannot\x20patch\x20','status','2364gzwAeV','4309466VVVDlj','540907vioRHF','extend','label','endsWith','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','mode','Start\x20non-interactive\x20menu\x20asset\x20update','paths','filter','setLogPath','.\x20Allowed\x20values:\x20replace,\x20patch','replace','some','patch','JS\x20URL\x20is\x20unreachable:\x20','dryRun','isArray','jsUrl','cssUrl','Invalid\x20--mode:\x20','split','Menu\x20asset\x20update\x20completed','\x20existing\x20JS\x20resources\x20for\x20\x22','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','info','after','string','has','Invalid\x20--params:\x20','push','\x22\x20(','.js','value','toLowerCase','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','--params.','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','parse','all','menu-asset-update','1142082vuPeLD','resources','1473340ZBbsAX','allSettled','unshift','90auiFmx','\x20existing\x20CSS\x20resources\x20for\x20\x22','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','map','join','path'];a132_0x5ce5=function(){return _0xb7f944;};return a132_0x5ce5();}export function selectMenusForUpdate(_0x5252c6,_0x548469){const _0x1c3b2e=a132_0x21dc;validateSelection(_0x548469);if(_0x548469[_0x1c3b2e(0x6e)])return _0x5252c6;const _0x31868c=new Set(_0x5252c6[_0x1c3b2e(0x78)](_0xefbfaf=>_0xefbfaf['id'])),_0x2d7e4f=new Set(_0x5252c6[_0x1c3b2e(0x78)](_0x304ca6=>_0x304ca6[_0x1c3b2e(0x7a)])),_0x3168b2=_0x548469[_0x1c3b2e(0x83)][_0x1c3b2e(0x97)](_0x437ea9=>!_0x31868c[_0x1c3b2e(0xab)](_0x437ea9)),_0x2715e9=_0x548469[_0x1c3b2e(0x96)][_0x1c3b2e(0x97)](_0x1babe2=>!_0x2d7e4f[_0x1c3b2e(0xab)](_0x1babe2));if(_0x3168b2[_0x1c3b2e(0x7b)]>0x0||_0x2715e9[_0x1c3b2e(0x7b)]>0x0){const _0x208b0e=[..._0x3168b2[_0x1c3b2e(0x78)](_0x5e06e7=>String(_0x5e06e7)),..._0x2715e9][_0x1c3b2e(0x79)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x208b0e);}const _0x231d43=new Set(_0x548469[_0x1c3b2e(0x83)]),_0x178a3c=new Set(_0x548469[_0x1c3b2e(0x96)]);return _0x5252c6['filter'](_0x166cd5=>_0x231d43[_0x1c3b2e(0xab)](_0x166cd5['id'])||_0x178a3c[_0x1c3b2e(0xab)](_0x166cd5[_0x1c3b2e(0x7a)]));}function a132_0x21dc(_0x2dce49,_0x4f31b8){_0x2dce49=_0x2dce49-0x6b;const _0x5ce5f2=a132_0x5ce5();let _0x21dcdb=_0x5ce5f2[_0x2dce49];return _0x21dcdb;}function normalizeMode(_0x5cb7c0){const _0x201787=a132_0x21dc;if(!_0x5cb7c0)return _0x201787(0x9c);if(_0x5cb7c0===_0x201787(0x9a)||_0x5cb7c0===_0x201787(0x9c))return _0x5cb7c0;throw new Error(_0x201787(0xa2)+_0x5cb7c0+_0x201787(0x99));}function buildMenuUpdateDiff(_0x2cb592,_0x1dcb7e,_0x3ff1f9,_0xf1c7fb,_0x19ed51){const _0xe8ddbe=a132_0x21dc,_0x1afbba=[..._0x2cb592[_0xe8ddbe(0x71)]];_0x3ff1f9===_0xe8ddbe(0x9c)&&assertUnambiguousPatchResources(_0x2cb592,_0x1afbba,_0x1dcb7e);const _0x458455=_0x3ff1f9===_0xe8ddbe(0x9c)?patchResources(_0x1afbba,_0x1dcb7e):replaceResources(_0x1dcb7e),_0x4866cb=[],_0x5518fa=_0x1afbba['some'](isJsResource),_0xa5ae3c=_0x458455[_0xe8ddbe(0x9b)](isJsResource);if(_0x5518fa&&!_0xa5ae3c){const _0x4ea07d=_0xe8ddbe(0x92)+_0x2cb592[_0xe8ddbe(0x90)]+'\x22\x20('+_0x2cb592['path']+_0xe8ddbe(0x82)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0xf1c7fb)throw new Error(_0x4ea07d);_0x4866cb[_0xe8ddbe(0xad)](_0x4ea07d);}const _0x53b779=_0x1afbba['some'](isCssResource),_0xf6f8ce=_0x458455[_0xe8ddbe(0x9b)](isCssResource);_0x53b779&&!_0xf6f8ce&&_0x4866cb[_0xe8ddbe(0xad)](_0xe8ddbe(0x93)+_0x2cb592['label']+_0xe8ddbe(0xae)+_0x2cb592['path']+').');const _0x5ec862=typeof _0x2cb592[_0xe8ddbe(0x8f)]?.['loadScriptMode']===_0xe8ddbe(0xaa)?_0x2cb592[_0xe8ddbe(0x8f)][_0xe8ddbe(0x88)]:null,_0x2c3b49=_0x19ed51?{'loadScriptMode':_0x5ec862}:{},_0x5c89af=_0x19ed51?{'loadScriptMode':_0x19ed51}:{};return{'id':_0x2cb592['id'],'label':_0x2cb592['label'],'path':_0x2cb592[_0xe8ddbe(0x7a)],'mode':_0x3ff1f9,'before':{'resources':_0x1afbba,..._0x2c3b49},'after':{'resources':_0x458455,..._0x5c89af},'warnings':_0x4866cb};}function replaceResources(_0x2a8673){const _0x4202ac=a132_0x21dc;return[_0x2a8673[_0x4202ac(0xa0)],_0x2a8673[_0x4202ac(0xa1)]][_0x4202ac(0x97)](_0x3f0cfa=>!!_0x3f0cfa);}function assertUnambiguousPatchResources(_0x5af401,_0x3e7c5c,_0x1d3d14){const _0x3f0fb6=a132_0x21dc,_0x4106e4=_0x3e7c5c[_0x3f0fb6(0x97)](isJsResource)['length'];if(_0x1d3d14[_0x3f0fb6(0xa0)]&&_0x4106e4>0x1)throw new Error(_0x3f0fb6(0x8a)+_0x4106e4+_0x3f0fb6(0xa5)+_0x5af401[_0x3f0fb6(0x90)]+_0x3f0fb6(0xae)+_0x5af401['path']+')\x20'+_0x3f0fb6(0xa6));const _0x52e105=_0x3e7c5c['filter'](isCssResource)['length'];if(_0x1d3d14[_0x3f0fb6(0xa1)]&&_0x52e105>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x52e105+_0x3f0fb6(0x76)+_0x5af401[_0x3f0fb6(0x90)]+_0x3f0fb6(0xae)+_0x5af401[_0x3f0fb6(0x7a)]+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function patchResources(_0x491f12,_0x175c11){const _0x3900e3=a132_0x21dc;let _0x57f2d8=![],_0x11e686=![];const _0x478846=[];for(const _0x4ddc1b of _0x491f12){if(isJsResource(_0x4ddc1b)){if(_0x175c11['jsUrl']&&!_0x57f2d8)_0x478846[_0x3900e3(0xad)](_0x175c11['jsUrl']),_0x57f2d8=!![];else!_0x175c11[_0x3900e3(0xa0)]&&_0x478846[_0x3900e3(0xad)](_0x4ddc1b);continue;}if(isCssResource(_0x4ddc1b)){if(_0x175c11['cssUrl']&&!_0x11e686)_0x478846[_0x3900e3(0xad)](_0x175c11[_0x3900e3(0xa1)]),_0x11e686=!![];else!_0x175c11[_0x3900e3(0xa1)]&&_0x478846[_0x3900e3(0xad)](_0x4ddc1b);continue;}_0x478846['push'](_0x4ddc1b);}return _0x175c11[_0x3900e3(0xa0)]&&!_0x57f2d8&&_0x478846[_0x3900e3(0x74)](_0x175c11[_0x3900e3(0xa0)]),_0x175c11[_0x3900e3(0xa1)]&&!_0x11e686&&_0x478846['push'](_0x175c11[_0x3900e3(0xa1)]),_0x478846;}function isJsResource(_0x51f482){const _0x214119=a132_0x21dc;return stripQuery(_0x51f482)[_0x214119(0xb1)]()[_0x214119(0x91)](_0x214119(0xaf));}function isCssResource(_0x4a91fc){const _0x71f381=a132_0x21dc;return stripQuery(_0x4a91fc)[_0x71f381(0xb1)]()[_0x71f381(0x91)](_0x71f381(0x7c));}function stripQuery(_0x1f4f24){const _0x354dc4=a132_0x21dc;return _0x1f4f24[_0x354dc4(0xa3)]('?')[0x0]??_0x1f4f24;}function parseUpdateParamsFlag(_0x52ef60){const _0x729e18=a132_0x21dc;if(!_0x52ef60||typeof _0x52ef60!==_0x729e18(0xaa))return{};try{const _0x1ac332=JSON[_0x729e18(0x6d)](_0x52ef60);if(typeof _0x1ac332!=='object'||_0x1ac332===null||Array[_0x729e18(0x9f)](_0x1ac332))return{};return{'jsUrl':typeof _0x1ac332[_0x729e18(0xa0)]===_0x729e18(0xaa)?_0x1ac332['jsUrl'][_0x729e18(0x86)]():undefined,'cssUrl':typeof _0x1ac332[_0x729e18(0xa1)]===_0x729e18(0xaa)?_0x1ac332['cssUrl'][_0x729e18(0x86)]():undefined};}catch{return{};}}
|
|
1
|
+
function a137_0x136d(_0x55da97,_0x10f6ab){_0x55da97=_0x55da97-0xd3;const _0x4b8a70=a137_0x4b8a();let _0x136dfb=_0x4b8a70[_0x55da97];return _0x136dfb;}(function(_0x5eade0,_0x4044ea){const _0xd923d=a137_0x136d,_0xf57e14=_0x5eade0();while(!![]){try{const _0x1ef678=parseInt(_0xd923d(0xe5))/0x1*(parseInt(_0xd923d(0xee))/0x2)+-parseInt(_0xd923d(0x10e))/0x3*(parseInt(_0xd923d(0xf5))/0x4)+parseInt(_0xd923d(0x10f))/0x5+parseInt(_0xd923d(0x110))/0x6*(parseInt(_0xd923d(0xe6))/0x7)+parseInt(_0xd923d(0x11b))/0x8*(parseInt(_0xd923d(0xdd))/0x9)+parseInt(_0xd923d(0xfa))/0xa*(parseInt(_0xd923d(0xfb))/0xb)+parseInt(_0xd923d(0x115))/0xc*(-parseInt(_0xd923d(0x10d))/0xd);if(_0x1ef678===_0x4044ea)break;else _0xf57e14['push'](_0xf57e14['shift']());}catch(_0x142b39){_0xf57e14['push'](_0xf57e14['shift']());}}}(a137_0x4b8a,0x29538));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(_0x2cc756){const _0x4e9c8e=a137_0x136d,_0x39bc12=[];return _0x2cc756[_0x4e9c8e(0xe9)]&&!isValidJsHttpsUrl(_0x2cc756['jsUrl'])&&_0x39bc12[_0x4e9c8e(0x10a)]({'field':_0x4e9c8e(0xe9),'message':_0x4e9c8e(0x114)}),_0x2cc756['cssUrl']&&!isValidCssHttpsUrl(_0x2cc756['cssUrl'])&&_0x39bc12['push']({'field':'cssUrl','message':_0x4e9c8e(0x103)}),_0x39bc12;}export async function runMenuUpdateCore(_0x41def3,_0x18f6aa,_0x6dcc74,_0x5a662e={}){const _0x247047=a137_0x136d,_0xbc3d0c=parseUpdateParamsFlag(_0x6dcc74),_0x38b793=normalizeMode(_0x5a662e[_0x247047(0x111)]);validateSelection(_0x5a662e[_0x247047(0x116)]);const _0x1bfc7f=[];if(_0xbc3d0c[_0x247047(0xe9)])_0x1bfc7f[_0x247047(0x10a)](_0xbc3d0c['jsUrl']);if(_0xbc3d0c[_0x247047(0xfc)])_0x1bfc7f[_0x247047(0x10a)](_0xbc3d0c[_0x247047(0xfc)]);const _0x248e64=validateParams(_0xbc3d0c);if(_0x248e64[_0x247047(0x112)]>0x0){const _0x30306a=_0x248e64[_0x247047(0x118)](_0x28a1d5=>_0x247047(0xea)+_0x28a1d5[_0x247047(0xff)]+':\x20'+_0x28a1d5[_0x247047(0x105)])['join'](';\x20');throw new Error(_0x247047(0xf6)+_0x30306a);}if(_0x1bfc7f[_0x247047(0x112)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x247047(0x101));logger[_0x247047(0xdf)](process['cwd']()),logger[_0x247047(0xe8)](_0x247047(0xfd),_0x247047(0xe4),{'appCode':_0x41def3,'jsUrl':_0xbc3d0c[_0x247047(0xe9)],'cssUrl':_0xbc3d0c[_0x247047(0xfc)],'mode':_0x38b793,'dryRun':_0x5a662e['dryRun']===!![]});if(_0xbc3d0c[_0x247047(0xe9)]){const _0x34c60c=await isUrlReachable(_0xbc3d0c[_0x247047(0xe9)]);if(!_0x34c60c)throw new Error(_0x247047(0xde)+_0xbc3d0c['jsUrl']);}if(_0xbc3d0c[_0x247047(0xfc)]){const _0x5207e2=await isUrlReachable(_0xbc3d0c[_0x247047(0xfc)]);if(!_0x5207e2)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0xbc3d0c[_0x247047(0xfc)]);}const _0x30f5c6=await getOnlineMenuList(_0x41def3,_0x18f6aa),_0x45a769=_0x30f5c6[_0x247047(0x106)](_0x4d2e8d=>_0x4d2e8d[_0x247047(0xf9)][_0x247047(0x112)]>0x0),_0x5b726c=selectMenusForUpdate(_0x45a769,_0x5a662e['selection']);if(_0x5b726c[_0x247047(0x112)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x5a662e[_0x247047(0xd7)]===!![]};const _0x4d5f77=_0x5b726c['map'](_0x3ce854=>buildMenuUpdateDiff(_0x3ce854,_0xbc3d0c,_0x38b793,_0x5a662e[_0x247047(0xd5)]===!![],_0x5a662e[_0x247047(0x10c)]));if(_0x5a662e['dryRun'])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x4d5f77};const _0x316b92=await Promise[_0x247047(0xdb)](_0x5b726c['map']((_0x15de46,_0x2fa1e4)=>updateMenuCdnUrl(_0x41def3,_0x18f6aa,{'id':_0x15de46['id'],'label':_0x15de46[_0x247047(0xf8)],'path':_0x15de46[_0x247047(0x11e)],'resources':_0x4d5f77[_0x2fa1e4][_0x247047(0x11a)][_0x247047(0xf9)],'extend':_0x15de46[_0x247047(0xf7)]??null,'loadScriptMode':_0x5a662e['loadScriptMode']}))),_0x10d645=_0x316b92[_0x247047(0x106)](_0x20659e=>_0x20659e[_0x247047(0x11d)]===_0x247047(0x107))[_0x247047(0x118)](_0x2f24ab=>_0x2f24ab['value']),_0x5a2971=_0x316b92['filter'](_0x451674=>_0x451674[_0x247047(0x11d)]===_0x247047(0xe1))[_0x247047(0x112)];return logger[_0x247047(0xe8)](_0x247047(0xfd),_0x247047(0xf1),{'count':_0x5b726c[_0x247047(0x112)],'resources':_0x1bfc7f}),{'updated':_0x10d645[_0x247047(0x112)],'failed':_0x5a2971,'skipped':![],'menus':_0x10d645};}function validateSelection(_0x309e99){const _0x1722f7=a137_0x136d;if(!_0x309e99)throw new Error(_0x1722f7(0x100));if(_0x309e99[_0x1722f7(0xfe)]&&(_0x309e99['menuIds'][_0x1722f7(0x112)]>0x0||_0x309e99[_0x1722f7(0x117)][_0x1722f7(0x112)]>0x0))throw new Error(_0x1722f7(0x10b));if(!_0x309e99[_0x1722f7(0xfe)]&&_0x309e99[_0x1722f7(0xeb)][_0x1722f7(0x112)]===0x0&&_0x309e99[_0x1722f7(0x117)][_0x1722f7(0x112)]===0x0)throw new Error(_0x1722f7(0x100));}export function selectMenusForUpdate(_0x5a0c83,_0x43c67a){const _0x146287=a137_0x136d;validateSelection(_0x43c67a);if(_0x43c67a[_0x146287(0xfe)])return _0x5a0c83;const _0x1b038c=new Set(_0x5a0c83[_0x146287(0x118)](_0x153219=>_0x153219['id'])),_0x53a06b=new Set(_0x5a0c83['map'](_0x5a49f9=>_0x5a49f9['path'])),_0x45b100=_0x43c67a[_0x146287(0xeb)]['filter'](_0x1672b2=>!_0x1b038c[_0x146287(0xe2)](_0x1672b2)),_0x15edb3=_0x43c67a[_0x146287(0x117)][_0x146287(0x106)](_0x36cde1=>!_0x53a06b[_0x146287(0xe2)](_0x36cde1));if(_0x45b100['length']>0x0||_0x15edb3['length']>0x0){const _0xd444e7=[..._0x45b100[_0x146287(0x118)](_0x58625f=>String(_0x58625f)),..._0x15edb3][_0x146287(0x113)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0xd444e7);}const _0x3ced4e=new Set(_0x43c67a[_0x146287(0xeb)]),_0x161c5b=new Set(_0x43c67a['paths']);return _0x5a0c83[_0x146287(0x106)](_0x42c912=>_0x3ced4e[_0x146287(0xe2)](_0x42c912['id'])||_0x161c5b[_0x146287(0xe2)](_0x42c912['path']));}function normalizeMode(_0x32d4cb){const _0x4d2b7f=a137_0x136d;if(!_0x32d4cb)return _0x4d2b7f(0x108);if(_0x32d4cb===_0x4d2b7f(0xf0)||_0x32d4cb===_0x4d2b7f(0x108))return _0x32d4cb;throw new Error(_0x4d2b7f(0xda)+_0x32d4cb+_0x4d2b7f(0xd4));}function buildMenuUpdateDiff(_0x44505b,_0x2a1a46,_0x4aa633,_0x5af547,_0x1f5604){const _0x475ea5=a137_0x136d,_0x360b14=[..._0x44505b[_0x475ea5(0xf9)]];_0x4aa633==='patch'&&assertUnambiguousPatchResources(_0x44505b,_0x360b14,_0x2a1a46);const _0x41535d=_0x4aa633===_0x475ea5(0x108)?patchResources(_0x360b14,_0x2a1a46):replaceResources(_0x2a1a46),_0x127c27=[],_0x29df71=_0x360b14['some'](isJsResource),_0x2f42f8=_0x41535d[_0x475ea5(0xe0)](isJsResource);if(_0x29df71&&!_0x2f42f8){const _0x2bf2d3=_0x475ea5(0xdc)+_0x44505b[_0x475ea5(0xf8)]+_0x475ea5(0xd3)+_0x44505b[_0x475ea5(0x11e)]+_0x475ea5(0x119)+_0x475ea5(0xf2);if(!_0x5af547)throw new Error(_0x2bf2d3);_0x127c27[_0x475ea5(0x10a)](_0x2bf2d3);}const _0x527447=_0x360b14[_0x475ea5(0xe0)](isCssResource),_0x55bcab=_0x41535d[_0x475ea5(0xe0)](isCssResource);_0x527447&&!_0x55bcab&&_0x127c27[_0x475ea5(0x10a)](_0x475ea5(0x104)+_0x44505b[_0x475ea5(0xf8)]+_0x475ea5(0xd3)+_0x44505b['path']+').');const _0x1efe3a=typeof _0x44505b[_0x475ea5(0xf7)]?.[_0x475ea5(0x10c)]===_0x475ea5(0xef)?_0x44505b['extend'][_0x475ea5(0x10c)]:null,_0x4ef143=_0x1f5604?{'loadScriptMode':_0x1efe3a}:{},_0x482b3f=_0x1f5604?{'loadScriptMode':_0x1f5604}:{};return{'id':_0x44505b['id'],'label':_0x44505b['label'],'path':_0x44505b['path'],'mode':_0x4aa633,'before':{'resources':_0x360b14,..._0x4ef143},'after':{'resources':_0x41535d,..._0x482b3f},'warnings':_0x127c27};}function a137_0x4b8a(){const _0x43efe7=['allSettled','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','18801dQZJrF','JS\x20URL\x20is\x20unreachable:\x20','setLogPath','some','rejected','has','.js','Start\x20non-interactive\x20menu\x20asset\x20update','196873CgyJva','618653lgXvLd','split','info','jsUrl','--params.','menuIds','endsWith','unshift','2YplNfb','string','replace','Menu\x20asset\x20update\x20completed','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','parse','\x20existing\x20JS\x20resources\x20for\x20\x22','28YBknCm','Invalid\x20--params:\x20','extend','label','resources','4010zHvzKq','5104QhxYxy','cssUrl','menu-asset-update','all','field','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','menu\x20asset-update\x20cannot\x20patch\x20','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','message','filter','fulfilled','patch','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','push','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','loadScriptMode','702OipRzs','13269YNlfTG','156035xOdoHq','6TUxjUG','mode','length','join','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','109884dyXhoe','selection','paths','map',').\x20','after','736QdyULL','\x20existing\x20CSS\x20resources\x20for\x20\x22','status','path','isArray','\x22\x20(','.\x20Allowed\x20values:\x20replace,\x20patch','force','trim','dryRun','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','toLowerCase','Invalid\x20--mode:\x20'];a137_0x4b8a=function(){return _0x43efe7;};return a137_0x4b8a();}function replaceResources(_0xf134a6){const _0x40b812=a137_0x136d;return[_0xf134a6[_0x40b812(0xe9)],_0xf134a6['cssUrl']]['filter'](_0xab19af=>!!_0xab19af);}function assertUnambiguousPatchResources(_0x40a1ee,_0x59bb2e,_0x318b11){const _0x252fd2=a137_0x136d,_0x4ef0f3=_0x59bb2e[_0x252fd2(0x106)](isJsResource)[_0x252fd2(0x112)];if(_0x318b11['jsUrl']&&_0x4ef0f3>0x1)throw new Error(_0x252fd2(0x102)+_0x4ef0f3+_0x252fd2(0xf4)+_0x40a1ee['label']+'\x22\x20('+_0x40a1ee[_0x252fd2(0x11e)]+')\x20'+_0x252fd2(0x109));const _0x355beb=_0x59bb2e[_0x252fd2(0x106)](isCssResource)[_0x252fd2(0x112)];if(_0x318b11[_0x252fd2(0xfc)]&&_0x355beb>0x1)throw new Error(_0x252fd2(0x102)+_0x355beb+_0x252fd2(0x11c)+_0x40a1ee[_0x252fd2(0xf8)]+_0x252fd2(0xd3)+_0x40a1ee[_0x252fd2(0x11e)]+')\x20'+_0x252fd2(0xd8));}function patchResources(_0x5de7a2,_0x359573){const _0x4022db=a137_0x136d;let _0x4c22c3=![],_0x5e3df4=![];const _0x48e04e=[];for(const _0x1be645 of _0x5de7a2){if(isJsResource(_0x1be645)){if(_0x359573[_0x4022db(0xe9)]&&!_0x4c22c3)_0x48e04e[_0x4022db(0x10a)](_0x359573[_0x4022db(0xe9)]),_0x4c22c3=!![];else!_0x359573['jsUrl']&&_0x48e04e[_0x4022db(0x10a)](_0x1be645);continue;}if(isCssResource(_0x1be645)){if(_0x359573['cssUrl']&&!_0x5e3df4)_0x48e04e['push'](_0x359573[_0x4022db(0xfc)]),_0x5e3df4=!![];else!_0x359573[_0x4022db(0xfc)]&&_0x48e04e[_0x4022db(0x10a)](_0x1be645);continue;}_0x48e04e[_0x4022db(0x10a)](_0x1be645);}return _0x359573[_0x4022db(0xe9)]&&!_0x4c22c3&&_0x48e04e[_0x4022db(0xed)](_0x359573['jsUrl']),_0x359573[_0x4022db(0xfc)]&&!_0x5e3df4&&_0x48e04e[_0x4022db(0x10a)](_0x359573[_0x4022db(0xfc)]),_0x48e04e;}function isJsResource(_0x74adf6){const _0x581eca=a137_0x136d;return stripQuery(_0x74adf6)[_0x581eca(0xd9)]()[_0x581eca(0xec)](_0x581eca(0xe3));}function isCssResource(_0x502cd7){const _0x2d7c00=a137_0x136d;return stripQuery(_0x502cd7)[_0x2d7c00(0xd9)]()[_0x2d7c00(0xec)]('.css');}function stripQuery(_0x3ba3c7){const _0x367263=a137_0x136d;return _0x3ba3c7[_0x367263(0xe7)]('?')[0x0]??_0x3ba3c7;}function parseUpdateParamsFlag(_0x3c2f00){const _0x220711=a137_0x136d;if(!_0x3c2f00||typeof _0x3c2f00!==_0x220711(0xef))return{};try{const _0xa9dd3=JSON[_0x220711(0xf3)](_0x3c2f00);if(typeof _0xa9dd3!=='object'||_0xa9dd3===null||Array[_0x220711(0x11f)](_0xa9dd3))return{};return{'jsUrl':typeof _0xa9dd3[_0x220711(0xe9)]===_0x220711(0xef)?_0xa9dd3[_0x220711(0xe9)][_0x220711(0xd6)]():undefined,'cssUrl':typeof _0xa9dd3[_0x220711(0xfc)]===_0x220711(0xef)?_0xa9dd3[_0x220711(0xfc)][_0x220711(0xd6)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a138_0x21f3(_0x478529,_0x40ba00){_0x478529=_0x478529-0x15a;const _0x1e01eb=a138_0x1e01();let _0x21f3c5=_0x1e01eb[_0x478529];return _0x21f3c5;}(function(_0x4128d5,_0x27e03a){const _0x43396d=a138_0x21f3,_0x3299e1=_0x4128d5();while(!![]){try{const _0x1cc919=-parseInt(_0x43396d(0x161))/0x1+-parseInt(_0x43396d(0x162))/0x2+-parseInt(_0x43396d(0x160))/0x3*(parseInt(_0x43396d(0x163))/0x4)+parseInt(_0x43396d(0x15e))/0x5+-parseInt(_0x43396d(0x15f))/0x6+-parseInt(_0x43396d(0x15a))/0x7+parseInt(_0x43396d(0x15d))/0x8;if(_0x1cc919===_0x27e03a)break;else _0x3299e1['push'](_0x3299e1['shift']());}catch(_0x589c96){_0x3299e1['push'](_0x3299e1['shift']());}}}(a138_0x1e01,0xec6d2));export function isValidJsHttpsUrl(_0x477bdd){const _0x563660=a138_0x21f3;return/^https:\/\/.+\.js(\?.*)?$/[_0x563660(0x15b)](_0x477bdd[_0x563660(0x15c)]());}function a138_0x1e01(){const _0x118424=['639495HQRZvc','1228937ZWTQUY','350354dBjAlD','12KnbXLh','HEAD','3364270FTTIsq','test','trim','32009312cAypHi','1937720snCmaA','5376522dRzFhZ'];a138_0x1e01=function(){return _0x118424;};return a138_0x1e01();}export function isValidCssHttpsUrl(_0x3b3ab1){const _0xcb8748=a138_0x21f3;return/^https:\/\/.+\.css(\?.*)?$/[_0xcb8748(0x15b)](_0x3b3ab1[_0xcb8748(0x15c)]());}export async function isUrlReachable(_0x509c34){const _0x444e74=a138_0x21f3;try{const _0x4efa9b=await fetch(_0x509c34,{'method':_0x444e74(0x164)});return _0x4efa9b['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a139_0x4a39c6=a139_0x5cba;(function(_0xed4c58,_0x48efa3){const _0x5461fe=a139_0x5cba,_0x326f58=_0xed4c58();while(!![]){try{const _0x3dedd2=-parseInt(_0x5461fe(0x1e0))/0x1*(-parseInt(_0x5461fe(0x1d3))/0x2)+parseInt(_0x5461fe(0x1d4))/0x3+parseInt(_0x5461fe(0x1cd))/0x4*(-parseInt(_0x5461fe(0x1e8))/0x5)+parseInt(_0x5461fe(0x1d8))/0x6*(-parseInt(_0x5461fe(0x1a5))/0x7)+parseInt(_0x5461fe(0x1b1))/0x8*(parseInt(_0x5461fe(0x1ce))/0x9)+parseInt(_0x5461fe(0x1a3))/0xa+parseInt(_0x5461fe(0x1d1))/0xb*(-parseInt(_0x5461fe(0x1e9))/0xc);if(_0x3dedd2===_0x48efa3)break;else _0x326f58['push'](_0x326f58['shift']());}catch(_0x49f524){_0x326f58['push'](_0x326f58['shift']());}}}(a139_0x198a,0x914c1));import a139_0x3ff134 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';function a139_0x5cba(_0x72853c,_0x5f32e2){_0x72853c=_0x72853c-0x1a3;const _0x198af7=a139_0x198a();let _0x5cba61=_0x198af7[_0x72853c];return _0x5cba61;}function a139_0x198a(){const _0x26efb6=['69344EXmqSn','gray','appCode','targetPages','onlineMenuList','map','cookie','Would\x20create\x20','onlinePaths','appcode','sync','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','cyan','string','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','Sync\x20local\x20pages\x20as\x20platform\x20menus','menu','cssUrl','Menu\x20sync\x20skipped','params','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','jsUrl','split','length','Creating\x20','\x20\x20Continue\x20with\x20creation?','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','POST','28Iuppfq','711QuLrhQ','Menu\x20creation\x20failed','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','1237434TiRlRQ','Online\x20menu\x20list\x20fetched','21014MZlfXl','1158087FUmsjm','rawFlags','yes','Pre-fill\x20JS/CSS\x20URLs.\x20','18294HZDLjO','Menu\x20sync\x20completed:\x20','skipped','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','\x20created,\x20','write','str','\x20menu(s)\x20created','31WaBTjO','\x20and\x20CSS:\x20','size','/smartapi/menu/create','selectedAppName','validation','Failed\x20to\x20fetch\x20online\x20menu\x20list','\x20\x20✓\x20Selected:\x20','33665NSRXbe','48PEakoc','\x20\x20Cancelled.','boolean','3482120fIhGVA','Fetching\x20online\x20menu\x20list...','1498ulvzEJ','trim','\x20menu(s)\x20with\x20JS:\x20','localPages','Created\x20','failed','\x20local\x20microfrontend\x20menu(s).','message','\x20menu(s)...','paths','yellow','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.'];a139_0x198a=function(){return _0x26efb6;};return a139_0x198a();}import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';export const menuSync={'service':a139_0x4a39c6(0x1c1),'command':a139_0x4a39c6(0x1bb),'description':a139_0x4a39c6(0x1c0),'risk':a139_0x4a39c6(0x1dd),'flags':[{'name':a139_0x4a39c6(0x1c4),'type':a139_0x4a39c6(0x1be),'description':a139_0x4a39c6(0x1d7)+a139_0x4a39c6(0x1d0)},{'name':a139_0x4a39c6(0x1ae),'type':a139_0x4a39c6(0x1be),'description':a139_0x4a39c6(0x1cb)},{'name':'yes','type':a139_0x4a39c6(0x1eb),'description':a139_0x4a39c6(0x1db)}],async 'dryRun'(_0x43d0f0){const _0x3b6f56=a139_0x4a39c6;ensureRunnableContext(_0x43d0f0['rawFlags'],_0x43d0f0['selectedAppName']);const _0xef0345=await runMenuSyncCore(_0x43d0f0[_0x3b6f56(0x1b3)],_0x43d0f0[_0x3b6f56(0x1b7)],parsePaths(_0x43d0f0[_0x3b6f56(0x1de)](_0x3b6f56(0x1ae))),_0x43d0f0[_0x3b6f56(0x1de)](_0x3b6f56(0x1c4)),{'dryRun':!![]});return{'method':_0x3b6f56(0x1cc),'url':_0x3b6f56(0x1e3),'body':_0xef0345,'description':_0xef0345[_0x3b6f56(0x1da)]?_0x3b6f56(0x1b0):_0x3b6f56(0x1b8)+_0xef0345[_0x3b6f56(0x1b4)]['length']+_0x3b6f56(0x1ab)};},async 'execute'(_0x504de6){const _0x1b510f=a139_0x4a39c6;ensureRunnableContext(_0x504de6[_0x1b510f(0x1d5)],_0x504de6[_0x1b510f(0x1e4)]);const _0x305e11=_0x504de6['flag'](_0x1b510f(0x1d6)),_0x2aefa6=_0x504de6[_0x1b510f(0x1de)](_0x1b510f(0x1c4)),_0x389d9a=parsePaths(_0x504de6[_0x1b510f(0x1de)](_0x1b510f(0x1ae))),_0x6ba65a=parseMenuSyncParams(_0x2aefa6);if(_0x305e11){const _0x17214b=await runMenuSyncCore(_0x504de6[_0x1b510f(0x1b3)],_0x504de6[_0x1b510f(0x1b7)],_0x389d9a,_0x2aefa6);if(_0x17214b['skipped']){const _0x4fbb0e=getLocalPages();_0x4fbb0e['length']===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0x1b510f(0x1bf));}else writeCliSideChannelLine('✓\x20Menu\x20sync\x20completed:\x20'+_0x17214b['created']+_0x1b510f(0x1df));return{'ok':!![],'data':_0x17214b,'message':_0x17214b['skipped']?_0x1b510f(0x1c3):_0x1b510f(0x1d9)+_0x17214b['created']+'\x20created.'};}if(_0x389d9a['length']>0x0)throw CliErrors['validation']('menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.',_0x1b510f(0x1c5));if(!isInteractive()&&_0x2aefa6)throw CliErrors['validation']('Non-interactive\x20menu\x20sync\x20requires\x20--yes.',_0x1b510f(0x1c5));requireInteractive();const _0x1d2bdd=startSpinner(_0x1b510f(0x1a4));let _0x493db3,_0x250d8c,_0x367fb4;try{const _0x3fff63=await fetchMenuData(_0x504de6[_0x1b510f(0x1b3)],_0x504de6[_0x1b510f(0x1b7)]);_0x493db3=_0x3fff63[_0x1b510f(0x1a8)],_0x250d8c=_0x3fff63[_0x1b510f(0x1b9)],_0x367fb4=_0x3fff63[_0x1b510f(0x1b5)],stopSpinner(_0x1d2bdd,_0x1b510f(0x1d2),!![]);}catch(_0x537738){stopSpinner(_0x1d2bdd,_0x1b510f(0x1e6),![]);throw CliErrors[_0x1b510f(0x1e5)](_0x537738 instanceof Error?_0x537738[_0x1b510f(0x1ac)]:_0x1b510f(0x1e6));}if(_0x493db3[_0x1b510f(0x1c8)]===0x0)return writeCliSideChannelLine(a139_0x3ff134[_0x1b510f(0x1af)](_0x1b510f(0x1bc))),{'ok':!![]};const _0x5c576b=buildCompareRows(_0x493db3,_0x250d8c);writeCliSideChannelLine(renderCompareTable(_0x5c576b)),writeCliSideChannelLine('');const _0x1b3672=await selectPages(_0x493db3,_0x250d8c);writeCliSideChannelLine(''),writeCliSideChannelLine(a139_0x3ff134[_0x1b510f(0x1bd)](_0x1b510f(0x1e7)+_0x1b3672[_0x1b510f(0x1c8)]+'\x20page(s)'));const _0x51b244=_0x6ba65a['jsUrl']&&_0x6ba65a[_0x1b510f(0x1c2)];if(!_0x51b244){writeCliSideChannelLine(renderSyncSummary(_0x1b3672,_0x250d8c[_0x1b510f(0x1e2)]>0x0));const _0xc3b5fe=await askConfirm(_0x1b510f(0x1ca));if(!_0xc3b5fe)return writeCliSideChannelLine(a139_0x3ff134[_0x1b510f(0x1b2)](_0x1b510f(0x1ea))),{'ok':!![]};}let _0xa14d70=_0x6ba65a[_0x1b510f(0x1c6)],_0x10f5b3=_0x6ba65a[_0x1b510f(0x1c2)];!_0xa14d70&&(_0xa14d70=await askJsUrl());!_0x10f5b3&&(_0x10f5b3=await askCssUrl());const _0x5b3896=await askConfirm('\x20\x20Create\x20'+_0x1b3672[_0x1b510f(0x1c8)]+_0x1b510f(0x1a7)+_0xa14d70+_0x1b510f(0x1e1)+_0x10f5b3+'?');if(!_0x5b3896)return writeCliSideChannelLine(a139_0x3ff134['gray'](_0x1b510f(0x1ea))),{'ok':!![]};const _0x5ae7ef=[_0xa14d70,_0x10f5b3],_0x38434f=startSpinner(_0x1b510f(0x1c9)+_0x1b3672[_0x1b510f(0x1c8)]+_0x1b510f(0x1ad));try{const _0x1d3d72=await doCreateMenus(_0x504de6[_0x1b510f(0x1b3)],_0x504de6[_0x1b510f(0x1b7)],_0x1b3672,_0x5ae7ef);return stopSpinner(_0x38434f,_0x1b510f(0x1a9)+_0x1d3d72['created']+'\x20menu(s)',!![]),{'ok':!![],'data':_0x1d3d72,'message':_0x1b510f(0x1d9)+_0x1d3d72['created']+_0x1b510f(0x1dc)+_0x1d3d72[_0x1b510f(0x1aa)]+'\x20failed.'};}catch(_0x52dfb7){stopSpinner(_0x38434f,_0x1b510f(0x1cf),![]);throw CliErrors[_0x1b510f(0x1e5)](_0x52dfb7 instanceof Error?_0x52dfb7['message']:_0x1b510f(0x1cf));}}};function ensureRunnableContext(_0xf08036,_0x33b0de){const _0x51444b=a139_0x4a39c6,_0x1ce6cc=_0xf08036[_0x51444b(0x1ba)]?String(_0xf08036['appcode'])['trim']():'';if(!isInProject()&&!_0x33b0de&&!_0x1ce6cc)throw CliErrors['validation']('menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20'+'Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.');}function parsePaths(_0x3d8c22){const _0x450a00=a139_0x4a39c6;return[...new Set(_0x3d8c22[_0x450a00(0x1c7)](',')[_0x450a00(0x1b6)](_0x6cb767=>_0x6cb767[_0x450a00(0x1a6)]())['filter'](Boolean))];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a135_0x3e97(_0x36fde9,_0x44b47b){_0x36fde9=_0x36fde9-0xef;const _0x38307e=a135_0x3830();let _0x3e97d7=_0x38307e[_0x36fde9];return _0x3e97d7;}function a135_0x3830(){const _0xcd8246=['update-recovery','menus','string','\x20updated,\x20','true','isSafeInteger','menuIds','filter','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.','updated','beforeById','pageType','update\x20visibility\x20for','label','Menu\x20visibility\x20update\x20completed:\x20','validation','push','Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','split','Would\x20update\x20visibility\x20for\x20','expected-count','body','code','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.','Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility','recovered','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','menu_expected_count_mismatch','plannedActions','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.','menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.','Menu\x20','60002FDKAED','appCode','failed','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.','targets','menu_verification_failed','One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','depth','values','resources','Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20','childrenCount','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.','2faclTM','message','has','false','47070acQKhp','expect-visible','Response\x20was\x20lost\x20for\x20menu\x20','datasetId','requestedVisible','12282090aWmGvR','Selected\x20','trim','stringify','some','high-risk-write','902084dFCIIg','1174011GdAyLH','5WFjvBc','verification','byId','Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','\x20was\x20not\x20found\x20during\x20visibility\x20verification.','warnings','childrenIds','Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20','Response\x20was\x20lost\x20and\x20menu\x20','url','menu_selector_not_found','update\x20menu\x20visibility','visible','Updated\x20visibility\x20for\x20','\x20visibility\x20could\x20not\x20be\x20verified\x20safely','menu\x20list','rabetbase\x20menu\x20list\x20--format\x20compress','path','boolean','visibility-update','pageId','\x20menu(s),\x20expected\x20','update-menu-visibility','Requested\x20menu\x20visibility','Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state','map','set','get','str','length','modelType','175HsenPC','menu_permission_denied','/smartapi/menu/update','\x20menu(s);\x20skip\x20','\x20skipped,\x20','expectVisible','\x20unchanged\x20menu(s).','3008556TstpxX','hash','Final\x20menu\x20visibility\x20readback\x20failed.','Menu\x20id\x20selector(s)\x20not\x20found:\x20','\x20changed\x20unexpectedly.','join','paths','isArray','cookie','Exact\x20comma-separated\x20menu\x20paths\x20to\x20update','type','plan','parentId','verify\x20menu\x20visibility\x20update','menu-ids','number','27032zthBXd','resourcesValid','\x20failed.','expectedCount','sort'];a135_0x3830=function(){return _0xcd8246;};return a135_0x3830();}const a135_0x183e3c=a135_0x3e97;(function(_0x2283ce,_0x4010ae){const _0x36ba00=a135_0x3e97,_0x48c0de=_0x2283ce();while(!![]){try{const _0x4c3504=-parseInt(_0x36ba00(0x11b))/0x1*(-parseInt(_0x36ba00(0x10d))/0x2)+-parseInt(_0x36ba00(0x12b))/0x3+-parseInt(_0x36ba00(0x12a))/0x4*(parseInt(_0x36ba00(0x12c))/0x5)+-parseInt(_0x36ba00(0x11f))/0x6+parseInt(_0x36ba00(0x14b))/0x7*(-parseInt(_0x36ba00(0x162))/0x8)+-parseInt(_0x36ba00(0x152))/0x9+parseInt(_0x36ba00(0x124))/0xa;if(_0x4c3504===_0x4010ae)break;else _0x48c0de['push'](_0x48c0de['shift']());}catch(_0x47e703){_0x48c0de['push'](_0x48c0de['shift']());}}}(a135_0x3830,0x3bc0d));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../commands/menu/shared/facts.js';import{asVerificationError,assertVerified,describeMenuErrorCause,fetchMutationSnapshot,hasFlag,isMenuResponseLoss,mapMenuApiError,menuDryRunResult,menuError,menuFailure,mutationResult,recheckMutationSnapshot,requireExplicitYes}from'../../commands/menu/shared/mutations.js';import{updateMenuEntity}from'../../commands/menu/shared/service.js';import{CliErrors}from'../../errors.js';const BACKEND=[{'method':'POST','path':a135_0x183e3c(0x14d)}];export const menuVisibilityUpdate={'service':'menu','command':a135_0x183e3c(0x13f),'description':a135_0x183e3c(0xfe),'risk':a135_0x183e3c(0x129),'structuredErrors':!![],'flags':[{'name':a135_0x183e3c(0x160),'type':a135_0x183e3c(0xef),'description':a135_0x183e3c(0x107)},{'name':a135_0x183e3c(0x158),'type':a135_0x183e3c(0xef),'description':a135_0x183e3c(0x15b)},{'name':a135_0x183e3c(0x138),'type':a135_0x183e3c(0x13e),'required':!![],'description':a135_0x183e3c(0x143)},{'name':'expect-visible','type':'boolean','description':a135_0x183e3c(0x105)},{'name':'expected-count','type':a135_0x183e3c(0x161),'description':'Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1fa4a8){parseInput(_0x1fa4a8),requireExplicitYes(_0x1fa4a8);},async 'dryRun'(_0x4666bb){const _0x38ab84=a135_0x183e3c,_0x7fcd8d=await buildPlan(_0x4666bb,!![]),_0xf1c8be=_0x7fcd8d[_0x38ab84(0x15d)]['plannedActions']?.[_0x38ab84(0x149)]??0x0,_0x3db38f=_0x7fcd8d['plan'][_0x38ab84(0x112)][_0x38ab84(0x149)]-_0xf1c8be;return menuDryRunResult(_0x7fcd8d['plan'],{'method':'POST','url':_0x38ab84(0x14d),'body':{'updates':_0x7fcd8d[_0x38ab84(0x15d)][_0x38ab84(0x109)]?.[_0x38ab84(0x145)](_0x446608=>_0x446608[_0x38ab84(0x102)])??[]},'description':_0x38ab84(0x100)+_0xf1c8be+_0x38ab84(0x14e)+_0x3db38f+'\x20unchanged\x20menu(s).'});},async 'execute'(_0x13eab8){const _0x57adc=a135_0x183e3c;requireExplicitYes(_0x13eab8);const _0x4d59e3=await buildPlan(_0x13eab8,![]);await recheckMutationSnapshot(_0x13eab8,_0x4d59e3[_0x57adc(0x15d)],_0x57adc(0x137));const _0x4e165f=[],_0x3a0c53=[],_0x3d3dc6=[];for(const _0x5f2bd9 of _0x4d59e3[_0x57adc(0x15d)][_0x57adc(0x112)]){if(_0x5f2bd9['before'][_0x57adc(0x138)]===_0x4d59e3['plan'][_0x57adc(0x123)]){_0x4e165f[_0x57adc(0xfd)]({'id':_0x5f2bd9['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0x13eab8[_0x57adc(0x10e)],_0x13eab8['cookie'],{'id':_0x5f2bd9['id'],'visible':_0x4d59e3[_0x57adc(0x15d)][_0x57adc(0x123)]}),_0x4e165f['push']({'id':_0x5f2bd9['id'],'updated':!![],'skipped':![]});}catch(_0x4a08c3){const _0x4bba68=mapMenuApiError(_0x4a08c3,_0x57adc(0xf9),_0x5f2bd9['id']);if(isMenuResponseLoss(_0x4a08c3)&&_0x4bba68[_0x57adc(0x103)]!==_0x57adc(0x14c)){_0x3d3dc6[_0x57adc(0xfd)](_0x5f2bd9['id']);continue;}_0x3a0c53[_0x57adc(0xfd)]({'id':_0x5f2bd9['id'],'stage':'update','code':_0x4bba68[_0x57adc(0x103)],'message':_0x4bba68[_0x57adc(0x11c)]});}}let _0x31f93d;try{_0x31f93d=await fetchMenuSnapshot(_0x13eab8[_0x57adc(0x10e)],_0x13eab8[_0x57adc(0x15a)]);}catch(_0x1b9e82){const _0x8dbd8a=describeMenuErrorCause(_0x1b9e82,_0x57adc(0x15f)),_0x55c70a=_0x3d3dc6[_0x57adc(0x145)](_0x23665d=>({'id':_0x23665d,'stage':_0x57adc(0x167),'code':_0x57adc(0x113),'message':_0x57adc(0x121)+_0x23665d+'\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','requestedStateConfirmed':![],'recovered':![]})),_0xa2097b={'stage':_0x57adc(0x12d),'code':_0x57adc(0x113),'message':_0x57adc(0x154),'targetIds':_0x4d59e3[_0x57adc(0x15d)][_0x57adc(0x112)]['map'](_0x1318d9=>_0x1318d9['id']),'requestedStateConfirmed':![],..._0x8dbd8a};throw menuFailure(asVerificationError(_0x1b9e82,_0x57adc(0x144)),_0x4d59e3['plan'],{'stage':_0x57adc(0x12d),'succeeded':_0x4e165f,'failedRecords':[..._0x3a0c53,..._0x55c70a,_0xa2097b],'warnings':['The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.'],'verification':{'status':_0x57adc(0x10f),'recoveredCount':0x0,'lookupCommand':'rabetbase\x20menu\x20list\x20--format\x20compress'}});}const _0x2a337b=[];for(const _0x1ca405 of _0x4e165f){const _0x3cb318=Number(_0x1ca405['id']),_0x3c6da9=_0x4d59e3[_0x57adc(0xf7)][_0x57adc(0x147)](_0x3cb318),_0x51fcfa=_0x31f93d['byId'][_0x57adc(0x147)](_0x3cb318);try{verifyVisibilityUpdate(_0x3c6da9,_0x51fcfa,_0x4d59e3[_0x57adc(0x15d)]['requestedVisible']);}catch(_0x18975a){const _0x26f8bb=asVerificationError(_0x18975a,_0x57adc(0x10c)+_0x3cb318+'\x20visibility\x20update\x20could\x20not\x20be\x20verified');_0x2a337b[_0x57adc(0xfd)]({'id':_0x3cb318,'stage':_0x57adc(0x12d),'code':_0x26f8bb[_0x57adc(0x103)],'message':_0x26f8bb['message'],'requestedStateConfirmed':![]});}}for(const _0x2c40bc of _0x3d3dc6){const _0x2e9182=_0x4d59e3[_0x57adc(0xf7)]['get'](_0x2c40bc),_0x4f8831=_0x31f93d[_0x57adc(0x12e)][_0x57adc(0x147)](_0x2c40bc);try{verifyVisibilityUpdate(_0x2e9182,_0x4f8831,_0x4d59e3[_0x57adc(0x15d)][_0x57adc(0x123)]),_0x4e165f['push']({'id':_0x2c40bc,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0x57eac7){const _0x4a4d32=asVerificationError(_0x57eac7,_0x57adc(0x134)+_0x2c40bc+_0x57adc(0x13a));_0x2a337b[_0x57adc(0xfd)]({'id':_0x2c40bc,'stage':'update-recovery','code':_0x4a4d32[_0x57adc(0x103)],'message':_0x4a4d32['message'],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x2a337b[_0x57adc(0x149)]>0x0){const _0x34f3e9=_0x2a337b[_0x57adc(0x145)](_0x4e764f=>Number(_0x4e764f['id'])),_0x596676=_0x4e165f[_0x57adc(0xf4)](_0x300389=>_0x300389[_0x57adc(0x106)]===!![])['length'],_0x46af62=menuError(_0x57adc(0x113),_0x57adc(0x118)+_0x34f3e9['join'](',\x20')+'.',_0x57adc(0x10a));throw menuFailure(_0x46af62,_0x4d59e3[_0x57adc(0x15d)],{'stage':_0x57adc(0x12d),'succeeded':_0x4e165f,'failedRecords':[..._0x3a0c53,..._0x2a337b],'warnings':[_0x57adc(0x114)],'verification':{'status':_0x57adc(0x10f),..._0x34f3e9[_0x57adc(0x149)]===0x1?{'targetId':_0x34f3e9[0x0]}:{'targetIds':_0x34f3e9},'recoveredCount':_0x596676,'lookupCommand':_0x57adc(0x13c)}});}const _0x29a464=_0x4e165f[_0x57adc(0xf4)](_0x1ff811=>_0x1ff811[_0x57adc(0xf6)]===!![])[_0x57adc(0x149)],_0x49296b=_0x4e165f[_0x57adc(0x149)]-_0x29a464,_0x58aaed={..._0x4d59e3[_0x57adc(0x15d)],'succeeded':_0x4e165f,'failed':_0x3a0c53,'warnings':_0x3a0c53[_0x57adc(0x149)]>0x0?[..._0x4d59e3[_0x57adc(0x15d)][_0x57adc(0x131)],_0x57adc(0x12f)]:_0x4d59e3[_0x57adc(0x15d)][_0x57adc(0x131)],'verification':{'checkedBy':_0x57adc(0x13b),'snapshotHash':_0x31f93d[_0x57adc(0x153)],'matchesRequestedState':_0x3a0c53['length']===0x0,'recoveredCount':_0x3d3dc6[_0x57adc(0x149)]}};return{'ok':_0x3a0c53['length']===0x0,'data':_0x58aaed,'message':_0x3a0c53['length']===0x0?_0x57adc(0x139)+_0x29a464+'\x20menu(s);\x20skipped\x20'+_0x49296b+_0x57adc(0x151):_0x57adc(0xfb)+_0x29a464+_0x57adc(0xf0)+_0x49296b+_0x57adc(0x14f)+_0x3a0c53[_0x57adc(0x149)]+_0x57adc(0x164)};}};function parseInput(_0xabd4a0){const _0x3ab468=a135_0x183e3c,_0x3eb0ac=parseMenuIds(_0xabd4a0[_0x3ab468(0x148)](_0x3ab468(0x160))),_0x580667=parseCsv(_0xabd4a0[_0x3ab468(0x148)](_0x3ab468(0x158)));if(_0x3eb0ac[_0x3ab468(0x149)]===0x0&&_0x580667[_0x3ab468(0x149)]===0x0)throw CliErrors['validation'](_0x3ab468(0x10b));const _0x193c5f=parseBooleanFlag(_0xabd4a0,_0x3ab468(0x138),!![]),_0x35aad6=parseBooleanFlag(_0xabd4a0,_0x3ab468(0x120),![]);let _0x5393cb;if(hasFlag(_0xabd4a0,_0x3ab468(0x101))){_0x5393cb=_0xabd4a0['num']('expected-count');if(!Number[_0x3ab468(0xf2)](_0x5393cb)||_0x5393cb<0x0)throw CliErrors[_0x3ab468(0xfc)]('--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.');}return{'menuIds':_0x3eb0ac,'paths':_0x580667,'visible':_0x193c5f,'expectVisible':_0x35aad6,'expectedCount':_0x5393cb};}async function buildPlan(_0x279f31,_0x40ff41){const _0x1c7fc1=a135_0x183e3c,_0x3d6170=parseInput(_0x279f31),_0x698d11=await fetchMutationSnapshot(_0x279f31,'update\x20menu\x20visibility'),_0x468a61=selectTargets(_0x698d11[_0x1c7fc1(0x168)],_0x3d6170[_0x1c7fc1(0xf3)],_0x3d6170[_0x1c7fc1(0x158)]);if(_0x3d6170[_0x1c7fc1(0x165)]!==undefined&&_0x468a61[_0x1c7fc1(0x149)]!==_0x3d6170[_0x1c7fc1(0x165)])throw menuError(_0x1c7fc1(0x108),_0x1c7fc1(0x125)+_0x468a61[_0x1c7fc1(0x149)]+_0x1c7fc1(0x141)+_0x3d6170[_0x1c7fc1(0x165)]+'.',_0x1c7fc1(0xf5));if(_0x3d6170[_0x1c7fc1(0x150)]!==undefined){const _0x4d140c=_0x468a61['filter'](_0x5a6423=>_0x5a6423[_0x1c7fc1(0x138)]!==_0x3d6170[_0x1c7fc1(0x150)]);if(_0x4d140c[_0x1c7fc1(0x149)]>0x0)throw menuError('menu_state_drift','Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20'+_0x4d140c[_0x1c7fc1(0x145)](_0x23f8bf=>_0x23f8bf['id'])[_0x1c7fc1(0x157)](',\x20')+'.',_0x1c7fc1(0x11a));}const _0x312783=_0x468a61['map'](_0x4fadab=>({'id':_0x4fadab['id'],'label':_0x4fadab[_0x1c7fc1(0xfa)],'path':_0x4fadab[_0x1c7fc1(0x13d)],'before':{'visible':_0x4fadab[_0x1c7fc1(0x138)]},'after':{'visible':_0x3d6170[_0x1c7fc1(0x138)]}})),_0x4011f6=_0x312783[_0x1c7fc1(0xf4)](_0x2ca53f=>_0x2ca53f['before']['visible']!==_0x3d6170[_0x1c7fc1(0x138)])[_0x1c7fc1(0x145)](_0x16dbd8=>({'stage':_0x1c7fc1(0x142),'method':'POST','path':'/smartapi/menu/update','body':{'appCode':_0x279f31[_0x1c7fc1(0x10e)],'id':_0x16dbd8['id'],'visible':_0x3d6170[_0x1c7fc1(0x138)]}})),_0x3e5f3b=mutationResult({'operation':'visibility-update','selector':{'menuIds':_0x3d6170['menuIds'],'paths':_0x3d6170[_0x1c7fc1(0x158)]},'before':{'menus':_0x468a61[_0x1c7fc1(0x145)](_0x1e3500=>({'id':_0x1e3500['id'],'path':_0x1e3500['path'],'visible':_0x1e3500[_0x1c7fc1(0x138)]}))},'after':{'menus':_0x468a61[_0x1c7fc1(0x145)](_0x23c857=>({'id':_0x23c857['id'],'path':_0x23c857[_0x1c7fc1(0x13d)],'visible':_0x3d6170[_0x1c7fc1(0x138)]}))},'dryRun':_0x40ff41,'backend':[...BACKEND],'plannedActions':_0x4011f6,'snapshotHash':_0x698d11['hash'],'warnings':_0x4011f6[_0x1c7fc1(0x149)]===0x0?['Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.']:[]});return{'plan':{..._0x3e5f3b,'requestedVisible':_0x3d6170[_0x1c7fc1(0x138)],'targets':_0x312783},'beforeById':new Map(_0x468a61['map'](_0x43d96c=>[_0x43d96c['id'],_0x43d96c]))};}function selectTargets(_0x1ab7b8,_0x1cbf97,_0x10cfd7){const _0x3b713c=a135_0x183e3c,_0x253bdb=new Map(_0x1ab7b8[_0x3b713c(0x145)](_0x48845a=>[_0x48845a['id'],_0x48845a])),_0x17b358=new Map(),_0x2e856c=_0x1cbf97[_0x3b713c(0xf4)](_0x550d93=>!_0x253bdb[_0x3b713c(0x11d)](_0x550d93));if(_0x2e856c[_0x3b713c(0x149)]>0x0)throw menuError(_0x3b713c(0x136),_0x3b713c(0x155)+_0x2e856c[_0x3b713c(0x157)](',\x20')+'.',_0x3b713c(0x104));for(const _0x480109 of _0x1cbf97){_0x17b358[_0x3b713c(0x146)](_0x480109,_0x253bdb[_0x3b713c(0x147)](_0x480109));}for(const _0x2783ce of _0x10cfd7){const _0x12c6f3=_0x1ab7b8[_0x3b713c(0xf4)](_0x8943ab=>_0x8943ab[_0x3b713c(0x13d)]===_0x2783ce);if(_0x12c6f3[_0x3b713c(0x149)]===0x0)throw menuError(_0x3b713c(0x136),'Menu\x20path\x20selector\x20not\x20found:\x20'+JSON[_0x3b713c(0x127)](_0x2783ce)+'.',_0x3b713c(0x111));if(_0x12c6f3[_0x3b713c(0x149)]>0x1)throw menuError('menu_selector_ambiguous',_0x3b713c(0x133)+JSON[_0x3b713c(0x127)](_0x2783ce)+'.','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20'+_0x12c6f3['map'](_0x5c86ae=>_0x5c86ae['id'])[_0x3b713c(0x157)](',\x20')+'.');const _0x2825d2=_0x12c6f3[0x0];_0x17b358[_0x3b713c(0x146)](_0x2825d2['id'],_0x2825d2);}return[..._0x17b358[_0x3b713c(0x116)]()];}function parseMenuIds(_0x5787f7){const _0x2c08fd=a135_0x183e3c,_0x26360d=parseCsv(_0x5787f7),_0x27bd94=_0x26360d[_0x2c08fd(0x145)](Number);if(_0x27bd94[_0x2c08fd(0x128)](_0x11f558=>!Number[_0x2c08fd(0xf2)](_0x11f558)||_0x11f558<=0x0))throw CliErrors[_0x2c08fd(0xfc)](_0x2c08fd(0x110));return[...new Set(_0x27bd94)];}function parseCsv(_0x2f5a4a){const _0x46f201=a135_0x183e3c;return[...new Set(_0x2f5a4a[_0x46f201(0xff)](',')[_0x46f201(0x145)](_0x467a3e=>_0x467a3e[_0x46f201(0x126)]())[_0x46f201(0xf4)](Boolean))];}function parseBooleanFlag(_0x150f0f,_0x356830,_0x47ef7c){const _0x396e20=a135_0x183e3c;if(!hasFlag(_0x150f0f,_0x356830)){if(_0x47ef7c)throw CliErrors['flagMissing'](_0x356830);return undefined;}const _0x496c63=_0x150f0f['rawFlags'][_0x356830];if(_0x496c63===!![]||_0x496c63===![])return _0x496c63;if(_0x496c63===_0x396e20(0xf1))return!![];if(_0x496c63===_0x396e20(0x11e))return![];throw CliErrors[_0x396e20(0xfc)]('--'+_0x356830+'\x20must\x20be\x20true\x20or\x20false.');}function verifyVisibilityUpdate(_0x490f32,_0x1e2937,_0x333fe4){const _0x35cc6b=a135_0x183e3c;assertVerified(!!_0x1e2937,_0x35cc6b(0x10c)+_0x490f32['id']+_0x35cc6b(0x130)),assertVerified(_0x1e2937['visible']===_0x333fe4,_0x35cc6b(0x10c)+_0x490f32['id']+'\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.');const _0x1ead47=[['id',_0x1e2937['id'],_0x490f32['id']],['parentId',_0x1e2937[_0x35cc6b(0x15e)],_0x490f32[_0x35cc6b(0x15e)]],[_0x35cc6b(0x115),_0x1e2937[_0x35cc6b(0x115)],_0x490f32[_0x35cc6b(0x115)]],['label',_0x1e2937['label'],_0x490f32[_0x35cc6b(0xfa)]],[_0x35cc6b(0x13d),_0x1e2937['path'],_0x490f32[_0x35cc6b(0x13d)]],[_0x35cc6b(0x135),_0x1e2937[_0x35cc6b(0x135)],_0x490f32[_0x35cc6b(0x135)]],[_0x35cc6b(0x15c),_0x1e2937[_0x35cc6b(0x15c)],_0x490f32[_0x35cc6b(0x15c)]],['sort',_0x1e2937['sort'],_0x490f32[_0x35cc6b(0x166)]],['resources',_0x1e2937['resources'],_0x490f32[_0x35cc6b(0x117)]],[_0x35cc6b(0x163),_0x1e2937[_0x35cc6b(0x163)],_0x490f32['resourcesValid']],[_0x35cc6b(0x132),_0x1e2937[_0x35cc6b(0x132)],_0x490f32[_0x35cc6b(0x132)]],['childrenCount',_0x1e2937[_0x35cc6b(0x119)],_0x490f32[_0x35cc6b(0x119)]],[_0x35cc6b(0x140),_0x1e2937[_0x35cc6b(0x140)],_0x490f32['pageId']],[_0x35cc6b(0xf8),_0x1e2937[_0x35cc6b(0xf8)],_0x490f32[_0x35cc6b(0xf8)]],[_0x35cc6b(0x14a),_0x1e2937['modelType'],_0x490f32[_0x35cc6b(0x14a)]],[_0x35cc6b(0x122),_0x1e2937[_0x35cc6b(0x122)],_0x490f32[_0x35cc6b(0x122)]],['datasetCode',_0x1e2937['datasetCode'],_0x490f32['datasetCode']]];for(const [_0x4e5c06,_0xbcbc2c,_0x1b661d]of _0x1ead47){assertVerified(sameValue(_0xbcbc2c,_0x1b661d),_0x35cc6b(0x10c)+_0x490f32['id']+'\x20'+_0x4e5c06+_0x35cc6b(0x156));}}function sameValue(_0x488faf,_0x1d57db){const _0x5f5421=a135_0x183e3c;if(Array[_0x5f5421(0x159)](_0x488faf)||Array[_0x5f5421(0x159)](_0x1d57db))return JSON[_0x5f5421(0x127)](_0x488faf)===JSON[_0x5f5421(0x127)](_0x1d57db);return _0x488faf===_0x1d57db;}
|
|
1
|
+
const a140_0x4ea6f3=a140_0x1897;(function(_0x76bb04,_0x6023de){const _0x6bb434=a140_0x1897,_0x51779d=_0x76bb04();while(!![]){try{const _0x23dc23=parseInt(_0x6bb434(0x200))/0x1+-parseInt(_0x6bb434(0x22a))/0x2*(-parseInt(_0x6bb434(0x1da))/0x3)+-parseInt(_0x6bb434(0x24a))/0x4*(-parseInt(_0x6bb434(0x209))/0x5)+-parseInt(_0x6bb434(0x217))/0x6+-parseInt(_0x6bb434(0x1e2))/0x7*(parseInt(_0x6bb434(0x227))/0x8)+-parseInt(_0x6bb434(0x1f3))/0x9*(-parseInt(_0x6bb434(0x24b))/0xa)+-parseInt(_0x6bb434(0x239))/0xb*(-parseInt(_0x6bb434(0x230))/0xc);if(_0x23dc23===_0x6023de)break;else _0x51779d['push'](_0x51779d['shift']());}catch(_0x18155d){_0x51779d['push'](_0x51779d['shift']());}}}(a140_0x27f6,0xccb60));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../commands/menu/shared/facts.js';import{asVerificationError,assertVerified,describeMenuErrorCause,fetchMutationSnapshot,hasFlag,isMenuResponseLoss,mapMenuApiError,menuDryRunResult,menuError,menuFailure,mutationResult,recheckMutationSnapshot,requireExplicitYes}from'../../commands/menu/shared/mutations.js';import{updateMenuEntity}from'../../commands/menu/shared/service.js';import{CliErrors}from'../../errors.js';const BACKEND=[{'method':a140_0x4ea6f3(0x246),'path':'/smartapi/menu/update'}];function a140_0x1897(_0x1050c2,_0x514379){_0x1050c2=_0x1050c2-0x1cf;const _0x27f675=a140_0x27f6();let _0x18973b=_0x27f675[_0x1050c2];return _0x18973b;}export const menuVisibilityUpdate={'service':a140_0x4ea6f3(0x242),'command':a140_0x4ea6f3(0x237),'description':a140_0x4ea6f3(0x244),'risk':a140_0x4ea6f3(0x21b),'structuredErrors':!![],'flags':[{'name':a140_0x4ea6f3(0x1ee),'type':a140_0x4ea6f3(0x1d6),'description':a140_0x4ea6f3(0x214)},{'name':a140_0x4ea6f3(0x20c),'type':a140_0x4ea6f3(0x1d6),'description':a140_0x4ea6f3(0x1f8)},{'name':'visible','type':a140_0x4ea6f3(0x221),'required':!![],'description':a140_0x4ea6f3(0x241)},{'name':a140_0x4ea6f3(0x1fe),'type':a140_0x4ea6f3(0x221),'description':a140_0x4ea6f3(0x1de)},{'name':a140_0x4ea6f3(0x1cf),'type':a140_0x4ea6f3(0x1fc),'description':a140_0x4ea6f3(0x1d4)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x325398){parseInput(_0x325398),requireExplicitYes(_0x325398);},async 'dryRun'(_0x58ced6){const _0x48bfd6=a140_0x4ea6f3,_0x5ecf1f=await buildPlan(_0x58ced6,!![]),_0x4e3f6e=_0x5ecf1f[_0x48bfd6(0x208)][_0x48bfd6(0x216)]?.['length']??0x0,_0x9932c0=_0x5ecf1f[_0x48bfd6(0x208)][_0x48bfd6(0x22e)][_0x48bfd6(0x22c)]-_0x4e3f6e;return menuDryRunResult(_0x5ecf1f[_0x48bfd6(0x208)],{'method':'POST','url':_0x48bfd6(0x21a),'body':{'updates':_0x5ecf1f[_0x48bfd6(0x208)][_0x48bfd6(0x216)]?.[_0x48bfd6(0x213)](_0x43e5d8=>_0x43e5d8['body'])??[]},'description':'Would\x20update\x20visibility\x20for\x20'+_0x4e3f6e+_0x48bfd6(0x21f)+_0x9932c0+'\x20unchanged\x20menu(s).'});},async 'execute'(_0x56f625){const _0x645abf=a140_0x4ea6f3;requireExplicitYes(_0x56f625);const _0x598ba2=await buildPlan(_0x56f625,![]);await recheckMutationSnapshot(_0x56f625,_0x598ba2['plan'],_0x645abf(0x240));const _0x2d3e20=[],_0x313148=[],_0x44ca77=[];for(const _0x4c63c9 of _0x598ba2[_0x645abf(0x208)][_0x645abf(0x22e)]){if(_0x4c63c9['before'][_0x645abf(0x235)]===_0x598ba2[_0x645abf(0x208)]['requestedVisible']){_0x2d3e20['push']({'id':_0x4c63c9['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0x56f625[_0x645abf(0x1ec)],_0x56f625['cookie'],{'id':_0x4c63c9['id'],'visible':_0x598ba2['plan'][_0x645abf(0x248)]}),_0x2d3e20[_0x645abf(0x1f7)]({'id':_0x4c63c9['id'],'updated':!![],'skipped':![]});}catch(_0x4d4f10){const _0x3f258d=mapMenuApiError(_0x4d4f10,_0x645abf(0x206),_0x4c63c9['id']);if(isMenuResponseLoss(_0x4d4f10)&&_0x3f258d[_0x645abf(0x23d)]!==_0x645abf(0x1d7)){_0x44ca77[_0x645abf(0x1f7)](_0x4c63c9['id']);continue;}_0x313148['push']({'id':_0x4c63c9['id'],'stage':_0x645abf(0x218),'code':_0x3f258d[_0x645abf(0x23d)],'message':_0x3f258d['message']});}}let _0x40ca56;try{_0x40ca56=await fetchMenuSnapshot(_0x56f625[_0x645abf(0x1ec)],_0x56f625[_0x645abf(0x1d0)]);}catch(_0xf749de){const _0x556db2=describeMenuErrorCause(_0xf749de,_0x645abf(0x1eb)),_0x205b14=_0x44ca77[_0x645abf(0x213)](_0x4b30d=>({'id':_0x4b30d,'stage':'update-recovery','code':_0x645abf(0x20b),'message':'Response\x20was\x20lost\x20for\x20menu\x20'+_0x4b30d+_0x645abf(0x205),'requestedStateConfirmed':![],'recovered':![]})),_0x13a9d4={'stage':'verification','code':_0x645abf(0x20b),'message':'Final\x20menu\x20visibility\x20readback\x20failed.','targetIds':_0x598ba2[_0x645abf(0x208)][_0x645abf(0x22e)][_0x645abf(0x213)](_0x14b747=>_0x14b747['id']),'requestedStateConfirmed':![],..._0x556db2};throw menuFailure(asVerificationError(_0xf749de,_0x645abf(0x1e4)),_0x598ba2[_0x645abf(0x208)],{'stage':_0x645abf(0x23e),'succeeded':_0x2d3e20,'failedRecords':[..._0x313148,..._0x205b14,_0x13a9d4],'warnings':[_0x645abf(0x222)],'verification':{'status':_0x645abf(0x249),'recoveredCount':0x0,'lookupCommand':_0x645abf(0x231)}});}const _0x2bffcd=[];for(const _0x12c743 of _0x2d3e20){const _0x1a915a=Number(_0x12c743['id']),_0x460a37=_0x598ba2['beforeById'][_0x645abf(0x1f2)](_0x1a915a),_0x73f94a=_0x40ca56[_0x645abf(0x233)][_0x645abf(0x1f2)](_0x1a915a);try{verifyVisibilityUpdate(_0x460a37,_0x73f94a,_0x598ba2[_0x645abf(0x208)][_0x645abf(0x248)]);}catch(_0x188a0f){const _0xbab4cc=asVerificationError(_0x188a0f,'Menu\x20'+_0x1a915a+_0x645abf(0x1e7));_0x2bffcd['push']({'id':_0x1a915a,'stage':_0x645abf(0x23e),'code':_0xbab4cc[_0x645abf(0x23d)],'message':_0xbab4cc[_0x645abf(0x21c)],'requestedStateConfirmed':![]});}}for(const _0x48af07 of _0x44ca77){const _0x2b5668=_0x598ba2[_0x645abf(0x1db)][_0x645abf(0x1f2)](_0x48af07),_0x30aa67=_0x40ca56[_0x645abf(0x233)]['get'](_0x48af07);try{verifyVisibilityUpdate(_0x2b5668,_0x30aa67,_0x598ba2[_0x645abf(0x208)][_0x645abf(0x248)]),_0x2d3e20[_0x645abf(0x1f7)]({'id':_0x48af07,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0x5a0622){const _0x2e8ee1=asVerificationError(_0x5a0622,_0x645abf(0x23b)+_0x48af07+'\x20visibility\x20could\x20not\x20be\x20verified\x20safely');_0x2bffcd[_0x645abf(0x1f7)]({'id':_0x48af07,'stage':'update-recovery','code':_0x2e8ee1[_0x645abf(0x23d)],'message':_0x2e8ee1[_0x645abf(0x21c)],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x2bffcd['length']>0x0){const _0x25e182=_0x2bffcd[_0x645abf(0x213)](_0x63f648=>Number(_0x63f648['id'])),_0x4bdba9=_0x2d3e20[_0x645abf(0x1d1)](_0x469bbc=>_0x469bbc['recovered']===!![])[_0x645abf(0x22c)],_0x358e96=menuError(_0x645abf(0x20b),_0x645abf(0x215)+_0x25e182[_0x645abf(0x1d2)](',\x20')+'.','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.');throw menuFailure(_0x358e96,_0x598ba2[_0x645abf(0x208)],{'stage':_0x645abf(0x23e),'succeeded':_0x2d3e20,'failedRecords':[..._0x313148,..._0x2bffcd],'warnings':[_0x645abf(0x234)],'verification':{'status':_0x645abf(0x249),..._0x25e182['length']===0x1?{'targetId':_0x25e182[0x0]}:{'targetIds':_0x25e182},'recoveredCount':_0x4bdba9,'lookupCommand':_0x645abf(0x231)}});}const _0x2adf0e=_0x2d3e20['filter'](_0xfbebac=>_0xfbebac[_0x645abf(0x20e)]===!![])['length'],_0x1a25fb=_0x2d3e20[_0x645abf(0x22c)]-_0x2adf0e,_0x5d206b={..._0x598ba2[_0x645abf(0x208)],'succeeded':_0x2d3e20,'failed':_0x313148,'warnings':_0x313148[_0x645abf(0x22c)]>0x0?[..._0x598ba2[_0x645abf(0x208)][_0x645abf(0x23c)],'Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.']:_0x598ba2[_0x645abf(0x208)][_0x645abf(0x23c)],'verification':{'checkedBy':_0x645abf(0x24e),'snapshotHash':_0x40ca56[_0x645abf(0x232)],'matchesRequestedState':_0x313148[_0x645abf(0x22c)]===0x0,'recoveredCount':_0x44ca77[_0x645abf(0x22c)]}};return{'ok':_0x313148[_0x645abf(0x22c)]===0x0,'data':_0x5d206b,'message':_0x313148[_0x645abf(0x22c)]===0x0?_0x645abf(0x1d5)+_0x2adf0e+_0x645abf(0x1ea)+_0x1a25fb+_0x645abf(0x247):_0x645abf(0x212)+_0x2adf0e+_0x645abf(0x22f)+_0x1a25fb+_0x645abf(0x229)+_0x313148[_0x645abf(0x22c)]+_0x645abf(0x1e3)};}};function a140_0x27f6(){const _0x52fe5a=['\x20was\x20not\x20found\x20during\x20visibility\x20verification.','\x20menu(s);\x20skip\x20','modelType','boolean','The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.','Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20','depth','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20','expectVisible','2828464TrlxTF','expectedCount','\x20skipped,\x20','65542gYLFMQ','has','length','update-menu-visibility','targets','\x20updated,\x20','187548hxHkFe','rabetbase\x20menu\x20list\x20--format\x20compress','hash','byId','One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','visible','rawFlags','visibility-update','resources','572dTGaXI','stringify','Response\x20was\x20lost\x20and\x20menu\x20','warnings','code','verification','childrenIds','update\x20menu\x20visibility','Requested\x20menu\x20visibility','menu','Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20','Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','isArray','POST','\x20unchanged\x20menu(s).','requestedVisible','failed','45524YpcGeO','206210caoLpX','menu_selector_not_found','\x20must\x20be\x20true\x20or\x20false.','menu\x20list','childrenCount','expected-count','cookie','filter','join','path','Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches','Updated\x20visibility\x20for\x20','string','menu_permission_denied','datasetId','Selected\x20','135VoGtYt','beforeById','sort','\x20menu(s),\x20expected\x20','Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility','some','resourcesValid','pageId','28mqyLYr','\x20failed.','Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state','menuIds','trim','\x20visibility\x20update\x20could\x20not\x20be\x20verified','before','flagMissing','\x20menu(s);\x20skipped\x20','verify\x20menu\x20visibility\x20update','appCode','isSafeInteger','menu-ids','parentId','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','\x20changed\x20unexpectedly.','get','144tvWqhn','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.','Menu\x20path\x20selector\x20not\x20found:\x20','values','push','Exact\x20comma-separated\x20menu\x20paths\x20to\x20update','str','validation','Menu\x20id\x20selector(s)\x20not\x20found:\x20','number','label','expect-visible','url','13903wzHKTW','menu_state_drift','menus','Menu\x20','set','\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','update\x20visibility\x20for','pageType','plan','180kmHfgN','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.','menu_verification_failed','paths','Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.','updated','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.','--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.','type','Menu\x20visibility\x20update\x20completed:\x20','map','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20','plannedActions','4729380EVhYha','update','split','/smartapi/menu/update','high-risk-write','message','datasetCode'];a140_0x27f6=function(){return _0x52fe5a;};return a140_0x27f6();}function parseInput(_0x4dca91){const _0x33fd3a=a140_0x4ea6f3,_0x33f584=parseMenuIds(_0x4dca91[_0x33fd3a(0x1f9)]('menu-ids')),_0x3d89c2=parseCsv(_0x4dca91[_0x33fd3a(0x1f9)](_0x33fd3a(0x20c)));if(_0x33f584[_0x33fd3a(0x22c)]===0x0&&_0x3d89c2['length']===0x0)throw CliErrors[_0x33fd3a(0x1fa)]('menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.');const _0x2c2d39=parseBooleanFlag(_0x4dca91,_0x33fd3a(0x235),!![]),_0x17790b=parseBooleanFlag(_0x4dca91,_0x33fd3a(0x1fe),![]);let _0x9210f3;if(hasFlag(_0x4dca91,_0x33fd3a(0x1cf))){_0x9210f3=_0x4dca91['num'](_0x33fd3a(0x1cf));if(!Number[_0x33fd3a(0x1ed)](_0x9210f3)||_0x9210f3<0x0)throw CliErrors[_0x33fd3a(0x1fa)](_0x33fd3a(0x210));}return{'menuIds':_0x33f584,'paths':_0x3d89c2,'visible':_0x2c2d39,'expectVisible':_0x17790b,'expectedCount':_0x9210f3};}async function buildPlan(_0x39b95f,_0x124037){const _0xb3058c=a140_0x4ea6f3,_0x439bcc=parseInput(_0x39b95f),_0x43906c=await fetchMutationSnapshot(_0x39b95f,_0xb3058c(0x240)),_0x2befc9=selectTargets(_0x43906c[_0xb3058c(0x202)],_0x439bcc[_0xb3058c(0x1e5)],_0x439bcc['paths']);if(_0x439bcc[_0xb3058c(0x228)]!==undefined&&_0x2befc9['length']!==_0x439bcc['expectedCount'])throw menuError('menu_expected_count_mismatch',_0xb3058c(0x1d9)+_0x2befc9['length']+_0xb3058c(0x1dd)+_0x439bcc['expectedCount']+'.',_0xb3058c(0x20a));if(_0x439bcc[_0xb3058c(0x226)]!==undefined){const _0x58b8a0=_0x2befc9[_0xb3058c(0x1d1)](_0x42cccc=>_0x42cccc[_0xb3058c(0x235)]!==_0x439bcc[_0xb3058c(0x226)]);if(_0x58b8a0[_0xb3058c(0x22c)]>0x0)throw menuError(_0xb3058c(0x201),_0xb3058c(0x223)+_0x58b8a0[_0xb3058c(0x213)](_0x3348d6=>_0x3348d6['id'])[_0xb3058c(0x1d2)](',\x20')+'.',_0xb3058c(0x1f4));}const _0x46e5e0=_0x2befc9[_0xb3058c(0x213)](_0x2afa86=>({'id':_0x2afa86['id'],'label':_0x2afa86[_0xb3058c(0x1fd)],'path':_0x2afa86['path'],'before':{'visible':_0x2afa86[_0xb3058c(0x235)]},'after':{'visible':_0x439bcc['visible']}})),_0x50704a=_0x46e5e0['filter'](_0x1bc92b=>_0x1bc92b[_0xb3058c(0x1e8)]['visible']!==_0x439bcc[_0xb3058c(0x235)])[_0xb3058c(0x213)](_0x206d3c=>({'stage':_0xb3058c(0x22d),'method':_0xb3058c(0x246),'path':_0xb3058c(0x21a),'body':{'appCode':_0x39b95f[_0xb3058c(0x1ec)],'id':_0x206d3c['id'],'visible':_0x439bcc[_0xb3058c(0x235)]}})),_0x201a4a=mutationResult({'operation':_0xb3058c(0x237),'selector':{'menuIds':_0x439bcc['menuIds'],'paths':_0x439bcc[_0xb3058c(0x20c)]},'before':{'menus':_0x2befc9[_0xb3058c(0x213)](_0x5c9049=>({'id':_0x5c9049['id'],'path':_0x5c9049[_0xb3058c(0x1d3)],'visible':_0x5c9049['visible']}))},'after':{'menus':_0x2befc9[_0xb3058c(0x213)](_0x3bfce5=>({'id':_0x3bfce5['id'],'path':_0x3bfce5[_0xb3058c(0x1d3)],'visible':_0x439bcc['visible']}))},'dryRun':_0x124037,'backend':[...BACKEND],'plannedActions':_0x50704a,'snapshotHash':_0x43906c['hash'],'warnings':_0x50704a[_0xb3058c(0x22c)]===0x0?[_0xb3058c(0x20d)]:[]});return{'plan':{..._0x201a4a,'requestedVisible':_0x439bcc[_0xb3058c(0x235)],'targets':_0x46e5e0},'beforeById':new Map(_0x2befc9[_0xb3058c(0x213)](_0x2a0470=>[_0x2a0470['id'],_0x2a0470]))};}function selectTargets(_0x53a402,_0x1d522e,_0x450396){const _0x5b78e8=a140_0x4ea6f3,_0x2ca6c5=new Map(_0x53a402['map'](_0x14c66c=>[_0x14c66c['id'],_0x14c66c])),_0x1ad90c=new Map(),_0x43c040=_0x1d522e[_0x5b78e8(0x1d1)](_0x3f3fb1=>!_0x2ca6c5[_0x5b78e8(0x22b)](_0x3f3fb1));if(_0x43c040[_0x5b78e8(0x22c)]>0x0)throw menuError(_0x5b78e8(0x24c),_0x5b78e8(0x1fb)+_0x43c040['join'](',\x20')+'.',_0x5b78e8(0x20f));for(const _0x53ee04 of _0x1d522e){_0x1ad90c['set'](_0x53ee04,_0x2ca6c5['get'](_0x53ee04));}for(const _0x3dee99 of _0x450396){const _0x435109=_0x53a402[_0x5b78e8(0x1d1)](_0x40d946=>_0x40d946[_0x5b78e8(0x1d3)]===_0x3dee99);if(_0x435109[_0x5b78e8(0x22c)]===0x0)throw menuError(_0x5b78e8(0x24c),_0x5b78e8(0x1f5)+JSON[_0x5b78e8(0x23a)](_0x3dee99)+'.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.');if(_0x435109[_0x5b78e8(0x22c)]>0x1)throw menuError('menu_selector_ambiguous',_0x5b78e8(0x243)+JSON[_0x5b78e8(0x23a)](_0x3dee99)+'.',_0x5b78e8(0x225)+_0x435109[_0x5b78e8(0x213)](_0x3c39a0=>_0x3c39a0['id'])[_0x5b78e8(0x1d2)](',\x20')+'.');const _0x5e5820=_0x435109[0x0];_0x1ad90c[_0x5b78e8(0x204)](_0x5e5820['id'],_0x5e5820);}return[..._0x1ad90c[_0x5b78e8(0x1f6)]()];}function parseMenuIds(_0x2d718a){const _0x60efa8=a140_0x4ea6f3,_0x5a8457=parseCsv(_0x2d718a),_0x27aedc=_0x5a8457[_0x60efa8(0x213)](Number);if(_0x27aedc[_0x60efa8(0x1df)](_0x2ba0bd=>!Number[_0x60efa8(0x1ed)](_0x2ba0bd)||_0x2ba0bd<=0x0))throw CliErrors['validation'](_0x60efa8(0x1f0));return[...new Set(_0x27aedc)];}function parseCsv(_0x3d307e){const _0x1c908d=a140_0x4ea6f3;return[...new Set(_0x3d307e[_0x1c908d(0x219)](',')[_0x1c908d(0x213)](_0x50ce19=>_0x50ce19[_0x1c908d(0x1e6)]())[_0x1c908d(0x1d1)](Boolean))];}function parseBooleanFlag(_0x4806a0,_0x46888e,_0x5ead84){const _0x156fab=a140_0x4ea6f3;if(!hasFlag(_0x4806a0,_0x46888e)){if(_0x5ead84)throw CliErrors[_0x156fab(0x1e9)](_0x46888e);return undefined;}const _0x3c9942=_0x4806a0[_0x156fab(0x236)][_0x46888e];if(_0x3c9942===!![]||_0x3c9942===![])return _0x3c9942;if(_0x3c9942==='true')return!![];if(_0x3c9942==='false')return![];throw CliErrors[_0x156fab(0x1fa)]('--'+_0x46888e+_0x156fab(0x24d));}function verifyVisibilityUpdate(_0xc377b6,_0x29d03e,_0x48f35d){const _0x38a1b8=a140_0x4ea6f3;assertVerified(!!_0x29d03e,_0x38a1b8(0x203)+_0xc377b6['id']+_0x38a1b8(0x21e)),assertVerified(_0x29d03e[_0x38a1b8(0x235)]===_0x48f35d,_0x38a1b8(0x203)+_0xc377b6['id']+'\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.');const _0x2c5785=[['id',_0x29d03e['id'],_0xc377b6['id']],[_0x38a1b8(0x1ef),_0x29d03e[_0x38a1b8(0x1ef)],_0xc377b6[_0x38a1b8(0x1ef)]],[_0x38a1b8(0x224),_0x29d03e[_0x38a1b8(0x224)],_0xc377b6[_0x38a1b8(0x224)]],[_0x38a1b8(0x1fd),_0x29d03e['label'],_0xc377b6['label']],[_0x38a1b8(0x1d3),_0x29d03e['path'],_0xc377b6[_0x38a1b8(0x1d3)]],['url',_0x29d03e[_0x38a1b8(0x1ff)],_0xc377b6[_0x38a1b8(0x1ff)]],[_0x38a1b8(0x211),_0x29d03e[_0x38a1b8(0x211)],_0xc377b6[_0x38a1b8(0x211)]],[_0x38a1b8(0x1dc),_0x29d03e[_0x38a1b8(0x1dc)],_0xc377b6[_0x38a1b8(0x1dc)]],['resources',_0x29d03e['resources'],_0xc377b6[_0x38a1b8(0x238)]],['resourcesValid',_0x29d03e[_0x38a1b8(0x1e0)],_0xc377b6[_0x38a1b8(0x1e0)]],[_0x38a1b8(0x23f),_0x29d03e['childrenIds'],_0xc377b6[_0x38a1b8(0x23f)]],[_0x38a1b8(0x24f),_0x29d03e['childrenCount'],_0xc377b6['childrenCount']],['pageId',_0x29d03e['pageId'],_0xc377b6[_0x38a1b8(0x1e1)]],[_0x38a1b8(0x207),_0x29d03e[_0x38a1b8(0x207)],_0xc377b6[_0x38a1b8(0x207)]],[_0x38a1b8(0x220),_0x29d03e[_0x38a1b8(0x220)],_0xc377b6[_0x38a1b8(0x220)]],[_0x38a1b8(0x1d8),_0x29d03e[_0x38a1b8(0x1d8)],_0xc377b6[_0x38a1b8(0x1d8)]],[_0x38a1b8(0x21d),_0x29d03e[_0x38a1b8(0x21d)],_0xc377b6[_0x38a1b8(0x21d)]]];for(const [_0x1d0377,_0x1a7d74,_0x49cfff]of _0x2c5785){assertVerified(sameValue(_0x1a7d74,_0x49cfff),_0x38a1b8(0x203)+_0xc377b6['id']+'\x20'+_0x1d0377+_0x38a1b8(0x1f1));}}function sameValue(_0x4f0bc2,_0xe5ab28){const _0x5c8d86=a140_0x4ea6f3;if(Array[_0x5c8d86(0x245)](_0x4f0bc2)||Array[_0x5c8d86(0x245)](_0xe5ab28))return JSON[_0x5c8d86(0x23a)](_0x4f0bc2)===JSON['stringify'](_0xe5ab28);return _0x4f0bc2===_0xe5ab28;}
|