@lovrabet/rabetbase-cli 2.5.8 → 2.5.9
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/README.md +6 -6
- 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/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.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/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.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/page-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.d.ts +8 -5
- 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.d.ts +5 -3
- 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.d.ts +14 -11
- 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-analysis.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-management-client.d.ts +2 -2
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.d.ts +3 -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/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +17 -15
- package/skills/rabetbase/references/rabetbase-rule.md +8 -6
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x46439b,_0x2cbb54){const _0x445b11=a177_0x2668,_0x2f082c=_0x46439b();while(!![]){try{const _0x4f0e1f=parseInt(_0x445b11(0x1a5))/0x1+parseInt(_0x445b11(0x1c4))/0x2*(parseInt(_0x445b11(0x1a0))/0x3)+-parseInt(_0x445b11(0x19c))/0x4+parseInt(_0x445b11(0x1bc))/0x5*(-parseInt(_0x445b11(0x1c1))/0x6)+parseInt(_0x445b11(0x1ab))/0x7*(-parseInt(_0x445b11(0x1b5))/0x8)+parseInt(_0x445b11(0x1ae))/0x9*(-parseInt(_0x445b11(0x1a2))/0xa)+parseInt(_0x445b11(0x1b3))/0xb;if(_0x4f0e1f===_0x2cbb54)break;else _0x2f082c['push'](_0x2f082c['shift']());}catch(_0x5dc03f){_0x2f082c['push'](_0x2f082c['shift']());}}}(a177_0x52c8,0x35bfc));function a177_0x52c8(){const _0xdc7551=['gray','red','327710VajRgt','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','\x20\x20Checking\x20JS\x20URL\x20reachability...','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','name','12znBKkw','error','CSS\x20URL\x20checked','2BJHurV','has','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','1020064LiTnXk','JS\x20URL\x20check\x20failed','cancelled','test','1231377AmXiPT','includes','3630ZGJHyu','fail','cyan','145486dKFVuh','filter','path','isTTY','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','succeed','527023drBXHL','stdin','length','3123pjRbdT','No\x20menus\x20selected.','ExitPromptError','[new]','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','6079887NeFqcK','Cancelled.','40MrkpGn','trim','\x20\x20Checking\x20CSS\x20URL\x20reachability...','\x20\x20CSS\x20URL:','This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20'];a177_0x52c8=function(){return _0xdc7551;};return a177_0x52c8();}import a177_0x5100ba from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a177_0x4b76c7 from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x1468d7){return _0x1468d7['catch'](_0x2a5ea7=>{const _0x5390e0=a177_0x2668;if(_0x2a5ea7?.[_0x5390e0(0x1c0)]===_0x5390e0(0x1b0))throw CliErrors[_0x5390e0(0x19e)](_0x5390e0(0x1b4));throw _0x2a5ea7;});}function a177_0x2668(_0x5140b1,_0x11411d){_0x5140b1=_0x5140b1-0x19c;const _0x52c85b=a177_0x52c8();let _0x2668ab=_0x52c85b[_0x5140b1];return _0x2668ab;}export function startSpinner(_0x54902d){const _0x4e72ae=a177_0x2668;return a177_0x4b76c7({'text':_0x54902d,'color':_0x4e72ae(0x1a4)})['start']();}export function stopSpinner(_0x14c9b2,_0x2f065d,_0x291fc4){const _0x1e8e43=a177_0x2668;_0x291fc4?_0x14c9b2[_0x1e8e43(0x1aa)](_0x2f065d):_0x14c9b2[_0x1e8e43(0x1a3)](_0x2f065d);}export async function askConfirm(_0x44a65e){return onCancel(confirm({'message':_0x44a65e,'theme':{'prefix':''}}));}export async function askJsUrl(_0x14b095){const _0x181be5=a177_0x2668;while(!![]){const _0x37185a=await onCancel(input({'message':'\x20\x20JS\x20URL:','default':_0x14b095,'theme':{'prefix':''}}));if(_0x37185a['trim']()==='')throw CliErrors['cancelled'](_0x181be5(0x1b4));if(!/^https:\/\/.+\.js(\?.*)?$/[_0x181be5(0x19f)](_0x37185a['trim']())){console[_0x181be5(0x1c2)](a177_0x5100ba[_0x181be5(0x1bb)](_0x181be5(0x1b2)));continue;}const _0x58a59c=startSpinner(_0x181be5(0x1be));try{const _0x5c6a53=await isUrlReachable(_0x37185a[_0x181be5(0x1b6)]());stopSpinner(_0x58a59c,'JS\x20URL\x20checked',_0x5c6a53);if(!_0x5c6a53){console['error'](a177_0x5100ba['red'](_0x181be5(0x1bd)));continue;}return _0x37185a[_0x181be5(0x1b6)]();}catch(_0x2e0db2){stopSpinner(_0x58a59c,_0x181be5(0x19d),![]);throw _0x2e0db2;}}}export async function askCssUrl(_0x76832b){const _0x203802=a177_0x2668;while(!![]){const _0x2e8db2=await onCancel(input({'message':_0x203802(0x1b8),'default':_0x76832b,'theme':{'prefix':''}}));if(_0x2e8db2['trim']()==='')throw CliErrors[_0x203802(0x19e)](_0x203802(0x1b4));if(!/^https:\/\/.+\.css(\?.*)?$/[_0x203802(0x19f)](_0x2e8db2['trim']())){console['error'](a177_0x5100ba['red']('\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'));continue;}const _0x269674=startSpinner(_0x203802(0x1b7));try{const _0x19cfdd=await isUrlReachable(_0x2e8db2[_0x203802(0x1b6)]());stopSpinner(_0x269674,_0x203802(0x1c3),_0x19cfdd);if(!_0x19cfdd){console[_0x203802(0x1c2)](a177_0x5100ba[_0x203802(0x1bb)](_0x203802(0x1bf)));continue;}return _0x2e8db2['trim']();}catch(_0x2b8778){stopSpinner(_0x269674,'CSS\x20URL\x20check\x20failed',![]);throw _0x2b8778;}}}export async function selectPages(_0x3088f6,_0x49a855){const _0x2f84fe=a177_0x2668,_0x308bfc=_0x3088f6['map'](_0x18d968=>{const _0x3125cf=a177_0x2668,_0x232d37=_0x49a855[_0x3125cf(0x1c5)](menuPathKey(_0x18d968[_0x3125cf(0x1a7)]));return{'name':_0x18d968['label']+'\x20\x20'+a177_0x5100ba[_0x3125cf(0x1ba)](_0x18d968['path'])+'\x20\x20'+(_0x232d37?a177_0x5100ba['gray']('[already\x20on\x20platform]'):a177_0x5100ba['green'](_0x3125cf(0x1b1))),'value':_0x18d968[_0x3125cf(0x1a7)],'checked':!_0x232d37,'disabled':_0x232d37};});if(_0x308bfc['length']===0x0)throw new Error('No\x20local\x20pages\x20found.');const _0x5ef9eb=await onCancel(checkbox({'message':_0x2f84fe(0x1c6),'choices':_0x308bfc,'loop':![],'theme':{'prefix':''}}));if(_0x5ef9eb[_0x2f84fe(0x1ad)]===0x0)throw new Error(_0x2f84fe(0x1af));return _0x3088f6[_0x2f84fe(0x1a6)](_0x1a8a1f=>_0x5ef9eb[_0x2f84fe(0x1a1)](_0x1a8a1f['path']));}export function isInteractive(){const _0x46b8b7=a177_0x2668;return process[_0x46b8b7(0x1ac)][_0x46b8b7(0x1a8)]===!![];}export function requireInteractive(){const _0x3e55aa=a177_0x2668;if(!isInteractive())throw new Error(_0x3e55aa(0x1b9)+_0x3e55aa(0x1a9));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a178_0x447df5=a178_0x2a0d;(function(_0x28938e,_0x14edf7){const _0x23a64a=a178_0x2a0d,_0x551729=_0x28938e();while(!![]){try{const _0x51c3b0=-parseInt(_0x23a64a(0x121))/0x1+parseInt(_0x23a64a(0x127))/0x2+parseInt(_0x23a64a(0x11d))/0x3+parseInt(_0x23a64a(0x111))/0x4*(-parseInt(_0x23a64a(0x137))/0x5)+-parseInt(_0x23a64a(0x10d))/0x6*(parseInt(_0x23a64a(0x13a))/0x7)+-parseInt(_0x23a64a(0x122))/0x8+-parseInt(_0x23a64a(0x110))/0x9*(-parseInt(_0x23a64a(0x132))/0xa);if(_0x51c3b0===_0x14edf7)break;else _0x551729['push'](_0x551729['shift']());}catch(_0x563cc2){_0x551729['push'](_0x551729['shift']());}}}(a178_0x2fbf,0xeeff8));import{existsSync,readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process[a178_0x447df5(0x13c)](),a178_0x447df5(0x131));function a178_0x2a0d(_0x5a637e,_0x2f5bb2){_0x5a637e=_0x5a637e-0x10d;const _0x2fbff8=a178_0x2fbf();let _0x2a0da8=_0x2fbff8[_0x5a637e];return _0x2a0da8;}export function extractTitleFromComment(_0x1f788a){const _0x24dadb=a178_0x447df5;try{const _0x5416f8=readFileSync(_0x1f788a,_0x24dadb(0x112)),_0x25e2c1=_0x5416f8[_0x24dadb(0x11f)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x25e2c1&&_0x25e2c1[0x1]){const _0x294843=_0x25e2c1[0x1],_0x5491aa=_0x294843['match'](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x5491aa&&_0x5491aa[0x1])return _0x5491aa[0x1][_0x24dadb(0x13e)]();}let _0x3310e9=null;const _0x53c993=_0x5416f8[_0x24dadb(0x11f)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x53c993&&_0x53c993[0x1]&&(_0x3310e9=_0x53c993[0x1]);if(!_0x3310e9){const _0x55f9ca=_0x5416f8[_0x24dadb(0x11f)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x55f9ca&&_0x55f9ca[0x1]&&(_0x3310e9=_0x55f9ca[0x1]);}if(_0x3310e9){const _0x3cc834=new RegExp('\x5cb'+_0x3310e9+_0x24dadb(0x134)),_0x3da9e8=_0x5416f8[_0x24dadb(0x11f)](_0x3cc834);if(_0x3da9e8&&_0x3da9e8[0x1])return _0x3da9e8[0x1];return _0x3310e9;}return null;}catch(_0x7541bf){return null;}}export function getLocalPages(_0x4beb72=pagesDir,_0x2796bb=pagesDir,_0x531d02=process['cwd']()){const _0x532d9e=a178_0x447df5;if(resolve(_0x4beb72)===resolve(_0x2796bb)){const _0x3b2754=join(_0x531d02,_0x532d9e(0x124));if(existsSync(_0x3b2754))return getDeclaredPages(_0x3b2754,_0x531d02);}let _0xca9f7e=[];const _0x39e606=readdirSync(_0x4beb72);return _0x39e606[_0x532d9e(0x133)](_0x45603e=>{const _0x2dad4a=_0x532d9e,_0x461507=join(_0x4beb72,_0x45603e),_0x11da07=statSync(_0x461507);if(_0x11da07&&_0x11da07['isDirectory']())_0xca9f7e=_0xca9f7e['concat'](getLocalPages(_0x461507,_0x2796bb,_0x531d02));else{if(_0x45603e[_0x2dad4a(0x13f)](_0x2dad4a(0x126))){let _0x34caaa=relative(_0x2796bb,_0x461507);_0x34caaa['endsWith'](_0x2dad4a(0x10e))?_0x34caaa=_0x34caaa['replace'](/index\.tsx$/,''):_0x34caaa=_0x34caaa[_0x2dad4a(0x11b)](/\.tsx$/,'');_0x34caaa[_0x2dad4a(0x13f)](sep)&&(_0x34caaa=_0x34caaa['slice'](0x0,-0x1));const _0x3a3d55=_0x34caaa['split'](sep)[_0x2dad4a(0x10f)]('/'),_0x5990c0=extractTitleFromComment(_0x461507),_0x10ed07=_0x5990c0||_0x3a3d55;_0xca9f7e[_0x2dad4a(0x13d)]({'path':_0x3a3d55['replaceAll']('$',':'),'label':_0x10ed07});}}}),_0xca9f7e[_0x532d9e(0x129)](_0x6e0a89=>_0x6e0a89[_0x532d9e(0x12a)]!=='');}function a178_0x2fbf(){const _0x5a066b=['1522158XpuCem','12527144dIsyiq','Invalid\x20route\x20manifest\x20row\x20','src/features/routing/routes.json','Invalid\x20route\x20order\x20for\x20','.tsx','1523462udUEnu','parse','filter','path','Duplicate\x20route\x20path\x20in\x20manifest:\x20','index','object','Route\x20manifest\x20must\x20contain\x20an\x20array:\x20',';\x20expected\x20','has','src/pages','20HLfBGI','forEach','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','Route\x20page\x20file\x20does\x20not\x20exist:\x20','Invalid\x20route\x20manifest\x20','7738515NYdeCy','visible','isArray','13123103izyrja','src/pages/','cwd','push','trim','endsWith',':$1','6VBHBmP','index.tsx','join','24770331uNeycq','4dejiRw','utf-8','Invalid\x20route\x20group\x20for\x20',':\x20path,\x20label,\x20pageFile\x20and\x20visible\x20are\x20required','map','group','pageFile','order','test','slice','replace','isInteger','3669510JkrBbE','replaceAll','match','string'];a178_0x2fbf=function(){return _0x5a066b;};return a178_0x2fbf();}function getDeclaredPages(_0x31c4a1,_0xbe0f09){const _0xa5e276=a178_0x447df5;let _0x95be2c;try{_0x95be2c=JSON[_0xa5e276(0x128)](readFileSync(_0x31c4a1,'utf8'));}catch(_0x259e2d){throw new Error(_0xa5e276(0x136)+_0x31c4a1+':\x20'+String(_0x259e2d));}if(!Array[_0xa5e276(0x139)](_0x95be2c))throw new Error(_0xa5e276(0x12e)+_0x31c4a1);const _0x1d6bd2=new Set();return _0x95be2c[_0xa5e276(0x115)]((_0x54ce34,_0x3c20a5)=>{const _0x27b4da=_0xa5e276;if(!_0x54ce34||typeof _0x54ce34!==_0x27b4da(0x12d)||Array[_0x27b4da(0x139)](_0x54ce34))throw new Error(_0x27b4da(0x123)+(_0x3c20a5+0x1));const _0x12bc1e=_0x54ce34,_0x341c06=_0x12bc1e[_0x27b4da(0x12a)],_0x5884b2=_0x12bc1e['label'],_0x32f115=_0x12bc1e[_0x27b4da(0x117)];if(typeof _0x341c06!==_0x27b4da(0x120)||!/^\/(?!\/)[^?#]*$/['test'](_0x341c06)||typeof _0x5884b2!==_0x27b4da(0x120)||!_0x5884b2[_0x27b4da(0x13e)]()||typeof _0x32f115!=='string'||!/^src\/pages\/(?!.*\.\.)[^/].*\.tsx$/[_0x27b4da(0x119)](_0x32f115)||typeof _0x12bc1e[_0x27b4da(0x138)]!=='boolean')throw new Error(_0x27b4da(0x123)+(_0x3c20a5+0x1)+_0x27b4da(0x114));if(_0x1d6bd2[_0x27b4da(0x130)](_0x341c06))throw new Error(_0x27b4da(0x12b)+_0x341c06);_0x1d6bd2['add'](_0x341c06);if(!existsSync(resolve(_0xbe0f09,_0x32f115)))throw new Error(_0x27b4da(0x135)+_0x32f115);const _0x28fa92=_0x32f115[_0x27b4da(0x11a)](_0x27b4da(0x13b)['length'])['replace'](/\/index\.tsx$/,'')[_0x27b4da(0x11b)](/\.tsx$/,'')[_0x27b4da(0x11e)]('$',':')[_0x27b4da(0x11b)](/\[([^/\]]+)\]/g,_0x27b4da(0x140)),_0x17d596=_0x28fa92===_0x27b4da(0x12c)?'/':'/'+_0x28fa92;if(_0x341c06!==_0x17d596)throw new Error('Route\x20'+_0x341c06+'\x20disagrees\x20with\x20pageFile\x20'+_0x32f115+_0x27b4da(0x12f)+_0x17d596);if(_0x12bc1e[_0x27b4da(0x116)]!==undefined&&(typeof _0x12bc1e[_0x27b4da(0x116)]!=='string'||!_0x12bc1e['group'][_0x27b4da(0x13e)]()))throw new Error(_0x27b4da(0x113)+_0x341c06);if(_0x12bc1e[_0x27b4da(0x118)]!==undefined&&(!Number[_0x27b4da(0x11c)](_0x12bc1e[_0x27b4da(0x118)])||_0x12bc1e[_0x27b4da(0x118)]<0x0))throw new Error(_0x27b4da(0x125)+_0x341c06);return{'path':_0x341c06,'label':_0x5884b2[_0x27b4da(0x13e)](),'visible':_0x12bc1e[_0x27b4da(0x138)],..._0x12bc1e[_0x27b4da(0x116)]===undefined?{}:{'group':_0x12bc1e['group']['trim']()},..._0x12bc1e[_0x27b4da(0x118)]===undefined?{}:{'order':_0x12bc1e['order']}};});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x134c97,_0x30fdf3){const _0x18918d=a179_0x3f5d,_0x1816a9=_0x134c97();while(!![]){try{const _0x2220a0=parseInt(_0x18918d(0x176))/0x1+parseInt(_0x18918d(0x180))/0x2*(parseInt(_0x18918d(0x173))/0x3)+-parseInt(_0x18918d(0x177))/0x4*(-parseInt(_0x18918d(0x16e))/0x5)+parseInt(_0x18918d(0x178))/0x6*(-parseInt(_0x18918d(0x17a))/0x7)+parseInt(_0x18918d(0x17e))/0x8+parseInt(_0x18918d(0x182))/0x9*(parseInt(_0x18918d(0x179))/0xa)+-parseInt(_0x18918d(0x17f))/0xb*(parseInt(_0x18918d(0x172))/0xc);if(_0x2220a0===_0x30fdf3)break;else _0x1816a9['push'](_0x1816a9['shift']());}catch(_0x528440){_0x1816a9['push'](_0x1816a9['shift']());}}}(a179_0x36cb,0xdd27b));function a179_0x36cb(){const _0x2cb475=['errors','5552576MGjkYA','244574ZCtQTN','10arRrOm','resources','1547568RrvnnI','length','CSS\x20URL\x20is\x20unreachable','20PDEqhw','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','map','JS\x20URL\x20is\x20unreachable','1452vniOgf','577506iMmxFx','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','path','1725907UzFvVx','1633580mBkPQx','672djvEcm','10LlhFFL','99491oLIgWx','label','push'];a179_0x36cb=function(){return _0x2cb475;};return a179_0x36cb();}import{menuPathKey}from'../../../commands/menu/shared/path.js';import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';export function validateJsUrl(_0x4d6ff1){const _0x5ba63a=a179_0x3f5d,_0x39c201=[];return!isValidJsHttpsUrl(_0x4d6ff1)&&_0x39c201['push'](_0x5ba63a(0x16f)),{'ok':_0x39c201[_0x5ba63a(0x183)]===0x0,'errors':_0x39c201};}export function validateCssUrl(_0x4b6968){const _0x2f0fd8=a179_0x3f5d,_0x27ad0d=[];return!isValidCssHttpsUrl(_0x4b6968)&&_0x27ad0d[_0x2f0fd8(0x17c)](_0x2f0fd8(0x174)),{'ok':_0x27ad0d[_0x2f0fd8(0x183)]===0x0,'errors':_0x27ad0d};}function a179_0x3f5d(_0x2af09c,_0x4db45f){_0x2af09c=_0x2af09c-0x16e;const _0x36cb58=a179_0x36cb();let _0x3f5d85=_0x36cb58[_0x2af09c];return _0x3f5d85;}export async function validateJsUrlReachable(_0xf74cfd){const _0x3c03b3=a179_0x3f5d,_0xe3823f=validateJsUrl(_0xf74cfd);if(!_0xe3823f['ok'])return _0xe3823f;const _0x403191=await isUrlReachable(_0xf74cfd);if(!_0x403191)_0xe3823f[_0x3c03b3(0x17d)][_0x3c03b3(0x17c)](_0x3c03b3(0x171));return{'ok':_0xe3823f[_0x3c03b3(0x17d)]['length']===0x0,'errors':_0xe3823f[_0x3c03b3(0x17d)]};}export async function validateCssUrlReachable(_0x62c5ae){const _0x1a1137=a179_0x3f5d,_0x59da5a=validateCssUrl(_0x62c5ae);if(!_0x59da5a['ok'])return _0x59da5a;const _0x18bf3b=await isUrlReachable(_0x62c5ae);if(!_0x18bf3b)_0x59da5a[_0x1a1137(0x17d)][_0x1a1137(0x17c)](_0x1a1137(0x184));return{'ok':_0x59da5a['errors']['length']===0x0,'errors':_0x59da5a['errors']};}export function buildCompareRows(_0x22d4d7,_0x4e7ae8){const _0x8a3c87=a179_0x3f5d;return _0x22d4d7[_0x8a3c87(0x170)](_0x3d5e3e=>({'label':_0x3d5e3e[_0x8a3c87(0x17b)],'path':_0x3d5e3e[_0x8a3c87(0x175)],'local':!![],'online':_0x4e7ae8['has'](menuPathKey(_0x3d5e3e['path']))}));}export async function doCreateMenus(_0x48826f,_0x2dc343,_0x2db947,_0x4b0b49,_0x2d7b18){const _0x59ae81=a179_0x3f5d,_0x178b35=_0x2d7b18?await createMenus(_0x48826f,_0x2dc343,_0x2db947,_0x4b0b49,_0x2d7b18):await createMenus(_0x48826f,_0x2dc343,_0x2db947,_0x4b0b49);return{'created':_0x178b35[_0x59ae81(0x183)],'failed':0x0,'labels':_0x2db947['map'](_0xaa0e93=>_0xaa0e93[_0x59ae81(0x17b)]),'menus':_0x178b35};}export function filterMenusWithResources(_0x738d11){const _0x12c840=a179_0x3f5d;return _0x738d11['filter'](_0x187e63=>_0x187e63[_0x12c840(0x181)][_0x12c840(0x183)]>0x0);}export async function fetchMenuData(_0x2078df,_0x178143){const _0x237b4c=a179_0x3f5d,_0x179e60=getLocalPages(),_0x126d23=await getOnlineMenuList(_0x2078df,_0x178143),_0x233399=new Set(_0x126d23[_0x237b4c(0x170)](_0x2f3261=>menuPathKey(_0x2f3261['path'])));return{'localPages':_0x179e60,'onlineMenuList':_0x126d23,'onlinePaths':_0x233399};}export async function fetchOnlineMenuList(_0x2fa0f,_0x2f6066){return getOnlineMenuList(_0x2fa0f,_0x2f6066);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a180_0x3f096d=a180_0x222a;(function(_0x6edaf9,_0x5beb9a){const _0x3e95f6=a180_0x222a,_0x1b777e=_0x6edaf9();while(!![]){try{const _0x256689=-parseInt(_0x3e95f6(0x11a))/0x1*(parseInt(_0x3e95f6(0xef))/0x2)+parseInt(_0x3e95f6(0x11d))/0x3+parseInt(_0x3e95f6(0xdd))/0x4*(parseInt(_0x3e95f6(0x12d))/0x5)+-parseInt(_0x3e95f6(0x126))/0x6+parseInt(_0x3e95f6(0x107))/0x7+-parseInt(_0x3e95f6(0xfe))/0x8*(parseInt(_0x3e95f6(0x105))/0x9)+parseInt(_0x3e95f6(0x110))/0xa;if(_0x256689===_0x5beb9a)break;else _0x1b777e['push'](_0x1b777e['shift']());}catch(_0xe3acae){_0x1b777e['push'](_0x1b777e['shift']());}}}(a180_0x302e,0xa546e));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;function a180_0x222a(_0x6c2d81,_0x327c47){_0x6c2d81=_0x6c2d81-0xc3;const _0x302efa=a180_0x302e();let _0x222a34=_0x302efa[_0x6c2d81];return _0x222a34;}export const MENU_ID_FLAG={'name':'id','type':a180_0x3f096d(0x112),'required':!![],'description':a180_0x3f096d(0xf9)};export const MENU_SORT_FLAG={'name':a180_0x3f096d(0xf5),'type':'number','description':a180_0x3f096d(0x11f)};export const MENU_PARENT_ID_FLAG={'name':a180_0x3f096d(0x10b),'type':'string','description':a180_0x3f096d(0xde)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a180_0x3f096d(0x104),'type':a180_0x3f096d(0xe6),'description':a180_0x3f096d(0xea)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a180_0x3f096d(0xdb),'type':a180_0x3f096d(0xe6),'description':a180_0x3f096d(0xe8)},{'name':a180_0x3f096d(0xd8),'type':a180_0x3f096d(0x112),'description':'Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches'}];export function validateExactId(_0x74ae82){const _0x4b71dc=a180_0x3f096d,_0x204014=_0x74ae82[_0x4b71dc(0xf2)]('id');if(!Number[_0x4b71dc(0x117)](_0x204014)||_0x204014<=0x0)throw CliErrors[_0x4b71dc(0x113)](_0x4b71dc(0xe9));return _0x204014;}export function validateSort(_0x51d01f,_0x29cbb5=a180_0x3f096d(0xf5)){const _0x51674d=a180_0x3f096d;if(!hasFlag(_0x51d01f,_0x29cbb5))return undefined;const _0x2f9b38=_0x51d01f['num'](_0x29cbb5);if(!Number[_0x51674d(0x117)](_0x2f9b38)||_0x2f9b38<0x0||_0x2f9b38>MAX_MENU_SORT)throw menuError(_0x51674d(0xd2),'--'+_0x29cbb5+_0x51674d(0xfb)+MAX_MENU_SORT+'.',_0x51674d(0xc8));return _0x2f9b38;}export function nextSiblingSort(_0x402f55,_0x5dd358,_0x187935){const _0x902b56=a180_0x3f096d,_0x189b85=getChildren(_0x402f55,_0x5dd358)['map'](_0x30d23d=>_0x30d23d[_0x902b56(0xf5)])[_0x902b56(0xd5)](_0x390b7e=>typeof _0x390b7e==='number');if(_0x189b85['length']===0x0)return 0x0;const _0x39f5bc=Math[_0x902b56(0xc4)](..._0x189b85);if(_0x39f5bc>=MAX_MENU_SORT)throw menuError(_0x902b56(0x106),_0x902b56(0x114)+_0x187935+_0x902b56(0x11e)+_0x39f5bc+'.','Reorder\x20sibling\x20menus\x20below\x20'+MAX_MENU_SORT+_0x902b56(0xe5));return _0x39f5bc+0x1;}export function requireExplicitYes(_0x38a0f1){const _0x1751ad=a180_0x3f096d;if(_0x38a0f1[_0x1751ad(0x10f)](_0x1751ad(0xcf)))return;if(!_0x38a0f1[_0x1751ad(0x10f)]('yes'))throw menuError(_0x1751ad(0xd7),_0x1751ad(0x116),_0x1751ad(0x102));}export async function fetchMutationSnapshot(_0x252c3e,_0x447f70,_0x4930ab){const _0x1fddf0=a180_0x3f096d;try{return await fetchMenuSnapshot(_0x252c3e[_0x1fddf0(0x129)],_0x252c3e[_0x1fddf0(0xee)]);}catch(_0x251742){throw mapMenuApiError(_0x251742,'read\x20online\x20menu\x20facts\x20before\x20'+_0x447f70,_0x4930ab);}}export async function recheckMutationSnapshot(_0x465b30,_0x54f642,_0xc530c1,_0x267087){const _0x3528c2=a180_0x3f096d;let _0xea9dc4;try{_0xea9dc4=await fetchMenuSnapshot(_0x465b30[_0x3528c2(0x129)],_0x465b30[_0x3528c2(0xee)]);}catch(_0x2bb938){const _0x3fa5a6=mapMenuApiError(_0x2bb938,_0x3528c2(0xcc)+_0xc530c1,_0x267087);throw menuFailure(_0x3fa5a6,_0x54f642,{'stage':_0x3528c2(0xf1),'failed':_0x267087==null?{}:{'id':_0x267087}});}if(_0xea9dc4[_0x3528c2(0x123)]!==_0x54f642['snapshotHash']){const _0x39cb24=menuError(_0x3528c2(0x124),_0x3528c2(0xe7)+_0xc530c1+';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.');throw menuFailure(_0x39cb24,_0x54f642,{'stage':_0x3528c2(0xf1),'failed':{..._0x267087==null?{}:{'id':_0x267087},'expectedSnapshotHash':_0x54f642[_0x3528c2(0xd6)],'currentSnapshotHash':_0xea9dc4['hash']}});}return _0xea9dc4;}export function parseParentId(_0x5041c6,_0x140ca9,_0x28c200={}){const _0x393196=a180_0x3f096d;if(!hasFlag(_0x5041c6,_0x140ca9)){if(_0x28c200[_0x393196(0xdc)])throw CliErrors[_0x393196(0x119)](_0x140ca9);return undefined;}const _0x1a1567=_0x5041c6[_0x393196(0xff)](_0x140ca9)[_0x393196(0xcd)]();if(_0x1a1567['toLowerCase']()===_0x393196(0xd4))return null;if(!/^\d+$/[_0x393196(0x122)](_0x1a1567))throw CliErrors[_0x393196(0x113)]('--'+_0x140ca9+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');const _0x4d31ff=Number(_0x1a1567);if(!Number[_0x393196(0x117)](_0x4d31ff)||_0x4d31ff<=0x0)throw CliErrors[_0x393196(0x113)]('--'+_0x140ca9+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');return _0x4d31ff;}export function requireMenu(_0x20a5ec,_0x4785f4){const _0x58bcf2=a180_0x3f096d,_0x3abf8a=_0x20a5ec[_0x58bcf2(0xc9)]['get'](_0x4785f4);if(!_0x3abf8a)throw menuError(_0x58bcf2(0x120),'Online\x20menu\x20not\x20found:\x20'+_0x4785f4,_0x58bcf2(0xe4));return _0x3abf8a;}export function requireFolder(_0x56ef9f,_0x249ae7){const _0xd511fe=a180_0x3f096d,_0x324f41=requireMenu(_0x56ef9f,_0x249ae7);if(_0x324f41[_0xd511fe(0x118)]!==_0xd511fe(0x109))throw menuError(_0xd511fe(0xd1),_0xd511fe(0xf0)+_0x249ae7+_0xd511fe(0xce)+(_0x324f41[_0xd511fe(0x118)]||_0xd511fe(0x103))+_0xd511fe(0xfa),_0xd511fe(0x127));return _0x324f41;}export function assertExpectedState(_0x41ba23,_0x3fea4d){const _0x48dc13=a180_0x3f096d;if(hasFlag(_0x41ba23,'expect-parent-id')){const _0x3cb7d0=parseParentId(_0x41ba23,'expect-parent-id',{'required':!![]});if(_0x3fea4d[_0x48dc13(0x12f)]!==_0x3cb7d0)throw stateDrift(_0x48dc13(0xf0)+_0x3fea4d['id']+'\x20parent\x20changed:\x20expected\x20'+formatParent(_0x3cb7d0)+_0x48dc13(0x10d)+formatParent(_0x3fea4d[_0x48dc13(0x12f)])+'.');}if(hasFlag(_0x41ba23,_0x48dc13(0xdb))){const _0x5d23c=_0x41ba23[_0x48dc13(0xff)](_0x48dc13(0xdb));if(_0x3fea4d[_0x48dc13(0xeb)]!==_0x5d23c)throw stateDrift(_0x48dc13(0xf0)+_0x3fea4d['id']+_0x48dc13(0xda)+JSON[_0x48dc13(0xe1)](_0x5d23c)+_0x48dc13(0x10d)+JSON[_0x48dc13(0xe1)](_0x3fea4d['path'])+'.');}if(hasFlag(_0x41ba23,'expected-children-count')){const _0x2f0d12=_0x41ba23['num'](_0x48dc13(0xd8));if(!Number[_0x48dc13(0x117)](_0x2f0d12)||_0x2f0d12<0x0)throw CliErrors['validation'](_0x48dc13(0xf7));if(_0x3fea4d[_0x48dc13(0xfd)]!==_0x2f0d12)throw stateDrift(_0x48dc13(0xf0)+_0x3fea4d['id']+_0x48dc13(0xf8)+_0x2f0d12+_0x48dc13(0x10d)+_0x3fea4d[_0x48dc13(0xfd)]+'.');}}export function assertVerified(_0xf32d40,_0x11b536,_0x50619f=a180_0x3f096d(0x12a)){const _0x6d3a2d=a180_0x3f096d;if(!_0xf32d40)throw menuError(_0x6d3a2d(0xc5),_0x11b536,_0x50619f);}export function mutationResult(_0x2a0489){const _0x2b23b1=a180_0x3f096d;return{'operation':_0x2a0489[_0x2b23b1(0xe3)],'selector':_0x2a0489[_0x2b23b1(0xca)],'before':_0x2a0489[_0x2b23b1(0x12e)],'after':_0x2a0489[_0x2b23b1(0x111)],'dryRun':_0x2a0489[_0x2b23b1(0xec)],'backend':_0x2a0489[_0x2b23b1(0xf3)],..._0x2a0489['plannedActions']?{'plannedActions':_0x2a0489[_0x2b23b1(0xdf)]}:{},..._0x2a0489['targets']?{'targets':_0x2a0489[_0x2b23b1(0x10c)]}:{},..._0x2a0489[_0x2b23b1(0x11c)]?{'deleteOrder':_0x2a0489['deleteOrder']}:{},'snapshotHash':_0x2a0489[_0x2b23b1(0xd6)],..._0x2a0489['cascade']?{'cascade':_0x2a0489[_0x2b23b1(0x125)]}:{},..._0x2a0489[_0x2b23b1(0x12c)]?{'planFile':_0x2a0489[_0x2b23b1(0x12c)]}:{},'succeeded':_0x2a0489[_0x2b23b1(0xd3)]??[],'failed':_0x2a0489['failed']??[],'warnings':_0x2a0489[_0x2b23b1(0x115)]??[],'verification':_0x2a0489[_0x2b23b1(0x100)],'error':_0x2a0489[_0x2b23b1(0x128)]};}export function menuDryRunResult(_0x2efa57,_0x145c2c){return{..._0x2efa57,..._0x145c2c};}function a180_0x302e(){const _0x883536=['childrenCount','64WMHXdJ','str','verification','failed','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','unknown','expect-parent-id','548478RkYREb','menu_sort_overflow','3950772hZGFYs','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','folder','call','parent-id','targets',',\x20current\x20','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','bool','13599240KsPOBy','after','number','validation','Cannot\x20append\x20a\x20','warnings','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','isSafeInteger','type','flagMissing','8wRmFFb','Failed\x20to\x20','deleteOrder','3463596uNmsxp','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','Sibling\x20sort\x20value\x20(non-negative\x20integer)','menu_not_found','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','test','hash','menu_state_drift','cascade','3898842qJxJMx','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','error','appCode','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','failedRecords','planFile','1545EmMKhh','before','parentId','message','max','menu_verification_failed','prototype','rawFlags','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','byId','selector','menu_permission_denied','recheck\x20online\x20menu\x20facts\x20before\x20','trim','\x20is\x20type\x20\x22','dry-run','menu_mutation_failed','menu_parent_not_folder','menu_sort_invalid','succeeded','root','filter','snapshotHash','menu_confirmation_required','expected-children-count','data','\x20path\x20changed:\x20expected\x20','expect-path','required','916jzJhVI','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','plannedActions','stage','stringify','api_error','operation','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','string','Online\x20menu\x20state\x20changed\x20before\x20','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','path','dryRun','hint','cookie','333824HzRGmd','Menu\x20','pre-write-recheck','num','backend','\x20menu\x20','sort','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','\x20child\x20count\x20changed:\x20expected\x20','Exact\x20online\x20menu\x20id','\x22,\x20not\x20folder.','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','code'];a180_0x302e=function(){return _0x883536;};return a180_0x302e();}export function menuFailure(_0x3e5372,_0x42ce6e,_0x69f038){const _0x426040=a180_0x3f096d,_0xb0d9ea=mutationResult({..._0x42ce6e,'after':_0x69f038[_0x426040(0x111)]===undefined?_0x42ce6e[_0x426040(0x111)]:_0x69f038[_0x426040(0x111)],'backend':_0x69f038[_0x426040(0xf3)]??_0x42ce6e[_0x426040(0xf3)],'dryRun':![],'succeeded':_0x69f038[_0x426040(0xd3)]??[],'failed':_0x69f038[_0x426040(0x12b)]??[{..._0x69f038[_0x426040(0x101)]??{},'stage':_0x69f038[_0x426040(0xe0)],'code':_0x3e5372['code'],'message':_0x3e5372[_0x426040(0xc3)]}],'warnings':[..._0x42ce6e['warnings'],..._0x69f038[_0x426040(0x115)]??[]],'verification':_0x69f038[_0x426040(0x100)],'error':{'code':_0x3e5372['code'],'message':_0x3e5372[_0x426040(0xc3)],..._0x3e5372[_0x426040(0xed)]?{'hint':_0x3e5372[_0x426040(0xed)]}:{}}});return Object['defineProperty'](_0x3e5372,_0x426040(0xd9),{'value':_0xb0d9ea,'enumerable':!![],'configurable':!![]}),_0x3e5372;}export function asVerificationError(_0xa867f1,_0x227a08){const _0x44cab3=a180_0x3f096d;if(_0xa867f1 instanceof CliError&&_0xa867f1[_0x44cab3(0xfc)]===_0x44cab3(0xc5))return _0xa867f1;const _0x427029=_0xa867f1 instanceof Error?_0xa867f1[_0x44cab3(0xc3)]:String(_0xa867f1);return menuError(_0x44cab3(0xc5),''+_0x227a08+(_0x427029?':\x20'+_0x427029:''),_0x44cab3(0x108));}export function describeMenuErrorCause(_0x566405,_0x31cd1f,_0x352dd7){const _0x15896c=a180_0x3f096d,_0x4dbb5e=mapMenuApiError(_0x566405,_0x31cd1f,_0x352dd7);return{'causeCode':_0x4dbb5e[_0x15896c(0xfc)],'causeMessage':_0x4dbb5e[_0x15896c(0xc3)]};}export function hasFlag(_0x1c7757,_0x17b67a){const _0x55da80=a180_0x3f096d;return Object[_0x55da80(0xc6)]['hasOwnProperty'][_0x55da80(0x10a)](_0x1c7757[_0x55da80(0xc7)],_0x17b67a)&&_0x1c7757[_0x55da80(0xc7)][_0x17b67a]!==undefined;}export function toApiParentId(_0x53669e){return _0x53669e??0x0;}export function formatParent(_0x3fad12){const _0x42fc8d=a180_0x3f096d;return _0x3fad12==null?_0x42fc8d(0xd4):String(_0x3fad12);}export function menuError(_0x343a53,_0x5b7167,_0x5bcf90){return new CliError(_0x343a53,0x1,_0x5b7167,_0x5bcf90);}export function mapMenuApiError(_0x215e54,_0x405e15,_0x50b260){const _0x238bc6=a180_0x3f096d;if(_0x215e54 instanceof CliError&&_0x215e54[_0x238bc6(0xfc)]!=='api_error')return _0x215e54;const _0x38c99d=_0x215e54 instanceof Error?_0x215e54[_0x238bc6(0xc3)]:String(_0x215e54);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x238bc6(0x122)](_0x38c99d))return menuError(_0x238bc6(0xcb),'Permission\x20denied\x20while\x20attempting\x20to\x20'+_0x405e15+(_0x50b260?_0x238bc6(0xf4)+_0x50b260:'')+'.',_0x238bc6(0x121));return menuError(_0x238bc6(0xd0),_0x238bc6(0x11b)+_0x405e15+(_0x50b260?_0x238bc6(0xf4)+_0x50b260:'')+':\x20'+_0x38c99d,_0x238bc6(0xf6));}export function isMenuResponseLoss(_0x514c82){const _0x595975=a180_0x3f096d,_0x32215f=_0x514c82 instanceof Error?_0x514c82['message']:String(_0x514c82);if(_0x514c82 instanceof CliError)return _0x514c82[_0x595975(0xfc)]===_0x595975(0xe2)&&/^Request (?:failed|timeout):/i[_0x595975(0x122)](_0x32215f);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i['test'](_0x32215f);}function stateDrift(_0x4d4a38){const _0x48aa86=a180_0x3f096d;return menuError(_0x48aa86(0x124),_0x4d4a38,_0x48aa86(0x10e));}
|
|
1
|
+
const a180_0x4f6c0f=a180_0x3b8b;(function(_0x581fc6,_0x19b88d){const _0x351399=a180_0x3b8b,_0x5e20fc=_0x581fc6();while(!![]){try{const _0x5788cd=-parseInt(_0x351399(0xda))/0x1+parseInt(_0x351399(0xcf))/0x2+parseInt(_0x351399(0xfa))/0x3+parseInt(_0x351399(0x118))/0x4+parseInt(_0x351399(0xd2))/0x5+-parseInt(_0x351399(0x110))/0x6*(-parseInt(_0x351399(0xdd))/0x7)+-parseInt(_0x351399(0xe0))/0x8;if(_0x5788cd===_0x19b88d)break;else _0x5e20fc['push'](_0x5e20fc['shift']());}catch(_0x31f262){_0x5e20fc['push'](_0x5e20fc['shift']());}}}(a180_0x3ca1,0x74ed8));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':a180_0x4f6c0f(0xc4),'required':!![],'description':a180_0x4f6c0f(0x10e)};export const MENU_SORT_FLAG={'name':a180_0x4f6c0f(0xf0),'type':a180_0x4f6c0f(0xc4),'description':a180_0x4f6c0f(0xc9)};export const MENU_PARENT_ID_FLAG={'name':a180_0x4f6c0f(0x105),'type':'string','description':a180_0x4f6c0f(0xf4)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a180_0x4f6c0f(0xee),'type':'string','description':a180_0x4f6c0f(0x102)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a180_0x4f6c0f(0xe1),'type':a180_0x4f6c0f(0xeb),'description':'Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches'},{'name':'expected-children-count','type':a180_0x4f6c0f(0xc4),'description':'Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches'}];export function validateExactId(_0x4a9b84){const _0x464272=a180_0x4f6c0f,_0x2d3328=_0x4a9b84[_0x464272(0xf6)]('id');if(!Number['isSafeInteger'](_0x2d3328)||_0x2d3328<=0x0)throw CliErrors[_0x464272(0xe3)](_0x464272(0x10a));return _0x2d3328;}export function validateSort(_0x526e18,_0x25c10d=a180_0x4f6c0f(0xf0)){const _0x29baf4=a180_0x4f6c0f;if(!hasFlag(_0x526e18,_0x25c10d))return undefined;const _0x5ff994=_0x526e18['num'](_0x25c10d);if(!Number[_0x29baf4(0xdf)](_0x5ff994)||_0x5ff994<0x0||_0x5ff994>MAX_MENU_SORT)throw menuError('menu_sort_invalid','--'+_0x25c10d+_0x29baf4(0xc5)+MAX_MENU_SORT+'.','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.');return _0x5ff994;}export function nextSiblingSort(_0x5cb1a9,_0x2bdd39,_0x2fcaba){const _0x12ebd2=a180_0x4f6c0f,_0x3e1c63=getChildren(_0x5cb1a9,_0x2bdd39)[_0x12ebd2(0x11c)](_0x17b4fa=>_0x17b4fa['sort'])[_0x12ebd2(0xd8)](_0x3aabc4=>typeof _0x3aabc4===_0x12ebd2(0xc4));if(_0x3e1c63[_0x12ebd2(0x104)]===0x0)return 0x0;const _0x219720=Math[_0x12ebd2(0x11a)](..._0x3e1c63);if(_0x219720>=MAX_MENU_SORT)throw menuError(_0x12ebd2(0x10d),_0x12ebd2(0x12f)+_0x2fcaba+_0x12ebd2(0xea)+_0x219720+'.',_0x12ebd2(0x113)+MAX_MENU_SORT+_0x12ebd2(0xcb));return _0x219720+0x1;}export function requireExplicitYes(_0x1ba839){const _0x3ad8b0=a180_0x4f6c0f;if(_0x1ba839['bool']('dry-run'))return;if(!_0x1ba839[_0x3ad8b0(0x108)](_0x3ad8b0(0xed)))throw menuError(_0x3ad8b0(0x107),_0x3ad8b0(0xe7),_0x3ad8b0(0xf7));}export async function fetchMutationSnapshot(_0x1fb477,_0x5658c3,_0x2b75fb){const _0x3081ed=a180_0x4f6c0f;try{return await fetchMenuSnapshot(_0x1fb477[_0x3081ed(0x124)],_0x1fb477[_0x3081ed(0x117)]);}catch(_0x51bf8b){throw mapMenuApiError(_0x51bf8b,_0x3081ed(0x128)+_0x5658c3,_0x2b75fb);}}export async function recheckMutationSnapshot(_0x22a2c2,_0x25190d,_0x35ce5c,_0x5d0cab){const _0x4a3157=a180_0x4f6c0f;let _0x4d7f57;try{_0x4d7f57=await fetchMenuSnapshot(_0x22a2c2[_0x4a3157(0x124)],_0x22a2c2[_0x4a3157(0x117)]);}catch(_0x1e2b3e){const _0x5f2fd8=mapMenuApiError(_0x1e2b3e,_0x4a3157(0x11b)+_0x35ce5c,_0x5d0cab);throw menuFailure(_0x5f2fd8,_0x25190d,{'stage':_0x4a3157(0xe5),'failed':_0x5d0cab==null?{}:{'id':_0x5d0cab}});}if(_0x4d7f57['hash']!==_0x25190d[_0x4a3157(0xf2)]){const _0x54c7db=menuError(_0x4a3157(0x119),'Online\x20menu\x20state\x20changed\x20before\x20'+_0x35ce5c+_0x4a3157(0x10c),_0x4a3157(0x115));throw menuFailure(_0x54c7db,_0x25190d,{'stage':'pre-write-recheck','failed':{..._0x5d0cab==null?{}:{'id':_0x5d0cab},'expectedSnapshotHash':_0x25190d[_0x4a3157(0xf2)],'currentSnapshotHash':_0x4d7f57[_0x4a3157(0xcc)]}});}return _0x4d7f57;}export function parseParentId(_0x487d58,_0x4413d1,_0x4b63d3={}){const _0x109f8a=a180_0x4f6c0f;if(!hasFlag(_0x487d58,_0x4413d1)){if(_0x4b63d3[_0x109f8a(0x11f)])throw CliErrors['flagMissing'](_0x4413d1);return undefined;}const _0x562aa5=_0x487d58[_0x109f8a(0xec)](_0x4413d1)[_0x109f8a(0xe4)]();if(_0x562aa5[_0x109f8a(0x10f)]()===_0x109f8a(0x100))return null;if(!/^\d+$/[_0x109f8a(0x125)](_0x562aa5))throw CliErrors['validation']('--'+_0x4413d1+_0x109f8a(0xdc));const _0x1ea2a8=Number(_0x562aa5);if(!Number[_0x109f8a(0xdf)](_0x1ea2a8)||_0x1ea2a8<=0x0)throw CliErrors['validation']('--'+_0x4413d1+_0x109f8a(0xdc));return _0x1ea2a8;}export function requireMenu(_0x2656ff,_0x34f9e7){const _0x20d3c9=a180_0x4f6c0f,_0x35d507=_0x2656ff[_0x20d3c9(0xc3)][_0x20d3c9(0xd6)](_0x34f9e7);if(!_0x35d507)throw menuError(_0x20d3c9(0xc7),_0x20d3c9(0xfb)+_0x34f9e7,_0x20d3c9(0x120));return _0x35d507;}export function requireFolder(_0x136c53,_0x2937e0){const _0x4f7ac4=a180_0x4f6c0f,_0x3d7f41=requireMenu(_0x136c53,_0x2937e0);if(_0x3d7f41[_0x4f7ac4(0xe2)]!==_0x4f7ac4(0x126))throw menuError(_0x4f7ac4(0x112),_0x4f7ac4(0x114)+_0x2937e0+_0x4f7ac4(0x10b)+(_0x3d7f41[_0x4f7ac4(0xe2)]||_0x4f7ac4(0xca))+_0x4f7ac4(0xff),_0x4f7ac4(0x103));return _0x3d7f41;}export function assertExpectedState(_0x36cc55,_0x40011a){const _0xe9fc6a=a180_0x4f6c0f;if(hasFlag(_0x36cc55,'expect-parent-id')){const _0x2e5e80=parseParentId(_0x36cc55,_0xe9fc6a(0xee),{'required':!![]});if(_0x40011a[_0xe9fc6a(0x121)]!==_0x2e5e80)throw stateDrift(_0xe9fc6a(0x114)+_0x40011a['id']+'\x20parent\x20changed:\x20expected\x20'+formatParent(_0x2e5e80)+',\x20current\x20'+formatParent(_0x40011a[_0xe9fc6a(0x121)])+'.');}if(hasFlag(_0x36cc55,_0xe9fc6a(0xe1))){const _0x4a9a7c=_0x36cc55[_0xe9fc6a(0xec)](_0xe9fc6a(0xe1));if(_0x40011a[_0xe9fc6a(0x101)]!==_0x4a9a7c)throw stateDrift('Menu\x20'+_0x40011a['id']+'\x20path\x20changed:\x20expected\x20'+JSON[_0xe9fc6a(0xd1)](_0x4a9a7c)+',\x20current\x20'+JSON['stringify'](_0x40011a[_0xe9fc6a(0x101)])+'.');}if(hasFlag(_0x36cc55,_0xe9fc6a(0xfc))){const _0xdf76c2=_0x36cc55[_0xe9fc6a(0xf6)](_0xe9fc6a(0xfc));if(!Number[_0xe9fc6a(0xdf)](_0xdf76c2)||_0xdf76c2<0x0)throw CliErrors[_0xe9fc6a(0xe3)](_0xe9fc6a(0xde));if(_0x40011a[_0xe9fc6a(0xd4)]!==_0xdf76c2)throw stateDrift('Menu\x20'+_0x40011a['id']+_0xe9fc6a(0x11e)+_0xdf76c2+_0xe9fc6a(0xd3)+_0x40011a[_0xe9fc6a(0xd4)]+'.');}}export function assertVerified(_0x340d1a,_0x4c7f82,_0x16f46d=a180_0x4f6c0f(0x123)){if(!_0x340d1a)throw menuError('menu_verification_failed',_0x4c7f82,_0x16f46d);}function a180_0x3b8b(_0xfe1cdc,_0x513f98){_0xfe1cdc=_0xfe1cdc-0xc3;const _0x3ca112=a180_0x3ca1();let _0x3b8bf1=_0x3ca112[_0xfe1cdc];return _0x3b8bf1;}export function mutationResult(_0x479457){const _0x5df7c8=a180_0x4f6c0f;return{'operation':_0x479457[_0x5df7c8(0x12a)],'selector':_0x479457[_0x5df7c8(0xd9)],'before':_0x479457[_0x5df7c8(0xd7)],'after':_0x479457[_0x5df7c8(0xce)],'dryRun':_0x479457[_0x5df7c8(0xf3)],'backend':_0x479457[_0x5df7c8(0x11d)],..._0x479457['plannedActions']?{'plannedActions':_0x479457['plannedActions']}:{},..._0x479457[_0x5df7c8(0xd5)]?{'targets':_0x479457[_0x5df7c8(0xd5)]}:{},..._0x479457[_0x5df7c8(0x12e)]?{'deleteOrder':_0x479457['deleteOrder']}:{},'snapshotHash':_0x479457['snapshotHash'],..._0x479457[_0x5df7c8(0x129)]?{'cascade':_0x479457[_0x5df7c8(0x129)]}:{},..._0x479457['planFile']?{'planFile':_0x479457[_0x5df7c8(0xe8)]}:{},'succeeded':_0x479457[_0x5df7c8(0xfd)]??[],'failed':_0x479457[_0x5df7c8(0xef)]??[],'warnings':_0x479457[_0x5df7c8(0x12c)]??[],'verification':_0x479457[_0x5df7c8(0xdb)],'error':_0x479457['error']};}export function menuDryRunResult(_0x5cdbce,_0x288341){return{..._0x5cdbce,..._0x288341};}export function menuFailure(_0x384693,_0x351441,_0x5580bf){const _0x3bd589=a180_0x4f6c0f,_0x57fa87=mutationResult({..._0x351441,'after':_0x5580bf[_0x3bd589(0xce)]===undefined?_0x351441[_0x3bd589(0xce)]:_0x5580bf[_0x3bd589(0xce)],'backend':_0x5580bf[_0x3bd589(0x11d)]??_0x351441[_0x3bd589(0x11d)],'dryRun':![],'succeeded':_0x5580bf[_0x3bd589(0xfd)]??[],'failed':_0x5580bf['failedRecords']??[{..._0x5580bf['failed']??{},'stage':_0x5580bf[_0x3bd589(0xe6)],'code':_0x384693['code'],'message':_0x384693[_0x3bd589(0xcd)]}],'warnings':[..._0x351441[_0x3bd589(0x12c)],..._0x5580bf[_0x3bd589(0x12c)]??[]],'verification':_0x5580bf['verification'],'error':{'code':_0x384693[_0x3bd589(0x106)],'message':_0x384693[_0x3bd589(0xcd)],..._0x384693[_0x3bd589(0x109)]?{'hint':_0x384693['hint']}:{}}});return Object[_0x3bd589(0x122)](_0x384693,_0x3bd589(0xf9),{'value':_0x57fa87,'enumerable':!![],'configurable':!![]}),_0x384693;}export function asVerificationError(_0x186dbb,_0x2b3796){const _0x5ba40f=a180_0x4f6c0f;if(_0x186dbb instanceof CliError&&_0x186dbb['code']===_0x5ba40f(0x127))return _0x186dbb;const _0x15843b=_0x186dbb instanceof Error?_0x186dbb[_0x5ba40f(0xcd)]:String(_0x186dbb);return menuError(_0x5ba40f(0x127),''+_0x2b3796+(_0x15843b?':\x20'+_0x15843b:''),_0x5ba40f(0xf1));}export function describeMenuErrorCause(_0x2726f8,_0x284a07,_0x2dc808){const _0x13f4b6=a180_0x4f6c0f,_0x5bcaf9=mapMenuApiError(_0x2726f8,_0x284a07,_0x2dc808);return{'causeCode':_0x5bcaf9[_0x13f4b6(0x106)],'causeMessage':_0x5bcaf9[_0x13f4b6(0xcd)]};}export function hasFlag(_0x2e1f7,_0x23be20){const _0x58277e=a180_0x4f6c0f;return Object[_0x58277e(0xf5)][_0x58277e(0xc6)][_0x58277e(0xf8)](_0x2e1f7['rawFlags'],_0x23be20)&&_0x2e1f7['rawFlags'][_0x23be20]!==undefined;}export function toApiParentId(_0x6932ff){return _0x6932ff??0x0;}function a180_0x3ca1(){const _0x1c3226=['after','474678yoPKqW','Permission\x20denied\x20while\x20attempting\x20to\x20','stringify','4040900xeoZLJ',',\x20current\x20','childrenCount','targets','get','before','filter','selector','578177DVgyru','verification','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','793709CguioT','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','isSafeInteger','20946592AaUDiy','expect-path','type','validation','trim','pre-write-recheck','stage','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','planFile','\x20menu\x20','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','string','str','yes','expect-parent-id','failed','sort','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','snapshotHash','dryRun','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','prototype','num','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','call','data','2305452DSMcAw','Online\x20menu\x20not\x20found:\x20','expected-children-count','succeeded','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','\x22,\x20not\x20folder.','root','path','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','length','parent-id','code','menu_confirmation_required','bool','hint','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','\x20is\x20type\x20\x22',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','menu_sort_overflow','Exact\x20online\x20menu\x20id','toLowerCase','48dfxOPI','Failed\x20to\x20','menu_parent_not_folder','Reorder\x20sibling\x20menus\x20below\x20','Menu\x20','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','cookie','3817352obrgSq','menu_state_drift','max','recheck\x20online\x20menu\x20facts\x20before\x20','map','backend','\x20child\x20count\x20changed:\x20expected\x20','required','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','parentId','defineProperty','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','appCode','test','folder','menu_verification_failed','read\x20online\x20menu\x20facts\x20before\x20','cascade','operation','api_error','warnings','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','deleteOrder','Cannot\x20append\x20a\x20','byId','number','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','hasOwnProperty','menu_not_found','menu_permission_denied','Sibling\x20sort\x20value\x20(non-negative\x20integer)','unknown',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','hash','message'];a180_0x3ca1=function(){return _0x1c3226;};return a180_0x3ca1();}export function formatParent(_0x956819){return _0x956819==null?'root':String(_0x956819);}export function menuError(_0x5db20a,_0x1d50d5,_0x805d8d){return new CliError(_0x5db20a,0x1,_0x1d50d5,_0x805d8d);}export function mapMenuApiError(_0x263ac9,_0x31c068,_0x1813e4){const _0x4b142f=a180_0x4f6c0f;if(_0x263ac9 instanceof CliError&&_0x263ac9[_0x4b142f(0x106)]!==_0x4b142f(0x12b))return _0x263ac9;const _0x51694a=_0x263ac9 instanceof Error?_0x263ac9[_0x4b142f(0xcd)]:String(_0x263ac9);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x4b142f(0x125)](_0x51694a))return menuError(_0x4b142f(0xc8),_0x4b142f(0xd0)+_0x31c068+(_0x1813e4?'\x20menu\x20'+_0x1813e4:'')+'.',_0x4b142f(0xfe));return menuError('menu_mutation_failed',_0x4b142f(0x111)+_0x31c068+(_0x1813e4?_0x4b142f(0xe9)+_0x1813e4:'')+':\x20'+_0x51694a,_0x4b142f(0x12d));}export function isMenuResponseLoss(_0x29ef87){const _0x5a8a38=a180_0x4f6c0f,_0x115014=_0x29ef87 instanceof Error?_0x29ef87['message']:String(_0x29ef87);if(_0x29ef87 instanceof CliError)return _0x29ef87['code']==='api_error'&&/^Request (?:failed|timeout):/i[_0x5a8a38(0x125)](_0x115014);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x5a8a38(0x125)](_0x115014);}function stateDrift(_0x1b0633){const _0x2fb8d9=a180_0x4f6c0f;return menuError('menu_state_drift',_0x1b0633,_0x2fb8d9(0x116));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a181_0x2226(_0x184cb9,_0x3b16b6){_0x184cb9=_0x184cb9-0x19f;const _0x219099=a181_0x2190();let _0x222605=_0x219099[_0x184cb9];return _0x222605;}(function(_0x29663a,_0x205f4f){const _0xb3d65a=a181_0x2226,_0x13eb69=_0x29663a();while(!![]){try{const _0x433a02=parseInt(_0xb3d65a(0x1a9))/0x1*(-parseInt(_0xb3d65a(0x1a2))/0x2)+-parseInt(_0xb3d65a(0x1a6))/0x3+parseInt(_0xb3d65a(0x1a1))/0x4+-parseInt(_0xb3d65a(0x1a7))/0x5*(parseInt(_0xb3d65a(0x1a4))/0x6)+-parseInt(_0xb3d65a(0x1a3))/0x7+parseInt(_0xb3d65a(0x1a0))/0x8+parseInt(_0xb3d65a(0x1a5))/0x9;if(_0x433a02===_0x205f4f)break;else _0x13eb69['push'](_0x13eb69['shift']());}catch(_0x3a38b5){_0x13eb69['push'](_0x13eb69['shift']());}}}(a181_0x2190,0x2981a));function a181_0x2190(){const _0x1ed93d=['505044nWgyDj','20050ZyNfjH','trim','109345VgNYle','replace','183368MiJOPj','258120FcAQhT','2TPULIt','1342502ebhOMx','258pjpOpc','6520212ViRGbV'];a181_0x2190=function(){return _0x1ed93d;};return a181_0x2190();}export function menuPathKey(_0x587ab5){const _0x370181=a181_0x2226,_0x3df7f6=_0x587ab5[_0x370181(0x1a8)]();if(!_0x3df7f6)return'';return _0x3df7f6[_0x370181(0x19f)](/^\/+/,'')[_0x370181(0x19f)](/\/+$/,'')||'/';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x54993f,_0x14f720){const _0x4f1edb=a182_0x38b5,_0x13e61c=_0x54993f();while(!![]){try{const _0x16b49e=parseInt(_0x4f1edb(0x13a))/0x1*(-parseInt(_0x4f1edb(0x12c))/0x2)+-parseInt(_0x4f1edb(0x12f))/0x3*(parseInt(_0x4f1edb(0x12a))/0x4)+parseInt(_0x4f1edb(0x120))/0x5+parseInt(_0x4f1edb(0x118))/0x6+-parseInt(_0x4f1edb(0x117))/0x7*(-parseInt(_0x4f1edb(0x11b))/0x8)+parseInt(_0x4f1edb(0x139))/0x9+parseInt(_0x4f1edb(0x113))/0xa;if(_0x16b49e===_0x14f720)break;else _0x13e61c['push'](_0x13e61c['shift']());}catch(_0x5bd10e){_0x13e61c['push'](_0x13e61c['shift']());}}}(a182_0x1cce,0xa316c));function a182_0x1cce(){const _0x4b1961=['Updating\x20menu\x20asset\x20links:\x20','parentId','Menu\x20assets\x20synced:\x20','914710bBRAKN','Creating\x20menu:\x20','label','update-menu-cdn-url','889TODIsO','2213118NGTEWC','path','menuGroups','12088mQKWVy','length','\x20online\x20menus\x20successfully','resources','loadScriptMode','6196040EtERMC','appName','Batch\x20menu\x20creation\x20completed,\x20total\x20','Regroup\x20','menus','visible','Menu\x20created\x20successfully:\x20','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','get-online-menu-list','number','82376JfOgAH','create-menu','2padTsk','total','map','192pomkgT','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','Start\x20batch\x20menu\x20creation,\x20total\x20','create-menus','procode','order','Fetched\x20','stringify','Create\x20menu\x20\x22','import','7684920qCQjry','759281qXoSpN','Update\x20menu\x20','info','boolean'];a182_0x1cce=function(){return _0x4b1961;};return a182_0x1cce();}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 a182_0x422c74,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x12da1b,_0x317b1c){const _0x2b1ffc=a182_0x38b5,_0x574f3d=getEnv();logger['info'](_0x2b1ffc(0x128),isProduction(_0x574f3d)?_0x2b1ffc(0x127)+_0x12da1b+')':_0x2b1ffc(0x130)+_0x12da1b+')');const _0x51467a=await fetchMenuSnapshot(_0x12da1b,_0x317b1c,{'verbose':!![]});return logger[_0x2b1ffc(0x13c)](_0x2b1ffc(0x128),_0x2b1ffc(0x135)+_0x51467a[_0x2b1ffc(0x12d)]+_0x2b1ffc(0x11d)),_0x51467a[_0x2b1ffc(0x124)]['map'](toProcessedMenuItem);}function a182_0x38b5(_0x1b3d6c,_0x515d15){_0x1b3d6c=_0x1b3d6c-0x112;const _0x1cce31=a182_0x1cce();let _0x38b57c=_0x1cce31[_0x1b3d6c];return _0x38b57c;}export async function createMenu(_0x2a1c7f,_0x54c6f7,_0x522664){const _0x588e66=a182_0x38b5;logger[_0x588e66(0x13c)](_0x588e66(0x12b),_0x588e66(0x114)+_0x522664[_0x588e66(0x115)]+'\x20('+_0x522664[_0x588e66(0x119)]+')');const _0x156fd6={'appCode':_0x2a1c7f,'type':_0x588e66(0x133),'sort':0x0,'extend':{'loadScriptMode':_0x588e66(0x138),'resources':_0x522664[_0x588e66(0x11e)]?JSON['stringify'](_0x522664['resources']):undefined},..._0x522664},_0x5cb9c1=await createMenuRecord(_0x156fd6,_0x54c6f7,_0x588e66(0x137)+_0x522664[_0x588e66(0x115)]+'\x22');return logger[_0x588e66(0x13c)](_0x588e66(0x12b),_0x588e66(0x126)+_0x522664[_0x588e66(0x115)]),_0x5cb9c1;}async function createSingleMenu(_0x33df37,_0x49d69a,_0x35d61b,_0x17a142,_0x292d62){const _0x7a85e3=a182_0x38b5,_0xbe3ec0={'appCode':_0x33df37,'type':_0x7a85e3(0x133),'sort':_0x7a85e3(0x134)in _0x35d61b&&typeof _0x35d61b[_0x7a85e3(0x134)]===_0x7a85e3(0x129)?_0x35d61b[_0x7a85e3(0x134)]:0x0,...'visible'in _0x35d61b&&typeof _0x35d61b[_0x7a85e3(0x125)]===_0x7a85e3(0x13d)?{'visible':_0x35d61b['visible']}:{},..._0x7a85e3(0x13f)in _0x35d61b&&typeof _0x35d61b[_0x7a85e3(0x13f)]===_0x7a85e3(0x129)?{'parentId':_0x35d61b[_0x7a85e3(0x13f)]}:{},'extend':{..._0x292d62?.[_0x7a85e3(0x121)]?{'appName':_0x292d62['appName']}:{},'loadScriptMode':_0x7a85e3(0x138),'resources':_0x17a142?JSON['stringify'](_0x17a142):undefined},'label':_0x35d61b['label'],'path':_0x35d61b[_0x7a85e3(0x119)]},_0x1da33b=await createMenuRecord(_0xbe3ec0,_0x49d69a,'Create\x20menu\x20\x22'+_0x35d61b[_0x7a85e3(0x115)]+'\x22');return logger[_0x7a85e3(0x13c)](_0x7a85e3(0x12b),_0x7a85e3(0x126)+_0x35d61b['label']),_0x1da33b;}export async function createMenus(_0x4359d4,_0x2e0f97,_0x41c4ed,_0x39de5d,_0x376449){const _0x40c8da=a182_0x38b5;logger['info'](_0x40c8da(0x132),_0x40c8da(0x131)+_0x41c4ed['length']);const _0x4b4f7e=await Promise['all'](_0x41c4ed[_0x40c8da(0x12e)](_0x48ea8b=>createSingleMenu(_0x4359d4,_0x2e0f97,_0x48ea8b,_0x39de5d,_0x376449)));return logger[_0x40c8da(0x13c)](_0x40c8da(0x132),_0x40c8da(0x122)+_0x41c4ed[_0x40c8da(0x11c)]),_0x4b4f7e;}export async function updateMenuCdnUrl(_0x4e710a,_0x12a007,_0x4826b5){const _0xb116d9=a182_0x38b5;logger[_0xb116d9(0x13c)](_0xb116d9(0x116),_0xb116d9(0x13e)+_0x4826b5[_0xb116d9(0x115)]+'\x20('+_0x4826b5[_0xb116d9(0x119)]+')');const _0x20aed8={'id':_0x4826b5['id'],'appCode':_0x4e710a,'extend':{..._0x4826b5['extend']??{},..._0x4826b5[_0xb116d9(0x11f)]?{'loadScriptMode':_0x4826b5['loadScriptMode']}:{},'resources':_0x4826b5[_0xb116d9(0x11e)]?JSON[_0xb116d9(0x136)](_0x4826b5[_0xb116d9(0x11e)]):undefined}},_0x3881f0=await updateMenuRecord(_0x20aed8,_0x12a007,'Update\x20menu\x20assets\x20\x22'+_0x4826b5[_0xb116d9(0x115)]+'\x22');return logger[_0xb116d9(0x13c)](_0xb116d9(0x116),_0xb116d9(0x112)+_0x4826b5['label'],undefined),_0x3881f0;}export async function createMenuEntity(_0x246626,_0x309aa0,_0xc9f9){const _0x36290f=a182_0x38b5;return createMenuRecord({'appCode':_0x246626,..._0xc9f9},_0x309aa0,_0x36290f(0x137)+_0xc9f9[_0x36290f(0x115)]+'\x22');}export async function updateMenuEntity(_0x42fa81,_0x1c7357,_0x279020){const _0x50cc6d=a182_0x38b5;return updateMenuRecord({'appCode':_0x42fa81,..._0x279020},_0x1c7357,_0x50cc6d(0x13b)+_0x279020['id']);}export async function batchDeleteMenuEntities(_0x9664b6,_0x19deb5){const _0x1a8b02=a182_0x38b5;return batchDeleteMenuRecords(_0x19deb5,_0x9664b6,'Delete\x20'+_0x19deb5[_0x1a8b02(0x11c)]+'\x20menu'+(_0x19deb5[_0x1a8b02(0x11c)]===0x1?'':'s'));}export async function startMenuRegroup(_0x1b85bb,_0x4d3869){const _0x373b75=a182_0x38b5;return a182_0x422c74(_0x4d3869,_0x1b85bb,_0x373b75(0x123)+_0x4d3869[_0x373b75(0x11a)]['length']+'\x20menu\x20group(s)');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a183_0x4e9c27=a183_0x1014;(function(_0xdfe549,_0x4e2d5b){const _0xf77fe3=a183_0x1014,_0x2baca8=_0xdfe549();while(!![]){try{const _0x4092c0=-parseInt(_0xf77fe3(0x97))/0x1+-parseInt(_0xf77fe3(0xbb))/0x2*(-parseInt(_0xf77fe3(0xab))/0x3)+-parseInt(_0xf77fe3(0x93))/0x4+-parseInt(_0xf77fe3(0xbc))/0x5*(parseInt(_0xf77fe3(0xac))/0x6)+parseInt(_0xf77fe3(0xa4))/0x7*(-parseInt(_0xf77fe3(0x9b))/0x8)+parseInt(_0xf77fe3(0x92))/0x9+parseInt(_0xf77fe3(0xa2))/0xa;if(_0x4092c0===_0x4e2d5b)break;else _0x2baca8['push'](_0x2baca8['shift']());}catch(_0x56a573){_0x2baca8['push'](_0x2baca8['shift']());}}}(a183_0x37ef,0x911a9));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{CliErrors}from'../../../errors.js';function a183_0x1014(_0x57b1e9,_0x2be199){_0x57b1e9=_0x57b1e9-0x90;const _0x37ef70=a183_0x37ef();let _0x1014d2=_0x37ef70[_0x57b1e9];return _0x1014d2;}function a183_0x37ef(){const _0x222eec=['sharedResources','extend','846mzakxr','2938870FChJOM','app','stringify','3522348BySpHv','2122056QyYYpU','\x20must\x20be\x20an\x20array\x20of\x20URLs.','app-name','appCode','328471VnHuFn','subapp.resources','\x20must\x20be\x20a\x20JSON\x20object.','trim','32nvqDlh','\x20contains\x20invalid\x20JSON.','\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.','sharedConfigured','menu','appName','validation','13028210avsILf','isArray','888951GkcipV','resources','--app-name\x20is\x20required.','basename','menu\x20','assets','filter','6063XNHiBq','6TFAqSO','parse','app.extend.assets[','app.extend','loadScriptMode','Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','str','app.extend.assets','length','fallbackDiffers','Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app','message','string'];a183_0x37ef=function(){return _0x222eec;};return a183_0x37ef();}function objectValue(_0x2e072c,_0x32c1f2){const _0x409cd0=a183_0x1014,_0x4c637f=typeof _0x2e072c===_0x409cd0(0xb8)?parseJson(_0x2e072c,_0x32c1f2):_0x2e072c;if(!_0x4c637f||typeof _0x4c637f!=='object'||Array[_0x409cd0(0xa3)](_0x4c637f))throw CliErrors[_0x409cd0(0xa1)](_0x32c1f2+_0x409cd0(0x99));return _0x4c637f;}function parseJson(_0x20d8ce,_0x57d0b8){const _0x5861ca=a183_0x1014;try{return JSON[_0x5861ca(0xad)](_0x20d8ce);}catch{throw CliErrors[_0x5861ca(0xa1)](_0x57d0b8+_0x5861ca(0x9c));}}function resourceList(_0x361a78,_0x5c9521){const _0x433584=a183_0x1014;if(typeof _0x361a78!=='string')throw CliErrors['validation'](_0x5c9521+_0x433584(0x9d));const _0x32c10d=parseJson(_0x361a78,_0x5c9521);if(!Array[_0x433584(0xa3)](_0x32c10d)||_0x32c10d['some'](_0x57c8dc=>typeof _0x57c8dc!==_0x433584(0xb8)))throw CliErrors[_0x433584(0xa1)](_0x5c9521+_0x433584(0x94));return _0x32c10d;}export function buildSubappAssetsStatus(_0x18472c,_0xe8e6e6,_0xff9616){const _0x15bc6d=a183_0x1014,_0x15d825=_0x18472c[_0x15bc6d(0xba)]==null?{}:objectValue(_0x18472c[_0x15bc6d(0xba)],_0x15bc6d(0xaf)),_0xcdd9f8=_0x15d825[_0x15bc6d(0xa9)]==null?[]:typeof _0x15d825[_0x15bc6d(0xa9)]===_0x15bc6d(0xb8)?parseJson(_0x15d825[_0x15bc6d(0xa9)],_0x15bc6d(0xb3)):_0x15d825[_0x15bc6d(0xa9)];if(!Array['isArray'](_0xcdd9f8))throw CliErrors[_0x15bc6d(0xa1)]('app.extend.assets\x20must\x20be\x20an\x20array.');const _0x367ab4=_0xcdd9f8['map']((_0x4e2e33,_0x490de9)=>objectValue(_0x4e2e33,_0x15bc6d(0xae)+_0x490de9+']')),_0x18e536=_0x367ab4[_0x15bc6d(0xaa)](_0x1683be=>_0x1683be[_0x15bc6d(0xa0)]===_0xff9616);if(_0x18e536[_0x15bc6d(0xb4)]>0x1)throw CliErrors['validation']('Duplicate\x20subapp\x20records\x20for\x20'+_0xff9616+'.');const _0x11de69=_0x18e536[0x0],_0x4ab2e7=_0x11de69?.[_0x15bc6d(0xa5)]==null?[]:resourceList(_0x11de69[_0x15bc6d(0xa5)],_0x15bc6d(0x98)),_0x1b4975=_0xe8e6e6[_0x15bc6d(0xaa)](_0x198484=>_0x198484[_0x15bc6d(0xba)]?.[_0x15bc6d(0xa0)]===_0xff9616),_0x1cdbfd=_0x1b4975['map'](_0x518833=>{const _0x5246d2=_0x15bc6d;let _0x2e659b=null,_0x4436eb=null;try{_0x2e659b=_0x518833[_0x5246d2(0xba)]?.['resources']==null?_0x518833['resources']:resourceList(_0x518833[_0x5246d2(0xba)]['resources'],_0x5246d2(0xa8)+_0x518833['id']+'\x20resources');}catch(_0x349c86){_0x4436eb=_0x349c86 instanceof Error?_0x349c86[_0x5246d2(0xb7)]:String(_0x349c86);}const _0x9c1f55=_0x4ab2e7[_0x5246d2(0xb4)]>0x0?_0x5246d2(0x90):_0x5246d2(0x9f),_0x380c7d=_0x9c1f55===_0x5246d2(0x90)?_0x4ab2e7:_0x2e659b;return{'id':_0x518833['id'],'path':_0x518833['path'],'preferredSourceIfSupported':_0x9c1f55,'preferredResourcesIfSupported':_0x380c7d,'menuFallbackResources':_0x2e659b,'menuFallbackError':_0x4436eb,'fallbackDiffers':_0x2e659b===null?null:_0x9c1f55==='app'&&_0x2e659b['length']>0x0&&JSON['stringify'](_0x2e659b)!==JSON[_0x5246d2(0x91)](_0x380c7d)};});return{'appName':_0xff9616,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x11de69),'sharedResources':_0x4ab2e7,'loadScriptMode':_0x11de69?.[_0x15bc6d(0xb0)]??null,'basename':_0x11de69?.[_0x15bc6d(0xa7)]??null,'boundMenus':_0x1cdbfd[_0x15bc6d(0xb4)],'staleMenuFallbacks':_0x1cdbfd[_0x15bc6d(0xaa)](_0x361342=>_0x361342[_0x15bc6d(0xb5)])[_0x15bc6d(0xb4)],'menus':_0x1cdbfd};}export async function assertSharedResourcesConfigured(_0x25d534,_0x2347fa,_0x3f4eab){const _0x8f08b3=a183_0x1014,_0x2e4aee=await getSmartAppRecord(_0x25d534,_0x2347fa),_0x3fe709=buildSubappAssetsStatus(_0x2e4aee,[],_0x3f4eab);if(!_0x3fe709[_0x8f08b3(0x9e)]||_0x3fe709[_0x8f08b3(0xb9)][_0x8f08b3(0xb4)]===0x0)throw CliErrors['validation']('No\x20shared\x20resources\x20configured\x20for\x20'+_0x3f4eab+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':a183_0x4e9c27(0xb6)},{'name':a183_0x4e9c27(0x95),'type':'string','required':!![],'description':a183_0x4e9c27(0xb1)}];export function getSubappSelector(_0x2f28f4){const _0x44e3ef=a183_0x4e9c27,_0x2fc0b9=_0x2f28f4[_0x44e3ef(0x96)],_0x23d989=_0x2f28f4[_0x44e3ef(0xb2)](_0x44e3ef(0x95))[_0x44e3ef(0x9a)]();if(!_0x23d989)throw CliErrors['validation'](_0x44e3ef(0xa6));return{'appCode':_0x2fc0b9,'appName':_0x23d989};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a184_0x18c720=a184_0x20bc;(function(_0x1b7c9d,_0x41fda3){const _0x306059=a184_0x20bc,_0x123306=_0x1b7c9d();while(!![]){try{const _0x47065c=parseInt(_0x306059(0x12b))/0x1*(parseInt(_0x306059(0xfd))/0x2)+-parseInt(_0x306059(0x113))/0x3+parseInt(_0x306059(0xf4))/0x4+parseInt(_0x306059(0x12c))/0x5*(parseInt(_0x306059(0xfe))/0x6)+-parseInt(_0x306059(0x112))/0x7*(-parseInt(_0x306059(0x11a))/0x8)+parseInt(_0x306059(0x10d))/0x9+-parseInt(_0x306059(0xf5))/0xa*(parseInt(_0x306059(0x111))/0xb);if(_0x47065c===_0x41fda3)break;else _0x123306['push'](_0x123306['shift']());}catch(_0x48193c){_0x123306['push'](_0x123306['shift']());}}}(a184_0x4bab,0x497cd));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a184_0x4bab(){const _0x4b8e42=['procode','cssUrl','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','boolean','menu-sync','type','1991574ueciax','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','parse','get','11FdNZZS','2044497tIwsMt','1528188oAbtQT','\x22\x20for\x20','import','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.',';\x20found\x20',':\x20expected\x20a\x20non-empty\x20string.','16KOAMQQ','path','dryRun','isInteger','parentId','string','appName','CSS\x20URL\x20is\x20unreachable:\x20','message','info','Invalid\x20--params\x20JSON.','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','filter','trim','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','JS\x20URL\x20is\x20unreachable:\x20','group','1iOLhdU','565GcXqoU','length','Menu\x20sync\x20completed','visible','\x0a\x20\x20Available\x20local\x20paths:\x20','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','label','Parent\x20','--params.','158228EKPXmK','7183420pGzYVf','Invalid\x20--params.','push','number','Start\x20non-interactive\x20menu\x20sync','jsUrl','has','cwd','950998WlbMqC','11058sdMTgq','object','join','order','Invalid\x20--params:\x20','setLogPath','map','folder','No\x20local\x20pages\x20matched\x20paths:\x20'];a184_0x4bab=function(){return _0x4b8e42;};return a184_0x4bab();}import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set(['jsUrl',a184_0x18c720(0x108),'appName','visible','parentId']);function a184_0x20bc(_0x23b46e,_0x2db681){_0x23b46e=_0x23b46e-0xed;const _0x4bab3a=a184_0x4bab();let _0x20bc6b=_0x4bab3a[_0x23b46e];return _0x20bc6b;}export function resolvePage(_0x1e8302,_0x20e69a,_0x84e68c){const _0xea8ac5=a184_0x18c720;let _0x14eba1=_0x20e69a[_0xea8ac5(0x11e)]??_0x1e8302['parentId'];if(_0x14eba1===undefined&&_0x1e8302['group']){const _0x40e5e9=_0x84e68c['filter'](_0x347cc9=>_0x347cc9[_0xea8ac5(0x10c)]==='folder'&&_0x347cc9[_0xea8ac5(0xf1)]===_0x1e8302['group']);if(_0x40e5e9['length']!==0x1)throw new Error('Expected\x20one\x20folder\x20named\x20\x22'+_0x1e8302[_0xea8ac5(0x12a)]+_0xea8ac5(0x114)+_0x1e8302[_0xea8ac5(0x11b)]+_0xea8ac5(0x118)+_0x40e5e9[_0xea8ac5(0x12d)]);_0x14eba1=_0x40e5e9[0x0]['id'];}if(_0x14eba1!==undefined&&_0x14eba1!==0x0&&_0x84e68c[_0xea8ac5(0x126)](_0x4af118=>_0x4af118['id']===_0x14eba1&&_0x4af118['type']===_0xea8ac5(0x105))[_0xea8ac5(0x12d)]!==0x1)throw new Error(_0xea8ac5(0xf2)+_0x14eba1+_0xea8ac5(0x117));return{..._0x1e8302,..._0x14eba1===undefined?{}:{'parentId':_0x14eba1},..._0x20e69a[_0xea8ac5(0xee)]===undefined?{}:{'visible':_0x20e69a[_0xea8ac5(0xee)]}};}function validateParams(_0x5efb18){const _0x119221=a184_0x18c720,_0x4095be=[];return _0x5efb18[_0x119221(0xfa)]&&!isValidJsHttpsUrl(_0x5efb18['jsUrl'])&&_0x4095be[_0x119221(0xf7)]({'field':_0x119221(0xfa),'message':_0x119221(0x10e)}),_0x5efb18[_0x119221(0x108)]&&!isValidCssHttpsUrl(_0x5efb18[_0x119221(0x108)])&&_0x4095be['push']({'field':_0x119221(0x108),'message':_0x119221(0x128)}),_0x4095be;}export async function runMenuSyncCore(_0x488e10,_0x2697a0,_0x8fcd8=[],_0xaa0f79,_0x4e4c04={}){const _0x1476ff=a184_0x18c720,_0xfafec=parseMenuSyncParams(_0xaa0f79),_0x1d9d9b=[...new Set(_0x8fcd8[_0x1476ff(0x104)](_0x17cbba=>_0x17cbba['trim']())[_0x1476ff(0x126)](Boolean)[_0x1476ff(0x104)](menuPathKey))],_0x2712da=_0xfafec[_0x1476ff(0xfa)],_0x21ded7=_0xfafec['cssUrl'],_0x5aead3=[];if(_0x2712da)_0x5aead3[_0x1476ff(0xf7)](_0x2712da);if(_0x21ded7)_0x5aead3['push'](_0x21ded7);const _0x2de3c9=validateParams(_0xfafec);if(_0x2de3c9[_0x1476ff(0x12d)]>0x0){const _0x1843e5=_0x2de3c9['map'](_0x18d58b=>_0x1476ff(0xf3)+_0x18d58b['field']+':\x20'+_0x18d58b[_0x1476ff(0x122)])[_0x1476ff(0x100)](';\x20');throw new Error(_0x1476ff(0x102)+_0x1843e5);}logger[_0x1476ff(0x103)](process[_0x1476ff(0xfc)]()),logger['info'](_0x1476ff(0x10b),_0x1476ff(0xf9),{'appCode':_0x488e10,'selectedCount':_0x1d9d9b[_0x1476ff(0x12d)],'jsUrl':_0x2712da,'cssUrl':_0x21ded7});if(_0x2712da){const _0x59d798=await isUrlReachable(_0x2712da);if(!_0x59d798)throw new Error(_0x1476ff(0x129)+_0x2712da);}if(_0x21ded7){const _0x3993f1=await isUrlReachable(_0x21ded7);if(!_0x3993f1)throw new Error(_0x1476ff(0x121)+_0x21ded7);}const _0x35c073=getLocalPages();if(_0x35c073[_0x1476ff(0x12d)]===0x0){if(_0x1d9d9b[_0x1476ff(0x12d)]>0x0)throw new Error(_0x1476ff(0x106)+_0x1d9d9b[_0x1476ff(0x100)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x4e4c04[_0x1476ff(0x11c)]===!![],'targetPages':[],'plannedMenus':[]};}const _0xbcfeb3=await getOnlineMenuList(_0x488e10,_0x2697a0),_0x28846b=new Set(_0xbcfeb3[_0x1476ff(0x104)](_0xaa69a7=>menuPathKey(_0xaa69a7[_0x1476ff(0x11b)])));let _0x102dfd;if(_0x1d9d9b['length']>0x0){const _0x578122=new Map(_0x35c073[_0x1476ff(0x104)](_0x1e6f47=>[menuPathKey(_0x1e6f47[_0x1476ff(0x11b)]),_0x1e6f47])),_0x23e308=_0x1d9d9b[_0x1476ff(0x126)](_0x12b2e6=>!_0x578122[_0x1476ff(0xfb)](_0x12b2e6));if(_0x23e308['length']>0x0){const _0xd06f87=_0x35c073['map'](_0x12a440=>_0x12a440[_0x1476ff(0x11b)])[_0x1476ff(0x100)](',\x20');throw new Error(_0x1476ff(0x106)+_0x23e308[_0x1476ff(0x100)](',\x20')+_0x1476ff(0xef)+_0xd06f87);}const _0x497db6=_0x1d9d9b[_0x1476ff(0x126)](_0x2381ed=>_0x28846b[_0x1476ff(0xfb)](_0x2381ed));if(_0x497db6['length']>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0x497db6[_0x1476ff(0x100)](',\x20'));_0x102dfd=_0x1d9d9b['map'](_0xce16f6=>_0x578122[_0x1476ff(0x110)](_0xce16f6));}else _0x102dfd=_0x35c073[_0x1476ff(0x126)](_0x173871=>!_0x28846b['has'](menuPathKey(_0x173871['path'])));if(_0x102dfd[_0x1476ff(0x12d)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x4e4c04[_0x1476ff(0x11c)]===!![],'targetPages':[],'plannedMenus':[]};_0x102dfd=_0x102dfd[_0x1476ff(0x104)](_0x1b812e=>resolvePage(_0x1b812e,_0xfafec,_0xbcfeb3));_0xfafec[_0x1476ff(0x120)]&&_0x5aead3[_0x1476ff(0x12d)]===0x0&&await assertSharedResourcesConfigured(_0x488e10,_0x2697a0,_0xfafec[_0x1476ff(0x120)]);const _0x160c8f=_0x102dfd[_0x1476ff(0x104)](_0x58325f=>({'type':_0x1476ff(0x107),'path':_0x58325f[_0x1476ff(0x11b)],'label':_0x58325f['label'],'loadScriptMode':_0x1476ff(0x115),'resources':[..._0x5aead3],..._0x58325f[_0x1476ff(0xee)]===undefined?{}:{'visible':_0x58325f[_0x1476ff(0xee)]},..._0x58325f[_0x1476ff(0x11e)]===undefined?{}:{'parentId':_0x58325f[_0x1476ff(0x11e)]},..._0x58325f[_0x1476ff(0x101)]===undefined?{}:{'sort':_0x58325f[_0x1476ff(0x101)]},..._0xfafec[_0x1476ff(0x120)]===undefined?{}:{'appName':_0xfafec['appName']}}));if(_0x4e4c04[_0x1476ff(0x11c)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x102dfd,'plannedMenus':_0x160c8f};const _0x56a20d=_0xfafec[_0x1476ff(0x120)]?await createMenus(_0x488e10,_0x2697a0,_0x102dfd,_0x5aead3[_0x1476ff(0x12d)]>0x0?_0x5aead3:undefined,{'appName':_0xfafec[_0x1476ff(0x120)]}):await createMenus(_0x488e10,_0x2697a0,_0x102dfd,_0x5aead3[_0x1476ff(0x12d)]>0x0?_0x5aead3:undefined);return logger[_0x1476ff(0x123)](_0x1476ff(0x10b),_0x1476ff(0xed),{'count':_0x102dfd['length'],'resources':_0x5aead3}),{'created':_0x56a20d[_0x1476ff(0x12d)],'skipped':![],'dryRun':![],'targetPages':_0x102dfd,'plannedMenus':_0x160c8f,'menus':_0x56a20d};}export function parseMenuSyncParams(_0x4082ee){const _0x1d8354=a184_0x18c720;if(!_0x4082ee||typeof _0x4082ee!==_0x1d8354(0x11f))return{};let _0x2758dc;try{_0x2758dc=JSON[_0x1d8354(0x10f)](_0x4082ee);}catch{throw new Error(_0x1d8354(0x124));}if(typeof _0x2758dc!==_0x1d8354(0xff)||_0x2758dc===null||Array['isArray'](_0x2758dc))throw new Error(_0x1d8354(0x109));const _0x41e1bd=_0x2758dc;if(Object['hasOwn'](_0x41e1bd,'pages'))throw new Error(_0x1d8354(0x116));const _0x3979e5=Object['keys'](_0x41e1bd)[_0x1d8354(0x126)](_0x22d339=>!MENU_SYNC_PARAM_KEYS[_0x1d8354(0xfb)](_0x22d339));if(_0x3979e5[_0x1d8354(0x12d)]>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x3979e5[_0x1d8354(0x100)](',\x20')+'.');for(const _0xb137bd of[_0x1d8354(0xfa),_0x1d8354(0x108),_0x1d8354(0x120)]){const _0x886257=_0x41e1bd[_0xb137bd];if(_0x886257!==undefined&&(typeof _0x886257!==_0x1d8354(0x11f)||_0x886257['trim']()===''))throw new Error(_0x1d8354(0xf6)+_0xb137bd+_0x1d8354(0x119));}if(_0x41e1bd['visible']!==undefined&&typeof _0x41e1bd[_0x1d8354(0xee)]!==_0x1d8354(0x10a))throw new Error(_0x1d8354(0xf0));if(_0x41e1bd[_0x1d8354(0x11e)]!==undefined&&(!Number[_0x1d8354(0x11d)](_0x41e1bd[_0x1d8354(0x11e)])||_0x41e1bd[_0x1d8354(0x11e)]<0x0))throw new Error(_0x1d8354(0x125));return{'jsUrl':typeof _0x41e1bd[_0x1d8354(0xfa)]===_0x1d8354(0x11f)?_0x41e1bd[_0x1d8354(0xfa)][_0x1d8354(0x127)]():undefined,'cssUrl':typeof _0x41e1bd[_0x1d8354(0x108)]===_0x1d8354(0x11f)?_0x41e1bd[_0x1d8354(0x108)][_0x1d8354(0x127)]():undefined,'appName':typeof _0x41e1bd[_0x1d8354(0x120)]===_0x1d8354(0x11f)?_0x41e1bd[_0x1d8354(0x120)][_0x1d8354(0x127)]():undefined,'visible':typeof _0x41e1bd[_0x1d8354(0xee)]==='boolean'?_0x41e1bd[_0x1d8354(0xee)]:undefined,'parentId':typeof _0x41e1bd[_0x1d8354(0x11e)]===_0x1d8354(0xf8)?_0x41e1bd['parentId']:undefined};}
|
|
1
|
+
const a184_0x51da87=a184_0x5e4c;(function(_0x5dfb9d,_0x3d2312){const _0x56543c=a184_0x5e4c,_0x2f0d9f=_0x5dfb9d();while(!![]){try{const _0x111f59=-parseInt(_0x56543c(0x13c))/0x1*(parseInt(_0x56543c(0x112))/0x2)+-parseInt(_0x56543c(0x106))/0x3+parseInt(_0x56543c(0x124))/0x4+-parseInt(_0x56543c(0x12c))/0x5+parseInt(_0x56543c(0x12d))/0x6+-parseInt(_0x56543c(0x138))/0x7+parseInt(_0x56543c(0x102))/0x8;if(_0x111f59===_0x3d2312)break;else _0x2f0d9f['push'](_0x2f0d9f['shift']());}catch(_0x308a14){_0x2f0d9f['push'](_0x2f0d9f['shift']());}}}(a184_0xf385,0x192c5));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a184_0x5e4c(_0xb8f0f7,_0x4f84fb){_0xb8f0f7=_0xb8f0f7-0x102;const _0xf38584=a184_0xf385();let _0x5e4c8b=_0xf38584[_0xb8f0f7];return _0x5e4c8b;}import{menuPathKey}from'../../../commands/menu/shared/path.js';function a184_0xf385(){const _0x52bd23=['251130meuBJh','98262QgFIxm','Invalid\x20--params:\x20','folder','visible','--params.','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','cwd','join','filter','path','Invalid\x20--params\x20JSON.','1018143cRyTbG',':\x20expected\x20a\x20non-empty\x20string.','appName','parse','2976WATMlQ','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','jsUrl','group','1661296HUNGHB',';\x20found\x20','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','map','27099aRDuvk','cssUrl','Invalid\x20--params\x20fields:\x20','Start\x20non-interactive\x20menu\x20sync','Invalid\x20--params.','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','push','trim','Parent\x20','parentId','pages','isInteger','8SuKjGY','JS\x20URL\x20is\x20unreachable:\x20','label','keys','setLogPath','type','Menu\x20sync\x20completed','hasOwn','dryRun','Expected\x20one\x20folder\x20named\x20\x22','length','import','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','string','has','CSS\x20URL\x20is\x20unreachable:\x20','menu-sync','message','382728zUsFpj','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','isArray','\x22\x20for\x20','order','\x0a\x20\x20Available\x20local\x20paths:\x20','procode'];a184_0xf385=function(){return _0x52bd23;};return a184_0xf385();}import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set([a184_0x51da87(0x13e),a184_0x51da87(0x107),a184_0x51da87(0x13a),a184_0x51da87(0x130),a184_0x51da87(0x10f)]);export function resolvePage(_0x26eee4,_0x4560cc,_0x51ff07){const _0x5dc9fa=a184_0x51da87;let _0x5441a6=_0x4560cc[_0x5dc9fa(0x10f)]??_0x26eee4[_0x5dc9fa(0x10f)];if(_0x5441a6===undefined&&_0x26eee4[_0x5dc9fa(0x13f)]){const _0x1ce2f6=_0x51ff07[_0x5dc9fa(0x135)](_0x502b98=>_0x502b98[_0x5dc9fa(0x117)]===_0x5dc9fa(0x12f)&&_0x502b98[_0x5dc9fa(0x114)]===_0x26eee4[_0x5dc9fa(0x13f)]);if(_0x1ce2f6['length']!==0x1)throw new Error(_0x5dc9fa(0x11b)+_0x26eee4[_0x5dc9fa(0x13f)]+_0x5dc9fa(0x128)+_0x26eee4['path']+_0x5dc9fa(0x103)+_0x1ce2f6[_0x5dc9fa(0x11c)]);_0x5441a6=_0x1ce2f6[0x0]['id'];}if(_0x5441a6!==undefined&&_0x5441a6!==0x0&&_0x51ff07[_0x5dc9fa(0x135)](_0x4d32d7=>_0x4d32d7['id']===_0x5441a6&&_0x4d32d7[_0x5dc9fa(0x117)]===_0x5dc9fa(0x12f))[_0x5dc9fa(0x11c)]!==0x1)throw new Error(_0x5dc9fa(0x10e)+_0x5441a6+_0x5dc9fa(0x132));return{..._0x26eee4,..._0x5441a6===undefined?{}:{'parentId':_0x5441a6},..._0x4560cc[_0x5dc9fa(0x130)]===undefined?{}:{'visible':_0x4560cc['visible']}};}function validateParams(_0x45e227){const _0x5b9740=a184_0x51da87,_0x449949=[];return _0x45e227['jsUrl']&&!isValidJsHttpsUrl(_0x45e227[_0x5b9740(0x13e)])&&_0x449949[_0x5b9740(0x10c)]({'field':'jsUrl','message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x45e227[_0x5b9740(0x107)]&&!isValidCssHttpsUrl(_0x45e227[_0x5b9740(0x107)])&&_0x449949[_0x5b9740(0x10c)]({'field':_0x5b9740(0x107),'message':_0x5b9740(0x11e)}),_0x449949;}export async function runMenuSyncCore(_0x1fc77c,_0xb924de,_0x41036c=[],_0x5c8500,_0x52910d={}){const _0x4f84e6=a184_0x51da87,_0x174ed6=parseMenuSyncParams(_0x5c8500),_0x7350f8=[...new Set(_0x41036c[_0x4f84e6(0x105)](_0x13a98e=>_0x13a98e['trim']())[_0x4f84e6(0x135)](Boolean)[_0x4f84e6(0x105)](menuPathKey))],_0xc9fa39=_0x174ed6[_0x4f84e6(0x13e)],_0x1a2e3d=_0x174ed6[_0x4f84e6(0x107)],_0x30c9e3=[];if(_0xc9fa39)_0x30c9e3[_0x4f84e6(0x10c)](_0xc9fa39);if(_0x1a2e3d)_0x30c9e3[_0x4f84e6(0x10c)](_0x1a2e3d);const _0x531b9e=validateParams(_0x174ed6);if(_0x531b9e[_0x4f84e6(0x11c)]>0x0){const _0x2da98a=_0x531b9e['map'](_0x5a2222=>_0x4f84e6(0x131)+_0x5a2222['field']+':\x20'+_0x5a2222[_0x4f84e6(0x123)])['join'](';\x20');throw new Error(_0x4f84e6(0x12e)+_0x2da98a);}logger[_0x4f84e6(0x116)](process[_0x4f84e6(0x133)]()),logger['info'](_0x4f84e6(0x122),_0x4f84e6(0x109),{'appCode':_0x1fc77c,'selectedCount':_0x7350f8[_0x4f84e6(0x11c)],'jsUrl':_0xc9fa39,'cssUrl':_0x1a2e3d});if(_0xc9fa39){const _0xa81e72=await isUrlReachable(_0xc9fa39);if(!_0xa81e72)throw new Error(_0x4f84e6(0x113)+_0xc9fa39);}if(_0x1a2e3d){const _0x4fadb1=await isUrlReachable(_0x1a2e3d);if(!_0x4fadb1)throw new Error(_0x4f84e6(0x121)+_0x1a2e3d);}const _0x2b1dbf=getLocalPages();if(_0x2b1dbf['length']===0x0){if(_0x7350f8[_0x4f84e6(0x11c)]>0x0)throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x7350f8[_0x4f84e6(0x134)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x52910d[_0x4f84e6(0x11a)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x59f480=await getOnlineMenuList(_0x1fc77c,_0xb924de),_0x183a10=new Set(_0x59f480[_0x4f84e6(0x105)](_0x392f11=>menuPathKey(_0x392f11[_0x4f84e6(0x136)])));let _0x2f114f;if(_0x7350f8[_0x4f84e6(0x11c)]>0x0){const _0x8f97c1=new Map(_0x2b1dbf['map'](_0x3abaaa=>[menuPathKey(_0x3abaaa[_0x4f84e6(0x136)]),_0x3abaaa])),_0x5f4319=_0x7350f8[_0x4f84e6(0x135)](_0x5b3d61=>!_0x8f97c1[_0x4f84e6(0x120)](_0x5b3d61));if(_0x5f4319['length']>0x0){const _0x2a2a20=_0x2b1dbf[_0x4f84e6(0x105)](_0x2326ba=>_0x2326ba[_0x4f84e6(0x136)])['join'](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x5f4319['join'](',\x20')+_0x4f84e6(0x12a)+_0x2a2a20);}const _0x4a823d=_0x7350f8[_0x4f84e6(0x135)](_0x335e34=>_0x183a10[_0x4f84e6(0x120)](_0x335e34));if(_0x4a823d[_0x4f84e6(0x11c)]>0x0)throw new Error(_0x4f84e6(0x125)+_0x4a823d[_0x4f84e6(0x134)](',\x20'));_0x2f114f=_0x7350f8[_0x4f84e6(0x105)](_0x337fb4=>_0x8f97c1['get'](_0x337fb4));}else _0x2f114f=_0x2b1dbf[_0x4f84e6(0x135)](_0x4bc18f=>!_0x183a10[_0x4f84e6(0x120)](menuPathKey(_0x4bc18f[_0x4f84e6(0x136)])));if(_0x2f114f[_0x4f84e6(0x11c)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x52910d['dryRun']===!![],'targetPages':[],'plannedMenus':[]};_0x2f114f=_0x2f114f[_0x4f84e6(0x105)](_0x3abf06=>resolvePage(_0x3abf06,_0x174ed6,_0x59f480));_0x174ed6[_0x4f84e6(0x13a)]&&_0x30c9e3[_0x4f84e6(0x11c)]===0x0&&await assertSharedResourcesConfigured(_0x1fc77c,_0xb924de,_0x174ed6[_0x4f84e6(0x13a)]);const _0x366b24=_0x2f114f[_0x4f84e6(0x105)](_0x27633f=>({'type':_0x4f84e6(0x12b),'path':_0x27633f[_0x4f84e6(0x136)],'label':_0x27633f[_0x4f84e6(0x114)],'loadScriptMode':_0x4f84e6(0x11d),'resources':[..._0x30c9e3],..._0x27633f[_0x4f84e6(0x130)]===undefined?{}:{'visible':_0x27633f[_0x4f84e6(0x130)]},..._0x27633f['parentId']===undefined?{}:{'parentId':_0x27633f[_0x4f84e6(0x10f)]},..._0x27633f[_0x4f84e6(0x129)]===undefined?{}:{'sort':_0x27633f[_0x4f84e6(0x129)]},..._0x174ed6['appName']===undefined?{}:{'appName':_0x174ed6[_0x4f84e6(0x13a)]}}));if(_0x52910d['dryRun'])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x2f114f,'plannedMenus':_0x366b24};const _0x213bb5=_0x174ed6[_0x4f84e6(0x13a)]?await createMenus(_0x1fc77c,_0xb924de,_0x2f114f,_0x30c9e3[_0x4f84e6(0x11c)]>0x0?_0x30c9e3:undefined,{'appName':_0x174ed6['appName']}):await createMenus(_0x1fc77c,_0xb924de,_0x2f114f,_0x30c9e3[_0x4f84e6(0x11c)]>0x0?_0x30c9e3:undefined);return logger['info'](_0x4f84e6(0x122),_0x4f84e6(0x118),{'count':_0x2f114f['length'],'resources':_0x30c9e3}),{'created':_0x213bb5[_0x4f84e6(0x11c)],'skipped':![],'dryRun':![],'targetPages':_0x2f114f,'plannedMenus':_0x366b24,'menus':_0x213bb5};}export function parseMenuSyncParams(_0x3c4196){const _0x470844=a184_0x51da87;if(!_0x3c4196||typeof _0x3c4196!=='string')return{};let _0x16d82f;try{_0x16d82f=JSON[_0x470844(0x13b)](_0x3c4196);}catch{throw new Error(_0x470844(0x137));}if(typeof _0x16d82f!=='object'||_0x16d82f===null||Array[_0x470844(0x127)](_0x16d82f))throw new Error(_0x470844(0x126));const _0x45ca96=_0x16d82f;if(Object[_0x470844(0x119)](_0x45ca96,_0x470844(0x110)))throw new Error(_0x470844(0x13d));const _0x4fe240=Object[_0x470844(0x115)](_0x45ca96)[_0x470844(0x135)](_0x20cdb5=>!MENU_SYNC_PARAM_KEYS[_0x470844(0x120)](_0x20cdb5));if(_0x4fe240[_0x470844(0x11c)]>0x0)throw new Error(_0x470844(0x108)+_0x4fe240[_0x470844(0x134)](',\x20')+'.');for(const _0x24611b of[_0x470844(0x13e),_0x470844(0x107),_0x470844(0x13a)]){const _0x1639a3=_0x45ca96[_0x24611b];if(_0x1639a3!==undefined&&(typeof _0x1639a3!==_0x470844(0x11f)||_0x1639a3[_0x470844(0x10d)]()===''))throw new Error(_0x470844(0x10a)+_0x24611b+_0x470844(0x139));}if(_0x45ca96[_0x470844(0x130)]!==undefined&&typeof _0x45ca96[_0x470844(0x130)]!=='boolean')throw new Error(_0x470844(0x104));if(_0x45ca96[_0x470844(0x10f)]!==undefined&&(!Number[_0x470844(0x111)](_0x45ca96[_0x470844(0x10f)])||_0x45ca96[_0x470844(0x10f)]<0x0))throw new Error(_0x470844(0x10b));return{'jsUrl':typeof _0x45ca96[_0x470844(0x13e)]==='string'?_0x45ca96['jsUrl'][_0x470844(0x10d)]():undefined,'cssUrl':typeof _0x45ca96[_0x470844(0x107)]===_0x470844(0x11f)?_0x45ca96[_0x470844(0x107)]['trim']():undefined,'appName':typeof _0x45ca96[_0x470844(0x13a)]===_0x470844(0x11f)?_0x45ca96[_0x470844(0x13a)]['trim']():undefined,'visible':typeof _0x45ca96[_0x470844(0x130)]==='boolean'?_0x45ca96[_0x470844(0x130)]:undefined,'parentId':typeof _0x45ca96[_0x470844(0x10f)]==='number'?_0x45ca96['parentId']:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x730652,_0x4f315d){const _0x383ca0=a186_0x86ea,_0x575243=_0x730652();while(!![]){try{const _0x30aed9=-parseInt(_0x383ca0(0xd3))/0x1*(-parseInt(_0x383ca0(0xbd))/0x2)+parseInt(_0x383ca0(0xcf))/0x3+-parseInt(_0x383ca0(0xc8))/0x4+-parseInt(_0x383ca0(0xa5))/0x5*(parseInt(_0x383ca0(0xe9))/0x6)+-parseInt(_0x383ca0(0xed))/0x7*(-parseInt(_0x383ca0(0xc7))/0x8)+parseInt(_0x383ca0(0xca))/0x9*(parseInt(_0x383ca0(0xc9))/0xa)+-parseInt(_0x383ca0(0xaf))/0xb*(parseInt(_0x383ca0(0xeb))/0xc);if(_0x30aed9===_0x4f315d)break;else _0x575243['push'](_0x575243['shift']());}catch(_0x286f53){_0x575243['push'](_0x575243['shift']());}}}(a186_0x4592,0xeb3fc));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(_0x202883){const _0x51830f=a186_0x86ea,_0x2d8115=[];return _0x202883[_0x51830f(0xe4)]&&!isValidJsHttpsUrl(_0x202883[_0x51830f(0xe4)])&&_0x2d8115[_0x51830f(0xe6)]({'field':_0x51830f(0xe4),'message':_0x51830f(0xd4)}),_0x202883[_0x51830f(0xde)]&&!isValidCssHttpsUrl(_0x202883[_0x51830f(0xde)])&&_0x2d8115[_0x51830f(0xe6)]({'field':_0x51830f(0xde),'message':_0x51830f(0xce)}),_0x2d8115;}export async function runMenuUpdateCore(_0x463044,_0x5ab627,_0x20838e,_0x1f31f8={}){const _0x28b73d=a186_0x86ea,_0x8ff921=parseUpdateParamsFlag(_0x20838e),_0x15883b=normalizeMode(_0x1f31f8[_0x28b73d(0xc4)]);validateSelection(_0x1f31f8[_0x28b73d(0xad)]);const _0x5f262f=[];if(_0x8ff921['jsUrl'])_0x5f262f[_0x28b73d(0xe6)](_0x8ff921[_0x28b73d(0xe4)]);if(_0x8ff921[_0x28b73d(0xde)])_0x5f262f[_0x28b73d(0xe6)](_0x8ff921[_0x28b73d(0xde)]);const _0xe2e0e4=validateParams(_0x8ff921);if(_0xe2e0e4[_0x28b73d(0xb7)]>0x0){const _0x569504=_0xe2e0e4[_0x28b73d(0xb6)](_0x28974a=>_0x28b73d(0xc0)+_0x28974a[_0x28b73d(0xab)]+':\x20'+_0x28974a[_0x28b73d(0xe5)])[_0x28b73d(0xdf)](';\x20');throw new Error(_0x28b73d(0xa3)+_0x569504);}if(_0x5f262f[_0x28b73d(0xb7)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x28b73d(0xec)](process[_0x28b73d(0xf0)]()),logger['info'](_0x28b73d(0xf1),_0x28b73d(0xd5),{'appCode':_0x463044,'jsUrl':_0x8ff921[_0x28b73d(0xe4)],'cssUrl':_0x8ff921[_0x28b73d(0xde)],'mode':_0x15883b,'dryRun':_0x1f31f8[_0x28b73d(0xcb)]===!![]});if(_0x8ff921['jsUrl']){const _0xe750d0=await isUrlReachable(_0x8ff921[_0x28b73d(0xe4)]);if(!_0xe750d0)throw new Error(_0x28b73d(0xa9)+_0x8ff921['jsUrl']);}if(_0x8ff921[_0x28b73d(0xde)]){const _0x277dde=await isUrlReachable(_0x8ff921[_0x28b73d(0xde)]);if(!_0x277dde)throw new Error(_0x28b73d(0xdc)+_0x8ff921['cssUrl']);}const _0x53795b=await getOnlineMenuList(_0x463044,_0x5ab627),_0x286180=_0x53795b['filter'](_0x26331a=>_0x26331a[_0x28b73d(0xd1)][_0x28b73d(0xb7)]>0x0),_0x29a01d=selectMenusForUpdate(_0x286180,_0x1f31f8[_0x28b73d(0xad)]);if(_0x29a01d['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x1f31f8[_0x28b73d(0xcb)]===!![]};const _0x2bd7f1=_0x29a01d[_0x28b73d(0xb6)](_0x93760c=>buildMenuUpdateDiff(_0x93760c,_0x8ff921,_0x15883b,_0x1f31f8[_0x28b73d(0xba)]===!![],_0x1f31f8['loadScriptMode']));if(_0x1f31f8[_0x28b73d(0xcb)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x2bd7f1};const _0x29c04f=await Promise[_0x28b73d(0xb1)](_0x29a01d[_0x28b73d(0xb6)]((_0x31a241,_0x240cbb)=>updateMenuCdnUrl(_0x463044,_0x5ab627,{'id':_0x31a241['id'],'label':_0x31a241[_0x28b73d(0xda)],'path':_0x31a241['path'],'resources':_0x2bd7f1[_0x240cbb]['after'][_0x28b73d(0xd1)],'extend':_0x31a241[_0x28b73d(0xd7)]??null,'loadScriptMode':_0x1f31f8['loadScriptMode']}))),_0x31ac05=_0x29c04f[_0x28b73d(0xd0)](_0x2bf8df=>_0x2bf8df[_0x28b73d(0xc5)]===_0x28b73d(0xee))[_0x28b73d(0xb6)](_0x581dcd=>_0x581dcd[_0x28b73d(0xb4)]),_0x5cd9d5=_0x29c04f[_0x28b73d(0xd0)](_0x3f852b=>_0x3f852b[_0x28b73d(0xc5)]===_0x28b73d(0xb5))[_0x28b73d(0xb7)];return logger[_0x28b73d(0xef)](_0x28b73d(0xf1),_0x28b73d(0xd2),{'count':_0x29a01d[_0x28b73d(0xb7)],'resources':_0x5f262f}),{'updated':_0x31ac05[_0x28b73d(0xb7)],'failed':_0x5cd9d5,'skipped':![],'menus':_0x31ac05};}function validateSelection(_0x5199fc){const _0x40af56=a186_0x86ea;if(!_0x5199fc)throw new Error(_0x40af56(0xc2));if(_0x5199fc[_0x40af56(0xe1)]&&(_0x5199fc['menuIds'][_0x40af56(0xb7)]>0x0||_0x5199fc['paths'][_0x40af56(0xb7)]>0x0))throw new Error(_0x40af56(0xe0));if(!_0x5199fc[_0x40af56(0xe1)]&&_0x5199fc[_0x40af56(0xc6)][_0x40af56(0xb7)]===0x0&&_0x5199fc['paths']['length']===0x0)throw new Error(_0x40af56(0xc2));}function a186_0x86ea(_0x5ae814,_0x5963b9){_0x5ae814=_0x5ae814-0xa3;const _0x459285=a186_0x4592();let _0x86ea8=_0x459285[_0x5ae814];return _0x86ea8;}export function selectMenusForUpdate(_0x9a40c7,_0x15ac5f){const _0xf9c769=a186_0x86ea;validateSelection(_0x15ac5f);if(_0x15ac5f[_0xf9c769(0xe1)])return _0x9a40c7;const _0x537a82=new Set(_0x9a40c7[_0xf9c769(0xb6)](_0x3855e6=>_0x3855e6['id'])),_0x5d928a=new Set(_0x9a40c7['map'](_0x4bf895=>_0x4bf895[_0xf9c769(0xcc)])),_0x2645c5=_0x15ac5f[_0xf9c769(0xc6)][_0xf9c769(0xd0)](_0xdb8ba7=>!_0x537a82['has'](_0xdb8ba7)),_0x41e701=_0x15ac5f[_0xf9c769(0xd8)][_0xf9c769(0xd0)](_0x4357f5=>!_0x5d928a[_0xf9c769(0xdb)](_0x4357f5));if(_0x2645c5[_0xf9c769(0xb7)]>0x0||_0x41e701[_0xf9c769(0xb7)]>0x0){const _0x56d413=[..._0x2645c5[_0xf9c769(0xb6)](_0x1bfc49=>String(_0x1bfc49)),..._0x41e701][_0xf9c769(0xdf)](',\x20');throw new Error(_0xf9c769(0xae)+_0x56d413);}const _0x32f6e1=new Set(_0x15ac5f[_0xf9c769(0xc6)]),_0x4a7753=new Set(_0x15ac5f[_0xf9c769(0xd8)]);return _0x9a40c7[_0xf9c769(0xd0)](_0x188c81=>_0x32f6e1[_0xf9c769(0xdb)](_0x188c81['id'])||_0x4a7753[_0xf9c769(0xdb)](_0x188c81[_0xf9c769(0xcc)]));}function normalizeMode(_0x3a5a85){const _0x2d64c1=a186_0x86ea;if(!_0x3a5a85)return _0x2d64c1(0xa6);if(_0x3a5a85===_0x2d64c1(0xe7)||_0x3a5a85===_0x2d64c1(0xa6))return _0x3a5a85;throw new Error(_0x2d64c1(0xd9)+_0x3a5a85+_0x2d64c1(0xbf));}function buildMenuUpdateDiff(_0x4d1dcf,_0x4fc285,_0x59b567,_0x17dcbc,_0x34329f){const _0x16a798=a186_0x86ea,_0x1cf485=[..._0x4d1dcf[_0x16a798(0xd1)]];_0x59b567===_0x16a798(0xa6)&&assertUnambiguousPatchResources(_0x4d1dcf,_0x1cf485,_0x4fc285);const _0x372465=_0x59b567===_0x16a798(0xa6)?patchResources(_0x1cf485,_0x4fc285):replaceResources(_0x4fc285),_0x2588cf=[],_0x3b2b80=_0x1cf485['some'](isJsResource),_0x3f078a=_0x372465[_0x16a798(0xa7)](isJsResource);if(_0x3b2b80&&!_0x3f078a){const _0x5127c7=_0x16a798(0xbc)+_0x4d1dcf[_0x16a798(0xda)]+_0x16a798(0xc3)+_0x4d1dcf['path']+_0x16a798(0xdd)+_0x16a798(0xa4);if(!_0x17dcbc)throw new Error(_0x5127c7);_0x2588cf[_0x16a798(0xe6)](_0x5127c7);}const _0x468b89=_0x1cf485[_0x16a798(0xa7)](isCssResource),_0x1650d1=_0x372465['some'](isCssResource);_0x468b89&&!_0x1650d1&&_0x2588cf[_0x16a798(0xe6)](_0x16a798(0xb0)+_0x4d1dcf[_0x16a798(0xda)]+_0x16a798(0xc3)+_0x4d1dcf[_0x16a798(0xcc)]+').');const _0x2c2a03=typeof _0x4d1dcf[_0x16a798(0xd7)]?.[_0x16a798(0xb3)]==='string'?_0x4d1dcf[_0x16a798(0xd7)]['loadScriptMode']:null,_0x283875=_0x34329f?{'loadScriptMode':_0x2c2a03}:{},_0x31aa2d=_0x34329f?{'loadScriptMode':_0x34329f}:{};return{'id':_0x4d1dcf['id'],'label':_0x4d1dcf['label'],'path':_0x4d1dcf[_0x16a798(0xcc)],'mode':_0x59b567,'before':{'resources':_0x1cf485,..._0x283875},'after':{'resources':_0x372465,..._0x31aa2d},'warnings':_0x2588cf};}function replaceResources(_0x1e7ae2){const _0x5a326b=a186_0x86ea;return[_0x1e7ae2[_0x5a326b(0xe4)],_0x1e7ae2[_0x5a326b(0xde)]][_0x5a326b(0xd0)](_0xb9512=>!!_0xb9512);}function a186_0x4592(){const _0x84c177=[').\x20','cssUrl','join','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','all','unshift','isArray','jsUrl','message','push','replace','menu\x20asset-update\x20cannot\x20patch\x20','66yCylMG','string','852VRhofM','setLogPath','14UUqdOs','fulfilled','info','cwd','menu-asset-update','Invalid\x20--params:\x20','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','448965inhITQ','patch','some','.css','JS\x20URL\x20is\x20unreachable:\x20','split','field','endsWith','selection','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','319121zGxQrH','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','allSettled','\x20existing\x20CSS\x20resources\x20for\x20\x22','loadScriptMode','value','rejected','map','length','.js','trim','force','object','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','652CqbTnk','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','.\x20Allowed\x20values:\x20replace,\x20patch','--params.','toLowerCase','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','\x22\x20(','mode','status','menuIds','3933160EIKkGA','259644VMMoGj','60DrWmDm','183564JRTJMc','dryRun','path','\x20existing\x20JS\x20resources\x20for\x20\x22','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','4933461FMUgFa','filter','resources','Menu\x20asset\x20update\x20completed','4067Meszff','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','Start\x20non-interactive\x20menu\x20asset\x20update','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','extend','paths','Invalid\x20--mode:\x20','label','has','CSS\x20URL\x20is\x20unreachable:\x20'];a186_0x4592=function(){return _0x84c177;};return a186_0x4592();}function assertUnambiguousPatchResources(_0x315c14,_0xcda089,_0x211cd7){const _0x131a9e=a186_0x86ea,_0x1c13f1=_0xcda089[_0x131a9e(0xd0)](isJsResource)[_0x131a9e(0xb7)];if(_0x211cd7['jsUrl']&&_0x1c13f1>0x1)throw new Error(_0x131a9e(0xe8)+_0x1c13f1+_0x131a9e(0xcd)+_0x315c14[_0x131a9e(0xda)]+'\x22\x20('+_0x315c14[_0x131a9e(0xcc)]+')\x20'+_0x131a9e(0xbe));const _0x3b5319=_0xcda089[_0x131a9e(0xd0)](isCssResource)[_0x131a9e(0xb7)];if(_0x211cd7[_0x131a9e(0xde)]&&_0x3b5319>0x1)throw new Error(_0x131a9e(0xe8)+_0x3b5319+_0x131a9e(0xb2)+_0x315c14['label']+_0x131a9e(0xc3)+_0x315c14[_0x131a9e(0xcc)]+')\x20'+_0x131a9e(0xd6));}function patchResources(_0x20c2ce,_0x422802){const _0x172025=a186_0x86ea;let _0x38de98=![],_0x38ab25=![];const _0x2321d1=[];for(const _0x25bc8b of _0x20c2ce){if(isJsResource(_0x25bc8b)){if(_0x422802[_0x172025(0xe4)]&&!_0x38de98)_0x2321d1[_0x172025(0xe6)](_0x422802[_0x172025(0xe4)]),_0x38de98=!![];else!_0x422802[_0x172025(0xe4)]&&_0x2321d1['push'](_0x25bc8b);continue;}if(isCssResource(_0x25bc8b)){if(_0x422802[_0x172025(0xde)]&&!_0x38ab25)_0x2321d1['push'](_0x422802[_0x172025(0xde)]),_0x38ab25=!![];else!_0x422802[_0x172025(0xde)]&&_0x2321d1[_0x172025(0xe6)](_0x25bc8b);continue;}_0x2321d1[_0x172025(0xe6)](_0x25bc8b);}return _0x422802['jsUrl']&&!_0x38de98&&_0x2321d1[_0x172025(0xe2)](_0x422802['jsUrl']),_0x422802[_0x172025(0xde)]&&!_0x38ab25&&_0x2321d1[_0x172025(0xe6)](_0x422802[_0x172025(0xde)]),_0x2321d1;}function isJsResource(_0x5ca3ca){const _0x4a65ae=a186_0x86ea;return stripQuery(_0x5ca3ca)['toLowerCase']()[_0x4a65ae(0xac)](_0x4a65ae(0xb8));}function isCssResource(_0x266b8e){const _0x33f5e7=a186_0x86ea;return stripQuery(_0x266b8e)[_0x33f5e7(0xc1)]()[_0x33f5e7(0xac)](_0x33f5e7(0xa8));}function stripQuery(_0x158caa){const _0x5e8f62=a186_0x86ea;return _0x158caa[_0x5e8f62(0xaa)]('?')[0x0]??_0x158caa;}function parseUpdateParamsFlag(_0x5e7b9c){const _0x263c12=a186_0x86ea;if(!_0x5e7b9c||typeof _0x5e7b9c!==_0x263c12(0xea))return{};try{const _0x4d4e01=JSON['parse'](_0x5e7b9c);if(typeof _0x4d4e01!==_0x263c12(0xbb)||_0x4d4e01===null||Array[_0x263c12(0xe3)](_0x4d4e01))return{};return{'jsUrl':typeof _0x4d4e01['jsUrl']===_0x263c12(0xea)?_0x4d4e01[_0x263c12(0xe4)][_0x263c12(0xb9)]():undefined,'cssUrl':typeof _0x4d4e01['cssUrl']===_0x263c12(0xea)?_0x4d4e01[_0x263c12(0xde)][_0x263c12(0xb9)]():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x5bcea2,_0x1f770d){const _0x30a035=a186_0xc74f,_0x17fb13=_0x5bcea2();while(!![]){try{const _0x47b3e3=parseInt(_0x30a035(0x1a6))/0x1*(parseInt(_0x30a035(0x1e3))/0x2)+-parseInt(_0x30a035(0x1a5))/0x3+-parseInt(_0x30a035(0x1c8))/0x4*(parseInt(_0x30a035(0x1ac))/0x5)+parseInt(_0x30a035(0x1dc))/0x6+parseInt(_0x30a035(0x1c6))/0x7*(parseInt(_0x30a035(0x1be))/0x8)+parseInt(_0x30a035(0x1d8))/0x9*(parseInt(_0x30a035(0x1b6))/0xa)+-parseInt(_0x30a035(0x1c5))/0xb;if(_0x47b3e3===_0x1f770d)break;else _0x17fb13['push'](_0x17fb13['shift']());}catch(_0x26c55a){_0x17fb13['push'](_0x17fb13['shift']());}}}(a186_0x46b3,0x36d89));function a186_0x46b3(){const _0x4d8582=['value','66182eCaRHL','cwd','1292910TgXkok','1siFLZI','trim','cssUrl','join','string','label','116420ZXQFll','force','path','\x20existing\x20JS\x20resources\x20for\x20\x22','info','selection','some','Start\x20non-interactive\x20menu\x20asset\x20update','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','180DcvkIk',').\x20','.\x20Allowed\x20values:\x20replace,\x20patch','.js','extend','loadScriptMode','all','push','16YHdgJO','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','rejected','menuIds','jsUrl','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','paths','2851101oEegCl','624743bNiMUf','menu-asset-update','12uBvcix','map','patch','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','unshift','filter','JS\x20URL\x20is\x20unreachable:\x20','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','dryRun','after','replace','menu\x20asset-update\x20cannot\x20patch\x20','field','length','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','Invalid\x20--mode:\x20','218061jliHSN','resources','isArray','toLowerCase','2021706COpdnE','message','--params.','has','endsWith','\x22\x20('];a186_0x46b3=function(){return _0x4d8582;};return a186_0x46b3();}import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a186_0xc74f(_0x3a766a,_0x3fca6f){_0x3a766a=_0x3a766a-0x1a5;const _0x46b3fb=a186_0x46b3();let _0xc74f66=_0x46b3fb[_0x3a766a];return _0xc74f66;}import{logger}from'../../../utils/logger.js';function validateParams(_0x3f67ce){const _0x166a87=a186_0xc74f,_0x7b0a8b=[];return _0x3f67ce[_0x166a87(0x1c2)]&&!isValidJsHttpsUrl(_0x3f67ce['jsUrl'])&&_0x7b0a8b[_0x166a87(0x1bd)]({'field':_0x166a87(0x1c2),'message':_0x166a87(0x1bf)}),_0x3f67ce[_0x166a87(0x1a8)]&&!isValidCssHttpsUrl(_0x3f67ce[_0x166a87(0x1a8)])&&_0x7b0a8b['push']({'field':'cssUrl','message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x7b0a8b;}export async function runMenuUpdateCore(_0x18d8c5,_0x4fd09f,_0x329805,_0x397b3d={}){const _0x11e108=a186_0xc74f,_0x22bd6a=parseUpdateParamsFlag(_0x329805),_0x5f2848=normalizeMode(_0x397b3d['mode']);validateSelection(_0x397b3d[_0x11e108(0x1b1)]);const _0x1680f4=[];if(_0x22bd6a[_0x11e108(0x1c2)])_0x1680f4[_0x11e108(0x1bd)](_0x22bd6a[_0x11e108(0x1c2)]);if(_0x22bd6a[_0x11e108(0x1a8)])_0x1680f4[_0x11e108(0x1bd)](_0x22bd6a[_0x11e108(0x1a8)]);const _0x1eb1e1=validateParams(_0x22bd6a);if(_0x1eb1e1[_0x11e108(0x1d5)]>0x0){const _0x52907f=_0x1eb1e1[_0x11e108(0x1c9)](_0x5a122c=>_0x11e108(0x1de)+_0x5a122c[_0x11e108(0x1d4)]+':\x20'+_0x5a122c[_0x11e108(0x1dd)])[_0x11e108(0x1a9)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x52907f);}if(_0x1680f4[_0x11e108(0x1d5)]===0x0)throw new Error(_0x11e108(0x1b4)+_0x11e108(0x1cb));logger['setLogPath'](process[_0x11e108(0x1e4)]()),logger[_0x11e108(0x1b0)](_0x11e108(0x1c7),_0x11e108(0x1b3),{'appCode':_0x18d8c5,'jsUrl':_0x22bd6a[_0x11e108(0x1c2)],'cssUrl':_0x22bd6a[_0x11e108(0x1a8)],'mode':_0x5f2848,'dryRun':_0x397b3d[_0x11e108(0x1d0)]===!![]});if(_0x22bd6a[_0x11e108(0x1c2)]){const _0x4b17e8=await isUrlReachable(_0x22bd6a[_0x11e108(0x1c2)]);if(!_0x4b17e8)throw new Error(_0x11e108(0x1ce)+_0x22bd6a[_0x11e108(0x1c2)]);}if(_0x22bd6a[_0x11e108(0x1a8)]){const _0x3f4ead=await isUrlReachable(_0x22bd6a[_0x11e108(0x1a8)]);if(!_0x3f4ead)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x22bd6a['cssUrl']);}const _0x234059=await getOnlineMenuList(_0x18d8c5,_0x4fd09f),_0x5eeb35=_0x234059[_0x11e108(0x1cd)](_0x41428c=>_0x41428c[_0x11e108(0x1d9)][_0x11e108(0x1d5)]>0x0),_0x2770c5=selectMenusForUpdate(_0x5eeb35,_0x397b3d[_0x11e108(0x1b1)]);if(_0x2770c5[_0x11e108(0x1d5)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x397b3d[_0x11e108(0x1d0)]===!![]};const _0x2437ae=_0x2770c5[_0x11e108(0x1c9)](_0x5b1eab=>buildMenuUpdateDiff(_0x5b1eab,_0x22bd6a,_0x5f2848,_0x397b3d[_0x11e108(0x1ad)]===!![],_0x397b3d[_0x11e108(0x1bb)]));if(_0x397b3d[_0x11e108(0x1d0)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x2437ae};const _0xc7b453=await Promise['allSettled'](_0x2770c5[_0x11e108(0x1c9)]((_0x2df9f8,_0x194747)=>updateMenuCdnUrl(_0x18d8c5,_0x4fd09f,{'id':_0x2df9f8['id'],'label':_0x2df9f8[_0x11e108(0x1ab)],'path':_0x2df9f8[_0x11e108(0x1ae)],'resources':_0x2437ae[_0x194747][_0x11e108(0x1d1)][_0x11e108(0x1d9)],'extend':_0x2df9f8[_0x11e108(0x1ba)]??null,'loadScriptMode':_0x397b3d[_0x11e108(0x1bb)]}))),_0x3dda0f=_0xc7b453['filter'](_0x56df90=>_0x56df90['status']==='fulfilled')[_0x11e108(0x1c9)](_0xb4929f=>_0xb4929f[_0x11e108(0x1e2)]),_0xf0746f=_0xc7b453['filter'](_0x4987c9=>_0x4987c9['status']===_0x11e108(0x1c0))[_0x11e108(0x1d5)];return logger[_0x11e108(0x1b0)](_0x11e108(0x1c7),'Menu\x20asset\x20update\x20completed',{'count':_0x2770c5[_0x11e108(0x1d5)],'resources':_0x1680f4}),{'updated':_0x3dda0f[_0x11e108(0x1d5)],'failed':_0xf0746f,'skipped':![],'menus':_0x3dda0f};}function validateSelection(_0x454c02){const _0x3eed76=a186_0xc74f;if(!_0x454c02)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x454c02[_0x3eed76(0x1bc)]&&(_0x454c02['menuIds'][_0x3eed76(0x1d5)]>0x0||_0x454c02[_0x3eed76(0x1c4)]['length']>0x0))throw new Error('--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.');if(!_0x454c02[_0x3eed76(0x1bc)]&&_0x454c02[_0x3eed76(0x1c1)][_0x3eed76(0x1d5)]===0x0&&_0x454c02[_0x3eed76(0x1c4)][_0x3eed76(0x1d5)]===0x0)throw new Error(_0x3eed76(0x1b5));}export function selectMenusForUpdate(_0x376123,_0x19ce1a){const _0x45dc89=a186_0xc74f;validateSelection(_0x19ce1a);if(_0x19ce1a[_0x45dc89(0x1bc)])return _0x376123;const _0x5b62b5=new Set(_0x376123[_0x45dc89(0x1c9)](_0x5cc163=>_0x5cc163['id'])),_0x3b6363=new Set(_0x376123[_0x45dc89(0x1c9)](_0x4a1d52=>_0x4a1d52[_0x45dc89(0x1ae)])),_0xd968d0=_0x19ce1a[_0x45dc89(0x1c1)][_0x45dc89(0x1cd)](_0x568056=>!_0x5b62b5[_0x45dc89(0x1df)](_0x568056)),_0x103b57=_0x19ce1a['paths'][_0x45dc89(0x1cd)](_0x4979d8=>!_0x3b6363[_0x45dc89(0x1df)](_0x4979d8));if(_0xd968d0[_0x45dc89(0x1d5)]>0x0||_0x103b57[_0x45dc89(0x1d5)]>0x0){const _0x32a5c6=[..._0xd968d0[_0x45dc89(0x1c9)](_0x3995c9=>String(_0x3995c9)),..._0x103b57][_0x45dc89(0x1a9)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x32a5c6);}const _0x2dfb0d=new Set(_0x19ce1a[_0x45dc89(0x1c1)]),_0x123a02=new Set(_0x19ce1a[_0x45dc89(0x1c4)]);return _0x376123[_0x45dc89(0x1cd)](_0x3f8177=>_0x2dfb0d[_0x45dc89(0x1df)](_0x3f8177['id'])||_0x123a02[_0x45dc89(0x1df)](_0x3f8177[_0x45dc89(0x1ae)]));}function normalizeMode(_0x3d96cd){const _0x1a51f4=a186_0xc74f;if(!_0x3d96cd)return _0x1a51f4(0x1ca);if(_0x3d96cd===_0x1a51f4(0x1d2)||_0x3d96cd===_0x1a51f4(0x1ca))return _0x3d96cd;throw new Error(_0x1a51f4(0x1d7)+_0x3d96cd+_0x1a51f4(0x1b8));}function buildMenuUpdateDiff(_0xc661a8,_0x1669ae,_0x3aac9d,_0x53b81c,_0x3d6a19){const _0x4ff6cb=a186_0xc74f,_0x4611bd=[..._0xc661a8[_0x4ff6cb(0x1d9)]];_0x3aac9d==='patch'&&assertUnambiguousPatchResources(_0xc661a8,_0x4611bd,_0x1669ae);const _0xbdb1b6=_0x3aac9d===_0x4ff6cb(0x1ca)?patchResources(_0x4611bd,_0x1669ae):replaceResources(_0x1669ae),_0x292ce8=[],_0x35e6de=_0x4611bd[_0x4ff6cb(0x1b2)](isJsResource),_0x1457c8=_0xbdb1b6[_0x4ff6cb(0x1b2)](isJsResource);if(_0x35e6de&&!_0x1457c8){const _0x4acd2f=_0x4ff6cb(0x1c3)+_0xc661a8[_0x4ff6cb(0x1ab)]+_0x4ff6cb(0x1e1)+_0xc661a8[_0x4ff6cb(0x1ae)]+_0x4ff6cb(0x1b7)+_0x4ff6cb(0x1d6);if(!_0x53b81c)throw new Error(_0x4acd2f);_0x292ce8[_0x4ff6cb(0x1bd)](_0x4acd2f);}const _0x390a34=_0x4611bd[_0x4ff6cb(0x1b2)](isCssResource),_0x164690=_0xbdb1b6[_0x4ff6cb(0x1b2)](isCssResource);_0x390a34&&!_0x164690&&_0x292ce8[_0x4ff6cb(0x1bd)]('menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22'+_0xc661a8['label']+'\x22\x20('+_0xc661a8['path']+').');const _0x568576=typeof _0xc661a8['extend']?.[_0x4ff6cb(0x1bb)]==='string'?_0xc661a8[_0x4ff6cb(0x1ba)][_0x4ff6cb(0x1bb)]:null,_0x59aabc=_0x3d6a19?{'loadScriptMode':_0x568576}:{},_0x5969ff=_0x3d6a19?{'loadScriptMode':_0x3d6a19}:{};return{'id':_0xc661a8['id'],'label':_0xc661a8[_0x4ff6cb(0x1ab)],'path':_0xc661a8[_0x4ff6cb(0x1ae)],'mode':_0x3aac9d,'before':{'resources':_0x4611bd,..._0x59aabc},'after':{'resources':_0xbdb1b6,..._0x5969ff},'warnings':_0x292ce8};}function replaceResources(_0xf60296){const _0x3a68a7=a186_0xc74f;return[_0xf60296['jsUrl'],_0xf60296[_0x3a68a7(0x1a8)]]['filter'](_0x329664=>!!_0x329664);}function assertUnambiguousPatchResources(_0x3cf6c3,_0x4a3359,_0x2cf874){const _0x193205=a186_0xc74f,_0x275b03=_0x4a3359['filter'](isJsResource)[_0x193205(0x1d5)];if(_0x2cf874['jsUrl']&&_0x275b03>0x1)throw new Error(_0x193205(0x1d3)+_0x275b03+_0x193205(0x1af)+_0x3cf6c3[_0x193205(0x1ab)]+_0x193205(0x1e1)+_0x3cf6c3[_0x193205(0x1ae)]+')\x20'+'with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');const _0x46c4d2=_0x4a3359[_0x193205(0x1cd)](isCssResource)[_0x193205(0x1d5)];if(_0x2cf874[_0x193205(0x1a8)]&&_0x46c4d2>0x1)throw new Error(_0x193205(0x1d3)+_0x46c4d2+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x3cf6c3['label']+'\x22\x20('+_0x3cf6c3[_0x193205(0x1ae)]+')\x20'+_0x193205(0x1cf));}function patchResources(_0x1ea2f8,_0x522362){const _0x50dc24=a186_0xc74f;let _0x2c027f=![],_0x5eb259=![];const _0x15d398=[];for(const _0x5a10c8 of _0x1ea2f8){if(isJsResource(_0x5a10c8)){if(_0x522362['jsUrl']&&!_0x2c027f)_0x15d398[_0x50dc24(0x1bd)](_0x522362[_0x50dc24(0x1c2)]),_0x2c027f=!![];else!_0x522362[_0x50dc24(0x1c2)]&&_0x15d398['push'](_0x5a10c8);continue;}if(isCssResource(_0x5a10c8)){if(_0x522362['cssUrl']&&!_0x5eb259)_0x15d398[_0x50dc24(0x1bd)](_0x522362['cssUrl']),_0x5eb259=!![];else!_0x522362[_0x50dc24(0x1a8)]&&_0x15d398[_0x50dc24(0x1bd)](_0x5a10c8);continue;}_0x15d398[_0x50dc24(0x1bd)](_0x5a10c8);}return _0x522362['jsUrl']&&!_0x2c027f&&_0x15d398[_0x50dc24(0x1cc)](_0x522362[_0x50dc24(0x1c2)]),_0x522362['cssUrl']&&!_0x5eb259&&_0x15d398[_0x50dc24(0x1bd)](_0x522362[_0x50dc24(0x1a8)]),_0x15d398;}function isJsResource(_0x1539b5){const _0x4f3f9c=a186_0xc74f;return stripQuery(_0x1539b5)[_0x4f3f9c(0x1db)]()[_0x4f3f9c(0x1e0)](_0x4f3f9c(0x1b9));}function isCssResource(_0x28af03){const _0x302270=a186_0xc74f;return stripQuery(_0x28af03)[_0x302270(0x1db)]()['endsWith']('.css');}function stripQuery(_0x20c96e){return _0x20c96e['split']('?')[0x0]??_0x20c96e;}function parseUpdateParamsFlag(_0x4a9367){const _0x6aa450=a186_0xc74f;if(!_0x4a9367||typeof _0x4a9367!=='string')return{};try{const _0x466290=JSON['parse'](_0x4a9367);if(typeof _0x466290!=='object'||_0x466290===null||Array[_0x6aa450(0x1da)](_0x466290))return{};return{'jsUrl':typeof _0x466290[_0x6aa450(0x1c2)]===_0x6aa450(0x1aa)?_0x466290['jsUrl']['trim']():undefined,'cssUrl':typeof _0x466290[_0x6aa450(0x1a8)]==='string'?_0x466290[_0x6aa450(0x1a8)][_0x6aa450(0x1a7)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a187_0x8b86(_0x4ee57a,_0x2afc13){_0x4ee57a=_0x4ee57a-0x1e9;const _0x2c809b=a187_0x2c80();let _0x8b867f=_0x2c809b[_0x4ee57a];return _0x8b867f;}(function(_0x13287e,_0x206837){const _0xbca10d=a187_0x8b86,_0x1c1660=_0x13287e();while(!![]){try{const _0x316b9d=parseInt(_0xbca10d(0x1f4))/0x1*(parseInt(_0xbca10d(0x1ee))/0x2)+-parseInt(_0xbca10d(0x1ea))/0x3*(parseInt(_0xbca10d(0x1eb))/0x4)+parseInt(_0xbca10d(0x1f5))/0x5*(-parseInt(_0xbca10d(0x1f6))/0x6)+parseInt(_0xbca10d(0x1e9))/0x7*(parseInt(_0xbca10d(0x1f7))/0x8)+parseInt(_0xbca10d(0x1f9))/0x9+parseInt(_0xbca10d(0x1f8))/0xa+-parseInt(_0xbca10d(0x1ed))/0xb;if(_0x316b9d===_0x206837)break;else _0x1c1660['push'](_0x1c1660['shift']());}catch(_0x353f4c){_0x1c1660['push'](_0x1c1660['shift']());}}}(a187_0x2c80,0x41e38));export function isValidJsHttpsUrl(_0x15c383){const _0x2075dc=a187_0x8b86;return/^https:\/\/.+\.js(\?.*)?$/[_0x2075dc(0x1f3)](_0x15c383[_0x2075dc(0x1f0)]());}function a187_0x2c80(){const _0x96d9a6=['test','425049MwNIne','810gmAlVi','4362CxVujt','3257256zATEbh','3682280yxcAPr','2579004SmHVcj','7gpPCAT','543qQlVRZ','60EMlPgd','GET','12062831NJXEsK','2pXlHis','bytes=0-0','trim','cancel','HEAD'];a187_0x2c80=function(){return _0x96d9a6;};return a187_0x2c80();}export function isValidCssHttpsUrl(_0x34c576){const _0x514760=a187_0x8b86;return/^https:\/\/.+\.css(\?.*)?$/[_0x514760(0x1f3)](_0x34c576[_0x514760(0x1f0)]());}export async function isUrlReachable(_0x52d30e){const _0xf374bd=a187_0x8b86;try{const _0x5cf3f4=await fetch(_0x52d30e,{'method':_0xf374bd(0x1f2)});if(_0x5cf3f4['ok'])return!![];}catch{}try{const _0x278578=await fetch(_0x52d30e,{'method':_0xf374bd(0x1ec),'headers':{'Range':_0xf374bd(0x1ef)}}),_0x59f113=_0x278578['ok'];try{await _0x278578['body']?.[_0xf374bd(0x1f1)]();}catch{}return _0x59f113;}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a188_0x31a8(){const _0x4101f6=['boundMenus','1265089AhqvON','105bxzhEV','Inspected\x20','1495400syVaLh','1307XaqafW','1256992mBQCOn','subapp-assets-status','856kxEUwR','\x20in\x20menu\x20host\x20','Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','3aFCJox','2080296BPSbpt','7191nipoca','274JuLpsE','cookie','\x20menu(s)\x20for\x20','22CVpprJ','read','21642RcAEws'];a188_0x31a8=function(){return _0x4101f6;};return a188_0x31a8();}const a188_0x2c5c6b=a188_0x133c;(function(_0x349382,_0x23bb34){const _0x262748=a188_0x133c,_0x3b00fc=_0x349382();while(!![]){try{const _0x5c45c6=parseInt(_0x262748(0x19e))/0x1*(parseInt(_0x262748(0x193))/0x2)+parseInt(_0x262748(0x190))/0x3*(parseInt(_0x262748(0x19f))/0x4)+-parseInt(_0x262748(0x19b))/0x5*(parseInt(_0x262748(0x198))/0x6)+parseInt(_0x262748(0x19a))/0x7+-parseInt(_0x262748(0x1a1))/0x8*(-parseInt(_0x262748(0x192))/0x9)+-parseInt(_0x262748(0x19d))/0xa+-parseInt(_0x262748(0x196))/0xb*(parseInt(_0x262748(0x191))/0xc);if(_0x5c45c6===_0x23bb34)break;else _0x3b00fc['push'](_0x3b00fc['shift']());}catch(_0x3625e3){_0x3b00fc['push'](_0x3b00fc['shift']());}}}(a188_0x31a8,0x2dc84));import{getSmartAppRecord}from'../../core/api-client.js';function a188_0x133c(_0x2d8550,_0x33fd2a){_0x2d8550=_0x2d8550-0x18f;const _0x31a8f9=a188_0x31a8();let _0x133cb6=_0x31a8f9[_0x2d8550];return _0x133cb6;}import{getOnlineMenuList}from'../../commands/menu/shared/service.js';import{buildSubappAssetsStatus,getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';export const menuSubappAssetsStatus={'service':'menu','command':a188_0x2c5c6b(0x1a0),'description':a188_0x2c5c6b(0x18f),'risk':a188_0x2c5c6b(0x197),'strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x4603f2){getSubappSelector(_0x4603f2);},async 'execute'(_0x442196){const _0x1b3595=a188_0x2c5c6b,{appCode:_0x1f313b,appName:_0x5c7e10}=getSubappSelector(_0x442196),[_0x1b8a06,_0x130925]=await Promise['all']([getSmartAppRecord(_0x1f313b,_0x442196[_0x1b3595(0x194)]),getOnlineMenuList(_0x1f313b,_0x442196[_0x1b3595(0x194)])]),_0x12c8ae={'appCode':_0x1f313b,...buildSubappAssetsStatus(_0x1b8a06,_0x130925,_0x5c7e10)};return{'ok':!![],'data':_0x12c8ae,'message':_0x1b3595(0x19c)+_0x12c8ae[_0x1b3595(0x199)]+_0x1b3595(0x195)+_0x5c7e10+_0x1b3595(0x1a2)+_0x1f313b+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a189_0xfb56cf=a189_0x1ef3;(function(_0x399cd1,_0x593083){const _0x14f13b=a189_0x1ef3,_0x28f7b3=_0x399cd1();while(!![]){try{const _0x28e6a2=parseInt(_0x14f13b(0x180))/0x1*(-parseInt(_0x14f13b(0x18b))/0x2)+-parseInt(_0x14f13b(0x17a))/0x3+parseInt(_0x14f13b(0x1a5))/0x4*(parseInt(_0x14f13b(0x1ab))/0x5)+parseInt(_0x14f13b(0x190))/0x6+-parseInt(_0x14f13b(0x1a1))/0x7*(-parseInt(_0x14f13b(0x16f))/0x8)+parseInt(_0x14f13b(0x158))/0x9*(parseInt(_0x14f13b(0x15d))/0xa)+parseInt(_0x14f13b(0x198))/0xb*(-parseInt(_0x14f13b(0x195))/0xc);if(_0x28e6a2===_0x593083)break;else _0x28f7b3['push'](_0x28f7b3['shift']());}catch(_0x2aff8c){_0x28f7b3['push'](_0x28f7b3['shift']());}}}(a189_0x4c10,0xd3d81));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a189_0x4c10(){const _0x158c6c=['7483CMDGdh','length','digest','--resources\x20is\x20required.','5872xmsLtb','protocol','appCode','App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.','enableOpenApi','expectedHash','4050GvdsdG','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','6642FGqOdM','directDbEnabled','filter','\x20must\x20be\x20a\x20JSON\x20array.','isArray','21030PMdWtC','join','appName','tenantColumn','update','apiError','has','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','validation','stringify','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','Updated\x20shared\x20resources\x20for\x20','keys','.\x20Refusing\x20update.','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','object','enableAutoSync','9392eXxFxS','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes',';\x20found\x20','some','resources','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','subapp-assets-update','not\x20HTTPS','parse','map','string','2813118PSNIrO','Unknown\x20app.extend\x20fields:\x20','resources[','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','Would\x20update\x20shared\x20assets\x20for\x20','directDbId','5qUxmUW',']\x20must\x20be\x20a\x20URL\x20string.','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','skinColor','app.extend.assets','assets','expected-hash','menu','trim','before','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','129566CMqhFb','str','enableSample','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','\x20in\x20menu\x20host\x20','4674708jiuiDV','\x20contains\x20invalid\x20JSON.','isSafeInteger','entries','unchanged','12nvnsnp','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','/smartapi/app/update','29104724uIyJjZ','appPublishStatus','accessKey','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','nextExtend','write','cookie','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs'];a189_0x4c10=function(){return _0x158c6c;};return a189_0x4c10();}import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a189_0xfb56cf(0x183),a189_0xfb56cf(0x1a9),a189_0xfb56cf(0x19a),a189_0xfb56cf(0x185),a189_0xfb56cf(0x160),a189_0xfb56cf(0x18d),'vipDeploy',a189_0xfb56cf(0x16e),a189_0xfb56cf(0x17f),a189_0xfb56cf(0x159)]);function parseObject(_0x30b550,_0x1b2cc5){const _0x13ae65=a189_0xfb56cf;let _0x501b89=_0x30b550;if(typeof _0x30b550===_0x13ae65(0x179))try{_0x501b89=JSON[_0x13ae65(0x177)](_0x30b550);}catch{throw CliErrors[_0x13ae65(0x165)](_0x1b2cc5+_0x13ae65(0x191));}if(!_0x501b89||typeof _0x501b89!==_0x13ae65(0x16d)||Array[_0x13ae65(0x15c)](_0x501b89))throw CliErrors[_0x13ae65(0x165)](_0x1b2cc5+'\x20must\x20be\x20a\x20JSON\x20object.');return _0x501b89;}function a189_0x1ef3(_0x5a6ebf,_0x44184e){_0x5a6ebf=_0x5a6ebf-0x157;const _0x4c1048=a189_0x4c10();let _0x1ef3b3=_0x4c1048[_0x5a6ebf];return _0x1ef3b3;}function parseArray(_0x100b31,_0x3caa96){const _0x2ab074=a189_0xfb56cf;let _0x4a1dcd;try{_0x4a1dcd=JSON[_0x2ab074(0x177)](_0x100b31);}catch{throw CliErrors[_0x2ab074(0x165)](_0x3caa96+_0x2ab074(0x191));}if(!Array[_0x2ab074(0x15c)](_0x4a1dcd))throw CliErrors[_0x2ab074(0x165)](_0x3caa96+_0x2ab074(0x15b));return _0x4a1dcd['map']((_0x257c44,_0x373571)=>parseObject(_0x257c44,_0x3caa96+'['+_0x373571+']'));}function validateResources(_0x3bf77c){const _0x471a24=a189_0xfb56cf;if(_0x3bf77c[_0x471a24(0x1a2)]===0x0)throw CliErrors['validation'](_0x471a24(0x167));for(const [_0x56a5ef,_0x27ee5b]of _0x3bf77c[_0x471a24(0x193)]()){if(typeof _0x27ee5b!==_0x471a24(0x179))throw CliErrors[_0x471a24(0x165)](_0x471a24(0x17c)+_0x56a5ef+_0x471a24(0x181));try{if(new URL(_0x27ee5b)[_0x471a24(0x1a6)]!=='https:')throw new Error(_0x471a24(0x176));}catch{throw CliErrors[_0x471a24(0x165)](_0x471a24(0x17c)+_0x56a5ef+_0x471a24(0x16c));}}if(new Set(_0x3bf77c)['size']!==_0x3bf77c[_0x471a24(0x1a2)]||!_0x3bf77c[_0x471a24(0x172)](_0x4b43ca=>/\.m?js(?:[?#]|$)/i['test'](_0x4b43ca)))throw CliErrors[_0x471a24(0x165)](_0x471a24(0x16b));return _0x3bf77c;}function prepare(_0x7a9831,_0x594ee0,_0x5c0ce6){const _0x59edd1=a189_0xfb56cf;if(!Number[_0x59edd1(0x192)](_0x7a9831['id'])||(_0x7a9831['id']??0x0)<=0x0||typeof _0x7a9831[_0x59edd1(0x199)]!=='string'||!_0x7a9831[_0x59edd1(0x199)])throw CliErrors[_0x59edd1(0x165)](_0x59edd1(0x182));const _0x5251af=parseObject(_0x7a9831['extend'],'app.extend'),_0x2e0de2=Object[_0x59edd1(0x169)](_0x5251af)[_0x59edd1(0x15a)](_0x5eae0d=>!KNOWN_EXTEND_KEYS[_0x59edd1(0x163)](_0x5eae0d));if(_0x2e0de2[_0x59edd1(0x1a2)])throw CliErrors[_0x59edd1(0x165)](_0x59edd1(0x17b)+_0x2e0de2[_0x59edd1(0x15e)](',\x20')+_0x59edd1(0x16a));if(typeof _0x5251af[_0x59edd1(0x185)]!==_0x59edd1(0x179))throw CliErrors[_0x59edd1(0x165)](_0x59edd1(0x17d));const _0x31959c=parseArray(_0x5251af[_0x59edd1(0x185)],_0x59edd1(0x184)),_0x1a7054=_0x31959c[_0x59edd1(0x15a)](_0x3c2dcc=>_0x3c2dcc[_0x59edd1(0x15f)]===_0x594ee0);if(_0x1a7054[_0x59edd1(0x1a2)]!==0x1)throw CliErrors[_0x59edd1(0x165)](_0x59edd1(0x164)+_0x594ee0+_0x59edd1(0x171)+_0x1a7054[_0x59edd1(0x1a2)]+'.');const _0x52acde=_0x1a7054[0x0];if(typeof _0x52acde['resources']!=='string')throw CliErrors[_0x59edd1(0x165)](_0x59edd1(0x174));let _0x337134;try{_0x337134=JSON['parse'](_0x52acde[_0x59edd1(0x173)]);}catch{throw CliErrors['validation'](_0x59edd1(0x18e));}if(!Array[_0x59edd1(0x15c)](_0x337134)||_0x337134['some'](_0x254c95=>typeof _0x254c95!==_0x59edd1(0x179)))throw CliErrors[_0x59edd1(0x165)](_0x59edd1(0x157));const _0x5893a6=_0x31959c[_0x59edd1(0x178)](_0x14cf54=>_0x14cf54===_0x52acde?{..._0x14cf54,'resources':JSON[_0x59edd1(0x166)](_0x5c0ce6)}:_0x14cf54),_0x111546={..._0x5251af,'assets':JSON[_0x59edd1(0x166)](_0x5893a6)},_0x1579e2=createHash('sha256')[_0x59edd1(0x161)](JSON[_0x59edd1(0x166)]({'appCode':_0x7a9831[_0x59edd1(0x1a7)],'id':_0x7a9831['id'],'appPublishStatus':_0x7a9831[_0x59edd1(0x199)],'extend':_0x5251af,'appName':_0x594ee0,'resources':_0x5c0ce6}))[_0x59edd1(0x1a3)]('hex');return{'before':_0x337134,'nextExtend':_0x111546,'expectedHash':_0x1579e2,'unchanged':isDeepStrictEqual(_0x337134,_0x5c0ce6)};}function flags(_0x4316be){const _0x20759e=a189_0xfb56cf,{appCode:_0x1ba1b7,appName:_0x3c303a}=getSubappSelector(_0x4316be),_0x214c68=_0x4316be[_0x20759e(0x18c)](_0x20759e(0x173))['trim']();if(!_0x214c68)throw CliErrors[_0x20759e(0x165)](_0x20759e(0x1a4));let _0x29930f;try{_0x29930f=JSON[_0x20759e(0x177)](_0x214c68);}catch{throw CliErrors[_0x20759e(0x165)](_0x20759e(0x19f));}if(!Array[_0x20759e(0x15c)](_0x29930f))throw CliErrors['validation'](_0x20759e(0x19f));return{'appCode':_0x1ba1b7,'appName':_0x3c303a,'resources':validateResources(_0x29930f)};}export const menuSubappAssetsUpdate={'service':a189_0xfb56cf(0x187),'command':a189_0xfb56cf(0x175),'description':'Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','risk':a189_0xfb56cf(0x19d),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a189_0xfb56cf(0x173),'type':'string','required':!![],'description':a189_0xfb56cf(0x1a0)},{'name':a189_0xfb56cf(0x186),'type':'string','description':a189_0xfb56cf(0x170)}],async 'validate'(_0x35968f){flags(_0x35968f);},async 'dryRun'(_0x2c664c){const _0x368ece=a189_0xfb56cf,{appCode:_0x584b6b,appName:_0x394137,resources:_0x54bb56}=flags(_0x2c664c),_0x107084=await getSmartAppRecord(_0x584b6b,_0x2c664c[_0x368ece(0x19e)]),_0x3be4d0=prepare(_0x107084,_0x394137,_0x54bb56);return{'method':'POST','url':_0x368ece(0x197),'body':{'preview':{'appCode':_0x584b6b,'appName':_0x394137,'before':_0x3be4d0[_0x368ece(0x189)],'after':_0x54bb56,'expectedHash':_0x3be4d0[_0x368ece(0x1aa)],'unchanged':_0x3be4d0[_0x368ece(0x194)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x3be4d0[_0x368ece(0x194)]?_0x368ece(0x18a):_0x368ece(0x17e)+_0x394137+'.'};},async 'execute'(_0x357146){const _0xa9642e=a189_0xfb56cf,{appCode:_0x3c124e,appName:_0x4761b5,resources:_0x4f42c}=flags(_0x357146),_0x21ac84=_0x357146[_0xa9642e(0x18c)]('expected-hash')[_0xa9642e(0x188)]();if(!/^[a-f0-9]{64}$/i['test'](_0x21ac84))throw CliErrors['validation'](_0xa9642e(0x196));const _0x4fe9c0=await getSmartAppRecord(_0x3c124e,_0x357146[_0xa9642e(0x19e)]),_0xc72dc5=prepare(_0x4fe9c0,_0x4761b5,_0x4f42c);if(_0x21ac84!==_0xc72dc5[_0xa9642e(0x1aa)])throw CliErrors['validation'](_0xa9642e(0x1a8));if(_0xc72dc5[_0xa9642e(0x194)])return{'ok':!![],'data':{'appCode':_0x3c124e,'appName':_0x4761b5,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0xa9642e(0x19b)};await updateSmartAppRecord({'id':_0x4fe9c0['id'],'appCode':_0x3c124e,'appPublishStatus':_0x4fe9c0[_0xa9642e(0x199)],'extend':_0xc72dc5[_0xa9642e(0x19c)]},_0x357146[_0xa9642e(0x19e)]);const _0x518153=await getSmartAppRecord(_0x3c124e,_0x357146[_0xa9642e(0x19e)]),_0x42b875=parseObject(_0x518153['extend'],'verified\x20app.extend');if(_0x518153['id']!==_0x4fe9c0['id']||_0x518153[_0xa9642e(0x199)]!==_0x4fe9c0[_0xa9642e(0x199)]||!isDeepStrictEqual(_0x42b875,_0xc72dc5[_0xa9642e(0x19c)]))throw CliErrors[_0xa9642e(0x162)]('App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.');return{'ok':!![],'data':{'appCode':_0x3c124e,'appName':_0x4761b5,'updated':!![],'resources':_0x4f42c,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0xa9642e(0x168)+_0x4761b5+_0xa9642e(0x18f)+_0x3c124e+';\x20independent\x20deployment\x20not\x20verified.'};}};
|
|
1
|
+
const a189_0x41ff96=a189_0x2418;function a189_0x2418(_0x3009c4,_0x314dea){_0x3009c4=_0x3009c4-0xc6;const _0x3c5880=a189_0x3c58();let _0x241805=_0x3c5880[_0x3009c4];return _0x241805;}(function(_0x516418,_0x1acd3d){const _0x3260fd=a189_0x2418,_0x28a330=_0x516418();while(!![]){try{const _0x2fd51e=parseInt(_0x3260fd(0x109))/0x1+-parseInt(_0x3260fd(0xca))/0x2*(parseInt(_0x3260fd(0x10b))/0x3)+-parseInt(_0x3260fd(0xf2))/0x4+-parseInt(_0x3260fd(0xd4))/0x5*(parseInt(_0x3260fd(0xd7))/0x6)+parseInt(_0x3260fd(0xdf))/0x7+parseInt(_0x3260fd(0x10d))/0x8*(parseInt(_0x3260fd(0xf3))/0x9)+-parseInt(_0x3260fd(0xf5))/0xa*(-parseInt(_0x3260fd(0x102))/0xb);if(_0x2fd51e===_0x1acd3d)break;else _0x28a330['push'](_0x28a330['shift']());}catch(_0xb1fa82){_0x28a330['push'](_0x28a330['shift']());}}}(a189_0x3c58,0x2824a));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([a189_0x41ff96(0xe3),a189_0x41ff96(0xd8),a189_0x41ff96(0xd1),a189_0x41ff96(0xce),a189_0x41ff96(0xd9),a189_0x41ff96(0xe1),a189_0x41ff96(0x113),a189_0x41ff96(0x118),a189_0x41ff96(0xdb),'directDbEnabled']);function parseObject(_0x5c9686,_0x1d8a32){const _0x53c11e=a189_0x41ff96;let _0x11f7df=_0x5c9686;if(typeof _0x5c9686===_0x53c11e(0x111))try{_0x11f7df=JSON[_0x53c11e(0xe6)](_0x5c9686);}catch{throw CliErrors[_0x53c11e(0xfe)](_0x1d8a32+_0x53c11e(0xef));}if(!_0x11f7df||typeof _0x11f7df!==_0x53c11e(0x101)||Array[_0x53c11e(0xde)](_0x11f7df))throw CliErrors['validation'](_0x1d8a32+_0x53c11e(0xf9));return _0x11f7df;}function parseArray(_0x485ad0,_0x4aa441){const _0x93187=a189_0x41ff96;let _0x46e1b0;try{_0x46e1b0=JSON[_0x93187(0xe6)](_0x485ad0);}catch{throw CliErrors[_0x93187(0xfe)](_0x4aa441+_0x93187(0xef));}if(!Array[_0x93187(0xde)](_0x46e1b0))throw CliErrors[_0x93187(0xfe)](_0x4aa441+_0x93187(0x10e));return _0x46e1b0[_0x93187(0xe9)]((_0x40557a,_0x30fa17)=>parseObject(_0x40557a,_0x4aa441+'['+_0x30fa17+']'));}function validateResources(_0x142688){const _0x4f69c2=a189_0x41ff96;if(_0x142688[_0x4f69c2(0xf0)]===0x0)throw CliErrors[_0x4f69c2(0xfe)](_0x4f69c2(0x115));for(const [_0x307ce1,_0x4ae508]of _0x142688[_0x4f69c2(0x112)]()){if(typeof _0x4ae508!=='string')throw CliErrors[_0x4f69c2(0xfe)](_0x4f69c2(0xf1)+_0x307ce1+']\x20must\x20be\x20a\x20URL\x20string.');try{if(new URL(_0x4ae508)[_0x4f69c2(0xee)]!=='https:')throw new Error(_0x4f69c2(0xd6));}catch{throw CliErrors[_0x4f69c2(0xfe)]('resources['+_0x307ce1+']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.');}}if(new Set(_0x142688)[_0x4f69c2(0xf4)]!==_0x142688[_0x4f69c2(0xf0)]||!_0x142688[_0x4f69c2(0x106)](_0x134b7c=>/\.m?js(?:[?#]|$)/i['test'](_0x134b7c)))throw CliErrors['validation'](_0x4f69c2(0xcb));return _0x142688;}function prepare(_0x3bb4ff,_0x360fc9,_0xfdd92c){const _0x5f28c0=a189_0x41ff96;if(!Number['isSafeInteger'](_0x3bb4ff['id'])||(_0x3bb4ff['id']??0x0)<=0x0||typeof _0x3bb4ff[_0x5f28c0(0x114)]!==_0x5f28c0(0x111)||!_0x3bb4ff[_0x5f28c0(0x114)])throw CliErrors['validation']('App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.');const _0x8f00f8=parseObject(_0x3bb4ff[_0x5f28c0(0xdc)],_0x5f28c0(0x105)),_0x1cff6f=Object[_0x5f28c0(0x10a)](_0x8f00f8)[_0x5f28c0(0xf6)](_0x216867=>!KNOWN_EXTEND_KEYS[_0x5f28c0(0xeb)](_0x216867));if(_0x1cff6f['length'])throw CliErrors['validation'](_0x5f28c0(0xe0)+_0x1cff6f[_0x5f28c0(0xd5)](',\x20')+_0x5f28c0(0xe7));if(typeof _0x8f00f8[_0x5f28c0(0xce)]!==_0x5f28c0(0x111))throw CliErrors['validation']('app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.');const _0x432c56=parseArray(_0x8f00f8[_0x5f28c0(0xce)],_0x5f28c0(0xdd)),_0x2e559a=_0x432c56[_0x5f28c0(0xf6)](_0x5e25f0=>_0x5e25f0['appName']===_0x360fc9);if(_0x2e559a[_0x5f28c0(0xf0)]!==0x1)throw CliErrors[_0x5f28c0(0xfe)](_0x5f28c0(0x116)+_0x360fc9+_0x5f28c0(0xd0)+_0x2e559a[_0x5f28c0(0xf0)]+'.');const _0x2b39ce=_0x2e559a[0x0];if(typeof _0x2b39ce[_0x5f28c0(0xc6)]!=='string')throw CliErrors[_0x5f28c0(0xfe)](_0x5f28c0(0xcd));let _0x576c2d;try{_0x576c2d=JSON[_0x5f28c0(0xe6)](_0x2b39ce[_0x5f28c0(0xc6)]);}catch{throw CliErrors[_0x5f28c0(0xfe)](_0x5f28c0(0xe5));}if(!Array[_0x5f28c0(0xde)](_0x576c2d)||_0x576c2d[_0x5f28c0(0x106)](_0x3759cb=>typeof _0x3759cb!==_0x5f28c0(0x111)))throw CliErrors[_0x5f28c0(0xfe)](_0x5f28c0(0xfc));const _0xeddafd=_0x432c56[_0x5f28c0(0xe9)](_0x4aed43=>_0x4aed43===_0x2b39ce?{..._0x4aed43,'resources':JSON[_0x5f28c0(0x103)](_0xfdd92c)}:_0x4aed43),_0x1d0a4f={..._0x8f00f8,'assets':JSON[_0x5f28c0(0x103)](_0xeddafd)},_0x2c56e0=createHash('sha256')[_0x5f28c0(0xd2)](JSON[_0x5f28c0(0x103)]({'appCode':_0x3bb4ff[_0x5f28c0(0xd3)],'id':_0x3bb4ff['id'],'appPublishStatus':_0x3bb4ff['appPublishStatus'],'extend':_0x8f00f8,'appName':_0x360fc9,'resources':_0xfdd92c}))[_0x5f28c0(0xfb)]('hex');return{'before':_0x576c2d,'nextExtend':_0x1d0a4f,'expectedHash':_0x2c56e0,'unchanged':isDeepStrictEqual(_0x576c2d,_0xfdd92c)};}function a189_0x3c58(){const _0x38fd6b=['--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','verified\x20app.extend','protocol','\x20contains\x20invalid\x20JSON.','length','resources[','939360QbzUyl','225TbZJRp','size','4998710QfQQUx','filter','subapp-assets-update','unchanged','\x20must\x20be\x20a\x20JSON\x20object.','App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.','digest','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','str','validation','menu','expected-hash','object','11LBukhn','stringify','before','app.extend','some','\x20in\x20menu\x20host\x20','--resources\x20is\x20required.','39471OULqjZ','keys','473862uqnlfx',';\x20independent\x20deployment\x20not\x20verified.','36296GSDQJy','\x20must\x20be\x20a\x20JSON\x20array.','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','apiError','string','entries','vipDeploy','appPublishStatus','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','nextExtend','enableAutoSync','resources','trim','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','test','2dwlwBo','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','assets','Would\x20update\x20shared\x20assets\x20for\x20',';\x20found\x20','accessKey','update','appCode','1190905aPRuEQ','join','not\x20HTTPS','6QKujfj','enableOpenApi','tenantColumn','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','directDbId','extend','app.extend.assets','isArray','998438hSnIXg','Unknown\x20app.extend\x20fields:\x20','enableSample','Updated\x20shared\x20resources\x20for\x20','skinColor','cookie','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','parse','.\x20Refusing\x20update.','expectedHash','map','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','has'];a189_0x3c58=function(){return _0x38fd6b;};return a189_0x3c58();}function flags(_0x35b41a){const _0x38111d=a189_0x41ff96,{appCode:_0x1bc01e,appName:_0xcf6177}=getSubappSelector(_0x35b41a),_0x4fdee6=_0x35b41a[_0x38111d(0xfd)](_0x38111d(0xc6))[_0x38111d(0xc7)]();if(!_0x4fdee6)throw CliErrors[_0x38111d(0xfe)](_0x38111d(0x108));let _0x2b8c3a;try{_0x2b8c3a=JSON[_0x38111d(0xe6)](_0x4fdee6);}catch{throw CliErrors[_0x38111d(0xfe)]('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');}if(!Array[_0x38111d(0xde)](_0x2b8c3a))throw CliErrors[_0x38111d(0xfe)](_0x38111d(0xec));return{'appCode':_0x1bc01e,'appName':_0xcf6177,'resources':validateResources(_0x2b8c3a)};}export const menuSubappAssetsUpdate={'service':a189_0x41ff96(0xff),'command':a189_0x41ff96(0xf7),'description':a189_0x41ff96(0xea),'risk':'write','strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a189_0x41ff96(0xc6),'type':a189_0x41ff96(0x111),'required':!![],'description':a189_0x41ff96(0xda)},{'name':a189_0x41ff96(0x100),'type':a189_0x41ff96(0x111),'description':a189_0x41ff96(0x10f)}],async 'validate'(_0x89ffdf){flags(_0x89ffdf);},async 'dryRun'(_0xd91626){const _0x587747=a189_0x41ff96,{appCode:_0x41042a,appName:_0xaabb22,resources:_0x3299c0}=flags(_0xd91626),_0x239f7e=await getSmartAppRecord(_0x41042a,_0xd91626[_0x587747(0xe4)]),_0x3102ad=prepare(_0x239f7e,_0xaabb22,_0x3299c0);return{'method':'POST','url':'/smartapi/app/update','body':{'preview':{'appCode':_0x41042a,'appName':_0xaabb22,'before':_0x3102ad[_0x587747(0x104)],'after':_0x3299c0,'expectedHash':_0x3102ad[_0x587747(0xe8)],'unchanged':_0x3102ad['unchanged'],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x3102ad['unchanged']?_0x587747(0xc8):_0x587747(0xcf)+_0xaabb22+'.'};},async 'execute'(_0x33b7c5){const _0x2701fc=a189_0x41ff96,{appCode:_0x5ad594,appName:_0xf17923,resources:_0x38880d}=flags(_0x33b7c5),_0x5c94fc=_0x33b7c5[_0x2701fc(0xfd)](_0x2701fc(0x100))[_0x2701fc(0xc7)]();if(!/^[a-f0-9]{64}$/i[_0x2701fc(0xc9)](_0x5c94fc))throw CliErrors[_0x2701fc(0xfe)]('--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.');const _0x397570=await getSmartAppRecord(_0x5ad594,_0x33b7c5[_0x2701fc(0xe4)]),_0x27fbc3=prepare(_0x397570,_0xf17923,_0x38880d);if(_0x5c94fc!==_0x27fbc3[_0x2701fc(0xe8)])throw CliErrors['validation']('App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.');if(_0x27fbc3[_0x2701fc(0xf8)])return{'ok':!![],'data':{'appCode':_0x5ad594,'appName':_0xf17923,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x2701fc(0xcc)};await updateSmartAppRecord({'id':_0x397570['id'],'appCode':_0x5ad594,'appPublishStatus':_0x397570[_0x2701fc(0x114)],'extend':_0x27fbc3[_0x2701fc(0x117)]},_0x33b7c5[_0x2701fc(0xe4)]);const _0x4a3743=await getSmartAppRecord(_0x5ad594,_0x33b7c5[_0x2701fc(0xe4)]),_0x11c6b4=parseObject(_0x4a3743[_0x2701fc(0xdc)],_0x2701fc(0xed));if(_0x4a3743['id']!==_0x397570['id']||_0x4a3743['appPublishStatus']!==_0x397570['appPublishStatus']||!isDeepStrictEqual(_0x11c6b4,_0x27fbc3[_0x2701fc(0x117)]))throw CliErrors[_0x2701fc(0x110)](_0x2701fc(0xfa));return{'ok':!![],'data':{'appCode':_0x5ad594,'appName':_0xf17923,'updated':!![],'resources':_0x38880d,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x2701fc(0xe2)+_0xf17923+_0x2701fc(0x107)+_0x5ad594+_0x2701fc(0x10c)};}};
|