@lovrabet/rabetbase-cli 2.5.10 → 2.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/context.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/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.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/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a183_0x2c5dcd=a183_0x2d4c;(function(_0x3cb3aa,_0xe4a1eb){const _0x38a654=a183_0x2d4c,_0x3ff0d8=_0x3cb3aa();while(!![]){try{const _0x4d4a54=-parseInt(_0x38a654(0x98))/0x1+-parseInt(_0x38a654(0x8e))/0x2*(parseInt(_0x38a654(0x94))/0x3)+parseInt(_0x38a654(0x7b))/0x4*(-parseInt(_0x38a654(0x84))/0x5)+parseInt(_0x38a654(0x73))/0x6+-parseInt(_0x38a654(0x9a))/0x7*(-parseInt(_0x38a654(0x7e))/0x8)+parseInt(_0x38a654(0x81))/0x9*(parseInt(_0x38a654(0x99))/0xa)+parseInt(_0x38a654(0x83))/0xb;if(_0x4d4a54===_0xe4a1eb)break;else _0x3ff0d8['push'](_0x3ff0d8['shift']());}catch(_0x3bb48e){_0x3ff0d8['push'](_0x3ff0d8['shift']());}}}(a183_0x382a,0x48b17));function a183_0x2d4c(_0x2e52ea,_0xfa3cd2){_0x2e52ea=_0x2e52ea-0x72;const _0x382a8f=a183_0x382a();let _0x2d4cbb=_0x382a8f[_0x2e52ea];return _0x2d4cbb;}import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{CliErrors}from'../../../errors.js';function a183_0x382a(){const _0x207918=['assets','length','Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app','No\x20shared\x20resources\x20configured\x20for\x20','message','some','app','956vwBUDw','string','resources','1997272Pkydfh','map','isArray','289161odlJeF','\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.','1091409atchLn','605JsCIeP','sharedResources','appCode','object','path','filter','appName','fallbackDiffers','app.extend.assets\x20must\x20be\x20an\x20array.','extend','2VMIoaY','str','app-name','\x20contains\x20invalid\x20JSON.','Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','\x20must\x20be\x20an\x20array\x20of\x20URLs.','1159455zxRHeo','\x20resources','stringify','validation','361601HvUXYD','10iuoNyK','14uhwFVA','loadScriptMode','\x20must\x20be\x20a\x20JSON\x20object.','parse','menu','2664540FtoiAa'];a183_0x382a=function(){return _0x207918;};return a183_0x382a();}function objectValue(_0x28fb66,_0x47c8a5){const _0x8b5eb=a183_0x2d4c,_0x582b61=typeof _0x28fb66===_0x8b5eb(0x7c)?parseJson(_0x28fb66,_0x47c8a5):_0x28fb66;if(!_0x582b61||typeof _0x582b61!==_0x8b5eb(0x87)||Array[_0x8b5eb(0x80)](_0x582b61))throw CliErrors[_0x8b5eb(0x97)](_0x47c8a5+_0x8b5eb(0x9c));return _0x582b61;}function parseJson(_0x10f98a,_0x4cffc0){const _0x2fe1ea=a183_0x2d4c;try{return JSON[_0x2fe1ea(0x9d)](_0x10f98a);}catch{throw CliErrors[_0x2fe1ea(0x97)](_0x4cffc0+_0x2fe1ea(0x91));}}function resourceList(_0x4273e2,_0xf8bc9c){const _0x73ab97=a183_0x2d4c;if(typeof _0x4273e2!==_0x73ab97(0x7c))throw CliErrors[_0x73ab97(0x97)](_0xf8bc9c+_0x73ab97(0x82));const _0x363712=parseJson(_0x4273e2,_0xf8bc9c);if(!Array[_0x73ab97(0x80)](_0x363712)||_0x363712[_0x73ab97(0x79)](_0x2591c5=>typeof _0x2591c5!=='string'))throw CliErrors[_0x73ab97(0x97)](_0xf8bc9c+_0x73ab97(0x93));return _0x363712;}export function buildSubappAssetsStatus(_0x594317,_0x501db9,_0xd6b1f5){const _0x1bf198=a183_0x2d4c,_0x47843f=_0x594317[_0x1bf198(0x8d)]==null?{}:objectValue(_0x594317[_0x1bf198(0x8d)],'app.extend'),_0x3cbcc3=_0x47843f['assets']==null?[]:typeof _0x47843f['assets']===_0x1bf198(0x7c)?parseJson(_0x47843f[_0x1bf198(0x74)],'app.extend.assets'):_0x47843f['assets'];if(!Array['isArray'](_0x3cbcc3))throw CliErrors[_0x1bf198(0x97)](_0x1bf198(0x8c));const _0x51ed66=_0x3cbcc3[_0x1bf198(0x7f)]((_0x472129,_0x30114e)=>objectValue(_0x472129,'app.extend.assets['+_0x30114e+']')),_0x59986d=_0x51ed66[_0x1bf198(0x89)](_0x3fb3c9=>_0x3fb3c9[_0x1bf198(0x8a)]===_0xd6b1f5);if(_0x59986d['length']>0x1)throw CliErrors[_0x1bf198(0x97)]('Duplicate\x20subapp\x20records\x20for\x20'+_0xd6b1f5+'.');const _0x59bdbf=_0x59986d[0x0],_0x1c8f56=_0x59bdbf?.['resources']==null?[]:resourceList(_0x59bdbf[_0x1bf198(0x7d)],'subapp.resources'),_0x5c202a=_0x501db9[_0x1bf198(0x89)](_0x468bed=>_0x468bed['extend']?.[_0x1bf198(0x8a)]===_0xd6b1f5),_0x23d301=_0x5c202a[_0x1bf198(0x7f)](_0x2219e3=>{const _0x3b34df=_0x1bf198;let _0xa44d59=null,_0xe79158=null;try{_0xa44d59=_0x2219e3[_0x3b34df(0x8d)]?.[_0x3b34df(0x7d)]==null?_0x2219e3[_0x3b34df(0x7d)]:resourceList(_0x2219e3[_0x3b34df(0x8d)][_0x3b34df(0x7d)],'menu\x20'+_0x2219e3['id']+_0x3b34df(0x95));}catch(_0x2aeae1){_0xe79158=_0x2aeae1 instanceof Error?_0x2aeae1[_0x3b34df(0x78)]:String(_0x2aeae1);}const _0x11aa43=_0x1c8f56[_0x3b34df(0x75)]>0x0?'app':_0x3b34df(0x72),_0xca079=_0x11aa43===_0x3b34df(0x7a)?_0x1c8f56:_0xa44d59;return{'id':_0x2219e3['id'],'path':_0x2219e3[_0x3b34df(0x88)],'preferredSourceIfSupported':_0x11aa43,'preferredResourcesIfSupported':_0xca079,'menuFallbackResources':_0xa44d59,'menuFallbackError':_0xe79158,'fallbackDiffers':_0xa44d59===null?null:_0x11aa43===_0x3b34df(0x7a)&&_0xa44d59[_0x3b34df(0x75)]>0x0&&JSON[_0x3b34df(0x96)](_0xa44d59)!==JSON['stringify'](_0xca079)};});return{'appName':_0xd6b1f5,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x59bdbf),'sharedResources':_0x1c8f56,'loadScriptMode':_0x59bdbf?.[_0x1bf198(0x9b)]??null,'basename':_0x59bdbf?.['basename']??null,'boundMenus':_0x23d301[_0x1bf198(0x75)],'staleMenuFallbacks':_0x23d301[_0x1bf198(0x89)](_0x50e110=>_0x50e110[_0x1bf198(0x8b)])['length'],'menus':_0x23d301};}export async function assertSharedResourcesConfigured(_0x2286c2,_0x2429c4,_0x8e1e12){const _0x574ed8=a183_0x2d4c,_0x4a85d0=await getSmartAppRecord(_0x2286c2,_0x2429c4),_0x2e8f49=buildSubappAssetsStatus(_0x4a85d0,[],_0x8e1e12);if(!_0x2e8f49['sharedConfigured']||_0x2e8f49[_0x574ed8(0x85)][_0x574ed8(0x75)]===0x0)throw CliErrors[_0x574ed8(0x97)](_0x574ed8(0x77)+_0x8e1e12+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':a183_0x2c5dcd(0x76)},{'name':'app-name','type':a183_0x2c5dcd(0x7c),'required':!![],'description':a183_0x2c5dcd(0x92)}];export function getSubappSelector(_0x257321){const _0x4d59e6=a183_0x2c5dcd,_0xedfcf1=_0x257321[_0x4d59e6(0x86)],_0x507364=_0x257321[_0x4d59e6(0x8f)](_0x4d59e6(0x90))['trim']();if(!_0x507364)throw CliErrors[_0x4d59e6(0x97)]('--app-name\x20is\x20required.');return{'appCode':_0xedfcf1,'appName':_0x507364};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a184_0x42aa11=a184_0x49a0;(function(_0x61febc,_0x30b280){const _0x55d3a1=a184_0x49a0,_0x44a448=_0x61febc();while(!![]){try{const _0x3e8239=parseInt(_0x55d3a1(0x17a))/0x1*(-parseInt(_0x55d3a1(0x199))/0x2)+parseInt(_0x55d3a1(0x19f))/0x3+-parseInt(_0x55d3a1(0x17b))/0x4+-parseInt(_0x55d3a1(0x173))/0x5+-parseInt(_0x55d3a1(0x181))/0x6+-parseInt(_0x55d3a1(0x1a6))/0x7+parseInt(_0x55d3a1(0x178))/0x8;if(_0x3e8239===_0x30b280)break;else _0x44a448['push'](_0x44a448['shift']());}catch(_0x1b8206){_0x44a448['push'](_0x44a448['shift']());}}}(a184_0x43b6,0xc0a45));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([a184_0x42aa11(0x17c),'cssUrl',a184_0x42aa11(0x185),a184_0x42aa11(0x19b),a184_0x42aa11(0x1a0)]);export function resolvePage(_0x260ff7,_0x47cc54,_0x3223ff){const _0x2fe5dc=a184_0x42aa11;let _0x5ab9fe=_0x47cc54[_0x2fe5dc(0x1a0)]??_0x260ff7[_0x2fe5dc(0x1a0)];if(_0x5ab9fe===undefined&&_0x260ff7['group']){const _0x52e256=_0x3223ff['filter'](_0x3faa21=>_0x3faa21[_0x2fe5dc(0x174)]==='folder'&&_0x3faa21[_0x2fe5dc(0x182)]===_0x260ff7[_0x2fe5dc(0x19e)]);if(_0x52e256[_0x2fe5dc(0x18c)]!==0x1)throw new Error(_0x2fe5dc(0x1ac)+_0x260ff7[_0x2fe5dc(0x19e)]+_0x2fe5dc(0x197)+_0x260ff7[_0x2fe5dc(0x1ab)]+_0x2fe5dc(0x177)+_0x52e256['length']);_0x5ab9fe=_0x52e256[0x0]['id'];}if(_0x5ab9fe!==undefined&&_0x5ab9fe!==0x0&&_0x3223ff[_0x2fe5dc(0x198)](_0x164cae=>_0x164cae['id']===_0x5ab9fe&&_0x164cae['type']===_0x2fe5dc(0x196))[_0x2fe5dc(0x18c)]!==0x1)throw new Error(_0x2fe5dc(0x1a9)+_0x5ab9fe+_0x2fe5dc(0x1a1));return{..._0x260ff7,..._0x5ab9fe===undefined?{}:{'parentId':_0x5ab9fe},..._0x47cc54['visible']===undefined?{}:{'visible':_0x47cc54[_0x2fe5dc(0x19b)]}};}function a184_0x43b6(){const _0x13baa7=['8421324OgMPmo','label','pages','hasOwn','appName','parse','import','JS\x20URL\x20is\x20unreachable:\x20','number','menu-sync','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','length','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','get','field','trim','Start\x20non-interactive\x20menu\x20sync','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','Invalid\x20--params\x20JSON.','cssUrl','folder','\x22\x20for\x20','filter','16OxgfDF','dryRun','visible','No\x20local\x20pages\x20matched\x20paths:\x20','isArray','group','3809805qJfRrV','parentId','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','push','has','map','CSS\x20URL\x20is\x20unreachable:\x20','805049xPIkiv','join','procode','Parent\x20','Invalid\x20--params:\x20','path','Expected\x20one\x20folder\x20named\x20\x22','string','2914700PjfXLL','type','setLogPath','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.',';\x20found\x20','34792864iQzWqc','info','170873qUWSWM','5445988SLpWdw','jsUrl','cwd','keys','boolean','order'];a184_0x43b6=function(){return _0x13baa7;};return a184_0x43b6();}function a184_0x49a0(_0x2d3ecf,_0x70ef60){_0x2d3ecf=_0x2d3ecf-0x172;const _0x43b662=a184_0x43b6();let _0x49a0b5=_0x43b662[_0x2d3ecf];return _0x49a0b5;}function validateParams(_0x1f89da){const _0x554d=a184_0x42aa11,_0x20c5af=[];return _0x1f89da[_0x554d(0x17c)]&&!isValidJsHttpsUrl(_0x1f89da[_0x554d(0x17c)])&&_0x20c5af[_0x554d(0x1a2)]({'field':_0x554d(0x17c),'message':_0x554d(0x193)}),_0x1f89da['cssUrl']&&!isValidCssHttpsUrl(_0x1f89da['cssUrl'])&&_0x20c5af[_0x554d(0x1a2)]({'field':'cssUrl','message':_0x554d(0x18b)}),_0x20c5af;}export async function runMenuSyncCore(_0x29746f,_0x49abdb,_0x35b993=[],_0x5b85c5,_0x21d81a={}){const _0x53624b=a184_0x42aa11,_0x327f07=parseMenuSyncParams(_0x5b85c5),_0x50f2bf=[...new Set(_0x35b993[_0x53624b(0x1a4)](_0x1029f6=>_0x1029f6[_0x53624b(0x191)]())[_0x53624b(0x198)](Boolean)[_0x53624b(0x1a4)](menuPathKey))],_0x3e9af5=_0x327f07['jsUrl'],_0x18d089=_0x327f07['cssUrl'],_0x560216=[];if(_0x3e9af5)_0x560216['push'](_0x3e9af5);if(_0x18d089)_0x560216[_0x53624b(0x1a2)](_0x18d089);const _0x193125=validateParams(_0x327f07);if(_0x193125[_0x53624b(0x18c)]>0x0){const _0x53fd59=_0x193125[_0x53624b(0x1a4)](_0x1b7fdd=>'--params.'+_0x1b7fdd[_0x53624b(0x190)]+':\x20'+_0x1b7fdd['message'])[_0x53624b(0x1a7)](';\x20');throw new Error(_0x53624b(0x1aa)+_0x53fd59);}logger[_0x53624b(0x175)](process[_0x53624b(0x17d)]()),logger[_0x53624b(0x179)](_0x53624b(0x18a),_0x53624b(0x192),{'appCode':_0x29746f,'selectedCount':_0x50f2bf[_0x53624b(0x18c)],'jsUrl':_0x3e9af5,'cssUrl':_0x18d089});if(_0x3e9af5){const _0x2e6fc6=await isUrlReachable(_0x3e9af5);if(!_0x2e6fc6)throw new Error(_0x53624b(0x188)+_0x3e9af5);}if(_0x18d089){const _0x2f994b=await isUrlReachable(_0x18d089);if(!_0x2f994b)throw new Error(_0x53624b(0x1a5)+_0x18d089);}const _0x5730dc=getLocalPages();if(_0x5730dc[_0x53624b(0x18c)]===0x0){if(_0x50f2bf[_0x53624b(0x18c)]>0x0)throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x50f2bf[_0x53624b(0x1a7)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x21d81a[_0x53624b(0x19a)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x16781a=await getOnlineMenuList(_0x29746f,_0x49abdb),_0xcbc6cc=new Set(_0x16781a['map'](_0x12ea6a=>menuPathKey(_0x12ea6a['path'])));let _0x1add2f;if(_0x50f2bf[_0x53624b(0x18c)]>0x0){const _0x5f4384=new Map(_0x5730dc[_0x53624b(0x1a4)](_0x17fbb5=>[menuPathKey(_0x17fbb5[_0x53624b(0x1ab)]),_0x17fbb5])),_0x1c5dd2=_0x50f2bf['filter'](_0x25f0d6=>!_0x5f4384[_0x53624b(0x1a3)](_0x25f0d6));if(_0x1c5dd2[_0x53624b(0x18c)]>0x0){const _0x251e85=_0x5730dc[_0x53624b(0x1a4)](_0x25e6bb=>_0x25e6bb[_0x53624b(0x1ab)])['join'](',\x20');throw new Error(_0x53624b(0x19c)+_0x1c5dd2[_0x53624b(0x1a7)](',\x20')+'\x0a\x20\x20Available\x20local\x20paths:\x20'+_0x251e85);}const _0x23053f=_0x50f2bf[_0x53624b(0x198)](_0x48d43c=>_0xcbc6cc['has'](_0x48d43c));if(_0x23053f['length']>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0x23053f[_0x53624b(0x1a7)](',\x20'));_0x1add2f=_0x50f2bf[_0x53624b(0x1a4)](_0xd1d900=>_0x5f4384[_0x53624b(0x18f)](_0xd1d900));}else _0x1add2f=_0x5730dc['filter'](_0x55de02=>!_0xcbc6cc['has'](menuPathKey(_0x55de02[_0x53624b(0x1ab)])));if(_0x1add2f[_0x53624b(0x18c)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x21d81a[_0x53624b(0x19a)]===!![],'targetPages':[],'plannedMenus':[]};_0x1add2f=_0x1add2f[_0x53624b(0x1a4)](_0x7de634=>resolvePage(_0x7de634,_0x327f07,_0x16781a));_0x327f07[_0x53624b(0x185)]&&_0x560216[_0x53624b(0x18c)]===0x0&&await assertSharedResourcesConfigured(_0x29746f,_0x49abdb,_0x327f07['appName']);const _0x377099=_0x1add2f[_0x53624b(0x1a4)](_0x139232=>({'type':_0x53624b(0x1a8),'path':_0x139232[_0x53624b(0x1ab)],'label':_0x139232[_0x53624b(0x182)],'loadScriptMode':_0x53624b(0x187),'resources':[..._0x560216],..._0x139232[_0x53624b(0x19b)]===undefined?{}:{'visible':_0x139232['visible']},..._0x139232[_0x53624b(0x1a0)]===undefined?{}:{'parentId':_0x139232[_0x53624b(0x1a0)]},..._0x139232[_0x53624b(0x180)]===undefined?{}:{'sort':_0x139232[_0x53624b(0x180)]},..._0x327f07['appName']===undefined?{}:{'appName':_0x327f07['appName']}}));if(_0x21d81a['dryRun'])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x1add2f,'plannedMenus':_0x377099};const _0x2edfb4=_0x327f07[_0x53624b(0x185)]?await createMenus(_0x29746f,_0x49abdb,_0x1add2f,_0x560216[_0x53624b(0x18c)]>0x0?_0x560216:undefined,{'appName':_0x327f07[_0x53624b(0x185)]}):await createMenus(_0x29746f,_0x49abdb,_0x1add2f,_0x560216[_0x53624b(0x18c)]>0x0?_0x560216:undefined);return logger[_0x53624b(0x179)](_0x53624b(0x18a),'Menu\x20sync\x20completed',{'count':_0x1add2f['length'],'resources':_0x560216}),{'created':_0x2edfb4[_0x53624b(0x18c)],'skipped':![],'dryRun':![],'targetPages':_0x1add2f,'plannedMenus':_0x377099,'menus':_0x2edfb4};}export function parseMenuSyncParams(_0x3a99c3){const _0x16a7b0=a184_0x42aa11;if(!_0x3a99c3||typeof _0x3a99c3!==_0x16a7b0(0x172))return{};let _0x74835d;try{_0x74835d=JSON[_0x16a7b0(0x186)](_0x3a99c3);}catch{throw new Error(_0x16a7b0(0x194));}if(typeof _0x74835d!=='object'||_0x74835d===null||Array[_0x16a7b0(0x19d)](_0x74835d))throw new Error(_0x16a7b0(0x18d));const _0x488897=_0x74835d;if(Object[_0x16a7b0(0x184)](_0x488897,_0x16a7b0(0x183)))throw new Error(_0x16a7b0(0x176));const _0x3a82dc=Object[_0x16a7b0(0x17e)](_0x488897)[_0x16a7b0(0x198)](_0x1a783a=>!MENU_SYNC_PARAM_KEYS[_0x16a7b0(0x1a3)](_0x1a783a));if(_0x3a82dc[_0x16a7b0(0x18c)]>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x3a82dc['join'](',\x20')+'.');for(const _0x354e7f of['jsUrl',_0x16a7b0(0x195),_0x16a7b0(0x185)]){const _0x3d3f13=_0x488897[_0x354e7f];if(_0x3d3f13!==undefined&&(typeof _0x3d3f13!=='string'||_0x3d3f13['trim']()===''))throw new Error('Invalid\x20--params.'+_0x354e7f+':\x20expected\x20a\x20non-empty\x20string.');}if(_0x488897[_0x16a7b0(0x19b)]!==undefined&&typeof _0x488897[_0x16a7b0(0x19b)]!==_0x16a7b0(0x17f))throw new Error('Invalid\x20--params.visible:\x20expected\x20a\x20boolean.');if(_0x488897[_0x16a7b0(0x1a0)]!==undefined&&(!Number['isInteger'](_0x488897[_0x16a7b0(0x1a0)])||_0x488897['parentId']<0x0))throw new Error(_0x16a7b0(0x18e));return{'jsUrl':typeof _0x488897['jsUrl']===_0x16a7b0(0x172)?_0x488897[_0x16a7b0(0x17c)][_0x16a7b0(0x191)]():undefined,'cssUrl':typeof _0x488897[_0x16a7b0(0x195)]===_0x16a7b0(0x172)?_0x488897['cssUrl'][_0x16a7b0(0x191)]():undefined,'appName':typeof _0x488897[_0x16a7b0(0x185)]===_0x16a7b0(0x172)?_0x488897['appName'][_0x16a7b0(0x191)]():undefined,'visible':typeof _0x488897['visible']===_0x16a7b0(0x17f)?_0x488897[_0x16a7b0(0x19b)]:undefined,'parentId':typeof _0x488897[_0x16a7b0(0x1a0)]===_0x16a7b0(0x189)?_0x488897['parentId']:undefined};}
|
|
1
|
+
const a184_0x3190dc=a184_0x54fc;(function(_0x108b64,_0x1fe0c1){const _0x3661d4=a184_0x54fc,_0x22af4e=_0x108b64();while(!![]){try{const _0x4ac731=parseInt(_0x3661d4(0x71))/0x1+parseInt(_0x3661d4(0x6a))/0x2+-parseInt(_0x3661d4(0x77))/0x3*(-parseInt(_0x3661d4(0xa6))/0x4)+parseInt(_0x3661d4(0x8a))/0x5*(parseInt(_0x3661d4(0x81))/0x6)+parseInt(_0x3661d4(0x78))/0x7*(parseInt(_0x3661d4(0x9a))/0x8)+parseInt(_0x3661d4(0x76))/0x9+-parseInt(_0x3661d4(0x91))/0xa;if(_0x4ac731===_0x1fe0c1)break;else _0x22af4e['push'](_0x22af4e['shift']());}catch(_0x3a1297){_0x22af4e['push'](_0x22af4e['shift']());}}}(a184_0x50e0,0xf2283));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([a184_0x3190dc(0x88),'cssUrl',a184_0x3190dc(0x8e),a184_0x3190dc(0x7b),a184_0x3190dc(0x70)]);function a184_0x50e0(){const _0x22c696=['cwd','Invalid\x20--params.','trim','Invalid\x20--params\x20JSON.','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','push','number','JS\x20URL\x20is\x20unreachable:\x20','1775768CqSWgf','label','get','No\x20local\x20pages\x20matched\x20paths:\x20','has','hasOwn','info','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','message','Start\x20non-interactive\x20menu\x20sync','folder','boolean','195968OFjIhB','field','Invalid\x20--params:\x20',':\x20expected\x20a\x20non-empty\x20string.',';\x20found\x20','Invalid\x20--params\x20fields:\x20','Parent\x20','2096624zBleLG','dryRun','parse','filter','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','path','parentId','1915394nqTpFw','\x0a\x20\x20Available\x20local\x20paths:\x20','--params.','keys','CSS\x20URL\x20is\x20unreachable:\x20','8448939rRvghO','111QPirmK','35uJRskq','cssUrl','length','visible','group','order','type','isArray','isInteger','6gHevaI','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','import','string','Menu\x20sync\x20completed','object','map','jsUrl','\x22\x20for\x20','2695855hpzfjR','menu-sync','join','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','appName','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','setLogPath','63723320YmBXQD'];a184_0x50e0=function(){return _0x22c696;};return a184_0x50e0();}export function resolvePage(_0x66b299,_0x19aab5,_0x4b357a){const _0x177592=a184_0x3190dc;let _0x5e3b41=_0x19aab5[_0x177592(0x70)]??_0x66b299['parentId'];if(_0x5e3b41===undefined&&_0x66b299[_0x177592(0x7c)]){const _0x5e830b=_0x4b357a[_0x177592(0x6d)](_0x2f2047=>_0x2f2047[_0x177592(0x7e)]===_0x177592(0xa4)&&_0x2f2047['label']===_0x66b299[_0x177592(0x7c)]);if(_0x5e830b[_0x177592(0x7a)]!==0x1)throw new Error('Expected\x20one\x20folder\x20named\x20\x22'+_0x66b299[_0x177592(0x7c)]+_0x177592(0x89)+_0x66b299[_0x177592(0x6f)]+_0x177592(0x67)+_0x5e830b['length']);_0x5e3b41=_0x5e830b[0x0]['id'];}if(_0x5e3b41!==undefined&&_0x5e3b41!==0x0&&_0x4b357a[_0x177592(0x6d)](_0x3f92eb=>_0x3f92eb['id']===_0x5e3b41&&_0x3f92eb[_0x177592(0x7e)]==='folder')['length']!==0x1)throw new Error(_0x177592(0x69)+_0x5e3b41+_0x177592(0x6e));return{..._0x66b299,..._0x5e3b41===undefined?{}:{'parentId':_0x5e3b41},..._0x19aab5['visible']===undefined?{}:{'visible':_0x19aab5[_0x177592(0x7b)]}};}function validateParams(_0xae7607){const _0x442112=a184_0x3190dc,_0x5798c0=[];return _0xae7607[_0x442112(0x88)]&&!isValidJsHttpsUrl(_0xae7607[_0x442112(0x88)])&&_0x5798c0[_0x442112(0x97)]({'field':_0x442112(0x88),'message':_0x442112(0x8f)}),_0xae7607[_0x442112(0x79)]&&!isValidCssHttpsUrl(_0xae7607[_0x442112(0x79)])&&_0x5798c0[_0x442112(0x97)]({'field':_0x442112(0x79),'message':_0x442112(0x8d)}),_0x5798c0;}export async function runMenuSyncCore(_0x5862ce,_0x4b390a,_0x4ec8bc=[],_0xbb59a7,_0x808c91={}){const _0x581fb2=a184_0x3190dc,_0x5f0e78=parseMenuSyncParams(_0xbb59a7),_0x4a73df=[...new Set(_0x4ec8bc[_0x581fb2(0x87)](_0xd0a716=>_0xd0a716[_0x581fb2(0x94)]())[_0x581fb2(0x6d)](Boolean)[_0x581fb2(0x87)](menuPathKey))],_0x479caa=_0x5f0e78[_0x581fb2(0x88)],_0x230f2b=_0x5f0e78[_0x581fb2(0x79)],_0xbafe48=[];if(_0x479caa)_0xbafe48['push'](_0x479caa);if(_0x230f2b)_0xbafe48[_0x581fb2(0x97)](_0x230f2b);const _0x5319d7=validateParams(_0x5f0e78);if(_0x5319d7[_0x581fb2(0x7a)]>0x0){const _0x5456f1=_0x5319d7[_0x581fb2(0x87)](_0x5c6033=>_0x581fb2(0x73)+_0x5c6033[_0x581fb2(0xa7)]+':\x20'+_0x5c6033[_0x581fb2(0xa2)])[_0x581fb2(0x8c)](';\x20');throw new Error(_0x581fb2(0x65)+_0x5456f1);}logger[_0x581fb2(0x90)](process[_0x581fb2(0x92)]()),logger[_0x581fb2(0xa0)](_0x581fb2(0x8b),_0x581fb2(0xa3),{'appCode':_0x5862ce,'selectedCount':_0x4a73df[_0x581fb2(0x7a)],'jsUrl':_0x479caa,'cssUrl':_0x230f2b});if(_0x479caa){const _0x98e82=await isUrlReachable(_0x479caa);if(!_0x98e82)throw new Error(_0x581fb2(0x99)+_0x479caa);}if(_0x230f2b){const _0x2437fd=await isUrlReachable(_0x230f2b);if(!_0x2437fd)throw new Error(_0x581fb2(0x75)+_0x230f2b);}const _0x18a124=getLocalPages();if(_0x18a124[_0x581fb2(0x7a)]===0x0){if(_0x4a73df[_0x581fb2(0x7a)]>0x0)throw new Error(_0x581fb2(0x9d)+_0x4a73df[_0x581fb2(0x8c)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x808c91[_0x581fb2(0x6b)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x18b848=await getOnlineMenuList(_0x5862ce,_0x4b390a),_0x430c11=new Set(_0x18b848[_0x581fb2(0x87)](_0x5ef0de=>menuPathKey(_0x5ef0de[_0x581fb2(0x6f)])));let _0x3bf7ab;if(_0x4a73df['length']>0x0){const _0x1bac45=new Map(_0x18a124[_0x581fb2(0x87)](_0x5ee9d9=>[menuPathKey(_0x5ee9d9['path']),_0x5ee9d9])),_0x3b0dcc=_0x4a73df[_0x581fb2(0x6d)](_0x34f312=>!_0x1bac45[_0x581fb2(0x9e)](_0x34f312));if(_0x3b0dcc[_0x581fb2(0x7a)]>0x0){const _0xe983ed=_0x18a124[_0x581fb2(0x87)](_0x22c634=>_0x22c634[_0x581fb2(0x6f)])[_0x581fb2(0x8c)](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x3b0dcc[_0x581fb2(0x8c)](',\x20')+_0x581fb2(0x72)+_0xe983ed);}const _0x14faa5=_0x4a73df[_0x581fb2(0x6d)](_0x178444=>_0x430c11[_0x581fb2(0x9e)](_0x178444));if(_0x14faa5[_0x581fb2(0x7a)]>0x0)throw new Error(_0x581fb2(0x96)+_0x14faa5[_0x581fb2(0x8c)](',\x20'));_0x3bf7ab=_0x4a73df[_0x581fb2(0x87)](_0x292d05=>_0x1bac45[_0x581fb2(0x9c)](_0x292d05));}else _0x3bf7ab=_0x18a124['filter'](_0xd0d625=>!_0x430c11[_0x581fb2(0x9e)](menuPathKey(_0xd0d625[_0x581fb2(0x6f)])));if(_0x3bf7ab[_0x581fb2(0x7a)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x808c91[_0x581fb2(0x6b)]===!![],'targetPages':[],'plannedMenus':[]};_0x3bf7ab=_0x3bf7ab[_0x581fb2(0x87)](_0x3aeb8c=>resolvePage(_0x3aeb8c,_0x5f0e78,_0x18b848));_0x5f0e78[_0x581fb2(0x8e)]&&_0xbafe48[_0x581fb2(0x7a)]===0x0&&await assertSharedResourcesConfigured(_0x5862ce,_0x4b390a,_0x5f0e78[_0x581fb2(0x8e)]);const _0x106191=_0x3bf7ab[_0x581fb2(0x87)](_0x3ce96c=>({'type':'procode','path':_0x3ce96c[_0x581fb2(0x6f)],'label':_0x3ce96c[_0x581fb2(0x9b)],'loadScriptMode':_0x581fb2(0x83),'resources':[..._0xbafe48],..._0x3ce96c[_0x581fb2(0x7b)]===undefined?{}:{'visible':_0x3ce96c[_0x581fb2(0x7b)]},..._0x3ce96c[_0x581fb2(0x70)]===undefined?{}:{'parentId':_0x3ce96c[_0x581fb2(0x70)]},..._0x3ce96c[_0x581fb2(0x7d)]===undefined?{}:{'sort':_0x3ce96c['order']},..._0x5f0e78[_0x581fb2(0x8e)]===undefined?{}:{'appName':_0x5f0e78[_0x581fb2(0x8e)]}}));if(_0x808c91[_0x581fb2(0x6b)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x3bf7ab,'plannedMenus':_0x106191};const _0x371766=_0x5f0e78[_0x581fb2(0x8e)]?await createMenus(_0x5862ce,_0x4b390a,_0x3bf7ab,_0xbafe48['length']>0x0?_0xbafe48:undefined,{'appName':_0x5f0e78[_0x581fb2(0x8e)]}):await createMenus(_0x5862ce,_0x4b390a,_0x3bf7ab,_0xbafe48[_0x581fb2(0x7a)]>0x0?_0xbafe48:undefined);return logger[_0x581fb2(0xa0)](_0x581fb2(0x8b),_0x581fb2(0x85),{'count':_0x3bf7ab['length'],'resources':_0xbafe48}),{'created':_0x371766[_0x581fb2(0x7a)],'skipped':![],'dryRun':![],'targetPages':_0x3bf7ab,'plannedMenus':_0x106191,'menus':_0x371766};}function a184_0x54fc(_0x136246,_0x3887b0){_0x136246=_0x136246-0x65;const _0x50e09f=a184_0x50e0();let _0x54fc14=_0x50e09f[_0x136246];return _0x54fc14;}export function parseMenuSyncParams(_0x3fd2a9){const _0x12bd0c=a184_0x3190dc;if(!_0x3fd2a9||typeof _0x3fd2a9!==_0x12bd0c(0x84))return{};let _0x3a6e6c;try{_0x3a6e6c=JSON[_0x12bd0c(0x6c)](_0x3fd2a9);}catch{throw new Error(_0x12bd0c(0x95));}if(typeof _0x3a6e6c!==_0x12bd0c(0x86)||_0x3a6e6c===null||Array[_0x12bd0c(0x7f)](_0x3a6e6c))throw new Error('Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.');const _0x4ddc2f=_0x3a6e6c;if(Object[_0x12bd0c(0x9f)](_0x4ddc2f,'pages'))throw new Error(_0x12bd0c(0xa1));const _0x300136=Object[_0x12bd0c(0x74)](_0x4ddc2f)[_0x12bd0c(0x6d)](_0x3d5e98=>!MENU_SYNC_PARAM_KEYS[_0x12bd0c(0x9e)](_0x3d5e98));if(_0x300136[_0x12bd0c(0x7a)]>0x0)throw new Error(_0x12bd0c(0x68)+_0x300136['join'](',\x20')+'.');for(const _0x29702a of[_0x12bd0c(0x88),_0x12bd0c(0x79),_0x12bd0c(0x8e)]){const _0xb27d3b=_0x4ddc2f[_0x29702a];if(_0xb27d3b!==undefined&&(typeof _0xb27d3b!==_0x12bd0c(0x84)||_0xb27d3b[_0x12bd0c(0x94)]()===''))throw new Error(_0x12bd0c(0x93)+_0x29702a+_0x12bd0c(0x66));}if(_0x4ddc2f[_0x12bd0c(0x7b)]!==undefined&&typeof _0x4ddc2f[_0x12bd0c(0x7b)]!==_0x12bd0c(0xa5))throw new Error('Invalid\x20--params.visible:\x20expected\x20a\x20boolean.');if(_0x4ddc2f[_0x12bd0c(0x70)]!==undefined&&(!Number[_0x12bd0c(0x80)](_0x4ddc2f[_0x12bd0c(0x70)])||_0x4ddc2f[_0x12bd0c(0x70)]<0x0))throw new Error(_0x12bd0c(0x82));return{'jsUrl':typeof _0x4ddc2f[_0x12bd0c(0x88)]===_0x12bd0c(0x84)?_0x4ddc2f[_0x12bd0c(0x88)][_0x12bd0c(0x94)]():undefined,'cssUrl':typeof _0x4ddc2f[_0x12bd0c(0x79)]==='string'?_0x4ddc2f[_0x12bd0c(0x79)][_0x12bd0c(0x94)]():undefined,'appName':typeof _0x4ddc2f[_0x12bd0c(0x8e)]===_0x12bd0c(0x84)?_0x4ddc2f[_0x12bd0c(0x8e)][_0x12bd0c(0x94)]():undefined,'visible':typeof _0x4ddc2f['visible']==='boolean'?_0x4ddc2f[_0x12bd0c(0x7b)]:undefined,'parentId':typeof _0x4ddc2f['parentId']===_0x12bd0c(0x98)?_0x4ddc2f['parentId']:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4cdbb7,_0x40e846){const _0x153ab6=a186_0x4aff,_0x20393c=_0x4cdbb7();while(!![]){try{const _0xdba0e8=parseInt(_0x153ab6(0x1a4))/0x1+-parseInt(_0x153ab6(0x192))/0x2*(-parseInt(_0x153ab6(0x18d))/0x3)+parseInt(_0x153ab6(0x182))/0x4*(-parseInt(_0x153ab6(0x198))/0x5)+-parseInt(_0x153ab6(0x18b))/0x6+parseInt(_0x153ab6(0x19c))/0x7+-parseInt(_0x153ab6(0x1b1))/0x8+-parseInt(_0x153ab6(0x1a6))/0x9*(-parseInt(_0x153ab6(0x1a2))/0xa);if(_0xdba0e8===_0x40e846)break;else _0x20393c['push'](_0x20393c['shift']());}catch(_0x46c9c5){_0x20393c['push'](_0x20393c['shift']());}}}(a186_0x5b60,0x2b870));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 a186_0x4aff(_0x291689,_0x4fe253){_0x291689=_0x291689-0x174;const _0x5b6051=a186_0x5b60();let _0x4aff57=_0x5b6051[_0x291689];return _0x4aff57;}function validateParams(_0x266c50){const _0xa020ec=a186_0x4aff,_0x598eda=[];return _0x266c50['jsUrl']&&!isValidJsHttpsUrl(_0x266c50[_0xa020ec(0x17f)])&&_0x598eda['push']({'field':'jsUrl','message':_0xa020ec(0x180)}),_0x266c50[_0xa020ec(0x184)]&&!isValidCssHttpsUrl(_0x266c50[_0xa020ec(0x184)])&&_0x598eda[_0xa020ec(0x1ab)]({'field':_0xa020ec(0x184),'message':_0xa020ec(0x1ad)}),_0x598eda;}export async function runMenuUpdateCore(_0x449f6e,_0x3d2ae6,_0x4ca0fd,_0x225ec8={}){const _0x1d0c68=a186_0x4aff,_0x45f4aa=parseUpdateParamsFlag(_0x4ca0fd),_0x58d220=normalizeMode(_0x225ec8[_0x1d0c68(0x1b7)]);validateSelection(_0x225ec8[_0x1d0c68(0x18e)]);const _0x1b6732=[];if(_0x45f4aa[_0x1d0c68(0x17f)])_0x1b6732[_0x1d0c68(0x1ab)](_0x45f4aa['jsUrl']);if(_0x45f4aa[_0x1d0c68(0x184)])_0x1b6732[_0x1d0c68(0x1ab)](_0x45f4aa[_0x1d0c68(0x184)]);const _0x1bef50=validateParams(_0x45f4aa);if(_0x1bef50['length']>0x0){const _0x23605c=_0x1bef50['map'](_0x549b4e=>_0x1d0c68(0x176)+_0x549b4e[_0x1d0c68(0x17b)]+':\x20'+_0x549b4e[_0x1d0c68(0x19f)])['join'](';\x20');throw new Error(_0x1d0c68(0x1af)+_0x23605c);}if(_0x1b6732['length']===0x0)throw new Error(_0x1d0c68(0x1a0)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger['setLogPath'](process[_0x1d0c68(0x186)]()),logger['info']('menu-asset-update','Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x449f6e,'jsUrl':_0x45f4aa['jsUrl'],'cssUrl':_0x45f4aa[_0x1d0c68(0x184)],'mode':_0x58d220,'dryRun':_0x225ec8[_0x1d0c68(0x1aa)]===!![]});if(_0x45f4aa[_0x1d0c68(0x17f)]){const _0xe790f2=await isUrlReachable(_0x45f4aa[_0x1d0c68(0x17f)]);if(!_0xe790f2)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x45f4aa[_0x1d0c68(0x17f)]);}if(_0x45f4aa[_0x1d0c68(0x184)]){const _0x68cd2d=await isUrlReachable(_0x45f4aa['cssUrl']);if(!_0x68cd2d)throw new Error(_0x1d0c68(0x199)+_0x45f4aa[_0x1d0c68(0x184)]);}const _0x556345=await getOnlineMenuList(_0x449f6e,_0x3d2ae6),_0x1f1aee=_0x556345[_0x1d0c68(0x1b6)](_0x4887e4=>_0x4887e4[_0x1d0c68(0x187)][_0x1d0c68(0x19a)]>0x0),_0x48a2eb=selectMenusForUpdate(_0x1f1aee,_0x225ec8['selection']);if(_0x48a2eb['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x225ec8[_0x1d0c68(0x1aa)]===!![]};const _0x29da8d=_0x48a2eb[_0x1d0c68(0x195)](_0x32256d=>buildMenuUpdateDiff(_0x32256d,_0x45f4aa,_0x58d220,_0x225ec8['force']===!![],_0x225ec8[_0x1d0c68(0x185)]));if(_0x225ec8[_0x1d0c68(0x1aa)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x29da8d};const _0x4158ab=await Promise[_0x1d0c68(0x174)](_0x48a2eb['map']((_0x39ae07,_0x57deb5)=>updateMenuCdnUrl(_0x449f6e,_0x3d2ae6,{'id':_0x39ae07['id'],'label':_0x39ae07[_0x1d0c68(0x194)],'path':_0x39ae07[_0x1d0c68(0x196)],'resources':_0x29da8d[_0x57deb5][_0x1d0c68(0x191)][_0x1d0c68(0x187)],'extend':_0x39ae07[_0x1d0c68(0x181)]??null,'loadScriptMode':_0x225ec8['loadScriptMode']}))),_0x33d428=_0x4158ab[_0x1d0c68(0x1b6)](_0x2e105f=>_0x2e105f[_0x1d0c68(0x175)]==='fulfilled')[_0x1d0c68(0x195)](_0x53aa8f=>_0x53aa8f[_0x1d0c68(0x17a)]),_0x1957a0=_0x4158ab[_0x1d0c68(0x1b6)](_0x127126=>_0x127126[_0x1d0c68(0x175)]===_0x1d0c68(0x178))[_0x1d0c68(0x19a)];return logger[_0x1d0c68(0x1a3)](_0x1d0c68(0x18c),_0x1d0c68(0x18a),{'count':_0x48a2eb[_0x1d0c68(0x19a)],'resources':_0x1b6732}),{'updated':_0x33d428[_0x1d0c68(0x19a)],'failed':_0x1957a0,'skipped':![],'menus':_0x33d428};}function validateSelection(_0x2b2831){const _0x5c6a57=a186_0x4aff;if(!_0x2b2831)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x2b2831[_0x5c6a57(0x183)]&&(_0x2b2831[_0x5c6a57(0x193)][_0x5c6a57(0x19a)]>0x0||_0x2b2831[_0x5c6a57(0x1b2)]['length']>0x0))throw new Error(_0x5c6a57(0x190));if(!_0x2b2831['all']&&_0x2b2831[_0x5c6a57(0x193)][_0x5c6a57(0x19a)]===0x0&&_0x2b2831['paths']['length']===0x0)throw new Error(_0x5c6a57(0x179));}export function selectMenusForUpdate(_0x349100,_0x2edc8d){const _0x37f79e=a186_0x4aff;validateSelection(_0x2edc8d);if(_0x2edc8d[_0x37f79e(0x183)])return _0x349100;const _0x1764d4=new Set(_0x349100[_0x37f79e(0x195)](_0x534530=>_0x534530['id'])),_0x3b6f7e=new Set(_0x349100['map'](_0x521b82=>_0x521b82[_0x37f79e(0x196)])),_0x2218bf=_0x2edc8d['menuIds'][_0x37f79e(0x1b6)](_0xfeea10=>!_0x1764d4[_0x37f79e(0x1b0)](_0xfeea10)),_0x33f21f=_0x2edc8d[_0x37f79e(0x1b2)]['filter'](_0x73f0fd=>!_0x3b6f7e[_0x37f79e(0x1b0)](_0x73f0fd));if(_0x2218bf[_0x37f79e(0x19a)]>0x0||_0x33f21f[_0x37f79e(0x19a)]>0x0){const _0x36f69b=[..._0x2218bf[_0x37f79e(0x195)](_0x6a1cc2=>String(_0x6a1cc2)),..._0x33f21f][_0x37f79e(0x1b4)](',\x20');throw new Error(_0x37f79e(0x1b3)+_0x36f69b);}const _0xb78632=new Set(_0x2edc8d[_0x37f79e(0x193)]),_0x3ffc5a=new Set(_0x2edc8d[_0x37f79e(0x1b2)]);return _0x349100[_0x37f79e(0x1b6)](_0x4f2f63=>_0xb78632[_0x37f79e(0x1b0)](_0x4f2f63['id'])||_0x3ffc5a[_0x37f79e(0x1b0)](_0x4f2f63['path']));}function normalizeMode(_0x2ec652){const _0x35dddc=a186_0x4aff;if(!_0x2ec652)return _0x35dddc(0x1a5);if(_0x2ec652===_0x35dddc(0x197)||_0x2ec652===_0x35dddc(0x1a5))return _0x2ec652;throw new Error('Invalid\x20--mode:\x20'+_0x2ec652+'.\x20Allowed\x20values:\x20replace,\x20patch');}function buildMenuUpdateDiff(_0x334f5b,_0x3a63a5,_0x7a78f1,_0x3793df,_0x472b8b){const _0x2fb217=a186_0x4aff,_0x4f0eae=[..._0x334f5b[_0x2fb217(0x187)]];_0x7a78f1===_0x2fb217(0x1a5)&&assertUnambiguousPatchResources(_0x334f5b,_0x4f0eae,_0x3a63a5);const _0x236315=_0x7a78f1==='patch'?patchResources(_0x4f0eae,_0x3a63a5):replaceResources(_0x3a63a5),_0x37ff18=[],_0x4c33b9=_0x4f0eae['some'](isJsResource),_0x49a75c=_0x236315[_0x2fb217(0x188)](isJsResource);if(_0x4c33b9&&!_0x49a75c){const _0x440e93=_0x2fb217(0x177)+_0x334f5b[_0x2fb217(0x194)]+_0x2fb217(0x1a8)+_0x334f5b[_0x2fb217(0x196)]+_0x2fb217(0x19d)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0x3793df)throw new Error(_0x440e93);_0x37ff18[_0x2fb217(0x1ab)](_0x440e93);}const _0x12b429=_0x4f0eae[_0x2fb217(0x188)](isCssResource),_0x5a8a25=_0x236315['some'](isCssResource);_0x12b429&&!_0x5a8a25&&_0x37ff18['push'](_0x2fb217(0x1a7)+_0x334f5b['label']+'\x22\x20('+_0x334f5b[_0x2fb217(0x196)]+').');const _0x45a002=typeof _0x334f5b['extend']?.['loadScriptMode']===_0x2fb217(0x17c)?_0x334f5b[_0x2fb217(0x181)][_0x2fb217(0x185)]:null,_0x45fc26=_0x472b8b?{'loadScriptMode':_0x45a002}:{},_0x1375c4=_0x472b8b?{'loadScriptMode':_0x472b8b}:{};return{'id':_0x334f5b['id'],'label':_0x334f5b[_0x2fb217(0x194)],'path':_0x334f5b[_0x2fb217(0x196)],'mode':_0x7a78f1,'before':{'resources':_0x4f0eae,..._0x45fc26},'after':{'resources':_0x236315,..._0x1375c4},'warnings':_0x37ff18};}function replaceResources(_0x2eacaa){const _0x94ff34=a186_0x4aff;return[_0x2eacaa[_0x94ff34(0x17f)],_0x2eacaa[_0x94ff34(0x184)]][_0x94ff34(0x1b6)](_0x53fc2b=>!!_0x53fc2b);}function assertUnambiguousPatchResources(_0x590276,_0x336343,_0x867fad){const _0x428da8=a186_0x4aff,_0x3b8669=_0x336343[_0x428da8(0x1b6)](isJsResource)['length'];if(_0x867fad[_0x428da8(0x17f)]&&_0x3b8669>0x1)throw new Error(_0x428da8(0x17d)+_0x3b8669+_0x428da8(0x1ae)+_0x590276[_0x428da8(0x194)]+_0x428da8(0x1a8)+_0x590276[_0x428da8(0x196)]+')\x20'+'with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');const _0x3cdf24=_0x336343[_0x428da8(0x1b6)](isCssResource)['length'];if(_0x867fad[_0x428da8(0x184)]&&_0x3cdf24>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x3cdf24+_0x428da8(0x17e)+_0x590276['label']+'\x22\x20('+_0x590276[_0x428da8(0x196)]+')\x20'+_0x428da8(0x189));}function patchResources(_0x2ab11b,_0x468f75){const _0x142724=a186_0x4aff;let _0x15d5d6=![],_0x432c6f=![];const _0x56e6ed=[];for(const _0x46cbe3 of _0x2ab11b){if(isJsResource(_0x46cbe3)){if(_0x468f75[_0x142724(0x17f)]&&!_0x15d5d6)_0x56e6ed[_0x142724(0x1ab)](_0x468f75[_0x142724(0x17f)]),_0x15d5d6=!![];else!_0x468f75[_0x142724(0x17f)]&&_0x56e6ed['push'](_0x46cbe3);continue;}if(isCssResource(_0x46cbe3)){if(_0x468f75[_0x142724(0x184)]&&!_0x432c6f)_0x56e6ed[_0x142724(0x1ab)](_0x468f75[_0x142724(0x184)]),_0x432c6f=!![];else!_0x468f75[_0x142724(0x184)]&&_0x56e6ed[_0x142724(0x1ab)](_0x46cbe3);continue;}_0x56e6ed[_0x142724(0x1ab)](_0x46cbe3);}return _0x468f75['jsUrl']&&!_0x15d5d6&&_0x56e6ed[_0x142724(0x1ac)](_0x468f75[_0x142724(0x17f)]),_0x468f75[_0x142724(0x184)]&&!_0x432c6f&&_0x56e6ed[_0x142724(0x1ab)](_0x468f75[_0x142724(0x184)]),_0x56e6ed;}function isJsResource(_0x1dce5d){const _0x1f2fcb=a186_0x4aff;return stripQuery(_0x1dce5d)[_0x1f2fcb(0x18f)]()['endsWith'](_0x1f2fcb(0x19b));}function isCssResource(_0x206f50){const _0x3d0919=a186_0x4aff;return stripQuery(_0x206f50)[_0x3d0919(0x18f)]()[_0x3d0919(0x1a1)](_0x3d0919(0x1a9));}function stripQuery(_0x41082c){return _0x41082c['split']('?')[0x0]??_0x41082c;}function parseUpdateParamsFlag(_0x1f05bd){const _0x3df771=a186_0x4aff;if(!_0x1f05bd||typeof _0x1f05bd!==_0x3df771(0x17c))return{};try{const _0x219ebd=JSON[_0x3df771(0x1b5)](_0x1f05bd);if(typeof _0x219ebd!=='object'||_0x219ebd===null||Array[_0x3df771(0x19e)](_0x219ebd))return{};return{'jsUrl':typeof _0x219ebd['jsUrl']===_0x3df771(0x17c)?_0x219ebd[_0x3df771(0x17f)]['trim']():undefined,'cssUrl':typeof _0x219ebd[_0x3df771(0x184)]==='string'?_0x219ebd[_0x3df771(0x184)]['trim']():undefined};}catch{return{};}}function a186_0x5b60(){const _0x34c257=['with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','Menu\x20asset\x20update\x20completed','858312RlybiD','menu-asset-update','7284pukfMS','selection','toLowerCase','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','after','36jJIAxG','menuIds','label','map','path','replace','130tgrbPo','CSS\x20URL\x20is\x20unreachable:\x20','length','.js','1179129NAtwEv',').\x20','isArray','message','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','endsWith','10LsWeOw','info','254648pFbJcG','patch','1575342djwUdl','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','\x22\x20(','.css','dryRun','push','unshift','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','\x20existing\x20JS\x20resources\x20for\x20\x22','Invalid\x20--params:\x20','has','831544xFlCIu','paths','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','join','parse','filter','mode','allSettled','status','--params.','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','rejected','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','value','field','string','menu\x20asset-update\x20cannot\x20patch\x20','\x20existing\x20CSS\x20resources\x20for\x20\x22','jsUrl','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','extend','33316cqwbGx','all','cssUrl','loadScriptMode','cwd','resources','some'];a186_0x5b60=function(){return _0x34c257;};return a186_0x5b60();}
|
|
1
|
+
(function(_0x1e09d1,_0x34d4b2){const _0x4b5aed=a186_0x3229,_0x9cd3fd=_0x1e09d1();while(!![]){try{const _0x21de5d=-parseInt(_0x4b5aed(0x1bb))/0x1*(-parseInt(_0x4b5aed(0x1d2))/0x2)+-parseInt(_0x4b5aed(0x1de))/0x3+-parseInt(_0x4b5aed(0x1ec))/0x4+-parseInt(_0x4b5aed(0x1e7))/0x5+-parseInt(_0x4b5aed(0x1b2))/0x6*(-parseInt(_0x4b5aed(0x1cc))/0x7)+-parseInt(_0x4b5aed(0x1dc))/0x8+-parseInt(_0x4b5aed(0x1ab))/0x9*(-parseInt(_0x4b5aed(0x1ba))/0xa);if(_0x21de5d===_0x34d4b2)break;else _0x9cd3fd['push'](_0x9cd3fd['shift']());}catch(_0x55b107){_0x9cd3fd['push'](_0x9cd3fd['shift']());}}}(a186_0xe837,0x5b7be));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(_0x2c4bbf){const _0x341de7=a186_0x3229,_0x43346c=[];return _0x2c4bbf[_0x341de7(0x1cb)]&&!isValidJsHttpsUrl(_0x2c4bbf[_0x341de7(0x1cb)])&&_0x43346c['push']({'field':_0x341de7(0x1cb),'message':_0x341de7(0x1ce)}),_0x2c4bbf[_0x341de7(0x1ac)]&&!isValidCssHttpsUrl(_0x2c4bbf[_0x341de7(0x1ac)])&&_0x43346c[_0x341de7(0x1f0)]({'field':_0x341de7(0x1ac),'message':_0x341de7(0x1d5)}),_0x43346c;}function a186_0x3229(_0x2b0191,_0x399b2b){_0x2b0191=_0x2b0191-0x1ab;const _0xe8377d=a186_0xe837();let _0x3229a7=_0xe8377d[_0x2b0191];return _0x3229a7;}export async function runMenuUpdateCore(_0x4835f0,_0x1e9a34,_0x176bfb,_0x5ca46d={}){const _0x4c9f58=a186_0x3229,_0x33a355=parseUpdateParamsFlag(_0x176bfb),_0x207a56=normalizeMode(_0x5ca46d['mode']);validateSelection(_0x5ca46d[_0x4c9f58(0x1cf)]);const _0xcbb278=[];if(_0x33a355[_0x4c9f58(0x1cb)])_0xcbb278[_0x4c9f58(0x1f0)](_0x33a355[_0x4c9f58(0x1cb)]);if(_0x33a355['cssUrl'])_0xcbb278[_0x4c9f58(0x1f0)](_0x33a355['cssUrl']);const _0xd3f731=validateParams(_0x33a355);if(_0xd3f731[_0x4c9f58(0x1b7)]>0x0){const _0x4ce144=_0xd3f731[_0x4c9f58(0x1c7)](_0x23d87a=>'--params.'+_0x23d87a[_0x4c9f58(0x1ef)]+':\x20'+_0x23d87a[_0x4c9f58(0x1ed)])[_0x4c9f58(0x1e6)](';\x20');throw new Error(_0x4c9f58(0x1af)+_0x4ce144);}if(_0xcbb278[_0x4c9f58(0x1b7)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x4c9f58(0x1b0));logger[_0x4c9f58(0x1c0)](process[_0x4c9f58(0x1d6)]()),logger[_0x4c9f58(0x1ee)](_0x4c9f58(0x1c1),_0x4c9f58(0x1b5),{'appCode':_0x4835f0,'jsUrl':_0x33a355[_0x4c9f58(0x1cb)],'cssUrl':_0x33a355[_0x4c9f58(0x1ac)],'mode':_0x207a56,'dryRun':_0x5ca46d[_0x4c9f58(0x1dd)]===!![]});if(_0x33a355['jsUrl']){const _0x497a0e=await isUrlReachable(_0x33a355['jsUrl']);if(!_0x497a0e)throw new Error(_0x4c9f58(0x1b6)+_0x33a355[_0x4c9f58(0x1cb)]);}if(_0x33a355[_0x4c9f58(0x1ac)]){const _0xf38206=await isUrlReachable(_0x33a355[_0x4c9f58(0x1ac)]);if(!_0xf38206)throw new Error(_0x4c9f58(0x1e4)+_0x33a355[_0x4c9f58(0x1ac)]);}const _0x4b2b1b=await getOnlineMenuList(_0x4835f0,_0x1e9a34),_0x32d6fe=_0x4b2b1b[_0x4c9f58(0x1c5)](_0xd04889=>_0xd04889['resources']['length']>0x0),_0x48d887=selectMenusForUpdate(_0x32d6fe,_0x5ca46d['selection']);if(_0x48d887['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x5ca46d['dryRun']===!![]};const _0x34df92=_0x48d887[_0x4c9f58(0x1c7)](_0x23f6fc=>buildMenuUpdateDiff(_0x23f6fc,_0x33a355,_0x207a56,_0x5ca46d['force']===!![],_0x5ca46d[_0x4c9f58(0x1df)]));if(_0x5ca46d[_0x4c9f58(0x1dd)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x34df92};const _0x416c1b=await Promise[_0x4c9f58(0x1b4)](_0x48d887[_0x4c9f58(0x1c7)]((_0x174d4a,_0x201448)=>updateMenuCdnUrl(_0x4835f0,_0x1e9a34,{'id':_0x174d4a['id'],'label':_0x174d4a[_0x4c9f58(0x1ea)],'path':_0x174d4a['path'],'resources':_0x34df92[_0x201448][_0x4c9f58(0x1f1)]['resources'],'extend':_0x174d4a['extend']??null,'loadScriptMode':_0x5ca46d[_0x4c9f58(0x1df)]}))),_0x32967f=_0x416c1b[_0x4c9f58(0x1c5)](_0x439e21=>_0x439e21[_0x4c9f58(0x1c3)]===_0x4c9f58(0x1e9))['map'](_0x33f77b=>_0x33f77b[_0x4c9f58(0x1be)]),_0x4e275e=_0x416c1b['filter'](_0x8f97ed=>_0x8f97ed[_0x4c9f58(0x1c3)]===_0x4c9f58(0x1d4))['length'];return logger[_0x4c9f58(0x1ee)](_0x4c9f58(0x1c1),_0x4c9f58(0x1d9),{'count':_0x48d887[_0x4c9f58(0x1b7)],'resources':_0xcbb278}),{'updated':_0x32967f[_0x4c9f58(0x1b7)],'failed':_0x4e275e,'skipped':![],'menus':_0x32967f};}function validateSelection(_0x1baeb6){const _0x3b47cd=a186_0x3229;if(!_0x1baeb6)throw new Error(_0x3b47cd(0x1c2));if(_0x1baeb6[_0x3b47cd(0x1ca)]&&(_0x1baeb6[_0x3b47cd(0x1c9)]['length']>0x0||_0x1baeb6[_0x3b47cd(0x1db)][_0x3b47cd(0x1b7)]>0x0))throw new Error(_0x3b47cd(0x1da));if(!_0x1baeb6[_0x3b47cd(0x1ca)]&&_0x1baeb6[_0x3b47cd(0x1c9)]['length']===0x0&&_0x1baeb6[_0x3b47cd(0x1db)][_0x3b47cd(0x1b7)]===0x0)throw new Error(_0x3b47cd(0x1c2));}export function selectMenusForUpdate(_0x4ce004,_0xca4992){const _0x289550=a186_0x3229;validateSelection(_0xca4992);if(_0xca4992[_0x289550(0x1ca)])return _0x4ce004;const _0x19d661=new Set(_0x4ce004[_0x289550(0x1c7)](_0x179030=>_0x179030['id'])),_0x29be22=new Set(_0x4ce004[_0x289550(0x1c7)](_0x2ab60f=>_0x2ab60f[_0x289550(0x1bd)])),_0x345ba0=_0xca4992[_0x289550(0x1c9)][_0x289550(0x1c5)](_0x4ec539=>!_0x19d661[_0x289550(0x1b9)](_0x4ec539)),_0x294b7b=_0xca4992[_0x289550(0x1db)][_0x289550(0x1c5)](_0x22f332=>!_0x29be22[_0x289550(0x1b9)](_0x22f332));if(_0x345ba0[_0x289550(0x1b7)]>0x0||_0x294b7b[_0x289550(0x1b7)]>0x0){const _0x3fab76=[..._0x345ba0[_0x289550(0x1c7)](_0x42a2c9=>String(_0x42a2c9)),..._0x294b7b]['join'](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x3fab76);}const _0x471d75=new Set(_0xca4992[_0x289550(0x1c9)]),_0x1f4e2a=new Set(_0xca4992['paths']);return _0x4ce004[_0x289550(0x1c5)](_0x254eb3=>_0x471d75['has'](_0x254eb3['id'])||_0x1f4e2a['has'](_0x254eb3['path']));}function normalizeMode(_0x2f0116){const _0x5b52a5=a186_0x3229;if(!_0x2f0116)return _0x5b52a5(0x1b3);if(_0x2f0116==='replace'||_0x2f0116===_0x5b52a5(0x1b3))return _0x2f0116;throw new Error(_0x5b52a5(0x1e0)+_0x2f0116+'.\x20Allowed\x20values:\x20replace,\x20patch');}function buildMenuUpdateDiff(_0x115930,_0x2b3975,_0x4233ff,_0x11529b,_0x46e34c){const _0x51c23a=a186_0x3229,_0x33a150=[..._0x115930[_0x51c23a(0x1c6)]];_0x4233ff===_0x51c23a(0x1b3)&&assertUnambiguousPatchResources(_0x115930,_0x33a150,_0x2b3975);const _0x428e11=_0x4233ff==='patch'?patchResources(_0x33a150,_0x2b3975):replaceResources(_0x2b3975),_0xd44033=[],_0x28093c=_0x33a150[_0x51c23a(0x1bf)](isJsResource),_0x98e7d1=_0x428e11[_0x51c23a(0x1bf)](isJsResource);if(_0x28093c&&!_0x98e7d1){const _0x4f3adf=_0x51c23a(0x1ad)+_0x115930[_0x51c23a(0x1ea)]+_0x51c23a(0x1bc)+_0x115930[_0x51c23a(0x1bd)]+_0x51c23a(0x1c4)+_0x51c23a(0x1d3);if(!_0x11529b)throw new Error(_0x4f3adf);_0xd44033['push'](_0x4f3adf);}const _0x2674d4=_0x33a150[_0x51c23a(0x1bf)](isCssResource),_0x221403=_0x428e11[_0x51c23a(0x1bf)](isCssResource);_0x2674d4&&!_0x221403&&_0xd44033[_0x51c23a(0x1f0)]('menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22'+_0x115930[_0x51c23a(0x1ea)]+_0x51c23a(0x1bc)+_0x115930[_0x51c23a(0x1bd)]+').');const _0x1e2658=typeof _0x115930[_0x51c23a(0x1d1)]?.[_0x51c23a(0x1df)]===_0x51c23a(0x1e5)?_0x115930[_0x51c23a(0x1d1)][_0x51c23a(0x1df)]:null,_0xacbcfd=_0x46e34c?{'loadScriptMode':_0x1e2658}:{},_0x3788d9=_0x46e34c?{'loadScriptMode':_0x46e34c}:{};return{'id':_0x115930['id'],'label':_0x115930[_0x51c23a(0x1ea)],'path':_0x115930['path'],'mode':_0x4233ff,'before':{'resources':_0x33a150,..._0xacbcfd},'after':{'resources':_0x428e11,..._0x3788d9},'warnings':_0xd44033};}function a186_0xe837(){const _0x4a6419=['with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','fulfilled','label','object','2032212RBScJQ','message','info','field','push','after','menu\x20asset-update\x20cannot\x20patch\x20','34281xkHsPx','cssUrl','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','\x20existing\x20CSS\x20resources\x20for\x20\x22','Invalid\x20--params:\x20','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','toLowerCase','1308IEGJnJ','patch','allSettled','Start\x20non-interactive\x20menu\x20asset\x20update','JS\x20URL\x20is\x20unreachable:\x20','length','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','has','2410FzcGpk','24PzbPDj','\x22\x20(','path','value','some','setLogPath','menu-asset-update','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','status',').\x20','filter','resources','map','trim','menuIds','all','jsUrl','17640kLcJTb','split','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','selection','\x20existing\x20JS\x20resources\x20for\x20\x22','extend','40892lssTfj','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','rejected','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','cwd','endsWith','parse','Menu\x20asset\x20update\x20completed','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','paths','4022704ZcUKIP','dryRun','301986OAppax','loadScriptMode','Invalid\x20--mode:\x20','.css','unshift','isArray','CSS\x20URL\x20is\x20unreachable:\x20','string','join','2358810fneEYd'];a186_0xe837=function(){return _0x4a6419;};return a186_0xe837();}function replaceResources(_0x13d3df){const _0x37662b=a186_0x3229;return[_0x13d3df['jsUrl'],_0x13d3df[_0x37662b(0x1ac)]]['filter'](_0x5e41d6=>!!_0x5e41d6);}function assertUnambiguousPatchResources(_0xafa88,_0x5b8521,_0x16a317){const _0x2ff87b=a186_0x3229,_0x3daf15=_0x5b8521[_0x2ff87b(0x1c5)](isJsResource)[_0x2ff87b(0x1b7)];if(_0x16a317['jsUrl']&&_0x3daf15>0x1)throw new Error(_0x2ff87b(0x1f2)+_0x3daf15+_0x2ff87b(0x1d0)+_0xafa88[_0x2ff87b(0x1ea)]+_0x2ff87b(0x1bc)+_0xafa88['path']+')\x20'+_0x2ff87b(0x1e8));const _0x261322=_0x5b8521[_0x2ff87b(0x1c5)](isCssResource)[_0x2ff87b(0x1b7)];if(_0x16a317[_0x2ff87b(0x1ac)]&&_0x261322>0x1)throw new Error(_0x2ff87b(0x1f2)+_0x261322+_0x2ff87b(0x1ae)+_0xafa88[_0x2ff87b(0x1ea)]+_0x2ff87b(0x1bc)+_0xafa88[_0x2ff87b(0x1bd)]+')\x20'+_0x2ff87b(0x1b8));}function patchResources(_0x4832d1,_0x5974a6){const _0x2552b3=a186_0x3229;let _0x121340=![],_0x4b0bb8=![];const _0x1292d6=[];for(const _0x3f5bf6 of _0x4832d1){if(isJsResource(_0x3f5bf6)){if(_0x5974a6[_0x2552b3(0x1cb)]&&!_0x121340)_0x1292d6[_0x2552b3(0x1f0)](_0x5974a6[_0x2552b3(0x1cb)]),_0x121340=!![];else!_0x5974a6[_0x2552b3(0x1cb)]&&_0x1292d6['push'](_0x3f5bf6);continue;}if(isCssResource(_0x3f5bf6)){if(_0x5974a6[_0x2552b3(0x1ac)]&&!_0x4b0bb8)_0x1292d6['push'](_0x5974a6[_0x2552b3(0x1ac)]),_0x4b0bb8=!![];else!_0x5974a6[_0x2552b3(0x1ac)]&&_0x1292d6[_0x2552b3(0x1f0)](_0x3f5bf6);continue;}_0x1292d6[_0x2552b3(0x1f0)](_0x3f5bf6);}return _0x5974a6[_0x2552b3(0x1cb)]&&!_0x121340&&_0x1292d6[_0x2552b3(0x1e2)](_0x5974a6['jsUrl']),_0x5974a6[_0x2552b3(0x1ac)]&&!_0x4b0bb8&&_0x1292d6[_0x2552b3(0x1f0)](_0x5974a6[_0x2552b3(0x1ac)]),_0x1292d6;}function isJsResource(_0x2f782b){const _0x77aa4b=a186_0x3229;return stripQuery(_0x2f782b)['toLowerCase']()[_0x77aa4b(0x1d7)]('.js');}function isCssResource(_0x222432){const _0x10799c=a186_0x3229;return stripQuery(_0x222432)[_0x10799c(0x1b1)]()[_0x10799c(0x1d7)](_0x10799c(0x1e1));}function stripQuery(_0xc71e2f){const _0x3508dc=a186_0x3229;return _0xc71e2f[_0x3508dc(0x1cd)]('?')[0x0]??_0xc71e2f;}function parseUpdateParamsFlag(_0x4527ad){const _0x5d9da0=a186_0x3229;if(!_0x4527ad||typeof _0x4527ad!==_0x5d9da0(0x1e5))return{};try{const _0x305749=JSON[_0x5d9da0(0x1d8)](_0x4527ad);if(typeof _0x305749!==_0x5d9da0(0x1eb)||_0x305749===null||Array[_0x5d9da0(0x1e3)](_0x305749))return{};return{'jsUrl':typeof _0x305749[_0x5d9da0(0x1cb)]===_0x5d9da0(0x1e5)?_0x305749[_0x5d9da0(0x1cb)][_0x5d9da0(0x1c8)]():undefined,'cssUrl':typeof _0x305749[_0x5d9da0(0x1ac)]===_0x5d9da0(0x1e5)?_0x305749[_0x5d9da0(0x1ac)][_0x5d9da0(0x1c8)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x26756c,_0x3d132a){const _0x5424ec=a187_0x4857,_0x5cf3ba=_0x26756c();while(!![]){try{const _0x4d776f=-parseInt(_0x5424ec(0xc0))/0x1*(parseInt(_0x5424ec(0xbb))/0x2)+parseInt(_0x5424ec(0xc2))/0x3*(parseInt(_0x5424ec(0xbf))/0x4)+-parseInt(_0x5424ec(0xbd))/0x5*(-parseInt(_0x5424ec(0xb9))/0x6)+-parseInt(_0x5424ec(0xbe))/0x7*(-parseInt(_0x5424ec(0xb8))/0x8)+-parseInt(_0x5424ec(0xbc))/0x9*(parseInt(_0x5424ec(0xc1))/0xa)+parseInt(_0x5424ec(0xb3))/0xb*(parseInt(_0x5424ec(0xb5))/0xc)+-parseInt(_0x5424ec(0xba))/0xd;if(_0x4d776f===_0x3d132a)break;else _0x5cf3ba['push'](_0x5cf3ba['shift']());}catch(_0x5dff91){_0x5cf3ba['push'](_0x5cf3ba['shift']());}}}(a187_0x559c,0x48e24));export function isValidJsHttpsUrl(_0x1029b1){const _0x499537=a187_0x4857;return/^https:\/\/.+\.js(\?.*)?$/[_0x499537(0xb1)](_0x1029b1[_0x499537(0xb6)]());}function a187_0x559c(){const _0x417db3=['417830rlxUGV','344qYBJuJ','2tvtbpZ','160VoNRDf','18738LjJoZV','GET','test','bytes=0-0','204017hhiHpe','body','348FEFodw','trim','HEAD','40PURlQT','361356NPfsAw','9074221XqqofF','46298wmQFpi','219852CkkbJy','5adRMAG'];a187_0x559c=function(){return _0x417db3;};return a187_0x559c();}export function isValidCssHttpsUrl(_0x3732fa){const _0x499eb6=a187_0x4857;return/^https:\/\/.+\.css(\?.*)?$/[_0x499eb6(0xb1)](_0x3732fa[_0x499eb6(0xb6)]());}function a187_0x4857(_0x2d4533,_0x3f137c){_0x2d4533=_0x2d4533-0xb1;const _0x559c1b=a187_0x559c();let _0x48578b=_0x559c1b[_0x2d4533];return _0x48578b;}export async function isUrlReachable(_0x3c65a6){const _0x45cdb0=a187_0x4857;try{const _0x3e5fe3=await fetch(_0x3c65a6,{'method':_0x45cdb0(0xb7)});if(_0x3e5fe3['ok'])return!![];}catch{}try{const _0x32c56e=await fetch(_0x3c65a6,{'method':_0x45cdb0(0xc3),'headers':{'Range':_0x45cdb0(0xb2)}}),_0x1f2e11=_0x32c56e['ok'];try{await _0x32c56e[_0x45cdb0(0xb4)]?.['cancel']();}catch{}return _0x1f2e11;}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a188_0x4084a1=a188_0x59b0;(function(_0x2b9c53,_0x3cf9e1){const _0x5008b3=a188_0x59b0,_0x3a0c71=_0x2b9c53();while(!![]){try{const _0x369052=-parseInt(_0x5008b3(0x1c0))/0x1*(parseInt(_0x5008b3(0x1c9))/0x2)+parseInt(_0x5008b3(0x1be))/0x3*(parseInt(_0x5008b3(0x1c5))/0x4)+parseInt(_0x5008b3(0x1cd))/0x5*(-parseInt(_0x5008b3(0x1c4))/0x6)+parseInt(_0x5008b3(0x1c7))/0x7+parseInt(_0x5008b3(0x1c6))/0x8*(-parseInt(_0x5008b3(0x1b9))/0x9)+parseInt(_0x5008b3(0x1b8))/0xa*(parseInt(_0x5008b3(0x1bd))/0xb)+-parseInt(_0x5008b3(0x1cb))/0xc*(parseInt(_0x5008b3(0x1c8))/0xd);if(_0x369052===_0x3cf9e1)break;else _0x3a0c71['push'](_0x3a0c71['shift']());}catch(_0x4e436a){_0x3a0c71['push'](_0x3a0c71['shift']());}}}(a188_0xbfc8,0x1fa85));import{getSmartAppRecord}from'../../core/api-client.js';import{getOnlineMenuList}from'../../commands/menu/shared/service.js';import{buildSubappAssetsStatus,getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';function a188_0x59b0(_0x38c1f1,_0x14fe54){_0x38c1f1=_0x38c1f1-0x1b7;const _0xbfc83f=a188_0xbfc8();let _0x59b073=_0xbfc83f[_0x38c1f1];return _0x59b073;}export const menuSubappAssetsStatus={'service':a188_0x4084a1(0x1cc),'command':a188_0x4084a1(0x1c2),'description':a188_0x4084a1(0x1bb),'risk':a188_0x4084a1(0x1ba),'strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x57d6a9){getSubappSelector(_0x57d6a9);},async 'execute'(_0x2e2b62){const _0x313402=a188_0x4084a1,{appCode:_0x531124,appName:_0xc4401b}=getSubappSelector(_0x2e2b62),[_0x174af3,_0x1e994e]=await Promise[_0x313402(0x1c1)]([getSmartAppRecord(_0x531124,_0x2e2b62[_0x313402(0x1ca)]),getOnlineMenuList(_0x531124,_0x2e2b62[_0x313402(0x1ca)])]),_0x5d13bc={'appCode':_0x531124,...buildSubappAssetsStatus(_0x174af3,_0x1e994e,_0xc4401b)};return{'ok':!![],'data':_0x5d13bc,'message':_0x313402(0x1b7)+_0x5d13bc[_0x313402(0x1c3)]+_0x313402(0x1bc)+_0xc4401b+_0x313402(0x1bf)+_0x531124+'.'};}};function a188_0xbfc8(){const _0x896b49=['all','subapp-assets-status','boundMenus','203742povoqA','41604jkXreq','80cnCoRx','1716589Lnmqtn','13uVYdME','8uvGuUR','cookie','1495716mxzKLV','menu','20MkLlKm','Inspected\x20','10qAlqby','92520WbELpn','read','Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','\x20menu(s)\x20for\x20','1607221ceSgZA','66SuNJOh','\x20in\x20menu\x20host\x20','31805ZVnAjM'];a188_0xbfc8=function(){return _0x896b49;};return a188_0xbfc8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a189_0x173114=a189_0x3ded;function a189_0x3ded(_0x16e367,_0x155aff){_0x16e367=_0x16e367-0xcd;const _0x54f9ae=a189_0x54f9();let _0x3dede4=_0x54f9ae[_0x16e367];return _0x3dede4;}(function(_0xffe137,_0x1d6a48){const _0x4721e9=a189_0x3ded,_0x262343=_0xffe137();while(!![]){try{const _0x472935=-parseInt(_0x4721e9(0x111))/0x1*(parseInt(_0x4721e9(0x116))/0x2)+parseInt(_0x4721e9(0x115))/0x3*(-parseInt(_0x4721e9(0xf8))/0x4)+-parseInt(_0x4721e9(0x101))/0x5+-parseInt(_0x4721e9(0x106))/0x6*(-parseInt(_0x4721e9(0xf6))/0x7)+-parseInt(_0x4721e9(0x114))/0x8+parseInt(_0x4721e9(0x10b))/0x9+-parseInt(_0x4721e9(0xea))/0xa*(-parseInt(_0x4721e9(0xcf))/0xb);if(_0x472935===_0x1d6a48)break;else _0x262343['push'](_0x262343['shift']());}catch(_0x5d3830){_0x262343['push'](_0x262343['shift']());}}}(a189_0x54f9,0x65c46));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a189_0x54f9(){const _0x368983=['parse','object','extend','apiError','4380867oPdwPG','enableSample','Updated\x20shared\x20resources\x20for\x20','resources','some','map','181126ttLzUV','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','assets','3936896KKvCrc','132ISvVfW','4MWqJlj','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','length','isArray','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','\x20must\x20be\x20a\x20JSON\x20object.','expected-hash','size','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','has','expectedHash','subapp-assets-update','33yURQnY','appPublishStatus','update','accessKey',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','appName','enableOpenApi','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','verified\x20app.extend','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','tenantColumn','nextExtend','appCode','directDbId','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','/smartapi/app/update','\x20contains\x20invalid\x20JSON.',';\x20independent\x20deployment\x20not\x20verified.','before','enableAutoSync','unchanged','string','resources[','App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.','6791610rJNZbM','not\x20HTTPS','skinColor','https:','keys','\x20must\x20be\x20a\x20JSON\x20array.','directDbEnabled','.\x20Refusing\x20update.','trim','cookie','protocol','entries','1337oyFHJA','stringify','58412otwxiM','app.extend.assets','test','join','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','app.extend','App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.','digest','sha256','3148060gCInDC','filter','validation','POST','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','600aVOhyu'];a189_0x54f9=function(){return _0x368983;};return a189_0x54f9();}import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a189_0x173114(0xec),a189_0x173114(0xd6),a189_0x173114(0xd2),a189_0x173114(0x113),a189_0x173114(0xdc),a189_0x173114(0x10c),'vipDeploy',a189_0x173114(0xe5),a189_0x173114(0xdf),a189_0x173114(0xf0)]);function parseObject(_0xfd4ba8,_0x3f7b3a){const _0x1b6578=a189_0x173114;let _0x410f20=_0xfd4ba8;if(typeof _0xfd4ba8===_0x1b6578(0xe7))try{_0x410f20=JSON[_0x1b6578(0x107)](_0xfd4ba8);}catch{throw CliErrors[_0x1b6578(0x103)](_0x3f7b3a+_0x1b6578(0xe2));}if(!_0x410f20||typeof _0x410f20!==_0x1b6578(0x108)||Array[_0x1b6578(0x11a)](_0x410f20))throw CliErrors['validation'](_0x3f7b3a+_0x1b6578(0x11c));return _0x410f20;}function parseArray(_0x128c76,_0x2619e5){const _0x294e7f=a189_0x173114;let _0xd47aea;try{_0xd47aea=JSON[_0x294e7f(0x107)](_0x128c76);}catch{throw CliErrors['validation'](_0x2619e5+_0x294e7f(0xe2));}if(!Array['isArray'](_0xd47aea))throw CliErrors[_0x294e7f(0x103)](_0x2619e5+_0x294e7f(0xef));return _0xd47aea['map']((_0xe17dd9,_0x2a9371)=>parseObject(_0xe17dd9,_0x2619e5+'['+_0x2a9371+']'));}function validateResources(_0x45c480){const _0x4da9ba=a189_0x173114;if(_0x45c480[_0x4da9ba(0x119)]===0x0)throw CliErrors[_0x4da9ba(0x103)](_0x4da9ba(0xdb));for(const [_0x2ed560,_0x10cbb7]of _0x45c480[_0x4da9ba(0xf5)]()){if(typeof _0x10cbb7!==_0x4da9ba(0xe7))throw CliErrors[_0x4da9ba(0x103)](_0x4da9ba(0xe8)+_0x2ed560+']\x20must\x20be\x20a\x20URL\x20string.');try{if(new URL(_0x10cbb7)[_0x4da9ba(0xf4)]!==_0x4da9ba(0xed))throw new Error(_0x4da9ba(0xeb));}catch{throw CliErrors[_0x4da9ba(0x103)](_0x4da9ba(0xe8)+_0x2ed560+_0x4da9ba(0xd3));}}if(new Set(_0x45c480)[_0x4da9ba(0x11e)]!==_0x45c480['length']||!_0x45c480[_0x4da9ba(0x10f)](_0x3cf57e=>/\.m?js(?:[?#]|$)/i[_0x4da9ba(0xfa)](_0x3cf57e)))throw CliErrors[_0x4da9ba(0x103)](_0x4da9ba(0x105));return _0x45c480;}function prepare(_0x8a1dbe,_0x9571ed,_0x557774){const _0x17ec07=a189_0x173114;if(!Number['isSafeInteger'](_0x8a1dbe['id'])||(_0x8a1dbe['id']??0x0)<=0x0||typeof _0x8a1dbe[_0x17ec07(0xd0)]!=='string'||!_0x8a1dbe[_0x17ec07(0xd0)])throw CliErrors['validation'](_0x17ec07(0x117));const _0x58d3d5=parseObject(_0x8a1dbe[_0x17ec07(0x109)],_0x17ec07(0xfd)),_0x1e8b80=Object[_0x17ec07(0xee)](_0x58d3d5)[_0x17ec07(0x102)](_0x42b69f=>!KNOWN_EXTEND_KEYS[_0x17ec07(0x120)](_0x42b69f));if(_0x1e8b80[_0x17ec07(0x119)])throw CliErrors['validation']('Unknown\x20app.extend\x20fields:\x20'+_0x1e8b80[_0x17ec07(0xfb)](',\x20')+_0x17ec07(0xf1));if(typeof _0x58d3d5[_0x17ec07(0x113)]!=='string')throw CliErrors[_0x17ec07(0x103)](_0x17ec07(0x11b));const _0x4b9aee=parseArray(_0x58d3d5['assets'],_0x17ec07(0xf9)),_0x5dd905=_0x4b9aee[_0x17ec07(0x102)](_0x4894dd=>_0x4894dd[_0x17ec07(0xd5)]===_0x9571ed);if(_0x5dd905[_0x17ec07(0x119)]!==0x1)throw CliErrors[_0x17ec07(0x103)](_0x17ec07(0xd4)+_0x9571ed+';\x20found\x20'+_0x5dd905[_0x17ec07(0x119)]+'.');const _0x5bd5f0=_0x5dd905[0x0];if(typeof _0x5bd5f0[_0x17ec07(0x10e)]!=='string')throw CliErrors['validation'](_0x17ec07(0xfc));let _0x5b0384;try{_0x5b0384=JSON[_0x17ec07(0x107)](_0x5bd5f0[_0x17ec07(0x10e)]);}catch{throw CliErrors[_0x17ec07(0x103)]('Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.');}if(!Array[_0x17ec07(0x11a)](_0x5b0384)||_0x5b0384[_0x17ec07(0x10f)](_0x1957c3=>typeof _0x1957c3!==_0x17ec07(0xe7)))throw CliErrors[_0x17ec07(0x103)](_0x17ec07(0xe0));const _0x1460fa=_0x4b9aee[_0x17ec07(0x110)](_0x3a1941=>_0x3a1941===_0x5bd5f0?{..._0x3a1941,'resources':JSON[_0x17ec07(0xf7)](_0x557774)}:_0x3a1941),_0x57cef7={..._0x58d3d5,'assets':JSON['stringify'](_0x1460fa)},_0x2e7a33=createHash(_0x17ec07(0x100))[_0x17ec07(0xd1)](JSON['stringify']({'appCode':_0x8a1dbe[_0x17ec07(0xde)],'id':_0x8a1dbe['id'],'appPublishStatus':_0x8a1dbe[_0x17ec07(0xd0)],'extend':_0x58d3d5,'appName':_0x9571ed,'resources':_0x557774}))[_0x17ec07(0xff)]('hex');return{'before':_0x5b0384,'nextExtend':_0x57cef7,'expectedHash':_0x2e7a33,'unchanged':isDeepStrictEqual(_0x5b0384,_0x557774)};}function flags(_0x198647){const _0x22872a=a189_0x173114,{appCode:_0x2a9c90,appName:_0x361ade}=getSubappSelector(_0x198647),_0x4622d3=_0x198647['str'](_0x22872a(0x10e))['trim']();if(!_0x4622d3)throw CliErrors['validation']('--resources\x20is\x20required.');let _0x313574;try{_0x313574=JSON[_0x22872a(0x107)](_0x4622d3);}catch{throw CliErrors[_0x22872a(0x103)](_0x22872a(0xd8));}if(!Array[_0x22872a(0x11a)](_0x313574))throw CliErrors[_0x22872a(0x103)](_0x22872a(0xd8));return{'appCode':_0x2a9c90,'appName':_0x361ade,'resources':validateResources(_0x313574)};}export const menuSubappAssetsUpdate={'service':'menu','command':a189_0x173114(0xce),'description':a189_0x173114(0x11f),'risk':'write','strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a189_0x173114(0x10e),'type':'string','required':!![],'description':'JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs'},{'name':a189_0x173114(0x11d),'type':'string','description':a189_0x173114(0xda)}],async 'validate'(_0x30f9c5){flags(_0x30f9c5);},async 'dryRun'(_0x27d8c5){const _0x3de34c=a189_0x173114,{appCode:_0x27becb,appName:_0x488287,resources:_0x25a351}=flags(_0x27d8c5),_0x462572=await getSmartAppRecord(_0x27becb,_0x27d8c5[_0x3de34c(0xf3)]),_0x445d73=prepare(_0x462572,_0x488287,_0x25a351);return{'method':_0x3de34c(0x104),'url':_0x3de34c(0xe1),'body':{'preview':{'appCode':_0x27becb,'appName':_0x488287,'before':_0x445d73[_0x3de34c(0xe4)],'after':_0x25a351,'expectedHash':_0x445d73[_0x3de34c(0xcd)],'unchanged':_0x445d73[_0x3de34c(0xe6)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x445d73['unchanged']?_0x3de34c(0xd7):'Would\x20update\x20shared\x20assets\x20for\x20'+_0x488287+'.'};},async 'execute'(_0x1e0f8d){const _0xae2df1=a189_0x173114,{appCode:_0x16fcf6,appName:_0x35ca3a,resources:_0x301268}=flags(_0x1e0f8d),_0x440145=_0x1e0f8d['str'](_0xae2df1(0x11d))[_0xae2df1(0xf2)]();if(!/^[a-f0-9]{64}$/i['test'](_0x440145))throw CliErrors[_0xae2df1(0x103)](_0xae2df1(0x112));const _0x5e3165=await getSmartAppRecord(_0x16fcf6,_0x1e0f8d['cookie']),_0x47ae9a=prepare(_0x5e3165,_0x35ca3a,_0x301268);if(_0x440145!==_0x47ae9a[_0xae2df1(0xcd)])throw CliErrors[_0xae2df1(0x103)](_0xae2df1(0xfe));if(_0x47ae9a[_0xae2df1(0xe6)])return{'ok':!![],'data':{'appCode':_0x16fcf6,'appName':_0x35ca3a,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0xae2df1(0x118)};await updateSmartAppRecord({'id':_0x5e3165['id'],'appCode':_0x16fcf6,'appPublishStatus':_0x5e3165[_0xae2df1(0xd0)],'extend':_0x47ae9a['nextExtend']},_0x1e0f8d[_0xae2df1(0xf3)]);const _0x3ee574=await getSmartAppRecord(_0x16fcf6,_0x1e0f8d['cookie']),_0x4049cf=parseObject(_0x3ee574[_0xae2df1(0x109)],_0xae2df1(0xd9));if(_0x3ee574['id']!==_0x5e3165['id']||_0x3ee574['appPublishStatus']!==_0x5e3165[_0xae2df1(0xd0)]||!isDeepStrictEqual(_0x4049cf,_0x47ae9a[_0xae2df1(0xdd)]))throw CliErrors[_0xae2df1(0x10a)](_0xae2df1(0xe9));return{'ok':!![],'data':{'appCode':_0x16fcf6,'appName':_0x35ca3a,'updated':!![],'resources':_0x301268,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0xae2df1(0x10d)+_0x35ca3a+'\x20in\x20menu\x20host\x20'+_0x16fcf6+_0xae2df1(0xe3)};}};
|
|
1
|
+
const a189_0x57552e=a189_0x13d3;(function(_0x4eba67,_0xf22bc5){const _0x2b50a9=a189_0x13d3,_0x5e03ed=_0x4eba67();while(!![]){try{const _0x570b73=-parseInt(_0x2b50a9(0x9a))/0x1+parseInt(_0x2b50a9(0x8b))/0x2+parseInt(_0x2b50a9(0xc8))/0x3*(-parseInt(_0x2b50a9(0xa7))/0x4)+-parseInt(_0x2b50a9(0xbc))/0x5+parseInt(_0x2b50a9(0xb3))/0x6*(-parseInt(_0x2b50a9(0xa5))/0x7)+-parseInt(_0x2b50a9(0xc0))/0x8+parseInt(_0x2b50a9(0x99))/0x9*(parseInt(_0x2b50a9(0xb7))/0xa);if(_0x570b73===_0xf22bc5)break;else _0x5e03ed['push'](_0x5e03ed['shift']());}catch(_0x2c039b){_0x5e03ed['push'](_0x5e03ed['shift']());}}}(a189_0x178b,0xa55db));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';function a189_0x178b(){const _0x343e1a=['apiError','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','7379072XmEMew','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.',']\x20must\x20be\x20a\x20URL\x20string.','string','accessKey','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','validation','some','3SFicbU','update','directDbId','subapp-assets-update','resources[','appName','cookie','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','verified\x20app.extend','hex','str','join','\x20must\x20be\x20a\x20JSON\x20array.','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','entries',';\x20independent\x20deployment\x20not\x20verified.','object',';\x20found\x20','--resources\x20is\x20required.','expected-hash','vipDeploy','2674594mwExFE','enableOpenApi','unchanged','length','enableSample','trim','appCode','App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.','app.extend','Would\x20update\x20shared\x20assets\x20for\x20','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','sha256','https:','protocol','9CXfqqB','1300268gRTErM','expectedHash','test','assets','isArray','resources','Unknown\x20app.extend\x20fields:\x20','stringify','before','POST','nextExtend','575078tNyabe','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','2633460lvicaA','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','.\x20Refusing\x20update.','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','\x20contains\x20invalid\x20JSON.','appPublishStatus','parse','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','enableAutoSync','write','not\x20HTTPS','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','6LQlEKF','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','filter','\x20in\x20menu\x20host\x20','31778990ivTVbs','tenantColumn','size','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','/smartapi/app/update','4373430LykGEw',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.'];a189_0x178b=function(){return _0x343e1a;};return a189_0x178b();}import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set(['skinColor',a189_0x57552e(0x8c),a189_0x57552e(0xc4),a189_0x57552e(0x9d),a189_0x57552e(0xb8),a189_0x57552e(0x8f),a189_0x57552e(0x8a),a189_0x57552e(0xaf),a189_0x57552e(0xca),'directDbEnabled']);function parseObject(_0x141cb6,_0xf06a60){const _0x3975eb=a189_0x57552e;let _0x3d49d0=_0x141cb6;if(typeof _0x141cb6===_0x3975eb(0xc3))try{_0x3d49d0=JSON['parse'](_0x141cb6);}catch{throw CliErrors[_0x3975eb(0xc6)](_0xf06a60+'\x20contains\x20invalid\x20JSON.');}if(!_0x3d49d0||typeof _0x3d49d0!==_0x3975eb(0x86)||Array['isArray'](_0x3d49d0))throw CliErrors[_0x3975eb(0xc6)](_0xf06a60+'\x20must\x20be\x20a\x20JSON\x20object.');return _0x3d49d0;}function parseArray(_0x51ca5d,_0x4ecd38){const _0x38f4a9=a189_0x57552e;let _0x267b6d;try{_0x267b6d=JSON[_0x38f4a9(0xad)](_0x51ca5d);}catch{throw CliErrors[_0x38f4a9(0xc6)](_0x4ecd38+_0x38f4a9(0xab));}if(!Array[_0x38f4a9(0x9e)](_0x267b6d))throw CliErrors[_0x38f4a9(0xc6)](_0x4ecd38+_0x38f4a9(0xd4));return _0x267b6d['map']((_0x677261,_0x3af693)=>parseObject(_0x677261,_0x4ecd38+'['+_0x3af693+']'));}function validateResources(_0x3b19f9){const _0x4b5cea=a189_0x57552e;if(_0x3b19f9['length']===0x0)throw CliErrors[_0x4b5cea(0xc6)](_0x4b5cea(0xa8));for(const [_0x38bc07,_0x1740df]of _0x3b19f9[_0x4b5cea(0xd6)]()){if(typeof _0x1740df!==_0x4b5cea(0xc3))throw CliErrors[_0x4b5cea(0xc6)](_0x4b5cea(0xcc)+_0x38bc07+_0x4b5cea(0xc2));try{if(new URL(_0x1740df)[_0x4b5cea(0x98)]!==_0x4b5cea(0x97))throw new Error(_0x4b5cea(0xb1));}catch{throw CliErrors[_0x4b5cea(0xc6)](_0x4b5cea(0xcc)+_0x38bc07+_0x4b5cea(0xbd));}}if(new Set(_0x3b19f9)[_0x4b5cea(0xb9)]!==_0x3b19f9['length']||!_0x3b19f9['some'](_0xbd4e67=>/\.m?js(?:[?#]|$)/i[_0x4b5cea(0x9c)](_0xbd4e67)))throw CliErrors[_0x4b5cea(0xc6)](_0x4b5cea(0xae));return _0x3b19f9;}function a189_0x13d3(_0x22c229,_0x5f34aa){_0x22c229=_0x22c229-0x86;const _0x178b89=a189_0x178b();let _0x13d335=_0x178b89[_0x22c229];return _0x13d335;}function prepare(_0x38bdea,_0x197d1d,_0x4f55f9){const _0x42c380=a189_0x57552e;if(!Number['isSafeInteger'](_0x38bdea['id'])||(_0x38bdea['id']??0x0)<=0x0||typeof _0x38bdea[_0x42c380(0xac)]!==_0x42c380(0xc3)||!_0x38bdea[_0x42c380(0xac)])throw CliErrors['validation'](_0x42c380(0xc1));const _0x550db1=parseObject(_0x38bdea['extend'],_0x42c380(0x93)),_0x256297=Object['keys'](_0x550db1)[_0x42c380(0xb5)](_0x197faa=>!KNOWN_EXTEND_KEYS['has'](_0x197faa));if(_0x256297[_0x42c380(0x8e)])throw CliErrors[_0x42c380(0xc6)](_0x42c380(0xa0)+_0x256297[_0x42c380(0xd3)](',\x20')+_0x42c380(0xa9));if(typeof _0x550db1[_0x42c380(0x9d)]!==_0x42c380(0xc3))throw CliErrors['validation'](_0x42c380(0xa6));const _0x318ff1=parseArray(_0x550db1[_0x42c380(0x9d)],'app.extend.assets'),_0x282022=_0x318ff1['filter'](_0x2a7114=>_0x2a7114[_0x42c380(0xcd)]===_0x197d1d);if(_0x282022[_0x42c380(0x8e)]!==0x1)throw CliErrors[_0x42c380(0xc6)](_0x42c380(0xd5)+_0x197d1d+_0x42c380(0x87)+_0x282022['length']+'.');const _0x1ee04d=_0x282022[0x0];if(typeof _0x1ee04d[_0x42c380(0x9f)]!=='string')throw CliErrors[_0x42c380(0xc6)](_0x42c380(0xb4));let _0x16d8d8;try{_0x16d8d8=JSON[_0x42c380(0xad)](_0x1ee04d[_0x42c380(0x9f)]);}catch{throw CliErrors[_0x42c380(0xc6)]('Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.');}if(!Array[_0x42c380(0x9e)](_0x16d8d8)||_0x16d8d8[_0x42c380(0xc7)](_0x2d6793=>typeof _0x2d6793!==_0x42c380(0xc3)))throw CliErrors[_0x42c380(0xc6)](_0x42c380(0xbf));const _0x2e0a84=_0x318ff1['map'](_0x34c229=>_0x34c229===_0x1ee04d?{..._0x34c229,'resources':JSON[_0x42c380(0xa1)](_0x4f55f9)}:_0x34c229),_0x5f2276={..._0x550db1,'assets':JSON[_0x42c380(0xa1)](_0x2e0a84)},_0x953500=createHash(_0x42c380(0x96))[_0x42c380(0xc9)](JSON[_0x42c380(0xa1)]({'appCode':_0x38bdea[_0x42c380(0x91)],'id':_0x38bdea['id'],'appPublishStatus':_0x38bdea[_0x42c380(0xac)],'extend':_0x550db1,'appName':_0x197d1d,'resources':_0x4f55f9}))['digest'](_0x42c380(0xd1));return{'before':_0x16d8d8,'nextExtend':_0x5f2276,'expectedHash':_0x953500,'unchanged':isDeepStrictEqual(_0x16d8d8,_0x4f55f9)};}function flags(_0xa5694e){const _0x23e4c1=a189_0x57552e,{appCode:_0x2a070e,appName:_0x4f5f82}=getSubappSelector(_0xa5694e),_0x30c328=_0xa5694e[_0x23e4c1(0xd2)](_0x23e4c1(0x9f))[_0x23e4c1(0x90)]();if(!_0x30c328)throw CliErrors[_0x23e4c1(0xc6)](_0x23e4c1(0x88));let _0x5874c5;try{_0x5874c5=JSON[_0x23e4c1(0xad)](_0x30c328);}catch{throw CliErrors['validation'](_0x23e4c1(0xb2));}if(!Array[_0x23e4c1(0x9e)](_0x5874c5))throw CliErrors[_0x23e4c1(0xc6)](_0x23e4c1(0xb2));return{'appCode':_0x2a070e,'appName':_0x4f5f82,'resources':validateResources(_0x5874c5)};}export const menuSubappAssetsUpdate={'service':'menu','command':a189_0x57552e(0xcb),'description':'Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','risk':a189_0x57552e(0xb0),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a189_0x57552e(0x9f),'type':a189_0x57552e(0xc3),'required':!![],'description':a189_0x57552e(0xba)},{'name':a189_0x57552e(0x89),'type':a189_0x57552e(0xc3),'description':a189_0x57552e(0xc5)}],async 'validate'(_0x40537c){flags(_0x40537c);},async 'dryRun'(_0x2321a1){const _0x23ed04=a189_0x57552e,{appCode:_0x17cb5a,appName:_0x2df66c,resources:_0x3e854b}=flags(_0x2321a1),_0x53e455=await getSmartAppRecord(_0x17cb5a,_0x2321a1['cookie']),_0x57baf3=prepare(_0x53e455,_0x2df66c,_0x3e854b);return{'method':_0x23ed04(0xa3),'url':_0x23ed04(0xbb),'body':{'preview':{'appCode':_0x17cb5a,'appName':_0x2df66c,'before':_0x57baf3[_0x23ed04(0xa2)],'after':_0x3e854b,'expectedHash':_0x57baf3[_0x23ed04(0x9b)],'unchanged':_0x57baf3[_0x23ed04(0x8d)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x57baf3[_0x23ed04(0x8d)]?_0x23ed04(0xaa):_0x23ed04(0x94)+_0x2df66c+'.'};},async 'execute'(_0x481ead){const _0x17745b=a189_0x57552e,{appCode:_0x1ef3b4,appName:_0x24c6b1,resources:_0xb1d853}=flags(_0x481ead),_0x36247e=_0x481ead['str'](_0x17745b(0x89))[_0x17745b(0x90)]();if(!/^[a-f0-9]{64}$/i[_0x17745b(0x9c)](_0x36247e))throw CliErrors[_0x17745b(0xc6)](_0x17745b(0x95));const _0x3c4942=await getSmartAppRecord(_0x1ef3b4,_0x481ead[_0x17745b(0xce)]),_0x27afc2=prepare(_0x3c4942,_0x24c6b1,_0xb1d853);if(_0x36247e!==_0x27afc2[_0x17745b(0x9b)])throw CliErrors[_0x17745b(0xc6)]('App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.');if(_0x27afc2[_0x17745b(0x8d)])return{'ok':!![],'data':{'appCode':_0x1ef3b4,'appName':_0x24c6b1,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x17745b(0xcf)};await updateSmartAppRecord({'id':_0x3c4942['id'],'appCode':_0x1ef3b4,'appPublishStatus':_0x3c4942[_0x17745b(0xac)],'extend':_0x27afc2['nextExtend']},_0x481ead[_0x17745b(0xce)]);const _0xd116b=await getSmartAppRecord(_0x1ef3b4,_0x481ead[_0x17745b(0xce)]),_0xd7945f=parseObject(_0xd116b['extend'],_0x17745b(0xd0));if(_0xd116b['id']!==_0x3c4942['id']||_0xd116b[_0x17745b(0xac)]!==_0x3c4942[_0x17745b(0xac)]||!isDeepStrictEqual(_0xd7945f,_0x27afc2[_0x17745b(0xa4)]))throw CliErrors[_0x17745b(0xbe)](_0x17745b(0x92));return{'ok':!![],'data':{'appCode':_0x1ef3b4,'appName':_0x24c6b1,'updated':!![],'resources':_0xb1d853,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':'Updated\x20shared\x20resources\x20for\x20'+_0x24c6b1+_0x17745b(0xb6)+_0x1ef3b4+_0x17745b(0xd7)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a190_0xb9417a=a190_0x5965;(function(_0x3be949,_0x3511f8){const _0x16eff1=a190_0x5965,_0x55b120=_0x3be949();while(!![]){try{const _0x203a32=-parseInt(_0x16eff1(0x177))/0x1+parseInt(_0x16eff1(0x159))/0x2*(parseInt(_0x16eff1(0x15c))/0x3)+parseInt(_0x16eff1(0x12e))/0x4+parseInt(_0x16eff1(0x171))/0x5*(-parseInt(_0x16eff1(0x150))/0x6)+-parseInt(_0x16eff1(0x160))/0x7*(-parseInt(_0x16eff1(0x15f))/0x8)+-parseInt(_0x16eff1(0x14d))/0x9+parseInt(_0x16eff1(0x15b))/0xa;if(_0x203a32===_0x3511f8)break;else _0x55b120['push'](_0x55b120['shift']());}catch(_0x39a26b){_0x55b120['push'](_0x55b120['shift']());}}}(a190_0x18b7,0x9df2b));function a190_0x5965(_0x542884,_0x374aff){_0x542884=_0x542884-0x12e;const _0x18b747=a190_0x18b7();let _0x5965af=_0x18b747[_0x542884];return _0x5965af;}import a190_0x4c8e0a from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,resolvePage,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';import{assertSharedResourcesConfigured}from'../../commands/menu/shared/subapp-assets.js';export const menuSync={'service':a190_0xb9417a(0x15e),'command':a190_0xb9417a(0x168),'description':a190_0xb9417a(0x16c),'risk':a190_0xb9417a(0x16d),'flags':[{'name':'params','type':a190_0xb9417a(0x15a),'description':a190_0xb9417a(0x169)+'JSON:\x20{\x22appName\x22:\x22store-app\x22,\x22parentId\x22:42,\x22visible\x22:false};\x20jsUrl\x20and\x20cssUrl\x20remain\x20available\x20for\x20individual\x20menu\x20resources.'},{'name':'paths','type':a190_0xb9417a(0x15a),'description':a190_0xb9417a(0x158)},{'name':a190_0xb9417a(0x164),'type':a190_0xb9417a(0x143),'description':a190_0xb9417a(0x16e)}],async 'dryRun'(_0x2e8006){const _0x1d8018=a190_0xb9417a;ensureRunnableContext(_0x2e8006[_0x1d8018(0x178)],_0x2e8006[_0x1d8018(0x139)]);const _0x54714e=await runMenuSyncCore(_0x2e8006['appCode'],_0x2e8006[_0x1d8018(0x144)],parsePaths(_0x2e8006[_0x1d8018(0x134)](_0x1d8018(0x14b))),_0x2e8006[_0x1d8018(0x134)](_0x1d8018(0x16b)),{'dryRun':!![]});return{'method':_0x1d8018(0x12f),'url':_0x1d8018(0x176),'body':_0x54714e,'description':_0x54714e['skipped']?_0x1d8018(0x147):'Would\x20create\x20'+_0x54714e[_0x1d8018(0x174)][_0x1d8018(0x16a)]+_0x1d8018(0x154)};},async 'execute'(_0x297a80){const _0x105f93=a190_0xb9417a;ensureRunnableContext(_0x297a80[_0x105f93(0x178)],_0x297a80[_0x105f93(0x139)]);const _0x24b7ff=_0x297a80[_0x105f93(0x156)]('yes'),_0x5d305f=_0x297a80[_0x105f93(0x134)](_0x105f93(0x16b)),_0x250f7a=parsePaths(_0x297a80[_0x105f93(0x134)](_0x105f93(0x14b))),_0x5ee48d=parseMenuSyncParams(_0x5d305f);if(_0x24b7ff){const _0xaa5c9=await runMenuSyncCore(_0x297a80[_0x105f93(0x151)],_0x297a80['cookie'],_0x250f7a,_0x5d305f);if(_0xaa5c9['skipped']){const _0x851b78=getLocalPages();_0x851b78['length']===0x0?writeCliSideChannelLine(_0x105f93(0x167)):writeCliSideChannelLine('✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform');}else writeCliSideChannelLine(_0x105f93(0x163)+_0xaa5c9['created']+'\x20menu(s)\x20created');return{'ok':!![],'data':_0xaa5c9,'message':_0xaa5c9[_0x105f93(0x166)]?_0x105f93(0x162):'Menu\x20sync\x20completed:\x20'+_0xaa5c9[_0x105f93(0x146)]+_0x105f93(0x141)};}if(_0x250f7a[_0x105f93(0x16a)]>0x0)throw CliErrors['validation'](_0x105f93(0x138),_0x105f93(0x175));if(!isInteractive()&&_0x5d305f)throw CliErrors[_0x105f93(0x153)](_0x105f93(0x149),_0x105f93(0x175));requireInteractive(),writeCliSideChannelLine('Tip:\x20For\x20frontend\x20subapps,\x20prefer\x20Agent-planned\x20menu\x20groups\x20and\x20shared\x20resources.\x20This\x20manual\x20sync\x20workflow\x20remains\x20available\x20as\x20a\x20fallback.');const _0x105e75=startSpinner(_0x105f93(0x155));let _0x5bda50,_0x4d0959,_0x200d9b;try{const _0x4d59dc=await fetchMenuData(_0x297a80[_0x105f93(0x151)],_0x297a80[_0x105f93(0x144)]);_0x5bda50=_0x4d59dc[_0x105f93(0x135)],_0x4d0959=_0x4d59dc[_0x105f93(0x15d)],_0x200d9b=_0x4d59dc[_0x105f93(0x13e)],stopSpinner(_0x105e75,_0x105f93(0x13b),!![]);}catch(_0x307c84){stopSpinner(_0x105e75,_0x105f93(0x152),![]);throw CliErrors[_0x105f93(0x153)](_0x307c84 instanceof Error?_0x307c84[_0x105f93(0x172)]:_0x105f93(0x152));}if(_0x5bda50[_0x105f93(0x16a)]===0x0)return writeCliSideChannelLine(a190_0x4c8e0a[_0x105f93(0x13d)](_0x105f93(0x157))),{'ok':!![]};const _0x23855e=buildCompareRows(_0x5bda50,_0x4d0959);writeCliSideChannelLine(renderCompareTable(_0x23855e)),writeCliSideChannelLine('');const _0x5131a0=await selectPages(_0x5bda50,_0x4d0959);writeCliSideChannelLine(''),writeCliSideChannelLine(a190_0x4c8e0a['cyan'](_0x105f93(0x13f)+_0x5131a0[_0x105f93(0x16a)]+_0x105f93(0x136)));const _0x435bef=_0x5ee48d[_0x105f93(0x133)]&&_0x5ee48d[_0x105f93(0x131)];if(!_0x435bef){writeCliSideChannelLine(renderSyncSummary(_0x5131a0,_0x4d0959['size']>0x0));const _0x1688bf=await askConfirm('\x20\x20Continue\x20with\x20creation?');if(!_0x1688bf)return writeCliSideChannelLine(a190_0x4c8e0a['gray'](_0x105f93(0x14a))),{'ok':!![]};}let _0x2f93e2=_0x5ee48d[_0x105f93(0x133)],_0xf0c188=_0x5ee48d['cssUrl'];!_0x2f93e2&&!_0x5ee48d[_0x105f93(0x14c)]&&(_0x2f93e2=await askJsUrl());!_0xf0c188&&!_0x5ee48d[_0x105f93(0x14c)]&&(_0xf0c188=await askCssUrl());const _0xbce99f=await askConfirm(_0x5ee48d[_0x105f93(0x14c)]?_0x105f93(0x165)+_0x5131a0[_0x105f93(0x16a)]+_0x105f93(0x16f)+_0x5ee48d[_0x105f93(0x14c)]+'?':_0x105f93(0x165)+_0x5131a0[_0x105f93(0x16a)]+_0x105f93(0x137)+_0x2f93e2+_0x105f93(0x170)+_0xf0c188+'?');if(!_0xbce99f)return writeCliSideChannelLine(a190_0x4c8e0a['gray'](_0x105f93(0x14a))),{'ok':!![]};const _0xe53d24=[_0x2f93e2,_0xf0c188]['filter'](_0x21b739=>Boolean(_0x21b739));_0x5ee48d[_0x105f93(0x14c)]&&_0xe53d24[_0x105f93(0x16a)]===0x0&&await assertSharedResourcesConfigured(_0x297a80[_0x105f93(0x151)],_0x297a80[_0x105f93(0x144)],_0x5ee48d[_0x105f93(0x14c)]);const _0x424eb8=startSpinner(_0x105f93(0x13a)+_0x5131a0['length']+_0x105f93(0x140));try{const _0x5f0d97=_0x5131a0[_0x105f93(0x179)](_0x509bdf=>resolvePage(_0x509bdf,_0x5ee48d,_0x200d9b)),_0x2d8dec=await doCreateMenus(_0x297a80[_0x105f93(0x151)],_0x297a80[_0x105f93(0x144)],_0x5f0d97,_0xe53d24,_0x5ee48d[_0x105f93(0x14c)]?{'appName':_0x5ee48d[_0x105f93(0x14c)]}:undefined);return stopSpinner(_0x424eb8,_0x105f93(0x130)+_0x2d8dec[_0x105f93(0x146)]+_0x105f93(0x13c),!![]),{'ok':!![],'data':_0x2d8dec,'message':'Menu\x20sync\x20completed:\x20'+_0x2d8dec[_0x105f93(0x146)]+_0x105f93(0x148)+_0x2d8dec[_0x105f93(0x132)]+'\x20failed.'};}catch(_0x51dbfe){stopSpinner(_0x424eb8,_0x105f93(0x161),![]);throw CliErrors['validation'](_0x51dbfe instanceof Error?_0x51dbfe[_0x105f93(0x172)]:_0x105f93(0x161));}}};function ensureRunnableContext(_0x304f97,_0x54ecf9){const _0x15dd93=a190_0xb9417a,_0xb74320=_0x304f97[_0x15dd93(0x145)]?String(_0x304f97['appcode'])[_0x15dd93(0x14f)]():'';if(!isInProject()&&!_0x54ecf9&&!_0xb74320)throw CliErrors[_0x15dd93(0x153)](_0x15dd93(0x173)+_0x15dd93(0x142));}function a190_0x18b7(){const _0x209261=['appcode','created','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','\x20created,\x20','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','\x20\x20Cancelled.','paths','appName','2599137yhQIsY','filter','trim','12WxfDuU','appCode','Failed\x20to\x20fetch\x20online\x20menu\x20list','validation','\x20local\x20microfrontend\x20menu(s).','Fetching\x20online\x20menu\x20list...','flag','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','336208NPPhKl','string','17680650HwkGFe','12cIVDUY','onlinePaths','menu','8SBbpNL','917455xzptCU','Menu\x20creation\x20failed','Menu\x20sync\x20skipped','✓\x20Menu\x20sync\x20completed:\x20','yes','\x20\x20Create\x20','skipped','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','sync','Prefer\x20appName\x20for\x20shared\x20subapp\x20resources\x20and\x20parentId\x20for\x20planned\x20groups.\x20','length','params','Register\x20local\x20pages\x20as\x20platform\x20menus','write','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','\x20menu(s)\x20bound\x20to\x20','\x20and\x20CSS:\x20','2915030TTfrZd','message','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','targetPages','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','/smartapi/menu/create','1046567fpoOEw','rawFlags','map','2307124yTCajB','POST','Created\x20','cssUrl','failed','jsUrl','str','localPages','\x20page(s)','\x20menu(s)\x20with\x20JS:\x20','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','selectedAppName','Creating\x20','Online\x20menu\x20list\x20fetched','\x20menu(s)','yellow','onlineMenuList','\x20\x20✓\x20Selected:\x20','\x20menu(s)...','\x20created.','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','boolean','cookie'];a190_0x18b7=function(){return _0x209261;};return a190_0x18b7();}function parsePaths(_0x4e86ad){const _0x10e2fc=a190_0xb9417a;return[...new Set(_0x4e86ad['split'](',')[_0x10e2fc(0x179)](_0xf7b6df=>_0xf7b6df[_0x10e2fc(0x14f)]())[_0x10e2fc(0x14e)](Boolean))];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a191_0x501b(_0x29b1d2,_0x269f5f){_0x29b1d2=_0x29b1d2-0x6f;const _0x5c2925=a191_0x5c29();let _0x501b11=_0x5c2925[_0x29b1d2];return _0x501b11;}const a191_0x17c4b5=a191_0x501b;(function(_0x58da2d,_0x3dc40e){const _0x143b47=a191_0x501b,_0x2f5da3=_0x58da2d();while(!![]){try{const _0x2a2bac=parseInt(_0x143b47(0xa2))/0x1*(-parseInt(_0x143b47(0xe0))/0x2)+parseInt(_0x143b47(0x99))/0x3*(parseInt(_0x143b47(0x8d))/0x4)+parseInt(_0x143b47(0x6f))/0x5*(-parseInt(_0x143b47(0x83))/0x6)+parseInt(_0x143b47(0xc4))/0x7+parseInt(_0x143b47(0xee))/0x8*(parseInt(_0x143b47(0xd7))/0x9)+parseInt(_0x143b47(0xbf))/0xa+-parseInt(_0x143b47(0xc8))/0xb;if(_0x2a2bac===_0x3dc40e)break;else _0x2f5da3['push'](_0x2f5da3['shift']());}catch(_0x26f36f){_0x2f5da3['push'](_0x2f5da3['shift']());}}}(a191_0x5c29,0xcd493));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}from'../../commands/menu/shared/mutations.js';import{updateMenuEntity}from'../../commands/menu/shared/service.js';import{CliErrors}from'../../errors.js';const BACKEND=[{'method':'POST','path':a191_0x17c4b5(0xdd)}];export const menuVisibilityUpdate={'service':a191_0x17c4b5(0xdc),'command':a191_0x17c4b5(0xaf),'description':a191_0x17c4b5(0xc2),'risk':a191_0x17c4b5(0xd2),'structuredErrors':!![],'flags':[{'name':a191_0x17c4b5(0x70),'type':'string','description':a191_0x17c4b5(0x81)},{'name':a191_0x17c4b5(0xb1),'type':a191_0x17c4b5(0xdb),'description':a191_0x17c4b5(0xb9)},{'name':a191_0x17c4b5(0xce),'type':a191_0x17c4b5(0xb3),'required':!![],'description':'Requested\x20menu\x20visibility'},{'name':'expect-visible','type':a191_0x17c4b5(0xb3),'description':a191_0x17c4b5(0x94)},{'name':a191_0x17c4b5(0xae),'type':a191_0x17c4b5(0x84),'description':a191_0x17c4b5(0x93)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x205cc8){parseInput(_0x205cc8);},async 'dryRun'(_0x5d4eed){const _0x994420=a191_0x17c4b5,_0x44fd2a=await buildPlan(_0x5d4eed,!![]),_0x51298d=_0x44fd2a[_0x994420(0xcd)]['plannedActions']?.['length']??0x0,_0x3057f4=_0x44fd2a['plan'][_0x994420(0xc0)]['length']-_0x51298d;return menuDryRunResult(_0x44fd2a[_0x994420(0xcd)],{'method':'POST','url':'/smartapi/menu/update','body':{'updates':_0x44fd2a['plan'][_0x994420(0xbc)]?.[_0x994420(0x75)](_0x47fd64=>_0x47fd64[_0x994420(0xcb)])??[]},'description':'Would\x20update\x20visibility\x20for\x20'+_0x51298d+_0x994420(0x7b)+_0x3057f4+_0x994420(0xa5)});},async 'execute'(_0x112964){const _0x3e8ab7=a191_0x17c4b5,_0x5a3d2b=await buildPlan(_0x112964,![]);await recheckMutationSnapshot(_0x112964,_0x5a3d2b[_0x3e8ab7(0xcd)],_0x3e8ab7(0xc3));const _0x395a55=[],_0x317bd7=[],_0x3c9b04=[];for(const _0x547967 of _0x5a3d2b[_0x3e8ab7(0xcd)]['targets']){if(_0x547967[_0x3e8ab7(0x98)]['visible']===_0x5a3d2b[_0x3e8ab7(0xcd)]['requestedVisible']){_0x395a55[_0x3e8ab7(0xb4)]({'id':_0x547967['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0x112964['appCode'],_0x112964[_0x3e8ab7(0x90)],{'id':_0x547967['id'],'visible':_0x5a3d2b[_0x3e8ab7(0xcd)][_0x3e8ab7(0xd5)]}),_0x395a55[_0x3e8ab7(0xb4)]({'id':_0x547967['id'],'updated':!![],'skipped':![]});}catch(_0x149baf){const _0x4e5cde=mapMenuApiError(_0x149baf,_0x3e8ab7(0x79),_0x547967['id']);if(isMenuResponseLoss(_0x149baf)&&_0x4e5cde[_0x3e8ab7(0xd3)]!=='menu_permission_denied'){_0x3c9b04[_0x3e8ab7(0xb4)](_0x547967['id']);continue;}_0x317bd7[_0x3e8ab7(0xb4)]({'id':_0x547967['id'],'stage':_0x3e8ab7(0x7f),'code':_0x4e5cde['code'],'message':_0x4e5cde['message']});}}let _0x1fd726;try{_0x1fd726=await fetchMenuSnapshot(_0x112964[_0x3e8ab7(0x77)],_0x112964[_0x3e8ab7(0x90)]);}catch(_0x1ab74b){const _0x5d6ed1=describeMenuErrorCause(_0x1ab74b,_0x3e8ab7(0xcc)),_0x57be5d=_0x3c9b04[_0x3e8ab7(0x75)](_0x7c4b9d=>({'id':_0x7c4b9d,'stage':_0x3e8ab7(0x8e),'code':_0x3e8ab7(0x9c),'message':_0x3e8ab7(0x87)+_0x7c4b9d+'\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','requestedStateConfirmed':![],'recovered':![]})),_0x5a095a={'stage':'verification','code':_0x3e8ab7(0x9c),'message':_0x3e8ab7(0x86),'targetIds':_0x5a3d2b[_0x3e8ab7(0xcd)]['targets'][_0x3e8ab7(0x75)](_0x2fb4a3=>_0x2fb4a3['id']),'requestedStateConfirmed':![],..._0x5d6ed1};throw menuFailure(asVerificationError(_0x1ab74b,'Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state'),_0x5a3d2b['plan'],{'stage':'verification','succeeded':_0x395a55,'failedRecords':[..._0x317bd7,..._0x57be5d,_0x5a095a],'warnings':[_0x3e8ab7(0xba)],'verification':{'status':_0x3e8ab7(0xb2),'recoveredCount':0x0,'lookupCommand':_0x3e8ab7(0xa8)}});}const _0x58d664=[];for(const _0x2a86f6 of _0x395a55){const _0x5be086=Number(_0x2a86f6['id']),_0x42aaad=_0x5a3d2b[_0x3e8ab7(0xca)]['get'](_0x5be086),_0x520fbf=_0x1fd726['byId']['get'](_0x5be086);try{verifyVisibilityUpdate(_0x42aaad,_0x520fbf,_0x5a3d2b[_0x3e8ab7(0xcd)]['requestedVisible']);}catch(_0x4c355e){const _0x2f5194=asVerificationError(_0x4c355e,'Menu\x20'+_0x5be086+_0x3e8ab7(0xde));_0x58d664[_0x3e8ab7(0xb4)]({'id':_0x5be086,'stage':_0x3e8ab7(0x9d),'code':_0x2f5194[_0x3e8ab7(0xd3)],'message':_0x2f5194[_0x3e8ab7(0xec)],'requestedStateConfirmed':![]});}}for(const _0x231e37 of _0x3c9b04){const _0x58eedd=_0x5a3d2b['beforeById']['get'](_0x231e37),_0x5f298e=_0x1fd726['byId'][_0x3e8ab7(0xa7)](_0x231e37);try{verifyVisibilityUpdate(_0x58eedd,_0x5f298e,_0x5a3d2b[_0x3e8ab7(0xcd)][_0x3e8ab7(0xd5)]),_0x395a55[_0x3e8ab7(0xb4)]({'id':_0x231e37,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0xa3824f){const _0x369d85=asVerificationError(_0xa3824f,'Response\x20was\x20lost\x20and\x20menu\x20'+_0x231e37+_0x3e8ab7(0xac));_0x58d664[_0x3e8ab7(0xb4)]({'id':_0x231e37,'stage':'update-recovery','code':_0x369d85[_0x3e8ab7(0xd3)],'message':_0x369d85[_0x3e8ab7(0xec)],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x58d664[_0x3e8ab7(0x95)]>0x0){const _0x5760b2=_0x58d664[_0x3e8ab7(0x75)](_0x3421c3=>Number(_0x3421c3['id'])),_0x4565c6=_0x395a55['filter'](_0x25dbd9=>_0x25dbd9[_0x3e8ab7(0x82)]===!![])[_0x3e8ab7(0x95)],_0x4dab22=menuError(_0x3e8ab7(0x9c),'Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20'+_0x5760b2[_0x3e8ab7(0xad)](',\x20')+'.','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.');throw menuFailure(_0x4dab22,_0x5a3d2b[_0x3e8ab7(0xcd)],{'stage':'verification','succeeded':_0x395a55,'failedRecords':[..._0x317bd7,..._0x58d664],'warnings':[_0x3e8ab7(0xb8)],'verification':{'status':_0x3e8ab7(0xb2),..._0x5760b2[_0x3e8ab7(0x95)]===0x1?{'targetId':_0x5760b2[0x0]}:{'targetIds':_0x5760b2},'recoveredCount':_0x4565c6,'lookupCommand':'rabetbase\x20menu\x20list\x20--format\x20compress'}});}const _0x21784c=_0x395a55['filter'](_0x3a0860=>_0x3a0860['updated']===!![])['length'],_0x4f9378=_0x395a55[_0x3e8ab7(0x95)]-_0x21784c,_0x233b10={..._0x5a3d2b[_0x3e8ab7(0xcd)],'succeeded':_0x395a55,'failed':_0x317bd7,'warnings':_0x317bd7['length']>0x0?[..._0x5a3d2b[_0x3e8ab7(0xcd)]['warnings'],_0x3e8ab7(0x74)]:_0x5a3d2b[_0x3e8ab7(0xcd)][_0x3e8ab7(0xda)],'verification':{'checkedBy':_0x3e8ab7(0xc6),'snapshotHash':_0x1fd726['hash'],'matchesRequestedState':_0x317bd7[_0x3e8ab7(0x95)]===0x0,'recoveredCount':_0x3c9b04['length']}};return{'ok':_0x317bd7[_0x3e8ab7(0x95)]===0x0,'data':_0x233b10,'message':_0x317bd7[_0x3e8ab7(0x95)]===0x0?_0x3e8ab7(0x7e)+_0x21784c+_0x3e8ab7(0xaa)+_0x4f9378+'\x20unchanged\x20menu(s).':_0x3e8ab7(0x8f)+_0x21784c+_0x3e8ab7(0x7a)+_0x4f9378+_0x3e8ab7(0x7c)+_0x317bd7[_0x3e8ab7(0x95)]+_0x3e8ab7(0x8b)};}};function parseInput(_0x45e1e5){const _0x2173a2=a191_0x17c4b5,_0x411dd8=parseMenuIds(_0x45e1e5[_0x2173a2(0xab)](_0x2173a2(0x70))),_0x1c9123=parseCsv(_0x45e1e5[_0x2173a2(0xab)](_0x2173a2(0xb1)));if(_0x411dd8['length']===0x0&&_0x1c9123[_0x2173a2(0x95)]===0x0)throw CliErrors[_0x2173a2(0xc9)](_0x2173a2(0x71));const _0x6813e1=parseBooleanFlag(_0x45e1e5,_0x2173a2(0xce),!![]),_0x441ceb=parseBooleanFlag(_0x45e1e5,_0x2173a2(0xa3),![]);let _0x59c460;if(hasFlag(_0x45e1e5,_0x2173a2(0xae))){_0x59c460=_0x45e1e5[_0x2173a2(0x89)]('expected-count');if(!Number[_0x2173a2(0xe3)](_0x59c460)||_0x59c460<0x0)throw CliErrors['validation']('--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.');}return{'menuIds':_0x411dd8,'paths':_0x1c9123,'visible':_0x6813e1,'expectVisible':_0x441ceb,'expectedCount':_0x59c460};}function a191_0x5c29(){const _0x28aa9f=['menuIds','One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','Exact\x20comma-separated\x20menu\x20paths\x20to\x20update','The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.','POST','plannedActions','type','isArray','9422180GsdgdE','targets','update-menu-visibility','Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','update\x20menu\x20visibility','3125255QuACiQ','datasetId','menu\x20list','stringify','11974765CrPfAk','validation','beforeById','body','verify\x20menu\x20visibility\x20update','plan','visible','childrenCount','url','datasetCode','write','code','\x20changed\x20unexpectedly.','requestedVisible','Menu\x20id\x20selector(s)\x20not\x20found:\x20','4365rZmluD','depth','modelType','warnings','string','menu','/smartapi/menu/update','\x20visibility\x20update\x20could\x20not\x20be\x20verified','\x20menu(s),\x20expected\x20','42ojhEjC','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.','false','isSafeInteger','\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20','values','Menu\x20','pageType','hash','\x20must\x20be\x20true\x20or\x20false.','resources','message','trim','23944uEpEOB','3495jSEMjP','menu-ids','menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.','expectVisible','Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','map','parentId','appCode','path','update\x20visibility\x20for','\x20updated,\x20','\x20menu(s);\x20skip\x20','\x20skipped,\x20','pageId','Updated\x20visibility\x20for\x20','update','menu_selector_ambiguous','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','recovered','294wjZXhL','number','Selected\x20','Final\x20menu\x20visibility\x20readback\x20failed.','Response\x20was\x20lost\x20for\x20menu\x20','filter','num','Menu\x20path\x20selector\x20not\x20found:\x20','\x20failed.','expectedCount','8SoeErE','update-recovery','Menu\x20visibility\x20update\x20completed:\x20','cookie','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.','flagMissing','Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches','Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility','length','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','menu_expected_count_mismatch','before','1093539OGIxVz','menu_selector_not_found','some','menu_verification_failed','verification','has','set','sort','childrenIds','76457rPLYMr','expect-visible','resourcesValid','\x20unchanged\x20menu(s).','split','get','rabetbase\x20menu\x20list\x20--format\x20compress','\x20was\x20not\x20found\x20during\x20visibility\x20verification.','\x20menu(s);\x20skipped\x20','str','\x20visibility\x20could\x20not\x20be\x20verified\x20safely','join','expected-count','visibility-update','label','paths','failed','boolean','push','Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.','rawFlags'];a191_0x5c29=function(){return _0x28aa9f;};return a191_0x5c29();}async function buildPlan(_0x268837,_0x542402){const _0x26d76c=a191_0x17c4b5,_0x434ee1=parseInput(_0x268837),_0x1414e6=await fetchMutationSnapshot(_0x268837,_0x26d76c(0xc3)),_0x22b464=selectTargets(_0x1414e6['menus'],_0x434ee1[_0x26d76c(0xb7)],_0x434ee1[_0x26d76c(0xb1)]);if(_0x434ee1[_0x26d76c(0x8c)]!==undefined&&_0x22b464[_0x26d76c(0x95)]!==_0x434ee1[_0x26d76c(0x8c)])throw menuError(_0x26d76c(0x97),_0x26d76c(0x85)+_0x22b464[_0x26d76c(0x95)]+_0x26d76c(0xdf)+_0x434ee1[_0x26d76c(0x8c)]+'.',_0x26d76c(0xe1));if(_0x434ee1[_0x26d76c(0x73)]!==undefined){const _0x2670eb=_0x22b464[_0x26d76c(0x88)](_0xc1d22a=>_0xc1d22a['visible']!==_0x434ee1[_0x26d76c(0x73)]);if(_0x2670eb[_0x26d76c(0x95)]>0x0)throw menuError('menu_state_drift','Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20'+_0x2670eb['map'](_0x4af7fd=>_0x4af7fd['id'])[_0x26d76c(0xad)](',\x20')+'.',_0x26d76c(0x91));}const _0x2ca9cd=_0x22b464[_0x26d76c(0x75)](_0x380e8=>({'id':_0x380e8['id'],'label':_0x380e8[_0x26d76c(0xb0)],'path':_0x380e8['path'],'before':{'visible':_0x380e8[_0x26d76c(0xce)]},'after':{'visible':_0x434ee1[_0x26d76c(0xce)]}})),_0x1f9e64=_0x2ca9cd['filter'](_0x484d75=>_0x484d75[_0x26d76c(0x98)][_0x26d76c(0xce)]!==_0x434ee1['visible'])['map'](_0x2ecb0c=>({'stage':_0x26d76c(0xc1),'method':_0x26d76c(0xbb),'path':'/smartapi/menu/update','body':{'appCode':_0x268837['appCode'],'id':_0x2ecb0c['id'],'visible':_0x434ee1[_0x26d76c(0xce)]}})),_0x4b016b=mutationResult({'operation':_0x26d76c(0xaf),'selector':{'menuIds':_0x434ee1[_0x26d76c(0xb7)],'paths':_0x434ee1[_0x26d76c(0xb1)]},'before':{'menus':_0x22b464['map'](_0x2b44df=>({'id':_0x2b44df['id'],'path':_0x2b44df[_0x26d76c(0x78)],'visible':_0x2b44df[_0x26d76c(0xce)]}))},'after':{'menus':_0x22b464[_0x26d76c(0x75)](_0x1dd86f=>({'id':_0x1dd86f['id'],'path':_0x1dd86f[_0x26d76c(0x78)],'visible':_0x434ee1['visible']}))},'dryRun':_0x542402,'backend':[...BACKEND],'plannedActions':_0x1f9e64,'snapshotHash':_0x1414e6[_0x26d76c(0xe9)],'warnings':_0x1f9e64[_0x26d76c(0x95)]===0x0?[_0x26d76c(0xb5)]:[]});return{'plan':{..._0x4b016b,'requestedVisible':_0x434ee1['visible'],'targets':_0x2ca9cd},'beforeById':new Map(_0x22b464[_0x26d76c(0x75)](_0x4dcee3=>[_0x4dcee3['id'],_0x4dcee3]))};}function selectTargets(_0x49e29a,_0x104dfb,_0x2ebf5b){const _0x48319d=a191_0x17c4b5,_0x1f412d=new Map(_0x49e29a[_0x48319d(0x75)](_0x586227=>[_0x586227['id'],_0x586227])),_0x219767=new Map(),_0x54041b=_0x104dfb[_0x48319d(0x88)](_0x5ebcc7=>!_0x1f412d[_0x48319d(0x9e)](_0x5ebcc7));if(_0x54041b[_0x48319d(0x95)]>0x0)throw menuError(_0x48319d(0x9a),_0x48319d(0xd6)+_0x54041b[_0x48319d(0xad)](',\x20')+'.',_0x48319d(0x72));for(const _0x58ccc6 of _0x104dfb){_0x219767[_0x48319d(0x9f)](_0x58ccc6,_0x1f412d[_0x48319d(0xa7)](_0x58ccc6));}for(const _0x10f239 of _0x2ebf5b){const _0x2a4ee3=_0x49e29a[_0x48319d(0x88)](_0x18ef71=>_0x18ef71[_0x48319d(0x78)]===_0x10f239);if(_0x2a4ee3[_0x48319d(0x95)]===0x0)throw menuError(_0x48319d(0x9a),_0x48319d(0x8a)+JSON[_0x48319d(0xc7)](_0x10f239)+'.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.');if(_0x2a4ee3[_0x48319d(0x95)]>0x1)throw menuError(_0x48319d(0x80),'Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20'+JSON[_0x48319d(0xc7)](_0x10f239)+'.',_0x48319d(0xe5)+_0x2a4ee3[_0x48319d(0x75)](_0x5736ca=>_0x5736ca['id'])[_0x48319d(0xad)](',\x20')+'.');const _0x1da162=_0x2a4ee3[0x0];_0x219767[_0x48319d(0x9f)](_0x1da162['id'],_0x1da162);}return[..._0x219767[_0x48319d(0xe6)]()];}function parseMenuIds(_0x1078fe){const _0x55ce38=a191_0x17c4b5,_0x9839be=parseCsv(_0x1078fe),_0x1a5025=_0x9839be[_0x55ce38(0x75)](Number);if(_0x1a5025[_0x55ce38(0x9b)](_0x1166c8=>!Number[_0x55ce38(0xe3)](_0x1166c8)||_0x1166c8<=0x0))throw CliErrors[_0x55ce38(0xc9)](_0x55ce38(0x96));return[...new Set(_0x1a5025)];}function parseCsv(_0x586c05){const _0x5d72bb=a191_0x17c4b5;return[...new Set(_0x586c05[_0x5d72bb(0xa6)](',')[_0x5d72bb(0x75)](_0x49fca4=>_0x49fca4[_0x5d72bb(0xed)]())[_0x5d72bb(0x88)](Boolean))];}function parseBooleanFlag(_0x2d798f,_0x1c8e87,_0x1a2350){const _0x2fb801=a191_0x17c4b5;if(!hasFlag(_0x2d798f,_0x1c8e87)){if(_0x1a2350)throw CliErrors[_0x2fb801(0x92)](_0x1c8e87);return undefined;}const _0x5a8b5e=_0x2d798f[_0x2fb801(0xb6)][_0x1c8e87];if(_0x5a8b5e===!![]||_0x5a8b5e===![])return _0x5a8b5e;if(_0x5a8b5e==='true')return!![];if(_0x5a8b5e===_0x2fb801(0xe2))return![];throw CliErrors[_0x2fb801(0xc9)]('--'+_0x1c8e87+_0x2fb801(0xea));}function verifyVisibilityUpdate(_0x3326be,_0xa130ee,_0x26b375){const _0x354e55=a191_0x17c4b5;assertVerified(!!_0xa130ee,'Menu\x20'+_0x3326be['id']+_0x354e55(0xa9)),assertVerified(_0xa130ee[_0x354e55(0xce)]===_0x26b375,_0x354e55(0xe7)+_0x3326be['id']+_0x354e55(0xe4));const _0x2a743b=[['id',_0xa130ee['id'],_0x3326be['id']],[_0x354e55(0x76),_0xa130ee[_0x354e55(0x76)],_0x3326be[_0x354e55(0x76)]],[_0x354e55(0xd8),_0xa130ee[_0x354e55(0xd8)],_0x3326be[_0x354e55(0xd8)]],[_0x354e55(0xb0),_0xa130ee[_0x354e55(0xb0)],_0x3326be[_0x354e55(0xb0)]],['path',_0xa130ee['path'],_0x3326be[_0x354e55(0x78)]],[_0x354e55(0xd0),_0xa130ee[_0x354e55(0xd0)],_0x3326be[_0x354e55(0xd0)]],[_0x354e55(0xbd),_0xa130ee[_0x354e55(0xbd)],_0x3326be[_0x354e55(0xbd)]],['sort',_0xa130ee[_0x354e55(0xa0)],_0x3326be['sort']],['resources',_0xa130ee['resources'],_0x3326be[_0x354e55(0xeb)]],['resourcesValid',_0xa130ee[_0x354e55(0xa4)],_0x3326be[_0x354e55(0xa4)]],[_0x354e55(0xa1),_0xa130ee[_0x354e55(0xa1)],_0x3326be[_0x354e55(0xa1)]],['childrenCount',_0xa130ee['childrenCount'],_0x3326be[_0x354e55(0xcf)]],[_0x354e55(0x7d),_0xa130ee['pageId'],_0x3326be[_0x354e55(0x7d)]],['pageType',_0xa130ee[_0x354e55(0xe8)],_0x3326be[_0x354e55(0xe8)]],[_0x354e55(0xd9),_0xa130ee[_0x354e55(0xd9)],_0x3326be[_0x354e55(0xd9)]],[_0x354e55(0xc5),_0xa130ee['datasetId'],_0x3326be['datasetId']],['datasetCode',_0xa130ee['datasetCode'],_0x3326be[_0x354e55(0xd1)]]];for(const [_0x46f4d0,_0x7f1d83,_0x234551]of _0x2a743b){assertVerified(sameValue(_0x7f1d83,_0x234551),'Menu\x20'+_0x3326be['id']+'\x20'+_0x46f4d0+_0x354e55(0xd4));}}function sameValue(_0x4987ad,_0x632817){const _0x3778c7=a191_0x17c4b5;if(Array[_0x3778c7(0xbe)](_0x4987ad)||Array['isArray'](_0x632817))return JSON[_0x3778c7(0xc7)](_0x4987ad)===JSON['stringify'](_0x632817);return _0x4987ad===_0x632817;}
|
|
1
|
+
const a191_0x5e6a12=a191_0x4a5e;(function(_0x5033b0,_0x4376c8){const _0x20830f=a191_0x4a5e,_0x3185a2=_0x5033b0();while(!![]){try{const _0x5cb63f=parseInt(_0x20830f(0x19f))/0x1*(-parseInt(_0x20830f(0x178))/0x2)+-parseInt(_0x20830f(0x1dc))/0x3+parseInt(_0x20830f(0x1b8))/0x4+-parseInt(_0x20830f(0x1ce))/0x5+parseInt(_0x20830f(0x19d))/0x6+-parseInt(_0x20830f(0x1c7))/0x7*(-parseInt(_0x20830f(0x1a0))/0x8)+parseInt(_0x20830f(0x199))/0x9;if(_0x5cb63f===_0x4376c8)break;else _0x3185a2['push'](_0x3185a2['shift']());}catch(_0x1c0573){_0x3185a2['push'](_0x3185a2['shift']());}}}(a191_0xbe67,0x98908));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a191_0xbe67(){const _0x225ebf=['cookie','resourcesValid','plannedActions','menu_permission_denied','boolean','byId','\x20failed.','pageId','pageType','Exact\x20comma-separated\x20menu\x20paths\x20to\x20update','\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.','menu-ids','verification','menuIds','childrenCount','menu','Response\x20was\x20lost\x20and\x20menu\x20','split','paths','\x20menu(s);\x20skip\x20','label','updated','hash','rabetbase\x20menu\x20list\x20--format\x20compress','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.','set','640292WMFzUB','resources','Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20','expectedCount','update\x20visibility\x20for','Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility','path','update','Menu\x20id\x20selector(s)\x20not\x20found:\x20','stringify','Menu\x20visibility\x20update\x20completed:\x20','Final\x20menu\x20visibility\x20readback\x20failed.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.','Menu\x20','recovered','has','code','requestedVisible','\x20menu(s),\x20expected\x20','expected-count','length','menu\x20list','str','warnings','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20','--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.','menu_state_drift','\x20updated,\x20','map','message','menus','join','menu_selector_ambiguous','7235235xHgKuk','type','update-recovery','Menu\x20path\x20selector\x20not\x20found:\x20','4728738HorbTy','Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20','3VmJomM','16elNxAW','get','expectVisible','isArray','sort','Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','menu_verification_failed','Response\x20was\x20lost\x20for\x20menu\x20','\x20must\x20be\x20true\x20or\x20false.','modelType','menu_expected_count_mismatch','datasetCode','true','number','visibility-update','plan','Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches','datasetId','failed','Would\x20update\x20visibility\x20for\x20','trim','string','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.','2034188uTzyFp','expect-visible','some','body','/smartapi/menu/update','Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','POST','rawFlags','filter','write','\x20skipped,\x20','verify\x20menu\x20visibility\x20update','targets','beforeById','58163daKHla','menu_selector_not_found','Selected\x20','flagMissing','before','update\x20menu\x20visibility','push','2288900hxFsqt','\x20unchanged\x20menu(s).','One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.','values','validation','appCode','isSafeInteger','url','depth','childrenIds','visible','parentId','\x20visibility\x20update\x20could\x20not\x20be\x20verified','222243QUahAW'];a191_0xbe67=function(){return _0x225ebf;};return a191_0xbe67();}function a191_0x4a5e(_0x158d66,_0x530721){_0x158d66=_0x158d66-0x162;const _0xbe678e=a191_0xbe67();let _0x4a5ebf=_0xbe678e[_0x158d66];return _0x4a5ebf;}import{fetchMenuSnapshot}from'../../commands/menu/shared/facts.js';import{asVerificationError,assertVerified,describeMenuErrorCause,fetchMutationSnapshot,hasFlag,isMenuResponseLoss,mapMenuApiError,menuDryRunResult,menuError,menuFailure,mutationResult,recheckMutationSnapshot}from'../../commands/menu/shared/mutations.js';import{updateMenuEntity}from'../../commands/menu/shared/service.js';import{CliErrors}from'../../errors.js';const BACKEND=[{'method':a191_0x5e6a12(0x1bf),'path':a191_0x5e6a12(0x1bc)}];export const menuVisibilityUpdate={'service':a191_0x5e6a12(0x16d),'command':a191_0x5e6a12(0x1ae),'description':'Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','risk':a191_0x5e6a12(0x1c2),'structuredErrors':!![],'flags':[{'name':'menu-ids','type':a191_0x5e6a12(0x1b5),'description':a191_0x5e6a12(0x1b6)},{'name':a191_0x5e6a12(0x170),'type':a191_0x5e6a12(0x1b5),'description':a191_0x5e6a12(0x167)},{'name':a191_0x5e6a12(0x1d9),'type':'boolean','required':!![],'description':'Requested\x20menu\x20visibility'},{'name':a191_0x5e6a12(0x1b9),'type':a191_0x5e6a12(0x162),'description':a191_0x5e6a12(0x17d)},{'name':a191_0x5e6a12(0x18b),'type':a191_0x5e6a12(0x1ad),'description':a191_0x5e6a12(0x1b0)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3aefde){parseInput(_0x3aefde);},async 'dryRun'(_0x4b96fa){const _0x4299e9=a191_0x5e6a12,_0x59b7ff=await buildPlan(_0x4b96fa,!![]),_0x2e4132=_0x59b7ff[_0x4299e9(0x1af)][_0x4299e9(0x1df)]?.[_0x4299e9(0x18c)]??0x0,_0x597160=_0x59b7ff[_0x4299e9(0x1af)][_0x4299e9(0x1c5)][_0x4299e9(0x18c)]-_0x2e4132;return menuDryRunResult(_0x59b7ff[_0x4299e9(0x1af)],{'method':'POST','url':'/smartapi/menu/update','body':{'updates':_0x59b7ff[_0x4299e9(0x1af)][_0x4299e9(0x1df)]?.['map'](_0x13a5a0=>_0x13a5a0[_0x4299e9(0x1bb)])??[]},'description':_0x4299e9(0x1b3)+_0x2e4132+_0x4299e9(0x171)+_0x597160+_0x4299e9(0x1cf)});},async 'execute'(_0x2ce898){const _0x4d062f=a191_0x5e6a12,_0xb77a34=await buildPlan(_0x2ce898,![]);await recheckMutationSnapshot(_0x2ce898,_0xb77a34['plan'],_0x4d062f(0x1cc));const _0x1ecaf5=[],_0x4283ab=[],_0x2b4979=[];for(const _0x4c98ef of _0xb77a34[_0x4d062f(0x1af)][_0x4d062f(0x1c5)]){if(_0x4c98ef[_0x4d062f(0x1cb)][_0x4d062f(0x1d9)]===_0xb77a34['plan'][_0x4d062f(0x189)]){_0x1ecaf5[_0x4d062f(0x1cd)]({'id':_0x4c98ef['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0x2ce898[_0x4d062f(0x1d4)],_0x2ce898[_0x4d062f(0x1dd)],{'id':_0x4c98ef['id'],'visible':_0xb77a34[_0x4d062f(0x1af)][_0x4d062f(0x189)]}),_0x1ecaf5[_0x4d062f(0x1cd)]({'id':_0x4c98ef['id'],'updated':!![],'skipped':![]});}catch(_0x19b94f){const _0x525b02=mapMenuApiError(_0x19b94f,_0x4d062f(0x17c),_0x4c98ef['id']);if(isMenuResponseLoss(_0x19b94f)&&_0x525b02[_0x4d062f(0x188)]!==_0x4d062f(0x1e0)){_0x2b4979[_0x4d062f(0x1cd)](_0x4c98ef['id']);continue;}_0x4283ab[_0x4d062f(0x1cd)]({'id':_0x4c98ef['id'],'stage':_0x4d062f(0x17f),'code':_0x525b02[_0x4d062f(0x188)],'message':_0x525b02[_0x4d062f(0x195)]});}}let _0x56111c;try{_0x56111c=await fetchMenuSnapshot(_0x2ce898[_0x4d062f(0x1d4)],_0x2ce898['cookie']);}catch(_0xc2426){const _0x41e70c=describeMenuErrorCause(_0xc2426,_0x4d062f(0x1c4)),_0x39c025=_0x2b4979[_0x4d062f(0x194)](_0x334e20=>({'id':_0x334e20,'stage':_0x4d062f(0x19b),'code':_0x4d062f(0x1a6),'message':_0x4d062f(0x1a7)+_0x334e20+'\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','requestedStateConfirmed':![],'recovered':![]})),_0x8cf39c={'stage':'verification','code':_0x4d062f(0x1a6),'message':_0x4d062f(0x183),'targetIds':_0xb77a34[_0x4d062f(0x1af)][_0x4d062f(0x1c5)][_0x4d062f(0x194)](_0x429732=>_0x429732['id']),'requestedStateConfirmed':![],..._0x41e70c};throw menuFailure(asVerificationError(_0xc2426,_0x4d062f(0x1bd)),_0xb77a34[_0x4d062f(0x1af)],{'stage':_0x4d062f(0x16a),'succeeded':_0x1ecaf5,'failedRecords':[..._0x4283ab,..._0x39c025,_0x8cf39c],'warnings':['The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.'],'verification':{'status':_0x4d062f(0x1b2),'recoveredCount':0x0,'lookupCommand':_0x4d062f(0x175)}});}const _0x119393=[];for(const _0x4abbaf of _0x1ecaf5){const _0x46f727=Number(_0x4abbaf['id']),_0x2d242a=_0xb77a34[_0x4d062f(0x1c6)][_0x4d062f(0x1a1)](_0x46f727),_0xc6e2f3=_0x56111c[_0x4d062f(0x163)][_0x4d062f(0x1a1)](_0x46f727);try{verifyVisibilityUpdate(_0x2d242a,_0xc6e2f3,_0xb77a34['plan']['requestedVisible']);}catch(_0xe500a9){const _0x116bb8=asVerificationError(_0xe500a9,'Menu\x20'+_0x46f727+_0x4d062f(0x1db));_0x119393[_0x4d062f(0x1cd)]({'id':_0x46f727,'stage':_0x4d062f(0x16a),'code':_0x116bb8[_0x4d062f(0x188)],'message':_0x116bb8['message'],'requestedStateConfirmed':![]});}}for(const _0x52932d of _0x2b4979){const _0x4bee2f=_0xb77a34[_0x4d062f(0x1c6)][_0x4d062f(0x1a1)](_0x52932d),_0x5607a7=_0x56111c['byId'][_0x4d062f(0x1a1)](_0x52932d);try{verifyVisibilityUpdate(_0x4bee2f,_0x5607a7,_0xb77a34['plan'][_0x4d062f(0x189)]),_0x1ecaf5[_0x4d062f(0x1cd)]({'id':_0x52932d,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0x55c39a){const _0x9f1ccc=asVerificationError(_0x55c39a,_0x4d062f(0x16e)+_0x52932d+'\x20visibility\x20could\x20not\x20be\x20verified\x20safely');_0x119393['push']({'id':_0x52932d,'stage':_0x4d062f(0x19b),'code':_0x9f1ccc['code'],'message':_0x9f1ccc[_0x4d062f(0x195)],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x119393[_0x4d062f(0x18c)]>0x0){const _0x1b19d6=_0x119393['map'](_0x3f51b9=>Number(_0x3f51b9['id'])),_0x25960b=_0x1ecaf5[_0x4d062f(0x1c1)](_0x3ef50b=>_0x3ef50b[_0x4d062f(0x186)]===!![])[_0x4d062f(0x18c)],_0x25cc3e=menuError(_0x4d062f(0x1a6),'Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20'+_0x1b19d6[_0x4d062f(0x197)](',\x20')+'.',_0x4d062f(0x176));throw menuFailure(_0x25cc3e,_0xb77a34[_0x4d062f(0x1af)],{'stage':_0x4d062f(0x16a),'succeeded':_0x1ecaf5,'failedRecords':[..._0x4283ab,..._0x119393],'warnings':[_0x4d062f(0x1d0)],'verification':{'status':_0x4d062f(0x1b2),..._0x1b19d6['length']===0x1?{'targetId':_0x1b19d6[0x0]}:{'targetIds':_0x1b19d6},'recoveredCount':_0x25960b,'lookupCommand':_0x4d062f(0x175)}});}const _0x3a9813=_0x1ecaf5[_0x4d062f(0x1c1)](_0x153c6b=>_0x153c6b[_0x4d062f(0x173)]===!![])[_0x4d062f(0x18c)],_0x33465b=_0x1ecaf5[_0x4d062f(0x18c)]-_0x3a9813,_0x5a34f8={..._0xb77a34['plan'],'succeeded':_0x1ecaf5,'failed':_0x4283ab,'warnings':_0x4283ab[_0x4d062f(0x18c)]>0x0?[..._0xb77a34['plan'][_0x4d062f(0x18f)],_0x4d062f(0x1a5)]:_0xb77a34[_0x4d062f(0x1af)][_0x4d062f(0x18f)],'verification':{'checkedBy':_0x4d062f(0x18d),'snapshotHash':_0x56111c[_0x4d062f(0x174)],'matchesRequestedState':_0x4283ab[_0x4d062f(0x18c)]===0x0,'recoveredCount':_0x2b4979['length']}};return{'ok':_0x4283ab[_0x4d062f(0x18c)]===0x0,'data':_0x5a34f8,'message':_0x4283ab['length']===0x0?'Updated\x20visibility\x20for\x20'+_0x3a9813+'\x20menu(s);\x20skipped\x20'+_0x33465b+'\x20unchanged\x20menu(s).':_0x4d062f(0x182)+_0x3a9813+_0x4d062f(0x193)+_0x33465b+_0x4d062f(0x1c3)+_0x4283ab[_0x4d062f(0x18c)]+_0x4d062f(0x164)};}};function parseInput(_0x41b1f0){const _0x23f306=a191_0x5e6a12,_0xce1704=parseMenuIds(_0x41b1f0[_0x23f306(0x18e)](_0x23f306(0x169))),_0x57aebc=parseCsv(_0x41b1f0[_0x23f306(0x18e)](_0x23f306(0x170)));if(_0xce1704[_0x23f306(0x18c)]===0x0&&_0x57aebc[_0x23f306(0x18c)]===0x0)throw CliErrors[_0x23f306(0x1d3)]('menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.');const _0x548452=parseBooleanFlag(_0x41b1f0,_0x23f306(0x1d9),!![]),_0x2e6618=parseBooleanFlag(_0x41b1f0,_0x23f306(0x1b9),![]);let _0x3a412a;if(hasFlag(_0x41b1f0,_0x23f306(0x18b))){_0x3a412a=_0x41b1f0['num'](_0x23f306(0x18b));if(!Number['isSafeInteger'](_0x3a412a)||_0x3a412a<0x0)throw CliErrors[_0x23f306(0x1d3)](_0x23f306(0x191));}return{'menuIds':_0xce1704,'paths':_0x57aebc,'visible':_0x548452,'expectVisible':_0x2e6618,'expectedCount':_0x3a412a};}async function buildPlan(_0x4779d8,_0x4738c3){const _0x448620=a191_0x5e6a12,_0x46c616=parseInput(_0x4779d8),_0x443dad=await fetchMutationSnapshot(_0x4779d8,_0x448620(0x1cc)),_0x2cea96=selectTargets(_0x443dad[_0x448620(0x196)],_0x46c616['menuIds'],_0x46c616[_0x448620(0x170)]);if(_0x46c616[_0x448620(0x17b)]!==undefined&&_0x2cea96['length']!==_0x46c616[_0x448620(0x17b)])throw menuError(_0x448620(0x1aa),_0x448620(0x1c9)+_0x2cea96['length']+_0x448620(0x18a)+_0x46c616[_0x448620(0x17b)]+'.',_0x448620(0x1b7));if(_0x46c616[_0x448620(0x1a2)]!==undefined){const _0x469c37=_0x2cea96[_0x448620(0x1c1)](_0x192c57=>_0x192c57['visible']!==_0x46c616[_0x448620(0x1a2)]);if(_0x469c37['length']>0x0)throw menuError(_0x448620(0x192),_0x448620(0x17a)+_0x469c37['map'](_0x2b6f48=>_0x2b6f48['id'])[_0x448620(0x197)](',\x20')+'.','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.');}const _0x565bc0=_0x2cea96[_0x448620(0x194)](_0x1ae733=>({'id':_0x1ae733['id'],'label':_0x1ae733['label'],'path':_0x1ae733['path'],'before':{'visible':_0x1ae733[_0x448620(0x1d9)]},'after':{'visible':_0x46c616[_0x448620(0x1d9)]}})),_0x1efd96=_0x565bc0[_0x448620(0x1c1)](_0x1c5a7a=>_0x1c5a7a[_0x448620(0x1cb)][_0x448620(0x1d9)]!==_0x46c616[_0x448620(0x1d9)])[_0x448620(0x194)](_0xf6a801=>({'stage':'update-menu-visibility','method':_0x448620(0x1bf),'path':_0x448620(0x1bc),'body':{'appCode':_0x4779d8[_0x448620(0x1d4)],'id':_0xf6a801['id'],'visible':_0x46c616[_0x448620(0x1d9)]}})),_0x49e520=mutationResult({'operation':'visibility-update','selector':{'menuIds':_0x46c616[_0x448620(0x16b)],'paths':_0x46c616['paths']},'before':{'menus':_0x2cea96[_0x448620(0x194)](_0x241274=>({'id':_0x241274['id'],'path':_0x241274[_0x448620(0x17e)],'visible':_0x241274[_0x448620(0x1d9)]}))},'after':{'menus':_0x2cea96['map'](_0x5bb820=>({'id':_0x5bb820['id'],'path':_0x5bb820['path'],'visible':_0x46c616[_0x448620(0x1d9)]}))},'dryRun':_0x4738c3,'backend':[...BACKEND],'plannedActions':_0x1efd96,'snapshotHash':_0x443dad[_0x448620(0x174)],'warnings':_0x1efd96[_0x448620(0x18c)]===0x0?['Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.']:[]});return{'plan':{..._0x49e520,'requestedVisible':_0x46c616[_0x448620(0x1d9)],'targets':_0x565bc0},'beforeById':new Map(_0x2cea96[_0x448620(0x194)](_0x3b00a9=>[_0x3b00a9['id'],_0x3b00a9]))};}function selectTargets(_0x389724,_0x54c46d,_0x36c102){const _0x328824=a191_0x5e6a12,_0x3da0e4=new Map(_0x389724[_0x328824(0x194)](_0x1385fb=>[_0x1385fb['id'],_0x1385fb])),_0x5c969b=new Map(),_0x13327b=_0x54c46d[_0x328824(0x1c1)](_0x11716e=>!_0x3da0e4[_0x328824(0x187)](_0x11716e));if(_0x13327b[_0x328824(0x18c)]>0x0)throw menuError(_0x328824(0x1c8),_0x328824(0x180)+_0x13327b['join'](',\x20')+'.',_0x328824(0x184));for(const _0x55fd61 of _0x54c46d){_0x5c969b[_0x328824(0x177)](_0x55fd61,_0x3da0e4[_0x328824(0x1a1)](_0x55fd61));}for(const _0x5283b2 of _0x36c102){const _0x472f0c=_0x389724['filter'](_0x12922b=>_0x12922b[_0x328824(0x17e)]===_0x5283b2);if(_0x472f0c['length']===0x0)throw menuError(_0x328824(0x1c8),_0x328824(0x19c)+JSON[_0x328824(0x181)](_0x5283b2)+'.',_0x328824(0x1d1));if(_0x472f0c[_0x328824(0x18c)]>0x1)throw menuError(_0x328824(0x198),_0x328824(0x19e)+JSON[_0x328824(0x181)](_0x5283b2)+'.',_0x328824(0x190)+_0x472f0c['map'](_0x28ebc6=>_0x28ebc6['id'])[_0x328824(0x197)](',\x20')+'.');const _0x391e59=_0x472f0c[0x0];_0x5c969b[_0x328824(0x177)](_0x391e59['id'],_0x391e59);}return[..._0x5c969b[_0x328824(0x1d2)]()];}function parseMenuIds(_0x593c94){const _0x4ac829=a191_0x5e6a12,_0x110090=parseCsv(_0x593c94),_0x355a90=_0x110090[_0x4ac829(0x194)](Number);if(_0x355a90[_0x4ac829(0x1ba)](_0x2e927b=>!Number[_0x4ac829(0x1d5)](_0x2e927b)||_0x2e927b<=0x0))throw CliErrors[_0x4ac829(0x1d3)](_0x4ac829(0x1be));return[...new Set(_0x355a90)];}function parseCsv(_0x34c720){const _0x5ebba5=a191_0x5e6a12;return[...new Set(_0x34c720[_0x5ebba5(0x16f)](',')[_0x5ebba5(0x194)](_0x59da20=>_0x59da20[_0x5ebba5(0x1b4)]())[_0x5ebba5(0x1c1)](Boolean))];}function parseBooleanFlag(_0x31b04d,_0x23786a,_0x416695){const _0x3eb18e=a191_0x5e6a12;if(!hasFlag(_0x31b04d,_0x23786a)){if(_0x416695)throw CliErrors[_0x3eb18e(0x1ca)](_0x23786a);return undefined;}const _0x136424=_0x31b04d[_0x3eb18e(0x1c0)][_0x23786a];if(_0x136424===!![]||_0x136424===![])return _0x136424;if(_0x136424===_0x3eb18e(0x1ac))return!![];if(_0x136424==='false')return![];throw CliErrors['validation']('--'+_0x23786a+_0x3eb18e(0x1a8));}function verifyVisibilityUpdate(_0x178141,_0xdf922a,_0x5f1cec){const _0x2347b7=a191_0x5e6a12;assertVerified(!!_0xdf922a,_0x2347b7(0x185)+_0x178141['id']+'\x20was\x20not\x20found\x20during\x20visibility\x20verification.'),assertVerified(_0xdf922a['visible']===_0x5f1cec,_0x2347b7(0x185)+_0x178141['id']+_0x2347b7(0x168));const _0x18c74f=[['id',_0xdf922a['id'],_0x178141['id']],[_0x2347b7(0x1da),_0xdf922a[_0x2347b7(0x1da)],_0x178141[_0x2347b7(0x1da)]],[_0x2347b7(0x1d7),_0xdf922a[_0x2347b7(0x1d7)],_0x178141['depth']],[_0x2347b7(0x172),_0xdf922a[_0x2347b7(0x172)],_0x178141[_0x2347b7(0x172)]],[_0x2347b7(0x17e),_0xdf922a[_0x2347b7(0x17e)],_0x178141['path']],[_0x2347b7(0x1d6),_0xdf922a[_0x2347b7(0x1d6)],_0x178141[_0x2347b7(0x1d6)]],[_0x2347b7(0x19a),_0xdf922a[_0x2347b7(0x19a)],_0x178141[_0x2347b7(0x19a)]],[_0x2347b7(0x1a4),_0xdf922a[_0x2347b7(0x1a4)],_0x178141[_0x2347b7(0x1a4)]],['resources',_0xdf922a[_0x2347b7(0x179)],_0x178141[_0x2347b7(0x179)]],['resourcesValid',_0xdf922a[_0x2347b7(0x1de)],_0x178141[_0x2347b7(0x1de)]],[_0x2347b7(0x1d8),_0xdf922a['childrenIds'],_0x178141[_0x2347b7(0x1d8)]],['childrenCount',_0xdf922a[_0x2347b7(0x16c)],_0x178141['childrenCount']],[_0x2347b7(0x165),_0xdf922a['pageId'],_0x178141[_0x2347b7(0x165)]],['pageType',_0xdf922a[_0x2347b7(0x166)],_0x178141[_0x2347b7(0x166)]],[_0x2347b7(0x1a9),_0xdf922a[_0x2347b7(0x1a9)],_0x178141[_0x2347b7(0x1a9)]],[_0x2347b7(0x1b1),_0xdf922a[_0x2347b7(0x1b1)],_0x178141['datasetId']],[_0x2347b7(0x1ab),_0xdf922a[_0x2347b7(0x1ab)],_0x178141[_0x2347b7(0x1ab)]]];for(const [_0x234174,_0x39a5f8,_0x1ca580]of _0x18c74f){assertVerified(sameValue(_0x39a5f8,_0x1ca580),_0x2347b7(0x185)+_0x178141['id']+'\x20'+_0x234174+'\x20changed\x20unexpectedly.');}}function sameValue(_0x3d90a6,_0x27322a){const _0x29dbb3=a191_0x5e6a12;if(Array[_0x29dbb3(0x1a3)](_0x3d90a6)||Array[_0x29dbb3(0x1a3)](_0x27322a))return JSON[_0x29dbb3(0x181)](_0x3d90a6)===JSON[_0x29dbb3(0x181)](_0x27322a);return _0x3d90a6===_0x27322a;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a192_0xab5d(){const _0x591680=['notification',';\x20do\x20not\x20resubmit\x20automatically.','POST','planned','9wvGfnt','channelConfig','6veUDQz','130mXjpoH','verified','Create\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20source','channelType','8284445idPgar','notification_config_create_outcome_unknown','readTimeout','mutation','161gGzWjI','create',';\x20do\x20not\x20resubmit.','document','5tESzug','485656LrxWhw','2069016sVeuEh','/notification/channel-config/create','isSafeInteger','599005CAfcUO','description','verification','29510844tuKDfb','endpointUrl','Notification\x20config\x20create\x20outcome\x20is\x20unknown\x20because\x20no\x20server\x20ID\x20was\x20received.','appCode','13PxBdHy','8202879rAmSVQ','723950lmkOCM','input','Notification\x20config\x20create\x20returned\x20no\x20usable\x20server\x20ID.','Inspect\x20with\x20','configName'];a192_0xab5d=function(){return _0x591680;};return a192_0xab5d();}const a192_0x42e5a3=a192_0x1125;(function(_0x9d9213,_0x4b6c5c){const _0x84d640=a192_0x1125,_0x3ed46d=_0x9d9213();while(!![]){try{const _0xbed404=-parseInt(_0x84d640(0x1fa))/0x1*(parseInt(_0x84d640(0x208))/0x2)+parseInt(_0x84d640(0x211))/0x3*(-parseInt(_0x84d640(0x1fc))/0x4)+parseInt(_0x84d640(0x1f2))/0x5*(parseInt(_0x84d640(0x1ed))/0x6)+-parseInt(_0x84d640(0x1f6))/0x7*(parseInt(_0x84d640(0x1fb))/0x8)+parseInt(_0x84d640(0x207))/0x9+-parseInt(_0x84d640(0x1ee))/0xa*(-parseInt(_0x84d640(0x1ff))/0xb)+parseInt(_0x84d640(0x202))/0xc*(parseInt(_0x84d640(0x206))/0xd);if(_0xbed404===_0x4b6c5c)break;else _0x3ed46d['push'](_0x3ed46d['shift']());}catch(_0x2c8a66){_0x3ed46d['push'](_0x3ed46d['shift']());}}}(a192_0xab5d,0xeeaa6));import{asDryRunResult}from'../../commands/common/dry-run.js';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=a192_0x42e5a3(0x1fd);function a192_0x1125(_0x364795,_0x1d2a8f){_0x364795=_0x364795-0x1ec;const _0xab5d1d=a192_0xab5d();let _0x1125d4=_0xab5d1d[_0x364795];return _0x1125d4;}async function prepareCreate(_0x5a22b3){const _0x2e2c9d=a192_0x42e5a3,_0x582214=await readNotificationDocument(_0x5a22b3,_0x2e2c9d(0x1f7)),_0x487b70=createMutationInput(_0x5a22b3[_0x2e2c9d(0x205)],_0x582214);return{'document':_0x582214,'input':_0x487b70,'planned':projectNotificationConfig({'appCode':_0x5a22b3[_0x2e2c9d(0x205)],'configName':_0x582214['configName'],'channelType':_0x582214['channelType'],'endpointUrl':_0x582214[_0x2e2c9d(0x203)],'channelConfig':_0x582214[_0x2e2c9d(0x1ec)],'description':_0x582214[_0x2e2c9d(0x200)],'connectTimeout':_0x582214['connectTimeout']??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,'readTimeout':_0x582214[_0x2e2c9d(0x1f4)]??DEFAULT_NOTIFICATION_READ_TIMEOUT})};}export const notificationConfigCreate={'service':a192_0x42e5a3(0x20d),'command':'config-create','description':a192_0x42e5a3(0x1f0),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x2dffd7){assertSingleNotificationSource(_0x2dffd7);},async 'dryRun'(_0x37dfdc){const _0x65c4bb=a192_0x42e5a3,_0x39bf70=await prepareCreate(_0x37dfdc),_0xcbd697=notificationLookupCommand(_0x37dfdc[_0x65c4bb(0x205)],_0x39bf70['document'][_0x65c4bb(0x1f1)]);return asDryRunResult({'operation':'create','selector':{'appCode':_0x37dfdc['appCode'],'configName':_0x39bf70[_0x65c4bb(0x1f9)][_0x65c4bb(0x20c)],'channelType':_0x39bf70[_0x65c4bb(0x1f9)][_0x65c4bb(0x1f1)]},'before':null,'after':_0x39bf70['planned'],'dryRun':!![],'backend':{'method':_0x65c4bb(0x20f),'path':CREATE_PATH},'warnings':[],'verification':{'status':_0x65c4bb(0x210),'lookupCommand':_0xcbd697}},{'method':_0x65c4bb(0x20f),'url':CREATE_PATH});},async 'execute'(_0x31ea01){const _0x4d2d81=a192_0x42e5a3,_0x5495a0=await prepareCreate(_0x31ea01),_0x433b03=notificationLookupCommand(_0x31ea01['appCode'],_0x5495a0['document'][_0x4d2d81(0x1f1)]);let _0x39f5da;try{_0x39f5da=await createNotificationChannelConfig(_0x5495a0[_0x4d2d81(0x209)]);}catch(_0x7574c){if(isPlatformTransportFailure(_0x7574c))throw notificationError('notification_config_create_outcome_unknown',_0x4d2d81(0x204),_0x4d2d81(0x20b)+_0x433b03+_0x4d2d81(0x1f8));throw safeApiFailure('create',_0x4d2d81(0x1f5),_0x4d2d81(0x20b)+_0x433b03+';\x20no\x20automatic\x20retry\x20was\x20attempted.');}if(!Number[_0x4d2d81(0x1fe)](_0x39f5da)||_0x39f5da<=0x0)throw notificationError(_0x4d2d81(0x1f3),_0x4d2d81(0x20a),_0x4d2d81(0x20b)+_0x433b03+';\x20do\x20not\x20resubmit.');let _0x4ce5c2;try{const _0x2812c0=await getNotificationChannelConfig(_0x39f5da,_0x31ea01[_0x4d2d81(0x205)]);_0x4ce5c2=normalizeExactNotificationConfig(_0x2812c0,_0x39f5da,_0x31ea01[_0x4d2d81(0x205)]);}catch{throw safeApiFailure(_0x4d2d81(0x1f7),_0x4d2d81(0x201),_0x4d2d81(0x20b)+_0x433b03+_0x4d2d81(0x20e));}return{'ok':!![],'data':{'operation':_0x4d2d81(0x1f7),'selector':{'appCode':_0x4ce5c2[_0x4d2d81(0x205)],'id':_0x4ce5c2['id'],'configCode':_0x4ce5c2['configCode'],'configName':_0x4ce5c2[_0x4d2d81(0x20c)],'channelType':_0x4ce5c2[_0x4d2d81(0x1f1)]},'before':null,'after':projectNotificationConfig(_0x4ce5c2),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[],'verification':{'status':_0x4d2d81(0x1ef),'lookupCommand':_0x433b03}},'message':'Created\x20notification\x20config\x20'+_0x4ce5c2['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a193_0xed5ad1=a193_0x47ac;function a193_0x47ac(_0x46bf41,_0x40a1bf){_0x46bf41=_0x46bf41-0x15d;const _0x33c3c0=a193_0x33c3();let _0x47acaf=_0x33c3c0[_0x46bf41];return _0x47acaf;}(function(_0x437d9b,_0x3b7d2a){const _0x135341=a193_0x47ac,_0x164071=_0x437d9b();while(!![]){try{const _0x1d18a1=-parseInt(_0x135341(0x16a))/0x1+parseInt(_0x135341(0x162))/0x2*(parseInt(_0x135341(0x179))/0x3)+parseInt(_0x135341(0x15e))/0x4*(-parseInt(_0x135341(0x161))/0x5)+parseInt(_0x135341(0x170))/0x6*(parseInt(_0x135341(0x15f))/0x7)+-parseInt(_0x135341(0x174))/0x8+parseInt(_0x135341(0x172))/0x9+parseInt(_0x135341(0x16f))/0xa;if(_0x1d18a1===_0x3b7d2a)break;else _0x164071['push'](_0x164071['shift']());}catch(_0x229ca4){_0x164071['push'](_0x164071['shift']());}}}(a193_0x33c3,0x3e51d));import{asDryRunResult}from'../../commands/common/dry-run.js';function a193_0x33c3(){const _0x7cdf2b=['175EtFKLy','378086oquVaB','Inspect\x20with\x20','Notification\x20config\x20','\x20delete\x20could\x20not\x20be\x20verified.','notification_config_delete_verification_failed','/notification/channel-config/delete',';\x20do\x20not\x20resubmit\x20automatically.','Deleting\x20this\x20app-level\x20config\x20may\x20make\x20dataset-level\x20channels\x20that\x20reference\x20it\x20unavailable;\x20dataset\x20references\x20were\x20not\x20verified\x20by\x20the\x20CLI.','233965gVuQxj','appCode','Delete\x20response\x20was\x20unavailable;\x20list\x20readback\x20proved\x20ID\x20absence\x20without\x20resubmitting.','notification','Delete\x20an\x20app-level\x20notification\x20config\x20after\x20exact\x20preflight','3331640nhUXqz','60vLhqCO','config-delete','2957013PvGiJb','delete','2077664sJurlI','high-risk-write','channelType','mutation','before','3bdqhnm','verified','Deleted\x20notification\x20config\x20','POST','planned','36072sloUTO','149660UalMal','some'];a193_0x33c3=function(){return _0x7cdf2b;};return a193_0x33c3();}import{deleteNotificationChannelConfig,isPlatformTransportFailure,listNotificationChannelConfigs}from'../../core/api-client.js';import{notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,projectNotificationConfig,readNotificationId,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure,validateNotificationDeleteReadback}from'../../commands/notification/shared.js';const DELETE_PATH=a193_0xed5ad1(0x167),REFERENCE_WARNING=a193_0xed5ad1(0x169);async function prepareDelete(_0x9e0d05){const _0x448081=a193_0xed5ad1,_0x1a730b=readNotificationId(_0x9e0d05),_0x407f3d=await requireExactNotificationConfig(_0x9e0d05['appCode'],_0x1a730b,_0x448081(0x173));return{'id':_0x1a730b,'before':_0x407f3d};}export const notificationConfigDelete={'service':a193_0xed5ad1(0x16d),'command':a193_0xed5ad1(0x171),'description':a193_0xed5ad1(0x16e),'risk':a193_0xed5ad1(0x175),'requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,NOTIFICATION_APP_FLAG],async 'validate'(_0x1eafc8){readNotificationId(_0x1eafc8),requireNotificationExplicitYes(_0x1eafc8);},async 'dryRun'(_0x4af073){const _0x3d37d5=a193_0xed5ad1,_0x525d03=await prepareDelete(_0x4af073),_0x19d977=notificationLookupCommand(_0x4af073[_0x3d37d5(0x16b)],_0x525d03[_0x3d37d5(0x178)]['channelType']);return asDryRunResult({'operation':_0x3d37d5(0x173),'selector':notificationSelector(_0x525d03['before']),'before':projectNotificationConfig(_0x525d03['before']),'after':null,'dryRun':!![],'backend':{'method':_0x3d37d5(0x17c),'path':DELETE_PATH},'warnings':[REFERENCE_WARNING],'verification':{'status':_0x3d37d5(0x15d),'lookupCommand':_0x19d977}},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0xaece31){const _0x4aca33=a193_0xed5ad1;requireNotificationExplicitYes(_0xaece31);const _0x157a38=await prepareDelete(_0xaece31),_0x610d3d=notificationLookupCommand(_0xaece31[_0x4aca33(0x16b)],_0x157a38[_0x4aca33(0x178)]['channelType']);let _0x42c099=![];try{await deleteNotificationChannelConfig(_0x157a38['id'],_0xaece31[_0x4aca33(0x16b)]);}catch(_0x3c7780){if(!isPlatformTransportFailure(_0x3c7780))throw safeApiFailure(_0x4aca33(0x173),_0x4aca33(0x177),_0x4aca33(0x163)+_0x610d3d+';\x20no\x20automatic\x20retry\x20was\x20attempted.');_0x42c099=!![];}let _0x44c511;try{_0x44c511=await listNotificationChannelConfigs(_0xaece31['appCode'],_0x157a38[_0x4aca33(0x178)]['channelType']),validateNotificationDeleteReadback(_0x44c511,_0xaece31[_0x4aca33(0x16b)],_0x157a38[_0x4aca33(0x178)][_0x4aca33(0x176)]);}catch{throw notificationError(_0x42c099?'notification_config_delete_outcome_unknown':'notification_config_delete_verification_unavailable',_0x4aca33(0x164)+_0x157a38['id']+_0x4aca33(0x165),_0x4aca33(0x163)+_0x610d3d+';\x20do\x20not\x20resubmit\x20automatically.');}if(_0x44c511[_0x4aca33(0x160)](_0xcefdd2=>_0xcefdd2['id']===_0x157a38['id']))throw notificationError(_0x42c099?'notification_config_delete_outcome_unknown':_0x4aca33(0x166),_0x4aca33(0x164)+_0x157a38['id']+'\x20remains\x20present\x20after\x20delete.',_0x4aca33(0x163)+_0x610d3d+_0x4aca33(0x168));const _0x41a30c=[REFERENCE_WARNING];return _0x42c099&&_0x41a30c['unshift'](_0x4aca33(0x16c)),{'ok':!![],'data':{'operation':_0x4aca33(0x173),'selector':notificationSelector(_0x157a38[_0x4aca33(0x178)]),'before':projectNotificationConfig(_0x157a38['before']),'after':null,'dryRun':![],'backend':{'method':_0x4aca33(0x17c),'path':DELETE_PATH},'warnings':_0x41a30c,'verification':{'status':_0x4aca33(0x17a),'absenceConfirmed':!![],'recoveredAfterUnknownResponse':_0x42c099,'lookupCommand':_0x610d3d}},'message':_0x4aca33(0x17b)+_0x157a38['id']};}};
|