@lovrabet/rabetbase-cli 2.5.2-beta.2 → 2.5.2-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/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.d.ts +1 -0
- 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/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/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/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/auto-sync.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/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.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/template.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/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/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.d.ts +3 -7
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +1 -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/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.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/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.d.ts +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +1 -3
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +2 -2
- package/skills/rabetbase/references/rabetbase-app-members-list.md +2 -0
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a146_0x24cb1e=a146_0x13f1;(function(_0x41884f,_0x3cdcec){const _0x3f2be2=a146_0x13f1,_0x29d1d6=_0x41884f();while(!![]){try{const _0x2d6e93=parseInt(_0x3f2be2(0x1ed))/0x1+-parseInt(_0x3f2be2(0x1c0))/0x2*(-parseInt(_0x3f2be2(0x1bf))/0x3)+parseInt(_0x3f2be2(0x1ef))/0x4+parseInt(_0x3f2be2(0x1d2))/0x5*(parseInt(_0x3f2be2(0x200))/0x6)+-parseInt(_0x3f2be2(0x1fb))/0x7+parseInt(_0x3f2be2(0x1c8))/0x8*(parseInt(_0x3f2be2(0x20b))/0x9)+parseInt(_0x3f2be2(0x1f2))/0xa*(-parseInt(_0x3f2be2(0x1e6))/0xb);if(_0x2d6e93===_0x3cdcec)break;else _0x29d1d6['push'](_0x29d1d6['shift']());}catch(_0x1f8039){_0x29d1d6['push'](_0x29d1d6['shift']());}}}(a146_0x265d,0x9916d));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':a146_0x24cb1e(0x1e7),'required':!![],'description':a146_0x24cb1e(0x1fe)};export const MENU_SORT_FLAG={'name':a146_0x24cb1e(0x1ec),'type':a146_0x24cb1e(0x1e7),'description':a146_0x24cb1e(0x1f6)};export const MENU_PARENT_ID_FLAG={'name':a146_0x24cb1e(0x215),'type':a146_0x24cb1e(0x1d8),'description':a146_0x24cb1e(0x218)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a146_0x24cb1e(0x1ce),'type':a146_0x24cb1e(0x1d8),'description':'Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level'};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':'expect-path','type':a146_0x24cb1e(0x1d8),'description':a146_0x24cb1e(0x209)},{'name':a146_0x24cb1e(0x1cb),'type':a146_0x24cb1e(0x1e7),'description':a146_0x24cb1e(0x1f7)}];export function validateExactId(_0x382262){const _0x3aefeb=a146_0x24cb1e,_0x20a6e3=_0x382262[_0x3aefeb(0x1df)]('id');if(!Number[_0x3aefeb(0x1cd)](_0x20a6e3)||_0x20a6e3<=0x0)throw CliErrors[_0x3aefeb(0x1d0)](_0x3aefeb(0x21a));return _0x20a6e3;}export function validateSort(_0x2bf7c9,_0x4b345a=a146_0x24cb1e(0x1ec)){const _0x551769=a146_0x24cb1e;if(!hasFlag(_0x2bf7c9,_0x4b345a))return undefined;const _0x38ee1e=_0x2bf7c9[_0x551769(0x1df)](_0x4b345a);if(!Number[_0x551769(0x1cd)](_0x38ee1e)||_0x38ee1e<0x0||_0x38ee1e>MAX_MENU_SORT)throw menuError(_0x551769(0x1c5),'--'+_0x4b345a+_0x551769(0x1db)+MAX_MENU_SORT+'.','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.');return _0x38ee1e;}export function nextSiblingSort(_0x32a9d3,_0x8882c9,_0x58fdaf){const _0xc0d888=a146_0x24cb1e,_0xe58ae9=getChildren(_0x32a9d3,_0x8882c9)['map'](_0x4fcb8d=>_0x4fcb8d['sort'])[_0xc0d888(0x217)](_0x16ebcd=>typeof _0x16ebcd===_0xc0d888(0x1e7));if(_0xe58ae9[_0xc0d888(0x21e)]===0x0)return 0x0;const _0x355b3a=Math[_0xc0d888(0x20f)](..._0xe58ae9);if(_0x355b3a>=MAX_MENU_SORT)throw menuError(_0xc0d888(0x219),_0xc0d888(0x21c)+_0x58fdaf+_0xc0d888(0x1e2)+_0x355b3a+'.',_0xc0d888(0x1f8)+MAX_MENU_SORT+_0xc0d888(0x1f0));return _0x355b3a+0x1;}export function requireExplicitYes(_0xdd9449){const _0x282b86=a146_0x24cb1e;if(_0xdd9449[_0x282b86(0x1e5)]('dry-run'))return;if(!_0xdd9449[_0x282b86(0x1e5)](_0x282b86(0x206)))throw menuError(_0x282b86(0x1c6),'This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0x240d2e,_0x32efbc,_0x3424fb){const _0x21f09b=a146_0x24cb1e;try{return await fetchMenuSnapshot(_0x240d2e[_0x21f09b(0x1d6)],_0x240d2e[_0x21f09b(0x202)]);}catch(_0x5ad0a7){throw mapMenuApiError(_0x5ad0a7,'read\x20online\x20menu\x20facts\x20before\x20'+_0x32efbc,_0x3424fb);}}export async function recheckMutationSnapshot(_0x270fbd,_0x17ff02,_0xc5ec3d,_0x454d15){const _0x254094=a146_0x24cb1e;let _0x50743b;try{_0x50743b=await fetchMenuSnapshot(_0x270fbd[_0x254094(0x1d6)],_0x270fbd[_0x254094(0x202)]);}catch(_0x53f70e){const _0x1e0f3c=mapMenuApiError(_0x53f70e,'recheck\x20online\x20menu\x20facts\x20before\x20'+_0xc5ec3d,_0x454d15);throw menuFailure(_0x1e0f3c,_0x17ff02,{'stage':'pre-write-recheck','failed':_0x454d15==null?{}:{'id':_0x454d15}});}if(_0x50743b[_0x254094(0x1dd)]!==_0x17ff02[_0x254094(0x20e)]){const _0x142dac=menuError(_0x254094(0x221),_0x254094(0x1e1)+_0xc5ec3d+_0x254094(0x1e3),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.');throw menuFailure(_0x142dac,_0x17ff02,{'stage':_0x254094(0x216),'failed':{..._0x454d15==null?{}:{'id':_0x454d15},'expectedSnapshotHash':_0x17ff02[_0x254094(0x20e)],'currentSnapshotHash':_0x50743b[_0x254094(0x1dd)]}});}return _0x50743b;}function a146_0x13f1(_0x32885d,_0x4de793){_0x32885d=_0x32885d-0x1bc;const _0x265db1=a146_0x265d();let _0x13f1d9=_0x265db1[_0x32885d];return _0x13f1d9;}export function parseParentId(_0x5d5a38,_0x534006,_0x79de19={}){const _0x3e19b3=a146_0x24cb1e;if(!hasFlag(_0x5d5a38,_0x534006)){if(_0x79de19[_0x3e19b3(0x1eb)])throw CliErrors['flagMissing'](_0x534006);return undefined;}const _0x19f4c1=_0x5d5a38['str'](_0x534006)[_0x3e19b3(0x1c1)]();if(_0x19f4c1[_0x3e19b3(0x211)]()===_0x3e19b3(0x1bc))return null;if(!/^\d+$/['test'](_0x19f4c1))throw CliErrors['validation']('--'+_0x534006+_0x3e19b3(0x1d1));const _0x2972e3=Number(_0x19f4c1);if(!Number[_0x3e19b3(0x1cd)](_0x2972e3)||_0x2972e3<=0x0)throw CliErrors[_0x3e19b3(0x1d0)]('--'+_0x534006+_0x3e19b3(0x1d1));return _0x2972e3;}export function requireMenu(_0x494e80,_0x3f6a20){const _0x53bbf1=a146_0x24cb1e,_0x5e22e2=_0x494e80[_0x53bbf1(0x21d)]['get'](_0x3f6a20);if(!_0x5e22e2)throw menuError(_0x53bbf1(0x20d),_0x53bbf1(0x1f3)+_0x3f6a20,_0x53bbf1(0x207));return _0x5e22e2;}export function requireFolder(_0x37586f,_0x61f6cb){const _0x5023c3=a146_0x24cb1e,_0x284a3f=requireMenu(_0x37586f,_0x61f6cb);if(_0x284a3f['type']!==_0x5023c3(0x1c9))throw menuError(_0x5023c3(0x1ea),_0x5023c3(0x220)+_0x61f6cb+_0x5023c3(0x21b)+(_0x284a3f[_0x5023c3(0x20c)]||'unknown')+'\x22,\x20not\x20folder.',_0x5023c3(0x1ee));return _0x284a3f;}export function assertExpectedState(_0x40bb09,_0xd3069b){const _0x4e195f=a146_0x24cb1e;if(hasFlag(_0x40bb09,_0x4e195f(0x1ce))){const _0x55a244=parseParentId(_0x40bb09,'expect-parent-id',{'required':!![]});if(_0xd3069b['parentId']!==_0x55a244)throw stateDrift('Menu\x20'+_0xd3069b['id']+_0x4e195f(0x210)+formatParent(_0x55a244)+',\x20current\x20'+formatParent(_0xd3069b['parentId'])+'.');}if(hasFlag(_0x40bb09,_0x4e195f(0x1d7))){const _0x356fa7=_0x40bb09[_0x4e195f(0x1cc)](_0x4e195f(0x1d7));if(_0xd3069b[_0x4e195f(0x205)]!==_0x356fa7)throw stateDrift(_0x4e195f(0x220)+_0xd3069b['id']+_0x4e195f(0x1fa)+JSON['stringify'](_0x356fa7)+',\x20current\x20'+JSON[_0x4e195f(0x1c2)](_0xd3069b[_0x4e195f(0x205)])+'.');}if(hasFlag(_0x40bb09,_0x4e195f(0x1cb))){const _0x875ed6=_0x40bb09[_0x4e195f(0x1df)](_0x4e195f(0x1cb));if(!Number[_0x4e195f(0x1cd)](_0x875ed6)||_0x875ed6<0x0)throw CliErrors['validation']('--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.');if(_0xd3069b[_0x4e195f(0x1c7)]!==_0x875ed6)throw stateDrift(_0x4e195f(0x220)+_0xd3069b['id']+_0x4e195f(0x1f9)+_0x875ed6+_0x4e195f(0x1d5)+_0xd3069b[_0x4e195f(0x1c7)]+'.');}}export function assertVerified(_0x590de8,_0x3f3fbc,_0x419057='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){if(!_0x590de8)throw menuError('menu_verification_failed',_0x3f3fbc,_0x419057);}export function mutationResult(_0x1e39c2){const _0x2d46b7=a146_0x24cb1e;return{'operation':_0x1e39c2['operation'],'selector':_0x1e39c2['selector'],'before':_0x1e39c2['before'],'after':_0x1e39c2['after'],'dryRun':_0x1e39c2[_0x2d46b7(0x1c3)],'backend':_0x1e39c2[_0x2d46b7(0x203)],..._0x1e39c2[_0x2d46b7(0x20a)]?{'plannedActions':_0x1e39c2[_0x2d46b7(0x20a)]}:{},..._0x1e39c2[_0x2d46b7(0x1d9)]?{'targets':_0x1e39c2['targets']}:{},..._0x1e39c2[_0x2d46b7(0x204)]?{'deleteOrder':_0x1e39c2['deleteOrder']}:{},'snapshotHash':_0x1e39c2[_0x2d46b7(0x20e)],..._0x1e39c2[_0x2d46b7(0x1d3)]?{'cascade':_0x1e39c2[_0x2d46b7(0x1d3)]}:{},..._0x1e39c2[_0x2d46b7(0x213)]?{'planFile':_0x1e39c2['planFile']}:{},'succeeded':_0x1e39c2[_0x2d46b7(0x1dc)]??[],'failed':_0x1e39c2[_0x2d46b7(0x1da)]??[],'warnings':_0x1e39c2[_0x2d46b7(0x1cf)]??[],'verification':_0x1e39c2['verification'],'error':_0x1e39c2[_0x2d46b7(0x1e4)]};}function a146_0x265d(){const _0x12be03=['expect-path','string','targets','failed','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','succeeded','hash','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','num','menu_permission_denied','Online\x20menu\x20state\x20changed\x20before\x20','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','error','bool','40821PdGldl','number','api_error','test','menu_parent_not_folder','required','sort','534670vFUZHa','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','1411424kOfNdU',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','Failed\x20to\x20','4010OQFiMd','Online\x20menu\x20not\x20found:\x20','defineProperty','call','Sibling\x20sort\x20value\x20(non-negative\x20integer)','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','Reorder\x20sibling\x20menus\x20below\x20','\x20child\x20count\x20changed:\x20expected\x20','\x20path\x20changed:\x20expected\x20','1087324IcJFyD','menu_mutation_failed','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','Exact\x20online\x20menu\x20id','after','6vSTNCK','failedRecords','cookie','backend','deleteOrder','path','yes','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','\x20menu\x20','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','plannedActions','819135iqRcoU','type','menu_not_found','snapshotHash','max','\x20parent\x20changed:\x20expected\x20','toLowerCase','data','planFile','hint','parent-id','pre-write-recheck','filter','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','menu_sort_overflow','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','\x20is\x20type\x20\x22','Cannot\x20append\x20a\x20','byId','length','message','Menu\x20','menu_state_drift','root','menu_verification_failed','prototype','1310583UIWUPS','2knVnfU','trim','stringify','dryRun','rawFlags','menu_sort_invalid','menu_confirmation_required','childrenCount','8Tuxlix','folder','Permission\x20denied\x20while\x20attempting\x20to\x20','expected-children-count','str','isSafeInteger','expect-parent-id','warnings','validation','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','4275470nljyvu','cascade','code',',\x20current\x20','appCode'];a146_0x265d=function(){return _0x12be03;};return a146_0x265d();}export function menuDryRunResult(_0x4d9538,_0x1a2eac){return{..._0x4d9538,..._0x1a2eac};}export function menuFailure(_0xdb5df2,_0x28e944,_0x3f0263){const _0x12497c=a146_0x24cb1e,_0x580270=mutationResult({..._0x28e944,'after':_0x3f0263[_0x12497c(0x1ff)]===undefined?_0x28e944[_0x12497c(0x1ff)]:_0x3f0263[_0x12497c(0x1ff)],'backend':_0x3f0263[_0x12497c(0x203)]??_0x28e944[_0x12497c(0x203)],'dryRun':![],'succeeded':_0x3f0263['succeeded']??[],'failed':_0x3f0263[_0x12497c(0x201)]??[{..._0x3f0263['failed']??{},'stage':_0x3f0263['stage'],'code':_0xdb5df2[_0x12497c(0x1d4)],'message':_0xdb5df2[_0x12497c(0x21f)]}],'warnings':[..._0x28e944[_0x12497c(0x1cf)],..._0x3f0263['warnings']??[]],'verification':_0x3f0263['verification'],'error':{'code':_0xdb5df2[_0x12497c(0x1d4)],'message':_0xdb5df2[_0x12497c(0x21f)],..._0xdb5df2['hint']?{'hint':_0xdb5df2[_0x12497c(0x214)]}:{}}});return Object[_0x12497c(0x1f4)](_0xdb5df2,_0x12497c(0x212),{'value':_0x580270,'enumerable':!![],'configurable':!![]}),_0xdb5df2;}export function asVerificationError(_0x2eb81a,_0x3f1c04){const _0x397fe8=a146_0x24cb1e;if(_0x2eb81a instanceof CliError&&_0x2eb81a[_0x397fe8(0x1d4)]===_0x397fe8(0x1bd))return _0x2eb81a;const _0x2973ac=_0x2eb81a instanceof Error?_0x2eb81a['message']:String(_0x2eb81a);return menuError(_0x397fe8(0x1bd),''+_0x3f1c04+(_0x2973ac?':\x20'+_0x2973ac:''),_0x397fe8(0x1fd));}export function describeMenuErrorCause(_0x82f18d,_0x5e054c,_0x1594f6){const _0x244a7d=a146_0x24cb1e,_0x5bd52b=mapMenuApiError(_0x82f18d,_0x5e054c,_0x1594f6);return{'causeCode':_0x5bd52b['code'],'causeMessage':_0x5bd52b[_0x244a7d(0x21f)]};}export function hasFlag(_0x4df615,_0x568beb){const _0x34556a=a146_0x24cb1e;return Object[_0x34556a(0x1be)]['hasOwnProperty'][_0x34556a(0x1f5)](_0x4df615[_0x34556a(0x1c4)],_0x568beb)&&_0x4df615['rawFlags'][_0x568beb]!==undefined;}export function toApiParentId(_0x3f4873){return _0x3f4873??0x0;}export function formatParent(_0x1fe406){return _0x1fe406==null?'root':String(_0x1fe406);}export function menuError(_0x584675,_0x2b1ae3,_0x4530bb){return new CliError(_0x584675,0x1,_0x2b1ae3,_0x4530bb);}export function mapMenuApiError(_0x33d7d4,_0x51ac37,_0x584af9){const _0x804386=a146_0x24cb1e;if(_0x33d7d4 instanceof CliError&&_0x33d7d4['code']!==_0x804386(0x1e8))return _0x33d7d4;const _0x152e41=_0x33d7d4 instanceof Error?_0x33d7d4[_0x804386(0x21f)]:String(_0x33d7d4);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i['test'](_0x152e41))return menuError(_0x804386(0x1e0),_0x804386(0x1ca)+_0x51ac37+(_0x584af9?'\x20menu\x20'+_0x584af9:'')+'.',_0x804386(0x1de));return menuError(_0x804386(0x1fc),_0x804386(0x1f1)+_0x51ac37+(_0x584af9?_0x804386(0x208)+_0x584af9:'')+':\x20'+_0x152e41,'Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.');}export function isMenuResponseLoss(_0x552573){const _0x35be4a=a146_0x24cb1e,_0x3ca52a=_0x552573 instanceof Error?_0x552573[_0x35be4a(0x21f)]:String(_0x552573);if(_0x552573 instanceof CliError)return _0x552573[_0x35be4a(0x1d4)]===_0x35be4a(0x1e8)&&/^Request (?:failed|timeout):/i[_0x35be4a(0x1e9)](_0x3ca52a);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x35be4a(0x1e9)](_0x3ca52a);}function stateDrift(_0x279975){const _0x29db7a=a146_0x24cb1e;return menuError(_0x29db7a(0x221),_0x279975,'Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.');}
|
|
1
|
+
const a146_0x539bf5=a146_0x29a7;(function(_0x5c0f0e,_0x3e1741){const _0x2199d8=a146_0x29a7,_0x8a48fc=_0x5c0f0e();while(!![]){try{const _0x36abe2=-parseInt(_0x2199d8(0x155))/0x1*(parseInt(_0x2199d8(0x16c))/0x2)+parseInt(_0x2199d8(0x164))/0x3*(parseInt(_0x2199d8(0x133))/0x4)+-parseInt(_0x2199d8(0x16d))/0x5*(-parseInt(_0x2199d8(0x14c))/0x6)+-parseInt(_0x2199d8(0x119))/0x7*(parseInt(_0x2199d8(0x135))/0x8)+-parseInt(_0x2199d8(0x10d))/0x9+-parseInt(_0x2199d8(0x12c))/0xa+parseInt(_0x2199d8(0x162))/0xb;if(_0x36abe2===_0x3e1741)break;else _0x8a48fc['push'](_0x8a48fc['shift']());}catch(_0x9043d2){_0x8a48fc['push'](_0x8a48fc['shift']());}}}(a146_0x2975,0x7ea13));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':a146_0x539bf5(0x15c),'required':!![],'description':a146_0x539bf5(0x117)};export const MENU_SORT_FLAG={'name':a146_0x539bf5(0x145),'type':a146_0x539bf5(0x15c),'description':'Sibling\x20sort\x20value\x20(non-negative\x20integer)'};export const MENU_PARENT_ID_FLAG={'name':a146_0x539bf5(0x156),'type':a146_0x539bf5(0x14f),'description':'Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node'};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a146_0x539bf5(0x14d),'type':a146_0x539bf5(0x14f),'description':'Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level'};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a146_0x539bf5(0x15e),'type':a146_0x539bf5(0x14f),'description':a146_0x539bf5(0x12e)},{'name':'expected-children-count','type':a146_0x539bf5(0x15c),'description':a146_0x539bf5(0x165)}];export function validateExactId(_0x3a1371){const _0x263f8f=a146_0x539bf5,_0x3067e3=_0x3a1371['num']('id');if(!Number[_0x263f8f(0x128)](_0x3067e3)||_0x3067e3<=0x0)throw CliErrors[_0x263f8f(0x132)]('--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.');return _0x3067e3;}export function validateSort(_0x4d212f,_0x2ae64d=a146_0x539bf5(0x145)){const _0x2c8dc9=a146_0x539bf5;if(!hasFlag(_0x4d212f,_0x2ae64d))return undefined;const _0x112538=_0x4d212f[_0x2c8dc9(0x11c)](_0x2ae64d);if(!Number[_0x2c8dc9(0x128)](_0x112538)||_0x112538<0x0||_0x112538>MAX_MENU_SORT)throw menuError(_0x2c8dc9(0x16a),'--'+_0x2ae64d+_0x2c8dc9(0x138)+MAX_MENU_SORT+'.',_0x2c8dc9(0x14e));return _0x112538;}export function nextSiblingSort(_0x3d0a61,_0x2b54e,_0x80614){const _0x401cdf=a146_0x539bf5,_0x216d25=getChildren(_0x3d0a61,_0x2b54e)[_0x401cdf(0x10e)](_0xafe1bc=>_0xafe1bc[_0x401cdf(0x145)])['filter'](_0x39f531=>typeof _0x39f531==='number');if(_0x216d25[_0x401cdf(0x10c)]===0x0)return 0x0;const _0x31a53f=Math[_0x401cdf(0x114)](..._0x216d25);if(_0x31a53f>=MAX_MENU_SORT)throw menuError('menu_sort_overflow',_0x401cdf(0x161)+_0x80614+'\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20'+_0x31a53f+'.',_0x401cdf(0x10f)+MAX_MENU_SORT+_0x401cdf(0x122));return _0x31a53f+0x1;}export function requireExplicitYes(_0x40b82a){const _0x5dce6f=a146_0x539bf5;if(_0x40b82a['bool'](_0x5dce6f(0x118)))return;if(!_0x40b82a[_0x5dce6f(0x116)]('yes'))throw menuError(_0x5dce6f(0x14a),_0x5dce6f(0x113),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0x38acdf,_0x3b33b9,_0x4b70ad){const _0x296d51=a146_0x539bf5;try{return await fetchMenuSnapshot(_0x38acdf[_0x296d51(0x11d)],_0x38acdf['cookie']);}catch(_0x566edc){throw mapMenuApiError(_0x566edc,_0x296d51(0x144)+_0x3b33b9,_0x4b70ad);}}export async function recheckMutationSnapshot(_0x2fa273,_0x5ed7eb,_0x5c030f,_0x26ddb6){const _0x31ae31=a146_0x539bf5;let _0xa1f5;try{_0xa1f5=await fetchMenuSnapshot(_0x2fa273[_0x31ae31(0x11d)],_0x2fa273[_0x31ae31(0x10a)]);}catch(_0x33eb5b){const _0x17490b=mapMenuApiError(_0x33eb5b,'recheck\x20online\x20menu\x20facts\x20before\x20'+_0x5c030f,_0x26ddb6);throw menuFailure(_0x17490b,_0x5ed7eb,{'stage':_0x31ae31(0x120),'failed':_0x26ddb6==null?{}:{'id':_0x26ddb6}});}if(_0xa1f5[_0x31ae31(0x13c)]!==_0x5ed7eb[_0x31ae31(0x143)]){const _0x2c7e09=menuError(_0x31ae31(0x139),_0x31ae31(0x15d)+_0x5c030f+_0x31ae31(0x151),_0x31ae31(0x146));throw menuFailure(_0x2c7e09,_0x5ed7eb,{'stage':_0x31ae31(0x120),'failed':{..._0x26ddb6==null?{}:{'id':_0x26ddb6},'expectedSnapshotHash':_0x5ed7eb[_0x31ae31(0x143)],'currentSnapshotHash':_0xa1f5[_0x31ae31(0x13c)]}});}return _0xa1f5;}export function parseParentId(_0x55964e,_0x294a09,_0x5174db={}){const _0x4f0dda=a146_0x539bf5;if(!hasFlag(_0x55964e,_0x294a09)){if(_0x5174db['required'])throw CliErrors['flagMissing'](_0x294a09);return undefined;}const _0x154b38=_0x55964e[_0x4f0dda(0x166)](_0x294a09)['trim']();if(_0x154b38['toLowerCase']()==='root')return null;if(!/^\d+$/[_0x4f0dda(0x129)](_0x154b38))throw CliErrors[_0x4f0dda(0x132)]('--'+_0x294a09+_0x4f0dda(0x11a));const _0x798d68=Number(_0x154b38);if(!Number['isSafeInteger'](_0x798d68)||_0x798d68<=0x0)throw CliErrors['validation']('--'+_0x294a09+_0x4f0dda(0x11a));return _0x798d68;}export function requireMenu(_0x11e6e2,_0x293fed){const _0x1330f6=a146_0x539bf5,_0xa4fe5b=_0x11e6e2[_0x1330f6(0x170)][_0x1330f6(0x140)](_0x293fed);if(!_0xa4fe5b)throw menuError(_0x1330f6(0x149),_0x1330f6(0x123)+_0x293fed,'Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.');return _0xa4fe5b;}export function requireFolder(_0x4d26ec,_0x148857){const _0x419e21=a146_0x539bf5,_0x31838c=requireMenu(_0x4d26ec,_0x148857);if(_0x31838c[_0x419e21(0x15b)]!==_0x419e21(0x127))throw menuError(_0x419e21(0x11b),_0x419e21(0x16e)+_0x148857+_0x419e21(0x148)+(_0x31838c[_0x419e21(0x15b)]||'unknown')+_0x419e21(0x130),_0x419e21(0x10b));return _0x31838c;}export function assertExpectedState(_0x379039,_0x3d824f){const _0x1dd322=a146_0x539bf5;if(hasFlag(_0x379039,_0x1dd322(0x14d))){const _0x416899=parseParentId(_0x379039,'expect-parent-id',{'required':!![]});if(_0x3d824f[_0x1dd322(0x152)]!==_0x416899)throw stateDrift(_0x1dd322(0x16e)+_0x3d824f['id']+_0x1dd322(0x136)+formatParent(_0x416899)+',\x20current\x20'+formatParent(_0x3d824f[_0x1dd322(0x152)])+'.');}if(hasFlag(_0x379039,_0x1dd322(0x15e))){const _0x4cc5f6=_0x379039[_0x1dd322(0x166)](_0x1dd322(0x15e));if(_0x3d824f[_0x1dd322(0x11e)]!==_0x4cc5f6)throw stateDrift('Menu\x20'+_0x3d824f['id']+_0x1dd322(0x13f)+JSON[_0x1dd322(0x153)](_0x4cc5f6)+_0x1dd322(0x15f)+JSON[_0x1dd322(0x153)](_0x3d824f['path'])+'.');}if(hasFlag(_0x379039,_0x1dd322(0x169))){const _0x802318=_0x379039[_0x1dd322(0x11c)]('expected-children-count');if(!Number[_0x1dd322(0x128)](_0x802318)||_0x802318<0x0)throw CliErrors[_0x1dd322(0x132)](_0x1dd322(0x125));if(_0x3d824f['childrenCount']!==_0x802318)throw stateDrift('Menu\x20'+_0x3d824f['id']+'\x20child\x20count\x20changed:\x20expected\x20'+_0x802318+_0x1dd322(0x15f)+_0x3d824f[_0x1dd322(0x110)]+'.');}}export function assertVerified(_0x55cebd,_0x155ead,_0x254685=a146_0x539bf5(0x147)){const _0x164ad7=a146_0x539bf5;if(!_0x55cebd)throw menuError(_0x164ad7(0x158),_0x155ead,_0x254685);}export function mutationResult(_0x20f431){const _0x3a7afc=a146_0x539bf5;return{'operation':_0x20f431[_0x3a7afc(0x168)],'selector':_0x20f431[_0x3a7afc(0x115)],'before':_0x20f431[_0x3a7afc(0x124)],'after':_0x20f431[_0x3a7afc(0x121)],'dryRun':_0x20f431[_0x3a7afc(0x111)],'backend':_0x20f431[_0x3a7afc(0x112)],..._0x20f431['plannedActions']?{'plannedActions':_0x20f431[_0x3a7afc(0x163)]}:{},..._0x20f431[_0x3a7afc(0x137)]?{'targets':_0x20f431[_0x3a7afc(0x137)]}:{},..._0x20f431[_0x3a7afc(0x13b)]?{'deleteOrder':_0x20f431[_0x3a7afc(0x13b)]}:{},'snapshotHash':_0x20f431[_0x3a7afc(0x143)],..._0x20f431[_0x3a7afc(0x11f)]?{'cascade':_0x20f431['cascade']}:{},..._0x20f431[_0x3a7afc(0x150)]?{'planFile':_0x20f431['planFile']}:{},'succeeded':_0x20f431[_0x3a7afc(0x13d)]??[],'failed':_0x20f431[_0x3a7afc(0x131)]??[],'warnings':_0x20f431['warnings']??[],'verification':_0x20f431['verification'],'error':_0x20f431[_0x3a7afc(0x141)]};}export function menuDryRunResult(_0x46af94,_0xeeccc9){return{..._0x46af94,..._0xeeccc9};}export function menuFailure(_0x1872db,_0x4326f9,_0x12fb99){const _0x25eae9=a146_0x539bf5,_0x535e6e=mutationResult({..._0x4326f9,'after':_0x12fb99[_0x25eae9(0x121)]===undefined?_0x4326f9[_0x25eae9(0x121)]:_0x12fb99['after'],'backend':_0x12fb99[_0x25eae9(0x112)]??_0x4326f9['backend'],'dryRun':![],'succeeded':_0x12fb99['succeeded']??[],'failed':_0x12fb99[_0x25eae9(0x142)]??[{..._0x12fb99[_0x25eae9(0x131)]??{},'stage':_0x12fb99['stage'],'code':_0x1872db[_0x25eae9(0x126)],'message':_0x1872db[_0x25eae9(0x157)]}],'warnings':[..._0x4326f9['warnings'],..._0x12fb99[_0x25eae9(0x12a)]??[]],'verification':_0x12fb99[_0x25eae9(0x16b)],'error':{'code':_0x1872db[_0x25eae9(0x126)],'message':_0x1872db[_0x25eae9(0x157)],..._0x1872db[_0x25eae9(0x134)]?{'hint':_0x1872db[_0x25eae9(0x134)]}:{}}});return Object[_0x25eae9(0x167)](_0x1872db,'data',{'value':_0x535e6e,'enumerable':!![],'configurable':!![]}),_0x1872db;}export function asVerificationError(_0x5b0d6d,_0x35b67f){const _0x29b6fb=a146_0x539bf5;if(_0x5b0d6d instanceof CliError&&_0x5b0d6d[_0x29b6fb(0x126)]===_0x29b6fb(0x158))return _0x5b0d6d;const _0x2aba9e=_0x5b0d6d instanceof Error?_0x5b0d6d[_0x29b6fb(0x157)]:String(_0x5b0d6d);return menuError(_0x29b6fb(0x158),''+_0x35b67f+(_0x2aba9e?':\x20'+_0x2aba9e:''),_0x29b6fb(0x12f));}export function describeMenuErrorCause(_0x4c21f2,_0x295412,_0x203b5b){const _0x3e2cf8=a146_0x539bf5,_0x39c1b7=mapMenuApiError(_0x4c21f2,_0x295412,_0x203b5b);return{'causeCode':_0x39c1b7[_0x3e2cf8(0x126)],'causeMessage':_0x39c1b7[_0x3e2cf8(0x157)]};}export function hasFlag(_0x59dab3,_0x10320f){const _0x3a802b=a146_0x539bf5;return Object['prototype'][_0x3a802b(0x159)][_0x3a802b(0x160)](_0x59dab3['rawFlags'],_0x10320f)&&_0x59dab3[_0x3a802b(0x12b)][_0x10320f]!==undefined;}export function toApiParentId(_0x11d0d7){return _0x11d0d7??0x0;}export function formatParent(_0x369f50){const _0x48ed7f=a146_0x539bf5;return _0x369f50==null?_0x48ed7f(0x12d):String(_0x369f50);}function a146_0x29a7(_0xfe4af3,_0x1aad0c){_0xfe4af3=_0xfe4af3-0x10a;const _0x297591=a146_0x2975();let _0x29a79f=_0x297591[_0xfe4af3];return _0x29a79f;}function a146_0x2975(){const _0x5862f1=['Reorder\x20sibling\x20menus\x20below\x20','childrenCount','dryRun','backend','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','max','selector','bool','Exact\x20online\x20menu\x20id','dry-run','5579qIkJyy','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','menu_parent_not_folder','num','appCode','path','cascade','pre-write-recheck','after',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','Online\x20menu\x20not\x20found:\x20','before','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','code','folder','isSafeInteger','test','warnings','rawFlags','4267700xhSpXU','root','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','\x22,\x20not\x20folder.','failed','validation','2780980XOlvne','hint','5864ecrdWX','\x20parent\x20changed:\x20expected\x20','targets','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','menu_state_drift','menu_permission_denied','deleteOrder','hash','succeeded','Permission\x20denied\x20while\x20attempting\x20to\x20','\x20path\x20changed:\x20expected\x20','get','error','failedRecords','snapshotHash','read\x20online\x20menu\x20facts\x20before\x20','sort','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','\x20is\x20type\x20\x22','menu_not_found','menu_confirmation_required','menu_mutation_failed','494526nnOjCc','expect-parent-id','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','string','planFile',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','parentId','stringify','Failed\x20to\x20','546307tgupWm','parent-id','message','menu_verification_failed','hasOwnProperty','\x20menu\x20','type','number','Online\x20menu\x20state\x20changed\x20before\x20','expect-path',',\x20current\x20','call','Cannot\x20append\x20a\x20','18370605zESBoD','plannedActions','3LqJvWp','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','str','defineProperty','operation','expected-children-count','menu_sort_invalid','verification','2lXKQBw','25ohZtmz','Menu\x20','api_error','byId','cookie','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','length','6313068bDKVXJ','map'];a146_0x2975=function(){return _0x5862f1;};return a146_0x2975();}export function menuError(_0xe1aea7,_0x4af46f,_0x2c99a1){return new CliError(_0xe1aea7,0x1,_0x4af46f,_0x2c99a1);}export function mapMenuApiError(_0x11246e,_0x2021ac,_0x4061cd){const _0x2dde09=a146_0x539bf5;if(_0x11246e instanceof CliError&&_0x11246e[_0x2dde09(0x126)]!=='api_error')return _0x11246e;const _0x1de539=_0x11246e instanceof Error?_0x11246e[_0x2dde09(0x157)]:String(_0x11246e);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x2dde09(0x129)](_0x1de539))return menuError(_0x2dde09(0x13a),_0x2dde09(0x13e)+_0x2021ac+(_0x4061cd?_0x2dde09(0x15a)+_0x4061cd:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x2dde09(0x14b),_0x2dde09(0x154)+_0x2021ac+(_0x4061cd?_0x2dde09(0x15a)+_0x4061cd:'')+':\x20'+_0x1de539,'Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.');}export function isMenuResponseLoss(_0x59e784){const _0x58fdc8=a146_0x539bf5,_0xba0b49=_0x59e784 instanceof Error?_0x59e784[_0x58fdc8(0x157)]:String(_0x59e784);if(_0x59e784 instanceof CliError)return _0x59e784['code']===_0x58fdc8(0x16f)&&/^Request (?:failed|timeout):/i[_0x58fdc8(0x129)](_0xba0b49);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x58fdc8(0x129)](_0xba0b49);}function stateDrift(_0x287e57){const _0x676c86=a146_0x539bf5;return menuError(_0x676c86(0x139),_0x287e57,'Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54c0f0,_0xe60f47){const _0xdabae3=a147_0x3e34,_0x1cc2c2=_0x54c0f0();while(!![]){try{const _0x432ca6=parseInt(_0xdabae3(0x140))/0x1+parseInt(_0xdabae3(0x131))/0x2*(-parseInt(_0xdabae3(0x130))/0x3)+parseInt(_0xdabae3(0x14c))/0x4+-parseInt(_0xdabae3(0x147))/0x5+-parseInt(_0xdabae3(0x153))/0x6+-parseInt(_0xdabae3(0x150))/0x7*(-parseInt(_0xdabae3(0x136))/0x8)+-parseInt(_0xdabae3(0x144))/0x9*(-parseInt(_0xdabae3(0x13b))/0xa);if(_0x432ca6===_0xe60f47)break;else _0x1cc2c2['push'](_0x1cc2c2['shift']());}catch(_0x290a31){_0x1cc2c2['push'](_0x1cc2c2['shift']());}}}(a147_0x2c22,0xc3d47));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 a147_0x380cad,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x1c8ad5,_0x5efceb){const _0x16fa33=a147_0x3e34,_0x41df16=getEnv();logger[_0x16fa33(0x138)]('get-online-menu-list',isProduction(_0x41df16)?_0x16fa33(0x14a)+_0x1c8ad5+')':_0x16fa33(0x152)+_0x1c8ad5+')');const _0x4f9f16=await fetchMenuSnapshot(_0x1c8ad5,_0x5efceb,{'verbose':!![]});return logger[_0x16fa33(0x138)](_0x16fa33(0x14e),_0x16fa33(0x13a)+_0x4f9f16[_0x16fa33(0x137)]+_0x16fa33(0x149)),_0x4f9f16[_0x16fa33(0x139)][_0x16fa33(0x142)](toProcessedMenuItem);}export async function createMenu(_0x2a603d,_0x3dc314,_0x41e8ca){const _0x9129f6=a147_0x3e34;logger[_0x9129f6(0x138)](_0x9129f6(0x132),_0x9129f6(0x133)+_0x41e8ca[_0x9129f6(0x145)]+'\x20('+_0x41e8ca[_0x9129f6(0x135)]+')');const _0x4a9b15={'appCode':_0x2a603d,'type':'procode','sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x41e8ca[_0x9129f6(0x151)]?JSON[_0x9129f6(0x148)](_0x41e8ca[_0x9129f6(0x151)]):undefined},..._0x41e8ca},_0x1a016a=await createMenuRecord(_0x4a9b15,_0x3dc314,_0x9129f6(0x12f)+_0x41e8ca['label']+'\x22');return logger[_0x9129f6(0x138)]('create-menu',_0x9129f6(0x14f)+_0x41e8ca[_0x9129f6(0x145)]),_0x1a016a;}async function createSingleMenu(_0x410515,_0x29a142,_0x3133a9,_0xd2c99c){const _0x491168=a147_0x3e34,_0x4d5525={'appCode':_0x410515,'type':'procode','sort':0x0,'extend':{'loadScriptMode':'import','resources':_0xd2c99c?JSON[_0x491168(0x148)](_0xd2c99c):undefined},'label':_0x3133a9[_0x491168(0x145)],'path':_0x3133a9[_0x491168(0x135)]},_0x174c0e=await createMenuRecord(_0x4d5525,_0x29a142,_0x491168(0x12f)+_0x3133a9[_0x491168(0x145)]+'\x22');return logger[_0x491168(0x138)]('create-menu',_0x491168(0x14f)+_0x3133a9[_0x491168(0x145)]),_0x174c0e;}function a147_0x2c22(){const _0x281574=['\x20menu','Start\x20batch\x20menu\x20creation,\x20total\x20','length','Update\x20menu\x20assets\x20\x22','256585iuFXUs','extend','map','update-menu-cdn-url','2284209bINFmH','label','Updating\x20menu\x20asset\x20links:\x20','4876235iVrjwI','stringify','\x20online\x20menus\x20successfully','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','loadScriptMode','2191932YhpDpD','\x20menu\x20group(s)','get-online-menu-list','Menu\x20created\x20successfully:\x20','581098CuYojq','resources','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','5058300BxjLVu','Delete\x20','Regroup\x20','all','Update\x20menu\x20','Batch\x20menu\x20creation\x20completed,\x20total\x20','Create\x20menu\x20\x22','12fpHiIo','190294ayXsxl','create-menu','Creating\x20menu:\x20','create-menus','path','16FCAocB','total','info','menus','Fetched\x20','80EvAPuE'];a147_0x2c22=function(){return _0x281574;};return a147_0x2c22();}export async function createMenus(_0x35b322,_0x467015,_0x2faa32,_0x208d1a){const _0x1fbf41=a147_0x3e34;logger['info']('create-menus',_0x1fbf41(0x13d)+_0x2faa32[_0x1fbf41(0x13e)]);const _0x4a1987=await Promise[_0x1fbf41(0x12c)](_0x2faa32[_0x1fbf41(0x142)](_0x385bd9=>createSingleMenu(_0x35b322,_0x467015,_0x385bd9,_0x208d1a)));return logger[_0x1fbf41(0x138)](_0x1fbf41(0x134),_0x1fbf41(0x12e)+_0x2faa32[_0x1fbf41(0x13e)]),_0x4a1987;}export async function updateMenuCdnUrl(_0x3dbcdb,_0x3261ed,_0x300a30){const _0x586e1d=a147_0x3e34;logger[_0x586e1d(0x138)](_0x586e1d(0x143),_0x586e1d(0x146)+_0x300a30[_0x586e1d(0x145)]+'\x20('+_0x300a30['path']+')');const _0x1a0cbc={'id':_0x300a30['id'],'appCode':_0x3dbcdb,'extend':{..._0x300a30[_0x586e1d(0x141)]??{},..._0x300a30[_0x586e1d(0x14b)]?{'loadScriptMode':_0x300a30[_0x586e1d(0x14b)]}:{},'resources':_0x300a30['resources']?JSON[_0x586e1d(0x148)](_0x300a30[_0x586e1d(0x151)]):undefined}},_0x4573f8=await updateMenuRecord(_0x1a0cbc,_0x3261ed,_0x586e1d(0x13f)+_0x300a30['label']+'\x22');return logger[_0x586e1d(0x138)](_0x586e1d(0x143),'Menu\x20assets\x20synced:\x20'+_0x300a30[_0x586e1d(0x145)],undefined),_0x4573f8;}export async function createMenuEntity(_0x524151,_0x567d35,_0x5b12c6){const _0x1882bc=a147_0x3e34;return createMenuRecord({'appCode':_0x524151,..._0x5b12c6},_0x567d35,'Create\x20menu\x20\x22'+_0x5b12c6[_0x1882bc(0x145)]+'\x22');}export async function updateMenuEntity(_0x431cf2,_0xed8d1c,_0x3ec151){const _0xa02641=a147_0x3e34;return updateMenuRecord({'appCode':_0x431cf2,..._0x3ec151},_0xed8d1c,_0xa02641(0x12d)+_0x3ec151['id']);}function a147_0x3e34(_0x4fee17,_0x1345c2){_0x4fee17=_0x4fee17-0x12b;const _0x2c2271=a147_0x2c22();let _0x3e348c=_0x2c2271[_0x4fee17];return _0x3e348c;}export async function batchDeleteMenuEntities(_0xa1c7c1,_0x27ec27){const _0x16ca62=a147_0x3e34;return batchDeleteMenuRecords(_0x27ec27,_0xa1c7c1,_0x16ca62(0x154)+_0x27ec27['length']+_0x16ca62(0x13c)+(_0x27ec27[_0x16ca62(0x13e)]===0x1?'':'s'));}export async function startMenuRegroup(_0x1c9620,_0x276afe){const _0x274feb=a147_0x3e34;return a147_0x380cad(_0x276afe,_0x1c9620,_0x274feb(0x12b)+_0x276afe['menuGroups'][_0x274feb(0x13e)]+_0x274feb(0x14d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a148_0x23bed3=a148_0x5df4;(function(_0x2b7024,_0x1ba882){const _0x473f1c=a148_0x5df4,_0x360252=_0x2b7024();while(!![]){try{const _0x317938=parseInt(_0x473f1c(0xba))/0x1*(-parseInt(_0x473f1c(0xb5))/0x2)+-parseInt(_0x473f1c(0xc9))/0x3*(parseInt(_0x473f1c(0xc7))/0x4)+-parseInt(_0x473f1c(0xbc))/0x5+-parseInt(_0x473f1c(0xc6))/0x6+parseInt(_0x473f1c(0xcc))/0x7+parseInt(_0x473f1c(0xca))/0x8+-parseInt(_0x473f1c(0xb0))/0x9*(-parseInt(_0x473f1c(0xa0))/0xa);if(_0x317938===_0x1ba882)break;else _0x360252['push'](_0x360252['shift']());}catch(_0x487d45){_0x360252['push'](_0x360252['shift']());}}}(a148_0x4a52,0xc1179));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 a148_0x4a52(){const _0x497d0f=['JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','9jQLmNS','JS\x20URL\x20is\x20unreachable:\x20','Invalid\x20--params\x20JSON.','label','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','6IMVWTb','string','map','isArray','Invalid\x20--params\x20fields:\x20','243824GCvCIn','Start\x20non-interactive\x20menu\x20sync','6702455XvLpij','No\x20local\x20pages\x20matched\x20paths:\x20','object','path','field','trim','--params.','message','dryRun','info','6419178CowgNW','784156GoNdVn','has','24cOWQLD','4890008OlIMGU','length','636237mBFNxS','Menu\x20sync\x20completed','filter','47989010oAtYXg','cssUrl','cwd','push','join','pages','import','menu-sync','procode','parse','Invalid\x20--params:\x20','setLogPath','\x0a\x20\x20Available\x20local\x20paths:\x20','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','jsUrl'];a148_0x4a52=function(){return _0x497d0f;};return a148_0x4a52();}import{logger}from'../../../utils/logger.js';function a148_0x5df4(_0x14b755,_0x346e1f){_0x14b755=_0x14b755-0x9f;const _0x4a52cc=a148_0x4a52();let _0x5df406=_0x4a52cc[_0x14b755];return _0x5df406;}const MENU_SYNC_PARAM_KEYS=new Set([a148_0x23bed3(0xae),a148_0x23bed3(0xa1)]);function validateParams(_0x303ffc){const _0x1ed852=a148_0x23bed3,_0x1e8f41=[];return _0x303ffc[_0x1ed852(0xae)]&&!isValidJsHttpsUrl(_0x303ffc[_0x1ed852(0xae)])&&_0x1e8f41['push']({'field':_0x1ed852(0xae),'message':_0x1ed852(0xaf)}),_0x303ffc[_0x1ed852(0xa1)]&&!isValidCssHttpsUrl(_0x303ffc[_0x1ed852(0xa1)])&&_0x1e8f41[_0x1ed852(0xa3)]({'field':_0x1ed852(0xa1),'message':_0x1ed852(0xad)}),_0x1e8f41;}export async function runMenuSyncCore(_0x35553e,_0x5585d9,_0x57e27f=[],_0x11647b,_0x2e8d54={}){const _0x48e50f=a148_0x23bed3,_0x200d16=parseMenuSyncParams(_0x11647b),_0x3c9dd8=[...new Set(_0x57e27f['map'](_0x33a67e=>_0x33a67e[_0x48e50f(0xc1)]())[_0x48e50f(0x9f)](Boolean))],_0xc6a019=_0x200d16[_0x48e50f(0xae)],_0x5d134a=_0x200d16[_0x48e50f(0xa1)],_0x119a81=[];if(_0xc6a019)_0x119a81[_0x48e50f(0xa3)](_0xc6a019);if(_0x5d134a)_0x119a81[_0x48e50f(0xa3)](_0x5d134a);const _0xf92687=validateParams(_0x200d16);if(_0xf92687[_0x48e50f(0xcb)]>0x0){const _0x2c8075=_0xf92687['map'](_0x72fcae=>_0x48e50f(0xc2)+_0x72fcae[_0x48e50f(0xc0)]+':\x20'+_0x72fcae[_0x48e50f(0xc3)])['join'](';\x20');throw new Error(_0x48e50f(0xaa)+_0x2c8075);}logger[_0x48e50f(0xab)](process[_0x48e50f(0xa2)]()),logger['info']('menu-sync',_0x48e50f(0xbb),{'appCode':_0x35553e,'selectedCount':_0x3c9dd8['length'],'jsUrl':_0xc6a019,'cssUrl':_0x5d134a});if(_0xc6a019){const _0x1681eb=await isUrlReachable(_0xc6a019);if(!_0x1681eb)throw new Error(_0x48e50f(0xb1)+_0xc6a019);}if(_0x5d134a){const _0x1b5609=await isUrlReachable(_0x5d134a);if(!_0x1b5609)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x5d134a);}const _0x2523a0=getLocalPages();if(_0x2523a0['length']===0x0){if(_0x3c9dd8['length']>0x0)throw new Error(_0x48e50f(0xbd)+_0x3c9dd8['join'](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x2e8d54[_0x48e50f(0xc4)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x4d70da=await getOnlineMenuList(_0x35553e,_0x5585d9),_0x56e147=new Set(_0x4d70da['map'](_0x425418=>_0x425418[_0x48e50f(0xbf)]));let _0x1a6482;if(_0x3c9dd8[_0x48e50f(0xcb)]>0x0){const _0x2baae2=new Map(_0x2523a0[_0x48e50f(0xb7)](_0x310c90=>[_0x310c90[_0x48e50f(0xbf)],_0x310c90])),_0x651b0e=_0x3c9dd8[_0x48e50f(0x9f)](_0x2e4109=>!_0x2baae2[_0x48e50f(0xc8)](_0x2e4109));if(_0x651b0e[_0x48e50f(0xcb)]>0x0){const _0x1bec0c=_0x2523a0[_0x48e50f(0xb7)](_0x555f7f=>_0x555f7f[_0x48e50f(0xbf)])['join'](',\x20');throw new Error(_0x48e50f(0xbd)+_0x651b0e[_0x48e50f(0xa4)](',\x20')+_0x48e50f(0xac)+_0x1bec0c);}const _0xc48b3c=_0x3c9dd8[_0x48e50f(0x9f)](_0x3882e3=>_0x56e147['has'](_0x3882e3));if(_0xc48b3c[_0x48e50f(0xcb)]>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0xc48b3c['join'](',\x20'));_0x1a6482=_0x3c9dd8[_0x48e50f(0xb7)](_0x51ed06=>_0x2baae2['get'](_0x51ed06));}else _0x1a6482=_0x2523a0[_0x48e50f(0x9f)](_0x4a34c4=>!_0x56e147[_0x48e50f(0xc8)](_0x4a34c4[_0x48e50f(0xbf)]));if(_0x1a6482['length']===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x2e8d54['dryRun']===!![],'targetPages':[],'plannedMenus':[]};const _0x100d0d=_0x1a6482[_0x48e50f(0xb7)](_0xfbc2b9=>({'type':_0x48e50f(0xa8),'path':_0xfbc2b9[_0x48e50f(0xbf)],'label':_0xfbc2b9[_0x48e50f(0xb3)],'loadScriptMode':_0x48e50f(0xa6),'resources':[..._0x119a81]}));if(_0x2e8d54[_0x48e50f(0xc4)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x1a6482,'plannedMenus':_0x100d0d};const _0x4f1337=await createMenus(_0x35553e,_0x5585d9,_0x1a6482,_0x119a81[_0x48e50f(0xcb)]>0x0?_0x119a81:undefined);return logger[_0x48e50f(0xc5)](_0x48e50f(0xa7),_0x48e50f(0xcd),{'count':_0x1a6482[_0x48e50f(0xcb)],'resources':_0x119a81}),{'created':_0x4f1337['length'],'skipped':![],'dryRun':![],'targetPages':_0x1a6482,'plannedMenus':_0x100d0d,'menus':_0x4f1337};}export function parseMenuSyncParams(_0x16a15e){const _0x25d392=a148_0x23bed3;if(!_0x16a15e||typeof _0x16a15e!==_0x25d392(0xb6))return{};let _0x5cf855;try{_0x5cf855=JSON[_0x25d392(0xa9)](_0x16a15e);}catch{throw new Error(_0x25d392(0xb2));}if(typeof _0x5cf855!==_0x25d392(0xbe)||_0x5cf855===null||Array[_0x25d392(0xb8)](_0x5cf855))throw new Error(_0x25d392(0xb4));const _0x418c81=_0x5cf855;if(Object['hasOwn'](_0x418c81,_0x25d392(0xa5)))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x2838a4=Object['keys'](_0x418c81)[_0x25d392(0x9f)](_0x36c828=>!MENU_SYNC_PARAM_KEYS[_0x25d392(0xc8)](_0x36c828));if(_0x2838a4[_0x25d392(0xcb)]>0x0)throw new Error(_0x25d392(0xb9)+_0x2838a4[_0x25d392(0xa4)](',\x20')+'.');for(const _0x92d681 of MENU_SYNC_PARAM_KEYS){const _0x57ee97=_0x418c81[_0x92d681];if(_0x57ee97!==undefined&&(typeof _0x57ee97!=='string'||_0x57ee97['trim']()===''))throw new Error('Invalid\x20--params.'+_0x92d681+':\x20expected\x20a\x20non-empty\x20string.');}return{'jsUrl':typeof _0x418c81[_0x25d392(0xae)]===_0x25d392(0xb6)?_0x418c81['jsUrl'][_0x25d392(0xc1)]():undefined,'cssUrl':typeof _0x418c81[_0x25d392(0xa1)]===_0x25d392(0xb6)?_0x418c81['cssUrl'][_0x25d392(0xc1)]():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x433259,_0x3ee0df){const _0x129da2=a150_0x5ae3,_0x3e32de=_0x433259();while(!![]){try{const _0x78cbd1=parseInt(_0x129da2(0x191))/0x1+-parseInt(_0x129da2(0x194))/0x2*(parseInt(_0x129da2(0x15f))/0x3)+parseInt(_0x129da2(0x175))/0x4+parseInt(_0x129da2(0x15b))/0x5+parseInt(_0x129da2(0x18e))/0x6*(-parseInt(_0x129da2(0x151))/0x7)+-parseInt(_0x129da2(0x189))/0x8*(-parseInt(_0x129da2(0x171))/0x9)+parseInt(_0x129da2(0x182))/0xa;if(_0x78cbd1===_0x3ee0df)break;else _0x3e32de['push'](_0x3e32de['shift']());}catch(_0x2e07f1){_0x3e32de['push'](_0x3e32de['shift']());}}}(a150_0x575d,0x27616));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(_0x51f5a0){const _0x1dfd55=a150_0x5ae3,_0x2e0404=[];return _0x51f5a0['jsUrl']&&!isValidJsHttpsUrl(_0x51f5a0[_0x1dfd55(0x178)])&&_0x2e0404[_0x1dfd55(0x15c)]({'field':'jsUrl','message':_0x1dfd55(0x188)}),_0x51f5a0[_0x1dfd55(0x180)]&&!isValidCssHttpsUrl(_0x51f5a0[_0x1dfd55(0x180)])&&_0x2e0404[_0x1dfd55(0x15c)]({'field':_0x1dfd55(0x180),'message':_0x1dfd55(0x16a)}),_0x2e0404;}export async function runMenuUpdateCore(_0x1bdfac,_0x4f26c9,_0x277279,_0x4e4eee={}){const _0xad8db8=a150_0x5ae3,_0x3c750f=parseUpdateParamsFlag(_0x277279),_0x1fcd65=normalizeMode(_0x4e4eee[_0xad8db8(0x183)]);validateSelection(_0x4e4eee[_0xad8db8(0x16c)]);const _0x57a394=[];if(_0x3c750f[_0xad8db8(0x178)])_0x57a394['push'](_0x3c750f[_0xad8db8(0x178)]);if(_0x3c750f['cssUrl'])_0x57a394['push'](_0x3c750f['cssUrl']);const _0x44a51e=validateParams(_0x3c750f);if(_0x44a51e['length']>0x0){const _0x477086=_0x44a51e['map'](_0xad21ba=>_0xad8db8(0x16f)+_0xad21ba[_0xad8db8(0x190)]+':\x20'+_0xad21ba[_0xad8db8(0x169)])['join'](';\x20');throw new Error(_0xad8db8(0x174)+_0x477086);}if(_0x57a394[_0xad8db8(0x15e)]===0x0)throw new Error(_0xad8db8(0x157)+_0xad8db8(0x168));logger[_0xad8db8(0x170)](process[_0xad8db8(0x18b)]()),logger[_0xad8db8(0x18f)](_0xad8db8(0x186),'Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x1bdfac,'jsUrl':_0x3c750f[_0xad8db8(0x178)],'cssUrl':_0x3c750f['cssUrl'],'mode':_0x1fcd65,'dryRun':_0x4e4eee['dryRun']===!![]});if(_0x3c750f['jsUrl']){const _0x499c54=await isUrlReachable(_0x3c750f[_0xad8db8(0x178)]);if(!_0x499c54)throw new Error(_0xad8db8(0x192)+_0x3c750f[_0xad8db8(0x178)]);}if(_0x3c750f['cssUrl']){const _0x3d4917=await isUrlReachable(_0x3c750f['cssUrl']);if(!_0x3d4917)throw new Error(_0xad8db8(0x17b)+_0x3c750f[_0xad8db8(0x180)]);}const _0x3b64c0=await getOnlineMenuList(_0x1bdfac,_0x4f26c9),_0x24a46f=_0x3b64c0[_0xad8db8(0x173)](_0x18b54e=>_0x18b54e[_0xad8db8(0x176)]['length']>0x0),_0x3f8cf3=selectMenusForUpdate(_0x24a46f,_0x4e4eee[_0xad8db8(0x16c)]);if(_0x3f8cf3['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x4e4eee[_0xad8db8(0x17a)]===!![]};const _0x49ca2b=_0x3f8cf3[_0xad8db8(0x167)](_0x4da9b2=>buildMenuUpdateDiff(_0x4da9b2,_0x3c750f,_0x1fcd65,_0x4e4eee[_0xad8db8(0x17d)]===!![],_0x4e4eee[_0xad8db8(0x17e)]));if(_0x4e4eee[_0xad8db8(0x17a)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x49ca2b};const _0x19d4b9=await Promise[_0xad8db8(0x17f)](_0x3f8cf3['map']((_0x2f45b5,_0x10e2a6)=>updateMenuCdnUrl(_0x1bdfac,_0x4f26c9,{'id':_0x2f45b5['id'],'label':_0x2f45b5[_0xad8db8(0x185)],'path':_0x2f45b5[_0xad8db8(0x161)],'resources':_0x49ca2b[_0x10e2a6][_0xad8db8(0x150)][_0xad8db8(0x176)],'extend':_0x2f45b5[_0xad8db8(0x18a)]??null,'loadScriptMode':_0x4e4eee[_0xad8db8(0x17e)]}))),_0x2e6837=_0x19d4b9[_0xad8db8(0x173)](_0x48bbad=>_0x48bbad['status']===_0xad8db8(0x163))['map'](_0x6d5dd=>_0x6d5dd['value']),_0x4426cb=_0x19d4b9[_0xad8db8(0x173)](_0x2fe964=>_0x2fe964[_0xad8db8(0x197)]===_0xad8db8(0x16d))[_0xad8db8(0x15e)];return logger[_0xad8db8(0x18f)](_0xad8db8(0x186),_0xad8db8(0x17c),{'count':_0x3f8cf3[_0xad8db8(0x15e)],'resources':_0x57a394}),{'updated':_0x2e6837['length'],'failed':_0x4426cb,'skipped':![],'menus':_0x2e6837};}function a150_0x5ae3(_0x40c4ea,_0x1aa121){_0x40c4ea=_0x40c4ea-0x14f;const _0x575de1=a150_0x575d();let _0x5ae3af=_0x575de1[_0x40c4ea];return _0x5ae3af;}function validateSelection(_0x81dbeb){const _0x1cd4c9=a150_0x5ae3;if(!_0x81dbeb)throw new Error(_0x1cd4c9(0x18d));if(_0x81dbeb[_0x1cd4c9(0x160)]&&(_0x81dbeb[_0x1cd4c9(0x15a)][_0x1cd4c9(0x15e)]>0x0||_0x81dbeb[_0x1cd4c9(0x166)][_0x1cd4c9(0x15e)]>0x0))throw new Error(_0x1cd4c9(0x193));if(!_0x81dbeb['all']&&_0x81dbeb['menuIds'][_0x1cd4c9(0x15e)]===0x0&&_0x81dbeb[_0x1cd4c9(0x166)][_0x1cd4c9(0x15e)]===0x0)throw new Error(_0x1cd4c9(0x18d));}export function selectMenusForUpdate(_0x6e810e,_0x3ecc4e){const _0x5ecbc7=a150_0x5ae3;validateSelection(_0x3ecc4e);if(_0x3ecc4e[_0x5ecbc7(0x160)])return _0x6e810e;const _0x41317b=new Set(_0x6e810e[_0x5ecbc7(0x167)](_0x311807=>_0x311807['id'])),_0x2278a7=new Set(_0x6e810e[_0x5ecbc7(0x167)](_0x3151c8=>_0x3151c8[_0x5ecbc7(0x161)])),_0x244312=_0x3ecc4e[_0x5ecbc7(0x15a)][_0x5ecbc7(0x173)](_0x42444b=>!_0x41317b[_0x5ecbc7(0x18c)](_0x42444b)),_0x2b2c70=_0x3ecc4e[_0x5ecbc7(0x166)][_0x5ecbc7(0x173)](_0x2c1960=>!_0x2278a7['has'](_0x2c1960));if(_0x244312['length']>0x0||_0x2b2c70[_0x5ecbc7(0x15e)]>0x0){const _0x5710fe=[..._0x244312[_0x5ecbc7(0x167)](_0x3e788f=>String(_0x3e788f)),..._0x2b2c70][_0x5ecbc7(0x162)](',\x20');throw new Error(_0x5ecbc7(0x159)+_0x5710fe);}const _0x2863d0=new Set(_0x3ecc4e['menuIds']),_0x35ee4d=new Set(_0x3ecc4e[_0x5ecbc7(0x166)]);return _0x6e810e[_0x5ecbc7(0x173)](_0x5bdd44=>_0x2863d0[_0x5ecbc7(0x18c)](_0x5bdd44['id'])||_0x35ee4d[_0x5ecbc7(0x18c)](_0x5bdd44[_0x5ecbc7(0x161)]));}function a150_0x575d(){const _0x4d5733=['.js','isArray','after','1804201wfcqez','patch','.css','menu\x20asset-update\x20cannot\x20patch\x20','split','some','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','string','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','menuIds','35180BQUOBk','push','Invalid\x20--mode:\x20','length','173067RUVYET','all','path','join','fulfilled','\x20existing\x20JS\x20resources\x20for\x20\x22','toLowerCase','paths','map','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','message','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','\x22\x20(','selection','rejected','endsWith','--params.','setLogPath','288syectC','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','filter','Invalid\x20--params:\x20','152760cyXzDR','resources','unshift','jsUrl','parse','dryRun','CSS\x20URL\x20is\x20unreachable:\x20','Menu\x20asset\x20update\x20completed','force','loadScriptMode','allSettled','cssUrl','replace','2142540VfgXtc','mode','trim','label','menu-asset-update','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','71752cgBCFq','extend','cwd','has','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','6GqawgI','info','field','161002jAziqS','JS\x20URL\x20is\x20unreachable:\x20','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','10Ieirmt',').\x20','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','status'];a150_0x575d=function(){return _0x4d5733;};return a150_0x575d();}function normalizeMode(_0x13ac86){const _0x52447a=a150_0x5ae3;if(!_0x13ac86)return _0x52447a(0x152);if(_0x13ac86===_0x52447a(0x181)||_0x13ac86===_0x52447a(0x152))return _0x13ac86;throw new Error(_0x52447a(0x15d)+_0x13ac86+'.\x20Allowed\x20values:\x20replace,\x20patch');}function buildMenuUpdateDiff(_0x579b52,_0x586c30,_0x460dca,_0xaca9f0,_0x3c61f0){const _0xfe6d79=a150_0x5ae3,_0x497b87=[..._0x579b52['resources']];_0x460dca===_0xfe6d79(0x152)&&assertUnambiguousPatchResources(_0x579b52,_0x497b87,_0x586c30);const _0x6ab3f=_0x460dca==='patch'?patchResources(_0x497b87,_0x586c30):replaceResources(_0x586c30),_0x429f74=[],_0x3bd18c=_0x497b87[_0xfe6d79(0x156)](isJsResource),_0x30b09a=_0x6ab3f['some'](isJsResource);if(_0x3bd18c&&!_0x30b09a){const _0x4ce589='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x579b52[_0xfe6d79(0x185)]+_0xfe6d79(0x16b)+_0x579b52[_0xfe6d79(0x161)]+_0xfe6d79(0x195)+_0xfe6d79(0x196);if(!_0xaca9f0)throw new Error(_0x4ce589);_0x429f74['push'](_0x4ce589);}const _0x4c8d79=_0x497b87[_0xfe6d79(0x156)](isCssResource),_0xad7be7=_0x6ab3f['some'](isCssResource);_0x4c8d79&&!_0xad7be7&&_0x429f74['push'](_0xfe6d79(0x172)+_0x579b52[_0xfe6d79(0x185)]+'\x22\x20('+_0x579b52[_0xfe6d79(0x161)]+').');const _0x31f06b=typeof _0x579b52[_0xfe6d79(0x18a)]?.[_0xfe6d79(0x17e)]===_0xfe6d79(0x158)?_0x579b52[_0xfe6d79(0x18a)][_0xfe6d79(0x17e)]:null,_0x474b19=_0x3c61f0?{'loadScriptMode':_0x31f06b}:{},_0x5a6e4c=_0x3c61f0?{'loadScriptMode':_0x3c61f0}:{};return{'id':_0x579b52['id'],'label':_0x579b52[_0xfe6d79(0x185)],'path':_0x579b52['path'],'mode':_0x460dca,'before':{'resources':_0x497b87,..._0x474b19},'after':{'resources':_0x6ab3f,..._0x5a6e4c},'warnings':_0x429f74};}function replaceResources(_0x95f24b){const _0x51d5f1=a150_0x5ae3;return[_0x95f24b[_0x51d5f1(0x178)],_0x95f24b[_0x51d5f1(0x180)]][_0x51d5f1(0x173)](_0x180192=>!!_0x180192);}function assertUnambiguousPatchResources(_0x38ab6c,_0x55534d,_0x36350a){const _0x596d2c=a150_0x5ae3,_0x24941f=_0x55534d[_0x596d2c(0x173)](isJsResource)[_0x596d2c(0x15e)];if(_0x36350a[_0x596d2c(0x178)]&&_0x24941f>0x1)throw new Error(_0x596d2c(0x154)+_0x24941f+_0x596d2c(0x164)+_0x38ab6c[_0x596d2c(0x185)]+'\x22\x20('+_0x38ab6c[_0x596d2c(0x161)]+')\x20'+_0x596d2c(0x187));const _0x2506d0=_0x55534d['filter'](isCssResource)[_0x596d2c(0x15e)];if(_0x36350a[_0x596d2c(0x180)]&&_0x2506d0>0x1)throw new Error(_0x596d2c(0x154)+_0x2506d0+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x38ab6c[_0x596d2c(0x185)]+_0x596d2c(0x16b)+_0x38ab6c[_0x596d2c(0x161)]+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function patchResources(_0x3e2c34,_0x5b5804){const _0x383e2d=a150_0x5ae3;let _0x55631c=![],_0x27981e=![];const _0x5bffa5=[];for(const _0x2fc348 of _0x3e2c34){if(isJsResource(_0x2fc348)){if(_0x5b5804['jsUrl']&&!_0x55631c)_0x5bffa5[_0x383e2d(0x15c)](_0x5b5804['jsUrl']),_0x55631c=!![];else!_0x5b5804[_0x383e2d(0x178)]&&_0x5bffa5['push'](_0x2fc348);continue;}if(isCssResource(_0x2fc348)){if(_0x5b5804[_0x383e2d(0x180)]&&!_0x27981e)_0x5bffa5[_0x383e2d(0x15c)](_0x5b5804[_0x383e2d(0x180)]),_0x27981e=!![];else!_0x5b5804['cssUrl']&&_0x5bffa5['push'](_0x2fc348);continue;}_0x5bffa5['push'](_0x2fc348);}return _0x5b5804[_0x383e2d(0x178)]&&!_0x55631c&&_0x5bffa5[_0x383e2d(0x177)](_0x5b5804[_0x383e2d(0x178)]),_0x5b5804['cssUrl']&&!_0x27981e&&_0x5bffa5['push'](_0x5b5804[_0x383e2d(0x180)]),_0x5bffa5;}function isJsResource(_0xff0659){const _0x3185bc=a150_0x5ae3;return stripQuery(_0xff0659)['toLowerCase']()[_0x3185bc(0x16e)](_0x3185bc(0x198));}function isCssResource(_0x3f8423){const _0xf9f87e=a150_0x5ae3;return stripQuery(_0x3f8423)[_0xf9f87e(0x165)]()['endsWith'](_0xf9f87e(0x153));}function stripQuery(_0x345bb4){const _0x6672e=a150_0x5ae3;return _0x345bb4[_0x6672e(0x155)]('?')[0x0]??_0x345bb4;}function parseUpdateParamsFlag(_0x85cd25){const _0x505f58=a150_0x5ae3;if(!_0x85cd25||typeof _0x85cd25!=='string')return{};try{const _0x11c74a=JSON[_0x505f58(0x179)](_0x85cd25);if(typeof _0x11c74a!=='object'||_0x11c74a===null||Array[_0x505f58(0x14f)](_0x11c74a))return{};return{'jsUrl':typeof _0x11c74a[_0x505f58(0x178)]===_0x505f58(0x158)?_0x11c74a[_0x505f58(0x178)]['trim']():undefined,'cssUrl':typeof _0x11c74a[_0x505f58(0x180)]===_0x505f58(0x158)?_0x11c74a['cssUrl'][_0x505f58(0x184)]():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x3d0522,_0x568f98){const _0x1e92d8=a150_0x5ca0,_0x5a5e5b=_0x3d0522();while(!![]){try{const _0x1a4849=-parseInt(_0x1e92d8(0x96))/0x1+-parseInt(_0x1e92d8(0xb6))/0x2*(-parseInt(_0x1e92d8(0x9a))/0x3)+-parseInt(_0x1e92d8(0x84))/0x4*(-parseInt(_0x1e92d8(0x7d))/0x5)+parseInt(_0x1e92d8(0x93))/0x6*(-parseInt(_0x1e92d8(0xb3))/0x7)+parseInt(_0x1e92d8(0x8c))/0x8+parseInt(_0x1e92d8(0x7e))/0x9+-parseInt(_0x1e92d8(0x9c))/0xa;if(_0x1a4849===_0x568f98)break;else _0x5a5e5b['push'](_0x5a5e5b['shift']());}catch(_0x5af225){_0x5a5e5b['push'](_0x5a5e5b['shift']());}}}(a150_0x3193,0x2b3bc));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';function a150_0x5ca0(_0x565057,_0x299f0d){_0x565057=_0x565057-0x7c;const _0x319328=a150_0x3193();let _0x5ca003=_0x319328[_0x565057];return _0x5ca003;}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x573ba7){const _0x5db820=a150_0x5ca0,_0x49b7d6=[];return _0x573ba7['jsUrl']&&!isValidJsHttpsUrl(_0x573ba7[_0x5db820(0x8d)])&&_0x49b7d6[_0x5db820(0xa4)]({'field':_0x5db820(0x8d),'message':_0x5db820(0x95)}),_0x573ba7[_0x5db820(0xbd)]&&!isValidCssHttpsUrl(_0x573ba7[_0x5db820(0xbd)])&&_0x49b7d6['push']({'field':_0x5db820(0xbd),'message':_0x5db820(0xab)}),_0x49b7d6;}export async function runMenuUpdateCore(_0x30a4dc,_0x4b9b54,_0x464579,_0x4fb2fb={}){const _0x3ec712=a150_0x5ca0,_0x803608=parseUpdateParamsFlag(_0x464579),_0x1cdc13=normalizeMode(_0x4fb2fb[_0x3ec712(0xbb)]);validateSelection(_0x4fb2fb[_0x3ec712(0x85)]);const _0x38a266=[];if(_0x803608['jsUrl'])_0x38a266['push'](_0x803608['jsUrl']);if(_0x803608[_0x3ec712(0xbd)])_0x38a266[_0x3ec712(0xa4)](_0x803608['cssUrl']);const _0x32f693=validateParams(_0x803608);if(_0x32f693[_0x3ec712(0xbe)]>0x0){const _0x18c847=_0x32f693[_0x3ec712(0x87)](_0x33928d=>_0x3ec712(0x90)+_0x33928d[_0x3ec712(0xba)]+':\x20'+_0x33928d[_0x3ec712(0x81)])[_0x3ec712(0xb1)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x18c847);}if(_0x38a266[_0x3ec712(0xbe)]===0x0)throw new Error(_0x3ec712(0xa3)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x3ec712(0x8e)](process[_0x3ec712(0x80)]()),logger[_0x3ec712(0x99)]('menu-asset-update','Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x30a4dc,'jsUrl':_0x803608['jsUrl'],'cssUrl':_0x803608[_0x3ec712(0xbd)],'mode':_0x1cdc13,'dryRun':_0x4fb2fb[_0x3ec712(0xaa)]===!![]});if(_0x803608[_0x3ec712(0x8d)]){const _0x3b8a79=await isUrlReachable(_0x803608['jsUrl']);if(!_0x3b8a79)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x803608[_0x3ec712(0x8d)]);}if(_0x803608[_0x3ec712(0xbd)]){const _0x2d5ec5=await isUrlReachable(_0x803608['cssUrl']);if(!_0x2d5ec5)throw new Error(_0x3ec712(0xae)+_0x803608['cssUrl']);}const _0x9a8028=await getOnlineMenuList(_0x30a4dc,_0x4b9b54),_0x2721bc=_0x9a8028['filter'](_0x5ccbef=>_0x5ccbef[_0x3ec712(0xb4)][_0x3ec712(0xbe)]>0x0),_0x4691d0=selectMenusForUpdate(_0x2721bc,_0x4fb2fb['selection']);if(_0x4691d0['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x4fb2fb[_0x3ec712(0xaa)]===!![]};const _0x549f44=_0x4691d0[_0x3ec712(0x87)](_0x39f75c=>buildMenuUpdateDiff(_0x39f75c,_0x803608,_0x1cdc13,_0x4fb2fb['force']===!![],_0x4fb2fb[_0x3ec712(0xad)]));if(_0x4fb2fb['dryRun'])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x549f44};const _0x597974=await Promise['allSettled'](_0x4691d0[_0x3ec712(0x87)]((_0x24f27c,_0x1246ee)=>updateMenuCdnUrl(_0x30a4dc,_0x4b9b54,{'id':_0x24f27c['id'],'label':_0x24f27c[_0x3ec712(0x7c)],'path':_0x24f27c[_0x3ec712(0xbf)],'resources':_0x549f44[_0x1246ee][_0x3ec712(0xa9)][_0x3ec712(0xb4)],'extend':_0x24f27c[_0x3ec712(0xa2)]??null,'loadScriptMode':_0x4fb2fb[_0x3ec712(0xad)]}))),_0x13e503=_0x597974[_0x3ec712(0x92)](_0x2c1ffa=>_0x2c1ffa[_0x3ec712(0xac)]===_0x3ec712(0xa0))[_0x3ec712(0x87)](_0x54b404=>_0x54b404[_0x3ec712(0xa1)]),_0x2091ed=_0x597974[_0x3ec712(0x92)](_0x4c306f=>_0x4c306f[_0x3ec712(0xac)]==='rejected')[_0x3ec712(0xbe)];return logger[_0x3ec712(0x99)](_0x3ec712(0x9b),'Menu\x20asset\x20update\x20completed',{'count':_0x4691d0[_0x3ec712(0xbe)],'resources':_0x38a266}),{'updated':_0x13e503[_0x3ec712(0xbe)],'failed':_0x2091ed,'skipped':![],'menus':_0x13e503};}function validateSelection(_0x18e6db){const _0x4ab94c=a150_0x5ca0;if(!_0x18e6db)throw new Error(_0x4ab94c(0x98));if(_0x18e6db[_0x4ab94c(0x7f)]&&(_0x18e6db[_0x4ab94c(0xbc)][_0x4ab94c(0xbe)]>0x0||_0x18e6db[_0x4ab94c(0x88)][_0x4ab94c(0xbe)]>0x0))throw new Error(_0x4ab94c(0x97));if(!_0x18e6db[_0x4ab94c(0x7f)]&&_0x18e6db[_0x4ab94c(0xbc)][_0x4ab94c(0xbe)]===0x0&&_0x18e6db[_0x4ab94c(0x88)][_0x4ab94c(0xbe)]===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x3ded97,_0x3640a0){const _0x12eb46=a150_0x5ca0;validateSelection(_0x3640a0);if(_0x3640a0[_0x12eb46(0x7f)])return _0x3ded97;const _0x51906a=new Set(_0x3ded97[_0x12eb46(0x87)](_0x3b0a11=>_0x3b0a11['id'])),_0x5a8219=new Set(_0x3ded97[_0x12eb46(0x87)](_0x4d9adc=>_0x4d9adc[_0x12eb46(0xbf)])),_0x5500bf=_0x3640a0[_0x12eb46(0xbc)][_0x12eb46(0x92)](_0x5dfb9e=>!_0x51906a[_0x12eb46(0x8f)](_0x5dfb9e)),_0x10397e=_0x3640a0[_0x12eb46(0x88)][_0x12eb46(0x92)](_0x2aed5c=>!_0x5a8219[_0x12eb46(0x8f)](_0x2aed5c));if(_0x5500bf[_0x12eb46(0xbe)]>0x0||_0x10397e[_0x12eb46(0xbe)]>0x0){const _0x1d0055=[..._0x5500bf[_0x12eb46(0x87)](_0x24c040=>String(_0x24c040)),..._0x10397e]['join'](',\x20');throw new Error(_0x12eb46(0xb2)+_0x1d0055);}const _0x579cc8=new Set(_0x3640a0[_0x12eb46(0xbc)]),_0x36d2f7=new Set(_0x3640a0[_0x12eb46(0x88)]);return _0x3ded97[_0x12eb46(0x92)](_0xc8d6c2=>_0x579cc8['has'](_0xc8d6c2['id'])||_0x36d2f7[_0x12eb46(0x8f)](_0xc8d6c2['path']));}function normalizeMode(_0x48380f){const _0x4d5516=a150_0x5ca0;if(!_0x48380f)return _0x4d5516(0x82);if(_0x48380f===_0x4d5516(0xb0)||_0x48380f===_0x4d5516(0x82))return _0x48380f;throw new Error(_0x4d5516(0x86)+_0x48380f+_0x4d5516(0xb7));}function a150_0x3193(){const _0x5e4f9f=['1238485JjckQB','2723508nLPLXG','all','cwd','message','patch','\x20existing\x20JS\x20resources\x20for\x20\x22','4dtmXTv','selection','Invalid\x20--mode:\x20','map','paths','parse','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','1706768iXAWwk','jsUrl','setLogPath','has','--params.','toLowerCase','filter','3648ErPIjZ',').\x20','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','50295wpiaxb','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','info','142179QKgztN','menu-asset-update','5629660iofzRu','\x22\x20(','unshift','string','fulfilled','value','extend','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','push','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','trim','isArray','.css','after','dryRun','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','status','loadScriptMode','CSS\x20URL\x20is\x20unreachable:\x20','object','replace','join','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','784AyeEem','resources','menu\x20asset-update\x20cannot\x20patch\x20','4gpCFmZ','.\x20Allowed\x20values:\x20replace,\x20patch','some','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','field','mode','menuIds','cssUrl','length','path','label'];a150_0x3193=function(){return _0x5e4f9f;};return a150_0x3193();}function buildMenuUpdateDiff(_0x3b713d,_0x4f564b,_0x88d348,_0x23e0b7,_0x5c890a){const _0x228979=a150_0x5ca0,_0x2db23a=[..._0x3b713d[_0x228979(0xb4)]];_0x88d348==='patch'&&assertUnambiguousPatchResources(_0x3b713d,_0x2db23a,_0x4f564b);const _0x144f1f=_0x88d348===_0x228979(0x82)?patchResources(_0x2db23a,_0x4f564b):replaceResources(_0x4f564b),_0x5a0428=[],_0x76a9e0=_0x2db23a[_0x228979(0xb8)](isJsResource),_0x1da47a=_0x144f1f[_0x228979(0xb8)](isJsResource);if(_0x76a9e0&&!_0x1da47a){const _0x265b85=_0x228979(0xa5)+_0x3b713d[_0x228979(0x7c)]+_0x228979(0x9d)+_0x3b713d[_0x228979(0xbf)]+_0x228979(0x94)+_0x228979(0xb9);if(!_0x23e0b7)throw new Error(_0x265b85);_0x5a0428[_0x228979(0xa4)](_0x265b85);}const _0x4a4a6f=_0x2db23a[_0x228979(0xb8)](isCssResource),_0x497439=_0x144f1f['some'](isCssResource);_0x4a4a6f&&!_0x497439&&_0x5a0428[_0x228979(0xa4)]('menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22'+_0x3b713d[_0x228979(0x7c)]+_0x228979(0x9d)+_0x3b713d[_0x228979(0xbf)]+').');const _0x6db238=typeof _0x3b713d[_0x228979(0xa2)]?.[_0x228979(0xad)]==='string'?_0x3b713d[_0x228979(0xa2)][_0x228979(0xad)]:null,_0x5cede5=_0x5c890a?{'loadScriptMode':_0x6db238}:{},_0xcceea0=_0x5c890a?{'loadScriptMode':_0x5c890a}:{};return{'id':_0x3b713d['id'],'label':_0x3b713d['label'],'path':_0x3b713d['path'],'mode':_0x88d348,'before':{'resources':_0x2db23a,..._0x5cede5},'after':{'resources':_0x144f1f,..._0xcceea0},'warnings':_0x5a0428};}function replaceResources(_0x15b3e4){const _0x663cd=a150_0x5ca0;return[_0x15b3e4[_0x663cd(0x8d)],_0x15b3e4[_0x663cd(0xbd)]][_0x663cd(0x92)](_0x16d82c=>!!_0x16d82c);}function assertUnambiguousPatchResources(_0x23f5b7,_0xf98236,_0x3fa7d2){const _0x356198=a150_0x5ca0,_0x5baae3=_0xf98236[_0x356198(0x92)](isJsResource)[_0x356198(0xbe)];if(_0x3fa7d2[_0x356198(0x8d)]&&_0x5baae3>0x1)throw new Error(_0x356198(0xb5)+_0x5baae3+_0x356198(0x83)+_0x23f5b7[_0x356198(0x7c)]+_0x356198(0x9d)+_0x23f5b7[_0x356198(0xbf)]+')\x20'+_0x356198(0x8b));const _0x2f7ac1=_0xf98236[_0x356198(0x92)](isCssResource)[_0x356198(0xbe)];if(_0x3fa7d2[_0x356198(0xbd)]&&_0x2f7ac1>0x1)throw new Error(_0x356198(0xb5)+_0x2f7ac1+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x23f5b7[_0x356198(0x7c)]+_0x356198(0x9d)+_0x23f5b7[_0x356198(0xbf)]+')\x20'+_0x356198(0x8a));}function patchResources(_0x1271d6,_0x529348){const _0x17826f=a150_0x5ca0;let _0x2e61d5=![],_0x5b83ab=![];const _0x4336cb=[];for(const _0x4e9a8f of _0x1271d6){if(isJsResource(_0x4e9a8f)){if(_0x529348['jsUrl']&&!_0x2e61d5)_0x4336cb[_0x17826f(0xa4)](_0x529348[_0x17826f(0x8d)]),_0x2e61d5=!![];else!_0x529348[_0x17826f(0x8d)]&&_0x4336cb['push'](_0x4e9a8f);continue;}if(isCssResource(_0x4e9a8f)){if(_0x529348[_0x17826f(0xbd)]&&!_0x5b83ab)_0x4336cb['push'](_0x529348[_0x17826f(0xbd)]),_0x5b83ab=!![];else!_0x529348[_0x17826f(0xbd)]&&_0x4336cb[_0x17826f(0xa4)](_0x4e9a8f);continue;}_0x4336cb[_0x17826f(0xa4)](_0x4e9a8f);}return _0x529348[_0x17826f(0x8d)]&&!_0x2e61d5&&_0x4336cb[_0x17826f(0x9e)](_0x529348[_0x17826f(0x8d)]),_0x529348['cssUrl']&&!_0x5b83ab&&_0x4336cb[_0x17826f(0xa4)](_0x529348[_0x17826f(0xbd)]),_0x4336cb;}function isJsResource(_0x5135b8){const _0x529434=a150_0x5ca0;return stripQuery(_0x5135b8)[_0x529434(0x91)]()['endsWith']('.js');}function isCssResource(_0x1a2a10){const _0x4a4327=a150_0x5ca0;return stripQuery(_0x1a2a10)[_0x4a4327(0x91)]()['endsWith'](_0x4a4327(0xa8));}function stripQuery(_0x177767){return _0x177767['split']('?')[0x0]??_0x177767;}function parseUpdateParamsFlag(_0x28946b){const _0x311ffe=a150_0x5ca0;if(!_0x28946b||typeof _0x28946b!==_0x311ffe(0x9f))return{};try{const _0x148255=JSON[_0x311ffe(0x89)](_0x28946b);if(typeof _0x148255!==_0x311ffe(0xaf)||_0x148255===null||Array[_0x311ffe(0xa7)](_0x148255))return{};return{'jsUrl':typeof _0x148255[_0x311ffe(0x8d)]===_0x311ffe(0x9f)?_0x148255[_0x311ffe(0x8d)][_0x311ffe(0xa6)]():undefined,'cssUrl':typeof _0x148255[_0x311ffe(0xbd)]===_0x311ffe(0x9f)?_0x148255[_0x311ffe(0xbd)][_0x311ffe(0xa6)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x52a482,_0x120548){const _0x5e583e=a151_0x4647,_0x2516b1=_0x52a482();while(!![]){try{const _0x166cf0=parseInt(_0x5e583e(0xbb))/0x1*(parseInt(_0x5e583e(0xbc))/0x2)+-parseInt(_0x5e583e(0xba))/0x3+parseInt(_0x5e583e(0xb8))/0x4+parseInt(_0x5e583e(0xb6))/0x5+parseInt(_0x5e583e(0xb9))/0x6+-parseInt(_0x5e583e(0xbf))/0x7+-parseInt(_0x5e583e(0xbd))/0x8*(parseInt(_0x5e583e(0xbe))/0x9);if(_0x166cf0===_0x120548)break;else _0x2516b1['push'](_0x2516b1['shift']());}catch(_0x5c2087){_0x2516b1['push'](_0x2516b1['shift']());}}}(a151_0x3da3,0x946c8));export function isValidJsHttpsUrl(_0x29d986){const _0x1b563c=a151_0x4647;return/^https:\/\/.+\.js(\?.*)?$/[_0x1b563c(0xc0)](_0x29d986[_0x1b563c(0xb7)]());}export function isValidCssHttpsUrl(_0x4e3dca){const _0x52e9f3=a151_0x4647;return/^https:\/\/.+\.css(\?.*)?$/[_0x52e9f3(0xc0)](_0x4e3dca[_0x52e9f3(0xb7)]());}function a151_0x3da3(){const _0x3b287e=['trim','4232892JyEksR','892242JahlKj','3605466LApZZj','2YSbdbR','872244jjknXC','433624zNJBgG','90zaQipG','1493506ESMbSB','test','2429900dJZiBh'];a151_0x3da3=function(){return _0x3b287e;};return a151_0x3da3();}function a151_0x4647(_0x4c120c,_0x339894){_0x4c120c=_0x4c120c-0xb6;const _0x3da38a=a151_0x3da3();let _0x464780=_0x3da38a[_0x4c120c];return _0x464780;}export async function isUrlReachable(_0x45416a){try{const _0x4ab60c=await fetch(_0x45416a,{'method':'HEAD'});return _0x4ab60c['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a152_0x269e35=a152_0x588e;(function(_0x373f94,_0x3055c2){const _0x11ad3f=a152_0x588e,_0x4bbdb7=_0x373f94();while(!![]){try{const _0x2ac142=-parseInt(_0x11ad3f(0xa2))/0x1+-parseInt(_0x11ad3f(0xdd))/0x2+parseInt(_0x11ad3f(0xc6))/0x3*(-parseInt(_0x11ad3f(0xbb))/0x4)+-parseInt(_0x11ad3f(0xcf))/0x5+-parseInt(_0x11ad3f(0xa1))/0x6*(-parseInt(_0x11ad3f(0xb1))/0x7)+parseInt(_0x11ad3f(0xd7))/0x8*(-parseInt(_0x11ad3f(0xcb))/0x9)+-parseInt(_0x11ad3f(0xca))/0xa*(-parseInt(_0x11ad3f(0xc9))/0xb);if(_0x2ac142===_0x3055c2)break;else _0x4bbdb7['push'](_0x4bbdb7['shift']());}catch(_0x2648e0){_0x4bbdb7['push'](_0x4bbdb7['shift']());}}}(a152_0x1dae,0x55bfc));import a152_0x429613 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';function a152_0x588e(_0x6fc84c,_0x16802a){_0x6fc84c=_0x6fc84c-0x9d;const _0x1daea1=a152_0x1dae();let _0x588e6a=_0x1daea1[_0x6fc84c];return _0x588e6a;}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';function a152_0x1dae(){const _0x476ae1=['\x20\x20✓\x20Selected:\x20','appcode','onlineMenuList','\x20and\x20CSS:\x20','onlinePaths','488FLNGML','flag','Fetching\x20online\x20menu\x20list...','created','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','paths','708912plDWlg','\x20\x20Cancelled.','validation','cyan','cookie','\x20local\x20microfrontend\x20menu(s).','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','Would\x20create\x20','Online\x20menu\x20list\x20fetched','\x20menu(s)\x20created','\x20menu(s)\x20with\x20JS:\x20','1398894DfEZLW','27365IzPmUU','Sync\x20local\x20pages\x20as\x20platform\x20menus','params','gray','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','menu','size','POST','\x20page(s)','Failed\x20to\x20fetch\x20online\x20menu\x20list','targetPages','\x20\x20Create\x20','Menu\x20creation\x20failed','write','jsUrl','14UcULRt','boolean','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','map','length','rawFlags','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','yes','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','2248JxfpMd','Pre-fill\x20JS/CSS\x20URLs.\x20','trim','Menu\x20sync\x20completed:\x20','Menu\x20sync\x20skipped','\x20created,\x20','string','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','appCode','failed','2658KafNCO','Created\x20','\x20created.','231yIbNPU','752810dmoosq','66870qRUJyC','message','selectedAppName','/smartapi/menu/create','1814940DcnUOi','localPages','str'];a152_0x1dae=function(){return _0x476ae1;};return a152_0x1dae();}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';export const menuSync={'service':a152_0x269e35(0xa7),'command':'sync','description':a152_0x269e35(0xa3),'risk':a152_0x269e35(0xaf),'flags':[{'name':a152_0x269e35(0xa4),'type':a152_0x269e35(0xc1),'description':a152_0x269e35(0xbc)+a152_0x269e35(0xb8)},{'name':a152_0x269e35(0xdc),'type':a152_0x269e35(0xc1),'description':a152_0x269e35(0xc2)},{'name':a152_0x269e35(0xb9),'type':a152_0x269e35(0xb2),'description':a152_0x269e35(0xdb)}],async 'dryRun'(_0x1a186e){const _0x445baf=a152_0x269e35;ensureRunnableContext(_0x1a186e[_0x445baf(0xb6)],_0x1a186e[_0x445baf(0xcd)]);const _0x3e3bcf=await runMenuSyncCore(_0x1a186e['appCode'],_0x1a186e[_0x445baf(0xe1)],parsePaths(_0x1a186e[_0x445baf(0xd1)](_0x445baf(0xdc))),_0x1a186e[_0x445baf(0xd1)]('params'),{'dryRun':!![]});return{'method':_0x445baf(0xa9),'url':_0x445baf(0xce),'body':_0x3e3bcf,'description':_0x3e3bcf['skipped']?_0x445baf(0xa6):_0x445baf(0x9d)+_0x3e3bcf[_0x445baf(0xac)][_0x445baf(0xb5)]+_0x445baf(0xe2)};},async 'execute'(_0x2ac4df){const _0x67e79f=a152_0x269e35;ensureRunnableContext(_0x2ac4df[_0x67e79f(0xb6)],_0x2ac4df[_0x67e79f(0xcd)]);const _0x2eddd7=_0x2ac4df[_0x67e79f(0xd8)](_0x67e79f(0xb9)),_0x11356b=_0x2ac4df[_0x67e79f(0xd1)](_0x67e79f(0xa4)),_0x18ae88=parsePaths(_0x2ac4df['str']('paths')),_0x655188=parseMenuSyncParams(_0x11356b);if(_0x2eddd7){const _0x417f99=await runMenuSyncCore(_0x2ac4df['appCode'],_0x2ac4df['cookie'],_0x18ae88,_0x11356b);if(_0x417f99['skipped']){const _0x18523c=getLocalPages();_0x18523c['length']===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0x67e79f(0xb7));}else writeCliSideChannelLine('✓\x20Menu\x20sync\x20completed:\x20'+_0x417f99[_0x67e79f(0xda)]+_0x67e79f(0x9f));return{'ok':!![],'data':_0x417f99,'message':_0x417f99['skipped']?_0x67e79f(0xbf):_0x67e79f(0xbe)+_0x417f99[_0x67e79f(0xda)]+_0x67e79f(0xc8)};}if(_0x18ae88[_0x67e79f(0xb5)]>0x0)throw CliErrors['validation']('menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.',_0x67e79f(0xba));if(!isInteractive()&&_0x11356b)throw CliErrors[_0x67e79f(0xdf)]('Non-interactive\x20menu\x20sync\x20requires\x20--yes.',_0x67e79f(0xba));requireInteractive();const _0x5d490e=startSpinner(_0x67e79f(0xd9));let _0x4cbf91,_0x30905c,_0x319592;try{const _0x45fa93=await fetchMenuData(_0x2ac4df['appCode'],_0x2ac4df[_0x67e79f(0xe1)]);_0x4cbf91=_0x45fa93[_0x67e79f(0xd0)],_0x30905c=_0x45fa93[_0x67e79f(0xd6)],_0x319592=_0x45fa93[_0x67e79f(0xd4)],stopSpinner(_0x5d490e,_0x67e79f(0x9e),!![]);}catch(_0x1e48ca){stopSpinner(_0x5d490e,_0x67e79f(0xab),![]);throw CliErrors['validation'](_0x1e48ca instanceof Error?_0x1e48ca['message']:'Failed\x20to\x20fetch\x20online\x20menu\x20list');}if(_0x4cbf91[_0x67e79f(0xb5)]===0x0)return writeCliSideChannelLine(a152_0x429613['yellow'](_0x67e79f(0xc3))),{'ok':!![]};const _0x1c0ffd=buildCompareRows(_0x4cbf91,_0x30905c);writeCliSideChannelLine(renderCompareTable(_0x1c0ffd)),writeCliSideChannelLine('');const _0x170949=await selectPages(_0x4cbf91,_0x30905c);writeCliSideChannelLine(''),writeCliSideChannelLine(a152_0x429613[_0x67e79f(0xe0)](_0x67e79f(0xd2)+_0x170949[_0x67e79f(0xb5)]+_0x67e79f(0xaa)));const _0x204779=_0x655188[_0x67e79f(0xb0)]&&_0x655188['cssUrl'];if(!_0x204779){writeCliSideChannelLine(renderSyncSummary(_0x170949,_0x30905c[_0x67e79f(0xa8)]>0x0));const _0x2754c8=await askConfirm('\x20\x20Continue\x20with\x20creation?');if(!_0x2754c8)return writeCliSideChannelLine(a152_0x429613[_0x67e79f(0xa5)](_0x67e79f(0xde))),{'ok':!![]};}let _0x2336e9=_0x655188['jsUrl'],_0x210de2=_0x655188['cssUrl'];!_0x2336e9&&(_0x2336e9=await askJsUrl());!_0x210de2&&(_0x210de2=await askCssUrl());const _0x27134b=await askConfirm(_0x67e79f(0xad)+_0x170949[_0x67e79f(0xb5)]+_0x67e79f(0xa0)+_0x2336e9+_0x67e79f(0xd5)+_0x210de2+'?');if(!_0x27134b)return writeCliSideChannelLine(a152_0x429613[_0x67e79f(0xa5)]('\x20\x20Cancelled.')),{'ok':!![]};const _0x5b4c61=[_0x2336e9,_0x210de2],_0x57c600=startSpinner('Creating\x20'+_0x170949['length']+'\x20menu(s)...');try{const _0x3fe251=await doCreateMenus(_0x2ac4df[_0x67e79f(0xc4)],_0x2ac4df[_0x67e79f(0xe1)],_0x170949,_0x5b4c61);return stopSpinner(_0x57c600,_0x67e79f(0xc7)+_0x3fe251[_0x67e79f(0xda)]+'\x20menu(s)',!![]),{'ok':!![],'data':_0x3fe251,'message':_0x67e79f(0xbe)+_0x3fe251[_0x67e79f(0xda)]+_0x67e79f(0xc0)+_0x3fe251[_0x67e79f(0xc5)]+'\x20failed.'};}catch(_0xd81171){stopSpinner(_0x57c600,_0x67e79f(0xae),![]);throw CliErrors['validation'](_0xd81171 instanceof Error?_0xd81171[_0x67e79f(0xcc)]:'Menu\x20creation\x20failed');}}};function ensureRunnableContext(_0x42de21,_0x192587){const _0x296871=a152_0x269e35,_0x5c5018=_0x42de21['appcode']?String(_0x42de21[_0x296871(0xd3)])['trim']():'';if(!isInProject()&&!_0x192587&&!_0x5c5018)throw CliErrors[_0x296871(0xdf)](_0x296871(0xb3)+_0x296871(0xe3));}function parsePaths(_0x41eacf){const _0x29317f=a152_0x269e35;return[...new Set(_0x41eacf['split'](',')[_0x29317f(0xb4)](_0x22a0d9=>_0x22a0d9[_0x29317f(0xbd)]())['filter'](Boolean))];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a153_0x5b19ef=a153_0x1fde;(function(_0x2bd5d1,_0x57d71b){const _0x40a7e9=a153_0x1fde,_0x2261c4=_0x2bd5d1();while(!![]){try{const _0x155355=parseInt(_0x40a7e9(0xa6))/0x1*(parseInt(_0x40a7e9(0xa9))/0x2)+-parseInt(_0x40a7e9(0xbc))/0x3*(parseInt(_0x40a7e9(0x77))/0x4)+-parseInt(_0x40a7e9(0xd0))/0x5*(parseInt(_0x40a7e9(0xaf))/0x6)+parseInt(_0x40a7e9(0x94))/0x7*(-parseInt(_0x40a7e9(0x7f))/0x8)+parseInt(_0x40a7e9(0xd1))/0x9+-parseInt(_0x40a7e9(0xe8))/0xa*(-parseInt(_0x40a7e9(0xe1))/0xb)+-parseInt(_0x40a7e9(0xdd))/0xc*(-parseInt(_0x40a7e9(0xed))/0xd);if(_0x155355===_0x57d71b)break;else _0x2261c4['push'](_0x2261c4['shift']());}catch(_0x6b56e0){_0x2261c4['push'](_0x2261c4['shift']());}}}(a153_0x4b63,0xeae0f));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../commands/menu/shared/facts.js';import{asVerificationError,assertVerified,describeMenuErrorCause,fetchMutationSnapshot,hasFlag,isMenuResponseLoss,mapMenuApiError,menuDryRunResult,menuError,menuFailure,mutationResult,recheckMutationSnapshot,requireExplicitYes}from'../../commands/menu/shared/mutations.js';import{updateMenuEntity}from'../../commands/menu/shared/service.js';import{CliErrors}from'../../errors.js';const BACKEND=[{'method':'POST','path':a153_0x5b19ef(0x96)}];function a153_0x4b63(){const _0x3961ac=['16291869EnqEvI','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20','byId','false','label','message','stringify','10PpaWWm','menu_selector_not_found','push','Menu\x20id\x20selector(s)\x20not\x20found:\x20','Response\x20was\x20lost\x20and\x20menu\x20','121615CYSYgZ','Menu\x20','has','\x20menu(s);\x20skip\x20','expectedCount','isArray','modelType','expectVisible','8XWYaLT','requestedVisible','menu\x20list','map','\x20visibility\x20update\x20could\x20not\x20be\x20verified','before','paths','str','2910280AGlEqm','url','Would\x20update\x20visibility\x20for\x20','expected-count','datasetId','filter','high-risk-write','verify\x20menu\x20visibility\x20update','update\x20menu\x20visibility','resourcesValid','beforeById','failed','targets','appCode','update','some','depth','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','num','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','\x20unchanged\x20menu(s).','21gNtNqK','\x20menu(s);\x20skipped\x20','/smartapi/menu/update','Selected\x20','\x20failed.','update-recovery','pageType','Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.','menuIds','plan','Menu\x20visibility\x20update\x20completed:\x20','join','verification','Updated\x20visibility\x20for\x20','parentId','isSafeInteger','sort','datasetCode','2MbadxJ','values','menu_permission_denied','628856GJOLGB','childrenCount','rabetbase\x20menu\x20list\x20--format\x20compress','update-menu-visibility','Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.','56508spVZNA','\x20visibility\x20could\x20not\x20be\x20verified\x20safely','\x20changed\x20unexpectedly.','type','number','string','flagMissing','Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','code','Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility','cookie','pageId','visibility-update','1246521TWhenE','Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20','trim','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.','One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','menu_state_drift','menu-ids','plannedActions','split','recovered','path','visible','hash','\x20must\x20be\x20true\x20or\x20false.','true','updated','menu_expected_count_mismatch','\x20skipped,\x20','\x20menu(s),\x20expected\x20','menu','105hIYYmp','2856825QxYHaG','Menu\x20path\x20selector\x20not\x20found:\x20','\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.','Final\x20menu\x20visibility\x20readback\x20failed.','get','warnings','length','menu_verification_failed','body','Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20','resources','POST','840JgsQcY','validation','expect-visible','childrenIds'];a153_0x4b63=function(){return _0x3961ac;};return a153_0x4b63();}export const menuVisibilityUpdate={'service':a153_0x5b19ef(0xcf),'command':'visibility-update','description':a153_0x5b19ef(0xad),'risk':a153_0x5b19ef(0x85),'structuredErrors':!![],'flags':[{'name':'menu-ids','type':a153_0x5b19ef(0xb4),'description':a153_0x5b19ef(0x92)},{'name':'paths','type':a153_0x5b19ef(0xb4),'description':'Exact\x20comma-separated\x20menu\x20paths\x20to\x20update'},{'name':a153_0x5b19ef(0xc7),'type':'boolean','required':!![],'description':'Requested\x20menu\x20visibility'},{'name':a153_0x5b19ef(0xdf),'type':'boolean','description':a153_0x5b19ef(0xb8)},{'name':'expected-count','type':a153_0x5b19ef(0xb3),'description':'Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x57107e){parseInput(_0x57107e),requireExplicitYes(_0x57107e);},async 'dryRun'(_0x35b127){const _0x58c586=a153_0x5b19ef,_0xc0fc06=await buildPlan(_0x35b127,!![]),_0x465dc9=_0xc0fc06['plan'][_0x58c586(0xc3)]?.[_0x58c586(0xd7)]??0x0,_0x219c35=_0xc0fc06['plan'][_0x58c586(0x8b)][_0x58c586(0xd7)]-_0x465dc9;return menuDryRunResult(_0xc0fc06[_0x58c586(0x9d)],{'method':_0x58c586(0xdc),'url':_0x58c586(0x96),'body':{'updates':_0xc0fc06[_0x58c586(0x9d)][_0x58c586(0xc3)]?.[_0x58c586(0x7a)](_0x383200=>_0x383200[_0x58c586(0xd9)])??[]},'description':_0x58c586(0x81)+_0x465dc9+_0x58c586(0xf0)+_0x219c35+_0x58c586(0x93)});},async 'execute'(_0xb257d){const _0x8292a6=a153_0x5b19ef;requireExplicitYes(_0xb257d);const _0x3fc988=await buildPlan(_0xb257d,![]);await recheckMutationSnapshot(_0xb257d,_0x3fc988[_0x8292a6(0x9d)],_0x8292a6(0x87));const _0x314dbc=[],_0x367019=[],_0x3fe645=[];for(const _0x3e2cc9 of _0x3fc988[_0x8292a6(0x9d)][_0x8292a6(0x8b)]){if(_0x3e2cc9['before']['visible']===_0x3fc988['plan']['requestedVisible']){_0x314dbc[_0x8292a6(0xea)]({'id':_0x3e2cc9['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0xb257d['appCode'],_0xb257d[_0x8292a6(0xb9)],{'id':_0x3e2cc9['id'],'visible':_0x3fc988[_0x8292a6(0x9d)][_0x8292a6(0x78)]}),_0x314dbc[_0x8292a6(0xea)]({'id':_0x3e2cc9['id'],'updated':!![],'skipped':![]});}catch(_0x35d2fd){const _0x2b4eed=mapMenuApiError(_0x35d2fd,'update\x20visibility\x20for',_0x3e2cc9['id']);if(isMenuResponseLoss(_0x35d2fd)&&_0x2b4eed[_0x8292a6(0xb7)]!==_0x8292a6(0xa8)){_0x3fe645[_0x8292a6(0xea)](_0x3e2cc9['id']);continue;}_0x367019[_0x8292a6(0xea)]({'id':_0x3e2cc9['id'],'stage':_0x8292a6(0x8d),'code':_0x2b4eed[_0x8292a6(0xb7)],'message':_0x2b4eed[_0x8292a6(0xe6)]});}}let _0x1adaf5;try{_0x1adaf5=await fetchMenuSnapshot(_0xb257d[_0x8292a6(0x8c)],_0xb257d[_0x8292a6(0xb9)]);}catch(_0x332f34){const _0x22690d=describeMenuErrorCause(_0x332f34,_0x8292a6(0x86)),_0x5de0d5=_0x3fe645[_0x8292a6(0x7a)](_0x29dda5=>({'id':_0x29dda5,'stage':_0x8292a6(0x99),'code':_0x8292a6(0xd8),'message':'Response\x20was\x20lost\x20for\x20menu\x20'+_0x29dda5+'\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','requestedStateConfirmed':![],'recovered':![]})),_0x40f090={'stage':'verification','code':'menu_verification_failed','message':_0x8292a6(0xd4),'targetIds':_0x3fc988[_0x8292a6(0x9d)][_0x8292a6(0x8b)][_0x8292a6(0x7a)](_0x31d8bc=>_0x31d8bc['id']),'requestedStateConfirmed':![],..._0x22690d};throw menuFailure(asVerificationError(_0x332f34,'Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state'),_0x3fc988[_0x8292a6(0x9d)],{'stage':_0x8292a6(0xa0),'succeeded':_0x314dbc,'failedRecords':[..._0x367019,..._0x5de0d5,_0x40f090],'warnings':['The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.'],'verification':{'status':_0x8292a6(0x8a),'recoveredCount':0x0,'lookupCommand':'rabetbase\x20menu\x20list\x20--format\x20compress'}});}const _0x3c17ab=[];for(const _0x5498aa of _0x314dbc){const _0x4a04fc=Number(_0x5498aa['id']),_0x2cdad3=_0x3fc988[_0x8292a6(0x89)][_0x8292a6(0xd5)](_0x4a04fc),_0x38e35d=_0x1adaf5['byId'][_0x8292a6(0xd5)](_0x4a04fc);try{verifyVisibilityUpdate(_0x2cdad3,_0x38e35d,_0x3fc988[_0x8292a6(0x9d)]['requestedVisible']);}catch(_0x22ab38){const _0x4e673d=asVerificationError(_0x22ab38,'Menu\x20'+_0x4a04fc+_0x8292a6(0x7b));_0x3c17ab[_0x8292a6(0xea)]({'id':_0x4a04fc,'stage':_0x8292a6(0xa0),'code':_0x4e673d['code'],'message':_0x4e673d[_0x8292a6(0xe6)],'requestedStateConfirmed':![]});}}for(const _0x13932c of _0x3fe645){const _0x2a9891=_0x3fc988[_0x8292a6(0x89)][_0x8292a6(0xd5)](_0x13932c),_0x267163=_0x1adaf5[_0x8292a6(0xe3)][_0x8292a6(0xd5)](_0x13932c);try{verifyVisibilityUpdate(_0x2a9891,_0x267163,_0x3fc988[_0x8292a6(0x9d)][_0x8292a6(0x78)]),_0x314dbc['push']({'id':_0x13932c,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0x37989d){const _0x23bca6=asVerificationError(_0x37989d,_0x8292a6(0xec)+_0x13932c+_0x8292a6(0xb0));_0x3c17ab[_0x8292a6(0xea)]({'id':_0x13932c,'stage':_0x8292a6(0x99),'code':_0x23bca6['code'],'message':_0x23bca6[_0x8292a6(0xe6)],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x3c17ab[_0x8292a6(0xd7)]>0x0){const _0x566717=_0x3c17ab[_0x8292a6(0x7a)](_0x2a2280=>Number(_0x2a2280['id'])),_0x4b93c3=_0x314dbc[_0x8292a6(0x84)](_0x507ed6=>_0x507ed6[_0x8292a6(0xc5)]===!![])['length'],_0xc4d94d=menuError(_0x8292a6(0xd8),_0x8292a6(0xda)+_0x566717[_0x8292a6(0x9f)](',\x20')+'.',_0x8292a6(0xae));throw menuFailure(_0xc4d94d,_0x3fc988['plan'],{'stage':_0x8292a6(0xa0),'succeeded':_0x314dbc,'failedRecords':[..._0x367019,..._0x3c17ab],'warnings':[_0x8292a6(0xc0)],'verification':{'status':_0x8292a6(0x8a),..._0x566717[_0x8292a6(0xd7)]===0x1?{'targetId':_0x566717[0x0]}:{'targetIds':_0x566717},'recoveredCount':_0x4b93c3,'lookupCommand':_0x8292a6(0xab)}});}const _0x1b788f=_0x314dbc[_0x8292a6(0x84)](_0x285e1d=>_0x285e1d[_0x8292a6(0xcb)]===!![])['length'],_0x15734c=_0x314dbc[_0x8292a6(0xd7)]-_0x1b788f,_0x42f514={..._0x3fc988[_0x8292a6(0x9d)],'succeeded':_0x314dbc,'failed':_0x367019,'warnings':_0x367019['length']>0x0?[..._0x3fc988['plan'][_0x8292a6(0xd6)],_0x8292a6(0xb6)]:_0x3fc988[_0x8292a6(0x9d)][_0x8292a6(0xd6)],'verification':{'checkedBy':_0x8292a6(0x79),'snapshotHash':_0x1adaf5['hash'],'matchesRequestedState':_0x367019[_0x8292a6(0xd7)]===0x0,'recoveredCount':_0x3fe645[_0x8292a6(0xd7)]}};return{'ok':_0x367019[_0x8292a6(0xd7)]===0x0,'data':_0x42f514,'message':_0x367019[_0x8292a6(0xd7)]===0x0?_0x8292a6(0xa1)+_0x1b788f+_0x8292a6(0x95)+_0x15734c+_0x8292a6(0x93):_0x8292a6(0x9e)+_0x1b788f+'\x20updated,\x20'+_0x15734c+_0x8292a6(0xcd)+_0x367019[_0x8292a6(0xd7)]+_0x8292a6(0x98)};}};function parseInput(_0x38cdc0){const _0x429576=a153_0x5b19ef,_0xecbc47=parseMenuIds(_0x38cdc0['str'](_0x429576(0xc2))),_0x31928c=parseCsv(_0x38cdc0[_0x429576(0x7e)](_0x429576(0x7d)));if(_0xecbc47[_0x429576(0xd7)]===0x0&&_0x31928c[_0x429576(0xd7)]===0x0)throw CliErrors[_0x429576(0xde)]('menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.');const _0x4fb74f=parseBooleanFlag(_0x38cdc0,'visible',!![]),_0x1672b1=parseBooleanFlag(_0x38cdc0,_0x429576(0xdf),![]);let _0x56b4f6;if(hasFlag(_0x38cdc0,_0x429576(0x82))){_0x56b4f6=_0x38cdc0[_0x429576(0x91)](_0x429576(0x82));if(!Number['isSafeInteger'](_0x56b4f6)||_0x56b4f6<0x0)throw CliErrors[_0x429576(0xde)]('--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.');}return{'menuIds':_0xecbc47,'paths':_0x31928c,'visible':_0x4fb74f,'expectVisible':_0x1672b1,'expectedCount':_0x56b4f6};}async function buildPlan(_0x118795,_0x25aedb){const _0x102332=a153_0x5b19ef,_0x8e8bc8=parseInput(_0x118795),_0x373230=await fetchMutationSnapshot(_0x118795,_0x102332(0x87)),_0x421e8f=selectTargets(_0x373230['menus'],_0x8e8bc8[_0x102332(0x9c)],_0x8e8bc8[_0x102332(0x7d)]);if(_0x8e8bc8[_0x102332(0xf1)]!==undefined&&_0x421e8f[_0x102332(0xd7)]!==_0x8e8bc8['expectedCount'])throw menuError(_0x102332(0xcc),_0x102332(0x97)+_0x421e8f[_0x102332(0xd7)]+_0x102332(0xce)+_0x8e8bc8[_0x102332(0xf1)]+'.','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.');if(_0x8e8bc8[_0x102332(0xf4)]!==undefined){const _0x4bf31f=_0x421e8f[_0x102332(0x84)](_0x35ab7b=>_0x35ab7b[_0x102332(0xc7)]!==_0x8e8bc8['expectVisible']);if(_0x4bf31f['length']>0x0)throw menuError(_0x102332(0xc1),'Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20'+_0x4bf31f[_0x102332(0x7a)](_0x46e77e=>_0x46e77e['id'])[_0x102332(0x9f)](',\x20')+'.',_0x102332(0xbf));}const _0x1992b2=_0x421e8f[_0x102332(0x7a)](_0x53da96=>({'id':_0x53da96['id'],'label':_0x53da96['label'],'path':_0x53da96[_0x102332(0xc6)],'before':{'visible':_0x53da96[_0x102332(0xc7)]},'after':{'visible':_0x8e8bc8[_0x102332(0xc7)]}})),_0x14144a=_0x1992b2[_0x102332(0x84)](_0x4e0737=>_0x4e0737[_0x102332(0x7c)][_0x102332(0xc7)]!==_0x8e8bc8[_0x102332(0xc7)])[_0x102332(0x7a)](_0x59fe06=>({'stage':_0x102332(0xac),'method':'POST','path':'/smartapi/menu/update','body':{'appCode':_0x118795[_0x102332(0x8c)],'id':_0x59fe06['id'],'visible':_0x8e8bc8[_0x102332(0xc7)]}})),_0x2acf93=mutationResult({'operation':_0x102332(0xbb),'selector':{'menuIds':_0x8e8bc8[_0x102332(0x9c)],'paths':_0x8e8bc8[_0x102332(0x7d)]},'before':{'menus':_0x421e8f[_0x102332(0x7a)](_0x45baf8=>({'id':_0x45baf8['id'],'path':_0x45baf8[_0x102332(0xc6)],'visible':_0x45baf8[_0x102332(0xc7)]}))},'after':{'menus':_0x421e8f[_0x102332(0x7a)](_0x2606f2=>({'id':_0x2606f2['id'],'path':_0x2606f2['path'],'visible':_0x8e8bc8[_0x102332(0xc7)]}))},'dryRun':_0x25aedb,'backend':[...BACKEND],'plannedActions':_0x14144a,'snapshotHash':_0x373230[_0x102332(0xc8)],'warnings':_0x14144a['length']===0x0?[_0x102332(0x9b)]:[]});return{'plan':{..._0x2acf93,'requestedVisible':_0x8e8bc8[_0x102332(0xc7)],'targets':_0x1992b2},'beforeById':new Map(_0x421e8f['map'](_0x5486ea=>[_0x5486ea['id'],_0x5486ea]))};}function a153_0x1fde(_0x32ec06,_0x5e4cc7){_0x32ec06=_0x32ec06-0x77;const _0x4b638f=a153_0x4b63();let _0x1fdeef=_0x4b638f[_0x32ec06];return _0x1fdeef;}function selectTargets(_0x3c0b42,_0xcf8b27,_0x2ff4e2){const _0x3db6d4=a153_0x5b19ef,_0x310581=new Map(_0x3c0b42[_0x3db6d4(0x7a)](_0x53c9ab=>[_0x53c9ab['id'],_0x53c9ab])),_0x5d7c4b=new Map(),_0x1b389d=_0xcf8b27[_0x3db6d4(0x84)](_0x547745=>!_0x310581[_0x3db6d4(0xef)](_0x547745));if(_0x1b389d[_0x3db6d4(0xd7)]>0x0)throw menuError(_0x3db6d4(0xe9),_0x3db6d4(0xeb)+_0x1b389d['join'](',\x20')+'.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.');for(const _0x489d34 of _0xcf8b27){_0x5d7c4b['set'](_0x489d34,_0x310581[_0x3db6d4(0xd5)](_0x489d34));}for(const _0x49db93 of _0x2ff4e2){const _0x579043=_0x3c0b42[_0x3db6d4(0x84)](_0x1b6a55=>_0x1b6a55['path']===_0x49db93);if(_0x579043[_0x3db6d4(0xd7)]===0x0)throw menuError('menu_selector_not_found',_0x3db6d4(0xd2)+JSON[_0x3db6d4(0xe7)](_0x49db93)+'.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.');if(_0x579043[_0x3db6d4(0xd7)]>0x1)throw menuError('menu_selector_ambiguous',_0x3db6d4(0xbd)+JSON[_0x3db6d4(0xe7)](_0x49db93)+'.',_0x3db6d4(0xe2)+_0x579043[_0x3db6d4(0x7a)](_0x466e3d=>_0x466e3d['id'])[_0x3db6d4(0x9f)](',\x20')+'.');const _0x1ceb5d=_0x579043[0x0];_0x5d7c4b['set'](_0x1ceb5d['id'],_0x1ceb5d);}return[..._0x5d7c4b[_0x3db6d4(0xa7)]()];}function parseMenuIds(_0x4fe44d){const _0xf19bfc=a153_0x5b19ef,_0x2e40ee=parseCsv(_0x4fe44d),_0x258cf6=_0x2e40ee[_0xf19bfc(0x7a)](Number);if(_0x258cf6[_0xf19bfc(0x8e)](_0x590f11=>!Number[_0xf19bfc(0xa3)](_0x590f11)||_0x590f11<=0x0))throw CliErrors['validation'](_0xf19bfc(0x90));return[...new Set(_0x258cf6)];}function parseCsv(_0x8485d9){const _0x48b635=a153_0x5b19ef;return[...new Set(_0x8485d9[_0x48b635(0xc4)](',')[_0x48b635(0x7a)](_0x4b2c09=>_0x4b2c09[_0x48b635(0xbe)]())[_0x48b635(0x84)](Boolean))];}function parseBooleanFlag(_0x264273,_0x48c6e4,_0x3d579a){const _0x136c43=a153_0x5b19ef;if(!hasFlag(_0x264273,_0x48c6e4)){if(_0x3d579a)throw CliErrors[_0x136c43(0xb5)](_0x48c6e4);return undefined;}const _0x1556c4=_0x264273['rawFlags'][_0x48c6e4];if(_0x1556c4===!![]||_0x1556c4===![])return _0x1556c4;if(_0x1556c4===_0x136c43(0xca))return!![];if(_0x1556c4===_0x136c43(0xe4))return![];throw CliErrors['validation']('--'+_0x48c6e4+_0x136c43(0xc9));}function verifyVisibilityUpdate(_0x22da82,_0x1b76eb,_0x10a042){const _0x289628=a153_0x5b19ef;assertVerified(!!_0x1b76eb,_0x289628(0xee)+_0x22da82['id']+'\x20was\x20not\x20found\x20during\x20visibility\x20verification.'),assertVerified(_0x1b76eb[_0x289628(0xc7)]===_0x10a042,_0x289628(0xee)+_0x22da82['id']+_0x289628(0xd3));const _0x5a0cf8=[['id',_0x1b76eb['id'],_0x22da82['id']],[_0x289628(0xa2),_0x1b76eb[_0x289628(0xa2)],_0x22da82[_0x289628(0xa2)]],[_0x289628(0x8f),_0x1b76eb[_0x289628(0x8f)],_0x22da82[_0x289628(0x8f)]],[_0x289628(0xe5),_0x1b76eb[_0x289628(0xe5)],_0x22da82[_0x289628(0xe5)]],[_0x289628(0xc6),_0x1b76eb[_0x289628(0xc6)],_0x22da82[_0x289628(0xc6)]],[_0x289628(0x80),_0x1b76eb['url'],_0x22da82[_0x289628(0x80)]],[_0x289628(0xb2),_0x1b76eb[_0x289628(0xb2)],_0x22da82['type']],[_0x289628(0xa4),_0x1b76eb[_0x289628(0xa4)],_0x22da82[_0x289628(0xa4)]],[_0x289628(0xdb),_0x1b76eb[_0x289628(0xdb)],_0x22da82[_0x289628(0xdb)]],[_0x289628(0x88),_0x1b76eb[_0x289628(0x88)],_0x22da82['resourcesValid']],[_0x289628(0xe0),_0x1b76eb['childrenIds'],_0x22da82[_0x289628(0xe0)]],['childrenCount',_0x1b76eb['childrenCount'],_0x22da82[_0x289628(0xaa)]],[_0x289628(0xba),_0x1b76eb['pageId'],_0x22da82[_0x289628(0xba)]],[_0x289628(0x9a),_0x1b76eb[_0x289628(0x9a)],_0x22da82[_0x289628(0x9a)]],[_0x289628(0xf3),_0x1b76eb['modelType'],_0x22da82[_0x289628(0xf3)]],[_0x289628(0x83),_0x1b76eb['datasetId'],_0x22da82[_0x289628(0x83)]],[_0x289628(0xa5),_0x1b76eb['datasetCode'],_0x22da82[_0x289628(0xa5)]]];for(const [_0xe642d8,_0x5ea26b,_0x3836c1]of _0x5a0cf8){assertVerified(sameValue(_0x5ea26b,_0x3836c1),_0x289628(0xee)+_0x22da82['id']+'\x20'+_0xe642d8+_0x289628(0xb1));}}function sameValue(_0x4cbb92,_0x1cab14){const _0x36548f=a153_0x5b19ef;if(Array[_0x36548f(0xf2)](_0x4cbb92)||Array[_0x36548f(0xf2)](_0x1cab14))return JSON[_0x36548f(0xe7)](_0x4cbb92)===JSON[_0x36548f(0xe7)](_0x1cab14);return _0x4cbb92===_0x1cab14;}
|
|
1
|
+
const a153_0x4f42a4=a153_0x467a;(function(_0x1c29dd,_0x373aad){const _0xccd606=a153_0x467a,_0x1afbfa=_0x1c29dd();while(!![]){try{const _0xbd4d5b=-parseInt(_0xccd606(0x21d))/0x1*(parseInt(_0xccd606(0x1fd))/0x2)+-parseInt(_0xccd606(0x1f2))/0x3*(-parseInt(_0xccd606(0x205))/0x4)+-parseInt(_0xccd606(0x1c2))/0x5*(parseInt(_0xccd606(0x208))/0x6)+parseInt(_0xccd606(0x22a))/0x7+-parseInt(_0xccd606(0x218))/0x8*(parseInt(_0xccd606(0x1cb))/0x9)+-parseInt(_0xccd606(0x1e8))/0xa*(parseInt(_0xccd606(0x200))/0xb)+parseInt(_0xccd606(0x1e2))/0xc;if(_0xbd4d5b===_0x373aad)break;else _0x1afbfa['push'](_0x1afbfa['shift']());}catch(_0x492359){_0x1afbfa['push'](_0x1afbfa['shift']());}}}(a153_0x464e,0xf12ec));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{fetchMenuSnapshot}from'../../commands/menu/shared/facts.js';import{asVerificationError,assertVerified,describeMenuErrorCause,fetchMutationSnapshot,hasFlag,isMenuResponseLoss,mapMenuApiError,menuDryRunResult,menuError,menuFailure,mutationResult,recheckMutationSnapshot,requireExplicitYes}from'../../commands/menu/shared/mutations.js';import{updateMenuEntity}from'../../commands/menu/shared/service.js';import{CliErrors}from'../../errors.js';const BACKEND=[{'method':a153_0x4f42a4(0x23d),'path':a153_0x4f42a4(0x203)}];function a153_0x464e(){const _0x1aaa2f=['before','One\x20or\x20more\x20updates\x20may\x20have\x20changed\x20fields\x20outside\x20visibility;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','expectedCount','menu_permission_denied','recovered','\x20visibility\x20could\x20not\x20be\x20verified\x20safely','datasetId','body','string','split','POST','verify\x20menu\x20visibility\x20update','true','get','\x20menu(s),\x20expected\x20','childrenCount','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expected-count.','2870DSHhJj','update','values','Exact\x20comma-separated\x20menu\x20IDs\x20to\x20update','appCode','--expected-count\x20must\x20be\x20a\x20non-negative\x20integer.','number','\x20failed.','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20an\x20exact\x20current\x20path.','143307vZuwqR','cookie','\x20unchanged\x20menu(s).','childrenIds','\x20was\x20not\x20found\x20during\x20visibility\x20verification.','plan','menu\x20list','rabetbase\x20menu\x20list\x20--format\x20compress','Menu\x20','visibility-update','label','hash','menu','boolean','\x20menu(s);\x20skip\x20','Use\x20--menu-ids\x20with\x20one\x20or\x20more\x20of:\x20','Failed\x20update\x20requests\x20were\x20not\x20retried;\x20inspect\x20current\x20menu\x20facts\x20before\x20retrying.','sort','menu_expected_count_mismatch','\x20updated,\x20','\x20and\x20final\x20state\x20could\x20not\x20be\x20read.','type','push','29613228hxTbEg','Run\x20`rabetbase\x20menu\x20list\x20--format\x20compress`\x20and\x20use\x20exact\x20current\x20ids.','updated','verification','visible','\x20must\x20be\x20true\x20or\x20false.','50PLjCrZ','update\x20menu\x20visibility','filter','\x20visibility\x20update\x20could\x20not\x20be\x20verified','Run\x20the\x20command\x20with\x20--dry-run\x20again\x20and\x20update\x20--expect-visible.','menus','set','validation','\x20menu(s);\x20skipped\x20','Would\x20update\x20visibility\x20for\x20','1392rFdoCf','modelType','length','expect-visible','isSafeInteger','paths','menu_selector_not_found','menu_verification_failed','update-recovery','stringify','pageId','10QbxsrU','Response\x20was\x20lost\x20for\x20menu\x20','menu_selector_ambiguous','2870087rCGBfu','expectVisible','resources','/smartapi/menu/update','targets','12308MXlCTk','Set\x20exact\x20menus\x20visible\x20or\x20hidden\x20without\x20changing\x20their\x20routes\x20or\x20resources','join','14676ayYQSm','update\x20visibility\x20for','path','Menu\x20path\x20selector\x20not\x20found:\x20','resourcesValid','Every\x20selected\x20menu\x20already\x20has\x20the\x20requested\x20visibility;\x20no\x20write\x20is\x20needed.','str','menu\x20visibility-update\x20requires\x20--menu-ids\x20or\x20--paths.','datasetCode','Selected\x20','Visibility\x20update\x20requests\x20completed\x20but\x20readback\x20could\x20not\x20confirm\x20the\x20requested\x20state','url','failed','warnings','plannedActions','rawFlags','528vOAlEt','message','flagMissing','--menu-ids\x20must\x20contain\x20positive\x20safe\x20integers.','beforeById','204871vAckSY','code','Exact\x20comma-separated\x20menu\x20paths\x20to\x20update','num','requestedVisible','Abort\x20unless\x20the\x20exact\x20number\x20of\x20selected\x20menus\x20matches','Abort\x20unless\x20every\x20selected\x20menu\x20has\x20this\x20visibility','\x20visible\x20did\x20not\x20match\x20the\x20requested\x20state.','update-menu-visibility','expected-count','menu_state_drift','menuIds','trim','13133743Xmhfpq','pageType','depth','byId','Requested\x20menu\x20visibility','parentId','isArray','menu-ids','map'];a153_0x464e=function(){return _0x1aaa2f;};return a153_0x464e();}export const menuVisibilityUpdate={'service':a153_0x4f42a4(0x1d7),'command':a153_0x4f42a4(0x1d4),'description':a153_0x4f42a4(0x206),'risk':'high-risk-write','structuredErrors':!![],'flags':[{'name':a153_0x4f42a4(0x231),'type':a153_0x4f42a4(0x23b),'description':a153_0x4f42a4(0x1c5)},{'name':a153_0x4f42a4(0x1f7),'type':a153_0x4f42a4(0x23b),'description':a153_0x4f42a4(0x21f)},{'name':'visible','type':'boolean','required':!![],'description':a153_0x4f42a4(0x22e)},{'name':'expect-visible','type':a153_0x4f42a4(0x1d8),'description':a153_0x4f42a4(0x223)},{'name':a153_0x4f42a4(0x226),'type':a153_0x4f42a4(0x1c8),'description':a153_0x4f42a4(0x222)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3cc4cd){parseInput(_0x3cc4cd),requireExplicitYes(_0x3cc4cd);},async 'dryRun'(_0x2a3910){const _0x448173=a153_0x4f42a4,_0x114dc9=await buildPlan(_0x2a3910,!![]),_0x320782=_0x114dc9[_0x448173(0x1d0)][_0x448173(0x216)]?.[_0x448173(0x1f4)]??0x0,_0x9c075a=_0x114dc9[_0x448173(0x1d0)][_0x448173(0x204)][_0x448173(0x1f4)]-_0x320782;return menuDryRunResult(_0x114dc9[_0x448173(0x1d0)],{'method':_0x448173(0x23d),'url':_0x448173(0x203),'body':{'updates':_0x114dc9[_0x448173(0x1d0)]['plannedActions']?.[_0x448173(0x232)](_0x32b744=>_0x32b744[_0x448173(0x23a)])??[]},'description':_0x448173(0x1f1)+_0x320782+_0x448173(0x1d9)+_0x9c075a+_0x448173(0x1cd)});},async 'execute'(_0x57ecdd){const _0x350cad=a153_0x4f42a4;requireExplicitYes(_0x57ecdd);const _0x3be9fa=await buildPlan(_0x57ecdd,![]);await recheckMutationSnapshot(_0x57ecdd,_0x3be9fa[_0x350cad(0x1d0)],_0x350cad(0x1e9));const _0x6e311a=[],_0x8a0a40=[],_0x1ab6c8=[];for(const _0x359e3b of _0x3be9fa[_0x350cad(0x1d0)]['targets']){if(_0x359e3b[_0x350cad(0x233)][_0x350cad(0x1e6)]===_0x3be9fa['plan'][_0x350cad(0x221)]){_0x6e311a[_0x350cad(0x1e1)]({'id':_0x359e3b['id'],'updated':![],'skipped':!![]});continue;}try{await updateMenuEntity(_0x57ecdd[_0x350cad(0x1c6)],_0x57ecdd[_0x350cad(0x1cc)],{'id':_0x359e3b['id'],'visible':_0x3be9fa[_0x350cad(0x1d0)][_0x350cad(0x221)]}),_0x6e311a[_0x350cad(0x1e1)]({'id':_0x359e3b['id'],'updated':!![],'skipped':![]});}catch(_0x44757d){const _0x46b9c8=mapMenuApiError(_0x44757d,_0x350cad(0x209),_0x359e3b['id']);if(isMenuResponseLoss(_0x44757d)&&_0x46b9c8[_0x350cad(0x21e)]!==_0x350cad(0x236)){_0x1ab6c8[_0x350cad(0x1e1)](_0x359e3b['id']);continue;}_0x8a0a40[_0x350cad(0x1e1)]({'id':_0x359e3b['id'],'stage':_0x350cad(0x1c3),'code':_0x46b9c8[_0x350cad(0x21e)],'message':_0x46b9c8[_0x350cad(0x219)]});}}let _0x5b722e;try{_0x5b722e=await fetchMenuSnapshot(_0x57ecdd['appCode'],_0x57ecdd[_0x350cad(0x1cc)]);}catch(_0x473e4d){const _0x38ae0a=describeMenuErrorCause(_0x473e4d,_0x350cad(0x23e)),_0x5dc8b8=_0x1ab6c8[_0x350cad(0x232)](_0x14e4a2=>({'id':_0x14e4a2,'stage':_0x350cad(0x1fa),'code':_0x350cad(0x1f9),'message':_0x350cad(0x1fe)+_0x14e4a2+_0x350cad(0x1df),'requestedStateConfirmed':![],'recovered':![]})),_0x35dddb={'stage':_0x350cad(0x1e5),'code':'menu_verification_failed','message':'Final\x20menu\x20visibility\x20readback\x20failed.','targetIds':_0x3be9fa[_0x350cad(0x1d0)][_0x350cad(0x204)]['map'](_0xb8f1b5=>_0xb8f1b5['id']),'requestedStateConfirmed':![],..._0x38ae0a};throw menuFailure(asVerificationError(_0x473e4d,_0x350cad(0x212)),_0x3be9fa['plan'],{'stage':_0x350cad(0x1e5),'succeeded':_0x6e311a,'failedRecords':[..._0x8a0a40,..._0x5dc8b8,_0x35dddb],'warnings':['The\x20update\x20may\x20have\x20taken\x20effect;\x20inspect\x20the\x20latest\x20menu\x20facts\x20before\x20retrying.'],'verification':{'status':_0x350cad(0x214),'recoveredCount':0x0,'lookupCommand':_0x350cad(0x1d2)}});}const _0x4b837e=[];for(const _0x3f50f3 of _0x6e311a){const _0x47f5ee=Number(_0x3f50f3['id']),_0x11ef59=_0x3be9fa[_0x350cad(0x21c)][_0x350cad(0x240)](_0x47f5ee),_0x400867=_0x5b722e[_0x350cad(0x22d)][_0x350cad(0x240)](_0x47f5ee);try{verifyVisibilityUpdate(_0x11ef59,_0x400867,_0x3be9fa[_0x350cad(0x1d0)][_0x350cad(0x221)]);}catch(_0x1013af){const _0x39129e=asVerificationError(_0x1013af,'Menu\x20'+_0x47f5ee+_0x350cad(0x1eb));_0x4b837e[_0x350cad(0x1e1)]({'id':_0x47f5ee,'stage':_0x350cad(0x1e5),'code':_0x39129e['code'],'message':_0x39129e[_0x350cad(0x219)],'requestedStateConfirmed':![]});}}for(const _0x2d59a8 of _0x1ab6c8){const _0x4a65e6=_0x3be9fa[_0x350cad(0x21c)]['get'](_0x2d59a8),_0x2d3bcc=_0x5b722e['byId'][_0x350cad(0x240)](_0x2d59a8);try{verifyVisibilityUpdate(_0x4a65e6,_0x2d3bcc,_0x3be9fa['plan'][_0x350cad(0x221)]),_0x6e311a[_0x350cad(0x1e1)]({'id':_0x2d59a8,'updated':!![],'skipped':![],'recovered':!![]});}catch(_0x3f0868){const _0xc4fbeb=asVerificationError(_0x3f0868,'Response\x20was\x20lost\x20and\x20menu\x20'+_0x2d59a8+_0x350cad(0x238));_0x4b837e['push']({'id':_0x2d59a8,'stage':'update-recovery','code':_0xc4fbeb[_0x350cad(0x21e)],'message':_0xc4fbeb['message'],'requestedStateConfirmed':![],'recovered':![]});}}if(_0x4b837e[_0x350cad(0x1f4)]>0x0){const _0x1f5f94=_0x4b837e[_0x350cad(0x232)](_0x224843=>Number(_0x224843['id'])),_0x56648d=_0x6e311a[_0x350cad(0x1ea)](_0x388b71=>_0x388b71[_0x350cad(0x237)]===!![])[_0x350cad(0x1f4)],_0x777638=menuError(_0x350cad(0x1f9),'Menu\x20visibility\x20update\x20could\x20not\x20be\x20verified\x20for\x20id(s):\x20'+_0x1f5f94[_0x350cad(0x207)](',\x20')+'.','Inspect\x20current\x20menu\x20facts\x20before\x20retrying\x20any\x20target.');throw menuFailure(_0x777638,_0x3be9fa[_0x350cad(0x1d0)],{'stage':_0x350cad(0x1e5),'succeeded':_0x6e311a,'failedRecords':[..._0x8a0a40,..._0x4b837e],'warnings':[_0x350cad(0x234)],'verification':{'status':_0x350cad(0x214),..._0x1f5f94[_0x350cad(0x1f4)]===0x1?{'targetId':_0x1f5f94[0x0]}:{'targetIds':_0x1f5f94},'recoveredCount':_0x56648d,'lookupCommand':'rabetbase\x20menu\x20list\x20--format\x20compress'}});}const _0x350fab=_0x6e311a[_0x350cad(0x1ea)](_0x3033a6=>_0x3033a6[_0x350cad(0x1e4)]===!![])[_0x350cad(0x1f4)],_0x1e19b4=_0x6e311a['length']-_0x350fab,_0x1b45d8={..._0x3be9fa['plan'],'succeeded':_0x6e311a,'failed':_0x8a0a40,'warnings':_0x8a0a40[_0x350cad(0x1f4)]>0x0?[..._0x3be9fa['plan'][_0x350cad(0x215)],_0x350cad(0x1db)]:_0x3be9fa['plan'][_0x350cad(0x215)],'verification':{'checkedBy':_0x350cad(0x1d1),'snapshotHash':_0x5b722e[_0x350cad(0x1d6)],'matchesRequestedState':_0x8a0a40['length']===0x0,'recoveredCount':_0x1ab6c8['length']}};return{'ok':_0x8a0a40[_0x350cad(0x1f4)]===0x0,'data':_0x1b45d8,'message':_0x8a0a40[_0x350cad(0x1f4)]===0x0?'Updated\x20visibility\x20for\x20'+_0x350fab+_0x350cad(0x1f0)+_0x1e19b4+'\x20unchanged\x20menu(s).':'Menu\x20visibility\x20update\x20completed:\x20'+_0x350fab+_0x350cad(0x1de)+_0x1e19b4+'\x20skipped,\x20'+_0x8a0a40['length']+_0x350cad(0x1c9)};}};function parseInput(_0x156964){const _0x5b28a9=a153_0x4f42a4,_0x49c622=parseMenuIds(_0x156964[_0x5b28a9(0x20e)](_0x5b28a9(0x231))),_0x49ed3d=parseCsv(_0x156964['str'](_0x5b28a9(0x1f7)));if(_0x49c622['length']===0x0&&_0x49ed3d['length']===0x0)throw CliErrors[_0x5b28a9(0x1ef)](_0x5b28a9(0x20f));const _0x5d1479=parseBooleanFlag(_0x156964,_0x5b28a9(0x1e6),!![]),_0x20d646=parseBooleanFlag(_0x156964,_0x5b28a9(0x1f5),![]);let _0x2e0b6e;if(hasFlag(_0x156964,_0x5b28a9(0x226))){_0x2e0b6e=_0x156964[_0x5b28a9(0x220)]('expected-count');if(!Number[_0x5b28a9(0x1f6)](_0x2e0b6e)||_0x2e0b6e<0x0)throw CliErrors['validation'](_0x5b28a9(0x1c7));}return{'menuIds':_0x49c622,'paths':_0x49ed3d,'visible':_0x5d1479,'expectVisible':_0x20d646,'expectedCount':_0x2e0b6e};}function a153_0x467a(_0x438e9f,_0x4d8621){_0x438e9f=_0x438e9f-0x1c2;const _0x464e7f=a153_0x464e();let _0x467acb=_0x464e7f[_0x438e9f];return _0x467acb;}async function buildPlan(_0x54b7df,_0x5f4d2e){const _0x532569=a153_0x4f42a4,_0xfa9b0a=parseInput(_0x54b7df),_0x2dbc03=await fetchMutationSnapshot(_0x54b7df,_0x532569(0x1e9)),_0xf32b5b=selectTargets(_0x2dbc03[_0x532569(0x1ed)],_0xfa9b0a[_0x532569(0x228)],_0xfa9b0a[_0x532569(0x1f7)]);if(_0xfa9b0a[_0x532569(0x235)]!==undefined&&_0xf32b5b[_0x532569(0x1f4)]!==_0xfa9b0a[_0x532569(0x235)])throw menuError(_0x532569(0x1dd),_0x532569(0x211)+_0xf32b5b[_0x532569(0x1f4)]+_0x532569(0x241)+_0xfa9b0a[_0x532569(0x235)]+'.',_0x532569(0x243));if(_0xfa9b0a[_0x532569(0x201)]!==undefined){const _0x2d2b59=_0xf32b5b['filter'](_0xd3ddb8=>_0xd3ddb8[_0x532569(0x1e6)]!==_0xfa9b0a[_0x532569(0x201)]);if(_0x2d2b59[_0x532569(0x1f4)]>0x0)throw menuError(_0x532569(0x227),'Selected\x20menu\x20visibility\x20changed\x20for\x20id(s):\x20'+_0x2d2b59['map'](_0x599820=>_0x599820['id'])[_0x532569(0x207)](',\x20')+'.',_0x532569(0x1ec));}const _0x46d666=_0xf32b5b[_0x532569(0x232)](_0x3ee676=>({'id':_0x3ee676['id'],'label':_0x3ee676[_0x532569(0x1d5)],'path':_0x3ee676[_0x532569(0x20a)],'before':{'visible':_0x3ee676[_0x532569(0x1e6)]},'after':{'visible':_0xfa9b0a[_0x532569(0x1e6)]}})),_0xcfc035=_0x46d666[_0x532569(0x1ea)](_0x1567e0=>_0x1567e0[_0x532569(0x233)][_0x532569(0x1e6)]!==_0xfa9b0a[_0x532569(0x1e6)])['map'](_0x4f4aed=>({'stage':_0x532569(0x225),'method':'POST','path':_0x532569(0x203),'body':{'appCode':_0x54b7df[_0x532569(0x1c6)],'id':_0x4f4aed['id'],'visible':_0xfa9b0a[_0x532569(0x1e6)]}})),_0x2039d1=mutationResult({'operation':_0x532569(0x1d4),'selector':{'menuIds':_0xfa9b0a[_0x532569(0x228)],'paths':_0xfa9b0a[_0x532569(0x1f7)]},'before':{'menus':_0xf32b5b['map'](_0x5c7d3b=>({'id':_0x5c7d3b['id'],'path':_0x5c7d3b[_0x532569(0x20a)],'visible':_0x5c7d3b['visible']}))},'after':{'menus':_0xf32b5b[_0x532569(0x232)](_0x44b488=>({'id':_0x44b488['id'],'path':_0x44b488[_0x532569(0x20a)],'visible':_0xfa9b0a[_0x532569(0x1e6)]}))},'dryRun':_0x5f4d2e,'backend':[...BACKEND],'plannedActions':_0xcfc035,'snapshotHash':_0x2dbc03['hash'],'warnings':_0xcfc035[_0x532569(0x1f4)]===0x0?[_0x532569(0x20d)]:[]});return{'plan':{..._0x2039d1,'requestedVisible':_0xfa9b0a[_0x532569(0x1e6)],'targets':_0x46d666},'beforeById':new Map(_0xf32b5b[_0x532569(0x232)](_0x2fed74=>[_0x2fed74['id'],_0x2fed74]))};}function selectTargets(_0x153f7f,_0x596d86,_0xddc7f3){const _0x364b3b=a153_0x4f42a4,_0x3c05e9=new Map(_0x153f7f[_0x364b3b(0x232)](_0x5d40c9=>[_0x5d40c9['id'],_0x5d40c9])),_0x2e6084=new Map(),_0x4bc7fb=_0x596d86[_0x364b3b(0x1ea)](_0x9b7016=>!_0x3c05e9['has'](_0x9b7016));if(_0x4bc7fb[_0x364b3b(0x1f4)]>0x0)throw menuError('menu_selector_not_found','Menu\x20id\x20selector(s)\x20not\x20found:\x20'+_0x4bc7fb[_0x364b3b(0x207)](',\x20')+'.',_0x364b3b(0x1e3));for(const _0x3c37a5 of _0x596d86){_0x2e6084[_0x364b3b(0x1ee)](_0x3c37a5,_0x3c05e9[_0x364b3b(0x240)](_0x3c37a5));}for(const _0x572554 of _0xddc7f3){const _0x4f4e8c=_0x153f7f[_0x364b3b(0x1ea)](_0x49de6e=>_0x49de6e[_0x364b3b(0x20a)]===_0x572554);if(_0x4f4e8c[_0x364b3b(0x1f4)]===0x0)throw menuError(_0x364b3b(0x1f8),_0x364b3b(0x20b)+JSON[_0x364b3b(0x1fb)](_0x572554)+'.',_0x364b3b(0x1ca));if(_0x4f4e8c[_0x364b3b(0x1f4)]>0x1)throw menuError(_0x364b3b(0x1ff),'Menu\x20path\x20selector\x20matched\x20multiple\x20menus:\x20'+JSON[_0x364b3b(0x1fb)](_0x572554)+'.',_0x364b3b(0x1da)+_0x4f4e8c['map'](_0x5c509f=>_0x5c509f['id'])[_0x364b3b(0x207)](',\x20')+'.');const _0x4f097d=_0x4f4e8c[0x0];_0x2e6084[_0x364b3b(0x1ee)](_0x4f097d['id'],_0x4f097d);}return[..._0x2e6084[_0x364b3b(0x1c4)]()];}function parseMenuIds(_0x44d151){const _0x19e471=a153_0x4f42a4,_0x261d10=parseCsv(_0x44d151),_0x28eeb0=_0x261d10[_0x19e471(0x232)](Number);if(_0x28eeb0['some'](_0x54e615=>!Number[_0x19e471(0x1f6)](_0x54e615)||_0x54e615<=0x0))throw CliErrors[_0x19e471(0x1ef)](_0x19e471(0x21b));return[...new Set(_0x28eeb0)];}function parseCsv(_0x448359){const _0x5f5301=a153_0x4f42a4;return[...new Set(_0x448359[_0x5f5301(0x23c)](',')[_0x5f5301(0x232)](_0x443a81=>_0x443a81[_0x5f5301(0x229)]())[_0x5f5301(0x1ea)](Boolean))];}function parseBooleanFlag(_0x521ff8,_0x54fddc,_0x53af4f){const _0x1bf7cd=a153_0x4f42a4;if(!hasFlag(_0x521ff8,_0x54fddc)){if(_0x53af4f)throw CliErrors[_0x1bf7cd(0x21a)](_0x54fddc);return undefined;}const _0xfdbdaa=_0x521ff8[_0x1bf7cd(0x217)][_0x54fddc];if(_0xfdbdaa===!![]||_0xfdbdaa===![])return _0xfdbdaa;if(_0xfdbdaa===_0x1bf7cd(0x23f))return!![];if(_0xfdbdaa==='false')return![];throw CliErrors['validation']('--'+_0x54fddc+_0x1bf7cd(0x1e7));}function verifyVisibilityUpdate(_0x5eaa4e,_0x3e4690,_0x2909e4){const _0x130480=a153_0x4f42a4;assertVerified(!!_0x3e4690,'Menu\x20'+_0x5eaa4e['id']+_0x130480(0x1cf)),assertVerified(_0x3e4690[_0x130480(0x1e6)]===_0x2909e4,_0x130480(0x1d3)+_0x5eaa4e['id']+_0x130480(0x224));const _0x76dc22=[['id',_0x3e4690['id'],_0x5eaa4e['id']],['parentId',_0x3e4690[_0x130480(0x22f)],_0x5eaa4e[_0x130480(0x22f)]],[_0x130480(0x22c),_0x3e4690[_0x130480(0x22c)],_0x5eaa4e['depth']],[_0x130480(0x1d5),_0x3e4690[_0x130480(0x1d5)],_0x5eaa4e[_0x130480(0x1d5)]],[_0x130480(0x20a),_0x3e4690[_0x130480(0x20a)],_0x5eaa4e[_0x130480(0x20a)]],[_0x130480(0x213),_0x3e4690[_0x130480(0x213)],_0x5eaa4e[_0x130480(0x213)]],[_0x130480(0x1e0),_0x3e4690[_0x130480(0x1e0)],_0x5eaa4e[_0x130480(0x1e0)]],[_0x130480(0x1dc),_0x3e4690[_0x130480(0x1dc)],_0x5eaa4e[_0x130480(0x1dc)]],[_0x130480(0x202),_0x3e4690[_0x130480(0x202)],_0x5eaa4e[_0x130480(0x202)]],[_0x130480(0x20c),_0x3e4690[_0x130480(0x20c)],_0x5eaa4e['resourcesValid']],[_0x130480(0x1ce),_0x3e4690[_0x130480(0x1ce)],_0x5eaa4e[_0x130480(0x1ce)]],[_0x130480(0x242),_0x3e4690[_0x130480(0x242)],_0x5eaa4e[_0x130480(0x242)]],[_0x130480(0x1fc),_0x3e4690[_0x130480(0x1fc)],_0x5eaa4e['pageId']],[_0x130480(0x22b),_0x3e4690[_0x130480(0x22b)],_0x5eaa4e[_0x130480(0x22b)]],[_0x130480(0x1f3),_0x3e4690['modelType'],_0x5eaa4e[_0x130480(0x1f3)]],['datasetId',_0x3e4690[_0x130480(0x239)],_0x5eaa4e[_0x130480(0x239)]],[_0x130480(0x210),_0x3e4690[_0x130480(0x210)],_0x5eaa4e['datasetCode']]];for(const [_0x294f2c,_0x27ab73,_0x6df2f3]of _0x76dc22){assertVerified(sameValue(_0x27ab73,_0x6df2f3),_0x130480(0x1d3)+_0x5eaa4e['id']+'\x20'+_0x294f2c+'\x20changed\x20unexpectedly.');}}function sameValue(_0x34affc,_0x1d0dfd){const _0x287612=a153_0x4f42a4;if(Array[_0x287612(0x230)](_0x34affc)||Array[_0x287612(0x230)](_0x1d0dfd))return JSON[_0x287612(0x1fb)](_0x34affc)===JSON['stringify'](_0x1d0dfd);return _0x34affc===_0x1d0dfd;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a154_0x50aa82=a154_0x1df6;function a154_0x3239(){const _0x304c8a=['document','config-create','3508225GTcVsU','24283SGijUQ','channelType','5799610ooHNAe','appCode','connectTimeout','7vkSbwI','9kWjUih','configCode','Inspect\x20with\x20','endpointUrl','description','POST',';\x20do\x20not\x20resubmit\x20automatically.','Created\x20notification\x20config\x20','2629208EvLDxY','notification','write','create','/notification/channel-config/create','4vWkhiv','verification','readTimeout','2157192eJJVIQ','2892593azcJiY','1104672Jhwnvf','50gMrgBN','configName',';\x20do\x20not\x20resubmit.','mutation','Create\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20source','planned','notification_config_create_outcome_unknown'];a154_0x3239=function(){return _0x304c8a;};return a154_0x3239();}(function(_0x5a010c,_0x56e4d7){const _0x3481c3=a154_0x1df6,_0x868076=_0x5a010c();while(!![]){try{const _0x58ec59=parseInt(_0x3481c3(0x1be))/0x1*(parseInt(_0x3481c3(0x1b4))/0x2)+parseInt(_0x3481c3(0x1b3))/0x3+-parseInt(_0x3481c3(0x1d1))/0x4*(parseInt(_0x3481c3(0x1bd))/0x5)+-parseInt(_0x3481c3(0x1b1))/0x6+parseInt(_0x3481c3(0x1c3))/0x7*(parseInt(_0x3481c3(0x1cc))/0x8)+-parseInt(_0x3481c3(0x1c4))/0x9*(-parseInt(_0x3481c3(0x1c0))/0xa)+-parseInt(_0x3481c3(0x1b2))/0xb;if(_0x58ec59===_0x56e4d7)break;else _0x868076['push'](_0x868076['shift']());}catch(_0x37b933){_0x868076['push'](_0x868076['shift']());}}}(a154_0x3239,0x88a9b));import{asDryRunResult}from'../../commands/common/dry-run.js';import{createNotificationChannelConfig,getNotificationChannelConfig,isPlatformTransportFailure}from'../../core/api-client.js';import{assertSingleNotificationSource,createMutationInput,DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,DEFAULT_NOTIFICATION_READ_TIMEOUT,normalizeExactNotificationConfig,notificationError,notificationLookupCommand,NOTIFICATION_APP_FLAG,NOTIFICATION_INPUT_FLAGS,projectNotificationConfig,readNotificationDocument,safeApiFailure}from'../../commands/notification/shared.js';const CREATE_PATH=a154_0x50aa82(0x1d0);function a154_0x1df6(_0x12735c,_0x5bcd11){_0x12735c=_0x12735c-0x1af;const _0x3239d6=a154_0x3239();let _0x1df65d=_0x3239d6[_0x12735c];return _0x1df65d;}async function prepareCreate(_0x590d93){const _0x4bbde9=a154_0x50aa82,_0xaea7a4=await readNotificationDocument(_0x590d93,_0x4bbde9(0x1cf)),_0x1ca8a3=createMutationInput(_0x590d93[_0x4bbde9(0x1c1)],_0xaea7a4);return{'document':_0xaea7a4,'input':_0x1ca8a3,'planned':projectNotificationConfig({'appCode':_0x590d93['appCode'],'configName':_0xaea7a4[_0x4bbde9(0x1b5)],'channelType':_0xaea7a4[_0x4bbde9(0x1bf)],'endpointUrl':_0xaea7a4[_0x4bbde9(0x1c7)],'channelConfig':_0xaea7a4['channelConfig'],'description':_0xaea7a4[_0x4bbde9(0x1c8)],'connectTimeout':_0xaea7a4[_0x4bbde9(0x1c2)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,'readTimeout':_0xaea7a4[_0x4bbde9(0x1b0)]??DEFAULT_NOTIFICATION_READ_TIMEOUT})};}export const notificationConfigCreate={'service':a154_0x50aa82(0x1cd),'command':a154_0x50aa82(0x1bc),'description':a154_0x50aa82(0x1b8),'risk':a154_0x50aa82(0x1ce),'requiresAppCode':!![],'structuredErrors':!![],'flags':[...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x39e506){assertSingleNotificationSource(_0x39e506);},async 'dryRun'(_0x42c8f4){const _0x50b560=a154_0x50aa82,_0x3b5a5b=await prepareCreate(_0x42c8f4),_0x175a10=notificationLookupCommand(_0x42c8f4[_0x50b560(0x1c1)],_0x3b5a5b[_0x50b560(0x1bb)]['channelType']);return asDryRunResult({'operation':'create','selector':{'appCode':_0x42c8f4['appCode'],'configName':_0x3b5a5b[_0x50b560(0x1bb)][_0x50b560(0x1b5)],'channelType':_0x3b5a5b[_0x50b560(0x1bb)][_0x50b560(0x1bf)]},'before':null,'after':_0x3b5a5b[_0x50b560(0x1b9)],'dryRun':!![],'backend':{'method':_0x50b560(0x1c9),'path':CREATE_PATH},'warnings':[],'verification':{'status':_0x50b560(0x1b9),'lookupCommand':_0x175a10}},{'method':_0x50b560(0x1c9),'url':CREATE_PATH});},async 'execute'(_0x5107de){const _0x351387=a154_0x50aa82,_0x5b645b=await prepareCreate(_0x5107de),_0x250aeb=notificationLookupCommand(_0x5107de[_0x351387(0x1c1)],_0x5b645b[_0x351387(0x1bb)][_0x351387(0x1bf)]);let _0x1fc991;try{_0x1fc991=await createNotificationChannelConfig(_0x5b645b['input']);}catch(_0x1f7c3a){if(isPlatformTransportFailure(_0x1f7c3a))throw notificationError(_0x351387(0x1ba),'Notification\x20config\x20create\x20outcome\x20is\x20unknown\x20because\x20no\x20server\x20ID\x20was\x20received.','Inspect\x20with\x20'+_0x250aeb+_0x351387(0x1b6));throw safeApiFailure(_0x351387(0x1cf),_0x351387(0x1b7),_0x351387(0x1c6)+_0x250aeb+';\x20no\x20automatic\x20retry\x20was\x20attempted.');}if(!Number['isSafeInteger'](_0x1fc991)||_0x1fc991<=0x0)throw notificationError(_0x351387(0x1ba),'Notification\x20config\x20create\x20returned\x20no\x20usable\x20server\x20ID.','Inspect\x20with\x20'+_0x250aeb+_0x351387(0x1b6));let _0x58dc95;try{const _0x58f916=await getNotificationChannelConfig(_0x1fc991,_0x5107de[_0x351387(0x1c1)]);_0x58dc95=normalizeExactNotificationConfig(_0x58f916,_0x1fc991,_0x5107de[_0x351387(0x1c1)]);}catch{throw safeApiFailure(_0x351387(0x1cf),_0x351387(0x1af),_0x351387(0x1c6)+_0x250aeb+_0x351387(0x1ca));}return{'ok':!![],'data':{'operation':'create','selector':{'appCode':_0x58dc95[_0x351387(0x1c1)],'id':_0x58dc95['id'],'configCode':_0x58dc95[_0x351387(0x1c5)],'configName':_0x58dc95[_0x351387(0x1b5)],'channelType':_0x58dc95['channelType']},'before':null,'after':projectNotificationConfig(_0x58dc95),'dryRun':![],'backend':{'method':_0x351387(0x1c9),'path':CREATE_PATH},'warnings':[],'verification':{'status':'verified','lookupCommand':_0x250aeb}},'message':_0x351387(0x1cb)+_0x58dc95['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a155_0x26bcfd=a155_0x2bea;(function(_0x2566f0,_0x270fed){const _0x1e5316=a155_0x2bea,_0x22fb9c=_0x2566f0();while(!![]){try{const _0x4e63fd=parseInt(_0x1e5316(0x187))/0x1+-parseInt(_0x1e5316(0x18a))/0x2+-parseInt(_0x1e5316(0x183))/0x3+parseInt(_0x1e5316(0x188))/0x4*(-parseInt(_0x1e5316(0x194))/0x5)+parseInt(_0x1e5316(0x180))/0x6*(parseInt(_0x1e5316(0x186))/0x7)+-parseInt(_0x1e5316(0x179))/0x8*(parseInt(_0x1e5316(0x189))/0x9)+parseInt(_0x1e5316(0x17e))/0xa;if(_0x4e63fd===_0x270fed)break;else _0x22fb9c['push'](_0x22fb9c['shift']());}catch(_0x4d95c3){_0x22fb9c['push'](_0x22fb9c['shift']());}}}(a155_0x1693,0x1e602));import{asDryRunResult}from'../../commands/common/dry-run.js';import{deleteNotificationChannelConfig,isPlatformTransportFailure,listNotificationChannelConfigs}from'../../core/api-client.js';import{notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,projectNotificationConfig,readNotificationId,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure,validateNotificationDeleteReadback}from'../../commands/notification/shared.js';const DELETE_PATH=a155_0x26bcfd(0x181),REFERENCE_WARNING='Deleting\x20this\x20app-level\x20config\x20may\x20make\x20dataset-level\x20channels\x20that\x20reference\x20it\x20unavailable;\x20dataset\x20references\x20were\x20not\x20verified\x20by\x20the\x20CLI.';function a155_0x2bea(_0x3f06f8,_0x120657){_0x3f06f8=_0x3f06f8-0x179;const _0x169338=a155_0x1693();let _0x2bead2=_0x169338[_0x3f06f8];return _0x2bead2;}async function prepareDelete(_0x50ca11){const _0x8be0d5=a155_0x26bcfd,_0x1263c2=readNotificationId(_0x50ca11),_0x121581=await requireExactNotificationConfig(_0x50ca11[_0x8be0d5(0x193)],_0x1263c2,'delete');return{'id':_0x1263c2,'before':_0x121581};}function a155_0x1693(){const _0x1a2cb2=['notification_config_delete_verification_unavailable','Inspect\x20with\x20',';\x20no\x20automatic\x20retry\x20was\x20attempted.','POST','verified','notification_config_delete_verification_failed','appCode','10ySxWDR','unshift','some','before','delete','72dzsZgj','\x20delete\x20could\x20not\x20be\x20verified.','channelType','Deleted\x20notification\x20config\x20','planned','3627490HREvpT',';\x20do\x20not\x20resubmit\x20automatically.','513054ASBRNy','/notification/channel-config/delete','notification_config_delete_outcome_unknown','523719CLkfcC','Delete\x20an\x20app-level\x20notification\x20config\x20after\x20exact\x20preflight','mutation','14itSYNS','67036pCnRhI','23932DspeHL','238131NcbIBy','103430GshrpD','config-delete','high-risk-write'];a155_0x1693=function(){return _0x1a2cb2;};return a155_0x1693();}export const notificationConfigDelete={'service':'notification','command':a155_0x26bcfd(0x18b),'description':a155_0x26bcfd(0x184),'risk':a155_0x26bcfd(0x18c),'requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,NOTIFICATION_APP_FLAG],async 'validate'(_0x402cd6){readNotificationId(_0x402cd6),requireNotificationExplicitYes(_0x402cd6);},async 'dryRun'(_0x43cd6b){const _0xe2efb6=a155_0x26bcfd,_0x55952e=await prepareDelete(_0x43cd6b),_0x3a37af=notificationLookupCommand(_0x43cd6b[_0xe2efb6(0x193)],_0x55952e[_0xe2efb6(0x197)][_0xe2efb6(0x17b)]);return asDryRunResult({'operation':_0xe2efb6(0x198),'selector':notificationSelector(_0x55952e[_0xe2efb6(0x197)]),'before':projectNotificationConfig(_0x55952e['before']),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[REFERENCE_WARNING],'verification':{'status':_0xe2efb6(0x17d),'lookupCommand':_0x3a37af}},{'method':_0xe2efb6(0x190),'url':DELETE_PATH});},async 'execute'(_0x29cb43){const _0x45dab7=a155_0x26bcfd;requireNotificationExplicitYes(_0x29cb43);const _0x186680=await prepareDelete(_0x29cb43),_0x2d1790=notificationLookupCommand(_0x29cb43[_0x45dab7(0x193)],_0x186680[_0x45dab7(0x197)][_0x45dab7(0x17b)]);let _0x543255=![];try{await deleteNotificationChannelConfig(_0x186680['id'],_0x29cb43['appCode']);}catch(_0x1dd9fb){if(!isPlatformTransportFailure(_0x1dd9fb))throw safeApiFailure('delete',_0x45dab7(0x185),'Inspect\x20with\x20'+_0x2d1790+_0x45dab7(0x18f));_0x543255=!![];}let _0x3db068;try{_0x3db068=await listNotificationChannelConfigs(_0x29cb43[_0x45dab7(0x193)],_0x186680[_0x45dab7(0x197)]['channelType']),validateNotificationDeleteReadback(_0x3db068,_0x29cb43['appCode'],_0x186680['before'][_0x45dab7(0x17b)]);}catch{throw notificationError(_0x543255?_0x45dab7(0x182):_0x45dab7(0x18d),'Notification\x20config\x20'+_0x186680['id']+_0x45dab7(0x17a),'Inspect\x20with\x20'+_0x2d1790+_0x45dab7(0x17f));}if(_0x3db068[_0x45dab7(0x196)](_0x3f72aa=>_0x3f72aa['id']===_0x186680['id']))throw notificationError(_0x543255?_0x45dab7(0x182):_0x45dab7(0x192),'Notification\x20config\x20'+_0x186680['id']+'\x20remains\x20present\x20after\x20delete.',_0x45dab7(0x18e)+_0x2d1790+';\x20do\x20not\x20resubmit\x20automatically.');const _0x26ea0b=[REFERENCE_WARNING];return _0x543255&&_0x26ea0b[_0x45dab7(0x195)]('Delete\x20response\x20was\x20unavailable;\x20list\x20readback\x20proved\x20ID\x20absence\x20without\x20resubmitting.'),{'ok':!![],'data':{'operation':_0x45dab7(0x198),'selector':notificationSelector(_0x186680['before']),'before':projectNotificationConfig(_0x186680[_0x45dab7(0x197)]),'after':null,'dryRun':![],'backend':{'method':_0x45dab7(0x190),'path':DELETE_PATH},'warnings':_0x26ea0b,'verification':{'status':_0x45dab7(0x191),'absenceConfirmed':!![],'recoveredAfterUnknownResponse':_0x543255,'lookupCommand':_0x2d1790}},'message':_0x45dab7(0x17c)+_0x186680['id']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a156_0x50d0d1=a156_0x250b;function a156_0x33d7(){const _0x22a1d9=['4770RWeawr','204ZqcupK','\x20notification\x20config(s)','4608705yDUCIT','6vLGAHH','Found\x20','config-list','22136leFVGR','21757630lWmsjJ','string','type','2455296FoDlte','length','15741bSVXiu','11TxrcbW','271012chgbtt','List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','map','4821609qVROkW','appCode'];a156_0x33d7=function(){return _0x22a1d9;};return a156_0x33d7();}(function(_0x542d49,_0x192851){const _0x3aed8e=a156_0x250b,_0xf98da3=_0x542d49();while(!![]){try{const _0x2decdc=parseInt(_0x3aed8e(0x186))/0x1*(parseInt(_0x3aed8e(0x18e))/0x2)+parseInt(_0x3aed8e(0x18b))/0x3+-parseInt(_0x3aed8e(0x198))/0x4+-parseInt(_0x3aed8e(0x190))/0x5+parseInt(_0x3aed8e(0x191))/0x6*(-parseInt(_0x3aed8e(0x188))/0x7)+parseInt(_0x3aed8e(0x194))/0x8*(parseInt(_0x3aed8e(0x18d))/0x9)+-parseInt(_0x3aed8e(0x195))/0xa*(parseInt(_0x3aed8e(0x187))/0xb);if(_0x2decdc===_0x192851)break;else _0xf98da3['push'](_0xf98da3['shift']());}catch(_0x2ffd03){_0xf98da3['push'](_0xf98da3['shift']());}}}(a156_0x33d7,0xe2de3));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{listNotificationChannelConfigs}from'../../core/api-client.js';function a156_0x250b(_0x11154d,_0x436949){_0x11154d=_0x11154d-0x186;const _0x33d745=a156_0x33d7();let _0x250be7=_0x33d745[_0x11154d];return _0x250be7;}import{NOTIFICATION_CHANNEL_TYPES,projectNotificationListConfig,readNotificationChannelType}from'../../commands/notification/shared.js';export const notificationConfigList={'service':'notification','command':a156_0x50d0d1(0x193),'description':a156_0x50d0d1(0x189),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a156_0x50d0d1(0x197),'type':a156_0x50d0d1(0x196),'description':'Notification\x20channel\x20type','enum':NOTIFICATION_CHANNEL_TYPES,'default':'EMAIL'}],async 'validate'(_0x3427eb){readNotificationChannelType(_0x3427eb);},async 'execute'(_0x22eb76){const _0x42921c=a156_0x50d0d1,_0x400bba=readNotificationChannelType(_0x22eb76),_0x86ac74=await listNotificationChannelConfigs(_0x22eb76['appCode'],_0x400bba),_0x533f34=_0x86ac74[_0x42921c(0x18a)](projectNotificationListConfig);return{'ok':!![],'data':{'appCode':_0x22eb76[_0x42921c(0x18c)],'channelType':_0x400bba,'count':_0x533f34[_0x42921c(0x199)],'configs':_0x533f34},'message':_0x42921c(0x192)+_0x533f34[_0x42921c(0x199)]+'\x20'+_0x400bba+_0x42921c(0x18f)};}};
|