@lovrabet/rabetbase-cli 2.5.3-beta.2 → 2.5.3-beta.4
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.d.ts +22 -0
- package/lib/api/api-group.js +1 -0
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +18 -2
- 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.d.ts +11 -0
- package/lib/api/legacy-api-file.js +1 -0
- package/lib/api/model-registry-file.d.ts +36 -0
- package/lib/api/model-registry-file.js +1 -0
- package/lib/api/model-registry-scaffold.d.ts +7 -0
- package/lib/api/model-registry-scaffold.js +1 -0
- package/lib/api/model-source.d.ts +6 -0
- package/lib/api/model-source.js +1 -0
- 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/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.d.ts +7 -0
- 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.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-create.js +1 -0
- package/lib/commands/dataset/cross-relation-delete.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-delete.js +1 -0
- package/lib/commands/dataset/cross-relation-list.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-list.js +1 -0
- package/lib/commands/dataset/cross-relation-shared.d.ts +190 -0
- package/lib/commands/dataset/cross-relation-shared.js +1 -0
- package/lib/commands/dataset/cross-relation-update.d.ts +2 -0
- package/lib/commands/dataset/cross-relation-update.js +1 -0
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.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/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.d.ts +28 -0
- package/lib/commands/project/api-architecture-upgrade.js +1 -0
- 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.d.ts +30 -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/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.d.ts +5 -3
- 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.d.ts +2 -0
- 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.d.ts +2 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.d.ts +13 -17
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +6 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.d.ts +41 -0
- package/lib/core/cross-db-relation.js +1 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.d.ts +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +0 -10
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +11 -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.d.ts +19 -0
- 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 +6 -1
- package/skills/rabetbase/SKILL.md +16 -10
- package/skills/rabetbase/guides/backend-function.md +5 -1
- package/skills/rabetbase/guides/bff-creation-workflow.md +3 -1
- package/skills/rabetbase/guides/cross-database-bff.md +70 -0
- package/skills/rabetbase/guides/data-api-guidelines.md +35 -33
- package/skills/rabetbase/guides/sdk-client-generation.md +112 -61
- package/skills/rabetbase/guides/sql-creation-workflow.md +2 -0
- package/skills/rabetbase/guides/typescript-sdk.md +9 -0
- package/skills/rabetbase/references/rabetbase-api-pull.md +30 -19
- package/skills/rabetbase/references/rabetbase-app-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-config.md +2 -1
- package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +64 -0
- package/skills/rabetbase/references/rabetbase-project-create.md +3 -3
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +24 -13
- package/skills/rabetbase.manifest.json +5 -3
- package/templates/README.md +46 -6
- package/templates/generate-api/model-runtime.ts.tpl +101 -0
- package/templates/generate-api/profile-api.ts.tpl +21 -0
- package/templates/generate-api/profile-client.ts.tpl +14 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
const a158_0x3b42eb=a158_0x143a;(function(_0x2b5d50,_0x84cb26){const _0x4e5e33=a158_0x143a,_0x3271b8=_0x2b5d50();while(!![]){try{const _0x275f54=parseInt(_0x4e5e33(0x181))/0x1+parseInt(_0x4e5e33(0x13f))/0x2+-parseInt(_0x4e5e33(0x153))/0x3+-parseInt(_0x4e5e33(0x172))/0x4*(parseInt(_0x4e5e33(0x166))/0x5)+-parseInt(_0x4e5e33(0x17c))/0x6+parseInt(_0x4e5e33(0x12d))/0x7+-parseInt(_0x4e5e33(0x16b))/0x8*(-parseInt(_0x4e5e33(0x12e))/0x9);if(_0x275f54===_0x84cb26)break;else _0x3271b8['push'](_0x3271b8['shift']());}catch(_0x4378c5){_0x3271b8['push'](_0x3271b8['shift']());}}}(a158_0x4789,0x8e88a));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':'number','required':!![],'description':a158_0x3b42eb(0x168)};export const MENU_SORT_FLAG={'name':a158_0x3b42eb(0x17e),'type':a158_0x3b42eb(0x12c),'description':a158_0x3b42eb(0x16c)};export const MENU_PARENT_ID_FLAG={'name':a158_0x3b42eb(0x150),'type':a158_0x3b42eb(0x14a),'description':'Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node'};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a158_0x3b42eb(0x169),'type':a158_0x3b42eb(0x14a),'description':a158_0x3b42eb(0x16a)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a158_0x3b42eb(0x13a),'type':'string','description':a158_0x3b42eb(0x179)},{'name':a158_0x3b42eb(0x174),'type':a158_0x3b42eb(0x12c),'description':'Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches'}];export function validateExactId(_0x550651){const _0x4d1c3e=a158_0x3b42eb,_0x3c911d=_0x550651[_0x4d1c3e(0x17a)]('id');if(!Number['isSafeInteger'](_0x3c911d)||_0x3c911d<=0x0)throw CliErrors[_0x4d1c3e(0x135)]('--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.');return _0x3c911d;}export function validateSort(_0x153ca9,_0x356582=a158_0x3b42eb(0x17e)){const _0x2c8308=a158_0x3b42eb;if(!hasFlag(_0x153ca9,_0x356582))return undefined;const _0x479a8f=_0x153ca9[_0x2c8308(0x17a)](_0x356582);if(!Number[_0x2c8308(0x11e)](_0x479a8f)||_0x479a8f<0x0||_0x479a8f>MAX_MENU_SORT)throw menuError('menu_sort_invalid','--'+_0x356582+_0x2c8308(0x129)+MAX_MENU_SORT+'.',_0x2c8308(0x173));return _0x479a8f;}export function nextSiblingSort(_0x4e80d2,_0x7647c5,_0x56ff29){const _0x3eaa23=a158_0x3b42eb,_0x55c9fc=getChildren(_0x4e80d2,_0x7647c5)[_0x3eaa23(0x128)](_0x363279=>_0x363279['sort'])[_0x3eaa23(0x14f)](_0x560862=>typeof _0x560862==='number');if(_0x55c9fc['length']===0x0)return 0x0;const _0x797021=Math['max'](..._0x55c9fc);if(_0x797021>=MAX_MENU_SORT)throw menuError(_0x3eaa23(0x180),_0x3eaa23(0x16f)+_0x56ff29+_0x3eaa23(0x142)+_0x797021+'.',_0x3eaa23(0x136)+MAX_MENU_SORT+_0x3eaa23(0x17f));return _0x797021+0x1;}export function requireExplicitYes(_0x180b2d){const _0x23a91a=a158_0x3b42eb;if(_0x180b2d[_0x23a91a(0x15a)]('dry-run'))return;if(!_0x180b2d['bool'](_0x23a91a(0x17d)))throw menuError(_0x23a91a(0x17b),'This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.',_0x23a91a(0x13c));}export async function fetchMutationSnapshot(_0x22a636,_0x38b6c0,_0x21862e){const _0x15d184=a158_0x3b42eb;try{return await fetchMenuSnapshot(_0x22a636[_0x15d184(0x13d)],_0x22a636[_0x15d184(0x141)]);}catch(_0x5969fe){throw mapMenuApiError(_0x5969fe,'read\x20online\x20menu\x20facts\x20before\x20'+_0x38b6c0,_0x21862e);}}export async function recheckMutationSnapshot(_0x20040e,_0x4f0576,_0x5cb790,_0x41b490){const _0x4b8364=a158_0x3b42eb;let _0x458710;try{_0x458710=await fetchMenuSnapshot(_0x20040e[_0x4b8364(0x13d)],_0x20040e[_0x4b8364(0x141)]);}catch(_0x237b77){const _0x329411=mapMenuApiError(_0x237b77,_0x4b8364(0x167)+_0x5cb790,_0x41b490);throw menuFailure(_0x329411,_0x4f0576,{'stage':'pre-write-recheck','failed':_0x41b490==null?{}:{'id':_0x41b490}});}if(_0x458710[_0x4b8364(0x11f)]!==_0x4f0576[_0x4b8364(0x158)]){const _0x1f4966=menuError(_0x4b8364(0x14d),'Online\x20menu\x20state\x20changed\x20before\x20'+_0x5cb790+_0x4b8364(0x14b),_0x4b8364(0x178));throw menuFailure(_0x1f4966,_0x4f0576,{'stage':_0x4b8364(0x16e),'failed':{..._0x41b490==null?{}:{'id':_0x41b490},'expectedSnapshotHash':_0x4f0576[_0x4b8364(0x158)],'currentSnapshotHash':_0x458710[_0x4b8364(0x11f)]}});}return _0x458710;}export function parseParentId(_0x44f05f,_0x1cf5ee,_0x41ee8d={}){const _0x84baaa=a158_0x3b42eb;if(!hasFlag(_0x44f05f,_0x1cf5ee)){if(_0x41ee8d[_0x84baaa(0x15e)])throw CliErrors['flagMissing'](_0x1cf5ee);return undefined;}const _0x51c486=_0x44f05f[_0x84baaa(0x12f)](_0x1cf5ee)[_0x84baaa(0x131)]();if(_0x51c486[_0x84baaa(0x121)]()==='root')return null;if(!/^\d+$/[_0x84baaa(0x148)](_0x51c486))throw CliErrors[_0x84baaa(0x135)]('--'+_0x1cf5ee+_0x84baaa(0x13e));const _0x41ee78=Number(_0x51c486);if(!Number[_0x84baaa(0x11e)](_0x41ee78)||_0x41ee78<=0x0)throw CliErrors[_0x84baaa(0x135)]('--'+_0x1cf5ee+_0x84baaa(0x13e));return _0x41ee78;}export function requireMenu(_0x11a500,_0x57770e){const _0x373c78=a158_0x3b42eb,_0x23b97a=_0x11a500[_0x373c78(0x151)][_0x373c78(0x123)](_0x57770e);if(!_0x23b97a)throw menuError(_0x373c78(0x145),_0x373c78(0x159)+_0x57770e,_0x373c78(0x126));return _0x23b97a;}export function requireFolder(_0x9dd185,_0x1bd740){const _0x2c0b09=a158_0x3b42eb,_0xdf81ea=requireMenu(_0x9dd185,_0x1bd740);if(_0xdf81ea[_0x2c0b09(0x160)]!==_0x2c0b09(0x175))throw menuError('menu_parent_not_folder',_0x2c0b09(0x132)+_0x1bd740+_0x2c0b09(0x11d)+(_0xdf81ea[_0x2c0b09(0x160)]||_0x2c0b09(0x139))+_0x2c0b09(0x15d),_0x2c0b09(0x147));return _0xdf81ea;}export function assertExpectedState(_0x43d63c,_0x51154d){const _0x9873aa=a158_0x3b42eb;if(hasFlag(_0x43d63c,_0x9873aa(0x169))){const _0xd410a2=parseParentId(_0x43d63c,_0x9873aa(0x169),{'required':!![]});if(_0x51154d[_0x9873aa(0x152)]!==_0xd410a2)throw stateDrift(_0x9873aa(0x132)+_0x51154d['id']+_0x9873aa(0x127)+formatParent(_0xd410a2)+_0x9873aa(0x161)+formatParent(_0x51154d[_0x9873aa(0x152)])+'.');}if(hasFlag(_0x43d63c,_0x9873aa(0x13a))){const _0x41bf55=_0x43d63c['str'](_0x9873aa(0x13a));if(_0x51154d[_0x9873aa(0x138)]!==_0x41bf55)throw stateDrift(_0x9873aa(0x132)+_0x51154d['id']+_0x9873aa(0x146)+JSON[_0x9873aa(0x165)](_0x41bf55)+',\x20current\x20'+JSON[_0x9873aa(0x165)](_0x51154d['path'])+'.');}if(hasFlag(_0x43d63c,'expected-children-count')){const _0x468d3a=_0x43d63c[_0x9873aa(0x17a)]('expected-children-count');if(!Number['isSafeInteger'](_0x468d3a)||_0x468d3a<0x0)throw CliErrors[_0x9873aa(0x135)](_0x9873aa(0x134));if(_0x51154d[_0x9873aa(0x137)]!==_0x468d3a)throw stateDrift(_0x9873aa(0x132)+_0x51154d['id']+'\x20child\x20count\x20changed:\x20expected\x20'+_0x468d3a+_0x9873aa(0x161)+_0x51154d[_0x9873aa(0x137)]+'.');}}export function assertVerified(_0x57b544,_0x54f4ce,_0x5c6f33=a158_0x3b42eb(0x15f)){if(!_0x57b544)throw menuError('menu_verification_failed',_0x54f4ce,_0x5c6f33);}export function mutationResult(_0x2dd7d4){const _0x13b122=a158_0x3b42eb;return{'operation':_0x2dd7d4[_0x13b122(0x120)],'selector':_0x2dd7d4['selector'],'before':_0x2dd7d4['before'],'after':_0x2dd7d4[_0x13b122(0x12a)],'dryRun':_0x2dd7d4['dryRun'],'backend':_0x2dd7d4['backend'],..._0x2dd7d4[_0x13b122(0x15c)]?{'plannedActions':_0x2dd7d4[_0x13b122(0x15c)]}:{},..._0x2dd7d4['targets']?{'targets':_0x2dd7d4[_0x13b122(0x144)]}:{},..._0x2dd7d4['deleteOrder']?{'deleteOrder':_0x2dd7d4['deleteOrder']}:{},'snapshotHash':_0x2dd7d4[_0x13b122(0x158)],..._0x2dd7d4[_0x13b122(0x163)]?{'cascade':_0x2dd7d4['cascade']}:{},..._0x2dd7d4[_0x13b122(0x133)]?{'planFile':_0x2dd7d4['planFile']}:{},'succeeded':_0x2dd7d4['succeeded']??[],'failed':_0x2dd7d4[_0x13b122(0x16d)]??[],'warnings':_0x2dd7d4[_0x13b122(0x149)]??[],'verification':_0x2dd7d4['verification'],'error':_0x2dd7d4['error']};}function a158_0x4789(){const _0x1aa3ed=['pre-write-recheck','Cannot\x20append\x20a\x20','defineProperty','Permission\x20denied\x20while\x20attempting\x20to\x20','456748vChlll','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','expected-children-count','folder','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','backend','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','num','menu_confirmation_required','338490EqUbqU','yes','sort',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','menu_sort_overflow','754219VfAinT','prototype','\x20is\x20type\x20\x22','isSafeInteger','hash','operation','toLowerCase','menu_verification_failed','get','api_error','menu_permission_denied','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','\x20parent\x20changed:\x20expected\x20','map','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','after','message','number','4346279VwdTDQ','27yubmoF','str','\x20menu\x20','trim','Menu\x20','planFile','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','validation','Reorder\x20sibling\x20menus\x20below\x20','childrenCount','path','unknown','expect-path','rawFlags','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','appCode','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','65086PLKtTg','menu_mutation_failed','cookie','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','hint','targets','menu_not_found','\x20path\x20changed:\x20expected\x20','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','test','warnings','string',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','call','menu_state_drift','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','filter','parent-id','byId','parentId','1962750xZuPBA','failedRecords','code','data','verification','snapshotHash','Online\x20menu\x20not\x20found:\x20','bool','root','plannedActions','\x22,\x20not\x20folder.','required','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','type',',\x20current\x20','Failed\x20to\x20','cascade','stage','stringify','5ssYYYB','recheck\x20online\x20menu\x20facts\x20before\x20','Exact\x20online\x20menu\x20id','expect-parent-id','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','2696egDVmp','Sibling\x20sort\x20value\x20(non-negative\x20integer)','failed'];a158_0x4789=function(){return _0x1aa3ed;};return a158_0x4789();}export function menuDryRunResult(_0x246570,_0x5ce7f3){return{..._0x246570,..._0x5ce7f3};}export function menuFailure(_0x3a1713,_0x557661,_0x4580d4){const _0x3b3370=a158_0x3b42eb,_0x5694dd=mutationResult({..._0x557661,'after':_0x4580d4[_0x3b3370(0x12a)]===undefined?_0x557661[_0x3b3370(0x12a)]:_0x4580d4['after'],'backend':_0x4580d4[_0x3b3370(0x177)]??_0x557661[_0x3b3370(0x177)],'dryRun':![],'succeeded':_0x4580d4['succeeded']??[],'failed':_0x4580d4[_0x3b3370(0x154)]??[{..._0x4580d4['failed']??{},'stage':_0x4580d4[_0x3b3370(0x164)],'code':_0x3a1713[_0x3b3370(0x155)],'message':_0x3a1713[_0x3b3370(0x12b)]}],'warnings':[..._0x557661[_0x3b3370(0x149)],..._0x4580d4[_0x3b3370(0x149)]??[]],'verification':_0x4580d4[_0x3b3370(0x157)],'error':{'code':_0x3a1713[_0x3b3370(0x155)],'message':_0x3a1713['message'],..._0x3a1713[_0x3b3370(0x143)]?{'hint':_0x3a1713['hint']}:{}}});return Object[_0x3b3370(0x170)](_0x3a1713,_0x3b3370(0x156),{'value':_0x5694dd,'enumerable':!![],'configurable':!![]}),_0x3a1713;}export function asVerificationError(_0x3f8acb,_0x59b7d0){const _0x48c0cd=a158_0x3b42eb;if(_0x3f8acb instanceof CliError&&_0x3f8acb['code']===_0x48c0cd(0x122))return _0x3f8acb;const _0x3f07ce=_0x3f8acb instanceof Error?_0x3f8acb['message']:String(_0x3f8acb);return menuError(_0x48c0cd(0x122),''+_0x59b7d0+(_0x3f07ce?':\x20'+_0x3f07ce:''),_0x48c0cd(0x176));}function a158_0x143a(_0x437eb0,_0x18a62a){_0x437eb0=_0x437eb0-0x11c;const _0x478948=a158_0x4789();let _0x143a49=_0x478948[_0x437eb0];return _0x143a49;}export function describeMenuErrorCause(_0xdab1a4,_0x4cdebc,_0xe3bf7){const _0x5edf42=a158_0x3b42eb,_0x379b51=mapMenuApiError(_0xdab1a4,_0x4cdebc,_0xe3bf7);return{'causeCode':_0x379b51[_0x5edf42(0x155)],'causeMessage':_0x379b51[_0x5edf42(0x12b)]};}export function hasFlag(_0xb8da8a,_0x29dc97){const _0x2c2d96=a158_0x3b42eb;return Object[_0x2c2d96(0x11c)]['hasOwnProperty'][_0x2c2d96(0x14c)](_0xb8da8a[_0x2c2d96(0x13b)],_0x29dc97)&&_0xb8da8a[_0x2c2d96(0x13b)][_0x29dc97]!==undefined;}export function toApiParentId(_0x5cc403){return _0x5cc403??0x0;}export function formatParent(_0x27b631){const _0x109830=a158_0x3b42eb;return _0x27b631==null?_0x109830(0x15b):String(_0x27b631);}export function menuError(_0x502bd2,_0x57ea7e,_0x51ec35){return new CliError(_0x502bd2,0x1,_0x57ea7e,_0x51ec35);}export function mapMenuApiError(_0x2ef6d1,_0x520684,_0x5b1b10){const _0x1ef9c4=a158_0x3b42eb;if(_0x2ef6d1 instanceof CliError&&_0x2ef6d1[_0x1ef9c4(0x155)]!==_0x1ef9c4(0x124))return _0x2ef6d1;const _0x167717=_0x2ef6d1 instanceof Error?_0x2ef6d1[_0x1ef9c4(0x12b)]:String(_0x2ef6d1);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x1ef9c4(0x148)](_0x167717))return menuError(_0x1ef9c4(0x125),_0x1ef9c4(0x171)+_0x520684+(_0x5b1b10?_0x1ef9c4(0x130)+_0x5b1b10:'')+'.',_0x1ef9c4(0x14e));return menuError(_0x1ef9c4(0x140),_0x1ef9c4(0x162)+_0x520684+(_0x5b1b10?_0x1ef9c4(0x130)+_0x5b1b10:'')+':\x20'+_0x167717,'Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.');}export function isMenuResponseLoss(_0x4bbe84){const _0x201702=a158_0x3b42eb,_0x5b8412=_0x4bbe84 instanceof Error?_0x4bbe84[_0x201702(0x12b)]:String(_0x4bbe84);if(_0x4bbe84 instanceof CliError)return _0x4bbe84[_0x201702(0x155)]===_0x201702(0x124)&&/^Request (?:failed|timeout):/i['test'](_0x5b8412);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x201702(0x148)](_0x5b8412);}function stateDrift(_0x5c4097){return menuError('menu_state_drift',_0x5c4097,'Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.');}
|
|
1
|
+
const a168_0x3432a0=a168_0xc44b;(function(_0x14c818,_0x206eae){const _0x2a4518=a168_0xc44b,_0x3bfcea=_0x14c818();while(!![]){try{const _0x47f583=parseInt(_0x2a4518(0x102))/0x1+-parseInt(_0x2a4518(0x140))/0x2+-parseInt(_0x2a4518(0xf7))/0x3+parseInt(_0x2a4518(0x146))/0x4*(parseInt(_0x2a4518(0xfd))/0x5)+-parseInt(_0x2a4518(0x10d))/0x6*(parseInt(_0x2a4518(0xfc))/0x7)+-parseInt(_0x2a4518(0x110))/0x8*(parseInt(_0x2a4518(0x112))/0x9)+parseInt(_0x2a4518(0x130))/0xa;if(_0x47f583===_0x206eae)break;else _0x3bfcea['push'](_0x3bfcea['shift']());}catch(_0x7fb496){_0x3bfcea['push'](_0x3bfcea['shift']());}}}(a168_0x7bb5,0xdbf18));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':'number','required':!![],'description':a168_0x3432a0(0xf4)};export const MENU_SORT_FLAG={'name':a168_0x3432a0(0x148),'type':a168_0x3432a0(0x11f),'description':a168_0x3432a0(0x10b)};export const MENU_PARENT_ID_FLAG={'name':'parent-id','type':a168_0x3432a0(0x113),'description':'Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node'};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a168_0x3432a0(0x14e),'type':'string','description':'Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level'};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a168_0x3432a0(0x142),'type':a168_0x3432a0(0x113),'description':a168_0x3432a0(0x151)},{'name':'expected-children-count','type':a168_0x3432a0(0x11f),'description':'Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches'}];export function validateExactId(_0x354bcc){const _0x3c43a9=a168_0x3432a0,_0x2b0f51=_0x354bcc[_0x3c43a9(0xf5)]('id');if(!Number[_0x3c43a9(0x158)](_0x2b0f51)||_0x2b0f51<=0x0)throw CliErrors[_0x3c43a9(0x11a)](_0x3c43a9(0x13b));return _0x2b0f51;}export function validateSort(_0x5592f6,_0xcb2cc7=a168_0x3432a0(0x148)){const _0x4f9d96=a168_0x3432a0;if(!hasFlag(_0x5592f6,_0xcb2cc7))return undefined;const _0x390cf6=_0x5592f6['num'](_0xcb2cc7);if(!Number['isSafeInteger'](_0x390cf6)||_0x390cf6<0x0||_0x390cf6>MAX_MENU_SORT)throw menuError(_0x4f9d96(0x119),'--'+_0xcb2cc7+_0x4f9d96(0x153)+MAX_MENU_SORT+'.',_0x4f9d96(0x12b));return _0x390cf6;}export function nextSiblingSort(_0x306985,_0x398230,_0x25acde){const _0x5568af=a168_0x3432a0,_0x2113ec=getChildren(_0x306985,_0x398230)[_0x5568af(0x136)](_0xaf8f13=>_0xaf8f13[_0x5568af(0x148)])[_0x5568af(0x14b)](_0x318830=>typeof _0x318830===_0x5568af(0x11f));if(_0x2113ec[_0x5568af(0x109)]===0x0)return 0x0;const _0x5e931f=Math[_0x5568af(0x107)](..._0x2113ec);if(_0x5e931f>=MAX_MENU_SORT)throw menuError('menu_sort_overflow',_0x5568af(0x105)+_0x25acde+_0x5568af(0x143)+_0x5e931f+'.',_0x5568af(0x154)+MAX_MENU_SORT+_0x5568af(0x144));return _0x5e931f+0x1;}export function requireExplicitYes(_0x27c6c4){const _0xf98d01=a168_0x3432a0;if(_0x27c6c4[_0xf98d01(0x117)](_0xf98d01(0x133)))return;if(!_0x27c6c4[_0xf98d01(0x117)](_0xf98d01(0x150)))throw menuError(_0xf98d01(0x11c),'This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}function a168_0x7bb5(){const _0x160d28=['dryRun','stringify','\x20menu\x20','after','7opGeXV','10ZbXaGG','warnings','menu_not_found','menu_mutation_failed','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','1364152XzRIvF','failed','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','Cannot\x20append\x20a\x20','succeeded','max','code','length','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','Sibling\x20sort\x20value\x20(non-negative\x20integer)','failedRecords','9735390FycHgB','defineProperty','unknown','3560ILzQMl','test','30465diWoul','string','\x20child\x20count\x20changed:\x20expected\x20','\x20path\x20changed:\x20expected\x20','menu_verification_failed','bool','folder','menu_sort_invalid','validation','required','menu_confirmation_required','appCode',',\x20current\x20','number','type','data','recheck\x20online\x20menu\x20facts\x20before\x20','cascade','menu_state_drift','get','snapshotHash','hash','root','Online\x20menu\x20state\x20changed\x20before\x20','Menu\x20','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','prototype','rawFlags','parentId','deleteOrder','33950300CfXxWf','backend','verification','dry-run','operation','\x20is\x20type\x20\x22','map','path','cookie','byId','flagMissing','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','menu_permission_denied','Failed\x20to\x20','Online\x20menu\x20not\x20found:\x20','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','2776384vLjYuf','str','expect-path','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','3239896ezNijc','call','sort','expected-children-count','targets','filter','childrenCount','planFile','expect-parent-id','message','yes','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','plannedActions','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','Reorder\x20sibling\x20menus\x20below\x20','api_error','menu_parent_not_folder','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','isSafeInteger','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','Exact\x20online\x20menu\x20id','num','error','2883480EZSmsI'];a168_0x7bb5=function(){return _0x160d28;};return a168_0x7bb5();}export async function fetchMutationSnapshot(_0x31dd70,_0x22550b,_0x434633){const _0x51bd23=a168_0x3432a0;try{return await fetchMenuSnapshot(_0x31dd70[_0x51bd23(0x11d)],_0x31dd70['cookie']);}catch(_0x3ce8e8){throw mapMenuApiError(_0x3ce8e8,'read\x20online\x20menu\x20facts\x20before\x20'+_0x22550b,_0x434633);}}export async function recheckMutationSnapshot(_0x5e65bd,_0x5f1b12,_0x1b5342,_0x401d84){const _0x3e5985=a168_0x3432a0;let _0x566b9d;try{_0x566b9d=await fetchMenuSnapshot(_0x5e65bd[_0x3e5985(0x11d)],_0x5e65bd[_0x3e5985(0x138)]);}catch(_0xdd5ffa){const _0x552277=mapMenuApiError(_0xdd5ffa,_0x3e5985(0x122)+_0x1b5342,_0x401d84);throw menuFailure(_0x552277,_0x5f1b12,{'stage':'pre-write-recheck','failed':_0x401d84==null?{}:{'id':_0x401d84}});}if(_0x566b9d[_0x3e5985(0x127)]!==_0x5f1b12[_0x3e5985(0x126)]){const _0x172296=menuError('menu_state_drift',_0x3e5985(0x129)+_0x1b5342+_0x3e5985(0xf2),_0x3e5985(0x13f));throw menuFailure(_0x172296,_0x5f1b12,{'stage':'pre-write-recheck','failed':{..._0x401d84==null?{}:{'id':_0x401d84},'expectedSnapshotHash':_0x5f1b12[_0x3e5985(0x126)],'currentSnapshotHash':_0x566b9d['hash']}});}return _0x566b9d;}export function parseParentId(_0x39277a,_0x50710e,_0x18799e={}){const _0x59b55c=a168_0x3432a0;if(!hasFlag(_0x39277a,_0x50710e)){if(_0x18799e[_0x59b55c(0x11b)])throw CliErrors[_0x59b55c(0x13a)](_0x50710e);return undefined;}const _0xa8a6fa=_0x39277a['str'](_0x50710e)['trim']();if(_0xa8a6fa['toLowerCase']()===_0x59b55c(0x128))return null;if(!/^\d+$/[_0x59b55c(0x111)](_0xa8a6fa))throw CliErrors[_0x59b55c(0x11a)]('--'+_0x50710e+_0x59b55c(0xf1));const _0x2f25ee=Number(_0xa8a6fa);if(!Number[_0x59b55c(0x158)](_0x2f25ee)||_0x2f25ee<=0x0)throw CliErrors[_0x59b55c(0x11a)]('--'+_0x50710e+_0x59b55c(0xf1));return _0x2f25ee;}export function requireMenu(_0x2cfdf5,_0x1a0f8b){const _0x56285a=a168_0x3432a0,_0x275680=_0x2cfdf5[_0x56285a(0x139)][_0x56285a(0x125)](_0x1a0f8b);if(!_0x275680)throw menuError(_0x56285a(0xff),_0x56285a(0x13e)+_0x1a0f8b,_0x56285a(0x104));return _0x275680;}export function requireFolder(_0x508e50,_0x458f4a){const _0x2bebbb=a168_0x3432a0,_0x3b90da=requireMenu(_0x508e50,_0x458f4a);if(_0x3b90da[_0x2bebbb(0x120)]!==_0x2bebbb(0x118))throw menuError(_0x2bebbb(0x156),_0x2bebbb(0x12a)+_0x458f4a+_0x2bebbb(0x135)+(_0x3b90da[_0x2bebbb(0x120)]||_0x2bebbb(0x10f))+'\x22,\x20not\x20folder.',_0x2bebbb(0x157));return _0x3b90da;}export function assertExpectedState(_0x11df3d,_0x8ceaa1){const _0x3f8bfe=a168_0x3432a0;if(hasFlag(_0x11df3d,_0x3f8bfe(0x14e))){const _0x273ff0=parseParentId(_0x11df3d,_0x3f8bfe(0x14e),{'required':!![]});if(_0x8ceaa1[_0x3f8bfe(0x12e)]!==_0x273ff0)throw stateDrift(_0x3f8bfe(0x12a)+_0x8ceaa1['id']+'\x20parent\x20changed:\x20expected\x20'+formatParent(_0x273ff0)+_0x3f8bfe(0x11e)+formatParent(_0x8ceaa1['parentId'])+'.');}if(hasFlag(_0x11df3d,_0x3f8bfe(0x142))){const _0x43742e=_0x11df3d[_0x3f8bfe(0x141)]('expect-path');if(_0x8ceaa1[_0x3f8bfe(0x137)]!==_0x43742e)throw stateDrift(_0x3f8bfe(0x12a)+_0x8ceaa1['id']+_0x3f8bfe(0x115)+JSON[_0x3f8bfe(0xf9)](_0x43742e)+',\x20current\x20'+JSON[_0x3f8bfe(0xf9)](_0x8ceaa1['path'])+'.');}if(hasFlag(_0x11df3d,_0x3f8bfe(0x149))){const _0x2c9a76=_0x11df3d[_0x3f8bfe(0xf5)](_0x3f8bfe(0x149));if(!Number['isSafeInteger'](_0x2c9a76)||_0x2c9a76<0x0)throw CliErrors['validation'](_0x3f8bfe(0x145));if(_0x8ceaa1[_0x3f8bfe(0x14c)]!==_0x2c9a76)throw stateDrift(_0x3f8bfe(0x12a)+_0x8ceaa1['id']+_0x3f8bfe(0x114)+_0x2c9a76+_0x3f8bfe(0x11e)+_0x8ceaa1['childrenCount']+'.');}}export function assertVerified(_0x9c93b8,_0x52916d,_0x514b02=a168_0x3432a0(0xf3)){if(!_0x9c93b8)throw menuError('menu_verification_failed',_0x52916d,_0x514b02);}export function mutationResult(_0x3b3e05){const _0x953d60=a168_0x3432a0;return{'operation':_0x3b3e05[_0x953d60(0x134)],'selector':_0x3b3e05['selector'],'before':_0x3b3e05['before'],'after':_0x3b3e05[_0x953d60(0xfb)],'dryRun':_0x3b3e05[_0x953d60(0xf8)],'backend':_0x3b3e05[_0x953d60(0x131)],..._0x3b3e05[_0x953d60(0x152)]?{'plannedActions':_0x3b3e05[_0x953d60(0x152)]}:{},..._0x3b3e05[_0x953d60(0x14a)]?{'targets':_0x3b3e05[_0x953d60(0x14a)]}:{},..._0x3b3e05[_0x953d60(0x12f)]?{'deleteOrder':_0x3b3e05[_0x953d60(0x12f)]}:{},'snapshotHash':_0x3b3e05[_0x953d60(0x126)],..._0x3b3e05[_0x953d60(0x123)]?{'cascade':_0x3b3e05[_0x953d60(0x123)]}:{},..._0x3b3e05[_0x953d60(0x14d)]?{'planFile':_0x3b3e05[_0x953d60(0x14d)]}:{},'succeeded':_0x3b3e05['succeeded']??[],'failed':_0x3b3e05[_0x953d60(0x103)]??[],'warnings':_0x3b3e05[_0x953d60(0xfe)]??[],'verification':_0x3b3e05[_0x953d60(0x132)],'error':_0x3b3e05[_0x953d60(0xf6)]};}export function menuDryRunResult(_0x4f4c97,_0x41ca87){return{..._0x4f4c97,..._0x41ca87};}export function menuFailure(_0x337eee,_0x3dbfa9,_0x2e6cb9){const _0x165550=a168_0x3432a0,_0x155df1=mutationResult({..._0x3dbfa9,'after':_0x2e6cb9[_0x165550(0xfb)]===undefined?_0x3dbfa9[_0x165550(0xfb)]:_0x2e6cb9[_0x165550(0xfb)],'backend':_0x2e6cb9[_0x165550(0x131)]??_0x3dbfa9['backend'],'dryRun':![],'succeeded':_0x2e6cb9[_0x165550(0x106)]??[],'failed':_0x2e6cb9[_0x165550(0x10c)]??[{..._0x2e6cb9[_0x165550(0x103)]??{},'stage':_0x2e6cb9['stage'],'code':_0x337eee[_0x165550(0x108)],'message':_0x337eee[_0x165550(0x14f)]}],'warnings':[..._0x3dbfa9[_0x165550(0xfe)],..._0x2e6cb9['warnings']??[]],'verification':_0x2e6cb9[_0x165550(0x132)],'error':{'code':_0x337eee[_0x165550(0x108)],'message':_0x337eee['message'],..._0x337eee['hint']?{'hint':_0x337eee['hint']}:{}}});return Object[_0x165550(0x10e)](_0x337eee,_0x165550(0x121),{'value':_0x155df1,'enumerable':!![],'configurable':!![]}),_0x337eee;}export function asVerificationError(_0x291d7e,_0x4e7612){const _0x5ddfec=a168_0x3432a0;if(_0x291d7e instanceof CliError&&_0x291d7e['code']===_0x5ddfec(0x116))return _0x291d7e;const _0x4173d4=_0x291d7e instanceof Error?_0x291d7e[_0x5ddfec(0x14f)]:String(_0x291d7e);return menuError(_0x5ddfec(0x116),''+_0x4e7612+(_0x4173d4?':\x20'+_0x4173d4:''),'The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.');}export function describeMenuErrorCause(_0x4f2999,_0x5a4e04,_0xea6434){const _0x35dc5b=a168_0x3432a0,_0x34b5ad=mapMenuApiError(_0x4f2999,_0x5a4e04,_0xea6434);return{'causeCode':_0x34b5ad[_0x35dc5b(0x108)],'causeMessage':_0x34b5ad[_0x35dc5b(0x14f)]};}export function hasFlag(_0x47af7d,_0x5c6fa4){const _0x11a3cb=a168_0x3432a0;return Object[_0x11a3cb(0x12c)]['hasOwnProperty'][_0x11a3cb(0x147)](_0x47af7d['rawFlags'],_0x5c6fa4)&&_0x47af7d[_0x11a3cb(0x12d)][_0x5c6fa4]!==undefined;}export function toApiParentId(_0x91f5bd){return _0x91f5bd??0x0;}export function formatParent(_0x231c1a){const _0xa9ec88=a168_0x3432a0;return _0x231c1a==null?_0xa9ec88(0x128):String(_0x231c1a);}export function menuError(_0x224cb2,_0x44b6fe,_0x4a053c){return new CliError(_0x224cb2,0x1,_0x44b6fe,_0x4a053c);}function a168_0xc44b(_0x337c4c,_0xd1d69c){_0x337c4c=_0x337c4c-0xf1;const _0x7bb58c=a168_0x7bb5();let _0xc44bbf=_0x7bb58c[_0x337c4c];return _0xc44bbf;}export function mapMenuApiError(_0x5f5238,_0x2bd5e0,_0x5b21c9){const _0x347192=a168_0x3432a0;if(_0x5f5238 instanceof CliError&&_0x5f5238[_0x347192(0x108)]!==_0x347192(0x155))return _0x5f5238;const _0x394ece=_0x5f5238 instanceof Error?_0x5f5238['message']:String(_0x5f5238);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x347192(0x111)](_0x394ece))return menuError(_0x347192(0x13c),'Permission\x20denied\x20while\x20attempting\x20to\x20'+_0x2bd5e0+(_0x5b21c9?_0x347192(0xfa)+_0x5b21c9:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x347192(0x100),_0x347192(0x13d)+_0x2bd5e0+(_0x5b21c9?_0x347192(0xfa)+_0x5b21c9:'')+':\x20'+_0x394ece,_0x347192(0x101));}export function isMenuResponseLoss(_0x34e5d1){const _0x47c71a=a168_0x3432a0,_0x36d1f3=_0x34e5d1 instanceof Error?_0x34e5d1[_0x47c71a(0x14f)]:String(_0x34e5d1);if(_0x34e5d1 instanceof CliError)return _0x34e5d1['code']==='api_error'&&/^Request (?:failed|timeout):/i[_0x47c71a(0x111)](_0x36d1f3);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i['test'](_0x36d1f3);}function stateDrift(_0x25b791){const _0x5a4a41=a168_0x3432a0;return menuError(_0x5a4a41(0x124),_0x25b791,_0x5a4a41(0x10a));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3140b4,_0x12f825){const _0x2a1025=a169_0x518a,_0x362265=_0x3140b4();while(!![]){try{const _0x10a0b9=parseInt(_0x2a1025(0xd8))/0x1*(parseInt(_0x2a1025(0xd6))/0x2)+parseInt(_0x2a1025(0xcb))/0x3*(-parseInt(_0x2a1025(0xee))/0x4)+-parseInt(_0x2a1025(0xd3))/0x5+-parseInt(_0x2a1025(0xca))/0x6+parseInt(_0x2a1025(0xd5))/0x7*(parseInt(_0x2a1025(0xd2))/0x8)+-parseInt(_0x2a1025(0xe5))/0x9+-parseInt(_0x2a1025(0xe3))/0xa*(-parseInt(_0x2a1025(0xea))/0xb);if(_0x10a0b9===_0x12f825)break;else _0x362265['push'](_0x362265['shift']());}catch(_0x2e0261){_0x362265['push'](_0x362265['shift']());}}}(a169_0xe300,0x596f3));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a169_0x6ab450,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x72742c,_0x1bce22){const _0x21b2e6=a169_0x518a,_0x49eedc=getEnv();logger[_0x21b2e6(0xf1)](_0x21b2e6(0xe8),isProduction(_0x49eedc)?'Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'+_0x72742c+')':_0x21b2e6(0xcd)+_0x72742c+')');const _0x3bc18d=await fetchMenuSnapshot(_0x72742c,_0x1bce22,{'verbose':!![]});return logger[_0x21b2e6(0xf1)](_0x21b2e6(0xe8),_0x21b2e6(0xe6)+_0x3bc18d[_0x21b2e6(0xdd)]+'\x20online\x20menus\x20successfully'),_0x3bc18d[_0x21b2e6(0xd4)][_0x21b2e6(0xce)](toProcessedMenuItem);}export async function createMenu(_0x4abb11,_0x3c3346,_0xfe81a6){const _0xa28f56=a169_0x518a;logger[_0xa28f56(0xf1)]('create-menu',_0xa28f56(0xcc)+_0xfe81a6[_0xa28f56(0xdb)]+'\x20('+_0xfe81a6[_0xa28f56(0xd1)]+')');const _0x323ac9={'appCode':_0x4abb11,'type':_0xa28f56(0xd7),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0xfe81a6['resources']?JSON[_0xa28f56(0xe7)](_0xfe81a6[_0xa28f56(0xcf)]):undefined},..._0xfe81a6},_0x3dfb13=await createMenuRecord(_0x323ac9,_0x3c3346,_0xa28f56(0xd9)+_0xfe81a6[_0xa28f56(0xdb)]+'\x22');return logger[_0xa28f56(0xf1)]('create-menu',_0xa28f56(0xd0)+_0xfe81a6[_0xa28f56(0xdb)]),_0x3dfb13;}function a169_0x518a(_0x28d189,_0x40fc04){_0x28d189=_0x28d189-0xca;const _0xe30072=a169_0xe300();let _0x518a72=_0xe30072[_0x28d189];return _0x518a72;}async function createSingleMenu(_0x38553e,_0x20277c,_0x3e7e88,_0x221ee1){const _0x527fde=a169_0x518a,_0x3d407d={'appCode':_0x38553e,'type':_0x527fde(0xd7),'sort':0x0,'extend':{'loadScriptMode':_0x527fde(0xef),'resources':_0x221ee1?JSON[_0x527fde(0xe7)](_0x221ee1):undefined},'label':_0x3e7e88[_0x527fde(0xdb)],'path':_0x3e7e88[_0x527fde(0xd1)]},_0x5072d0=await createMenuRecord(_0x3d407d,_0x20277c,_0x527fde(0xd9)+_0x3e7e88[_0x527fde(0xdb)]+'\x22');return logger['info'](_0x527fde(0xe9),_0x527fde(0xd0)+_0x3e7e88['label']),_0x5072d0;}export async function createMenus(_0x2b053e,_0x50a5b5,_0x59be38,_0x1f14f6){const _0x2138ab=a169_0x518a;logger[_0x2138ab(0xf1)](_0x2138ab(0xeb),_0x2138ab(0xe2)+_0x59be38[_0x2138ab(0xde)]);const _0x4de714=await Promise['all'](_0x59be38['map'](_0x12d422=>createSingleMenu(_0x2b053e,_0x50a5b5,_0x12d422,_0x1f14f6)));return logger[_0x2138ab(0xf1)](_0x2138ab(0xeb),_0x2138ab(0xe0)+_0x59be38['length']),_0x4de714;}export async function updateMenuCdnUrl(_0x4d603e,_0xe8488a,_0x1d5b14){const _0x47825e=a169_0x518a;logger['info'](_0x47825e(0xe1),_0x47825e(0xed)+_0x1d5b14[_0x47825e(0xdb)]+'\x20('+_0x1d5b14[_0x47825e(0xd1)]+')');const _0x33afd9={'id':_0x1d5b14['id'],'appCode':_0x4d603e,'extend':{..._0x1d5b14[_0x47825e(0xdc)]??{},..._0x1d5b14[_0x47825e(0xec)]?{'loadScriptMode':_0x1d5b14[_0x47825e(0xec)]}:{},'resources':_0x1d5b14[_0x47825e(0xcf)]?JSON[_0x47825e(0xe7)](_0x1d5b14[_0x47825e(0xcf)]):undefined}},_0x2fbf2b=await updateMenuRecord(_0x33afd9,_0xe8488a,_0x47825e(0xdf)+_0x1d5b14[_0x47825e(0xdb)]+'\x22');return logger[_0x47825e(0xf1)]('update-menu-cdn-url','Menu\x20assets\x20synced:\x20'+_0x1d5b14[_0x47825e(0xdb)],undefined),_0x2fbf2b;}function a169_0xe300(){const _0x88a41b=['extend','total','length','Update\x20menu\x20assets\x20\x22','Batch\x20menu\x20creation\x20completed,\x20total\x20','update-menu-cdn-url','Start\x20batch\x20menu\x20creation,\x20total\x20','10EvKNGq','Regroup\x20','45720gKEHth','Fetched\x20','stringify','get-online-menu-list','create-menu','10854261EFtXko','create-menus','loadScriptMode','Updating\x20menu\x20asset\x20links:\x20','4tfJqaZ','import','menuGroups','info','1687458mKFpla','1073238qRGRLU','Creating\x20menu:\x20','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','map','resources','Menu\x20created\x20successfully:\x20','path','32svGLSw','3058870joMHhI','menus','75236etPYmF','1184846pajnyA','procode','1nswCnf','Create\x20menu\x20\x22','Delete\x20','label'];a169_0xe300=function(){return _0x88a41b;};return a169_0xe300();}export async function createMenuEntity(_0x593ed7,_0x1b24b5,_0x432882){const _0x26e908=a169_0x518a;return createMenuRecord({'appCode':_0x593ed7,..._0x432882},_0x1b24b5,_0x26e908(0xd9)+_0x432882[_0x26e908(0xdb)]+'\x22');}export async function updateMenuEntity(_0xfc9cf8,_0x23008,_0x8c1b42){return updateMenuRecord({'appCode':_0xfc9cf8,..._0x8c1b42},_0x23008,'Update\x20menu\x20'+_0x8c1b42['id']);}export async function batchDeleteMenuEntities(_0x3d1109,_0x4dc428){const _0x5925c6=a169_0x518a;return batchDeleteMenuRecords(_0x4dc428,_0x3d1109,_0x5925c6(0xda)+_0x4dc428[_0x5925c6(0xde)]+'\x20menu'+(_0x4dc428[_0x5925c6(0xde)]===0x1?'':'s'));}export async function startMenuRegroup(_0xac3249,_0x304c26){const _0x58b2db=a169_0x518a;return a169_0x6ab450(_0x304c26,_0xac3249,_0x58b2db(0xe4)+_0x304c26[_0x58b2db(0xf0)]['length']+'\x20menu\x20group(s)');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x46e140,_0x41b6aa){const _0x265c26=a170_0x5e30,_0x970bc0=_0x46e140();while(!![]){try{const _0x152b24=parseInt(_0x265c26(0x1fa))/0x1+parseInt(_0x265c26(0x1f1))/0x2*(-parseInt(_0x265c26(0x1ed))/0x3)+-parseInt(_0x265c26(0x1fd))/0x4*(parseInt(_0x265c26(0x200))/0x5)+parseInt(_0x265c26(0x1ec))/0x6+parseInt(_0x265c26(0x1e7))/0x7*(parseInt(_0x265c26(0x1f8))/0x8)+-parseInt(_0x265c26(0x1ea))/0x9*(parseInt(_0x265c26(0x1e8))/0xa)+parseInt(_0x265c26(0x1f5))/0xb;if(_0x152b24===_0x41b6aa)break;else _0x970bc0['push'](_0x970bc0['shift']());}catch(_0x8412bf){_0x970bc0['push'](_0x970bc0['shift']());}}}(a170_0x12e0,0x5a6a6));function a170_0x12e0(){const _0x28b479=['import','Invalid\x20--params\x20fields:\x20','82uyYWSg','Start\x20non-interactive\x20menu\x20sync','push','menu-sync','10344664IMAjVl','Menu\x20sync\x20completed','\x0a\x20\x20Available\x20local\x20paths:\x20','8BDDYvw','cwd','385593qQxVRf','map','dryRun','4VHRlmZ','jsUrl','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','3447265OZbciF','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','cssUrl','join','trim','has','pages','path','string','filter','Invalid\x20--params:\x20','hasOwn','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','parse','object','setLogPath','info','4635715iazqea','2380HtHTrT','length','24237HYuyYO','CSS\x20URL\x20is\x20unreachable:\x20','2518548FtooGg','51753ZSRiLf','message'];a170_0x12e0=function(){return _0x28b479;};return a170_0x12e0();}import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a170_0x5e30(_0x31b913,_0x12f61d){_0x31b913=_0x31b913-0x1d9;const _0x12e01c=a170_0x12e0();let _0x5e30a9=_0x12e01c[_0x31b913];return _0x5e30a9;}import{logger}from'../../../utils/logger.js';const MENU_SYNC_PARAM_KEYS=new Set(['jsUrl','cssUrl']);function validateParams(_0x5991eb){const _0x37ed91=a170_0x5e30,_0x2736ff=[];return _0x5991eb[_0x37ed91(0x1fe)]&&!isValidJsHttpsUrl(_0x5991eb['jsUrl'])&&_0x2736ff[_0x37ed91(0x1f3)]({'field':_0x37ed91(0x1fe),'message':_0x37ed91(0x1e2)}),_0x5991eb[_0x37ed91(0x202)]&&!isValidCssHttpsUrl(_0x5991eb[_0x37ed91(0x202)])&&_0x2736ff[_0x37ed91(0x1f3)]({'field':_0x37ed91(0x202),'message':_0x37ed91(0x1ff)}),_0x2736ff;}export async function runMenuSyncCore(_0x2c1c97,_0x1730b2,_0x57a8c7=[],_0x3c934b,_0x25292f={}){const _0x57b1c2=a170_0x5e30,_0x2e32a1=parseMenuSyncParams(_0x3c934b),_0x3ea68b=[...new Set(_0x57a8c7[_0x57b1c2(0x1fb)](_0x2a109e=>_0x2a109e['trim']())[_0x57b1c2(0x1df)](Boolean))],_0x5bb627=_0x2e32a1[_0x57b1c2(0x1fe)],_0x4442c4=_0x2e32a1[_0x57b1c2(0x202)],_0x37924c=[];if(_0x5bb627)_0x37924c[_0x57b1c2(0x1f3)](_0x5bb627);if(_0x4442c4)_0x37924c[_0x57b1c2(0x1f3)](_0x4442c4);const _0x559e31=validateParams(_0x2e32a1);if(_0x559e31[_0x57b1c2(0x1e9)]>0x0){const _0xcb1925=_0x559e31[_0x57b1c2(0x1fb)](_0x6e8ff3=>'--params.'+_0x6e8ff3['field']+':\x20'+_0x6e8ff3[_0x57b1c2(0x1ee)])[_0x57b1c2(0x1d9)](';\x20');throw new Error(_0x57b1c2(0x1e0)+_0xcb1925);}logger[_0x57b1c2(0x1e5)](process[_0x57b1c2(0x1f9)]()),logger[_0x57b1c2(0x1e6)](_0x57b1c2(0x1f4),_0x57b1c2(0x1f2),{'appCode':_0x2c1c97,'selectedCount':_0x3ea68b[_0x57b1c2(0x1e9)],'jsUrl':_0x5bb627,'cssUrl':_0x4442c4});if(_0x5bb627){const _0x52ba68=await isUrlReachable(_0x5bb627);if(!_0x52ba68)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x5bb627);}if(_0x4442c4){const _0x178f3c=await isUrlReachable(_0x4442c4);if(!_0x178f3c)throw new Error(_0x57b1c2(0x1eb)+_0x4442c4);}const _0xf3e125=getLocalPages();if(_0xf3e125[_0x57b1c2(0x1e9)]===0x0){if(_0x3ea68b[_0x57b1c2(0x1e9)]>0x0)throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x3ea68b['join'](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x25292f[_0x57b1c2(0x1fc)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x5a9077=await getOnlineMenuList(_0x2c1c97,_0x1730b2),_0x5625e0=new Set(_0x5a9077[_0x57b1c2(0x1fb)](_0x32f2d1=>_0x32f2d1[_0x57b1c2(0x1dd)]));let _0x4477da;if(_0x3ea68b['length']>0x0){const _0x5ac44b=new Map(_0xf3e125[_0x57b1c2(0x1fb)](_0x1f88b0=>[_0x1f88b0['path'],_0x1f88b0])),_0x589065=_0x3ea68b[_0x57b1c2(0x1df)](_0x2ac6cc=>!_0x5ac44b[_0x57b1c2(0x1db)](_0x2ac6cc));if(_0x589065[_0x57b1c2(0x1e9)]>0x0){const _0x18c3a7=_0xf3e125[_0x57b1c2(0x1fb)](_0x5812c9=>_0x5812c9['path'])['join'](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x589065[_0x57b1c2(0x1d9)](',\x20')+_0x57b1c2(0x1f7)+_0x18c3a7);}const _0xe03d3f=_0x3ea68b['filter'](_0x1946e0=>_0x5625e0[_0x57b1c2(0x1db)](_0x1946e0));if(_0xe03d3f['length']>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0xe03d3f['join'](',\x20'));_0x4477da=_0x3ea68b['map'](_0x30ad40=>_0x5ac44b['get'](_0x30ad40));}else _0x4477da=_0xf3e125[_0x57b1c2(0x1df)](_0x350a81=>!_0x5625e0[_0x57b1c2(0x1db)](_0x350a81['path']));if(_0x4477da[_0x57b1c2(0x1e9)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x25292f['dryRun']===!![],'targetPages':[],'plannedMenus':[]};const _0x157d9c=_0x4477da[_0x57b1c2(0x1fb)](_0x59946a=>({'type':'procode','path':_0x59946a[_0x57b1c2(0x1dd)],'label':_0x59946a['label'],'loadScriptMode':_0x57b1c2(0x1ef),'resources':[..._0x37924c]}));if(_0x25292f[_0x57b1c2(0x1fc)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x4477da,'plannedMenus':_0x157d9c};const _0x5191d2=await createMenus(_0x2c1c97,_0x1730b2,_0x4477da,_0x37924c[_0x57b1c2(0x1e9)]>0x0?_0x37924c:undefined);return logger['info']('menu-sync',_0x57b1c2(0x1f6),{'count':_0x4477da[_0x57b1c2(0x1e9)],'resources':_0x37924c}),{'created':_0x5191d2[_0x57b1c2(0x1e9)],'skipped':![],'dryRun':![],'targetPages':_0x4477da,'plannedMenus':_0x157d9c,'menus':_0x5191d2};}export function parseMenuSyncParams(_0x280d09){const _0xf76969=a170_0x5e30;if(!_0x280d09||typeof _0x280d09!==_0xf76969(0x1de))return{};let _0x23f920;try{_0x23f920=JSON[_0xf76969(0x1e3)](_0x280d09);}catch{throw new Error('Invalid\x20--params\x20JSON.');}if(typeof _0x23f920!==_0xf76969(0x1e4)||_0x23f920===null||Array['isArray'](_0x23f920))throw new Error('Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.');const _0x4d67d2=_0x23f920;if(Object[_0xf76969(0x1e1)](_0x4d67d2,_0xf76969(0x1dc)))throw new Error(_0xf76969(0x201));const _0x35e39b=Object['keys'](_0x4d67d2)['filter'](_0x34602e=>!MENU_SYNC_PARAM_KEYS[_0xf76969(0x1db)](_0x34602e));if(_0x35e39b[_0xf76969(0x1e9)]>0x0)throw new Error(_0xf76969(0x1f0)+_0x35e39b[_0xf76969(0x1d9)](',\x20')+'.');for(const _0x3f8dfa of MENU_SYNC_PARAM_KEYS){const _0x3e1660=_0x4d67d2[_0x3f8dfa];if(_0x3e1660!==undefined&&(typeof _0x3e1660!==_0xf76969(0x1de)||_0x3e1660[_0xf76969(0x1da)]()===''))throw new Error('Invalid\x20--params.'+_0x3f8dfa+':\x20expected\x20a\x20non-empty\x20string.');}return{'jsUrl':typeof _0x4d67d2[_0xf76969(0x1fe)]==='string'?_0x4d67d2[_0xf76969(0x1fe)][_0xf76969(0x1da)]():undefined,'cssUrl':typeof _0x4d67d2[_0xf76969(0x202)]===_0xf76969(0x1de)?_0x4d67d2[_0xf76969(0x202)][_0xf76969(0x1da)]():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a162_0x3a34(_0x505b8f,_0x3ad6b6){_0x505b8f=_0x505b8f-0xb3;const _0x51bd10=a162_0x51bd();let _0x3a34bd=_0x51bd10[_0x505b8f];return _0x3a34bd;}(function(_0x27f91f,_0x3da615){const _0x2a3f97=a162_0x3a34,_0x41ab89=_0x27f91f();while(!![]){try{const _0x33ee0b=-parseInt(_0x2a3f97(0xcc))/0x1*(parseInt(_0x2a3f97(0xd3))/0x2)+parseInt(_0x2a3f97(0xf2))/0x3*(-parseInt(_0x2a3f97(0xf3))/0x4)+-parseInt(_0x2a3f97(0xf0))/0x5*(-parseInt(_0x2a3f97(0xb3))/0x6)+-parseInt(_0x2a3f97(0xe6))/0x7*(parseInt(_0x2a3f97(0xf6))/0x8)+-parseInt(_0x2a3f97(0xf4))/0x9*(-parseInt(_0x2a3f97(0xd5))/0xa)+-parseInt(_0x2a3f97(0xde))/0xb+parseInt(_0x2a3f97(0xc9))/0xc;if(_0x33ee0b===_0x3da615)break;else _0x41ab89['push'](_0x41ab89['shift']());}catch(_0x1edaaf){_0x41ab89['push'](_0x41ab89['shift']());}}}(a162_0x51bd,0x23b83));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(_0x51b21b){const _0x421c61=a162_0x3a34,_0x4f6fef=[];return _0x51b21b['jsUrl']&&!isValidJsHttpsUrl(_0x51b21b[_0x421c61(0xf7)])&&_0x4f6fef[_0x421c61(0xd9)]({'field':_0x421c61(0xf7),'message':_0x421c61(0xe5)}),_0x51b21b['cssUrl']&&!isValidCssHttpsUrl(_0x51b21b[_0x421c61(0xee)])&&_0x4f6fef['push']({'field':'cssUrl','message':_0x421c61(0xec)}),_0x4f6fef;}function a162_0x51bd(){const _0x494e44=['endsWith','menu\x20asset-update\x20cannot\x20patch\x20','length','has','mode','fulfilled','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','77lUMEiY','resources','filter','rejected','label','Invalid\x20--params:\x20','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','some','cssUrl','path','15HiuKWC','map','66909SmpEMD','8LohykU','2351205vIAoIY','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','119608EvJZah','jsUrl','status','426366zsvHun','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','Start\x20non-interactive\x20menu\x20asset\x20update','JS\x20URL\x20is\x20unreachable:\x20','isArray','join','object','allSettled','\x20existing\x20CSS\x20resources\x20for\x20\x22','trim','menu-asset-update',').\x20','Invalid\x20--mode:\x20','setLogPath','parse','menuIds','.js','\x22\x20(','toLowerCase','paths','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','CSS\x20URL\x20is\x20unreachable:\x20','2821020fqIVJp','cwd','replace','10vrPTdq','dryRun','patch','all','message','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','info','35858ZuATHx','value','10qWnmOn','.\x20Allowed\x20values:\x20replace,\x20patch','Menu\x20asset\x20update\x20completed','string','push','.css','extend','loadScriptMode','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','1923339wunUaB'];a162_0x51bd=function(){return _0x494e44;};return a162_0x51bd();}export async function runMenuUpdateCore(_0xfda53c,_0x15adb1,_0x16263e,_0x52fe0c={}){const _0x3c8463=a162_0x3a34,_0xd9e181=parseUpdateParamsFlag(_0x16263e),_0x39499a=normalizeMode(_0x52fe0c[_0x3c8463(0xe3)]);validateSelection(_0x52fe0c['selection']);const _0x52d002=[];if(_0xd9e181[_0x3c8463(0xf7)])_0x52d002['push'](_0xd9e181[_0x3c8463(0xf7)]);if(_0xd9e181[_0x3c8463(0xee)])_0x52d002[_0x3c8463(0xd9)](_0xd9e181['cssUrl']);const _0x5b55e9=validateParams(_0xd9e181);if(_0x5b55e9[_0x3c8463(0xe1)]>0x0){const _0x1a94e5=_0x5b55e9[_0x3c8463(0xf1)](_0x43ad26=>'--params.'+_0x43ad26['field']+':\x20'+_0x43ad26[_0x3c8463(0xd0)])[_0x3c8463(0xb8)](';\x20');throw new Error(_0x3c8463(0xeb)+_0x1a94e5);}if(_0x52d002[_0x3c8463(0xe1)]===0x0)throw new Error(_0x3c8463(0xd1)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x3c8463(0xc0)](process[_0x3c8463(0xca)]()),logger['info'](_0x3c8463(0xbd),_0x3c8463(0xb5),{'appCode':_0xfda53c,'jsUrl':_0xd9e181['jsUrl'],'cssUrl':_0xd9e181[_0x3c8463(0xee)],'mode':_0x39499a,'dryRun':_0x52fe0c[_0x3c8463(0xcd)]===!![]});if(_0xd9e181[_0x3c8463(0xf7)]){const _0x22128d=await isUrlReachable(_0xd9e181[_0x3c8463(0xf7)]);if(!_0x22128d)throw new Error(_0x3c8463(0xb6)+_0xd9e181['jsUrl']);}if(_0xd9e181['cssUrl']){const _0x30ef79=await isUrlReachable(_0xd9e181[_0x3c8463(0xee)]);if(!_0x30ef79)throw new Error(_0x3c8463(0xc8)+_0xd9e181[_0x3c8463(0xee)]);}const _0x3a52d0=await getOnlineMenuList(_0xfda53c,_0x15adb1),_0xb21169=_0x3a52d0[_0x3c8463(0xe8)](_0x2ecef8=>_0x2ecef8['resources'][_0x3c8463(0xe1)]>0x0),_0x28f4ed=selectMenusForUpdate(_0xb21169,_0x52fe0c['selection']);if(_0x28f4ed[_0x3c8463(0xe1)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x52fe0c[_0x3c8463(0xcd)]===!![]};const _0x55d715=_0x28f4ed[_0x3c8463(0xf1)](_0x869578=>buildMenuUpdateDiff(_0x869578,_0xd9e181,_0x39499a,_0x52fe0c['force']===!![],_0x52fe0c[_0x3c8463(0xdc)]));if(_0x52fe0c[_0x3c8463(0xcd)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x55d715};const _0x4ad19a=await Promise[_0x3c8463(0xba)](_0x28f4ed[_0x3c8463(0xf1)]((_0x4fb082,_0x2cec3d)=>updateMenuCdnUrl(_0xfda53c,_0x15adb1,{'id':_0x4fb082['id'],'label':_0x4fb082[_0x3c8463(0xea)],'path':_0x4fb082[_0x3c8463(0xef)],'resources':_0x55d715[_0x2cec3d]['after'][_0x3c8463(0xe7)],'extend':_0x4fb082[_0x3c8463(0xdb)]??null,'loadScriptMode':_0x52fe0c[_0x3c8463(0xdc)]}))),_0x10e884=_0x4ad19a[_0x3c8463(0xe8)](_0x37570f=>_0x37570f[_0x3c8463(0xf8)]===_0x3c8463(0xe4))[_0x3c8463(0xf1)](_0x139742=>_0x139742[_0x3c8463(0xd4)]),_0x3e8843=_0x4ad19a[_0x3c8463(0xe8)](_0x394196=>_0x394196[_0x3c8463(0xf8)]===_0x3c8463(0xe9))[_0x3c8463(0xe1)];return logger[_0x3c8463(0xd2)](_0x3c8463(0xbd),_0x3c8463(0xd7),{'count':_0x28f4ed[_0x3c8463(0xe1)],'resources':_0x52d002}),{'updated':_0x10e884['length'],'failed':_0x3e8843,'skipped':![],'menus':_0x10e884};}function validateSelection(_0x39316a){const _0x5cca58=a162_0x3a34;if(!_0x39316a)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x39316a['all']&&(_0x39316a[_0x5cca58(0xc2)]['length']>0x0||_0x39316a[_0x5cca58(0xc6)][_0x5cca58(0xe1)]>0x0))throw new Error(_0x5cca58(0xc7));if(!_0x39316a[_0x5cca58(0xcf)]&&_0x39316a[_0x5cca58(0xc2)][_0x5cca58(0xe1)]===0x0&&_0x39316a[_0x5cca58(0xc6)]['length']===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x38f332,_0x224e01){const _0x1ec3af=a162_0x3a34;validateSelection(_0x224e01);if(_0x224e01[_0x1ec3af(0xcf)])return _0x38f332;const _0x203b6d=new Set(_0x38f332[_0x1ec3af(0xf1)](_0x41dc1d=>_0x41dc1d['id'])),_0x3eb8af=new Set(_0x38f332['map'](_0x8d5548=>_0x8d5548[_0x1ec3af(0xef)])),_0xa70bf2=_0x224e01[_0x1ec3af(0xc2)][_0x1ec3af(0xe8)](_0x1e2b38=>!_0x203b6d['has'](_0x1e2b38)),_0x3f9b83=_0x224e01[_0x1ec3af(0xc6)][_0x1ec3af(0xe8)](_0x200e13=>!_0x3eb8af[_0x1ec3af(0xe2)](_0x200e13));if(_0xa70bf2[_0x1ec3af(0xe1)]>0x0||_0x3f9b83['length']>0x0){const _0x1be4f9=[..._0xa70bf2[_0x1ec3af(0xf1)](_0x52b5cd=>String(_0x52b5cd)),..._0x3f9b83][_0x1ec3af(0xb8)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x1be4f9);}const _0x4201ec=new Set(_0x224e01[_0x1ec3af(0xc2)]),_0xb795c1=new Set(_0x224e01[_0x1ec3af(0xc6)]);return _0x38f332['filter'](_0x5bc415=>_0x4201ec['has'](_0x5bc415['id'])||_0xb795c1['has'](_0x5bc415[_0x1ec3af(0xef)]));}function normalizeMode(_0x920171){const _0x2d839f=a162_0x3a34;if(!_0x920171)return _0x2d839f(0xce);if(_0x920171===_0x2d839f(0xcb)||_0x920171===_0x2d839f(0xce))return _0x920171;throw new Error(_0x2d839f(0xbf)+_0x920171+_0x2d839f(0xd6));}function buildMenuUpdateDiff(_0x3a4bf2,_0x291876,_0x22315c,_0x239749,_0x201f42){const _0x169422=a162_0x3a34,_0x346ef5=[..._0x3a4bf2['resources']];_0x22315c===_0x169422(0xce)&&assertUnambiguousPatchResources(_0x3a4bf2,_0x346ef5,_0x291876);const _0x4b1783=_0x22315c===_0x169422(0xce)?patchResources(_0x346ef5,_0x291876):replaceResources(_0x291876),_0x50e74d=[],_0x7aa044=_0x346ef5[_0x169422(0xed)](isJsResource),_0x42e299=_0x4b1783['some'](isJsResource);if(_0x7aa044&&!_0x42e299){const _0x23c132=_0x169422(0xdd)+_0x3a4bf2[_0x169422(0xea)]+_0x169422(0xc4)+_0x3a4bf2[_0x169422(0xef)]+_0x169422(0xbe)+_0x169422(0xb4);if(!_0x239749)throw new Error(_0x23c132);_0x50e74d[_0x169422(0xd9)](_0x23c132);}const _0x4e705b=_0x346ef5[_0x169422(0xed)](isCssResource),_0x36e978=_0x4b1783['some'](isCssResource);_0x4e705b&&!_0x36e978&&_0x50e74d[_0x169422(0xd9)](_0x169422(0xf5)+_0x3a4bf2[_0x169422(0xea)]+'\x22\x20('+_0x3a4bf2['path']+').');const _0x20c7f1=typeof _0x3a4bf2[_0x169422(0xdb)]?.[_0x169422(0xdc)]===_0x169422(0xd8)?_0x3a4bf2[_0x169422(0xdb)][_0x169422(0xdc)]:null,_0x280355=_0x201f42?{'loadScriptMode':_0x20c7f1}:{},_0x5799cb=_0x201f42?{'loadScriptMode':_0x201f42}:{};return{'id':_0x3a4bf2['id'],'label':_0x3a4bf2[_0x169422(0xea)],'path':_0x3a4bf2[_0x169422(0xef)],'mode':_0x22315c,'before':{'resources':_0x346ef5,..._0x280355},'after':{'resources':_0x4b1783,..._0x5799cb},'warnings':_0x50e74d};}function replaceResources(_0x4d227a){const _0x437b11=a162_0x3a34;return[_0x4d227a['jsUrl'],_0x4d227a[_0x437b11(0xee)]][_0x437b11(0xe8)](_0x36a04e=>!!_0x36a04e);}function assertUnambiguousPatchResources(_0x4688aa,_0x87bf44,_0x3d5741){const _0xf420de=a162_0x3a34,_0x3a07fb=_0x87bf44[_0xf420de(0xe8)](isJsResource)['length'];if(_0x3d5741['jsUrl']&&_0x3a07fb>0x1)throw new Error(_0xf420de(0xe0)+_0x3a07fb+'\x20existing\x20JS\x20resources\x20for\x20\x22'+_0x4688aa[_0xf420de(0xea)]+_0xf420de(0xc4)+_0x4688aa[_0xf420de(0xef)]+')\x20'+'with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');const _0x3b03e9=_0x87bf44[_0xf420de(0xe8)](isCssResource)[_0xf420de(0xe1)];if(_0x3d5741[_0xf420de(0xee)]&&_0x3b03e9>0x1)throw new Error(_0xf420de(0xe0)+_0x3b03e9+_0xf420de(0xbb)+_0x4688aa[_0xf420de(0xea)]+_0xf420de(0xc4)+_0x4688aa['path']+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function patchResources(_0x36a744,_0x565a55){const _0x43532d=a162_0x3a34;let _0x5561b9=![],_0x2cbab8=![];const _0x175551=[];for(const _0x23beca of _0x36a744){if(isJsResource(_0x23beca)){if(_0x565a55['jsUrl']&&!_0x5561b9)_0x175551['push'](_0x565a55['jsUrl']),_0x5561b9=!![];else!_0x565a55[_0x43532d(0xf7)]&&_0x175551[_0x43532d(0xd9)](_0x23beca);continue;}if(isCssResource(_0x23beca)){if(_0x565a55[_0x43532d(0xee)]&&!_0x2cbab8)_0x175551[_0x43532d(0xd9)](_0x565a55[_0x43532d(0xee)]),_0x2cbab8=!![];else!_0x565a55[_0x43532d(0xee)]&&_0x175551[_0x43532d(0xd9)](_0x23beca);continue;}_0x175551['push'](_0x23beca);}return _0x565a55[_0x43532d(0xf7)]&&!_0x5561b9&&_0x175551['unshift'](_0x565a55['jsUrl']),_0x565a55[_0x43532d(0xee)]&&!_0x2cbab8&&_0x175551[_0x43532d(0xd9)](_0x565a55[_0x43532d(0xee)]),_0x175551;}function isJsResource(_0x437a5c){const _0x2873b5=a162_0x3a34;return stripQuery(_0x437a5c)[_0x2873b5(0xc5)]()[_0x2873b5(0xdf)](_0x2873b5(0xc3));}function isCssResource(_0x2cf585){const _0x656b6=a162_0x3a34;return stripQuery(_0x2cf585)[_0x656b6(0xc5)]()[_0x656b6(0xdf)](_0x656b6(0xda));}function stripQuery(_0x1d56ad){return _0x1d56ad['split']('?')[0x0]??_0x1d56ad;}function parseUpdateParamsFlag(_0x287e3f){const _0x26f1cb=a162_0x3a34;if(!_0x287e3f||typeof _0x287e3f!=='string')return{};try{const _0x4ebaaf=JSON[_0x26f1cb(0xc1)](_0x287e3f);if(typeof _0x4ebaaf!==_0x26f1cb(0xb9)||_0x4ebaaf===null||Array[_0x26f1cb(0xb7)](_0x4ebaaf))return{};return{'jsUrl':typeof _0x4ebaaf[_0x26f1cb(0xf7)]===_0x26f1cb(0xd8)?_0x4ebaaf[_0x26f1cb(0xf7)][_0x26f1cb(0xbc)]():undefined,'cssUrl':typeof _0x4ebaaf['cssUrl']==='string'?_0x4ebaaf['cssUrl']['trim']():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0xacce8a,_0x1284c){const _0x1e5f06=a172_0x5cd9,_0x15d938=_0xacce8a();while(!![]){try{const _0xa8e3e=-parseInt(_0x1e5f06(0x18e))/0x1*(-parseInt(_0x1e5f06(0x18c))/0x2)+-parseInt(_0x1e5f06(0x170))/0x3+parseInt(_0x1e5f06(0x18b))/0x4+parseInt(_0x1e5f06(0x16c))/0x5*(parseInt(_0x1e5f06(0x17e))/0x6)+parseInt(_0x1e5f06(0x171))/0x7*(parseInt(_0x1e5f06(0x17f))/0x8)+-parseInt(_0x1e5f06(0x176))/0x9+-parseInt(_0x1e5f06(0x15b))/0xa;if(_0xa8e3e===_0x1284c)break;else _0x15d938['push'](_0x15d938['shift']());}catch(_0x5edcc5){_0x15d938['push'](_0x15d938['shift']());}}}(a172_0x6f9e,0xbcd41));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';function a172_0x6f9e(){const _0xb94e66=['object','patch','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','.js','3520368mVDlDl','has','fulfilled','map','some','allSettled','message','JS\x20URL\x20is\x20unreachable:\x20','2862876OJTPTm','63688TGivMk','extend','path','trim','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','\x20existing\x20JS\x20resources\x20for\x20\x22','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','status',').\x20','after','replace','paths','4746088nQmJWg','46KPneQn','resources','55315MBwTje','cwd','dryRun','label','filter','Menu\x20asset\x20update\x20completed','menuIds','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','info','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','loadScriptMode','--params.','unshift','cssUrl','value','force','mode','\x22\x20(','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','25550650JdedGC','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','all','Start\x20non-interactive\x20menu\x20asset\x20update','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','parse','selection','Invalid\x20--mode:\x20','length','.\x20Allowed\x20values:\x20replace,\x20patch','endsWith','toLowerCase','.css','menu\x20asset-update\x20cannot\x20patch\x20','string','menu-asset-update','push','10iGMXtq','jsUrl','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','join','1564035GdddGV','728rWokZa'];a172_0x6f9e=function(){return _0xb94e66;};return a172_0x6f9e();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0xaf7d68){const _0x126efd=a172_0x5cd9,_0x545a7e=[];return _0xaf7d68[_0x126efd(0x16d)]&&!isValidJsHttpsUrl(_0xaf7d68['jsUrl'])&&_0x545a7e[_0x126efd(0x16b)]({'field':_0x126efd(0x16d),'message':_0x126efd(0x15c)}),_0xaf7d68[_0x126efd(0x155)]&&!isValidCssHttpsUrl(_0xaf7d68[_0x126efd(0x155)])&&_0x545a7e[_0x126efd(0x16b)]({'field':_0x126efd(0x155),'message':_0x126efd(0x185)}),_0x545a7e;}export async function runMenuUpdateCore(_0xf10824,_0x5366f4,_0x186565,_0x358b22={}){const _0x507c13=a172_0x5cd9,_0x37aebc=parseUpdateParamsFlag(_0x186565),_0x153011=normalizeMode(_0x358b22[_0x507c13(0x158)]);validateSelection(_0x358b22[_0x507c13(0x161)]);const _0xad22b6=[];if(_0x37aebc['jsUrl'])_0xad22b6[_0x507c13(0x16b)](_0x37aebc[_0x507c13(0x16d)]);if(_0x37aebc['cssUrl'])_0xad22b6[_0x507c13(0x16b)](_0x37aebc[_0x507c13(0x155)]);const _0x4bafdf=validateParams(_0x37aebc);if(_0x4bafdf['length']>0x0){const _0x43b8ae=_0x4bafdf['map'](_0x27a7fe=>_0x507c13(0x153)+_0x27a7fe['field']+':\x20'+_0x27a7fe[_0x507c13(0x17c)])['join'](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x43b8ae);}if(_0xad22b6['length']===0x0)throw new Error(_0x507c13(0x183)+_0x507c13(0x174));logger['setLogPath'](process[_0x507c13(0x18f)]()),logger[_0x507c13(0x196)](_0x507c13(0x16a),_0x507c13(0x15e),{'appCode':_0xf10824,'jsUrl':_0x37aebc[_0x507c13(0x16d)],'cssUrl':_0x37aebc[_0x507c13(0x155)],'mode':_0x153011,'dryRun':_0x358b22[_0x507c13(0x190)]===!![]});if(_0x37aebc['jsUrl']){const _0x5e24b3=await isUrlReachable(_0x37aebc[_0x507c13(0x16d)]);if(!_0x5e24b3)throw new Error(_0x507c13(0x17d)+_0x37aebc['jsUrl']);}if(_0x37aebc[_0x507c13(0x155)]){const _0x1191ae=await isUrlReachable(_0x37aebc[_0x507c13(0x155)]);if(!_0x1191ae)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x37aebc[_0x507c13(0x155)]);}const _0x3a955d=await getOnlineMenuList(_0xf10824,_0x5366f4),_0x3e232f=_0x3a955d[_0x507c13(0x192)](_0x12330d=>_0x12330d[_0x507c13(0x18d)][_0x507c13(0x163)]>0x0),_0x4993f3=selectMenusForUpdate(_0x3e232f,_0x358b22[_0x507c13(0x161)]);if(_0x4993f3[_0x507c13(0x163)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x358b22['dryRun']===!![]};const _0x23edcc=_0x4993f3['map'](_0x5505c7=>buildMenuUpdateDiff(_0x5505c7,_0x37aebc,_0x153011,_0x358b22[_0x507c13(0x157)]===!![],_0x358b22[_0x507c13(0x152)]));if(_0x358b22[_0x507c13(0x190)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x23edcc};const _0x350b22=await Promise[_0x507c13(0x17b)](_0x4993f3[_0x507c13(0x179)]((_0x2a7709,_0x3a6899)=>updateMenuCdnUrl(_0xf10824,_0x5366f4,{'id':_0x2a7709['id'],'label':_0x2a7709[_0x507c13(0x191)],'path':_0x2a7709[_0x507c13(0x181)],'resources':_0x23edcc[_0x3a6899][_0x507c13(0x188)]['resources'],'extend':_0x2a7709[_0x507c13(0x180)]??null,'loadScriptMode':_0x358b22[_0x507c13(0x152)]}))),_0x300b54=_0x350b22['filter'](_0x20244c=>_0x20244c[_0x507c13(0x186)]===_0x507c13(0x178))[_0x507c13(0x179)](_0x2b2ec3=>_0x2b2ec3[_0x507c13(0x156)]),_0x36e363=_0x350b22[_0x507c13(0x192)](_0x487442=>_0x487442[_0x507c13(0x186)]==='rejected')[_0x507c13(0x163)];return logger['info'](_0x507c13(0x16a),_0x507c13(0x193),{'count':_0x4993f3[_0x507c13(0x163)],'resources':_0xad22b6}),{'updated':_0x300b54[_0x507c13(0x163)],'failed':_0x36e363,'skipped':![],'menus':_0x300b54};}function validateSelection(_0x390904){const _0x3331c6=a172_0x5cd9;if(!_0x390904)throw new Error(_0x3331c6(0x198));if(_0x390904[_0x3331c6(0x15d)]&&(_0x390904[_0x3331c6(0x194)]['length']>0x0||_0x390904[_0x3331c6(0x18a)][_0x3331c6(0x163)]>0x0))throw new Error(_0x3331c6(0x15f));if(!_0x390904['all']&&_0x390904[_0x3331c6(0x194)]['length']===0x0&&_0x390904[_0x3331c6(0x18a)][_0x3331c6(0x163)]===0x0)throw new Error(_0x3331c6(0x198));}function a172_0x5cd9(_0x2269b0,_0x19f07d){_0x2269b0=_0x2269b0-0x152;const _0x6f9e10=a172_0x6f9e();let _0x5cd98e=_0x6f9e10[_0x2269b0];return _0x5cd98e;}export function selectMenusForUpdate(_0x4ccca6,_0x59f0d1){const _0x23b710=a172_0x5cd9;validateSelection(_0x59f0d1);if(_0x59f0d1[_0x23b710(0x15d)])return _0x4ccca6;const _0x28b8c9=new Set(_0x4ccca6[_0x23b710(0x179)](_0xd348f0=>_0xd348f0['id'])),_0xf3d389=new Set(_0x4ccca6[_0x23b710(0x179)](_0x3a01f8=>_0x3a01f8['path'])),_0x2781e6=_0x59f0d1[_0x23b710(0x194)][_0x23b710(0x192)](_0x207f03=>!_0x28b8c9[_0x23b710(0x177)](_0x207f03)),_0x38ff45=_0x59f0d1['paths']['filter'](_0x578eb9=>!_0xf3d389[_0x23b710(0x177)](_0x578eb9));if(_0x2781e6[_0x23b710(0x163)]>0x0||_0x38ff45['length']>0x0){const _0x22d08e=[..._0x2781e6[_0x23b710(0x179)](_0x5f398c=>String(_0x5f398c)),..._0x38ff45][_0x23b710(0x16f)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x22d08e);}const _0x4613a8=new Set(_0x59f0d1[_0x23b710(0x194)]),_0x477ce1=new Set(_0x59f0d1['paths']);return _0x4ccca6[_0x23b710(0x192)](_0x36cad4=>_0x4613a8[_0x23b710(0x177)](_0x36cad4['id'])||_0x477ce1[_0x23b710(0x177)](_0x36cad4[_0x23b710(0x181)]));}function normalizeMode(_0x278b54){const _0x50325a=a172_0x5cd9;if(!_0x278b54)return'patch';if(_0x278b54===_0x50325a(0x189)||_0x278b54===_0x50325a(0x173))return _0x278b54;throw new Error(_0x50325a(0x162)+_0x278b54+_0x50325a(0x164));}function buildMenuUpdateDiff(_0x4bb865,_0x697c19,_0xecb5eb,_0x368c81,_0x54668f){const _0x45c7b2=a172_0x5cd9,_0x1cc8c5=[..._0x4bb865[_0x45c7b2(0x18d)]];_0xecb5eb===_0x45c7b2(0x173)&&assertUnambiguousPatchResources(_0x4bb865,_0x1cc8c5,_0x697c19);const _0x271a13=_0xecb5eb===_0x45c7b2(0x173)?patchResources(_0x1cc8c5,_0x697c19):replaceResources(_0x697c19),_0x18d732=[],_0x365ef7=_0x1cc8c5['some'](isJsResource),_0x46d40c=_0x271a13[_0x45c7b2(0x17a)](isJsResource);if(_0x365ef7&&!_0x46d40c){const _0x5d331d=_0x45c7b2(0x197)+_0x4bb865['label']+_0x45c7b2(0x159)+_0x4bb865[_0x45c7b2(0x181)]+_0x45c7b2(0x187)+_0x45c7b2(0x16e);if(!_0x368c81)throw new Error(_0x5d331d);_0x18d732[_0x45c7b2(0x16b)](_0x5d331d);}const _0x399985=_0x1cc8c5[_0x45c7b2(0x17a)](isCssResource),_0x2b156b=_0x271a13[_0x45c7b2(0x17a)](isCssResource);_0x399985&&!_0x2b156b&&_0x18d732['push'](_0x45c7b2(0x15a)+_0x4bb865['label']+_0x45c7b2(0x159)+_0x4bb865[_0x45c7b2(0x181)]+').');const _0x3680d4=typeof _0x4bb865[_0x45c7b2(0x180)]?.[_0x45c7b2(0x152)]===_0x45c7b2(0x169)?_0x4bb865[_0x45c7b2(0x180)][_0x45c7b2(0x152)]:null,_0x3fecd9=_0x54668f?{'loadScriptMode':_0x3680d4}:{},_0x314b08=_0x54668f?{'loadScriptMode':_0x54668f}:{};return{'id':_0x4bb865['id'],'label':_0x4bb865['label'],'path':_0x4bb865[_0x45c7b2(0x181)],'mode':_0xecb5eb,'before':{'resources':_0x1cc8c5,..._0x3fecd9},'after':{'resources':_0x271a13,..._0x314b08},'warnings':_0x18d732};}function replaceResources(_0x1cb490){const _0x48e95e=a172_0x5cd9;return[_0x1cb490['jsUrl'],_0x1cb490[_0x48e95e(0x155)]][_0x48e95e(0x192)](_0x1460f7=>!!_0x1460f7);}function assertUnambiguousPatchResources(_0x1f9651,_0x538cb2,_0x17dd77){const _0x20ca38=a172_0x5cd9,_0x1477e9=_0x538cb2[_0x20ca38(0x192)](isJsResource)['length'];if(_0x17dd77[_0x20ca38(0x16d)]&&_0x1477e9>0x1)throw new Error(_0x20ca38(0x168)+_0x1477e9+_0x20ca38(0x184)+_0x1f9651[_0x20ca38(0x191)]+_0x20ca38(0x159)+_0x1f9651['path']+')\x20'+'with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');const _0x2ec4d3=_0x538cb2[_0x20ca38(0x192)](isCssResource)[_0x20ca38(0x163)];if(_0x17dd77[_0x20ca38(0x155)]&&_0x2ec4d3>0x1)throw new Error(_0x20ca38(0x168)+_0x2ec4d3+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x1f9651[_0x20ca38(0x191)]+'\x22\x20('+_0x1f9651['path']+')\x20'+_0x20ca38(0x195));}function patchResources(_0x58115d,_0x16427e){const _0xc7c8d6=a172_0x5cd9;let _0x3bb6d2=![],_0x14b45b=![];const _0x48dff7=[];for(const _0x5ba921 of _0x58115d){if(isJsResource(_0x5ba921)){if(_0x16427e[_0xc7c8d6(0x16d)]&&!_0x3bb6d2)_0x48dff7[_0xc7c8d6(0x16b)](_0x16427e[_0xc7c8d6(0x16d)]),_0x3bb6d2=!![];else!_0x16427e['jsUrl']&&_0x48dff7[_0xc7c8d6(0x16b)](_0x5ba921);continue;}if(isCssResource(_0x5ba921)){if(_0x16427e[_0xc7c8d6(0x155)]&&!_0x14b45b)_0x48dff7[_0xc7c8d6(0x16b)](_0x16427e[_0xc7c8d6(0x155)]),_0x14b45b=!![];else!_0x16427e[_0xc7c8d6(0x155)]&&_0x48dff7[_0xc7c8d6(0x16b)](_0x5ba921);continue;}_0x48dff7[_0xc7c8d6(0x16b)](_0x5ba921);}return _0x16427e['jsUrl']&&!_0x3bb6d2&&_0x48dff7[_0xc7c8d6(0x154)](_0x16427e[_0xc7c8d6(0x16d)]),_0x16427e[_0xc7c8d6(0x155)]&&!_0x14b45b&&_0x48dff7[_0xc7c8d6(0x16b)](_0x16427e[_0xc7c8d6(0x155)]),_0x48dff7;}function isJsResource(_0x2d8618){const _0x53194e=a172_0x5cd9;return stripQuery(_0x2d8618)['toLowerCase']()[_0x53194e(0x165)](_0x53194e(0x175));}function isCssResource(_0x30a66e){const _0x3b6be2=a172_0x5cd9;return stripQuery(_0x30a66e)[_0x3b6be2(0x166)]()[_0x3b6be2(0x165)](_0x3b6be2(0x167));}function stripQuery(_0x2a0490){return _0x2a0490['split']('?')[0x0]??_0x2a0490;}function parseUpdateParamsFlag(_0x1d7fe1){const _0x46de44=a172_0x5cd9;if(!_0x1d7fe1||typeof _0x1d7fe1!==_0x46de44(0x169))return{};try{const _0x14b857=JSON[_0x46de44(0x160)](_0x1d7fe1);if(typeof _0x14b857!==_0x46de44(0x172)||_0x14b857===null||Array['isArray'](_0x14b857))return{};return{'jsUrl':typeof _0x14b857[_0x46de44(0x16d)]==='string'?_0x14b857[_0x46de44(0x16d)][_0x46de44(0x182)]():undefined,'cssUrl':typeof _0x14b857[_0x46de44(0x155)]===_0x46de44(0x169)?_0x14b857[_0x46de44(0x155)][_0x46de44(0x182)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1c6347,_0x3bea10){const _0x1e325c=a173_0x4cdb,_0x3279bd=_0x1c6347();while(!![]){try{const _0x40016b=parseInt(_0x1e325c(0x1a3))/0x1*(parseInt(_0x1e325c(0x1a5))/0x2)+parseInt(_0x1e325c(0x1a4))/0x3*(parseInt(_0x1e325c(0x19e))/0x4)+parseInt(_0x1e325c(0x1a9))/0x5*(-parseInt(_0x1e325c(0x19b))/0x6)+parseInt(_0x1e325c(0x1a1))/0x7*(-parseInt(_0x1e325c(0x1a2))/0x8)+parseInt(_0x1e325c(0x1a8))/0x9+parseInt(_0x1e325c(0x19c))/0xa+-parseInt(_0x1e325c(0x1a0))/0xb;if(_0x40016b===_0x3bea10)break;else _0x3279bd['push'](_0x3279bd['shift']());}catch(_0xd462c6){_0x3279bd['push'](_0x3279bd['shift']());}}}(a173_0x6a84,0xdbe92));export function isValidJsHttpsUrl(_0xe4962a){const _0x2223b4=a173_0x4cdb;return/^https:\/\/.+\.js(\?.*)?$/[_0x2223b4(0x19f)](_0xe4962a['trim']());}function a173_0x6a84(){const _0x27cd69=['14106XqWZzP','13605910GVvkzX','bytes=0-0','860160TAZOCD','test','7461344MwqumS','3321598yAiWYD','24xUnoeR','240297mrKSay','3qPDpaP','10FCIikY','trim','body','7128675SFOMjh','1205QWDcRc','HEAD'];a173_0x6a84=function(){return _0x27cd69;};return a173_0x6a84();}function a173_0x4cdb(_0x16a7df,_0x51646a){_0x16a7df=_0x16a7df-0x19a;const _0x6a8479=a173_0x6a84();let _0x4cdb4a=_0x6a8479[_0x16a7df];return _0x4cdb4a;}export function isValidCssHttpsUrl(_0x57bd0e){const _0x2f36d2=a173_0x4cdb;return/^https:\/\/.+\.css(\?.*)?$/[_0x2f36d2(0x19f)](_0x57bd0e[_0x2f36d2(0x1a6)]());}export async function isUrlReachable(_0x3e5b94){const _0xebaed6=a173_0x4cdb;try{const _0x1c32d6=await fetch(_0x3e5b94,{'method':_0xebaed6(0x19a)});if(_0x1c32d6['ok'])return!![];}catch{}try{const _0x422fb2=await fetch(_0x3e5b94,{'method':'GET','headers':{'Range':_0xebaed6(0x19d)}}),_0x435475=_0x422fb2['ok'];try{await _0x422fb2[_0xebaed6(0x1a7)]?.['cancel']();}catch{}return _0x435475;}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a174_0x2c6b5b=a174_0x2a40;(function(_0x5ca510,_0x5dfa96){const _0x6e92d5=a174_0x2a40,_0x420a69=_0x5ca510();while(!![]){try{const _0x2f0fd3=-parseInt(_0x6e92d5(0x1be))/0x1+parseInt(_0x6e92d5(0x18d))/0x2*(parseInt(_0x6e92d5(0x1bd))/0x3)+parseInt(_0x6e92d5(0x1c9))/0x4+-parseInt(_0x6e92d5(0x18c))/0x5*(-parseInt(_0x6e92d5(0x1cc))/0x6)+parseInt(_0x6e92d5(0x1c8))/0x7+-parseInt(_0x6e92d5(0x1c4))/0x8+-parseInt(_0x6e92d5(0x192))/0x9*(parseInt(_0x6e92d5(0x1c3))/0xa);if(_0x2f0fd3===_0x5dfa96)break;else _0x420a69['push'](_0x420a69['shift']());}catch(_0x4b0cc5){_0x420a69['push'](_0x420a69['shift']());}}}(a174_0x3767,0xaedd7));import a174_0x495d47 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,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';function a174_0x3767(){const _0x507924=['108280IPOGjA','Sync\x20local\x20pages\x20as\x20platform\x20menus','\x20and\x20CSS:\x20','flag','6570158vlOHfq','4290132uBSDqT','\x20\x20Create\x20','write','252pWBcvx','POST','Menu\x20sync\x20skipped','menu','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','appCode','onlinePaths','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','Would\x20create\x20','cssUrl','\x20menu(s)\x20created','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','163615ajwfMK','640996FuaBIQ','\x20local\x20microfrontend\x20menu(s).','\x20created.','cookie','\x20\x20Cancelled.','246933TcgGdH','failed','Menu\x20creation\x20failed','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','yes','filter','map','length','\x20menu(s)...','✓\x20Menu\x20sync\x20completed:\x20','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','\x20\x20✓\x20Selected:\x20','onlineMenuList','\x20menu(s)','appcode','params','Fetching\x20online\x20menu\x20list...','boolean','Failed\x20to\x20fetch\x20online\x20menu\x20list','Menu\x20sync\x20completed:\x20','validation','Online\x20menu\x20list\x20fetched','trim','string','\x20failed.','sync','split','/smartapi/menu/create','message','Pre-fill\x20JS/CSS\x20URLs.\x20','\x20created,\x20','jsUrl','targetPages','Created\x20','gray','paths','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','skipped','\x20\x20Continue\x20with\x20creation?','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','str','\x20menu(s)\x20with\x20JS:\x20','yellow','9FDuVVA','626572dCZICe','created','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','selectedAppName','rawFlags','1090COnqEf'];a174_0x3767=function(){return _0x507924;};return a174_0x3767();}export const menuSync={'service':a174_0x2c6b5b(0x183),'command':a174_0x2c6b5b(0x1ab),'description':a174_0x2c6b5b(0x1c5),'risk':a174_0x2c6b5b(0x1cb),'flags':[{'name':a174_0x2c6b5b(0x1a1),'type':a174_0x2c6b5b(0x1a9),'description':a174_0x2c6b5b(0x1af)+a174_0x2c6b5b(0x18b)},{'name':a174_0x2c6b5b(0x1b5),'type':'string','description':'Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync'},{'name':a174_0x2c6b5b(0x196),'type':a174_0x2c6b5b(0x1a3),'description':'Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages'}],async 'dryRun'(_0x269198){const _0x414f78=a174_0x2c6b5b;ensureRunnableContext(_0x269198[_0x414f78(0x1c2)],_0x269198['selectedAppName']);const _0x49f8f9=await runMenuSyncCore(_0x269198[_0x414f78(0x185)],_0x269198[_0x414f78(0x190)],parsePaths(_0x269198[_0x414f78(0x1ba)]('paths')),_0x269198[_0x414f78(0x1ba)](_0x414f78(0x1a1)),{'dryRun':!![]});return{'method':_0x414f78(0x1cd),'url':_0x414f78(0x1ad),'body':_0x49f8f9,'description':_0x49f8f9[_0x414f78(0x1b7)]?_0x414f78(0x1b6):_0x414f78(0x188)+_0x49f8f9[_0x414f78(0x1b2)][_0x414f78(0x199)]+_0x414f78(0x18e)};},async 'execute'(_0x1e9c0a){const _0x40fa55=a174_0x2c6b5b;ensureRunnableContext(_0x1e9c0a['rawFlags'],_0x1e9c0a[_0x40fa55(0x1c1)]);const _0x5a6b78=_0x1e9c0a[_0x40fa55(0x1c7)](_0x40fa55(0x196)),_0xdbe8e=_0x1e9c0a[_0x40fa55(0x1ba)](_0x40fa55(0x1a1)),_0x622a85=parsePaths(_0x1e9c0a[_0x40fa55(0x1ba)]('paths')),_0x1f1965=parseMenuSyncParams(_0xdbe8e);if(_0x5a6b78){const _0x34daef=await runMenuSyncCore(_0x1e9c0a[_0x40fa55(0x185)],_0x1e9c0a[_0x40fa55(0x190)],_0x622a85,_0xdbe8e);if(_0x34daef[_0x40fa55(0x1b7)]){const _0x12bcac=getLocalPages();_0x12bcac['length']===0x0?writeCliSideChannelLine(_0x40fa55(0x1b9)):writeCliSideChannelLine(_0x40fa55(0x184));}else writeCliSideChannelLine(_0x40fa55(0x19b)+_0x34daef[_0x40fa55(0x1bf)]+_0x40fa55(0x18a));return{'ok':!![],'data':_0x34daef,'message':_0x34daef['skipped']?_0x40fa55(0x1ce):_0x40fa55(0x1a5)+_0x34daef[_0x40fa55(0x1bf)]+_0x40fa55(0x18f)};}if(_0x622a85['length']>0x0)throw CliErrors[_0x40fa55(0x1a6)](_0x40fa55(0x195),_0x40fa55(0x187));if(!isInteractive()&&_0xdbe8e)throw CliErrors[_0x40fa55(0x1a6)](_0x40fa55(0x1c0),'Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');requireInteractive();const _0x2d176a=startSpinner(_0x40fa55(0x1a2));let _0x2a0dcb,_0x4f7856,_0x46c27b;try{const _0x1a840f=await fetchMenuData(_0x1e9c0a['appCode'],_0x1e9c0a['cookie']);_0x2a0dcb=_0x1a840f['localPages'],_0x4f7856=_0x1a840f[_0x40fa55(0x186)],_0x46c27b=_0x1a840f[_0x40fa55(0x19e)],stopSpinner(_0x2d176a,_0x40fa55(0x1a7),!![]);}catch(_0x216932){stopSpinner(_0x2d176a,_0x40fa55(0x1a4),![]);throw CliErrors[_0x40fa55(0x1a6)](_0x216932 instanceof Error?_0x216932['message']:_0x40fa55(0x1a4));}if(_0x2a0dcb[_0x40fa55(0x199)]===0x0)return writeCliSideChannelLine(a174_0x495d47[_0x40fa55(0x1bc)]('\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first')),{'ok':!![]};const _0x24de54=buildCompareRows(_0x2a0dcb,_0x4f7856);writeCliSideChannelLine(renderCompareTable(_0x24de54)),writeCliSideChannelLine('');const _0x19c35a=await selectPages(_0x2a0dcb,_0x4f7856);writeCliSideChannelLine(''),writeCliSideChannelLine(a174_0x495d47['cyan'](_0x40fa55(0x19d)+_0x19c35a['length']+'\x20page(s)'));const _0x1d4927=_0x1f1965[_0x40fa55(0x1b1)]&&_0x1f1965[_0x40fa55(0x189)];if(!_0x1d4927){writeCliSideChannelLine(renderSyncSummary(_0x19c35a,_0x4f7856['size']>0x0));const _0x59b07a=await askConfirm(_0x40fa55(0x1b8));if(!_0x59b07a)return writeCliSideChannelLine(a174_0x495d47['gray'](_0x40fa55(0x191))),{'ok':!![]};}let _0x49a086=_0x1f1965['jsUrl'],_0x102271=_0x1f1965['cssUrl'];!_0x49a086&&(_0x49a086=await askJsUrl());!_0x102271&&(_0x102271=await askCssUrl());const _0x1c55fc=await askConfirm(_0x40fa55(0x1ca)+_0x19c35a[_0x40fa55(0x199)]+_0x40fa55(0x1bb)+_0x49a086+_0x40fa55(0x1c6)+_0x102271+'?');if(!_0x1c55fc)return writeCliSideChannelLine(a174_0x495d47[_0x40fa55(0x1b4)](_0x40fa55(0x191))),{'ok':!![]};const _0xdb4351=[_0x49a086,_0x102271],_0x21464b=startSpinner('Creating\x20'+_0x19c35a[_0x40fa55(0x199)]+_0x40fa55(0x19a));try{const _0x290ddf=await doCreateMenus(_0x1e9c0a['appCode'],_0x1e9c0a[_0x40fa55(0x190)],_0x19c35a,_0xdb4351);return stopSpinner(_0x21464b,_0x40fa55(0x1b3)+_0x290ddf[_0x40fa55(0x1bf)]+_0x40fa55(0x19f),!![]),{'ok':!![],'data':_0x290ddf,'message':_0x40fa55(0x1a5)+_0x290ddf['created']+_0x40fa55(0x1b0)+_0x290ddf[_0x40fa55(0x193)]+_0x40fa55(0x1aa)};}catch(_0x52ffdf){stopSpinner(_0x21464b,'Menu\x20creation\x20failed',![]);throw CliErrors[_0x40fa55(0x1a6)](_0x52ffdf instanceof Error?_0x52ffdf[_0x40fa55(0x1ae)]:_0x40fa55(0x194));}}};function ensureRunnableContext(_0x501e5b,_0xabd8a4){const _0x268c79=a174_0x2c6b5b,_0x7f9d2b=_0x501e5b[_0x268c79(0x1a0)]?String(_0x501e5b[_0x268c79(0x1a0)])[_0x268c79(0x1a8)]():'';if(!isInProject()&&!_0xabd8a4&&!_0x7f9d2b)throw CliErrors[_0x268c79(0x1a6)]('menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20'+_0x268c79(0x19c));}function a174_0x2a40(_0x42dca7,_0x3f4856){_0x42dca7=_0x42dca7-0x183;const _0x3767a1=a174_0x3767();let _0x2a40e9=_0x3767a1[_0x42dca7];return _0x2a40e9;}function parsePaths(_0x12eee4){const _0xd933a1=a174_0x2c6b5b;return[...new Set(_0x12eee4[_0xd933a1(0x1ac)](',')[_0xd933a1(0x198)](_0x1e23c9=>_0x1e23c9[_0xd933a1(0x1a8)]())[_0xd933a1(0x197)](Boolean))];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a165_0x214bdc=a165_0x391d;(function(_0x5f342b,_0x391228){const _0x5d8840=a165_0x391d,_0x2e67c1=_0x5f342b();while(!![]){try{const _0x2d74d9=-parseInt(_0x5d8840(0x149))/0x1+-parseInt(_0x5d8840(0x172))/0x2+-parseInt(_0x5d8840(0x158))/0x3*(-parseInt(_0x5d8840(0x15a))/0x4)+parseInt(_0x5d8840(0x17a))/0x5+-parseInt(_0x5d8840(0x165))/0x6*(parseInt(_0x5d8840(0x140))/0x7)+parseInt(_0x5d8840(0x147))/0x8*(parseInt(_0x5d8840(0x1a2))/0x9)+parseInt(_0x5d8840(0x183))/0xa*(parseInt(_0x5d8840(0x190))/0xb);if(_0x2d74d9===_0x391228)break;else _0x2e67c1['push'](_0x2e67c1['shift']());}catch(_0xcf3c5e){_0x2e67c1['push'](_0x2e67c1['shift']());}}}(a165_0x5b50,0xa22f3));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../commands/menu/shared/facts.js';function a165_0x5b50(){const _0x160c67=['boolean','isArray','expectedCount','Response\x20was\x20lost\x20and\x20menu\x20','Requested\x20menu\x20visibility','visible','childrenCount','pageType','update-menu-visibility','7252021JqpPwk','filter','values','--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.','\x20menu(s);\x20skip\x20','map','Updated\x20visibility\x20for\x20','75176uaffEQ','type','1064067ZLbIIm','message','plannedActions','menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.','code','cookie','str','menu_expected_count_mismatch','menu_selector_not_found','targets','\x20must\x20be\x20true\x20or\x20false.','\x20skipped,\x20','depth','Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20','expectVisible','35757uuUdJj','true','412tMbJVB','string','beforeById','verification','expect-visible','pageId','Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','Exact\x20comma-separated\x20menu\x20paths\x20to\x20update','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.','isSafeInteger','number','6cNgqaK','url','body','set','plan','validation','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.','\x20changed\x20unexpectedly.','expected-count','has','\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','\x20was\x20not\x20found\x20during\x20visibility\x20verification.','resourcesValid','2391798Fejeqm','menus','num','\x20visibility\x20could\x20not\x20be\x20verified\x20safely','rabetbase\x20menu\x20list\x20--format\x20compress','before','Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state','visibility-update','4365010YSJZVX','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','failed','The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.','Menu\x20','resources','Menu\x20visibility\x20update\x20completed:\x20','Menu\x20path\x20selector\x20not\x20found:\x20','Final\x20menu\x20visibility\x20readback\x20failed.','20ywjRBv','split','byId','\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.','Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20','Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.','Would\x20update\x20visibility\x20for\x20','menuIds','false','menu_permission_denied','stringify','One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','9452641UeSouE','get','\x20failed.','updated','update\x20visibility\x20for','verify\x20menu\x20visibility\x20update','appCode','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.','menu','datasetCode','rawFlags','update-recovery','\x20unchanged\x20menu(s).','datasetId','trim','requestedVisible','warnings','menu_verification_failed','135URvOds','childrenIds','menu\x20list','recovered','sort','length','update\x20menu\x20visibility','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.','push','label','\x20menu(s),\x20expected\x20','paths','parentId','menu-ids','join','some','Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20','POST','path','/smartapi/menu/update','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.'];a165_0x5b50=function(){return _0x160c67;};return a165_0x5b50();}import{asVerificationError,assertVerified,describeMenuErrorCause,fetchMutationSnapshot,hasFlag,isMenuResponseLoss,mapMenuApiError,menuDryRunResult,menuError,menuFailure,mutationResult,recheckMutationSnapshot,requireExplicitYes}from'../../commands/menu/shared/mutations.js';import{updateMenuEntity}from'../../commands/menu/shared/service.js';import{CliErrors}from'../../errors.js';const BACKEND=[{'method':'POST','path':a165_0x214bdc(0x1b6)}];export const menuVisibilityUpdate={'service':a165_0x214bdc(0x198),'command':'visibility-update','description':a165_0x214bdc(0x188),'risk':'high-risk-write','structuredErrors':!![],'flags':[{'name':a165_0x214bdc(0x1af),'type':a165_0x214bdc(0x15b),'description':a165_0x214bdc(0x17b)},{'name':a165_0x214bdc(0x1ad),'type':'string','description':a165_0x214bdc(0x161)},{'name':a165_0x214bdc(0x13c),'type':a165_0x214bdc(0x1b8),'required':!![],'description':a165_0x214bdc(0x13b)},{'name':a165_0x214bdc(0x15e),'type':a165_0x214bdc(0x1b8),'description':a165_0x214bdc(0x1b2)},{'name':a165_0x214bdc(0x16d),'type':a165_0x214bdc(0x164),'description':'Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2b5cbf){parseInput(_0x2b5cbf),requireExplicitYes(_0x2b5cbf);},async 'dryRun'(_0xcb5772){const _0x370143=a165_0x214bdc,_0x24fd3b=await buildPlan(_0xcb5772,!![]),_0x2955cc=_0x24fd3b['plan'][_0x370143(0x14b)]?.['length']??0x0,_0x4979e7=_0x24fd3b[_0x370143(0x169)][_0x370143(0x152)]['length']-_0x2955cc;return menuDryRunResult(_0x24fd3b[_0x370143(0x169)],{'method':_0x370143(0x1b4),'url':'/smartapi/menu/update','body':{'updates':_0x24fd3b['plan'][_0x370143(0x14b)]?.[_0x370143(0x145)](_0x1c8a25=>_0x1c8a25[_0x370143(0x167)])??[]},'description':_0x370143(0x18a)+_0x2955cc+_0x370143(0x144)+_0x4979e7+_0x370143(0x19c)});},async 'execute'(_0x4a9f49){const _0x5e2d4c=a165_0x214bdc;requireExplicitYes(_0x4a9f49);const _0x3a60e8=await buildPlan(_0x4a9f49,![]);await recheckMutationSnapshot(_0x4a9f49,_0x3a60e8['plan'],_0x5e2d4c(0x1a8));const _0x3b3c71=[],_0x249c4f=[],_0x178945=[];for(const _0xbf38bf of _0x3a60e8[_0x5e2d4c(0x169)][_0x5e2d4c(0x152)]){if(_0xbf38bf[_0x5e2d4c(0x177)][_0x5e2d4c(0x13c)]===_0x3a60e8['plan'][_0x5e2d4c(0x19f)]){_0x3b3c71[_0x5e2d4c(0x1aa)]({'id':_0xbf38bf['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0x4a9f49['appCode'],_0x4a9f49['cookie'],{'id':_0xbf38bf['id'],'visible':_0x3a60e8[_0x5e2d4c(0x169)]['requestedVisible']}),_0x3b3c71[_0x5e2d4c(0x1aa)]({'id':_0xbf38bf['id'],'updated':!![],'skipped':![]});}catch(_0x10e610){const _0x47e92f=mapMenuApiError(_0x10e610,_0x5e2d4c(0x194),_0xbf38bf['id']);if(isMenuResponseLoss(_0x10e610)&&_0x47e92f[_0x5e2d4c(0x14d)]!==_0x5e2d4c(0x18d)){_0x178945['push'](_0xbf38bf['id']);continue;}_0x249c4f['push']({'id':_0xbf38bf['id'],'stage':'update','code':_0x47e92f['code'],'message':_0x47e92f[_0x5e2d4c(0x14a)]});}}let _0x3aa3c0;try{_0x3aa3c0=await fetchMenuSnapshot(_0x4a9f49['appCode'],_0x4a9f49[_0x5e2d4c(0x14e)]);}catch(_0x2c17ad){const _0x4a2280=describeMenuErrorCause(_0x2c17ad,_0x5e2d4c(0x195)),_0x312335=_0x178945[_0x5e2d4c(0x145)](_0x2101c7=>({'id':_0x2101c7,'stage':_0x5e2d4c(0x19b),'code':_0x5e2d4c(0x1a1),'message':'Response\x20was\x20lost\x20for\x20menu\x20'+_0x2101c7+_0x5e2d4c(0x16f),'requestedStateConfirmed':![],'recovered':![]})),_0x44af5f={'stage':_0x5e2d4c(0x15d),'code':_0x5e2d4c(0x1a1),'message':_0x5e2d4c(0x182),'targetIds':_0x3a60e8[_0x5e2d4c(0x169)][_0x5e2d4c(0x152)][_0x5e2d4c(0x145)](_0x335170=>_0x335170['id']),'requestedStateConfirmed':![],..._0x4a2280};throw menuFailure(asVerificationError(_0x2c17ad,_0x5e2d4c(0x178)),_0x3a60e8['plan'],{'stage':_0x5e2d4c(0x15d),'succeeded':_0x3b3c71,'failedRecords':[..._0x249c4f,..._0x312335,_0x44af5f],'warnings':[_0x5e2d4c(0x17d)],'verification':{'status':_0x5e2d4c(0x17c),'recoveredCount':0x0,'lookupCommand':_0x5e2d4c(0x176)}});}const _0x2d11a4=[];for(const _0x4614cf of _0x3b3c71){const _0x224ae6=Number(_0x4614cf['id']),_0x46991e=_0x3a60e8[_0x5e2d4c(0x15c)][_0x5e2d4c(0x191)](_0x224ae6),_0x10084c=_0x3aa3c0[_0x5e2d4c(0x185)][_0x5e2d4c(0x191)](_0x224ae6);try{verifyVisibilityUpdate(_0x46991e,_0x10084c,_0x3a60e8['plan'][_0x5e2d4c(0x19f)]);}catch(_0x3d932a){const _0x1ea0a1=asVerificationError(_0x3d932a,_0x5e2d4c(0x17e)+_0x224ae6+'\x20visibility\x20update\x20could\x20not\x20be\x20verified');_0x2d11a4['push']({'id':_0x224ae6,'stage':_0x5e2d4c(0x15d),'code':_0x1ea0a1[_0x5e2d4c(0x14d)],'message':_0x1ea0a1[_0x5e2d4c(0x14a)],'requestedStateConfirmed':![]});}}for(const _0x43bbc2 of _0x178945){const _0x292de1=_0x3a60e8[_0x5e2d4c(0x15c)][_0x5e2d4c(0x191)](_0x43bbc2),_0x3f3612=_0x3aa3c0[_0x5e2d4c(0x185)][_0x5e2d4c(0x191)](_0x43bbc2);try{verifyVisibilityUpdate(_0x292de1,_0x3f3612,_0x3a60e8[_0x5e2d4c(0x169)][_0x5e2d4c(0x19f)]),_0x3b3c71[_0x5e2d4c(0x1aa)]({'id':_0x43bbc2,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0x24ec21){const _0x560f2b=asVerificationError(_0x24ec21,_0x5e2d4c(0x13a)+_0x43bbc2+_0x5e2d4c(0x175));_0x2d11a4['push']({'id':_0x43bbc2,'stage':_0x5e2d4c(0x19b),'code':_0x560f2b['code'],'message':_0x560f2b[_0x5e2d4c(0x14a)],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x2d11a4[_0x5e2d4c(0x1a7)]>0x0){const _0x941677=_0x2d11a4[_0x5e2d4c(0x145)](_0x4bd8b7=>Number(_0x4bd8b7['id'])),_0x506bf1=_0x3b3c71['filter'](_0x5d50a8=>_0x5d50a8[_0x5e2d4c(0x1a5)]===!![])['length'],_0x5a1176=menuError(_0x5e2d4c(0x1a1),'Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20'+_0x941677[_0x5e2d4c(0x1b0)](',\x20')+'.',_0x5e2d4c(0x1a9));throw menuFailure(_0x5a1176,_0x3a60e8[_0x5e2d4c(0x169)],{'stage':_0x5e2d4c(0x15d),'succeeded':_0x3b3c71,'failedRecords':[..._0x249c4f,..._0x2d11a4],'warnings':[_0x5e2d4c(0x18f)],'verification':{'status':_0x5e2d4c(0x17c),..._0x941677[_0x5e2d4c(0x1a7)]===0x1?{'targetId':_0x941677[0x0]}:{'targetIds':_0x941677},'recoveredCount':_0x506bf1,'lookupCommand':_0x5e2d4c(0x176)}});}const _0x3e7831=_0x3b3c71['filter'](_0xbcc99b=>_0xbcc99b[_0x5e2d4c(0x193)]===!![])['length'],_0x9dc8ed=_0x3b3c71[_0x5e2d4c(0x1a7)]-_0x3e7831,_0x1a280a={..._0x3a60e8[_0x5e2d4c(0x169)],'succeeded':_0x3b3c71,'failed':_0x249c4f,'warnings':_0x249c4f[_0x5e2d4c(0x1a7)]>0x0?[..._0x3a60e8[_0x5e2d4c(0x169)][_0x5e2d4c(0x1a0)],_0x5e2d4c(0x160)]:_0x3a60e8[_0x5e2d4c(0x169)][_0x5e2d4c(0x1a0)],'verification':{'checkedBy':_0x5e2d4c(0x1a4),'snapshotHash':_0x3aa3c0['hash'],'matchesRequestedState':_0x249c4f['length']===0x0,'recoveredCount':_0x178945[_0x5e2d4c(0x1a7)]}};return{'ok':_0x249c4f[_0x5e2d4c(0x1a7)]===0x0,'data':_0x1a280a,'message':_0x249c4f['length']===0x0?_0x5e2d4c(0x146)+_0x3e7831+'\x20menu(s);\x20skipped\x20'+_0x9dc8ed+_0x5e2d4c(0x19c):_0x5e2d4c(0x180)+_0x3e7831+'\x20updated,\x20'+_0x9dc8ed+_0x5e2d4c(0x154)+_0x249c4f[_0x5e2d4c(0x1a7)]+_0x5e2d4c(0x192)};}};function a165_0x391d(_0x1a72b7,_0x51e621){_0x1a72b7=_0x1a72b7-0x13a;const _0x5b507d=a165_0x5b50();let _0x391d0a=_0x5b507d[_0x1a72b7];return _0x391d0a;}function parseInput(_0x287d36){const _0x3b2173=a165_0x214bdc,_0x112566=parseMenuIds(_0x287d36['str'](_0x3b2173(0x1af))),_0x1f6c99=parseCsv(_0x287d36[_0x3b2173(0x14f)](_0x3b2173(0x1ad)));if(_0x112566[_0x3b2173(0x1a7)]===0x0&&_0x1f6c99[_0x3b2173(0x1a7)]===0x0)throw CliErrors[_0x3b2173(0x16a)](_0x3b2173(0x14c));const _0x1ea64b=parseBooleanFlag(_0x287d36,_0x3b2173(0x13c),!![]),_0x17d1cf=parseBooleanFlag(_0x287d36,_0x3b2173(0x15e),![]);let _0x2da380;if(hasFlag(_0x287d36,_0x3b2173(0x16d))){_0x2da380=_0x287d36[_0x3b2173(0x174)](_0x3b2173(0x16d));if(!Number[_0x3b2173(0x163)](_0x2da380)||_0x2da380<0x0)throw CliErrors[_0x3b2173(0x16a)](_0x3b2173(0x143));}return{'menuIds':_0x112566,'paths':_0x1f6c99,'visible':_0x1ea64b,'expectVisible':_0x17d1cf,'expectedCount':_0x2da380};}async function buildPlan(_0x3ff92d,_0x4c39a6){const _0x10dfc5=a165_0x214bdc,_0x4682dd=parseInput(_0x3ff92d),_0x178f03=await fetchMutationSnapshot(_0x3ff92d,_0x10dfc5(0x1a8)),_0x271d20=selectTargets(_0x178f03[_0x10dfc5(0x173)],_0x4682dd[_0x10dfc5(0x18b)],_0x4682dd[_0x10dfc5(0x1ad)]);if(_0x4682dd[_0x10dfc5(0x1ba)]!==undefined&&_0x271d20[_0x10dfc5(0x1a7)]!==_0x4682dd[_0x10dfc5(0x1ba)])throw menuError(_0x10dfc5(0x150),'Selected\x20'+_0x271d20['length']+_0x10dfc5(0x1ac)+_0x4682dd[_0x10dfc5(0x1ba)]+'.',_0x10dfc5(0x1b7));if(_0x4682dd['expectVisible']!==undefined){const _0x10e693=_0x271d20[_0x10dfc5(0x141)](_0xe5e6cd=>_0xe5e6cd[_0x10dfc5(0x13c)]!==_0x4682dd[_0x10dfc5(0x157)]);if(_0x10e693[_0x10dfc5(0x1a7)]>0x0)throw menuError('menu_state_drift',_0x10dfc5(0x187)+_0x10e693['map'](_0x22d266=>_0x22d266['id'])[_0x10dfc5(0x1b0)](',\x20')+'.',_0x10dfc5(0x197));}const _0x2f0fcd=_0x271d20[_0x10dfc5(0x145)](_0x29346c=>({'id':_0x29346c['id'],'label':_0x29346c['label'],'path':_0x29346c[_0x10dfc5(0x1b5)],'before':{'visible':_0x29346c[_0x10dfc5(0x13c)]},'after':{'visible':_0x4682dd[_0x10dfc5(0x13c)]}})),_0x311cf1=_0x2f0fcd[_0x10dfc5(0x141)](_0x2cbcf5=>_0x2cbcf5['before'][_0x10dfc5(0x13c)]!==_0x4682dd[_0x10dfc5(0x13c)])[_0x10dfc5(0x145)](_0x449ae9=>({'stage':_0x10dfc5(0x13f),'method':_0x10dfc5(0x1b4),'path':_0x10dfc5(0x1b6),'body':{'appCode':_0x3ff92d[_0x10dfc5(0x196)],'id':_0x449ae9['id'],'visible':_0x4682dd[_0x10dfc5(0x13c)]}})),_0x49ccc6=mutationResult({'operation':_0x10dfc5(0x179),'selector':{'menuIds':_0x4682dd[_0x10dfc5(0x18b)],'paths':_0x4682dd[_0x10dfc5(0x1ad)]},'before':{'menus':_0x271d20['map'](_0x28228e=>({'id':_0x28228e['id'],'path':_0x28228e[_0x10dfc5(0x1b5)],'visible':_0x28228e['visible']}))},'after':{'menus':_0x271d20[_0x10dfc5(0x145)](_0x2bbec6=>({'id':_0x2bbec6['id'],'path':_0x2bbec6[_0x10dfc5(0x1b5)],'visible':_0x4682dd[_0x10dfc5(0x13c)]}))},'dryRun':_0x4c39a6,'backend':[...BACKEND],'plannedActions':_0x311cf1,'snapshotHash':_0x178f03['hash'],'warnings':_0x311cf1['length']===0x0?[_0x10dfc5(0x189)]:[]});return{'plan':{..._0x49ccc6,'requestedVisible':_0x4682dd[_0x10dfc5(0x13c)],'targets':_0x2f0fcd},'beforeById':new Map(_0x271d20[_0x10dfc5(0x145)](_0x2c2dd9=>[_0x2c2dd9['id'],_0x2c2dd9]))};}function selectTargets(_0x4772a0,_0xfee997,_0x2ea841){const _0x2761dc=a165_0x214bdc,_0x1a8c9a=new Map(_0x4772a0[_0x2761dc(0x145)](_0x3e2820=>[_0x3e2820['id'],_0x3e2820])),_0x1ac121=new Map(),_0xf14c21=_0xfee997[_0x2761dc(0x141)](_0x6e5e4c=>!_0x1a8c9a[_0x2761dc(0x16e)](_0x6e5e4c));if(_0xf14c21[_0x2761dc(0x1a7)]>0x0)throw menuError(_0x2761dc(0x151),'Menu\x20id\x20selector(s)\x20not\x20found:\x20'+_0xf14c21[_0x2761dc(0x1b0)](',\x20')+'.',_0x2761dc(0x16b));for(const _0x9bb53e of _0xfee997){_0x1ac121['set'](_0x9bb53e,_0x1a8c9a['get'](_0x9bb53e));}for(const _0x4799bf of _0x2ea841){const _0x410ba5=_0x4772a0[_0x2761dc(0x141)](_0x5ca35a=>_0x5ca35a[_0x2761dc(0x1b5)]===_0x4799bf);if(_0x410ba5[_0x2761dc(0x1a7)]===0x0)throw menuError(_0x2761dc(0x151),_0x2761dc(0x181)+JSON[_0x2761dc(0x18e)](_0x4799bf)+'.',_0x2761dc(0x162));if(_0x410ba5['length']>0x1)throw menuError('menu_selector_ambiguous',_0x2761dc(0x156)+JSON['stringify'](_0x4799bf)+'.',_0x2761dc(0x1b3)+_0x410ba5[_0x2761dc(0x145)](_0xec8661=>_0xec8661['id'])[_0x2761dc(0x1b0)](',\x20')+'.');const _0x43a2aa=_0x410ba5[0x0];_0x1ac121[_0x2761dc(0x168)](_0x43a2aa['id'],_0x43a2aa);}return[..._0x1ac121[_0x2761dc(0x142)]()];}function parseMenuIds(_0x78b1fa){const _0x367d50=a165_0x214bdc,_0x45d717=parseCsv(_0x78b1fa),_0x502084=_0x45d717[_0x367d50(0x145)](Number);if(_0x502084[_0x367d50(0x1b1)](_0x22a5c4=>!Number[_0x367d50(0x163)](_0x22a5c4)||_0x22a5c4<=0x0))throw CliErrors[_0x367d50(0x16a)]('--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.');return[...new Set(_0x502084)];}function parseCsv(_0x2a7ba2){const _0x4ab817=a165_0x214bdc;return[...new Set(_0x2a7ba2[_0x4ab817(0x184)](',')['map'](_0x4d8325=>_0x4d8325[_0x4ab817(0x19e)]())[_0x4ab817(0x141)](Boolean))];}function parseBooleanFlag(_0x260d58,_0x32ec14,_0x310dbc){const _0x2714c2=a165_0x214bdc;if(!hasFlag(_0x260d58,_0x32ec14)){if(_0x310dbc)throw CliErrors['flagMissing'](_0x32ec14);return undefined;}const _0x27b135=_0x260d58[_0x2714c2(0x19a)][_0x32ec14];if(_0x27b135===!![]||_0x27b135===![])return _0x27b135;if(_0x27b135===_0x2714c2(0x159))return!![];if(_0x27b135===_0x2714c2(0x18c))return![];throw CliErrors[_0x2714c2(0x16a)]('--'+_0x32ec14+_0x2714c2(0x153));}function verifyVisibilityUpdate(_0x53297f,_0x3b7924,_0x1aa950){const _0x48ac54=a165_0x214bdc;assertVerified(!!_0x3b7924,'Menu\x20'+_0x53297f['id']+_0x48ac54(0x170)),assertVerified(_0x3b7924[_0x48ac54(0x13c)]===_0x1aa950,_0x48ac54(0x17e)+_0x53297f['id']+_0x48ac54(0x186));const _0x5575df=[['id',_0x3b7924['id'],_0x53297f['id']],[_0x48ac54(0x1ae),_0x3b7924[_0x48ac54(0x1ae)],_0x53297f[_0x48ac54(0x1ae)]],[_0x48ac54(0x155),_0x3b7924[_0x48ac54(0x155)],_0x53297f[_0x48ac54(0x155)]],[_0x48ac54(0x1ab),_0x3b7924[_0x48ac54(0x1ab)],_0x53297f[_0x48ac54(0x1ab)]],[_0x48ac54(0x1b5),_0x3b7924[_0x48ac54(0x1b5)],_0x53297f[_0x48ac54(0x1b5)]],[_0x48ac54(0x166),_0x3b7924['url'],_0x53297f[_0x48ac54(0x166)]],[_0x48ac54(0x148),_0x3b7924[_0x48ac54(0x148)],_0x53297f[_0x48ac54(0x148)]],[_0x48ac54(0x1a6),_0x3b7924[_0x48ac54(0x1a6)],_0x53297f[_0x48ac54(0x1a6)]],[_0x48ac54(0x17f),_0x3b7924[_0x48ac54(0x17f)],_0x53297f['resources']],[_0x48ac54(0x171),_0x3b7924[_0x48ac54(0x171)],_0x53297f['resourcesValid']],[_0x48ac54(0x1a3),_0x3b7924[_0x48ac54(0x1a3)],_0x53297f[_0x48ac54(0x1a3)]],[_0x48ac54(0x13d),_0x3b7924[_0x48ac54(0x13d)],_0x53297f['childrenCount']],['pageId',_0x3b7924[_0x48ac54(0x15f)],_0x53297f['pageId']],['pageType',_0x3b7924['pageType'],_0x53297f[_0x48ac54(0x13e)]],['modelType',_0x3b7924['modelType'],_0x53297f['modelType']],[_0x48ac54(0x19d),_0x3b7924[_0x48ac54(0x19d)],_0x53297f[_0x48ac54(0x19d)]],[_0x48ac54(0x199),_0x3b7924[_0x48ac54(0x199)],_0x53297f[_0x48ac54(0x199)]]];for(const [_0x10b6bc,_0x4a1802,_0x58b3a4]of _0x5575df){assertVerified(sameValue(_0x4a1802,_0x58b3a4),_0x48ac54(0x17e)+_0x53297f['id']+'\x20'+_0x10b6bc+_0x48ac54(0x16c));}}function sameValue(_0x4f5b9b,_0x2aae98){const _0x167017=a165_0x214bdc;if(Array[_0x167017(0x1b9)](_0x4f5b9b)||Array[_0x167017(0x1b9)](_0x2aae98))return JSON['stringify'](_0x4f5b9b)===JSON[_0x167017(0x18e)](_0x2aae98);return _0x4f5b9b===_0x2aae98;}
|
|
1
|
+
const a175_0xc3a003=a175_0x39ff;function a175_0x1abf(){const _0x475236=['11709170HFsrMt','map','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.','POST','Exact\x20comma-separated\x20menu\x20paths\x20to\x20update','expect-visible','/smartapi/menu/update','841npQeJT','Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','rabetbase\x20menu\x20list\x20--format\x20compress','menu_selector_not_found','menus','Menu\x20visibility\x20update\x20completed:\x20','\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','visibility-update','\x20skipped,\x20','pageId','verify\x20menu\x20visibility\x20update','42498yhgeuj','1861748pxveSL','string','Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','boolean','length','expected-count','Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20','\x20was\x20not\x20found\x20during\x20visibility\x20verification.','resources','menu_state_drift','\x20menu(s);\x20skipped\x20','Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20','isArray','depth','split','menu-ids','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','update-recovery','some','filter','Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches','update\x20visibility\x20for','label','before','One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','trim','plan','visible','\x20visibility\x20could\x20not\x20be\x20verified\x20safely','Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility','str','\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.','18372rlPdRG','has','menu_verification_failed','verification','1685kQAgXo','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20','set','hash','childrenIds','expectVisible','\x20visibility\x20update\x20could\x20not\x20be\x20verified','resourcesValid','menuIds','path','appCode','12rxfDop','3604876LqFrJM','Menu\x20id\x20selector(s)\x20not\x20found:\x20','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.','validation','menu\x20list','targets','isSafeInteger','Would\x20update\x20visibility\x20for\x20','1712OcqWkS','Requested\x20menu\x20visibility','datasetId','Menu\x20path\x20selector\x20not\x20found:\x20','num','\x20updated,\x20','message','modelType','childrenCount','high-risk-write','menu_permission_denied','paths','update-menu-visibility','plannedActions','Final\x20menu\x20visibility\x20readback\x20failed.','Selected\x20','3IvUVhg','Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state','body','10teDWKx','menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.','join','push','Menu\x20','get','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.','menu','Response\x20was\x20lost\x20and\x20menu\x20','requestedVisible','warnings','beforeById','\x20unchanged\x20menu(s).','parentId','\x20must\x20be\x20true\x20or\x20false.','cookie','stringify','Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.','\x20menu(s);\x20skip\x20','--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.','\x20menu(s),\x20expected\x20','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.','url','1002qCqzir','datasetCode','type','Response\x20was\x20lost\x20for\x20menu\x20','code','sort','update\x20menu\x20visibility','11263057xYYdAJ','expectedCount','true','byId'];a175_0x1abf=function(){return _0x475236;};return a175_0x1abf();}(function(_0x3562e9,_0x1fc911){const _0x34d2ea=a175_0x39ff,_0x1e6d4c=_0x3562e9();while(!![]){try{const _0xe2cf0d=parseInt(_0x34d2ea(0x7e))/0x1*(-parseInt(_0x34d2ea(0xed))/0x2)+-parseInt(_0x34d2ea(0xd2))/0x3*(-parseInt(_0x34d2ea(0xba))/0x4)+-parseInt(_0x34d2ea(0xae))/0x5*(-parseInt(_0x34d2ea(0xaa))/0x6)+parseInt(_0x34d2ea(0x8a))/0x7+parseInt(_0x34d2ea(0xc2))/0x8*(-parseInt(_0x34d2ea(0x89))/0x9)+-parseInt(_0x34d2ea(0xd5))/0xa*(parseInt(_0x34d2ea(0x77))/0xb)+parseInt(_0x34d2ea(0xb9))/0xc*(parseInt(_0x34d2ea(0x73))/0xd);if(_0xe2cf0d===_0x1fc911)break;else _0x1e6d4c['push'](_0x1e6d4c['shift']());}catch(_0x1e80f5){_0x1e6d4c['push'](_0x1e6d4c['shift']());}}}(a175_0x1abf,0x8af3b));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../commands/menu/shared/facts.js';import{asVerificationError,assertVerified,describeMenuErrorCause,fetchMutationSnapshot,hasFlag,isMenuResponseLoss,mapMenuApiError,menuDryRunResult,menuError,menuFailure,mutationResult,recheckMutationSnapshot,requireExplicitYes}from'../../commands/menu/shared/mutations.js';import{updateMenuEntity}from'../../commands/menu/shared/service.js';function a175_0x39ff(_0x25978f,_0xfcd833){_0x25978f=_0x25978f-0x6e;const _0x1abf5e=a175_0x1abf();let _0x39ffb3=_0x1abf5e[_0x25978f];return _0x39ffb3;}import{CliErrors}from'../../errors.js';const BACKEND=[{'method':'POST','path':a175_0xc3a003(0x7d)}];export const menuVisibilityUpdate={'service':a175_0xc3a003(0xdc),'command':a175_0xc3a003(0x85),'description':a175_0xc3a003(0x7f),'risk':a175_0xc3a003(0xcb),'structuredErrors':!![],'flags':[{'name':a175_0xc3a003(0x99),'type':a175_0xc3a003(0x8b),'description':'Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update'},{'name':a175_0xc3a003(0xcd),'type':'string','description':a175_0xc3a003(0x7b)},{'name':a175_0xc3a003(0xa5),'type':a175_0xc3a003(0x8d),'required':!![],'description':a175_0xc3a003(0xc3)},{'name':a175_0xc3a003(0x7c),'type':a175_0xc3a003(0x8d),'description':a175_0xc3a003(0xa7)},{'name':a175_0xc3a003(0x8f),'type':'number','description':a175_0xc3a003(0x9e)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x30c0b0){parseInput(_0x30c0b0),requireExplicitYes(_0x30c0b0);},async 'dryRun'(_0xcf0aa4){const _0x4bbe53=a175_0xc3a003,_0x2bcc4e=await buildPlan(_0xcf0aa4,!![]),_0x31cbc5=_0x2bcc4e['plan'][_0x4bbe53(0xcf)]?.[_0x4bbe53(0x8e)]??0x0,_0x45599b=_0x2bcc4e[_0x4bbe53(0xa4)]['targets'][_0x4bbe53(0x8e)]-_0x31cbc5;return menuDryRunResult(_0x2bcc4e['plan'],{'method':'POST','url':_0x4bbe53(0x7d),'body':{'updates':_0x2bcc4e[_0x4bbe53(0xa4)][_0x4bbe53(0xcf)]?.[_0x4bbe53(0x78)](_0x3fc07c=>_0x3fc07c[_0x4bbe53(0xd4)])??[]},'description':_0x4bbe53(0xc1)+_0x31cbc5+_0x4bbe53(0xe7)+_0x45599b+_0x4bbe53(0xe1)});},async 'execute'(_0x2772ba){const _0xa0da53=a175_0xc3a003;requireExplicitYes(_0x2772ba);const _0x3b0745=await buildPlan(_0x2772ba,![]);await recheckMutationSnapshot(_0x2772ba,_0x3b0745[_0xa0da53(0xa4)],_0xa0da53(0x72));const _0x3c7d23=[],_0x2c56b5=[],_0x52cc1c=[];for(const _0x38ecc6 of _0x3b0745[_0xa0da53(0xa4)][_0xa0da53(0xbf)]){if(_0x38ecc6[_0xa0da53(0xa1)]['visible']===_0x3b0745[_0xa0da53(0xa4)][_0xa0da53(0xde)]){_0x3c7d23['push']({'id':_0x38ecc6['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0x2772ba['appCode'],_0x2772ba[_0xa0da53(0xe4)],{'id':_0x38ecc6['id'],'visible':_0x3b0745[_0xa0da53(0xa4)][_0xa0da53(0xde)]}),_0x3c7d23['push']({'id':_0x38ecc6['id'],'updated':!![],'skipped':![]});}catch(_0x4f7bf1){const _0x4f7a8a=mapMenuApiError(_0x4f7bf1,_0xa0da53(0x9f),_0x38ecc6['id']);if(isMenuResponseLoss(_0x4f7bf1)&&_0x4f7a8a['code']!==_0xa0da53(0xcc)){_0x52cc1c[_0xa0da53(0xd8)](_0x38ecc6['id']);continue;}_0x2c56b5['push']({'id':_0x38ecc6['id'],'stage':'update','code':_0x4f7a8a[_0xa0da53(0x70)],'message':_0x4f7a8a[_0xa0da53(0xc8)]});}}let _0x507c03;try{_0x507c03=await fetchMenuSnapshot(_0x2772ba[_0xa0da53(0xb8)],_0x2772ba[_0xa0da53(0xe4)]);}catch(_0x4fcb7b){const _0x590ee3=describeMenuErrorCause(_0x4fcb7b,_0xa0da53(0x88)),_0x3b3761=_0x52cc1c[_0xa0da53(0x78)](_0x1e4911=>({'id':_0x1e4911,'stage':_0xa0da53(0x9b),'code':_0xa0da53(0xac),'message':_0xa0da53(0x6f)+_0x1e4911+_0xa0da53(0x84),'requestedStateConfirmed':![],'recovered':![]})),_0x2cea28={'stage':_0xa0da53(0xad),'code':_0xa0da53(0xac),'message':_0xa0da53(0xd0),'targetIds':_0x3b0745['plan'][_0xa0da53(0xbf)]['map'](_0x59bb6a=>_0x59bb6a['id']),'requestedStateConfirmed':![],..._0x590ee3};throw menuFailure(asVerificationError(_0x4fcb7b,_0xa0da53(0xd3)),_0x3b0745[_0xa0da53(0xa4)],{'stage':_0xa0da53(0xad),'succeeded':_0x3c7d23,'failedRecords':[..._0x2c56b5,..._0x3b3761,_0x2cea28],'warnings':['The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.'],'verification':{'status':'failed','recoveredCount':0x0,'lookupCommand':_0xa0da53(0x80)}});}const _0x43c3fb=[];for(const _0x5cc299 of _0x3c7d23){const _0x53860a=Number(_0x5cc299['id']),_0x15afb2=_0x3b0745[_0xa0da53(0xe0)]['get'](_0x53860a),_0x1b0a1a=_0x507c03[_0xa0da53(0x76)]['get'](_0x53860a);try{verifyVisibilityUpdate(_0x15afb2,_0x1b0a1a,_0x3b0745[_0xa0da53(0xa4)][_0xa0da53(0xde)]);}catch(_0xb95a65){const _0x460eb2=asVerificationError(_0xb95a65,_0xa0da53(0xd9)+_0x53860a+_0xa0da53(0xb4));_0x43c3fb[_0xa0da53(0xd8)]({'id':_0x53860a,'stage':_0xa0da53(0xad),'code':_0x460eb2[_0xa0da53(0x70)],'message':_0x460eb2[_0xa0da53(0xc8)],'requestedStateConfirmed':![]});}}for(const _0x86b4e5 of _0x52cc1c){const _0x1ba90e=_0x3b0745['beforeById'][_0xa0da53(0xda)](_0x86b4e5),_0x399d8e=_0x507c03[_0xa0da53(0x76)][_0xa0da53(0xda)](_0x86b4e5);try{verifyVisibilityUpdate(_0x1ba90e,_0x399d8e,_0x3b0745['plan'][_0xa0da53(0xde)]),_0x3c7d23['push']({'id':_0x86b4e5,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0x2b375d){const _0x54f22d=asVerificationError(_0x2b375d,_0xa0da53(0xdd)+_0x86b4e5+_0xa0da53(0xa6));_0x43c3fb['push']({'id':_0x86b4e5,'stage':_0xa0da53(0x9b),'code':_0x54f22d[_0xa0da53(0x70)],'message':_0x54f22d[_0xa0da53(0xc8)],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x43c3fb[_0xa0da53(0x8e)]>0x0){const _0x293f5c=_0x43c3fb[_0xa0da53(0x78)](_0xf831c6=>Number(_0xf831c6['id'])),_0xcab98a=_0x3c7d23['filter'](_0x1360e3=>_0x1360e3['recovered']===!![])[_0xa0da53(0x8e)],_0x380f57=menuError(_0xa0da53(0xac),_0xa0da53(0x95)+_0x293f5c[_0xa0da53(0xd7)](',\x20')+'.',_0xa0da53(0xe9));throw menuFailure(_0x380f57,_0x3b0745['plan'],{'stage':_0xa0da53(0xad),'succeeded':_0x3c7d23,'failedRecords':[..._0x2c56b5,..._0x43c3fb],'warnings':[_0xa0da53(0xa2)],'verification':{'status':'failed',..._0x293f5c[_0xa0da53(0x8e)]===0x1?{'targetId':_0x293f5c[0x0]}:{'targetIds':_0x293f5c},'recoveredCount':_0xcab98a,'lookupCommand':_0xa0da53(0x80)}});}const _0x48bc66=_0x3c7d23[_0xa0da53(0x9d)](_0x3cac83=>_0x3cac83['updated']===!![])[_0xa0da53(0x8e)],_0x46194f=_0x3c7d23['length']-_0x48bc66,_0x182f24={..._0x3b0745[_0xa0da53(0xa4)],'succeeded':_0x3c7d23,'failed':_0x2c56b5,'warnings':_0x2c56b5[_0xa0da53(0x8e)]>0x0?[..._0x3b0745['plan'][_0xa0da53(0xdf)],_0xa0da53(0x8c)]:_0x3b0745[_0xa0da53(0xa4)][_0xa0da53(0xdf)],'verification':{'checkedBy':_0xa0da53(0xbe),'snapshotHash':_0x507c03[_0xa0da53(0xb1)],'matchesRequestedState':_0x2c56b5['length']===0x0,'recoveredCount':_0x52cc1c['length']}};return{'ok':_0x2c56b5['length']===0x0,'data':_0x182f24,'message':_0x2c56b5[_0xa0da53(0x8e)]===0x0?'Updated\x20visibility\x20for\x20'+_0x48bc66+_0xa0da53(0x94)+_0x46194f+_0xa0da53(0xe1):_0xa0da53(0x83)+_0x48bc66+_0xa0da53(0xc7)+_0x46194f+_0xa0da53(0x86)+_0x2c56b5[_0xa0da53(0x8e)]+'\x20failed.'};}};function parseInput(_0x37173d){const _0x3d7fc0=a175_0xc3a003,_0x3a8b41=parseMenuIds(_0x37173d[_0x3d7fc0(0xa8)](_0x3d7fc0(0x99))),_0x4f9050=parseCsv(_0x37173d['str']('paths'));if(_0x3a8b41[_0x3d7fc0(0x8e)]===0x0&&_0x4f9050[_0x3d7fc0(0x8e)]===0x0)throw CliErrors[_0x3d7fc0(0xbd)](_0x3d7fc0(0xd6));const _0x2ce9cd=parseBooleanFlag(_0x37173d,_0x3d7fc0(0xa5),!![]),_0x1db070=parseBooleanFlag(_0x37173d,_0x3d7fc0(0x7c),![]);let _0x209dc4;if(hasFlag(_0x37173d,_0x3d7fc0(0x8f))){_0x209dc4=_0x37173d[_0x3d7fc0(0xc6)](_0x3d7fc0(0x8f));if(!Number[_0x3d7fc0(0xc0)](_0x209dc4)||_0x209dc4<0x0)throw CliErrors['validation'](_0x3d7fc0(0xe8));}return{'menuIds':_0x3a8b41,'paths':_0x4f9050,'visible':_0x2ce9cd,'expectVisible':_0x1db070,'expectedCount':_0x209dc4};}async function buildPlan(_0x22cdd,_0xbabb25){const _0x3dcb0b=a175_0xc3a003,_0x86541=parseInput(_0x22cdd),_0x1f368d=await fetchMutationSnapshot(_0x22cdd,_0x3dcb0b(0x72)),_0x253741=selectTargets(_0x1f368d[_0x3dcb0b(0x82)],_0x86541['menuIds'],_0x86541[_0x3dcb0b(0xcd)]);if(_0x86541['expectedCount']!==undefined&&_0x253741[_0x3dcb0b(0x8e)]!==_0x86541[_0x3dcb0b(0x74)])throw menuError('menu_expected_count_mismatch',_0x3dcb0b(0xd1)+_0x253741[_0x3dcb0b(0x8e)]+_0x3dcb0b(0xea)+_0x86541[_0x3dcb0b(0x74)]+'.',_0x3dcb0b(0x79));if(_0x86541['expectVisible']!==undefined){const _0x2d76ae=_0x253741[_0x3dcb0b(0x9d)](_0x19fcb9=>_0x19fcb9['visible']!==_0x86541[_0x3dcb0b(0xb3)]);if(_0x2d76ae['length']>0x0)throw menuError(_0x3dcb0b(0x93),_0x3dcb0b(0x90)+_0x2d76ae['map'](_0xcd6e70=>_0xcd6e70['id'])[_0x3dcb0b(0xd7)](',\x20')+'.',_0x3dcb0b(0xbc));}const _0x58f2c9=_0x253741[_0x3dcb0b(0x78)](_0x456ed9=>({'id':_0x456ed9['id'],'label':_0x456ed9[_0x3dcb0b(0xa0)],'path':_0x456ed9[_0x3dcb0b(0xb7)],'before':{'visible':_0x456ed9[_0x3dcb0b(0xa5)]},'after':{'visible':_0x86541[_0x3dcb0b(0xa5)]}})),_0x55d3ef=_0x58f2c9[_0x3dcb0b(0x9d)](_0x44e516=>_0x44e516[_0x3dcb0b(0xa1)][_0x3dcb0b(0xa5)]!==_0x86541['visible'])[_0x3dcb0b(0x78)](_0x31f03b=>({'stage':_0x3dcb0b(0xce),'method':_0x3dcb0b(0x7a),'path':_0x3dcb0b(0x7d),'body':{'appCode':_0x22cdd[_0x3dcb0b(0xb8)],'id':_0x31f03b['id'],'visible':_0x86541[_0x3dcb0b(0xa5)]}})),_0x35e91e=mutationResult({'operation':'visibility-update','selector':{'menuIds':_0x86541[_0x3dcb0b(0xb6)],'paths':_0x86541[_0x3dcb0b(0xcd)]},'before':{'menus':_0x253741[_0x3dcb0b(0x78)](_0x4de299=>({'id':_0x4de299['id'],'path':_0x4de299[_0x3dcb0b(0xb7)],'visible':_0x4de299['visible']}))},'after':{'menus':_0x253741[_0x3dcb0b(0x78)](_0x2beaaf=>({'id':_0x2beaaf['id'],'path':_0x2beaaf[_0x3dcb0b(0xb7)],'visible':_0x86541[_0x3dcb0b(0xa5)]}))},'dryRun':_0xbabb25,'backend':[...BACKEND],'plannedActions':_0x55d3ef,'snapshotHash':_0x1f368d[_0x3dcb0b(0xb1)],'warnings':_0x55d3ef[_0x3dcb0b(0x8e)]===0x0?[_0x3dcb0b(0xe6)]:[]});return{'plan':{..._0x35e91e,'requestedVisible':_0x86541[_0x3dcb0b(0xa5)],'targets':_0x58f2c9},'beforeById':new Map(_0x253741[_0x3dcb0b(0x78)](_0x867732=>[_0x867732['id'],_0x867732]))};}function selectTargets(_0x59043c,_0x20dafa,_0x39e2be){const _0x1f8bd1=a175_0xc3a003,_0x184eef=new Map(_0x59043c[_0x1f8bd1(0x78)](_0x122ecb=>[_0x122ecb['id'],_0x122ecb])),_0x9482c1=new Map(),_0x5bd2ee=_0x20dafa[_0x1f8bd1(0x9d)](_0x36ea37=>!_0x184eef[_0x1f8bd1(0xab)](_0x36ea37));if(_0x5bd2ee[_0x1f8bd1(0x8e)]>0x0)throw menuError(_0x1f8bd1(0x81),_0x1f8bd1(0xbb)+_0x5bd2ee[_0x1f8bd1(0xd7)](',\x20')+'.',_0x1f8bd1(0xeb));for(const _0x4c4350 of _0x20dafa){_0x9482c1[_0x1f8bd1(0xb0)](_0x4c4350,_0x184eef[_0x1f8bd1(0xda)](_0x4c4350));}for(const _0x340d4f of _0x39e2be){const _0xb773a5=_0x59043c[_0x1f8bd1(0x9d)](_0x45aac4=>_0x45aac4[_0x1f8bd1(0xb7)]===_0x340d4f);if(_0xb773a5['length']===0x0)throw menuError(_0x1f8bd1(0x81),_0x1f8bd1(0xc5)+JSON[_0x1f8bd1(0xe5)](_0x340d4f)+'.',_0x1f8bd1(0xdb));if(_0xb773a5[_0x1f8bd1(0x8e)]>0x1)throw menuError('menu_selector_ambiguous','Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20'+JSON[_0x1f8bd1(0xe5)](_0x340d4f)+'.',_0x1f8bd1(0xaf)+_0xb773a5['map'](_0xd429b6=>_0xd429b6['id'])[_0x1f8bd1(0xd7)](',\x20')+'.');const _0x2adb1e=_0xb773a5[0x0];_0x9482c1['set'](_0x2adb1e['id'],_0x2adb1e);}return[..._0x9482c1['values']()];}function parseMenuIds(_0x485bce){const _0x8936c8=a175_0xc3a003,_0x4467e8=parseCsv(_0x485bce),_0x525643=_0x4467e8[_0x8936c8(0x78)](Number);if(_0x525643[_0x8936c8(0x9c)](_0x15b8be=>!Number[_0x8936c8(0xc0)](_0x15b8be)||_0x15b8be<=0x0))throw CliErrors['validation'](_0x8936c8(0x9a));return[...new Set(_0x525643)];}function parseCsv(_0x20d778){const _0x5cd44d=a175_0xc3a003;return[...new Set(_0x20d778[_0x5cd44d(0x98)](',')[_0x5cd44d(0x78)](_0x482598=>_0x482598[_0x5cd44d(0xa3)]())['filter'](Boolean))];}function parseBooleanFlag(_0x366eb4,_0x2a06e8,_0x538464){const _0x3ccc72=a175_0xc3a003;if(!hasFlag(_0x366eb4,_0x2a06e8)){if(_0x538464)throw CliErrors['flagMissing'](_0x2a06e8);return undefined;}const _0x43f647=_0x366eb4['rawFlags'][_0x2a06e8];if(_0x43f647===!![]||_0x43f647===![])return _0x43f647;if(_0x43f647===_0x3ccc72(0x75))return!![];if(_0x43f647==='false')return![];throw CliErrors[_0x3ccc72(0xbd)]('--'+_0x2a06e8+_0x3ccc72(0xe3));}function verifyVisibilityUpdate(_0x2b918f,_0x5efe5b,_0x5a35a5){const _0x5e7fbc=a175_0xc3a003;assertVerified(!!_0x5efe5b,'Menu\x20'+_0x2b918f['id']+_0x5e7fbc(0x91)),assertVerified(_0x5efe5b[_0x5e7fbc(0xa5)]===_0x5a35a5,'Menu\x20'+_0x2b918f['id']+_0x5e7fbc(0xa9));const _0x3a3241=[['id',_0x5efe5b['id'],_0x2b918f['id']],[_0x5e7fbc(0xe2),_0x5efe5b['parentId'],_0x2b918f['parentId']],['depth',_0x5efe5b['depth'],_0x2b918f[_0x5e7fbc(0x97)]],[_0x5e7fbc(0xa0),_0x5efe5b['label'],_0x2b918f[_0x5e7fbc(0xa0)]],['path',_0x5efe5b['path'],_0x2b918f[_0x5e7fbc(0xb7)]],[_0x5e7fbc(0xec),_0x5efe5b[_0x5e7fbc(0xec)],_0x2b918f['url']],[_0x5e7fbc(0x6e),_0x5efe5b['type'],_0x2b918f[_0x5e7fbc(0x6e)]],['sort',_0x5efe5b[_0x5e7fbc(0x71)],_0x2b918f[_0x5e7fbc(0x71)]],[_0x5e7fbc(0x92),_0x5efe5b[_0x5e7fbc(0x92)],_0x2b918f[_0x5e7fbc(0x92)]],[_0x5e7fbc(0xb5),_0x5efe5b[_0x5e7fbc(0xb5)],_0x2b918f['resourcesValid']],[_0x5e7fbc(0xb2),_0x5efe5b['childrenIds'],_0x2b918f[_0x5e7fbc(0xb2)]],[_0x5e7fbc(0xca),_0x5efe5b['childrenCount'],_0x2b918f[_0x5e7fbc(0xca)]],[_0x5e7fbc(0x87),_0x5efe5b[_0x5e7fbc(0x87)],_0x2b918f[_0x5e7fbc(0x87)]],['pageType',_0x5efe5b['pageType'],_0x2b918f['pageType']],[_0x5e7fbc(0xc9),_0x5efe5b[_0x5e7fbc(0xc9)],_0x2b918f[_0x5e7fbc(0xc9)]],[_0x5e7fbc(0xc4),_0x5efe5b[_0x5e7fbc(0xc4)],_0x2b918f[_0x5e7fbc(0xc4)]],['datasetCode',_0x5efe5b['datasetCode'],_0x2b918f[_0x5e7fbc(0xee)]]];for(const [_0x1e20eb,_0x4efd4f,_0x54df3d]of _0x3a3241){assertVerified(sameValue(_0x4efd4f,_0x54df3d),_0x5e7fbc(0xd9)+_0x2b918f['id']+'\x20'+_0x1e20eb+'\x20changed\x20unexpectedly.');}}function sameValue(_0x52caa8,_0x1ee71d){const _0x18c536=a175_0xc3a003;if(Array['isArray'](_0x52caa8)||Array[_0x18c536(0x96)](_0x1ee71d))return JSON[_0x18c536(0xe5)](_0x52caa8)===JSON[_0x18c536(0xe5)](_0x1ee71d);return _0x52caa8===_0x1ee71d;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a176_0x451087=a176_0x482a;(function(_0x3fce97,_0x4140ea){const _0x5209b6=a176_0x482a,_0x3d816a=_0x3fce97();while(!![]){try{const _0x328bb2=parseInt(_0x5209b6(0x1bb))/0x1+-parseInt(_0x5209b6(0x1af))/0x2*(-parseInt(_0x5209b6(0x1bc))/0x3)+-parseInt(_0x5209b6(0x1a8))/0x4*(-parseInt(_0x5209b6(0x1a9))/0x5)+parseInt(_0x5209b6(0x1b4))/0x6+-parseInt(_0x5209b6(0x1b1))/0x7*(-parseInt(_0x5209b6(0x1b0))/0x8)+parseInt(_0x5209b6(0x1b2))/0x9*(parseInt(_0x5209b6(0x1aa))/0xa)+-parseInt(_0x5209b6(0x1a6))/0xb;if(_0x328bb2===_0x4140ea)break;else _0x3d816a['push'](_0x3d816a['shift']());}catch(_0x2242c8){_0x3d816a['push'](_0x3d816a['shift']());}}}(a176_0x2bdb,0xa1f92));function a176_0x2bdb(){const _0x43c3ce=['1989099XAePIo','appCode','6970860xiVeWd','Inspect\x20with\x20','Notification\x20config\x20create\x20returned\x20no\x20usable\x20server\x20ID.','isSafeInteger','POST','planned','channelConfig','474661jVEjEi','46239kHlaUd',';\x20do\x20not\x20resubmit\x20automatically.','/notification/channel-config/create','channelType','notification_config_create_outcome_unknown','Notification\x20config\x20create\x20outcome\x20is\x20unknown\x20because\x20no\x20server\x20ID\x20was\x20received.','verified','document','verification','connectTimeout','config-create','54524800McckDT','create','2200wLRBpE','11095LPKcTs','50OEIaZi','configName',';\x20do\x20not\x20resubmit.','Create\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20source','description','106EvmTFa','77368DFDFvf','609IRIHpg'];a176_0x2bdb=function(){return _0x43c3ce;};return a176_0x2bdb();}import{asDryRunResult}from'../../commands/common/dry-run.js';function a176_0x482a(_0x2cdcd7,_0x24c5e9){_0x2cdcd7=_0x2cdcd7-0x1a5;const _0x2bdb2e=a176_0x2bdb();let _0x482afb=_0x2bdb2e[_0x2cdcd7];return _0x482afb;}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=a176_0x451087(0x1be);async function prepareCreate(_0x3a9f69){const _0x439811=a176_0x451087,_0x1c0e5f=await readNotificationDocument(_0x3a9f69,_0x439811(0x1a7)),_0x336e8b=createMutationInput(_0x3a9f69[_0x439811(0x1b3)],_0x1c0e5f);return{'document':_0x1c0e5f,'input':_0x336e8b,'planned':projectNotificationConfig({'appCode':_0x3a9f69[_0x439811(0x1b3)],'configName':_0x1c0e5f['configName'],'channelType':_0x1c0e5f[_0x439811(0x1bf)],'endpointUrl':_0x1c0e5f['endpointUrl'],'channelConfig':_0x1c0e5f[_0x439811(0x1ba)],'description':_0x1c0e5f[_0x439811(0x1ae)],'connectTimeout':_0x1c0e5f[_0x439811(0x1c5)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,'readTimeout':_0x1c0e5f['readTimeout']??DEFAULT_NOTIFICATION_READ_TIMEOUT})};}export const notificationConfigCreate={'service':'notification','command':a176_0x451087(0x1a5),'description':a176_0x451087(0x1ad),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x3b5afa){assertSingleNotificationSource(_0x3b5afa);},async 'dryRun'(_0x4ed6e3){const _0x201692=a176_0x451087,_0x19d0ae=await prepareCreate(_0x4ed6e3),_0x313bf6=notificationLookupCommand(_0x4ed6e3[_0x201692(0x1b3)],_0x19d0ae['document']['channelType']);return asDryRunResult({'operation':_0x201692(0x1a7),'selector':{'appCode':_0x4ed6e3[_0x201692(0x1b3)],'configName':_0x19d0ae[_0x201692(0x1c3)][_0x201692(0x1ab)],'channelType':_0x19d0ae[_0x201692(0x1c3)]['channelType']},'before':null,'after':_0x19d0ae['planned'],'dryRun':!![],'backend':{'method':_0x201692(0x1b8),'path':CREATE_PATH},'warnings':[],'verification':{'status':_0x201692(0x1b9),'lookupCommand':_0x313bf6}},{'method':_0x201692(0x1b8),'url':CREATE_PATH});},async 'execute'(_0x3bc4de){const _0x1163e0=a176_0x451087,_0xc2a1aa=await prepareCreate(_0x3bc4de),_0x340a41=notificationLookupCommand(_0x3bc4de['appCode'],_0xc2a1aa[_0x1163e0(0x1c3)][_0x1163e0(0x1bf)]);let _0x51808a;try{_0x51808a=await createNotificationChannelConfig(_0xc2a1aa['input']);}catch(_0x380c13){if(isPlatformTransportFailure(_0x380c13))throw notificationError(_0x1163e0(0x1c0),_0x1163e0(0x1c1),_0x1163e0(0x1b5)+_0x340a41+_0x1163e0(0x1ac));throw safeApiFailure(_0x1163e0(0x1a7),'mutation','Inspect\x20with\x20'+_0x340a41+';\x20no\x20automatic\x20retry\x20was\x20attempted.');}if(!Number[_0x1163e0(0x1b7)](_0x51808a)||_0x51808a<=0x0)throw notificationError(_0x1163e0(0x1c0),_0x1163e0(0x1b6),_0x1163e0(0x1b5)+_0x340a41+_0x1163e0(0x1ac));let _0x3509a3;try{const _0x3ab0ef=await getNotificationChannelConfig(_0x51808a,_0x3bc4de[_0x1163e0(0x1b3)]);_0x3509a3=normalizeExactNotificationConfig(_0x3ab0ef,_0x51808a,_0x3bc4de[_0x1163e0(0x1b3)]);}catch{throw safeApiFailure(_0x1163e0(0x1a7),_0x1163e0(0x1c4),'Inspect\x20with\x20'+_0x340a41+_0x1163e0(0x1bd));}return{'ok':!![],'data':{'operation':_0x1163e0(0x1a7),'selector':{'appCode':_0x3509a3[_0x1163e0(0x1b3)],'id':_0x3509a3['id'],'configCode':_0x3509a3['configCode'],'configName':_0x3509a3['configName'],'channelType':_0x3509a3[_0x1163e0(0x1bf)]},'before':null,'after':projectNotificationConfig(_0x3509a3),'dryRun':![],'backend':{'method':_0x1163e0(0x1b8),'path':CREATE_PATH},'warnings':[],'verification':{'status':_0x1163e0(0x1c2),'lookupCommand':_0x340a41}},'message':'Created\x20notification\x20config\x20'+_0x3509a3['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a177_0x2c646e=a177_0x340b;(function(_0x1d7814,_0x2df274){const _0x59a844=a177_0x340b,_0x5da148=_0x1d7814();while(!![]){try{const _0x3d7244=parseInt(_0x59a844(0x67))/0x1+parseInt(_0x59a844(0x84))/0x2+-parseInt(_0x59a844(0x73))/0x3*(parseInt(_0x59a844(0x70))/0x4)+parseInt(_0x59a844(0x72))/0x5+parseInt(_0x59a844(0x7d))/0x6*(-parseInt(_0x59a844(0x6c))/0x7)+-parseInt(_0x59a844(0x7e))/0x8+parseInt(_0x59a844(0x77))/0x9*(parseInt(_0x59a844(0x7c))/0xa);if(_0x3d7244===_0x2df274)break;else _0x5da148['push'](_0x5da148['shift']());}catch(_0xa4a496){_0x5da148['push'](_0x5da148['shift']());}}}(a177_0xf9ca,0x37bc3));import{asDryRunResult}from'../../commands/common/dry-run.js';import{deleteNotificationChannelConfig,isPlatformTransportFailure,listNotificationChannelConfigs}from'../../core/api-client.js';function a177_0xf9ca(){const _0x342756=['331079hMRrsC','high-risk-write','Notification\x20config\x20','planned','POST','2576UIwoLF',';\x20no\x20automatic\x20retry\x20was\x20attempted.','Inspect\x20with\x20','appCode','44dRgtts','mutation','798290pGcRDo','26628tRmxZQ','Delete\x20response\x20was\x20unavailable;\x20list\x20readback\x20proved\x20ID\x20absence\x20without\x20resubmitting.','verified','before','1701OLXHlk','notification_config_delete_outcome_unknown','channelType','\x20delete\x20could\x20not\x20be\x20verified.','Delete\x20an\x20app-level\x20notification\x20config\x20after\x20exact\x20preflight','12730azSVtX','4434EVXUvZ','3399000ATPLDF','\x20remains\x20present\x20after\x20delete.',';\x20do\x20not\x20resubmit\x20automatically.','delete','some','Deleted\x20notification\x20config\x20','582840nhxHtL','notification','notification_config_delete_verification_failed'];a177_0xf9ca=function(){return _0x342756;};return a177_0xf9ca();}import{notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,projectNotificationConfig,readNotificationId,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure,validateNotificationDeleteReadback}from'../../commands/notification/shared.js';function a177_0x340b(_0x56bfa8,_0x3f3639){_0x56bfa8=_0x56bfa8-0x65;const _0xf9ca4a=a177_0xf9ca();let _0x340ba1=_0xf9ca4a[_0x56bfa8];return _0x340ba1;}const DELETE_PATH='/notification/channel-config/delete',REFERENCE_WARNING='Deleting\x20this\x20app-level\x20config\x20may\x20make\x20dataset-level\x20channels\x20that\x20reference\x20it\x20unavailable;\x20dataset\x20references\x20were\x20not\x20verified\x20by\x20the\x20CLI.';async function prepareDelete(_0x57c121){const _0x50818b=readNotificationId(_0x57c121),_0x1dc11c=await requireExactNotificationConfig(_0x57c121['appCode'],_0x50818b,'delete');return{'id':_0x50818b,'before':_0x1dc11c};}export const notificationConfigDelete={'service':a177_0x2c646e(0x65),'command':'config-delete','description':a177_0x2c646e(0x7b),'risk':a177_0x2c646e(0x68),'requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,NOTIFICATION_APP_FLAG],async 'validate'(_0x54e86e){readNotificationId(_0x54e86e),requireNotificationExplicitYes(_0x54e86e);},async 'dryRun'(_0x42a283){const _0x2ce3c1=a177_0x2c646e,_0x33129=await prepareDelete(_0x42a283),_0x3acbd0=notificationLookupCommand(_0x42a283['appCode'],_0x33129[_0x2ce3c1(0x76)][_0x2ce3c1(0x79)]);return asDryRunResult({'operation':_0x2ce3c1(0x81),'selector':notificationSelector(_0x33129[_0x2ce3c1(0x76)]),'before':projectNotificationConfig(_0x33129[_0x2ce3c1(0x76)]),'after':null,'dryRun':!![],'backend':{'method':_0x2ce3c1(0x6b),'path':DELETE_PATH},'warnings':[REFERENCE_WARNING],'verification':{'status':_0x2ce3c1(0x6a),'lookupCommand':_0x3acbd0}},{'method':_0x2ce3c1(0x6b),'url':DELETE_PATH});},async 'execute'(_0x59499){const _0x328f6d=a177_0x2c646e;requireNotificationExplicitYes(_0x59499);const _0x579770=await prepareDelete(_0x59499),_0x3eb560=notificationLookupCommand(_0x59499[_0x328f6d(0x6f)],_0x579770[_0x328f6d(0x76)][_0x328f6d(0x79)]);let _0x131dcb=![];try{await deleteNotificationChannelConfig(_0x579770['id'],_0x59499[_0x328f6d(0x6f)]);}catch(_0x1cb5c4){if(!isPlatformTransportFailure(_0x1cb5c4))throw safeApiFailure(_0x328f6d(0x81),_0x328f6d(0x71),_0x328f6d(0x6e)+_0x3eb560+_0x328f6d(0x6d));_0x131dcb=!![];}let _0x2a7cda;try{_0x2a7cda=await listNotificationChannelConfigs(_0x59499[_0x328f6d(0x6f)],_0x579770[_0x328f6d(0x76)][_0x328f6d(0x79)]),validateNotificationDeleteReadback(_0x2a7cda,_0x59499['appCode'],_0x579770[_0x328f6d(0x76)][_0x328f6d(0x79)]);}catch{throw notificationError(_0x131dcb?_0x328f6d(0x78):'notification_config_delete_verification_unavailable',_0x328f6d(0x69)+_0x579770['id']+_0x328f6d(0x7a),_0x328f6d(0x6e)+_0x3eb560+_0x328f6d(0x80));}if(_0x2a7cda[_0x328f6d(0x82)](_0x1e03e9=>_0x1e03e9['id']===_0x579770['id']))throw notificationError(_0x131dcb?_0x328f6d(0x78):_0x328f6d(0x66),'Notification\x20config\x20'+_0x579770['id']+_0x328f6d(0x7f),_0x328f6d(0x6e)+_0x3eb560+_0x328f6d(0x80));const _0x1bb6ff=[REFERENCE_WARNING];return _0x131dcb&&_0x1bb6ff['unshift'](_0x328f6d(0x74)),{'ok':!![],'data':{'operation':_0x328f6d(0x81),'selector':notificationSelector(_0x579770['before']),'before':projectNotificationConfig(_0x579770['before']),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x1bb6ff,'verification':{'status':_0x328f6d(0x75),'absenceConfirmed':!![],'recoveredAfterUnknownResponse':_0x131dcb,'lookupCommand':_0x3eb560}},'message':_0x328f6d(0x83)+_0x579770['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a178_0xeb4801=a178_0x2a1b;(function(_0x74bada,_0x32cfba){const _0x17cd24=a178_0x2a1b,_0x56700c=_0x74bada();while(!![]){try{const _0x310304=parseInt(_0x17cd24(0x19a))/0x1*(-parseInt(_0x17cd24(0x187))/0x2)+parseInt(_0x17cd24(0x18b))/0x3*(-parseInt(_0x17cd24(0x193))/0x4)+-parseInt(_0x17cd24(0x180))/0x5*(-parseInt(_0x17cd24(0x17e))/0x6)+parseInt(_0x17cd24(0x185))/0x7*(-parseInt(_0x17cd24(0x192))/0x8)+-parseInt(_0x17cd24(0x189))/0x9+-parseInt(_0x17cd24(0x194))/0xa+parseInt(_0x17cd24(0x199))/0xb;if(_0x310304===_0x32cfba)break;else _0x56700c['push'](_0x56700c['shift']());}catch(_0x31d46d){_0x56700c['push'](_0x56700c['shift']());}}}(a178_0x4fee,0x83351));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a178_0x2a1b(_0x1f2d2d,_0x40c3bd){_0x1f2d2d=_0x1f2d2d-0x17e;const _0x4fee33=a178_0x4fee();let _0x2a1bd6=_0x4fee33[_0x1f2d2d];return _0x2a1bd6;}import{listNotificationChannelConfigs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a178_0x4fee(){const _0xc067fc=['validation','672314nANSkA','string','7981227erELAA','config-list','27zkuQEF','flat','boolean','str','all','Found\x20','appCode','8gjgfCX','221276MbdYom','2536960abEvZj','List\x20configs\x20for\x20every\x20supported\x20notification\x20channel\x20type','map','length','\x20notification\x20config(s)','26206972iAPafL','1RWMgxc','type','18NcZfCK','read','238295lNJrsY','trim','Use\x20--all,\x20or\x20query\x20one\x20explicit\x20--type.','bool','--all\x20and\x20--type\x20are\x20mutually\x20exclusive.','94339tVIUvN'];a178_0x4fee=function(){return _0xc067fc;};return a178_0x4fee();}import{NOTIFICATION_CHANNEL_TYPES,projectNotificationListConfig,readNotificationChannelType}from'../../commands/notification/shared.js';export const notificationConfigList={'service':'notification','command':a178_0xeb4801(0x18a),'description':'List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','risk':a178_0xeb4801(0x17f),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a178_0xeb4801(0x19b),'type':a178_0xeb4801(0x188),'description':'Notification\x20channel\x20type','enum':NOTIFICATION_CHANNEL_TYPES},{'name':a178_0xeb4801(0x18f),'type':a178_0xeb4801(0x18d),'default':![],'description':a178_0xeb4801(0x195)}],async 'validate'(_0x389225){const _0x3dc04a=a178_0xeb4801;if(_0x389225[_0x3dc04a(0x183)]('all')&&_0x389225[_0x3dc04a(0x18e)](_0x3dc04a(0x19b))[_0x3dc04a(0x181)]())throw CliErrors[_0x3dc04a(0x186)](_0x3dc04a(0x184),_0x3dc04a(0x182));if(_0x389225[_0x3dc04a(0x183)](_0x3dc04a(0x18f)))return;readNotificationChannelType(_0x389225);},async 'execute'(_0x24dac7){const _0x4a4c02=a178_0xeb4801;if(_0x24dac7[_0x4a4c02(0x183)]('all')){const _0x3ba7f0=await Promise['all'](NOTIFICATION_CHANNEL_TYPES['map'](_0x2ab2d1=>listNotificationChannelConfigs(_0x24dac7['appCode'],_0x2ab2d1))),_0x269e88=_0x3ba7f0[_0x4a4c02(0x18c)]()[_0x4a4c02(0x196)](projectNotificationListConfig);return{'ok':!![],'data':{'appCode':_0x24dac7[_0x4a4c02(0x191)],'channelTypes':NOTIFICATION_CHANNEL_TYPES,'count':_0x269e88[_0x4a4c02(0x197)],'configs':_0x269e88},'message':_0x4a4c02(0x190)+_0x269e88[_0x4a4c02(0x197)]+'\x20notification\x20config(s)\x20across\x20all\x20channel\x20types'};}const _0x375695=readNotificationChannelType(_0x24dac7),_0x479858=await listNotificationChannelConfigs(_0x24dac7[_0x4a4c02(0x191)],_0x375695),_0x5f59eb=_0x479858[_0x4a4c02(0x196)](projectNotificationListConfig);return{'ok':!![],'data':{'appCode':_0x24dac7['appCode'],'channelType':_0x375695,'count':_0x5f59eb[_0x4a4c02(0x197)],'configs':_0x5f59eb},'message':_0x4a4c02(0x190)+_0x5f59eb[_0x4a4c02(0x197)]+'\x20'+_0x375695+_0x4a4c02(0x198)};}};
|