@lovrabet/rabetbase-cli 2.5.4-beta.3 → 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 +16 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +22 -13
- 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/references/rabetbase-user-account.md +8 -8
- 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_0x4da4d8=a170_0x21bd;(function(_0x5110b2,_0x48352f){const _0x46c834=a170_0x21bd,_0x41e234=_0x5110b2();while(!![]){try{const _0x282575=-parseInt(_0x46c834(0xec))/0x1*(parseInt(_0x46c834(0xe3))/0x2)+-parseInt(_0x46c834(0xed))/0x3*(parseInt(_0x46c834(0xe4))/0x4)+-parseInt(_0x46c834(0xe5))/0x5*(-parseInt(_0x46c834(0xff))/0x6)+-parseInt(_0x46c834(0xd7))/0x7*(-parseInt(_0x46c834(0xf2))/0x8)+parseInt(_0x46c834(0xdb))/0x9+-parseInt(_0x46c834(0xd6))/0xa+parseInt(_0x46c834(0xe1))/0xb*(parseInt(_0x46c834(0xe9))/0xc);if(_0x282575===_0x48352f)break;else _0x41e234['push'](_0x41e234['shift']());}catch(_0x1d3411){_0x41e234['push'](_0x41e234['shift']());}}}(a170_0x52df,0x90881));function a170_0x52df(){const _0x4e969a=['2142639LzoGLU','Invalid\x20--params\x20JSON.','string','menu-sync','Start\x20non-interactive\x20menu\x20sync',':\x20expected\x20a\x20non-empty\x20string.','248633fuditm','cssUrl','2260788FUkVfP','3941508YVlFIa','5wcMfBS','jsUrl','has','length','1224xvQSAN','info','trim','1ASCbwd','3pXCgTn','hasOwn','setLogPath','get','message','16616stvwmE','parse','Invalid\x20--params\x20fields:\x20','filter','import','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','No\x20local\x20pages\x20matched\x20paths:\x20','dryRun','path','join','map','--params.','push','3014250LcImlk','Menu\x20sync\x20completed','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','isArray','4482610HbjSHw','371gkWhTt','Invalid\x20--params.','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','\x0a\x20\x20Available\x20local\x20paths:\x20'];a170_0x52df=function(){return _0x4e969a;};return a170_0x52df();}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_0x4da4d8(0xe6),a170_0x4da4d8(0xe2)]);function a170_0x21bd(_0x1eb8fb,_0x284202){_0x1eb8fb=_0x1eb8fb-0xd3;const _0x52df86=a170_0x52df();let _0x21bd67=_0x52df86[_0x1eb8fb];return _0x21bd67;}function validateParams(_0x31aa3e){const _0x1e1e65=a170_0x4da4d8,_0xe1e66a=[];return _0x31aa3e[_0x1e1e65(0xe6)]&&!isValidJsHttpsUrl(_0x31aa3e[_0x1e1e65(0xe6)])&&_0xe1e66a[_0x1e1e65(0xfe)]({'field':_0x1e1e65(0xe6),'message':_0x1e1e65(0xd4)}),_0x31aa3e['cssUrl']&&!isValidCssHttpsUrl(_0x31aa3e['cssUrl'])&&_0xe1e66a[_0x1e1e65(0xfe)]({'field':_0x1e1e65(0xe2),'message':_0x1e1e65(0xd9)}),_0xe1e66a;}export async function runMenuSyncCore(_0x11fb57,_0x2070ad,_0x406e88=[],_0x4e09fc,_0x5862a4={}){const _0x419ca7=a170_0x4da4d8,_0x4eba04=parseMenuSyncParams(_0x4e09fc),_0xa14f22=[...new Set(_0x406e88[_0x419ca7(0xfc)](_0xc8b0c7=>_0xc8b0c7[_0x419ca7(0xeb)]())[_0x419ca7(0xf5)](Boolean))],_0x15d5ac=_0x4eba04[_0x419ca7(0xe6)],_0x46c0db=_0x4eba04['cssUrl'],_0x49d8b5=[];if(_0x15d5ac)_0x49d8b5[_0x419ca7(0xfe)](_0x15d5ac);if(_0x46c0db)_0x49d8b5[_0x419ca7(0xfe)](_0x46c0db);const _0x279f9c=validateParams(_0x4eba04);if(_0x279f9c[_0x419ca7(0xe8)]>0x0){const _0x3f974e=_0x279f9c[_0x419ca7(0xfc)](_0x2de6fe=>_0x419ca7(0xfd)+_0x2de6fe['field']+':\x20'+_0x2de6fe[_0x419ca7(0xf1)])[_0x419ca7(0xfb)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x3f974e);}logger[_0x419ca7(0xef)](process['cwd']()),logger[_0x419ca7(0xea)](_0x419ca7(0xde),_0x419ca7(0xdf),{'appCode':_0x11fb57,'selectedCount':_0xa14f22[_0x419ca7(0xe8)],'jsUrl':_0x15d5ac,'cssUrl':_0x46c0db});if(_0x15d5ac){const _0x15bdf0=await isUrlReachable(_0x15d5ac);if(!_0x15bdf0)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x15d5ac);}if(_0x46c0db){const _0x4f4748=await isUrlReachable(_0x46c0db);if(!_0x4f4748)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x46c0db);}const _0x202c8e=getLocalPages();if(_0x202c8e['length']===0x0){if(_0xa14f22[_0x419ca7(0xe8)]>0x0)throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0xa14f22[_0x419ca7(0xfb)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x5862a4[_0x419ca7(0xf9)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x562f3c=await getOnlineMenuList(_0x11fb57,_0x2070ad),_0x14c620=new Set(_0x562f3c[_0x419ca7(0xfc)](_0x17794f=>_0x17794f[_0x419ca7(0xfa)]));let _0x9dbbb6;if(_0xa14f22[_0x419ca7(0xe8)]>0x0){const _0x48079d=new Map(_0x202c8e[_0x419ca7(0xfc)](_0x182683=>[_0x182683[_0x419ca7(0xfa)],_0x182683])),_0x2b11f6=_0xa14f22[_0x419ca7(0xf5)](_0x128127=>!_0x48079d[_0x419ca7(0xe7)](_0x128127));if(_0x2b11f6[_0x419ca7(0xe8)]>0x0){const _0x2be4b8=_0x202c8e['map'](_0x36c686=>_0x36c686[_0x419ca7(0xfa)])[_0x419ca7(0xfb)](',\x20');throw new Error(_0x419ca7(0xf8)+_0x2b11f6['join'](',\x20')+_0x419ca7(0xda)+_0x2be4b8);}const _0x52e25a=_0xa14f22[_0x419ca7(0xf5)](_0x4332e2=>_0x14c620[_0x419ca7(0xe7)](_0x4332e2));if(_0x52e25a['length']>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0x52e25a['join'](',\x20'));_0x9dbbb6=_0xa14f22[_0x419ca7(0xfc)](_0x1ddc3a=>_0x48079d[_0x419ca7(0xf0)](_0x1ddc3a));}else _0x9dbbb6=_0x202c8e['filter'](_0xe61e76=>!_0x14c620[_0x419ca7(0xe7)](_0xe61e76['path']));if(_0x9dbbb6[_0x419ca7(0xe8)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x5862a4[_0x419ca7(0xf9)]===!![],'targetPages':[],'plannedMenus':[]};const _0x10757c=_0x9dbbb6[_0x419ca7(0xfc)](_0x3858b6=>({'type':'procode','path':_0x3858b6[_0x419ca7(0xfa)],'label':_0x3858b6['label'],'loadScriptMode':_0x419ca7(0xf6),'resources':[..._0x49d8b5]}));if(_0x5862a4[_0x419ca7(0xf9)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x9dbbb6,'plannedMenus':_0x10757c};const _0x5030c6=await createMenus(_0x11fb57,_0x2070ad,_0x9dbbb6,_0x49d8b5[_0x419ca7(0xe8)]>0x0?_0x49d8b5:undefined);return logger[_0x419ca7(0xea)](_0x419ca7(0xde),_0x419ca7(0xd3),{'count':_0x9dbbb6['length'],'resources':_0x49d8b5}),{'created':_0x5030c6[_0x419ca7(0xe8)],'skipped':![],'dryRun':![],'targetPages':_0x9dbbb6,'plannedMenus':_0x10757c,'menus':_0x5030c6};}export function parseMenuSyncParams(_0x25f5c4){const _0x3715eb=a170_0x4da4d8;if(!_0x25f5c4||typeof _0x25f5c4!==_0x3715eb(0xdd))return{};let _0x27f74a;try{_0x27f74a=JSON[_0x3715eb(0xf3)](_0x25f5c4);}catch{throw new Error(_0x3715eb(0xdc));}if(typeof _0x27f74a!=='object'||_0x27f74a===null||Array[_0x3715eb(0xd5)](_0x27f74a))throw new Error(_0x3715eb(0xf7));const _0x3fed5e=_0x27f74a;if(Object[_0x3715eb(0xee)](_0x3fed5e,'pages'))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x3bbd42=Object['keys'](_0x3fed5e)[_0x3715eb(0xf5)](_0x267947=>!MENU_SYNC_PARAM_KEYS[_0x3715eb(0xe7)](_0x267947));if(_0x3bbd42[_0x3715eb(0xe8)]>0x0)throw new Error(_0x3715eb(0xf4)+_0x3bbd42[_0x3715eb(0xfb)](',\x20')+'.');for(const _0x2f6aa3 of MENU_SYNC_PARAM_KEYS){const _0xc0fdbc=_0x3fed5e[_0x2f6aa3];if(_0xc0fdbc!==undefined&&(typeof _0xc0fdbc!==_0x3715eb(0xdd)||_0xc0fdbc['trim']()===''))throw new Error(_0x3715eb(0xd8)+_0x2f6aa3+_0x3715eb(0xe0));}return{'jsUrl':typeof _0x3fed5e[_0x3715eb(0xe6)]===_0x3715eb(0xdd)?_0x3fed5e[_0x3715eb(0xe6)][_0x3715eb(0xeb)]():undefined,'cssUrl':typeof _0x3fed5e[_0x3715eb(0xe2)]===_0x3715eb(0xdd)?_0x3fed5e[_0x3715eb(0xe2)][_0x3715eb(0xeb)]():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(_0x5badfe,_0x4d8e6b){const _0x1e0299=a172_0x32f2,_0x3eaa90=_0x5badfe();while(!![]){try{const _0x4aa1ed=-parseInt(_0x1e0299(0x117))/0x1*(-parseInt(_0x1e0299(0x128))/0x2)+-parseInt(_0x1e0299(0x113))/0x3*(-parseInt(_0x1e0299(0x134))/0x4)+parseInt(_0x1e0299(0xf9))/0x5+-parseInt(_0x1e0299(0x111))/0x6+-parseInt(_0x1e0299(0xf3))/0x7+parseInt(_0x1e0299(0x10e))/0x8*(parseInt(_0x1e0299(0xf7))/0x9)+parseInt(_0x1e0299(0x104))/0xa*(-parseInt(_0x1e0299(0x100))/0xb);if(_0x4aa1ed===_0x4d8e6b)break;else _0x3eaa90['push'](_0x3eaa90['shift']());}catch(_0x3c3981){_0x3eaa90['push'](_0x3eaa90['shift']());}}}(a172_0x13e6,0x9874d));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(_0x4cc996){const _0x339ef4=a172_0x32f2,_0x20afb3=[];return _0x4cc996[_0x339ef4(0x10d)]&&!isValidJsHttpsUrl(_0x4cc996[_0x339ef4(0x10d)])&&_0x20afb3[_0x339ef4(0xf1)]({'field':'jsUrl','message':_0x339ef4(0x118)}),_0x4cc996['cssUrl']&&!isValidCssHttpsUrl(_0x4cc996['cssUrl'])&&_0x20afb3[_0x339ef4(0xf1)]({'field':_0x339ef4(0x125),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x20afb3;}function a172_0x32f2(_0x33fbb5,_0x1b835e){_0x33fbb5=_0x33fbb5-0xee;const _0x13e637=a172_0x13e6();let _0x32f2aa=_0x13e637[_0x33fbb5];return _0x32f2aa;}export async function runMenuUpdateCore(_0x4cb311,_0x2f9ed7,_0x2ce061,_0x465fe3={}){const _0x3e4877=a172_0x32f2,_0xdf8441=parseUpdateParamsFlag(_0x2ce061),_0x12e983=normalizeMode(_0x465fe3['mode']);validateSelection(_0x465fe3['selection']);const _0x5e6cd0=[];if(_0xdf8441[_0x3e4877(0x10d)])_0x5e6cd0['push'](_0xdf8441[_0x3e4877(0x10d)]);if(_0xdf8441['cssUrl'])_0x5e6cd0[_0x3e4877(0xf1)](_0xdf8441[_0x3e4877(0x125)]);const _0x18c6d8=validateParams(_0xdf8441);if(_0x18c6d8[_0x3e4877(0x105)]>0x0){const _0x4179f1=_0x18c6d8['map'](_0xc4b907=>'--params.'+_0xc4b907[_0x3e4877(0x123)]+':\x20'+_0xc4b907[_0x3e4877(0xf6)])[_0x3e4877(0x12b)](';\x20');throw new Error(_0x3e4877(0x131)+_0x4179f1);}if(_0x5e6cd0[_0x3e4877(0x105)]===0x0)throw new Error(_0x3e4877(0x11b)+_0x3e4877(0x133));logger[_0x3e4877(0xfa)](process[_0x3e4877(0x11a)]()),logger[_0x3e4877(0x11d)]('menu-asset-update',_0x3e4877(0x124),{'appCode':_0x4cb311,'jsUrl':_0xdf8441[_0x3e4877(0x10d)],'cssUrl':_0xdf8441['cssUrl'],'mode':_0x12e983,'dryRun':_0x465fe3[_0x3e4877(0x121)]===!![]});if(_0xdf8441['jsUrl']){const _0x3c6d68=await isUrlReachable(_0xdf8441[_0x3e4877(0x10d)]);if(!_0x3c6d68)throw new Error(_0x3e4877(0x120)+_0xdf8441[_0x3e4877(0x10d)]);}if(_0xdf8441['cssUrl']){const _0x2e29f7=await isUrlReachable(_0xdf8441[_0x3e4877(0x125)]);if(!_0x2e29f7)throw new Error(_0x3e4877(0x115)+_0xdf8441[_0x3e4877(0x125)]);}const _0x121a51=await getOnlineMenuList(_0x4cb311,_0x2f9ed7),_0x1a89a3=_0x121a51[_0x3e4877(0xf4)](_0x9f1a2c=>_0x9f1a2c['resources'][_0x3e4877(0x105)]>0x0),_0x138f59=selectMenusForUpdate(_0x1a89a3,_0x465fe3[_0x3e4877(0x109)]);if(_0x138f59['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x465fe3['dryRun']===!![]};const _0x59c47e=_0x138f59[_0x3e4877(0xfc)](_0xe2dccc=>buildMenuUpdateDiff(_0xe2dccc,_0xdf8441,_0x12e983,_0x465fe3[_0x3e4877(0x102)]===!![],_0x465fe3[_0x3e4877(0xfe)]));if(_0x465fe3[_0x3e4877(0x121)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x59c47e};const _0x4f1488=await Promise[_0x3e4877(0x127)](_0x138f59['map']((_0x499434,_0x450890)=>updateMenuCdnUrl(_0x4cb311,_0x2f9ed7,{'id':_0x499434['id'],'label':_0x499434[_0x3e4877(0xf8)],'path':_0x499434[_0x3e4877(0x132)],'resources':_0x59c47e[_0x450890][_0x3e4877(0x12d)][_0x3e4877(0x12f)],'extend':_0x499434[_0x3e4877(0x11f)]??null,'loadScriptMode':_0x465fe3[_0x3e4877(0xfe)]}))),_0xe9faff=_0x4f1488[_0x3e4877(0xf4)](_0x2794de=>_0x2794de[_0x3e4877(0x12c)]==='fulfilled')[_0x3e4877(0xfc)](_0x4a3cd8=>_0x4a3cd8[_0x3e4877(0xff)]),_0x29d041=_0x4f1488['filter'](_0x4ae004=>_0x4ae004[_0x3e4877(0x12c)]==='rejected')[_0x3e4877(0x105)];return logger[_0x3e4877(0x11d)]('menu-asset-update','Menu\x20asset\x20update\x20completed',{'count':_0x138f59['length'],'resources':_0x5e6cd0}),{'updated':_0xe9faff[_0x3e4877(0x105)],'failed':_0x29d041,'skipped':![],'menus':_0xe9faff};}function validateSelection(_0x17f305){const _0x5cb8b3=a172_0x32f2;if(!_0x17f305)throw new Error(_0x5cb8b3(0xef));if(_0x17f305['all']&&(_0x17f305['menuIds']['length']>0x0||_0x17f305['paths']['length']>0x0))throw new Error(_0x5cb8b3(0xfd));if(!_0x17f305[_0x5cb8b3(0x11e)]&&_0x17f305[_0x5cb8b3(0x114)][_0x5cb8b3(0x105)]===0x0&&_0x17f305[_0x5cb8b3(0xf5)][_0x5cb8b3(0x105)]===0x0)throw new Error(_0x5cb8b3(0xef));}export function selectMenusForUpdate(_0x4a5e72,_0x56a08a){const _0x13e963=a172_0x32f2;validateSelection(_0x56a08a);if(_0x56a08a[_0x13e963(0x11e)])return _0x4a5e72;const _0x1a8fdc=new Set(_0x4a5e72[_0x13e963(0xfc)](_0x3bb10e=>_0x3bb10e['id'])),_0x129b98=new Set(_0x4a5e72[_0x13e963(0xfc)](_0x3d9748=>_0x3d9748[_0x13e963(0x132)])),_0x498a65=_0x56a08a[_0x13e963(0x114)]['filter'](_0x1c2220=>!_0x1a8fdc[_0x13e963(0x10b)](_0x1c2220)),_0x3a42e4=_0x56a08a['paths'][_0x13e963(0xf4)](_0x9c7af7=>!_0x129b98[_0x13e963(0x10b)](_0x9c7af7));if(_0x498a65['length']>0x0||_0x3a42e4['length']>0x0){const _0x6d1d52=[..._0x498a65[_0x13e963(0xfc)](_0x1453a4=>String(_0x1453a4)),..._0x3a42e4][_0x13e963(0x12b)](',\x20');throw new Error(_0x13e963(0x103)+_0x6d1d52);}const _0x96443f=new Set(_0x56a08a[_0x13e963(0x114)]),_0x40dd69=new Set(_0x56a08a['paths']);return _0x4a5e72[_0x13e963(0xf4)](_0x5b8b90=>_0x96443f[_0x13e963(0x10b)](_0x5b8b90['id'])||_0x40dd69[_0x13e963(0x10b)](_0x5b8b90['path']));}function normalizeMode(_0x23906d){const _0x55fd3c=a172_0x32f2;if(!_0x23906d)return _0x55fd3c(0xee);if(_0x23906d===_0x55fd3c(0x130)||_0x23906d===_0x55fd3c(0xee))return _0x23906d;throw new Error(_0x55fd3c(0x11c)+_0x23906d+_0x55fd3c(0x10f));}function buildMenuUpdateDiff(_0x2ddeae,_0x3cd493,_0x3c3a8b,_0x1cb1d6,_0xb7bc76){const _0x22e46d=a172_0x32f2,_0x2bc59a=[..._0x2ddeae[_0x22e46d(0x12f)]];_0x3c3a8b===_0x22e46d(0xee)&&assertUnambiguousPatchResources(_0x2ddeae,_0x2bc59a,_0x3cd493);const _0x71ba01=_0x3c3a8b==='patch'?patchResources(_0x2bc59a,_0x3cd493):replaceResources(_0x3cd493),_0x4065a4=[],_0x140a40=_0x2bc59a[_0x22e46d(0x116)](isJsResource),_0x4402ce=_0x71ba01[_0x22e46d(0x116)](isJsResource);if(_0x140a40&&!_0x4402ce){const _0x50387d=_0x22e46d(0x126)+_0x2ddeae['label']+'\x22\x20('+_0x2ddeae['path']+').\x20'+_0x22e46d(0x12e);if(!_0x1cb1d6)throw new Error(_0x50387d);_0x4065a4[_0x22e46d(0xf1)](_0x50387d);}const _0x4f1f40=_0x2bc59a[_0x22e46d(0x116)](isCssResource),_0x3efc45=_0x71ba01[_0x22e46d(0x116)](isCssResource);_0x4f1f40&&!_0x3efc45&&_0x4065a4[_0x22e46d(0xf1)]('menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22'+_0x2ddeae['label']+_0x22e46d(0x12a)+_0x2ddeae[_0x22e46d(0x132)]+').');const _0xf8df86=typeof _0x2ddeae[_0x22e46d(0x11f)]?.['loadScriptMode']===_0x22e46d(0x108)?_0x2ddeae[_0x22e46d(0x11f)][_0x22e46d(0xfe)]:null,_0x1573d9=_0xb7bc76?{'loadScriptMode':_0xf8df86}:{},_0x2c2011=_0xb7bc76?{'loadScriptMode':_0xb7bc76}:{};return{'id':_0x2ddeae['id'],'label':_0x2ddeae[_0x22e46d(0xf8)],'path':_0x2ddeae['path'],'mode':_0x3c3a8b,'before':{'resources':_0x2bc59a,..._0x1573d9},'after':{'resources':_0x71ba01,..._0x2c2011},'warnings':_0x4065a4};}function replaceResources(_0x1e0c42){const _0x58e283=a172_0x32f2;return[_0x1e0c42[_0x58e283(0x10d)],_0x1e0c42['cssUrl']][_0x58e283(0xf4)](_0xc2240c=>!!_0xc2240c);}function assertUnambiguousPatchResources(_0x1473d6,_0x530a9c,_0x3c9aba){const _0x854a69=a172_0x32f2,_0x3b4b80=_0x530a9c[_0x854a69(0xf4)](isJsResource)['length'];if(_0x3c9aba[_0x854a69(0x10d)]&&_0x3b4b80>0x1)throw new Error(_0x854a69(0x112)+_0x3b4b80+_0x854a69(0x119)+_0x1473d6[_0x854a69(0xf8)]+_0x854a69(0x12a)+_0x1473d6[_0x854a69(0x132)]+')\x20'+_0x854a69(0x110));const _0x1fcee1=_0x530a9c['filter'](isCssResource)[_0x854a69(0x105)];if(_0x3c9aba[_0x854a69(0x125)]&&_0x1fcee1>0x1)throw new Error(_0x854a69(0x112)+_0x1fcee1+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x1473d6[_0x854a69(0xf8)]+_0x854a69(0x12a)+_0x1473d6[_0x854a69(0x132)]+')\x20'+_0x854a69(0x101));}function patchResources(_0xdee22f,_0x17a66d){const _0x59cc06=a172_0x32f2;let _0x93cdc1=![],_0x235c38=![];const _0x4fd5c5=[];for(const _0x3b079a of _0xdee22f){if(isJsResource(_0x3b079a)){if(_0x17a66d[_0x59cc06(0x10d)]&&!_0x93cdc1)_0x4fd5c5[_0x59cc06(0xf1)](_0x17a66d[_0x59cc06(0x10d)]),_0x93cdc1=!![];else!_0x17a66d[_0x59cc06(0x10d)]&&_0x4fd5c5['push'](_0x3b079a);continue;}if(isCssResource(_0x3b079a)){if(_0x17a66d[_0x59cc06(0x125)]&&!_0x235c38)_0x4fd5c5['push'](_0x17a66d[_0x59cc06(0x125)]),_0x235c38=!![];else!_0x17a66d[_0x59cc06(0x125)]&&_0x4fd5c5[_0x59cc06(0xf1)](_0x3b079a);continue;}_0x4fd5c5[_0x59cc06(0xf1)](_0x3b079a);}return _0x17a66d[_0x59cc06(0x10d)]&&!_0x93cdc1&&_0x4fd5c5[_0x59cc06(0xfb)](_0x17a66d[_0x59cc06(0x10d)]),_0x17a66d['cssUrl']&&!_0x235c38&&_0x4fd5c5[_0x59cc06(0xf1)](_0x17a66d[_0x59cc06(0x125)]),_0x4fd5c5;}function isJsResource(_0x3571b0){const _0x4ea8f5=a172_0x32f2;return stripQuery(_0x3571b0)[_0x4ea8f5(0xf2)]()[_0x4ea8f5(0x129)](_0x4ea8f5(0xf0));}function a172_0x13e6(){const _0x235b22=['push','toLowerCase','4472048HWvbmk','filter','paths','message','1341bXKInq','label','3988700pnnMsh','setLogPath','unshift','map','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','loadScriptMode','value','22864435dTvqiF','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','force','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','10zbIQRw','length','trim','parse','string','selection','split','has','object','jsUrl','55504XJhXoC','.\x20Allowed\x20values:\x20replace,\x20patch','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','3289638CrgJun','menu\x20asset-update\x20cannot\x20patch\x20','7971Eeewys','menuIds','CSS\x20URL\x20is\x20unreachable:\x20','some','27717cuegDm','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','\x20existing\x20JS\x20resources\x20for\x20\x22','cwd','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','Invalid\x20--mode:\x20','info','all','extend','JS\x20URL\x20is\x20unreachable:\x20','dryRun','isArray','field','Start\x20non-interactive\x20menu\x20asset\x20update','cssUrl','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','allSettled','64xnLUJD','endsWith','\x22\x20(','join','status','after','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','resources','replace','Invalid\x20--params:\x20','path','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','1764yZxAdZ','patch','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','.js'];a172_0x13e6=function(){return _0x235b22;};return a172_0x13e6();}function isCssResource(_0x587c28){const _0x8d7f1d=a172_0x32f2;return stripQuery(_0x587c28)['toLowerCase']()[_0x8d7f1d(0x129)]('.css');}function stripQuery(_0x190798){const _0x15f41c=a172_0x32f2;return _0x190798[_0x15f41c(0x10a)]('?')[0x0]??_0x190798;}function parseUpdateParamsFlag(_0x8e9d94){const _0x4f4d1a=a172_0x32f2;if(!_0x8e9d94||typeof _0x8e9d94!==_0x4f4d1a(0x108))return{};try{const _0x55edc7=JSON[_0x4f4d1a(0x107)](_0x8e9d94);if(typeof _0x55edc7!==_0x4f4d1a(0x10c)||_0x55edc7===null||Array[_0x4f4d1a(0x122)](_0x55edc7))return{};return{'jsUrl':typeof _0x55edc7['jsUrl']===_0x4f4d1a(0x108)?_0x55edc7[_0x4f4d1a(0x10d)][_0x4f4d1a(0x106)]():undefined,'cssUrl':typeof _0x55edc7['cssUrl']===_0x4f4d1a(0x108)?_0x55edc7[_0x4f4d1a(0x125)]['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_0x157ea1=a175_0x4d5d;(function(_0x4a1416,_0x1b0676){const _0x40d62f=a175_0x4d5d,_0x88b115=_0x4a1416();while(!![]){try{const _0xc4b954=-parseInt(_0x40d62f(0x72))/0x1+parseInt(_0x40d62f(0x92))/0x2+-parseInt(_0x40d62f(0x90))/0x3*(-parseInt(_0x40d62f(0xb3))/0x4)+parseInt(_0x40d62f(0x6f))/0x5*(-parseInt(_0x40d62f(0x87))/0x6)+-parseInt(_0x40d62f(0xc6))/0x7+-parseInt(_0x40d62f(0x69))/0x8+parseInt(_0x40d62f(0x91))/0x9;if(_0xc4b954===_0x1b0676)break;else _0x88b115['push'](_0x88b115['shift']());}catch(_0x8c2655){_0x88b115['push'](_0x88b115['shift']());}}}(a175_0x35f0,0x6788b));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a175_0x4d5d(_0xee480c,_0x26fd3f){_0xee480c=_0xee480c-0x64;const _0x35f053=a175_0x35f0();let _0x4d5d23=_0x35f053[_0xee480c];return _0x4d5d23;}import{fetchMenuSnapshot}from'../../commands/menu/shared/facts.js';function a175_0x35f0(){const _0x44d032=['Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.','expect-visible','failed','Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.','number','The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.','childrenIds','5834320hWtnCJ','update-menu-visibility','childrenCount','Final\x20menu\x20visibility\x20readback\x20failed.','map','menu_permission_denied','55DnAYCM','\x20updated,\x20','values','810891lUeZPC','appCode','\x20menu(s);\x20skipped\x20','Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches','stringify','hash','flagMissing','paths','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','recovered','Updated\x20visibility\x20for\x20','Menu\x20path\x20selector\x20not\x20found:\x20','plan','menu','length','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.','sort','url','join','visibility-update','POST','27636FJVUrp','high-risk-write','resources','expectedCount','code','Response\x20was\x20lost\x20and\x20menu\x20','Menu\x20id\x20selector(s)\x20not\x20found:\x20','updated','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.','15FEoenZ','15123177cwFXOt','1375514rZBJPd','num','validation','boolean','Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state','menus','menu\x20list','menuIds','split','rawFlags','menu_selector_ambiguous','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.','isSafeInteger','Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20','before','str','trim','--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.','visible','update-recovery','Selected\x20','menu_verification_failed','path','get','\x20skipped,\x20','true','some','set','string','/smartapi/menu/update','Menu\x20','Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20','depth','371460MjWjtC','modelType','datasetCode','Response\x20was\x20lost\x20for\x20menu\x20','type','byId','warnings','Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility','Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','message','\x20unchanged\x20menu(s).','has','push','update\x20menu\x20visibility','One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','\x20changed\x20unexpectedly.','Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.','Would\x20update\x20visibility\x20for\x20','verification','5722591VwFDCx','\x20failed.','requestedVisible','\x20must\x20be\x20true\x20or\x20false.','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20','\x20menu(s),\x20expected\x20','datasetId','pageType','\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','filter','label','false','Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20','plannedActions','beforeById','pageId','resourcesValid','parentId','isArray','expected-count','menu-ids','Requested\x20menu\x20visibility'];a175_0x35f0=function(){return _0x44d032;};return a175_0x35f0();}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':a175_0x157ea1(0x86),'path':'/smartapi/menu/update'}];export const menuVisibilityUpdate={'service':a175_0x157ea1(0x7f),'command':a175_0x157ea1(0x85),'description':a175_0x157ea1(0x64),'risk':a175_0x157ea1(0x88),'structuredErrors':!![],'flags':[{'name':'menu-ids','type':a175_0x157ea1(0xae),'description':a175_0x157ea1(0x7a)},{'name':a175_0x157ea1(0x79),'type':a175_0x157ea1(0xae),'description':'Exact\x20comma-separated\x20menu\x20paths\x20to\x20update'},{'name':a175_0x157ea1(0xa4),'type':a175_0x157ea1(0x95),'required':!![],'description':a175_0x157ea1(0xdb)},{'name':'expect-visible','type':'boolean','description':a175_0x157ea1(0xba)},{'name':'expected-count','type':a175_0x157ea1(0x66),'description':a175_0x157ea1(0x75)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x10156a){parseInput(_0x10156a),requireExplicitYes(_0x10156a);},async 'dryRun'(_0x22b250){const _0x8cea8f=a175_0x157ea1,_0x14a10a=await buildPlan(_0x22b250,!![]),_0x50a99d=_0x14a10a['plan'][_0x8cea8f(0xd3)]?.[_0x8cea8f(0x80)]??0x0,_0x238083=_0x14a10a[_0x8cea8f(0x7e)]['targets'][_0x8cea8f(0x80)]-_0x50a99d;return menuDryRunResult(_0x14a10a[_0x8cea8f(0x7e)],{'method':_0x8cea8f(0x86),'url':_0x8cea8f(0xaf),'body':{'updates':_0x14a10a[_0x8cea8f(0x7e)][_0x8cea8f(0xd3)]?.[_0x8cea8f(0x6d)](_0x2f30a8=>_0x2f30a8['body'])??[]},'description':_0x8cea8f(0xc4)+_0x50a99d+'\x20menu(s);\x20skip\x20'+_0x238083+_0x8cea8f(0xbd)});},async 'execute'(_0x9569e8){const _0x42551f=a175_0x157ea1;requireExplicitYes(_0x9569e8);const _0x415b60=await buildPlan(_0x9569e8,![]);await recheckMutationSnapshot(_0x9569e8,_0x415b60['plan'],_0x42551f(0xc0));const _0x423651=[],_0x29a3d0=[],_0x1ef372=[];for(const _0x453989 of _0x415b60['plan']['targets']){if(_0x453989[_0x42551f(0xa0)][_0x42551f(0xa4)]===_0x415b60[_0x42551f(0x7e)]['requestedVisible']){_0x423651[_0x42551f(0xbf)]({'id':_0x453989['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0x9569e8[_0x42551f(0x73)],_0x9569e8['cookie'],{'id':_0x453989['id'],'visible':_0x415b60['plan']['requestedVisible']}),_0x423651[_0x42551f(0xbf)]({'id':_0x453989['id'],'updated':!![],'skipped':![]});}catch(_0x2abcbe){const _0x5b5b20=mapMenuApiError(_0x2abcbe,'update\x20visibility\x20for',_0x453989['id']);if(isMenuResponseLoss(_0x2abcbe)&&_0x5b5b20[_0x42551f(0x8b)]!==_0x42551f(0x6e)){_0x1ef372[_0x42551f(0xbf)](_0x453989['id']);continue;}_0x29a3d0[_0x42551f(0xbf)]({'id':_0x453989['id'],'stage':'update','code':_0x5b5b20['code'],'message':_0x5b5b20[_0x42551f(0xbc)]});}}let _0x40cf39;try{_0x40cf39=await fetchMenuSnapshot(_0x9569e8[_0x42551f(0x73)],_0x9569e8['cookie']);}catch(_0x33f97b){const _0x5b7aeb=describeMenuErrorCause(_0x33f97b,'verify\x20menu\x20visibility\x20update'),_0xc91008=_0x1ef372[_0x42551f(0x6d)](_0x20d17c=>({'id':_0x20d17c,'stage':_0x42551f(0xa5),'code':_0x42551f(0xa7),'message':_0x42551f(0xb6)+_0x20d17c+_0x42551f(0xce),'requestedStateConfirmed':![],'recovered':![]})),_0x17013f={'stage':_0x42551f(0xc5),'code':_0x42551f(0xa7),'message':_0x42551f(0x6c),'targetIds':_0x415b60[_0x42551f(0x7e)]['targets'][_0x42551f(0x6d)](_0x6c9eb5=>_0x6c9eb5['id']),'requestedStateConfirmed':![],..._0x5b7aeb};throw menuFailure(asVerificationError(_0x33f97b,_0x42551f(0x96)),_0x415b60[_0x42551f(0x7e)],{'stage':_0x42551f(0xc5),'succeeded':_0x423651,'failedRecords':[..._0x29a3d0,..._0xc91008,_0x17013f],'warnings':[_0x42551f(0x67)],'verification':{'status':_0x42551f(0xde),'recoveredCount':0x0,'lookupCommand':'rabetbase\x20menu\x20list\x20--format\x20compress'}});}const _0x1cf2f2=[];for(const _0xc14584 of _0x423651){const _0x2ce194=Number(_0xc14584['id']),_0xae8eeb=_0x415b60[_0x42551f(0xd4)]['get'](_0x2ce194),_0x516746=_0x40cf39['byId'][_0x42551f(0xa9)](_0x2ce194);try{verifyVisibilityUpdate(_0xae8eeb,_0x516746,_0x415b60[_0x42551f(0x7e)][_0x42551f(0xc8)]);}catch(_0x1e17a6){const _0x41946f=asVerificationError(_0x1e17a6,'Menu\x20'+_0x2ce194+'\x20visibility\x20update\x20could\x20not\x20be\x20verified');_0x1cf2f2['push']({'id':_0x2ce194,'stage':_0x42551f(0xc5),'code':_0x41946f[_0x42551f(0x8b)],'message':_0x41946f['message'],'requestedStateConfirmed':![]});}}for(const _0x181db5 of _0x1ef372){const _0x565baa=_0x415b60['beforeById'][_0x42551f(0xa9)](_0x181db5),_0x5025b4=_0x40cf39[_0x42551f(0xb8)]['get'](_0x181db5);try{verifyVisibilityUpdate(_0x565baa,_0x5025b4,_0x415b60[_0x42551f(0x7e)][_0x42551f(0xc8)]),_0x423651['push']({'id':_0x181db5,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0x1cc576){const _0x53bcdf=asVerificationError(_0x1cc576,_0x42551f(0x8c)+_0x181db5+'\x20visibility\x20could\x20not\x20be\x20verified\x20safely');_0x1cf2f2[_0x42551f(0xbf)]({'id':_0x181db5,'stage':_0x42551f(0xa5),'code':_0x53bcdf[_0x42551f(0x8b)],'message':_0x53bcdf['message'],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x1cf2f2[_0x42551f(0x80)]>0x0){const _0x250396=_0x1cf2f2[_0x42551f(0x6d)](_0x555d35=>Number(_0x555d35['id'])),_0x6159ad=_0x423651[_0x42551f(0xcf)](_0x11f56=>_0x11f56[_0x42551f(0x7b)]===!![])[_0x42551f(0x80)],_0x44f12c=menuError(_0x42551f(0xa7),_0x42551f(0x9f)+_0x250396[_0x42551f(0x84)](',\x20')+'.','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.');throw menuFailure(_0x44f12c,_0x415b60[_0x42551f(0x7e)],{'stage':'verification','succeeded':_0x423651,'failedRecords':[..._0x29a3d0,..._0x1cf2f2],'warnings':[_0x42551f(0xc1)],'verification':{'status':_0x42551f(0xde),..._0x250396['length']===0x1?{'targetId':_0x250396[0x0]}:{'targetIds':_0x250396},'recoveredCount':_0x6159ad,'lookupCommand':'rabetbase\x20menu\x20list\x20--format\x20compress'}});}const _0x197d79=_0x423651[_0x42551f(0xcf)](_0x4bd4b7=>_0x4bd4b7[_0x42551f(0x8e)]===!![])[_0x42551f(0x80)],_0xb71b03=_0x423651['length']-_0x197d79,_0xd970ca={..._0x415b60[_0x42551f(0x7e)],'succeeded':_0x423651,'failed':_0x29a3d0,'warnings':_0x29a3d0[_0x42551f(0x80)]>0x0?[..._0x415b60['plan'][_0x42551f(0xb9)],_0x42551f(0xbb)]:_0x415b60[_0x42551f(0x7e)]['warnings'],'verification':{'checkedBy':_0x42551f(0x98),'snapshotHash':_0x40cf39[_0x42551f(0x77)],'matchesRequestedState':_0x29a3d0[_0x42551f(0x80)]===0x0,'recoveredCount':_0x1ef372[_0x42551f(0x80)]}};return{'ok':_0x29a3d0[_0x42551f(0x80)]===0x0,'data':_0xd970ca,'message':_0x29a3d0[_0x42551f(0x80)]===0x0?_0x42551f(0x7c)+_0x197d79+_0x42551f(0x74)+_0xb71b03+_0x42551f(0xbd):'Menu\x20visibility\x20update\x20completed:\x20'+_0x197d79+_0x42551f(0x70)+_0xb71b03+_0x42551f(0xaa)+_0x29a3d0[_0x42551f(0x80)]+_0x42551f(0xc7)};}};function parseInput(_0x4984bc){const _0x51477a=a175_0x157ea1,_0x434982=parseMenuIds(_0x4984bc[_0x51477a(0xa1)](_0x51477a(0xda))),_0xfc7547=parseCsv(_0x4984bc[_0x51477a(0xa1)](_0x51477a(0x79)));if(_0x434982[_0x51477a(0x80)]===0x0&&_0xfc7547[_0x51477a(0x80)]===0x0)throw CliErrors['validation'](_0x51477a(0x65));const _0x521a74=parseBooleanFlag(_0x4984bc,'visible',!![]),_0xa0981f=parseBooleanFlag(_0x4984bc,_0x51477a(0xdd),![]);let _0x741750;if(hasFlag(_0x4984bc,_0x51477a(0xd9))){_0x741750=_0x4984bc[_0x51477a(0x93)](_0x51477a(0xd9));if(!Number[_0x51477a(0x9e)](_0x741750)||_0x741750<0x0)throw CliErrors[_0x51477a(0x94)](_0x51477a(0xa3));}return{'menuIds':_0x434982,'paths':_0xfc7547,'visible':_0x521a74,'expectVisible':_0xa0981f,'expectedCount':_0x741750};}async function buildPlan(_0x49f2c9,_0x17945f){const _0x23b4a9=a175_0x157ea1,_0x49d2c3=parseInput(_0x49f2c9),_0x515137=await fetchMutationSnapshot(_0x49f2c9,_0x23b4a9(0xc0)),_0x488809=selectTargets(_0x515137[_0x23b4a9(0x97)],_0x49d2c3[_0x23b4a9(0x99)],_0x49d2c3[_0x23b4a9(0x79)]);if(_0x49d2c3[_0x23b4a9(0x8a)]!==undefined&&_0x488809['length']!==_0x49d2c3[_0x23b4a9(0x8a)])throw menuError('menu_expected_count_mismatch',_0x23b4a9(0xa6)+_0x488809[_0x23b4a9(0x80)]+_0x23b4a9(0xcb)+_0x49d2c3['expectedCount']+'.',_0x23b4a9(0x8f));if(_0x49d2c3['expectVisible']!==undefined){const _0xada910=_0x488809[_0x23b4a9(0xcf)](_0x197518=>_0x197518[_0x23b4a9(0xa4)]!==_0x49d2c3['expectVisible']);if(_0xada910[_0x23b4a9(0x80)]>0x0)throw menuError('menu_state_drift',_0x23b4a9(0xd2)+_0xada910[_0x23b4a9(0x6d)](_0x2eb2bf=>_0x2eb2bf['id'])['join'](',\x20')+'.',_0x23b4a9(0x81));}const _0x1722d4=_0x488809[_0x23b4a9(0x6d)](_0x189906=>({'id':_0x189906['id'],'label':_0x189906['label'],'path':_0x189906['path'],'before':{'visible':_0x189906[_0x23b4a9(0xa4)]},'after':{'visible':_0x49d2c3['visible']}})),_0x559997=_0x1722d4[_0x23b4a9(0xcf)](_0x3635b7=>_0x3635b7[_0x23b4a9(0xa0)][_0x23b4a9(0xa4)]!==_0x49d2c3[_0x23b4a9(0xa4)])[_0x23b4a9(0x6d)](_0x4d7c5f=>({'stage':_0x23b4a9(0x6a),'method':'POST','path':_0x23b4a9(0xaf),'body':{'appCode':_0x49f2c9['appCode'],'id':_0x4d7c5f['id'],'visible':_0x49d2c3[_0x23b4a9(0xa4)]}})),_0x2f6c51=mutationResult({'operation':_0x23b4a9(0x85),'selector':{'menuIds':_0x49d2c3[_0x23b4a9(0x99)],'paths':_0x49d2c3[_0x23b4a9(0x79)]},'before':{'menus':_0x488809[_0x23b4a9(0x6d)](_0x193787=>({'id':_0x193787['id'],'path':_0x193787['path'],'visible':_0x193787[_0x23b4a9(0xa4)]}))},'after':{'menus':_0x488809['map'](_0xdeddea=>({'id':_0xdeddea['id'],'path':_0xdeddea[_0x23b4a9(0xa8)],'visible':_0x49d2c3[_0x23b4a9(0xa4)]}))},'dryRun':_0x17945f,'backend':[...BACKEND],'plannedActions':_0x559997,'snapshotHash':_0x515137[_0x23b4a9(0x77)],'warnings':_0x559997['length']===0x0?[_0x23b4a9(0xc3)]:[]});return{'plan':{..._0x2f6c51,'requestedVisible':_0x49d2c3[_0x23b4a9(0xa4)],'targets':_0x1722d4},'beforeById':new Map(_0x488809['map'](_0x1e4ad9=>[_0x1e4ad9['id'],_0x1e4ad9]))};}function selectTargets(_0x4403b2,_0xa3c37a,_0x38d961){const _0x4c1125=a175_0x157ea1,_0x42c8f1=new Map(_0x4403b2[_0x4c1125(0x6d)](_0x14c2d7=>[_0x14c2d7['id'],_0x14c2d7])),_0x201627=new Map(),_0x6f0071=_0xa3c37a[_0x4c1125(0xcf)](_0x37b25e=>!_0x42c8f1[_0x4c1125(0xbe)](_0x37b25e));if(_0x6f0071['length']>0x0)throw menuError('menu_selector_not_found',_0x4c1125(0x8d)+_0x6f0071[_0x4c1125(0x84)](',\x20')+'.',_0x4c1125(0x9d));for(const _0xac001f of _0xa3c37a){_0x201627[_0x4c1125(0xad)](_0xac001f,_0x42c8f1[_0x4c1125(0xa9)](_0xac001f));}for(const _0x1f327c of _0x38d961){const _0x3f7752=_0x4403b2[_0x4c1125(0xcf)](_0x13dc85=>_0x13dc85['path']===_0x1f327c);if(_0x3f7752[_0x4c1125(0x80)]===0x0)throw menuError('menu_selector_not_found',_0x4c1125(0x7d)+JSON[_0x4c1125(0x76)](_0x1f327c)+'.',_0x4c1125(0xdc));if(_0x3f7752[_0x4c1125(0x80)]>0x1)throw menuError(_0x4c1125(0x9c),_0x4c1125(0xb1)+JSON[_0x4c1125(0x76)](_0x1f327c)+'.',_0x4c1125(0xca)+_0x3f7752['map'](_0x1cf48d=>_0x1cf48d['id'])[_0x4c1125(0x84)](',\x20')+'.');const _0x5c3c88=_0x3f7752[0x0];_0x201627[_0x4c1125(0xad)](_0x5c3c88['id'],_0x5c3c88);}return[..._0x201627[_0x4c1125(0x71)]()];}function parseMenuIds(_0x3904bc){const _0xe537f9=a175_0x157ea1,_0x26ffb9=parseCsv(_0x3904bc),_0x3665dc=_0x26ffb9[_0xe537f9(0x6d)](Number);if(_0x3665dc[_0xe537f9(0xac)](_0x1d6f98=>!Number[_0xe537f9(0x9e)](_0x1d6f98)||_0x1d6f98<=0x0))throw CliErrors['validation']('--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.');return[...new Set(_0x3665dc)];}function parseCsv(_0x4e3113){const _0x31c5b5=a175_0x157ea1;return[...new Set(_0x4e3113[_0x31c5b5(0x9a)](',')['map'](_0x49890f=>_0x49890f[_0x31c5b5(0xa2)]())[_0x31c5b5(0xcf)](Boolean))];}function parseBooleanFlag(_0x530496,_0x45b01c,_0xf6c496){const _0x4f90b1=a175_0x157ea1;if(!hasFlag(_0x530496,_0x45b01c)){if(_0xf6c496)throw CliErrors[_0x4f90b1(0x78)](_0x45b01c);return undefined;}const _0x442407=_0x530496[_0x4f90b1(0x9b)][_0x45b01c];if(_0x442407===!![]||_0x442407===![])return _0x442407;if(_0x442407===_0x4f90b1(0xab))return!![];if(_0x442407===_0x4f90b1(0xd1))return![];throw CliErrors[_0x4f90b1(0x94)]('--'+_0x45b01c+_0x4f90b1(0xc9));}function verifyVisibilityUpdate(_0x3b35ba,_0x2508cd,_0x409582){const _0x152729=a175_0x157ea1;assertVerified(!!_0x2508cd,_0x152729(0xb0)+_0x3b35ba['id']+'\x20was\x20not\x20found\x20during\x20visibility\x20verification.'),assertVerified(_0x2508cd[_0x152729(0xa4)]===_0x409582,_0x152729(0xb0)+_0x3b35ba['id']+'\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.');const _0x343268=[['id',_0x2508cd['id'],_0x3b35ba['id']],['parentId',_0x2508cd[_0x152729(0xd7)],_0x3b35ba[_0x152729(0xd7)]],['depth',_0x2508cd['depth'],_0x3b35ba[_0x152729(0xb2)]],['label',_0x2508cd['label'],_0x3b35ba[_0x152729(0xd0)]],[_0x152729(0xa8),_0x2508cd[_0x152729(0xa8)],_0x3b35ba['path']],[_0x152729(0x83),_0x2508cd['url'],_0x3b35ba[_0x152729(0x83)]],[_0x152729(0xb7),_0x2508cd[_0x152729(0xb7)],_0x3b35ba[_0x152729(0xb7)]],[_0x152729(0x82),_0x2508cd[_0x152729(0x82)],_0x3b35ba[_0x152729(0x82)]],['resources',_0x2508cd[_0x152729(0x89)],_0x3b35ba[_0x152729(0x89)]],[_0x152729(0xd6),_0x2508cd[_0x152729(0xd6)],_0x3b35ba[_0x152729(0xd6)]],['childrenIds',_0x2508cd[_0x152729(0x68)],_0x3b35ba['childrenIds']],['childrenCount',_0x2508cd[_0x152729(0x6b)],_0x3b35ba['childrenCount']],[_0x152729(0xd5),_0x2508cd[_0x152729(0xd5)],_0x3b35ba[_0x152729(0xd5)]],[_0x152729(0xcd),_0x2508cd[_0x152729(0xcd)],_0x3b35ba[_0x152729(0xcd)]],[_0x152729(0xb4),_0x2508cd[_0x152729(0xb4)],_0x3b35ba['modelType']],[_0x152729(0xcc),_0x2508cd[_0x152729(0xcc)],_0x3b35ba[_0x152729(0xcc)]],[_0x152729(0xb5),_0x2508cd[_0x152729(0xb5)],_0x3b35ba[_0x152729(0xb5)]]];for(const [_0x437a26,_0x532a33,_0x43d477]of _0x343268){assertVerified(sameValue(_0x532a33,_0x43d477),'Menu\x20'+_0x3b35ba['id']+'\x20'+_0x437a26+_0x152729(0xc2));}}function sameValue(_0x5be81b,_0x2e6d00){const _0x22660f=a175_0x157ea1;if(Array[_0x22660f(0xd8)](_0x5be81b)||Array['isArray'](_0x2e6d00))return JSON[_0x22660f(0x76)](_0x5be81b)===JSON[_0x22660f(0x76)](_0x2e6d00);return _0x5be81b===_0x2e6d00;}
|
|
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']};}};
|