@lovrabet/rabetbase-cli 2.5.4-beta.4 → 2.5.4-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- 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.d.ts +2 -0
- package/lib/commands/app/detail.js +1 -0
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.d.ts +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.d.ts +3 -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.d.ts +2 -0
- package/lib/commands/menu/shared/path.js +1 -0
- package/lib/commands/menu/shared/service.d.ts +6 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.d.ts +28 -0
- package/lib/commands/menu/shared/subapp-assets.js +1 -0
- package/lib/commands/menu/shared/sync-core.d.ts +2 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/types.d.ts +14 -4
- 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.d.ts +2 -0
- package/lib/commands/menu/subapp-assets-status.js +1 -0
- package/lib/commands/menu/subapp-assets-update.d.ts +2 -0
- package/lib/commands/menu/subapp-assets-update.js +1 -0
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +15 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +21 -12
- package/skills/rabetbase/guides/backend-function.md +2 -7
- package/skills/rabetbase/guides/bff-creation-workflow.md +24 -23
- package/skills/rabetbase/guides/host-frontend-integration.md +62 -0
- package/skills/rabetbase/guides/independent-deployment.md +45 -0
- package/skills/rabetbase/guides/troubleshooting.md +9 -1
- package/skills/rabetbase/references/rabetbase-app-detail.md +31 -0
- package/skills/rabetbase/references/rabetbase-bff-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-push.md +2 -2
- package/skills/rabetbase/references/rabetbase-data-list-status.md +1 -0
- package/skills/rabetbase/references/rabetbase-deployment-sync-all.md +5 -1
- package/skills/rabetbase/references/rabetbase-menu-asset-update.md +9 -7
- package/skills/rabetbase/references/rabetbase-menu-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-menu-subapp-assets-status.md +19 -0
- package/skills/rabetbase/references/rabetbase-menu-subapp-assets-update.md +27 -0
- package/skills/rabetbase/references/rabetbase-menu-sync.md +40 -14
- package/skills/rabetbase/references/rabetbase-page-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-generate-start.md +5 -3
- package/skills/rabetbase/references/rabetbase-page-generate-status.md +1 -0
- package/skills/rabetbase.manifest.json +8 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x10b1ba,_0x11adea){const _0x518ac1=a171_0x3162,_0x649e86=_0x10b1ba();while(!![]){try{const _0x3396a9=parseInt(_0x518ac1(0x1c0))/0x1+-parseInt(_0x518ac1(0x1c7))/0x2*(parseInt(_0x518ac1(0x1c3))/0x3)+-parseInt(_0x518ac1(0x1b8))/0x4+parseInt(_0x518ac1(0x1bc))/0x5+parseInt(_0x518ac1(0x1c4))/0x6*(parseInt(_0x518ac1(0x1cf))/0x7)+parseInt(_0x518ac1(0x1af))/0x8+-parseInt(_0x518ac1(0x1c9))/0x9*(parseInt(_0x518ac1(0x1c1))/0xa);if(_0x3396a9===_0x11adea)break;else _0x649e86['push'](_0x649e86['shift']());}catch(_0x5d7715){_0x649e86['push'](_0x649e86['shift']());}}}(a171_0x4c43,0xe0ca9));function a171_0x4c43(){const _0x147d1f=['create-menus','333VlLJdw','update-menu-cdn-url','procode','order','path','number','21uhtesf','boolean','Start\x20batch\x20menu\x20creation,\x20total\x20','map','import','Delete\x20','Regroup\x20','visible','Menu\x20assets\x20synced:\x20','get-online-menu-list','menuGroups','resources','3427592fhmFxp','Fetched\x20','parentId','info','create-menu','Menu\x20created\x20successfully:\x20','loadScriptMode','stringify','total','187608BLcLft','Create\x20menu\x20\x22','extend','appName','6662145XywGvy','\x20menu\x20group(s)','all','label','940252RfvAVO','240440hpUJgV','Creating\x20menu:\x20','63aEoIOr','1620042LauJTm','Update\x20menu\x20','length','157512zDgDHF'];a171_0x4c43=function(){return _0x147d1f;};return a171_0x4c43();}import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a171_0x11513c,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x57e60a,_0x3b0b56){const _0x2e50b3=a171_0x3162,_0x332e3e=getEnv();logger[_0x2e50b3(0x1b2)](_0x2e50b3(0x1d8),isProduction(_0x332e3e)?'Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'+_0x57e60a+')':'Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20'+_0x57e60a+')');const _0x105310=await fetchMenuSnapshot(_0x57e60a,_0x3b0b56,{'verbose':!![]});return logger['info'](_0x2e50b3(0x1d8),_0x2e50b3(0x1b0)+_0x105310[_0x2e50b3(0x1b7)]+'\x20online\x20menus\x20successfully'),_0x105310['menus']['map'](toProcessedMenuItem);}export async function createMenu(_0x369304,_0x4a1907,_0x183c11){const _0x56f389=a171_0x3162;logger[_0x56f389(0x1b2)]('create-menu',_0x56f389(0x1c2)+_0x183c11[_0x56f389(0x1bf)]+'\x20('+_0x183c11['path']+')');const _0x41dc96={'appCode':_0x369304,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x56f389(0x1d3),'resources':_0x183c11[_0x56f389(0x1da)]?JSON[_0x56f389(0x1b6)](_0x183c11[_0x56f389(0x1da)]):undefined},..._0x183c11},_0x3f186a=await createMenuRecord(_0x41dc96,_0x4a1907,_0x56f389(0x1b9)+_0x183c11['label']+'\x22');return logger[_0x56f389(0x1b2)](_0x56f389(0x1b3),_0x56f389(0x1b4)+_0x183c11['label']),_0x3f186a;}async function createSingleMenu(_0x3fa2f7,_0x56fbdf,_0x2ccb62,_0x397e6e,_0x2f4169){const _0x12470d=a171_0x3162,_0x4ae0ce={'appCode':_0x3fa2f7,'type':_0x12470d(0x1cb),'sort':_0x12470d(0x1cc)in _0x2ccb62&&typeof _0x2ccb62[_0x12470d(0x1cc)]===_0x12470d(0x1ce)?_0x2ccb62[_0x12470d(0x1cc)]:0x0,..._0x12470d(0x1d6)in _0x2ccb62&&typeof _0x2ccb62[_0x12470d(0x1d6)]===_0x12470d(0x1d0)?{'visible':_0x2ccb62[_0x12470d(0x1d6)]}:{},..._0x12470d(0x1b1)in _0x2ccb62&&typeof _0x2ccb62[_0x12470d(0x1b1)]===_0x12470d(0x1ce)?{'parentId':_0x2ccb62['parentId']}:{},'extend':{..._0x2f4169?.[_0x12470d(0x1bb)]?{'appName':_0x2f4169[_0x12470d(0x1bb)]}:{},'loadScriptMode':_0x12470d(0x1d3),'resources':_0x397e6e?JSON[_0x12470d(0x1b6)](_0x397e6e):undefined},'label':_0x2ccb62[_0x12470d(0x1bf)],'path':_0x2ccb62[_0x12470d(0x1cd)]},_0x58cbae=await createMenuRecord(_0x4ae0ce,_0x56fbdf,_0x12470d(0x1b9)+_0x2ccb62[_0x12470d(0x1bf)]+'\x22');return logger[_0x12470d(0x1b2)](_0x12470d(0x1b3),_0x12470d(0x1b4)+_0x2ccb62[_0x12470d(0x1bf)]),_0x58cbae;}export async function createMenus(_0x243555,_0x167f06,_0x1badb4,_0xa89852,_0x13137c){const _0xe28248=a171_0x3162;logger['info'](_0xe28248(0x1c8),_0xe28248(0x1d1)+_0x1badb4[_0xe28248(0x1c6)]);const _0x117a3b=await Promise[_0xe28248(0x1be)](_0x1badb4[_0xe28248(0x1d2)](_0x33c484=>createSingleMenu(_0x243555,_0x167f06,_0x33c484,_0xa89852,_0x13137c)));return logger[_0xe28248(0x1b2)]('create-menus','Batch\x20menu\x20creation\x20completed,\x20total\x20'+_0x1badb4['length']),_0x117a3b;}export async function updateMenuCdnUrl(_0x45757e,_0x4e507b,_0x4b5016){const _0x1b2ff2=a171_0x3162;logger[_0x1b2ff2(0x1b2)](_0x1b2ff2(0x1ca),'Updating\x20menu\x20asset\x20links:\x20'+_0x4b5016[_0x1b2ff2(0x1bf)]+'\x20('+_0x4b5016['path']+')');const _0x51bb52={'id':_0x4b5016['id'],'appCode':_0x45757e,'extend':{..._0x4b5016[_0x1b2ff2(0x1ba)]??{},..._0x4b5016[_0x1b2ff2(0x1b5)]?{'loadScriptMode':_0x4b5016['loadScriptMode']}:{},'resources':_0x4b5016[_0x1b2ff2(0x1da)]?JSON['stringify'](_0x4b5016[_0x1b2ff2(0x1da)]):undefined}},_0x44ba88=await updateMenuRecord(_0x51bb52,_0x4e507b,'Update\x20menu\x20assets\x20\x22'+_0x4b5016[_0x1b2ff2(0x1bf)]+'\x22');return logger['info'](_0x1b2ff2(0x1ca),_0x1b2ff2(0x1d7)+_0x4b5016['label'],undefined),_0x44ba88;}export async function createMenuEntity(_0x19b1b2,_0x3de616,_0xcf668a){const _0x36adec=a171_0x3162;return createMenuRecord({'appCode':_0x19b1b2,..._0xcf668a},_0x3de616,_0x36adec(0x1b9)+_0xcf668a[_0x36adec(0x1bf)]+'\x22');}function a171_0x3162(_0x247a72,_0x31db0e){_0x247a72=_0x247a72-0x1af;const _0x4c4360=a171_0x4c43();let _0x3162f3=_0x4c4360[_0x247a72];return _0x3162f3;}export async function updateMenuEntity(_0x6ebf9,_0x310b50,_0x3b7b73){const _0x3572b9=a171_0x3162;return updateMenuRecord({'appCode':_0x6ebf9,..._0x3b7b73},_0x310b50,_0x3572b9(0x1c5)+_0x3b7b73['id']);}export async function batchDeleteMenuEntities(_0x23e712,_0x2df3dd){const _0x56bec2=a171_0x3162;return batchDeleteMenuRecords(_0x2df3dd,_0x23e712,_0x56bec2(0x1d4)+_0x2df3dd[_0x56bec2(0x1c6)]+'\x20menu'+(_0x2df3dd['length']===0x1?'':'s'));}export async function startMenuRegroup(_0x2ac669,_0x3073bf){const _0x56f11e=a171_0x3162;return a171_0x11513c(_0x3073bf,_0x2ac669,_0x56f11e(0x1d5)+_0x3073bf[_0x56f11e(0x1d9)]['length']+_0x56f11e(0x1bd));}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SmartAppRecord } from "../../../core/api-client.js";
|
|
2
|
+
import type { ProcessedMenuItem } from "../../../commands/menu/shared/types.js";
|
|
3
|
+
import type { FlagDef, RuntimeContext } from "../../../framework/types.js";
|
|
4
|
+
export declare function buildSubappAssetsStatus(app: Pick<SmartAppRecord, "extend">, menus: ProcessedMenuItem[], appName: string): {
|
|
5
|
+
appName: string;
|
|
6
|
+
hostCapabilityVerified: boolean;
|
|
7
|
+
sharedConfigured: boolean;
|
|
8
|
+
sharedResources: string[];
|
|
9
|
+
loadScriptMode: {} | null;
|
|
10
|
+
basename: {} | null;
|
|
11
|
+
boundMenus: number;
|
|
12
|
+
staleMenuFallbacks: number;
|
|
13
|
+
menus: {
|
|
14
|
+
id: number;
|
|
15
|
+
path: string;
|
|
16
|
+
preferredSourceIfSupported: string;
|
|
17
|
+
preferredResourcesIfSupported: string[] | null;
|
|
18
|
+
menuFallbackResources: string[] | null;
|
|
19
|
+
menuFallbackError: string | null;
|
|
20
|
+
fallbackDiffers: boolean | null;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
export declare function assertSharedResourcesConfigured(appCode: string, cookie: string, appName: string): Promise<void>;
|
|
24
|
+
export declare const SUBAPP_ASSET_SELECTOR_FLAGS: FlagDef[];
|
|
25
|
+
export declare function getSubappSelector(ctx: Pick<RuntimeContext, "str" | "appCode">): {
|
|
26
|
+
appCode: string;
|
|
27
|
+
appName: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a172_0x5da411=a172_0x2079;function a172_0x59a1(){const _0x52402f=['filter','assets','Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app','5385810LdmJXh','18JHpnuJ','app.extend.assets[','No\x20shared\x20resources\x20configured\x20for\x20','2960001jatDpi','length','55zhYwWL','--app-name\x20is\x20required.','string','Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','763180GYVNMe','21nrUUjv','6wgjsra','fallbackDiffers','app.extend','app-name','\x20resources','2738iaoBrM','sharedResources','path','11676904XtHapf','validation','isArray','48713TGluQn','appCode','loadScriptMode','menu\x20','map','resources','1617684tZGlTc','object','extend','subapp.resources','app.extend.assets\x20must\x20be\x20an\x20array.','menu','appName','\x20must\x20be\x20a\x20JSON\x20object.','app.extend.assets','some','basename','sharedConfigured','stringify','app','4eEqvWi'];a172_0x59a1=function(){return _0x52402f;};return a172_0x59a1();}(function(_0x587713,_0x279e09){const _0x1e0009=a172_0x2079,_0x3c6c3b=_0x587713();while(!![]){try{const _0x2dc6df=parseInt(_0x1e0009(0x1af))/0x1*(parseInt(_0x1e0009(0x1b5))/0x2)+parseInt(_0x1e0009(0x1d7))/0x3+-parseInt(_0x1e0009(0x1cf))/0x4*(-parseInt(_0x1e0009(0x1ae))/0x5)+parseInt(_0x1e0009(0x1b0))/0x6*(parseInt(_0x1e0009(0x1bb))/0x7)+parseInt(_0x1e0009(0x1b8))/0x8+parseInt(_0x1e0009(0x1d4))/0x9*(-parseInt(_0x1e0009(0x1d3))/0xa)+parseInt(_0x1e0009(0x1aa))/0xb*(-parseInt(_0x1e0009(0x1c1))/0xc);if(_0x2dc6df===_0x279e09)break;else _0x3c6c3b['push'](_0x3c6c3b['shift']());}catch(_0x1aaa68){_0x3c6c3b['push'](_0x3c6c3b['shift']());}}}(a172_0x59a1,0xd7ae3));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{CliErrors}from'../../../errors.js';function objectValue(_0x2fa85d,_0x41d26c){const _0x119bec=a172_0x2079,_0xabf64=typeof _0x2fa85d===_0x119bec(0x1ac)?parseJson(_0x2fa85d,_0x41d26c):_0x2fa85d;if(!_0xabf64||typeof _0xabf64!==_0x119bec(0x1c2)||Array[_0x119bec(0x1ba)](_0xabf64))throw CliErrors['validation'](_0x41d26c+_0x119bec(0x1c8));return _0xabf64;}function parseJson(_0xbbec6a,_0x42055e){const _0xc4a14f=a172_0x2079;try{return JSON['parse'](_0xbbec6a);}catch{throw CliErrors[_0xc4a14f(0x1b9)](_0x42055e+'\x20contains\x20invalid\x20JSON.');}}function a172_0x2079(_0x4cbf29,_0x29cc81){_0x4cbf29=_0x4cbf29-0x1a9;const _0x59a18c=a172_0x59a1();let _0x207950=_0x59a18c[_0x4cbf29];return _0x207950;}function resourceList(_0x3eb404,_0xf35425){const _0x38a882=a172_0x2079;if(typeof _0x3eb404!=='string')throw CliErrors[_0x38a882(0x1b9)](_0xf35425+'\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.');const _0x1e7fbd=parseJson(_0x3eb404,_0xf35425);if(!Array[_0x38a882(0x1ba)](_0x1e7fbd)||_0x1e7fbd[_0x38a882(0x1ca)](_0x1e86cf=>typeof _0x1e86cf!==_0x38a882(0x1ac)))throw CliErrors['validation'](_0xf35425+'\x20must\x20be\x20an\x20array\x20of\x20URLs.');return _0x1e7fbd;}export function buildSubappAssetsStatus(_0x41dc82,_0x10c650,_0x335b2c){const _0x2ca849=a172_0x2079,_0x492a38=_0x41dc82[_0x2ca849(0x1c3)]==null?{}:objectValue(_0x41dc82[_0x2ca849(0x1c3)],_0x2ca849(0x1b2)),_0xc6810e=_0x492a38[_0x2ca849(0x1d1)]==null?[]:typeof _0x492a38[_0x2ca849(0x1d1)]==='string'?parseJson(_0x492a38[_0x2ca849(0x1d1)],_0x2ca849(0x1c9)):_0x492a38[_0x2ca849(0x1d1)];if(!Array[_0x2ca849(0x1ba)](_0xc6810e))throw CliErrors[_0x2ca849(0x1b9)](_0x2ca849(0x1c5));const _0x1be064=_0xc6810e[_0x2ca849(0x1bf)]((_0x43d01f,_0xe90898)=>objectValue(_0x43d01f,_0x2ca849(0x1d5)+_0xe90898+']')),_0x418c27=_0x1be064[_0x2ca849(0x1d0)](_0x50e275=>_0x50e275[_0x2ca849(0x1c7)]===_0x335b2c);if(_0x418c27[_0x2ca849(0x1a9)]>0x1)throw CliErrors[_0x2ca849(0x1b9)]('Duplicate\x20subapp\x20records\x20for\x20'+_0x335b2c+'.');const _0x1953f9=_0x418c27[0x0],_0x2b7dfc=_0x1953f9?.['resources']==null?[]:resourceList(_0x1953f9[_0x2ca849(0x1c0)],_0x2ca849(0x1c4)),_0x5ecf0f=_0x10c650[_0x2ca849(0x1d0)](_0x107d9a=>_0x107d9a[_0x2ca849(0x1c3)]?.[_0x2ca849(0x1c7)]===_0x335b2c),_0x25edc0=_0x5ecf0f[_0x2ca849(0x1bf)](_0x4752ea=>{const _0x1cddf5=_0x2ca849;let _0x312c9a=null,_0x36b926=null;try{_0x312c9a=_0x4752ea['extend']?.[_0x1cddf5(0x1c0)]==null?_0x4752ea[_0x1cddf5(0x1c0)]:resourceList(_0x4752ea[_0x1cddf5(0x1c3)]['resources'],_0x1cddf5(0x1be)+_0x4752ea['id']+_0x1cddf5(0x1b4));}catch(_0x3bbcac){_0x36b926=_0x3bbcac instanceof Error?_0x3bbcac['message']:String(_0x3bbcac);}const _0x2cc83b=_0x2b7dfc[_0x1cddf5(0x1a9)]>0x0?_0x1cddf5(0x1ce):_0x1cddf5(0x1c6),_0x22ad96=_0x2cc83b===_0x1cddf5(0x1ce)?_0x2b7dfc:_0x312c9a;return{'id':_0x4752ea['id'],'path':_0x4752ea[_0x1cddf5(0x1b7)],'preferredSourceIfSupported':_0x2cc83b,'preferredResourcesIfSupported':_0x22ad96,'menuFallbackResources':_0x312c9a,'menuFallbackError':_0x36b926,'fallbackDiffers':_0x312c9a===null?null:_0x2cc83b===_0x1cddf5(0x1ce)&&_0x312c9a[_0x1cddf5(0x1a9)]>0x0&&JSON[_0x1cddf5(0x1cd)](_0x312c9a)!==JSON['stringify'](_0x22ad96)};});return{'appName':_0x335b2c,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x1953f9),'sharedResources':_0x2b7dfc,'loadScriptMode':_0x1953f9?.[_0x2ca849(0x1bd)]??null,'basename':_0x1953f9?.[_0x2ca849(0x1cb)]??null,'boundMenus':_0x25edc0[_0x2ca849(0x1a9)],'staleMenuFallbacks':_0x25edc0[_0x2ca849(0x1d0)](_0x569bc4=>_0x569bc4[_0x2ca849(0x1b1)])[_0x2ca849(0x1a9)],'menus':_0x25edc0};}export async function assertSharedResourcesConfigured(_0x5a72b6,_0x3d96ae,_0x386429){const _0x541e32=a172_0x2079,_0x3f51af=await getSmartAppRecord(_0x5a72b6,_0x3d96ae),_0x24cac1=buildSubappAssetsStatus(_0x3f51af,[],_0x386429);if(!_0x24cac1[_0x541e32(0x1cc)]||_0x24cac1[_0x541e32(0x1b6)]['length']===0x0)throw CliErrors['validation'](_0x541e32(0x1d6)+_0x386429+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':a172_0x5da411(0x1d2)},{'name':a172_0x5da411(0x1b3),'type':a172_0x5da411(0x1ac),'required':!![],'description':a172_0x5da411(0x1ad)}];export function getSubappSelector(_0x57b2ca){const _0x12d093=a172_0x5da411,_0x1c92a0=_0x57b2ca[_0x12d093(0x1bc)],_0x8e8784=_0x57b2ca['str'](_0x12d093(0x1b3))['trim']();if(!_0x8e8784)throw CliErrors[_0x12d093(0x1b9)](_0x12d093(0x1ab));return{'appCode':_0x1c92a0,'appName':_0x8e8784};}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { MenuSyncParams, SyncResult } from "../../../commands/menu/shared/types.js";
|
|
1
|
+
import type { LocalPage, MenuSyncParams, ProcessedMenuItem, SyncResult } from "../../../commands/menu/shared/types.js";
|
|
2
2
|
interface MenuSyncOptions {
|
|
3
3
|
dryRun?: boolean;
|
|
4
4
|
}
|
|
5
|
+
export declare function resolvePage(page: LocalPage, params: MenuSyncParams, online: ProcessedMenuItem[]): LocalPage;
|
|
5
6
|
export declare function runMenuSyncCore(appCode: string, cookie: string, selectedPaths?: string[], paramsFlag?: string, options?: MenuSyncOptions): Promise<SyncResult>;
|
|
6
7
|
export declare function parseMenuSyncParams(paramsFlag: unknown): MenuSyncParams;
|
|
7
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a170_0x34ce01=a170_0x509a;function a170_0x37c3(){const _0xb200cf=['1457218XRPNii','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','hasOwn','Invalid\x20--params\x20JSON.','Invalid\x20--params:\x20','push','253284lcYBHV','isArray','3320XDpmhL','No\x20local\x20pages\x20matched\x20paths:\x20','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','3079470Zpetvm','CSS\x20URL\x20is\x20unreachable:\x20','keys','jsUrl','get','Invalid\x20--params.','length','cwd','object','3807ujJBfO','trim','cssUrl','Menu\x20sync\x20completed','path','procode','pages','menu-sync','dryRun','57960wcZctc','JS\x20URL\x20is\x20unreachable:\x20','\x0a\x20\x20Available\x20local\x20paths:\x20','has','Start\x20non-interactive\x20menu\x20sync','filter','setLogPath','map','string','65154KNdgMN','16FeuESB','50DZhglq','join','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','info','parse','274296vFTFNb','import'];a170_0x37c3=function(){return _0xb200cf;};return a170_0x37c3();}(function(_0x5abb24,_0x34b926){const _0x35d6b2=a170_0x509a,_0x7560d6=_0x5abb24();while(!![]){try{const _0x389923=parseInt(_0x35d6b2(0x14d))/0x1+parseInt(_0x35d6b2(0x145))/0x2+-parseInt(_0x35d6b2(0x135))/0x3*(parseInt(_0x35d6b2(0x13f))/0x4)+-parseInt(_0x35d6b2(0x140))/0x5*(parseInt(_0x35d6b2(0x13e))/0x6)+-parseInt(_0x35d6b2(0x147))/0x7+parseInt(_0x35d6b2(0x14f))/0x8*(-parseInt(_0x35d6b2(0x12c))/0x9)+parseInt(_0x35d6b2(0x152))/0xa;if(_0x389923===_0x34b926)break;else _0x7560d6['push'](_0x7560d6['shift']());}catch(_0x3bae64){_0x7560d6['push'](_0x7560d6['shift']());}}}(a170_0x37c3,0x1f716));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';const MENU_SYNC_PARAM_KEYS=new Set([a170_0x34ce01(0x155),a170_0x34ce01(0x12e)]);function validateParams(_0xa5eaf0){const _0x19358a=a170_0x34ce01,_0x3584c8=[];return _0xa5eaf0['jsUrl']&&!isValidJsHttpsUrl(_0xa5eaf0['jsUrl'])&&_0x3584c8[_0x19358a(0x14c)]({'field':_0x19358a(0x155),'message':_0x19358a(0x142)}),_0xa5eaf0[_0x19358a(0x12e)]&&!isValidCssHttpsUrl(_0xa5eaf0[_0x19358a(0x12e)])&&_0x3584c8[_0x19358a(0x14c)]({'field':_0x19358a(0x12e),'message':_0x19358a(0x148)}),_0x3584c8;}function a170_0x509a(_0x461ce0,_0x153ad3){_0x461ce0=_0x461ce0-0x12b;const _0x37c3c4=a170_0x37c3();let _0x509a1a=_0x37c3c4[_0x461ce0];return _0x509a1a;}export async function runMenuSyncCore(_0x1f4a77,_0x327e07,_0x36182f=[],_0x4a56cb,_0x41b038={}){const _0x14b7ce=a170_0x34ce01,_0x88eece=parseMenuSyncParams(_0x4a56cb),_0x291af8=[...new Set(_0x36182f[_0x14b7ce(0x13c)](_0x33f010=>_0x33f010[_0x14b7ce(0x12d)]())[_0x14b7ce(0x13a)](Boolean))],_0x2b1cd5=_0x88eece[_0x14b7ce(0x155)],_0x552c20=_0x88eece[_0x14b7ce(0x12e)],_0x253c4d=[];if(_0x2b1cd5)_0x253c4d['push'](_0x2b1cd5);if(_0x552c20)_0x253c4d['push'](_0x552c20);const _0x444ab5=validateParams(_0x88eece);if(_0x444ab5[_0x14b7ce(0x158)]>0x0){const _0x33f0ed=_0x444ab5[_0x14b7ce(0x13c)](_0x3806c6=>'--params.'+_0x3806c6['field']+':\x20'+_0x3806c6['message'])[_0x14b7ce(0x141)](';\x20');throw new Error(_0x14b7ce(0x14b)+_0x33f0ed);}logger[_0x14b7ce(0x13b)](process[_0x14b7ce(0x159)]()),logger[_0x14b7ce(0x143)](_0x14b7ce(0x133),_0x14b7ce(0x139),{'appCode':_0x1f4a77,'selectedCount':_0x291af8[_0x14b7ce(0x158)],'jsUrl':_0x2b1cd5,'cssUrl':_0x552c20});if(_0x2b1cd5){const _0x2c619f=await isUrlReachable(_0x2b1cd5);if(!_0x2c619f)throw new Error(_0x14b7ce(0x136)+_0x2b1cd5);}if(_0x552c20){const _0x58e946=await isUrlReachable(_0x552c20);if(!_0x58e946)throw new Error(_0x14b7ce(0x153)+_0x552c20);}const _0x522b1b=getLocalPages();if(_0x522b1b[_0x14b7ce(0x158)]===0x0){if(_0x291af8[_0x14b7ce(0x158)]>0x0)throw new Error(_0x14b7ce(0x150)+_0x291af8['join'](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x41b038[_0x14b7ce(0x134)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x1d0a0f=await getOnlineMenuList(_0x1f4a77,_0x327e07),_0x284b50=new Set(_0x1d0a0f[_0x14b7ce(0x13c)](_0x1d7cbc=>_0x1d7cbc[_0x14b7ce(0x130)]));let _0x19d5f0;if(_0x291af8[_0x14b7ce(0x158)]>0x0){const _0x130198=new Map(_0x522b1b[_0x14b7ce(0x13c)](_0x224b4c=>[_0x224b4c[_0x14b7ce(0x130)],_0x224b4c])),_0xe2abf7=_0x291af8[_0x14b7ce(0x13a)](_0x4106a7=>!_0x130198[_0x14b7ce(0x138)](_0x4106a7));if(_0xe2abf7[_0x14b7ce(0x158)]>0x0){const _0x3c307c=_0x522b1b[_0x14b7ce(0x13c)](_0x22578a=>_0x22578a[_0x14b7ce(0x130)])['join'](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0xe2abf7[_0x14b7ce(0x141)](',\x20')+_0x14b7ce(0x137)+_0x3c307c);}const _0x48d7f9=_0x291af8['filter'](_0x10dbc6=>_0x284b50['has'](_0x10dbc6));if(_0x48d7f9[_0x14b7ce(0x158)]>0x0)throw new Error(_0x14b7ce(0x151)+_0x48d7f9[_0x14b7ce(0x141)](',\x20'));_0x19d5f0=_0x291af8[_0x14b7ce(0x13c)](_0x48f27d=>_0x130198[_0x14b7ce(0x156)](_0x48f27d));}else _0x19d5f0=_0x522b1b[_0x14b7ce(0x13a)](_0x33f4b3=>!_0x284b50[_0x14b7ce(0x138)](_0x33f4b3[_0x14b7ce(0x130)]));if(_0x19d5f0['length']===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x41b038[_0x14b7ce(0x134)]===!![],'targetPages':[],'plannedMenus':[]};const _0x5f373f=_0x19d5f0['map'](_0x32f01=>({'type':_0x14b7ce(0x131),'path':_0x32f01[_0x14b7ce(0x130)],'label':_0x32f01['label'],'loadScriptMode':_0x14b7ce(0x146),'resources':[..._0x253c4d]}));if(_0x41b038[_0x14b7ce(0x134)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x19d5f0,'plannedMenus':_0x5f373f};const _0x4cd962=await createMenus(_0x1f4a77,_0x327e07,_0x19d5f0,_0x253c4d[_0x14b7ce(0x158)]>0x0?_0x253c4d:undefined);return logger[_0x14b7ce(0x143)](_0x14b7ce(0x133),_0x14b7ce(0x12f),{'count':_0x19d5f0[_0x14b7ce(0x158)],'resources':_0x253c4d}),{'created':_0x4cd962[_0x14b7ce(0x158)],'skipped':![],'dryRun':![],'targetPages':_0x19d5f0,'plannedMenus':_0x5f373f,'menus':_0x4cd962};}export function parseMenuSyncParams(_0x5badb3){const _0x29e9b8=a170_0x34ce01;if(!_0x5badb3||typeof _0x5badb3!==_0x29e9b8(0x13d))return{};let _0x1aeb00;try{_0x1aeb00=JSON[_0x29e9b8(0x144)](_0x5badb3);}catch{throw new Error(_0x29e9b8(0x14a));}if(typeof _0x1aeb00!==_0x29e9b8(0x12b)||_0x1aeb00===null||Array[_0x29e9b8(0x14e)](_0x1aeb00))throw new Error('Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.');const _0x3f061c=_0x1aeb00;if(Object[_0x29e9b8(0x149)](_0x3f061c,_0x29e9b8(0x132)))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x19334d=Object[_0x29e9b8(0x154)](_0x3f061c)[_0x29e9b8(0x13a)](_0x32e7fb=>!MENU_SYNC_PARAM_KEYS[_0x29e9b8(0x138)](_0x32e7fb));if(_0x19334d['length']>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x19334d['join'](',\x20')+'.');for(const _0x4b7466 of MENU_SYNC_PARAM_KEYS){const _0x113aba=_0x3f061c[_0x4b7466];if(_0x113aba!==undefined&&(typeof _0x113aba!==_0x29e9b8(0x13d)||_0x113aba[_0x29e9b8(0x12d)]()===''))throw new Error(_0x29e9b8(0x157)+_0x4b7466+':\x20expected\x20a\x20non-empty\x20string.');}return{'jsUrl':typeof _0x3f061c['jsUrl']===_0x29e9b8(0x13d)?_0x3f061c[_0x29e9b8(0x155)][_0x29e9b8(0x12d)]():undefined,'cssUrl':typeof _0x3f061c['cssUrl']===_0x29e9b8(0x13d)?_0x3f061c[_0x29e9b8(0x12e)][_0x29e9b8(0x12d)]():undefined};}
|
|
1
|
+
const a173_0x97141b=a173_0x32e5;function a173_0x49f9(){const _0x27fb6=['get','cwd','isInteger','JS\x20URL\x20is\x20unreachable:\x20','No\x20local\x20pages\x20matched\x20paths:\x20','pages','340WfPtof','number','CSS\x20URL\x20is\x20unreachable:\x20','order','2653ZpOaCV','Invalid\x20--params:\x20','label','has','folder','import','length','Invalid\x20--params.','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','object','parentId','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','dryRun','\x22\x20for\x20','isArray','map','Invalid\x20--params\x20fields:\x20','visible','392IcsDvR','33478wjxEPz','push','hasOwn','group','cssUrl','filter','message','procode','Start\x20non-interactive\x20menu\x20sync','parse','31206VHkzKY','appName',';\x20found\x20','info','trim','join','setLogPath','string',':\x20expected\x20a\x20non-empty\x20string.','245680QCPdyF','menu-sync','35780EgrZdE','field','2954727KCoRzf','boolean','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','30wCEQHn','--params.','keys','jsUrl','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','path','Menu\x20sync\x20completed','436310WWbeAn','\x0a\x20\x20Available\x20local\x20paths:\x20','type'];a173_0x49f9=function(){return _0x27fb6;};return a173_0x49f9();}function a173_0x32e5(_0x23e7ef,_0x3c1158){_0x23e7ef=_0x23e7ef-0x1a8;const _0x49f997=a173_0x49f9();let _0x32e511=_0x49f997[_0x23e7ef];return _0x32e511;}(function(_0x238753,_0x467fa3){const _0x365343=a173_0x32e5,_0x12ba6c=_0x238753();while(!![]){try{const _0xff489e=parseInt(_0x365343(0x1db))/0x1+-parseInt(_0x365343(0x1ac))/0x2*(-parseInt(_0x365343(0x1b2))/0x3)+-parseInt(_0x365343(0x1aa))/0x4+parseInt(_0x365343(0x1c3))/0x5*(parseInt(_0x365343(0x1e5))/0x6)+-parseInt(_0x365343(0x1c7))/0x7*(-parseInt(_0x365343(0x1da))/0x8)+-parseInt(_0x365343(0x1ae))/0x9+parseInt(_0x365343(0x1ba))/0xa;if(_0xff489e===_0x467fa3)break;else _0x12ba6c['push'](_0x12ba6c['shift']());}catch(_0x546823){_0x12ba6c['push'](_0x12ba6c['shift']());}}}(a173_0x49f9,0x3a3bd));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set([a173_0x97141b(0x1b5),a173_0x97141b(0x1df),'appName',a173_0x97141b(0x1d9),'parentId']);export function resolvePage(_0x3b0a95,_0x297478,_0x276cea){const _0x548bbc=a173_0x97141b;let _0x575fb4=_0x297478['parentId']??_0x3b0a95[_0x548bbc(0x1d1)];if(_0x575fb4===undefined&&_0x3b0a95[_0x548bbc(0x1de)]){const _0x16b440=_0x276cea[_0x548bbc(0x1e0)](_0x42d8d0=>_0x42d8d0[_0x548bbc(0x1bc)]==='folder'&&_0x42d8d0['label']===_0x3b0a95['group']);if(_0x16b440['length']!==0x1)throw new Error('Expected\x20one\x20folder\x20named\x20\x22'+_0x3b0a95[_0x548bbc(0x1de)]+_0x548bbc(0x1d5)+_0x3b0a95[_0x548bbc(0x1b8)]+_0x548bbc(0x1e7)+_0x16b440['length']);_0x575fb4=_0x16b440[0x0]['id'];}if(_0x575fb4!==undefined&&_0x575fb4!==0x0&&_0x276cea[_0x548bbc(0x1e0)](_0x3b573f=>_0x3b573f['id']===_0x575fb4&&_0x3b573f[_0x548bbc(0x1bc)]===_0x548bbc(0x1cb))['length']!==0x1)throw new Error('Parent\x20'+_0x575fb4+_0x548bbc(0x1d2));return{..._0x3b0a95,..._0x575fb4===undefined?{}:{'parentId':_0x575fb4},..._0x297478['visible']===undefined?{}:{'visible':_0x297478['visible']}};}function validateParams(_0x2d75d0){const _0x259e45=a173_0x97141b,_0x39b127=[];return _0x2d75d0[_0x259e45(0x1b5)]&&!isValidJsHttpsUrl(_0x2d75d0[_0x259e45(0x1b5)])&&_0x39b127[_0x259e45(0x1dc)]({'field':'jsUrl','message':_0x259e45(0x1d3)}),_0x2d75d0[_0x259e45(0x1df)]&&!isValidCssHttpsUrl(_0x2d75d0[_0x259e45(0x1df)])&&_0x39b127[_0x259e45(0x1dc)]({'field':_0x259e45(0x1df),'message':_0x259e45(0x1cf)}),_0x39b127;}export async function runMenuSyncCore(_0x8bc673,_0x5b4a08,_0x392d03=[],_0x342a6a,_0x594081={}){const _0x42c6f4=a173_0x97141b,_0x11be51=parseMenuSyncParams(_0x342a6a),_0xe05642=[...new Set(_0x392d03[_0x42c6f4(0x1d7)](_0x4553d9=>_0x4553d9[_0x42c6f4(0x1e9)]())[_0x42c6f4(0x1e0)](Boolean)[_0x42c6f4(0x1d7)](menuPathKey))],_0x63b328=_0x11be51[_0x42c6f4(0x1b5)],_0xde714f=_0x11be51[_0x42c6f4(0x1df)],_0x549b2=[];if(_0x63b328)_0x549b2['push'](_0x63b328);if(_0xde714f)_0x549b2[_0x42c6f4(0x1dc)](_0xde714f);const _0x4f891a=validateParams(_0x11be51);if(_0x4f891a[_0x42c6f4(0x1cd)]>0x0){const _0x222b74=_0x4f891a[_0x42c6f4(0x1d7)](_0x38b9cb=>_0x42c6f4(0x1b3)+_0x38b9cb[_0x42c6f4(0x1ad)]+':\x20'+_0x38b9cb[_0x42c6f4(0x1e1)])[_0x42c6f4(0x1ea)](';\x20');throw new Error(_0x42c6f4(0x1c8)+_0x222b74);}logger[_0x42c6f4(0x1eb)](process[_0x42c6f4(0x1be)]()),logger[_0x42c6f4(0x1e8)](_0x42c6f4(0x1ab),_0x42c6f4(0x1e3),{'appCode':_0x8bc673,'selectedCount':_0xe05642['length'],'jsUrl':_0x63b328,'cssUrl':_0xde714f});if(_0x63b328){const _0x39ca0c=await isUrlReachable(_0x63b328);if(!_0x39ca0c)throw new Error(_0x42c6f4(0x1c0)+_0x63b328);}if(_0xde714f){const _0x291fbc=await isUrlReachable(_0xde714f);if(!_0x291fbc)throw new Error(_0x42c6f4(0x1c5)+_0xde714f);}const _0x437586=getLocalPages();if(_0x437586[_0x42c6f4(0x1cd)]===0x0){if(_0xe05642['length']>0x0)throw new Error(_0x42c6f4(0x1c1)+_0xe05642['join'](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x594081[_0x42c6f4(0x1d4)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x387932=await getOnlineMenuList(_0x8bc673,_0x5b4a08),_0x5f20c6=new Set(_0x387932[_0x42c6f4(0x1d7)](_0x4b1865=>menuPathKey(_0x4b1865[_0x42c6f4(0x1b8)])));let _0x2d3330;if(_0xe05642[_0x42c6f4(0x1cd)]>0x0){const _0x402a05=new Map(_0x437586['map'](_0x28eddc=>[menuPathKey(_0x28eddc['path']),_0x28eddc])),_0x50e492=_0xe05642[_0x42c6f4(0x1e0)](_0x26ff93=>!_0x402a05[_0x42c6f4(0x1ca)](_0x26ff93));if(_0x50e492[_0x42c6f4(0x1cd)]>0x0){const _0x994f22=_0x437586[_0x42c6f4(0x1d7)](_0x1efaec=>_0x1efaec[_0x42c6f4(0x1b8)])['join'](',\x20');throw new Error(_0x42c6f4(0x1c1)+_0x50e492[_0x42c6f4(0x1ea)](',\x20')+_0x42c6f4(0x1bb)+_0x994f22);}const _0x51b926=_0xe05642[_0x42c6f4(0x1e0)](_0x43a56b=>_0x5f20c6[_0x42c6f4(0x1ca)](_0x43a56b));if(_0x51b926[_0x42c6f4(0x1cd)]>0x0)throw new Error(_0x42c6f4(0x1b6)+_0x51b926['join'](',\x20'));_0x2d3330=_0xe05642[_0x42c6f4(0x1d7)](_0x1bafca=>_0x402a05[_0x42c6f4(0x1bd)](_0x1bafca));}else _0x2d3330=_0x437586[_0x42c6f4(0x1e0)](_0x5f1111=>!_0x5f20c6[_0x42c6f4(0x1ca)](menuPathKey(_0x5f1111[_0x42c6f4(0x1b8)])));if(_0x2d3330[_0x42c6f4(0x1cd)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x594081[_0x42c6f4(0x1d4)]===!![],'targetPages':[],'plannedMenus':[]};_0x2d3330=_0x2d3330[_0x42c6f4(0x1d7)](_0x4e0176=>resolvePage(_0x4e0176,_0x11be51,_0x387932));_0x11be51['appName']&&_0x549b2[_0x42c6f4(0x1cd)]===0x0&&await assertSharedResourcesConfigured(_0x8bc673,_0x5b4a08,_0x11be51[_0x42c6f4(0x1e6)]);const _0x1fef77=_0x2d3330[_0x42c6f4(0x1d7)](_0x13452f=>({'type':_0x42c6f4(0x1e2),'path':_0x13452f['path'],'label':_0x13452f[_0x42c6f4(0x1c9)],'loadScriptMode':_0x42c6f4(0x1cc),'resources':[..._0x549b2],..._0x13452f[_0x42c6f4(0x1d9)]===undefined?{}:{'visible':_0x13452f[_0x42c6f4(0x1d9)]},..._0x13452f[_0x42c6f4(0x1d1)]===undefined?{}:{'parentId':_0x13452f[_0x42c6f4(0x1d1)]},..._0x13452f[_0x42c6f4(0x1c6)]===undefined?{}:{'sort':_0x13452f[_0x42c6f4(0x1c6)]},..._0x11be51[_0x42c6f4(0x1e6)]===undefined?{}:{'appName':_0x11be51[_0x42c6f4(0x1e6)]}}));if(_0x594081[_0x42c6f4(0x1d4)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x2d3330,'plannedMenus':_0x1fef77};const _0x1aa0a7=_0x11be51[_0x42c6f4(0x1e6)]?await createMenus(_0x8bc673,_0x5b4a08,_0x2d3330,_0x549b2[_0x42c6f4(0x1cd)]>0x0?_0x549b2:undefined,{'appName':_0x11be51[_0x42c6f4(0x1e6)]}):await createMenus(_0x8bc673,_0x5b4a08,_0x2d3330,_0x549b2[_0x42c6f4(0x1cd)]>0x0?_0x549b2:undefined);return logger[_0x42c6f4(0x1e8)]('menu-sync',_0x42c6f4(0x1b9),{'count':_0x2d3330[_0x42c6f4(0x1cd)],'resources':_0x549b2}),{'created':_0x1aa0a7['length'],'skipped':![],'dryRun':![],'targetPages':_0x2d3330,'plannedMenus':_0x1fef77,'menus':_0x1aa0a7};}export function parseMenuSyncParams(_0x588f31){const _0x459b2f=a173_0x97141b;if(!_0x588f31||typeof _0x588f31!==_0x459b2f(0x1a8))return{};let _0xe31b37;try{_0xe31b37=JSON[_0x459b2f(0x1e4)](_0x588f31);}catch{throw new Error('Invalid\x20--params\x20JSON.');}if(typeof _0xe31b37!==_0x459b2f(0x1d0)||_0xe31b37===null||Array[_0x459b2f(0x1d6)](_0xe31b37))throw new Error(_0x459b2f(0x1b7));const _0x52be9e=_0xe31b37;if(Object[_0x459b2f(0x1dd)](_0x52be9e,_0x459b2f(0x1c2)))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x3d59e3=Object[_0x459b2f(0x1b4)](_0x52be9e)[_0x459b2f(0x1e0)](_0x46959f=>!MENU_SYNC_PARAM_KEYS[_0x459b2f(0x1ca)](_0x46959f));if(_0x3d59e3[_0x459b2f(0x1cd)]>0x0)throw new Error(_0x459b2f(0x1d8)+_0x3d59e3[_0x459b2f(0x1ea)](',\x20')+'.');for(const _0x1ec9fe of[_0x459b2f(0x1b5),_0x459b2f(0x1df),_0x459b2f(0x1e6)]){const _0x149129=_0x52be9e[_0x1ec9fe];if(_0x149129!==undefined&&(typeof _0x149129!==_0x459b2f(0x1a8)||_0x149129[_0x459b2f(0x1e9)]()===''))throw new Error(_0x459b2f(0x1ce)+_0x1ec9fe+_0x459b2f(0x1a9));}if(_0x52be9e[_0x459b2f(0x1d9)]!==undefined&&typeof _0x52be9e[_0x459b2f(0x1d9)]!==_0x459b2f(0x1af))throw new Error(_0x459b2f(0x1b0));if(_0x52be9e['parentId']!==undefined&&(!Number[_0x459b2f(0x1bf)](_0x52be9e[_0x459b2f(0x1d1)])||_0x52be9e[_0x459b2f(0x1d1)]<0x0))throw new Error(_0x459b2f(0x1b1));return{'jsUrl':typeof _0x52be9e[_0x459b2f(0x1b5)]===_0x459b2f(0x1a8)?_0x52be9e[_0x459b2f(0x1b5)]['trim']():undefined,'cssUrl':typeof _0x52be9e[_0x459b2f(0x1df)]===_0x459b2f(0x1a8)?_0x52be9e['cssUrl'][_0x459b2f(0x1e9)]():undefined,'appName':typeof _0x52be9e[_0x459b2f(0x1e6)]===_0x459b2f(0x1a8)?_0x52be9e[_0x459b2f(0x1e6)][_0x459b2f(0x1e9)]():undefined,'visible':typeof _0x52be9e[_0x459b2f(0x1d9)]===_0x459b2f(0x1af)?_0x52be9e[_0x459b2f(0x1d9)]:undefined,'parentId':typeof _0x52be9e[_0x459b2f(0x1d1)]===_0x459b2f(0x1c4)?_0x52be9e[_0x459b2f(0x1d1)]:undefined};}
|
|
@@ -17,6 +17,10 @@ export interface UpdateMenuCdnUrlParams {
|
|
|
17
17
|
export interface LocalPage {
|
|
18
18
|
path: string;
|
|
19
19
|
label: string;
|
|
20
|
+
visible?: boolean;
|
|
21
|
+
group?: string;
|
|
22
|
+
order?: number;
|
|
23
|
+
parentId?: number;
|
|
20
24
|
}
|
|
21
25
|
export interface ProcessedMenuItem {
|
|
22
26
|
id: number;
|
|
@@ -24,6 +28,8 @@ export interface ProcessedMenuItem {
|
|
|
24
28
|
label: string;
|
|
25
29
|
resources: string[];
|
|
26
30
|
extend?: Record<string, unknown> | null;
|
|
31
|
+
type?: string;
|
|
32
|
+
parentId?: number | null;
|
|
27
33
|
}
|
|
28
34
|
export interface MenuFact {
|
|
29
35
|
id: number;
|
|
@@ -99,6 +105,9 @@ export interface MenuMutationResult<TTarget = MenuFact> {
|
|
|
99
105
|
export interface MenuSyncParams {
|
|
100
106
|
jsUrl?: string;
|
|
101
107
|
cssUrl?: string;
|
|
108
|
+
appName?: string;
|
|
109
|
+
visible?: boolean;
|
|
110
|
+
parentId?: number;
|
|
102
111
|
}
|
|
103
112
|
export interface MenuUpdateParams {
|
|
104
113
|
jsUrl?: string;
|
|
@@ -154,16 +163,17 @@ export interface SyncResult {
|
|
|
154
163
|
created: number;
|
|
155
164
|
skipped: boolean;
|
|
156
165
|
dryRun?: boolean;
|
|
157
|
-
targetPages:
|
|
158
|
-
path: string;
|
|
159
|
-
label: string;
|
|
160
|
-
}[];
|
|
166
|
+
targetPages: LocalPage[];
|
|
161
167
|
plannedMenus?: Array<{
|
|
162
168
|
type: "procode";
|
|
163
169
|
path: string;
|
|
164
170
|
label: string;
|
|
165
171
|
loadScriptMode: "import";
|
|
166
172
|
resources: string[];
|
|
173
|
+
visible?: boolean;
|
|
174
|
+
parentId?: number;
|
|
175
|
+
sort?: number;
|
|
176
|
+
appName?: string;
|
|
167
177
|
}>;
|
|
168
178
|
menus?: MenuMutationEntity[];
|
|
169
179
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a172_0x32ee(_0x52ea9d,_0x17e44c){_0x52ea9d=_0x52ea9d-0xd6;const _0x518f7e=a172_0x518f();let _0x32ee4b=_0x518f7e[_0x52ea9d];return _0x32ee4b;}(function(_0x10d8ff,_0x59794f){const _0x3ca626=a172_0x32ee,_0x3b94f8=_0x10d8ff();while(!![]){try{const _0x57db6d=-parseInt(_0x3ca626(0x10d))/0x1+-parseInt(_0x3ca626(0xd6))/0x2*(-parseInt(_0x3ca626(0xf7))/0x3)+parseInt(_0x3ca626(0x111))/0x4+parseInt(_0x3ca626(0xe0))/0x5+-parseInt(_0x3ca626(0x113))/0x6*(parseInt(_0x3ca626(0x110))/0x7)+parseInt(_0x3ca626(0x108))/0x8+-parseInt(_0x3ca626(0xe3))/0x9*(-parseInt(_0x3ca626(0x10c))/0xa);if(_0x57db6d===_0x59794f)break;else _0x3b94f8['push'](_0x3b94f8['shift']());}catch(_0x4fd666){_0x3b94f8['push'](_0x3b94f8['shift']());}}}(a172_0x518f,0xb72cf));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(_0x46cb31){const _0x5943db=a172_0x32ee,_0x1ba13d=[];return _0x46cb31[_0x5943db(0xec)]&&!isValidJsHttpsUrl(_0x46cb31['jsUrl'])&&_0x1ba13d[_0x5943db(0x112)]({'field':_0x5943db(0xec),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x46cb31[_0x5943db(0x103)]&&!isValidCssHttpsUrl(_0x46cb31[_0x5943db(0x103)])&&_0x1ba13d[_0x5943db(0x112)]({'field':_0x5943db(0x103),'message':_0x5943db(0xd8)}),_0x1ba13d;}export async function runMenuUpdateCore(_0x396715,_0x19cac7,_0x189713,_0x4da4c0={}){const _0x43e61d=a172_0x32ee,_0x26a2e1=parseUpdateParamsFlag(_0x189713),_0x3dfd13=normalizeMode(_0x4da4c0[_0x43e61d(0xfb)]);validateSelection(_0x4da4c0[_0x43e61d(0x107)]);const _0x2188f4=[];if(_0x26a2e1[_0x43e61d(0xec)])_0x2188f4[_0x43e61d(0x112)](_0x26a2e1['jsUrl']);if(_0x26a2e1['cssUrl'])_0x2188f4[_0x43e61d(0x112)](_0x26a2e1[_0x43e61d(0x103)]);const _0x51226d=validateParams(_0x26a2e1);if(_0x51226d[_0x43e61d(0xde)]>0x0){const _0x1c4b0f=_0x51226d[_0x43e61d(0xd9)](_0x36a924=>'--params.'+_0x36a924[_0x43e61d(0xf4)]+':\x20'+_0x36a924['message'])[_0x43e61d(0xff)](';\x20');throw new Error(_0x43e61d(0x101)+_0x1c4b0f);}if(_0x2188f4['length']===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x43e61d(0x104));logger[_0x43e61d(0xdf)](process[_0x43e61d(0xe6)]()),logger[_0x43e61d(0xf0)]('menu-asset-update','Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x396715,'jsUrl':_0x26a2e1[_0x43e61d(0xec)],'cssUrl':_0x26a2e1[_0x43e61d(0x103)],'mode':_0x3dfd13,'dryRun':_0x4da4c0['dryRun']===!![]});if(_0x26a2e1['jsUrl']){const _0x565ee5=await isUrlReachable(_0x26a2e1[_0x43e61d(0xec)]);if(!_0x565ee5)throw new Error(_0x43e61d(0xe4)+_0x26a2e1[_0x43e61d(0xec)]);}if(_0x26a2e1[_0x43e61d(0x103)]){const _0x1e91f2=await isUrlReachable(_0x26a2e1[_0x43e61d(0x103)]);if(!_0x1e91f2)throw new Error(_0x43e61d(0xe1)+_0x26a2e1['cssUrl']);}const _0x309bb0=await getOnlineMenuList(_0x396715,_0x19cac7),_0x1e97a8=_0x309bb0[_0x43e61d(0xf1)](_0x2f64c2=>_0x2f64c2[_0x43e61d(0xf5)][_0x43e61d(0xde)]>0x0),_0x12d941=selectMenusForUpdate(_0x1e97a8,_0x4da4c0[_0x43e61d(0x107)]);if(_0x12d941[_0x43e61d(0xde)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x4da4c0[_0x43e61d(0x10e)]===!![]};const _0x3f172a=_0x12d941[_0x43e61d(0xd9)](_0x2865bf=>buildMenuUpdateDiff(_0x2865bf,_0x26a2e1,_0x3dfd13,_0x4da4c0['force']===!![],_0x4da4c0['loadScriptMode']));if(_0x4da4c0[_0x43e61d(0x10e)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x3f172a};const _0x183e79=await Promise[_0x43e61d(0x118)](_0x12d941[_0x43e61d(0xd9)]((_0xa79b2b,_0x1bd07e)=>updateMenuCdnUrl(_0x396715,_0x19cac7,{'id':_0xa79b2b['id'],'label':_0xa79b2b[_0x43e61d(0x100)],'path':_0xa79b2b['path'],'resources':_0x3f172a[_0x1bd07e][_0x43e61d(0xf6)]['resources'],'extend':_0xa79b2b[_0x43e61d(0xdd)]??null,'loadScriptMode':_0x4da4c0['loadScriptMode']}))),_0x375c65=_0x183e79[_0x43e61d(0xf1)](_0x1db102=>_0x1db102[_0x43e61d(0xf8)]===_0x43e61d(0x114))[_0x43e61d(0xd9)](_0x4c2df7=>_0x4c2df7[_0x43e61d(0xe5)]),_0x391795=_0x183e79[_0x43e61d(0xf1)](_0x421d52=>_0x421d52[_0x43e61d(0xf8)]==='rejected')[_0x43e61d(0xde)];return logger['info'](_0x43e61d(0xfd),'Menu\x20asset\x20update\x20completed',{'count':_0x12d941[_0x43e61d(0xde)],'resources':_0x2188f4}),{'updated':_0x375c65[_0x43e61d(0xde)],'failed':_0x391795,'skipped':![],'menus':_0x375c65};}function a172_0x518f(){const _0x5c306f=['Invalid\x20--params:\x20','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','cssUrl','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','path','replace','selection','6083936EXeUEW','\x22\x20(','paths','Invalid\x20--mode:\x20','470740BdFFyU','737812jwlVlG','dryRun','.js','146503aVYLaz','1390560bvzTQZ','push','366AAzYYP','fulfilled','endsWith','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','allSettled','\x20existing\x20CSS\x20resources\x20for\x20\x22','45748bqPKjD','parse','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','map','has','menu\x20asset-update\x20cannot\x20patch\x20','string','extend','length','setLogPath','4818930JdbkEo','CSS\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.','45tSbCPs','JS\x20URL\x20is\x20unreachable:\x20','value','cwd','\x20existing\x20JS\x20resources\x20for\x20\x22','menuIds','isArray','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','.css','jsUrl','split','loadScriptMode','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','info','filter','some','unshift','field','resources','after','60jZmixt','status','all','trim','mode','object','menu-asset-update','patch','join','label'];a172_0x518f=function(){return _0x5c306f;};return a172_0x518f();}function validateSelection(_0x154f3b){const _0x476835=a172_0x32ee;if(!_0x154f3b)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x154f3b[_0x476835(0xf9)]&&(_0x154f3b['menuIds'][_0x476835(0xde)]>0x0||_0x154f3b[_0x476835(0x10a)][_0x476835(0xde)]>0x0))throw new Error(_0x476835(0x102));if(!_0x154f3b[_0x476835(0xf9)]&&_0x154f3b[_0x476835(0xe8)][_0x476835(0xde)]===0x0&&_0x154f3b[_0x476835(0x10a)]['length']===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x45b2fc,_0x20e586){const _0x60e5d8=a172_0x32ee;validateSelection(_0x20e586);if(_0x20e586[_0x60e5d8(0xf9)])return _0x45b2fc;const _0x54b26f=new Set(_0x45b2fc[_0x60e5d8(0xd9)](_0x100f3e=>_0x100f3e['id'])),_0x584b1c=new Set(_0x45b2fc['map'](_0x40b2b7=>_0x40b2b7[_0x60e5d8(0x105)])),_0x3d7e8e=_0x20e586[_0x60e5d8(0xe8)][_0x60e5d8(0xf1)](_0x569fbb=>!_0x54b26f[_0x60e5d8(0xda)](_0x569fbb)),_0x5b69b2=_0x20e586[_0x60e5d8(0x10a)][_0x60e5d8(0xf1)](_0x4700cf=>!_0x584b1c['has'](_0x4700cf));if(_0x3d7e8e[_0x60e5d8(0xde)]>0x0||_0x5b69b2['length']>0x0){const _0x42d810=[..._0x3d7e8e[_0x60e5d8(0xd9)](_0x380b77=>String(_0x380b77)),..._0x5b69b2][_0x60e5d8(0xff)](',\x20');throw new Error(_0x60e5d8(0x116)+_0x42d810);}const _0x3c9a15=new Set(_0x20e586[_0x60e5d8(0xe8)]),_0x4de24a=new Set(_0x20e586[_0x60e5d8(0x10a)]);return _0x45b2fc[_0x60e5d8(0xf1)](_0x17433a=>_0x3c9a15[_0x60e5d8(0xda)](_0x17433a['id'])||_0x4de24a['has'](_0x17433a[_0x60e5d8(0x105)]));}function normalizeMode(_0x12ef6c){const _0x45a571=a172_0x32ee;if(!_0x12ef6c)return'patch';if(_0x12ef6c===_0x45a571(0x106)||_0x12ef6c===_0x45a571(0xfe))return _0x12ef6c;throw new Error(_0x45a571(0x10b)+_0x12ef6c+'.\x20Allowed\x20values:\x20replace,\x20patch');}function buildMenuUpdateDiff(_0x5169c5,_0xa71bbd,_0x59031d,_0xd71313,_0x5ef196){const _0xedc8cb=a172_0x32ee,_0x2ef064=[..._0x5169c5[_0xedc8cb(0xf5)]];_0x59031d===_0xedc8cb(0xfe)&&assertUnambiguousPatchResources(_0x5169c5,_0x2ef064,_0xa71bbd);const _0x47091b=_0x59031d==='patch'?patchResources(_0x2ef064,_0xa71bbd):replaceResources(_0xa71bbd),_0x1287c0=[],_0x16d0aa=_0x2ef064[_0xedc8cb(0xf2)](isJsResource),_0x4f441d=_0x47091b[_0xedc8cb(0xf2)](isJsResource);if(_0x16d0aa&&!_0x4f441d){const _0x42bd37='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x5169c5[_0xedc8cb(0x100)]+_0xedc8cb(0x109)+_0x5169c5['path']+').\x20'+_0xedc8cb(0x117);if(!_0xd71313)throw new Error(_0x42bd37);_0x1287c0[_0xedc8cb(0x112)](_0x42bd37);}const _0x4d65de=_0x2ef064['some'](isCssResource),_0x32712f=_0x47091b[_0xedc8cb(0xf2)](isCssResource);_0x4d65de&&!_0x32712f&&_0x1287c0['push'](_0xedc8cb(0xef)+_0x5169c5[_0xedc8cb(0x100)]+'\x22\x20('+_0x5169c5[_0xedc8cb(0x105)]+').');const _0x3a72c9=typeof _0x5169c5[_0xedc8cb(0xdd)]?.['loadScriptMode']===_0xedc8cb(0xdc)?_0x5169c5[_0xedc8cb(0xdd)][_0xedc8cb(0xee)]:null,_0x54e47f=_0x5ef196?{'loadScriptMode':_0x3a72c9}:{},_0x227a1e=_0x5ef196?{'loadScriptMode':_0x5ef196}:{};return{'id':_0x5169c5['id'],'label':_0x5169c5['label'],'path':_0x5169c5['path'],'mode':_0x59031d,'before':{'resources':_0x2ef064,..._0x54e47f},'after':{'resources':_0x47091b,..._0x227a1e},'warnings':_0x1287c0};}function replaceResources(_0x3b7fad){const _0x204d20=a172_0x32ee;return[_0x3b7fad[_0x204d20(0xec)],_0x3b7fad['cssUrl']][_0x204d20(0xf1)](_0x320fb5=>!!_0x320fb5);}function assertUnambiguousPatchResources(_0x289f04,_0x1e2ef8,_0x50e278){const _0x2a4b4c=a172_0x32ee,_0x1a0a44=_0x1e2ef8[_0x2a4b4c(0xf1)](isJsResource)[_0x2a4b4c(0xde)];if(_0x50e278[_0x2a4b4c(0xec)]&&_0x1a0a44>0x1)throw new Error(_0x2a4b4c(0xdb)+_0x1a0a44+_0x2a4b4c(0xe7)+_0x289f04[_0x2a4b4c(0x100)]+'\x22\x20('+_0x289f04[_0x2a4b4c(0x105)]+')\x20'+_0x2a4b4c(0xea));const _0x43929f=_0x1e2ef8[_0x2a4b4c(0xf1)](isCssResource)['length'];if(_0x50e278[_0x2a4b4c(0x103)]&&_0x43929f>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x43929f+_0x2a4b4c(0x119)+_0x289f04[_0x2a4b4c(0x100)]+_0x2a4b4c(0x109)+_0x289f04[_0x2a4b4c(0x105)]+')\x20'+_0x2a4b4c(0xe2));}function patchResources(_0x41ed33,_0x18adb5){const _0x150f1f=a172_0x32ee;let _0xc06ad2=![],_0x376f07=![];const _0x6200e4=[];for(const _0x4b16d3 of _0x41ed33){if(isJsResource(_0x4b16d3)){if(_0x18adb5[_0x150f1f(0xec)]&&!_0xc06ad2)_0x6200e4[_0x150f1f(0x112)](_0x18adb5[_0x150f1f(0xec)]),_0xc06ad2=!![];else!_0x18adb5[_0x150f1f(0xec)]&&_0x6200e4[_0x150f1f(0x112)](_0x4b16d3);continue;}if(isCssResource(_0x4b16d3)){if(_0x18adb5[_0x150f1f(0x103)]&&!_0x376f07)_0x6200e4[_0x150f1f(0x112)](_0x18adb5[_0x150f1f(0x103)]),_0x376f07=!![];else!_0x18adb5[_0x150f1f(0x103)]&&_0x6200e4[_0x150f1f(0x112)](_0x4b16d3);continue;}_0x6200e4[_0x150f1f(0x112)](_0x4b16d3);}return _0x18adb5['jsUrl']&&!_0xc06ad2&&_0x6200e4[_0x150f1f(0xf3)](_0x18adb5['jsUrl']),_0x18adb5['cssUrl']&&!_0x376f07&&_0x6200e4['push'](_0x18adb5[_0x150f1f(0x103)]),_0x6200e4;}function isJsResource(_0xd3eb8){const _0x5a4c49=a172_0x32ee;return stripQuery(_0xd3eb8)['toLowerCase']()[_0x5a4c49(0x115)](_0x5a4c49(0x10f));}function isCssResource(_0x1c6660){const _0x29d0c9=a172_0x32ee;return stripQuery(_0x1c6660)['toLowerCase']()['endsWith'](_0x29d0c9(0xeb));}function stripQuery(_0x3af2a4){const _0x11b967=a172_0x32ee;return _0x3af2a4[_0x11b967(0xed)]('?')[0x0]??_0x3af2a4;}function parseUpdateParamsFlag(_0x981364){const _0x551690=a172_0x32ee;if(!_0x981364||typeof _0x981364!==_0x551690(0xdc))return{};try{const _0x267475=JSON[_0x551690(0xd7)](_0x981364);if(typeof _0x267475!==_0x551690(0xfc)||_0x267475===null||Array[_0x551690(0xe9)](_0x267475))return{};return{'jsUrl':typeof _0x267475['jsUrl']===_0x551690(0xdc)?_0x267475['jsUrl'][_0x551690(0xfa)]():undefined,'cssUrl':typeof _0x267475[_0x551690(0x103)]===_0x551690(0xdc)?_0x267475[_0x551690(0x103)]['trim']():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x272418,_0x415038){const _0x33b423=a175_0x583c,_0x584e6a=_0x272418();while(!![]){try{const _0x2d41b5=parseInt(_0x33b423(0x11e))/0x1+-parseInt(_0x33b423(0x10d))/0x2*(-parseInt(_0x33b423(0x100))/0x3)+parseInt(_0x33b423(0xef))/0x4+-parseInt(_0x33b423(0x11a))/0x5*(parseInt(_0x33b423(0xfa))/0x6)+-parseInt(_0x33b423(0xe8))/0x7+-parseInt(_0x33b423(0xea))/0x8+-parseInt(_0x33b423(0x112))/0x9*(-parseInt(_0x33b423(0x127))/0xa);if(_0x2d41b5===_0x415038)break;else _0x584e6a['push'](_0x584e6a['shift']());}catch(_0x4535e7){_0x584e6a['push'](_0x584e6a['shift']());}}}(a175_0x1e89,0x3a338));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(_0x4526fc){const _0x4cb5cd=a175_0x583c,_0x535835=[];return _0x4526fc[_0x4cb5cd(0x115)]&&!isValidJsHttpsUrl(_0x4526fc[_0x4cb5cd(0x115)])&&_0x535835[_0x4cb5cd(0xe4)]({'field':'jsUrl','message':_0x4cb5cd(0xf5)}),_0x4526fc['cssUrl']&&!isValidCssHttpsUrl(_0x4526fc[_0x4cb5cd(0xe7)])&&_0x535835[_0x4cb5cd(0xe4)]({'field':_0x4cb5cd(0xe7),'message':_0x4cb5cd(0x111)}),_0x535835;}export async function runMenuUpdateCore(_0x33326d,_0x3b1993,_0x32fc97,_0x4feb59={}){const _0x5d6328=a175_0x583c,_0x15da02=parseUpdateParamsFlag(_0x32fc97),_0x45e1ee=normalizeMode(_0x4feb59[_0x5d6328(0xf3)]);validateSelection(_0x4feb59[_0x5d6328(0x118)]);const _0x39503d=[];if(_0x15da02['jsUrl'])_0x39503d['push'](_0x15da02[_0x5d6328(0x115)]);if(_0x15da02[_0x5d6328(0xe7)])_0x39503d[_0x5d6328(0xe4)](_0x15da02['cssUrl']);const _0x133693=validateParams(_0x15da02);if(_0x133693['length']>0x0){const _0x107616=_0x133693[_0x5d6328(0x110)](_0x11214d=>'--params.'+_0x11214d[_0x5d6328(0xf9)]+':\x20'+_0x11214d[_0x5d6328(0xe2)])[_0x5d6328(0x102)](';\x20');throw new Error(_0x5d6328(0xe3)+_0x107616);}if(_0x39503d['length']===0x0)throw new Error(_0x5d6328(0x108)+_0x5d6328(0x116));logger[_0x5d6328(0x101)](process['cwd']()),logger[_0x5d6328(0xfb)]('menu-asset-update',_0x5d6328(0xfc),{'appCode':_0x33326d,'jsUrl':_0x15da02[_0x5d6328(0x115)],'cssUrl':_0x15da02['cssUrl'],'mode':_0x45e1ee,'dryRun':_0x4feb59['dryRun']===!![]});if(_0x15da02[_0x5d6328(0x115)]){const _0x42fc13=await isUrlReachable(_0x15da02[_0x5d6328(0x115)]);if(!_0x42fc13)throw new Error(_0x5d6328(0x106)+_0x15da02['jsUrl']);}if(_0x15da02[_0x5d6328(0xe7)]){const _0x150b88=await isUrlReachable(_0x15da02['cssUrl']);if(!_0x150b88)throw new Error(_0x5d6328(0x123)+_0x15da02['cssUrl']);}const _0x276183=await getOnlineMenuList(_0x33326d,_0x3b1993),_0x1e1f1a=_0x276183[_0x5d6328(0x119)](_0x566858=>_0x566858[_0x5d6328(0x120)][_0x5d6328(0x124)]>0x0),_0x1883a1=selectMenusForUpdate(_0x1e1f1a,_0x4feb59[_0x5d6328(0x118)]);if(_0x1883a1[_0x5d6328(0x124)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x4feb59[_0x5d6328(0xf4)]===!![]};const _0x442cb4=_0x1883a1['map'](_0x8cadbd=>buildMenuUpdateDiff(_0x8cadbd,_0x15da02,_0x45e1ee,_0x4feb59[_0x5d6328(0xe6)]===!![],_0x4feb59[_0x5d6328(0x129)]));if(_0x4feb59[_0x5d6328(0xf4)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x442cb4};const _0x467c63=await Promise[_0x5d6328(0x10e)](_0x1883a1['map']((_0x559944,_0x162e18)=>updateMenuCdnUrl(_0x33326d,_0x3b1993,{'id':_0x559944['id'],'label':_0x559944[_0x5d6328(0x122)],'path':_0x559944['path'],'resources':_0x442cb4[_0x162e18][_0x5d6328(0xf8)]['resources'],'extend':_0x559944['extend']??null,'loadScriptMode':_0x4feb59['loadScriptMode']}))),_0x38aed3=_0x467c63[_0x5d6328(0x119)](_0x5b7094=>_0x5b7094[_0x5d6328(0xed)]===_0x5d6328(0x10f))[_0x5d6328(0x110)](_0x4e6784=>_0x4e6784[_0x5d6328(0x103)]),_0x2c82e2=_0x467c63[_0x5d6328(0x119)](_0x58af88=>_0x58af88[_0x5d6328(0xed)]==='rejected')['length'];return logger[_0x5d6328(0xfb)](_0x5d6328(0xe5),'Menu\x20asset\x20update\x20completed',{'count':_0x1883a1[_0x5d6328(0x124)],'resources':_0x39503d}),{'updated':_0x38aed3[_0x5d6328(0x124)],'failed':_0x2c82e2,'skipped':![],'menus':_0x38aed3};}function validateSelection(_0x3496ee){const _0x4de3f3=a175_0x583c;if(!_0x3496ee)throw new Error(_0x4de3f3(0x11b));if(_0x3496ee[_0x4de3f3(0xee)]&&(_0x3496ee[_0x4de3f3(0x11d)][_0x4de3f3(0x124)]>0x0||_0x3496ee[_0x4de3f3(0x126)][_0x4de3f3(0x124)]>0x0))throw new Error(_0x4de3f3(0x105));if(!_0x3496ee[_0x4de3f3(0xee)]&&_0x3496ee[_0x4de3f3(0x11d)]['length']===0x0&&_0x3496ee[_0x4de3f3(0x126)][_0x4de3f3(0x124)]===0x0)throw new Error(_0x4de3f3(0x11b));}export function selectMenusForUpdate(_0x1a12ef,_0x32cf68){const _0x4027fe=a175_0x583c;validateSelection(_0x32cf68);if(_0x32cf68['all'])return _0x1a12ef;const _0x1fc634=new Set(_0x1a12ef[_0x4027fe(0x110)](_0x53ea2a=>_0x53ea2a['id'])),_0x45fed8=new Set(_0x1a12ef[_0x4027fe(0x110)](_0x533b13=>_0x533b13[_0x4027fe(0xfd)])),_0x165f9f=_0x32cf68[_0x4027fe(0x11d)][_0x4027fe(0x119)](_0x4009b7=>!_0x1fc634[_0x4027fe(0x125)](_0x4009b7)),_0x37ebe8=_0x32cf68['paths'][_0x4027fe(0x119)](_0x1853ef=>!_0x45fed8[_0x4027fe(0x125)](_0x1853ef));if(_0x165f9f[_0x4027fe(0x124)]>0x0||_0x37ebe8['length']>0x0){const _0x4a1a4d=[..._0x165f9f[_0x4027fe(0x110)](_0x38f880=>String(_0x38f880)),..._0x37ebe8][_0x4027fe(0x102)](',\x20');throw new Error(_0x4027fe(0x113)+_0x4a1a4d);}const _0x1c4596=new Set(_0x32cf68[_0x4027fe(0x11d)]),_0xea66a8=new Set(_0x32cf68[_0x4027fe(0x126)]);return _0x1a12ef[_0x4027fe(0x119)](_0x1af1d9=>_0x1c4596[_0x4027fe(0x125)](_0x1af1d9['id'])||_0xea66a8[_0x4027fe(0x125)](_0x1af1d9[_0x4027fe(0xfd)]));}function normalizeMode(_0x499e19){const _0x2602b3=a175_0x583c;if(!_0x499e19)return _0x2602b3(0xf2);if(_0x499e19===_0x2602b3(0xec)||_0x499e19==='patch')return _0x499e19;throw new Error(_0x2602b3(0x121)+_0x499e19+_0x2602b3(0x114));}function a175_0x583c(_0x418dd1,_0xe7f998){_0x418dd1=_0x418dd1-0xe2;const _0x1e89c7=a175_0x1e89();let _0x583cab=_0x1e89c7[_0x418dd1];return _0x583cab;}function buildMenuUpdateDiff(_0x3d6687,_0x2343b3,_0x5c3e28,_0x38682f,_0x55bb1a){const _0x12ec82=a175_0x583c,_0x2452dc=[..._0x3d6687['resources']];_0x5c3e28===_0x12ec82(0xf2)&&assertUnambiguousPatchResources(_0x3d6687,_0x2452dc,_0x2343b3);const _0x3487ac=_0x5c3e28==='patch'?patchResources(_0x2452dc,_0x2343b3):replaceResources(_0x2343b3),_0x5e95b2=[],_0x2166be=_0x2452dc[_0x12ec82(0x10a)](isJsResource),_0x1b7b5d=_0x3487ac[_0x12ec82(0x10a)](isJsResource);if(_0x2166be&&!_0x1b7b5d){const _0x5f5d8a=_0x12ec82(0xf0)+_0x3d6687[_0x12ec82(0x122)]+_0x12ec82(0xeb)+_0x3d6687[_0x12ec82(0xfd)]+_0x12ec82(0x12a)+_0x12ec82(0x10b);if(!_0x38682f)throw new Error(_0x5f5d8a);_0x5e95b2[_0x12ec82(0xe4)](_0x5f5d8a);}const _0x1c68c5=_0x2452dc[_0x12ec82(0x10a)](isCssResource),_0x536f47=_0x3487ac['some'](isCssResource);_0x1c68c5&&!_0x536f47&&_0x5e95b2[_0x12ec82(0xe4)](_0x12ec82(0x109)+_0x3d6687['label']+'\x22\x20('+_0x3d6687[_0x12ec82(0xfd)]+').');const _0x51028b=typeof _0x3d6687[_0x12ec82(0x107)]?.[_0x12ec82(0x129)]===_0x12ec82(0x10c)?_0x3d6687[_0x12ec82(0x107)][_0x12ec82(0x129)]:null,_0x3128ef=_0x55bb1a?{'loadScriptMode':_0x51028b}:{},_0x555f11=_0x55bb1a?{'loadScriptMode':_0x55bb1a}:{};return{'id':_0x3d6687['id'],'label':_0x3d6687['label'],'path':_0x3d6687[_0x12ec82(0xfd)],'mode':_0x5c3e28,'before':{'resources':_0x2452dc,..._0x3128ef},'after':{'resources':_0x3487ac,..._0x555f11},'warnings':_0x5e95b2};}function replaceResources(_0x40b42f){const _0x46ed6a=a175_0x583c;return[_0x40b42f[_0x46ed6a(0x115)],_0x40b42f[_0x46ed6a(0xe7)]][_0x46ed6a(0x119)](_0x5a588d=>!!_0x5a588d);}function assertUnambiguousPatchResources(_0x509c74,_0x255147,_0x18d3c8){const _0x4df893=a175_0x583c,_0x49b7db=_0x255147[_0x4df893(0x119)](isJsResource)[_0x4df893(0x124)];if(_0x18d3c8[_0x4df893(0x115)]&&_0x49b7db>0x1)throw new Error(_0x4df893(0x11c)+_0x49b7db+_0x4df893(0xff)+_0x509c74[_0x4df893(0x122)]+_0x4df893(0xeb)+_0x509c74[_0x4df893(0xfd)]+')\x20'+_0x4df893(0xf7));const _0x11e2e6=_0x255147[_0x4df893(0x119)](isCssResource)['length'];if(_0x18d3c8[_0x4df893(0xe7)]&&_0x11e2e6>0x1)throw new Error(_0x4df893(0x11c)+_0x11e2e6+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x509c74[_0x4df893(0x122)]+_0x4df893(0xeb)+_0x509c74[_0x4df893(0xfd)]+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function patchResources(_0x583e25,_0x273bc7){const _0x34fb31=a175_0x583c;let _0x10e540=![],_0x523758=![];const _0x690275=[];for(const _0x1ba53a of _0x583e25){if(isJsResource(_0x1ba53a)){if(_0x273bc7[_0x34fb31(0x115)]&&!_0x10e540)_0x690275[_0x34fb31(0xe4)](_0x273bc7[_0x34fb31(0x115)]),_0x10e540=!![];else!_0x273bc7[_0x34fb31(0x115)]&&_0x690275['push'](_0x1ba53a);continue;}if(isCssResource(_0x1ba53a)){if(_0x273bc7[_0x34fb31(0xe7)]&&!_0x523758)_0x690275[_0x34fb31(0xe4)](_0x273bc7[_0x34fb31(0xe7)]),_0x523758=!![];else!_0x273bc7[_0x34fb31(0xe7)]&&_0x690275[_0x34fb31(0xe4)](_0x1ba53a);continue;}_0x690275[_0x34fb31(0xe4)](_0x1ba53a);}return _0x273bc7['jsUrl']&&!_0x10e540&&_0x690275[_0x34fb31(0xf1)](_0x273bc7[_0x34fb31(0x115)]),_0x273bc7[_0x34fb31(0xe7)]&&!_0x523758&&_0x690275[_0x34fb31(0xe4)](_0x273bc7[_0x34fb31(0xe7)]),_0x690275;}function isJsResource(_0x146669){const _0x44daca=a175_0x583c;return stripQuery(_0x146669)[_0x44daca(0xe9)]()['endsWith']('.js');}function isCssResource(_0x61653d){const _0x4b988e=a175_0x583c;return stripQuery(_0x61653d)['toLowerCase']()[_0x4b988e(0xfe)](_0x4b988e(0x104));}function stripQuery(_0x1396b6){return _0x1396b6['split']('?')[0x0]??_0x1396b6;}function parseUpdateParamsFlag(_0x36265e){const _0x740f7f=a175_0x583c;if(!_0x36265e||typeof _0x36265e!=='string')return{};try{const _0x3584ea=JSON[_0x740f7f(0x117)](_0x36265e);if(typeof _0x3584ea!==_0x740f7f(0x11f)||_0x3584ea===null||Array[_0x740f7f(0x128)](_0x3584ea))return{};return{'jsUrl':typeof _0x3584ea[_0x740f7f(0x115)]===_0x740f7f(0x10c)?_0x3584ea[_0x740f7f(0x115)]['trim']():undefined,'cssUrl':typeof _0x3584ea[_0x740f7f(0xe7)]==='string'?_0x3584ea[_0x740f7f(0xe7)][_0x740f7f(0xf6)]():undefined};}catch{return{};}}function a175_0x1e89(){const _0x5953f9=['Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','some','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','string','6080XxVuGR','allSettled','fulfilled','map','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','42966PmYVOe','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','.\x20Allowed\x20values:\x20replace,\x20patch','jsUrl','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','parse','selection','filter','15UdBBGk','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','menu\x20asset-update\x20cannot\x20patch\x20','menuIds','147264gKDZtE','object','resources','Invalid\x20--mode:\x20','label','CSS\x20URL\x20is\x20unreachable:\x20','length','has','paths','1850GntQgJ','isArray','loadScriptMode',').\x20','message','Invalid\x20--params:\x20','push','menu-asset-update','force','cssUrl','2894101qRCWkB','toLowerCase','2956784kHeOgH','\x22\x20(','replace','status','all','676016VLsyfU','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','unshift','patch','mode','dryRun','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','trim','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','after','field','854610WLZCSk','info','Start\x20non-interactive\x20menu\x20asset\x20update','path','endsWith','\x20existing\x20JS\x20resources\x20for\x20\x22','246jeDmHX','setLogPath','join','value','.css','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','JS\x20URL\x20is\x20unreachable:\x20','extend'];a175_0x1e89=function(){return _0x5953f9;};return a175_0x1e89();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x31869f,_0x2579cd){const _0x3868e4=a176_0x3365,_0x2f0262=_0x31869f();while(!![]){try{const _0x41d837=parseInt(_0x3868e4(0x99))/0x1+parseInt(_0x3868e4(0x96))/0x2+parseInt(_0x3868e4(0x90))/0x3*(-parseInt(_0x3868e4(0x9b))/0x4)+parseInt(_0x3868e4(0x98))/0x5*(parseInt(_0x3868e4(0x95))/0x6)+parseInt(_0x3868e4(0x94))/0x7+parseInt(_0x3868e4(0x9d))/0x8*(parseInt(_0x3868e4(0x8e))/0x9)+-parseInt(_0x3868e4(0x97))/0xa;if(_0x41d837===_0x2579cd)break;else _0x2f0262['push'](_0x2f0262['shift']());}catch(_0x543900){_0x2f0262['push'](_0x2f0262['shift']());}}}(a176_0xe9dc,0xc26f2));function a176_0xe9dc(){const _0x45f29a=['867sdLyKh','trim','GET','body','10666397pWTglS','12714UOHDxo','1592698UREEfM','14754230mFeAws','110DZGpoC','499398VlKRGq','test','18916IbergG','HEAD','8pToqsX','bytes=0-0','6951330TqBBpJ','cancel'];a176_0xe9dc=function(){return _0x45f29a;};return a176_0xe9dc();}export function isValidJsHttpsUrl(_0x6db8b0){const _0x1974ff=a176_0x3365;return/^https:\/\/.+\.js(\?.*)?$/[_0x1974ff(0x9a)](_0x6db8b0['trim']());}export function isValidCssHttpsUrl(_0x24faa9){const _0x566e30=a176_0x3365;return/^https:\/\/.+\.css(\?.*)?$/[_0x566e30(0x9a)](_0x24faa9[_0x566e30(0x91)]());}function a176_0x3365(_0x8a9766,_0x13065a){_0x8a9766=_0x8a9766-0x8d;const _0xe9dc84=a176_0xe9dc();let _0x336551=_0xe9dc84[_0x8a9766];return _0x336551;}export async function isUrlReachable(_0x1f29e1){const _0x2c8784=a176_0x3365;try{const _0x1942f2=await fetch(_0x1f29e1,{'method':_0x2c8784(0x9c)});if(_0x1942f2['ok'])return!![];}catch{}try{const _0x18855e=await fetch(_0x1f29e1,{'method':_0x2c8784(0x92),'headers':{'Range':_0x2c8784(0x8d)}}),_0x48b6cb=_0x18855e['ok'];try{await _0x18855e[_0x2c8784(0x93)]?.[_0x2c8784(0x8f)]();}catch{}return _0x48b6cb;}catch{return![];}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a177_0x4810(_0x2e1622,_0x297604){_0x2e1622=_0x2e1622-0xef;const _0x45e8d5=a177_0x45e8();let _0x4810f8=_0x45e8d5[_0x2e1622];return _0x4810f8;}const a177_0x115e5a=a177_0x4810;(function(_0x4da2cd,_0x2329ba){const _0x4f33b9=a177_0x4810,_0x24913e=_0x4da2cd();while(!![]){try{const _0x11eef0=-parseInt(_0x4f33b9(0xfd))/0x1*(-parseInt(_0x4f33b9(0xf3))/0x2)+-parseInt(_0x4f33b9(0xf4))/0x3+-parseInt(_0x4f33b9(0xf5))/0x4+parseInt(_0x4f33b9(0xf1))/0x5*(parseInt(_0x4f33b9(0xfa))/0x6)+-parseInt(_0x4f33b9(0xf8))/0x7+-parseInt(_0x4f33b9(0xf7))/0x8+parseInt(_0x4f33b9(0xef))/0x9;if(_0x11eef0===_0x2329ba)break;else _0x24913e['push'](_0x24913e['shift']());}catch(_0x5d68be){_0x24913e['push'](_0x24913e['shift']());}}}(a177_0x45e8,0xa1b2f));import{getSmartAppRecord}from'../../core/api-client.js';function a177_0x45e8(){const _0x635f5=['1312946pJVQJb','3393183ajYltc','2036308hNZmIW','all','3910560KZiTVI','2317350fqqOBc','menu','19956HIURht','\x20in\x20menu\x20host\x20','cookie','2DNUDDP','11135781qAOawd','boundMenus','860ngpAKd','Inspected\x20'];a177_0x45e8=function(){return _0x635f5;};return a177_0x45e8();}import{getOnlineMenuList}from'../../commands/menu/shared/service.js';import{buildSubappAssetsStatus,getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';export const menuSubappAssetsStatus={'service':a177_0x115e5a(0xf9),'command':'subapp-assets-status','description':'Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','risk':'read','strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x3b9b5c){getSubappSelector(_0x3b9b5c);},async 'execute'(_0x29c75d){const _0x2f1d65=a177_0x115e5a,{appCode:_0x436e01,appName:_0x1706ca}=getSubappSelector(_0x29c75d),[_0x2aeeab,_0x4bc727]=await Promise[_0x2f1d65(0xf6)]([getSmartAppRecord(_0x436e01,_0x29c75d[_0x2f1d65(0xfc)]),getOnlineMenuList(_0x436e01,_0x29c75d[_0x2f1d65(0xfc)])]),_0x230244={'appCode':_0x436e01,...buildSubappAssetsStatus(_0x2aeeab,_0x4bc727,_0x1706ca)};return{'ok':!![],'data':_0x230244,'message':_0x2f1d65(0xf2)+_0x230244[_0x2f1d65(0xf0)]+'\x20menu(s)\x20for\x20'+_0x1706ca+_0x2f1d65(0xfb)+_0x436e01+'.'};}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a178_0x3fdbc3=a178_0x4d5e;(function(_0x1bec6a,_0x5f548e){const _0x1e1d18=a178_0x4d5e,_0x297503=_0x1bec6a();while(!![]){try{const _0x4bed1f=-parseInt(_0x1e1d18(0x1cd))/0x1*(-parseInt(_0x1e1d18(0x1d9))/0x2)+parseInt(_0x1e1d18(0x1b0))/0x3*(parseInt(_0x1e1d18(0x1d1))/0x4)+parseInt(_0x1e1d18(0x1b4))/0x5*(parseInt(_0x1e1d18(0x1c7))/0x6)+parseInt(_0x1e1d18(0x1e2))/0x7+parseInt(_0x1e1d18(0x1b1))/0x8+-parseInt(_0x1e1d18(0x1cc))/0x9+-parseInt(_0x1e1d18(0x19a))/0xa*(parseInt(_0x1e1d18(0x1b8))/0xb);if(_0x4bed1f===_0x5f548e)break;else _0x297503['push'](_0x297503['shift']());}catch(_0x3bb00b){_0x297503['push'](_0x297503['shift']());}}}(a178_0x7d1b,0x6cd1f));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a178_0x7d1b(){const _0x13d8cf=['--resources\x20is\x20required.','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','expected-hash','Unknown\x20app.extend\x20fields:\x20','string','assets','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.',';\x20independent\x20deployment\x20not\x20verified.','\x20in\x20menu\x20host\x20','https:','protocol','resources','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','object','tenantColumn','resources[','test','326271BMJPhm','6642456NNyVzJ','entries','isArray','355uPTCPu','apiError','not\x20HTTPS','parse','9783400qfhjgr',']\x20must\x20be\x20a\x20URL\x20string.','length','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','filter','stringify','App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.','str','extend','some','app.extend.assets','cookie','Would\x20update\x20shared\x20assets\x20for\x20','directDbEnabled',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','56802uhpcqn','join','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','expectedHash','vipDeploy','2571912nCdprh','1udAxcj','appName','/smartapi/app/update','accessKey','4VSDLPU','\x20contains\x20invalid\x20JSON.','size','trim','sha256','enableAutoSync','appPublishStatus','appCode','17734sjjTun','.\x20Refusing\x20update.','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','keys','enableOpenApi','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','has','map','validation','5649WRMZUd','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','nextExtend','hex','unchanged','10raAeTg','Updated\x20shared\x20resources\x20for\x20'];a178_0x7d1b=function(){return _0x13d8cf;};return a178_0x7d1b();}import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set(['skinColor',a178_0x3fdbc3(0x1dd),a178_0x3fdbc3(0x1d0),a178_0x3fdbc3(0x1a2),a178_0x3fdbc3(0x1ad),'enableSample',a178_0x3fdbc3(0x1cb),a178_0x3fdbc3(0x1d6),'directDbId',a178_0x3fdbc3(0x1c5)]);function a178_0x4d5e(_0x65258,_0x296655){_0x65258=_0x65258-0x199;const _0x7d1b06=a178_0x7d1b();let _0x4d5e12=_0x7d1b06[_0x65258];return _0x4d5e12;}function parseObject(_0x15660b,_0x261f0b){const _0x4034f9=a178_0x3fdbc3;let _0xef56d=_0x15660b;if(typeof _0x15660b===_0x4034f9(0x1a1))try{_0xef56d=JSON[_0x4034f9(0x1b7)](_0x15660b);}catch{throw CliErrors[_0x4034f9(0x1e1)](_0x261f0b+_0x4034f9(0x1d2));}if(!_0xef56d||typeof _0xef56d!==_0x4034f9(0x1ac)||Array[_0x4034f9(0x1b3)](_0xef56d))throw CliErrors[_0x4034f9(0x1e1)](_0x261f0b+'\x20must\x20be\x20a\x20JSON\x20object.');return _0xef56d;}function parseArray(_0x19a1e9,_0xa92694){const _0x5c1be9=a178_0x3fdbc3;let _0x4c99f4;try{_0x4c99f4=JSON[_0x5c1be9(0x1b7)](_0x19a1e9);}catch{throw CliErrors[_0x5c1be9(0x1e1)](_0xa92694+_0x5c1be9(0x1d2));}if(!Array['isArray'](_0x4c99f4))throw CliErrors['validation'](_0xa92694+'\x20must\x20be\x20a\x20JSON\x20array.');return _0x4c99f4[_0x5c1be9(0x1e0)]((_0x38334c,_0x102301)=>parseObject(_0x38334c,_0xa92694+'['+_0x102301+']'));}function validateResources(_0x2cdc5b){const _0x2a27ae=a178_0x3fdbc3;if(_0x2cdc5b[_0x2a27ae(0x1ba)]===0x0)throw CliErrors[_0x2a27ae(0x1e1)]('At\x20least\x20one\x20resource\x20URL\x20is\x20required.');for(const [_0x296377,_0x22388e]of _0x2cdc5b[_0x2a27ae(0x1b2)]()){if(typeof _0x22388e!=='string')throw CliErrors[_0x2a27ae(0x1e1)](_0x2a27ae(0x1ae)+_0x296377+_0x2a27ae(0x1b9));try{if(new URL(_0x22388e)[_0x2a27ae(0x1a8)]!==_0x2a27ae(0x1a7))throw new Error(_0x2a27ae(0x1b6));}catch{throw CliErrors['validation'](_0x2a27ae(0x1ae)+_0x296377+_0x2a27ae(0x1c6));}}if(new Set(_0x2cdc5b)[_0x2a27ae(0x1d3)]!==_0x2cdc5b['length']||!_0x2cdc5b[_0x2a27ae(0x1c1)](_0x4f96ff=>/\.m?js(?:[?#]|$)/i[_0x2a27ae(0x1af)](_0x4f96ff)))throw CliErrors[_0x2a27ae(0x1e1)]('Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.');return _0x2cdc5b;}function prepare(_0xa4cca8,_0x2a6e9b,_0x17b9ae){const _0x1ffb3e=a178_0x3fdbc3;if(!Number['isSafeInteger'](_0xa4cca8['id'])||(_0xa4cca8['id']??0x0)<=0x0||typeof _0xa4cca8[_0x1ffb3e(0x1d7)]!==_0x1ffb3e(0x1a1)||!_0xa4cca8[_0x1ffb3e(0x1d7)])throw CliErrors[_0x1ffb3e(0x1e1)](_0x1ffb3e(0x1de));const _0x3a735c=parseObject(_0xa4cca8[_0x1ffb3e(0x1c0)],'app.extend'),_0x814478=Object[_0x1ffb3e(0x1dc)](_0x3a735c)[_0x1ffb3e(0x1bc)](_0x5f2a64=>!KNOWN_EXTEND_KEYS[_0x1ffb3e(0x1df)](_0x5f2a64));if(_0x814478[_0x1ffb3e(0x1ba)])throw CliErrors[_0x1ffb3e(0x1e1)](_0x1ffb3e(0x1a0)+_0x814478[_0x1ffb3e(0x1c8)](',\x20')+_0x1ffb3e(0x1da));if(typeof _0x3a735c['assets']!==_0x1ffb3e(0x1a1))throw CliErrors[_0x1ffb3e(0x1e1)](_0x1ffb3e(0x1aa));const _0x2ee6bf=parseArray(_0x3a735c[_0x1ffb3e(0x1a2)],_0x1ffb3e(0x1c2)),_0x112a39=_0x2ee6bf[_0x1ffb3e(0x1bc)](_0x128060=>_0x128060[_0x1ffb3e(0x1ce)]===_0x2a6e9b);if(_0x112a39[_0x1ffb3e(0x1ba)]!==0x1)throw CliErrors[_0x1ffb3e(0x1e1)]('Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20'+_0x2a6e9b+';\x20found\x20'+_0x112a39[_0x1ffb3e(0x1ba)]+'.');const _0x5b4a3b=_0x112a39[0x0];if(typeof _0x5b4a3b[_0x1ffb3e(0x1a9)]!==_0x1ffb3e(0x1a1))throw CliErrors[_0x1ffb3e(0x1e1)](_0x1ffb3e(0x1db));let _0x4d437e;try{_0x4d437e=JSON[_0x1ffb3e(0x1b7)](_0x5b4a3b[_0x1ffb3e(0x1a9)]);}catch{throw CliErrors[_0x1ffb3e(0x1e1)](_0x1ffb3e(0x19d));}if(!Array['isArray'](_0x4d437e)||_0x4d437e[_0x1ffb3e(0x1c1)](_0x534477=>typeof _0x534477!==_0x1ffb3e(0x1a1)))throw CliErrors[_0x1ffb3e(0x1e1)](_0x1ffb3e(0x1ab));const _0x181e0b=_0x2ee6bf[_0x1ffb3e(0x1e0)](_0x33061f=>_0x33061f===_0x5b4a3b?{..._0x33061f,'resources':JSON[_0x1ffb3e(0x1bd)](_0x17b9ae)}:_0x33061f),_0x966818={..._0x3a735c,'assets':JSON[_0x1ffb3e(0x1bd)](_0x181e0b)},_0x216b31=createHash(_0x1ffb3e(0x1d5))['update'](JSON[_0x1ffb3e(0x1bd)]({'appCode':_0xa4cca8[_0x1ffb3e(0x1d8)],'id':_0xa4cca8['id'],'appPublishStatus':_0xa4cca8['appPublishStatus'],'extend':_0x3a735c,'appName':_0x2a6e9b,'resources':_0x17b9ae}))['digest'](_0x1ffb3e(0x1e5));return{'before':_0x4d437e,'nextExtend':_0x966818,'expectedHash':_0x216b31,'unchanged':isDeepStrictEqual(_0x4d437e,_0x17b9ae)};}function flags(_0x2f855b){const _0x5179e6=a178_0x3fdbc3,{appCode:_0x3ece58,appName:_0x2e8a28}=getSubappSelector(_0x2f855b),_0x5cad73=_0x2f855b[_0x5179e6(0x1bf)](_0x5179e6(0x1a9))[_0x5179e6(0x1d4)]();if(!_0x5cad73)throw CliErrors['validation'](_0x5179e6(0x19c));let _0x471bc1;try{_0x471bc1=JSON['parse'](_0x5cad73);}catch{throw CliErrors[_0x5179e6(0x1e1)](_0x5179e6(0x19e));}if(!Array[_0x5179e6(0x1b3)](_0x471bc1))throw CliErrors[_0x5179e6(0x1e1)]('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');return{'appCode':_0x3ece58,'appName':_0x2e8a28,'resources':validateResources(_0x471bc1)};}export const menuSubappAssetsUpdate={'service':'menu','command':'subapp-assets-update','description':a178_0x3fdbc3(0x1bb),'risk':'write','strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a178_0x3fdbc3(0x1a9),'type':a178_0x3fdbc3(0x1a1),'required':!![],'description':'JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs'},{'name':'expected-hash','type':a178_0x3fdbc3(0x1a1),'description':a178_0x3fdbc3(0x1c9)}],async 'validate'(_0x5d1c20){flags(_0x5d1c20);},async 'dryRun'(_0x578b23){const _0x3ffaef=a178_0x3fdbc3,{appCode:_0x378e68,appName:_0x433a14,resources:_0x4e32dc}=flags(_0x578b23),_0x3660c7=await getSmartAppRecord(_0x378e68,_0x578b23['cookie']),_0x43c0eb=prepare(_0x3660c7,_0x433a14,_0x4e32dc);return{'method':'POST','url':_0x3ffaef(0x1cf),'body':{'preview':{'appCode':_0x378e68,'appName':_0x433a14,'before':_0x43c0eb['before'],'after':_0x4e32dc,'expectedHash':_0x43c0eb['expectedHash'],'unchanged':_0x43c0eb[_0x3ffaef(0x199)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x43c0eb[_0x3ffaef(0x199)]?_0x3ffaef(0x1a3):_0x3ffaef(0x1c4)+_0x433a14+'.'};},async 'execute'(_0x5064d7){const _0x141371=a178_0x3fdbc3,{appCode:_0x2ad1ca,appName:_0x129c27,resources:_0x382c95}=flags(_0x5064d7),_0x188695=_0x5064d7[_0x141371(0x1bf)](_0x141371(0x19f))['trim']();if(!/^[a-f0-9]{64}$/i[_0x141371(0x1af)](_0x188695))throw CliErrors[_0x141371(0x1e1)](_0x141371(0x1a4));const _0x22e729=await getSmartAppRecord(_0x2ad1ca,_0x5064d7[_0x141371(0x1c3)]),_0x5c5fc5=prepare(_0x22e729,_0x129c27,_0x382c95);if(_0x188695!==_0x5c5fc5[_0x141371(0x1ca)])throw CliErrors[_0x141371(0x1e1)](_0x141371(0x1be));if(_0x5c5fc5['unchanged'])return{'ok':!![],'data':{'appCode':_0x2ad1ca,'appName':_0x129c27,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x141371(0x1e3)};await updateSmartAppRecord({'id':_0x22e729['id'],'appCode':_0x2ad1ca,'appPublishStatus':_0x22e729[_0x141371(0x1d7)],'extend':_0x5c5fc5['nextExtend']},_0x5064d7[_0x141371(0x1c3)]);const _0x5551e2=await getSmartAppRecord(_0x2ad1ca,_0x5064d7['cookie']),_0x141e1f=parseObject(_0x5551e2[_0x141371(0x1c0)],'verified\x20app.extend');if(_0x5551e2['id']!==_0x22e729['id']||_0x5551e2[_0x141371(0x1d7)]!==_0x22e729[_0x141371(0x1d7)]||!isDeepStrictEqual(_0x141e1f,_0x5c5fc5[_0x141371(0x1e4)]))throw CliErrors[_0x141371(0x1b5)]('App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.');return{'ok':!![],'data':{'appCode':_0x2ad1ca,'appName':_0x129c27,'updated':!![],'resources':_0x382c95,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x141371(0x19b)+_0x129c27+_0x141371(0x1a6)+_0x2ad1ca+_0x141371(0x1a5)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a179_0x583bb4=a179_0x56d7;(function(_0x38e298,_0x142025){const _0x5cef78=a179_0x56d7,_0x571928=_0x38e298();while(!![]){try{const _0x450c58=-parseInt(_0x5cef78(0xdc))/0x1+-parseInt(_0x5cef78(0xdd))/0x2*(-parseInt(_0x5cef78(0xd1))/0x3)+parseInt(_0x5cef78(0xdb))/0x4*(parseInt(_0x5cef78(0xed))/0x5)+parseInt(_0x5cef78(0xda))/0x6+-parseInt(_0x5cef78(0xb6))/0x7*(-parseInt(_0x5cef78(0xaf))/0x8)+-parseInt(_0x5cef78(0xe2))/0x9*(-parseInt(_0x5cef78(0xad))/0xa)+-parseInt(_0x5cef78(0xb5))/0xb;if(_0x450c58===_0x142025)break;else _0x571928['push'](_0x571928['shift']());}catch(_0x302ec6){_0x571928['push'](_0x571928['shift']());}}}(a179_0x33e2,0x67f3d));import a179_0x45a36d from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';function a179_0x33e2(){const _0x41cdc5=['Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','\x20failed.','\x20menu(s)...','failed','yellow','Would\x20create\x20','appName','str','✓\x20Menu\x20sync\x20completed:\x20','selectedAppName','message','\x20local\x20microfrontend\x20menu(s).','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','\x20menu(s)','/smartapi/menu/create','onlineMenuList','params','sync','\x20\x20Cancelled.','\x20created,\x20','cookie','appcode','9sbIxvo','Fetching\x20online\x20menu\x20list...','\x20\x20✓\x20Selected:\x20','onlinePaths','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','jsUrl','string','\x20menu(s)\x20with\x20JS:\x20','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','1293006nHmvJa','4LZfAZJ','259006XAHYiU','279692EWdrDR','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','Tip:\x20For\x20frontend\x20subapps,\x20prefer\x20Agent-planned\x20menu\x20groups\x20and\x20shared\x20resources.\x20This\x20manual\x20sync\x20workflow\x20remains\x20available\x20as\x20a\x20fallback.','created','boolean','18MGvRyM','gray','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','Prefer\x20appName\x20for\x20shared\x20subapp\x20resources\x20and\x20parentId\x20for\x20planned\x20groups.\x20','Creating\x20','Menu\x20sync\x20skipped','appCode','map','Menu\x20sync\x20completed:\x20','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','Menu\x20creation\x20failed','2082130aygdQM','cssUrl','yes','\x20\x20Continue\x20with\x20creation?','trim','\x20\x20Create\x20','localPages','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','Created\x20','filter','cyan','2888350wnzzOm','skipped','16DtzEXj','length','paths','size','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','menu','14575198cuDteX','1332373HLYNEK','Failed\x20to\x20fetch\x20online\x20menu\x20list','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','\x20menu(s)\x20bound\x20to\x20','validation'];a179_0x33e2=function(){return _0x41cdc5;};return a179_0x33e2();}import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,resolvePage,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';import{assertSharedResourcesConfigured}from'../../commands/menu/shared/subapp-assets.js';function a179_0x56d7(_0x56e959,_0x16430d){_0x56e959=_0x56e959-0xa5;const _0x33e20a=a179_0x33e2();let _0x56d786=_0x33e20a[_0x56e959];return _0x56d786;}export const menuSync={'service':a179_0x583bb4(0xb4),'command':a179_0x583bb4(0xcc),'description':'Register\x20local\x20pages\x20as\x20platform\x20menus','risk':'write','flags':[{'name':a179_0x583bb4(0xcb),'type':a179_0x583bb4(0xd7),'description':a179_0x583bb4(0xe5)+'JSON:\x20{\x22appName\x22:\x22store-app\x22,\x22parentId\x22:42,\x22visible\x22:false};\x20jsUrl\x20and\x20cssUrl\x20remain\x20available\x20for\x20individual\x20menu\x20resources.'},{'name':a179_0x583bb4(0xb1),'type':'string','description':a179_0x583bb4(0xbb)},{'name':a179_0x583bb4(0xef),'type':a179_0x583bb4(0xe1),'description':a179_0x583bb4(0xb8)}],async 'dryRun'(_0x5ea5fe){const _0x356d27=a179_0x583bb4;ensureRunnableContext(_0x5ea5fe['rawFlags'],_0x5ea5fe[_0x356d27(0xc4)]);const _0x3c9338=await runMenuSyncCore(_0x5ea5fe[_0x356d27(0xe8)],_0x5ea5fe['cookie'],parsePaths(_0x5ea5fe[_0x356d27(0xc2)]('paths')),_0x5ea5fe[_0x356d27(0xc2)]('params'),{'dryRun':!![]});return{'method':'POST','url':_0x356d27(0xc9),'body':_0x3c9338,'description':_0x3c9338[_0x356d27(0xae)]?_0x356d27(0xd5):_0x356d27(0xc0)+_0x3c9338['targetPages'][_0x356d27(0xb0)]+_0x356d27(0xc6)};},async 'execute'(_0x1e28dc){const _0xb6d460=a179_0x583bb4;ensureRunnableContext(_0x1e28dc['rawFlags'],_0x1e28dc['selectedAppName']);const _0x410b89=_0x1e28dc['flag'](_0xb6d460(0xef)),_0x54e970=_0x1e28dc['str'](_0xb6d460(0xcb)),_0x2bd99b=parsePaths(_0x1e28dc['str'](_0xb6d460(0xb1))),_0x7504ac=parseMenuSyncParams(_0x54e970);if(_0x410b89){const _0x34515b=await runMenuSyncCore(_0x1e28dc['appCode'],_0x1e28dc[_0xb6d460(0xcf)],_0x2bd99b,_0x54e970);if(_0x34515b['skipped']){const _0xc6a178=getLocalPages();_0xc6a178[_0xb6d460(0xb0)]===0x0?writeCliSideChannelLine(_0xb6d460(0xeb)):writeCliSideChannelLine(_0xb6d460(0xd9));}else writeCliSideChannelLine(_0xb6d460(0xc3)+_0x34515b['created']+'\x20menu(s)\x20created');return{'ok':!![],'data':_0x34515b,'message':_0x34515b[_0xb6d460(0xae)]?_0xb6d460(0xe7):_0xb6d460(0xea)+_0x34515b[_0xb6d460(0xe0)]+'\x20created.'};}if(_0x2bd99b[_0xb6d460(0xb0)]>0x0)throw CliErrors[_0xb6d460(0xba)]('menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.',_0xb6d460(0xa9));if(!isInteractive()&&_0x54e970)throw CliErrors[_0xb6d460(0xba)](_0xb6d460(0xb3),_0xb6d460(0xa9));requireInteractive(),writeCliSideChannelLine(_0xb6d460(0xdf));const _0x4f3495=startSpinner(_0xb6d460(0xd2));let _0x2bed7a,_0x48c638,_0x3915fe;try{const _0x583a9f=await fetchMenuData(_0x1e28dc[_0xb6d460(0xe8)],_0x1e28dc[_0xb6d460(0xcf)]);_0x2bed7a=_0x583a9f[_0xb6d460(0xa8)],_0x48c638=_0x583a9f[_0xb6d460(0xd4)],_0x3915fe=_0x583a9f[_0xb6d460(0xca)],stopSpinner(_0x4f3495,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x54be77){stopSpinner(_0x4f3495,_0xb6d460(0xb7),![]);throw CliErrors['validation'](_0x54be77 instanceof Error?_0x54be77[_0xb6d460(0xc5)]:_0xb6d460(0xb7));}if(_0x2bed7a['length']===0x0)return writeCliSideChannelLine(a179_0x45a36d[_0xb6d460(0xbf)](_0xb6d460(0xc7))),{'ok':!![]};const _0x5e1e2a=buildCompareRows(_0x2bed7a,_0x48c638);writeCliSideChannelLine(renderCompareTable(_0x5e1e2a)),writeCliSideChannelLine('');const _0x5e3dce=await selectPages(_0x2bed7a,_0x48c638);writeCliSideChannelLine(''),writeCliSideChannelLine(a179_0x45a36d[_0xb6d460(0xac)](_0xb6d460(0xd3)+_0x5e3dce[_0xb6d460(0xb0)]+'\x20page(s)'));const _0x408dca=_0x7504ac[_0xb6d460(0xd6)]&&_0x7504ac[_0xb6d460(0xee)];if(!_0x408dca){writeCliSideChannelLine(renderSyncSummary(_0x5e3dce,_0x48c638[_0xb6d460(0xb2)]>0x0));const _0xe0f279=await askConfirm(_0xb6d460(0xa5));if(!_0xe0f279)return writeCliSideChannelLine(a179_0x45a36d[_0xb6d460(0xe3)](_0xb6d460(0xcd))),{'ok':!![]};}let _0xf327d2=_0x7504ac['jsUrl'],_0x354292=_0x7504ac[_0xb6d460(0xee)];!_0xf327d2&&!_0x7504ac[_0xb6d460(0xc1)]&&(_0xf327d2=await askJsUrl());!_0x354292&&!_0x7504ac[_0xb6d460(0xc1)]&&(_0x354292=await askCssUrl());const _0x530d70=await askConfirm(_0x7504ac[_0xb6d460(0xc1)]?_0xb6d460(0xa7)+_0x5e3dce[_0xb6d460(0xb0)]+_0xb6d460(0xb9)+_0x7504ac[_0xb6d460(0xc1)]+'?':'\x20\x20Create\x20'+_0x5e3dce[_0xb6d460(0xb0)]+_0xb6d460(0xd8)+_0xf327d2+'\x20and\x20CSS:\x20'+_0x354292+'?');if(!_0x530d70)return writeCliSideChannelLine(a179_0x45a36d[_0xb6d460(0xe3)](_0xb6d460(0xcd))),{'ok':!![]};const _0x473aa5=[_0xf327d2,_0x354292][_0xb6d460(0xab)](_0x2efaea=>Boolean(_0x2efaea));_0x7504ac[_0xb6d460(0xc1)]&&_0x473aa5['length']===0x0&&await assertSharedResourcesConfigured(_0x1e28dc[_0xb6d460(0xe8)],_0x1e28dc['cookie'],_0x7504ac['appName']);const _0x3291c8=startSpinner(_0xb6d460(0xe6)+_0x5e3dce[_0xb6d460(0xb0)]+_0xb6d460(0xbd));try{const _0x3d6fa3=_0x5e3dce['map'](_0xd48792=>resolvePage(_0xd48792,_0x7504ac,_0x3915fe)),_0x2bb7f9=await doCreateMenus(_0x1e28dc[_0xb6d460(0xe8)],_0x1e28dc[_0xb6d460(0xcf)],_0x3d6fa3,_0x473aa5,_0x7504ac['appName']?{'appName':_0x7504ac[_0xb6d460(0xc1)]}:undefined);return stopSpinner(_0x3291c8,_0xb6d460(0xaa)+_0x2bb7f9[_0xb6d460(0xe0)]+_0xb6d460(0xc8),!![]),{'ok':!![],'data':_0x2bb7f9,'message':_0xb6d460(0xea)+_0x2bb7f9[_0xb6d460(0xe0)]+_0xb6d460(0xce)+_0x2bb7f9[_0xb6d460(0xbe)]+_0xb6d460(0xbc)};}catch(_0x45fe89){stopSpinner(_0x3291c8,_0xb6d460(0xec),![]);throw CliErrors[_0xb6d460(0xba)](_0x45fe89 instanceof Error?_0x45fe89['message']:_0xb6d460(0xec));}}};function ensureRunnableContext(_0x400226,_0x35fb1c){const _0x5de3f3=a179_0x583bb4,_0x29405=_0x400226['appcode']?String(_0x400226[_0x5de3f3(0xd0)])[_0x5de3f3(0xa6)]():'';if(!isInProject()&&!_0x35fb1c&&!_0x29405)throw CliErrors['validation'](_0x5de3f3(0xe4)+_0x5de3f3(0xde));}function parsePaths(_0x30e56f){const _0x286e9d=a179_0x583bb4;return[...new Set(_0x30e56f['split'](',')[_0x286e9d(0xe9)](_0x238fc1=>_0x238fc1[_0x286e9d(0xa6)]())[_0x286e9d(0xab)](Boolean))];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a175_0x2d7fee=a175_0x1e6c;(function(_0x328cbc,_0x2a416a){const _0x322030=a175_0x1e6c,_0x1b90a5=_0x328cbc();while(!![]){try{const _0x2006db=parseInt(_0x322030(0x169))/0x1*(-parseInt(_0x322030(0x14d))/0x2)+parseInt(_0x322030(0x177))/0x3+parseInt(_0x322030(0x161))/0x4+-parseInt(_0x322030(0x14a))/0x5*(parseInt(_0x322030(0x165))/0x6)+parseInt(_0x322030(0x17a))/0x7*(-parseInt(_0x322030(0x15e))/0x8)+parseInt(_0x322030(0x17d))/0x9+-parseInt(_0x322030(0x1a5))/0xa*(-parseInt(_0x322030(0x187))/0xb);if(_0x2006db===_0x2a416a)break;else _0x1b90a5['push'](_0x1b90a5['shift']());}catch(_0x1adfd9){_0x1b90a5['push'](_0x1b90a5['shift']());}}}(a175_0x2d05,0x2af81));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a175_0x1e6c(_0x23507a,_0x9de75b){_0x23507a=_0x23507a-0x142;const _0x2d05f6=a175_0x2d05();let _0x1e6cb1=_0x2d05f6[_0x23507a];return _0x1e6cb1;}import{fetchMenuSnapshot}from'../../commands/menu/shared/facts.js';import{asVerificationError,assertVerified,describeMenuErrorCause,fetchMutationSnapshot,hasFlag,isMenuResponseLoss,mapMenuApiError,menuDryRunResult,menuError,menuFailure,mutationResult,recheckMutationSnapshot,requireExplicitYes}from'../../commands/menu/shared/mutations.js';import{updateMenuEntity}from'../../commands/menu/shared/service.js';import{CliErrors}from'../../errors.js';function a175_0x2d05(){const _0x2647e8=['boolean','before','high-risk-write','Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','menu_expected_count_mismatch','\x20unchanged\x20menu(s).','Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20','7400RkqCRN','resourcesValid','menu_selector_ambiguous','295682tROEFf','\x20was\x20not\x20found\x20during\x20visibility\x20verification.','split','expectVisible','menu_permission_denied','menuIds','menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.','update-menu-visibility','visibility-update','path','length','modelType','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.','POST','url','\x20visibility\x20could\x20not\x20be\x20verified\x20safely','Selected\x20','1125800hTLmNf','Response\x20was\x20lost\x20and\x20menu\x20','values','11460hqNQlM','childrenCount','targets','Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20','684hhMcnt','\x20must\x20be\x20true\x20or\x20false.','update\x20menu\x20visibility','join','1SWTRHk','label','\x20changed\x20unexpectedly.','has','expectedCount','parentId','trim','\x20updated,\x20','map','true','flagMissing','num','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.','Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state','534012fFAslR','type','Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches','14UZrwvE','datasetId','menu-ids','2149398qhQuvj','verification','pageType','Updated\x20visibility\x20for\x20','\x20failed.','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20','hash','recovered','visible','\x20skipped,\x20','33khemqi','get','isArray','isSafeInteger','expect-visible','Would\x20update\x20visibility\x20for\x20','false','\x20menu(s);\x20skipped\x20','expected-count','\x20visibility\x20update\x20could\x20not\x20be\x20verified','byId','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.','failed','menus','Response\x20was\x20lost\x20for\x20menu\x20','plan','menu','Menu\x20path\x20selector\x20not\x20found:\x20','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','code','/smartapi/menu/update','plannedActions','depth','update\x20visibility\x20for','requestedVisible','string','datasetCode','appCode','push','str','1181070AWHVLx','paths','Menu\x20','filter','\x20menu(s);\x20skip\x20','rabetbase\x20menu\x20list\x20--format\x20compress','message','cookie','update','Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20','Menu\x20visibility\x20update\x20completed:\x20','validation','pageId','Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility','stringify','--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.','sort','beforeById','warnings','menu_selector_not_found','menu_verification_failed','resources','childrenIds'];a175_0x2d05=function(){return _0x2647e8;};return a175_0x2d05();}const BACKEND=[{'method':'POST','path':a175_0x2d7fee(0x19b)}];export const menuVisibilityUpdate={'service':a175_0x2d7fee(0x197),'command':'visibility-update','description':a175_0x2d7fee(0x146),'risk':a175_0x2d7fee(0x145),'structuredErrors':!![],'flags':[{'name':a175_0x2d7fee(0x17c),'type':a175_0x2d7fee(0x1a0),'description':a175_0x2d7fee(0x199)},{'name':a175_0x2d7fee(0x1a6),'type':a175_0x2d7fee(0x1a0),'description':'Exact\x20comma-separated\x20menu\x20paths\x20to\x20update'},{'name':a175_0x2d7fee(0x185),'type':a175_0x2d7fee(0x143),'required':!![],'description':'Requested\x20menu\x20visibility'},{'name':'expect-visible','type':a175_0x2d7fee(0x143),'description':a175_0x2d7fee(0x1b2)},{'name':a175_0x2d7fee(0x18f),'type':'number','description':a175_0x2d7fee(0x179)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0xb12231){parseInput(_0xb12231),requireExplicitYes(_0xb12231);},async 'dryRun'(_0x245635){const _0x23413e=a175_0x2d7fee,_0x13992d=await buildPlan(_0x245635,!![]),_0x338dbf=_0x13992d[_0x23413e(0x196)]['plannedActions']?.['length']??0x0,_0x2f89d0=_0x13992d[_0x23413e(0x196)]['targets'][_0x23413e(0x157)]-_0x338dbf;return menuDryRunResult(_0x13992d['plan'],{'method':'POST','url':_0x23413e(0x19b),'body':{'updates':_0x13992d[_0x23413e(0x196)][_0x23413e(0x19c)]?.[_0x23413e(0x171)](_0x2e37b7=>_0x2e37b7['body'])??[]},'description':_0x23413e(0x18c)+_0x338dbf+_0x23413e(0x1a9)+_0x2f89d0+_0x23413e(0x148)});},async 'execute'(_0x7c4d31){const _0x1311f4=a175_0x2d7fee;requireExplicitYes(_0x7c4d31);const _0x582e50=await buildPlan(_0x7c4d31,![]);await recheckMutationSnapshot(_0x7c4d31,_0x582e50[_0x1311f4(0x196)],'update\x20menu\x20visibility');const _0x3c6024=[],_0x52adcf=[],_0x4604d9=[];for(const _0x53f6cb of _0x582e50[_0x1311f4(0x196)]['targets']){if(_0x53f6cb[_0x1311f4(0x144)][_0x1311f4(0x185)]===_0x582e50[_0x1311f4(0x196)][_0x1311f4(0x19f)]){_0x3c6024[_0x1311f4(0x1a3)]({'id':_0x53f6cb['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0x7c4d31[_0x1311f4(0x1a2)],_0x7c4d31[_0x1311f4(0x1ac)],{'id':_0x53f6cb['id'],'visible':_0x582e50[_0x1311f4(0x196)][_0x1311f4(0x19f)]}),_0x3c6024[_0x1311f4(0x1a3)]({'id':_0x53f6cb['id'],'updated':!![],'skipped':![]});}catch(_0x50d1af){const _0x237b54=mapMenuApiError(_0x50d1af,_0x1311f4(0x19e),_0x53f6cb['id']);if(isMenuResponseLoss(_0x50d1af)&&_0x237b54[_0x1311f4(0x19a)]!==_0x1311f4(0x151)){_0x4604d9[_0x1311f4(0x1a3)](_0x53f6cb['id']);continue;}_0x52adcf[_0x1311f4(0x1a3)]({'id':_0x53f6cb['id'],'stage':_0x1311f4(0x1ad),'code':_0x237b54[_0x1311f4(0x19a)],'message':_0x237b54[_0x1311f4(0x1ab)]});}}let _0x55c994;try{_0x55c994=await fetchMenuSnapshot(_0x7c4d31[_0x1311f4(0x1a2)],_0x7c4d31['cookie']);}catch(_0x3d5ed0){const _0x2cab49=describeMenuErrorCause(_0x3d5ed0,'verify\x20menu\x20visibility\x20update'),_0x51785c=_0x4604d9[_0x1311f4(0x171)](_0x10407=>({'id':_0x10407,'stage':'update-recovery','code':_0x1311f4(0x1b9),'message':_0x1311f4(0x195)+_0x10407+'\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','requestedStateConfirmed':![],'recovered':![]})),_0x5b51f3={'stage':'verification','code':_0x1311f4(0x1b9),'message':'Final\x20menu\x20visibility\x20readback\x20failed.','targetIds':_0x582e50[_0x1311f4(0x196)][_0x1311f4(0x163)][_0x1311f4(0x171)](_0x22ab01=>_0x22ab01['id']),'requestedStateConfirmed':![],..._0x2cab49};throw menuFailure(asVerificationError(_0x3d5ed0,_0x1311f4(0x176)),_0x582e50[_0x1311f4(0x196)],{'stage':_0x1311f4(0x17e),'succeeded':_0x3c6024,'failedRecords':[..._0x52adcf,..._0x51785c,_0x5b51f3],'warnings':['The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.'],'verification':{'status':_0x1311f4(0x193),'recoveredCount':0x0,'lookupCommand':'rabetbase\x20menu\x20list\x20--format\x20compress'}});}const _0x3c310a=[];for(const _0x5748c0 of _0x3c6024){const _0x4017f6=Number(_0x5748c0['id']),_0x5e99e0=_0x582e50[_0x1311f4(0x1b6)][_0x1311f4(0x188)](_0x4017f6),_0xdf6271=_0x55c994[_0x1311f4(0x191)]['get'](_0x4017f6);try{verifyVisibilityUpdate(_0x5e99e0,_0xdf6271,_0x582e50[_0x1311f4(0x196)]['requestedVisible']);}catch(_0x17cb69){const _0xd6d80=asVerificationError(_0x17cb69,'Menu\x20'+_0x4017f6+_0x1311f4(0x190));_0x3c310a['push']({'id':_0x4017f6,'stage':_0x1311f4(0x17e),'code':_0xd6d80[_0x1311f4(0x19a)],'message':_0xd6d80['message'],'requestedStateConfirmed':![]});}}for(const _0x202d89 of _0x4604d9){const _0x19d0c8=_0x582e50[_0x1311f4(0x1b6)][_0x1311f4(0x188)](_0x202d89),_0x1e8aa7=_0x55c994[_0x1311f4(0x191)][_0x1311f4(0x188)](_0x202d89);try{verifyVisibilityUpdate(_0x19d0c8,_0x1e8aa7,_0x582e50[_0x1311f4(0x196)][_0x1311f4(0x19f)]),_0x3c6024[_0x1311f4(0x1a3)]({'id':_0x202d89,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0x26382d){const _0x4509d6=asVerificationError(_0x26382d,_0x1311f4(0x15f)+_0x202d89+_0x1311f4(0x15c));_0x3c310a[_0x1311f4(0x1a3)]({'id':_0x202d89,'stage':'update-recovery','code':_0x4509d6[_0x1311f4(0x19a)],'message':_0x4509d6[_0x1311f4(0x1ab)],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x3c310a[_0x1311f4(0x157)]>0x0){const _0x4f87cf=_0x3c310a[_0x1311f4(0x171)](_0x2b082d=>Number(_0x2b082d['id'])),_0x350b84=_0x3c6024[_0x1311f4(0x1a8)](_0x58cae0=>_0x58cae0[_0x1311f4(0x184)]===!![])[_0x1311f4(0x157)],_0x44e94d=menuError(_0x1311f4(0x1b9),_0x1311f4(0x164)+_0x4f87cf[_0x1311f4(0x168)](',\x20')+'.',_0x1311f4(0x175));throw menuFailure(_0x44e94d,_0x582e50[_0x1311f4(0x196)],{'stage':_0x1311f4(0x17e),'succeeded':_0x3c6024,'failedRecords':[..._0x52adcf,..._0x3c310a],'warnings':['One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.'],'verification':{'status':_0x1311f4(0x193),..._0x4f87cf[_0x1311f4(0x157)]===0x1?{'targetId':_0x4f87cf[0x0]}:{'targetIds':_0x4f87cf},'recoveredCount':_0x350b84,'lookupCommand':_0x1311f4(0x1aa)}});}const _0x52c427=_0x3c6024['filter'](_0x151113=>_0x151113['updated']===!![])['length'],_0x1aa930=_0x3c6024['length']-_0x52c427,_0xb2b752={..._0x582e50[_0x1311f4(0x196)],'succeeded':_0x3c6024,'failed':_0x52adcf,'warnings':_0x52adcf[_0x1311f4(0x157)]>0x0?[..._0x582e50['plan'][_0x1311f4(0x1b7)],'Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.']:_0x582e50[_0x1311f4(0x196)]['warnings'],'verification':{'checkedBy':'menu\x20list','snapshotHash':_0x55c994[_0x1311f4(0x183)],'matchesRequestedState':_0x52adcf[_0x1311f4(0x157)]===0x0,'recoveredCount':_0x4604d9[_0x1311f4(0x157)]}};return{'ok':_0x52adcf[_0x1311f4(0x157)]===0x0,'data':_0xb2b752,'message':_0x52adcf[_0x1311f4(0x157)]===0x0?_0x1311f4(0x180)+_0x52c427+_0x1311f4(0x18e)+_0x1aa930+_0x1311f4(0x148):_0x1311f4(0x1af)+_0x52c427+_0x1311f4(0x170)+_0x1aa930+_0x1311f4(0x186)+_0x52adcf[_0x1311f4(0x157)]+_0x1311f4(0x181)};}};function parseInput(_0x2ab2d0){const _0x32b353=a175_0x2d7fee,_0x9751fe=parseMenuIds(_0x2ab2d0[_0x32b353(0x1a4)]('menu-ids')),_0x4b0630=parseCsv(_0x2ab2d0['str'](_0x32b353(0x1a6)));if(_0x9751fe[_0x32b353(0x157)]===0x0&&_0x4b0630['length']===0x0)throw CliErrors[_0x32b353(0x1b0)](_0x32b353(0x153));const _0x16368b=parseBooleanFlag(_0x2ab2d0,_0x32b353(0x185),!![]),_0x1003a3=parseBooleanFlag(_0x2ab2d0,_0x32b353(0x18b),![]);let _0x3a36ea;if(hasFlag(_0x2ab2d0,_0x32b353(0x18f))){_0x3a36ea=_0x2ab2d0[_0x32b353(0x174)]('expected-count');if(!Number[_0x32b353(0x18a)](_0x3a36ea)||_0x3a36ea<0x0)throw CliErrors[_0x32b353(0x1b0)](_0x32b353(0x1b4));}return{'menuIds':_0x9751fe,'paths':_0x4b0630,'visible':_0x16368b,'expectVisible':_0x1003a3,'expectedCount':_0x3a36ea};}async function buildPlan(_0xc3df33,_0x3d71f9){const _0x47d151=a175_0x2d7fee,_0x5304ed=parseInput(_0xc3df33),_0x2dceab=await fetchMutationSnapshot(_0xc3df33,_0x47d151(0x167)),_0x17de98=selectTargets(_0x2dceab[_0x47d151(0x194)],_0x5304ed[_0x47d151(0x152)],_0x5304ed[_0x47d151(0x1a6)]);if(_0x5304ed[_0x47d151(0x16d)]!==undefined&&_0x17de98[_0x47d151(0x157)]!==_0x5304ed[_0x47d151(0x16d)])throw menuError(_0x47d151(0x147),_0x47d151(0x15d)+_0x17de98[_0x47d151(0x157)]+'\x20menu(s),\x20expected\x20'+_0x5304ed[_0x47d151(0x16d)]+'.',_0x47d151(0x159));if(_0x5304ed['expectVisible']!==undefined){const _0x6f31bc=_0x17de98[_0x47d151(0x1a8)](_0x1d0f6d=>_0x1d0f6d[_0x47d151(0x185)]!==_0x5304ed[_0x47d151(0x150)]);if(_0x6f31bc[_0x47d151(0x157)]>0x0)throw menuError('menu_state_drift',_0x47d151(0x149)+_0x6f31bc[_0x47d151(0x171)](_0x47e4e6=>_0x47e4e6['id'])[_0x47d151(0x168)](',\x20')+'.',_0x47d151(0x192));}const _0x44a94b=_0x17de98[_0x47d151(0x171)](_0x4ece97=>({'id':_0x4ece97['id'],'label':_0x4ece97['label'],'path':_0x4ece97[_0x47d151(0x156)],'before':{'visible':_0x4ece97[_0x47d151(0x185)]},'after':{'visible':_0x5304ed['visible']}})),_0x39d3b7=_0x44a94b[_0x47d151(0x1a8)](_0x577dc2=>_0x577dc2[_0x47d151(0x144)][_0x47d151(0x185)]!==_0x5304ed[_0x47d151(0x185)])[_0x47d151(0x171)](_0x2b5a69=>({'stage':_0x47d151(0x154),'method':_0x47d151(0x15a),'path':_0x47d151(0x19b),'body':{'appCode':_0xc3df33[_0x47d151(0x1a2)],'id':_0x2b5a69['id'],'visible':_0x5304ed['visible']}})),_0x4f2efe=mutationResult({'operation':_0x47d151(0x155),'selector':{'menuIds':_0x5304ed['menuIds'],'paths':_0x5304ed[_0x47d151(0x1a6)]},'before':{'menus':_0x17de98[_0x47d151(0x171)](_0x39bc56=>({'id':_0x39bc56['id'],'path':_0x39bc56['path'],'visible':_0x39bc56[_0x47d151(0x185)]}))},'after':{'menus':_0x17de98[_0x47d151(0x171)](_0x123cee=>({'id':_0x123cee['id'],'path':_0x123cee[_0x47d151(0x156)],'visible':_0x5304ed[_0x47d151(0x185)]}))},'dryRun':_0x3d71f9,'backend':[...BACKEND],'plannedActions':_0x39d3b7,'snapshotHash':_0x2dceab[_0x47d151(0x183)],'warnings':_0x39d3b7[_0x47d151(0x157)]===0x0?['Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.']:[]});return{'plan':{..._0x4f2efe,'requestedVisible':_0x5304ed['visible'],'targets':_0x44a94b},'beforeById':new Map(_0x17de98[_0x47d151(0x171)](_0x5e3dd0=>[_0x5e3dd0['id'],_0x5e3dd0]))};}function selectTargets(_0x3107b7,_0x599de8,_0x59144f){const _0x254ad2=a175_0x2d7fee,_0x192fe2=new Map(_0x3107b7['map'](_0x13d2dd=>[_0x13d2dd['id'],_0x13d2dd])),_0x123f39=new Map(),_0x24eb97=_0x599de8['filter'](_0x4c6cb0=>!_0x192fe2[_0x254ad2(0x16c)](_0x4c6cb0));if(_0x24eb97[_0x254ad2(0x157)]>0x0)throw menuError(_0x254ad2(0x1b8),'Menu\x20id\x20selector(s)\x20not\x20found:\x20'+_0x24eb97[_0x254ad2(0x168)](',\x20')+'.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.');for(const _0x334e96 of _0x599de8){_0x123f39['set'](_0x334e96,_0x192fe2[_0x254ad2(0x188)](_0x334e96));}for(const _0x4b9b8e of _0x59144f){const _0x51a8c0=_0x3107b7[_0x254ad2(0x1a8)](_0x41cf3e=>_0x41cf3e[_0x254ad2(0x156)]===_0x4b9b8e);if(_0x51a8c0[_0x254ad2(0x157)]===0x0)throw menuError(_0x254ad2(0x1b8),_0x254ad2(0x198)+JSON['stringify'](_0x4b9b8e)+'.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.');if(_0x51a8c0[_0x254ad2(0x157)]>0x1)throw menuError(_0x254ad2(0x14c),_0x254ad2(0x1ae)+JSON[_0x254ad2(0x1b3)](_0x4b9b8e)+'.',_0x254ad2(0x182)+_0x51a8c0['map'](_0xcb12dd=>_0xcb12dd['id'])['join'](',\x20')+'.');const _0x37b0a3=_0x51a8c0[0x0];_0x123f39['set'](_0x37b0a3['id'],_0x37b0a3);}return[..._0x123f39[_0x254ad2(0x160)]()];}function parseMenuIds(_0x42e605){const _0x13e271=a175_0x2d7fee,_0x1ae0e1=parseCsv(_0x42e605),_0xce3b35=_0x1ae0e1['map'](Number);if(_0xce3b35['some'](_0x4ed314=>!Number[_0x13e271(0x18a)](_0x4ed314)||_0x4ed314<=0x0))throw CliErrors[_0x13e271(0x1b0)]('--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.');return[...new Set(_0xce3b35)];}function parseCsv(_0x529152){const _0xe2e7d=a175_0x2d7fee;return[...new Set(_0x529152[_0xe2e7d(0x14f)](',')[_0xe2e7d(0x171)](_0x15d98c=>_0x15d98c[_0xe2e7d(0x16f)]())[_0xe2e7d(0x1a8)](Boolean))];}function parseBooleanFlag(_0x4c6221,_0x427dec,_0x5c6293){const _0x3771d0=a175_0x2d7fee;if(!hasFlag(_0x4c6221,_0x427dec)){if(_0x5c6293)throw CliErrors[_0x3771d0(0x173)](_0x427dec);return undefined;}const _0x5816a6=_0x4c6221['rawFlags'][_0x427dec];if(_0x5816a6===!![]||_0x5816a6===![])return _0x5816a6;if(_0x5816a6===_0x3771d0(0x172))return!![];if(_0x5816a6===_0x3771d0(0x18d))return![];throw CliErrors[_0x3771d0(0x1b0)]('--'+_0x427dec+_0x3771d0(0x166));}function verifyVisibilityUpdate(_0x11c052,_0x329350,_0x576ea2){const _0x4c9c2f=a175_0x2d7fee;assertVerified(!!_0x329350,'Menu\x20'+_0x11c052['id']+_0x4c9c2f(0x14e)),assertVerified(_0x329350[_0x4c9c2f(0x185)]===_0x576ea2,'Menu\x20'+_0x11c052['id']+'\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.');const _0x276bad=[['id',_0x329350['id'],_0x11c052['id']],[_0x4c9c2f(0x16e),_0x329350['parentId'],_0x11c052[_0x4c9c2f(0x16e)]],[_0x4c9c2f(0x19d),_0x329350['depth'],_0x11c052[_0x4c9c2f(0x19d)]],[_0x4c9c2f(0x16a),_0x329350['label'],_0x11c052[_0x4c9c2f(0x16a)]],[_0x4c9c2f(0x156),_0x329350[_0x4c9c2f(0x156)],_0x11c052[_0x4c9c2f(0x156)]],[_0x4c9c2f(0x15b),_0x329350[_0x4c9c2f(0x15b)],_0x11c052[_0x4c9c2f(0x15b)]],[_0x4c9c2f(0x178),_0x329350[_0x4c9c2f(0x178)],_0x11c052['type']],[_0x4c9c2f(0x1b5),_0x329350[_0x4c9c2f(0x1b5)],_0x11c052[_0x4c9c2f(0x1b5)]],[_0x4c9c2f(0x1ba),_0x329350[_0x4c9c2f(0x1ba)],_0x11c052[_0x4c9c2f(0x1ba)]],['resourcesValid',_0x329350[_0x4c9c2f(0x14b)],_0x11c052[_0x4c9c2f(0x14b)]],[_0x4c9c2f(0x142),_0x329350[_0x4c9c2f(0x142)],_0x11c052['childrenIds']],['childrenCount',_0x329350[_0x4c9c2f(0x162)],_0x11c052['childrenCount']],[_0x4c9c2f(0x1b1),_0x329350[_0x4c9c2f(0x1b1)],_0x11c052[_0x4c9c2f(0x1b1)]],[_0x4c9c2f(0x17f),_0x329350[_0x4c9c2f(0x17f)],_0x11c052[_0x4c9c2f(0x17f)]],[_0x4c9c2f(0x158),_0x329350[_0x4c9c2f(0x158)],_0x11c052['modelType']],[_0x4c9c2f(0x17b),_0x329350[_0x4c9c2f(0x17b)],_0x11c052[_0x4c9c2f(0x17b)]],[_0x4c9c2f(0x1a1),_0x329350['datasetCode'],_0x11c052[_0x4c9c2f(0x1a1)]]];for(const [_0x59e9d3,_0x4a9410,_0x1d1ba9]of _0x276bad){assertVerified(sameValue(_0x4a9410,_0x1d1ba9),_0x4c9c2f(0x1a7)+_0x11c052['id']+'\x20'+_0x59e9d3+_0x4c9c2f(0x16b));}}function sameValue(_0x4d86b1,_0x4d1e9f){const _0x5e3ae9=a175_0x2d7fee;if(Array[_0x5e3ae9(0x189)](_0x4d86b1)||Array[_0x5e3ae9(0x189)](_0x4d1e9f))return JSON[_0x5e3ae9(0x1b3)](_0x4d86b1)===JSON['stringify'](_0x4d1e9f);return _0x4d86b1===_0x4d1e9f;}
|
|
1
|
+
const a180_0x13d0dc=a180_0x80cf;function a180_0x80cf(_0x43932d,_0x1862ff){_0x43932d=_0x43932d-0x159;const _0x2b2722=a180_0x2b27();let _0x80cfaa=_0x2b2722[_0x43932d];return _0x80cfaa;}(function(_0x569779,_0x375f3e){const _0x2e539f=a180_0x80cf,_0x175614=_0x569779();while(!![]){try{const _0x4d461a=parseInt(_0x2e539f(0x172))/0x1*(parseInt(_0x2e539f(0x1c6))/0x2)+-parseInt(_0x2e539f(0x19f))/0x3*(parseInt(_0x2e539f(0x17e))/0x4)+-parseInt(_0x2e539f(0x16d))/0x5*(-parseInt(_0x2e539f(0x170))/0x6)+parseInt(_0x2e539f(0x16c))/0x7+-parseInt(_0x2e539f(0x1c2))/0x8+-parseInt(_0x2e539f(0x1a1))/0x9+-parseInt(_0x2e539f(0x1c8))/0xa;if(_0x4d461a===_0x375f3e)break;else _0x175614['push'](_0x175614['shift']());}catch(_0x14c055){_0x175614['push'](_0x175614['shift']());}}}(a180_0x2b27,0xa28d6));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../commands/menu/shared/facts.js';import{asVerificationError,assertVerified,describeMenuErrorCause,fetchMutationSnapshot,hasFlag,isMenuResponseLoss,mapMenuApiError,menuDryRunResult,menuError,menuFailure,mutationResult,recheckMutationSnapshot,requireExplicitYes}from'../../commands/menu/shared/mutations.js';import{updateMenuEntity}from'../../commands/menu/shared/service.js';import{CliErrors}from'../../errors.js';const BACKEND=[{'method':a180_0x13d0dc(0x183),'path':a180_0x13d0dc(0x164)}];export const menuVisibilityUpdate={'service':a180_0x13d0dc(0x178),'command':a180_0x13d0dc(0x196),'description':a180_0x13d0dc(0x16e),'risk':'high-risk-write','structuredErrors':!![],'flags':[{'name':a180_0x13d0dc(0x160),'type':a180_0x13d0dc(0x15e),'description':a180_0x13d0dc(0x1c0)},{'name':'paths','type':a180_0x13d0dc(0x15e),'description':'Exact\x20comma-separated\x20menu\x20paths\x20to\x20update'},{'name':a180_0x13d0dc(0x1be),'type':a180_0x13d0dc(0x1c1),'required':!![],'description':a180_0x13d0dc(0x1b4)},{'name':a180_0x13d0dc(0x1cc),'type':a180_0x13d0dc(0x1c1),'description':'Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility'},{'name':'expected-count','type':a180_0x13d0dc(0x19c),'description':a180_0x13d0dc(0x173)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x226902){parseInput(_0x226902),requireExplicitYes(_0x226902);},async 'dryRun'(_0x2ab56e){const _0x8a0505=a180_0x13d0dc,_0x396022=await buildPlan(_0x2ab56e,!![]),_0x382631=_0x396022['plan'][_0x8a0505(0x1ac)]?.[_0x8a0505(0x188)]??0x0,_0x433246=_0x396022[_0x8a0505(0x190)][_0x8a0505(0x18e)]['length']-_0x382631;return menuDryRunResult(_0x396022[_0x8a0505(0x190)],{'method':'POST','url':_0x8a0505(0x164),'body':{'updates':_0x396022['plan']['plannedActions']?.['map'](_0x25183b=>_0x25183b[_0x8a0505(0x18d)])??[]},'description':_0x8a0505(0x17d)+_0x382631+_0x8a0505(0x166)+_0x433246+'\x20unchanged\x20menu(s).'});},async 'execute'(_0x442f82){const _0xb8be52=a180_0x13d0dc;requireExplicitYes(_0x442f82);const _0x495e4e=await buildPlan(_0x442f82,![]);await recheckMutationSnapshot(_0x442f82,_0x495e4e[_0xb8be52(0x190)],'update\x20menu\x20visibility');const _0x53758d=[],_0x493cb3=[],_0x38c991=[];for(const _0xa861e of _0x495e4e[_0xb8be52(0x190)][_0xb8be52(0x18e)]){if(_0xa861e[_0xb8be52(0x195)][_0xb8be52(0x1be)]===_0x495e4e[_0xb8be52(0x190)]['requestedVisible']){_0x53758d[_0xb8be52(0x1a7)]({'id':_0xa861e['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0x442f82[_0xb8be52(0x16b)],_0x442f82[_0xb8be52(0x163)],{'id':_0xa861e['id'],'visible':_0x495e4e[_0xb8be52(0x190)]['requestedVisible']}),_0x53758d['push']({'id':_0xa861e['id'],'updated':!![],'skipped':![]});}catch(_0x5d6dba){const _0x38caec=mapMenuApiError(_0x5d6dba,_0xb8be52(0x15b),_0xa861e['id']);if(isMenuResponseLoss(_0x5d6dba)&&_0x38caec[_0xb8be52(0x15d)]!==_0xb8be52(0x1d2)){_0x38c991[_0xb8be52(0x1a7)](_0xa861e['id']);continue;}_0x493cb3['push']({'id':_0xa861e['id'],'stage':_0xb8be52(0x180),'code':_0x38caec[_0xb8be52(0x15d)],'message':_0x38caec[_0xb8be52(0x1ad)]});}}let _0x6b79e6;try{_0x6b79e6=await fetchMenuSnapshot(_0x442f82[_0xb8be52(0x16b)],_0x442f82[_0xb8be52(0x163)]);}catch(_0x5776c5){const _0xc68148=describeMenuErrorCause(_0x5776c5,'verify\x20menu\x20visibility\x20update'),_0x54ec72=_0x38c991[_0xb8be52(0x15f)](_0x4ecc49=>({'id':_0x4ecc49,'stage':_0xb8be52(0x17a),'code':_0xb8be52(0x18b),'message':'Response\x20was\x20lost\x20for\x20menu\x20'+_0x4ecc49+_0xb8be52(0x1d0),'requestedStateConfirmed':![],'recovered':![]})),_0x2fda6e={'stage':_0xb8be52(0x181),'code':_0xb8be52(0x18b),'message':'Final\x20menu\x20visibility\x20readback\x20failed.','targetIds':_0x495e4e['plan'][_0xb8be52(0x18e)][_0xb8be52(0x15f)](_0x48dc99=>_0x48dc99['id']),'requestedStateConfirmed':![],..._0xc68148};throw menuFailure(asVerificationError(_0x5776c5,'Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state'),_0x495e4e[_0xb8be52(0x190)],{'stage':_0xb8be52(0x181),'succeeded':_0x53758d,'failedRecords':[..._0x493cb3,..._0x54ec72,_0x2fda6e],'warnings':[_0xb8be52(0x185)],'verification':{'status':_0xb8be52(0x169),'recoveredCount':0x0,'lookupCommand':_0xb8be52(0x1b8)}});}const _0x4a82c0=[];for(const _0x20f914 of _0x53758d){const _0x269d96=Number(_0x20f914['id']),_0x423c89=_0x495e4e['beforeById'][_0xb8be52(0x1cb)](_0x269d96),_0x1184f5=_0x6b79e6[_0xb8be52(0x15a)]['get'](_0x269d96);try{verifyVisibilityUpdate(_0x423c89,_0x1184f5,_0x495e4e[_0xb8be52(0x190)][_0xb8be52(0x162)]);}catch(_0xaf90b8){const _0x5594bb=asVerificationError(_0xaf90b8,'Menu\x20'+_0x269d96+_0xb8be52(0x1c3));_0x4a82c0[_0xb8be52(0x1a7)]({'id':_0x269d96,'stage':_0xb8be52(0x181),'code':_0x5594bb[_0xb8be52(0x15d)],'message':_0x5594bb[_0xb8be52(0x1ad)],'requestedStateConfirmed':![]});}}for(const _0x56770e of _0x38c991){const _0x551752=_0x495e4e[_0xb8be52(0x1bf)][_0xb8be52(0x1cb)](_0x56770e),_0x2ed03d=_0x6b79e6[_0xb8be52(0x15a)][_0xb8be52(0x1cb)](_0x56770e);try{verifyVisibilityUpdate(_0x551752,_0x2ed03d,_0x495e4e['plan']['requestedVisible']),_0x53758d[_0xb8be52(0x1a7)]({'id':_0x56770e,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0x170bdd){const _0x29f230=asVerificationError(_0x170bdd,_0xb8be52(0x1b9)+_0x56770e+_0xb8be52(0x167));_0x4a82c0[_0xb8be52(0x1a7)]({'id':_0x56770e,'stage':_0xb8be52(0x17a),'code':_0x29f230['code'],'message':_0x29f230[_0xb8be52(0x1ad)],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x4a82c0[_0xb8be52(0x188)]>0x0){const _0x4812f4=_0x4a82c0[_0xb8be52(0x15f)](_0x2a6dc8=>Number(_0x2a6dc8['id'])),_0xa48d05=_0x53758d[_0xb8be52(0x182)](_0x43fe62=>_0x43fe62[_0xb8be52(0x17c)]===!![])[_0xb8be52(0x188)],_0xd1d528=menuError('menu_verification_failed',_0xb8be52(0x1bc)+_0x4812f4[_0xb8be52(0x1c4)](',\x20')+'.',_0xb8be52(0x194));throw menuFailure(_0xd1d528,_0x495e4e['plan'],{'stage':'verification','succeeded':_0x53758d,'failedRecords':[..._0x493cb3,..._0x4a82c0],'warnings':['One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.'],'verification':{'status':_0xb8be52(0x169),..._0x4812f4[_0xb8be52(0x188)]===0x1?{'targetId':_0x4812f4[0x0]}:{'targetIds':_0x4812f4},'recoveredCount':_0xa48d05,'lookupCommand':_0xb8be52(0x1b8)}});}const _0x1ba6a2=_0x53758d[_0xb8be52(0x182)](_0x119749=>_0x119749[_0xb8be52(0x177)]===!![])[_0xb8be52(0x188)],_0x5dd89a=_0x53758d[_0xb8be52(0x188)]-_0x1ba6a2,_0x529789={..._0x495e4e['plan'],'succeeded':_0x53758d,'failed':_0x493cb3,'warnings':_0x493cb3['length']>0x0?[..._0x495e4e[_0xb8be52(0x190)]['warnings'],_0xb8be52(0x18c)]:_0x495e4e[_0xb8be52(0x190)]['warnings'],'verification':{'checkedBy':_0xb8be52(0x1ab),'snapshotHash':_0x6b79e6[_0xb8be52(0x176)],'matchesRequestedState':_0x493cb3[_0xb8be52(0x188)]===0x0,'recoveredCount':_0x38c991[_0xb8be52(0x188)]}};return{'ok':_0x493cb3[_0xb8be52(0x188)]===0x0,'data':_0x529789,'message':_0x493cb3['length']===0x0?'Updated\x20visibility\x20for\x20'+_0x1ba6a2+'\x20menu(s);\x20skipped\x20'+_0x5dd89a+_0xb8be52(0x192):'Menu\x20visibility\x20update\x20completed:\x20'+_0x1ba6a2+_0xb8be52(0x1a2)+_0x5dd89a+'\x20skipped,\x20'+_0x493cb3['length']+_0xb8be52(0x1cf)};}};function parseInput(_0x4ddc4b){const _0x834b47=a180_0x13d0dc,_0x5a6e78=parseMenuIds(_0x4ddc4b[_0x834b47(0x18f)]('menu-ids')),_0x3e7c6b=parseCsv(_0x4ddc4b[_0x834b47(0x18f)](_0x834b47(0x197)));if(_0x5a6e78[_0x834b47(0x188)]===0x0&&_0x3e7c6b[_0x834b47(0x188)]===0x0)throw CliErrors[_0x834b47(0x1af)](_0x834b47(0x161));const _0x5e808f=parseBooleanFlag(_0x4ddc4b,_0x834b47(0x1be),!![]),_0x2f13b9=parseBooleanFlag(_0x4ddc4b,_0x834b47(0x1cc),![]);let _0x473dd3;if(hasFlag(_0x4ddc4b,'expected-count')){_0x473dd3=_0x4ddc4b[_0x834b47(0x1bd)](_0x834b47(0x1d1));if(!Number[_0x834b47(0x1ca)](_0x473dd3)||_0x473dd3<0x0)throw CliErrors[_0x834b47(0x1af)](_0x834b47(0x1c9));}return{'menuIds':_0x5a6e78,'paths':_0x3e7c6b,'visible':_0x5e808f,'expectVisible':_0x2f13b9,'expectedCount':_0x473dd3};}function a180_0x2b27(){const _0xc7ca30=['paths','Menu\x20id\x20selector(s)\x20not\x20found:\x20','pageId','resourcesValid','menuIds','number','label','sort','64542LmuIEa','Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.','223803xMdCBd','\x20updated,\x20','flagMissing','isArray','rawFlags','menu_selector_ambiguous','push','childrenIds','pageType','Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20','menu\x20list','plannedActions','message','menu_state_drift','validation','\x20must\x20be\x20true\x20or\x20false.','trim','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.','datasetId','Requested\x20menu\x20visibility','\x20menu(s),\x20expected\x20','stringify','childrenCount','rabetbase\x20menu\x20list\x20--format\x20compress','Response\x20was\x20lost\x20and\x20menu\x20','expectVisible','split','Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20','num','visible','beforeById','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','boolean','2791336IbLfzn','\x20visibility\x20update\x20could\x20not\x20be\x20verified','join','expectedCount','1443082qTBuFv','set','12619770NoApxV','--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.','isSafeInteger','get','expect-visible','menu_expected_count_mismatch','modelType','\x20failed.','\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','expected-count','menu_permission_denied','datasetCode','byId','update\x20visibility\x20for','true','code','string','map','menu-ids','menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.','requestedVisible','cookie','/smartapi/menu/update','depth','\x20menu(s);\x20skip\x20','\x20visibility\x20could\x20not\x20be\x20verified\x20safely','Selected\x20','failed','\x20was\x20not\x20found\x20during\x20visibility\x20verification.','appCode','3823211SLjGcM','5aTuDlD','Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','menus','7106754NcpYOV','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','1bxsMCL','Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches','path','type','hash','updated','menu','parentId','update-recovery','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.','recovered','Would\x20update\x20visibility\x20for\x20','28VpweIB','values','update','verification','filter','POST','Menu\x20','The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.','url','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20','length','resources','\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.','menu_verification_failed','Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','body','targets','str','plan','false','\x20unchanged\x20menu(s).','Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.','before','visibility-update'];a180_0x2b27=function(){return _0xc7ca30;};return a180_0x2b27();}async function buildPlan(_0x48052e,_0x17b1eb){const _0x498ed1=a180_0x13d0dc,_0x30fb41=parseInput(_0x48052e),_0x355a6d=await fetchMutationSnapshot(_0x48052e,'update\x20menu\x20visibility'),_0x5c84ce=selectTargets(_0x355a6d[_0x498ed1(0x16f)],_0x30fb41[_0x498ed1(0x19b)],_0x30fb41[_0x498ed1(0x197)]);if(_0x30fb41['expectedCount']!==undefined&&_0x5c84ce[_0x498ed1(0x188)]!==_0x30fb41[_0x498ed1(0x1c5)])throw menuError(_0x498ed1(0x1cd),_0x498ed1(0x168)+_0x5c84ce[_0x498ed1(0x188)]+_0x498ed1(0x1b5)+_0x30fb41[_0x498ed1(0x1c5)]+'.','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.');if(_0x30fb41[_0x498ed1(0x1ba)]!==undefined){const _0x43290f=_0x5c84ce[_0x498ed1(0x182)](_0x1f2d85=>_0x1f2d85[_0x498ed1(0x1be)]!==_0x30fb41[_0x498ed1(0x1ba)]);if(_0x43290f[_0x498ed1(0x188)]>0x0)throw menuError(_0x498ed1(0x1ae),_0x498ed1(0x1aa)+_0x43290f[_0x498ed1(0x15f)](_0x5ad5e4=>_0x5ad5e4['id'])[_0x498ed1(0x1c4)](',\x20')+'.','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.');}const _0x38687c=_0x5c84ce[_0x498ed1(0x15f)](_0x4f594b=>({'id':_0x4f594b['id'],'label':_0x4f594b['label'],'path':_0x4f594b[_0x498ed1(0x174)],'before':{'visible':_0x4f594b[_0x498ed1(0x1be)]},'after':{'visible':_0x30fb41[_0x498ed1(0x1be)]}})),_0x2173e6=_0x38687c[_0x498ed1(0x182)](_0x1c18d5=>_0x1c18d5[_0x498ed1(0x195)][_0x498ed1(0x1be)]!==_0x30fb41['visible'])['map'](_0xa13d75=>({'stage':'update-menu-visibility','method':_0x498ed1(0x183),'path':'/smartapi/menu/update','body':{'appCode':_0x48052e[_0x498ed1(0x16b)],'id':_0xa13d75['id'],'visible':_0x30fb41[_0x498ed1(0x1be)]}})),_0x3af1e3=mutationResult({'operation':_0x498ed1(0x196),'selector':{'menuIds':_0x30fb41[_0x498ed1(0x19b)],'paths':_0x30fb41[_0x498ed1(0x197)]},'before':{'menus':_0x5c84ce[_0x498ed1(0x15f)](_0xb25554=>({'id':_0xb25554['id'],'path':_0xb25554[_0x498ed1(0x174)],'visible':_0xb25554[_0x498ed1(0x1be)]}))},'after':{'menus':_0x5c84ce[_0x498ed1(0x15f)](_0x4b0949=>({'id':_0x4b0949['id'],'path':_0x4b0949[_0x498ed1(0x174)],'visible':_0x30fb41[_0x498ed1(0x1be)]}))},'dryRun':_0x17b1eb,'backend':[...BACKEND],'plannedActions':_0x2173e6,'snapshotHash':_0x355a6d[_0x498ed1(0x176)],'warnings':_0x2173e6[_0x498ed1(0x188)]===0x0?[_0x498ed1(0x1a0)]:[]});return{'plan':{..._0x3af1e3,'requestedVisible':_0x30fb41[_0x498ed1(0x1be)],'targets':_0x38687c},'beforeById':new Map(_0x5c84ce['map'](_0x3cf2ca=>[_0x3cf2ca['id'],_0x3cf2ca]))};}function selectTargets(_0xad3a24,_0x519058,_0x5e7c66){const _0xb6149f=a180_0x13d0dc,_0x397bde=new Map(_0xad3a24[_0xb6149f(0x15f)](_0x486fa9=>[_0x486fa9['id'],_0x486fa9])),_0x45be2c=new Map(),_0x4b9d88=_0x519058[_0xb6149f(0x182)](_0xdf4133=>!_0x397bde['has'](_0xdf4133));if(_0x4b9d88[_0xb6149f(0x188)]>0x0)throw menuError('menu_selector_not_found',_0xb6149f(0x198)+_0x4b9d88[_0xb6149f(0x1c4)](',\x20')+'.',_0xb6149f(0x17b));for(const _0xdcb22c of _0x519058){_0x45be2c[_0xb6149f(0x1c7)](_0xdcb22c,_0x397bde['get'](_0xdcb22c));}for(const _0x174437 of _0x5e7c66){const _0x46b03d=_0xad3a24['filter'](_0x283fbf=>_0x283fbf[_0xb6149f(0x174)]===_0x174437);if(_0x46b03d[_0xb6149f(0x188)]===0x0)throw menuError('menu_selector_not_found','Menu\x20path\x20selector\x20not\x20found:\x20'+JSON['stringify'](_0x174437)+'.',_0xb6149f(0x1b2));if(_0x46b03d[_0xb6149f(0x188)]>0x1)throw menuError(_0xb6149f(0x1a6),_0xb6149f(0x193)+JSON['stringify'](_0x174437)+'.',_0xb6149f(0x187)+_0x46b03d['map'](_0x2f5d38=>_0x2f5d38['id'])[_0xb6149f(0x1c4)](',\x20')+'.');const _0x1f4d6a=_0x46b03d[0x0];_0x45be2c['set'](_0x1f4d6a['id'],_0x1f4d6a);}return[..._0x45be2c[_0xb6149f(0x17f)]()];}function parseMenuIds(_0x264c50){const _0x274158=a180_0x13d0dc,_0x167731=parseCsv(_0x264c50),_0x28a211=_0x167731[_0x274158(0x15f)](Number);if(_0x28a211['some'](_0x47b80a=>!Number[_0x274158(0x1ca)](_0x47b80a)||_0x47b80a<=0x0))throw CliErrors[_0x274158(0x1af)](_0x274158(0x171));return[...new Set(_0x28a211)];}function parseCsv(_0x2a1b9b){const _0x155438=a180_0x13d0dc;return[...new Set(_0x2a1b9b[_0x155438(0x1bb)](',')['map'](_0x5ddaa2=>_0x5ddaa2[_0x155438(0x1b1)]())['filter'](Boolean))];}function parseBooleanFlag(_0x5e08e0,_0x1fc338,_0x21878b){const _0x7259e8=a180_0x13d0dc;if(!hasFlag(_0x5e08e0,_0x1fc338)){if(_0x21878b)throw CliErrors[_0x7259e8(0x1a3)](_0x1fc338);return undefined;}const _0x11ecee=_0x5e08e0[_0x7259e8(0x1a5)][_0x1fc338];if(_0x11ecee===!![]||_0x11ecee===![])return _0x11ecee;if(_0x11ecee===_0x7259e8(0x15c))return!![];if(_0x11ecee===_0x7259e8(0x191))return![];throw CliErrors[_0x7259e8(0x1af)]('--'+_0x1fc338+_0x7259e8(0x1b0));}function verifyVisibilityUpdate(_0x186737,_0x433a90,_0x49662a){const _0x5271dd=a180_0x13d0dc;assertVerified(!!_0x433a90,_0x5271dd(0x184)+_0x186737['id']+_0x5271dd(0x16a)),assertVerified(_0x433a90[_0x5271dd(0x1be)]===_0x49662a,_0x5271dd(0x184)+_0x186737['id']+_0x5271dd(0x18a));const _0x3eb4e9=[['id',_0x433a90['id'],_0x186737['id']],[_0x5271dd(0x179),_0x433a90[_0x5271dd(0x179)],_0x186737[_0x5271dd(0x179)]],[_0x5271dd(0x165),_0x433a90[_0x5271dd(0x165)],_0x186737[_0x5271dd(0x165)]],[_0x5271dd(0x19d),_0x433a90[_0x5271dd(0x19d)],_0x186737[_0x5271dd(0x19d)]],[_0x5271dd(0x174),_0x433a90['path'],_0x186737['path']],[_0x5271dd(0x186),_0x433a90[_0x5271dd(0x186)],_0x186737[_0x5271dd(0x186)]],[_0x5271dd(0x175),_0x433a90[_0x5271dd(0x175)],_0x186737[_0x5271dd(0x175)]],[_0x5271dd(0x19e),_0x433a90[_0x5271dd(0x19e)],_0x186737['sort']],['resources',_0x433a90[_0x5271dd(0x189)],_0x186737[_0x5271dd(0x189)]],['resourcesValid',_0x433a90[_0x5271dd(0x19a)],_0x186737[_0x5271dd(0x19a)]],[_0x5271dd(0x1a8),_0x433a90[_0x5271dd(0x1a8)],_0x186737['childrenIds']],[_0x5271dd(0x1b7),_0x433a90['childrenCount'],_0x186737[_0x5271dd(0x1b7)]],['pageId',_0x433a90[_0x5271dd(0x199)],_0x186737[_0x5271dd(0x199)]],[_0x5271dd(0x1a9),_0x433a90[_0x5271dd(0x1a9)],_0x186737[_0x5271dd(0x1a9)]],[_0x5271dd(0x1ce),_0x433a90['modelType'],_0x186737[_0x5271dd(0x1ce)]],[_0x5271dd(0x1b3),_0x433a90[_0x5271dd(0x1b3)],_0x186737[_0x5271dd(0x1b3)]],[_0x5271dd(0x159),_0x433a90[_0x5271dd(0x159)],_0x186737['datasetCode']]];for(const [_0x28b2b3,_0x441b1e,_0x4240f0]of _0x3eb4e9){assertVerified(sameValue(_0x441b1e,_0x4240f0),_0x5271dd(0x184)+_0x186737['id']+'\x20'+_0x28b2b3+'\x20changed\x20unexpectedly.');}}function sameValue(_0x1bd12f,_0x418a09){const _0x32458a=a180_0x13d0dc;if(Array[_0x32458a(0x1a4)](_0x1bd12f)||Array[_0x32458a(0x1a4)](_0x418a09))return JSON[_0x32458a(0x1b6)](_0x1bd12f)===JSON[_0x32458a(0x1b6)](_0x418a09);return _0x1bd12f===_0x418a09;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a181_0x3c39e2=a181_0x5a20;(function(_0x2a3359,_0x2c2d4a){const _0x3c9f6e=a181_0x5a20,_0x11adda=_0x2a3359();while(!![]){try{const _0x469a45=-parseInt(_0x3c9f6e(0x1fd))/0x1+-parseInt(_0x3c9f6e(0x1f8))/0x2*(-parseInt(_0x3c9f6e(0x204))/0x3)+-parseInt(_0x3c9f6e(0x207))/0x4+parseInt(_0x3c9f6e(0x1fc))/0x5+-parseInt(_0x3c9f6e(0x201))/0x6+-parseInt(_0x3c9f6e(0x1fa))/0x7*(-parseInt(_0x3c9f6e(0x209))/0x8)+parseInt(_0x3c9f6e(0x1f0))/0x9;if(_0x469a45===_0x2c2d4a)break;else _0x11adda['push'](_0x11adda['shift']());}catch(_0x49a344){_0x11adda['push'](_0x11adda['shift']());}}}(a181_0x1e5d,0x3b1fe));function a181_0x5a20(_0x161e3d,_0x5c1377){_0x161e3d=_0x161e3d-0x1eb;const _0x1e5da5=a181_0x1e5d();let _0x5a2008=_0x1e5da5[_0x161e3d];return _0x5a2008;}import{asDryRunResult}from'../../commands/common/dry-run.js';function a181_0x1e5d(){const _0x45f165=['notification','747313jMNTjO','isSafeInteger','1655350frlpmz','357948CQxyki','Create\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20source','Created\x20notification\x20config\x20','Notification\x20config\x20create\x20outcome\x20is\x20unknown\x20because\x20no\x20server\x20ID\x20was\x20received.','1782930yrbSZX','endpointUrl','create','3GWNImO','Notification\x20config\x20create\x20returned\x20no\x20usable\x20server\x20ID.','configName','558648nyQuAW','planned','8iHzCHr',';\x20do\x20not\x20resubmit.','channelConfig','document','/notification/channel-config/create','notification_config_create_outcome_unknown','configCode','config-create','channelType','3000483dIESHV','appCode',';\x20no\x20automatic\x20retry\x20was\x20attempted.','write','POST','mutation','connectTimeout','Inspect\x20with\x20','531446GaJnpf'];a181_0x1e5d=function(){return _0x45f165;};return a181_0x1e5d();}import{createNotificationChannelConfig,getNotificationChannelConfig,isPlatformTransportFailure}from'../../core/api-client.js';import{assertSingleNotificationSource,createMutationInput,DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,DEFAULT_NOTIFICATION_READ_TIMEOUT,normalizeExactNotificationConfig,notificationError,notificationLookupCommand,NOTIFICATION_APP_FLAG,NOTIFICATION_INPUT_FLAGS,projectNotificationConfig,readNotificationDocument,safeApiFailure}from'../../commands/notification/shared.js';const CREATE_PATH=a181_0x3c39e2(0x1eb);async function prepareCreate(_0x2ca0c1){const _0x8e63c7=a181_0x3c39e2,_0x5c2608=await readNotificationDocument(_0x2ca0c1,_0x8e63c7(0x203)),_0x108e76=createMutationInput(_0x2ca0c1[_0x8e63c7(0x1f1)],_0x5c2608);return{'document':_0x5c2608,'input':_0x108e76,'planned':projectNotificationConfig({'appCode':_0x2ca0c1[_0x8e63c7(0x1f1)],'configName':_0x5c2608[_0x8e63c7(0x206)],'channelType':_0x5c2608[_0x8e63c7(0x1ef)],'endpointUrl':_0x5c2608[_0x8e63c7(0x202)],'channelConfig':_0x5c2608[_0x8e63c7(0x20b)],'description':_0x5c2608['description'],'connectTimeout':_0x5c2608[_0x8e63c7(0x1f6)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,'readTimeout':_0x5c2608['readTimeout']??DEFAULT_NOTIFICATION_READ_TIMEOUT})};}export const notificationConfigCreate={'service':a181_0x3c39e2(0x1f9),'command':a181_0x3c39e2(0x1ee),'description':a181_0x3c39e2(0x1fe),'risk':a181_0x3c39e2(0x1f3),'requiresAppCode':!![],'structuredErrors':!![],'flags':[...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x7b19ce){assertSingleNotificationSource(_0x7b19ce);},async 'dryRun'(_0x206072){const _0x311547=a181_0x3c39e2,_0x4d1d5a=await prepareCreate(_0x206072),_0x47fc10=notificationLookupCommand(_0x206072[_0x311547(0x1f1)],_0x4d1d5a[_0x311547(0x20c)]['channelType']);return asDryRunResult({'operation':'create','selector':{'appCode':_0x206072[_0x311547(0x1f1)],'configName':_0x4d1d5a['document'][_0x311547(0x206)],'channelType':_0x4d1d5a[_0x311547(0x20c)]['channelType']},'before':null,'after':_0x4d1d5a[_0x311547(0x208)],'dryRun':!![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[],'verification':{'status':_0x311547(0x208),'lookupCommand':_0x47fc10}},{'method':_0x311547(0x1f4),'url':CREATE_PATH});},async 'execute'(_0x5917b1){const _0x52ee49=a181_0x3c39e2,_0xa8ac53=await prepareCreate(_0x5917b1),_0x1f86a6=notificationLookupCommand(_0x5917b1[_0x52ee49(0x1f1)],_0xa8ac53[_0x52ee49(0x20c)][_0x52ee49(0x1ef)]);let _0x8ce3aa;try{_0x8ce3aa=await createNotificationChannelConfig(_0xa8ac53['input']);}catch(_0x235665){if(isPlatformTransportFailure(_0x235665))throw notificationError('notification_config_create_outcome_unknown',_0x52ee49(0x200),_0x52ee49(0x1f7)+_0x1f86a6+_0x52ee49(0x20a));throw safeApiFailure(_0x52ee49(0x203),_0x52ee49(0x1f5),_0x52ee49(0x1f7)+_0x1f86a6+_0x52ee49(0x1f2));}if(!Number[_0x52ee49(0x1fb)](_0x8ce3aa)||_0x8ce3aa<=0x0)throw notificationError(_0x52ee49(0x1ec),_0x52ee49(0x205),_0x52ee49(0x1f7)+_0x1f86a6+_0x52ee49(0x20a));let _0x55548d;try{const _0x43bb3f=await getNotificationChannelConfig(_0x8ce3aa,_0x5917b1['appCode']);_0x55548d=normalizeExactNotificationConfig(_0x43bb3f,_0x8ce3aa,_0x5917b1[_0x52ee49(0x1f1)]);}catch{throw safeApiFailure('create','verification',_0x52ee49(0x1f7)+_0x1f86a6+';\x20do\x20not\x20resubmit\x20automatically.');}return{'ok':!![],'data':{'operation':'create','selector':{'appCode':_0x55548d[_0x52ee49(0x1f1)],'id':_0x55548d['id'],'configCode':_0x55548d[_0x52ee49(0x1ed)],'configName':_0x55548d[_0x52ee49(0x206)],'channelType':_0x55548d[_0x52ee49(0x1ef)]},'before':null,'after':projectNotificationConfig(_0x55548d),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[],'verification':{'status':'verified','lookupCommand':_0x1f86a6}},'message':_0x52ee49(0x1ff)+_0x55548d['id']};}};
|