@lovrabet/rabetbase-cli 2.5.4 → 2.5.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/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 +2 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +35 -0
- package/skills/rabetbase-page-generation/references/component-baseline.md +18 -0
- package/skills/rabetbase-page-generation/references/generation.md +77 -0
- package/skills/rabetbase-page-generation/templates/onepage/build.mjs +63 -0
- package/skills/rabetbase-page-generation/templates/onepage/create/README.md +20 -0
- package/skills/rabetbase-page-generation/templates/onepage/create/index.jsx +4 -0
- package/skills/rabetbase-page-generation/templates/onepage/create/preview.png +0 -0
- package/skills/rabetbase-page-generation/templates/onepage/detail/README.md +20 -0
- package/skills/rabetbase-page-generation/templates/onepage/detail/index.jsx +194 -0
- package/skills/rabetbase-page-generation/templates/onepage/detail/preview.png +0 -0
- package/skills/rabetbase-page-generation/templates/onepage/list/README.md +20 -0
- package/skills/rabetbase-page-generation/templates/onepage/list/index.jsx +717 -0
- package/skills/rabetbase-page-generation/templates/onepage/list/preview.png +0 -0
- package/skills/rabetbase-page-generation/templates/onepage/shared/editor.jsx +395 -0
- package/skills/rabetbase-page-generation/templates/onepage/shared/model.js +141 -0
- package/skills/rabetbase-page-generation/templates/onepage/shared/page.css +377 -0
- package/skills/rabetbase-page-generation/templates/onepage/shared/record-layout.jsx +90 -0
- package/skills/rabetbase-page-generation/templates/onepage/shared/responsive.jsx +70 -0
- package/skills/rabetbase-page-generation/templates/onepage/update/README.md +21 -0
- package/skills/rabetbase-page-generation/templates/onepage/update/index.jsx +4 -0
- package/skills/rabetbase-page-generation/templates/onepage/update/preview.png +0 -0
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a169_0x36feb0=a169_0x9ecc;(function(_0x200ce4,_0x4e5e4d){const _0x23b9d2=a169_0x9ecc,_0x3a02aa=_0x200ce4();while(!![]){try{const _0x17bb4a=parseInt(_0x23b9d2(0x1b1))/0x1*(-parseInt(_0x23b9d2(0x1ac))/0x2)+-parseInt(_0x23b9d2(0x1c9))/0x3+-parseInt(_0x23b9d2(0x1f9))/0x4*(parseInt(_0x23b9d2(0x20a))/0x5)+parseInt(_0x23b9d2(0x1d5))/0x6*(parseInt(_0x23b9d2(0x1d6))/0x7)+-parseInt(_0x23b9d2(0x1af))/0x8+-parseInt(_0x23b9d2(0x1c8))/0x9*(parseInt(_0x23b9d2(0x1ab))/0xa)+parseInt(_0x23b9d2(0x1f8))/0xb*(parseInt(_0x23b9d2(0x1bc))/0xc);if(_0x17bb4a===_0x4e5e4d)break;else _0x3a02aa['push'](_0x3a02aa['shift']());}catch(_0x200728){_0x3a02aa['push'](_0x3a02aa['shift']());}}}(a169_0xe3b5,0xa2c08));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_0x36feb0(0x1c7),'required':!![],'description':a169_0x36feb0(0x208)};function a169_0xe3b5(){const _0x511bd6=['Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','snapshotHash','unknown','get','\x20is\x20type\x20\x22','type','cookie','defineProperty','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','failed','warnings','num','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','Exact\x20online\x20menu\x20id','code','5WORcqB','Menu\x20','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','byId','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','before','targets','isSafeInteger','verification','\x22,\x20not\x20folder.','recheck\x20online\x20menu\x20facts\x20before\x20','backend','parentId','parent-id','cascade','hasOwnProperty','5414740mRfBLU','2tstknF','appCode','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','4311496sZtovc','data','746839gwVtEw','test','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','menu_sort_overflow',',\x20current\x20','menu_sort_invalid','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','\x20menu\x20','expect-parent-id','Permission\x20denied\x20while\x20attempting\x20to\x20','toLowerCase','3636czULju','operation','pre-write-recheck','Reorder\x20sibling\x20menus\x20below\x20','read\x20online\x20menu\x20facts\x20before\x20','path','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','sort','succeeded','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','number','9eTyOEv','3126195PDmFZm','expect-path','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','plannedActions','length','selector','menu_verification_failed','menu_not_found','folder','validation','str','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','6yBnPHK','4151294CkVMnE','api_error','trim','failedRecords','deleteOrder','planFile','Online\x20menu\x20not\x20found:\x20','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','flagMissing','\x20parent\x20changed:\x20expected\x20','menu_confirmation_required','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','menu_state_drift','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','string','after','rawFlags',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','required','\x20child\x20count\x20changed:\x20expected\x20','root','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','Cannot\x20append\x20a\x20','Online\x20menu\x20state\x20changed\x20before\x20','max','expected-children-count','filter','hash','menu_mutation_failed','stringify','message','bool','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','menu_parent_not_folder','130658MVVZrM','2624516QPCphm','hint'];a169_0xe3b5=function(){return _0x511bd6;};return a169_0xe3b5();}export const MENU_SORT_FLAG={'name':a169_0x36feb0(0x1c3),'type':a169_0x36feb0(0x1c7),'description':'Sibling\x20sort\x20value\x20(non-negative\x20integer)'};export const MENU_PARENT_ID_FLAG={'name':a169_0x36feb0(0x1a8),'type':'string','description':a169_0x36feb0(0x20c)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a169_0x36feb0(0x1b9),'type':a169_0x36feb0(0x1e4),'description':a169_0x36feb0(0x203)};function a169_0x9ecc(_0x2e785e,_0xa07085){_0x2e785e=_0x2e785e-0x1a7;const _0xe3b594=a169_0xe3b5();let _0x9eccdf=_0xe3b594[_0x2e785e];return _0x9eccdf;}export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':'expect-path','type':'string','description':a169_0x36feb0(0x1b7)},{'name':a169_0x36feb0(0x1ef),'type':a169_0x36feb0(0x1c7),'description':a169_0x36feb0(0x1e3)}];export function validateExactId(_0x4c36a7){const _0x1fe91f=a169_0x36feb0,_0x4e1b10=_0x4c36a7['num']('id');if(!Number[_0x1fe91f(0x211)](_0x4e1b10)||_0x4e1b10<=0x0)throw CliErrors[_0x1fe91f(0x1d2)](_0x1fe91f(0x1e1));return _0x4e1b10;}export function validateSort(_0x1f3349,_0x37b61b=a169_0x36feb0(0x1c3)){const _0x521471=a169_0x36feb0;if(!hasFlag(_0x1f3349,_0x37b61b))return undefined;const _0x1583e5=_0x1f3349[_0x521471(0x206)](_0x37b61b);if(!Number['isSafeInteger'](_0x1583e5)||_0x1583e5<0x0||_0x1583e5>MAX_MENU_SORT)throw menuError(_0x521471(0x1b6),'--'+_0x37b61b+_0x521471(0x1dd)+MAX_MENU_SORT+'.',_0x521471(0x207));return _0x1583e5;}export function nextSiblingSort(_0x325bb0,_0x4ec24b,_0x40c6a1){const _0x350ee4=a169_0x36feb0,_0x15e105=getChildren(_0x325bb0,_0x4ec24b)['map'](_0x401a7c=>_0x401a7c[_0x350ee4(0x1c3)])[_0x350ee4(0x1f0)](_0x34c861=>typeof _0x34c861===_0x350ee4(0x1c7));if(_0x15e105[_0x350ee4(0x1cd)]===0x0)return 0x0;const _0x27da21=Math[_0x350ee4(0x1ee)](..._0x15e105);if(_0x27da21>=MAX_MENU_SORT)throw menuError(_0x350ee4(0x1b4),_0x350ee4(0x1ec)+_0x40c6a1+_0x350ee4(0x1d4)+_0x27da21+'.',_0x350ee4(0x1bf)+MAX_MENU_SORT+',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.');return _0x27da21+0x1;}export function requireExplicitYes(_0x36cc0f){const _0x2ebe08=a169_0x36feb0;if(_0x36cc0f[_0x2ebe08(0x1f5)]('dry-run'))return;if(!_0x36cc0f['bool']('yes'))throw menuError(_0x2ebe08(0x1e0),_0x2ebe08(0x1c5),_0x2ebe08(0x1c2));}export async function fetchMutationSnapshot(_0x101b95,_0x1de1fd,_0x228ecd){const _0x2ec776=a169_0x36feb0;try{return await fetchMenuSnapshot(_0x101b95[_0x2ec776(0x1ad)],_0x101b95[_0x2ec776(0x201)]);}catch(_0x50a947){throw mapMenuApiError(_0x50a947,_0x2ec776(0x1c0)+_0x1de1fd,_0x228ecd);}}export async function recheckMutationSnapshot(_0x2fa97c,_0x73e30e,_0x532016,_0x264949){const _0x1feab7=a169_0x36feb0;let _0x525e3a;try{_0x525e3a=await fetchMenuSnapshot(_0x2fa97c[_0x1feab7(0x1ad)],_0x2fa97c['cookie']);}catch(_0x1c6530){const _0x2e7c42=mapMenuApiError(_0x1c6530,_0x1feab7(0x214)+_0x532016,_0x264949);throw menuFailure(_0x2e7c42,_0x73e30e,{'stage':_0x1feab7(0x1be),'failed':_0x264949==null?{}:{'id':_0x264949}});}if(_0x525e3a[_0x1feab7(0x1f1)]!==_0x73e30e[_0x1feab7(0x1fc)]){const _0x4dd25b=menuError(_0x1feab7(0x1e2),_0x1feab7(0x1ed)+_0x532016+_0x1feab7(0x1e7),_0x1feab7(0x20e));throw menuFailure(_0x4dd25b,_0x73e30e,{'stage':_0x1feab7(0x1be),'failed':{..._0x264949==null?{}:{'id':_0x264949},'expectedSnapshotHash':_0x73e30e[_0x1feab7(0x1fc)],'currentSnapshotHash':_0x525e3a['hash']}});}return _0x525e3a;}export function parseParentId(_0x28b022,_0x39c4f6,_0x1ea72a={}){const _0x4d39d8=a169_0x36feb0;if(!hasFlag(_0x28b022,_0x39c4f6)){if(_0x1ea72a[_0x4d39d8(0x1e8)])throw CliErrors[_0x4d39d8(0x1de)](_0x39c4f6);return undefined;}const _0x1f4a55=_0x28b022[_0x4d39d8(0x1d3)](_0x39c4f6)[_0x4d39d8(0x1d8)]();if(_0x1f4a55[_0x4d39d8(0x1bb)]()===_0x4d39d8(0x1ea))return null;if(!/^\d+$/[_0x4d39d8(0x1b2)](_0x1f4a55))throw CliErrors['validation']('--'+_0x39c4f6+_0x4d39d8(0x1f6));const _0x64c80a=Number(_0x1f4a55);if(!Number['isSafeInteger'](_0x64c80a)||_0x64c80a<=0x0)throw CliErrors[_0x4d39d8(0x1d2)]('--'+_0x39c4f6+_0x4d39d8(0x1f6));return _0x64c80a;}export function requireMenu(_0x458666,_0x1c2033){const _0x58ac26=a169_0x36feb0,_0x1000c2=_0x458666[_0x58ac26(0x20d)][_0x58ac26(0x1fe)](_0x1c2033);if(!_0x1000c2)throw menuError(_0x58ac26(0x1d0),_0x58ac26(0x1dc)+_0x1c2033,'Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.');return _0x1000c2;}export function requireFolder(_0x1d4910,_0x36a31f){const _0x213dbe=a169_0x36feb0,_0x3b271f=requireMenu(_0x1d4910,_0x36a31f);if(_0x3b271f[_0x213dbe(0x200)]!==_0x213dbe(0x1d1))throw menuError(_0x213dbe(0x1f7),'Menu\x20'+_0x36a31f+_0x213dbe(0x1ff)+(_0x3b271f[_0x213dbe(0x200)]||_0x213dbe(0x1fd))+_0x213dbe(0x213),_0x213dbe(0x1ae));return _0x3b271f;}export function assertExpectedState(_0x467d49,_0x1e6662){const _0x14a156=a169_0x36feb0;if(hasFlag(_0x467d49,_0x14a156(0x1b9))){const _0x1ca48e=parseParentId(_0x467d49,'expect-parent-id',{'required':!![]});if(_0x1e6662[_0x14a156(0x1a7)]!==_0x1ca48e)throw stateDrift(_0x14a156(0x20b)+_0x1e6662['id']+_0x14a156(0x1df)+formatParent(_0x1ca48e)+_0x14a156(0x1b5)+formatParent(_0x1e6662[_0x14a156(0x1a7)])+'.');}if(hasFlag(_0x467d49,_0x14a156(0x1ca))){const _0x24f871=_0x467d49['str'](_0x14a156(0x1ca));if(_0x1e6662[_0x14a156(0x1c1)]!==_0x24f871)throw stateDrift(_0x14a156(0x20b)+_0x1e6662['id']+'\x20path\x20changed:\x20expected\x20'+JSON[_0x14a156(0x1f3)](_0x24f871)+_0x14a156(0x1b5)+JSON[_0x14a156(0x1f3)](_0x1e6662[_0x14a156(0x1c1)])+'.');}if(hasFlag(_0x467d49,_0x14a156(0x1ef))){const _0x25ac98=_0x467d49['num'](_0x14a156(0x1ef));if(!Number['isSafeInteger'](_0x25ac98)||_0x25ac98<0x0)throw CliErrors[_0x14a156(0x1d2)]('--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.');if(_0x1e6662['childrenCount']!==_0x25ac98)throw stateDrift(_0x14a156(0x20b)+_0x1e6662['id']+_0x14a156(0x1e9)+_0x25ac98+_0x14a156(0x1b5)+_0x1e6662['childrenCount']+'.');}}export function assertVerified(_0x1917df,_0x260b4e,_0x125a0f=a169_0x36feb0(0x1eb)){const _0x433630=a169_0x36feb0;if(!_0x1917df)throw menuError(_0x433630(0x1cf),_0x260b4e,_0x125a0f);}export function mutationResult(_0x4003f0){const _0x24cf2d=a169_0x36feb0;return{'operation':_0x4003f0[_0x24cf2d(0x1bd)],'selector':_0x4003f0[_0x24cf2d(0x1ce)],'before':_0x4003f0[_0x24cf2d(0x20f)],'after':_0x4003f0['after'],'dryRun':_0x4003f0['dryRun'],'backend':_0x4003f0[_0x24cf2d(0x215)],..._0x4003f0[_0x24cf2d(0x1cc)]?{'plannedActions':_0x4003f0[_0x24cf2d(0x1cc)]}:{},..._0x4003f0[_0x24cf2d(0x210)]?{'targets':_0x4003f0[_0x24cf2d(0x210)]}:{},..._0x4003f0[_0x24cf2d(0x1da)]?{'deleteOrder':_0x4003f0[_0x24cf2d(0x1da)]}:{},'snapshotHash':_0x4003f0[_0x24cf2d(0x1fc)],..._0x4003f0[_0x24cf2d(0x1a9)]?{'cascade':_0x4003f0[_0x24cf2d(0x1a9)]}:{},..._0x4003f0[_0x24cf2d(0x1db)]?{'planFile':_0x4003f0[_0x24cf2d(0x1db)]}:{},'succeeded':_0x4003f0[_0x24cf2d(0x1c4)]??[],'failed':_0x4003f0[_0x24cf2d(0x204)]??[],'warnings':_0x4003f0[_0x24cf2d(0x205)]??[],'verification':_0x4003f0[_0x24cf2d(0x212)],'error':_0x4003f0['error']};}export function menuDryRunResult(_0x70ca08,_0x21708f){return{..._0x70ca08,..._0x21708f};}export function menuFailure(_0x3d2620,_0x36eeb6,_0x38a992){const _0x25c6ba=a169_0x36feb0,_0x53735f=mutationResult({..._0x36eeb6,'after':_0x38a992[_0x25c6ba(0x1e5)]===undefined?_0x36eeb6[_0x25c6ba(0x1e5)]:_0x38a992[_0x25c6ba(0x1e5)],'backend':_0x38a992[_0x25c6ba(0x215)]??_0x36eeb6[_0x25c6ba(0x215)],'dryRun':![],'succeeded':_0x38a992[_0x25c6ba(0x1c4)]??[],'failed':_0x38a992[_0x25c6ba(0x1d9)]??[{..._0x38a992[_0x25c6ba(0x204)]??{},'stage':_0x38a992['stage'],'code':_0x3d2620['code'],'message':_0x3d2620[_0x25c6ba(0x1f4)]}],'warnings':[..._0x36eeb6[_0x25c6ba(0x205)],..._0x38a992[_0x25c6ba(0x205)]??[]],'verification':_0x38a992[_0x25c6ba(0x212)],'error':{'code':_0x3d2620[_0x25c6ba(0x209)],'message':_0x3d2620[_0x25c6ba(0x1f4)],..._0x3d2620['hint']?{'hint':_0x3d2620[_0x25c6ba(0x1fa)]}:{}}});return Object[_0x25c6ba(0x202)](_0x3d2620,_0x25c6ba(0x1b0),{'value':_0x53735f,'enumerable':!![],'configurable':!![]}),_0x3d2620;}export function asVerificationError(_0x5eaa51,_0x1e28e4){const _0x40ed70=a169_0x36feb0;if(_0x5eaa51 instanceof CliError&&_0x5eaa51['code']==='menu_verification_failed')return _0x5eaa51;const _0x5aa2a9=_0x5eaa51 instanceof Error?_0x5eaa51['message']:String(_0x5eaa51);return menuError(_0x40ed70(0x1cf),''+_0x1e28e4+(_0x5aa2a9?':\x20'+_0x5aa2a9:''),_0x40ed70(0x1c6));}export function describeMenuErrorCause(_0x4aa0ee,_0x1b813,_0x26d8b6){const _0x2eb6ed=a169_0x36feb0,_0x5ad991=mapMenuApiError(_0x4aa0ee,_0x1b813,_0x26d8b6);return{'causeCode':_0x5ad991[_0x2eb6ed(0x209)],'causeMessage':_0x5ad991[_0x2eb6ed(0x1f4)]};}export function hasFlag(_0x1ffbe3,_0x15cbd7){const _0x1cbd2f=a169_0x36feb0;return Object['prototype'][_0x1cbd2f(0x1aa)]['call'](_0x1ffbe3[_0x1cbd2f(0x1e6)],_0x15cbd7)&&_0x1ffbe3[_0x1cbd2f(0x1e6)][_0x15cbd7]!==undefined;}export function toApiParentId(_0x210d5d){return _0x210d5d??0x0;}export function formatParent(_0x3e2693){const _0x33d6c4=a169_0x36feb0;return _0x3e2693==null?_0x33d6c4(0x1ea):String(_0x3e2693);}export function menuError(_0x1140d0,_0x2103c2,_0x2b532a){return new CliError(_0x1140d0,0x1,_0x2103c2,_0x2b532a);}export function mapMenuApiError(_0x590d84,_0x14a3e0,_0x57a0e5){const _0x4b2ee9=a169_0x36feb0;if(_0x590d84 instanceof CliError&&_0x590d84['code']!==_0x4b2ee9(0x1d7))return _0x590d84;const _0x31f378=_0x590d84 instanceof Error?_0x590d84['message']:String(_0x590d84);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x4b2ee9(0x1b2)](_0x31f378))return menuError('menu_permission_denied',_0x4b2ee9(0x1ba)+_0x14a3e0+(_0x57a0e5?_0x4b2ee9(0x1b8)+_0x57a0e5:'')+'.',_0x4b2ee9(0x1fb));return menuError(_0x4b2ee9(0x1f2),'Failed\x20to\x20'+_0x14a3e0+(_0x57a0e5?'\x20menu\x20'+_0x57a0e5:'')+':\x20'+_0x31f378,_0x4b2ee9(0x1b3));}export function isMenuResponseLoss(_0x2fa87c){const _0x4fd326=a169_0x36feb0,_0x11940b=_0x2fa87c instanceof Error?_0x2fa87c[_0x4fd326(0x1f4)]:String(_0x2fa87c);if(_0x2fa87c instanceof CliError)return _0x2fa87c[_0x4fd326(0x209)]==='api_error'&&/^Request (?:failed|timeout):/i[_0x4fd326(0x1b2)](_0x11940b);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x4fd326(0x1b2)](_0x11940b);}function stateDrift(_0x1f6baa){const _0x29f09c=a169_0x36feb0;return menuError('menu_state_drift',_0x1f6baa,_0x29f09c(0x1cb));}
|
|
1
|
+
function a169_0x3ea1(){const _0xb7429d=['map','backend','operation','max','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','message','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','18537786xzMWnM','4cJNZvN','Sibling\x20sort\x20value\x20(non-negative\x20integer)','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','folder','Exact\x20online\x20menu\x20id','menu_sort_overflow','before','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','menu_mutation_failed','string','snapshotHash','\x20is\x20type\x20\x22','expect-parent-id','hash',',\x20current\x20','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','\x20menu\x20','menu_verification_failed','isSafeInteger','bool','menu_confirmation_required','type','prototype','succeeded','call','required','number','50160lZeHaF','10102896FexIPm','recheck\x20online\x20menu\x20facts\x20before\x20','menu_state_drift','2911447kapEIv','hint','get','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','hasOwnProperty','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','verification','parentId','code','warnings','cookie','failedRecords','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','\x22,\x20not\x20folder.','expect-path','appCode','defineProperty','stage','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','unknown','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','validation','data','10649zFcGmT','expected-children-count','menu_sort_invalid','path','2113175ExbMZz','toLowerCase','rawFlags','Online\x20menu\x20state\x20changed\x20before\x20','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','targets','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','deleteOrder','Permission\x20denied\x20while\x20attempting\x20to\x20','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','\x20child\x20count\x20changed:\x20expected\x20','test','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','after','root','yes','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','selector','12YWaKsA','planFile','7639896bMUpnY','childrenCount',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','menu_parent_not_folder','cascade',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','Menu\x20','api_error','dryRun','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','sort','length','parent-id','plannedActions','dry-run','failed','num','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','str'];a169_0x3ea1=function(){return _0xb7429d;};return a169_0x3ea1();}const a169_0x3183fb=a169_0x2790;(function(_0x59c7c1,_0x4704c2){const _0x1504e0=a169_0x2790,_0x108260=_0x59c7c1();while(!![]){try{const _0x411254=parseInt(_0x1504e0(0x122))/0x1*(-parseInt(_0x1504e0(0xec))/0x2)+parseInt(_0x1504e0(0x107))/0x3+-parseInt(_0x1504e0(0xd0))/0x4+parseInt(_0x1504e0(0x126))/0x5*(-parseInt(_0x1504e0(0x138))/0x6)+parseInt(_0x1504e0(0x10b))/0x7+parseInt(_0x1504e0(0x108))/0x8+parseInt(_0x1504e0(0xeb))/0x9;if(_0x411254===_0x4704c2)break;else _0x108260['push'](_0x108260['shift']());}catch(_0x894da2){_0x108260['push'](_0x108260['shift']());}}}(a169_0x3ea1,0xeef1b));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_0x3183fb(0x106),'required':!![],'description':a169_0x3183fb(0xf0)};export const MENU_SORT_FLAG={'name':a169_0x3183fb(0xda),'type':a169_0x3183fb(0x106),'description':a169_0x3183fb(0xed)};export const MENU_PARENT_ID_FLAG={'name':a169_0x3183fb(0xdc),'type':a169_0x3183fb(0xf5),'description':a169_0x3183fb(0x132)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a169_0x3183fb(0xf8),'type':a169_0x3183fb(0xf5),'description':a169_0x3183fb(0x11f)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a169_0x3183fb(0x119),'type':a169_0x3183fb(0xf5),'description':a169_0x3183fb(0xd9)},{'name':a169_0x3183fb(0x123),'type':a169_0x3183fb(0x106),'description':a169_0x3183fb(0x12f)}];export function validateExactId(_0x35851a){const _0x15c0b8=a169_0x3183fb,_0x6ec27=_0x35851a[_0x15c0b8(0xe0)]('id');if(!Number['isSafeInteger'](_0x6ec27)||_0x6ec27<=0x0)throw CliErrors[_0x15c0b8(0x120)](_0x15c0b8(0x136));return _0x6ec27;}export function validateSort(_0x4c4adb,_0x389d3b=a169_0x3183fb(0xda)){const _0x3454c7=a169_0x3183fb;if(!hasFlag(_0x4c4adb,_0x389d3b))return undefined;const _0x53d38f=_0x4c4adb[_0x3454c7(0xe0)](_0x389d3b);if(!Number[_0x3454c7(0xfe)](_0x53d38f)||_0x53d38f<0x0||_0x53d38f>MAX_MENU_SORT)throw menuError(_0x3454c7(0x124),'--'+_0x389d3b+_0x3454c7(0xe7)+MAX_MENU_SORT+'.',_0x3454c7(0x11d));return _0x53d38f;}export function nextSiblingSort(_0x3ebafe,_0x428607,_0x4cc6b4){const _0x3fa3ee=a169_0x3183fb,_0x5c30a6=getChildren(_0x3ebafe,_0x428607)[_0x3fa3ee(0xe3)](_0x24a268=>_0x24a268['sort'])['filter'](_0x1bc7af=>typeof _0x1bc7af===_0x3fa3ee(0x106));if(_0x5c30a6[_0x3fa3ee(0xdb)]===0x0)return 0x0;const _0x1fc772=Math[_0x3fa3ee(0xe6)](..._0x5c30a6);if(_0x1fc772>=MAX_MENU_SORT)throw menuError(_0x3fa3ee(0xf1),'Cannot\x20append\x20a\x20'+_0x4cc6b4+_0x3fa3ee(0x12a)+_0x1fc772+'.','Reorder\x20sibling\x20menus\x20below\x20'+MAX_MENU_SORT+_0x3fa3ee(0xd2));return _0x1fc772+0x1;}export function requireExplicitYes(_0xf8bffd){const _0x479e85=a169_0x3183fb;if(_0xf8bffd[_0x479e85(0xff)](_0x479e85(0xde)))return;if(!_0xf8bffd[_0x479e85(0xff)](_0x479e85(0x135)))throw menuError(_0x479e85(0x100),_0x479e85(0xfb),_0x479e85(0xee));}export async function fetchMutationSnapshot(_0x4467b3,_0x3f8edb,_0x5d3cfd){const _0x178747=a169_0x3183fb;try{return await fetchMenuSnapshot(_0x4467b3[_0x178747(0x11a)],_0x4467b3[_0x178747(0x115)]);}catch(_0x932f7b){throw mapMenuApiError(_0x932f7b,'read\x20online\x20menu\x20facts\x20before\x20'+_0x3f8edb,_0x5d3cfd);}}export async function recheckMutationSnapshot(_0x95f19,_0x23f04b,_0xd56d5a,_0x5903ed){const _0x2655f2=a169_0x3183fb;let _0x17b0f4;try{_0x17b0f4=await fetchMenuSnapshot(_0x95f19[_0x2655f2(0x11a)],_0x95f19['cookie']);}catch(_0xe5cc6c){const _0xe78d93=mapMenuApiError(_0xe5cc6c,_0x2655f2(0x109)+_0xd56d5a,_0x5903ed);throw menuFailure(_0xe78d93,_0x23f04b,{'stage':'pre-write-recheck','failed':_0x5903ed==null?{}:{'id':_0x5903ed}});}if(_0x17b0f4[_0x2655f2(0xf9)]!==_0x23f04b['snapshotHash']){const _0x9563d9=menuError(_0x2655f2(0x10a),_0x2655f2(0x129)+_0xd56d5a+_0x2655f2(0xd5),_0x2655f2(0xf3));throw menuFailure(_0x9563d9,_0x23f04b,{'stage':'pre-write-recheck','failed':{..._0x5903ed==null?{}:{'id':_0x5903ed},'expectedSnapshotHash':_0x23f04b[_0x2655f2(0xf6)],'currentSnapshotHash':_0x17b0f4[_0x2655f2(0xf9)]}});}return _0x17b0f4;}export function parseParentId(_0x3873b7,_0x2a7fa8,_0x372750={}){const _0x226484=a169_0x3183fb;if(!hasFlag(_0x3873b7,_0x2a7fa8)){if(_0x372750[_0x226484(0x105)])throw CliErrors['flagMissing'](_0x2a7fa8);return undefined;}const _0xbf0f7a=_0x3873b7[_0x226484(0xe2)](_0x2a7fa8)['trim']();if(_0xbf0f7a[_0x226484(0x127)]()===_0x226484(0x134))return null;if(!/^\d+$/[_0x226484(0x131)](_0xbf0f7a))throw CliErrors[_0x226484(0x120)]('--'+_0x2a7fa8+_0x226484(0x117));const _0x5b6476=Number(_0xbf0f7a);if(!Number[_0x226484(0xfe)](_0x5b6476)||_0x5b6476<=0x0)throw CliErrors['validation']('--'+_0x2a7fa8+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');return _0x5b6476;}function a169_0x2790(_0x4b597c,_0x12a7b5){_0x4b597c=_0x4b597c-0xd0;const _0x3ea146=a169_0x3ea1();let _0x27904a=_0x3ea146[_0x4b597c];return _0x27904a;}export function requireMenu(_0x56ff5b,_0x20cfcc){const _0x127254=a169_0x3183fb,_0x5737aa=_0x56ff5b['byId'][_0x127254(0x10d)](_0x20cfcc);if(!_0x5737aa)throw menuError('menu_not_found','Online\x20menu\x20not\x20found:\x20'+_0x20cfcc,_0x127254(0xea));return _0x5737aa;}export function requireFolder(_0x4770f5,_0x5f5578){const _0x4dec9b=a169_0x3183fb,_0x232100=requireMenu(_0x4770f5,_0x5f5578);if(_0x232100[_0x4dec9b(0x101)]!==_0x4dec9b(0xef))throw menuError(_0x4dec9b(0xd3),'Menu\x20'+_0x5f5578+_0x4dec9b(0xf7)+(_0x232100[_0x4dec9b(0x101)]||_0x4dec9b(0x11e))+_0x4dec9b(0x118),'Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.');return _0x232100;}export function assertExpectedState(_0x124adc,_0x776f74){const _0x568bf2=a169_0x3183fb;if(hasFlag(_0x124adc,'expect-parent-id')){const _0x3dfb7e=parseParentId(_0x124adc,_0x568bf2(0xf8),{'required':!![]});if(_0x776f74[_0x568bf2(0x112)]!==_0x3dfb7e)throw stateDrift(_0x568bf2(0xd6)+_0x776f74['id']+'\x20parent\x20changed:\x20expected\x20'+formatParent(_0x3dfb7e)+_0x568bf2(0xfa)+formatParent(_0x776f74[_0x568bf2(0x112)])+'.');}if(hasFlag(_0x124adc,_0x568bf2(0x119))){const _0x1e13cf=_0x124adc[_0x568bf2(0xe2)](_0x568bf2(0x119));if(_0x776f74[_0x568bf2(0x125)]!==_0x1e13cf)throw stateDrift('Menu\x20'+_0x776f74['id']+'\x20path\x20changed:\x20expected\x20'+JSON['stringify'](_0x1e13cf)+',\x20current\x20'+JSON['stringify'](_0x776f74[_0x568bf2(0x125)])+'.');}if(hasFlag(_0x124adc,_0x568bf2(0x123))){const _0x48bfdd=_0x124adc['num'](_0x568bf2(0x123));if(!Number[_0x568bf2(0xfe)](_0x48bfdd)||_0x48bfdd<0x0)throw CliErrors['validation'](_0x568bf2(0x110));if(_0x776f74['childrenCount']!==_0x48bfdd)throw stateDrift('Menu\x20'+_0x776f74['id']+_0x568bf2(0x130)+_0x48bfdd+',\x20current\x20'+_0x776f74[_0x568bf2(0xd1)]+'.');}}export function assertVerified(_0x26a89e,_0x2d1f58,_0x6dccd=a169_0x3183fb(0x10e)){const _0x12d357=a169_0x3183fb;if(!_0x26a89e)throw menuError(_0x12d357(0xfd),_0x2d1f58,_0x6dccd);}export function mutationResult(_0x552b95){const _0x250fc1=a169_0x3183fb;return{'operation':_0x552b95[_0x250fc1(0xe5)],'selector':_0x552b95[_0x250fc1(0x137)],'before':_0x552b95[_0x250fc1(0xf2)],'after':_0x552b95[_0x250fc1(0x133)],'dryRun':_0x552b95[_0x250fc1(0xd8)],'backend':_0x552b95[_0x250fc1(0xe4)],..._0x552b95[_0x250fc1(0xdd)]?{'plannedActions':_0x552b95['plannedActions']}:{},..._0x552b95[_0x250fc1(0x12b)]?{'targets':_0x552b95[_0x250fc1(0x12b)]}:{},..._0x552b95[_0x250fc1(0x12d)]?{'deleteOrder':_0x552b95[_0x250fc1(0x12d)]}:{},'snapshotHash':_0x552b95['snapshotHash'],..._0x552b95[_0x250fc1(0xd4)]?{'cascade':_0x552b95[_0x250fc1(0xd4)]}:{},..._0x552b95[_0x250fc1(0x139)]?{'planFile':_0x552b95[_0x250fc1(0x139)]}:{},'succeeded':_0x552b95[_0x250fc1(0x103)]??[],'failed':_0x552b95[_0x250fc1(0xdf)]??[],'warnings':_0x552b95[_0x250fc1(0x114)]??[],'verification':_0x552b95[_0x250fc1(0x111)],'error':_0x552b95['error']};}export function menuDryRunResult(_0xf94719,_0x4d0e0a){return{..._0xf94719,..._0x4d0e0a};}export function menuFailure(_0x2e773d,_0x1f8606,_0x5cd190){const _0x3b933d=a169_0x3183fb,_0x4af263=mutationResult({..._0x1f8606,'after':_0x5cd190[_0x3b933d(0x133)]===undefined?_0x1f8606[_0x3b933d(0x133)]:_0x5cd190[_0x3b933d(0x133)],'backend':_0x5cd190['backend']??_0x1f8606[_0x3b933d(0xe4)],'dryRun':![],'succeeded':_0x5cd190['succeeded']??[],'failed':_0x5cd190[_0x3b933d(0x116)]??[{..._0x5cd190[_0x3b933d(0xdf)]??{},'stage':_0x5cd190[_0x3b933d(0x11c)],'code':_0x2e773d['code'],'message':_0x2e773d[_0x3b933d(0xe9)]}],'warnings':[..._0x1f8606['warnings'],..._0x5cd190[_0x3b933d(0x114)]??[]],'verification':_0x5cd190[_0x3b933d(0x111)],'error':{'code':_0x2e773d[_0x3b933d(0x113)],'message':_0x2e773d[_0x3b933d(0xe9)],..._0x2e773d['hint']?{'hint':_0x2e773d[_0x3b933d(0x10c)]}:{}}});return Object[_0x3b933d(0x11b)](_0x2e773d,_0x3b933d(0x121),{'value':_0x4af263,'enumerable':!![],'configurable':!![]}),_0x2e773d;}export function asVerificationError(_0x380c63,_0x28aa68){const _0x368b8b=a169_0x3183fb;if(_0x380c63 instanceof CliError&&_0x380c63['code']===_0x368b8b(0xfd))return _0x380c63;const _0x4b5eb8=_0x380c63 instanceof Error?_0x380c63[_0x368b8b(0xe9)]:String(_0x380c63);return menuError(_0x368b8b(0xfd),''+_0x28aa68+(_0x4b5eb8?':\x20'+_0x4b5eb8:''),_0x368b8b(0xe8));}export function describeMenuErrorCause(_0x43fb8c,_0x384100,_0x32afb2){const _0x2d2598=a169_0x3183fb,_0x776b15=mapMenuApiError(_0x43fb8c,_0x384100,_0x32afb2);return{'causeCode':_0x776b15[_0x2d2598(0x113)],'causeMessage':_0x776b15[_0x2d2598(0xe9)]};}export function hasFlag(_0x312f5b,_0x46505e){const _0x1aa5a1=a169_0x3183fb;return Object[_0x1aa5a1(0x102)][_0x1aa5a1(0x10f)][_0x1aa5a1(0x104)](_0x312f5b[_0x1aa5a1(0x128)],_0x46505e)&&_0x312f5b['rawFlags'][_0x46505e]!==undefined;}export function toApiParentId(_0xe1423d){return _0xe1423d??0x0;}export function formatParent(_0x3c36dd){const _0x4559b4=a169_0x3183fb;return _0x3c36dd==null?_0x4559b4(0x134):String(_0x3c36dd);}export function menuError(_0x4f3af2,_0xb92826,_0x1fc27e){return new CliError(_0x4f3af2,0x1,_0xb92826,_0x1fc27e);}export function mapMenuApiError(_0x2893df,_0x293f7e,_0x1614f1){const _0x530f05=a169_0x3183fb;if(_0x2893df instanceof CliError&&_0x2893df[_0x530f05(0x113)]!==_0x530f05(0xd7))return _0x2893df;const _0x48030c=_0x2893df instanceof Error?_0x2893df['message']:String(_0x2893df);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x530f05(0x131)](_0x48030c))return menuError('menu_permission_denied',_0x530f05(0x12e)+_0x293f7e+(_0x1614f1?_0x530f05(0xfc)+_0x1614f1:'')+'.',_0x530f05(0x12c));return menuError(_0x530f05(0xf4),'Failed\x20to\x20'+_0x293f7e+(_0x1614f1?_0x530f05(0xfc)+_0x1614f1:'')+':\x20'+_0x48030c,'Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.');}export function isMenuResponseLoss(_0x41ad6f){const _0x7fb7e8=a169_0x3183fb,_0x3b82b2=_0x41ad6f instanceof Error?_0x41ad6f[_0x7fb7e8(0xe9)]:String(_0x41ad6f);if(_0x41ad6f instanceof CliError)return _0x41ad6f['code']===_0x7fb7e8(0xd7)&&/^Request (?:failed|timeout):/i[_0x7fb7e8(0x131)](_0x3b82b2);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x7fb7e8(0x131)](_0x3b82b2);}function stateDrift(_0xfd459b){const _0x111463=a169_0x3183fb;return menuError(_0x111463(0x10a),_0xfd459b,_0x111463(0xe1));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x53d611,_0x5cd147){const _0x1d5e19=a170_0x19ad,_0x1693e0=_0x53d611();while(!![]){try{const _0x12a5a5=parseInt(_0x1d5e19(0x17f))/0x1*(-parseInt(_0x1d5e19(0x176))/0x2)+parseInt(_0x1d5e19(0x17b))/0x3+-parseInt(_0x1d5e19(0x178))/0x4+-parseInt(_0x1d5e19(0x17a))/0x5+-parseInt(_0x1d5e19(0x17d))/0x6+-parseInt(_0x1d5e19(0x17c))/0x7+-parseInt(_0x1d5e19(0x177))/0x8*(-parseInt(_0x1d5e19(0x17e))/0x9);if(_0x12a5a5===_0x5cd147)break;else _0x1693e0['push'](_0x1693e0['shift']());}catch(_0x79e205){_0x1693e0['push'](_0x1693e0['shift']());}}}(a170_0x428e,0x8f9b3));function a170_0x428e(){const _0x4fd8f9=['561843TZouQh','411QWvuFV','802hMWYrU','464oqFQLH','3080768ReKqpJ','replace','5502375GLuXQi','2038980wcuLKX','5441821HNKjjB','5396004XkOZPN'];a170_0x428e=function(){return _0x4fd8f9;};return a170_0x428e();}function a170_0x19ad(_0x5383db,_0x4ab118){_0x5383db=_0x5383db-0x176;const _0x428e09=a170_0x428e();let _0x19ad5a=_0x428e09[_0x5383db];return _0x19ad5a;}export function menuPathKey(_0x5e29c6){const _0x29178a=a170_0x19ad,_0x4029a3=_0x5e29c6['trim']();if(!_0x4029a3)return'';return _0x4029a3[_0x29178a(0x179)](/^\/+/,'')['replace'](/\/+$/,'')||'/';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x55170f,_0x5c6840){const _0x518646=a171_0x3923,_0xabceb=_0x55170f();while(!![]){try{const _0x293e8d=-parseInt(_0x518646(0xdd))/0x1+-parseInt(_0x518646(0xd7))/0x2+-parseInt(_0x518646(0xdb))/0x3*(-parseInt(_0x518646(0xf6))/0x4)+parseInt(_0x518646(0xef))/0x5*(-parseInt(_0x518646(0xe2))/0x6)+-parseInt(_0x518646(0xee))/0x7+parseInt(_0x518646(0xfe))/0x8*(-parseInt(_0x518646(0xfb))/0x9)+parseInt(_0x518646(0xf3))/0xa;if(_0x293e8d===_0x5c6840)break;else _0xabceb['push'](_0xabceb['shift']());}catch(_0x189a11){_0xabceb['push'](_0xabceb['shift']());}}}(a171_0x3bfb,0xc9804));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a171_0x109a43,updateMenuRecord}from'../../../core/api-client.js';function a171_0x3bfb(){const _0x227245=['stringify','Fetched\x20','number','procode','path','Batch\x20menu\x20creation\x20completed,\x20total\x20','4533053NwLxxC','10aaZKme','menus','visible','create-menu','57148540wMkbVt','label','Delete\x20','1132PZtTMT','menuGroups','Update\x20menu\x20assets\x20\x22','\x20menu','info','19287UJaEvX','\x20menu\x20group(s)','loadScriptMode','5864XUFbRZ','Update\x20menu\x20','create-menus','import','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','parentId','resources','get-online-menu-list','length','587570DkdDES','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','\x20online\x20menus\x20successfully','all','6081EpjypE','extend','1594666uPOamT','update-menu-cdn-url','appName','map','boolean','4068894WPtWDW','Updating\x20menu\x20asset\x20links:\x20','total','order','Create\x20menu\x20\x22','Menu\x20created\x20successfully:\x20'];a171_0x3bfb=function(){return _0x227245;};return a171_0x3bfb();}function a171_0x3923(_0x4d81ac,_0x181dc5){_0x4d81ac=_0x4d81ac-0xd5;const _0x3bfb3a=a171_0x3bfb();let _0x3923bf=_0x3bfb3a[_0x4d81ac];return _0x3923bf;}export async function getOnlineMenuList(_0x28b7b5,_0x1ca5c7){const _0x2fbbb4=a171_0x3923,_0x2aee23=getEnv();logger['info'](_0x2fbbb4(0xd5),isProduction(_0x2aee23)?_0x2fbbb4(0x102)+_0x28b7b5+')':_0x2fbbb4(0xd8)+_0x28b7b5+')');const _0x3cc209=await fetchMenuSnapshot(_0x28b7b5,_0x1ca5c7,{'verbose':!![]});return logger[_0x2fbbb4(0xfa)](_0x2fbbb4(0xd5),_0x2fbbb4(0xe9)+_0x3cc209[_0x2fbbb4(0xe4)]+_0x2fbbb4(0xd9)),_0x3cc209[_0x2fbbb4(0xf0)]['map'](toProcessedMenuItem);}export async function createMenu(_0x4b210c,_0xb4d1af,_0x3d196b){const _0x565f1a=a171_0x3923;logger[_0x565f1a(0xfa)](_0x565f1a(0xf2),'Creating\x20menu:\x20'+_0x3d196b['label']+'\x20('+_0x3d196b['path']+')');const _0x451e30={'appCode':_0x4b210c,'type':_0x565f1a(0xeb),'sort':0x0,'extend':{'loadScriptMode':_0x565f1a(0x101),'resources':_0x3d196b[_0x565f1a(0x104)]?JSON['stringify'](_0x3d196b[_0x565f1a(0x104)]):undefined},..._0x3d196b},_0x40bf86=await createMenuRecord(_0x451e30,_0xb4d1af,_0x565f1a(0xe6)+_0x3d196b[_0x565f1a(0xf4)]+'\x22');return logger['info'](_0x565f1a(0xf2),_0x565f1a(0xe7)+_0x3d196b[_0x565f1a(0xf4)]),_0x40bf86;}async function createSingleMenu(_0x1f8a15,_0x17873b,_0x98ab0f,_0xa617ec,_0x1b9884){const _0x5638b2=a171_0x3923,_0x353998={'appCode':_0x1f8a15,'type':'procode','sort':_0x5638b2(0xe5)in _0x98ab0f&&typeof _0x98ab0f[_0x5638b2(0xe5)]==='number'?_0x98ab0f[_0x5638b2(0xe5)]:0x0,..._0x5638b2(0xf1)in _0x98ab0f&&typeof _0x98ab0f[_0x5638b2(0xf1)]===_0x5638b2(0xe1)?{'visible':_0x98ab0f[_0x5638b2(0xf1)]}:{},..._0x5638b2(0x103)in _0x98ab0f&&typeof _0x98ab0f[_0x5638b2(0x103)]===_0x5638b2(0xea)?{'parentId':_0x98ab0f['parentId']}:{},'extend':{..._0x1b9884?.[_0x5638b2(0xdf)]?{'appName':_0x1b9884[_0x5638b2(0xdf)]}:{},'loadScriptMode':_0x5638b2(0x101),'resources':_0xa617ec?JSON[_0x5638b2(0xe8)](_0xa617ec):undefined},'label':_0x98ab0f[_0x5638b2(0xf4)],'path':_0x98ab0f[_0x5638b2(0xec)]},_0x32fa8f=await createMenuRecord(_0x353998,_0x17873b,_0x5638b2(0xe6)+_0x98ab0f[_0x5638b2(0xf4)]+'\x22');return logger[_0x5638b2(0xfa)](_0x5638b2(0xf2),_0x5638b2(0xe7)+_0x98ab0f['label']),_0x32fa8f;}export async function createMenus(_0x1f3275,_0x3cfb30,_0x513ca5,_0xfe2ae7,_0x37e45f){const _0x40a478=a171_0x3923;logger[_0x40a478(0xfa)](_0x40a478(0x100),'Start\x20batch\x20menu\x20creation,\x20total\x20'+_0x513ca5[_0x40a478(0xd6)]);const _0x3b878d=await Promise[_0x40a478(0xda)](_0x513ca5[_0x40a478(0xe0)](_0x110d02=>createSingleMenu(_0x1f3275,_0x3cfb30,_0x110d02,_0xfe2ae7,_0x37e45f)));return logger[_0x40a478(0xfa)](_0x40a478(0x100),_0x40a478(0xed)+_0x513ca5['length']),_0x3b878d;}export async function updateMenuCdnUrl(_0x11225b,_0x2e1f84,_0xe7d0da){const _0x40d95d=a171_0x3923;logger[_0x40d95d(0xfa)](_0x40d95d(0xde),_0x40d95d(0xe3)+_0xe7d0da[_0x40d95d(0xf4)]+'\x20('+_0xe7d0da[_0x40d95d(0xec)]+')');const _0xc56b65={'id':_0xe7d0da['id'],'appCode':_0x11225b,'extend':{..._0xe7d0da[_0x40d95d(0xdc)]??{},..._0xe7d0da['loadScriptMode']?{'loadScriptMode':_0xe7d0da[_0x40d95d(0xfd)]}:{},'resources':_0xe7d0da[_0x40d95d(0x104)]?JSON['stringify'](_0xe7d0da[_0x40d95d(0x104)]):undefined}},_0x30e1b2=await updateMenuRecord(_0xc56b65,_0x2e1f84,_0x40d95d(0xf8)+_0xe7d0da[_0x40d95d(0xf4)]+'\x22');return logger[_0x40d95d(0xfa)]('update-menu-cdn-url','Menu\x20assets\x20synced:\x20'+_0xe7d0da[_0x40d95d(0xf4)],undefined),_0x30e1b2;}export async function createMenuEntity(_0x1f1d97,_0x422e5f,_0x24883c){const _0x1f18c1=a171_0x3923;return createMenuRecord({'appCode':_0x1f1d97,..._0x24883c},_0x422e5f,_0x1f18c1(0xe6)+_0x24883c[_0x1f18c1(0xf4)]+'\x22');}export async function updateMenuEntity(_0x216771,_0x23abf1,_0x12d456){const _0xd8970d=a171_0x3923;return updateMenuRecord({'appCode':_0x216771,..._0x12d456},_0x23abf1,_0xd8970d(0xff)+_0x12d456['id']);}export async function batchDeleteMenuEntities(_0x302daa,_0x50b295){const _0x3a2144=a171_0x3923;return batchDeleteMenuRecords(_0x50b295,_0x302daa,_0x3a2144(0xf5)+_0x50b295[_0x3a2144(0xd6)]+_0x3a2144(0xf9)+(_0x50b295[_0x3a2144(0xd6)]===0x1?'':'s'));}export async function startMenuRegroup(_0x38a2dc,_0x8e47c){const _0x2b903e=a171_0x3923;return a171_0x109a43(_0x8e47c,_0x38a2dc,'Regroup\x20'+_0x8e47c[_0x2b903e(0xf7)]['length']+_0x2b903e(0xfc));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a172_0x3ca490=a172_0x3e83;(function(_0x204b15,_0xdee488){const _0x5a1416=a172_0x3e83,_0x25ccf5=_0x204b15();while(!![]){try{const _0x1920ea=parseInt(_0x5a1416(0x16c))/0x1+-parseInt(_0x5a1416(0x14f))/0x2+-parseInt(_0x5a1416(0x15f))/0x3*(parseInt(_0x5a1416(0x153))/0x4)+parseInt(_0x5a1416(0x15e))/0x5*(parseInt(_0x5a1416(0x16d))/0x6)+parseInt(_0x5a1416(0x15a))/0x7+parseInt(_0x5a1416(0x176))/0x8+parseInt(_0x5a1416(0x16b))/0x9;if(_0x1920ea===_0xdee488)break;else _0x25ccf5['push'](_0x25ccf5['shift']());}catch(_0x3b3514){_0x25ccf5['push'](_0x25ccf5['shift']());}}}(a172_0x2c4b,0x95157));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';function a172_0x2c4b(){const _0x2c9b3e=['appName','\x20must\x20be\x20a\x20JSON\x20object.','trim','filter','app.extend.assets\x20must\x20be\x20an\x20array.','map','1645238ssrVmC','string','app','menu\x20','59510jmMpsD','3UcJwRv','validation','menu','\x20contains\x20invalid\x20JSON.','sharedConfigured','resources','app-name','Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app','sharedResources','\x20resources','basename','assets','2681973NuawYK','656591eEYoFf','6MWmnaB','app.extend','--app-name\x20is\x20required.','appCode','Duplicate\x20subapp\x20records\x20for\x20','\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.','extend','Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','length','7091424mjATOc','object','app.extend.assets[','message','stringify','814932oYjqFW','subapp.resources','path','isArray','4279356PkMeDQ'];a172_0x2c4b=function(){return _0x2c9b3e;};return a172_0x2c4b();}import{CliErrors}from'../../../errors.js';function objectValue(_0x2f02a0,_0x2dc56a){const _0x5a1129=a172_0x3e83,_0x5f261f=typeof _0x2f02a0===_0x5a1129(0x15b)?parseJson(_0x2f02a0,_0x2dc56a):_0x2f02a0;if(!_0x5f261f||typeof _0x5f261f!==_0x5a1129(0x177)||Array['isArray'](_0x5f261f))throw CliErrors[_0x5a1129(0x160)](_0x2dc56a+_0x5a1129(0x155));return _0x5f261f;}function parseJson(_0x24d3e8,_0x1f29a0){const _0x369878=a172_0x3e83;try{return JSON['parse'](_0x24d3e8);}catch{throw CliErrors[_0x369878(0x160)](_0x1f29a0+_0x369878(0x162));}}function a172_0x3e83(_0x3a7ab5,_0x434e98){_0x3a7ab5=_0x3a7ab5-0x14c;const _0x2c4bad=a172_0x2c4b();let _0x3e8369=_0x2c4bad[_0x3a7ab5];return _0x3e8369;}function resourceList(_0x2175d2,_0x3c6f66){const _0x349826=a172_0x3e83;if(typeof _0x2175d2!=='string')throw CliErrors[_0x349826(0x160)](_0x3c6f66+_0x349826(0x172));const _0x4f291d=parseJson(_0x2175d2,_0x3c6f66);if(!Array['isArray'](_0x4f291d)||_0x4f291d['some'](_0x361c94=>typeof _0x361c94!==_0x349826(0x15b)))throw CliErrors[_0x349826(0x160)](_0x3c6f66+'\x20must\x20be\x20an\x20array\x20of\x20URLs.');return _0x4f291d;}export function buildSubappAssetsStatus(_0xc32bd7,_0x55203a,_0x4371d4){const _0x35898b=a172_0x3e83,_0x189c1c=_0xc32bd7[_0x35898b(0x173)]==null?{}:objectValue(_0xc32bd7[_0x35898b(0x173)],_0x35898b(0x16e)),_0x18abb9=_0x189c1c['assets']==null?[]:typeof _0x189c1c['assets']===_0x35898b(0x15b)?parseJson(_0x189c1c[_0x35898b(0x16a)],'app.extend.assets'):_0x189c1c[_0x35898b(0x16a)];if(!Array[_0x35898b(0x152)](_0x18abb9))throw CliErrors[_0x35898b(0x160)](_0x35898b(0x158));const _0x486e3d=_0x18abb9[_0x35898b(0x159)]((_0x1d19de,_0x3ab9f7)=>objectValue(_0x1d19de,_0x35898b(0x14c)+_0x3ab9f7+']')),_0x3183c0=_0x486e3d[_0x35898b(0x157)](_0x500bfa=>_0x500bfa[_0x35898b(0x154)]===_0x4371d4);if(_0x3183c0[_0x35898b(0x175)]>0x1)throw CliErrors[_0x35898b(0x160)](_0x35898b(0x171)+_0x4371d4+'.');const _0x3a11fc=_0x3183c0[0x0],_0x372d6b=_0x3a11fc?.[_0x35898b(0x164)]==null?[]:resourceList(_0x3a11fc['resources'],_0x35898b(0x150)),_0x3f6eab=_0x55203a[_0x35898b(0x157)](_0x31f64b=>_0x31f64b[_0x35898b(0x173)]?.[_0x35898b(0x154)]===_0x4371d4),_0x4435ee=_0x3f6eab[_0x35898b(0x159)](_0x313081=>{const _0x35fd3a=_0x35898b;let _0x2a35dc=null,_0xd2f8ac=null;try{_0x2a35dc=_0x313081[_0x35fd3a(0x173)]?.[_0x35fd3a(0x164)]==null?_0x313081['resources']:resourceList(_0x313081['extend'][_0x35fd3a(0x164)],_0x35fd3a(0x15d)+_0x313081['id']+_0x35fd3a(0x168));}catch(_0x42627e){_0xd2f8ac=_0x42627e instanceof Error?_0x42627e[_0x35fd3a(0x14d)]:String(_0x42627e);}const _0x39f724=_0x372d6b[_0x35fd3a(0x175)]>0x0?_0x35fd3a(0x15c):_0x35fd3a(0x161),_0x573473=_0x39f724==='app'?_0x372d6b:_0x2a35dc;return{'id':_0x313081['id'],'path':_0x313081[_0x35fd3a(0x151)],'preferredSourceIfSupported':_0x39f724,'preferredResourcesIfSupported':_0x573473,'menuFallbackResources':_0x2a35dc,'menuFallbackError':_0xd2f8ac,'fallbackDiffers':_0x2a35dc===null?null:_0x39f724===_0x35fd3a(0x15c)&&_0x2a35dc[_0x35fd3a(0x175)]>0x0&&JSON[_0x35fd3a(0x14e)](_0x2a35dc)!==JSON[_0x35fd3a(0x14e)](_0x573473)};});return{'appName':_0x4371d4,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x3a11fc),'sharedResources':_0x372d6b,'loadScriptMode':_0x3a11fc?.['loadScriptMode']??null,'basename':_0x3a11fc?.[_0x35898b(0x169)]??null,'boundMenus':_0x4435ee[_0x35898b(0x175)],'staleMenuFallbacks':_0x4435ee['filter'](_0x37dfc8=>_0x37dfc8['fallbackDiffers'])[_0x35898b(0x175)],'menus':_0x4435ee};}export async function assertSharedResourcesConfigured(_0x193ecb,_0x1b9100,_0x7557b7){const _0x3c7a69=a172_0x3e83,_0x5624d1=await getSmartAppRecord(_0x193ecb,_0x1b9100),_0x1a9e9f=buildSubappAssetsStatus(_0x5624d1,[],_0x7557b7);if(!_0x1a9e9f[_0x3c7a69(0x163)]||_0x1a9e9f[_0x3c7a69(0x167)][_0x3c7a69(0x175)]===0x0)throw CliErrors[_0x3c7a69(0x160)]('No\x20shared\x20resources\x20configured\x20for\x20'+_0x7557b7+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':a172_0x3ca490(0x166)},{'name':'app-name','type':a172_0x3ca490(0x15b),'required':!![],'description':a172_0x3ca490(0x174)}];export function getSubappSelector(_0x16a2c2){const _0x28bd26=a172_0x3ca490,_0x10c8de=_0x16a2c2[_0x28bd26(0x170)],_0x49955e=_0x16a2c2['str'](_0x28bd26(0x165))[_0x28bd26(0x156)]();if(!_0x49955e)throw CliErrors[_0x28bd26(0x160)](_0x28bd26(0x16f));return{'appCode':_0x10c8de,'appName':_0x49955e};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a173_0x1849ab=a173_0x3d41;(function(_0x231e52,_0x3b1e74){const _0x395f32=a173_0x3d41,_0x287289=_0x231e52();while(!![]){try{const _0x50ed4f=parseInt(_0x395f32(0x1f1))/0x1*(-parseInt(_0x395f32(0x207))/0x2)+parseInt(_0x395f32(0x1d2))/0x3*(-parseInt(_0x395f32(0x200))/0x4)+-parseInt(_0x395f32(0x1e5))/0x5*(parseInt(_0x395f32(0x1eb))/0x6)+-parseInt(_0x395f32(0x1ce))/0x7*(-parseInt(_0x395f32(0x209))/0x8)+-parseInt(_0x395f32(0x1d1))/0x9*(parseInt(_0x395f32(0x1f4))/0xa)+-parseInt(_0x395f32(0x1e0))/0xb*(-parseInt(_0x395f32(0x1ea))/0xc)+-parseInt(_0x395f32(0x1f7))/0xd*(-parseInt(_0x395f32(0x1e8))/0xe);if(_0x50ed4f===_0x3b1e74)break;else _0x287289['push'](_0x287289['shift']());}catch(_0x44a052){_0x287289['push'](_0x287289['shift']());}}}(a173_0x1a85,0xe0bc1));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a173_0x3d41(_0x31408b,_0x3fd168){_0x31408b=_0x31408b-0x1cd;const _0x1a85e7=a173_0x1a85();let _0x3d410f=_0x1a85e7[_0x31408b];return _0x3d410f;}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';function a173_0x1a85(){const _0xe96fe0=['label','field','13VStHWx','filter','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','dryRun','Invalid\x20--params.','isArray','Invalid\x20--params:\x20','object','string','111956zbYTRK','group','visible','Parent\x20','CSS\x20URL\x20is\x20unreachable:\x20','isInteger','menu-sync','348388UmHJYp','join','12744272eVqFEL','JS\x20URL\x20is\x20unreachable:\x20','hasOwn','path','7NdxYkZ','Menu\x20sync\x20completed','get','2470536AoPqbH','3yAmehc','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL',':\x20expected\x20a\x20non-empty\x20string.','type','Start\x20non-interactive\x20menu\x20sync','jsUrl','appName','has','cwd','Expected\x20one\x20folder\x20named\x20\x22','trim','--params.','import','order','13644983oRuuHP','Invalid\x20--params\x20fields:\x20','cssUrl','setLogPath','push','10IsVUnP','length','No\x20local\x20pages\x20matched\x20paths:\x20','7812378elEbXu','\x0a\x20\x20Available\x20local\x20paths:\x20','12OdeWuV','1200426eTdWZx','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','boolean','number','map','7YlZfaj','keys','parentId','30uTSscr'];a173_0x1a85=function(){return _0xe96fe0;};return a173_0x1a85();}import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set([a173_0x1849ab(0x1d7),a173_0x1849ab(0x1e2),'appName',a173_0x1849ab(0x202),'parentId']);export function resolvePage(_0x496a3c,_0x49ac05,_0x2c8c64){const _0x5dccb0=a173_0x1849ab;let _0x145635=_0x49ac05['parentId']??_0x496a3c[_0x5dccb0(0x1f3)];if(_0x145635===undefined&&_0x496a3c[_0x5dccb0(0x201)]){const _0xe6f0ef=_0x2c8c64[_0x5dccb0(0x1f8)](_0x218576=>_0x218576[_0x5dccb0(0x1d5)]==='folder'&&_0x218576[_0x5dccb0(0x1f5)]===_0x496a3c[_0x5dccb0(0x201)]);if(_0xe6f0ef['length']!==0x1)throw new Error(_0x5dccb0(0x1db)+_0x496a3c[_0x5dccb0(0x201)]+'\x22\x20for\x20'+_0x496a3c[_0x5dccb0(0x1cd)]+';\x20found\x20'+_0xe6f0ef[_0x5dccb0(0x1e6)]);_0x145635=_0xe6f0ef[0x0]['id'];}if(_0x145635!==undefined&&_0x145635!==0x0&&_0x2c8c64['filter'](_0xf286a1=>_0xf286a1['id']===_0x145635&&_0xf286a1[_0x5dccb0(0x1d5)]==='folder')[_0x5dccb0(0x1e6)]!==0x1)throw new Error(_0x5dccb0(0x203)+_0x145635+'\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.');return{..._0x496a3c,..._0x145635===undefined?{}:{'parentId':_0x145635},..._0x49ac05['visible']===undefined?{}:{'visible':_0x49ac05['visible']}};}function validateParams(_0x49594a){const _0x33dc7c=a173_0x1849ab,_0x4f3480=[];return _0x49594a[_0x33dc7c(0x1d7)]&&!isValidJsHttpsUrl(_0x49594a[_0x33dc7c(0x1d7)])&&_0x4f3480[_0x33dc7c(0x1e4)]({'field':_0x33dc7c(0x1d7),'message':_0x33dc7c(0x1d3)}),_0x49594a[_0x33dc7c(0x1e2)]&&!isValidCssHttpsUrl(_0x49594a[_0x33dc7c(0x1e2)])&&_0x4f3480['push']({'field':_0x33dc7c(0x1e2),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x4f3480;}export async function runMenuSyncCore(_0x42206b,_0x1536dc,_0xaf3ec1=[],_0x1160d5,_0x5c4eb9={}){const _0x2527d4=a173_0x1849ab,_0x3225a9=parseMenuSyncParams(_0x1160d5),_0x59b7a3=[...new Set(_0xaf3ec1[_0x2527d4(0x1f0)](_0xb49c88=>_0xb49c88[_0x2527d4(0x1dc)]())[_0x2527d4(0x1f8)](Boolean)[_0x2527d4(0x1f0)](menuPathKey))],_0x236533=_0x3225a9[_0x2527d4(0x1d7)],_0x38622e=_0x3225a9['cssUrl'],_0x45b3c3=[];if(_0x236533)_0x45b3c3[_0x2527d4(0x1e4)](_0x236533);if(_0x38622e)_0x45b3c3['push'](_0x38622e);const _0x5dfd3b=validateParams(_0x3225a9);if(_0x5dfd3b[_0x2527d4(0x1e6)]>0x0){const _0x30bb31=_0x5dfd3b[_0x2527d4(0x1f0)](_0x26a170=>_0x2527d4(0x1dd)+_0x26a170[_0x2527d4(0x1f6)]+':\x20'+_0x26a170['message'])[_0x2527d4(0x208)](';\x20');throw new Error(_0x2527d4(0x1fd)+_0x30bb31);}logger[_0x2527d4(0x1e3)](process[_0x2527d4(0x1da)]()),logger['info'](_0x2527d4(0x206),_0x2527d4(0x1d6),{'appCode':_0x42206b,'selectedCount':_0x59b7a3[_0x2527d4(0x1e6)],'jsUrl':_0x236533,'cssUrl':_0x38622e});if(_0x236533){const _0x481778=await isUrlReachable(_0x236533);if(!_0x481778)throw new Error(_0x2527d4(0x20a)+_0x236533);}if(_0x38622e){const _0x5d0eb2=await isUrlReachable(_0x38622e);if(!_0x5d0eb2)throw new Error(_0x2527d4(0x204)+_0x38622e);}const _0x5c9970=getLocalPages();if(_0x5c9970[_0x2527d4(0x1e6)]===0x0){if(_0x59b7a3[_0x2527d4(0x1e6)]>0x0)throw new Error(_0x2527d4(0x1e7)+_0x59b7a3[_0x2527d4(0x208)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x5c4eb9[_0x2527d4(0x1fa)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x1b5ddd=await getOnlineMenuList(_0x42206b,_0x1536dc),_0x358663=new Set(_0x1b5ddd['map'](_0x564d05=>menuPathKey(_0x564d05[_0x2527d4(0x1cd)])));let _0x50755e;if(_0x59b7a3[_0x2527d4(0x1e6)]>0x0){const _0x42ac63=new Map(_0x5c9970[_0x2527d4(0x1f0)](_0x2b6a0f=>[menuPathKey(_0x2b6a0f['path']),_0x2b6a0f])),_0x5be530=_0x59b7a3[_0x2527d4(0x1f8)](_0x31b853=>!_0x42ac63[_0x2527d4(0x1d9)](_0x31b853));if(_0x5be530['length']>0x0){const _0xd971ef=_0x5c9970[_0x2527d4(0x1f0)](_0x151c74=>_0x151c74[_0x2527d4(0x1cd)])[_0x2527d4(0x208)](',\x20');throw new Error(_0x2527d4(0x1e7)+_0x5be530[_0x2527d4(0x208)](',\x20')+_0x2527d4(0x1e9)+_0xd971ef);}const _0x11a927=_0x59b7a3[_0x2527d4(0x1f8)](_0x3fa9bc=>_0x358663['has'](_0x3fa9bc));if(_0x11a927[_0x2527d4(0x1e6)]>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0x11a927[_0x2527d4(0x208)](',\x20'));_0x50755e=_0x59b7a3[_0x2527d4(0x1f0)](_0x21501b=>_0x42ac63[_0x2527d4(0x1d0)](_0x21501b));}else _0x50755e=_0x5c9970[_0x2527d4(0x1f8)](_0x3f12d8=>!_0x358663[_0x2527d4(0x1d9)](menuPathKey(_0x3f12d8[_0x2527d4(0x1cd)])));if(_0x50755e[_0x2527d4(0x1e6)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x5c4eb9[_0x2527d4(0x1fa)]===!![],'targetPages':[],'plannedMenus':[]};_0x50755e=_0x50755e['map'](_0x1839d6=>resolvePage(_0x1839d6,_0x3225a9,_0x1b5ddd));_0x3225a9[_0x2527d4(0x1d8)]&&_0x45b3c3[_0x2527d4(0x1e6)]===0x0&&await assertSharedResourcesConfigured(_0x42206b,_0x1536dc,_0x3225a9[_0x2527d4(0x1d8)]);const _0x3393f6=_0x50755e[_0x2527d4(0x1f0)](_0x1d5682=>({'type':'procode','path':_0x1d5682[_0x2527d4(0x1cd)],'label':_0x1d5682[_0x2527d4(0x1f5)],'loadScriptMode':_0x2527d4(0x1de),'resources':[..._0x45b3c3],..._0x1d5682[_0x2527d4(0x202)]===undefined?{}:{'visible':_0x1d5682[_0x2527d4(0x202)]},..._0x1d5682[_0x2527d4(0x1f3)]===undefined?{}:{'parentId':_0x1d5682[_0x2527d4(0x1f3)]},..._0x1d5682[_0x2527d4(0x1df)]===undefined?{}:{'sort':_0x1d5682[_0x2527d4(0x1df)]},..._0x3225a9[_0x2527d4(0x1d8)]===undefined?{}:{'appName':_0x3225a9[_0x2527d4(0x1d8)]}}));if(_0x5c4eb9[_0x2527d4(0x1fa)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x50755e,'plannedMenus':_0x3393f6};const _0xb49d00=_0x3225a9[_0x2527d4(0x1d8)]?await createMenus(_0x42206b,_0x1536dc,_0x50755e,_0x45b3c3['length']>0x0?_0x45b3c3:undefined,{'appName':_0x3225a9[_0x2527d4(0x1d8)]}):await createMenus(_0x42206b,_0x1536dc,_0x50755e,_0x45b3c3[_0x2527d4(0x1e6)]>0x0?_0x45b3c3:undefined);return logger['info'](_0x2527d4(0x206),_0x2527d4(0x1cf),{'count':_0x50755e[_0x2527d4(0x1e6)],'resources':_0x45b3c3}),{'created':_0xb49d00[_0x2527d4(0x1e6)],'skipped':![],'dryRun':![],'targetPages':_0x50755e,'plannedMenus':_0x3393f6,'menus':_0xb49d00};}export function parseMenuSyncParams(_0x7ce868){const _0x1c09a4=a173_0x1849ab;if(!_0x7ce868||typeof _0x7ce868!=='string')return{};let _0x5b1e0d;try{_0x5b1e0d=JSON['parse'](_0x7ce868);}catch{throw new Error('Invalid\x20--params\x20JSON.');}if(typeof _0x5b1e0d!==_0x1c09a4(0x1fe)||_0x5b1e0d===null||Array[_0x1c09a4(0x1fc)](_0x5b1e0d))throw new Error(_0x1c09a4(0x1ec));const _0x45cb41=_0x5b1e0d;if(Object[_0x1c09a4(0x20b)](_0x45cb41,'pages'))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0xf6f7fa=Object[_0x1c09a4(0x1f2)](_0x45cb41)[_0x1c09a4(0x1f8)](_0x5695a7=>!MENU_SYNC_PARAM_KEYS[_0x1c09a4(0x1d9)](_0x5695a7));if(_0xf6f7fa[_0x1c09a4(0x1e6)]>0x0)throw new Error(_0x1c09a4(0x1e1)+_0xf6f7fa[_0x1c09a4(0x208)](',\x20')+'.');for(const _0x1990d3 of[_0x1c09a4(0x1d7),_0x1c09a4(0x1e2),_0x1c09a4(0x1d8)]){const _0xdcbdaf=_0x45cb41[_0x1990d3];if(_0xdcbdaf!==undefined&&(typeof _0xdcbdaf!=='string'||_0xdcbdaf[_0x1c09a4(0x1dc)]()===''))throw new Error(_0x1c09a4(0x1fb)+_0x1990d3+_0x1c09a4(0x1d4));}if(_0x45cb41['visible']!==undefined&&typeof _0x45cb41['visible']!==_0x1c09a4(0x1ee))throw new Error(_0x1c09a4(0x1ed));if(_0x45cb41[_0x1c09a4(0x1f3)]!==undefined&&(!Number[_0x1c09a4(0x205)](_0x45cb41['parentId'])||_0x45cb41['parentId']<0x0))throw new Error(_0x1c09a4(0x1f9));return{'jsUrl':typeof _0x45cb41[_0x1c09a4(0x1d7)]===_0x1c09a4(0x1ff)?_0x45cb41['jsUrl']['trim']():undefined,'cssUrl':typeof _0x45cb41[_0x1c09a4(0x1e2)]===_0x1c09a4(0x1ff)?_0x45cb41['cssUrl'][_0x1c09a4(0x1dc)]():undefined,'appName':typeof _0x45cb41[_0x1c09a4(0x1d8)]===_0x1c09a4(0x1ff)?_0x45cb41[_0x1c09a4(0x1d8)][_0x1c09a4(0x1dc)]():undefined,'visible':typeof _0x45cb41['visible']===_0x1c09a4(0x1ee)?_0x45cb41[_0x1c09a4(0x202)]:undefined,'parentId':typeof _0x45cb41['parentId']===_0x1c09a4(0x1ef)?_0x45cb41[_0x1c09a4(0x1f3)]:undefined};}
|
|
1
|
+
const a173_0x58f940=a173_0x9770;(function(_0x45a2e1,_0x2da662){const _0x2f21a1=a173_0x9770,_0x425de4=_0x45a2e1();while(!![]){try{const _0x44cf2b=-parseInt(_0x2f21a1(0x9e))/0x1+parseInt(_0x2f21a1(0x99))/0x2+parseInt(_0x2f21a1(0xa9))/0x3*(parseInt(_0x2f21a1(0xb9))/0x4)+-parseInt(_0x2f21a1(0xbf))/0x5*(-parseInt(_0x2f21a1(0xc1))/0x6)+-parseInt(_0x2f21a1(0x96))/0x7+parseInt(_0x2f21a1(0x91))/0x8*(-parseInt(_0x2f21a1(0xab))/0x9)+parseInt(_0x2f21a1(0x98))/0xa;if(_0x44cf2b===_0x2da662)break;else _0x425de4['push'](_0x425de4['shift']());}catch(_0x4db163){_0x425de4['push'](_0x425de4['shift']());}}}(a173_0x590f,0x91ae8));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';function a173_0x590f(){const _0x123d76=['Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','visible','cssUrl','5goJdin','\x0a\x20\x20Available\x20local\x20paths:\x20','5478chEwTB','isArray','get','jsUrl','filter','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','No\x20local\x20pages\x20matched\x20paths:\x20','Menu\x20sync\x20completed','order','folder','push','menu-sync','8lquvhg','Expected\x20one\x20folder\x20named\x20\x22','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','type','message','1010933erZFbU','--params.','18426520oEJGWA','328036wMlRST','field','number','join','Invalid\x20--params:\x20','993172LdsWBQ','length','boolean','Start\x20non-interactive\x20menu\x20sync','cwd','dryRun','setLogPath','import','trim','label','string','538527SlJqNs','object','7306263pWymgW','appName',';\x20found\x20','path','info','Invalid\x20--params.','Invalid\x20--params\x20JSON.','map','group','parse','Parent\x20','has','\x22\x20for\x20','procode','12lUXWNJ','parentId','hasOwn'];a173_0x590f=function(){return _0x123d76;};return a173_0x590f();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';function a173_0x9770(_0x3c227c,_0x55a491){_0x3c227c=_0x3c227c-0x8c;const _0x590fb3=a173_0x590f();let _0x9770a6=_0x590fb3[_0x3c227c];return _0x9770a6;}const MENU_SYNC_PARAM_KEYS=new Set([a173_0x58f940(0xc4),a173_0x58f940(0xbe),a173_0x58f940(0xac),'visible','parentId']);export function resolvePage(_0x3c9da5,_0x55936d,_0x272c7e){const _0x41ef89=a173_0x58f940;let _0x1fe1d0=_0x55936d[_0x41ef89(0xba)]??_0x3c9da5[_0x41ef89(0xba)];if(_0x1fe1d0===undefined&&_0x3c9da5[_0x41ef89(0xb3)]){const _0x1d1ba9=_0x272c7e['filter'](_0x5aeca4=>_0x5aeca4[_0x41ef89(0x94)]===_0x41ef89(0x8e)&&_0x5aeca4[_0x41ef89(0xa7)]===_0x3c9da5[_0x41ef89(0xb3)]);if(_0x1d1ba9[_0x41ef89(0x9f)]!==0x1)throw new Error(_0x41ef89(0x92)+_0x3c9da5[_0x41ef89(0xb3)]+_0x41ef89(0xb7)+_0x3c9da5['path']+_0x41ef89(0xad)+_0x1d1ba9[_0x41ef89(0x9f)]);_0x1fe1d0=_0x1d1ba9[0x0]['id'];}if(_0x1fe1d0!==undefined&&_0x1fe1d0!==0x0&&_0x272c7e[_0x41ef89(0xc5)](_0x44464c=>_0x44464c['id']===_0x1fe1d0&&_0x44464c[_0x41ef89(0x94)]===_0x41ef89(0x8e))[_0x41ef89(0x9f)]!==0x1)throw new Error(_0x41ef89(0xb5)+_0x1fe1d0+_0x41ef89(0x93));return{..._0x3c9da5,..._0x1fe1d0===undefined?{}:{'parentId':_0x1fe1d0},..._0x55936d[_0x41ef89(0xbd)]===undefined?{}:{'visible':_0x55936d['visible']}};}function validateParams(_0x34000e){const _0x4623bd=a173_0x58f940,_0x25b41c=[];return _0x34000e[_0x4623bd(0xc4)]&&!isValidJsHttpsUrl(_0x34000e[_0x4623bd(0xc4)])&&_0x25b41c[_0x4623bd(0x8f)]({'field':'jsUrl','message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x34000e[_0x4623bd(0xbe)]&&!isValidCssHttpsUrl(_0x34000e['cssUrl'])&&_0x25b41c[_0x4623bd(0x8f)]({'field':_0x4623bd(0xbe),'message':_0x4623bd(0xc6)}),_0x25b41c;}export async function runMenuSyncCore(_0x1f012f,_0x1b7ff3,_0x112c68=[],_0x153898,_0x26463f={}){const _0x566f65=a173_0x58f940,_0x7dea0e=parseMenuSyncParams(_0x153898),_0x3b75b0=[...new Set(_0x112c68[_0x566f65(0xb2)](_0x255ece=>_0x255ece['trim']())[_0x566f65(0xc5)](Boolean)[_0x566f65(0xb2)](menuPathKey))],_0x5bbda2=_0x7dea0e['jsUrl'],_0x2f5d20=_0x7dea0e['cssUrl'],_0x141c75=[];if(_0x5bbda2)_0x141c75['push'](_0x5bbda2);if(_0x2f5d20)_0x141c75['push'](_0x2f5d20);const _0x1c3950=validateParams(_0x7dea0e);if(_0x1c3950[_0x566f65(0x9f)]>0x0){const _0x183db9=_0x1c3950[_0x566f65(0xb2)](_0x3041bf=>_0x566f65(0x97)+_0x3041bf[_0x566f65(0x9a)]+':\x20'+_0x3041bf[_0x566f65(0x95)])[_0x566f65(0x9c)](';\x20');throw new Error(_0x566f65(0x9d)+_0x183db9);}logger[_0x566f65(0xa4)](process[_0x566f65(0xa2)]()),logger['info']('menu-sync',_0x566f65(0xa1),{'appCode':_0x1f012f,'selectedCount':_0x3b75b0[_0x566f65(0x9f)],'jsUrl':_0x5bbda2,'cssUrl':_0x2f5d20});if(_0x5bbda2){const _0x39cd04=await isUrlReachable(_0x5bbda2);if(!_0x39cd04)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x5bbda2);}if(_0x2f5d20){const _0x4fd237=await isUrlReachable(_0x2f5d20);if(!_0x4fd237)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x2f5d20);}const _0x54d9aa=getLocalPages();if(_0x54d9aa['length']===0x0){if(_0x3b75b0[_0x566f65(0x9f)]>0x0)throw new Error(_0x566f65(0xc7)+_0x3b75b0['join'](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x26463f[_0x566f65(0xa3)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x319442=await getOnlineMenuList(_0x1f012f,_0x1b7ff3),_0x240206=new Set(_0x319442[_0x566f65(0xb2)](_0x210425=>menuPathKey(_0x210425[_0x566f65(0xae)])));let _0x2cf348;if(_0x3b75b0[_0x566f65(0x9f)]>0x0){const _0x590c38=new Map(_0x54d9aa[_0x566f65(0xb2)](_0x4774fc=>[menuPathKey(_0x4774fc['path']),_0x4774fc])),_0x514e6b=_0x3b75b0[_0x566f65(0xc5)](_0x2be184=>!_0x590c38[_0x566f65(0xb6)](_0x2be184));if(_0x514e6b[_0x566f65(0x9f)]>0x0){const _0x342805=_0x54d9aa['map'](_0x11cb30=>_0x11cb30['path'])[_0x566f65(0x9c)](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x514e6b['join'](',\x20')+_0x566f65(0xc0)+_0x342805);}const _0xb489bd=_0x3b75b0[_0x566f65(0xc5)](_0xabb53=>_0x240206[_0x566f65(0xb6)](_0xabb53));if(_0xb489bd[_0x566f65(0x9f)]>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0xb489bd[_0x566f65(0x9c)](',\x20'));_0x2cf348=_0x3b75b0[_0x566f65(0xb2)](_0x23cd4d=>_0x590c38[_0x566f65(0xc3)](_0x23cd4d));}else _0x2cf348=_0x54d9aa[_0x566f65(0xc5)](_0x5dd5ca=>!_0x240206['has'](menuPathKey(_0x5dd5ca['path'])));if(_0x2cf348['length']===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x26463f[_0x566f65(0xa3)]===!![],'targetPages':[],'plannedMenus':[]};_0x2cf348=_0x2cf348['map'](_0x5470f9=>resolvePage(_0x5470f9,_0x7dea0e,_0x319442));_0x7dea0e[_0x566f65(0xac)]&&_0x141c75[_0x566f65(0x9f)]===0x0&&await assertSharedResourcesConfigured(_0x1f012f,_0x1b7ff3,_0x7dea0e['appName']);const _0x23d935=_0x2cf348[_0x566f65(0xb2)](_0x57b6fa=>({'type':_0x566f65(0xb8),'path':_0x57b6fa[_0x566f65(0xae)],'label':_0x57b6fa[_0x566f65(0xa7)],'loadScriptMode':_0x566f65(0xa5),'resources':[..._0x141c75],..._0x57b6fa[_0x566f65(0xbd)]===undefined?{}:{'visible':_0x57b6fa[_0x566f65(0xbd)]},..._0x57b6fa[_0x566f65(0xba)]===undefined?{}:{'parentId':_0x57b6fa[_0x566f65(0xba)]},..._0x57b6fa[_0x566f65(0x8d)]===undefined?{}:{'sort':_0x57b6fa[_0x566f65(0x8d)]},..._0x7dea0e['appName']===undefined?{}:{'appName':_0x7dea0e['appName']}}));if(_0x26463f[_0x566f65(0xa3)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x2cf348,'plannedMenus':_0x23d935};const _0x44fb06=_0x7dea0e[_0x566f65(0xac)]?await createMenus(_0x1f012f,_0x1b7ff3,_0x2cf348,_0x141c75[_0x566f65(0x9f)]>0x0?_0x141c75:undefined,{'appName':_0x7dea0e[_0x566f65(0xac)]}):await createMenus(_0x1f012f,_0x1b7ff3,_0x2cf348,_0x141c75['length']>0x0?_0x141c75:undefined);return logger[_0x566f65(0xaf)](_0x566f65(0x90),_0x566f65(0x8c),{'count':_0x2cf348[_0x566f65(0x9f)],'resources':_0x141c75}),{'created':_0x44fb06[_0x566f65(0x9f)],'skipped':![],'dryRun':![],'targetPages':_0x2cf348,'plannedMenus':_0x23d935,'menus':_0x44fb06};}export function parseMenuSyncParams(_0x48579a){const _0x30b787=a173_0x58f940;if(!_0x48579a||typeof _0x48579a!==_0x30b787(0xa8))return{};let _0x1bca6b;try{_0x1bca6b=JSON[_0x30b787(0xb4)](_0x48579a);}catch{throw new Error(_0x30b787(0xb1));}if(typeof _0x1bca6b!==_0x30b787(0xaa)||_0x1bca6b===null||Array[_0x30b787(0xc2)](_0x1bca6b))throw new Error('Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.');const _0x4d26a5=_0x1bca6b;if(Object[_0x30b787(0xbb)](_0x4d26a5,'pages'))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x50f48f=Object['keys'](_0x4d26a5)[_0x30b787(0xc5)](_0x19d2ac=>!MENU_SYNC_PARAM_KEYS[_0x30b787(0xb6)](_0x19d2ac));if(_0x50f48f[_0x30b787(0x9f)]>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x50f48f[_0x30b787(0x9c)](',\x20')+'.');for(const _0x188b70 of['jsUrl',_0x30b787(0xbe),_0x30b787(0xac)]){const _0x4a45f4=_0x4d26a5[_0x188b70];if(_0x4a45f4!==undefined&&(typeof _0x4a45f4!=='string'||_0x4a45f4['trim']()===''))throw new Error(_0x30b787(0xb0)+_0x188b70+':\x20expected\x20a\x20non-empty\x20string.');}if(_0x4d26a5['visible']!==undefined&&typeof _0x4d26a5[_0x30b787(0xbd)]!==_0x30b787(0xa0))throw new Error('Invalid\x20--params.visible:\x20expected\x20a\x20boolean.');if(_0x4d26a5[_0x30b787(0xba)]!==undefined&&(!Number['isInteger'](_0x4d26a5['parentId'])||_0x4d26a5[_0x30b787(0xba)]<0x0))throw new Error(_0x30b787(0xbc));return{'jsUrl':typeof _0x4d26a5[_0x30b787(0xc4)]===_0x30b787(0xa8)?_0x4d26a5[_0x30b787(0xc4)][_0x30b787(0xa6)]():undefined,'cssUrl':typeof _0x4d26a5['cssUrl']==='string'?_0x4d26a5[_0x30b787(0xbe)][_0x30b787(0xa6)]():undefined,'appName':typeof _0x4d26a5[_0x30b787(0xac)]===_0x30b787(0xa8)?_0x4d26a5[_0x30b787(0xac)][_0x30b787(0xa6)]():undefined,'visible':typeof _0x4d26a5[_0x30b787(0xbd)]==='boolean'?_0x4d26a5['visible']:undefined,'parentId':typeof _0x4d26a5[_0x30b787(0xba)]===_0x30b787(0x9b)?_0x4d26a5[_0x30b787(0xba)]:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x44358a,_0x2b8c80){const _0x12950c=a175_0x4f14,_0x57ea0b=_0x44358a();while(!![]){try{const _0x5c4e77=parseInt(_0x12950c(0xdd))/0x1+parseInt(_0x12950c(0xd9))/0x2+-parseInt(_0x12950c(0xb0))/0x3*(-parseInt(_0x12950c(0xe6))/0x4)+-parseInt(_0x12950c(0xca))/0x5+-parseInt(_0x12950c(0xdc))/0x6*(-parseInt(_0x12950c(0xef))/0x7)+parseInt(_0x12950c(0xb6))/0x8*(parseInt(_0x12950c(0xb3))/0x9)+-parseInt(_0x12950c(0xd8))/0xa;if(_0x5c4e77===_0x2b8c80)break;else _0x57ea0b['push'](_0x57ea0b['shift']());}catch(_0x2f05e0){_0x57ea0b['push'](_0x57ea0b['shift']());}}}(a175_0x257e,0x4f0d8));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(_0x2c750a){const _0x2adf02=a175_0x4f14,_0x47399e=[];return _0x2c750a[_0x2adf02(0xe4)]&&!isValidJsHttpsUrl(_0x2c750a['jsUrl'])&&_0x47399e['push']({'field':_0x2adf02(0xe4),'message':_0x2adf02(0xaf)}),_0x2c750a['cssUrl']&&!isValidCssHttpsUrl(_0x2c750a[_0x2adf02(0xec)])&&_0x47399e['push']({'field':'cssUrl','message':_0x2adf02(0xdb)}),_0x47399e;}export async function runMenuUpdateCore(_0x450bad,_0x47bca6,_0x48bc8e,_0x2559e2={}){const _0xdc3604=a175_0x4f14,_0x19df46=parseUpdateParamsFlag(_0x48bc8e),_0x8d5159=normalizeMode(_0x2559e2[_0xdc3604(0xac)]);validateSelection(_0x2559e2[_0xdc3604(0xe0)]);const _0xe52a1f=[];if(_0x19df46[_0xdc3604(0xe4)])_0xe52a1f[_0xdc3604(0xbf)](_0x19df46[_0xdc3604(0xe4)]);if(_0x19df46[_0xdc3604(0xec)])_0xe52a1f[_0xdc3604(0xbf)](_0x19df46['cssUrl']);const _0x4da46d=validateParams(_0x19df46);if(_0x4da46d[_0xdc3604(0xdf)]>0x0){const _0x44f234=_0x4da46d['map'](_0x16af2f=>_0xdc3604(0xd3)+_0x16af2f[_0xdc3604(0xbc)]+':\x20'+_0x16af2f['message'])[_0xdc3604(0xc8)](';\x20');throw new Error(_0xdc3604(0xce)+_0x44f234);}if(_0xe52a1f[_0xdc3604(0xdf)]===0x0)throw new Error(_0xdc3604(0xd0)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0xdc3604(0xb1)](process['cwd']()),logger[_0xdc3604(0xea)]('menu-asset-update',_0xdc3604(0xb5),{'appCode':_0x450bad,'jsUrl':_0x19df46[_0xdc3604(0xe4)],'cssUrl':_0x19df46[_0xdc3604(0xec)],'mode':_0x8d5159,'dryRun':_0x2559e2[_0xdc3604(0xc4)]===!![]});if(_0x19df46[_0xdc3604(0xe4)]){const _0x529e22=await isUrlReachable(_0x19df46[_0xdc3604(0xe4)]);if(!_0x529e22)throw new Error(_0xdc3604(0xb9)+_0x19df46[_0xdc3604(0xe4)]);}if(_0x19df46['cssUrl']){const _0x50762e=await isUrlReachable(_0x19df46[_0xdc3604(0xec)]);if(!_0x50762e)throw new Error(_0xdc3604(0xe3)+_0x19df46['cssUrl']);}const _0x3debc7=await getOnlineMenuList(_0x450bad,_0x47bca6),_0x252b44=_0x3debc7[_0xdc3604(0xc3)](_0x2e6c19=>_0x2e6c19['resources'][_0xdc3604(0xdf)]>0x0),_0x3fb464=selectMenusForUpdate(_0x252b44,_0x2559e2[_0xdc3604(0xe0)]);if(_0x3fb464[_0xdc3604(0xdf)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x2559e2[_0xdc3604(0xc4)]===!![]};const _0x2cf937=_0x3fb464[_0xdc3604(0xed)](_0x2d34db=>buildMenuUpdateDiff(_0x2d34db,_0x19df46,_0x8d5159,_0x2559e2[_0xdc3604(0xbd)]===!![],_0x2559e2['loadScriptMode']));if(_0x2559e2[_0xdc3604(0xc4)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x2cf937};const _0x79ac24=await Promise[_0xdc3604(0xcd)](_0x3fb464[_0xdc3604(0xed)]((_0x15be96,_0x32454c)=>updateMenuCdnUrl(_0x450bad,_0x47bca6,{'id':_0x15be96['id'],'label':_0x15be96[_0xdc3604(0xf0)],'path':_0x15be96[_0xdc3604(0xb4)],'resources':_0x2cf937[_0x32454c][_0xdc3604(0xb2)]['resources'],'extend':_0x15be96[_0xdc3604(0xeb)]??null,'loadScriptMode':_0x2559e2[_0xdc3604(0xe5)]}))),_0x1a9f55=_0x79ac24[_0xdc3604(0xc3)](_0x29241e=>_0x29241e[_0xdc3604(0xe2)]===_0xdc3604(0xd2))[_0xdc3604(0xed)](_0x3e8443=>_0x3e8443[_0xdc3604(0xc1)]),_0x16c3f4=_0x79ac24[_0xdc3604(0xc3)](_0x5db429=>_0x5db429[_0xdc3604(0xe2)]===_0xdc3604(0xbe))[_0xdc3604(0xdf)];return logger[_0xdc3604(0xea)](_0xdc3604(0xd7),_0xdc3604(0xc5),{'count':_0x3fb464['length'],'resources':_0xe52a1f}),{'updated':_0x1a9f55[_0xdc3604(0xdf)],'failed':_0x16c3f4,'skipped':![],'menus':_0x1a9f55};}function validateSelection(_0x4713b6){const _0x204b0c=a175_0x4f14;if(!_0x4713b6)throw new Error(_0x204b0c(0xb8));if(_0x4713b6[_0x204b0c(0xd6)]&&(_0x4713b6[_0x204b0c(0xe1)]['length']>0x0||_0x4713b6[_0x204b0c(0xcf)]['length']>0x0))throw new Error(_0x204b0c(0xda));if(!_0x4713b6[_0x204b0c(0xd6)]&&_0x4713b6[_0x204b0c(0xe1)][_0x204b0c(0xdf)]===0x0&&_0x4713b6[_0x204b0c(0xcf)]['length']===0x0)throw new Error(_0x204b0c(0xb8));}export function selectMenusForUpdate(_0x4d209a,_0x5c89cf){const _0x5e6f15=a175_0x4f14;validateSelection(_0x5c89cf);if(_0x5c89cf['all'])return _0x4d209a;const _0x4e6af=new Set(_0x4d209a[_0x5e6f15(0xed)](_0x188e1b=>_0x188e1b['id'])),_0x130583=new Set(_0x4d209a['map'](_0x1309b3=>_0x1309b3[_0x5e6f15(0xb4)])),_0x1dd3b0=_0x5c89cf[_0x5e6f15(0xe1)][_0x5e6f15(0xc3)](_0x20de20=>!_0x4e6af[_0x5e6f15(0xc9)](_0x20de20)),_0x3eaaca=_0x5c89cf[_0x5e6f15(0xcf)][_0x5e6f15(0xc3)](_0x5695f0=>!_0x130583[_0x5e6f15(0xc9)](_0x5695f0));if(_0x1dd3b0[_0x5e6f15(0xdf)]>0x0||_0x3eaaca[_0x5e6f15(0xdf)]>0x0){const _0x2cd338=[..._0x1dd3b0[_0x5e6f15(0xed)](_0x527519=>String(_0x527519)),..._0x3eaaca][_0x5e6f15(0xc8)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x2cd338);}const _0x3d75b4=new Set(_0x5c89cf[_0x5e6f15(0xe1)]),_0x5324be=new Set(_0x5c89cf['paths']);return _0x4d209a[_0x5e6f15(0xc3)](_0x5d3453=>_0x3d75b4[_0x5e6f15(0xc9)](_0x5d3453['id'])||_0x5324be[_0x5e6f15(0xc9)](_0x5d3453[_0x5e6f15(0xb4)]));}function normalizeMode(_0x305652){const _0x288976=a175_0x4f14;if(!_0x305652)return'patch';if(_0x305652==='replace'||_0x305652===_0x288976(0xbb))return _0x305652;throw new Error(_0x288976(0xcb)+_0x305652+_0x288976(0xd5));}function buildMenuUpdateDiff(_0x1d7919,_0x205ffd,_0x1a2247,_0xd5bfa1,_0x1e7c60){const _0x5ece0b=a175_0x4f14,_0x3a80af=[..._0x1d7919[_0x5ece0b(0xd1)]];_0x1a2247===_0x5ece0b(0xbb)&&assertUnambiguousPatchResources(_0x1d7919,_0x3a80af,_0x205ffd);const _0x21cce8=_0x1a2247===_0x5ece0b(0xbb)?patchResources(_0x3a80af,_0x205ffd):replaceResources(_0x205ffd),_0x112b45=[],_0x17863e=_0x3a80af['some'](isJsResource),_0x2000dc=_0x21cce8['some'](isJsResource);if(_0x17863e&&!_0x2000dc){const _0x23ad81=_0x5ece0b(0xe8)+_0x1d7919[_0x5ece0b(0xf0)]+_0x5ece0b(0xc7)+_0x1d7919[_0x5ece0b(0xb4)]+').\x20'+_0x5ece0b(0xe7);if(!_0xd5bfa1)throw new Error(_0x23ad81);_0x112b45['push'](_0x23ad81);}const _0x3086d7=_0x3a80af[_0x5ece0b(0xd4)](isCssResource),_0x261ecb=_0x21cce8[_0x5ece0b(0xd4)](isCssResource);_0x3086d7&&!_0x261ecb&&_0x112b45[_0x5ece0b(0xbf)](_0x5ece0b(0xc0)+_0x1d7919[_0x5ece0b(0xf0)]+_0x5ece0b(0xc7)+_0x1d7919[_0x5ece0b(0xb4)]+').');const _0x5cd311=typeof _0x1d7919[_0x5ece0b(0xeb)]?.['loadScriptMode']===_0x5ece0b(0xde)?_0x1d7919[_0x5ece0b(0xeb)][_0x5ece0b(0xe5)]:null,_0x5ce32f=_0x1e7c60?{'loadScriptMode':_0x5cd311}:{},_0x26fbb0=_0x1e7c60?{'loadScriptMode':_0x1e7c60}:{};return{'id':_0x1d7919['id'],'label':_0x1d7919['label'],'path':_0x1d7919[_0x5ece0b(0xb4)],'mode':_0x1a2247,'before':{'resources':_0x3a80af,..._0x5ce32f},'after':{'resources':_0x21cce8,..._0x26fbb0},'warnings':_0x112b45};}function a175_0x4f14(_0xb20085,_0x51e446){_0xb20085=_0xb20085-0xab;const _0x257e2f=a175_0x257e();let _0x4f1412=_0x257e2f[_0xb20085];return _0x4f1412;}function replaceResources(_0x2bb33a){const _0x28177f=a175_0x4f14;return[_0x2bb33a[_0x28177f(0xe4)],_0x2bb33a['cssUrl']][_0x28177f(0xc3)](_0x2e9ca6=>!!_0x2e9ca6);}function assertUnambiguousPatchResources(_0x4f73a2,_0x56aa2c,_0x3bf993){const _0xabc873=a175_0x4f14,_0x24c3b4=_0x56aa2c[_0xabc873(0xc3)](isJsResource)[_0xabc873(0xdf)];if(_0x3bf993[_0xabc873(0xe4)]&&_0x24c3b4>0x1)throw new Error(_0xabc873(0xf2)+_0x24c3b4+_0xabc873(0xab)+_0x4f73a2[_0xabc873(0xf0)]+_0xabc873(0xc7)+_0x4f73a2[_0xabc873(0xb4)]+')\x20'+_0xabc873(0xad));const _0x95e933=_0x56aa2c[_0xabc873(0xc3)](isCssResource)['length'];if(_0x3bf993[_0xabc873(0xec)]&&_0x95e933>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x95e933+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x4f73a2[_0xabc873(0xf0)]+_0xabc873(0xc7)+_0x4f73a2[_0xabc873(0xb4)]+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function patchResources(_0x9e7e6b,_0x51f69d){const _0x597d0c=a175_0x4f14;let _0x1221c4=![],_0x3b6832=![];const _0x2dfe19=[];for(const _0x3e23af of _0x9e7e6b){if(isJsResource(_0x3e23af)){if(_0x51f69d['jsUrl']&&!_0x1221c4)_0x2dfe19[_0x597d0c(0xbf)](_0x51f69d['jsUrl']),_0x1221c4=!![];else!_0x51f69d[_0x597d0c(0xe4)]&&_0x2dfe19[_0x597d0c(0xbf)](_0x3e23af);continue;}if(isCssResource(_0x3e23af)){if(_0x51f69d[_0x597d0c(0xec)]&&!_0x3b6832)_0x2dfe19[_0x597d0c(0xbf)](_0x51f69d[_0x597d0c(0xec)]),_0x3b6832=!![];else!_0x51f69d[_0x597d0c(0xec)]&&_0x2dfe19[_0x597d0c(0xbf)](_0x3e23af);continue;}_0x2dfe19['push'](_0x3e23af);}return _0x51f69d[_0x597d0c(0xe4)]&&!_0x1221c4&&_0x2dfe19[_0x597d0c(0xc6)](_0x51f69d[_0x597d0c(0xe4)]),_0x51f69d[_0x597d0c(0xec)]&&!_0x3b6832&&_0x2dfe19[_0x597d0c(0xbf)](_0x51f69d[_0x597d0c(0xec)]),_0x2dfe19;}function isJsResource(_0xd3abb2){const _0xd5b0c=a175_0x4f14;return stripQuery(_0xd3abb2)[_0xd5b0c(0xae)]()[_0xd5b0c(0xb7)](_0xd5b0c(0xee));}function isCssResource(_0x498e51){const _0x322888=a175_0x4f14;return stripQuery(_0x498e51)['toLowerCase']()[_0x322888(0xb7)]('.css');}function stripQuery(_0xe4f429){const _0x20ecfd=a175_0x4f14;return _0xe4f429[_0x20ecfd(0xe9)]('?')[0x0]??_0xe4f429;}function parseUpdateParamsFlag(_0x2dd0a0){const _0x1473e5=a175_0x4f14;if(!_0x2dd0a0||typeof _0x2dd0a0!=='string')return{};try{const _0x304aa6=JSON[_0x1473e5(0xc2)](_0x2dd0a0);if(typeof _0x304aa6!==_0x1473e5(0xf1)||_0x304aa6===null||Array[_0x1473e5(0xba)](_0x304aa6))return{};return{'jsUrl':typeof _0x304aa6[_0x1473e5(0xe4)]===_0x1473e5(0xde)?_0x304aa6[_0x1473e5(0xe4)][_0x1473e5(0xcc)]():undefined,'cssUrl':typeof _0x304aa6[_0x1473e5(0xec)]===_0x1473e5(0xde)?_0x304aa6[_0x1473e5(0xec)]['trim']():undefined};}catch{return{};}}function a175_0x257e(){const _0x57761c=['some','.\x20Allowed\x20values:\x20replace,\x20patch','all','menu-asset-update','6992460FyuRKm','668546XOrTjE','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','2118RUsJvF','501655FtAPCZ','string','length','selection','menuIds','status','CSS\x20URL\x20is\x20unreachable:\x20','jsUrl','loadScriptMode','8tqgTkw','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','split','info','extend','cssUrl','map','.js','2072aWLsfj','label','object','menu\x20asset-update\x20cannot\x20patch\x20','\x20existing\x20JS\x20resources\x20for\x20\x22','mode','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','toLowerCase','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','281661ySONKH','setLogPath','after','59346TeFzcN','path','Start\x20non-interactive\x20menu\x20asset\x20update','56EQgNjm','endsWith','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','JS\x20URL\x20is\x20unreachable:\x20','isArray','patch','field','force','rejected','push','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','value','parse','filter','dryRun','Menu\x20asset\x20update\x20completed','unshift','\x22\x20(','join','has','756510ISGmUK','Invalid\x20--mode:\x20','trim','allSettled','Invalid\x20--params:\x20','paths','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','resources','fulfilled','--params.'];a175_0x257e=function(){return _0x57761c;};return a175_0x257e();}
|
|
1
|
+
(function(_0x622895,_0x5f0fb1){const _0x26797e=a175_0x3c91,_0x371b1f=_0x622895();while(!![]){try{const _0x1e9e1d=parseInt(_0x26797e(0xd8))/0x1+-parseInt(_0x26797e(0xbd))/0x2+parseInt(_0x26797e(0xdb))/0x3*(parseInt(_0x26797e(0xcb))/0x4)+parseInt(_0x26797e(0xd0))/0x5+-parseInt(_0x26797e(0xb7))/0x6*(parseInt(_0x26797e(0xa8))/0x7)+-parseInt(_0x26797e(0xd4))/0x8+-parseInt(_0x26797e(0x9d))/0x9*(-parseInt(_0x26797e(0xdd))/0xa);if(_0x1e9e1d===_0x5f0fb1)break;else _0x371b1f['push'](_0x371b1f['shift']());}catch(_0x59bf39){_0x371b1f['push'](_0x371b1f['shift']());}}}(a175_0x2131,0x50c17));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a175_0x3c91(_0x30d078,_0x1b4bf4){_0x30d078=_0x30d078-0x92;const _0x2131a3=a175_0x2131();let _0x3c9140=_0x2131a3[_0x30d078];return _0x3c9140;}import{logger}from'../../../utils/logger.js';function validateParams(_0x171e7a){const _0x1063bb=a175_0x3c91,_0x1f4590=[];return _0x171e7a[_0x1063bb(0xad)]&&!isValidJsHttpsUrl(_0x171e7a[_0x1063bb(0xad)])&&_0x1f4590['push']({'field':_0x1063bb(0xad),'message':_0x1063bb(0xc5)}),_0x171e7a[_0x1063bb(0x9a)]&&!isValidCssHttpsUrl(_0x171e7a[_0x1063bb(0x9a)])&&_0x1f4590['push']({'field':_0x1063bb(0x9a),'message':_0x1063bb(0x95)}),_0x1f4590;}export async function runMenuUpdateCore(_0x121469,_0x216fa1,_0x50ab57,_0x780f53={}){const _0x51aa1c=a175_0x3c91,_0x1c5a82=parseUpdateParamsFlag(_0x50ab57),_0x39babd=normalizeMode(_0x780f53[_0x51aa1c(0xa0)]);validateSelection(_0x780f53[_0x51aa1c(0xbc)]);const _0x2e4cbc=[];if(_0x1c5a82[_0x51aa1c(0xad)])_0x2e4cbc['push'](_0x1c5a82['jsUrl']);if(_0x1c5a82['cssUrl'])_0x2e4cbc[_0x51aa1c(0xa6)](_0x1c5a82[_0x51aa1c(0x9a)]);const _0x145d8d=validateParams(_0x1c5a82);if(_0x145d8d[_0x51aa1c(0xa3)]>0x0){const _0xaa9560=_0x145d8d[_0x51aa1c(0x9e)](_0x4682dd=>_0x51aa1c(0xac)+_0x4682dd[_0x51aa1c(0xce)]+':\x20'+_0x4682dd['message'])[_0x51aa1c(0xc1)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0xaa9560);}if(_0x2e4cbc[_0x51aa1c(0xa3)]===0x0)throw new Error(_0x51aa1c(0xc4)+_0x51aa1c(0x99));logger[_0x51aa1c(0xc9)](process[_0x51aa1c(0xb5)]()),logger['info'](_0x51aa1c(0xa9),_0x51aa1c(0xba),{'appCode':_0x121469,'jsUrl':_0x1c5a82[_0x51aa1c(0xad)],'cssUrl':_0x1c5a82[_0x51aa1c(0x9a)],'mode':_0x39babd,'dryRun':_0x780f53[_0x51aa1c(0xb3)]===!![]});if(_0x1c5a82['jsUrl']){const _0x2b4b6c=await isUrlReachable(_0x1c5a82[_0x51aa1c(0xad)]);if(!_0x2b4b6c)throw new Error(_0x51aa1c(0xcf)+_0x1c5a82[_0x51aa1c(0xad)]);}if(_0x1c5a82[_0x51aa1c(0x9a)]){const _0x4b61a7=await isUrlReachable(_0x1c5a82[_0x51aa1c(0x9a)]);if(!_0x4b61a7)throw new Error(_0x51aa1c(0xb2)+_0x1c5a82['cssUrl']);}const _0x33af67=await getOnlineMenuList(_0x121469,_0x216fa1),_0x19cf28=_0x33af67[_0x51aa1c(0xaf)](_0x1e359e=>_0x1e359e['resources'][_0x51aa1c(0xa3)]>0x0),_0x30a169=selectMenusForUpdate(_0x19cf28,_0x780f53[_0x51aa1c(0xbc)]);if(_0x30a169[_0x51aa1c(0xa3)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x780f53[_0x51aa1c(0xb3)]===!![]};const _0x1f50ea=_0x30a169['map'](_0x546a5e=>buildMenuUpdateDiff(_0x546a5e,_0x1c5a82,_0x39babd,_0x780f53[_0x51aa1c(0xd9)]===!![],_0x780f53[_0x51aa1c(0xaa)]));if(_0x780f53[_0x51aa1c(0xb3)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x1f50ea};const _0x32f728=await Promise[_0x51aa1c(0xc6)](_0x30a169[_0x51aa1c(0x9e)]((_0x3183c8,_0x708c34)=>updateMenuCdnUrl(_0x121469,_0x216fa1,{'id':_0x3183c8['id'],'label':_0x3183c8[_0x51aa1c(0xa7)],'path':_0x3183c8['path'],'resources':_0x1f50ea[_0x708c34][_0x51aa1c(0xab)][_0x51aa1c(0xb9)],'extend':_0x3183c8[_0x51aa1c(0xa5)]??null,'loadScriptMode':_0x780f53[_0x51aa1c(0xaa)]}))),_0x5c01fa=_0x32f728[_0x51aa1c(0xaf)](_0x11e494=>_0x11e494[_0x51aa1c(0xc3)]===_0x51aa1c(0xd2))[_0x51aa1c(0x9e)](_0x5023b4=>_0x5023b4[_0x51aa1c(0xae)]),_0x5c7739=_0x32f728[_0x51aa1c(0xaf)](_0x3b3edc=>_0x3b3edc[_0x51aa1c(0xc3)]===_0x51aa1c(0x97))[_0x51aa1c(0xa3)];return logger[_0x51aa1c(0xc2)](_0x51aa1c(0xa9),_0x51aa1c(0xbf),{'count':_0x30a169[_0x51aa1c(0xa3)],'resources':_0x2e4cbc}),{'updated':_0x5c01fa['length'],'failed':_0x5c7739,'skipped':![],'menus':_0x5c01fa};}function validateSelection(_0xb8fba1){const _0x124c24=a175_0x3c91;if(!_0xb8fba1)throw new Error(_0x124c24(0x96));if(_0xb8fba1[_0x124c24(0xd3)]&&(_0xb8fba1[_0x124c24(0xa4)][_0x124c24(0xa3)]>0x0||_0xb8fba1[_0x124c24(0xb4)][_0x124c24(0xa3)]>0x0))throw new Error('--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.');if(!_0xb8fba1[_0x124c24(0xd3)]&&_0xb8fba1['menuIds']['length']===0x0&&_0xb8fba1[_0x124c24(0xb4)]['length']===0x0)throw new Error(_0x124c24(0x96));}export function selectMenusForUpdate(_0x23348f,_0x46c2bf){const _0x4828b1=a175_0x3c91;validateSelection(_0x46c2bf);if(_0x46c2bf[_0x4828b1(0xd3)])return _0x23348f;const _0x1710da=new Set(_0x23348f[_0x4828b1(0x9e)](_0x582d56=>_0x582d56['id'])),_0x4e30c2=new Set(_0x23348f['map'](_0x220d50=>_0x220d50[_0x4828b1(0xdc)])),_0xd31332=_0x46c2bf['menuIds'][_0x4828b1(0xaf)](_0x408186=>!_0x1710da[_0x4828b1(0xa2)](_0x408186)),_0x1510c2=_0x46c2bf[_0x4828b1(0xb4)]['filter'](_0x2100bf=>!_0x4e30c2[_0x4828b1(0xa2)](_0x2100bf));if(_0xd31332[_0x4828b1(0xa3)]>0x0||_0x1510c2[_0x4828b1(0xa3)]>0x0){const _0x4806df=[..._0xd31332['map'](_0x552d24=>String(_0x552d24)),..._0x1510c2][_0x4828b1(0xc1)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x4806df);}const _0x52c11c=new Set(_0x46c2bf['menuIds']),_0x55453b=new Set(_0x46c2bf[_0x4828b1(0xb4)]);return _0x23348f[_0x4828b1(0xaf)](_0xc44a3e=>_0x52c11c[_0x4828b1(0xa2)](_0xc44a3e['id'])||_0x55453b[_0x4828b1(0xa2)](_0xc44a3e[_0x4828b1(0xdc)]));}function normalizeMode(_0xc6fb3b){const _0x416d26=a175_0x3c91;if(!_0xc6fb3b)return _0x416d26(0xcd);if(_0xc6fb3b===_0x416d26(0xa1)||_0xc6fb3b===_0x416d26(0xcd))return _0xc6fb3b;throw new Error(_0x416d26(0x93)+_0xc6fb3b+_0x416d26(0xc0));}function buildMenuUpdateDiff(_0x29defb,_0x49d6a0,_0x594dd9,_0x31bfa1,_0x11e595){const _0x439aaa=a175_0x3c91,_0x51912b=[..._0x29defb[_0x439aaa(0xb9)]];_0x594dd9===_0x439aaa(0xcd)&&assertUnambiguousPatchResources(_0x29defb,_0x51912b,_0x49d6a0);const _0x4bb5a2=_0x594dd9===_0x439aaa(0xcd)?patchResources(_0x51912b,_0x49d6a0):replaceResources(_0x49d6a0),_0x22c74a=[],_0x1df8e9=_0x51912b[_0x439aaa(0x9c)](isJsResource),_0x4edb35=_0x4bb5a2[_0x439aaa(0x9c)](isJsResource);if(_0x1df8e9&&!_0x4edb35){const _0x3ad2f5=_0x439aaa(0xbb)+_0x29defb[_0x439aaa(0xa7)]+_0x439aaa(0x92)+_0x29defb[_0x439aaa(0xdc)]+_0x439aaa(0x9b)+_0x439aaa(0xb6);if(!_0x31bfa1)throw new Error(_0x3ad2f5);_0x22c74a[_0x439aaa(0xa6)](_0x3ad2f5);}const _0x2af8e1=_0x51912b[_0x439aaa(0x9c)](isCssResource),_0x45e6c9=_0x4bb5a2[_0x439aaa(0x9c)](isCssResource);_0x2af8e1&&!_0x45e6c9&&_0x22c74a[_0x439aaa(0xa6)](_0x439aaa(0xbe)+_0x29defb[_0x439aaa(0xa7)]+_0x439aaa(0x92)+_0x29defb[_0x439aaa(0xdc)]+').');const _0x57974a=typeof _0x29defb[_0x439aaa(0xa5)]?.[_0x439aaa(0xaa)]===_0x439aaa(0xca)?_0x29defb[_0x439aaa(0xa5)][_0x439aaa(0xaa)]:null,_0x2828eb=_0x11e595?{'loadScriptMode':_0x57974a}:{},_0x386f4f=_0x11e595?{'loadScriptMode':_0x11e595}:{};return{'id':_0x29defb['id'],'label':_0x29defb['label'],'path':_0x29defb[_0x439aaa(0xdc)],'mode':_0x594dd9,'before':{'resources':_0x51912b,..._0x2828eb},'after':{'resources':_0x4bb5a2,..._0x386f4f},'warnings':_0x22c74a};}function replaceResources(_0x2c010d){const _0x4eafa1=a175_0x3c91;return[_0x2c010d['jsUrl'],_0x2c010d[_0x4eafa1(0x9a)]][_0x4eafa1(0xaf)](_0x366613=>!!_0x366613);}function assertUnambiguousPatchResources(_0x415d10,_0x426e65,_0x510468){const _0x26813f=a175_0x3c91,_0x1ed715=_0x426e65[_0x26813f(0xaf)](isJsResource)[_0x26813f(0xa3)];if(_0x510468[_0x26813f(0xad)]&&_0x1ed715>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x1ed715+_0x26813f(0xd5)+_0x415d10['label']+'\x22\x20('+_0x415d10['path']+')\x20'+_0x26813f(0xc7));const _0xd733e0=_0x426e65['filter'](isCssResource)[_0x26813f(0xa3)];if(_0x510468[_0x26813f(0x9a)]&&_0xd733e0>0x1)throw new Error(_0x26813f(0xd6)+_0xd733e0+_0x26813f(0xb8)+_0x415d10[_0x26813f(0xa7)]+'\x22\x20('+_0x415d10[_0x26813f(0xdc)]+')\x20'+_0x26813f(0xd7));}function patchResources(_0xf877d1,_0x554718){const _0x330e06=a175_0x3c91;let _0x34ad3c=![],_0x4bf76c=![];const _0x41bc52=[];for(const _0x84b43f of _0xf877d1){if(isJsResource(_0x84b43f)){if(_0x554718[_0x330e06(0xad)]&&!_0x34ad3c)_0x41bc52['push'](_0x554718['jsUrl']),_0x34ad3c=!![];else!_0x554718['jsUrl']&&_0x41bc52['push'](_0x84b43f);continue;}if(isCssResource(_0x84b43f)){if(_0x554718[_0x330e06(0x9a)]&&!_0x4bf76c)_0x41bc52[_0x330e06(0xa6)](_0x554718['cssUrl']),_0x4bf76c=!![];else!_0x554718[_0x330e06(0x9a)]&&_0x41bc52[_0x330e06(0xa6)](_0x84b43f);continue;}_0x41bc52[_0x330e06(0xa6)](_0x84b43f);}return _0x554718[_0x330e06(0xad)]&&!_0x34ad3c&&_0x41bc52[_0x330e06(0xda)](_0x554718[_0x330e06(0xad)]),_0x554718[_0x330e06(0x9a)]&&!_0x4bf76c&&_0x41bc52[_0x330e06(0xa6)](_0x554718[_0x330e06(0x9a)]),_0x41bc52;}function isJsResource(_0x2bc64e){const _0xcdb221=a175_0x3c91;return stripQuery(_0x2bc64e)[_0xcdb221(0x94)]()['endsWith'](_0xcdb221(0xd1));}function isCssResource(_0x508ed9){const _0x459a54=a175_0x3c91;return stripQuery(_0x508ed9)[_0x459a54(0x94)]()[_0x459a54(0x9f)](_0x459a54(0xc8));}function stripQuery(_0x3809d5){const _0x50b0d2=a175_0x3c91;return _0x3809d5[_0x50b0d2(0xcc)]('?')[0x0]??_0x3809d5;}function parseUpdateParamsFlag(_0x1016c4){const _0x495dc7=a175_0x3c91;if(!_0x1016c4||typeof _0x1016c4!==_0x495dc7(0xca))return{};try{const _0x22199d=JSON['parse'](_0x1016c4);if(typeof _0x22199d!==_0x495dc7(0x98)||_0x22199d===null||Array[_0x495dc7(0xb0)](_0x22199d))return{};return{'jsUrl':typeof _0x22199d[_0x495dc7(0xad)]===_0x495dc7(0xca)?_0x22199d['jsUrl'][_0x495dc7(0xb1)]():undefined,'cssUrl':typeof _0x22199d[_0x495dc7(0x9a)]===_0x495dc7(0xca)?_0x22199d[_0x495dc7(0x9a)][_0x495dc7(0xb1)]():undefined};}catch{return{};}}function a175_0x2131(){const _0x2e15c8=['toLowerCase','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','rejected','object','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','cssUrl',').\x20','some','186381WnsheY','map','endsWith','mode','replace','has','length','menuIds','extend','push','label','763AxmosM','menu-asset-update','loadScriptMode','after','--params.','jsUrl','value','filter','isArray','trim','CSS\x20URL\x20is\x20unreachable:\x20','dryRun','paths','cwd','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','21498ioCEmR','\x20existing\x20CSS\x20resources\x20for\x20\x22','resources','Start\x20non-interactive\x20menu\x20asset\x20update','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','selection','904948zRjTHM','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','Menu\x20asset\x20update\x20completed','.\x20Allowed\x20values:\x20replace,\x20patch','join','info','status','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','allSettled','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','.css','setLogPath','string','251848OQAyoZ','split','patch','field','JS\x20URL\x20is\x20unreachable:\x20','2612820DrYXlk','.js','fulfilled','all','4593432EaDedJ','\x20existing\x20JS\x20resources\x20for\x20\x22','menu\x20asset-update\x20cannot\x20patch\x20','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','390371llAJyV','force','unshift','24MYMGVl','path','160posHyJ','\x22\x20(','Invalid\x20--mode:\x20'];a175_0x2131=function(){return _0x2e15c8;};return a175_0x2131();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a176_0x3e8f(){const _0x4a6eb7=['body','trim','2058296VtngHx','997352YTaecY','6852132QqzNlL','10405764dNVOgT','HEAD','8682gAMsHN','test','cancel','6UnDIEs','4371785NCrIDN','159OOLrFX','10403904ZPuGdG'];a176_0x3e8f=function(){return _0x4a6eb7;};return a176_0x3e8f();}(function(_0x261fab,_0x381604){const _0x535d4d=a176_0xcd7b,_0x5a4f66=_0x261fab();while(!![]){try{const _0x383746=parseInt(_0x535d4d(0x1fa))/0x1+-parseInt(_0x535d4d(0x1f0))/0x2*(-parseInt(_0x535d4d(0x1f5))/0x3)+-parseInt(_0x535d4d(0x1f9))/0x4+-parseInt(_0x535d4d(0x1f4))/0x5+-parseInt(_0x535d4d(0x1f3))/0x6*(-parseInt(_0x535d4d(0x1ed))/0x7)+-parseInt(_0x535d4d(0x1f6))/0x8+parseInt(_0x535d4d(0x1ee))/0x9;if(_0x383746===_0x381604)break;else _0x5a4f66['push'](_0x5a4f66['shift']());}catch(_0x51a453){_0x5a4f66['push'](_0x5a4f66['shift']());}}}(a176_0x3e8f,0xa4536));export function isValidJsHttpsUrl(_0x5805cd){const _0x34b77f=a176_0xcd7b;return/^https:\/\/.+\.js(\?.*)?$/[_0x34b77f(0x1f1)](_0x5805cd[_0x34b77f(0x1f8)]());}function a176_0xcd7b(_0x9fe90e,_0x2be701){_0x9fe90e=_0x9fe90e-0x1ed;const _0x3e8f43=a176_0x3e8f();let _0xcd7b19=_0x3e8f43[_0x9fe90e];return _0xcd7b19;}export function isValidCssHttpsUrl(_0x167958){const _0x33ae4d=a176_0xcd7b;return/^https:\/\/.+\.css(\?.*)?$/[_0x33ae4d(0x1f1)](_0x167958['trim']());}export async function isUrlReachable(_0x17dba8){const _0x2273bf=a176_0xcd7b;try{const _0x3cd96a=await fetch(_0x17dba8,{'method':_0x2273bf(0x1ef)});if(_0x3cd96a['ok'])return!![];}catch{}try{const _0x53d9a1=await fetch(_0x17dba8,{'method':'GET','headers':{'Range':'bytes=0-0'}}),_0x3bca5e=_0x53d9a1['ok'];try{await _0x53d9a1[_0x2273bf(0x1f7)]?.[_0x2273bf(0x1f2)]();}catch{}return _0x3bca5e;}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a177_0x354f(_0x28c793,_0x519af6){_0x28c793=_0x28c793-0x12d;const _0x19ecfc=a177_0x19ec();let _0x354f57=_0x19ecfc[_0x28c793];return _0x354f57;}const a177_0xc959f6=a177_0x354f;(function(_0x3e2aa7,_0x597f26){const _0x158d2e=a177_0x354f,_0x53cf93=_0x3e2aa7();while(!![]){try{const _0x3cee7f=-parseInt(_0x158d2e(0x135))/0x1+-parseInt(_0x158d2e(0x134))/0x2*(parseInt(_0x158d2e(0x13b))/0x3)+parseInt(_0x158d2e(0x130))/0x4+-parseInt(_0x158d2e(0x13d))/0x5+-parseInt(_0x158d2e(0x138))/0x6+parseInt(_0x158d2e(0x12e))/0x7+parseInt(_0x158d2e(0x133))/0x8;if(_0x3cee7f===_0x597f26)break;else _0x53cf93['push'](_0x53cf93['shift']());}catch(_0x54328e){_0x53cf93['push'](_0x53cf93['shift']());}}}(a177_0x19ec,0xabf6b));import{getSmartAppRecord}from'../../core/api-client.js';import{getOnlineMenuList}from'../../commands/menu/shared/service.js';function a177_0x19ec(){const _0x4e3ca3=['8190912kznHFc','all','Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','303LTUKky','\x20in\x20menu\x20host\x20','4540780teMgeP','read','6104063NfPUiM','Inspected\x20','925460oWBqmr','boundMenus','subapp-assets-status','18988240UcNfgP','1142JzRPtU','441562uicYET','\x20menu(s)\x20for\x20','cookie'];a177_0x19ec=function(){return _0x4e3ca3;};return a177_0x19ec();}import{buildSubappAssetsStatus,getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';export const menuSubappAssetsStatus={'service':'menu','command':a177_0xc959f6(0x132),'description':a177_0xc959f6(0x13a),'risk':a177_0xc959f6(0x12d),'strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x2772d5){getSubappSelector(_0x2772d5);},async 'execute'(_0x340396){const _0x416e38=a177_0xc959f6,{appCode:_0x96ebf8,appName:_0x5d9701}=getSubappSelector(_0x340396),[_0xcc2add,_0x2e91ca]=await Promise[_0x416e38(0x139)]([getSmartAppRecord(_0x96ebf8,_0x340396[_0x416e38(0x137)]),getOnlineMenuList(_0x96ebf8,_0x340396['cookie'])]),_0x19d00e={'appCode':_0x96ebf8,...buildSubappAssetsStatus(_0xcc2add,_0x2e91ca,_0x5d9701)};return{'ok':!![],'data':_0x19d00e,'message':_0x416e38(0x12f)+_0x19d00e[_0x416e38(0x131)]+_0x416e38(0x136)+_0x5d9701+_0x416e38(0x13c)+_0x96ebf8+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a178_0xe7b19c=a178_0x1d2f;function a178_0x589c(){const _0x43f326=['skinColor','accessKey','1863363Ethdgx','size','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','test','map','.\x20Refusing\x20update.','some',';\x20independent\x20deployment\x20not\x20verified.','object','extend','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','string','keys','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','Would\x20update\x20shared\x20assets\x20for\x20','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','cookie','app.extend.assets','unchanged','directDbEnabled','nextExtend','digest','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','expectedHash','stringify','hex','vipDeploy','24WdUjgk','46642WZxYtB','sha256','enableOpenApi','https:','has','/smartapi/app/update','\x20in\x20menu\x20host\x20','str','--resources\x20is\x20required.','Updated\x20shared\x20resources\x20for\x20','verified\x20app.extend','3826963kifJbq','\x20must\x20be\x20a\x20JSON\x20object.',']\x20must\x20be\x20a\x20URL\x20string.','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','trim','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','15wIjKuy','isArray','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','resources','6037390AvgiWx','resources[','filter','316809vjZZsn','apiError','6mgXWty','\x20must\x20be\x20a\x20JSON\x20array.','entries','enableSample','validation','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','directDbId','length','subapp-assets-update','appPublishStatus','appCode','689932yLWpOZ','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','expected-hash','parse','before','assets','\x20contains\x20invalid\x20JSON.','enableAutoSync',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','POST','551925ttUAOx'];a178_0x589c=function(){return _0x43f326;};return a178_0x589c();}(function(_0x3c8b7f,_0x3d18d0){const _0x83ce97=a178_0x1d2f,_0x15126c=_0x3c8b7f();while(!![]){try{const _0x2116c7=-parseInt(_0x83ce97(0xc1))/0x1+-parseInt(_0x83ce97(0xe1))/0x2+-parseInt(_0x83ce97(0xc4))/0x3+parseInt(_0x83ce97(0xb7))/0x4*(parseInt(_0x83ce97(0xa3))/0x5)+parseInt(_0x83ce97(0xac))/0x6*(parseInt(_0x83ce97(0x9d))/0x7)+-parseInt(_0x83ce97(0xe0))/0x8*(parseInt(_0x83ce97(0xaa))/0x9)+parseInt(_0x83ce97(0xa7))/0xa;if(_0x2116c7===_0x3d18d0)break;else _0x15126c['push'](_0x15126c['shift']());}catch(_0x3c6d14){_0x15126c['push'](_0x15126c['shift']());}}}(a178_0x589c,0x59567));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_0xe7b19c(0xc2),a178_0xe7b19c(0xe3),a178_0xe7b19c(0xc3),'assets','tenantColumn',a178_0xe7b19c(0xaf),a178_0xe7b19c(0xdf),a178_0xe7b19c(0xbe),a178_0xe7b19c(0xb2),a178_0xe7b19c(0xd8)]);function parseObject(_0x4e3497,_0x4403d6){const _0x2ee1a0=a178_0xe7b19c;let _0x99593=_0x4e3497;if(typeof _0x4e3497===_0x2ee1a0(0xd0))try{_0x99593=JSON[_0x2ee1a0(0xba)](_0x4e3497);}catch{throw CliErrors['validation'](_0x4403d6+_0x2ee1a0(0xbd));}if(!_0x99593||typeof _0x99593!==_0x2ee1a0(0xcc)||Array[_0x2ee1a0(0xa4)](_0x99593))throw CliErrors[_0x2ee1a0(0xb0)](_0x4403d6+_0x2ee1a0(0x9e));return _0x99593;}function parseArray(_0x14fbf2,_0xb9421c){const _0x50e0ac=a178_0xe7b19c;let _0x2151a7;try{_0x2151a7=JSON['parse'](_0x14fbf2);}catch{throw CliErrors[_0x50e0ac(0xb0)](_0xb9421c+_0x50e0ac(0xbd));}if(!Array['isArray'](_0x2151a7))throw CliErrors[_0x50e0ac(0xb0)](_0xb9421c+_0x50e0ac(0xad));return _0x2151a7[_0x50e0ac(0xc8)]((_0x589dab,_0x3c0ed0)=>parseObject(_0x589dab,_0xb9421c+'['+_0x3c0ed0+']'));}function a178_0x1d2f(_0x321a85,_0x24fed4){_0x321a85=_0x321a85-0x97;const _0x589c25=a178_0x589c();let _0x1d2f79=_0x589c25[_0x321a85];return _0x1d2f79;}function validateResources(_0x483330){const _0x2eed06=a178_0xe7b19c;if(_0x483330[_0x2eed06(0xb3)]===0x0)throw CliErrors[_0x2eed06(0xb0)]('At\x20least\x20one\x20resource\x20URL\x20is\x20required.');for(const [_0x534d91,_0x293ea6]of _0x483330[_0x2eed06(0xae)]()){if(typeof _0x293ea6!==_0x2eed06(0xd0))throw CliErrors[_0x2eed06(0xb0)](_0x2eed06(0xa8)+_0x534d91+_0x2eed06(0x9f));try{if(new URL(_0x293ea6)['protocol']!==_0x2eed06(0xe4))throw new Error('not\x20HTTPS');}catch{throw CliErrors['validation']('resources['+_0x534d91+_0x2eed06(0xbf));}}if(new Set(_0x483330)[_0x2eed06(0xc5)]!==_0x483330['length']||!_0x483330[_0x2eed06(0xca)](_0x1a9b85=>/\.m?js(?:[?#]|$)/i[_0x2eed06(0xc7)](_0x1a9b85)))throw CliErrors[_0x2eed06(0xb0)](_0x2eed06(0xd4));return _0x483330;}function prepare(_0x2582e0,_0x34e15e,_0x2a81e5){const _0x31f68a=a178_0xe7b19c;if(!Number['isSafeInteger'](_0x2582e0['id'])||(_0x2582e0['id']??0x0)<=0x0||typeof _0x2582e0[_0x31f68a(0xb5)]!==_0x31f68a(0xd0)||!_0x2582e0[_0x31f68a(0xb5)])throw CliErrors[_0x31f68a(0xb0)](_0x31f68a(0xa5));const _0x34a2d0=parseObject(_0x2582e0[_0x31f68a(0xcd)],'app.extend'),_0x3f7c6f=Object[_0x31f68a(0xd1)](_0x34a2d0)['filter'](_0x47ec8b=>!KNOWN_EXTEND_KEYS[_0x31f68a(0xe5)](_0x47ec8b));if(_0x3f7c6f[_0x31f68a(0xb3)])throw CliErrors[_0x31f68a(0xb0)]('Unknown\x20app.extend\x20fields:\x20'+_0x3f7c6f['join'](',\x20')+_0x31f68a(0xc9));if(typeof _0x34a2d0[_0x31f68a(0xbc)]!==_0x31f68a(0xd0))throw CliErrors[_0x31f68a(0xb0)]('app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.');const _0x4fc138=parseArray(_0x34a2d0[_0x31f68a(0xbc)],_0x31f68a(0xd6)),_0x474b3d=_0x4fc138[_0x31f68a(0xa9)](_0x5911f4=>_0x5911f4['appName']===_0x34e15e);if(_0x474b3d[_0x31f68a(0xb3)]!==0x1)throw CliErrors[_0x31f68a(0xb0)](_0x31f68a(0xd2)+_0x34e15e+';\x20found\x20'+_0x474b3d['length']+'.');const _0x4b7626=_0x474b3d[0x0];if(typeof _0x4b7626[_0x31f68a(0xa6)]!==_0x31f68a(0xd0))throw CliErrors[_0x31f68a(0xb0)](_0x31f68a(0xce));let _0x330e6a;try{_0x330e6a=JSON[_0x31f68a(0xba)](_0x4b7626[_0x31f68a(0xa6)]);}catch{throw CliErrors[_0x31f68a(0xb0)]('Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.');}if(!Array[_0x31f68a(0xa4)](_0x330e6a)||_0x330e6a[_0x31f68a(0xca)](_0x1efef5=>typeof _0x1efef5!==_0x31f68a(0xd0)))throw CliErrors['validation'](_0x31f68a(0xa0));const _0x5a8ec3=_0x4fc138[_0x31f68a(0xc8)](_0x47df66=>_0x47df66===_0x4b7626?{..._0x47df66,'resources':JSON[_0x31f68a(0xdd)](_0x2a81e5)}:_0x47df66),_0x12d274={..._0x34a2d0,'assets':JSON['stringify'](_0x5a8ec3)},_0x494d1e=createHash(_0x31f68a(0xe2))['update'](JSON[_0x31f68a(0xdd)]({'appCode':_0x2582e0[_0x31f68a(0xb6)],'id':_0x2582e0['id'],'appPublishStatus':_0x2582e0['appPublishStatus'],'extend':_0x34a2d0,'appName':_0x34e15e,'resources':_0x2a81e5}))[_0x31f68a(0xda)](_0x31f68a(0xde));return{'before':_0x330e6a,'nextExtend':_0x12d274,'expectedHash':_0x494d1e,'unchanged':isDeepStrictEqual(_0x330e6a,_0x2a81e5)};}function flags(_0x4c0622){const _0x38807a=a178_0xe7b19c,{appCode:_0x88ab13,appName:_0x29b52}=getSubappSelector(_0x4c0622),_0x4b0456=_0x4c0622[_0x38807a(0x99)](_0x38807a(0xa6))[_0x38807a(0xa1)]();if(!_0x4b0456)throw CliErrors[_0x38807a(0xb0)](_0x38807a(0x9a));let _0x3038d;try{_0x3038d=JSON[_0x38807a(0xba)](_0x4b0456);}catch{throw CliErrors[_0x38807a(0xb0)](_0x38807a(0xb8));}if(!Array[_0x38807a(0xa4)](_0x3038d))throw CliErrors[_0x38807a(0xb0)](_0x38807a(0xb8));return{'appCode':_0x88ab13,'appName':_0x29b52,'resources':validateResources(_0x3038d)};}export const menuSubappAssetsUpdate={'service':'menu','command':a178_0xe7b19c(0xb4),'description':a178_0xe7b19c(0xc6),'risk':'write','strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a178_0xe7b19c(0xa6),'type':a178_0xe7b19c(0xd0),'required':!![],'description':a178_0xe7b19c(0xa2)},{'name':'expected-hash','type':a178_0xe7b19c(0xd0),'description':a178_0xe7b19c(0xb1)}],async 'validate'(_0x9aefed){flags(_0x9aefed);},async 'dryRun'(_0x348a5f){const _0x2d100e=a178_0xe7b19c,{appCode:_0x1a6691,appName:_0xf56ee2,resources:_0x29fb47}=flags(_0x348a5f),_0x3cfa8b=await getSmartAppRecord(_0x1a6691,_0x348a5f[_0x2d100e(0xd5)]),_0x183cfe=prepare(_0x3cfa8b,_0xf56ee2,_0x29fb47);return{'method':_0x2d100e(0xc0),'url':_0x2d100e(0x97),'body':{'preview':{'appCode':_0x1a6691,'appName':_0xf56ee2,'before':_0x183cfe[_0x2d100e(0xbb)],'after':_0x29fb47,'expectedHash':_0x183cfe['expectedHash'],'unchanged':_0x183cfe['unchanged'],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x183cfe[_0x2d100e(0xd7)]?'Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.':_0x2d100e(0xd3)+_0xf56ee2+'.'};},async 'execute'(_0x8272d0){const _0x2efe1f=a178_0xe7b19c,{appCode:_0x32919d,appName:_0x23dc95,resources:_0x58629c}=flags(_0x8272d0),_0x32eea5=_0x8272d0[_0x2efe1f(0x99)](_0x2efe1f(0xb9))[_0x2efe1f(0xa1)]();if(!/^[a-f0-9]{64}$/i[_0x2efe1f(0xc7)](_0x32eea5))throw CliErrors[_0x2efe1f(0xb0)](_0x2efe1f(0xcf));const _0x2541d7=await getSmartAppRecord(_0x32919d,_0x8272d0[_0x2efe1f(0xd5)]),_0xff9de5=prepare(_0x2541d7,_0x23dc95,_0x58629c);if(_0x32eea5!==_0xff9de5[_0x2efe1f(0xdc)])throw CliErrors['validation']('App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.');if(_0xff9de5[_0x2efe1f(0xd7)])return{'ok':!![],'data':{'appCode':_0x32919d,'appName':_0x23dc95,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x2efe1f(0xdb)};await updateSmartAppRecord({'id':_0x2541d7['id'],'appCode':_0x32919d,'appPublishStatus':_0x2541d7[_0x2efe1f(0xb5)],'extend':_0xff9de5[_0x2efe1f(0xd9)]},_0x8272d0['cookie']);const _0x491e49=await getSmartAppRecord(_0x32919d,_0x8272d0[_0x2efe1f(0xd5)]),_0x2c35d7=parseObject(_0x491e49[_0x2efe1f(0xcd)],_0x2efe1f(0x9c));if(_0x491e49['id']!==_0x2541d7['id']||_0x491e49[_0x2efe1f(0xb5)]!==_0x2541d7[_0x2efe1f(0xb5)]||!isDeepStrictEqual(_0x2c35d7,_0xff9de5[_0x2efe1f(0xd9)]))throw CliErrors[_0x2efe1f(0xab)]('App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.');return{'ok':!![],'data':{'appCode':_0x32919d,'appName':_0x23dc95,'updated':!![],'resources':_0x58629c,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x2efe1f(0x9b)+_0x23dc95+_0x2efe1f(0x98)+_0x32919d+_0x2efe1f(0xcb)};}};
|
|
1
|
+
function a178_0x4dd8(){const _0x18aaa4=['isSafeInteger','assets','\x20contains\x20invalid\x20JSON.','--resources\x20is\x20required.','string','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.',';\x20found\x20','4142636YqIpQw','entries','3027447uoNlsH',';\x20independent\x20deployment\x20not\x20verified.',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','directDbEnabled','109034STJfiV','protocol','nextExtend','object','\x20must\x20be\x20a\x20JSON\x20array.','extend','apiError','hex','write','skinColor','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','5510520NgMGYP','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','cookie','App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.','menu','map','str','appCode','validation','/smartapi/app/update','not\x20HTTPS','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','2vPruVJ','resources','trim','5eahyVq','has','unchanged','accessKey','isArray','resources[','appPublishStatus','tenantColumn','.\x20Refusing\x20update.','\x20in\x20menu\x20host\x20','4688892oRgaZi','vipDeploy','enableAutoSync',']\x20must\x20be\x20a\x20URL\x20string.','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','Unknown\x20app.extend\x20fields:\x20','some','test','subapp-assets-update','sha256','expectedHash','expected-hash','verified\x20app.extend','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','Updated\x20shared\x20resources\x20for\x20','POST','app.extend.assets','stringify','1029618WYOFht','parse','enableOpenApi','enableSample','length','3124821oYjSzV'];a178_0x4dd8=function(){return _0x18aaa4;};return a178_0x4dd8();}function a178_0x1afb(_0x18c686,_0x399d30){_0x18c686=_0x18c686-0x74;const _0x4dd833=a178_0x4dd8();let _0x1afbe1=_0x4dd833[_0x18c686];return _0x1afbe1;}const a178_0x46b043=a178_0x1afb;(function(_0x5a4489,_0x481bc6){const _0x344d9d=a178_0x1afb,_0x368f43=_0x5a4489();while(!![]){try{const _0x1baa91=parseInt(_0x344d9d(0xbf))/0x1*(-parseInt(_0x344d9d(0xa4))/0x2)+parseInt(_0x344d9d(0x8f))/0x3+parseInt(_0x344d9d(0x9d))/0x4*(parseInt(_0x344d9d(0xc2))/0x5)+-parseInt(_0x344d9d(0x7d))/0x6+parseInt(_0x344d9d(0x94))/0x7+-parseInt(_0x344d9d(0xaf))/0x8+parseInt(_0x344d9d(0x9f))/0x9;if(_0x1baa91===_0x481bc6)break;else _0x368f43['push'](_0x368f43['shift']());}catch(_0x3e5825){_0x368f43['push'](_0x368f43['shift']());}}}(a178_0x4dd8,0x8e2b0));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_0x46b043(0xad),a178_0x46b043(0x91),a178_0x46b043(0x76),a178_0x46b043(0x96),a178_0x46b043(0x7a),a178_0x46b043(0x92),a178_0x46b043(0x7e),a178_0x46b043(0x7f),'directDbId',a178_0x46b043(0xa3)]);function parseObject(_0x5a96ef,_0x42db68){const _0x1f01c1=a178_0x46b043;let _0x5123d8=_0x5a96ef;if(typeof _0x5a96ef===_0x1f01c1(0x99))try{_0x5123d8=JSON['parse'](_0x5a96ef);}catch{throw CliErrors[_0x1f01c1(0xb7)](_0x42db68+_0x1f01c1(0x97));}if(!_0x5123d8||typeof _0x5123d8!==_0x1f01c1(0xa7)||Array[_0x1f01c1(0x77)](_0x5123d8))throw CliErrors[_0x1f01c1(0xb7)](_0x42db68+'\x20must\x20be\x20a\x20JSON\x20object.');return _0x5123d8;}function parseArray(_0x466081,_0x2dcc79){const _0x2a2558=a178_0x46b043;let _0x1f4b38;try{_0x1f4b38=JSON[_0x2a2558(0x90)](_0x466081);}catch{throw CliErrors[_0x2a2558(0xb7)](_0x2dcc79+_0x2a2558(0x97));}if(!Array[_0x2a2558(0x77)](_0x1f4b38))throw CliErrors['validation'](_0x2dcc79+_0x2a2558(0xa8));return _0x1f4b38[_0x2a2558(0xb4)]((_0x352ac1,_0x490ac3)=>parseObject(_0x352ac1,_0x2dcc79+'['+_0x490ac3+']'));}function validateResources(_0x4fefa7){const _0x5533de=a178_0x46b043;if(_0x4fefa7[_0x5533de(0x93)]===0x0)throw CliErrors[_0x5533de(0xb7)]('At\x20least\x20one\x20resource\x20URL\x20is\x20required.');for(const [_0x442c2d,_0x3ce276]of _0x4fefa7[_0x5533de(0x9e)]()){if(typeof _0x3ce276!==_0x5533de(0x99))throw CliErrors[_0x5533de(0xb7)](_0x5533de(0x78)+_0x442c2d+_0x5533de(0x80));try{if(new URL(_0x3ce276)[_0x5533de(0xa5)]!=='https:')throw new Error(_0x5533de(0xb9));}catch{throw CliErrors[_0x5533de(0xb7)](_0x5533de(0x78)+_0x442c2d+_0x5533de(0xa1));}}if(new Set(_0x4fefa7)['size']!==_0x4fefa7[_0x5533de(0x93)]||!_0x4fefa7[_0x5533de(0x83)](_0x284b63=>/\.m?js(?:[?#]|$)/i['test'](_0x284b63)))throw CliErrors[_0x5533de(0xb7)](_0x5533de(0xbc));return _0x4fefa7;}function prepare(_0x79067,_0x27dcc2,_0x1d310d){const _0x3cc091=a178_0x46b043;if(!Number[_0x3cc091(0x95)](_0x79067['id'])||(_0x79067['id']??0x0)<=0x0||typeof _0x79067[_0x3cc091(0x79)]!==_0x3cc091(0x99)||!_0x79067['appPublishStatus'])throw CliErrors[_0x3cc091(0xb7)](_0x3cc091(0x9b));const _0x348cce=parseObject(_0x79067[_0x3cc091(0xa9)],'app.extend'),_0x1f367e=Object['keys'](_0x348cce)['filter'](_0x413c71=>!KNOWN_EXTEND_KEYS[_0x3cc091(0x74)](_0x413c71));if(_0x1f367e[_0x3cc091(0x93)])throw CliErrors['validation'](_0x3cc091(0x82)+_0x1f367e['join'](',\x20')+_0x3cc091(0x7b));if(typeof _0x348cce[_0x3cc091(0x96)]!==_0x3cc091(0x99))throw CliErrors['validation'](_0x3cc091(0x8a));const _0xca74c6=parseArray(_0x348cce[_0x3cc091(0x96)],_0x3cc091(0x8d)),_0x12073f=_0xca74c6['filter'](_0xac129e=>_0xac129e['appName']===_0x27dcc2);if(_0x12073f[_0x3cc091(0x93)]!==0x1)throw CliErrors[_0x3cc091(0xb7)](_0x3cc091(0xb0)+_0x27dcc2+_0x3cc091(0x9c)+_0x12073f['length']+'.');const _0x58338a=_0x12073f[0x0];if(typeof _0x58338a[_0x3cc091(0xc0)]!==_0x3cc091(0x99))throw CliErrors[_0x3cc091(0xb7)]('Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.');let _0x2b689c;try{_0x2b689c=JSON[_0x3cc091(0x90)](_0x58338a[_0x3cc091(0xc0)]);}catch{throw CliErrors['validation'](_0x3cc091(0x81));}if(!Array[_0x3cc091(0x77)](_0x2b689c)||_0x2b689c[_0x3cc091(0x83)](_0x4a270f=>typeof _0x4a270f!==_0x3cc091(0x99)))throw CliErrors['validation'](_0x3cc091(0xbd));const _0x3d4026=_0xca74c6[_0x3cc091(0xb4)](_0x4b7949=>_0x4b7949===_0x58338a?{..._0x4b7949,'resources':JSON[_0x3cc091(0x8e)](_0x1d310d)}:_0x4b7949),_0x5f25e4={..._0x348cce,'assets':JSON['stringify'](_0x3d4026)},_0x177579=createHash(_0x3cc091(0x86))['update'](JSON[_0x3cc091(0x8e)]({'appCode':_0x79067[_0x3cc091(0xb6)],'id':_0x79067['id'],'appPublishStatus':_0x79067[_0x3cc091(0x79)],'extend':_0x348cce,'appName':_0x27dcc2,'resources':_0x1d310d}))['digest'](_0x3cc091(0xab));return{'before':_0x2b689c,'nextExtend':_0x5f25e4,'expectedHash':_0x177579,'unchanged':isDeepStrictEqual(_0x2b689c,_0x1d310d)};}function flags(_0x1a5123){const _0x289abc=a178_0x46b043,{appCode:_0x9e2bcf,appName:_0x5c5fc5}=getSubappSelector(_0x1a5123),_0x57092e=_0x1a5123[_0x289abc(0xb5)](_0x289abc(0xc0))[_0x289abc(0xc1)]();if(!_0x57092e)throw CliErrors[_0x289abc(0xb7)](_0x289abc(0x98));let _0x201695;try{_0x201695=JSON[_0x289abc(0x90)](_0x57092e);}catch{throw CliErrors[_0x289abc(0xb7)](_0x289abc(0xbb));}if(!Array[_0x289abc(0x77)](_0x201695))throw CliErrors[_0x289abc(0xb7)]('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');return{'appCode':_0x9e2bcf,'appName':_0x5c5fc5,'resources':validateResources(_0x201695)};}export const menuSubappAssetsUpdate={'service':a178_0x46b043(0xb3),'command':a178_0x46b043(0x85),'description':a178_0x46b043(0xa2),'risk':a178_0x46b043(0xac),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':'resources','type':a178_0x46b043(0x99),'required':!![],'description':a178_0x46b043(0xbe)},{'name':a178_0x46b043(0x88),'type':a178_0x46b043(0x99),'description':'Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes'}],async 'validate'(_0x1d8e78){flags(_0x1d8e78);},async 'dryRun'(_0xb46148){const _0x4cbbc5=a178_0x46b043,{appCode:_0x447ccc,appName:_0x359ee6,resources:_0x4052ee}=flags(_0xb46148),_0x55326b=await getSmartAppRecord(_0x447ccc,_0xb46148['cookie']),_0x2ca0a3=prepare(_0x55326b,_0x359ee6,_0x4052ee);return{'method':_0x4cbbc5(0x8c),'url':_0x4cbbc5(0xb8),'body':{'preview':{'appCode':_0x447ccc,'appName':_0x359ee6,'before':_0x2ca0a3['before'],'after':_0x4052ee,'expectedHash':_0x2ca0a3[_0x4cbbc5(0x87)],'unchanged':_0x2ca0a3[_0x4cbbc5(0x75)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x2ca0a3[_0x4cbbc5(0x75)]?_0x4cbbc5(0xae):'Would\x20update\x20shared\x20assets\x20for\x20'+_0x359ee6+'.'};},async 'execute'(_0x4def22){const _0x262c67=a178_0x46b043,{appCode:_0x183be6,appName:_0x40dd9c,resources:_0x38ec2e}=flags(_0x4def22),_0x505d7d=_0x4def22['str'](_0x262c67(0x88))[_0x262c67(0xc1)]();if(!/^[a-f0-9]{64}$/i[_0x262c67(0x84)](_0x505d7d))throw CliErrors[_0x262c67(0xb7)](_0x262c67(0xba));const _0x3e2a02=await getSmartAppRecord(_0x183be6,_0x4def22[_0x262c67(0xb1)]),_0x1c4b2a=prepare(_0x3e2a02,_0x40dd9c,_0x38ec2e);if(_0x505d7d!==_0x1c4b2a[_0x262c67(0x87)])throw CliErrors[_0x262c67(0xb7)]('App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.');if(_0x1c4b2a[_0x262c67(0x75)])return{'ok':!![],'data':{'appCode':_0x183be6,'appName':_0x40dd9c,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x262c67(0x9a)};await updateSmartAppRecord({'id':_0x3e2a02['id'],'appCode':_0x183be6,'appPublishStatus':_0x3e2a02[_0x262c67(0x79)],'extend':_0x1c4b2a[_0x262c67(0xa6)]},_0x4def22[_0x262c67(0xb1)]);const _0x3d568f=await getSmartAppRecord(_0x183be6,_0x4def22[_0x262c67(0xb1)]),_0x23a3f0=parseObject(_0x3d568f[_0x262c67(0xa9)],_0x262c67(0x89));if(_0x3d568f['id']!==_0x3e2a02['id']||_0x3d568f['appPublishStatus']!==_0x3e2a02[_0x262c67(0x79)]||!isDeepStrictEqual(_0x23a3f0,_0x1c4b2a[_0x262c67(0xa6)]))throw CliErrors[_0x262c67(0xaa)](_0x262c67(0xb2));return{'ok':!![],'data':{'appCode':_0x183be6,'appName':_0x40dd9c,'updated':!![],'resources':_0x38ec2e,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x262c67(0x8b)+_0x40dd9c+_0x262c67(0x7c)+_0x183be6+_0x262c67(0xa0)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a179_0x161e46=a179_0x471a;(function(_0x3558f0,_0x3a00eb){const _0x34073a=a179_0x471a,_0x560ff2=_0x3558f0();while(!![]){try{const _0x539234=parseInt(_0x34073a(0xbb))/0x1+-parseInt(_0x34073a(0xa5))/0x2+parseInt(_0x34073a(0xdf))/0x3+parseInt(_0x34073a(0xe3))/0x4+parseInt(_0x34073a(0xb3))/0x5*(-parseInt(_0x34073a(0xbe))/0x6)+parseInt(_0x34073a(0xe6))/0x7+-parseInt(_0x34073a(0xae))/0x8;if(_0x539234===_0x3a00eb)break;else _0x560ff2['push'](_0x560ff2['shift']());}catch(_0x517d99){_0x560ff2['push'](_0x560ff2['shift']());}}}(a179_0x343d,0x21402));import a179_0x1eba5b from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';function a179_0x343d(){const _0x300158=['cssUrl','flag','\x20local\x20microfrontend\x20menu(s).','message','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','validation','gray','write','368022LLPhTc','localPages','trim','rawFlags','544608FCHoNM','\x20created.','Online\x20menu\x20list\x20fetched','302372qwmqzd','onlineMenuList','length','sync','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','menu','skipped','Fetching\x20online\x20menu\x20list...','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','\x20\x20Create\x20','315630zkvRmA','Tip:\x20For\x20frontend\x20subapps,\x20prefer\x20Agent-planned\x20menu\x20groups\x20and\x20shared\x20resources.\x20This\x20manual\x20sync\x20workflow\x20remains\x20available\x20as\x20a\x20fallback.','\x20\x20✓\x20Selected:\x20','selectedAppName','\x20created,\x20','jsUrl','\x20menu(s)...','appCode','\x20menu(s)\x20created','216264GyvuoG','Prefer\x20appName\x20for\x20shared\x20subapp\x20resources\x20and\x20parentId\x20for\x20planned\x20groups.\x20','cookie','appcode','\x20failed.','990rBaQLh','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','filter','\x20page(s)','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','yellow','Created\x20','87726UWcoHO','split','cyan','2082enwfYK','string','Menu\x20sync\x20completed:\x20','Register\x20local\x20pages\x20as\x20platform\x20menus','map','created','\x20menu(s)\x20with\x20JS:\x20','onlinePaths','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','str','size','failed','Menu\x20creation\x20failed','paths','\x20\x20Cancelled.','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','yes','appName','Creating\x20','JSON:\x20{\x22appName\x22:\x22store-app\x22,\x22parentId\x22:42,\x22visible\x22:false};\x20jsUrl\x20and\x20cssUrl\x20remain\x20available\x20for\x20individual\x20menu\x20resources.','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','\x20and\x20CSS:\x20','Failed\x20to\x20fetch\x20online\x20menu\x20list','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','\x20menu(s)'];a179_0x343d=function(){return _0x300158;};return a179_0x343d();}import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function a179_0x471a(_0x4b63c6,_0x287501){_0x4b63c6=_0x4b63c6-0xa4;const _0x343dfe=a179_0x343d();let _0x471ab0=_0x343dfe[_0x4b63c6];return _0x471ab0;}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_0x161e46(0xeb),'command':a179_0x161e46(0xe9),'description':a179_0x161e46(0xc1),'risk':a179_0x161e46(0xde),'flags':[{'name':'params','type':a179_0x161e46(0xbf),'description':a179_0x161e46(0xaf)+a179_0x161e46(0xd1)},{'name':a179_0x161e46(0xcb),'type':'string','description':a179_0x161e46(0xd5)},{'name':a179_0x161e46(0xce),'type':'boolean','description':a179_0x161e46(0xb5)}],async 'dryRun'(_0x4c716a){const _0x472a52=a179_0x161e46;ensureRunnableContext(_0x4c716a[_0x472a52(0xe2)],_0x4c716a[_0x472a52(0xa8)]);const _0x57a3b2=await runMenuSyncCore(_0x4c716a[_0x472a52(0xac)],_0x4c716a[_0x472a52(0xb0)],parsePaths(_0x4c716a[_0x472a52(0xc7)](_0x472a52(0xcb))),_0x4c716a[_0x472a52(0xc7)]('params'),{'dryRun':!![]});return{'method':'POST','url':'/smartapi/menu/create','body':_0x57a3b2,'description':_0x57a3b2[_0x472a52(0xec)]?_0x472a52(0xdb):'Would\x20create\x20'+_0x57a3b2['targetPages']['length']+_0x472a52(0xd9)};},async 'execute'(_0x4d4de7){const _0x570d89=a179_0x161e46;ensureRunnableContext(_0x4d4de7['rawFlags'],_0x4d4de7[_0x570d89(0xa8)]);const _0x5d008e=_0x4d4de7[_0x570d89(0xd8)]('yes'),_0x138945=_0x4d4de7[_0x570d89(0xc7)]('params'),_0x1738cd=parsePaths(_0x4d4de7[_0x570d89(0xc7)](_0x570d89(0xcb))),_0x5ceb66=parseMenuSyncParams(_0x138945);if(_0x5d008e){const _0x28532b=await runMenuSyncCore(_0x4d4de7[_0x570d89(0xac)],_0x4d4de7[_0x570d89(0xb0)],_0x1738cd,_0x138945);if(_0x28532b[_0x570d89(0xec)]){const _0x4c741f=getLocalPages();_0x4c741f[_0x570d89(0xe8)]===0x0?writeCliSideChannelLine(_0x570d89(0xc6)):writeCliSideChannelLine(_0x570d89(0xcd));}else writeCliSideChannelLine('✓\x20Menu\x20sync\x20completed:\x20'+_0x28532b['created']+_0x570d89(0xad));return{'ok':!![],'data':_0x28532b,'message':_0x28532b['skipped']?'Menu\x20sync\x20skipped':_0x570d89(0xc0)+_0x28532b['created']+_0x570d89(0xe4)};}if(_0x1738cd['length']>0x0)throw CliErrors[_0x570d89(0xdc)](_0x570d89(0xee),_0x570d89(0xea));if(!isInteractive()&&_0x138945)throw CliErrors[_0x570d89(0xdc)](_0x570d89(0xb4),'Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');requireInteractive(),writeCliSideChannelLine(_0x570d89(0xa6));const _0x5d7c35=startSpinner(_0x570d89(0xed));let _0x1c9492,_0x28a845,_0x3f2a36;try{const _0x58d54d=await fetchMenuData(_0x4d4de7[_0x570d89(0xac)],_0x4d4de7['cookie']);_0x1c9492=_0x58d54d[_0x570d89(0xe0)],_0x28a845=_0x58d54d[_0x570d89(0xc5)],_0x3f2a36=_0x58d54d[_0x570d89(0xe7)],stopSpinner(_0x5d7c35,_0x570d89(0xe5),!![]);}catch(_0x5a29d9){stopSpinner(_0x5d7c35,_0x570d89(0xd4),![]);throw CliErrors[_0x570d89(0xdc)](_0x5a29d9 instanceof Error?_0x5a29d9[_0x570d89(0xda)]:_0x570d89(0xd4));}if(_0x1c9492[_0x570d89(0xe8)]===0x0)return writeCliSideChannelLine(a179_0x1eba5b[_0x570d89(0xb9)](_0x570d89(0xd2))),{'ok':!![]};const _0x3bc086=buildCompareRows(_0x1c9492,_0x28a845);writeCliSideChannelLine(renderCompareTable(_0x3bc086)),writeCliSideChannelLine('');const _0x3ec33d=await selectPages(_0x1c9492,_0x28a845);writeCliSideChannelLine(''),writeCliSideChannelLine(a179_0x1eba5b[_0x570d89(0xbd)](_0x570d89(0xa7)+_0x3ec33d[_0x570d89(0xe8)]+_0x570d89(0xb7)));const _0x5466d9=_0x5ceb66[_0x570d89(0xaa)]&&_0x5ceb66[_0x570d89(0xd7)];if(!_0x5466d9){writeCliSideChannelLine(renderSyncSummary(_0x3ec33d,_0x28a845[_0x570d89(0xc8)]>0x0));const _0x3ee419=await askConfirm('\x20\x20Continue\x20with\x20creation?');if(!_0x3ee419)return writeCliSideChannelLine(a179_0x1eba5b[_0x570d89(0xdd)](_0x570d89(0xcc))),{'ok':!![]};}let _0x507c2c=_0x5ceb66['jsUrl'],_0x3eceaf=_0x5ceb66['cssUrl'];!_0x507c2c&&!_0x5ceb66[_0x570d89(0xcf)]&&(_0x507c2c=await askJsUrl());!_0x3eceaf&&!_0x5ceb66[_0x570d89(0xcf)]&&(_0x3eceaf=await askCssUrl());const _0x3a3227=await askConfirm(_0x5ceb66[_0x570d89(0xcf)]?_0x570d89(0xa4)+_0x3ec33d['length']+'\x20menu(s)\x20bound\x20to\x20'+_0x5ceb66['appName']+'?':'\x20\x20Create\x20'+_0x3ec33d['length']+_0x570d89(0xc4)+_0x507c2c+_0x570d89(0xd3)+_0x3eceaf+'?');if(!_0x3a3227)return writeCliSideChannelLine(a179_0x1eba5b[_0x570d89(0xdd)](_0x570d89(0xcc))),{'ok':!![]};const _0x263729=[_0x507c2c,_0x3eceaf][_0x570d89(0xb6)](_0x1466eb=>Boolean(_0x1466eb));_0x5ceb66[_0x570d89(0xcf)]&&_0x263729[_0x570d89(0xe8)]===0x0&&await assertSharedResourcesConfigured(_0x4d4de7[_0x570d89(0xac)],_0x4d4de7[_0x570d89(0xb0)],_0x5ceb66[_0x570d89(0xcf)]);const _0x4a8e7f=startSpinner(_0x570d89(0xd0)+_0x3ec33d['length']+_0x570d89(0xab));try{const _0x2d2a22=_0x3ec33d[_0x570d89(0xc2)](_0x48b3fd=>resolvePage(_0x48b3fd,_0x5ceb66,_0x3f2a36)),_0xceb727=await doCreateMenus(_0x4d4de7['appCode'],_0x4d4de7[_0x570d89(0xb0)],_0x2d2a22,_0x263729,_0x5ceb66[_0x570d89(0xcf)]?{'appName':_0x5ceb66[_0x570d89(0xcf)]}:undefined);return stopSpinner(_0x4a8e7f,_0x570d89(0xba)+_0xceb727[_0x570d89(0xc3)]+_0x570d89(0xd6),!![]),{'ok':!![],'data':_0xceb727,'message':'Menu\x20sync\x20completed:\x20'+_0xceb727[_0x570d89(0xc3)]+_0x570d89(0xa9)+_0xceb727[_0x570d89(0xc9)]+_0x570d89(0xb2)};}catch(_0x538cc9){stopSpinner(_0x4a8e7f,_0x570d89(0xca),![]);throw CliErrors['validation'](_0x538cc9 instanceof Error?_0x538cc9[_0x570d89(0xda)]:_0x570d89(0xca));}}};function ensureRunnableContext(_0x3e95e7,_0x450f7c){const _0x3338b0=a179_0x161e46,_0x461e90=_0x3e95e7['appcode']?String(_0x3e95e7[_0x3338b0(0xb1)])[_0x3338b0(0xe1)]():'';if(!isInProject()&&!_0x450f7c&&!_0x461e90)throw CliErrors[_0x3338b0(0xdc)](_0x3338b0(0xb8)+'Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.');}function parsePaths(_0x2ad525){const _0x2d1954=a179_0x161e46;return[...new Set(_0x2ad525[_0x2d1954(0xbc)](',')[_0x2d1954(0xc2)](_0x38f94c=>_0x38f94c[_0x2d1954(0xe1)]())['filter'](Boolean))];}
|