@lovrabet/rabetbase-cli 2.5.5-beta.2 → 2.5.5-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/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 +3 -3
- package/skills/rabetbase/guides/independent-deployment.md +11 -1
- package/skills/rabetbase/references/rabetbase-config.md +16 -19
- package/skills/rabetbase/references/rabetbase-menu-visibility-update.md +5 -4
- package/skills/rabetbase/references/rabetbase-workspace.md +3 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a169_0x395969=a169_0x1eab;(function(_0x58f2a4,_0x5b94ee){const _0x244cd0=a169_0x1eab,_0x695d87=_0x58f2a4();while(!![]){try{const _0x923d0f=parseInt(_0x244cd0(0x192))/0x1*(parseInt(_0x244cd0(0x194))/0x2)+-parseInt(_0x244cd0(0x1ba))/0x3*(-parseInt(_0x244cd0(0x1e1))/0x4)+-parseInt(_0x244cd0(0x19c))/0x5+parseInt(_0x244cd0(0x18a))/0x6*(-parseInt(_0x244cd0(0x1cc))/0x7)+parseInt(_0x244cd0(0x1c2))/0x8+-parseInt(_0x244cd0(0x1d1))/0x9+parseInt(_0x244cd0(0x1c0))/0xa;if(_0x923d0f===_0x5b94ee)break;else _0x695d87['push'](_0x695d87['shift']());}catch(_0x141406){_0x695d87['push'](_0x695d87['shift']());}}}(a169_0x4356,0x5e4b7));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':a169_0x395969(0x198),'required':!![],'description':a169_0x395969(0x1c8)};export const MENU_SORT_FLAG={'name':a169_0x395969(0x1cd),'type':a169_0x395969(0x198),'description':a169_0x395969(0x1d3)};export const MENU_PARENT_ID_FLAG={'name':a169_0x395969(0x1c3),'type':'string','description':a169_0x395969(0x1f4)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a169_0x395969(0x1ec),'type':a169_0x395969(0x1db),'description':a169_0x395969(0x1be)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a169_0x395969(0x1e7),'type':a169_0x395969(0x1db),'description':a169_0x395969(0x1ef)},{'name':'expected-children-count','type':a169_0x395969(0x198),'description':a169_0x395969(0x1e8)}];function a169_0x1eab(_0x4879de,_0x4a724b){_0x4879de=_0x4879de-0x186;const _0x435682=a169_0x4356();let _0x1eabbd=_0x435682[_0x4879de];return _0x1eabbd;}export function validateExactId(_0x5aef6f){const _0x5e6d3b=a169_0x395969,_0x3d8ff0=_0x5aef6f['num']('id');if(!Number[_0x5e6d3b(0x1f2)](_0x3d8ff0)||_0x3d8ff0<=0x0)throw CliErrors[_0x5e6d3b(0x1a6)](_0x5e6d3b(0x1ee));return _0x3d8ff0;}export function validateSort(_0x305773,_0x2b2193=a169_0x395969(0x1cd)){const _0x4061af=a169_0x395969;if(!hasFlag(_0x305773,_0x2b2193))return undefined;const _0x577517=_0x305773[_0x4061af(0x1b1)](_0x2b2193);if(!Number[_0x4061af(0x1f2)](_0x577517)||_0x577517<0x0||_0x577517>MAX_MENU_SORT)throw menuError(_0x4061af(0x1d4),'--'+_0x2b2193+_0x4061af(0x1e0)+MAX_MENU_SORT+'.',_0x4061af(0x1a2));return _0x577517;}export function nextSiblingSort(_0x2ec4b6,_0x38093c,_0x5b6a84){const _0x3f5ab1=a169_0x395969,_0x3884f4=getChildren(_0x2ec4b6,_0x38093c)[_0x3f5ab1(0x1a5)](_0x161ceb=>_0x161ceb[_0x3f5ab1(0x1cd)])['filter'](_0x2b745e=>typeof _0x2b745e===_0x3f5ab1(0x198));if(_0x3884f4[_0x3f5ab1(0x1a1)]===0x0)return 0x0;const _0x5c497a=Math[_0x3f5ab1(0x1f0)](..._0x3884f4);if(_0x5c497a>=MAX_MENU_SORT)throw menuError(_0x3f5ab1(0x1bb),_0x3f5ab1(0x1d0)+_0x5b6a84+_0x3f5ab1(0x199)+_0x5c497a+'.',_0x3f5ab1(0x1d6)+MAX_MENU_SORT+_0x3f5ab1(0x1e9));return _0x5c497a+0x1;}export function requireExplicitYes(_0x402a76){const _0x55605a=a169_0x395969;if(_0x402a76['bool']('dry-run'))return;if(!_0x402a76[_0x55605a(0x18e)](_0x55605a(0x1a9)))throw menuError(_0x55605a(0x18f),_0x55605a(0x1b8),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0x34728b,_0x5d8f64,_0x5c5ffc){const _0x1b7715=a169_0x395969;try{return await fetchMenuSnapshot(_0x34728b['appCode'],_0x34728b[_0x1b7715(0x1f3)]);}catch(_0xb8d07d){throw mapMenuApiError(_0xb8d07d,_0x1b7715(0x189)+_0x5d8f64,_0x5c5ffc);}}export async function recheckMutationSnapshot(_0x1b8d90,_0x497db1,_0x50ecaa,_0x5c6cc0){const _0x18c8be=a169_0x395969;let _0x3f900d;try{_0x3f900d=await fetchMenuSnapshot(_0x1b8d90['appCode'],_0x1b8d90[_0x18c8be(0x1f3)]);}catch(_0x135d78){const _0x4b551e=mapMenuApiError(_0x135d78,_0x18c8be(0x1c9)+_0x50ecaa,_0x5c6cc0);throw menuFailure(_0x4b551e,_0x497db1,{'stage':_0x18c8be(0x1ab),'failed':_0x5c6cc0==null?{}:{'id':_0x5c6cc0}});}if(_0x3f900d[_0x18c8be(0x19d)]!==_0x497db1[_0x18c8be(0x1d7)]){const _0x284754=menuError(_0x18c8be(0x1e3),_0x18c8be(0x1ae)+_0x50ecaa+_0x18c8be(0x1c4),_0x18c8be(0x1ca));throw menuFailure(_0x284754,_0x497db1,{'stage':_0x18c8be(0x1ab),'failed':{..._0x5c6cc0==null?{}:{'id':_0x5c6cc0},'expectedSnapshotHash':_0x497db1[_0x18c8be(0x1d7)],'currentSnapshotHash':_0x3f900d[_0x18c8be(0x19d)]}});}return _0x3f900d;}export function parseParentId(_0xb6d708,_0x1e99c1,_0x8b2a31={}){const _0x2e4312=a169_0x395969;if(!hasFlag(_0xb6d708,_0x1e99c1)){if(_0x8b2a31['required'])throw CliErrors['flagMissing'](_0x1e99c1);return undefined;}const _0x2243f6=_0xb6d708[_0x2e4312(0x1ea)](_0x1e99c1)[_0x2e4312(0x1b4)]();if(_0x2243f6[_0x2e4312(0x1c7)]()==='root')return null;if(!/^\d+$/['test'](_0x2243f6))throw CliErrors['validation']('--'+_0x1e99c1+_0x2e4312(0x1bc));const _0x26a11e=Number(_0x2243f6);if(!Number[_0x2e4312(0x1f2)](_0x26a11e)||_0x26a11e<=0x0)throw CliErrors[_0x2e4312(0x1a6)]('--'+_0x1e99c1+_0x2e4312(0x1bc));return _0x26a11e;}export function requireMenu(_0x43d54b,_0x480709){const _0x5e639e=a169_0x395969,_0x1b05c0=_0x43d54b['byId'][_0x5e639e(0x1de)](_0x480709);if(!_0x1b05c0)throw menuError(_0x5e639e(0x1d2),_0x5e639e(0x1cb)+_0x480709,_0x5e639e(0x1d5));return _0x1b05c0;}export function requireFolder(_0x365235,_0x163ec1){const _0x5e1b5b=a169_0x395969,_0x787f6a=requireMenu(_0x365235,_0x163ec1);if(_0x787f6a[_0x5e1b5b(0x188)]!==_0x5e1b5b(0x1f5))throw menuError(_0x5e1b5b(0x1b0),_0x5e1b5b(0x1eb)+_0x163ec1+_0x5e1b5b(0x1dd)+(_0x787f6a[_0x5e1b5b(0x188)]||_0x5e1b5b(0x1a8))+_0x5e1b5b(0x1b7),'Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.');return _0x787f6a;}export function assertExpectedState(_0x24a857,_0xf2aa49){const _0x2c1778=a169_0x395969;if(hasFlag(_0x24a857,_0x2c1778(0x1ec))){const _0x3efee2=parseParentId(_0x24a857,_0x2c1778(0x1ec),{'required':!![]});if(_0xf2aa49[_0x2c1778(0x19e)]!==_0x3efee2)throw stateDrift('Menu\x20'+_0xf2aa49['id']+_0x2c1778(0x187)+formatParent(_0x3efee2)+_0x2c1778(0x1c1)+formatParent(_0xf2aa49[_0x2c1778(0x19e)])+'.');}if(hasFlag(_0x24a857,'expect-path')){const _0xf73add=_0x24a857['str'](_0x2c1778(0x1e7));if(_0xf2aa49[_0x2c1778(0x1a4)]!==_0xf73add)throw stateDrift(_0x2c1778(0x1eb)+_0xf2aa49['id']+_0x2c1778(0x1b2)+JSON[_0x2c1778(0x197)](_0xf73add)+',\x20current\x20'+JSON[_0x2c1778(0x197)](_0xf2aa49[_0x2c1778(0x1a4)])+'.');}if(hasFlag(_0x24a857,_0x2c1778(0x1ad))){const _0x4d10c8=_0x24a857['num'](_0x2c1778(0x1ad));if(!Number[_0x2c1778(0x1f2)](_0x4d10c8)||_0x4d10c8<0x0)throw CliErrors[_0x2c1778(0x1a6)](_0x2c1778(0x1e5));if(_0xf2aa49[_0x2c1778(0x1bd)]!==_0x4d10c8)throw stateDrift(_0x2c1778(0x1eb)+_0xf2aa49['id']+_0x2c1778(0x1bf)+_0x4d10c8+_0x2c1778(0x1c1)+_0xf2aa49[_0x2c1778(0x1bd)]+'.');}}export function assertVerified(_0x557067,_0x186054,_0x365537=a169_0x395969(0x1da)){const _0x246fb6=a169_0x395969;if(!_0x557067)throw menuError(_0x246fb6(0x1e2),_0x186054,_0x365537);}export function mutationResult(_0x34aae0){const _0x3306cb=a169_0x395969;return{'operation':_0x34aae0['operation'],'selector':_0x34aae0[_0x3306cb(0x1e4)],'before':_0x34aae0['before'],'after':_0x34aae0['after'],'dryRun':_0x34aae0[_0x3306cb(0x193)],'backend':_0x34aae0[_0x3306cb(0x1c5)],..._0x34aae0[_0x3306cb(0x191)]?{'plannedActions':_0x34aae0[_0x3306cb(0x191)]}:{},..._0x34aae0['targets']?{'targets':_0x34aae0['targets']}:{},..._0x34aae0[_0x3306cb(0x196)]?{'deleteOrder':_0x34aae0[_0x3306cb(0x196)]}:{},'snapshotHash':_0x34aae0[_0x3306cb(0x1d7)],..._0x34aae0[_0x3306cb(0x19f)]?{'cascade':_0x34aae0[_0x3306cb(0x19f)]}:{},..._0x34aae0['planFile']?{'planFile':_0x34aae0[_0x3306cb(0x18b)]}:{},'succeeded':_0x34aae0[_0x3306cb(0x1a7)]??[],'failed':_0x34aae0['failed']??[],'warnings':_0x34aae0[_0x3306cb(0x1ed)]??[],'verification':_0x34aae0[_0x3306cb(0x1c6)],'error':_0x34aae0[_0x3306cb(0x18d)]};}export function menuDryRunResult(_0x418b23,_0x1f5181){return{..._0x418b23,..._0x1f5181};}export function menuFailure(_0x291ac1,_0x44a578,_0x4c57d6){const _0x2ecb80=a169_0x395969,_0x447872=mutationResult({..._0x44a578,'after':_0x4c57d6['after']===undefined?_0x44a578[_0x2ecb80(0x1d9)]:_0x4c57d6[_0x2ecb80(0x1d9)],'backend':_0x4c57d6[_0x2ecb80(0x1c5)]??_0x44a578[_0x2ecb80(0x1c5)],'dryRun':![],'succeeded':_0x4c57d6['succeeded']??[],'failed':_0x4c57d6[_0x2ecb80(0x1e6)]??[{..._0x4c57d6['failed']??{},'stage':_0x4c57d6[_0x2ecb80(0x195)],'code':_0x291ac1['code'],'message':_0x291ac1[_0x2ecb80(0x1af)]}],'warnings':[..._0x44a578[_0x2ecb80(0x1ed)],..._0x4c57d6[_0x2ecb80(0x1ed)]??[]],'verification':_0x4c57d6[_0x2ecb80(0x1c6)],'error':{'code':_0x291ac1[_0x2ecb80(0x19a)],'message':_0x291ac1[_0x2ecb80(0x1af)],..._0x291ac1[_0x2ecb80(0x1df)]?{'hint':_0x291ac1[_0x2ecb80(0x1df)]}:{}}});return Object[_0x2ecb80(0x1f1)](_0x291ac1,_0x2ecb80(0x18c),{'value':_0x447872,'enumerable':!![],'configurable':!![]}),_0x291ac1;}export function asVerificationError(_0x5e0116,_0x1eded1){const _0x13d4bd=a169_0x395969;if(_0x5e0116 instanceof CliError&&_0x5e0116[_0x13d4bd(0x19a)]===_0x13d4bd(0x1e2))return _0x5e0116;const _0x958d0=_0x5e0116 instanceof Error?_0x5e0116[_0x13d4bd(0x1af)]:String(_0x5e0116);return menuError(_0x13d4bd(0x1e2),''+_0x1eded1+(_0x958d0?':\x20'+_0x958d0:''),_0x13d4bd(0x19b));}function a169_0x4356(){const _0x4fcf50=['Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','Reorder\x20sibling\x20menus\x20below\x20','snapshotHash','api_error','after','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','string','hasOwnProperty','\x20is\x20type\x20\x22','get','hint','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','2336996wqJVsx','menu_verification_failed','menu_state_drift','selector','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','failedRecords','expect-path','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','str','Menu\x20','expect-parent-id','warnings','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','max','defineProperty','isSafeInteger','cookie','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','folder','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','\x20parent\x20changed:\x20expected\x20','type','read\x20online\x20menu\x20facts\x20before\x20','19194GeTVcW','planFile','data','error','bool','menu_confirmation_required','Failed\x20to\x20','plannedActions','3RJABKF','dryRun','107444cliVsm','stage','deleteOrder','stringify','number','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','code','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','1206995ojMqsC','hash','parentId','cascade','prototype','length','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','root','path','map','validation','succeeded','unknown','yes','\x20menu\x20','pre-write-recheck','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','expected-children-count','Online\x20menu\x20state\x20changed\x20before\x20','message','menu_parent_not_folder','num','\x20path\x20changed:\x20expected\x20','test','trim','Permission\x20denied\x20while\x20attempting\x20to\x20','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','\x22,\x20not\x20folder.','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','call','3MTyvVC','menu_sort_overflow','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','childrenCount','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','\x20child\x20count\x20changed:\x20expected\x20','1505040CqrOOu',',\x20current\x20','540248QxqRlx','parent-id',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','backend','verification','toLowerCase','Exact\x20online\x20menu\x20id','recheck\x20online\x20menu\x20facts\x20before\x20','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','Online\x20menu\x20not\x20found:\x20','301xhRiNx','sort','rawFlags','menu_permission_denied','Cannot\x20append\x20a\x20','1784367qFVhLK','menu_not_found','Sibling\x20sort\x20value\x20(non-negative\x20integer)','menu_sort_invalid'];a169_0x4356=function(){return _0x4fcf50;};return a169_0x4356();}export function describeMenuErrorCause(_0x33ad9e,_0x46ca5f,_0x565457){const _0x857d9a=a169_0x395969,_0x836b7c=mapMenuApiError(_0x33ad9e,_0x46ca5f,_0x565457);return{'causeCode':_0x836b7c['code'],'causeMessage':_0x836b7c[_0x857d9a(0x1af)]};}export function hasFlag(_0x282717,_0x5a92ee){const _0x5d7e11=a169_0x395969;return Object[_0x5d7e11(0x1a0)][_0x5d7e11(0x1dc)][_0x5d7e11(0x1b9)](_0x282717['rawFlags'],_0x5a92ee)&&_0x282717[_0x5d7e11(0x1ce)][_0x5a92ee]!==undefined;}export function toApiParentId(_0x2869e6){return _0x2869e6??0x0;}export function formatParent(_0x152920){const _0x2c8c9a=a169_0x395969;return _0x152920==null?_0x2c8c9a(0x1a3):String(_0x152920);}export function menuError(_0x155e5c,_0x5a0705,_0x38e0c2){return new CliError(_0x155e5c,0x1,_0x5a0705,_0x38e0c2);}export function mapMenuApiError(_0xc7f012,_0x411052,_0x3dbbb5){const _0x5d3127=a169_0x395969;if(_0xc7f012 instanceof CliError&&_0xc7f012[_0x5d3127(0x19a)]!==_0x5d3127(0x1d8))return _0xc7f012;const _0xfea93a=_0xc7f012 instanceof Error?_0xc7f012['message']:String(_0xc7f012);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x5d3127(0x1b3)](_0xfea93a))return menuError(_0x5d3127(0x1cf),_0x5d3127(0x1b5)+_0x411052+(_0x3dbbb5?_0x5d3127(0x1aa)+_0x3dbbb5:'')+'.',_0x5d3127(0x1b6));return menuError('menu_mutation_failed',_0x5d3127(0x190)+_0x411052+(_0x3dbbb5?_0x5d3127(0x1aa)+_0x3dbbb5:'')+':\x20'+_0xfea93a,_0x5d3127(0x1ac));}export function isMenuResponseLoss(_0x27e796){const _0x6d3d29=a169_0x395969,_0x288308=_0x27e796 instanceof Error?_0x27e796[_0x6d3d29(0x1af)]:String(_0x27e796);if(_0x27e796 instanceof CliError)return _0x27e796[_0x6d3d29(0x19a)]==='api_error'&&/^Request (?:failed|timeout):/i[_0x6d3d29(0x1b3)](_0x288308);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x6d3d29(0x1b3)](_0x288308);}function stateDrift(_0x12a28b){const _0x33eb72=a169_0x395969;return menuError(_0x33eb72(0x1e3),_0x12a28b,_0x33eb72(0x186));}
|
|
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 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x58a366,_0x1ff32e){const _0x4483eb=a170_0x50f8,_0xb4fcec=_0x58a366();while(!![]){try{const _0x37c67f=parseInt(_0x4483eb(0x15f))/0x1+parseInt(_0x4483eb(0x15d))/0x2+parseInt(_0x4483eb(0x15a))/0x3*(-parseInt(_0x4483eb(0x15b))/0x4)+-parseInt(_0x4483eb(0x15c))/0x5*(-parseInt(_0x4483eb(0x159))/0x6)+parseInt(_0x4483eb(0x157))/0x7+-parseInt(_0x4483eb(0x158))/0x8+parseInt(_0x4483eb(0x15e))/0x9;if(_0x37c67f===_0x1ff32e)break;else _0xb4fcec['push'](_0xb4fcec['shift']());}catch(_0x1d9424){_0xb4fcec['push'](_0xb4fcec['shift']());}}}(a170_0x4c57,0x384aa));function a170_0x50f8(_0x336dd7,_0x39cfcc){_0x336dd7=_0x336dd7-0x157;const _0x4c57bb=a170_0x4c57();let _0x50f8f0=_0x4c57bb[_0x336dd7];return _0x50f8f0;}function a170_0x4c57(){const _0x37efb2=['3079584cewUec','482358KdQtjn','3678AjKBci','624wBpczk','5WRQaRG','457086rAIhWp','214164sbQSSd','208634NhRHkx','replace','1857856RDpXit'];a170_0x4c57=function(){return _0x37efb2;};return a170_0x4c57();}export function menuPathKey(_0x7292e1){const _0x5b04df=a170_0x50f8,_0x2e2ef9=_0x7292e1['trim']();if(!_0x2e2ef9)return'';return _0x2e2ef9[_0x5b04df(0x160)](/^\/+/,'')['replace'](/\/+$/,'')||'/';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c01dd,_0x39fe8b){const _0x5075dc=a171_0x474c,_0x3fb040=_0x2c01dd();while(!![]){try{const _0x438fee=parseInt(_0x5075dc(0x1c5))/0x1+parseInt(_0x5075dc(0x1c6))/0x2*(parseInt(_0x5075dc(0x1ae))/0x3)+parseInt(_0x5075dc(0x1c2))/0x4+parseInt(_0x5075dc(0x1aa))/0x5*(-parseInt(_0x5075dc(0x1c9))/0x6)+-parseInt(_0x5075dc(0x1b9))/0x7+parseInt(_0x5075dc(0x1c1))/0x8*(parseInt(_0x5075dc(0x1b0))/0x9)+-parseInt(_0x5075dc(0x1b5))/0xa;if(_0x438fee===_0x39fe8b)break;else _0x3fb040['push'](_0x3fb040['shift']());}catch(_0x1c5d2a){_0x3fb040['push'](_0x3fb040['shift']());}}}(a171_0x376f,0xd5d0d));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';function a171_0x376f(){const _0x1d60a2=['Delete\x20','Regroup\x20','parentId','number','Batch\x20menu\x20creation\x20completed,\x20total\x20','length','procode','boolean','Update\x20menu\x20','stringify','update-menu-cdn-url','865PImFfY','Menu\x20created\x20successfully:\x20','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','\x20menu\x20group(s)','78012NWteWU','loadScriptMode','5403330CpYkfl','create-menu','Start\x20batch\x20menu\x20creation,\x20total\x20','visible','menus','6158920gavdRm','extend','Menu\x20assets\x20synced:\x20','label','6934648YIZOrU','path','resources','appName','create-menus','import','\x20menu','all','16ZJZObK','3569724WZUucd','info','Create\x20menu\x20\x22','1180779gpQmxe','8gqsvuL','order','Update\x20menu\x20assets\x20\x22','31062OyszQk'];a171_0x376f=function(){return _0x1d60a2;};return a171_0x376f();}import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';function a171_0x474c(_0x1dfcde,_0x4b134c){_0x1dfcde=_0x1dfcde-0x1a5;const _0x376f93=a171_0x376f();let _0x474cdd=_0x376f93[_0x1dfcde];return _0x474cdd;}import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a171_0x5ac752,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x4a826f,_0x37ea52){const _0x16c77a=a171_0x474c,_0x3442e1=getEnv();logger[_0x16c77a(0x1c3)]('get-online-menu-list',isProduction(_0x3442e1)?'Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'+_0x4a826f+')':_0x16c77a(0x1ac)+_0x4a826f+')');const _0x3d764a=await fetchMenuSnapshot(_0x4a826f,_0x37ea52,{'verbose':!![]});return logger[_0x16c77a(0x1c3)]('get-online-menu-list','Fetched\x20'+_0x3d764a['total']+'\x20online\x20menus\x20successfully'),_0x3d764a[_0x16c77a(0x1b4)]['map'](toProcessedMenuItem);}export async function createMenu(_0x2e2f46,_0x2ecea3,_0x289ac2){const _0x13f3e7=a171_0x474c;logger[_0x13f3e7(0x1c3)](_0x13f3e7(0x1b1),'Creating\x20menu:\x20'+_0x289ac2[_0x13f3e7(0x1b8)]+'\x20('+_0x289ac2['path']+')');const _0x478ed0={'appCode':_0x2e2f46,'type':_0x13f3e7(0x1a5),'sort':0x0,'extend':{'loadScriptMode':_0x13f3e7(0x1be),'resources':_0x289ac2[_0x13f3e7(0x1bb)]?JSON['stringify'](_0x289ac2[_0x13f3e7(0x1bb)]):undefined},..._0x289ac2},_0x4f8347=await createMenuRecord(_0x478ed0,_0x2ecea3,_0x13f3e7(0x1c4)+_0x289ac2[_0x13f3e7(0x1b8)]+'\x22');return logger[_0x13f3e7(0x1c3)]('create-menu',_0x13f3e7(0x1ab)+_0x289ac2[_0x13f3e7(0x1b8)]),_0x4f8347;}async function createSingleMenu(_0x185563,_0x21e78b,_0x26a8b6,_0x4f362e,_0x19a919){const _0x30d9ff=a171_0x474c,_0x5b30d6={'appCode':_0x185563,'type':_0x30d9ff(0x1a5),'sort':_0x30d9ff(0x1c7)in _0x26a8b6&&typeof _0x26a8b6[_0x30d9ff(0x1c7)]==='number'?_0x26a8b6[_0x30d9ff(0x1c7)]:0x0,...'visible'in _0x26a8b6&&typeof _0x26a8b6[_0x30d9ff(0x1b3)]===_0x30d9ff(0x1a6)?{'visible':_0x26a8b6[_0x30d9ff(0x1b3)]}:{},..._0x30d9ff(0x1cc)in _0x26a8b6&&typeof _0x26a8b6['parentId']===_0x30d9ff(0x1cd)?{'parentId':_0x26a8b6[_0x30d9ff(0x1cc)]}:{},'extend':{..._0x19a919?.['appName']?{'appName':_0x19a919[_0x30d9ff(0x1bc)]}:{},'loadScriptMode':_0x30d9ff(0x1be),'resources':_0x4f362e?JSON[_0x30d9ff(0x1a8)](_0x4f362e):undefined},'label':_0x26a8b6[_0x30d9ff(0x1b8)],'path':_0x26a8b6['path']},_0x507d3a=await createMenuRecord(_0x5b30d6,_0x21e78b,_0x30d9ff(0x1c4)+_0x26a8b6[_0x30d9ff(0x1b8)]+'\x22');return logger[_0x30d9ff(0x1c3)](_0x30d9ff(0x1b1),_0x30d9ff(0x1ab)+_0x26a8b6[_0x30d9ff(0x1b8)]),_0x507d3a;}export async function createMenus(_0x4c93c2,_0x2242cc,_0x51976a,_0x3b84d9,_0x213113){const _0x50bfff=a171_0x474c;logger['info'](_0x50bfff(0x1bd),_0x50bfff(0x1b2)+_0x51976a[_0x50bfff(0x1cf)]);const _0x3af6b5=await Promise[_0x50bfff(0x1c0)](_0x51976a['map'](_0x5201d1=>createSingleMenu(_0x4c93c2,_0x2242cc,_0x5201d1,_0x3b84d9,_0x213113)));return logger[_0x50bfff(0x1c3)](_0x50bfff(0x1bd),_0x50bfff(0x1ce)+_0x51976a[_0x50bfff(0x1cf)]),_0x3af6b5;}export async function updateMenuCdnUrl(_0xd11d53,_0x3a93c2,_0x1688b5){const _0xeb27ce=a171_0x474c;logger[_0xeb27ce(0x1c3)](_0xeb27ce(0x1a9),'Updating\x20menu\x20asset\x20links:\x20'+_0x1688b5[_0xeb27ce(0x1b8)]+'\x20('+_0x1688b5[_0xeb27ce(0x1ba)]+')');const _0x3a6ed5={'id':_0x1688b5['id'],'appCode':_0xd11d53,'extend':{..._0x1688b5[_0xeb27ce(0x1b6)]??{},..._0x1688b5[_0xeb27ce(0x1af)]?{'loadScriptMode':_0x1688b5[_0xeb27ce(0x1af)]}:{},'resources':_0x1688b5[_0xeb27ce(0x1bb)]?JSON[_0xeb27ce(0x1a8)](_0x1688b5[_0xeb27ce(0x1bb)]):undefined}},_0x51118c=await updateMenuRecord(_0x3a6ed5,_0x3a93c2,_0xeb27ce(0x1c8)+_0x1688b5[_0xeb27ce(0x1b8)]+'\x22');return logger[_0xeb27ce(0x1c3)](_0xeb27ce(0x1a9),_0xeb27ce(0x1b7)+_0x1688b5[_0xeb27ce(0x1b8)],undefined),_0x51118c;}export async function createMenuEntity(_0x3bff39,_0x18615d,_0x28da8c){const _0x4329e1=a171_0x474c;return createMenuRecord({'appCode':_0x3bff39,..._0x28da8c},_0x18615d,_0x4329e1(0x1c4)+_0x28da8c[_0x4329e1(0x1b8)]+'\x22');}export async function updateMenuEntity(_0x1e4d0e,_0x546c6c,_0x15f39e){const _0x51290d=a171_0x474c;return updateMenuRecord({'appCode':_0x1e4d0e,..._0x15f39e},_0x546c6c,_0x51290d(0x1a7)+_0x15f39e['id']);}export async function batchDeleteMenuEntities(_0x7693b6,_0x5b264a){const _0x283142=a171_0x474c;return batchDeleteMenuRecords(_0x5b264a,_0x7693b6,_0x283142(0x1ca)+_0x5b264a[_0x283142(0x1cf)]+_0x283142(0x1bf)+(_0x5b264a[_0x283142(0x1cf)]===0x1?'':'s'));}export async function startMenuRegroup(_0x15e4d5,_0x297f41){const _0x15be82=a171_0x474c;return a171_0x5ac752(_0x297f41,_0x15e4d5,_0x15be82(0x1cb)+_0x297f41['menuGroups']['length']+_0x15be82(0x1ad));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a172_0x1b64(){const _0x415f95=['isArray','4679397uZzxnb','Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','app-name','loadScriptMode','some','appCode','menu\x20','extend','resources','map','15276SCUCdM','124HFeWdx','parse','No\x20shared\x20resources\x20configured\x20for\x20','sharedResources','\x20must\x20be\x20a\x20JSON\x20object.','trim','147505tnolAn','882RREMyr','subapp.resources','assets','19454340VhJKIO','length','12258832zpZKAR','app.extend.assets','app.extend.assets\x20must\x20be\x20an\x20array.','stringify','13626675jSGzez','filter','app','string','appName','app.extend','fallbackDiffers','message','Duplicate\x20subapp\x20records\x20for\x20','object','validation','\x20resources','str','app.extend.assets[','15104zClcsi','152HpLZwY'];a172_0x1b64=function(){return _0x415f95;};return a172_0x1b64();}const a172_0x5beeff=a172_0xb0d1;(function(_0x49ce97,_0x2e5178){const _0xc7df47=a172_0xb0d1,_0x306534=_0x49ce97();while(!![]){try{const _0x323bf7=parseInt(_0xc7df47(0x129))/0x1*(parseInt(_0xc7df47(0x128))/0x2)+-parseInt(_0xc7df47(0xff))/0x3+-parseInt(_0xc7df47(0x10a))/0x4*(parseInt(_0xc7df47(0x110))/0x5)+-parseInt(_0xc7df47(0x109))/0x6*(-parseInt(_0xc7df47(0x111))/0x7)+parseInt(_0xc7df47(0x116))/0x8+-parseInt(_0xc7df47(0x11a))/0x9+parseInt(_0xc7df47(0x114))/0xa;if(_0x323bf7===_0x2e5178)break;else _0x306534['push'](_0x306534['shift']());}catch(_0x24c9fa){_0x306534['push'](_0x306534['shift']());}}}(a172_0x1b64,0xe9e83));import{getSmartAppRecord}from'../../../core/api-client.js';function a172_0xb0d1(_0x3594d9,_0x365ebb){_0x3594d9=_0x3594d9-0xfe;const _0x1b6482=a172_0x1b64();let _0xb0d1b0=_0x1b6482[_0x3594d9];return _0xb0d1b0;}import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{CliErrors}from'../../../errors.js';function objectValue(_0x4a6ee5,_0x1cc5c4){const _0xd364e3=a172_0xb0d1,_0x14ea7c=typeof _0x4a6ee5===_0xd364e3(0x11d)?parseJson(_0x4a6ee5,_0x1cc5c4):_0x4a6ee5;if(!_0x14ea7c||typeof _0x14ea7c!==_0xd364e3(0x123)||Array[_0xd364e3(0xfe)](_0x14ea7c))throw CliErrors[_0xd364e3(0x124)](_0x1cc5c4+_0xd364e3(0x10e));return _0x14ea7c;}function parseJson(_0x3cd3df,_0x2a6b03){const _0x14bdaf=a172_0xb0d1;try{return JSON[_0x14bdaf(0x10b)](_0x3cd3df);}catch{throw CliErrors['validation'](_0x2a6b03+'\x20contains\x20invalid\x20JSON.');}}function resourceList(_0x542285,_0x1f05f5){const _0x3c3d71=a172_0xb0d1;if(typeof _0x542285!==_0x3c3d71(0x11d))throw CliErrors['validation'](_0x1f05f5+'\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.');const _0x522f90=parseJson(_0x542285,_0x1f05f5);if(!Array[_0x3c3d71(0xfe)](_0x522f90)||_0x522f90[_0x3c3d71(0x103)](_0x1b685e=>typeof _0x1b685e!==_0x3c3d71(0x11d)))throw CliErrors[_0x3c3d71(0x124)](_0x1f05f5+'\x20must\x20be\x20an\x20array\x20of\x20URLs.');return _0x522f90;}export function buildSubappAssetsStatus(_0x548f73,_0x13613f,_0x43041a){const _0x3f6985=a172_0xb0d1,_0x41f31d=_0x548f73['extend']==null?{}:objectValue(_0x548f73[_0x3f6985(0x106)],_0x3f6985(0x11f)),_0x3726bc=_0x41f31d[_0x3f6985(0x113)]==null?[]:typeof _0x41f31d[_0x3f6985(0x113)]==='string'?parseJson(_0x41f31d[_0x3f6985(0x113)],_0x3f6985(0x117)):_0x41f31d[_0x3f6985(0x113)];if(!Array['isArray'](_0x3726bc))throw CliErrors[_0x3f6985(0x124)](_0x3f6985(0x118));const _0x5c09ca=_0x3726bc[_0x3f6985(0x108)]((_0x5bcb11,_0xa7804d)=>objectValue(_0x5bcb11,_0x3f6985(0x127)+_0xa7804d+']')),_0x33a99b=_0x5c09ca[_0x3f6985(0x11b)](_0x45cbad=>_0x45cbad[_0x3f6985(0x11e)]===_0x43041a);if(_0x33a99b[_0x3f6985(0x115)]>0x1)throw CliErrors[_0x3f6985(0x124)](_0x3f6985(0x122)+_0x43041a+'.');const _0x42c8db=_0x33a99b[0x0],_0x5c12a9=_0x42c8db?.[_0x3f6985(0x107)]==null?[]:resourceList(_0x42c8db[_0x3f6985(0x107)],_0x3f6985(0x112)),_0x292e20=_0x13613f['filter'](_0x20fa72=>_0x20fa72[_0x3f6985(0x106)]?.[_0x3f6985(0x11e)]===_0x43041a),_0x4bd13d=_0x292e20[_0x3f6985(0x108)](_0x2612b4=>{const _0x1d4111=_0x3f6985;let _0x1aef07=null,_0x562afb=null;try{_0x1aef07=_0x2612b4[_0x1d4111(0x106)]?.[_0x1d4111(0x107)]==null?_0x2612b4[_0x1d4111(0x107)]:resourceList(_0x2612b4[_0x1d4111(0x106)][_0x1d4111(0x107)],_0x1d4111(0x105)+_0x2612b4['id']+_0x1d4111(0x125));}catch(_0x32b99d){_0x562afb=_0x32b99d instanceof Error?_0x32b99d[_0x1d4111(0x121)]:String(_0x32b99d);}const _0x48b0bf=_0x5c12a9['length']>0x0?_0x1d4111(0x11c):'menu',_0x29ff8a=_0x48b0bf===_0x1d4111(0x11c)?_0x5c12a9:_0x1aef07;return{'id':_0x2612b4['id'],'path':_0x2612b4['path'],'preferredSourceIfSupported':_0x48b0bf,'preferredResourcesIfSupported':_0x29ff8a,'menuFallbackResources':_0x1aef07,'menuFallbackError':_0x562afb,'fallbackDiffers':_0x1aef07===null?null:_0x48b0bf===_0x1d4111(0x11c)&&_0x1aef07['length']>0x0&&JSON[_0x1d4111(0x119)](_0x1aef07)!==JSON[_0x1d4111(0x119)](_0x29ff8a)};});return{'appName':_0x43041a,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x42c8db),'sharedResources':_0x5c12a9,'loadScriptMode':_0x42c8db?.[_0x3f6985(0x102)]??null,'basename':_0x42c8db?.['basename']??null,'boundMenus':_0x4bd13d[_0x3f6985(0x115)],'staleMenuFallbacks':_0x4bd13d['filter'](_0x385863=>_0x385863[_0x3f6985(0x120)])['length'],'menus':_0x4bd13d};}export async function assertSharedResourcesConfigured(_0x5a9a74,_0x311f08,_0xef6e65){const _0x4dfc69=a172_0xb0d1,_0x4c7ceb=await getSmartAppRecord(_0x5a9a74,_0x311f08),_0x3aecb2=buildSubappAssetsStatus(_0x4c7ceb,[],_0xef6e65);if(!_0x3aecb2['sharedConfigured']||_0x3aecb2[_0x4dfc69(0x10d)][_0x4dfc69(0x115)]===0x0)throw CliErrors['validation'](_0x4dfc69(0x10c)+_0xef6e65+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':'Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app'},{'name':a172_0x5beeff(0x101),'type':a172_0x5beeff(0x11d),'required':!![],'description':a172_0x5beeff(0x100)}];export function getSubappSelector(_0x5b93ec){const _0x385aa4=a172_0x5beeff,_0x1219b1=_0x5b93ec[_0x385aa4(0x104)],_0x4b2773=_0x5b93ec[_0x385aa4(0x126)](_0x385aa4(0x101))[_0x385aa4(0x10f)]();if(!_0x4b2773)throw CliErrors[_0x385aa4(0x124)]('--app-name\x20is\x20required.');return{'appCode':_0x1219b1,'appName':_0x4b2773};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a173_0x400a3c=a173_0x82c8;(function(_0x11c732,_0x2a528b){const _0x1f827c=a173_0x82c8,_0x4466d9=_0x11c732();while(!![]){try{const _0xc7053e=-parseInt(_0x1f827c(0xac))/0x1*(parseInt(_0x1f827c(0x99))/0x2)+parseInt(_0x1f827c(0x95))/0x3*(-parseInt(_0x1f827c(0xa4))/0x4)+-parseInt(_0x1f827c(0xaa))/0x5+parseInt(_0x1f827c(0xb4))/0x6+-parseInt(_0x1f827c(0x9f))/0x7*(parseInt(_0x1f827c(0xbe))/0x8)+-parseInt(_0x1f827c(0xbb))/0x9+parseInt(_0x1f827c(0xb9))/0xa;if(_0xc7053e===_0x2a528b)break;else _0x4466d9['push'](_0x4466d9['shift']());}catch(_0x2bd7ef){_0x4466d9['push'](_0x4466d9['shift']());}}}(a173_0x1add,0x8a058));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([a173_0x400a3c(0xc2),a173_0x400a3c(0xbc),a173_0x400a3c(0xa6),'visible',a173_0x400a3c(0x8e)]);function a173_0x1add(){const _0x39ccbc=['jsUrl','Invalid\x20--params\x20JSON.','menu-sync','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','folder','Invalid\x20--params:\x20','parentId','filter',';\x20found\x20','pages','procode','\x0a\x20\x20Available\x20local\x20paths:\x20','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','412668xTyJqv','trim','JS\x20URL\x20is\x20unreachable:\x20','get','628206tmviBR','\x22\x20for\x20','path','No\x20local\x20pages\x20matched\x20paths:\x20','type','string','7rxqccS','group','cwd','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','join','16IphAPH','field','appName','info','keys','Menu\x20sync\x20completed','1048620ATLAlG','object','1kINUoB','parse','visible','Parent\x20','push','CSS\x20URL\x20is\x20unreachable:\x20','boolean','Invalid\x20--params\x20fields:\x20','5283654jxSoYj','has','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','number','11923240uDDAwW','length','2994615pvERBX','cssUrl','Invalid\x20--params.','806488ebVfTE','label','map','order'];a173_0x1add=function(){return _0x39ccbc;};return a173_0x1add();}export function resolvePage(_0x5aef15,_0x291118,_0x5113ae){const _0x3c4f99=a173_0x400a3c;let _0x5189dd=_0x291118[_0x3c4f99(0x8e)]??_0x5aef15[_0x3c4f99(0x8e)];if(_0x5189dd===undefined&&_0x5aef15['group']){const _0x1de383=_0x5113ae['filter'](_0x4204c9=>_0x4204c9['type']===_0x3c4f99(0x8c)&&_0x4204c9[_0x3c4f99(0xbf)]===_0x5aef15['group']);if(_0x1de383[_0x3c4f99(0xba)]!==0x1)throw new Error('Expected\x20one\x20folder\x20named\x20\x22'+_0x5aef15[_0x3c4f99(0xa0)]+_0x3c4f99(0x9a)+_0x5aef15[_0x3c4f99(0x9b)]+_0x3c4f99(0x90)+_0x1de383[_0x3c4f99(0xba)]);_0x5189dd=_0x1de383[0x0]['id'];}if(_0x5189dd!==undefined&&_0x5189dd!==0x0&&_0x5113ae['filter'](_0x555dc6=>_0x555dc6['id']===_0x5189dd&&_0x555dc6[_0x3c4f99(0x9d)]===_0x3c4f99(0x8c))[_0x3c4f99(0xba)]!==0x1)throw new Error(_0x3c4f99(0xaf)+_0x5189dd+'\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.');return{..._0x5aef15,..._0x5189dd===undefined?{}:{'parentId':_0x5189dd},..._0x291118[_0x3c4f99(0xae)]===undefined?{}:{'visible':_0x291118['visible']}};}function a173_0x82c8(_0x315e65,_0x3c600a){_0x315e65=_0x315e65-0x8a;const _0x1add80=a173_0x1add();let _0x82c8=_0x1add80[_0x315e65];return _0x82c8;}function validateParams(_0x31e51f){const _0x5cc397=a173_0x400a3c,_0x342269=[];return _0x31e51f[_0x5cc397(0xc2)]&&!isValidJsHttpsUrl(_0x31e51f[_0x5cc397(0xc2)])&&_0x342269[_0x5cc397(0xb0)]({'field':_0x5cc397(0xc2),'message':_0x5cc397(0x94)}),_0x31e51f[_0x5cc397(0xbc)]&&!isValidCssHttpsUrl(_0x31e51f['cssUrl'])&&_0x342269[_0x5cc397(0xb0)]({'field':_0x5cc397(0xbc),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x342269;}export async function runMenuSyncCore(_0xddc55b,_0x325923,_0x1d93c7=[],_0x486429,_0x156bd9={}){const _0x188138=a173_0x400a3c,_0x161de2=parseMenuSyncParams(_0x486429),_0x4904ce=[...new Set(_0x1d93c7[_0x188138(0xc0)](_0x561c79=>_0x561c79[_0x188138(0x96)]())[_0x188138(0x8f)](Boolean)['map'](menuPathKey))],_0x3db513=_0x161de2['jsUrl'],_0x2f3544=_0x161de2['cssUrl'],_0x58d7d4=[];if(_0x3db513)_0x58d7d4[_0x188138(0xb0)](_0x3db513);if(_0x2f3544)_0x58d7d4[_0x188138(0xb0)](_0x2f3544);const _0x2ef5a2=validateParams(_0x161de2);if(_0x2ef5a2[_0x188138(0xba)]>0x0){const _0x509415=_0x2ef5a2[_0x188138(0xc0)](_0x16d6f6=>'--params.'+_0x16d6f6[_0x188138(0xa5)]+':\x20'+_0x16d6f6['message'])['join'](';\x20');throw new Error(_0x188138(0x8d)+_0x509415);}logger['setLogPath'](process[_0x188138(0xa1)]()),logger[_0x188138(0xa7)](_0x188138(0x8a),'Start\x20non-interactive\x20menu\x20sync',{'appCode':_0xddc55b,'selectedCount':_0x4904ce[_0x188138(0xba)],'jsUrl':_0x3db513,'cssUrl':_0x2f3544});if(_0x3db513){const _0x3ddda3=await isUrlReachable(_0x3db513);if(!_0x3ddda3)throw new Error(_0x188138(0x97)+_0x3db513);}if(_0x2f3544){const _0x55c930=await isUrlReachable(_0x2f3544);if(!_0x55c930)throw new Error(_0x188138(0xb1)+_0x2f3544);}const _0x533989=getLocalPages();if(_0x533989['length']===0x0){if(_0x4904ce[_0x188138(0xba)]>0x0)throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x4904ce[_0x188138(0xa3)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x156bd9['dryRun']===!![],'targetPages':[],'plannedMenus':[]};}const _0x374981=await getOnlineMenuList(_0xddc55b,_0x325923),_0x5ae841=new Set(_0x374981['map'](_0x466896=>menuPathKey(_0x466896[_0x188138(0x9b)])));let _0x4cd56f;if(_0x4904ce[_0x188138(0xba)]>0x0){const _0x404731=new Map(_0x533989[_0x188138(0xc0)](_0x5bfdba=>[menuPathKey(_0x5bfdba[_0x188138(0x9b)]),_0x5bfdba])),_0x443c52=_0x4904ce[_0x188138(0x8f)](_0x5f05f0=>!_0x404731['has'](_0x5f05f0));if(_0x443c52['length']>0x0){const _0x49768a=_0x533989[_0x188138(0xc0)](_0x36e77d=>_0x36e77d[_0x188138(0x9b)])[_0x188138(0xa3)](',\x20');throw new Error(_0x188138(0x9c)+_0x443c52[_0x188138(0xa3)](',\x20')+_0x188138(0x93)+_0x49768a);}const _0x4cd4a0=_0x4904ce[_0x188138(0x8f)](_0x243e46=>_0x5ae841[_0x188138(0xb5)](_0x243e46));if(_0x4cd4a0[_0x188138(0xba)]>0x0)throw new Error(_0x188138(0x8b)+_0x4cd4a0[_0x188138(0xa3)](',\x20'));_0x4cd56f=_0x4904ce[_0x188138(0xc0)](_0x53268b=>_0x404731[_0x188138(0x98)](_0x53268b));}else _0x4cd56f=_0x533989[_0x188138(0x8f)](_0x38a783=>!_0x5ae841[_0x188138(0xb5)](menuPathKey(_0x38a783[_0x188138(0x9b)])));if(_0x4cd56f[_0x188138(0xba)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x156bd9['dryRun']===!![],'targetPages':[],'plannedMenus':[]};_0x4cd56f=_0x4cd56f[_0x188138(0xc0)](_0x8a2c0b=>resolvePage(_0x8a2c0b,_0x161de2,_0x374981));_0x161de2[_0x188138(0xa6)]&&_0x58d7d4['length']===0x0&&await assertSharedResourcesConfigured(_0xddc55b,_0x325923,_0x161de2['appName']);const _0x118f91=_0x4cd56f[_0x188138(0xc0)](_0x25e772=>({'type':_0x188138(0x92),'path':_0x25e772['path'],'label':_0x25e772[_0x188138(0xbf)],'loadScriptMode':'import','resources':[..._0x58d7d4],..._0x25e772[_0x188138(0xae)]===undefined?{}:{'visible':_0x25e772[_0x188138(0xae)]},..._0x25e772[_0x188138(0x8e)]===undefined?{}:{'parentId':_0x25e772[_0x188138(0x8e)]},..._0x25e772[_0x188138(0xc1)]===undefined?{}:{'sort':_0x25e772[_0x188138(0xc1)]},..._0x161de2[_0x188138(0xa6)]===undefined?{}:{'appName':_0x161de2[_0x188138(0xa6)]}}));if(_0x156bd9['dryRun'])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x4cd56f,'plannedMenus':_0x118f91};const _0x55c50a=_0x161de2[_0x188138(0xa6)]?await createMenus(_0xddc55b,_0x325923,_0x4cd56f,_0x58d7d4[_0x188138(0xba)]>0x0?_0x58d7d4:undefined,{'appName':_0x161de2[_0x188138(0xa6)]}):await createMenus(_0xddc55b,_0x325923,_0x4cd56f,_0x58d7d4[_0x188138(0xba)]>0x0?_0x58d7d4:undefined);return logger[_0x188138(0xa7)](_0x188138(0x8a),_0x188138(0xa9),{'count':_0x4cd56f[_0x188138(0xba)],'resources':_0x58d7d4}),{'created':_0x55c50a['length'],'skipped':![],'dryRun':![],'targetPages':_0x4cd56f,'plannedMenus':_0x118f91,'menus':_0x55c50a};}export function parseMenuSyncParams(_0x4feab8){const _0x4d3924=a173_0x400a3c;if(!_0x4feab8||typeof _0x4feab8!==_0x4d3924(0x9e))return{};let _0x28f384;try{_0x28f384=JSON[_0x4d3924(0xad)](_0x4feab8);}catch{throw new Error(_0x4d3924(0xc3));}if(typeof _0x28f384!==_0x4d3924(0xab)||_0x28f384===null||Array['isArray'](_0x28f384))throw new Error(_0x4d3924(0xa2));const _0x4df2f2=_0x28f384;if(Object['hasOwn'](_0x4df2f2,_0x4d3924(0x91)))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x1d46e7=Object[_0x4d3924(0xa8)](_0x4df2f2)[_0x4d3924(0x8f)](_0x34dcbb=>!MENU_SYNC_PARAM_KEYS[_0x4d3924(0xb5)](_0x34dcbb));if(_0x1d46e7['length']>0x0)throw new Error(_0x4d3924(0xb3)+_0x1d46e7[_0x4d3924(0xa3)](',\x20')+'.');for(const _0x430e5d of[_0x4d3924(0xc2),_0x4d3924(0xbc),'appName']){const _0x2e7740=_0x4df2f2[_0x430e5d];if(_0x2e7740!==undefined&&(typeof _0x2e7740!=='string'||_0x2e7740[_0x4d3924(0x96)]()===''))throw new Error(_0x4d3924(0xbd)+_0x430e5d+':\x20expected\x20a\x20non-empty\x20string.');}if(_0x4df2f2[_0x4d3924(0xae)]!==undefined&&typeof _0x4df2f2[_0x4d3924(0xae)]!=='boolean')throw new Error(_0x4d3924(0xb7));if(_0x4df2f2[_0x4d3924(0x8e)]!==undefined&&(!Number['isInteger'](_0x4df2f2[_0x4d3924(0x8e)])||_0x4df2f2[_0x4d3924(0x8e)]<0x0))throw new Error(_0x4d3924(0xb6));return{'jsUrl':typeof _0x4df2f2['jsUrl']==='string'?_0x4df2f2[_0x4d3924(0xc2)][_0x4d3924(0x96)]():undefined,'cssUrl':typeof _0x4df2f2[_0x4d3924(0xbc)]===_0x4d3924(0x9e)?_0x4df2f2[_0x4d3924(0xbc)][_0x4d3924(0x96)]():undefined,'appName':typeof _0x4df2f2[_0x4d3924(0xa6)]===_0x4d3924(0x9e)?_0x4df2f2['appName'][_0x4d3924(0x96)]():undefined,'visible':typeof _0x4df2f2[_0x4d3924(0xae)]===_0x4d3924(0xb2)?_0x4df2f2[_0x4d3924(0xae)]:undefined,'parentId':typeof _0x4df2f2[_0x4d3924(0x8e)]===_0x4d3924(0xb8)?_0x4df2f2[_0x4d3924(0x8e)]:undefined};}
|
|
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 +1 @@
|
|
|
1
|
-
(function(_0xacbf53,_0x42ae51){const _0x3d5033=a175_0x15f7,_0x3297d5=_0xacbf53();while(!![]){try{const _0x227bc5=parseInt(_0x3d5033(0xa1))/0x1*(parseInt(_0x3d5033(0xc6))/0x2)+-parseInt(_0x3d5033(0xdf))/0x3*(parseInt(_0x3d5033(0xd2))/0x4)+parseInt(_0x3d5033(0xc0))/0x5+parseInt(_0x3d5033(0xa8))/0x6+-parseInt(_0x3d5033(0xce))/0x7*(-parseInt(_0x3d5033(0xbb))/0x8)+parseInt(_0x3d5033(0xcb))/0x9*(parseInt(_0x3d5033(0xc2))/0xa)+-parseInt(_0x3d5033(0xa3))/0xb;if(_0x227bc5===_0x42ae51)break;else _0x3297d5['push'](_0x3297d5['shift']());}catch(_0xa5a325){_0x3297d5['push'](_0x3297d5['shift']());}}}(a175_0x1f11,0x841c8));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(_0x4b5bf4){const _0x354fe0=a175_0x15f7,_0x4a2161=[];return _0x4b5bf4[_0x354fe0(0xa0)]&&!isValidJsHttpsUrl(_0x4b5bf4['jsUrl'])&&_0x4a2161['push']({'field':_0x354fe0(0xa0),'message':_0x354fe0(0xa6)}),_0x4b5bf4[_0x354fe0(0xc5)]&&!isValidCssHttpsUrl(_0x4b5bf4[_0x354fe0(0xc5)])&&_0x4a2161[_0x354fe0(0x9e)]({'field':_0x354fe0(0xc5),'message':_0x354fe0(0xab)}),_0x4a2161;}export async function runMenuUpdateCore(_0x5a7d35,_0x4a5fa0,_0x109938,_0x1b56f4={}){const _0x2f6458=a175_0x15f7,_0x195255=parseUpdateParamsFlag(_0x109938),_0x209da5=normalizeMode(_0x1b56f4['mode']);validateSelection(_0x1b56f4[_0x2f6458(0xda)]);const _0x1926a=[];if(_0x195255['jsUrl'])_0x1926a[_0x2f6458(0x9e)](_0x195255[_0x2f6458(0xa0)]);if(_0x195255[_0x2f6458(0xc5)])_0x1926a['push'](_0x195255[_0x2f6458(0xc5)]);const _0x10727b=validateParams(_0x195255);if(_0x10727b[_0x2f6458(0xd9)]>0x0){const _0x48ff7b=_0x10727b[_0x2f6458(0xaa)](_0x4488ea=>_0x2f6458(0xdc)+_0x4488ea['field']+':\x20'+_0x4488ea[_0x2f6458(0xd0)])['join'](';\x20');throw new Error(_0x2f6458(0xca)+_0x48ff7b);}if(_0x1926a[_0x2f6458(0xd9)]===0x0)throw new Error(_0x2f6458(0x9f)+_0x2f6458(0xa7));logger[_0x2f6458(0xae)](process[_0x2f6458(0xe0)]()),logger['info'](_0x2f6458(0xbd),_0x2f6458(0xc7),{'appCode':_0x5a7d35,'jsUrl':_0x195255[_0x2f6458(0xa0)],'cssUrl':_0x195255[_0x2f6458(0xc5)],'mode':_0x209da5,'dryRun':_0x1b56f4[_0x2f6458(0xa5)]===!![]});if(_0x195255[_0x2f6458(0xa0)]){const _0x1bb127=await isUrlReachable(_0x195255[_0x2f6458(0xa0)]);if(!_0x1bb127)throw new Error(_0x2f6458(0xd1)+_0x195255[_0x2f6458(0xa0)]);}if(_0x195255[_0x2f6458(0xc5)]){const _0x3fa8c9=await isUrlReachable(_0x195255[_0x2f6458(0xc5)]);if(!_0x3fa8c9)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x195255[_0x2f6458(0xc5)]);}const _0x2de5fe=await getOnlineMenuList(_0x5a7d35,_0x4a5fa0),_0x260c58=_0x2de5fe[_0x2f6458(0xbf)](_0x344797=>_0x344797[_0x2f6458(0xa2)][_0x2f6458(0xd9)]>0x0),_0xa24995=selectMenusForUpdate(_0x260c58,_0x1b56f4['selection']);if(_0xa24995['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x1b56f4['dryRun']===!![]};const _0x505dd6=_0xa24995[_0x2f6458(0xaa)](_0x973b03=>buildMenuUpdateDiff(_0x973b03,_0x195255,_0x209da5,_0x1b56f4[_0x2f6458(0xb8)]===!![],_0x1b56f4[_0x2f6458(0xc1)]));if(_0x1b56f4[_0x2f6458(0xa5)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x505dd6};const _0x5c8771=await Promise[_0x2f6458(0xad)](_0xa24995[_0x2f6458(0xaa)]((_0x559b69,_0x4255f4)=>updateMenuCdnUrl(_0x5a7d35,_0x4a5fa0,{'id':_0x559b69['id'],'label':_0x559b69[_0x2f6458(0xcd)],'path':_0x559b69[_0x2f6458(0xb9)],'resources':_0x505dd6[_0x4255f4]['after'][_0x2f6458(0xa2)],'extend':_0x559b69[_0x2f6458(0xd5)]??null,'loadScriptMode':_0x1b56f4[_0x2f6458(0xc1)]}))),_0x17a6d0=_0x5c8771['filter'](_0x4063b7=>_0x4063b7[_0x2f6458(0xdd)]===_0x2f6458(0x9c))['map'](_0x5c8101=>_0x5c8101[_0x2f6458(0x9d)]),_0x537dde=_0x5c8771[_0x2f6458(0xbf)](_0xaadbcc=>_0xaadbcc[_0x2f6458(0xdd)]==='rejected')[_0x2f6458(0xd9)];return logger[_0x2f6458(0xa9)](_0x2f6458(0xbd),_0x2f6458(0xb5),{'count':_0xa24995[_0x2f6458(0xd9)],'resources':_0x1926a}),{'updated':_0x17a6d0[_0x2f6458(0xd9)],'failed':_0x537dde,'skipped':![],'menus':_0x17a6d0};}function validateSelection(_0x51a989){const _0x4bb447=a175_0x15f7;if(!_0x51a989)throw new Error(_0x4bb447(0xb0));if(_0x51a989['all']&&(_0x51a989[_0x4bb447(0xc3)]['length']>0x0||_0x51a989[_0x4bb447(0xc8)]['length']>0x0))throw new Error(_0x4bb447(0xb1));if(!_0x51a989[_0x4bb447(0xc4)]&&_0x51a989[_0x4bb447(0xc3)]['length']===0x0&&_0x51a989[_0x4bb447(0xc8)]['length']===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x1fca6f,_0x534dda){const _0x121e16=a175_0x15f7;validateSelection(_0x534dda);if(_0x534dda[_0x121e16(0xc4)])return _0x1fca6f;const _0x4851f5=new Set(_0x1fca6f[_0x121e16(0xaa)](_0x47388b=>_0x47388b['id'])),_0x237275=new Set(_0x1fca6f[_0x121e16(0xaa)](_0x1e5d35=>_0x1e5d35[_0x121e16(0xb9)])),_0x2a3bed=_0x534dda['menuIds'][_0x121e16(0xbf)](_0x42e003=>!_0x4851f5[_0x121e16(0xd3)](_0x42e003)),_0x524512=_0x534dda[_0x121e16(0xc8)]['filter'](_0x3d3140=>!_0x237275[_0x121e16(0xd3)](_0x3d3140));if(_0x2a3bed['length']>0x0||_0x524512['length']>0x0){const _0x2adccd=[..._0x2a3bed['map'](_0x280eec=>String(_0x280eec)),..._0x524512][_0x121e16(0xc9)](',\x20');throw new Error(_0x121e16(0xcc)+_0x2adccd);}const _0x25c5c7=new Set(_0x534dda[_0x121e16(0xc3)]),_0x526eec=new Set(_0x534dda['paths']);return _0x1fca6f[_0x121e16(0xbf)](_0x1f335b=>_0x25c5c7[_0x121e16(0xd3)](_0x1f335b['id'])||_0x526eec[_0x121e16(0xd3)](_0x1f335b[_0x121e16(0xb9)]));}function normalizeMode(_0x1a193e){const _0x47ffec=a175_0x15f7;if(!_0x1a193e)return _0x47ffec(0xb4);if(_0x1a193e===_0x47ffec(0xd7)||_0x1a193e===_0x47ffec(0xb4))return _0x1a193e;throw new Error(_0x47ffec(0xd6)+_0x1a193e+_0x47ffec(0xac));}function buildMenuUpdateDiff(_0x21b445,_0x1120c5,_0xf6acf7,_0x238cbc,_0x15d0cd){const _0x3cbe44=a175_0x15f7,_0x292e86=[..._0x21b445[_0x3cbe44(0xa2)]];_0xf6acf7===_0x3cbe44(0xb4)&&assertUnambiguousPatchResources(_0x21b445,_0x292e86,_0x1120c5);const _0x404d3e=_0xf6acf7===_0x3cbe44(0xb4)?patchResources(_0x292e86,_0x1120c5):replaceResources(_0x1120c5),_0x3920a7=[],_0x553371=_0x292e86['some'](isJsResource),_0x1cbc59=_0x404d3e['some'](isJsResource);if(_0x553371&&!_0x1cbc59){const _0x464230='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x21b445[_0x3cbe44(0xcd)]+'\x22\x20('+_0x21b445[_0x3cbe44(0xb9)]+').\x20'+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0x238cbc)throw new Error(_0x464230);_0x3920a7[_0x3cbe44(0x9e)](_0x464230);}const _0x2c17e3=_0x292e86[_0x3cbe44(0xdb)](isCssResource),_0x2c8f35=_0x404d3e[_0x3cbe44(0xdb)](isCssResource);_0x2c17e3&&!_0x2c8f35&&_0x3920a7[_0x3cbe44(0x9e)](_0x3cbe44(0xd4)+_0x21b445[_0x3cbe44(0xcd)]+_0x3cbe44(0xcf)+_0x21b445[_0x3cbe44(0xb9)]+').');const _0x2491da=typeof _0x21b445[_0x3cbe44(0xd5)]?.[_0x3cbe44(0xc1)]===_0x3cbe44(0xba)?_0x21b445[_0x3cbe44(0xd5)][_0x3cbe44(0xc1)]:null,_0x6da538=_0x15d0cd?{'loadScriptMode':_0x2491da}:{},_0x19b41e=_0x15d0cd?{'loadScriptMode':_0x15d0cd}:{};return{'id':_0x21b445['id'],'label':_0x21b445[_0x3cbe44(0xcd)],'path':_0x21b445['path'],'mode':_0xf6acf7,'before':{'resources':_0x292e86,..._0x6da538},'after':{'resources':_0x404d3e,..._0x19b41e},'warnings':_0x3920a7};}function replaceResources(_0xab2539){const _0x3f8fe4=a175_0x15f7;return[_0xab2539['jsUrl'],_0xab2539[_0x3f8fe4(0xc5)]][_0x3f8fe4(0xbf)](_0xe999d6=>!!_0xe999d6);}function a175_0x15f7(_0x143fd9,_0x181633){_0x143fd9=_0x143fd9-0x9b;const _0x1f1127=a175_0x1f11();let _0x15f7cd=_0x1f1127[_0x143fd9];return _0x15f7cd;}function assertUnambiguousPatchResources(_0x592aa5,_0x16913a,_0x3d3728){const _0x2b0cd3=a175_0x15f7,_0x3798f4=_0x16913a[_0x2b0cd3(0xbf)](isJsResource)['length'];if(_0x3d3728[_0x2b0cd3(0xa0)]&&_0x3798f4>0x1)throw new Error(_0x2b0cd3(0xde)+_0x3798f4+'\x20existing\x20JS\x20resources\x20for\x20\x22'+_0x592aa5['label']+_0x2b0cd3(0xcf)+_0x592aa5[_0x2b0cd3(0xb9)]+')\x20'+_0x2b0cd3(0xa4));const _0x412dc1=_0x16913a[_0x2b0cd3(0xbf)](isCssResource)[_0x2b0cd3(0xd9)];if(_0x3d3728[_0x2b0cd3(0xc5)]&&_0x412dc1>0x1)throw new Error(_0x2b0cd3(0xde)+_0x412dc1+_0x2b0cd3(0xaf)+_0x592aa5['label']+_0x2b0cd3(0xcf)+_0x592aa5['path']+')\x20'+_0x2b0cd3(0xb7));}function patchResources(_0x1c9e78,_0x25f623){const _0x52a1cb=a175_0x15f7;let _0x34b652=![],_0x2f62ed=![];const _0x522eb4=[];for(const _0x31cc82 of _0x1c9e78){if(isJsResource(_0x31cc82)){if(_0x25f623[_0x52a1cb(0xa0)]&&!_0x34b652)_0x522eb4[_0x52a1cb(0x9e)](_0x25f623[_0x52a1cb(0xa0)]),_0x34b652=!![];else!_0x25f623[_0x52a1cb(0xa0)]&&_0x522eb4[_0x52a1cb(0x9e)](_0x31cc82);continue;}if(isCssResource(_0x31cc82)){if(_0x25f623[_0x52a1cb(0xc5)]&&!_0x2f62ed)_0x522eb4[_0x52a1cb(0x9e)](_0x25f623[_0x52a1cb(0xc5)]),_0x2f62ed=!![];else!_0x25f623[_0x52a1cb(0xc5)]&&_0x522eb4[_0x52a1cb(0x9e)](_0x31cc82);continue;}_0x522eb4[_0x52a1cb(0x9e)](_0x31cc82);}return _0x25f623[_0x52a1cb(0xa0)]&&!_0x34b652&&_0x522eb4[_0x52a1cb(0xbc)](_0x25f623[_0x52a1cb(0xa0)]),_0x25f623['cssUrl']&&!_0x2f62ed&&_0x522eb4['push'](_0x25f623[_0x52a1cb(0xc5)]),_0x522eb4;}function a175_0x1f11(){const _0x5e9656=['284901BKyHqR','cwd','isArray','fulfilled','value','push','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','jsUrl','1231jrDxor','resources','18205418usmNAr','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','dryRun','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','5409540FLplLU','info','map','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','.\x20Allowed\x20values:\x20replace,\x20patch','allSettled','setLogPath','\x20existing\x20CSS\x20resources\x20for\x20\x22','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','.js','split','patch','Menu\x20asset\x20update\x20completed','trim','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','force','path','string','8qsaxJd','unshift','menu-asset-update','endsWith','filter','1431530HvAiow','loadScriptMode','20poDFsS','menuIds','all','cssUrl','812RPIjhj','Start\x20non-interactive\x20menu\x20asset\x20update','paths','join','Invalid\x20--params:\x20','2414619xmdIcY','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','label','7115773ZePHyZ','\x22\x20(','message','JS\x20URL\x20is\x20unreachable:\x20','44XgliUZ','has','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','extend','Invalid\x20--mode:\x20','replace','toLowerCase','length','selection','some','--params.','status','menu\x20asset-update\x20cannot\x20patch\x20'];a175_0x1f11=function(){return _0x5e9656;};return a175_0x1f11();}function isJsResource(_0x193117){const _0x58a457=a175_0x15f7;return stripQuery(_0x193117)[_0x58a457(0xd8)]()[_0x58a457(0xbe)](_0x58a457(0xb2));}function isCssResource(_0x3c03dc){const _0x24b347=a175_0x15f7;return stripQuery(_0x3c03dc)[_0x24b347(0xd8)]()[_0x24b347(0xbe)]('.css');}function stripQuery(_0x48ff9a){const _0x12fc73=a175_0x15f7;return _0x48ff9a[_0x12fc73(0xb3)]('?')[0x0]??_0x48ff9a;}function parseUpdateParamsFlag(_0x33bc17){const _0x22c448=a175_0x15f7;if(!_0x33bc17||typeof _0x33bc17!==_0x22c448(0xba))return{};try{const _0x163f1f=JSON['parse'](_0x33bc17);if(typeof _0x163f1f!=='object'||_0x163f1f===null||Array[_0x22c448(0x9b)](_0x163f1f))return{};return{'jsUrl':typeof _0x163f1f[_0x22c448(0xa0)]===_0x22c448(0xba)?_0x163f1f[_0x22c448(0xa0)][_0x22c448(0xb6)]():undefined,'cssUrl':typeof _0x163f1f['cssUrl']===_0x22c448(0xba)?_0x163f1f['cssUrl']['trim']():undefined};}catch{return{};}}
|
|
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 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x59c228,_0x42402e){const _0x44ac16=a176_0xcc9a,_0x4193ba=_0x59c228();while(!![]){try{const _0x324407=-parseInt(_0x44ac16(0x1d5))/0x1+parseInt(_0x44ac16(0x1dc))/0x2*(parseInt(_0x44ac16(0x1e1))/0x3)+parseInt(_0x44ac16(0x1d6))/0x4+parseInt(_0x44ac16(0x1d7))/0x5*(-parseInt(_0x44ac16(0x1d9))/0x6)+-parseInt(_0x44ac16(0x1e2))/0x7*(parseInt(_0x44ac16(0x1d4))/0x8)+parseInt(_0x44ac16(0x1d2))/0x9+parseInt(_0x44ac16(0x1de))/0xa*(-parseInt(_0x44ac16(0x1df))/0xb);if(_0x324407===_0x42402e)break;else _0x4193ba['push'](_0x4193ba['shift']());}catch(_0x59f619){_0x4193ba['push'](_0x4193ba['shift']());}}}(a176_0x5dc5,0x29860));function a176_0x5dc5(){const _0xc4199=['HEAD','208XJnCer','43361JszBiP','897892LdxkWj','25urbzfI','body','206754pLJVGU','cancel','test','4kpXWft','trim','42190WerfGK','781FboceC','GET','331014PWxtiF','10675JgAuVc','2518074nPtBqG'];a176_0x5dc5=function(){return _0xc4199;};return a176_0x5dc5();}export function isValidJsHttpsUrl(_0x5710fd){const _0x2c730c=a176_0xcc9a;return/^https:\/\/.+\.js(\?.*)?$/[_0x2c730c(0x1db)](_0x5710fd['trim']());}export function isValidCssHttpsUrl(_0x2eacf8){const _0x3922c6=a176_0xcc9a;return/^https:\/\/.+\.css(\?.*)?$/[_0x3922c6(0x1db)](_0x2eacf8[_0x3922c6(0x1dd)]());}function a176_0xcc9a(_0x2f7b7a,_0x39cc33){_0x2f7b7a=_0x2f7b7a-0x1d2;const _0x5dc593=a176_0x5dc5();let _0xcc9a10=_0x5dc593[_0x2f7b7a];return _0xcc9a10;}export async function isUrlReachable(_0x656b4f){const _0x3c314e=a176_0xcc9a;try{const _0x420d24=await fetch(_0x656b4f,{'method':_0x3c314e(0x1d3)});if(_0x420d24['ok'])return!![];}catch{}try{const _0x22725c=await fetch(_0x656b4f,{'method':_0x3c314e(0x1e0),'headers':{'Range':'bytes=0-0'}}),_0x5e8ce7=_0x22725c['ok'];try{await _0x22725c[_0x3c314e(0x1d8)]?.[_0x3c314e(0x1da)]();}catch{}return _0x5e8ce7;}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a177_0x5833df=a177_0x4832;(function(_0x211bff,_0x1dad75){const _0x907fac=a177_0x4832,_0x512342=_0x211bff();while(!![]){try{const _0x37fd43=-parseInt(_0x907fac(0x85))/0x1*(parseInt(_0x907fac(0x83))/0x2)+parseInt(_0x907fac(0x88))/0x3*(parseInt(_0x907fac(0x8a))/0x4)+-parseInt(_0x907fac(0x84))/0x5+parseInt(_0x907fac(0x92))/0x6+parseInt(_0x907fac(0x8b))/0x7+parseInt(_0x907fac(0x91))/0x8*(-parseInt(_0x907fac(0x89))/0x9)+parseInt(_0x907fac(0x8e))/0xa*(-parseInt(_0x907fac(0x93))/0xb);if(_0x37fd43===_0x1dad75)break;else _0x512342['push'](_0x512342['shift']());}catch(_0x5adf45){_0x512342['push'](_0x512342['shift']());}}}(a177_0x45a3,0x669e8));function a177_0x4832(_0x57c54b,_0xf2cbef){_0x57c54b=_0x57c54b-0x82;const _0x45a32d=a177_0x45a3();let _0x4832bc=_0x45a32d[_0x57c54b];return _0x4832bc;}import{getSmartAppRecord}from'../../core/api-client.js';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_0x5833df(0x8f),'command':a177_0x5833df(0x82),'description':a177_0x5833df(0x87),'risk':a177_0x5833df(0x90),'strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x16af4a){getSubappSelector(_0x16af4a);},async 'execute'(_0x52ee38){const _0x3257a8=a177_0x5833df,{appCode:_0x41f8f0,appName:_0x5eacac}=getSubappSelector(_0x52ee38),[_0x2c2e95,_0x1cdde1]=await Promise[_0x3257a8(0x94)]([getSmartAppRecord(_0x41f8f0,_0x52ee38[_0x3257a8(0x95)]),getOnlineMenuList(_0x41f8f0,_0x52ee38['cookie'])]),_0xdeea3c={'appCode':_0x41f8f0,...buildSubappAssetsStatus(_0x2c2e95,_0x1cdde1,_0x5eacac)};return{'ok':!![],'data':_0xdeea3c,'message':'Inspected\x20'+_0xdeea3c[_0x3257a8(0x8c)]+_0x3257a8(0x8d)+_0x5eacac+_0x3257a8(0x86)+_0x41f8f0+'.'};}};function a177_0x45a3(){const _0x55070b=['2OABUaZ','\x20in\x20menu\x20host\x20','Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','129JoOJDb','2510559EuKwCP','74772ackoXH','5155080IwcfhE','boundMenus','\x20menu(s)\x20for\x20','6601990QYGNHe','menu','read','16zkGGlc','2306778UrcrkL','11gpfpdf','all','cookie','subapp-assets-status','184246ZiLeTn','510135HsnaeT'];a177_0x45a3=function(){return _0x55070b;};return a177_0x45a3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a178_0x4c9f97=a178_0x1be7;(function(_0x4074bc,_0x43ec7a){const _0x2a80a8=a178_0x1be7,_0x2d3fa6=_0x4074bc();while(!![]){try{const _0x209754=parseInt(_0x2a80a8(0x15f))/0x1*(-parseInt(_0x2a80a8(0x18d))/0x2)+-parseInt(_0x2a80a8(0x189))/0x3+parseInt(_0x2a80a8(0x19a))/0x4*(-parseInt(_0x2a80a8(0x159))/0x5)+-parseInt(_0x2a80a8(0x1a3))/0x6*(parseInt(_0x2a80a8(0x17f))/0x7)+-parseInt(_0x2a80a8(0x184))/0x8+-parseInt(_0x2a80a8(0x16c))/0x9+parseInt(_0x2a80a8(0x178))/0xa*(parseInt(_0x2a80a8(0x176))/0xb);if(_0x209754===_0x43ec7a)break;else _0x2d3fa6['push'](_0x2d3fa6['shift']());}catch(_0x2b5a4e){_0x2d3fa6['push'](_0x2d3fa6['shift']());}}}(a178_0x2cc3,0xdc470));function a178_0x2cc3(){const _0x3f5f52=['\x20must\x20be\x20a\x20JSON\x20array.','Unknown\x20app.extend\x20fields:\x20','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','4202511eiUckb','enableSample','object','appPublishStatus','4oWrngh','sha256','update','parse','App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.','subapp-assets-update','POST','resources','some','unchanged','enableOpenApi','App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.','appCode','8GcHYJD','string','assets','\x20must\x20be\x20a\x20JSON\x20object.','tenantColumn','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','filter','vipDeploy','verified\x20app.extend','1247718NJuEIY','app.extend','stringify','Would\x20update\x20shared\x20assets\x20for\x20','has','apiError','write','3210755jlQpQp','extend','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.',';\x20found\x20','keys','before','288853CDKGuW','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','str','isSafeInteger','join','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','enableAutoSync','length','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20',';\x20independent\x20deployment\x20not\x20verified.','cookie','validation','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','14817393yTDtCh','.\x20Refusing\x20update.','entries','expectedHash','https:','nextExtend','map','directDbEnabled','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','test','11RtxGKl',']\x20must\x20be\x20a\x20URL\x20string.','76389990Uyhcsi','skinColor','resources[','isArray','trim','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','expected-hash','28CEVmpA','not\x20HTTPS','\x20contains\x20invalid\x20JSON.','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','7965672LveTxf','accessKey'];a178_0x2cc3=function(){return _0x3f5f52;};return a178_0x2cc3();}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_0x4c9f97(0x179),a178_0x4c9f97(0x197),a178_0x4c9f97(0x185),a178_0x4c9f97(0x19c),a178_0x4c9f97(0x19e),a178_0x4c9f97(0x18a),a178_0x4c9f97(0x1a1),a178_0x4c9f97(0x165),'directDbId',a178_0x4c9f97(0x173)]);function parseObject(_0x1593ca,_0x475cd1){const _0xc8935e=a178_0x4c9f97;let _0x5591e6=_0x1593ca;if(typeof _0x1593ca===_0xc8935e(0x19b))try{_0x5591e6=JSON[_0xc8935e(0x190)](_0x1593ca);}catch{throw CliErrors['validation'](_0x475cd1+_0xc8935e(0x181));}if(!_0x5591e6||typeof _0x5591e6!==_0xc8935e(0x18b)||Array[_0xc8935e(0x17b)](_0x5591e6))throw CliErrors[_0xc8935e(0x16a)](_0x475cd1+_0xc8935e(0x19d));return _0x5591e6;}function parseArray(_0x2f1ec0,_0x3c2211){const _0x5e837d=a178_0x4c9f97;let _0x3fbdd5;try{_0x3fbdd5=JSON['parse'](_0x2f1ec0);}catch{throw CliErrors['validation'](_0x3c2211+_0x5e837d(0x181));}if(!Array[_0x5e837d(0x17b)](_0x3fbdd5))throw CliErrors[_0x5e837d(0x16a)](_0x3c2211+_0x5e837d(0x186));return _0x3fbdd5[_0x5e837d(0x172)]((_0x337a64,_0x2ea8cb)=>parseObject(_0x337a64,_0x3c2211+'['+_0x2ea8cb+']'));}function validateResources(_0x374870){const _0x2bf1d8=a178_0x4c9f97;if(_0x374870[_0x2bf1d8(0x166)]===0x0)throw CliErrors[_0x2bf1d8(0x16a)](_0x2bf1d8(0x17d));for(const [_0x229ca8,_0x468fd7]of _0x374870[_0x2bf1d8(0x16e)]()){if(typeof _0x468fd7!==_0x2bf1d8(0x19b))throw CliErrors['validation'](_0x2bf1d8(0x17a)+_0x229ca8+_0x2bf1d8(0x177));try{if(new URL(_0x468fd7)['protocol']!==_0x2bf1d8(0x170))throw new Error(_0x2bf1d8(0x180));}catch{throw CliErrors['validation'](_0x2bf1d8(0x17a)+_0x229ca8+']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.');}}if(new Set(_0x374870)['size']!==_0x374870[_0x2bf1d8(0x166)]||!_0x374870['some'](_0x4dcaa7=>/\.m?js(?:[?#]|$)/i[_0x2bf1d8(0x175)](_0x4dcaa7)))throw CliErrors['validation']('Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.');return _0x374870;}function a178_0x1be7(_0x3fb9f8,_0x197be8){_0x3fb9f8=_0x3fb9f8-0x157;const _0x2cc33a=a178_0x2cc3();let _0x1be7d4=_0x2cc33a[_0x3fb9f8];return _0x1be7d4;}function prepare(_0x3ee00d,_0x516144,_0x4f6076){const _0x270c33=a178_0x4c9f97;if(!Number[_0x270c33(0x162)](_0x3ee00d['id'])||(_0x3ee00d['id']??0x0)<=0x0||typeof _0x3ee00d[_0x270c33(0x18c)]!=='string'||!_0x3ee00d[_0x270c33(0x18c)])throw CliErrors['validation'](_0x270c33(0x16b));const _0x21a477=parseObject(_0x3ee00d[_0x270c33(0x15a)],_0x270c33(0x1a4)),_0x3e679a=Object[_0x270c33(0x15d)](_0x21a477)['filter'](_0xdd65=>!KNOWN_EXTEND_KEYS[_0x270c33(0x1a7)](_0xdd65));if(_0x3e679a[_0x270c33(0x166)])throw CliErrors[_0x270c33(0x16a)](_0x270c33(0x187)+_0x3e679a[_0x270c33(0x163)](',\x20')+_0x270c33(0x16d));if(typeof _0x21a477[_0x270c33(0x19c)]!==_0x270c33(0x19b))throw CliErrors[_0x270c33(0x16a)](_0x270c33(0x182));const _0x257d0e=parseArray(_0x21a477[_0x270c33(0x19c)],'app.extend.assets'),_0x312c53=_0x257d0e[_0x270c33(0x1a0)](_0x2aaafc=>_0x2aaafc['appName']===_0x516144);if(_0x312c53['length']!==0x1)throw CliErrors['validation'](_0x270c33(0x167)+_0x516144+_0x270c33(0x15c)+_0x312c53[_0x270c33(0x166)]+'.');const _0x4721d3=_0x312c53[0x0];if(typeof _0x4721d3['resources']!==_0x270c33(0x19b))throw CliErrors[_0x270c33(0x16a)](_0x270c33(0x164));let _0x582d87;try{_0x582d87=JSON['parse'](_0x4721d3['resources']);}catch{throw CliErrors[_0x270c33(0x16a)](_0x270c33(0x188));}if(!Array[_0x270c33(0x17b)](_0x582d87)||_0x582d87[_0x270c33(0x195)](_0xcf3f38=>typeof _0xcf3f38!=='string'))throw CliErrors['validation'](_0x270c33(0x183));const _0x48b493=_0x257d0e[_0x270c33(0x172)](_0x1fa6f0=>_0x1fa6f0===_0x4721d3?{..._0x1fa6f0,'resources':JSON['stringify'](_0x4f6076)}:_0x1fa6f0),_0x20b384={..._0x21a477,'assets':JSON[_0x270c33(0x1a5)](_0x48b493)},_0x27dbf5=createHash(_0x270c33(0x18e))[_0x270c33(0x18f)](JSON[_0x270c33(0x1a5)]({'appCode':_0x3ee00d[_0x270c33(0x199)],'id':_0x3ee00d['id'],'appPublishStatus':_0x3ee00d['appPublishStatus'],'extend':_0x21a477,'appName':_0x516144,'resources':_0x4f6076}))['digest']('hex');return{'before':_0x582d87,'nextExtend':_0x20b384,'expectedHash':_0x27dbf5,'unchanged':isDeepStrictEqual(_0x582d87,_0x4f6076)};}function flags(_0x57f969){const _0x531113=a178_0x4c9f97,{appCode:_0x339b87,appName:_0x57e1ee}=getSubappSelector(_0x57f969),_0xa55627=_0x57f969[_0x531113(0x161)](_0x531113(0x194))[_0x531113(0x17c)]();if(!_0xa55627)throw CliErrors[_0x531113(0x16a)]('--resources\x20is\x20required.');let _0x469f80;try{_0x469f80=JSON['parse'](_0xa55627);}catch{throw CliErrors[_0x531113(0x16a)]('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');}if(!Array[_0x531113(0x17b)](_0x469f80))throw CliErrors[_0x531113(0x16a)]('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');return{'appCode':_0x339b87,'appName':_0x57e1ee,'resources':validateResources(_0x469f80)};}export const menuSubappAssetsUpdate={'service':'menu','command':a178_0x4c9f97(0x192),'description':'Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','risk':a178_0x4c9f97(0x158),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a178_0x4c9f97(0x194),'type':a178_0x4c9f97(0x19b),'required':!![],'description':'JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs'},{'name':a178_0x4c9f97(0x17e),'type':a178_0x4c9f97(0x19b),'description':a178_0x4c9f97(0x160)}],async 'validate'(_0x130661){flags(_0x130661);},async 'dryRun'(_0x303526){const _0x36e59c=a178_0x4c9f97,{appCode:_0x4857bf,appName:_0x703dd5,resources:_0x33cba9}=flags(_0x303526),_0x186e61=await getSmartAppRecord(_0x4857bf,_0x303526[_0x36e59c(0x169)]),_0x375fe5=prepare(_0x186e61,_0x703dd5,_0x33cba9);return{'method':_0x36e59c(0x193),'url':'/smartapi/app/update','body':{'preview':{'appCode':_0x4857bf,'appName':_0x703dd5,'before':_0x375fe5[_0x36e59c(0x15e)],'after':_0x33cba9,'expectedHash':_0x375fe5[_0x36e59c(0x16f)],'unchanged':_0x375fe5['unchanged'],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x375fe5[_0x36e59c(0x196)]?_0x36e59c(0x15b):_0x36e59c(0x1a6)+_0x703dd5+'.'};},async 'execute'(_0x3ad7ac){const _0x1ae34d=a178_0x4c9f97,{appCode:_0x40b2dc,appName:_0x130e2b,resources:_0xb1ee7}=flags(_0x3ad7ac),_0x11f02a=_0x3ad7ac['str'](_0x1ae34d(0x17e))['trim']();if(!/^[a-f0-9]{64}$/i['test'](_0x11f02a))throw CliErrors['validation'](_0x1ae34d(0x19f));const _0x2e60d2=await getSmartAppRecord(_0x40b2dc,_0x3ad7ac[_0x1ae34d(0x169)]),_0x11b24e=prepare(_0x2e60d2,_0x130e2b,_0xb1ee7);if(_0x11f02a!==_0x11b24e[_0x1ae34d(0x16f)])throw CliErrors[_0x1ae34d(0x16a)](_0x1ae34d(0x191));if(_0x11b24e[_0x1ae34d(0x196)])return{'ok':!![],'data':{'appCode':_0x40b2dc,'appName':_0x130e2b,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x1ae34d(0x174)};await updateSmartAppRecord({'id':_0x2e60d2['id'],'appCode':_0x40b2dc,'appPublishStatus':_0x2e60d2[_0x1ae34d(0x18c)],'extend':_0x11b24e[_0x1ae34d(0x171)]},_0x3ad7ac[_0x1ae34d(0x169)]);const _0x11eff1=await getSmartAppRecord(_0x40b2dc,_0x3ad7ac['cookie']),_0x4d64d0=parseObject(_0x11eff1[_0x1ae34d(0x15a)],_0x1ae34d(0x1a2));if(_0x11eff1['id']!==_0x2e60d2['id']||_0x11eff1['appPublishStatus']!==_0x2e60d2['appPublishStatus']||!isDeepStrictEqual(_0x4d64d0,_0x11b24e[_0x1ae34d(0x171)]))throw CliErrors[_0x1ae34d(0x157)](_0x1ae34d(0x198));return{'ok':!![],'data':{'appCode':_0x40b2dc,'appName':_0x130e2b,'updated':!![],'resources':_0xb1ee7,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':'Updated\x20shared\x20resources\x20for\x20'+_0x130e2b+'\x20in\x20menu\x20host\x20'+_0x40b2dc+_0x1ae34d(0x168)};}};
|
|
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 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a179_0x1517b2=a179_0x2039;(function(_0x3feb0d,_0xf526bb){const _0x46df52=a179_0x2039,_0x2bf329=_0x3feb0d();while(!![]){try{const _0x2b808c=-parseInt(_0x46df52(0x15e))/0x1*(-parseInt(_0x46df52(0x17f))/0x2)+-parseInt(_0x46df52(0x155))/0x3*(-parseInt(_0x46df52(0x15f))/0x4)+parseInt(_0x46df52(0x195))/0x5+parseInt(_0x46df52(0x187))/0x6+-parseInt(_0x46df52(0x15c))/0x7*(parseInt(_0x46df52(0x151))/0x8)+parseInt(_0x46df52(0x188))/0x9*(-parseInt(_0x46df52(0x170))/0xa)+-parseInt(_0x46df52(0x175))/0xb*(-parseInt(_0x46df52(0x197))/0xc);if(_0x2b808c===_0xf526bb)break;else _0x2bf329['push'](_0x2bf329['shift']());}catch(_0x5a4cd5){_0x2bf329['push'](_0x2bf329['shift']());}}}(a179_0x5bdb,0x1f1ee));import a179_0x3915cf 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';function a179_0x2039(_0x4a9c3e,_0x158481){_0x4a9c3e=_0x4a9c3e-0x150;const _0x5bdba7=a179_0x5bdb();let _0x2039e2=_0x5bdba7[_0x4a9c3e];return _0x2039e2;}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';import{isInProject}from'../../context.js';import{assertSharedResourcesConfigured}from'../../commands/menu/shared/subapp-assets.js';export const menuSync={'service':a179_0x1517b2(0x153),'command':a179_0x1517b2(0x179),'description':a179_0x1517b2(0x167),'risk':a179_0x1517b2(0x17c),'flags':[{'name':a179_0x1517b2(0x16c),'type':'string','description':a179_0x1517b2(0x198)+'JSON:\x20{\x22appName\x22:\x22store-app\x22,\x22parentId\x22:42,\x22visible\x22:false};\x20jsUrl\x20and\x20cssUrl\x20remain\x20available\x20for\x20individual\x20menu\x20resources.'},{'name':'paths','type':a179_0x1517b2(0x18a),'description':a179_0x1517b2(0x178)},{'name':'yes','type':a179_0x1517b2(0x19d),'description':a179_0x1517b2(0x174)}],async 'dryRun'(_0x118ad2){const _0x265191=a179_0x1517b2;ensureRunnableContext(_0x118ad2[_0x265191(0x173)],_0x118ad2[_0x265191(0x185)]);const _0x10c3bf=await runMenuSyncCore(_0x118ad2[_0x265191(0x152)],_0x118ad2['cookie'],parsePaths(_0x118ad2[_0x265191(0x189)](_0x265191(0x177))),_0x118ad2['str'](_0x265191(0x16c)),{'dryRun':!![]});return{'method':_0x265191(0x157),'url':'/smartapi/menu/create','body':_0x10c3bf,'description':_0x10c3bf['skipped']?_0x265191(0x180):_0x265191(0x16d)+_0x10c3bf[_0x265191(0x16e)][_0x265191(0x162)]+_0x265191(0x17a)};},async 'execute'(_0x5357d2){const _0x31dacb=a179_0x1517b2;ensureRunnableContext(_0x5357d2[_0x31dacb(0x173)],_0x5357d2['selectedAppName']);const _0x30ac81=_0x5357d2[_0x31dacb(0x17b)](_0x31dacb(0x154)),_0x557675=_0x5357d2[_0x31dacb(0x189)]('params'),_0x21d442=parsePaths(_0x5357d2['str'](_0x31dacb(0x177))),_0x11b53e=parseMenuSyncParams(_0x557675);if(_0x30ac81){const _0x57f1aa=await runMenuSyncCore(_0x5357d2[_0x31dacb(0x152)],_0x5357d2[_0x31dacb(0x19b)],_0x21d442,_0x557675);if(_0x57f1aa[_0x31dacb(0x17e)]){const _0x6b6df7=getLocalPages();_0x6b6df7[_0x31dacb(0x162)]===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0x31dacb(0x150));}else writeCliSideChannelLine(_0x31dacb(0x163)+_0x57f1aa['created']+_0x31dacb(0x172));return{'ok':!![],'data':_0x57f1aa,'message':_0x57f1aa[_0x31dacb(0x17e)]?_0x31dacb(0x16f):_0x31dacb(0x191)+_0x57f1aa[_0x31dacb(0x181)]+_0x31dacb(0x159)};}if(_0x21d442[_0x31dacb(0x162)]>0x0)throw CliErrors[_0x31dacb(0x192)](_0x31dacb(0x18c),'Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');if(!isInteractive()&&_0x557675)throw CliErrors[_0x31dacb(0x192)]('Non-interactive\x20menu\x20sync\x20requires\x20--yes.',_0x31dacb(0x176));requireInteractive(),writeCliSideChannelLine(_0x31dacb(0x18e));const _0x537045=startSpinner(_0x31dacb(0x199));let _0x1baf40,_0x34b6e7,_0x230f54;try{const _0x5c4686=await fetchMenuData(_0x5357d2[_0x31dacb(0x152)],_0x5357d2[_0x31dacb(0x19b)]);_0x1baf40=_0x5c4686[_0x31dacb(0x168)],_0x34b6e7=_0x5c4686[_0x31dacb(0x19c)],_0x230f54=_0x5c4686[_0x31dacb(0x15a)],stopSpinner(_0x537045,_0x31dacb(0x17d),!![]);}catch(_0x3877ea){stopSpinner(_0x537045,_0x31dacb(0x190),![]);throw CliErrors[_0x31dacb(0x192)](_0x3877ea instanceof Error?_0x3877ea['message']:_0x31dacb(0x190));}if(_0x1baf40[_0x31dacb(0x162)]===0x0)return writeCliSideChannelLine(a179_0x3915cf['yellow'](_0x31dacb(0x169))),{'ok':!![]};const _0x554921=buildCompareRows(_0x1baf40,_0x34b6e7);writeCliSideChannelLine(renderCompareTable(_0x554921)),writeCliSideChannelLine('');const _0x507d72=await selectPages(_0x1baf40,_0x34b6e7);writeCliSideChannelLine(''),writeCliSideChannelLine(a179_0x3915cf['cyan'](_0x31dacb(0x15b)+_0x507d72['length']+_0x31dacb(0x160)));const _0x485b9b=_0x11b53e[_0x31dacb(0x184)]&&_0x11b53e[_0x31dacb(0x156)];if(!_0x485b9b){writeCliSideChannelLine(renderSyncSummary(_0x507d72,_0x34b6e7[_0x31dacb(0x164)]>0x0));const _0x4da0a5=await askConfirm('\x20\x20Continue\x20with\x20creation?');if(!_0x4da0a5)return writeCliSideChannelLine(a179_0x3915cf[_0x31dacb(0x18b)](_0x31dacb(0x171))),{'ok':!![]};}let _0x289ade=_0x11b53e[_0x31dacb(0x184)],_0xbf604f=_0x11b53e[_0x31dacb(0x156)];!_0x289ade&&!_0x11b53e[_0x31dacb(0x18f)]&&(_0x289ade=await askJsUrl());!_0xbf604f&&!_0x11b53e[_0x31dacb(0x18f)]&&(_0xbf604f=await askCssUrl());const _0xb322b2=await askConfirm(_0x11b53e[_0x31dacb(0x18f)]?_0x31dacb(0x158)+_0x507d72['length']+'\x20menu(s)\x20bound\x20to\x20'+_0x11b53e[_0x31dacb(0x18f)]+'?':'\x20\x20Create\x20'+_0x507d72[_0x31dacb(0x162)]+_0x31dacb(0x183)+_0x289ade+'\x20and\x20CSS:\x20'+_0xbf604f+'?');if(!_0xb322b2)return writeCliSideChannelLine(a179_0x3915cf[_0x31dacb(0x18b)](_0x31dacb(0x171))),{'ok':!![]};const _0x31ca29=[_0x289ade,_0xbf604f][_0x31dacb(0x194)](_0x2a5760=>Boolean(_0x2a5760));_0x11b53e['appName']&&_0x31ca29[_0x31dacb(0x162)]===0x0&&await assertSharedResourcesConfigured(_0x5357d2[_0x31dacb(0x152)],_0x5357d2[_0x31dacb(0x19b)],_0x11b53e[_0x31dacb(0x18f)]);const _0x1d11fb=startSpinner(_0x31dacb(0x186)+_0x507d72[_0x31dacb(0x162)]+_0x31dacb(0x19a));try{const _0x2ea2cc=_0x507d72[_0x31dacb(0x19e)](_0x3afb26=>resolvePage(_0x3afb26,_0x11b53e,_0x230f54)),_0xf0b48d=await doCreateMenus(_0x5357d2[_0x31dacb(0x152)],_0x5357d2['cookie'],_0x2ea2cc,_0x31ca29,_0x11b53e[_0x31dacb(0x18f)]?{'appName':_0x11b53e[_0x31dacb(0x18f)]}:undefined);return stopSpinner(_0x1d11fb,'Created\x20'+_0xf0b48d['created']+_0x31dacb(0x182),!![]),{'ok':!![],'data':_0xf0b48d,'message':_0x31dacb(0x191)+_0xf0b48d[_0x31dacb(0x181)]+_0x31dacb(0x15d)+_0xf0b48d[_0x31dacb(0x161)]+'\x20failed.'};}catch(_0x46f146){stopSpinner(_0x1d11fb,_0x31dacb(0x16a),![]);throw CliErrors[_0x31dacb(0x192)](_0x46f146 instanceof Error?_0x46f146[_0x31dacb(0x165)]:_0x31dacb(0x16a));}}};function ensureRunnableContext(_0x2c9843,_0x3e80c4){const _0x437b3c=a179_0x1517b2,_0x2a7912=_0x2c9843[_0x437b3c(0x18d)]?String(_0x2c9843[_0x437b3c(0x18d)])[_0x437b3c(0x16b)]():'';if(!isInProject()&&!_0x3e80c4&&!_0x2a7912)throw CliErrors[_0x437b3c(0x192)](_0x437b3c(0x193)+_0x437b3c(0x196));}function a179_0x5bdb(){const _0x455d8f=['Register\x20local\x20pages\x20as\x20platform\x20menus','localPages','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','Menu\x20creation\x20failed','trim','params','Would\x20create\x20','targetPages','Menu\x20sync\x20skipped','85010XtmHyH','\x20\x20Cancelled.','\x20menu(s)\x20created','rawFlags','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','594PdiSdx','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','paths','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','sync','\x20local\x20microfrontend\x20menu(s).','flag','write','Online\x20menu\x20list\x20fetched','skipped','4PJKFzJ','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','created','\x20menu(s)','\x20menu(s)\x20with\x20JS:\x20','jsUrl','selectedAppName','Creating\x20','357342zQoBGR','234pzCXwQ','str','string','gray','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','appcode','Tip:\x20For\x20frontend\x20subapps,\x20prefer\x20Agent-planned\x20menu\x20groups\x20and\x20shared\x20resources.\x20This\x20manual\x20sync\x20workflow\x20remains\x20available\x20as\x20a\x20fallback.','appName','Failed\x20to\x20fetch\x20online\x20menu\x20list','Menu\x20sync\x20completed:\x20','validation','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','filter','459265iyYfyl','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','32952WAyYae','Prefer\x20appName\x20for\x20shared\x20subapp\x20resources\x20and\x20parentId\x20for\x20planned\x20groups.\x20','Fetching\x20online\x20menu\x20list...','\x20menu(s)...','cookie','onlinePaths','boolean','map','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','1181176IGVeka','appCode','menu','yes','13551JshiVl','cssUrl','POST','\x20\x20Create\x20','\x20created.','onlineMenuList','\x20\x20✓\x20Selected:\x20','7ZSCXhk','\x20created,\x20','28211SRUfoL','124CnYTEq','\x20page(s)','failed','length','✓\x20Menu\x20sync\x20completed:\x20','size','message','split'];a179_0x5bdb=function(){return _0x455d8f;};return a179_0x5bdb();}function parsePaths(_0x381a31){const _0x3057b1=a179_0x1517b2;return[...new Set(_0x381a31[_0x3057b1(0x166)](',')['map'](_0x59f2b2=>_0x59f2b2['trim']())[_0x3057b1(0x194)](Boolean))];}
|