@lovrabet/rabetbase-cli 2.5.5-beta.3 → 2.5.5
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/api-group.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/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.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/detail.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/logs.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.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/batch-design.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/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.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.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-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/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.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/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.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/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.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/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/api-architecture-upgrade.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/domain-routing-sync.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/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.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/feishu-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/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.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/supported-flags.js +1 -1
- 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/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.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 +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a169_0x6e8897=a169_0x13aa;(function(_0xed824,_0x50e141){const _0x29c22f=a169_0x13aa,_0x34393d=_0xed824();while(!![]){try{const _0x4c8a49=parseInt(_0x29c22f(0x1a9))/0x1+parseInt(_0x29c22f(0x1ca))/0x2+parseInt(_0x29c22f(0x1f2))/0x3*(parseInt(_0x29c22f(0x1d9))/0x4)+parseInt(_0x29c22f(0x1cd))/0x5*(parseInt(_0x29c22f(0x1d6))/0x6)+parseInt(_0x29c22f(0x205))/0x7+-parseInt(_0x29c22f(0x207))/0x8+-parseInt(_0x29c22f(0x1fc))/0x9;if(_0x4c8a49===_0x50e141)break;else _0x34393d['push'](_0x34393d['shift']());}catch(_0x3c8dd4){_0x34393d['push'](_0x34393d['shift']());}}}(a169_0x383f,0xb06b3));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':'number','required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':a169_0x6e8897(0x1e4),'type':a169_0x6e8897(0x1b1),'description':a169_0x6e8897(0x1b5)};export const MENU_PARENT_ID_FLAG={'name':a169_0x6e8897(0x1b0),'type':'string','description':a169_0x6e8897(0x1ba)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a169_0x6e8897(0x1cc),'type':a169_0x6e8897(0x1a5),'description':a169_0x6e8897(0x1df)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a169_0x6e8897(0x1bb),'type':a169_0x6e8897(0x1a5),'description':'Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches'},{'name':a169_0x6e8897(0x1cb),'type':a169_0x6e8897(0x1b1),'description':a169_0x6e8897(0x1e7)}];function a169_0x13aa(_0x3bb33d,_0x21189f){_0x3bb33d=_0x3bb33d-0x1a3;const _0x383ff5=a169_0x383f();let _0x13aabc=_0x383ff5[_0x3bb33d];return _0x13aabc;}export function validateExactId(_0x415ff3){const _0x5706ec=a169_0x6e8897,_0x2721e8=_0x415ff3[_0x5706ec(0x1b4)]('id');if(!Number[_0x5706ec(0x1e2)](_0x2721e8)||_0x2721e8<=0x0)throw CliErrors['validation'](_0x5706ec(0x1ff));return _0x2721e8;}export function validateSort(_0x94c925,_0x533056=a169_0x6e8897(0x1e4)){const _0x17a316=a169_0x6e8897;if(!hasFlag(_0x94c925,_0x533056))return undefined;const _0x3ab520=_0x94c925[_0x17a316(0x1b4)](_0x533056);if(!Number['isSafeInteger'](_0x3ab520)||_0x3ab520<0x0||_0x3ab520>MAX_MENU_SORT)throw menuError(_0x17a316(0x1e0),'--'+_0x533056+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x17a316(0x203));return _0x3ab520;}export function nextSiblingSort(_0x528ec2,_0x2b1028,_0x5c8207){const _0xfbfda4=a169_0x6e8897,_0x29065d=getChildren(_0x528ec2,_0x2b1028)['map'](_0x346ff1=>_0x346ff1['sort'])['filter'](_0x290b54=>typeof _0x290b54==='number');if(_0x29065d['length']===0x0)return 0x0;const _0x44ccac=Math[_0xfbfda4(0x1e3)](..._0x29065d);if(_0x44ccac>=MAX_MENU_SORT)throw menuError(_0xfbfda4(0x1eb),_0xfbfda4(0x1f5)+_0x5c8207+_0xfbfda4(0x1aa)+_0x44ccac+'.','Reorder\x20sibling\x20menus\x20below\x20'+MAX_MENU_SORT+',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.');return _0x44ccac+0x1;}export function requireExplicitYes(_0x5a0dfe){const _0x153dde=a169_0x6e8897;if(_0x5a0dfe[_0x153dde(0x1bd)](_0x153dde(0x1ec)))return;if(!_0x5a0dfe[_0x153dde(0x1bd)](_0x153dde(0x1fb)))throw menuError(_0x153dde(0x1c0),_0x153dde(0x1ae),_0x153dde(0x1f1));}export async function fetchMutationSnapshot(_0x5553b1,_0x44300d,_0xb0cf7b){const _0x1c70f8=a169_0x6e8897;try{return await fetchMenuSnapshot(_0x5553b1[_0x1c70f8(0x1d8)],_0x5553b1['cookie']);}catch(_0x5b4f3e){throw mapMenuApiError(_0x5b4f3e,_0x1c70f8(0x1f0)+_0x44300d,_0xb0cf7b);}}export async function recheckMutationSnapshot(_0x34cf76,_0x46fce8,_0x4b76be,_0x2bfe3a){const _0x4bfae7=a169_0x6e8897;let _0x31e25f;try{_0x31e25f=await fetchMenuSnapshot(_0x34cf76[_0x4bfae7(0x1d8)],_0x34cf76[_0x4bfae7(0x206)]);}catch(_0x379e44){const _0x22beb0=mapMenuApiError(_0x379e44,_0x4bfae7(0x1f9)+_0x4b76be,_0x2bfe3a);throw menuFailure(_0x22beb0,_0x46fce8,{'stage':'pre-write-recheck','failed':_0x2bfe3a==null?{}:{'id':_0x2bfe3a}});}if(_0x31e25f['hash']!==_0x46fce8[_0x4bfae7(0x1a3)]){const _0x325718=menuError(_0x4bfae7(0x1e9),_0x4bfae7(0x1fe)+_0x4b76be+_0x4bfae7(0x1de),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.');throw menuFailure(_0x325718,_0x46fce8,{'stage':'pre-write-recheck','failed':{..._0x2bfe3a==null?{}:{'id':_0x2bfe3a},'expectedSnapshotHash':_0x46fce8[_0x4bfae7(0x1a3)],'currentSnapshotHash':_0x31e25f[_0x4bfae7(0x1a8)]}});}return _0x31e25f;}export function parseParentId(_0x307b74,_0x44244e,_0x48a68e={}){const _0x5b2f3e=a169_0x6e8897;if(!hasFlag(_0x307b74,_0x44244e)){if(_0x48a68e[_0x5b2f3e(0x1b8)])throw CliErrors[_0x5b2f3e(0x1c9)](_0x44244e);return undefined;}const _0x51c050=_0x307b74[_0x5b2f3e(0x1dd)](_0x44244e)[_0x5b2f3e(0x1c6)]();if(_0x51c050[_0x5b2f3e(0x201)]()===_0x5b2f3e(0x1b6))return null;if(!/^\d+$/[_0x5b2f3e(0x1c7)](_0x51c050))throw CliErrors[_0x5b2f3e(0x1f4)]('--'+_0x44244e+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');const _0xbf8e9d=Number(_0x51c050);if(!Number[_0x5b2f3e(0x1e2)](_0xbf8e9d)||_0xbf8e9d<=0x0)throw CliErrors[_0x5b2f3e(0x1f4)]('--'+_0x44244e+_0x5b2f3e(0x1e8));return _0xbf8e9d;}export function requireMenu(_0xd9b8b8,_0x2abc22){const _0x111541=a169_0x6e8897,_0x2da4e0=_0xd9b8b8[_0x111541(0x1f3)]['get'](_0x2abc22);if(!_0x2da4e0)throw menuError('menu_not_found',_0x111541(0x1e1)+_0x2abc22,'Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.');return _0x2da4e0;}function a169_0x383f(){const _0x18ad94=['number','code','before','num','Sibling\x20sort\x20value\x20(non-negative\x20integer)','root','operation','required','succeeded','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','expect-path','Failed\x20to\x20','bool','menu_parent_not_folder','folder','menu_confirmation_required','Permission\x20denied\x20while\x20attempting\x20to\x20','\x20parent\x20changed:\x20expected\x20','stringify','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','menu_verification_failed','trim','test','dryRun','flagMissing','2220496zDfokl','expected-children-count','expect-parent-id','110whCTNL','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','warnings','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','\x20menu\x20','failed','\x20child\x20count\x20changed:\x20expected\x20','after','hasOwnProperty','46302dBkqMd','\x22,\x20not\x20folder.','appCode','4WxWrMm','backend','parentId','path','str',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','menu_sort_invalid','Online\x20menu\x20not\x20found:\x20','isSafeInteger','max','sort','error','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','menu_state_drift','call','menu_sort_overflow','dry-run','verification',',\x20current\x20','targets','read\x20online\x20menu\x20facts\x20before\x20','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','2569323wLEfMy','byId','validation','Cannot\x20append\x20a\x20','childrenCount','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','defineProperty','recheck\x20online\x20menu\x20facts\x20before\x20','rawFlags','yes','19991088yicSpa','planFile','Online\x20menu\x20state\x20changed\x20before\x20','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','message','toLowerCase','\x20path\x20changed:\x20expected\x20','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','selector','7929516XoPNTN','cookie','8926488Wffffi','\x20is\x20type\x20\x22','snapshotHash','type','string','hint','Menu\x20','hash','790403wkXayE','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','data','api_error','unknown','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','plannedActions','parent-id'];a169_0x383f=function(){return _0x18ad94;};return a169_0x383f();}export function requireFolder(_0x30bf4a,_0x5cc1fb){const _0x2483f6=a169_0x6e8897,_0x229918=requireMenu(_0x30bf4a,_0x5cc1fb);if(_0x229918[_0x2483f6(0x1a4)]!==_0x2483f6(0x1bf))throw menuError(_0x2483f6(0x1be),_0x2483f6(0x1a7)+_0x5cc1fb+_0x2483f6(0x208)+(_0x229918[_0x2483f6(0x1a4)]||_0x2483f6(0x1ad))+_0x2483f6(0x1d7),_0x2483f6(0x1f7));return _0x229918;}export function assertExpectedState(_0x52dda6,_0x39231b){const _0x51b931=a169_0x6e8897;if(hasFlag(_0x52dda6,'expect-parent-id')){const _0x1aa194=parseParentId(_0x52dda6,_0x51b931(0x1cc),{'required':!![]});if(_0x39231b['parentId']!==_0x1aa194)throw stateDrift('Menu\x20'+_0x39231b['id']+_0x51b931(0x1c2)+formatParent(_0x1aa194)+_0x51b931(0x1ee)+formatParent(_0x39231b[_0x51b931(0x1db)])+'.');}if(hasFlag(_0x52dda6,_0x51b931(0x1bb))){const _0x59773d=_0x52dda6['str']('expect-path');if(_0x39231b['path']!==_0x59773d)throw stateDrift(_0x51b931(0x1a7)+_0x39231b['id']+_0x51b931(0x202)+JSON[_0x51b931(0x1c3)](_0x59773d)+',\x20current\x20'+JSON[_0x51b931(0x1c3)](_0x39231b[_0x51b931(0x1dc)])+'.');}if(hasFlag(_0x52dda6,'expected-children-count')){const _0xb1899c=_0x52dda6[_0x51b931(0x1b4)]('expected-children-count');if(!Number[_0x51b931(0x1e2)](_0xb1899c)||_0xb1899c<0x0)throw CliErrors[_0x51b931(0x1f4)](_0x51b931(0x1ce));if(_0x39231b['childrenCount']!==_0xb1899c)throw stateDrift('Menu\x20'+_0x39231b['id']+_0x51b931(0x1d3)+_0xb1899c+_0x51b931(0x1ee)+_0x39231b[_0x51b931(0x1f6)]+'.');}}export function assertVerified(_0x547299,_0x28add5,_0x15d339='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){if(!_0x547299)throw menuError('menu_verification_failed',_0x28add5,_0x15d339);}export function mutationResult(_0x14428e){const _0x396a60=a169_0x6e8897;return{'operation':_0x14428e[_0x396a60(0x1b7)],'selector':_0x14428e[_0x396a60(0x204)],'before':_0x14428e[_0x396a60(0x1b3)],'after':_0x14428e[_0x396a60(0x1d4)],'dryRun':_0x14428e[_0x396a60(0x1c8)],'backend':_0x14428e[_0x396a60(0x1da)],..._0x14428e[_0x396a60(0x1af)]?{'plannedActions':_0x14428e[_0x396a60(0x1af)]}:{},..._0x14428e[_0x396a60(0x1ef)]?{'targets':_0x14428e[_0x396a60(0x1ef)]}:{},..._0x14428e['deleteOrder']?{'deleteOrder':_0x14428e['deleteOrder']}:{},'snapshotHash':_0x14428e['snapshotHash'],..._0x14428e['cascade']?{'cascade':_0x14428e['cascade']}:{},..._0x14428e[_0x396a60(0x1fd)]?{'planFile':_0x14428e[_0x396a60(0x1fd)]}:{},'succeeded':_0x14428e[_0x396a60(0x1b9)]??[],'failed':_0x14428e[_0x396a60(0x1d2)]??[],'warnings':_0x14428e[_0x396a60(0x1cf)]??[],'verification':_0x14428e[_0x396a60(0x1ed)],'error':_0x14428e[_0x396a60(0x1e5)]};}export function menuDryRunResult(_0x4f5e4a,_0x50324d){return{..._0x4f5e4a,..._0x50324d};}export function menuFailure(_0x1047a5,_0x48de20,_0x391d13){const _0xd7f721=a169_0x6e8897,_0x2a6485=mutationResult({..._0x48de20,'after':_0x391d13['after']===undefined?_0x48de20[_0xd7f721(0x1d4)]:_0x391d13[_0xd7f721(0x1d4)],'backend':_0x391d13['backend']??_0x48de20['backend'],'dryRun':![],'succeeded':_0x391d13['succeeded']??[],'failed':_0x391d13['failedRecords']??[{..._0x391d13[_0xd7f721(0x1d2)]??{},'stage':_0x391d13['stage'],'code':_0x1047a5[_0xd7f721(0x1b2)],'message':_0x1047a5[_0xd7f721(0x200)]}],'warnings':[..._0x48de20[_0xd7f721(0x1cf)],..._0x391d13['warnings']??[]],'verification':_0x391d13[_0xd7f721(0x1ed)],'error':{'code':_0x1047a5[_0xd7f721(0x1b2)],'message':_0x1047a5[_0xd7f721(0x200)],..._0x1047a5[_0xd7f721(0x1a6)]?{'hint':_0x1047a5['hint']}:{}}});return Object[_0xd7f721(0x1f8)](_0x1047a5,_0xd7f721(0x1ab),{'value':_0x2a6485,'enumerable':!![],'configurable':!![]}),_0x1047a5;}export function asVerificationError(_0x52c88e,_0x19734e){const _0x32612d=a169_0x6e8897;if(_0x52c88e instanceof CliError&&_0x52c88e['code']===_0x32612d(0x1c5))return _0x52c88e;const _0x364f6d=_0x52c88e instanceof Error?_0x52c88e[_0x32612d(0x200)]:String(_0x52c88e);return menuError('menu_verification_failed',''+_0x19734e+(_0x364f6d?':\x20'+_0x364f6d:''),'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(_0x38f641,_0x47bfec,_0x1a9443){const _0x4226e3=a169_0x6e8897,_0x526ca8=mapMenuApiError(_0x38f641,_0x47bfec,_0x1a9443);return{'causeCode':_0x526ca8[_0x4226e3(0x1b2)],'causeMessage':_0x526ca8[_0x4226e3(0x200)]};}export function hasFlag(_0xc07bae,_0x45b11a){const _0x486ea3=a169_0x6e8897;return Object['prototype'][_0x486ea3(0x1d5)][_0x486ea3(0x1ea)](_0xc07bae[_0x486ea3(0x1fa)],_0x45b11a)&&_0xc07bae[_0x486ea3(0x1fa)][_0x45b11a]!==undefined;}export function toApiParentId(_0x5319b8){return _0x5319b8??0x0;}export function formatParent(_0x140ce2){return _0x140ce2==null?'root':String(_0x140ce2);}export function menuError(_0x452191,_0x207b59,_0x4a7c85){return new CliError(_0x452191,0x1,_0x207b59,_0x4a7c85);}export function mapMenuApiError(_0x35b4ba,_0x2532af,_0x335f54){const _0x20cbd9=a169_0x6e8897;if(_0x35b4ba instanceof CliError&&_0x35b4ba[_0x20cbd9(0x1b2)]!=='api_error')return _0x35b4ba;const _0x5d43ba=_0x35b4ba instanceof Error?_0x35b4ba[_0x20cbd9(0x200)]:String(_0x35b4ba);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x20cbd9(0x1c7)](_0x5d43ba))return menuError('menu_permission_denied',_0x20cbd9(0x1c1)+_0x2532af+(_0x335f54?_0x20cbd9(0x1d1)+_0x335f54:'')+'.',_0x20cbd9(0x1e6));return menuError('menu_mutation_failed',_0x20cbd9(0x1bc)+_0x2532af+(_0x335f54?_0x20cbd9(0x1d1)+_0x335f54:'')+':\x20'+_0x5d43ba,_0x20cbd9(0x1c4));}export function isMenuResponseLoss(_0x1e67f4){const _0x37bf28=a169_0x6e8897,_0x5acb01=_0x1e67f4 instanceof Error?_0x1e67f4[_0x37bf28(0x200)]:String(_0x1e67f4);if(_0x1e67f4 instanceof CliError)return _0x1e67f4['code']===_0x37bf28(0x1ac)&&/^Request (?:failed|timeout):/i[_0x37bf28(0x1c7)](_0x5acb01);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i['test'](_0x5acb01);}function stateDrift(_0xe4783e){const _0x247a98=a169_0x6e8897;return menuError(_0x247a98(0x1e9),_0xe4783e,_0x247a98(0x1d0));}
|
|
1
|
+
const a169_0x4c9f12=a169_0x3a4e;function a169_0x3a4e(_0x131981,_0x2cc088){_0x131981=_0x131981-0x67;const _0x34e989=a169_0x34e9();let _0x3a4e50=_0x34e989[_0x131981];return _0x3a4e50;}(function(_0x20d884,_0x19f5ee){const _0x172a3e=a169_0x3a4e,_0x456789=_0x20d884();while(!![]){try{const _0x3107a3=-parseInt(_0x172a3e(0xa1))/0x1+parseInt(_0x172a3e(0xa8))/0x2+parseInt(_0x172a3e(0x9a))/0x3+-parseInt(_0x172a3e(0x68))/0x4+parseInt(_0x172a3e(0x6d))/0x5+-parseInt(_0x172a3e(0xc9))/0x6+-parseInt(_0x172a3e(0x71))/0x7*(-parseInt(_0x172a3e(0xb6))/0x8);if(_0x3107a3===_0x19f5ee)break;else _0x456789['push'](_0x456789['shift']());}catch(_0x18ae88){_0x456789['push'](_0x456789['shift']());}}}(a169_0x34e9,0xad58d));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':'number','required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':'sort','type':a169_0x4c9f12(0x6f),'description':a169_0x4c9f12(0xc7)};export const MENU_PARENT_ID_FLAG={'name':a169_0x4c9f12(0x91),'type':a169_0x4c9f12(0xa3),'description':'Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node'};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a169_0x4c9f12(0xbb),'type':'string','description':a169_0x4c9f12(0x99)};function a169_0x34e9(){const _0x3239b6=['hasOwnProperty','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','selector','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','planFile','appCode','menu_sort_overflow','rawFlags','menu_not_found','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','cascade','parent-id','byId','call','snapshotHash','dryRun','deleteOrder','Failed\x20to\x20','read\x20online\x20menu\x20facts\x20before\x20','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','3471747ecQeBT','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','length','succeeded','menu_verification_failed','error','\x20parent\x20changed:\x20expected\x20','350007KJolAT','Permission\x20denied\x20while\x20attempting\x20to\x20','string','menu_state_drift','defineProperty','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','message','1218646JmYuKe','num','yes','operation','flagMissing','cookie','unknown','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','get','Reorder\x20sibling\x20menus\x20below\x20','root','hash','\x22,\x20not\x20folder.','stage','3152YWQWtO','verification','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','expected-children-count','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','expect-parent-id','warnings','isSafeInteger',',\x20current\x20','menu_mutation_failed','Cannot\x20append\x20a\x20','menu_sort_invalid','\x20path\x20changed:\x20expected\x20','targets','after','test','folder','Sibling\x20sort\x20value\x20(non-negative\x20integer)','filter','1011300MmWVvZ','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','plannedActions','pre-write-recheck','\x20is\x20type\x20\x22','4345020CRHBuh','bool','dry-run','failed','sort','1525855iUcGMF','toLowerCase','number','backend','4319BKgYVW','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','\x20menu\x20','Menu\x20','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','validation','childrenCount','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','menu_permission_denied','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','api_error','expect-path','str','max','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','parentId','required','recheck\x20online\x20menu\x20facts\x20before\x20','code','Online\x20menu\x20not\x20found:\x20'];a169_0x34e9=function(){return _0x3239b6;};return a169_0x34e9();}export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a169_0x4c9f12(0x7d),'type':a169_0x4c9f12(0xa3),'description':a169_0x4c9f12(0xaf)},{'name':a169_0x4c9f12(0xb9),'type':a169_0x4c9f12(0x6f),'description':a169_0x4c9f12(0x7a)}];export function validateExactId(_0x385d52){const _0x5c962c=a169_0x4c9f12,_0x54cc18=_0x385d52[_0x5c962c(0xa9)]('id');if(!Number[_0x5c962c(0xbd)](_0x54cc18)||_0x54cc18<=0x0)throw CliErrors['validation'](_0x5c962c(0xa6));return _0x54cc18;}export function validateSort(_0x114046,_0x5a3581=a169_0x4c9f12(0x6c)){const _0x2ef5df=a169_0x4c9f12;if(!hasFlag(_0x114046,_0x5a3581))return undefined;const _0x30174c=_0x114046[_0x2ef5df(0xa9)](_0x5a3581);if(!Number[_0x2ef5df(0xbd)](_0x30174c)||_0x30174c<0x0||_0x30174c>MAX_MENU_SORT)throw menuError(_0x2ef5df(0xc1),'--'+_0x5a3581+_0x2ef5df(0x75)+MAX_MENU_SORT+'.',_0x2ef5df(0x8f));return _0x30174c;}export function nextSiblingSort(_0x25c8c9,_0x42a3e2,_0x5345e8){const _0x1087ee=a169_0x4c9f12,_0x2053ef=getChildren(_0x25c8c9,_0x42a3e2)['map'](_0x3c47cf=>_0x3c47cf[_0x1087ee(0x6c)])[_0x1087ee(0xc8)](_0xc9ce2f=>typeof _0xc9ce2f===_0x1087ee(0x6f));if(_0x2053ef[_0x1087ee(0x9c)]===0x0)return 0x0;const _0x53587c=Math[_0x1087ee(0x7f)](..._0x2053ef);if(_0x53587c>=MAX_MENU_SORT)throw menuError(_0x1087ee(0x8c),_0x1087ee(0xc0)+_0x5345e8+_0x1087ee(0x9b)+_0x53587c+'.',_0x1087ee(0xb1)+MAX_MENU_SORT+',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.');return _0x53587c+0x1;}export function requireExplicitYes(_0x55f8b7){const _0x27fed6=a169_0x4c9f12;if(_0x55f8b7[_0x27fed6(0x69)](_0x27fed6(0x6a)))return;if(!_0x55f8b7['bool'](_0x27fed6(0xaa)))throw menuError('menu_confirmation_required',_0x27fed6(0xb8),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0xe62c62,_0x19bf4f,_0xc1ad5a){const _0x51636e=a169_0x4c9f12;try{return await fetchMenuSnapshot(_0xe62c62[_0x51636e(0x8b)],_0xe62c62[_0x51636e(0xad)]);}catch(_0x5d5a1c){throw mapMenuApiError(_0x5d5a1c,_0x51636e(0x98)+_0x19bf4f,_0xc1ad5a);}}export async function recheckMutationSnapshot(_0x402f91,_0x263cc7,_0x51bb99,_0x49df01){const _0x214d01=a169_0x4c9f12;let _0x4e1e04;try{_0x4e1e04=await fetchMenuSnapshot(_0x402f91[_0x214d01(0x8b)],_0x402f91['cookie']);}catch(_0x1f9747){const _0x24c948=mapMenuApiError(_0x1f9747,_0x214d01(0x83)+_0x51bb99,_0x49df01);throw menuFailure(_0x24c948,_0x263cc7,{'stage':_0x214d01(0xcc),'failed':_0x49df01==null?{}:{'id':_0x49df01}});}if(_0x4e1e04[_0x214d01(0xb3)]!==_0x263cc7[_0x214d01(0x94)]){const _0xf24dbe=menuError(_0x214d01(0xa4),'Online\x20menu\x20state\x20changed\x20before\x20'+_0x51bb99+';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.',_0x214d01(0x7b));throw menuFailure(_0xf24dbe,_0x263cc7,{'stage':_0x214d01(0xcc),'failed':{..._0x49df01==null?{}:{'id':_0x49df01},'expectedSnapshotHash':_0x263cc7[_0x214d01(0x94)],'currentSnapshotHash':_0x4e1e04[_0x214d01(0xb3)]}});}return _0x4e1e04;}export function parseParentId(_0x1461c4,_0x27b676,_0x2d9c42={}){const _0x3d6de9=a169_0x4c9f12;if(!hasFlag(_0x1461c4,_0x27b676)){if(_0x2d9c42[_0x3d6de9(0x82)])throw CliErrors[_0x3d6de9(0xac)](_0x27b676);return undefined;}const _0x293bb7=_0x1461c4['str'](_0x27b676)['trim']();if(_0x293bb7[_0x3d6de9(0x6e)]()===_0x3d6de9(0xb2))return null;if(!/^\d+$/[_0x3d6de9(0xc5)](_0x293bb7))throw CliErrors[_0x3d6de9(0x76)]('--'+_0x27b676+_0x3d6de9(0xba));const _0x13d613=Number(_0x293bb7);if(!Number[_0x3d6de9(0xbd)](_0x13d613)||_0x13d613<=0x0)throw CliErrors['validation']('--'+_0x27b676+_0x3d6de9(0xba));return _0x13d613;}export function requireMenu(_0x21ed70,_0x1baea9){const _0x3387cb=a169_0x4c9f12,_0x33d999=_0x21ed70[_0x3387cb(0x92)][_0x3387cb(0xb0)](_0x1baea9);if(!_0x33d999)throw menuError(_0x3387cb(0x8e),_0x3387cb(0x85)+_0x1baea9,_0x3387cb(0x80));return _0x33d999;}export function requireFolder(_0x2e3efb,_0x40b9ee){const _0x180dc6=a169_0x4c9f12,_0x523ab5=requireMenu(_0x2e3efb,_0x40b9ee);if(_0x523ab5['type']!==_0x180dc6(0xc6))throw menuError('menu_parent_not_folder',_0x180dc6(0x74)+_0x40b9ee+_0x180dc6(0x67)+(_0x523ab5['type']||_0x180dc6(0xae))+_0x180dc6(0xb4),_0x180dc6(0xca));return _0x523ab5;}export function assertExpectedState(_0x2971bc,_0x5e5d9d){const _0x3da917=a169_0x4c9f12;if(hasFlag(_0x2971bc,_0x3da917(0xbb))){const _0x1161aa=parseParentId(_0x2971bc,_0x3da917(0xbb),{'required':!![]});if(_0x5e5d9d[_0x3da917(0x81)]!==_0x1161aa)throw stateDrift(_0x3da917(0x74)+_0x5e5d9d['id']+_0x3da917(0xa0)+formatParent(_0x1161aa)+_0x3da917(0xbe)+formatParent(_0x5e5d9d[_0x3da917(0x81)])+'.');}if(hasFlag(_0x2971bc,_0x3da917(0x7d))){const _0x52f654=_0x2971bc[_0x3da917(0x7e)](_0x3da917(0x7d));if(_0x5e5d9d['path']!==_0x52f654)throw stateDrift(_0x3da917(0x74)+_0x5e5d9d['id']+_0x3da917(0xc2)+JSON['stringify'](_0x52f654)+_0x3da917(0xbe)+JSON['stringify'](_0x5e5d9d['path'])+'.');}if(hasFlag(_0x2971bc,_0x3da917(0xb9))){const _0x4656dc=_0x2971bc['num'](_0x3da917(0xb9));if(!Number[_0x3da917(0xbd)](_0x4656dc)||_0x4656dc<0x0)throw CliErrors[_0x3da917(0x76)](_0x3da917(0x78));if(_0x5e5d9d[_0x3da917(0x77)]!==_0x4656dc)throw stateDrift(_0x3da917(0x74)+_0x5e5d9d['id']+'\x20child\x20count\x20changed:\x20expected\x20'+_0x4656dc+_0x3da917(0xbe)+_0x5e5d9d[_0x3da917(0x77)]+'.');}}export function assertVerified(_0x2fbf49,_0x6ea8f8,_0x2c3644='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){const _0x56400a=a169_0x4c9f12;if(!_0x2fbf49)throw menuError(_0x56400a(0x9e),_0x6ea8f8,_0x2c3644);}export function mutationResult(_0x4e9724){const _0x5c7c84=a169_0x4c9f12;return{'operation':_0x4e9724[_0x5c7c84(0xab)],'selector':_0x4e9724[_0x5c7c84(0x88)],'before':_0x4e9724['before'],'after':_0x4e9724['after'],'dryRun':_0x4e9724[_0x5c7c84(0x95)],'backend':_0x4e9724[_0x5c7c84(0x70)],..._0x4e9724[_0x5c7c84(0xcb)]?{'plannedActions':_0x4e9724[_0x5c7c84(0xcb)]}:{},..._0x4e9724[_0x5c7c84(0xc3)]?{'targets':_0x4e9724[_0x5c7c84(0xc3)]}:{},..._0x4e9724[_0x5c7c84(0x96)]?{'deleteOrder':_0x4e9724[_0x5c7c84(0x96)]}:{},'snapshotHash':_0x4e9724[_0x5c7c84(0x94)],..._0x4e9724[_0x5c7c84(0x90)]?{'cascade':_0x4e9724[_0x5c7c84(0x90)]}:{},..._0x4e9724[_0x5c7c84(0x8a)]?{'planFile':_0x4e9724[_0x5c7c84(0x8a)]}:{},'succeeded':_0x4e9724['succeeded']??[],'failed':_0x4e9724[_0x5c7c84(0x6b)]??[],'warnings':_0x4e9724['warnings']??[],'verification':_0x4e9724[_0x5c7c84(0xb7)],'error':_0x4e9724[_0x5c7c84(0x9f)]};}export function menuDryRunResult(_0x36479f,_0xac0a8a){return{..._0x36479f,..._0xac0a8a};}export function menuFailure(_0x28a2da,_0xafc01b,_0x445015){const _0x2800d7=a169_0x4c9f12,_0x54e987=mutationResult({..._0xafc01b,'after':_0x445015[_0x2800d7(0xc4)]===undefined?_0xafc01b[_0x2800d7(0xc4)]:_0x445015[_0x2800d7(0xc4)],'backend':_0x445015[_0x2800d7(0x70)]??_0xafc01b[_0x2800d7(0x70)],'dryRun':![],'succeeded':_0x445015[_0x2800d7(0x9d)]??[],'failed':_0x445015['failedRecords']??[{..._0x445015[_0x2800d7(0x6b)]??{},'stage':_0x445015[_0x2800d7(0xb5)],'code':_0x28a2da[_0x2800d7(0x84)],'message':_0x28a2da['message']}],'warnings':[..._0xafc01b[_0x2800d7(0xbc)],..._0x445015[_0x2800d7(0xbc)]??[]],'verification':_0x445015[_0x2800d7(0xb7)],'error':{'code':_0x28a2da[_0x2800d7(0x84)],'message':_0x28a2da[_0x2800d7(0xa7)],..._0x28a2da['hint']?{'hint':_0x28a2da['hint']}:{}}});return Object[_0x2800d7(0xa5)](_0x28a2da,'data',{'value':_0x54e987,'enumerable':!![],'configurable':!![]}),_0x28a2da;}export function asVerificationError(_0xc0142f,_0x2ffc83){const _0x5d2a1e=a169_0x4c9f12;if(_0xc0142f instanceof CliError&&_0xc0142f[_0x5d2a1e(0x84)]==='menu_verification_failed')return _0xc0142f;const _0x282dc3=_0xc0142f instanceof Error?_0xc0142f[_0x5d2a1e(0xa7)]:String(_0xc0142f);return menuError(_0x5d2a1e(0x9e),''+_0x2ffc83+(_0x282dc3?':\x20'+_0x282dc3:''),'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(_0x4a7354,_0x18196d,_0x5b82ac){const _0x4c092c=a169_0x4c9f12,_0x24ff39=mapMenuApiError(_0x4a7354,_0x18196d,_0x5b82ac);return{'causeCode':_0x24ff39[_0x4c092c(0x84)],'causeMessage':_0x24ff39['message']};}export function hasFlag(_0x22c678,_0x1fe898){const _0x36c8c2=a169_0x4c9f12;return Object['prototype'][_0x36c8c2(0x86)][_0x36c8c2(0x93)](_0x22c678[_0x36c8c2(0x8d)],_0x1fe898)&&_0x22c678[_0x36c8c2(0x8d)][_0x1fe898]!==undefined;}export function toApiParentId(_0x19f715){return _0x19f715??0x0;}export function formatParent(_0xeb8519){const _0x37d9c0=a169_0x4c9f12;return _0xeb8519==null?_0x37d9c0(0xb2):String(_0xeb8519);}export function menuError(_0xd10b14,_0x25b9b3,_0x2d9f8e){return new CliError(_0xd10b14,0x1,_0x25b9b3,_0x2d9f8e);}export function mapMenuApiError(_0x3e4bc4,_0x34637d,_0x5d7082){const _0x364149=a169_0x4c9f12;if(_0x3e4bc4 instanceof CliError&&_0x3e4bc4[_0x364149(0x84)]!==_0x364149(0x7c))return _0x3e4bc4;const _0x469f5a=_0x3e4bc4 instanceof Error?_0x3e4bc4[_0x364149(0xa7)]:String(_0x3e4bc4);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x364149(0xc5)](_0x469f5a))return menuError(_0x364149(0x79),_0x364149(0xa2)+_0x34637d+(_0x5d7082?_0x364149(0x73)+_0x5d7082:'')+'.',_0x364149(0x72));return menuError(_0x364149(0xbf),_0x364149(0x97)+_0x34637d+(_0x5d7082?_0x364149(0x73)+_0x5d7082:'')+':\x20'+_0x469f5a,_0x364149(0x89));}export function isMenuResponseLoss(_0x4c0ec8){const _0x430ff2=a169_0x4c9f12,_0x58b1a4=_0x4c0ec8 instanceof Error?_0x4c0ec8['message']:String(_0x4c0ec8);if(_0x4c0ec8 instanceof CliError)return _0x4c0ec8[_0x430ff2(0x84)]==='api_error'&&/^Request (?:failed|timeout):/i[_0x430ff2(0xc5)](_0x58b1a4);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x430ff2(0xc5)](_0x58b1a4);}function stateDrift(_0x48bc8c){const _0x3d4f84=a169_0x4c9f12;return menuError(_0x3d4f84(0xa4),_0x48bc8c,_0x3d4f84(0x87));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x82f79e,_0x36e1f9){const _0x20c6e9=a170_0x2c10,_0x58465f=_0x82f79e();while(!![]){try{const _0x53e1e0=parseInt(_0x20c6e9(0xda))/0x1+parseInt(_0x20c6e9(0xde))/0x2+parseInt(_0x20c6e9(0xd9))/0x3+-parseInt(_0x20c6e9(0xe0))/0x4+-parseInt(_0x20c6e9(0xdb))/0x5+-parseInt(_0x20c6e9(0xdf))/0x6*(-parseInt(_0x20c6e9(0xdd))/0x7)+-parseInt(_0x20c6e9(0xdc))/0x8;if(_0x53e1e0===_0x36e1f9)break;else _0x58465f['push'](_0x58465f['shift']());}catch(_0x369260){_0x58465f['push'](_0x58465f['shift']());}}}(a170_0x1052,0xa11ee));function a170_0x2c10(_0x1fbe48,_0x529a5d){_0x1fbe48=_0x1fbe48-0xd8;const _0x105254=a170_0x1052();let _0x2c101e=_0x105254[_0x1fbe48];return _0x2c101e;}function a170_0x1052(){const _0x51dfaf=['3246175AOwdOu','1249200xfRmYB','922992eSarHA','1416516lwzymZ','48AOvFot','1675696ZGdZNH','replace','trim','51033UyVNLG','104142jtQSYw'];a170_0x1052=function(){return _0x51dfaf;};return a170_0x1052();}export function menuPathKey(_0x1d7384){const _0x587dd5=a170_0x2c10,_0x3822f2=_0x1d7384[_0x587dd5(0xd8)]();if(!_0x3822f2)return'';return _0x3822f2[_0x587dd5(0xe1)](/^\/+/,'')['replace'](/\/+$/,'')||'/';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5238c4,_0x8ec22b){const _0x531334=a171_0x45c9,_0x5aac76=_0x5238c4();while(!![]){try{const _0x2b020c=-parseInt(_0x531334(0xa8))/0x1*(-parseInt(_0x531334(0xa2))/0x2)+-parseInt(_0x531334(0x98))/0x3+-parseInt(_0x531334(0x81))/0x4+parseInt(_0x531334(0xaa))/0x5+-parseInt(_0x531334(0x96))/0x6+parseInt(_0x531334(0xa7))/0x7*(parseInt(_0x531334(0x88))/0x8)+-parseInt(_0x531334(0xa3))/0x9*(-parseInt(_0x531334(0x8f))/0xa);if(_0x2b020c===_0x8ec22b)break;else _0x5aac76['push'](_0x5aac76['shift']());}catch(_0x248f00){_0x5aac76['push'](_0x5aac76['shift']());}}}(a171_0x53fa,0xe3b13));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';function a171_0x53fa(){const _0x437fac=['4733SwHwzT','visible','4937035CaKFPg','map','3713396bdnioc','resources','info','boolean','path','update-menu-cdn-url','get-online-menu-list','16JboGqJ','appName','Regroup\x20','Create\x20menu\x20\x22','extend','\x20menu\x20group(s)','Menu\x20created\x20successfully:\x20','69770yAqjGU','length','Update\x20menu\x20','\x20menu','import','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','Fetched\x20','6894852NYQWwF','label','133131okeZUJ','stringify','Start\x20batch\x20menu\x20creation,\x20total\x20','procode','number','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','Menu\x20assets\x20synced:\x20','create-menus','create-menu','Batch\x20menu\x20creation\x20completed,\x20total\x20','100YPKnlT','738iEduau','parentId','loadScriptMode','Updating\x20menu\x20asset\x20links:\x20','4404134NdAfRV'];a171_0x53fa=function(){return _0x437fac;};return a171_0x53fa();}import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a171_0x2a6469,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x327e55,_0x185b9c){const _0x281722=a171_0x45c9,_0x3c665c=getEnv();logger[_0x281722(0x83)](_0x281722(0x87),isProduction(_0x3c665c)?_0x281722(0x9d)+_0x327e55+')':_0x281722(0x94)+_0x327e55+')');const _0x426242=await fetchMenuSnapshot(_0x327e55,_0x185b9c,{'verbose':!![]});return logger[_0x281722(0x83)]('get-online-menu-list',_0x281722(0x95)+_0x426242['total']+'\x20online\x20menus\x20successfully'),_0x426242['menus'][_0x281722(0x80)](toProcessedMenuItem);}export async function createMenu(_0x3f096a,_0x5ca34b,_0x589c3e){const _0x375e1d=a171_0x45c9;logger[_0x375e1d(0x83)](_0x375e1d(0xa0),'Creating\x20menu:\x20'+_0x589c3e['label']+'\x20('+_0x589c3e['path']+')');const _0x59894a={'appCode':_0x3f096a,'type':_0x375e1d(0x9b),'sort':0x0,'extend':{'loadScriptMode':_0x375e1d(0x93),'resources':_0x589c3e[_0x375e1d(0x82)]?JSON[_0x375e1d(0x99)](_0x589c3e[_0x375e1d(0x82)]):undefined},..._0x589c3e},_0x1c9ca0=await createMenuRecord(_0x59894a,_0x5ca34b,'Create\x20menu\x20\x22'+_0x589c3e['label']+'\x22');return logger['info'](_0x375e1d(0xa0),_0x375e1d(0x8e)+_0x589c3e[_0x375e1d(0x97)]),_0x1c9ca0;}async function createSingleMenu(_0x296f34,_0x1d11f4,_0x4426d8,_0x2936c0,_0x42fbbc){const _0x168cc8=a171_0x45c9,_0x19c38b={'appCode':_0x296f34,'type':_0x168cc8(0x9b),'sort':'order'in _0x4426d8&&typeof _0x4426d8['order']===_0x168cc8(0x9c)?_0x4426d8['order']:0x0,..._0x168cc8(0xa9)in _0x4426d8&&typeof _0x4426d8[_0x168cc8(0xa9)]===_0x168cc8(0x84)?{'visible':_0x4426d8[_0x168cc8(0xa9)]}:{},..._0x168cc8(0xa4)in _0x4426d8&&typeof _0x4426d8[_0x168cc8(0xa4)]===_0x168cc8(0x9c)?{'parentId':_0x4426d8[_0x168cc8(0xa4)]}:{},'extend':{..._0x42fbbc?.[_0x168cc8(0x89)]?{'appName':_0x42fbbc[_0x168cc8(0x89)]}:{},'loadScriptMode':'import','resources':_0x2936c0?JSON[_0x168cc8(0x99)](_0x2936c0):undefined},'label':_0x4426d8[_0x168cc8(0x97)],'path':_0x4426d8[_0x168cc8(0x85)]},_0x16c62b=await createMenuRecord(_0x19c38b,_0x1d11f4,_0x168cc8(0x8b)+_0x4426d8['label']+'\x22');return logger[_0x168cc8(0x83)](_0x168cc8(0xa0),'Menu\x20created\x20successfully:\x20'+_0x4426d8['label']),_0x16c62b;}export async function createMenus(_0x1a93a9,_0x6e6c93,_0x39379b,_0x555bb3,_0x21beee){const _0x55b648=a171_0x45c9;logger[_0x55b648(0x83)](_0x55b648(0x9f),_0x55b648(0x9a)+_0x39379b[_0x55b648(0x90)]);const _0x55bd51=await Promise['all'](_0x39379b[_0x55b648(0x80)](_0x4159e2=>createSingleMenu(_0x1a93a9,_0x6e6c93,_0x4159e2,_0x555bb3,_0x21beee)));return logger['info'](_0x55b648(0x9f),_0x55b648(0xa1)+_0x39379b[_0x55b648(0x90)]),_0x55bd51;}function a171_0x45c9(_0x546418,_0x51ed5d){_0x546418=_0x546418-0x80;const _0x53fa68=a171_0x53fa();let _0x45c904=_0x53fa68[_0x546418];return _0x45c904;}export async function updateMenuCdnUrl(_0x558646,_0x188be7,_0x2333f7){const _0x43a295=a171_0x45c9;logger['info']('update-menu-cdn-url',_0x43a295(0xa6)+_0x2333f7[_0x43a295(0x97)]+'\x20('+_0x2333f7['path']+')');const _0x17753c={'id':_0x2333f7['id'],'appCode':_0x558646,'extend':{..._0x2333f7[_0x43a295(0x8c)]??{},..._0x2333f7[_0x43a295(0xa5)]?{'loadScriptMode':_0x2333f7['loadScriptMode']}:{},'resources':_0x2333f7['resources']?JSON[_0x43a295(0x99)](_0x2333f7[_0x43a295(0x82)]):undefined}},_0x2b3d90=await updateMenuRecord(_0x17753c,_0x188be7,'Update\x20menu\x20assets\x20\x22'+_0x2333f7['label']+'\x22');return logger[_0x43a295(0x83)](_0x43a295(0x86),_0x43a295(0x9e)+_0x2333f7[_0x43a295(0x97)],undefined),_0x2b3d90;}export async function createMenuEntity(_0x239099,_0x581140,_0x2abec4){const _0x20d339=a171_0x45c9;return createMenuRecord({'appCode':_0x239099,..._0x2abec4},_0x581140,_0x20d339(0x8b)+_0x2abec4[_0x20d339(0x97)]+'\x22');}export async function updateMenuEntity(_0x4c13f1,_0x432c83,_0x1c8a07){const _0x54da61=a171_0x45c9;return updateMenuRecord({'appCode':_0x4c13f1,..._0x1c8a07},_0x432c83,_0x54da61(0x91)+_0x1c8a07['id']);}export async function batchDeleteMenuEntities(_0x349d46,_0x185aef){const _0x1c9c8f=a171_0x45c9;return batchDeleteMenuRecords(_0x185aef,_0x349d46,'Delete\x20'+_0x185aef[_0x1c9c8f(0x90)]+_0x1c9c8f(0x92)+(_0x185aef[_0x1c9c8f(0x90)]===0x1?'':'s'));}export async function startMenuRegroup(_0x5126b0,_0x2354ea){const _0x45bb6b=a171_0x45c9;return a171_0x2a6469(_0x2354ea,_0x5126b0,_0x45bb6b(0x8a)+_0x2354ea['menuGroups'][_0x45bb6b(0x90)]+_0x45bb6b(0x8d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a172_0x3f11b0=a172_0x1695;(function(_0x3ad23d,_0x36a4ce){const _0x1ed0ee=a172_0x1695,_0x163ef6=_0x3ad23d();while(!![]){try{const _0x91831f=parseInt(_0x1ed0ee(0x109))/0x1+parseInt(_0x1ed0ee(0x101))/0x2+-parseInt(_0x1ed0ee(0xe8))/0x3+parseInt(_0x1ed0ee(0xfd))/0x4*(parseInt(_0x1ed0ee(0x10a))/0x5)+parseInt(_0x1ed0ee(0x10c))/0x6+-parseInt(_0x1ed0ee(0xff))/0x7*(-parseInt(_0x1ed0ee(0x10d))/0x8)+parseInt(_0x1ed0ee(0x10e))/0x9*(-parseInt(_0x1ed0ee(0xf9))/0xa);if(_0x91831f===_0x36a4ce)break;else _0x163ef6['push'](_0x163ef6['shift']());}catch(_0x3a1d4a){_0x163ef6['push'](_0x163ef6['shift']());}}}(a172_0x2bb8,0xda853));function a172_0x1695(_0xed62d2,_0x12f211){_0xed62d2=_0xed62d2-0xe8;const _0x2bb82e=a172_0x2bb8();let _0x169550=_0x2bb82e[_0xed62d2];return _0x169550;}import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{CliErrors}from'../../../errors.js';function objectValue(_0x44222b,_0x229c77){const _0x5cc332=a172_0x1695,_0x36e70a=typeof _0x44222b==='string'?parseJson(_0x44222b,_0x229c77):_0x44222b;if(!_0x36e70a||typeof _0x36e70a!==_0x5cc332(0xf1)||Array['isArray'](_0x36e70a))throw CliErrors[_0x5cc332(0x115)](_0x229c77+_0x5cc332(0x107));return _0x36e70a;}function parseJson(_0x379bf7,_0x24b02a){const _0x3632bd=a172_0x1695;try{return JSON['parse'](_0x379bf7);}catch{throw CliErrors['validation'](_0x24b02a+_0x3632bd(0xed));}}function resourceList(_0x479646,_0x497fcf){const _0x18eaa2=a172_0x1695;if(typeof _0x479646!==_0x18eaa2(0xea))throw CliErrors[_0x18eaa2(0x115)](_0x497fcf+_0x18eaa2(0xef));const _0xd455bb=parseJson(_0x479646,_0x497fcf);if(!Array[_0x18eaa2(0x10b)](_0xd455bb)||_0xd455bb[_0x18eaa2(0x10f)](_0xa3155a=>typeof _0xa3155a!==_0x18eaa2(0xea)))throw CliErrors[_0x18eaa2(0x115)](_0x497fcf+_0x18eaa2(0xf0));return _0xd455bb;}export function buildSubappAssetsStatus(_0x27b2df,_0x3c5b78,_0x122941){const _0x1bdf0f=a172_0x1695,_0x934f19=_0x27b2df[_0x1bdf0f(0xf3)]==null?{}:objectValue(_0x27b2df[_0x1bdf0f(0xf3)],_0x1bdf0f(0xf4)),_0x476cdf=_0x934f19[_0x1bdf0f(0x104)]==null?[]:typeof _0x934f19[_0x1bdf0f(0x104)]===_0x1bdf0f(0xea)?parseJson(_0x934f19[_0x1bdf0f(0x104)],'app.extend.assets'):_0x934f19[_0x1bdf0f(0x104)];if(!Array[_0x1bdf0f(0x10b)](_0x476cdf))throw CliErrors['validation'](_0x1bdf0f(0x106));const _0x45d44c=_0x476cdf['map']((_0x58c654,_0x4eb861)=>objectValue(_0x58c654,_0x1bdf0f(0xfb)+_0x4eb861+']')),_0x296590=_0x45d44c['filter'](_0x3b68c2=>_0x3b68c2[_0x1bdf0f(0xfa)]===_0x122941);if(_0x296590['length']>0x1)throw CliErrors[_0x1bdf0f(0x115)](_0x1bdf0f(0xf5)+_0x122941+'.');const _0x431732=_0x296590[0x0],_0x5155c1=_0x431732?.[_0x1bdf0f(0xfc)]==null?[]:resourceList(_0x431732[_0x1bdf0f(0xfc)],_0x1bdf0f(0x103)),_0x4b6c48=_0x3c5b78[_0x1bdf0f(0xf6)](_0x4188c7=>_0x4188c7[_0x1bdf0f(0xf3)]?.[_0x1bdf0f(0xfa)]===_0x122941),_0x4e4754=_0x4b6c48[_0x1bdf0f(0x108)](_0x398863=>{const _0x1cb3ae=_0x1bdf0f;let _0x4346b6=null,_0x28c883=null;try{_0x4346b6=_0x398863[_0x1cb3ae(0xf3)]?.[_0x1cb3ae(0xfc)]==null?_0x398863['resources']:resourceList(_0x398863[_0x1cb3ae(0xf3)][_0x1cb3ae(0xfc)],'menu\x20'+_0x398863['id']+_0x1cb3ae(0x105));}catch(_0x325879){_0x28c883=_0x325879 instanceof Error?_0x325879[_0x1cb3ae(0x113)]:String(_0x325879);}const _0x47d5f3=_0x5155c1[_0x1cb3ae(0x102)]>0x0?_0x1cb3ae(0xfe):_0x1cb3ae(0x112),_0x334dca=_0x47d5f3===_0x1cb3ae(0xfe)?_0x5155c1:_0x4346b6;return{'id':_0x398863['id'],'path':_0x398863[_0x1cb3ae(0x111)],'preferredSourceIfSupported':_0x47d5f3,'preferredResourcesIfSupported':_0x334dca,'menuFallbackResources':_0x4346b6,'menuFallbackError':_0x28c883,'fallbackDiffers':_0x4346b6===null?null:_0x47d5f3===_0x1cb3ae(0xfe)&&_0x4346b6[_0x1cb3ae(0x102)]>0x0&&JSON['stringify'](_0x4346b6)!==JSON[_0x1cb3ae(0xee)](_0x334dca)};});return{'appName':_0x122941,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x431732),'sharedResources':_0x5155c1,'loadScriptMode':_0x431732?.[_0x1bdf0f(0x116)]??null,'basename':_0x431732?.[_0x1bdf0f(0x110)]??null,'boundMenus':_0x4e4754['length'],'staleMenuFallbacks':_0x4e4754['filter'](_0x1afee5=>_0x1afee5[_0x1bdf0f(0x100)])[_0x1bdf0f(0x102)],'menus':_0x4e4754};}function a172_0x2bb8(){const _0x4bb7e5=['4786404pLJQkI','316720yHqUKK','2340ZYZTgL','some','basename','path','menu','message','sharedResources','validation','loadScriptMode','317109odcmGy','Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','string','--app-name\x20is\x20required.','sharedConfigured','\x20contains\x20invalid\x20JSON.','stringify','\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.','\x20must\x20be\x20an\x20array\x20of\x20URLs.','object','appCode','extend','app.extend','Duplicate\x20subapp\x20records\x20for\x20','filter','app-name','str','106550kvduaj','appName','app.extend.assets[','resources','112376wSbbuY','app','105dzMcbS','fallbackDiffers','2433740mwuKtU','length','subapp.resources','assets','\x20resources','app.extend.assets\x20must\x20be\x20an\x20array.','\x20must\x20be\x20a\x20JSON\x20object.','map','10754sENrRd','205RcvnVf','isArray'];a172_0x2bb8=function(){return _0x4bb7e5;};return a172_0x2bb8();}export async function assertSharedResourcesConfigured(_0x255a58,_0x5f208c,_0x410ad2){const _0x384e6b=a172_0x1695,_0x3325ce=await getSmartAppRecord(_0x255a58,_0x5f208c),_0x5277f1=buildSubappAssetsStatus(_0x3325ce,[],_0x410ad2);if(!_0x5277f1[_0x384e6b(0xec)]||_0x5277f1[_0x384e6b(0x114)]['length']===0x0)throw CliErrors[_0x384e6b(0x115)]('No\x20shared\x20resources\x20configured\x20for\x20'+_0x410ad2+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':'Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app'},{'name':a172_0x3f11b0(0xf7),'type':a172_0x3f11b0(0xea),'required':!![],'description':a172_0x3f11b0(0xe9)}];export function getSubappSelector(_0x135cda){const _0x8d500c=a172_0x3f11b0,_0x38bf3c=_0x135cda[_0x8d500c(0xf2)],_0x466779=_0x135cda[_0x8d500c(0xf8)]('app-name')['trim']();if(!_0x466779)throw CliErrors['validation'](_0x8d500c(0xeb));return{'appCode':_0x38bf3c,'appName':_0x466779};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a173_0x5bea17=a173_0x41a3;(function(_0x3470db,_0x484a04){const _0x4be0fb=a173_0x41a3,_0x322119=_0x3470db();while(!![]){try{const _0x435c25=parseInt(_0x4be0fb(0x15c))/0x1*(-parseInt(_0x4be0fb(0x138))/0x2)+-parseInt(_0x4be0fb(0x14e))/0x3+parseInt(_0x4be0fb(0x14d))/0x4+parseInt(_0x4be0fb(0x167))/0x5+-parseInt(_0x4be0fb(0x169))/0x6*(-parseInt(_0x4be0fb(0x131))/0x7)+-parseInt(_0x4be0fb(0x162))/0x8+parseInt(_0x4be0fb(0x154))/0x9*(parseInt(_0x4be0fb(0x128))/0xa);if(_0x435c25===_0x484a04)break;else _0x322119['push'](_0x322119['shift']());}catch(_0x11a8b4){_0x322119['push'](_0x322119['shift']());}}}(a173_0x8586,0x480cd));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set(['jsUrl',a173_0x5bea17(0x142),'appName',a173_0x5bea17(0x12b),'parentId']);export function resolvePage(_0x4547b2,_0x396f42,_0x33b43a){const _0x116541=a173_0x5bea17;let _0x55cd6d=_0x396f42[_0x116541(0x165)]??_0x4547b2[_0x116541(0x165)];if(_0x55cd6d===undefined&&_0x4547b2[_0x116541(0x13f)]){const _0x2f6b67=_0x33b43a[_0x116541(0x137)](_0x5b7405=>_0x5b7405['type']===_0x116541(0x14a)&&_0x5b7405[_0x116541(0x15a)]===_0x4547b2[_0x116541(0x13f)]);if(_0x2f6b67['length']!==0x1)throw new Error(_0x116541(0x140)+_0x4547b2[_0x116541(0x13f)]+_0x116541(0x151)+_0x4547b2[_0x116541(0x134)]+';\x20found\x20'+_0x2f6b67[_0x116541(0x149)]);_0x55cd6d=_0x2f6b67[0x0]['id'];}if(_0x55cd6d!==undefined&&_0x55cd6d!==0x0&&_0x33b43a[_0x116541(0x137)](_0x4776e8=>_0x4776e8['id']===_0x55cd6d&&_0x4776e8[_0x116541(0x14f)]===_0x116541(0x14a))[_0x116541(0x149)]!==0x1)throw new Error(_0x116541(0x129)+_0x55cd6d+_0x116541(0x135));return{..._0x4547b2,..._0x55cd6d===undefined?{}:{'parentId':_0x55cd6d},..._0x396f42[_0x116541(0x12b)]===undefined?{}:{'visible':_0x396f42[_0x116541(0x12b)]}};}function a173_0x41a3(_0x38596f,_0x2ded51){_0x38596f=_0x38596f-0x128;const _0x8586b=a173_0x8586();let _0x41a315=_0x8586b[_0x38596f];return _0x41a315;}function validateParams(_0x5a99da){const _0x1e846d=a173_0x5bea17,_0xe48018=[];return _0x5a99da['jsUrl']&&!isValidJsHttpsUrl(_0x5a99da[_0x1e846d(0x164)])&&_0xe48018[_0x1e846d(0x157)]({'field':_0x1e846d(0x164),'message':_0x1e846d(0x136)}),_0x5a99da[_0x1e846d(0x142)]&&!isValidCssHttpsUrl(_0x5a99da[_0x1e846d(0x142)])&&_0xe48018[_0x1e846d(0x157)]({'field':'cssUrl','message':_0x1e846d(0x12a)}),_0xe48018;}function a173_0x8586(){const _0xb1f1ee=['number','dryRun','order','3749008DTqJzD','import','jsUrl','parentId','keys','1635060cvpupw','menu-sync','6jIHsvX','10eOyEHq','Parent\x20','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','visible','parse','Menu\x20sync\x20completed','appName','trim','has','2997099CcFsXq','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','Start\x20non-interactive\x20menu\x20sync','path','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','filter','4vGPkFl','Invalid\x20--params.','Invalid\x20--params\x20JSON.','--params.','CSS\x20URL\x20is\x20unreachable:\x20','join','Invalid\x20--params\x20fields:\x20','group','Expected\x20one\x20folder\x20named\x20\x22','get','cssUrl','message','Invalid\x20--params:\x20','setLogPath','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','length','folder','field','info','1131636WzjAIV','1304721MNCExX','type','\x0a\x20\x20Available\x20local\x20paths:\x20','\x22\x20for\x20',':\x20expected\x20a\x20non-empty\x20string.','map','4797972kZQyqd','string','isArray','push','boolean','cwd','label','pages','186268FPIfWx','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','No\x20local\x20pages\x20matched\x20paths:\x20'];a173_0x8586=function(){return _0xb1f1ee;};return a173_0x8586();}export async function runMenuSyncCore(_0x4aa978,_0x1f7462,_0x5a1170=[],_0x4ef57d,_0x4bb1c1={}){const _0x3da71f=a173_0x5bea17,_0x1abb2f=parseMenuSyncParams(_0x4ef57d),_0x57f7ee=[...new Set(_0x5a1170[_0x3da71f(0x153)](_0x22809d=>_0x22809d[_0x3da71f(0x12f)]())[_0x3da71f(0x137)](Boolean)['map'](menuPathKey))],_0xcb7501=_0x1abb2f[_0x3da71f(0x164)],_0x1a6bbd=_0x1abb2f[_0x3da71f(0x142)],_0x469016=[];if(_0xcb7501)_0x469016[_0x3da71f(0x157)](_0xcb7501);if(_0x1a6bbd)_0x469016[_0x3da71f(0x157)](_0x1a6bbd);const _0x323605=validateParams(_0x1abb2f);if(_0x323605['length']>0x0){const _0x26380b=_0x323605[_0x3da71f(0x153)](_0xc5bab2=>_0x3da71f(0x13b)+_0xc5bab2[_0x3da71f(0x14b)]+':\x20'+_0xc5bab2[_0x3da71f(0x143)])['join'](';\x20');throw new Error(_0x3da71f(0x144)+_0x26380b);}logger[_0x3da71f(0x145)](process[_0x3da71f(0x159)]()),logger[_0x3da71f(0x14c)](_0x3da71f(0x168),_0x3da71f(0x133),{'appCode':_0x4aa978,'selectedCount':_0x57f7ee[_0x3da71f(0x149)],'jsUrl':_0xcb7501,'cssUrl':_0x1a6bbd});if(_0xcb7501){const _0x48ce96=await isUrlReachable(_0xcb7501);if(!_0x48ce96)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0xcb7501);}if(_0x1a6bbd){const _0x2a6b86=await isUrlReachable(_0x1a6bbd);if(!_0x2a6b86)throw new Error(_0x3da71f(0x13c)+_0x1a6bbd);}const _0x4c62cc=getLocalPages();if(_0x4c62cc[_0x3da71f(0x149)]===0x0){if(_0x57f7ee['length']>0x0)throw new Error(_0x3da71f(0x15e)+_0x57f7ee['join'](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x4bb1c1[_0x3da71f(0x160)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x44c851=await getOnlineMenuList(_0x4aa978,_0x1f7462),_0x1b3170=new Set(_0x44c851[_0x3da71f(0x153)](_0x2e1edc=>menuPathKey(_0x2e1edc[_0x3da71f(0x134)])));let _0x34bc7e;if(_0x57f7ee[_0x3da71f(0x149)]>0x0){const _0x1ec557=new Map(_0x4c62cc[_0x3da71f(0x153)](_0x25ab99=>[menuPathKey(_0x25ab99[_0x3da71f(0x134)]),_0x25ab99])),_0x34a44c=_0x57f7ee[_0x3da71f(0x137)](_0x475c45=>!_0x1ec557[_0x3da71f(0x130)](_0x475c45));if(_0x34a44c['length']>0x0){const _0x48e650=_0x4c62cc['map'](_0x1989b7=>_0x1989b7[_0x3da71f(0x134)])['join'](',\x20');throw new Error(_0x3da71f(0x15e)+_0x34a44c[_0x3da71f(0x13d)](',\x20')+_0x3da71f(0x150)+_0x48e650);}const _0x2e448b=_0x57f7ee[_0x3da71f(0x137)](_0x5ed7a4=>_0x1b3170[_0x3da71f(0x130)](_0x5ed7a4));if(_0x2e448b[_0x3da71f(0x149)]>0x0)throw new Error(_0x3da71f(0x147)+_0x2e448b[_0x3da71f(0x13d)](',\x20'));_0x34bc7e=_0x57f7ee['map'](_0x165521=>_0x1ec557[_0x3da71f(0x141)](_0x165521));}else _0x34bc7e=_0x4c62cc[_0x3da71f(0x137)](_0x291579=>!_0x1b3170['has'](menuPathKey(_0x291579['path'])));if(_0x34bc7e[_0x3da71f(0x149)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x4bb1c1[_0x3da71f(0x160)]===!![],'targetPages':[],'plannedMenus':[]};_0x34bc7e=_0x34bc7e[_0x3da71f(0x153)](_0x4cf6ef=>resolvePage(_0x4cf6ef,_0x1abb2f,_0x44c851));_0x1abb2f['appName']&&_0x469016[_0x3da71f(0x149)]===0x0&&await assertSharedResourcesConfigured(_0x4aa978,_0x1f7462,_0x1abb2f[_0x3da71f(0x12e)]);const _0x23060e=_0x34bc7e['map'](_0x2d2e57=>({'type':'procode','path':_0x2d2e57[_0x3da71f(0x134)],'label':_0x2d2e57[_0x3da71f(0x15a)],'loadScriptMode':_0x3da71f(0x163),'resources':[..._0x469016],..._0x2d2e57[_0x3da71f(0x12b)]===undefined?{}:{'visible':_0x2d2e57[_0x3da71f(0x12b)]},..._0x2d2e57[_0x3da71f(0x165)]===undefined?{}:{'parentId':_0x2d2e57[_0x3da71f(0x165)]},..._0x2d2e57[_0x3da71f(0x161)]===undefined?{}:{'sort':_0x2d2e57['order']},..._0x1abb2f[_0x3da71f(0x12e)]===undefined?{}:{'appName':_0x1abb2f['appName']}}));if(_0x4bb1c1['dryRun'])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x34bc7e,'plannedMenus':_0x23060e};const _0x35c132=_0x1abb2f['appName']?await createMenus(_0x4aa978,_0x1f7462,_0x34bc7e,_0x469016[_0x3da71f(0x149)]>0x0?_0x469016:undefined,{'appName':_0x1abb2f[_0x3da71f(0x12e)]}):await createMenus(_0x4aa978,_0x1f7462,_0x34bc7e,_0x469016['length']>0x0?_0x469016:undefined);return logger['info'](_0x3da71f(0x168),_0x3da71f(0x12d),{'count':_0x34bc7e[_0x3da71f(0x149)],'resources':_0x469016}),{'created':_0x35c132[_0x3da71f(0x149)],'skipped':![],'dryRun':![],'targetPages':_0x34bc7e,'plannedMenus':_0x23060e,'menus':_0x35c132};}export function parseMenuSyncParams(_0x5b8839){const _0x5c033e=a173_0x5bea17;if(!_0x5b8839||typeof _0x5b8839!==_0x5c033e(0x155))return{};let _0x238549;try{_0x238549=JSON[_0x5c033e(0x12c)](_0x5b8839);}catch{throw new Error(_0x5c033e(0x13a));}if(typeof _0x238549!=='object'||_0x238549===null||Array[_0x5c033e(0x156)](_0x238549))throw new Error(_0x5c033e(0x15d));const _0xbd8684=_0x238549;if(Object['hasOwn'](_0xbd8684,_0x5c033e(0x15b)))throw new Error(_0x5c033e(0x146));const _0x2ddf35=Object[_0x5c033e(0x166)](_0xbd8684)['filter'](_0x28e952=>!MENU_SYNC_PARAM_KEYS[_0x5c033e(0x130)](_0x28e952));if(_0x2ddf35[_0x5c033e(0x149)]>0x0)throw new Error(_0x5c033e(0x13e)+_0x2ddf35['join'](',\x20')+'.');for(const _0x55518 of[_0x5c033e(0x164),_0x5c033e(0x142),_0x5c033e(0x12e)]){const _0x3402af=_0xbd8684[_0x55518];if(_0x3402af!==undefined&&(typeof _0x3402af!==_0x5c033e(0x155)||_0x3402af[_0x5c033e(0x12f)]()===''))throw new Error(_0x5c033e(0x139)+_0x55518+_0x5c033e(0x152));}if(_0xbd8684[_0x5c033e(0x12b)]!==undefined&&typeof _0xbd8684['visible']!==_0x5c033e(0x158))throw new Error(_0x5c033e(0x132));if(_0xbd8684['parentId']!==undefined&&(!Number['isInteger'](_0xbd8684[_0x5c033e(0x165)])||_0xbd8684[_0x5c033e(0x165)]<0x0))throw new Error(_0x5c033e(0x148));return{'jsUrl':typeof _0xbd8684[_0x5c033e(0x164)]===_0x5c033e(0x155)?_0xbd8684[_0x5c033e(0x164)][_0x5c033e(0x12f)]():undefined,'cssUrl':typeof _0xbd8684['cssUrl']===_0x5c033e(0x155)?_0xbd8684[_0x5c033e(0x142)][_0x5c033e(0x12f)]():undefined,'appName':typeof _0xbd8684['appName']===_0x5c033e(0x155)?_0xbd8684[_0x5c033e(0x12e)][_0x5c033e(0x12f)]():undefined,'visible':typeof _0xbd8684[_0x5c033e(0x12b)]===_0x5c033e(0x158)?_0xbd8684[_0x5c033e(0x12b)]:undefined,'parentId':typeof _0xbd8684[_0x5c033e(0x165)]===_0x5c033e(0x15f)?_0xbd8684[_0x5c033e(0x165)]:undefined};}
|
|
1
|
+
const a173_0x27ade8=a173_0x44bb;(function(_0x372853,_0x2a8699){const _0x523bda=a173_0x44bb,_0x221b91=_0x372853();while(!![]){try{const _0x49cfb1=-parseInt(_0x523bda(0x1c5))/0x1*(-parseInt(_0x523bda(0x1be))/0x2)+parseInt(_0x523bda(0x19d))/0x3+-parseInt(_0x523bda(0x1ae))/0x4+-parseInt(_0x523bda(0x1c2))/0x5*(-parseInt(_0x523bda(0x1d5))/0x6)+parseInt(_0x523bda(0x1cd))/0x7*(-parseInt(_0x523bda(0x1ca))/0x8)+-parseInt(_0x523bda(0x19e))/0x9+parseInt(_0x523bda(0x19a))/0xa;if(_0x49cfb1===_0x2a8699)break;else _0x221b91['push'](_0x221b91['shift']());}catch(_0x13c6b0){_0x221b91['push'](_0x221b91['shift']());}}}(a173_0x25f9,0x771c2));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';function a173_0x44bb(_0x1fb618,_0x350790){_0x1fb618=_0x1fb618-0x196;const _0x25f958=a173_0x25f9();let _0x44bbda=_0x25f958[_0x1fb618];return _0x44bbda;}const MENU_SYNC_PARAM_KEYS=new Set([a173_0x27ade8(0x1d2),a173_0x27ade8(0x1a1),a173_0x27ade8(0x1b6),a173_0x27ade8(0x1a9),a173_0x27ade8(0x1b7)]);export function resolvePage(_0x598a09,_0x5a2ede,_0x555ac1){const _0x2a9834=a173_0x27ade8;let _0x3fa92a=_0x5a2ede[_0x2a9834(0x1b7)]??_0x598a09[_0x2a9834(0x1b7)];if(_0x3fa92a===undefined&&_0x598a09[_0x2a9834(0x199)]){const _0x4b0ed1=_0x555ac1[_0x2a9834(0x1bc)](_0x2d8e03=>_0x2d8e03[_0x2a9834(0x1c9)]==='folder'&&_0x2d8e03['label']===_0x598a09[_0x2a9834(0x199)]);if(_0x4b0ed1[_0x2a9834(0x1c3)]!==0x1)throw new Error(_0x2a9834(0x1af)+_0x598a09[_0x2a9834(0x199)]+_0x2a9834(0x1bb)+_0x598a09[_0x2a9834(0x1bd)]+_0x2a9834(0x1ad)+_0x4b0ed1['length']);_0x3fa92a=_0x4b0ed1[0x0]['id'];}if(_0x3fa92a!==undefined&&_0x3fa92a!==0x0&&_0x555ac1['filter'](_0x1526f2=>_0x1526f2['id']===_0x3fa92a&&_0x1526f2['type']==='folder')[_0x2a9834(0x1c3)]!==0x1)throw new Error(_0x2a9834(0x197)+_0x3fa92a+_0x2a9834(0x1d4));return{..._0x598a09,..._0x3fa92a===undefined?{}:{'parentId':_0x3fa92a},..._0x5a2ede[_0x2a9834(0x1a9)]===undefined?{}:{'visible':_0x5a2ede[_0x2a9834(0x1a9)]}};}function a173_0x25f9(){const _0x5def41=['field','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','Menu\x20sync\x20completed','isArray','push','menu-sync','Invalid\x20--params.','visible','number','trim','Invalid\x20--params:\x20',';\x20found\x20','592176BQfnqJ','Expected\x20one\x20folder\x20named\x20\x22','Invalid\x20--params\x20fields:\x20','get','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','CSS\x20URL\x20is\x20unreachable:\x20','JS\x20URL\x20is\x20unreachable:\x20','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','appName','parentId','message','map','dryRun','\x22\x20for\x20','filter','path','13778MpsMzV','parse',':\x20expected\x20a\x20non-empty\x20string.','cwd','374625AmIpcX','length','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','115zZFSHq','boolean','info','isInteger','type','16vrQyrM','setLogPath','string','1830073LjxavO','No\x20local\x20pages\x20matched\x20paths:\x20','import','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','jsUrl','label','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','30dzAAry','--params.','Parent\x20','join','group','2429590YnVDbE','hasOwn','Invalid\x20--params\x20JSON.','1099968KLgmcJ','5559111NGUztS','order','has','cssUrl'];a173_0x25f9=function(){return _0x5def41;};return a173_0x25f9();}function validateParams(_0x1009d3){const _0x22a6fe=a173_0x27ade8,_0x7fd481=[];return _0x1009d3[_0x22a6fe(0x1d2)]&&!isValidJsHttpsUrl(_0x1009d3[_0x22a6fe(0x1d2)])&&_0x7fd481[_0x22a6fe(0x1a6)]({'field':_0x22a6fe(0x1d2),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x1009d3[_0x22a6fe(0x1a1)]&&!isValidCssHttpsUrl(_0x1009d3['cssUrl'])&&_0x7fd481[_0x22a6fe(0x1a6)]({'field':'cssUrl','message':_0x22a6fe(0x1d0)}),_0x7fd481;}export async function runMenuSyncCore(_0x2bbbdc,_0x3eac38,_0x58b02e=[],_0x3762c9,_0x3cdebc={}){const _0xfcd1ef=a173_0x27ade8,_0x291bee=parseMenuSyncParams(_0x3762c9),_0xe98e2b=[...new Set(_0x58b02e['map'](_0x8c3d0c=>_0x8c3d0c[_0xfcd1ef(0x1ab)]())[_0xfcd1ef(0x1bc)](Boolean)[_0xfcd1ef(0x1b9)](menuPathKey))],_0x3515a6=_0x291bee[_0xfcd1ef(0x1d2)],_0x5be203=_0x291bee['cssUrl'],_0x2184ce=[];if(_0x3515a6)_0x2184ce['push'](_0x3515a6);if(_0x5be203)_0x2184ce['push'](_0x5be203);const _0xd3eb81=validateParams(_0x291bee);if(_0xd3eb81[_0xfcd1ef(0x1c3)]>0x0){const _0x1ef203=_0xd3eb81[_0xfcd1ef(0x1b9)](_0x5c75c5=>_0xfcd1ef(0x196)+_0x5c75c5[_0xfcd1ef(0x1a2)]+':\x20'+_0x5c75c5[_0xfcd1ef(0x1b8)])[_0xfcd1ef(0x198)](';\x20');throw new Error(_0xfcd1ef(0x1ac)+_0x1ef203);}logger[_0xfcd1ef(0x1cb)](process[_0xfcd1ef(0x1c1)]()),logger[_0xfcd1ef(0x1c7)](_0xfcd1ef(0x1a7),'Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x2bbbdc,'selectedCount':_0xe98e2b[_0xfcd1ef(0x1c3)],'jsUrl':_0x3515a6,'cssUrl':_0x5be203});if(_0x3515a6){const _0x2ffa33=await isUrlReachable(_0x3515a6);if(!_0x2ffa33)throw new Error(_0xfcd1ef(0x1b4)+_0x3515a6);}if(_0x5be203){const _0x42aeca=await isUrlReachable(_0x5be203);if(!_0x42aeca)throw new Error(_0xfcd1ef(0x1b3)+_0x5be203);}const _0x26ad44=getLocalPages();if(_0x26ad44[_0xfcd1ef(0x1c3)]===0x0){if(_0xe98e2b[_0xfcd1ef(0x1c3)]>0x0)throw new Error(_0xfcd1ef(0x1ce)+_0xe98e2b['join'](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x3cdebc[_0xfcd1ef(0x1ba)]===!![],'targetPages':[],'plannedMenus':[]};}const _0xa200b6=await getOnlineMenuList(_0x2bbbdc,_0x3eac38),_0x1c4b3d=new Set(_0xa200b6[_0xfcd1ef(0x1b9)](_0x1667a7=>menuPathKey(_0x1667a7[_0xfcd1ef(0x1bd)])));let _0x39ee65;if(_0xe98e2b[_0xfcd1ef(0x1c3)]>0x0){const _0x31064a=new Map(_0x26ad44[_0xfcd1ef(0x1b9)](_0xc7950b=>[menuPathKey(_0xc7950b[_0xfcd1ef(0x1bd)]),_0xc7950b])),_0x4dfd20=_0xe98e2b[_0xfcd1ef(0x1bc)](_0x3a7b01=>!_0x31064a[_0xfcd1ef(0x1a0)](_0x3a7b01));if(_0x4dfd20[_0xfcd1ef(0x1c3)]>0x0){const _0x742626=_0x26ad44[_0xfcd1ef(0x1b9)](_0x54984f=>_0x54984f[_0xfcd1ef(0x1bd)])[_0xfcd1ef(0x198)](',\x20');throw new Error(_0xfcd1ef(0x1ce)+_0x4dfd20['join'](',\x20')+'\x0a\x20\x20Available\x20local\x20paths:\x20'+_0x742626);}const _0xe1be37=_0xe98e2b[_0xfcd1ef(0x1bc)](_0xb8a390=>_0x1c4b3d[_0xfcd1ef(0x1a0)](_0xb8a390));if(_0xe1be37[_0xfcd1ef(0x1c3)]>0x0)throw new Error(_0xfcd1ef(0x1d1)+_0xe1be37[_0xfcd1ef(0x198)](',\x20'));_0x39ee65=_0xe98e2b[_0xfcd1ef(0x1b9)](_0x5a2aaa=>_0x31064a[_0xfcd1ef(0x1b1)](_0x5a2aaa));}else _0x39ee65=_0x26ad44[_0xfcd1ef(0x1bc)](_0x4c08a1=>!_0x1c4b3d['has'](menuPathKey(_0x4c08a1[_0xfcd1ef(0x1bd)])));if(_0x39ee65[_0xfcd1ef(0x1c3)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x3cdebc[_0xfcd1ef(0x1ba)]===!![],'targetPages':[],'plannedMenus':[]};_0x39ee65=_0x39ee65[_0xfcd1ef(0x1b9)](_0x2f897a=>resolvePage(_0x2f897a,_0x291bee,_0xa200b6));_0x291bee[_0xfcd1ef(0x1b6)]&&_0x2184ce[_0xfcd1ef(0x1c3)]===0x0&&await assertSharedResourcesConfigured(_0x2bbbdc,_0x3eac38,_0x291bee[_0xfcd1ef(0x1b6)]);const _0x69d5de=_0x39ee65[_0xfcd1ef(0x1b9)](_0x3d678a=>({'type':'procode','path':_0x3d678a[_0xfcd1ef(0x1bd)],'label':_0x3d678a[_0xfcd1ef(0x1d3)],'loadScriptMode':_0xfcd1ef(0x1cf),'resources':[..._0x2184ce],..._0x3d678a[_0xfcd1ef(0x1a9)]===undefined?{}:{'visible':_0x3d678a['visible']},..._0x3d678a[_0xfcd1ef(0x1b7)]===undefined?{}:{'parentId':_0x3d678a[_0xfcd1ef(0x1b7)]},..._0x3d678a[_0xfcd1ef(0x19f)]===undefined?{}:{'sort':_0x3d678a[_0xfcd1ef(0x19f)]},..._0x291bee[_0xfcd1ef(0x1b6)]===undefined?{}:{'appName':_0x291bee[_0xfcd1ef(0x1b6)]}}));if(_0x3cdebc['dryRun'])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x39ee65,'plannedMenus':_0x69d5de};const _0x4073c0=_0x291bee[_0xfcd1ef(0x1b6)]?await createMenus(_0x2bbbdc,_0x3eac38,_0x39ee65,_0x2184ce[_0xfcd1ef(0x1c3)]>0x0?_0x2184ce:undefined,{'appName':_0x291bee[_0xfcd1ef(0x1b6)]}):await createMenus(_0x2bbbdc,_0x3eac38,_0x39ee65,_0x2184ce[_0xfcd1ef(0x1c3)]>0x0?_0x2184ce:undefined);return logger[_0xfcd1ef(0x1c7)]('menu-sync',_0xfcd1ef(0x1a4),{'count':_0x39ee65['length'],'resources':_0x2184ce}),{'created':_0x4073c0['length'],'skipped':![],'dryRun':![],'targetPages':_0x39ee65,'plannedMenus':_0x69d5de,'menus':_0x4073c0};}export function parseMenuSyncParams(_0x2ea8c9){const _0x230972=a173_0x27ade8;if(!_0x2ea8c9||typeof _0x2ea8c9!==_0x230972(0x1cc))return{};let _0x446ff0;try{_0x446ff0=JSON[_0x230972(0x1bf)](_0x2ea8c9);}catch{throw new Error(_0x230972(0x19c));}if(typeof _0x446ff0!=='object'||_0x446ff0===null||Array[_0x230972(0x1a5)](_0x446ff0))throw new Error(_0x230972(0x1b2));const _0x5085e9=_0x446ff0;if(Object[_0x230972(0x19b)](_0x5085e9,'pages'))throw new Error(_0x230972(0x1c4));const _0x579d06=Object['keys'](_0x5085e9)[_0x230972(0x1bc)](_0x2a2ceb=>!MENU_SYNC_PARAM_KEYS[_0x230972(0x1a0)](_0x2a2ceb));if(_0x579d06[_0x230972(0x1c3)]>0x0)throw new Error(_0x230972(0x1b0)+_0x579d06[_0x230972(0x198)](',\x20')+'.');for(const _0x3c2c31 of['jsUrl',_0x230972(0x1a1),_0x230972(0x1b6)]){const _0x534eae=_0x5085e9[_0x3c2c31];if(_0x534eae!==undefined&&(typeof _0x534eae!=='string'||_0x534eae[_0x230972(0x1ab)]()===''))throw new Error(_0x230972(0x1a8)+_0x3c2c31+_0x230972(0x1c0));}if(_0x5085e9['visible']!==undefined&&typeof _0x5085e9['visible']!==_0x230972(0x1c6))throw new Error(_0x230972(0x1b5));if(_0x5085e9[_0x230972(0x1b7)]!==undefined&&(!Number[_0x230972(0x1c8)](_0x5085e9[_0x230972(0x1b7)])||_0x5085e9['parentId']<0x0))throw new Error(_0x230972(0x1a3));return{'jsUrl':typeof _0x5085e9[_0x230972(0x1d2)]===_0x230972(0x1cc)?_0x5085e9[_0x230972(0x1d2)]['trim']():undefined,'cssUrl':typeof _0x5085e9[_0x230972(0x1a1)]===_0x230972(0x1cc)?_0x5085e9[_0x230972(0x1a1)]['trim']():undefined,'appName':typeof _0x5085e9[_0x230972(0x1b6)]==='string'?_0x5085e9['appName'][_0x230972(0x1ab)]():undefined,'visible':typeof _0x5085e9[_0x230972(0x1a9)]===_0x230972(0x1c6)?_0x5085e9[_0x230972(0x1a9)]:undefined,'parentId':typeof _0x5085e9[_0x230972(0x1b7)]===_0x230972(0x1aa)?_0x5085e9['parentId']:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xb8ae26,_0x29dcda){const _0x2e3db9=a175_0x3d0e,_0x1c4aa9=_0xb8ae26();while(!![]){try{const _0x30157b=-parseInt(_0x2e3db9(0x161))/0x1*(-parseInt(_0x2e3db9(0x168))/0x2)+-parseInt(_0x2e3db9(0x15b))/0x3*(parseInt(_0x2e3db9(0x18c))/0x4)+-parseInt(_0x2e3db9(0x14c))/0x5+-parseInt(_0x2e3db9(0x152))/0x6*(parseInt(_0x2e3db9(0x16e))/0x7)+-parseInt(_0x2e3db9(0x150))/0x8+-parseInt(_0x2e3db9(0x17a))/0x9+-parseInt(_0x2e3db9(0x178))/0xa*(-parseInt(_0x2e3db9(0x186))/0xb);if(_0x30157b===_0x29dcda)break;else _0x1c4aa9['push'](_0x1c4aa9['shift']());}catch(_0x103e48){_0x1c4aa9['push'](_0x1c4aa9['shift']());}}}(a175_0x4c20,0xcd2c7));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(_0x3a924e){const _0x1e5295=a175_0x3d0e,_0x4d1383=[];return _0x3a924e[_0x1e5295(0x172)]&&!isValidJsHttpsUrl(_0x3a924e[_0x1e5295(0x172)])&&_0x4d1383[_0x1e5295(0x163)]({'field':'jsUrl','message':_0x1e5295(0x156)}),_0x3a924e[_0x1e5295(0x155)]&&!isValidCssHttpsUrl(_0x3a924e[_0x1e5295(0x155)])&&_0x4d1383[_0x1e5295(0x163)]({'field':'cssUrl','message':_0x1e5295(0x162)}),_0x4d1383;}export async function runMenuUpdateCore(_0x14c653,_0x3320a1,_0x51838a,_0x18c6a4={}){const _0x4e9915=a175_0x3d0e,_0x1247b4=parseUpdateParamsFlag(_0x51838a),_0x3607d0=normalizeMode(_0x18c6a4['mode']);validateSelection(_0x18c6a4[_0x4e9915(0x181)]);const _0x4d964b=[];if(_0x1247b4['jsUrl'])_0x4d964b['push'](_0x1247b4[_0x4e9915(0x172)]);if(_0x1247b4[_0x4e9915(0x155)])_0x4d964b[_0x4e9915(0x163)](_0x1247b4[_0x4e9915(0x155)]);const _0x46462c=validateParams(_0x1247b4);if(_0x46462c[_0x4e9915(0x14d)]>0x0){const _0x55a2e4=_0x46462c[_0x4e9915(0x157)](_0x456c8f=>_0x4e9915(0x14e)+_0x456c8f[_0x4e9915(0x166)]+':\x20'+_0x456c8f[_0x4e9915(0x15d)])['join'](';\x20');throw new Error(_0x4e9915(0x189)+_0x55a2e4);}if(_0x4d964b[_0x4e9915(0x14d)]===0x0)throw new Error(_0x4e9915(0x175)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger['setLogPath'](process[_0x4e9915(0x16d)]()),logger['info'](_0x4e9915(0x18b),'Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x14c653,'jsUrl':_0x1247b4[_0x4e9915(0x172)],'cssUrl':_0x1247b4[_0x4e9915(0x155)],'mode':_0x3607d0,'dryRun':_0x18c6a4[_0x4e9915(0x151)]===!![]});if(_0x1247b4[_0x4e9915(0x172)]){const _0x4286a3=await isUrlReachable(_0x1247b4[_0x4e9915(0x172)]);if(!_0x4286a3)throw new Error(_0x4e9915(0x183)+_0x1247b4[_0x4e9915(0x172)]);}if(_0x1247b4[_0x4e9915(0x155)]){const _0x212b65=await isUrlReachable(_0x1247b4[_0x4e9915(0x155)]);if(!_0x212b65)throw new Error(_0x4e9915(0x174)+_0x1247b4[_0x4e9915(0x155)]);}const _0x1899fb=await getOnlineMenuList(_0x14c653,_0x3320a1),_0x50a1fb=_0x1899fb[_0x4e9915(0x180)](_0x1cb798=>_0x1cb798[_0x4e9915(0x159)][_0x4e9915(0x14d)]>0x0),_0x521ff4=selectMenusForUpdate(_0x50a1fb,_0x18c6a4[_0x4e9915(0x181)]);if(_0x521ff4[_0x4e9915(0x14d)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x18c6a4[_0x4e9915(0x151)]===!![]};const _0x4c7736=_0x521ff4['map'](_0x53394a=>buildMenuUpdateDiff(_0x53394a,_0x1247b4,_0x3607d0,_0x18c6a4['force']===!![],_0x18c6a4[_0x4e9915(0x17d)]));if(_0x18c6a4['dryRun'])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x4c7736};const _0x299fab=await Promise['allSettled'](_0x521ff4[_0x4e9915(0x157)]((_0x4eee11,_0x3212fc)=>updateMenuCdnUrl(_0x14c653,_0x3320a1,{'id':_0x4eee11['id'],'label':_0x4eee11[_0x4e9915(0x17f)],'path':_0x4eee11[_0x4e9915(0x15f)],'resources':_0x4c7736[_0x3212fc][_0x4e9915(0x164)]['resources'],'extend':_0x4eee11['extend']??null,'loadScriptMode':_0x18c6a4['loadScriptMode']}))),_0x1f3be2=_0x299fab['filter'](_0x37c21d=>_0x37c21d[_0x4e9915(0x15a)]===_0x4e9915(0x16b))['map'](_0xdb5761=>_0xdb5761['value']),_0x296a5b=_0x299fab[_0x4e9915(0x180)](_0x280901=>_0x280901[_0x4e9915(0x15a)]==='rejected')[_0x4e9915(0x14d)];return logger['info'](_0x4e9915(0x18b),_0x4e9915(0x15e),{'count':_0x521ff4[_0x4e9915(0x14d)],'resources':_0x4d964b}),{'updated':_0x1f3be2[_0x4e9915(0x14d)],'failed':_0x296a5b,'skipped':![],'menus':_0x1f3be2};}function validateSelection(_0x6a0b49){const _0xcbd5e0=a175_0x3d0e;if(!_0x6a0b49)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x6a0b49['all']&&(_0x6a0b49['menuIds']['length']>0x0||_0x6a0b49['paths']['length']>0x0))throw new Error(_0xcbd5e0(0x173));if(!_0x6a0b49[_0xcbd5e0(0x17b)]&&_0x6a0b49[_0xcbd5e0(0x188)]['length']===0x0&&_0x6a0b49[_0xcbd5e0(0x18a)][_0xcbd5e0(0x14d)]===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x523db7,_0x1968c4){const _0x3639b6=a175_0x3d0e;validateSelection(_0x1968c4);if(_0x1968c4[_0x3639b6(0x17b)])return _0x523db7;const _0x10dc4b=new Set(_0x523db7[_0x3639b6(0x157)](_0x361674=>_0x361674['id'])),_0x53e7b0=new Set(_0x523db7[_0x3639b6(0x157)](_0x1fb3ab=>_0x1fb3ab[_0x3639b6(0x15f)])),_0x53c96b=_0x1968c4[_0x3639b6(0x188)]['filter'](_0x3e115a=>!_0x10dc4b['has'](_0x3e115a)),_0x54403f=_0x1968c4[_0x3639b6(0x18a)]['filter'](_0x7e592b=>!_0x53e7b0[_0x3639b6(0x182)](_0x7e592b));if(_0x53c96b['length']>0x0||_0x54403f[_0x3639b6(0x14d)]>0x0){const _0x4a417f=[..._0x53c96b[_0x3639b6(0x157)](_0x145ef4=>String(_0x145ef4)),..._0x54403f][_0x3639b6(0x154)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x4a417f);}const _0x482c79=new Set(_0x1968c4['menuIds']),_0x487155=new Set(_0x1968c4['paths']);return _0x523db7['filter'](_0x48915e=>_0x482c79[_0x3639b6(0x182)](_0x48915e['id'])||_0x487155['has'](_0x48915e[_0x3639b6(0x15f)]));}function normalizeMode(_0xa4427a){const _0x17392c=a175_0x3d0e;if(!_0xa4427a)return _0x17392c(0x17c);if(_0xa4427a==='replace'||_0xa4427a==='patch')return _0xa4427a;throw new Error(_0x17392c(0x16c)+_0xa4427a+_0x17392c(0x167));}function a175_0x4c20(){const _0x311dae=['\x20existing\x20CSS\x20resources\x20for\x20\x22','8360015YYPonX','length','--params.','parse','1648272xplKel','dryRun','114eMfiTK','isArray','join','cssUrl','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','map','.js','resources','status','3383925cGPccC','unshift','message','Menu\x20asset\x20update\x20completed','path','object','72635LpBbpR','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','push','after','trim','field','.\x20Allowed\x20values:\x20replace,\x20patch','2mRcfAs','endsWith','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','fulfilled','Invalid\x20--mode:\x20','cwd','459515YYXIWf','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','some','string','jsUrl','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','CSS\x20URL\x20is\x20unreachable:\x20','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','menu\x20asset-update\x20cannot\x20patch\x20','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','1020MzoEdR','extend','3678687QCJRPB','all','patch','loadScriptMode','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','label','filter','selection','has','JS\x20URL\x20is\x20unreachable:\x20','\x22\x20(',').\x20','585563MGPLMg','split','menuIds','Invalid\x20--params:\x20','paths','menu-asset-update','4wbpqGs'];a175_0x4c20=function(){return _0x311dae;};return a175_0x4c20();}function buildMenuUpdateDiff(_0x2a6da4,_0xf85bad,_0x392576,_0x55bb5d,_0x3c6e3b){const _0x44588a=a175_0x3d0e,_0x2746f7=[..._0x2a6da4[_0x44588a(0x159)]];_0x392576===_0x44588a(0x17c)&&assertUnambiguousPatchResources(_0x2a6da4,_0x2746f7,_0xf85bad);const _0x2e080b=_0x392576==='patch'?patchResources(_0x2746f7,_0xf85bad):replaceResources(_0xf85bad),_0x434fbc=[],_0x29956d=_0x2746f7['some'](isJsResource),_0x5ab2ff=_0x2e080b['some'](isJsResource);if(_0x29956d&&!_0x5ab2ff){const _0xd5b690=_0x44588a(0x177)+_0x2a6da4[_0x44588a(0x17f)]+_0x44588a(0x184)+_0x2a6da4[_0x44588a(0x15f)]+_0x44588a(0x185)+_0x44588a(0x17e);if(!_0x55bb5d)throw new Error(_0xd5b690);_0x434fbc[_0x44588a(0x163)](_0xd5b690);}const _0x4ad293=_0x2746f7['some'](isCssResource),_0x1cbbbe=_0x2e080b[_0x44588a(0x170)](isCssResource);_0x4ad293&&!_0x1cbbbe&&_0x434fbc['push'](_0x44588a(0x16a)+_0x2a6da4[_0x44588a(0x17f)]+'\x22\x20('+_0x2a6da4[_0x44588a(0x15f)]+').');const _0x3da8f2=typeof _0x2a6da4['extend']?.[_0x44588a(0x17d)]===_0x44588a(0x171)?_0x2a6da4[_0x44588a(0x179)][_0x44588a(0x17d)]:null,_0x2520af=_0x3c6e3b?{'loadScriptMode':_0x3da8f2}:{},_0x4be498=_0x3c6e3b?{'loadScriptMode':_0x3c6e3b}:{};return{'id':_0x2a6da4['id'],'label':_0x2a6da4['label'],'path':_0x2a6da4['path'],'mode':_0x392576,'before':{'resources':_0x2746f7,..._0x2520af},'after':{'resources':_0x2e080b,..._0x4be498},'warnings':_0x434fbc};}function replaceResources(_0x1ff141){const _0x48a769=a175_0x3d0e;return[_0x1ff141[_0x48a769(0x172)],_0x1ff141[_0x48a769(0x155)]]['filter'](_0x4978e5=>!!_0x4978e5);}function a175_0x3d0e(_0x4884d5,_0x156903){_0x4884d5=_0x4884d5-0x14c;const _0x4c2066=a175_0x4c20();let _0x3d0e2c=_0x4c2066[_0x4884d5];return _0x3d0e2c;}function assertUnambiguousPatchResources(_0x1cba48,_0x3a4ac1,_0x3eb6dc){const _0x25a89a=a175_0x3d0e,_0x283d05=_0x3a4ac1[_0x25a89a(0x180)](isJsResource)['length'];if(_0x3eb6dc[_0x25a89a(0x172)]&&_0x283d05>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x283d05+'\x20existing\x20JS\x20resources\x20for\x20\x22'+_0x1cba48[_0x25a89a(0x17f)]+_0x25a89a(0x184)+_0x1cba48[_0x25a89a(0x15f)]+')\x20'+_0x25a89a(0x16f));const _0x5c5bdc=_0x3a4ac1[_0x25a89a(0x180)](isCssResource)[_0x25a89a(0x14d)];if(_0x3eb6dc[_0x25a89a(0x155)]&&_0x5c5bdc>0x1)throw new Error(_0x25a89a(0x176)+_0x5c5bdc+_0x25a89a(0x18d)+_0x1cba48[_0x25a89a(0x17f)]+'\x22\x20('+_0x1cba48[_0x25a89a(0x15f)]+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function patchResources(_0x2e2cd6,_0x43fce8){const _0x255d1b=a175_0x3d0e;let _0x37bdb4=![],_0x220939=![];const _0x363a39=[];for(const _0x4c066a of _0x2e2cd6){if(isJsResource(_0x4c066a)){if(_0x43fce8[_0x255d1b(0x172)]&&!_0x37bdb4)_0x363a39[_0x255d1b(0x163)](_0x43fce8[_0x255d1b(0x172)]),_0x37bdb4=!![];else!_0x43fce8[_0x255d1b(0x172)]&&_0x363a39[_0x255d1b(0x163)](_0x4c066a);continue;}if(isCssResource(_0x4c066a)){if(_0x43fce8[_0x255d1b(0x155)]&&!_0x220939)_0x363a39[_0x255d1b(0x163)](_0x43fce8['cssUrl']),_0x220939=!![];else!_0x43fce8['cssUrl']&&_0x363a39[_0x255d1b(0x163)](_0x4c066a);continue;}_0x363a39[_0x255d1b(0x163)](_0x4c066a);}return _0x43fce8[_0x255d1b(0x172)]&&!_0x37bdb4&&_0x363a39[_0x255d1b(0x15c)](_0x43fce8[_0x255d1b(0x172)]),_0x43fce8[_0x255d1b(0x155)]&&!_0x220939&&_0x363a39[_0x255d1b(0x163)](_0x43fce8['cssUrl']),_0x363a39;}function isJsResource(_0x1e85a3){const _0xcbee8e=a175_0x3d0e;return stripQuery(_0x1e85a3)['toLowerCase']()['endsWith'](_0xcbee8e(0x158));}function isCssResource(_0x24dda8){const _0x2ecae2=a175_0x3d0e;return stripQuery(_0x24dda8)['toLowerCase']()[_0x2ecae2(0x169)]('.css');}function stripQuery(_0x7eca5b){const _0x20078b=a175_0x3d0e;return _0x7eca5b[_0x20078b(0x187)]('?')[0x0]??_0x7eca5b;}function parseUpdateParamsFlag(_0x24f34b){const _0x33ba61=a175_0x3d0e;if(!_0x24f34b||typeof _0x24f34b!==_0x33ba61(0x171))return{};try{const _0x1daa19=JSON[_0x33ba61(0x14f)](_0x24f34b);if(typeof _0x1daa19!==_0x33ba61(0x160)||_0x1daa19===null||Array[_0x33ba61(0x153)](_0x1daa19))return{};return{'jsUrl':typeof _0x1daa19[_0x33ba61(0x172)]===_0x33ba61(0x171)?_0x1daa19[_0x33ba61(0x172)][_0x33ba61(0x165)]():undefined,'cssUrl':typeof _0x1daa19[_0x33ba61(0x155)]===_0x33ba61(0x171)?_0x1daa19[_0x33ba61(0x155)]['trim']():undefined};}catch{return{};}}
|
|
1
|
+
function a175_0x107d(){const _0x51c74a=['7AJgNIr','Invalid\x20--mode:\x20','55mjuQyX','field','dryRun','replace','.css','selection','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','jsUrl','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','menuIds','extend','2117456HggzVN','416720bDhtWG','paths','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','1955784ESBwDJ','some','length','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','\x20existing\x20JS\x20resources\x20for\x20\x22','split','fulfilled','join','after','1028568GvzZLk','toLowerCase','37998jKRgqN','resources','string','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','value','\x22\x20(','filter','.js','force','has','message','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','status','all','map','patch','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','isArray','--params.','endsWith','loadScriptMode','menu\x20asset-update\x20cannot\x20patch\x20','1270tawbPs','object','push','trim','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','menu-asset-update','cssUrl','.\x20Allowed\x20values:\x20replace,\x20patch','path','1jONLIJ',').\x20','unshift','2323284jahzaW','JS\x20URL\x20is\x20unreachable:\x20','\x20existing\x20CSS\x20resources\x20for\x20\x22','CSS\x20URL\x20is\x20unreachable:\x20','label','parse','cwd','968318WQpJmv','5emtAFZ','rejected','allSettled'];a175_0x107d=function(){return _0x51c74a;};return a175_0x107d();}(function(_0x498db8,_0x580aaf){const _0x3997f5=a175_0x288f,_0x3801ce=_0x498db8();while(!![]){try{const _0x3ad50a=parseInt(_0x3997f5(0xb2))/0x1*(-parseInt(_0x3997f5(0xbc))/0x2)+-parseInt(_0x3997f5(0xda))/0x3+parseInt(_0x3997f5(0xce))/0x4*(-parseInt(_0x3997f5(0xbd))/0x5)+parseInt(_0x3997f5(0xb5))/0x6*(-parseInt(_0x3997f5(0xc0))/0x7)+parseInt(_0x3997f5(0xcd))/0x8+-parseInt(_0x3997f5(0xdc))/0x9*(-parseInt(_0x3997f5(0xa9))/0xa)+-parseInt(_0x3997f5(0xc2))/0xb*(-parseInt(_0x3997f5(0xd1))/0xc);if(_0x3ad50a===_0x580aaf)break;else _0x3801ce['push'](_0x3801ce['shift']());}catch(_0x560bf1){_0x3801ce['push'](_0x3801ce['shift']());}}}(a175_0x107d,0x489a1));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(_0x3f6f99){const _0x435c8c=a175_0x288f,_0x1e26e3=[];return _0x3f6f99['jsUrl']&&!isValidJsHttpsUrl(_0x3f6f99['jsUrl'])&&_0x1e26e3['push']({'field':_0x435c8c(0xc9),'message':_0x435c8c(0xa3)}),_0x3f6f99[_0x435c8c(0xaf)]&&!isValidCssHttpsUrl(_0x3f6f99[_0x435c8c(0xaf)])&&_0x1e26e3[_0x435c8c(0xab)]({'field':_0x435c8c(0xaf),'message':_0x435c8c(0xe0)}),_0x1e26e3;}export async function runMenuUpdateCore(_0x2e425e,_0xf47278,_0x5741db,_0x3862f6={}){const _0x159b95=a175_0x288f,_0x252e00=parseUpdateParamsFlag(_0x5741db),_0x1d8f9d=normalizeMode(_0x3862f6['mode']);validateSelection(_0x3862f6[_0x159b95(0xc7)]);const _0xee96fa=[];if(_0x252e00[_0x159b95(0xc9)])_0xee96fa[_0x159b95(0xab)](_0x252e00[_0x159b95(0xc9)]);if(_0x252e00[_0x159b95(0xaf)])_0xee96fa['push'](_0x252e00[_0x159b95(0xaf)]);const _0x15e7eb=validateParams(_0x252e00);if(_0x15e7eb[_0x159b95(0xd3)]>0x0){const _0x34eb0f=_0x15e7eb[_0x159b95(0xeb)](_0x587068=>_0x159b95(0xa5)+_0x587068[_0x159b95(0xc3)]+':\x20'+_0x587068[_0x159b95(0xe7)])[_0x159b95(0xd8)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x34eb0f);}if(_0xee96fa['length']===0x0)throw new Error(_0x159b95(0xad)+_0x159b95(0xdf));logger['setLogPath'](process[_0x159b95(0xbb)]()),logger['info']('menu-asset-update','Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x2e425e,'jsUrl':_0x252e00[_0x159b95(0xc9)],'cssUrl':_0x252e00['cssUrl'],'mode':_0x1d8f9d,'dryRun':_0x3862f6[_0x159b95(0xc4)]===!![]});if(_0x252e00[_0x159b95(0xc9)]){const _0xc41f50=await isUrlReachable(_0x252e00[_0x159b95(0xc9)]);if(!_0xc41f50)throw new Error(_0x159b95(0xb6)+_0x252e00[_0x159b95(0xc9)]);}if(_0x252e00['cssUrl']){const _0x25a3f4=await isUrlReachable(_0x252e00[_0x159b95(0xaf)]);if(!_0x25a3f4)throw new Error(_0x159b95(0xb8)+_0x252e00[_0x159b95(0xaf)]);}const _0x233b91=await getOnlineMenuList(_0x2e425e,_0xf47278),_0x35df2c=_0x233b91[_0x159b95(0xe3)](_0x36596a=>_0x36596a['resources']['length']>0x0),_0x2d67af=selectMenusForUpdate(_0x35df2c,_0x3862f6[_0x159b95(0xc7)]);if(_0x2d67af[_0x159b95(0xd3)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x3862f6['dryRun']===!![]};const _0x49f86f=_0x2d67af[_0x159b95(0xeb)](_0x107982=>buildMenuUpdateDiff(_0x107982,_0x252e00,_0x1d8f9d,_0x3862f6[_0x159b95(0xe5)]===!![],_0x3862f6[_0x159b95(0xa7)]));if(_0x3862f6['dryRun'])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x49f86f};const _0x249e4e=await Promise[_0x159b95(0xbf)](_0x2d67af[_0x159b95(0xeb)]((_0x151644,_0x47eb08)=>updateMenuCdnUrl(_0x2e425e,_0xf47278,{'id':_0x151644['id'],'label':_0x151644[_0x159b95(0xb9)],'path':_0x151644['path'],'resources':_0x49f86f[_0x47eb08][_0x159b95(0xd9)][_0x159b95(0xdd)],'extend':_0x151644[_0x159b95(0xcc)]??null,'loadScriptMode':_0x3862f6[_0x159b95(0xa7)]}))),_0x2666c3=_0x249e4e['filter'](_0x4e8054=>_0x4e8054[_0x159b95(0xe9)]===_0x159b95(0xd7))[_0x159b95(0xeb)](_0x56cac2=>_0x56cac2[_0x159b95(0xe1)]),_0x4c09d9=_0x249e4e[_0x159b95(0xe3)](_0x1ea2ac=>_0x1ea2ac[_0x159b95(0xe9)]===_0x159b95(0xbe))[_0x159b95(0xd3)];return logger['info'](_0x159b95(0xae),'Menu\x20asset\x20update\x20completed',{'count':_0x2d67af['length'],'resources':_0xee96fa}),{'updated':_0x2666c3[_0x159b95(0xd3)],'failed':_0x4c09d9,'skipped':![],'menus':_0x2666c3};}function validateSelection(_0xae4fbb){const _0x1a9098=a175_0x288f;if(!_0xae4fbb)throw new Error(_0x1a9098(0xd0));if(_0xae4fbb[_0x1a9098(0xea)]&&(_0xae4fbb[_0x1a9098(0xcb)]['length']>0x0||_0xae4fbb[_0x1a9098(0xcf)]['length']>0x0))throw new Error(_0x1a9098(0xc8));if(!_0xae4fbb[_0x1a9098(0xea)]&&_0xae4fbb['menuIds']['length']===0x0&&_0xae4fbb[_0x1a9098(0xcf)][_0x1a9098(0xd3)]===0x0)throw new Error(_0x1a9098(0xd0));}export function selectMenusForUpdate(_0x39fee8,_0x48538b){const _0x325822=a175_0x288f;validateSelection(_0x48538b);if(_0x48538b[_0x325822(0xea)])return _0x39fee8;const _0x59ae13=new Set(_0x39fee8[_0x325822(0xeb)](_0x4e3a37=>_0x4e3a37['id'])),_0x479aaa=new Set(_0x39fee8['map'](_0x4f5ccb=>_0x4f5ccb['path'])),_0x270c11=_0x48538b[_0x325822(0xcb)]['filter'](_0x1dcb64=>!_0x59ae13['has'](_0x1dcb64)),_0x38eaa8=_0x48538b['paths'][_0x325822(0xe3)](_0x4b371c=>!_0x479aaa[_0x325822(0xe6)](_0x4b371c));if(_0x270c11[_0x325822(0xd3)]>0x0||_0x38eaa8['length']>0x0){const _0x42b810=[..._0x270c11[_0x325822(0xeb)](_0x336838=>String(_0x336838)),..._0x38eaa8][_0x325822(0xd8)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x42b810);}const _0x16e19b=new Set(_0x48538b[_0x325822(0xcb)]),_0x5bd187=new Set(_0x48538b[_0x325822(0xcf)]);return _0x39fee8[_0x325822(0xe3)](_0x3bd503=>_0x16e19b[_0x325822(0xe6)](_0x3bd503['id'])||_0x5bd187[_0x325822(0xe6)](_0x3bd503[_0x325822(0xb1)]));}function normalizeMode(_0xfe678d){const _0x50e2bc=a175_0x288f;if(!_0xfe678d)return _0x50e2bc(0xa2);if(_0xfe678d===_0x50e2bc(0xc5)||_0xfe678d===_0x50e2bc(0xa2))return _0xfe678d;throw new Error(_0x50e2bc(0xc1)+_0xfe678d+_0x50e2bc(0xb0));}function buildMenuUpdateDiff(_0x1b3b7f,_0x2b760e,_0x3baf6b,_0x4e315d,_0x41faed){const _0x16fd06=a175_0x288f,_0x6d7605=[..._0x1b3b7f[_0x16fd06(0xdd)]];_0x3baf6b==='patch'&&assertUnambiguousPatchResources(_0x1b3b7f,_0x6d7605,_0x2b760e);const _0x259c0f=_0x3baf6b===_0x16fd06(0xa2)?patchResources(_0x6d7605,_0x2b760e):replaceResources(_0x2b760e),_0x2ad4b8=[],_0x2348f5=_0x6d7605['some'](isJsResource),_0x31abb6=_0x259c0f['some'](isJsResource);if(_0x2348f5&&!_0x31abb6){const _0xf7d8f6='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x1b3b7f['label']+_0x16fd06(0xe2)+_0x1b3b7f['path']+_0x16fd06(0xb3)+_0x16fd06(0xe8);if(!_0x4e315d)throw new Error(_0xf7d8f6);_0x2ad4b8[_0x16fd06(0xab)](_0xf7d8f6);}const _0x51c973=_0x6d7605[_0x16fd06(0xd2)](isCssResource),_0x1e02c3=_0x259c0f['some'](isCssResource);_0x51c973&&!_0x1e02c3&&_0x2ad4b8['push'](_0x16fd06(0xd4)+_0x1b3b7f[_0x16fd06(0xb9)]+_0x16fd06(0xe2)+_0x1b3b7f[_0x16fd06(0xb1)]+').');const _0x59dc63=typeof _0x1b3b7f[_0x16fd06(0xcc)]?.['loadScriptMode']===_0x16fd06(0xde)?_0x1b3b7f['extend'][_0x16fd06(0xa7)]:null,_0x31232c=_0x41faed?{'loadScriptMode':_0x59dc63}:{},_0x1574f3=_0x41faed?{'loadScriptMode':_0x41faed}:{};return{'id':_0x1b3b7f['id'],'label':_0x1b3b7f['label'],'path':_0x1b3b7f[_0x16fd06(0xb1)],'mode':_0x3baf6b,'before':{'resources':_0x6d7605,..._0x31232c},'after':{'resources':_0x259c0f,..._0x1574f3},'warnings':_0x2ad4b8};}function replaceResources(_0x24734d){const _0x1257af=a175_0x288f;return[_0x24734d['jsUrl'],_0x24734d[_0x1257af(0xaf)]][_0x1257af(0xe3)](_0x4ff15d=>!!_0x4ff15d);}function assertUnambiguousPatchResources(_0x3c94c3,_0x1413a6,_0x569d27){const _0x4420ec=a175_0x288f,_0x4207aa=_0x1413a6[_0x4420ec(0xe3)](isJsResource)[_0x4420ec(0xd3)];if(_0x569d27[_0x4420ec(0xc9)]&&_0x4207aa>0x1)throw new Error(_0x4420ec(0xa8)+_0x4207aa+_0x4420ec(0xd5)+_0x3c94c3[_0x4420ec(0xb9)]+_0x4420ec(0xe2)+_0x3c94c3[_0x4420ec(0xb1)]+')\x20'+_0x4420ec(0xca));const _0x2d5e61=_0x1413a6[_0x4420ec(0xe3)](isCssResource)[_0x4420ec(0xd3)];if(_0x569d27[_0x4420ec(0xaf)]&&_0x2d5e61>0x1)throw new Error(_0x4420ec(0xa8)+_0x2d5e61+_0x4420ec(0xb7)+_0x3c94c3[_0x4420ec(0xb9)]+_0x4420ec(0xe2)+_0x3c94c3['path']+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function a175_0x288f(_0x2d01ca,_0x4b7c7d){_0x2d01ca=_0x2d01ca-0xa2;const _0x107d6e=a175_0x107d();let _0x288f19=_0x107d6e[_0x2d01ca];return _0x288f19;}function patchResources(_0x54e522,_0x43593d){const _0x244c60=a175_0x288f;let _0x5867cb=![],_0x345a20=![];const _0xb05852=[];for(const _0x4a1122 of _0x54e522){if(isJsResource(_0x4a1122)){if(_0x43593d['jsUrl']&&!_0x5867cb)_0xb05852['push'](_0x43593d[_0x244c60(0xc9)]),_0x5867cb=!![];else!_0x43593d[_0x244c60(0xc9)]&&_0xb05852[_0x244c60(0xab)](_0x4a1122);continue;}if(isCssResource(_0x4a1122)){if(_0x43593d[_0x244c60(0xaf)]&&!_0x345a20)_0xb05852[_0x244c60(0xab)](_0x43593d[_0x244c60(0xaf)]),_0x345a20=!![];else!_0x43593d[_0x244c60(0xaf)]&&_0xb05852['push'](_0x4a1122);continue;}_0xb05852['push'](_0x4a1122);}return _0x43593d['jsUrl']&&!_0x5867cb&&_0xb05852[_0x244c60(0xb4)](_0x43593d[_0x244c60(0xc9)]),_0x43593d[_0x244c60(0xaf)]&&!_0x345a20&&_0xb05852['push'](_0x43593d[_0x244c60(0xaf)]),_0xb05852;}function isJsResource(_0x2eaa5a){const _0x1847e3=a175_0x288f;return stripQuery(_0x2eaa5a)['toLowerCase']()['endsWith'](_0x1847e3(0xe4));}function isCssResource(_0x216ac2){const _0x14915a=a175_0x288f;return stripQuery(_0x216ac2)[_0x14915a(0xdb)]()[_0x14915a(0xa6)](_0x14915a(0xc6));}function stripQuery(_0x2c9e94){const _0x12210a=a175_0x288f;return _0x2c9e94[_0x12210a(0xd6)]('?')[0x0]??_0x2c9e94;}function parseUpdateParamsFlag(_0x3c9df3){const _0x47cfee=a175_0x288f;if(!_0x3c9df3||typeof _0x3c9df3!==_0x47cfee(0xde))return{};try{const _0x113c54=JSON[_0x47cfee(0xba)](_0x3c9df3);if(typeof _0x113c54!==_0x47cfee(0xaa)||_0x113c54===null||Array[_0x47cfee(0xa4)](_0x113c54))return{};return{'jsUrl':typeof _0x113c54[_0x47cfee(0xc9)]===_0x47cfee(0xde)?_0x113c54[_0x47cfee(0xc9)][_0x47cfee(0xac)]():undefined,'cssUrl':typeof _0x113c54[_0x47cfee(0xaf)]===_0x47cfee(0xde)?_0x113c54[_0x47cfee(0xaf)][_0x47cfee(0xac)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x36e2b9,_0x83c989){const _0x7567c8=a176_0x4d27,_0x8f1228=_0x36e2b9();while(!![]){try{const _0x52ed41=parseInt(_0x7567c8(0x1c6))/0x1*(parseInt(_0x7567c8(0x1cc))/0x2)+-parseInt(_0x7567c8(0x1c0))/0x3+parseInt(_0x7567c8(0x1c8))/0x4+parseInt(_0x7567c8(0x1cb))/0x5+parseInt(_0x7567c8(0x1c5))/0x6+parseInt(_0x7567c8(0x1c7))/0x7*(-parseInt(_0x7567c8(0x1c3))/0x8)+parseInt(_0x7567c8(0x1cd))/0x9;if(_0x52ed41===_0x83c989)break;else _0x8f1228['push'](_0x8f1228['shift']());}catch(_0x2c2240){_0x8f1228['push'](_0x8f1228['shift']());}}}(a176_0x859c,0x74a01));function a176_0x859c(){const _0x3dcb13=['1861380tCGbfu','932oXFiak','7irXfLR','2014272sJeyRS','trim','cancel','4615835PTooSg','208DcZrNQ','1808262XmKZkV','GET','test','2746923OWXQBv','bytes=0-0','body','5131784mFJzzi','HEAD'];a176_0x859c=function(){return _0x3dcb13;};return a176_0x859c();}export function isValidJsHttpsUrl(_0x5c4d81){const _0x3210c9=a176_0x4d27;return/^https:\/\/.+\.js(\?.*)?$/[_0x3210c9(0x1bf)](_0x5c4d81[_0x3210c9(0x1c9)]());}function a176_0x4d27(_0xc060de,_0x294c6a){_0xc060de=_0xc060de-0x1bf;const _0x859c31=a176_0x859c();let _0x4d2750=_0x859c31[_0xc060de];return _0x4d2750;}export function isValidCssHttpsUrl(_0x4bdcf4){const _0x778ae4=a176_0x4d27;return/^https:\/\/.+\.css(\?.*)?$/[_0x778ae4(0x1bf)](_0x4bdcf4[_0x778ae4(0x1c9)]());}export async function isUrlReachable(_0x4102e8){const _0x454d88=a176_0x4d27;try{const _0x19d702=await fetch(_0x4102e8,{'method':_0x454d88(0x1c4)});if(_0x19d702['ok'])return!![];}catch{}try{const _0x10ee84=await fetch(_0x4102e8,{'method':_0x454d88(0x1ce),'headers':{'Range':_0x454d88(0x1c1)}}),_0x1d8890=_0x10ee84['ok'];try{await _0x10ee84[_0x454d88(0x1c2)]?.[_0x454d88(0x1ca)]();}catch{}return _0x1d8890;}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a177_0x25f9da=a177_0x140c;(function(_0x4dfe41,_0x37b60f){const _0xc8badd=a177_0x140c,_0x590d4d=_0x4dfe41();while(!![]){try{const _0x267891=parseInt(_0xc8badd(0x86))/0x1+-parseInt(_0xc8badd(0x8d))/0x2*(parseInt(_0xc8badd(0x95))/0x3)+-parseInt(_0xc8badd(0x89))/0x4+-parseInt(_0xc8badd(0x8e))/0x5*(-parseInt(_0xc8badd(0x92))/0x6)+-parseInt(_0xc8badd(0x84))/0x7*(parseInt(_0xc8badd(0x88))/0x8)+parseInt(_0xc8badd(0x94))/0x9*(-parseInt(_0xc8badd(0x87))/0xa)+-parseInt(_0xc8badd(0x83))/0xb*(-parseInt(_0xc8badd(0x8a))/0xc);if(_0x267891===_0x37b60f)break;else _0x590d4d['push'](_0x590d4d['shift']());}catch(_0x257f1c){_0x590d4d['push'](_0x590d4d['shift']());}}}(a177_0x3ee8,0x835d1));import{getSmartAppRecord}from'../../core/api-client.js';function a177_0x3ee8(){const _0x4acb6a=['read','all','Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','48NSLorg','\x20menu(s)\x20for\x20','36nvpZar','1411173EGkGLi','Inspected\x20','2625865bbLiGW','3080WjFRRC','menu','975683IWhuwL','738680Nfunsy','11296XtWRMB','3382752NKDasL','84FhAwVW','boundMenus','cookie','2wEkqRD','77630XObJJA'];a177_0x3ee8=function(){return _0x4acb6a;};return a177_0x3ee8();}function a177_0x140c(_0x4f1e80,_0x46f4a4){_0x4f1e80=_0x4f1e80-0x82;const _0x3ee8e3=a177_0x3ee8();let _0x140cd5=_0x3ee8e3[_0x4f1e80];return _0x140cd5;}import{getOnlineMenuList}from'../../commands/menu/shared/service.js';import{buildSubappAssetsStatus,getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';export const menuSubappAssetsStatus={'service':a177_0x25f9da(0x85),'command':'subapp-assets-status','description':a177_0x25f9da(0x91),'risk':a177_0x25f9da(0x8f),'strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x2babb9){getSubappSelector(_0x2babb9);},async 'execute'(_0x2aa7f5){const _0x2089ab=a177_0x25f9da,{appCode:_0x30a990,appName:_0x40969a}=getSubappSelector(_0x2aa7f5),[_0x333b59,_0x59f7c9]=await Promise[_0x2089ab(0x90)]([getSmartAppRecord(_0x30a990,_0x2aa7f5['cookie']),getOnlineMenuList(_0x30a990,_0x2aa7f5[_0x2089ab(0x8c)])]),_0xc7ea76={'appCode':_0x30a990,...buildSubappAssetsStatus(_0x333b59,_0x59f7c9,_0x40969a)};return{'ok':!![],'data':_0xc7ea76,'message':_0x2089ab(0x82)+_0xc7ea76[_0x2089ab(0x8b)]+_0x2089ab(0x93)+_0x40969a+'\x20in\x20menu\x20host\x20'+_0x30a990+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a178_0x114fc2=a178_0x2666;(function(_0xb58db1,_0x587c95){const _0x31a9bb=a178_0x2666,_0x254593=_0xb58db1();while(!![]){try{const _0x5c4bf5=parseInt(_0x31a9bb(0xf2))/0x1*(parseInt(_0x31a9bb(0xd5))/0x2)+parseInt(_0x31a9bb(0xc0))/0x3+-parseInt(_0x31a9bb(0xb8))/0x4+parseInt(_0x31a9bb(0xcf))/0x5*(parseInt(_0x31a9bb(0xb9))/0x6)+-parseInt(_0x31a9bb(0xe6))/0x7*(parseInt(_0x31a9bb(0xd2))/0x8)+-parseInt(_0x31a9bb(0xbd))/0x9*(-parseInt(_0x31a9bb(0xb6))/0xa)+-parseInt(_0x31a9bb(0xff))/0xb;if(_0x5c4bf5===_0x587c95)break;else _0x254593['push'](_0x254593['shift']());}catch(_0x1aca98){_0x254593['push'](_0x254593['shift']());}}}(a178_0xd364,0x6e429));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a178_0x114fc2(0xf3),a178_0x114fc2(0xc9),'accessKey',a178_0x114fc2(0xf9),'tenantColumn','enableSample',a178_0x114fc2(0xbb),a178_0x114fc2(0xe9),a178_0x114fc2(0xdd),a178_0x114fc2(0xdb)]);function a178_0xd364(){const _0x923101=['appName','digest','menu','object','assets','string','some',']\x20must\x20be\x20a\x20URL\x20string.','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','sha256','3456574LdngEc','\x20in\x20menu\x20host\x20','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','not\x20HTTPS','validation','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','Would\x20update\x20shared\x20assets\x20for\x20','resources[','10WfPran','map','1030692ZoLbrR','18gCxTLY','test','vipDeploy','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','2494746SsVtbv','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','2169441SYYmZX','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','stringify','update','hex','has','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','apiError','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','enableOpenApi','nextExtend','\x20must\x20be\x20a\x20JSON\x20array.','expected-hash','Unknown\x20app.extend\x20fields:\x20','filter','731625tZCdeR','POST','Updated\x20shared\x20resources\x20for\x20','136MCjVcO','entries','write','852486rbaYdm','app.extend.assets','str','.\x20Refusing\x20update.','verified\x20app.extend','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','directDbEnabled','expectedHash','directDbId','join','\x20contains\x20invalid\x20JSON.','extend','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','appCode','isArray','parse','before','346717JMhEou','length','appPublishStatus','enableAutoSync','subapp-assets-update','app.extend','/smartapi/app/update','trim','size','cookie','resources','unchanged','1uepBpa','skinColor',';\x20independent\x20deployment\x20not\x20verified.'];a178_0xd364=function(){return _0x923101;};return a178_0xd364();}function parseObject(_0x1d703a,_0x5db873){const _0x5c0ec1=a178_0x114fc2;let _0x245f80=_0x1d703a;if(typeof _0x1d703a===_0x5c0ec1(0xfa))try{_0x245f80=JSON[_0x5c0ec1(0xe4)](_0x1d703a);}catch{throw CliErrors[_0x5c0ec1(0xb2)](_0x5db873+_0x5c0ec1(0xdf));}if(!_0x245f80||typeof _0x245f80!==_0x5c0ec1(0xf8)||Array['isArray'](_0x245f80))throw CliErrors[_0x5c0ec1(0xb2)](_0x5db873+'\x20must\x20be\x20a\x20JSON\x20object.');return _0x245f80;}function a178_0x2666(_0x5333da,_0x12f7c1){_0x5333da=_0x5333da-0xb2;const _0xd3649c=a178_0xd364();let _0x2666f5=_0xd3649c[_0x5333da];return _0x2666f5;}function parseArray(_0x21aa2a,_0x54f671){const _0x1bb00a=a178_0x114fc2;let _0x405f16;try{_0x405f16=JSON[_0x1bb00a(0xe4)](_0x21aa2a);}catch{throw CliErrors[_0x1bb00a(0xb2)](_0x54f671+'\x20contains\x20invalid\x20JSON.');}if(!Array['isArray'](_0x405f16))throw CliErrors[_0x1bb00a(0xb2)](_0x54f671+_0x1bb00a(0xcb));return _0x405f16[_0x1bb00a(0xb7)]((_0xc63dd3,_0x15b126)=>parseObject(_0xc63dd3,_0x54f671+'['+_0x15b126+']'));}function validateResources(_0x270339){const _0x37c270=a178_0x114fc2;if(_0x270339[_0x37c270(0xe7)]===0x0)throw CliErrors[_0x37c270(0xb2)](_0x37c270(0xe1));for(const [_0x50e8ba,_0x2f02a8]of _0x270339[_0x37c270(0xd3)]()){if(typeof _0x2f02a8!==_0x37c270(0xfa))throw CliErrors[_0x37c270(0xb2)](_0x37c270(0xb5)+_0x50e8ba+_0x37c270(0xfc));try{if(new URL(_0x2f02a8)['protocol']!=='https:')throw new Error(_0x37c270(0x102));}catch{throw CliErrors['validation'](_0x37c270(0xb5)+_0x50e8ba+']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.');}}if(new Set(_0x270339)[_0x37c270(0xee)]!==_0x270339['length']||!_0x270339[_0x37c270(0xfb)](_0x136f62=>/\.m?js(?:[?#]|$)/i['test'](_0x136f62)))throw CliErrors[_0x37c270(0xb2)]('Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.');return _0x270339;}function prepare(_0x1bce7f,_0x4ad892,_0x5e568c){const _0x211436=a178_0x114fc2;if(!Number['isSafeInteger'](_0x1bce7f['id'])||(_0x1bce7f['id']??0x0)<=0x0||typeof _0x1bce7f['appPublishStatus']!==_0x211436(0xfa)||!_0x1bce7f[_0x211436(0xe8)])throw CliErrors[_0x211436(0xb2)](_0x211436(0xb3));const _0x266cc4=parseObject(_0x1bce7f[_0x211436(0xe0)],_0x211436(0xeb)),_0x5b59cd=Object['keys'](_0x266cc4)[_0x211436(0xce)](_0x447a5f=>!KNOWN_EXTEND_KEYS[_0x211436(0xc5)](_0x447a5f));if(_0x5b59cd['length'])throw CliErrors[_0x211436(0xb2)](_0x211436(0xcd)+_0x5b59cd[_0x211436(0xde)](',\x20')+_0x211436(0xd8));if(typeof _0x266cc4[_0x211436(0xf9)]!==_0x211436(0xfa))throw CliErrors[_0x211436(0xb2)](_0x211436(0xc1));const _0x2f2089=parseArray(_0x266cc4[_0x211436(0xf9)],_0x211436(0xd6)),_0x13e826=_0x2f2089[_0x211436(0xce)](_0x5cdac4=>_0x5cdac4[_0x211436(0xf5)]===_0x4ad892);if(_0x13e826[_0x211436(0xe7)]!==0x1)throw CliErrors[_0x211436(0xb2)](_0x211436(0xbf)+_0x4ad892+';\x20found\x20'+_0x13e826[_0x211436(0xe7)]+'.');const _0x41fa31=_0x13e826[0x0];if(typeof _0x41fa31['resources']!==_0x211436(0xfa))throw CliErrors[_0x211436(0xb2)](_0x211436(0xfd));let _0x2c09e9;try{_0x2c09e9=JSON['parse'](_0x41fa31[_0x211436(0xf0)]);}catch{throw CliErrors[_0x211436(0xb2)](_0x211436(0xbe));}if(!Array[_0x211436(0xe3)](_0x2c09e9)||_0x2c09e9[_0x211436(0xfb)](_0x26cb10=>typeof _0x26cb10!==_0x211436(0xfa)))throw CliErrors[_0x211436(0xb2)](_0x211436(0xc6));const _0x1cbeb5=_0x2f2089[_0x211436(0xb7)](_0x398877=>_0x398877===_0x41fa31?{..._0x398877,'resources':JSON['stringify'](_0x5e568c)}:_0x398877),_0x179737={..._0x266cc4,'assets':JSON[_0x211436(0xc2)](_0x1cbeb5)},_0x161e3f=createHash(_0x211436(0xfe))[_0x211436(0xc3)](JSON['stringify']({'appCode':_0x1bce7f[_0x211436(0xe2)],'id':_0x1bce7f['id'],'appPublishStatus':_0x1bce7f[_0x211436(0xe8)],'extend':_0x266cc4,'appName':_0x4ad892,'resources':_0x5e568c}))[_0x211436(0xf6)](_0x211436(0xc4));return{'before':_0x2c09e9,'nextExtend':_0x179737,'expectedHash':_0x161e3f,'unchanged':isDeepStrictEqual(_0x2c09e9,_0x5e568c)};}function flags(_0x37e35f){const _0x2edfea=a178_0x114fc2,{appCode:_0x3b333e,appName:_0x2706ee}=getSubappSelector(_0x37e35f),_0x4b876a=_0x37e35f[_0x2edfea(0xd7)](_0x2edfea(0xf0))[_0x2edfea(0xed)]();if(!_0x4b876a)throw CliErrors['validation']('--resources\x20is\x20required.');let _0x42e33e;try{_0x42e33e=JSON['parse'](_0x4b876a);}catch{throw CliErrors[_0x2edfea(0xb2)](_0x2edfea(0x101));}if(!Array[_0x2edfea(0xe3)](_0x42e33e))throw CliErrors['validation']('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');return{'appCode':_0x3b333e,'appName':_0x2706ee,'resources':validateResources(_0x42e33e)};}export const menuSubappAssetsUpdate={'service':a178_0x114fc2(0xf7),'command':a178_0x114fc2(0xea),'description':a178_0x114fc2(0xc8),'risk':a178_0x114fc2(0xd4),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a178_0x114fc2(0xf0),'type':'string','required':!![],'description':'JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs'},{'name':a178_0x114fc2(0xcc),'type':'string','description':'Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes'}],async 'validate'(_0x5f54a2){flags(_0x5f54a2);},async 'dryRun'(_0x16d44a){const _0x314494=a178_0x114fc2,{appCode:_0x5554aa,appName:_0x4f67f9,resources:_0x554bfe}=flags(_0x16d44a),_0x1d7885=await getSmartAppRecord(_0x5554aa,_0x16d44a['cookie']),_0x530157=prepare(_0x1d7885,_0x4f67f9,_0x554bfe);return{'method':_0x314494(0xd0),'url':_0x314494(0xec),'body':{'preview':{'appCode':_0x5554aa,'appName':_0x4f67f9,'before':_0x530157[_0x314494(0xe5)],'after':_0x554bfe,'expectedHash':_0x530157[_0x314494(0xdc)],'unchanged':_0x530157[_0x314494(0xf1)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x530157['unchanged']?'Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.':_0x314494(0xb4)+_0x4f67f9+'.'};},async 'execute'(_0xc45570){const _0x39f03d=a178_0x114fc2,{appCode:_0x3f2370,appName:_0x4556a4,resources:_0x1bcb72}=flags(_0xc45570),_0x4de72a=_0xc45570[_0x39f03d(0xd7)](_0x39f03d(0xcc))[_0x39f03d(0xed)]();if(!/^[a-f0-9]{64}$/i[_0x39f03d(0xba)](_0x4de72a))throw CliErrors['validation'](_0x39f03d(0xbc));const _0x86b4e7=await getSmartAppRecord(_0x3f2370,_0xc45570[_0x39f03d(0xef)]),_0x1802ce=prepare(_0x86b4e7,_0x4556a4,_0x1bcb72);if(_0x4de72a!==_0x1802ce[_0x39f03d(0xdc)])throw CliErrors[_0x39f03d(0xb2)]('App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.');if(_0x1802ce[_0x39f03d(0xf1)])return{'ok':!![],'data':{'appCode':_0x3f2370,'appName':_0x4556a4,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x39f03d(0xda)};await updateSmartAppRecord({'id':_0x86b4e7['id'],'appCode':_0x3f2370,'appPublishStatus':_0x86b4e7[_0x39f03d(0xe8)],'extend':_0x1802ce['nextExtend']},_0xc45570[_0x39f03d(0xef)]);const _0x110455=await getSmartAppRecord(_0x3f2370,_0xc45570[_0x39f03d(0xef)]),_0x19f46e=parseObject(_0x110455[_0x39f03d(0xe0)],_0x39f03d(0xd9));if(_0x110455['id']!==_0x86b4e7['id']||_0x110455[_0x39f03d(0xe8)]!==_0x86b4e7[_0x39f03d(0xe8)]||!isDeepStrictEqual(_0x19f46e,_0x1802ce[_0x39f03d(0xca)]))throw CliErrors[_0x39f03d(0xc7)]('App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.');return{'ok':!![],'data':{'appCode':_0x3f2370,'appName':_0x4556a4,'updated':!![],'resources':_0x1bcb72,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x39f03d(0xd1)+_0x4556a4+_0x39f03d(0x100)+_0x3f2370+_0x39f03d(0xf4)};}};
|
|
1
|
+
const a178_0x46700a=a178_0x5829;(function(_0x1ab72e,_0x3c32d0){const _0x4b9bee=a178_0x5829,_0x348dfd=_0x1ab72e();while(!![]){try{const _0x37ff04=parseInt(_0x4b9bee(0x16a))/0x1*(parseInt(_0x4b9bee(0x15d))/0x2)+-parseInt(_0x4b9bee(0x17b))/0x3*(parseInt(_0x4b9bee(0x16c))/0x4)+parseInt(_0x4b9bee(0x15b))/0x5+-parseInt(_0x4b9bee(0x168))/0x6+parseInt(_0x4b9bee(0x14f))/0x7+parseInt(_0x4b9bee(0x172))/0x8+parseInt(_0x4b9bee(0x15e))/0x9;if(_0x37ff04===_0x3c32d0)break;else _0x348dfd['push'](_0x348dfd['shift']());}catch(_0xec819e){_0x348dfd['push'](_0x348dfd['shift']());}}}(a178_0x364e,0x2547b));import{createHash}from'node:crypto';function a178_0x5829(_0x350cb2,_0xa1407d){_0x350cb2=_0x350cb2-0x135;const _0x364e5c=a178_0x364e();let _0x582980=_0x364e5c[_0x350cb2];return _0x582980;}function a178_0x364e(){const _0x12230e=['appCode','671972OnWKhM','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','expectedHash','extend','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','before','apiError','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','\x20must\x20be\x20a\x20JSON\x20object.','object','directDbEnabled','test','41290LcRGVy','str','119046aezhiT','1345149ZWKkDb','string','resources[','keys','menu','skinColor','not\x20HTTPS','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','POST','app.extend.assets','808962maghgJ','some','1KXFOtc','filter','17444ZWrCgC','accessKey','appPublishStatus','parse','/smartapi/app/update','stringify','1957360VQlXjg','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','directDbId','cookie','hex','map','update','https:','protocol','186nGfmXP','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','isArray','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','subapp-assets-update','digest','Updated\x20shared\x20resources\x20for\x20','enableSample','resources','length','isSafeInteger','assets',']\x20must\x20be\x20a\x20URL\x20string.','.\x20Refusing\x20update.','join','enableOpenApi',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','vipDeploy','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','unchanged','validation',';\x20found\x20','expected-hash','trim','tenantColumn'];a178_0x364e=function(){return _0x12230e;};return a178_0x364e();}import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a178_0x46700a(0x163),a178_0x46700a(0x143),a178_0x46700a(0x16d),a178_0x46700a(0x13f),a178_0x46700a(0x14d),a178_0x46700a(0x13b),a178_0x46700a(0x146),'enableAutoSync',a178_0x46700a(0x174),a178_0x46700a(0x159)]);function parseObject(_0x35f6e7,_0x3c14c2){const _0x58c1bf=a178_0x46700a;let _0x4d7460=_0x35f6e7;if(typeof _0x35f6e7===_0x58c1bf(0x15f))try{_0x4d7460=JSON[_0x58c1bf(0x16f)](_0x35f6e7);}catch{throw CliErrors[_0x58c1bf(0x149)](_0x3c14c2+'\x20contains\x20invalid\x20JSON.');}if(!_0x4d7460||typeof _0x4d7460!==_0x58c1bf(0x158)||Array[_0x58c1bf(0x136)](_0x4d7460))throw CliErrors[_0x58c1bf(0x149)](_0x3c14c2+_0x58c1bf(0x157));return _0x4d7460;}function parseArray(_0x273cd2,_0x326d5b){const _0x52144d=a178_0x46700a;let _0x4f32e1;try{_0x4f32e1=JSON['parse'](_0x273cd2);}catch{throw CliErrors[_0x52144d(0x149)](_0x326d5b+'\x20contains\x20invalid\x20JSON.');}if(!Array[_0x52144d(0x136)](_0x4f32e1))throw CliErrors['validation'](_0x326d5b+'\x20must\x20be\x20a\x20JSON\x20array.');return _0x4f32e1[_0x52144d(0x177)]((_0x384a15,_0x37a2d8)=>parseObject(_0x384a15,_0x326d5b+'['+_0x37a2d8+']'));}function validateResources(_0x49a978){const _0x31c291=a178_0x46700a;if(_0x49a978[_0x31c291(0x13d)]===0x0)throw CliErrors[_0x31c291(0x149)](_0x31c291(0x173));for(const [_0x1630a0,_0x58bd58]of _0x49a978['entries']()){if(typeof _0x58bd58!==_0x31c291(0x15f))throw CliErrors[_0x31c291(0x149)](_0x31c291(0x160)+_0x1630a0+_0x31c291(0x140));try{if(new URL(_0x58bd58)[_0x31c291(0x17a)]!==_0x31c291(0x179))throw new Error(_0x31c291(0x164));}catch{throw CliErrors[_0x31c291(0x149)](_0x31c291(0x160)+_0x1630a0+_0x31c291(0x144));}}if(new Set(_0x49a978)['size']!==_0x49a978[_0x31c291(0x13d)]||!_0x49a978[_0x31c291(0x169)](_0x4a4eff=>/\.m?js(?:[?#]|$)/i[_0x31c291(0x15a)](_0x4a4eff)))throw CliErrors['validation']('Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.');return _0x49a978;}function prepare(_0x2212df,_0xdca596,_0x2dc922){const _0x5b6b6e=a178_0x46700a;if(!Number[_0x5b6b6e(0x13e)](_0x2212df['id'])||(_0x2212df['id']??0x0)<=0x0||typeof _0x2212df[_0x5b6b6e(0x16e)]!==_0x5b6b6e(0x15f)||!_0x2212df[_0x5b6b6e(0x16e)])throw CliErrors[_0x5b6b6e(0x149)](_0x5b6b6e(0x153));const _0x4bf997=parseObject(_0x2212df[_0x5b6b6e(0x152)],'app.extend'),_0x417ea8=Object[_0x5b6b6e(0x161)](_0x4bf997)[_0x5b6b6e(0x16b)](_0x3f0394=>!KNOWN_EXTEND_KEYS['has'](_0x3f0394));if(_0x417ea8[_0x5b6b6e(0x13d)])throw CliErrors['validation']('Unknown\x20app.extend\x20fields:\x20'+_0x417ea8[_0x5b6b6e(0x142)](',\x20')+_0x5b6b6e(0x141));if(typeof _0x4bf997['assets']!==_0x5b6b6e(0x15f))throw CliErrors[_0x5b6b6e(0x149)](_0x5b6b6e(0x150));const _0x4ffd52=parseArray(_0x4bf997[_0x5b6b6e(0x13f)],_0x5b6b6e(0x167)),_0x5e9ed1=_0x4ffd52['filter'](_0x4015e3=>_0x4015e3['appName']===_0xdca596);if(_0x5e9ed1[_0x5b6b6e(0x13d)]!==0x1)throw CliErrors[_0x5b6b6e(0x149)]('Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20'+_0xdca596+_0x5b6b6e(0x14a)+_0x5e9ed1['length']+'.');const _0x1d978d=_0x5e9ed1[0x0];if(typeof _0x1d978d['resources']!==_0x5b6b6e(0x15f))throw CliErrors[_0x5b6b6e(0x149)](_0x5b6b6e(0x147));let _0x598ede;try{_0x598ede=JSON[_0x5b6b6e(0x16f)](_0x1d978d['resources']);}catch{throw CliErrors[_0x5b6b6e(0x149)](_0x5b6b6e(0x145));}if(!Array['isArray'](_0x598ede)||_0x598ede['some'](_0x5add4d=>typeof _0x5add4d!=='string'))throw CliErrors[_0x5b6b6e(0x149)]('Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.');const _0x297916=_0x4ffd52[_0x5b6b6e(0x177)](_0x2a915c=>_0x2a915c===_0x1d978d?{..._0x2a915c,'resources':JSON[_0x5b6b6e(0x171)](_0x2dc922)}:_0x2a915c),_0x561d5c={..._0x4bf997,'assets':JSON[_0x5b6b6e(0x171)](_0x297916)},_0x2cd725=createHash('sha256')[_0x5b6b6e(0x178)](JSON[_0x5b6b6e(0x171)]({'appCode':_0x2212df[_0x5b6b6e(0x14e)],'id':_0x2212df['id'],'appPublishStatus':_0x2212df[_0x5b6b6e(0x16e)],'extend':_0x4bf997,'appName':_0xdca596,'resources':_0x2dc922}))[_0x5b6b6e(0x139)](_0x5b6b6e(0x176));return{'before':_0x598ede,'nextExtend':_0x561d5c,'expectedHash':_0x2cd725,'unchanged':isDeepStrictEqual(_0x598ede,_0x2dc922)};}function flags(_0x267744){const _0x98bfa5=a178_0x46700a,{appCode:_0x23e8e1,appName:_0x22a98d}=getSubappSelector(_0x267744),_0x3fc16d=_0x267744['str'](_0x98bfa5(0x13c))[_0x98bfa5(0x14c)]();if(!_0x3fc16d)throw CliErrors[_0x98bfa5(0x149)]('--resources\x20is\x20required.');let _0x50f36f;try{_0x50f36f=JSON[_0x98bfa5(0x16f)](_0x3fc16d);}catch{throw CliErrors[_0x98bfa5(0x149)]('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');}if(!Array[_0x98bfa5(0x136)](_0x50f36f))throw CliErrors[_0x98bfa5(0x149)](_0x98bfa5(0x135));return{'appCode':_0x23e8e1,'appName':_0x22a98d,'resources':validateResources(_0x50f36f)};}export const menuSubappAssetsUpdate={'service':a178_0x46700a(0x162),'command':a178_0x46700a(0x138),'description':a178_0x46700a(0x165),'risk':'write','strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a178_0x46700a(0x13c),'type':a178_0x46700a(0x15f),'required':!![],'description':a178_0x46700a(0x137)},{'name':a178_0x46700a(0x14b),'type':a178_0x46700a(0x15f),'description':'Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes'}],async 'validate'(_0x590f9){flags(_0x590f9);},async 'dryRun'(_0x137b93){const _0x214fc6=a178_0x46700a,{appCode:_0x1bfb05,appName:_0x1d9038,resources:_0x34b746}=flags(_0x137b93),_0x229013=await getSmartAppRecord(_0x1bfb05,_0x137b93[_0x214fc6(0x175)]),_0x4780e7=prepare(_0x229013,_0x1d9038,_0x34b746);return{'method':_0x214fc6(0x166),'url':_0x214fc6(0x170),'body':{'preview':{'appCode':_0x1bfb05,'appName':_0x1d9038,'before':_0x4780e7[_0x214fc6(0x154)],'after':_0x34b746,'expectedHash':_0x4780e7[_0x214fc6(0x151)],'unchanged':_0x4780e7[_0x214fc6(0x148)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x4780e7['unchanged']?_0x214fc6(0x17d):'Would\x20update\x20shared\x20assets\x20for\x20'+_0x1d9038+'.'};},async 'execute'(_0x10b1b0){const _0x524b9b=a178_0x46700a,{appCode:_0x3a727e,appName:_0x477c01,resources:_0x233548}=flags(_0x10b1b0),_0x2af4ee=_0x10b1b0[_0x524b9b(0x15c)](_0x524b9b(0x14b))[_0x524b9b(0x14c)]();if(!/^[a-f0-9]{64}$/i['test'](_0x2af4ee))throw CliErrors[_0x524b9b(0x149)](_0x524b9b(0x17c));const _0x399149=await getSmartAppRecord(_0x3a727e,_0x10b1b0[_0x524b9b(0x175)]),_0x4a3c14=prepare(_0x399149,_0x477c01,_0x233548);if(_0x2af4ee!==_0x4a3c14[_0x524b9b(0x151)])throw CliErrors[_0x524b9b(0x149)]('App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.');if(_0x4a3c14[_0x524b9b(0x148)])return{'ok':!![],'data':{'appCode':_0x3a727e,'appName':_0x477c01,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x524b9b(0x156)};await updateSmartAppRecord({'id':_0x399149['id'],'appCode':_0x3a727e,'appPublishStatus':_0x399149[_0x524b9b(0x16e)],'extend':_0x4a3c14['nextExtend']},_0x10b1b0[_0x524b9b(0x175)]);const _0x247546=await getSmartAppRecord(_0x3a727e,_0x10b1b0[_0x524b9b(0x175)]),_0x2b8253=parseObject(_0x247546[_0x524b9b(0x152)],'verified\x20app.extend');if(_0x247546['id']!==_0x399149['id']||_0x247546[_0x524b9b(0x16e)]!==_0x399149[_0x524b9b(0x16e)]||!isDeepStrictEqual(_0x2b8253,_0x4a3c14['nextExtend']))throw CliErrors[_0x524b9b(0x155)]('App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.');return{'ok':!![],'data':{'appCode':_0x3a727e,'appName':_0x477c01,'updated':!![],'resources':_0x233548,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x524b9b(0x13a)+_0x477c01+'\x20in\x20menu\x20host\x20'+_0x3a727e+';\x20independent\x20deployment\x20not\x20verified.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a179_0x4c767d=a179_0x4705;function a179_0x2dd7(){const _0x206385=['appCode','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','\x20failed.','7NmTbCA','\x20\x20✓\x20Selected:\x20','flag','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','Online\x20menu\x20list\x20fetched','1525725qUzfIy','appcode','filter','appName','split','\x20\x20Cancelled.','localPages','\x20menu(s)...','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','POST','177432oIsjyT','targetPages','3229czIaIR','gray','\x20and\x20CSS:\x20','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','created','\x20local\x20microfrontend\x20menu(s).','232557ayWVyL','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','params','16GSDWbi','jsUrl','cyan','cookie','/smartapi/menu/create','JSON:\x20{\x22appName\x22:\x22store-app\x22,\x22parentId\x22:42,\x22visible\x22:false};\x20jsUrl\x20and\x20cssUrl\x20remain\x20available\x20for\x20individual\x20menu\x20resources.','cssUrl','8QDLjlw','string','Menu\x20sync\x20skipped','map','size','validation','Tip:\x20For\x20frontend\x20subapps,\x20prefer\x20Agent-planned\x20menu\x20groups\x20and\x20shared\x20resources.\x20This\x20manual\x20sync\x20workflow\x20remains\x20available\x20as\x20a\x20fallback.','paths','failed','Menu\x20sync\x20completed:\x20','message','40jRfzIj','onlineMenuList','Register\x20local\x20pages\x20as\x20platform\x20menus','996UdhvUj','rawFlags','\x20page(s)','Menu\x20creation\x20failed','4773802vKDQPV','trim','5560146fqJlSz','Fetching\x20online\x20menu\x20list...','selectedAppName','Failed\x20to\x20fetch\x20online\x20menu\x20list','9781788ZisUKV','length','\x20created.','\x20\x20Create\x20','\x20menu(s)\x20created','skipped','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','str','\x20menu(s)','write','9gffGgs','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.'];a179_0x2dd7=function(){return _0x206385;};return a179_0x2dd7();}(function(_0x90f871,_0x2b6b78){const _0x23cbc5=a179_0x4705,_0x548b28=_0x90f871();while(!![]){try{const _0x5eda66=-parseInt(_0x23cbc5(0x165))/0x1*(-parseInt(_0x23cbc5(0x16e))/0x2)+parseInt(_0x23cbc5(0x197))/0x3*(-parseInt(_0x23cbc5(0x163))/0x4)+parseInt(_0x23cbc5(0x159))/0x5+-parseInt(_0x23cbc5(0x18d))/0x6*(-parseInt(_0x23cbc5(0x19c))/0x7)+-parseInt(_0x23cbc5(0x175))/0x8*(parseInt(_0x23cbc5(0x189))/0x9)+-parseInt(_0x23cbc5(0x180))/0xa*(parseInt(_0x23cbc5(0x187))/0xb)+parseInt(_0x23cbc5(0x183))/0xc*(parseInt(_0x23cbc5(0x16b))/0xd);if(_0x5eda66===_0x2b6b78)break;else _0x548b28['push'](_0x548b28['shift']());}catch(_0x251bf2){_0x548b28['push'](_0x548b28['shift']());}}}(a179_0x2dd7,0xea322));import a179_0x2dd919 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,resolvePage,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';function a179_0x4705(_0x554da9,_0x7dffb6){_0x554da9=_0x554da9-0x156;const _0x2dd712=a179_0x2dd7();let _0x470518=_0x2dd712[_0x554da9];return _0x470518;}import{isInProject}from'../../context.js';import{assertSharedResourcesConfigured}from'../../commands/menu/shared/subapp-assets.js';export const menuSync={'service':'menu','command':'sync','description':a179_0x4c767d(0x182),'risk':a179_0x4c767d(0x196),'flags':[{'name':a179_0x4c767d(0x16d),'type':a179_0x4c767d(0x176),'description':'Prefer\x20appName\x20for\x20shared\x20subapp\x20resources\x20and\x20parentId\x20for\x20planned\x20groups.\x20'+a179_0x4c767d(0x173)},{'name':a179_0x4c767d(0x17c),'type':a179_0x4c767d(0x176),'description':'Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync'},{'name':'yes','type':'boolean','description':a179_0x4c767d(0x19a)}],async 'dryRun'(_0x2ed446){const _0x2dab52=a179_0x4c767d;ensureRunnableContext(_0x2ed446[_0x2dab52(0x184)],_0x2ed446[_0x2dab52(0x18b)]);const _0x1b6589=await runMenuSyncCore(_0x2ed446[_0x2dab52(0x199)],_0x2ed446[_0x2dab52(0x171)],parsePaths(_0x2ed446[_0x2dab52(0x194)](_0x2dab52(0x17c))),_0x2ed446[_0x2dab52(0x194)](_0x2dab52(0x16d)),{'dryRun':!![]});return{'method':_0x2dab52(0x162),'url':_0x2dab52(0x172),'body':_0x1b6589,'description':_0x1b6589[_0x2dab52(0x192)]?_0x2dab52(0x161):'Would\x20create\x20'+_0x1b6589[_0x2dab52(0x164)][_0x2dab52(0x18e)]+_0x2dab52(0x16a)};},async 'execute'(_0x3933ec){const _0xfb56d7=a179_0x4c767d;ensureRunnableContext(_0x3933ec[_0xfb56d7(0x184)],_0x3933ec[_0xfb56d7(0x18b)]);const _0x299fc6=_0x3933ec[_0xfb56d7(0x156)]('yes'),_0x1bbcd4=_0x3933ec[_0xfb56d7(0x194)]('params'),_0x2e7adb=parsePaths(_0x3933ec['str'](_0xfb56d7(0x17c))),_0x144b34=parseMenuSyncParams(_0x1bbcd4);if(_0x299fc6){const _0x1a3704=await runMenuSyncCore(_0x3933ec[_0xfb56d7(0x199)],_0x3933ec['cookie'],_0x2e7adb,_0x1bbcd4);if(_0x1a3704[_0xfb56d7(0x192)]){const _0x31a46c=getLocalPages();_0x31a46c[_0xfb56d7(0x18e)]===0x0?writeCliSideChannelLine(_0xfb56d7(0x16c)):writeCliSideChannelLine(_0xfb56d7(0x157));}else writeCliSideChannelLine('✓\x20Menu\x20sync\x20completed:\x20'+_0x1a3704[_0xfb56d7(0x169)]+_0xfb56d7(0x191));return{'ok':!![],'data':_0x1a3704,'message':_0x1a3704[_0xfb56d7(0x192)]?_0xfb56d7(0x177):_0xfb56d7(0x17e)+_0x1a3704[_0xfb56d7(0x169)]+_0xfb56d7(0x18f)};}if(_0x2e7adb['length']>0x0)throw CliErrors[_0xfb56d7(0x17a)](_0xfb56d7(0x198),_0xfb56d7(0x168));if(!isInteractive()&&_0x1bbcd4)throw CliErrors[_0xfb56d7(0x17a)](_0xfb56d7(0x193),_0xfb56d7(0x168));requireInteractive(),writeCliSideChannelLine(_0xfb56d7(0x17b));const _0x35703c=startSpinner(_0xfb56d7(0x18a));let _0x20db9f,_0x29a3d1,_0x420ffa;try{const _0x5e5bfe=await fetchMenuData(_0x3933ec[_0xfb56d7(0x199)],_0x3933ec[_0xfb56d7(0x171)]);_0x20db9f=_0x5e5bfe[_0xfb56d7(0x15f)],_0x29a3d1=_0x5e5bfe['onlinePaths'],_0x420ffa=_0x5e5bfe[_0xfb56d7(0x181)],stopSpinner(_0x35703c,_0xfb56d7(0x158),!![]);}catch(_0x2be598){stopSpinner(_0x35703c,'Failed\x20to\x20fetch\x20online\x20menu\x20list',![]);throw CliErrors[_0xfb56d7(0x17a)](_0x2be598 instanceof Error?_0x2be598[_0xfb56d7(0x17f)]:_0xfb56d7(0x18c));}if(_0x20db9f[_0xfb56d7(0x18e)]===0x0)return writeCliSideChannelLine(a179_0x2dd919['yellow']('\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first')),{'ok':!![]};const _0x12660f=buildCompareRows(_0x20db9f,_0x29a3d1);writeCliSideChannelLine(renderCompareTable(_0x12660f)),writeCliSideChannelLine('');const _0x3813e8=await selectPages(_0x20db9f,_0x29a3d1);writeCliSideChannelLine(''),writeCliSideChannelLine(a179_0x2dd919[_0xfb56d7(0x170)](_0xfb56d7(0x19d)+_0x3813e8[_0xfb56d7(0x18e)]+_0xfb56d7(0x185)));const _0x9e3a2b=_0x144b34[_0xfb56d7(0x16f)]&&_0x144b34[_0xfb56d7(0x174)];if(!_0x9e3a2b){writeCliSideChannelLine(renderSyncSummary(_0x3813e8,_0x29a3d1[_0xfb56d7(0x179)]>0x0));const _0x3e85ba=await askConfirm('\x20\x20Continue\x20with\x20creation?');if(!_0x3e85ba)return writeCliSideChannelLine(a179_0x2dd919[_0xfb56d7(0x166)](_0xfb56d7(0x15e))),{'ok':!![]};}let _0x59004b=_0x144b34[_0xfb56d7(0x16f)],_0x26eb07=_0x144b34['cssUrl'];!_0x59004b&&!_0x144b34[_0xfb56d7(0x15c)]&&(_0x59004b=await askJsUrl());!_0x26eb07&&!_0x144b34['appName']&&(_0x26eb07=await askCssUrl());const _0x253c6c=await askConfirm(_0x144b34[_0xfb56d7(0x15c)]?_0xfb56d7(0x190)+_0x3813e8[_0xfb56d7(0x18e)]+'\x20menu(s)\x20bound\x20to\x20'+_0x144b34[_0xfb56d7(0x15c)]+'?':_0xfb56d7(0x190)+_0x3813e8[_0xfb56d7(0x18e)]+'\x20menu(s)\x20with\x20JS:\x20'+_0x59004b+_0xfb56d7(0x167)+_0x26eb07+'?');if(!_0x253c6c)return writeCliSideChannelLine(a179_0x2dd919[_0xfb56d7(0x166)](_0xfb56d7(0x15e))),{'ok':!![]};const _0x8ebaf0=[_0x59004b,_0x26eb07]['filter'](_0x1b2693=>Boolean(_0x1b2693));_0x144b34['appName']&&_0x8ebaf0[_0xfb56d7(0x18e)]===0x0&&await assertSharedResourcesConfigured(_0x3933ec[_0xfb56d7(0x199)],_0x3933ec['cookie'],_0x144b34[_0xfb56d7(0x15c)]);const _0x19cb42=startSpinner('Creating\x20'+_0x3813e8[_0xfb56d7(0x18e)]+_0xfb56d7(0x160));try{const _0x40907d=_0x3813e8[_0xfb56d7(0x178)](_0x5e2dd8=>resolvePage(_0x5e2dd8,_0x144b34,_0x420ffa)),_0x148e2e=await doCreateMenus(_0x3933ec[_0xfb56d7(0x199)],_0x3933ec[_0xfb56d7(0x171)],_0x40907d,_0x8ebaf0,_0x144b34['appName']?{'appName':_0x144b34[_0xfb56d7(0x15c)]}:undefined);return stopSpinner(_0x19cb42,'Created\x20'+_0x148e2e['created']+_0xfb56d7(0x195),!![]),{'ok':!![],'data':_0x148e2e,'message':'Menu\x20sync\x20completed:\x20'+_0x148e2e[_0xfb56d7(0x169)]+'\x20created,\x20'+_0x148e2e[_0xfb56d7(0x17d)]+_0xfb56d7(0x19b)};}catch(_0x596c5f){stopSpinner(_0x19cb42,_0xfb56d7(0x186),![]);throw CliErrors['validation'](_0x596c5f instanceof Error?_0x596c5f[_0xfb56d7(0x17f)]:_0xfb56d7(0x186));}}};function ensureRunnableContext(_0x1184db,_0x268275){const _0x5c00da=a179_0x4c767d,_0x1fba04=_0x1184db[_0x5c00da(0x15a)]?String(_0x1184db[_0x5c00da(0x15a)])['trim']():'';if(!isInProject()&&!_0x268275&&!_0x1fba04)throw CliErrors[_0x5c00da(0x17a)]('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(_0x1f7bf7){const _0x34ebb6=a179_0x4c767d;return[...new Set(_0x1f7bf7[_0x34ebb6(0x15d)](',')[_0x34ebb6(0x178)](_0x2a3a74=>_0x2a3a74[_0x34ebb6(0x188)]())[_0x34ebb6(0x15b)](Boolean))];}
|