@lovrabet/rabetbase-cli 2.5.6 → 2.5.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.d.ts +2 -0
- package/lib/commands/flow/page-list.js +1 -0
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.d.ts +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.d.ts +6 -2
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +26 -6
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.d.ts +12 -0
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/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 +8 -4
- package/skills/rabetbase/guides/approval-flow-development-workflow.md +52 -13
- package/skills/rabetbase/guides/backend-function.md +26 -4
- package/skills/rabetbase/guides/bff-creation-workflow.md +9 -0
- package/skills/rabetbase/guides/cross-database-bff.md +1 -0
- package/skills/rabetbase/guides/custom-page-flow-sdk.md +2 -0
- package/skills/rabetbase/guides/data-api-guidelines.md +2 -0
- package/skills/rabetbase/guides/flow-config-examples.md +75 -0
- package/skills/rabetbase/guides/form-flow-start.md +61 -0
- package/skills/rabetbase/guides/typescript-sdk.md +1 -1
- package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +18 -4
- package/skills/rabetbase/references/rabetbase-codegen-sdk.md +5 -4
- package/skills/rabetbase/references/rabetbase-flow-commands.md +21 -2
- package/skills/rabetbase/references/rabetbase-flow-resources.md +21 -3
- package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +6 -2
- package/skills/rabetbase/references/rabetbase-kb.md +4 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f7ace,_0x389659){const _0x48586a=a177_0x1cd4,_0x4cff05=_0x2f7ace();while(!![]){try{const _0x436ae3=-parseInt(_0x48586a(0x1c7))/0x1+-parseInt(_0x48586a(0x1be))/0x2+-parseInt(_0x48586a(0x1ca))/0x3*(parseInt(_0x48586a(0x1cf))/0x4)+parseInt(_0x48586a(0x1d0))/0x5*(-parseInt(_0x48586a(0x1bc))/0x6)+-parseInt(_0x48586a(0x1b8))/0x7+parseInt(_0x48586a(0x1b3))/0x8*(parseInt(_0x48586a(0x1ae))/0x9)+parseInt(_0x48586a(0x1d3))/0xa;if(_0x436ae3===_0x389659)break;else _0x4cff05['push'](_0x4cff05['shift']());}catch(_0x3e2e2e){_0x4cff05['push'](_0x4cff05['shift']());}}}(a177_0x2f1d,0xcee92));import a177_0xe15ba6 from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a177_0x4a4221 from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';function a177_0x2f1d(){const _0x1a379e=['test','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','1402734YMjzwh','length','red','221424NOHFrU','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','includes','trim','map','44JgTIVm','2931095SPxUMN','start','JS\x20URL\x20checked','49721980nDbTRi','succeed','stdin','error','catch','Cancelled.','4041vhzndD','JS\x20URL\x20check\x20failed','has','\x20\x20Checking\x20JS\x20URL\x20reachability...','green','8112iKehrb','\x20\x20CSS\x20URL:','\x20\x20Checking\x20CSS\x20URL\x20reachability...','CSS\x20URL\x20check\x20failed','No\x20local\x20pages\x20found.','11205306SBNqqp','cancelled','\x20\x20JS\x20URL:','fail','6UEOtdF','path','356758iDbMri','[already\x20on\x20platform]','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','name','cyan','isTTY','gray'];a177_0x2f1d=function(){return _0x1a379e;};return a177_0x2f1d();}import{menuPathKey}from'../../../commands/menu/shared/path.js';function a177_0x1cd4(_0x534ce5,_0x33a384){_0x534ce5=_0x534ce5-0x1aa;const _0x2f1de9=a177_0x2f1d();let _0x1cd42b=_0x2f1de9[_0x534ce5];return _0x1cd42b;}import{CliErrors}from'../../../errors.js';function onCancel(_0x4659ff){const _0x47aa76=a177_0x1cd4;return _0x4659ff[_0x47aa76(0x1ac)](_0x58c4f4=>{const _0x1f9b48=_0x47aa76;if(_0x58c4f4?.[_0x1f9b48(0x1c1)]==='ExitPromptError')throw CliErrors['cancelled'](_0x1f9b48(0x1ad));throw _0x58c4f4;});}export function startSpinner(_0x3b27a2){const _0x30cf0b=a177_0x1cd4;return a177_0x4a4221({'text':_0x3b27a2,'color':_0x30cf0b(0x1c2)})[_0x30cf0b(0x1d1)]();}export function stopSpinner(_0x1ac52c,_0x504fa4,_0x30d81e){const _0x38399b=a177_0x1cd4;_0x30d81e?_0x1ac52c[_0x38399b(0x1d4)](_0x504fa4):_0x1ac52c[_0x38399b(0x1bb)](_0x504fa4);}export async function askConfirm(_0x479f29){return onCancel(confirm({'message':_0x479f29,'theme':{'prefix':''}}));}export async function askJsUrl(_0x25e2a0){const _0x16a4db=a177_0x1cd4;while(!![]){const _0x394893=await onCancel(input({'message':_0x16a4db(0x1ba),'default':_0x25e2a0,'theme':{'prefix':''}}));if(_0x394893[_0x16a4db(0x1cd)]()==='')throw CliErrors['cancelled']('Cancelled.');if(!/^https:\/\/.+\.js(\?.*)?$/[_0x16a4db(0x1c5)](_0x394893[_0x16a4db(0x1cd)]())){console['error'](a177_0xe15ba6['red'](_0x16a4db(0x1c6)));continue;}const _0x3b3827=startSpinner(_0x16a4db(0x1b1));try{const _0x5e2dd9=await isUrlReachable(_0x394893[_0x16a4db(0x1cd)]());stopSpinner(_0x3b3827,_0x16a4db(0x1d2),_0x5e2dd9);if(!_0x5e2dd9){console[_0x16a4db(0x1ab)](a177_0xe15ba6[_0x16a4db(0x1c9)]('\x20\x20✗\x20JS\x20URL\x20is\x20unreachable'));continue;}return _0x394893['trim']();}catch(_0x3d183f){stopSpinner(_0x3b3827,_0x16a4db(0x1af),![]);throw _0x3d183f;}}}export async function askCssUrl(_0x107fa9){const _0x172e58=a177_0x1cd4;while(!![]){const _0x25e43c=await onCancel(input({'message':_0x172e58(0x1b4),'default':_0x107fa9,'theme':{'prefix':''}}));if(_0x25e43c[_0x172e58(0x1cd)]()==='')throw CliErrors[_0x172e58(0x1b9)](_0x172e58(0x1ad));if(!/^https:\/\/.+\.css(\?.*)?$/[_0x172e58(0x1c5)](_0x25e43c[_0x172e58(0x1cd)]())){console[_0x172e58(0x1ab)](a177_0xe15ba6[_0x172e58(0x1c9)](_0x172e58(0x1c0)));continue;}const _0xe4d45c=startSpinner(_0x172e58(0x1b5));try{const _0x4d2c30=await isUrlReachable(_0x25e43c['trim']());stopSpinner(_0xe4d45c,'CSS\x20URL\x20checked',_0x4d2c30);if(!_0x4d2c30){console[_0x172e58(0x1ab)](a177_0xe15ba6[_0x172e58(0x1c9)](_0x172e58(0x1cb)));continue;}return _0x25e43c[_0x172e58(0x1cd)]();}catch(_0x102262){stopSpinner(_0xe4d45c,_0x172e58(0x1b6),![]);throw _0x102262;}}}export async function selectPages(_0x54a2ee,_0x2da631){const _0x31ed46=a177_0x1cd4,_0x56a30e=_0x54a2ee[_0x31ed46(0x1ce)](_0x367646=>{const _0x1fe5a7=_0x31ed46,_0x8bba84=_0x2da631[_0x1fe5a7(0x1b0)](menuPathKey(_0x367646[_0x1fe5a7(0x1bd)]));return{'name':_0x367646['label']+'\x20\x20'+a177_0xe15ba6[_0x1fe5a7(0x1c4)](_0x367646['path'])+'\x20\x20'+(_0x8bba84?a177_0xe15ba6[_0x1fe5a7(0x1c4)](_0x1fe5a7(0x1bf)):a177_0xe15ba6[_0x1fe5a7(0x1b2)]('[new]')),'value':_0x367646[_0x1fe5a7(0x1bd)],'checked':!_0x8bba84,'disabled':_0x8bba84};});if(_0x56a30e[_0x31ed46(0x1c8)]===0x0)throw new Error(_0x31ed46(0x1b7));const _0x4cb2fa=await onCancel(checkbox({'message':'\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','choices':_0x56a30e,'loop':![],'theme':{'prefix':''}}));if(_0x4cb2fa[_0x31ed46(0x1c8)]===0x0)throw new Error('No\x20menus\x20selected.');return _0x54a2ee['filter'](_0x2e7f22=>_0x4cb2fa[_0x31ed46(0x1cc)](_0x2e7f22['path']));}export function isInteractive(){const _0xa0111b=a177_0x1cd4;return process[_0xa0111b(0x1aa)][_0xa0111b(0x1c3)]===!![];}export function requireInteractive(){if(!isInteractive())throw new Error('This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20'+'Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a178_0x3ba2ce=a178_0x5b0d;(function(_0x132a0a,_0x263aa6){const _0x58789c=a178_0x5b0d,_0x595bf3=_0x132a0a();while(!![]){try{const _0x3f661b=-parseInt(_0x58789c(0x169))/0x1*(parseInt(_0x58789c(0x164))/0x2)+parseInt(_0x58789c(0x162))/0x3*(parseInt(_0x58789c(0x190))/0x4)+-parseInt(_0x58789c(0x16b))/0x5*(parseInt(_0x58789c(0x18a))/0x6)+parseInt(_0x58789c(0x17a))/0x7*(parseInt(_0x58789c(0x18b))/0x8)+parseInt(_0x58789c(0x17f))/0x9*(-parseInt(_0x58789c(0x161))/0xa)+-parseInt(_0x58789c(0x186))/0xb+parseInt(_0x58789c(0x185))/0xc*(parseInt(_0x58789c(0x174))/0xd);if(_0x3f661b===_0x263aa6)break;else _0x595bf3['push'](_0x595bf3['shift']());}catch(_0x50dc1b){_0x595bf3['push'](_0x595bf3['shift']());}}}(a178_0x425d,0xbac28));import{existsSync,readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process[a178_0x3ba2ce(0x188)](),'src/pages');export function extractTitleFromComment(_0x100213){const _0x3f6e55=a178_0x3ba2ce;try{const _0x1a076f=readFileSync(_0x100213,_0x3f6e55(0x18f)),_0x555702=_0x1a076f[_0x3f6e55(0x16c)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x555702&&_0x555702[0x1]){const _0x1584c2=_0x555702[0x1],_0x3f867c=_0x1584c2[_0x3f6e55(0x16c)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x3f867c&&_0x3f867c[0x1])return _0x3f867c[0x1][_0x3f6e55(0x16a)]();}let _0x5cc4cc=null;const _0x220411=_0x1a076f[_0x3f6e55(0x16c)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x220411&&_0x220411[0x1]&&(_0x5cc4cc=_0x220411[0x1]);if(!_0x5cc4cc){const _0x29bcb7=_0x1a076f['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x29bcb7&&_0x29bcb7[0x1]&&(_0x5cc4cc=_0x29bcb7[0x1]);}if(_0x5cc4cc){const _0x5077cf=new RegExp('\x5cb'+_0x5cc4cc+_0x3f6e55(0x175)),_0xadae1d=_0x1a076f[_0x3f6e55(0x16c)](_0x5077cf);if(_0xadae1d&&_0xadae1d[0x1])return _0xadae1d[0x1];return _0x5cc4cc;}return null;}catch(_0x2cb8bb){return null;}}export function getLocalPages(_0x80b73=pagesDir,_0x112366=pagesDir,_0x8b06a7=process[a178_0x3ba2ce(0x188)]()){const _0x3d723d=a178_0x3ba2ce;if(resolve(_0x80b73)===resolve(_0x112366)){const _0x1cd5cd=join(_0x8b06a7,_0x3d723d(0x17e));if(existsSync(_0x1cd5cd))return getDeclaredPages(_0x1cd5cd,_0x8b06a7);}let _0x57b1dd=[];const _0x48817d=readdirSync(_0x80b73);return _0x48817d[_0x3d723d(0x172)](_0x77b802=>{const _0x3e2ffe=_0x3d723d,_0x3066a3=join(_0x80b73,_0x77b802),_0x2bfdd5=statSync(_0x3066a3);if(_0x2bfdd5&&_0x2bfdd5[_0x3e2ffe(0x173)]())_0x57b1dd=_0x57b1dd['concat'](getLocalPages(_0x3066a3,_0x112366,_0x8b06a7));else{if(_0x77b802[_0x3e2ffe(0x181)]('.tsx')){let _0x540580=relative(_0x112366,_0x3066a3);_0x540580[_0x3e2ffe(0x181)](_0x3e2ffe(0x170))?_0x540580=_0x540580[_0x3e2ffe(0x168)](/index\.tsx$/,''):_0x540580=_0x540580['replace'](/\.tsx$/,'');_0x540580[_0x3e2ffe(0x181)](sep)&&(_0x540580=_0x540580[_0x3e2ffe(0x177)](0x0,-0x1));const _0x4ca340=_0x540580[_0x3e2ffe(0x17d)](sep)[_0x3e2ffe(0x171)]('/'),_0x52b3a3=extractTitleFromComment(_0x3066a3),_0x2b0201=_0x52b3a3||_0x4ca340;_0x57b1dd[_0x3e2ffe(0x15d)]({'path':_0x4ca340[_0x3e2ffe(0x16f)]('$',':'),'label':_0x2b0201});}}}),_0x57b1dd[_0x3d723d(0x193)](_0x699627=>_0x699627[_0x3d723d(0x163)]!=='');}function a178_0x5b0d(_0x26e6b0,_0x1df5c5){_0x26e6b0=_0x26e6b0-0x15b;const _0x425d17=a178_0x425d();let _0x5b0d05=_0x425d17[_0x26e6b0];return _0x5b0d05;}function a178_0x425d(){const _0x563af0=['has','src/pages/','filter','\x20disagrees\x20with\x20pageFile\x20','map','push','parse','boolean',':$1','20DFQIqN','138XDIzqs','path','92398AYKCsG','order',';\x20expected\x20','Duplicate\x20route\x20path\x20in\x20manifest:\x20','replace','9ZMKImX','trim','90XTbHkb','match','Route\x20manifest\x20must\x20contain\x20an\x20array:\x20',':\x20path,\x20label,\x20pageFile\x20and\x20visible\x20are\x20required','replaceAll','index.tsx','join','forEach','isDirectory','1703ywOTmW','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','index','slice','pageFile','isArray','42GImGaZ','Invalid\x20route\x20group\x20for\x20','test','split','src/features/routing/routes.json','3708945hctLQg','string','endsWith','group','length','Route\x20','218136WSCIoX','15577969MgZEjN','Invalid\x20route\x20order\x20for\x20','cwd','Route\x20page\x20file\x20does\x20not\x20exist:\x20','225534sozDqr','423184fOHDRU','Invalid\x20route\x20manifest\x20row\x20','utf8','visible','utf-8','121656uzIiuG'];a178_0x425d=function(){return _0x563af0;};return a178_0x425d();}function getDeclaredPages(_0x288559,_0x9f24e7){const _0x4ab80d=a178_0x3ba2ce;let _0x150c1d;try{_0x150c1d=JSON[_0x4ab80d(0x15e)](readFileSync(_0x288559,_0x4ab80d(0x18d)));}catch(_0x3666f2){throw new Error('Invalid\x20route\x20manifest\x20'+_0x288559+':\x20'+String(_0x3666f2));}if(!Array[_0x4ab80d(0x179)](_0x150c1d))throw new Error(_0x4ab80d(0x16d)+_0x288559);const _0x2e587d=new Set();return _0x150c1d[_0x4ab80d(0x15c)]((_0x1d9ad1,_0x30b231)=>{const _0x12117c=_0x4ab80d;if(!_0x1d9ad1||typeof _0x1d9ad1!=='object'||Array['isArray'](_0x1d9ad1))throw new Error('Invalid\x20route\x20manifest\x20row\x20'+(_0x30b231+0x1));const _0x4f64da=_0x1d9ad1,_0x1c8b6f=_0x4f64da[_0x12117c(0x163)],_0xa243e6=_0x4f64da['label'],_0x1c3195=_0x4f64da[_0x12117c(0x178)];if(typeof _0x1c8b6f!==_0x12117c(0x180)||!/^\/(?!\/)[^?#]*$/[_0x12117c(0x17c)](_0x1c8b6f)||typeof _0xa243e6!=='string'||!_0xa243e6[_0x12117c(0x16a)]()||typeof _0x1c3195!==_0x12117c(0x180)||!/^src\/pages\/(?!.*\.\.)[^/].*\.tsx$/[_0x12117c(0x17c)](_0x1c3195)||typeof _0x4f64da[_0x12117c(0x18e)]!==_0x12117c(0x15f))throw new Error(_0x12117c(0x18c)+(_0x30b231+0x1)+_0x12117c(0x16e));if(_0x2e587d[_0x12117c(0x191)](_0x1c8b6f))throw new Error(_0x12117c(0x167)+_0x1c8b6f);_0x2e587d['add'](_0x1c8b6f);if(!existsSync(resolve(_0x9f24e7,_0x1c3195)))throw new Error(_0x12117c(0x189)+_0x1c3195);const _0x16d970=_0x1c3195[_0x12117c(0x177)](_0x12117c(0x192)[_0x12117c(0x183)])[_0x12117c(0x168)](/\/index\.tsx$/,'')[_0x12117c(0x168)](/\.tsx$/,'')[_0x12117c(0x16f)]('$',':')[_0x12117c(0x168)](/\[([^/\]]+)\]/g,_0x12117c(0x160)),_0x4c8934=_0x16d970===_0x12117c(0x176)?'/':'/'+_0x16d970;if(_0x1c8b6f!==_0x4c8934)throw new Error(_0x12117c(0x184)+_0x1c8b6f+_0x12117c(0x15b)+_0x1c3195+_0x12117c(0x166)+_0x4c8934);if(_0x4f64da[_0x12117c(0x182)]!==undefined&&(typeof _0x4f64da[_0x12117c(0x182)]!==_0x12117c(0x180)||!_0x4f64da[_0x12117c(0x182)]['trim']()))throw new Error(_0x12117c(0x17b)+_0x1c8b6f);if(_0x4f64da[_0x12117c(0x165)]!==undefined&&(!Number['isInteger'](_0x4f64da[_0x12117c(0x165)])||_0x4f64da[_0x12117c(0x165)]<0x0))throw new Error(_0x12117c(0x187)+_0x1c8b6f);return{'path':_0x1c8b6f,'label':_0xa243e6[_0x12117c(0x16a)](),'visible':_0x4f64da[_0x12117c(0x18e)],..._0x4f64da[_0x12117c(0x182)]===undefined?{}:{'group':_0x4f64da['group']['trim']()},..._0x4f64da['order']===undefined?{}:{'order':_0x4f64da[_0x12117c(0x165)]}};});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5dd9c2,_0x4193d0){const _0x769f3c=a179_0x48bf,_0x2f5359=_0x5dd9c2();while(!![]){try{const _0x4aa5e6=-parseInt(_0x769f3c(0x15b))/0x1+-parseInt(_0x769f3c(0x161))/0x2*(parseInt(_0x769f3c(0x155))/0x3)+parseInt(_0x769f3c(0x152))/0x4*(parseInt(_0x769f3c(0x153))/0x5)+-parseInt(_0x769f3c(0x159))/0x6*(parseInt(_0x769f3c(0x162))/0x7)+-parseInt(_0x769f3c(0x160))/0x8*(parseInt(_0x769f3c(0x15e))/0x9)+parseInt(_0x769f3c(0x156))/0xa*(-parseInt(_0x769f3c(0x15f))/0xb)+parseInt(_0x769f3c(0x163))/0xc;if(_0x4aa5e6===_0x4193d0)break;else _0x2f5359['push'](_0x2f5359['shift']());}catch(_0x220bb7){_0x2f5359['push'](_0x2f5359['shift']());}}}(a179_0x7898,0xe9b42));function a179_0x7898(){const _0xa13d66=['545voEnzf','map','45BWpeet','20020VdurMu','length','JS\x20URL\x20is\x20unreachable','21672LwXAcj','CSS\x20URL\x20is\x20unreachable','393107RKRtNF','errors','label','103176euhIgV','5060FgaXGZ','16GaLWOA','39190cvnHRD','1323TmixEj','37500780TBfrrQ','push','path','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','has','5348RlzDum'];a179_0x7898=function(){return _0xa13d66;};return a179_0x7898();}import{menuPathKey}from'../../../commands/menu/shared/path.js';function a179_0x48bf(_0x4b80dc,_0x15a108){_0x4b80dc=_0x4b80dc-0x14f;const _0x789828=a179_0x7898();let _0x48bf8f=_0x789828[_0x4b80dc];return _0x48bf8f;}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';export function validateJsUrl(_0x58e70f){const _0x189f58=a179_0x48bf,_0x18a149=[];return!isValidJsHttpsUrl(_0x58e70f)&&_0x18a149['push']('JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'),{'ok':_0x18a149[_0x189f58(0x157)]===0x0,'errors':_0x18a149};}export function validateCssUrl(_0x4776a7){const _0x4844dd=a179_0x48bf,_0x56c252=[];return!isValidCssHttpsUrl(_0x4776a7)&&_0x56c252[_0x4844dd(0x164)](_0x4844dd(0x150)),{'ok':_0x56c252[_0x4844dd(0x157)]===0x0,'errors':_0x56c252};}export async function validateJsUrlReachable(_0xb4ceb3){const _0x13e7e2=a179_0x48bf,_0x515dbc=validateJsUrl(_0xb4ceb3);if(!_0x515dbc['ok'])return _0x515dbc;const _0x688fd1=await isUrlReachable(_0xb4ceb3);if(!_0x688fd1)_0x515dbc[_0x13e7e2(0x15c)][_0x13e7e2(0x164)](_0x13e7e2(0x158));return{'ok':_0x515dbc['errors'][_0x13e7e2(0x157)]===0x0,'errors':_0x515dbc[_0x13e7e2(0x15c)]};}export async function validateCssUrlReachable(_0x5b499f){const _0x3f6e70=a179_0x48bf,_0x8c6c7=validateCssUrl(_0x5b499f);if(!_0x8c6c7['ok'])return _0x8c6c7;const _0x5dfa12=await isUrlReachable(_0x5b499f);if(!_0x5dfa12)_0x8c6c7[_0x3f6e70(0x15c)][_0x3f6e70(0x164)](_0x3f6e70(0x15a));return{'ok':_0x8c6c7[_0x3f6e70(0x15c)][_0x3f6e70(0x157)]===0x0,'errors':_0x8c6c7[_0x3f6e70(0x15c)]};}export function buildCompareRows(_0x3329b0,_0x3a5b32){const _0x42268c=a179_0x48bf;return _0x3329b0[_0x42268c(0x154)](_0x3e5978=>({'label':_0x3e5978[_0x42268c(0x15d)],'path':_0x3e5978[_0x42268c(0x14f)],'local':!![],'online':_0x3a5b32[_0x42268c(0x151)](menuPathKey(_0x3e5978[_0x42268c(0x14f)]))}));}export async function doCreateMenus(_0x3822b8,_0x3eff95,_0x5d6c81,_0x4ce02e,_0x49e28f){const _0x358edd=a179_0x48bf,_0x523c1d=_0x49e28f?await createMenus(_0x3822b8,_0x3eff95,_0x5d6c81,_0x4ce02e,_0x49e28f):await createMenus(_0x3822b8,_0x3eff95,_0x5d6c81,_0x4ce02e);return{'created':_0x523c1d[_0x358edd(0x157)],'failed':0x0,'labels':_0x5d6c81[_0x358edd(0x154)](_0x28a534=>_0x28a534[_0x358edd(0x15d)]),'menus':_0x523c1d};}export function filterMenusWithResources(_0x1b8c0d){const _0x3b823e=a179_0x48bf;return _0x1b8c0d['filter'](_0x460ff0=>_0x460ff0['resources'][_0x3b823e(0x157)]>0x0);}export async function fetchMenuData(_0x2e1f27,_0x4a0661){const _0x3fa4ea=a179_0x48bf,_0x1a143f=getLocalPages(),_0x321438=await getOnlineMenuList(_0x2e1f27,_0x4a0661),_0x1bd956=new Set(_0x321438[_0x3fa4ea(0x154)](_0x227b1d=>menuPathKey(_0x227b1d[_0x3fa4ea(0x14f)])));return{'localPages':_0x1a143f,'onlineMenuList':_0x321438,'onlinePaths':_0x1bd956};}export async function fetchOnlineMenuList(_0x28db55,_0x2bf198){return getOnlineMenuList(_0x28db55,_0x2bf198);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a179_0x4e7584=a179_0x12ed;(function(_0x19beec,_0x4b78a2){const _0x5d1b1a=a179_0x12ed,_0xa70834=_0x19beec();while(!![]){try{const _0x3e8ab8=parseInt(_0x5d1b1a(0x19c))/0x1+-parseInt(_0x5d1b1a(0x19d))/0x2+-parseInt(_0x5d1b1a(0x14b))/0x3*(parseInt(_0x5d1b1a(0x13e))/0x4)+-parseInt(_0x5d1b1a(0x172))/0x5+-parseInt(_0x5d1b1a(0x17f))/0x6+-parseInt(_0x5d1b1a(0x151))/0x7+-parseInt(_0x5d1b1a(0x143))/0x8*(-parseInt(_0x5d1b1a(0x179))/0x9);if(_0x3e8ab8===_0x4b78a2)break;else _0xa70834['push'](_0xa70834['shift']());}catch(_0x531521){_0xa70834['push'](_0xa70834['shift']());}}}(a179_0x181f,0x4a8e6));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':a179_0x4e7584(0x191),'required':!![],'description':a179_0x4e7584(0x170)};export const MENU_SORT_FLAG={'name':'sort','type':a179_0x4e7584(0x191),'description':a179_0x4e7584(0x19f)};export const MENU_PARENT_ID_FLAG={'name':a179_0x4e7584(0x18b),'type':a179_0x4e7584(0x147),'description':a179_0x4e7584(0x14f)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a179_0x4e7584(0x168),'type':a179_0x4e7584(0x147),'description':a179_0x4e7584(0x160)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a179_0x4e7584(0x167),'type':'string','description':a179_0x4e7584(0x13f)},{'name':a179_0x4e7584(0x149),'type':a179_0x4e7584(0x191),'description':a179_0x4e7584(0x16a)}];export function validateExactId(_0x59e922){const _0x171506=a179_0x4e7584,_0x1f7085=_0x59e922[_0x171506(0x146)]('id');if(!Number[_0x171506(0x16f)](_0x1f7085)||_0x1f7085<=0x0)throw CliErrors[_0x171506(0x1a9)](_0x171506(0x19e));return _0x1f7085;}export function validateSort(_0x1d95f3,_0x5e93e7=a179_0x4e7584(0x175)){const _0x2d8c55=a179_0x4e7584;if(!hasFlag(_0x1d95f3,_0x5e93e7))return undefined;const _0x57afd9=_0x1d95f3[_0x2d8c55(0x146)](_0x5e93e7);if(!Number[_0x2d8c55(0x16f)](_0x57afd9)||_0x57afd9<0x0||_0x57afd9>MAX_MENU_SORT)throw menuError('menu_sort_invalid','--'+_0x5e93e7+_0x2d8c55(0x186)+MAX_MENU_SORT+'.',_0x2d8c55(0x194));return _0x57afd9;}export function nextSiblingSort(_0x4a3687,_0x52f81a,_0x17106b){const _0x247247=a179_0x4e7584,_0x332c6a=getChildren(_0x4a3687,_0x52f81a)['map'](_0x432bd9=>_0x432bd9['sort'])[_0x247247(0x16b)](_0x28b233=>typeof _0x28b233==='number');if(_0x332c6a['length']===0x0)return 0x0;const _0x4c9d9b=Math[_0x247247(0x142)](..._0x332c6a);if(_0x4c9d9b>=MAX_MENU_SORT)throw menuError(_0x247247(0x150),_0x247247(0x14e)+_0x17106b+_0x247247(0x183)+_0x4c9d9b+'.',_0x247247(0x14c)+MAX_MENU_SORT+_0x247247(0x164));return _0x4c9d9b+0x1;}export function requireExplicitYes(_0x26c7fd){const _0x331be4=a179_0x4e7584;if(_0x26c7fd[_0x331be4(0x13d)]('dry-run'))return;if(!_0x26c7fd[_0x331be4(0x13d)](_0x331be4(0x158)))throw menuError(_0x331be4(0x198),_0x331be4(0x1a7),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0xab1565,_0x30c3dc,_0x42b12e){const _0x213c7b=a179_0x4e7584;try{return await fetchMenuSnapshot(_0xab1565['appCode'],_0xab1565[_0x213c7b(0x13c)]);}catch(_0x2dae02){throw mapMenuApiError(_0x2dae02,'read\x20online\x20menu\x20facts\x20before\x20'+_0x30c3dc,_0x42b12e);}}export async function recheckMutationSnapshot(_0x51006b,_0x35a979,_0x40677d,_0x3e6a59){const _0x330464=a179_0x4e7584;let _0x2a2193;try{_0x2a2193=await fetchMenuSnapshot(_0x51006b['appCode'],_0x51006b[_0x330464(0x13c)]);}catch(_0x2ce0ff){const _0x38057c=mapMenuApiError(_0x2ce0ff,_0x330464(0x196)+_0x40677d,_0x3e6a59);throw menuFailure(_0x38057c,_0x35a979,{'stage':'pre-write-recheck','failed':_0x3e6a59==null?{}:{'id':_0x3e6a59}});}if(_0x2a2193[_0x330464(0x166)]!==_0x35a979[_0x330464(0x17e)]){const _0x484742=menuError('menu_state_drift','Online\x20menu\x20state\x20changed\x20before\x20'+_0x40677d+_0x330464(0x18c),_0x330464(0x173));throw menuFailure(_0x484742,_0x35a979,{'stage':_0x330464(0x197),'failed':{..._0x3e6a59==null?{}:{'id':_0x3e6a59},'expectedSnapshotHash':_0x35a979[_0x330464(0x17e)],'currentSnapshotHash':_0x2a2193['hash']}});}return _0x2a2193;}export function parseParentId(_0x5cf587,_0x423192,_0x38f82d={}){const _0x920133=a179_0x4e7584;if(!hasFlag(_0x5cf587,_0x423192)){if(_0x38f82d[_0x920133(0x195)])throw CliErrors['flagMissing'](_0x423192);return undefined;}const _0x548622=_0x5cf587[_0x920133(0x182)](_0x423192)[_0x920133(0x15c)]();if(_0x548622[_0x920133(0x145)]()==='root')return null;if(!/^\d+$/[_0x920133(0x178)](_0x548622))throw CliErrors['validation']('--'+_0x423192+_0x920133(0x17b));const _0x3867b7=Number(_0x548622);if(!Number[_0x920133(0x16f)](_0x3867b7)||_0x3867b7<=0x0)throw CliErrors[_0x920133(0x1a9)]('--'+_0x423192+_0x920133(0x17b));return _0x3867b7;}export function requireMenu(_0x3f26f4,_0x40fa67){const _0xa6a448=a179_0x4e7584,_0x52195d=_0x3f26f4[_0xa6a448(0x157)]['get'](_0x40fa67);if(!_0x52195d)throw menuError(_0xa6a448(0x180),_0xa6a448(0x144)+_0x40fa67,_0xa6a448(0x155));return _0x52195d;}function a179_0x12ed(_0x39a063,_0x20666f){_0x39a063=_0x39a063-0x13c;const _0x181f43=a179_0x181f();let _0x12ed40=_0x181f43[_0x39a063];return _0x12ed40;}export function requireFolder(_0x2913ad,_0x29fb2a){const _0x54d779=a179_0x4e7584,_0x29e5ee=requireMenu(_0x2913ad,_0x29fb2a);if(_0x29e5ee[_0x54d779(0x1a4)]!==_0x54d779(0x19b))throw menuError(_0x54d779(0x14a),_0x54d779(0x19a)+_0x29fb2a+'\x20is\x20type\x20\x22'+(_0x29e5ee[_0x54d779(0x1a4)]||_0x54d779(0x187))+_0x54d779(0x141),_0x54d779(0x165));return _0x29e5ee;}export function assertExpectedState(_0x59b8b7,_0x17f3a9){const _0x506eb5=a179_0x4e7584;if(hasFlag(_0x59b8b7,_0x506eb5(0x168))){const _0x4eeeea=parseParentId(_0x59b8b7,'expect-parent-id',{'required':!![]});if(_0x17f3a9[_0x506eb5(0x1a1)]!==_0x4eeeea)throw stateDrift(_0x506eb5(0x19a)+_0x17f3a9['id']+_0x506eb5(0x16e)+formatParent(_0x4eeeea)+_0x506eb5(0x18f)+formatParent(_0x17f3a9['parentId'])+'.');}if(hasFlag(_0x59b8b7,'expect-path')){const _0x48126d=_0x59b8b7['str'](_0x506eb5(0x167));if(_0x17f3a9[_0x506eb5(0x17d)]!==_0x48126d)throw stateDrift(_0x506eb5(0x19a)+_0x17f3a9['id']+'\x20path\x20changed:\x20expected\x20'+JSON['stringify'](_0x48126d)+_0x506eb5(0x18f)+JSON[_0x506eb5(0x148)](_0x17f3a9['path'])+'.');}if(hasFlag(_0x59b8b7,_0x506eb5(0x149))){const _0xf71b2b=_0x59b8b7[_0x506eb5(0x146)](_0x506eb5(0x149));if(!Number[_0x506eb5(0x16f)](_0xf71b2b)||_0xf71b2b<0x0)throw CliErrors[_0x506eb5(0x1a9)](_0x506eb5(0x18d));if(_0x17f3a9[_0x506eb5(0x153)]!==_0xf71b2b)throw stateDrift('Menu\x20'+_0x17f3a9['id']+_0x506eb5(0x154)+_0xf71b2b+',\x20current\x20'+_0x17f3a9[_0x506eb5(0x153)]+'.');}}export function assertVerified(_0x41a255,_0x39d838,_0x5e9e95=a179_0x4e7584(0x16d)){if(!_0x41a255)throw menuError('menu_verification_failed',_0x39d838,_0x5e9e95);}export function mutationResult(_0x526941){const _0x5cf34c=a179_0x4e7584;return{'operation':_0x526941[_0x5cf34c(0x17a)],'selector':_0x526941[_0x5cf34c(0x1a2)],'before':_0x526941[_0x5cf34c(0x190)],'after':_0x526941[_0x5cf34c(0x14d)],'dryRun':_0x526941[_0x5cf34c(0x163)],'backend':_0x526941['backend'],..._0x526941[_0x5cf34c(0x185)]?{'plannedActions':_0x526941[_0x5cf34c(0x185)]}:{},..._0x526941[_0x5cf34c(0x192)]?{'targets':_0x526941['targets']}:{},..._0x526941[_0x5cf34c(0x1a6)]?{'deleteOrder':_0x526941[_0x5cf34c(0x1a6)]}:{},'snapshotHash':_0x526941[_0x5cf34c(0x17e)],..._0x526941[_0x5cf34c(0x1a0)]?{'cascade':_0x526941[_0x5cf34c(0x1a0)]}:{},..._0x526941[_0x5cf34c(0x161)]?{'planFile':_0x526941[_0x5cf34c(0x161)]}:{},'succeeded':_0x526941['succeeded']??[],'failed':_0x526941[_0x5cf34c(0x159)]??[],'warnings':_0x526941['warnings']??[],'verification':_0x526941[_0x5cf34c(0x15a)],'error':_0x526941[_0x5cf34c(0x177)]};}export function menuDryRunResult(_0x1c67f4,_0xd722eb){return{..._0x1c67f4,..._0xd722eb};}export function menuFailure(_0x4bb23b,_0x594b3e,_0x340477){const _0x5b378c=a179_0x4e7584,_0x44ded8=mutationResult({..._0x594b3e,'after':_0x340477[_0x5b378c(0x14d)]===undefined?_0x594b3e[_0x5b378c(0x14d)]:_0x340477[_0x5b378c(0x14d)],'backend':_0x340477[_0x5b378c(0x176)]??_0x594b3e[_0x5b378c(0x176)],'dryRun':![],'succeeded':_0x340477[_0x5b378c(0x17c)]??[],'failed':_0x340477[_0x5b378c(0x16c)]??[{..._0x340477[_0x5b378c(0x159)]??{},'stage':_0x340477[_0x5b378c(0x156)],'code':_0x4bb23b[_0x5b378c(0x18e)],'message':_0x4bb23b[_0x5b378c(0x1a5)]}],'warnings':[..._0x594b3e[_0x5b378c(0x193)],..._0x340477[_0x5b378c(0x193)]??[]],'verification':_0x340477[_0x5b378c(0x15a)],'error':{'code':_0x4bb23b[_0x5b378c(0x18e)],'message':_0x4bb23b['message'],..._0x4bb23b[_0x5b378c(0x189)]?{'hint':_0x4bb23b[_0x5b378c(0x189)]}:{}}});return Object['defineProperty'](_0x4bb23b,_0x5b378c(0x15b),{'value':_0x44ded8,'enumerable':!![],'configurable':!![]}),_0x4bb23b;}export function asVerificationError(_0x27150c,_0x5035fa){const _0x503c3f=a179_0x4e7584;if(_0x27150c instanceof CliError&&_0x27150c[_0x503c3f(0x18e)]==='menu_verification_failed')return _0x27150c;const _0x25150f=_0x27150c instanceof Error?_0x27150c[_0x503c3f(0x1a5)]:String(_0x27150c);return menuError(_0x503c3f(0x152),''+_0x5035fa+(_0x25150f?':\x20'+_0x25150f:''),_0x503c3f(0x15d));}export function describeMenuErrorCause(_0x4384ee,_0x171d1b,_0x398a5b){const _0x4fa61e=a179_0x4e7584,_0x2935fc=mapMenuApiError(_0x4384ee,_0x171d1b,_0x398a5b);return{'causeCode':_0x2935fc[_0x4fa61e(0x18e)],'causeMessage':_0x2935fc[_0x4fa61e(0x1a5)]};}export function hasFlag(_0x43ee4e,_0x3ef8ad){const _0x37789d=a179_0x4e7584;return Object[_0x37789d(0x162)][_0x37789d(0x1a8)][_0x37789d(0x184)](_0x43ee4e[_0x37789d(0x174)],_0x3ef8ad)&&_0x43ee4e[_0x37789d(0x174)][_0x3ef8ad]!==undefined;}export function toApiParentId(_0x136bc3){return _0x136bc3??0x0;}export function formatParent(_0x295f05){const _0x57cd83=a179_0x4e7584;return _0x295f05==null?_0x57cd83(0x1a3):String(_0x295f05);}export function menuError(_0x37949e,_0x430091,_0x50fa8e){return new CliError(_0x37949e,0x1,_0x430091,_0x50fa8e);}export function mapMenuApiError(_0x2af8e7,_0x43601a,_0x545659){const _0x1f5db7=a179_0x4e7584;if(_0x2af8e7 instanceof CliError&&_0x2af8e7[_0x1f5db7(0x18e)]!==_0x1f5db7(0x188))return _0x2af8e7;const _0x1666d9=_0x2af8e7 instanceof Error?_0x2af8e7[_0x1f5db7(0x1a5)]:String(_0x2af8e7);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x1f5db7(0x178)](_0x1666d9))return menuError('menu_permission_denied',_0x1f5db7(0x171)+_0x43601a+(_0x545659?_0x1f5db7(0x199)+_0x545659:'')+'.',_0x1f5db7(0x140));return menuError(_0x1f5db7(0x181),_0x1f5db7(0x169)+_0x43601a+(_0x545659?_0x1f5db7(0x199)+_0x545659:'')+':\x20'+_0x1666d9,_0x1f5db7(0x15e));}export function isMenuResponseLoss(_0x5d4d9f){const _0xeab5db=a179_0x4e7584,_0x2fe1b4=_0x5d4d9f instanceof Error?_0x5d4d9f['message']:String(_0x5d4d9f);if(_0x5d4d9f instanceof CliError)return _0x5d4d9f['code']===_0xeab5db(0x188)&&/^Request (?:failed|timeout):/i['test'](_0x2fe1b4);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i['test'](_0x2fe1b4);}function stateDrift(_0x13f0d2){const _0x5496da=a179_0x4e7584;return menuError(_0x5496da(0x18a),_0x13f0d2,_0x5496da(0x15f));}function a179_0x181f(){const _0x2d70b5=['menu_confirmation_required','\x20menu\x20','Menu\x20','folder','519064vGvaBg','1203550jPfaaJ','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','Sibling\x20sort\x20value\x20(non-negative\x20integer)','cascade','parentId','selector','root','type','message','deleteOrder','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','hasOwnProperty','validation','cookie','bool','4EhytyM','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','\x22,\x20not\x20folder.','max','968noDxcE','Online\x20menu\x20not\x20found:\x20','toLowerCase','num','string','stringify','expected-children-count','menu_parent_not_folder','442563LQrJnN','Reorder\x20sibling\x20menus\x20below\x20','after','Cannot\x20append\x20a\x20','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','menu_sort_overflow','2399866Hyivdi','menu_verification_failed','childrenCount','\x20child\x20count\x20changed:\x20expected\x20','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','stage','byId','yes','failed','verification','data','trim','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','planFile','prototype','dryRun',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','hash','expect-path','expect-parent-id','Failed\x20to\x20','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','filter','failedRecords','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','\x20parent\x20changed:\x20expected\x20','isSafeInteger','Exact\x20online\x20menu\x20id','Permission\x20denied\x20while\x20attempting\x20to\x20','1291765SyhXNy','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','rawFlags','sort','backend','error','test','127350CZJjnZ','operation','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','succeeded','path','snapshotHash','3452070BhBRsz','menu_not_found','menu_mutation_failed','str','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','call','plannedActions','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','unknown','api_error','hint','menu_state_drift','parent-id',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','code',',\x20current\x20','before','number','targets','warnings','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','required','recheck\x20online\x20menu\x20facts\x20before\x20','pre-write-recheck'];a179_0x181f=function(){return _0x2d70b5;};return a179_0x181f();}
|
|
1
|
+
const a180_0x5c1eee=a180_0x3585;(function(_0x29b498,_0x54f4cf){const _0xcf044c=a180_0x3585,_0x231c65=_0x29b498();while(!![]){try{const _0x5e7c72=parseInt(_0xcf044c(0x1ac))/0x1*(-parseInt(_0xcf044c(0x1ef))/0x2)+-parseInt(_0xcf044c(0x1c7))/0x3+-parseInt(_0xcf044c(0x1b1))/0x4*(parseInt(_0xcf044c(0x1f2))/0x5)+parseInt(_0xcf044c(0x1f0))/0x6*(parseInt(_0xcf044c(0x1d2))/0x7)+parseInt(_0xcf044c(0x19c))/0x8*(-parseInt(_0xcf044c(0x1d8))/0x9)+parseInt(_0xcf044c(0x1ca))/0xa+parseInt(_0xcf044c(0x1bb))/0xb;if(_0x5e7c72===_0x54f4cf)break;else _0x231c65['push'](_0x231c65['shift']());}catch(_0x145c10){_0x231c65['push'](_0x231c65['shift']());}}}(a180_0x2de0,0x5426d));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':a180_0x5c1eee(0x1bc),'required':!![],'description':a180_0x5c1eee(0x1df)};export const MENU_SORT_FLAG={'name':'sort','type':a180_0x5c1eee(0x1bc),'description':a180_0x5c1eee(0x1e5)};export const MENU_PARENT_ID_FLAG={'name':a180_0x5c1eee(0x1db),'type':a180_0x5c1eee(0x1d1),'description':a180_0x5c1eee(0x1b9)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a180_0x5c1eee(0x1a8),'type':'string','description':a180_0x5c1eee(0x192)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a180_0x5c1eee(0x194),'type':'string','description':a180_0x5c1eee(0x18b)},{'name':a180_0x5c1eee(0x1b3),'type':a180_0x5c1eee(0x1bc),'description':'Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches'}];export function validateExactId(_0x4b0486){const _0x3e1cfb=a180_0x5c1eee,_0x247e74=_0x4b0486[_0x3e1cfb(0x1a9)]('id');if(!Number['isSafeInteger'](_0x247e74)||_0x247e74<=0x0)throw CliErrors[_0x3e1cfb(0x188)](_0x3e1cfb(0x1e7));return _0x247e74;}export function validateSort(_0xbf6149,_0x531fa0=a180_0x5c1eee(0x1f3)){const _0x43d7a6=a180_0x5c1eee;if(!hasFlag(_0xbf6149,_0x531fa0))return undefined;const _0x503775=_0xbf6149[_0x43d7a6(0x1a9)](_0x531fa0);if(!Number[_0x43d7a6(0x1d9)](_0x503775)||_0x503775<0x0||_0x503775>MAX_MENU_SORT)throw menuError('menu_sort_invalid','--'+_0x531fa0+_0x43d7a6(0x18d)+MAX_MENU_SORT+'.',_0x43d7a6(0x19e));return _0x503775;}function a180_0x2de0(){const _0x2d83a7=['str','hint','test','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','cookie','1887093aUIjhk','isSafeInteger','call','parent-id','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','Online\x20menu\x20not\x20found:\x20','Exact\x20online\x20menu\x20id','\x20is\x20type\x20\x22','toLowerCase','unknown','root','plannedActions','Sibling\x20sort\x20value\x20(non-negative\x20integer)','stringify','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','hasOwnProperty','Menu\x20','folder','operation','menu_not_found','dry-run','bool','387956csGqoC','1824KCBBJt','failed','1312935wfeeTX','sort','failedRecords','warnings','trim','validation','rawFlags','verification','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','\x20child\x20count\x20changed:\x20expected\x20','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','Cannot\x20append\x20a\x20','succeeded','backend','yes','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','message','expect-path','type','Reorder\x20sibling\x20menus\x20below\x20','selector',',\x20current\x20','\x20parent\x20changed:\x20expected\x20','api_error','stage','16SqaOuU','menu_permission_denied','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','length','\x20menu\x20','menu_parent_not_folder','deleteOrder','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','flagMissing','after','error','planFile','expect-parent-id','num','appCode','defineProperty','2UOMONi','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','menu_verification_failed','\x22,\x20not\x20folder.','path','4YxLvfs','parentId','expected-children-count','childrenCount','Failed\x20to\x20',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','prototype','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','11307439RGuRrn','number','map','targets','code','hash','pre-write-recheck','menu_mutation_failed','dryRun','menu_sort_overflow','max','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','840732ugTFTZ','data','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','5677730fnFIOb','cascade','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','snapshotHash','Permission\x20denied\x20while\x20attempting\x20to\x20','before','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','string','2282vAvfpj'];a180_0x2de0=function(){return _0x2d83a7;};return a180_0x2de0();}export function nextSiblingSort(_0x3594fe,_0x37aabc,_0x2ddc77){const _0xa7c76b=a180_0x5c1eee,_0xe5398c=getChildren(_0x3594fe,_0x37aabc)[_0xa7c76b(0x1bd)](_0x222818=>_0x222818['sort'])['filter'](_0x2710cb=>typeof _0x2710cb===_0xa7c76b(0x1bc));if(_0xe5398c[_0xa7c76b(0x19f)]===0x0)return 0x0;const _0x412b7c=Math[_0xa7c76b(0x1c5)](..._0xe5398c);if(_0x412b7c>=MAX_MENU_SORT)throw menuError(_0xa7c76b(0x1c4),_0xa7c76b(0x18e)+_0x2ddc77+_0xa7c76b(0x1c6)+_0x412b7c+'.',_0xa7c76b(0x196)+MAX_MENU_SORT+_0xa7c76b(0x1b6));return _0x412b7c+0x1;}export function requireExplicitYes(_0x3e3b81){const _0x14ecb4=a180_0x5c1eee;if(_0x3e3b81[_0x14ecb4(0x1ee)](_0x14ecb4(0x1ed)))return;if(!_0x3e3b81[_0x14ecb4(0x1ee)](_0x14ecb4(0x191)))throw menuError('menu_confirmation_required',_0x14ecb4(0x1b7),_0x14ecb4(0x1d0));}export async function fetchMutationSnapshot(_0x5bbc2d,_0x211af2,_0x4c8e6a){const _0x409ef5=a180_0x5c1eee;try{return await fetchMenuSnapshot(_0x5bbc2d[_0x409ef5(0x1aa)],_0x5bbc2d[_0x409ef5(0x1d7)]);}catch(_0x5e0e78){throw mapMenuApiError(_0x5e0e78,'read\x20online\x20menu\x20facts\x20before\x20'+_0x211af2,_0x4c8e6a);}}export async function recheckMutationSnapshot(_0x2072da,_0x2f77e9,_0x2c654c,_0x2abdfc){const _0x1a7e0e=a180_0x5c1eee;let _0x2a73fc;try{_0x2a73fc=await fetchMenuSnapshot(_0x2072da[_0x1a7e0e(0x1aa)],_0x2072da[_0x1a7e0e(0x1d7)]);}catch(_0x21c482){const _0x5368f8=mapMenuApiError(_0x21c482,'recheck\x20online\x20menu\x20facts\x20before\x20'+_0x2c654c,_0x2abdfc);throw menuFailure(_0x5368f8,_0x2f77e9,{'stage':_0x1a7e0e(0x1c1),'failed':_0x2abdfc==null?{}:{'id':_0x2abdfc}});}if(_0x2a73fc[_0x1a7e0e(0x1c0)]!==_0x2f77e9[_0x1a7e0e(0x1cd)]){const _0x3dc420=menuError('menu_state_drift','Online\x20menu\x20state\x20changed\x20before\x20'+_0x2c654c+';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.',_0x1a7e0e(0x1a3));throw menuFailure(_0x3dc420,_0x2f77e9,{'stage':_0x1a7e0e(0x1c1),'failed':{..._0x2abdfc==null?{}:{'id':_0x2abdfc},'expectedSnapshotHash':_0x2f77e9['snapshotHash'],'currentSnapshotHash':_0x2a73fc[_0x1a7e0e(0x1c0)]}});}return _0x2a73fc;}export function parseParentId(_0x2a2fbf,_0x7e4e41,_0x22df26={}){const _0x37e62f=a180_0x5c1eee;if(!hasFlag(_0x2a2fbf,_0x7e4e41)){if(_0x22df26['required'])throw CliErrors[_0x37e62f(0x1a4)](_0x7e4e41);return undefined;}const _0x47ed47=_0x2a2fbf[_0x37e62f(0x1d3)](_0x7e4e41)[_0x37e62f(0x187)]();if(_0x47ed47[_0x37e62f(0x1e1)]()===_0x37e62f(0x1e3))return null;if(!/^\d+$/['test'](_0x47ed47))throw CliErrors[_0x37e62f(0x188)]('--'+_0x7e4e41+_0x37e62f(0x1cc));const _0x3bce43=Number(_0x47ed47);if(!Number[_0x37e62f(0x1d9)](_0x3bce43)||_0x3bce43<=0x0)throw CliErrors[_0x37e62f(0x188)]('--'+_0x7e4e41+_0x37e62f(0x1cc));return _0x3bce43;}export function requireMenu(_0x405aaa,_0x27976f){const _0x4444ca=a180_0x5c1eee,_0x41b611=_0x405aaa['byId']['get'](_0x27976f);if(!_0x41b611)throw menuError(_0x4444ca(0x1ec),_0x4444ca(0x1de)+_0x27976f,_0x4444ca(0x1c9));return _0x41b611;}export function requireFolder(_0x299e92,_0x539aaf){const _0x4ed3df=a180_0x5c1eee,_0xbaa16c=requireMenu(_0x299e92,_0x539aaf);if(_0xbaa16c[_0x4ed3df(0x195)]!==_0x4ed3df(0x1ea))throw menuError(_0x4ed3df(0x1a1),_0x4ed3df(0x1e9)+_0x539aaf+_0x4ed3df(0x1e0)+(_0xbaa16c[_0x4ed3df(0x195)]||_0x4ed3df(0x1e2))+_0x4ed3df(0x1af),_0x4ed3df(0x1ba));return _0xbaa16c;}export function assertExpectedState(_0x239d44,_0xd3414e){const _0x58627d=a180_0x5c1eee;if(hasFlag(_0x239d44,'expect-parent-id')){const _0x1fcbf1=parseParentId(_0x239d44,_0x58627d(0x1a8),{'required':!![]});if(_0xd3414e[_0x58627d(0x1b2)]!==_0x1fcbf1)throw stateDrift(_0x58627d(0x1e9)+_0xd3414e['id']+_0x58627d(0x199)+formatParent(_0x1fcbf1)+_0x58627d(0x198)+formatParent(_0xd3414e[_0x58627d(0x1b2)])+'.');}if(hasFlag(_0x239d44,_0x58627d(0x194))){const _0x251cc8=_0x239d44['str'](_0x58627d(0x194));if(_0xd3414e[_0x58627d(0x1b0)]!==_0x251cc8)throw stateDrift(_0x58627d(0x1e9)+_0xd3414e['id']+'\x20path\x20changed:\x20expected\x20'+JSON['stringify'](_0x251cc8)+',\x20current\x20'+JSON[_0x58627d(0x1e6)](_0xd3414e[_0x58627d(0x1b0)])+'.');}if(hasFlag(_0x239d44,_0x58627d(0x1b3))){const _0x4bc756=_0x239d44[_0x58627d(0x1a9)](_0x58627d(0x1b3));if(!Number[_0x58627d(0x1d9)](_0x4bc756)||_0x4bc756<0x0)throw CliErrors[_0x58627d(0x188)](_0x58627d(0x1dd));if(_0xd3414e[_0x58627d(0x1b4)]!==_0x4bc756)throw stateDrift(_0x58627d(0x1e9)+_0xd3414e['id']+_0x58627d(0x18c)+_0x4bc756+_0x58627d(0x198)+_0xd3414e[_0x58627d(0x1b4)]+'.');}}export function assertVerified(_0x5db0af,_0x27eb34,_0x1b430d='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){const _0x3021dc=a180_0x5c1eee;if(!_0x5db0af)throw menuError(_0x3021dc(0x1ae),_0x27eb34,_0x1b430d);}function a180_0x3585(_0x2921d9,_0x3820ec){_0x2921d9=_0x2921d9-0x186;const _0x2de0a6=a180_0x2de0();let _0x3585b0=_0x2de0a6[_0x2921d9];return _0x3585b0;}export function mutationResult(_0x1eeba0){const _0x27d9cc=a180_0x5c1eee;return{'operation':_0x1eeba0[_0x27d9cc(0x1eb)],'selector':_0x1eeba0[_0x27d9cc(0x197)],'before':_0x1eeba0[_0x27d9cc(0x1cf)],'after':_0x1eeba0[_0x27d9cc(0x1a5)],'dryRun':_0x1eeba0[_0x27d9cc(0x1c3)],'backend':_0x1eeba0[_0x27d9cc(0x190)],..._0x1eeba0[_0x27d9cc(0x1e4)]?{'plannedActions':_0x1eeba0[_0x27d9cc(0x1e4)]}:{},..._0x1eeba0['targets']?{'targets':_0x1eeba0[_0x27d9cc(0x1be)]}:{},..._0x1eeba0[_0x27d9cc(0x1a2)]?{'deleteOrder':_0x1eeba0[_0x27d9cc(0x1a2)]}:{},'snapshotHash':_0x1eeba0[_0x27d9cc(0x1cd)],..._0x1eeba0[_0x27d9cc(0x1cb)]?{'cascade':_0x1eeba0[_0x27d9cc(0x1cb)]}:{},..._0x1eeba0['planFile']?{'planFile':_0x1eeba0[_0x27d9cc(0x1a7)]}:{},'succeeded':_0x1eeba0['succeeded']??[],'failed':_0x1eeba0[_0x27d9cc(0x1f1)]??[],'warnings':_0x1eeba0[_0x27d9cc(0x186)]??[],'verification':_0x1eeba0[_0x27d9cc(0x18a)],'error':_0x1eeba0[_0x27d9cc(0x1a6)]};}export function menuDryRunResult(_0x3734dc,_0x4efe44){return{..._0x3734dc,..._0x4efe44};}export function menuFailure(_0x41b92b,_0x32a6e3,_0x5304f8){const _0x2b0d01=a180_0x5c1eee,_0x465000=mutationResult({..._0x32a6e3,'after':_0x5304f8['after']===undefined?_0x32a6e3[_0x2b0d01(0x1a5)]:_0x5304f8[_0x2b0d01(0x1a5)],'backend':_0x5304f8['backend']??_0x32a6e3['backend'],'dryRun':![],'succeeded':_0x5304f8[_0x2b0d01(0x18f)]??[],'failed':_0x5304f8[_0x2b0d01(0x1f4)]??[{..._0x5304f8[_0x2b0d01(0x1f1)]??{},'stage':_0x5304f8[_0x2b0d01(0x19b)],'code':_0x41b92b[_0x2b0d01(0x1bf)],'message':_0x41b92b[_0x2b0d01(0x193)]}],'warnings':[..._0x32a6e3[_0x2b0d01(0x186)],..._0x5304f8[_0x2b0d01(0x186)]??[]],'verification':_0x5304f8[_0x2b0d01(0x18a)],'error':{'code':_0x41b92b[_0x2b0d01(0x1bf)],'message':_0x41b92b['message'],..._0x41b92b['hint']?{'hint':_0x41b92b[_0x2b0d01(0x1d4)]}:{}}});return Object[_0x2b0d01(0x1ab)](_0x41b92b,_0x2b0d01(0x1c8),{'value':_0x465000,'enumerable':!![],'configurable':!![]}),_0x41b92b;}export function asVerificationError(_0x3c7e8c,_0x4d6772){const _0x3dd212=a180_0x5c1eee;if(_0x3c7e8c instanceof CliError&&_0x3c7e8c[_0x3dd212(0x1bf)]==='menu_verification_failed')return _0x3c7e8c;const _0x4d3b6a=_0x3c7e8c instanceof Error?_0x3c7e8c['message']:String(_0x3c7e8c);return menuError(_0x3dd212(0x1ae),''+_0x4d6772+(_0x4d3b6a?':\x20'+_0x4d3b6a:''),_0x3dd212(0x1dc));}export function describeMenuErrorCause(_0x590546,_0x273997,_0x28f35f){const _0x102e5f=a180_0x5c1eee,_0x238ee2=mapMenuApiError(_0x590546,_0x273997,_0x28f35f);return{'causeCode':_0x238ee2[_0x102e5f(0x1bf)],'causeMessage':_0x238ee2[_0x102e5f(0x193)]};}export function hasFlag(_0x478b49,_0x15bc0d){const _0x16baac=a180_0x5c1eee;return Object[_0x16baac(0x1b8)][_0x16baac(0x1e8)][_0x16baac(0x1da)](_0x478b49[_0x16baac(0x189)],_0x15bc0d)&&_0x478b49[_0x16baac(0x189)][_0x15bc0d]!==undefined;}export function toApiParentId(_0x58ec75){return _0x58ec75??0x0;}export function formatParent(_0x434171){const _0x225ba7=a180_0x5c1eee;return _0x434171==null?_0x225ba7(0x1e3):String(_0x434171);}export function menuError(_0x11acba,_0x43663b,_0xc2e3f){return new CliError(_0x11acba,0x1,_0x43663b,_0xc2e3f);}export function mapMenuApiError(_0x3d0d8c,_0x481a31,_0x565614){const _0x12b9c1=a180_0x5c1eee;if(_0x3d0d8c instanceof CliError&&_0x3d0d8c[_0x12b9c1(0x1bf)]!==_0x12b9c1(0x19a))return _0x3d0d8c;const _0x2b5f40=_0x3d0d8c instanceof Error?_0x3d0d8c[_0x12b9c1(0x193)]:String(_0x3d0d8c);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x12b9c1(0x1d5)](_0x2b5f40))return menuError(_0x12b9c1(0x19d),_0x12b9c1(0x1ce)+_0x481a31+(_0x565614?_0x12b9c1(0x1a0)+_0x565614:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x12b9c1(0x1c2),_0x12b9c1(0x1b5)+_0x481a31+(_0x565614?_0x12b9c1(0x1a0)+_0x565614:'')+':\x20'+_0x2b5f40,_0x12b9c1(0x1ad));}export function isMenuResponseLoss(_0x8330cd){const _0x2e2337=a180_0x5c1eee,_0xbc6ae0=_0x8330cd instanceof Error?_0x8330cd[_0x2e2337(0x193)]:String(_0x8330cd);if(_0x8330cd instanceof CliError)return _0x8330cd[_0x2e2337(0x1bf)]===_0x2e2337(0x19a)&&/^Request (?:failed|timeout):/i[_0x2e2337(0x1d5)](_0xbc6ae0);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i['test'](_0xbc6ae0);}function stateDrift(_0x4a2947){const _0x5cade9=a180_0x5c1eee;return menuError('menu_state_drift',_0x4a2947,_0x5cade9(0x1d6));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1c5c5b,_0x397ac4){const _0x53a80e=a181_0x27a4,_0x44526d=_0x1c5c5b();while(!![]){try{const _0x4e0228=-parseInt(_0x53a80e(0x1ea))/0x1*(parseInt(_0x53a80e(0x1e1))/0x2)+parseInt(_0x53a80e(0x1df))/0x3+parseInt(_0x53a80e(0x1e8))/0x4*(parseInt(_0x53a80e(0x1e9))/0x5)+-parseInt(_0x53a80e(0x1e7))/0x6*(parseInt(_0x53a80e(0x1ec))/0x7)+-parseInt(_0x53a80e(0x1e6))/0x8*(-parseInt(_0x53a80e(0x1eb))/0x9)+-parseInt(_0x53a80e(0x1e5))/0xa*(-parseInt(_0x53a80e(0x1e3))/0xb)+-parseInt(_0x53a80e(0x1e0))/0xc*(parseInt(_0x53a80e(0x1e2))/0xd);if(_0x4e0228===_0x397ac4)break;else _0x44526d['push'](_0x44526d['shift']());}catch(_0x101470){_0x44526d['push'](_0x44526d['shift']());}}}(a181_0x16ed,0xc333f));function a181_0x16ed(){const _0x2c6615=['5079370LcVlFY','16jLPHjB','9tZvptC','2588754PQmIRy','4694244EtglED','1405596FyTfCW','149066GbfrIH','52BQqPHH','2101TtdhJD','replace','34130QqJkZi','2700576OkvNzQ','18PRzHmR','4QDHYEH'];a181_0x16ed=function(){return _0x2c6615;};return a181_0x16ed();}function a181_0x27a4(_0xecf295,_0x52de11){_0xecf295=_0xecf295-0x1df;const _0x16ed5c=a181_0x16ed();let _0x27a499=_0x16ed5c[_0xecf295];return _0x27a499;}export function menuPathKey(_0x193859){const _0x3078f7=a181_0x27a4,_0x46cf82=_0x193859['trim']();if(!_0x46cf82)return'';return _0x46cf82[_0x3078f7(0x1e4)](/^\/+/,'')[_0x3078f7(0x1e4)](/\/+$/,'')||'/';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xaa7610,_0x31f3bf){const _0x21d0fe=a182_0xab79,_0x25b33d=_0xaa7610();while(!![]){try{const _0x22d086=-parseInt(_0x21d0fe(0x1a3))/0x1*(parseInt(_0x21d0fe(0x19e))/0x2)+-parseInt(_0x21d0fe(0x1a7))/0x3*(-parseInt(_0x21d0fe(0x192))/0x4)+-parseInt(_0x21d0fe(0x196))/0x5*(-parseInt(_0x21d0fe(0x1b7))/0x6)+parseInt(_0x21d0fe(0x1b2))/0x7+parseInt(_0x21d0fe(0x1a9))/0x8+parseInt(_0x21d0fe(0x1c3))/0x9*(-parseInt(_0x21d0fe(0x1c5))/0xa)+parseInt(_0x21d0fe(0x1c2))/0xb*(-parseInt(_0x21d0fe(0x1bc))/0xc);if(_0x22d086===_0x31f3bf)break;else _0x25b33d['push'](_0x25b33d['shift']());}catch(_0x32132a){_0x25b33d['push'](_0x25b33d['shift']());}}}(a182_0x32c3,0xbee9d));function a182_0x32c3(){const _0x1bb6bc=['loadScriptMode','21255chkwMO','Menu\x20assets\x20synced:\x20','boolean','\x20menu\x20group(s)','parentId','update-menu-cdn-url','Create\x20menu\x20\x22','Fetched\x20','10jMtfeY','Updating\x20menu\x20asset\x20links:\x20','appName','resources','path','238947MqWSPB','menus','Menu\x20created\x20successfully:\x20','Creating\x20menu:\x20','60fvYNOU','\x20menu','10527184YwMlXr','procode','Delete\x20','\x20online\x20menus\x20successfully','Update\x20menu\x20assets\x20\x22','total','Update\x20menu\x20','Start\x20batch\x20menu\x20creation,\x20total\x20','number','4711476DjzPOi','menuGroups','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','length','all','714NDxGOf','info','create-menus','import','visible','11352JkCurk','map','order','get-online-menu-list','stringify','create-menu','3685VnQLeE','9eKNicc','extend','9372490zwmqob','Batch\x20menu\x20creation\x20completed,\x20total\x20','147208HrrLfR','label','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'];a182_0x32c3=function(){return _0x1bb6bc;};return a182_0x32c3();}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 a182_0x310721,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x479c81,_0x42f38c){const _0x1ae88d=a182_0xab79,_0x4614ca=getEnv();logger[_0x1ae88d(0x1b8)](_0x1ae88d(0x1bf),isProduction(_0x4614ca)?_0x1ae88d(0x194)+_0x479c81+')':_0x1ae88d(0x1b4)+_0x479c81+')');const _0x5bb927=await fetchMenuSnapshot(_0x479c81,_0x42f38c,{'verbose':!![]});return logger['info']('get-online-menu-list',_0x1ae88d(0x19d)+_0x5bb927[_0x1ae88d(0x1ae)]+_0x1ae88d(0x1ac)),_0x5bb927[_0x1ae88d(0x1a4)][_0x1ae88d(0x1bd)](toProcessedMenuItem);}export async function createMenu(_0x40e721,_0x13d90e,_0x4b6849){const _0x21229b=a182_0xab79;logger[_0x21229b(0x1b8)](_0x21229b(0x1c1),_0x21229b(0x1a6)+_0x4b6849[_0x21229b(0x193)]+'\x20('+_0x4b6849[_0x21229b(0x1a2)]+')');const _0x237903={'appCode':_0x40e721,'type':_0x21229b(0x1aa),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x4b6849['resources']?JSON['stringify'](_0x4b6849[_0x21229b(0x1a1)]):undefined},..._0x4b6849},_0x1478bf=await createMenuRecord(_0x237903,_0x13d90e,_0x21229b(0x19c)+_0x4b6849[_0x21229b(0x193)]+'\x22');return logger['info'](_0x21229b(0x1c1),_0x21229b(0x1a5)+_0x4b6849[_0x21229b(0x193)]),_0x1478bf;}async function createSingleMenu(_0x15f8b3,_0x32b89b,_0x42cd61,_0x400428,_0x2856ae){const _0x427f2d=a182_0xab79,_0x1290be={'appCode':_0x15f8b3,'type':_0x427f2d(0x1aa),'sort':'order'in _0x42cd61&&typeof _0x42cd61[_0x427f2d(0x1be)]===_0x427f2d(0x1b1)?_0x42cd61[_0x427f2d(0x1be)]:0x0,..._0x427f2d(0x1bb)in _0x42cd61&&typeof _0x42cd61['visible']===_0x427f2d(0x198)?{'visible':_0x42cd61['visible']}:{},...'parentId'in _0x42cd61&&typeof _0x42cd61[_0x427f2d(0x19a)]===_0x427f2d(0x1b1)?{'parentId':_0x42cd61['parentId']}:{},'extend':{..._0x2856ae?.[_0x427f2d(0x1a0)]?{'appName':_0x2856ae['appName']}:{},'loadScriptMode':_0x427f2d(0x1ba),'resources':_0x400428?JSON[_0x427f2d(0x1c0)](_0x400428):undefined},'label':_0x42cd61[_0x427f2d(0x193)],'path':_0x42cd61[_0x427f2d(0x1a2)]},_0x23b384=await createMenuRecord(_0x1290be,_0x32b89b,_0x427f2d(0x19c)+_0x42cd61[_0x427f2d(0x193)]+'\x22');return logger[_0x427f2d(0x1b8)](_0x427f2d(0x1c1),_0x427f2d(0x1a5)+_0x42cd61[_0x427f2d(0x193)]),_0x23b384;}export async function createMenus(_0x228044,_0x55eb6f,_0x27537e,_0x5ca350,_0x218948){const _0xd36d4=a182_0xab79;logger[_0xd36d4(0x1b8)](_0xd36d4(0x1b9),_0xd36d4(0x1b0)+_0x27537e[_0xd36d4(0x1b5)]);const _0x378d42=await Promise[_0xd36d4(0x1b6)](_0x27537e['map'](_0xfb73ec=>createSingleMenu(_0x228044,_0x55eb6f,_0xfb73ec,_0x5ca350,_0x218948)));return logger[_0xd36d4(0x1b8)](_0xd36d4(0x1b9),_0xd36d4(0x1c6)+_0x27537e[_0xd36d4(0x1b5)]),_0x378d42;}export async function updateMenuCdnUrl(_0x42a4a4,_0x51850e,_0x105e7a){const _0x5c7364=a182_0xab79;logger[_0x5c7364(0x1b8)](_0x5c7364(0x19b),_0x5c7364(0x19f)+_0x105e7a['label']+'\x20('+_0x105e7a[_0x5c7364(0x1a2)]+')');const _0x42eafe={'id':_0x105e7a['id'],'appCode':_0x42a4a4,'extend':{..._0x105e7a[_0x5c7364(0x1c4)]??{},..._0x105e7a['loadScriptMode']?{'loadScriptMode':_0x105e7a[_0x5c7364(0x195)]}:{},'resources':_0x105e7a[_0x5c7364(0x1a1)]?JSON[_0x5c7364(0x1c0)](_0x105e7a[_0x5c7364(0x1a1)]):undefined}},_0x56b226=await updateMenuRecord(_0x42eafe,_0x51850e,_0x5c7364(0x1ad)+_0x105e7a[_0x5c7364(0x193)]+'\x22');return logger[_0x5c7364(0x1b8)](_0x5c7364(0x19b),_0x5c7364(0x197)+_0x105e7a[_0x5c7364(0x193)],undefined),_0x56b226;}export async function createMenuEntity(_0x5b53b6,_0x59ab67,_0x1582db){const _0x4ef323=a182_0xab79;return createMenuRecord({'appCode':_0x5b53b6,..._0x1582db},_0x59ab67,_0x4ef323(0x19c)+_0x1582db[_0x4ef323(0x193)]+'\x22');}export async function updateMenuEntity(_0x277bec,_0x54e6bd,_0x32b101){const _0x252391=a182_0xab79;return updateMenuRecord({'appCode':_0x277bec,..._0x32b101},_0x54e6bd,_0x252391(0x1af)+_0x32b101['id']);}export async function batchDeleteMenuEntities(_0x836a40,_0x5e3e22){const _0x5a70e0=a182_0xab79;return batchDeleteMenuRecords(_0x5e3e22,_0x836a40,_0x5a70e0(0x1ab)+_0x5e3e22['length']+_0x5a70e0(0x1a8)+(_0x5e3e22[_0x5a70e0(0x1b5)]===0x1?'':'s'));}function a182_0xab79(_0x377efd,_0x56a826){_0x377efd=_0x377efd-0x192;const _0x32c309=a182_0x32c3();let _0xab79d1=_0x32c309[_0x377efd];return _0xab79d1;}export async function startMenuRegroup(_0x20fe72,_0x180a2e){const _0x5a6b64=a182_0xab79;return a182_0x310721(_0x180a2e,_0x20fe72,'Regroup\x20'+_0x180a2e[_0x5a6b64(0x1b3)][_0x5a6b64(0x1b5)]+_0x5a6b64(0x199));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a183_0x35f8(_0x17f694,_0x480527){_0x17f694=_0x17f694-0x167;const _0x5a0a26=a183_0x5a0a();let _0x35f83b=_0x5a0a26[_0x17f694];return _0x35f83b;}const a183_0x1efc09=a183_0x35f8;(function(_0x3f323a,_0xce8e1b){const _0x54bb43=a183_0x35f8,_0x591a03=_0x3f323a();while(!![]){try{const _0x2b2931=-parseInt(_0x54bb43(0x168))/0x1+-parseInt(_0x54bb43(0x185))/0x2+-parseInt(_0x54bb43(0x194))/0x3+-parseInt(_0x54bb43(0x175))/0x4+-parseInt(_0x54bb43(0x171))/0x5*(-parseInt(_0x54bb43(0x184))/0x6)+parseInt(_0x54bb43(0x18d))/0x7*(parseInt(_0x54bb43(0x18c))/0x8)+-parseInt(_0x54bb43(0x18a))/0x9*(-parseInt(_0x54bb43(0x189))/0xa);if(_0x2b2931===_0xce8e1b)break;else _0x591a03['push'](_0x591a03['shift']());}catch(_0x4f71de){_0x591a03['push'](_0x591a03['shift']());}}}(a183_0x5a0a,0x1ed8b));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{CliErrors}from'../../../errors.js';function objectValue(_0x4632ae,_0x4361ba){const _0xc9c9a5=a183_0x35f8,_0x3bb4f9=typeof _0x4632ae==='string'?parseJson(_0x4632ae,_0x4361ba):_0x4632ae;if(!_0x3bb4f9||typeof _0x3bb4f9!==_0xc9c9a5(0x192)||Array['isArray'](_0x3bb4f9))throw CliErrors['validation'](_0x4361ba+_0xc9c9a5(0x174));return _0x3bb4f9;}function parseJson(_0x560614,_0x579611){const _0x270fbd=a183_0x35f8;try{return JSON[_0x270fbd(0x17f)](_0x560614);}catch{throw CliErrors[_0x270fbd(0x191)](_0x579611+_0x270fbd(0x16b));}}function resourceList(_0x3f0e57,_0x1a8059){const _0x49b395=a183_0x35f8;if(typeof _0x3f0e57!=='string')throw CliErrors['validation'](_0x1a8059+_0x49b395(0x17b));const _0x236afa=parseJson(_0x3f0e57,_0x1a8059);if(!Array[_0x49b395(0x195)](_0x236afa)||_0x236afa[_0x49b395(0x18e)](_0x24efe4=>typeof _0x24efe4!=='string'))throw CliErrors[_0x49b395(0x191)](_0x1a8059+_0x49b395(0x187));return _0x236afa;}export function buildSubappAssetsStatus(_0x1de878,_0x1405e3,_0x30139a){const _0x23c35f=a183_0x35f8,_0x3a4b57=_0x1de878['extend']==null?{}:objectValue(_0x1de878[_0x23c35f(0x172)],_0x23c35f(0x193)),_0x2ac9a7=_0x3a4b57[_0x23c35f(0x17d)]==null?[]:typeof _0x3a4b57['assets']===_0x23c35f(0x186)?parseJson(_0x3a4b57['assets'],_0x23c35f(0x176)):_0x3a4b57['assets'];if(!Array[_0x23c35f(0x195)](_0x2ac9a7))throw CliErrors['validation'](_0x23c35f(0x179));const _0x555e74=_0x2ac9a7[_0x23c35f(0x17a)]((_0x3865bd,_0x41a898)=>objectValue(_0x3865bd,_0x23c35f(0x17c)+_0x41a898+']')),_0x1f4a76=_0x555e74[_0x23c35f(0x18b)](_0x9b0d5f=>_0x9b0d5f[_0x23c35f(0x167)]===_0x30139a);if(_0x1f4a76[_0x23c35f(0x18f)]>0x1)throw CliErrors[_0x23c35f(0x191)](_0x23c35f(0x16f)+_0x30139a+'.');const _0x43dc46=_0x1f4a76[0x0],_0x3064e5=_0x43dc46?.[_0x23c35f(0x17e)]==null?[]:resourceList(_0x43dc46[_0x23c35f(0x17e)],_0x23c35f(0x16a)),_0x5cfb0e=_0x1405e3[_0x23c35f(0x18b)](_0x4d139a=>_0x4d139a[_0x23c35f(0x172)]?.[_0x23c35f(0x167)]===_0x30139a),_0x2590bd=_0x5cfb0e[_0x23c35f(0x17a)](_0x16337c=>{const _0x1970c5=_0x23c35f;let _0x54f7ba=null,_0x50947f=null;try{_0x54f7ba=_0x16337c[_0x1970c5(0x172)]?.[_0x1970c5(0x17e)]==null?_0x16337c[_0x1970c5(0x17e)]:resourceList(_0x16337c[_0x1970c5(0x172)]['resources'],_0x1970c5(0x16e)+_0x16337c['id']+_0x1970c5(0x182));}catch(_0x5562a8){_0x50947f=_0x5562a8 instanceof Error?_0x5562a8['message']:String(_0x5562a8);}const _0x594ff6=_0x3064e5['length']>0x0?_0x1970c5(0x181):_0x1970c5(0x188),_0x3c9e55=_0x594ff6===_0x1970c5(0x181)?_0x3064e5:_0x54f7ba;return{'id':_0x16337c['id'],'path':_0x16337c['path'],'preferredSourceIfSupported':_0x594ff6,'preferredResourcesIfSupported':_0x3c9e55,'menuFallbackResources':_0x54f7ba,'menuFallbackError':_0x50947f,'fallbackDiffers':_0x54f7ba===null?null:_0x594ff6==='app'&&_0x54f7ba['length']>0x0&&JSON['stringify'](_0x54f7ba)!==JSON[_0x1970c5(0x190)](_0x3c9e55)};});return{'appName':_0x30139a,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x43dc46),'sharedResources':_0x3064e5,'loadScriptMode':_0x43dc46?.[_0x23c35f(0x169)]??null,'basename':_0x43dc46?.[_0x23c35f(0x16d)]??null,'boundMenus':_0x2590bd[_0x23c35f(0x18f)],'staleMenuFallbacks':_0x2590bd[_0x23c35f(0x18b)](_0x54d2af=>_0x54d2af['fallbackDiffers'])[_0x23c35f(0x18f)],'menus':_0x2590bd};}export async function assertSharedResourcesConfigured(_0x2e8e42,_0x187506,_0x2c1f2c){const _0x4d02ea=a183_0x35f8,_0x2a1fdd=await getSmartAppRecord(_0x2e8e42,_0x187506),_0x563ecd=buildSubappAssetsStatus(_0x2a1fdd,[],_0x2c1f2c);if(!_0x563ecd[_0x4d02ea(0x180)]||_0x563ecd['sharedResources'][_0x4d02ea(0x18f)]===0x0)throw CliErrors[_0x4d02ea(0x191)]('No\x20shared\x20resources\x20configured\x20for\x20'+_0x2c1f2c+'.');}function a183_0x5a0a(){const _0x39fda2=['resources','parse','sharedConfigured','app','\x20resources','Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','88512FbWYzU','83678sLsgNI','string','\x20must\x20be\x20an\x20array\x20of\x20URLs.','menu','5680330GGVrWO','9YuUUus','filter','15104CzPHmm','266QBmztg','some','length','stringify','validation','object','app.extend','668754UlJHCZ','isArray','appName','251582wIGYXw','loadScriptMode','subapp.resources','\x20contains\x20invalid\x20JSON.','app-name','basename','menu\x20','Duplicate\x20subapp\x20records\x20for\x20','trim','20Lpgdvc','extend','Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app','\x20must\x20be\x20a\x20JSON\x20object.','224396QtjUaw','app.extend.assets','appCode','str','app.extend.assets\x20must\x20be\x20an\x20array.','map','\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.','app.extend.assets[','assets'];a183_0x5a0a=function(){return _0x39fda2;};return a183_0x5a0a();}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':a183_0x1efc09(0x173)},{'name':a183_0x1efc09(0x16c),'type':a183_0x1efc09(0x186),'required':!![],'description':a183_0x1efc09(0x183)}];export function getSubappSelector(_0xfaef6d){const _0x1cd32e=a183_0x1efc09,_0x41cea1=_0xfaef6d[_0x1cd32e(0x177)],_0x46325c=_0xfaef6d[_0x1cd32e(0x178)](_0x1cd32e(0x16c))[_0x1cd32e(0x170)]();if(!_0x46325c)throw CliErrors[_0x1cd32e(0x191)]('--app-name\x20is\x20required.');return{'appCode':_0x41cea1,'appName':_0x46325c};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a183_0x142de5=a183_0x216b;(function(_0x5e1516,_0x3852a5){const _0x572e67=a183_0x216b,_0x40dc2f=_0x5e1516();while(!![]){try{const _0x3f3108=parseInt(_0x572e67(0x96))/0x1*(-parseInt(_0x572e67(0xb4))/0x2)+parseInt(_0x572e67(0x95))/0x3*(-parseInt(_0x572e67(0xaa))/0x4)+parseInt(_0x572e67(0x97))/0x5+parseInt(_0x572e67(0x92))/0x6+parseInt(_0x572e67(0xb2))/0x7*(parseInt(_0x572e67(0xa1))/0x8)+parseInt(_0x572e67(0x98))/0x9+-parseInt(_0x572e67(0x94))/0xa*(parseInt(_0x572e67(0x91))/0xb);if(_0x3f3108===_0x3852a5)break;else _0x40dc2f['push'](_0x40dc2f['shift']());}catch(_0x3b13e0){_0x40dc2f['push'](_0x40dc2f['shift']());}}}(a183_0x1131,0xbcaf3));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';function a183_0x1131(){const _0x396bc4=['Invalid\x20--params.','label','info','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','4TKpVnV','number','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','message','Menu\x20sync\x20completed','setLogPath','join','cssUrl','21zqGTtq','jsUrl','2cGTcdU','Invalid\x20--params:\x20','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','map','keys',';\x20found\x20','No\x20local\x20pages\x20matched\x20paths:\x20','string','Invalid\x20--params\x20JSON.','path','group','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','filter','\x22\x20for\x20','folder','\x0a\x20\x20Available\x20local\x20paths:\x20','has','get','Parent\x20','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','type','procode','visible','Expected\x20one\x20folder\x20named\x20\x22',':\x20expected\x20a\x20non-empty\x20string.','11qCqVZC','5116038tjpCqW','dryRun','11754740dOTfFk','32667tYDWMD','243228NQJyFf','3508535ydwxxq','5503509hUHKZS','length','trim','--params.','boolean','isInteger','parentId','appName','menu-sync','97496RhqQBb','CSS\x20URL\x20is\x20unreachable:\x20','push'];a183_0x1131=function(){return _0x396bc4;};return a183_0x1131();}const MENU_SYNC_PARAM_KEYS=new Set([a183_0x142de5(0xb3),a183_0x142de5(0xb1),a183_0x142de5(0x9f),'visible',a183_0x142de5(0x9e)]);export function resolvePage(_0x50d581,_0x4f8bd5,_0x94b8a5){const _0x2f8c51=a183_0x142de5;let _0x482fae=_0x4f8bd5[_0x2f8c51(0x9e)]??_0x50d581[_0x2f8c51(0x9e)];if(_0x482fae===undefined&&_0x50d581['group']){const _0x2dc5ba=_0x94b8a5[_0x2f8c51(0x84)](_0x219acd=>_0x219acd[_0x2f8c51(0x8c)]==='folder'&&_0x219acd[_0x2f8c51(0xa5)]===_0x50d581[_0x2f8c51(0xbe)]);if(_0x2dc5ba[_0x2f8c51(0x99)]!==0x1)throw new Error(_0x2f8c51(0x8f)+_0x50d581[_0x2f8c51(0xbe)]+_0x2f8c51(0x85)+_0x50d581[_0x2f8c51(0xbd)]+_0x2f8c51(0xb9)+_0x2dc5ba[_0x2f8c51(0x99)]);_0x482fae=_0x2dc5ba[0x0]['id'];}if(_0x482fae!==undefined&&_0x482fae!==0x0&&_0x94b8a5[_0x2f8c51(0x84)](_0x3fd111=>_0x3fd111['id']===_0x482fae&&_0x3fd111[_0x2f8c51(0x8c)]===_0x2f8c51(0x86))[_0x2f8c51(0x99)]!==0x1)throw new Error(_0x2f8c51(0x8a)+_0x482fae+'\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.');return{..._0x50d581,..._0x482fae===undefined?{}:{'parentId':_0x482fae},..._0x4f8bd5[_0x2f8c51(0x8e)]===undefined?{}:{'visible':_0x4f8bd5[_0x2f8c51(0x8e)]}};}function a183_0x216b(_0x36a0ad,_0x5d230e){_0x36a0ad=_0x36a0ad-0x84;const _0x113184=a183_0x1131();let _0x216b9a=_0x113184[_0x36a0ad];return _0x216b9a;}function validateParams(_0x48449d){const _0x2818e8=a183_0x142de5,_0x290234=[];return _0x48449d['jsUrl']&&!isValidJsHttpsUrl(_0x48449d[_0x2818e8(0xb3)])&&_0x290234[_0x2818e8(0xa3)]({'field':'jsUrl','message':_0x2818e8(0xa9)}),_0x48449d[_0x2818e8(0xb1)]&&!isValidCssHttpsUrl(_0x48449d[_0x2818e8(0xb1)])&&_0x290234[_0x2818e8(0xa3)]({'field':_0x2818e8(0xb1),'message':_0x2818e8(0xbf)}),_0x290234;}export async function runMenuSyncCore(_0x48d77,_0x1195f0,_0x45ddd2=[],_0x117be9,_0x5da19c={}){const _0x16f7dc=a183_0x142de5,_0x155a51=parseMenuSyncParams(_0x117be9),_0x3f673d=[...new Set(_0x45ddd2['map'](_0x2f6216=>_0x2f6216[_0x16f7dc(0x9a)]())[_0x16f7dc(0x84)](Boolean)['map'](menuPathKey))],_0x2c64c1=_0x155a51['jsUrl'],_0x345a00=_0x155a51[_0x16f7dc(0xb1)],_0x9dbb7e=[];if(_0x2c64c1)_0x9dbb7e[_0x16f7dc(0xa3)](_0x2c64c1);if(_0x345a00)_0x9dbb7e[_0x16f7dc(0xa3)](_0x345a00);const _0x511a20=validateParams(_0x155a51);if(_0x511a20[_0x16f7dc(0x99)]>0x0){const _0x24219a=_0x511a20[_0x16f7dc(0xb7)](_0x28c0b3=>_0x16f7dc(0x9b)+_0x28c0b3['field']+':\x20'+_0x28c0b3[_0x16f7dc(0xad)])[_0x16f7dc(0xb0)](';\x20');throw new Error(_0x16f7dc(0xb5)+_0x24219a);}logger[_0x16f7dc(0xaf)](process['cwd']()),logger[_0x16f7dc(0xa6)]('menu-sync','Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x48d77,'selectedCount':_0x3f673d['length'],'jsUrl':_0x2c64c1,'cssUrl':_0x345a00});if(_0x2c64c1){const _0x539329=await isUrlReachable(_0x2c64c1);if(!_0x539329)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x2c64c1);}if(_0x345a00){const _0x5c5601=await isUrlReachable(_0x345a00);if(!_0x5c5601)throw new Error(_0x16f7dc(0xa2)+_0x345a00);}const _0x1f8157=getLocalPages();if(_0x1f8157[_0x16f7dc(0x99)]===0x0){if(_0x3f673d['length']>0x0)throw new Error(_0x16f7dc(0xba)+_0x3f673d[_0x16f7dc(0xb0)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x5da19c[_0x16f7dc(0x93)]===!![],'targetPages':[],'plannedMenus':[]};}const _0xca3941=await getOnlineMenuList(_0x48d77,_0x1195f0),_0x19ed8b=new Set(_0xca3941[_0x16f7dc(0xb7)](_0x1c81a8=>menuPathKey(_0x1c81a8[_0x16f7dc(0xbd)])));let _0x2e9a0a;if(_0x3f673d[_0x16f7dc(0x99)]>0x0){const _0x441610=new Map(_0x1f8157[_0x16f7dc(0xb7)](_0x3f8972=>[menuPathKey(_0x3f8972['path']),_0x3f8972])),_0x150f4c=_0x3f673d[_0x16f7dc(0x84)](_0x18a39c=>!_0x441610['has'](_0x18a39c));if(_0x150f4c[_0x16f7dc(0x99)]>0x0){const _0x3d8372=_0x1f8157[_0x16f7dc(0xb7)](_0x23eb36=>_0x23eb36[_0x16f7dc(0xbd)])['join'](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x150f4c[_0x16f7dc(0xb0)](',\x20')+_0x16f7dc(0x87)+_0x3d8372);}const _0x3e923d=_0x3f673d[_0x16f7dc(0x84)](_0xe7693e=>_0x19ed8b[_0x16f7dc(0x88)](_0xe7693e));if(_0x3e923d[_0x16f7dc(0x99)]>0x0)throw new Error(_0x16f7dc(0xac)+_0x3e923d[_0x16f7dc(0xb0)](',\x20'));_0x2e9a0a=_0x3f673d['map'](_0x55751b=>_0x441610[_0x16f7dc(0x89)](_0x55751b));}else _0x2e9a0a=_0x1f8157['filter'](_0x30a364=>!_0x19ed8b[_0x16f7dc(0x88)](menuPathKey(_0x30a364[_0x16f7dc(0xbd)])));if(_0x2e9a0a[_0x16f7dc(0x99)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x5da19c['dryRun']===!![],'targetPages':[],'plannedMenus':[]};_0x2e9a0a=_0x2e9a0a[_0x16f7dc(0xb7)](_0x470ef9=>resolvePage(_0x470ef9,_0x155a51,_0xca3941));_0x155a51[_0x16f7dc(0x9f)]&&_0x9dbb7e['length']===0x0&&await assertSharedResourcesConfigured(_0x48d77,_0x1195f0,_0x155a51[_0x16f7dc(0x9f)]);const _0x2f6f65=_0x2e9a0a['map'](_0x4e8d19=>({'type':_0x16f7dc(0x8d),'path':_0x4e8d19[_0x16f7dc(0xbd)],'label':_0x4e8d19[_0x16f7dc(0xa5)],'loadScriptMode':'import','resources':[..._0x9dbb7e],..._0x4e8d19[_0x16f7dc(0x8e)]===undefined?{}:{'visible':_0x4e8d19['visible']},..._0x4e8d19[_0x16f7dc(0x9e)]===undefined?{}:{'parentId':_0x4e8d19[_0x16f7dc(0x9e)]},..._0x4e8d19['order']===undefined?{}:{'sort':_0x4e8d19['order']},..._0x155a51[_0x16f7dc(0x9f)]===undefined?{}:{'appName':_0x155a51[_0x16f7dc(0x9f)]}}));if(_0x5da19c[_0x16f7dc(0x93)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x2e9a0a,'plannedMenus':_0x2f6f65};const _0x5dd7ee=_0x155a51[_0x16f7dc(0x9f)]?await createMenus(_0x48d77,_0x1195f0,_0x2e9a0a,_0x9dbb7e[_0x16f7dc(0x99)]>0x0?_0x9dbb7e:undefined,{'appName':_0x155a51['appName']}):await createMenus(_0x48d77,_0x1195f0,_0x2e9a0a,_0x9dbb7e[_0x16f7dc(0x99)]>0x0?_0x9dbb7e:undefined);return logger[_0x16f7dc(0xa6)](_0x16f7dc(0xa0),_0x16f7dc(0xae),{'count':_0x2e9a0a[_0x16f7dc(0x99)],'resources':_0x9dbb7e}),{'created':_0x5dd7ee[_0x16f7dc(0x99)],'skipped':![],'dryRun':![],'targetPages':_0x2e9a0a,'plannedMenus':_0x2f6f65,'menus':_0x5dd7ee};}export function parseMenuSyncParams(_0x17a8be){const _0xfeb06f=a183_0x142de5;if(!_0x17a8be||typeof _0x17a8be!==_0xfeb06f(0xbb))return{};let _0x598cf6;try{_0x598cf6=JSON['parse'](_0x17a8be);}catch{throw new Error(_0xfeb06f(0xbc));}if(typeof _0x598cf6!=='object'||_0x598cf6===null||Array['isArray'](_0x598cf6))throw new Error(_0xfeb06f(0xb6));const _0x562d70=_0x598cf6;if(Object['hasOwn'](_0x562d70,'pages'))throw new Error(_0xfeb06f(0xa7));const _0x5e41f9=Object[_0xfeb06f(0xb8)](_0x562d70)[_0xfeb06f(0x84)](_0x17e2bd=>!MENU_SYNC_PARAM_KEYS['has'](_0x17e2bd));if(_0x5e41f9[_0xfeb06f(0x99)]>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x5e41f9[_0xfeb06f(0xb0)](',\x20')+'.');for(const _0x238d1b of[_0xfeb06f(0xb3),_0xfeb06f(0xb1),_0xfeb06f(0x9f)]){const _0x2cf5a3=_0x562d70[_0x238d1b];if(_0x2cf5a3!==undefined&&(typeof _0x2cf5a3!==_0xfeb06f(0xbb)||_0x2cf5a3[_0xfeb06f(0x9a)]()===''))throw new Error(_0xfeb06f(0xa4)+_0x238d1b+_0xfeb06f(0x90));}if(_0x562d70[_0xfeb06f(0x8e)]!==undefined&&typeof _0x562d70['visible']!==_0xfeb06f(0x9c))throw new Error(_0xfeb06f(0xa8));if(_0x562d70[_0xfeb06f(0x9e)]!==undefined&&(!Number[_0xfeb06f(0x9d)](_0x562d70['parentId'])||_0x562d70[_0xfeb06f(0x9e)]<0x0))throw new Error(_0xfeb06f(0x8b));return{'jsUrl':typeof _0x562d70[_0xfeb06f(0xb3)]===_0xfeb06f(0xbb)?_0x562d70[_0xfeb06f(0xb3)][_0xfeb06f(0x9a)]():undefined,'cssUrl':typeof _0x562d70['cssUrl']===_0xfeb06f(0xbb)?_0x562d70['cssUrl'][_0xfeb06f(0x9a)]():undefined,'appName':typeof _0x562d70[_0xfeb06f(0x9f)]===_0xfeb06f(0xbb)?_0x562d70['appName'][_0xfeb06f(0x9a)]():undefined,'visible':typeof _0x562d70[_0xfeb06f(0x8e)]===_0xfeb06f(0x9c)?_0x562d70['visible']:undefined,'parentId':typeof _0x562d70[_0xfeb06f(0x9e)]===_0xfeb06f(0xab)?_0x562d70[_0xfeb06f(0x9e)]:undefined};}
|
|
1
|
+
const a184_0x49e0dc=a184_0x23be;(function(_0x1bc11c,_0x4e9d38){const _0x326600=a184_0x23be,_0x375475=_0x1bc11c();while(!![]){try{const _0x47d33c=-parseInt(_0x326600(0x18f))/0x1*(parseInt(_0x326600(0x171))/0x2)+-parseInt(_0x326600(0x15f))/0x3*(-parseInt(_0x326600(0x18c))/0x4)+-parseInt(_0x326600(0x183))/0x5+parseInt(_0x326600(0x176))/0x6*(-parseInt(_0x326600(0x17f))/0x7)+parseInt(_0x326600(0x177))/0x8+parseInt(_0x326600(0x169))/0x9*(-parseInt(_0x326600(0x17b))/0xa)+parseInt(_0x326600(0x191))/0xb;if(_0x47d33c===_0x4e9d38)break;else _0x375475['push'](_0x375475['shift']());}catch(_0x4cb4fa){_0x375475['push'](_0x375475['shift']());}}}(a184_0x190e,0x54788));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';function a184_0x190e(){const _0x7e9837=['get','6915865sCRoxs','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','has','setLogPath','pages','parse','label','trim','Invalid\x20--params\x20JSON.','folder','3bOXKFN','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','object','appName',':\x20expected\x20a\x20non-empty\x20string.','\x0a\x20\x20Available\x20local\x20paths:\x20','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','map','type','CSS\x20URL\x20is\x20unreachable:\x20','99ZmFQiS','cssUrl','jsUrl','Invalid\x20--params:\x20','path','cwd','join','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','59266bbmwkZ','length','number','hasOwn','push','162588IuYYjl','2856400aolJjl','string','visible','--params.','439610eJhRTE','Start\x20non-interactive\x20menu\x20sync','\x22\x20for\x20','group','56ewbgpn','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','filter','info','576450kafGOq','Invalid\x20--params\x20fields:\x20','Invalid\x20--params.','keys','boolean','isInteger','dryRun','parentId','menu-sync','2244404NHOJJk','Parent\x20','isArray','13gezEIH'];a184_0x190e=function(){return _0x7e9837;};return a184_0x190e();}const MENU_SYNC_PARAM_KEYS=new Set([a184_0x49e0dc(0x16b),a184_0x49e0dc(0x16a),a184_0x49e0dc(0x162),a184_0x49e0dc(0x179),a184_0x49e0dc(0x18a)]);export function resolvePage(_0x3cdee6,_0x10ad23,_0x8e173b){const _0x4c465b=a184_0x49e0dc;let _0x420806=_0x10ad23[_0x4c465b(0x18a)]??_0x3cdee6['parentId'];if(_0x420806===undefined&&_0x3cdee6[_0x4c465b(0x17e)]){const _0x172338=_0x8e173b[_0x4c465b(0x181)](_0x197cdd=>_0x197cdd[_0x4c465b(0x167)]===_0x4c465b(0x15e)&&_0x197cdd[_0x4c465b(0x15b)]===_0x3cdee6[_0x4c465b(0x17e)]);if(_0x172338[_0x4c465b(0x172)]!==0x1)throw new Error('Expected\x20one\x20folder\x20named\x20\x22'+_0x3cdee6[_0x4c465b(0x17e)]+_0x4c465b(0x17d)+_0x3cdee6[_0x4c465b(0x16d)]+';\x20found\x20'+_0x172338['length']);_0x420806=_0x172338[0x0]['id'];}if(_0x420806!==undefined&&_0x420806!==0x0&&_0x8e173b[_0x4c465b(0x181)](_0x3df3f8=>_0x3df3f8['id']===_0x420806&&_0x3df3f8[_0x4c465b(0x167)]===_0x4c465b(0x15e))[_0x4c465b(0x172)]!==0x1)throw new Error(_0x4c465b(0x18d)+_0x420806+_0x4c465b(0x180));return{..._0x3cdee6,..._0x420806===undefined?{}:{'parentId':_0x420806},..._0x10ad23[_0x4c465b(0x179)]===undefined?{}:{'visible':_0x10ad23[_0x4c465b(0x179)]}};}function a184_0x23be(_0x49d828,_0x3cb351){_0x49d828=_0x49d828-0x156;const _0x190ec6=a184_0x190e();let _0x23be93=_0x190ec6[_0x49d828];return _0x23be93;}function validateParams(_0x30b1cf){const _0x303216=a184_0x49e0dc,_0x1c7e20=[];return _0x30b1cf['jsUrl']&&!isValidJsHttpsUrl(_0x30b1cf[_0x303216(0x16b)])&&_0x1c7e20[_0x303216(0x175)]({'field':_0x303216(0x16b),'message':_0x303216(0x192)}),_0x30b1cf[_0x303216(0x16a)]&&!isValidCssHttpsUrl(_0x30b1cf['cssUrl'])&&_0x1c7e20['push']({'field':_0x303216(0x16a),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x1c7e20;}export async function runMenuSyncCore(_0x28a454,_0x3a4a54,_0x2062b5=[],_0x47366c,_0x107ec4={}){const _0x999912=a184_0x49e0dc,_0x121fe8=parseMenuSyncParams(_0x47366c),_0xa7f5f4=[...new Set(_0x2062b5[_0x999912(0x166)](_0x26138=>_0x26138['trim']())[_0x999912(0x181)](Boolean)[_0x999912(0x166)](menuPathKey))],_0x1f5ee2=_0x121fe8[_0x999912(0x16b)],_0x25752a=_0x121fe8['cssUrl'],_0x979139=[];if(_0x1f5ee2)_0x979139[_0x999912(0x175)](_0x1f5ee2);if(_0x25752a)_0x979139[_0x999912(0x175)](_0x25752a);const _0x1ae619=validateParams(_0x121fe8);if(_0x1ae619[_0x999912(0x172)]>0x0){const _0x3753ed=_0x1ae619[_0x999912(0x166)](_0x53baa3=>_0x999912(0x17a)+_0x53baa3['field']+':\x20'+_0x53baa3['message'])[_0x999912(0x16f)](';\x20');throw new Error(_0x999912(0x16c)+_0x3753ed);}logger[_0x999912(0x158)](process[_0x999912(0x16e)]()),logger[_0x999912(0x182)]('menu-sync',_0x999912(0x17c),{'appCode':_0x28a454,'selectedCount':_0xa7f5f4[_0x999912(0x172)],'jsUrl':_0x1f5ee2,'cssUrl':_0x25752a});if(_0x1f5ee2){const _0x14d738=await isUrlReachable(_0x1f5ee2);if(!_0x14d738)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x1f5ee2);}if(_0x25752a){const _0x3e2358=await isUrlReachable(_0x25752a);if(!_0x3e2358)throw new Error(_0x999912(0x168)+_0x25752a);}const _0x137fe7=getLocalPages();if(_0x137fe7[_0x999912(0x172)]===0x0){if(_0xa7f5f4[_0x999912(0x172)]>0x0)throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0xa7f5f4[_0x999912(0x16f)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x107ec4['dryRun']===!![],'targetPages':[],'plannedMenus':[]};}const _0xc04f10=await getOnlineMenuList(_0x28a454,_0x3a4a54),_0x34c6e2=new Set(_0xc04f10[_0x999912(0x166)](_0x1dce8a=>menuPathKey(_0x1dce8a[_0x999912(0x16d)])));let _0xc802c1;if(_0xa7f5f4['length']>0x0){const _0x3cf681=new Map(_0x137fe7[_0x999912(0x166)](_0x3721ae=>[menuPathKey(_0x3721ae[_0x999912(0x16d)]),_0x3721ae])),_0x52f6d9=_0xa7f5f4['filter'](_0x3adeb6=>!_0x3cf681[_0x999912(0x157)](_0x3adeb6));if(_0x52f6d9[_0x999912(0x172)]>0x0){const _0x735a2f=_0x137fe7['map'](_0x32ecbc=>_0x32ecbc[_0x999912(0x16d)])[_0x999912(0x16f)](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x52f6d9[_0x999912(0x16f)](',\x20')+_0x999912(0x164)+_0x735a2f);}const _0xa177da=_0xa7f5f4[_0x999912(0x181)](_0x1dbac6=>_0x34c6e2['has'](_0x1dbac6));if(_0xa177da[_0x999912(0x172)]>0x0)throw new Error(_0x999912(0x165)+_0xa177da[_0x999912(0x16f)](',\x20'));_0xc802c1=_0xa7f5f4[_0x999912(0x166)](_0x29002e=>_0x3cf681[_0x999912(0x190)](_0x29002e));}else _0xc802c1=_0x137fe7['filter'](_0x5c9e47=>!_0x34c6e2['has'](menuPathKey(_0x5c9e47[_0x999912(0x16d)])));if(_0xc802c1['length']===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x107ec4['dryRun']===!![],'targetPages':[],'plannedMenus':[]};_0xc802c1=_0xc802c1[_0x999912(0x166)](_0x313df5=>resolvePage(_0x313df5,_0x121fe8,_0xc04f10));_0x121fe8[_0x999912(0x162)]&&_0x979139[_0x999912(0x172)]===0x0&&await assertSharedResourcesConfigured(_0x28a454,_0x3a4a54,_0x121fe8['appName']);const _0x369634=_0xc802c1['map'](_0x535489=>({'type':'procode','path':_0x535489[_0x999912(0x16d)],'label':_0x535489[_0x999912(0x15b)],'loadScriptMode':'import','resources':[..._0x979139],..._0x535489[_0x999912(0x179)]===undefined?{}:{'visible':_0x535489['visible']},..._0x535489['parentId']===undefined?{}:{'parentId':_0x535489[_0x999912(0x18a)]},..._0x535489['order']===undefined?{}:{'sort':_0x535489['order']},..._0x121fe8[_0x999912(0x162)]===undefined?{}:{'appName':_0x121fe8[_0x999912(0x162)]}}));if(_0x107ec4[_0x999912(0x189)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0xc802c1,'plannedMenus':_0x369634};const _0x898968=_0x121fe8[_0x999912(0x162)]?await createMenus(_0x28a454,_0x3a4a54,_0xc802c1,_0x979139[_0x999912(0x172)]>0x0?_0x979139:undefined,{'appName':_0x121fe8['appName']}):await createMenus(_0x28a454,_0x3a4a54,_0xc802c1,_0x979139[_0x999912(0x172)]>0x0?_0x979139:undefined);return logger[_0x999912(0x182)](_0x999912(0x18b),'Menu\x20sync\x20completed',{'count':_0xc802c1[_0x999912(0x172)],'resources':_0x979139}),{'created':_0x898968['length'],'skipped':![],'dryRun':![],'targetPages':_0xc802c1,'plannedMenus':_0x369634,'menus':_0x898968};}export function parseMenuSyncParams(_0x15f20b){const _0x173c22=a184_0x49e0dc;if(!_0x15f20b||typeof _0x15f20b!==_0x173c22(0x178))return{};let _0x1ef9c7;try{_0x1ef9c7=JSON[_0x173c22(0x15a)](_0x15f20b);}catch{throw new Error(_0x173c22(0x15d));}if(typeof _0x1ef9c7!==_0x173c22(0x161)||_0x1ef9c7===null||Array[_0x173c22(0x18e)](_0x1ef9c7))throw new Error(_0x173c22(0x156));const _0x394af2=_0x1ef9c7;if(Object[_0x173c22(0x174)](_0x394af2,_0x173c22(0x159)))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x1b209b=Object[_0x173c22(0x186)](_0x394af2)[_0x173c22(0x181)](_0x52871d=>!MENU_SYNC_PARAM_KEYS[_0x173c22(0x157)](_0x52871d));if(_0x1b209b[_0x173c22(0x172)]>0x0)throw new Error(_0x173c22(0x184)+_0x1b209b['join'](',\x20')+'.');for(const _0x3340a1 of['jsUrl',_0x173c22(0x16a),_0x173c22(0x162)]){const _0xe36cc2=_0x394af2[_0x3340a1];if(_0xe36cc2!==undefined&&(typeof _0xe36cc2!==_0x173c22(0x178)||_0xe36cc2['trim']()===''))throw new Error(_0x173c22(0x185)+_0x3340a1+_0x173c22(0x163));}if(_0x394af2[_0x173c22(0x179)]!==undefined&&typeof _0x394af2[_0x173c22(0x179)]!=='boolean')throw new Error(_0x173c22(0x170));if(_0x394af2[_0x173c22(0x18a)]!==undefined&&(!Number[_0x173c22(0x188)](_0x394af2['parentId'])||_0x394af2['parentId']<0x0))throw new Error(_0x173c22(0x160));return{'jsUrl':typeof _0x394af2[_0x173c22(0x16b)]===_0x173c22(0x178)?_0x394af2[_0x173c22(0x16b)]['trim']():undefined,'cssUrl':typeof _0x394af2[_0x173c22(0x16a)]===_0x173c22(0x178)?_0x394af2['cssUrl'][_0x173c22(0x15c)]():undefined,'appName':typeof _0x394af2[_0x173c22(0x162)]===_0x173c22(0x178)?_0x394af2[_0x173c22(0x162)]['trim']():undefined,'visible':typeof _0x394af2[_0x173c22(0x179)]===_0x173c22(0x187)?_0x394af2[_0x173c22(0x179)]:undefined,'parentId':typeof _0x394af2[_0x173c22(0x18a)]===_0x173c22(0x173)?_0x394af2[_0x173c22(0x18a)]:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x32c25e,_0x182be4){const _0x32a136=a185_0x2fc1,_0x3d765f=_0x32c25e();while(!![]){try{const _0x1166c0=parseInt(_0x32a136(0x190))/0x1*(-parseInt(_0x32a136(0x175))/0x2)+-parseInt(_0x32a136(0x193))/0x3+-parseInt(_0x32a136(0x163))/0x4*(parseInt(_0x32a136(0x18e))/0x5)+-parseInt(_0x32a136(0x18a))/0x6*(-parseInt(_0x32a136(0x16c))/0x7)+-parseInt(_0x32a136(0x18d))/0x8+parseInt(_0x32a136(0x157))/0x9*(parseInt(_0x32a136(0x181))/0xa)+parseInt(_0x32a136(0x154))/0xb;if(_0x1166c0===_0x182be4)break;else _0x3d765f['push'](_0x3d765f['shift']());}catch(_0x1e1050){_0x3d765f['push'](_0x3d765f['shift']());}}}(a185_0x12a1,0x1e07c));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';function a185_0x12a1(){const _0x29d12f=['patch','filter','parse','push','value','length','menuIds','390840xqNmMB','\x20existing\x20JS\x20resources\x20for\x20\x22','rejected','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','endsWith','selection','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','Invalid\x20--mode:\x20','7dFHsQP','loadScriptMode','force','toLowerCase','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','.css','paths','extend','JS\x20URL\x20is\x20unreachable:\x20','21418HcUcKO','string','all','isArray','resources','jsUrl','Start\x20non-interactive\x20menu\x20asset\x20update','path','menu-asset-update','CSS\x20URL\x20is\x20unreachable:\x20','dryRun','setLogPath','10jKTJzF','message','label','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','trim','after','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','unshift','has','1036632uaRouT','some','info','20976gdDSIv','5ecKzmb','.js','1aQeisw','map','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','30216zpWJJi','--params.','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','606936ZHQjiH','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','split','145521DXOZVd','join','Menu\x20asset\x20update\x20completed','cssUrl','\x22\x20('];a185_0x12a1=function(){return _0x29d12f;};return a185_0x12a1();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x3edbe5){const _0x1884f5=a185_0x2fc1,_0x3bb1b6=[];return _0x3edbe5['jsUrl']&&!isValidJsHttpsUrl(_0x3edbe5[_0x1884f5(0x17a)])&&_0x3bb1b6[_0x1884f5(0x15f)]({'field':_0x1884f5(0x17a),'message':_0x1884f5(0x155)}),_0x3edbe5['cssUrl']&&!isValidCssHttpsUrl(_0x3edbe5['cssUrl'])&&_0x3bb1b6['push']({'field':_0x1884f5(0x15a),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x3bb1b6;}export async function runMenuUpdateCore(_0x167b22,_0x3deeb4,_0x533b59,_0x34eed7={}){const _0x4233a8=a185_0x2fc1,_0x27cf73=parseUpdateParamsFlag(_0x533b59),_0x5ad0ff=normalizeMode(_0x34eed7['mode']);validateSelection(_0x34eed7[_0x4233a8(0x169)]);const _0x5eaffd=[];if(_0x27cf73[_0x4233a8(0x17a)])_0x5eaffd[_0x4233a8(0x15f)](_0x27cf73[_0x4233a8(0x17a)]);if(_0x27cf73[_0x4233a8(0x15a)])_0x5eaffd[_0x4233a8(0x15f)](_0x27cf73[_0x4233a8(0x15a)]);const _0x36a84d=validateParams(_0x27cf73);if(_0x36a84d[_0x4233a8(0x161)]>0x0){const _0x46ee8a=_0x36a84d[_0x4233a8(0x191)](_0x150b31=>_0x4233a8(0x194)+_0x150b31['field']+':\x20'+_0x150b31[_0x4233a8(0x182)])[_0x4233a8(0x158)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x46ee8a);}if(_0x5eaffd[_0x4233a8(0x161)]===0x0)throw new Error(_0x4233a8(0x166)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x4233a8(0x180)](process['cwd']()),logger[_0x4233a8(0x18c)](_0x4233a8(0x17d),_0x4233a8(0x17b),{'appCode':_0x167b22,'jsUrl':_0x27cf73['jsUrl'],'cssUrl':_0x27cf73['cssUrl'],'mode':_0x5ad0ff,'dryRun':_0x34eed7[_0x4233a8(0x17f)]===!![]});if(_0x27cf73[_0x4233a8(0x17a)]){const _0x42ba8b=await isUrlReachable(_0x27cf73[_0x4233a8(0x17a)]);if(!_0x42ba8b)throw new Error(_0x4233a8(0x174)+_0x27cf73[_0x4233a8(0x17a)]);}if(_0x27cf73[_0x4233a8(0x15a)]){const _0x435860=await isUrlReachable(_0x27cf73[_0x4233a8(0x15a)]);if(!_0x435860)throw new Error(_0x4233a8(0x17e)+_0x27cf73[_0x4233a8(0x15a)]);}const _0x16d135=await getOnlineMenuList(_0x167b22,_0x3deeb4),_0xc6bd83=_0x16d135[_0x4233a8(0x15d)](_0x502513=>_0x502513[_0x4233a8(0x179)][_0x4233a8(0x161)]>0x0),_0x36cd3d=selectMenusForUpdate(_0xc6bd83,_0x34eed7['selection']);if(_0x36cd3d[_0x4233a8(0x161)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x34eed7['dryRun']===!![]};const _0x564369=_0x36cd3d[_0x4233a8(0x191)](_0x53a192=>buildMenuUpdateDiff(_0x53a192,_0x27cf73,_0x5ad0ff,_0x34eed7[_0x4233a8(0x16e)]===!![],_0x34eed7[_0x4233a8(0x16d)]));if(_0x34eed7[_0x4233a8(0x17f)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x564369};const _0x472a72=await Promise['allSettled'](_0x36cd3d[_0x4233a8(0x191)]((_0x2097ef,_0x2741e8)=>updateMenuCdnUrl(_0x167b22,_0x3deeb4,{'id':_0x2097ef['id'],'label':_0x2097ef[_0x4233a8(0x183)],'path':_0x2097ef[_0x4233a8(0x17c)],'resources':_0x564369[_0x2741e8][_0x4233a8(0x186)][_0x4233a8(0x179)],'extend':_0x2097ef[_0x4233a8(0x173)]??null,'loadScriptMode':_0x34eed7['loadScriptMode']}))),_0x4704b3=_0x472a72[_0x4233a8(0x15d)](_0x4a79c2=>_0x4a79c2['status']==='fulfilled')[_0x4233a8(0x191)](_0x2a01d8=>_0x2a01d8[_0x4233a8(0x160)]),_0x1f46c4=_0x472a72[_0x4233a8(0x15d)](_0x3b39ad=>_0x3b39ad['status']===_0x4233a8(0x165))['length'];return logger[_0x4233a8(0x18c)](_0x4233a8(0x17d),_0x4233a8(0x159),{'count':_0x36cd3d['length'],'resources':_0x5eaffd}),{'updated':_0x4704b3[_0x4233a8(0x161)],'failed':_0x1f46c4,'skipped':![],'menus':_0x4704b3};}function validateSelection(_0x2a2652){const _0x60c7c7=a185_0x2fc1;if(!_0x2a2652)throw new Error(_0x60c7c7(0x170));if(_0x2a2652['all']&&(_0x2a2652['menuIds'][_0x60c7c7(0x161)]>0x0||_0x2a2652[_0x60c7c7(0x172)]['length']>0x0))throw new Error(_0x60c7c7(0x16a));if(!_0x2a2652['all']&&_0x2a2652[_0x60c7c7(0x162)][_0x60c7c7(0x161)]===0x0&&_0x2a2652[_0x60c7c7(0x172)][_0x60c7c7(0x161)]===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x5c2dd3,_0x2085af){const _0x5dd5d4=a185_0x2fc1;validateSelection(_0x2085af);if(_0x2085af[_0x5dd5d4(0x177)])return _0x5c2dd3;const _0x4e1417=new Set(_0x5c2dd3[_0x5dd5d4(0x191)](_0x5bf112=>_0x5bf112['id'])),_0x297ce8=new Set(_0x5c2dd3[_0x5dd5d4(0x191)](_0x5d0aca=>_0x5d0aca[_0x5dd5d4(0x17c)])),_0x5ca99c=_0x2085af['menuIds'][_0x5dd5d4(0x15d)](_0x54d8dd=>!_0x4e1417[_0x5dd5d4(0x189)](_0x54d8dd)),_0x4a0b58=_0x2085af[_0x5dd5d4(0x172)][_0x5dd5d4(0x15d)](_0x2ec15f=>!_0x297ce8['has'](_0x2ec15f));if(_0x5ca99c[_0x5dd5d4(0x161)]>0x0||_0x4a0b58[_0x5dd5d4(0x161)]>0x0){const _0x3af985=[..._0x5ca99c['map'](_0x3b002e=>String(_0x3b002e)),..._0x4a0b58][_0x5dd5d4(0x158)](',\x20');throw new Error(_0x5dd5d4(0x167)+_0x3af985);}const _0x2a7d66=new Set(_0x2085af['menuIds']),_0x251bb5=new Set(_0x2085af[_0x5dd5d4(0x172)]);return _0x5c2dd3['filter'](_0xc4e099=>_0x2a7d66[_0x5dd5d4(0x189)](_0xc4e099['id'])||_0x251bb5['has'](_0xc4e099['path']));}function normalizeMode(_0x36b919){const _0x47bb21=a185_0x2fc1;if(!_0x36b919)return _0x47bb21(0x15c);if(_0x36b919==='replace'||_0x36b919===_0x47bb21(0x15c))return _0x36b919;throw new Error(_0x47bb21(0x16b)+_0x36b919+'.\x20Allowed\x20values:\x20replace,\x20patch');}function buildMenuUpdateDiff(_0x2d0575,_0x163b1e,_0x1b2398,_0x47ed59,_0x3fe7ed){const _0xdd312e=a185_0x2fc1,_0x1a77ff=[..._0x2d0575[_0xdd312e(0x179)]];_0x1b2398==='patch'&&assertUnambiguousPatchResources(_0x2d0575,_0x1a77ff,_0x163b1e);const _0x7c5bf1=_0x1b2398===_0xdd312e(0x15c)?patchResources(_0x1a77ff,_0x163b1e):replaceResources(_0x163b1e),_0x1d7062=[],_0xc66a9f=_0x1a77ff[_0xdd312e(0x18b)](isJsResource),_0x34ed13=_0x7c5bf1[_0xdd312e(0x18b)](isJsResource);if(_0xc66a9f&&!_0x34ed13){const _0xde73d=_0xdd312e(0x184)+_0x2d0575['label']+_0xdd312e(0x15b)+_0x2d0575[_0xdd312e(0x17c)]+').\x20'+_0xdd312e(0x196);if(!_0x47ed59)throw new Error(_0xde73d);_0x1d7062[_0xdd312e(0x15f)](_0xde73d);}const _0x1d20ba=_0x1a77ff[_0xdd312e(0x18b)](isCssResource),_0x426cb7=_0x7c5bf1['some'](isCssResource);_0x1d20ba&&!_0x426cb7&&_0x1d7062['push'](_0xdd312e(0x195)+_0x2d0575['label']+_0xdd312e(0x15b)+_0x2d0575['path']+').');const _0x493a87=typeof _0x2d0575[_0xdd312e(0x173)]?.[_0xdd312e(0x16d)]===_0xdd312e(0x176)?_0x2d0575['extend'][_0xdd312e(0x16d)]:null,_0x956b2d=_0x3fe7ed?{'loadScriptMode':_0x493a87}:{},_0x5e4812=_0x3fe7ed?{'loadScriptMode':_0x3fe7ed}:{};return{'id':_0x2d0575['id'],'label':_0x2d0575[_0xdd312e(0x183)],'path':_0x2d0575[_0xdd312e(0x17c)],'mode':_0x1b2398,'before':{'resources':_0x1a77ff,..._0x956b2d},'after':{'resources':_0x7c5bf1,..._0x5e4812},'warnings':_0x1d7062};}function a185_0x2fc1(_0x541d06,_0x515cda){_0x541d06=_0x541d06-0x154;const _0x12a1d8=a185_0x12a1();let _0x2fc183=_0x12a1d8[_0x541d06];return _0x2fc183;}function replaceResources(_0x59ad73){const _0x469d50=a185_0x2fc1;return[_0x59ad73[_0x469d50(0x17a)],_0x59ad73[_0x469d50(0x15a)]][_0x469d50(0x15d)](_0x558651=>!!_0x558651);}function assertUnambiguousPatchResources(_0x27ca9b,_0x2574b3,_0x3ddd9e){const _0x162329=a185_0x2fc1,_0x4cbbd6=_0x2574b3[_0x162329(0x15d)](isJsResource)['length'];if(_0x3ddd9e['jsUrl']&&_0x4cbbd6>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x4cbbd6+_0x162329(0x164)+_0x27ca9b[_0x162329(0x183)]+_0x162329(0x15b)+_0x27ca9b[_0x162329(0x17c)]+')\x20'+_0x162329(0x192));const _0xd961ea=_0x2574b3[_0x162329(0x15d)](isCssResource)[_0x162329(0x161)];if(_0x3ddd9e[_0x162329(0x15a)]&&_0xd961ea>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0xd961ea+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x27ca9b[_0x162329(0x183)]+_0x162329(0x15b)+_0x27ca9b[_0x162329(0x17c)]+')\x20'+_0x162329(0x187));}function patchResources(_0x11d474,_0xb9e357){const _0x25ed64=a185_0x2fc1;let _0x1559fc=![],_0x3f07d6=![];const _0x9b323f=[];for(const _0x17ef4d of _0x11d474){if(isJsResource(_0x17ef4d)){if(_0xb9e357['jsUrl']&&!_0x1559fc)_0x9b323f['push'](_0xb9e357[_0x25ed64(0x17a)]),_0x1559fc=!![];else!_0xb9e357[_0x25ed64(0x17a)]&&_0x9b323f[_0x25ed64(0x15f)](_0x17ef4d);continue;}if(isCssResource(_0x17ef4d)){if(_0xb9e357[_0x25ed64(0x15a)]&&!_0x3f07d6)_0x9b323f[_0x25ed64(0x15f)](_0xb9e357[_0x25ed64(0x15a)]),_0x3f07d6=!![];else!_0xb9e357[_0x25ed64(0x15a)]&&_0x9b323f['push'](_0x17ef4d);continue;}_0x9b323f['push'](_0x17ef4d);}return _0xb9e357[_0x25ed64(0x17a)]&&!_0x1559fc&&_0x9b323f[_0x25ed64(0x188)](_0xb9e357[_0x25ed64(0x17a)]),_0xb9e357['cssUrl']&&!_0x3f07d6&&_0x9b323f[_0x25ed64(0x15f)](_0xb9e357[_0x25ed64(0x15a)]),_0x9b323f;}function isJsResource(_0x1d8293){const _0x13006e=a185_0x2fc1;return stripQuery(_0x1d8293)['toLowerCase']()[_0x13006e(0x168)](_0x13006e(0x18f));}function isCssResource(_0x150314){const _0x3c04f5=a185_0x2fc1;return stripQuery(_0x150314)[_0x3c04f5(0x16f)]()['endsWith'](_0x3c04f5(0x171));}function stripQuery(_0x5185f6){const _0x27ae58=a185_0x2fc1;return _0x5185f6[_0x27ae58(0x156)]('?')[0x0]??_0x5185f6;}function parseUpdateParamsFlag(_0x757bf1){const _0x21e725=a185_0x2fc1;if(!_0x757bf1||typeof _0x757bf1!==_0x21e725(0x176))return{};try{const _0x4c0986=JSON[_0x21e725(0x15e)](_0x757bf1);if(typeof _0x4c0986!=='object'||_0x4c0986===null||Array[_0x21e725(0x178)](_0x4c0986))return{};return{'jsUrl':typeof _0x4c0986['jsUrl']===_0x21e725(0x176)?_0x4c0986[_0x21e725(0x17a)][_0x21e725(0x185)]():undefined,'cssUrl':typeof _0x4c0986[_0x21e725(0x15a)]===_0x21e725(0x176)?_0x4c0986[_0x21e725(0x15a)][_0x21e725(0x185)]():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x402a7c,_0x275f0e){const _0x465b8a=a186_0x134f,_0x5c8492=_0x402a7c();while(!![]){try{const _0x41e247=-parseInt(_0x465b8a(0x152))/0x1+-parseInt(_0x465b8a(0x16c))/0x2*(-parseInt(_0x465b8a(0x170))/0x3)+-parseInt(_0x465b8a(0x169))/0x4*(-parseInt(_0x465b8a(0x151))/0x5)+-parseInt(_0x465b8a(0x167))/0x6+-parseInt(_0x465b8a(0x14e))/0x7*(parseInt(_0x465b8a(0x148))/0x8)+parseInt(_0x465b8a(0x17a))/0x9+parseInt(_0x465b8a(0x166))/0xa;if(_0x41e247===_0x275f0e)break;else _0x5c8492['push'](_0x5c8492['shift']());}catch(_0x35f422){_0x5c8492['push'](_0x5c8492['shift']());}}}(a186_0x190d,0x866d7));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function a186_0x190d(){const _0x35cc0a=[').\x20','resources','label','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','mode','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','4595193eHJInY','replace','paths','map','dryRun','path','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','menuIds','string','Invalid\x20--params:\x20','rejected','force','menu\x20asset-update\x20cannot\x20patch\x20','\x20existing\x20JS\x20resources\x20for\x20\x22','.\x20Allowed\x20values:\x20replace,\x20patch','field','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','--params.','21224GEkPsU','selection','patch','join','all','.js','2737HlzCgA','loadScriptMode','cwd','594595xleQfQ','552953GOgmph','extend','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','isArray','some','menu-asset-update','jsUrl','toLowerCase','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','CSS\x20URL\x20is\x20unreachable:\x20','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','has','unshift','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','filter','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','push','after','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','9456920qZahMz','219678MRHQIc','Menu\x20asset\x20update\x20completed','4ewLwJm','.css','endsWith','3042ukfwRj','\x22\x20(','trim','length','1188HrhKuC','fulfilled','cssUrl','JS\x20URL\x20is\x20unreachable:\x20'];a186_0x190d=function(){return _0x35cc0a;};return a186_0x190d();}function validateParams(_0x4efca3){const _0x2238a1=a186_0x134f,_0x44685b=[];return _0x4efca3[_0x2238a1(0x159)]&&!isValidJsHttpsUrl(_0x4efca3[_0x2238a1(0x159)])&&_0x44685b[_0x2238a1(0x163)]({'field':_0x2238a1(0x159),'message':_0x2238a1(0x165)}),_0x4efca3[_0x2238a1(0x172)]&&!isValidCssHttpsUrl(_0x4efca3['cssUrl'])&&_0x44685b[_0x2238a1(0x163)]({'field':_0x2238a1(0x172),'message':_0x2238a1(0x162)}),_0x44685b;}export async function runMenuUpdateCore(_0x11c0fd,_0x4c038c,_0x63bd66,_0x594bdc={}){const _0x3fc780=a186_0x134f,_0x4a0fa5=parseUpdateParamsFlag(_0x63bd66),_0x2fcc19=normalizeMode(_0x594bdc[_0x3fc780(0x178)]);validateSelection(_0x594bdc['selection']);const _0x37d685=[];if(_0x4a0fa5[_0x3fc780(0x159)])_0x37d685[_0x3fc780(0x163)](_0x4a0fa5[_0x3fc780(0x159)]);if(_0x4a0fa5[_0x3fc780(0x172)])_0x37d685['push'](_0x4a0fa5['cssUrl']);const _0x425e6b=validateParams(_0x4a0fa5);if(_0x425e6b[_0x3fc780(0x16f)]>0x0){const _0x46a105=_0x425e6b[_0x3fc780(0x17d)](_0x836790=>_0x3fc780(0x147)+_0x836790[_0x3fc780(0x145)]+':\x20'+_0x836790['message'])[_0x3fc780(0x14b)](';\x20');throw new Error(_0x3fc780(0x183)+_0x46a105);}if(_0x37d685[_0x3fc780(0x16f)]===0x0)throw new Error(_0x3fc780(0x160)+_0x3fc780(0x15d));logger['setLogPath'](process[_0x3fc780(0x150)]()),logger['info'](_0x3fc780(0x158),'Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x11c0fd,'jsUrl':_0x4a0fa5['jsUrl'],'cssUrl':_0x4a0fa5[_0x3fc780(0x172)],'mode':_0x2fcc19,'dryRun':_0x594bdc[_0x3fc780(0x17e)]===!![]});if(_0x4a0fa5[_0x3fc780(0x159)]){const _0x26267b=await isUrlReachable(_0x4a0fa5['jsUrl']);if(!_0x26267b)throw new Error(_0x3fc780(0x173)+_0x4a0fa5[_0x3fc780(0x159)]);}if(_0x4a0fa5['cssUrl']){const _0x31343a=await isUrlReachable(_0x4a0fa5['cssUrl']);if(!_0x31343a)throw new Error(_0x3fc780(0x15c)+_0x4a0fa5['cssUrl']);}const _0x205c11=await getOnlineMenuList(_0x11c0fd,_0x4c038c),_0x45d2e9=_0x205c11[_0x3fc780(0x161)](_0x3e535d=>_0x3e535d['resources'][_0x3fc780(0x16f)]>0x0),_0x2db70c=selectMenusForUpdate(_0x45d2e9,_0x594bdc[_0x3fc780(0x149)]);if(_0x2db70c[_0x3fc780(0x16f)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x594bdc['dryRun']===!![]};const _0x38c48b=_0x2db70c[_0x3fc780(0x17d)](_0x187ca3=>buildMenuUpdateDiff(_0x187ca3,_0x4a0fa5,_0x2fcc19,_0x594bdc[_0x3fc780(0x185)]===!![],_0x594bdc[_0x3fc780(0x14f)]));if(_0x594bdc[_0x3fc780(0x17e)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x38c48b};const _0x2ce807=await Promise['allSettled'](_0x2db70c[_0x3fc780(0x17d)]((_0x4d5019,_0x53d5e0)=>updateMenuCdnUrl(_0x11c0fd,_0x4c038c,{'id':_0x4d5019['id'],'label':_0x4d5019[_0x3fc780(0x176)],'path':_0x4d5019['path'],'resources':_0x38c48b[_0x53d5e0][_0x3fc780(0x164)]['resources'],'extend':_0x4d5019[_0x3fc780(0x153)]??null,'loadScriptMode':_0x594bdc[_0x3fc780(0x14f)]}))),_0x579408=_0x2ce807['filter'](_0x596200=>_0x596200['status']===_0x3fc780(0x171))[_0x3fc780(0x17d)](_0x479a41=>_0x479a41['value']),_0x135be3=_0x2ce807[_0x3fc780(0x161)](_0x229c5f=>_0x229c5f['status']===_0x3fc780(0x184))[_0x3fc780(0x16f)];return logger['info']('menu-asset-update',_0x3fc780(0x168),{'count':_0x2db70c[_0x3fc780(0x16f)],'resources':_0x37d685}),{'updated':_0x579408[_0x3fc780(0x16f)],'failed':_0x135be3,'skipped':![],'menus':_0x579408};}function validateSelection(_0xcd3a){const _0x27a379=a186_0x134f;if(!_0xcd3a)throw new Error(_0x27a379(0x179));if(_0xcd3a[_0x27a379(0x14c)]&&(_0xcd3a[_0x27a379(0x181)]['length']>0x0||_0xcd3a[_0x27a379(0x17c)]['length']>0x0))throw new Error(_0x27a379(0x154));if(!_0xcd3a[_0x27a379(0x14c)]&&_0xcd3a[_0x27a379(0x181)][_0x27a379(0x16f)]===0x0&&_0xcd3a[_0x27a379(0x17c)][_0x27a379(0x16f)]===0x0)throw new Error(_0x27a379(0x179));}export function selectMenusForUpdate(_0x2694c5,_0x1b95b7){const _0x471d79=a186_0x134f;validateSelection(_0x1b95b7);if(_0x1b95b7[_0x471d79(0x14c)])return _0x2694c5;const _0x4485de=new Set(_0x2694c5[_0x471d79(0x17d)](_0x3fe5b0=>_0x3fe5b0['id'])),_0x4b6d27=new Set(_0x2694c5[_0x471d79(0x17d)](_0xd842a9=>_0xd842a9[_0x471d79(0x17f)])),_0x536b78=_0x1b95b7['menuIds'][_0x471d79(0x161)](_0xc3078d=>!_0x4485de['has'](_0xc3078d)),_0x2cbbf7=_0x1b95b7[_0x471d79(0x17c)][_0x471d79(0x161)](_0x5616e5=>!_0x4b6d27[_0x471d79(0x15e)](_0x5616e5));if(_0x536b78['length']>0x0||_0x2cbbf7[_0x471d79(0x16f)]>0x0){const _0x2be5ac=[..._0x536b78[_0x471d79(0x17d)](_0x2fa015=>String(_0x2fa015)),..._0x2cbbf7][_0x471d79(0x14b)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x2be5ac);}const _0xfcab9b=new Set(_0x1b95b7['menuIds']),_0x5373db=new Set(_0x1b95b7[_0x471d79(0x17c)]);return _0x2694c5[_0x471d79(0x161)](_0x335d82=>_0xfcab9b[_0x471d79(0x15e)](_0x335d82['id'])||_0x5373db[_0x471d79(0x15e)](_0x335d82[_0x471d79(0x17f)]));}function normalizeMode(_0x208e73){const _0x5b1c8d=a186_0x134f;if(!_0x208e73)return _0x5b1c8d(0x14a);if(_0x208e73===_0x5b1c8d(0x17b)||_0x208e73===_0x5b1c8d(0x14a))return _0x208e73;throw new Error('Invalid\x20--mode:\x20'+_0x208e73+_0x5b1c8d(0x144));}function buildMenuUpdateDiff(_0x22ac4d,_0xc8c5d4,_0x597119,_0x7ade5c,_0x33210f){const _0x22d7f6=a186_0x134f,_0x4ebd5a=[..._0x22ac4d[_0x22d7f6(0x175)]];_0x597119==='patch'&&assertUnambiguousPatchResources(_0x22ac4d,_0x4ebd5a,_0xc8c5d4);const _0x3dab97=_0x597119===_0x22d7f6(0x14a)?patchResources(_0x4ebd5a,_0xc8c5d4):replaceResources(_0xc8c5d4),_0x14864f=[],_0x53ac5f=_0x4ebd5a['some'](isJsResource),_0x55379b=_0x3dab97[_0x22d7f6(0x157)](isJsResource);if(_0x53ac5f&&!_0x55379b){const _0x176bcb=_0x22d7f6(0x146)+_0x22ac4d[_0x22d7f6(0x176)]+_0x22d7f6(0x16d)+_0x22ac4d[_0x22d7f6(0x17f)]+_0x22d7f6(0x174)+_0x22d7f6(0x177);if(!_0x7ade5c)throw new Error(_0x176bcb);_0x14864f[_0x22d7f6(0x163)](_0x176bcb);}const _0x286d46=_0x4ebd5a['some'](isCssResource),_0x290239=_0x3dab97[_0x22d7f6(0x157)](isCssResource);_0x286d46&&!_0x290239&&_0x14864f[_0x22d7f6(0x163)](_0x22d7f6(0x180)+_0x22ac4d[_0x22d7f6(0x176)]+'\x22\x20('+_0x22ac4d[_0x22d7f6(0x17f)]+').');const _0x328415=typeof _0x22ac4d[_0x22d7f6(0x153)]?.['loadScriptMode']===_0x22d7f6(0x182)?_0x22ac4d[_0x22d7f6(0x153)][_0x22d7f6(0x14f)]:null,_0x4408b4=_0x33210f?{'loadScriptMode':_0x328415}:{},_0x345b95=_0x33210f?{'loadScriptMode':_0x33210f}:{};return{'id':_0x22ac4d['id'],'label':_0x22ac4d[_0x22d7f6(0x176)],'path':_0x22ac4d[_0x22d7f6(0x17f)],'mode':_0x597119,'before':{'resources':_0x4ebd5a,..._0x4408b4},'after':{'resources':_0x3dab97,..._0x345b95},'warnings':_0x14864f};}function replaceResources(_0x108957){const _0x14b14f=a186_0x134f;return[_0x108957[_0x14b14f(0x159)],_0x108957[_0x14b14f(0x172)]]['filter'](_0x2088b7=>!!_0x2088b7);}function assertUnambiguousPatchResources(_0x4e4ebf,_0x7c4230,_0x49fd08){const _0x43378a=a186_0x134f,_0x3502ed=_0x7c4230[_0x43378a(0x161)](isJsResource)[_0x43378a(0x16f)];if(_0x49fd08['jsUrl']&&_0x3502ed>0x1)throw new Error(_0x43378a(0x142)+_0x3502ed+_0x43378a(0x143)+_0x4e4ebf[_0x43378a(0x176)]+_0x43378a(0x16d)+_0x4e4ebf[_0x43378a(0x17f)]+')\x20'+_0x43378a(0x15b));const _0x2fd9e4=_0x7c4230[_0x43378a(0x161)](isCssResource)[_0x43378a(0x16f)];if(_0x49fd08['cssUrl']&&_0x2fd9e4>0x1)throw new Error(_0x43378a(0x142)+_0x2fd9e4+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x4e4ebf[_0x43378a(0x176)]+_0x43378a(0x16d)+_0x4e4ebf['path']+')\x20'+_0x43378a(0x155));}function patchResources(_0x353765,_0x5ab2f1){const _0x7a770c=a186_0x134f;let _0x53972c=![],_0x4f31ad=![];const _0x3d32e2=[];for(const _0x160d9c of _0x353765){if(isJsResource(_0x160d9c)){if(_0x5ab2f1[_0x7a770c(0x159)]&&!_0x53972c)_0x3d32e2['push'](_0x5ab2f1[_0x7a770c(0x159)]),_0x53972c=!![];else!_0x5ab2f1[_0x7a770c(0x159)]&&_0x3d32e2[_0x7a770c(0x163)](_0x160d9c);continue;}if(isCssResource(_0x160d9c)){if(_0x5ab2f1['cssUrl']&&!_0x4f31ad)_0x3d32e2[_0x7a770c(0x163)](_0x5ab2f1[_0x7a770c(0x172)]),_0x4f31ad=!![];else!_0x5ab2f1['cssUrl']&&_0x3d32e2['push'](_0x160d9c);continue;}_0x3d32e2[_0x7a770c(0x163)](_0x160d9c);}return _0x5ab2f1[_0x7a770c(0x159)]&&!_0x53972c&&_0x3d32e2[_0x7a770c(0x15f)](_0x5ab2f1[_0x7a770c(0x159)]),_0x5ab2f1[_0x7a770c(0x172)]&&!_0x4f31ad&&_0x3d32e2[_0x7a770c(0x163)](_0x5ab2f1[_0x7a770c(0x172)]),_0x3d32e2;}function isJsResource(_0x4979a5){const _0x56af31=a186_0x134f;return stripQuery(_0x4979a5)[_0x56af31(0x15a)]()[_0x56af31(0x16b)](_0x56af31(0x14d));}function isCssResource(_0x171aa2){const _0x2c2095=a186_0x134f;return stripQuery(_0x171aa2)[_0x2c2095(0x15a)]()[_0x2c2095(0x16b)](_0x2c2095(0x16a));}function stripQuery(_0x5c4287){return _0x5c4287['split']('?')[0x0]??_0x5c4287;}function a186_0x134f(_0x47599f,_0x18e572){_0x47599f=_0x47599f-0x142;const _0x190d4c=a186_0x190d();let _0x134fdb=_0x190d4c[_0x47599f];return _0x134fdb;}function parseUpdateParamsFlag(_0xbc7e0){const _0x38fab5=a186_0x134f;if(!_0xbc7e0||typeof _0xbc7e0!==_0x38fab5(0x182))return{};try{const _0x45c7f4=JSON['parse'](_0xbc7e0);if(typeof _0x45c7f4!=='object'||_0x45c7f4===null||Array[_0x38fab5(0x156)](_0x45c7f4))return{};return{'jsUrl':typeof _0x45c7f4[_0x38fab5(0x159)]==='string'?_0x45c7f4[_0x38fab5(0x159)][_0x38fab5(0x16e)]():undefined,'cssUrl':typeof _0x45c7f4[_0x38fab5(0x172)]==='string'?_0x45c7f4['cssUrl'][_0x38fab5(0x16e)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ffd51,_0x11533b){const _0x3c65a9=a187_0x3f07,_0x2432e8=_0x3ffd51();while(!![]){try{const _0x43e147=parseInt(_0x3c65a9(0x1c4))/0x1*(parseInt(_0x3c65a9(0x1c0))/0x2)+-parseInt(_0x3c65a9(0x1c6))/0x3*(-parseInt(_0x3c65a9(0x1ca))/0x4)+parseInt(_0x3c65a9(0x1cb))/0x5*(parseInt(_0x3c65a9(0x1c5))/0x6)+-parseInt(_0x3c65a9(0x1c7))/0x7+parseInt(_0x3c65a9(0x1c9))/0x8+parseInt(_0x3c65a9(0x1be))/0x9+parseInt(_0x3c65a9(0x1bf))/0xa*(-parseInt(_0x3c65a9(0x1cd))/0xb);if(_0x43e147===_0x11533b)break;else _0x2432e8['push'](_0x2432e8['shift']());}catch(_0x521aef){_0x2432e8['push'](_0x2432e8['shift']());}}}(a187_0x15a2,0x72048));function a187_0x15a2(){const _0x18ed0c=['624TyFPzZ','309PbNxfo','41188NYuRJW','cancel','40856GTPxBb','21516sGlTYy','20395KCPZEC','test','8529323ctgDDB','8322939mOkMAU','20SzmaDa','21010ZzpQRX','trim','body','GET','11bWsRmp'];a187_0x15a2=function(){return _0x18ed0c;};return a187_0x15a2();}export function isValidJsHttpsUrl(_0x5869dd){const _0x2021ff=a187_0x3f07;return/^https:\/\/.+\.js(\?.*)?$/['test'](_0x5869dd[_0x2021ff(0x1c1)]());}function a187_0x3f07(_0x3ae788,_0xc1fa1){_0x3ae788=_0x3ae788-0x1be;const _0x15a2cd=a187_0x15a2();let _0x3f079f=_0x15a2cd[_0x3ae788];return _0x3f079f;}export function isValidCssHttpsUrl(_0x1c68b0){const _0x1b383d=a187_0x3f07;return/^https:\/\/.+\.css(\?.*)?$/[_0x1b383d(0x1cc)](_0x1c68b0[_0x1b383d(0x1c1)]());}export async function isUrlReachable(_0x14a3fb){const _0x2aed8c=a187_0x3f07;try{const _0xd09046=await fetch(_0x14a3fb,{'method':'HEAD'});if(_0xd09046['ok'])return!![];}catch{}try{const _0x345aef=await fetch(_0x14a3fb,{'method':_0x2aed8c(0x1c3),'headers':{'Range':'bytes=0-0'}}),_0x37fd3f=_0x345aef['ok'];try{await _0x345aef[_0x2aed8c(0x1c2)]?.[_0x2aed8c(0x1c8)]();}catch{}return _0x37fd3f;}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a188_0x55c8be=a188_0x538f;(function(_0x9901eb,_0x34521a){const _0xfbbb99=a188_0x538f,_0x49faf4=_0x9901eb();while(!![]){try{const _0x2d3af4=parseInt(_0xfbbb99(0x1ec))/0x1+parseInt(_0xfbbb99(0x1e1))/0x2*(parseInt(_0xfbbb99(0x1e8))/0x3)+parseInt(_0xfbbb99(0x1e2))/0x4*(parseInt(_0xfbbb99(0x1ee))/0x5)+-parseInt(_0xfbbb99(0x1df))/0x6+parseInt(_0xfbbb99(0x1ed))/0x7+parseInt(_0xfbbb99(0x1e4))/0x8*(parseInt(_0xfbbb99(0x1e5))/0x9)+-parseInt(_0xfbbb99(0x1eb))/0xa*(parseInt(_0xfbbb99(0x1e3))/0xb);if(_0x2d3af4===_0x34521a)break;else _0x49faf4['push'](_0x49faf4['shift']());}catch(_0x341d4f){_0x49faf4['push'](_0x49faf4['shift']());}}}(a188_0x3366,0xa9123));function a188_0x3366(){const _0x3dee13=['24838JiiPAz','3222264DkTMwm','18HtlkqY','all','subapp-assets-status','6hMPAed','\x20menu(s)\x20for\x20','\x20in\x20menu\x20host\x20','16220effJgM','670305VMRDBI','9003484CxnTfR','446920QnCDdu','cookie','read','3063396NljZSs','Inspected\x20','1120250zAwAML','44WoFbTI'];a188_0x3366=function(){return _0x3dee13;};return a188_0x3366();}import{getSmartAppRecord}from'../../core/api-client.js';import{getOnlineMenuList}from'../../commands/menu/shared/service.js';function a188_0x538f(_0x517938,_0xe85ce4){_0x517938=_0x517938-0x1df;const _0x3366ac=a188_0x3366();let _0x538f81=_0x3366ac[_0x517938];return _0x538f81;}import{buildSubappAssetsStatus,getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';export const menuSubappAssetsStatus={'service':'menu','command':a188_0x55c8be(0x1e7),'description':'Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','risk':a188_0x55c8be(0x1f0),'strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x79d42b){getSubappSelector(_0x79d42b);},async 'execute'(_0x254068){const _0x284e46=a188_0x55c8be,{appCode:_0x255bff,appName:_0x159539}=getSubappSelector(_0x254068),[_0x32fdd5,_0x29ee8a]=await Promise[_0x284e46(0x1e6)]([getSmartAppRecord(_0x255bff,_0x254068[_0x284e46(0x1ef)]),getOnlineMenuList(_0x255bff,_0x254068[_0x284e46(0x1ef)])]),_0x30dc90={'appCode':_0x255bff,...buildSubappAssetsStatus(_0x32fdd5,_0x29ee8a,_0x159539)};return{'ok':!![],'data':_0x30dc90,'message':_0x284e46(0x1e0)+_0x30dc90['boundMenus']+_0x284e46(0x1e9)+_0x159539+_0x284e46(0x1ea)+_0x255bff+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a188_0x36c5(_0x1eeef0,_0x42a529){_0x1eeef0=_0x1eeef0-0x9c;const _0x179f20=a188_0x179f();let _0x36c5a1=_0x179f20[_0x1eeef0];return _0x36c5a1;}const a188_0x28fd08=a188_0x36c5;(function(_0x2689c5,_0x285a02){const _0x4c2c2f=a188_0x36c5,_0x3f7af2=_0x2689c5();while(!![]){try{const _0x5b4735=-parseInt(_0x4c2c2f(0xad))/0x1+parseInt(_0x4c2c2f(0xbe))/0x2+parseInt(_0x4c2c2f(0xa7))/0x3+parseInt(_0x4c2c2f(0xa5))/0x4+parseInt(_0x4c2c2f(0xba))/0x5*(-parseInt(_0x4c2c2f(0xda))/0x6)+parseInt(_0x4c2c2f(0xb4))/0x7+parseInt(_0x4c2c2f(0xe7))/0x8;if(_0x5b4735===_0x285a02)break;else _0x3f7af2['push'](_0x3f7af2['shift']());}catch(_0x455646){_0x3f7af2['push'](_0x3f7af2['shift']());}}}(a188_0x179f,0x53d0a));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';function a188_0x179f(){const _0x515753=['verified\x20app.extend','apiError','Unknown\x20app.extend\x20fields:\x20','str','expectedHash','Updated\x20shared\x20resources\x20for\x20','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','filter','test','1825260Ralqyb','some','1190733OeZZiH','stringify','extend','enableAutoSync','\x20must\x20be\x20a\x20JSON\x20array.','protocol','598214NERAjO','validation','map','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','sha256','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','update','2096087cUswuJ',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','app.extend','resources','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','subapp-assets-update','955615KcUqkW','join','size','enableSample','715288gkahiO','POST','appName','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','directDbEnabled','has','before','isArray','unchanged','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','tenantColumn','parse','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.','https:','--resources\x20is\x20required.',';\x20independent\x20deployment\x20not\x20verified.','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','app.extend.assets','accessKey','expected-hash','not\x20HTTPS','write','skinColor','length','directDbId','cookie','\x20contains\x20invalid\x20JSON.','18JHkrNQ','isSafeInteger','entries','appPublishStatus',']\x20must\x20be\x20a\x20URL\x20string.','string','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','digest','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','trim','appCode','assets','36624mueoiv','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','resources['];a188_0x179f=function(){return _0x515753;};return a188_0x179f();}import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a188_0x28fd08(0xd5),'enableOpenApi',a188_0x28fd08(0xd1),a188_0x28fd08(0xe6),a188_0x28fd08(0xc8),a188_0x28fd08(0xbd),'vipDeploy',a188_0x28fd08(0xaa),a188_0x28fd08(0xd7),a188_0x28fd08(0xc2)]);function parseObject(_0x3fcb47,_0x191a40){const _0x15881d=a188_0x28fd08;let _0x2c1776=_0x3fcb47;if(typeof _0x3fcb47==='string')try{_0x2c1776=JSON['parse'](_0x3fcb47);}catch{throw CliErrors['validation'](_0x191a40+_0x15881d(0xd9));}if(!_0x2c1776||typeof _0x2c1776!=='object'||Array[_0x15881d(0xc5)](_0x2c1776))throw CliErrors[_0x15881d(0xae)](_0x191a40+'\x20must\x20be\x20a\x20JSON\x20object.');return _0x2c1776;}function parseArray(_0x40fa52,_0x47601d){const _0x383b93=a188_0x28fd08;let _0x37dd82;try{_0x37dd82=JSON[_0x383b93(0xc9)](_0x40fa52);}catch{throw CliErrors[_0x383b93(0xae)](_0x47601d+_0x383b93(0xd9));}if(!Array[_0x383b93(0xc5)](_0x37dd82))throw CliErrors[_0x383b93(0xae)](_0x47601d+_0x383b93(0xab));return _0x37dd82[_0x383b93(0xaf)]((_0x99791f,_0xbd61c0)=>parseObject(_0x99791f,_0x47601d+'['+_0xbd61c0+']'));}function validateResources(_0x1aa170){const _0x27cec4=a188_0x28fd08;if(_0x1aa170[_0x27cec4(0xd6)]===0x0)throw CliErrors[_0x27cec4(0xae)](_0x27cec4(0xe2));for(const [_0x21e0da,_0x4130d9]of _0x1aa170[_0x27cec4(0xdc)]()){if(typeof _0x4130d9!==_0x27cec4(0xdf))throw CliErrors[_0x27cec4(0xae)](_0x27cec4(0xe9)+_0x21e0da+_0x27cec4(0xde));try{if(new URL(_0x4130d9)[_0x27cec4(0xac)]!==_0x27cec4(0xcc))throw new Error(_0x27cec4(0xd3));}catch{throw CliErrors[_0x27cec4(0xae)](_0x27cec4(0xe9)+_0x21e0da+_0x27cec4(0xb5));}}if(new Set(_0x1aa170)[_0x27cec4(0xbc)]!==_0x1aa170['length']||!_0x1aa170[_0x27cec4(0xa6)](_0x52ebcf=>/\.m?js(?:[?#]|$)/i['test'](_0x52ebcf)))throw CliErrors[_0x27cec4(0xae)](_0x27cec4(0xe8));return _0x1aa170;}function prepare(_0x18321c,_0x3b7bb8,_0x2dc28c){const _0x2cf90d=a188_0x28fd08;if(!Number[_0x2cf90d(0xdb)](_0x18321c['id'])||(_0x18321c['id']??0x0)<=0x0||typeof _0x18321c[_0x2cf90d(0xdd)]!=='string'||!_0x18321c[_0x2cf90d(0xdd)])throw CliErrors['validation'](_0x2cf90d(0xc7));const _0x5bc04f=parseObject(_0x18321c[_0x2cf90d(0xa9)],_0x2cf90d(0xb6)),_0x5042da=Object['keys'](_0x5bc04f)[_0x2cf90d(0xa3)](_0x1b49a4=>!KNOWN_EXTEND_KEYS[_0x2cf90d(0xc3)](_0x1b49a4));if(_0x5042da['length'])throw CliErrors[_0x2cf90d(0xae)](_0x2cf90d(0x9d)+_0x5042da[_0x2cf90d(0xbb)](',\x20')+'.\x20Refusing\x20update.');if(typeof _0x5bc04f[_0x2cf90d(0xe6)]!=='string')throw CliErrors[_0x2cf90d(0xae)](_0x2cf90d(0xa2));const _0x2007e4=parseArray(_0x5bc04f[_0x2cf90d(0xe6)],_0x2cf90d(0xd0)),_0x260aad=_0x2007e4[_0x2cf90d(0xa3)](_0x5367c0=>_0x5367c0[_0x2cf90d(0xc0)]===_0x3b7bb8);if(_0x260aad['length']!==0x1)throw CliErrors[_0x2cf90d(0xae)](_0x2cf90d(0xa1)+_0x3b7bb8+';\x20found\x20'+_0x260aad[_0x2cf90d(0xd6)]+'.');const _0x3b7123=_0x260aad[0x0];if(typeof _0x3b7123[_0x2cf90d(0xb7)]!==_0x2cf90d(0xdf))throw CliErrors[_0x2cf90d(0xae)](_0x2cf90d(0xb8));let _0x1bad4d;try{_0x1bad4d=JSON[_0x2cf90d(0xc9)](_0x3b7123['resources']);}catch{throw CliErrors[_0x2cf90d(0xae)](_0x2cf90d(0xcf));}if(!Array[_0x2cf90d(0xc5)](_0x1bad4d)||_0x1bad4d['some'](_0xba45ee=>typeof _0xba45ee!==_0x2cf90d(0xdf)))throw CliErrors[_0x2cf90d(0xae)]('Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.');const _0x26cc85=_0x2007e4['map'](_0x52b86f=>_0x52b86f===_0x3b7123?{..._0x52b86f,'resources':JSON[_0x2cf90d(0xa8)](_0x2dc28c)}:_0x52b86f),_0x14ebb7={..._0x5bc04f,'assets':JSON['stringify'](_0x26cc85)},_0x56a966=createHash(_0x2cf90d(0xb1))[_0x2cf90d(0xb3)](JSON[_0x2cf90d(0xa8)]({'appCode':_0x18321c[_0x2cf90d(0xe5)],'id':_0x18321c['id'],'appPublishStatus':_0x18321c[_0x2cf90d(0xdd)],'extend':_0x5bc04f,'appName':_0x3b7bb8,'resources':_0x2dc28c}))[_0x2cf90d(0xe1)]('hex');return{'before':_0x1bad4d,'nextExtend':_0x14ebb7,'expectedHash':_0x56a966,'unchanged':isDeepStrictEqual(_0x1bad4d,_0x2dc28c)};}function flags(_0x3f843f){const _0x19c2a7=a188_0x28fd08,{appCode:_0x433618,appName:_0x590254}=getSubappSelector(_0x3f843f),_0xd612a2=_0x3f843f[_0x19c2a7(0x9e)]('resources')[_0x19c2a7(0xe4)]();if(!_0xd612a2)throw CliErrors[_0x19c2a7(0xae)](_0x19c2a7(0xcd));let _0x531602;try{_0x531602=JSON[_0x19c2a7(0xc9)](_0xd612a2);}catch{throw CliErrors[_0x19c2a7(0xae)](_0x19c2a7(0xe3));}if(!Array['isArray'](_0x531602))throw CliErrors[_0x19c2a7(0xae)](_0x19c2a7(0xe3));return{'appCode':_0x433618,'appName':_0x590254,'resources':validateResources(_0x531602)};}export const menuSubappAssetsUpdate={'service':'menu','command':a188_0x28fd08(0xb9),'description':a188_0x28fd08(0xb0),'risk':a188_0x28fd08(0xd4),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':'resources','type':'string','required':!![],'description':'JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs'},{'name':a188_0x28fd08(0xd2),'type':'string','description':a188_0x28fd08(0xc1)}],async 'validate'(_0x16749e){flags(_0x16749e);},async 'dryRun'(_0x6dc7f3){const _0x13d6a5=a188_0x28fd08,{appCode:_0x4f0e2e,appName:_0x9a432,resources:_0x8ec3e1}=flags(_0x6dc7f3),_0x2bbdba=await getSmartAppRecord(_0x4f0e2e,_0x6dc7f3[_0x13d6a5(0xd8)]),_0x55a165=prepare(_0x2bbdba,_0x9a432,_0x8ec3e1);return{'method':_0x13d6a5(0xbf),'url':'/smartapi/app/update','body':{'preview':{'appCode':_0x4f0e2e,'appName':_0x9a432,'before':_0x55a165[_0x13d6a5(0xc4)],'after':_0x8ec3e1,'expectedHash':_0x55a165[_0x13d6a5(0x9f)],'unchanged':_0x55a165[_0x13d6a5(0xc6)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x55a165['unchanged']?_0x13d6a5(0xb2):'Would\x20update\x20shared\x20assets\x20for\x20'+_0x9a432+'.'};},async 'execute'(_0x24913f){const _0x797f53=a188_0x28fd08,{appCode:_0x2945f9,appName:_0x24f486,resources:_0x578d70}=flags(_0x24913f),_0xe4b2d4=_0x24913f[_0x797f53(0x9e)](_0x797f53(0xd2))['trim']();if(!/^[a-f0-9]{64}$/i[_0x797f53(0xa4)](_0xe4b2d4))throw CliErrors['validation'](_0x797f53(0xca));const _0x12ca64=await getSmartAppRecord(_0x2945f9,_0x24913f[_0x797f53(0xd8)]),_0x1cb9e5=prepare(_0x12ca64,_0x24f486,_0x578d70);if(_0xe4b2d4!==_0x1cb9e5[_0x797f53(0x9f)])throw CliErrors['validation'](_0x797f53(0xcb));if(_0x1cb9e5[_0x797f53(0xc6)])return{'ok':!![],'data':{'appCode':_0x2945f9,'appName':_0x24f486,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x797f53(0xe0)};await updateSmartAppRecord({'id':_0x12ca64['id'],'appCode':_0x2945f9,'appPublishStatus':_0x12ca64[_0x797f53(0xdd)],'extend':_0x1cb9e5['nextExtend']},_0x24913f[_0x797f53(0xd8)]);const _0x42b259=await getSmartAppRecord(_0x2945f9,_0x24913f[_0x797f53(0xd8)]),_0x5c0032=parseObject(_0x42b259['extend'],_0x797f53(0xea));if(_0x42b259['id']!==_0x12ca64['id']||_0x42b259[_0x797f53(0xdd)]!==_0x12ca64[_0x797f53(0xdd)]||!isDeepStrictEqual(_0x5c0032,_0x1cb9e5['nextExtend']))throw CliErrors[_0x797f53(0x9c)]('App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.');return{'ok':!![],'data':{'appCode':_0x2945f9,'appName':_0x24f486,'updated':!![],'resources':_0x578d70,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x797f53(0xa0)+_0x24f486+'\x20in\x20menu\x20host\x20'+_0x2945f9+_0x797f53(0xce)};}};
|
|
1
|
+
const a189_0x4135b7=a189_0x11aa;(function(_0x5d62d8,_0x49ad84){const _0x395681=a189_0x11aa,_0xf7c065=_0x5d62d8();while(!![]){try{const _0x3ffb98=parseInt(_0x395681(0x1f4))/0x1*(parseInt(_0x395681(0x1d9))/0x2)+-parseInt(_0x395681(0x1ee))/0x3+parseInt(_0x395681(0x1cb))/0x4*(parseInt(_0x395681(0x1e6))/0x5)+parseInt(_0x395681(0x1fc))/0x6+parseInt(_0x395681(0x208))/0x7+-parseInt(_0x395681(0x1e7))/0x8+parseInt(_0x395681(0x207))/0x9;if(_0x3ffb98===_0x49ad84)break;else _0xf7c065['push'](_0xf7c065['shift']());}catch(_0x17ace5){_0xf7c065['push'](_0xf7c065['shift']());}}}(a189_0x3d4a,0x97d6e));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';function a189_0x3d4a(){const _0x344a75=['Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','Updated\x20shared\x20resources\x20for\x20','expected-hash','\x20contains\x20invalid\x20JSON.','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','1423431MhAzji','App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.','appPublishStatus','resources[','object','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','1346SwAVXJ','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','before','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','appName','extend','app.extend','stringify','4120932jjOVSx','enableAutoSync','apiError','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','appCode','sha256','validation','length','resources','directDbEnabled','trim','23427tVfHeJ','583667gghbIC','\x20must\x20be\x20a\x20JSON\x20object.','--resources\x20is\x20required.','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','str','map','parse','unchanged','string','expectedHash','verified\x20app.extend','menu','enableOpenApi',']\x20must\x20be\x20a\x20URL\x20string.','hex','/smartapi/app/update','44HfueIw','nextExtend','write','cookie','update','some','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','entries','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','tenantColumn','assets','skinColor','438sUsoZp','join',';\x20independent\x20deployment\x20not\x20verified.','app.extend.assets','filter','isSafeInteger','enableSample','test','isArray','.\x20Refusing\x20update.','\x20must\x20be\x20a\x20JSON\x20array.',';\x20found\x20','subapp-assets-update','166485eAMbcF','2699488DTAsWB','protocol'];a189_0x3d4a=function(){return _0x344a75;};return a189_0x3d4a();}import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a189_0x4135b7(0x1d8),a189_0x4135b7(0x1c7),'accessKey','assets',a189_0x4135b7(0x1d6),a189_0x4135b7(0x1df),'vipDeploy',a189_0x4135b7(0x1fd),'directDbId',a189_0x4135b7(0x205)]);function parseObject(_0x16e62d,_0x5d3e5e){const _0x44a8d5=a189_0x4135b7;let _0x2072eb=_0x16e62d;if(typeof _0x16e62d===_0x44a8d5(0x1c3))try{_0x2072eb=JSON[_0x44a8d5(0x20f)](_0x16e62d);}catch{throw CliErrors[_0x44a8d5(0x202)](_0x5d3e5e+_0x44a8d5(0x1ec));}if(!_0x2072eb||typeof _0x2072eb!==_0x44a8d5(0x1f2)||Array[_0x44a8d5(0x1e1)](_0x2072eb))throw CliErrors['validation'](_0x5d3e5e+_0x44a8d5(0x209));return _0x2072eb;}function a189_0x11aa(_0x410eb8,_0x5ef039){_0x410eb8=_0x410eb8-0x1c2;const _0x3d4a82=a189_0x3d4a();let _0x11aa38=_0x3d4a82[_0x410eb8];return _0x11aa38;}function parseArray(_0x118bfe,_0x5b0ba6){const _0x3a47f8=a189_0x4135b7;let _0x20bf9b;try{_0x20bf9b=JSON[_0x3a47f8(0x20f)](_0x118bfe);}catch{throw CliErrors[_0x3a47f8(0x202)](_0x5b0ba6+'\x20contains\x20invalid\x20JSON.');}if(!Array[_0x3a47f8(0x1e1)](_0x20bf9b))throw CliErrors[_0x3a47f8(0x202)](_0x5b0ba6+_0x3a47f8(0x1e3));return _0x20bf9b[_0x3a47f8(0x20e)]((_0x15f508,_0x3e18fb)=>parseObject(_0x15f508,_0x5b0ba6+'['+_0x3e18fb+']'));}function validateResources(_0x4952fb){const _0x50e762=a189_0x4135b7;if(_0x4952fb['length']===0x0)throw CliErrors[_0x50e762(0x202)]('At\x20least\x20one\x20resource\x20URL\x20is\x20required.');for(const [_0xfaf047,_0x24952c]of _0x4952fb[_0x50e762(0x1d2)]()){if(typeof _0x24952c!==_0x50e762(0x1c3))throw CliErrors['validation']('resources['+_0xfaf047+_0x50e762(0x1c8));try{if(new URL(_0x24952c)[_0x50e762(0x1e8)]!=='https:')throw new Error('not\x20HTTPS');}catch{throw CliErrors['validation'](_0x50e762(0x1f1)+_0xfaf047+']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.');}}if(new Set(_0x4952fb)['size']!==_0x4952fb[_0x50e762(0x203)]||!_0x4952fb[_0x50e762(0x1d0)](_0x2fe4e5=>/\.m?js(?:[?#]|$)/i['test'](_0x2fe4e5)))throw CliErrors['validation'](_0x50e762(0x1f3));return _0x4952fb;}function prepare(_0x135944,_0x3aa5b0,_0x1953d1){const _0x5167b8=a189_0x4135b7;if(!Number[_0x5167b8(0x1de)](_0x135944['id'])||(_0x135944['id']??0x0)<=0x0||typeof _0x135944['appPublishStatus']!==_0x5167b8(0x1c3)||!_0x135944[_0x5167b8(0x1f0)])throw CliErrors['validation'](_0x5167b8(0x1d1));const _0x2f9c77=parseObject(_0x135944[_0x5167b8(0x1f9)],_0x5167b8(0x1fa)),_0x19cb3d=Object['keys'](_0x2f9c77)[_0x5167b8(0x1dd)](_0x26982e=>!KNOWN_EXTEND_KEYS['has'](_0x26982e));if(_0x19cb3d[_0x5167b8(0x203)])throw CliErrors[_0x5167b8(0x202)]('Unknown\x20app.extend\x20fields:\x20'+_0x19cb3d[_0x5167b8(0x1da)](',\x20')+_0x5167b8(0x1e2));if(typeof _0x2f9c77[_0x5167b8(0x1d7)]!==_0x5167b8(0x1c3))throw CliErrors['validation'](_0x5167b8(0x20c));const _0x173531=parseArray(_0x2f9c77[_0x5167b8(0x1d7)],_0x5167b8(0x1dc)),_0x339b1c=_0x173531[_0x5167b8(0x1dd)](_0xc6ac53=>_0xc6ac53[_0x5167b8(0x1f8)]===_0x3aa5b0);if(_0x339b1c[_0x5167b8(0x203)]!==0x1)throw CliErrors[_0x5167b8(0x202)](_0x5167b8(0x1d4)+_0x3aa5b0+_0x5167b8(0x1e4)+_0x339b1c[_0x5167b8(0x203)]+'.');const _0x304fe0=_0x339b1c[0x0];if(typeof _0x304fe0[_0x5167b8(0x204)]!==_0x5167b8(0x1c3))throw CliErrors['validation'](_0x5167b8(0x1f7));let _0x19170e;try{_0x19170e=JSON[_0x5167b8(0x20f)](_0x304fe0[_0x5167b8(0x204)]);}catch{throw CliErrors['validation'](_0x5167b8(0x1ed));}if(!Array['isArray'](_0x19170e)||_0x19170e[_0x5167b8(0x1d0)](_0x46d629=>typeof _0x46d629!=='string'))throw CliErrors[_0x5167b8(0x202)](_0x5167b8(0x1f5));const _0x38ee6f=_0x173531[_0x5167b8(0x20e)](_0xb5393c=>_0xb5393c===_0x304fe0?{..._0xb5393c,'resources':JSON[_0x5167b8(0x1fb)](_0x1953d1)}:_0xb5393c),_0x46102c={..._0x2f9c77,'assets':JSON['stringify'](_0x38ee6f)},_0x115215=createHash(_0x5167b8(0x201))[_0x5167b8(0x1cf)](JSON[_0x5167b8(0x1fb)]({'appCode':_0x135944[_0x5167b8(0x200)],'id':_0x135944['id'],'appPublishStatus':_0x135944['appPublishStatus'],'extend':_0x2f9c77,'appName':_0x3aa5b0,'resources':_0x1953d1}))['digest'](_0x5167b8(0x1c9));return{'before':_0x19170e,'nextExtend':_0x46102c,'expectedHash':_0x115215,'unchanged':isDeepStrictEqual(_0x19170e,_0x1953d1)};}function flags(_0x19fe7b){const _0x43a965=a189_0x4135b7,{appCode:_0x27233c,appName:_0x5a2c9e}=getSubappSelector(_0x19fe7b),_0x231f23=_0x19fe7b[_0x43a965(0x20d)]('resources')[_0x43a965(0x206)]();if(!_0x231f23)throw CliErrors[_0x43a965(0x202)](_0x43a965(0x20a));let _0x36a7d4;try{_0x36a7d4=JSON[_0x43a965(0x20f)](_0x231f23);}catch{throw CliErrors[_0x43a965(0x202)]('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');}if(!Array[_0x43a965(0x1e1)](_0x36a7d4))throw CliErrors[_0x43a965(0x202)](_0x43a965(0x1d3));return{'appCode':_0x27233c,'appName':_0x5a2c9e,'resources':validateResources(_0x36a7d4)};}export const menuSubappAssetsUpdate={'service':a189_0x4135b7(0x1c6),'command':a189_0x4135b7(0x1e5),'description':'Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','risk':a189_0x4135b7(0x1cd),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a189_0x4135b7(0x204),'type':a189_0x4135b7(0x1c3),'required':!![],'description':a189_0x4135b7(0x1ff)},{'name':a189_0x4135b7(0x1eb),'type':a189_0x4135b7(0x1c3),'description':a189_0x4135b7(0x1e9)}],async 'validate'(_0x457146){flags(_0x457146);},async 'dryRun'(_0x1cf194){const _0xc57855=a189_0x4135b7,{appCode:_0x4e6c73,appName:_0x4ee43d,resources:_0x259674}=flags(_0x1cf194),_0x79b96b=await getSmartAppRecord(_0x4e6c73,_0x1cf194[_0xc57855(0x1ce)]),_0x1cb904=prepare(_0x79b96b,_0x4ee43d,_0x259674);return{'method':'POST','url':_0xc57855(0x1ca),'body':{'preview':{'appCode':_0x4e6c73,'appName':_0x4ee43d,'before':_0x1cb904[_0xc57855(0x1f6)],'after':_0x259674,'expectedHash':_0x1cb904[_0xc57855(0x1c4)],'unchanged':_0x1cb904[_0xc57855(0x1c2)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x1cb904[_0xc57855(0x1c2)]?_0xc57855(0x1d5):'Would\x20update\x20shared\x20assets\x20for\x20'+_0x4ee43d+'.'};},async 'execute'(_0x7f4dbf){const _0xada29f=a189_0x4135b7,{appCode:_0x373d1e,appName:_0x909c4,resources:_0x54def6}=flags(_0x7f4dbf),_0xb5f5f9=_0x7f4dbf[_0xada29f(0x20d)](_0xada29f(0x1eb))['trim']();if(!/^[a-f0-9]{64}$/i[_0xada29f(0x1e0)](_0xb5f5f9))throw CliErrors[_0xada29f(0x202)](_0xada29f(0x20b));const _0x24d86d=await getSmartAppRecord(_0x373d1e,_0x7f4dbf[_0xada29f(0x1ce)]),_0x431da6=prepare(_0x24d86d,_0x909c4,_0x54def6);if(_0xb5f5f9!==_0x431da6[_0xada29f(0x1c4)])throw CliErrors[_0xada29f(0x202)]('App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.');if(_0x431da6['unchanged'])return{'ok':!![],'data':{'appCode':_0x373d1e,'appName':_0x909c4,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':'Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.'};await updateSmartAppRecord({'id':_0x24d86d['id'],'appCode':_0x373d1e,'appPublishStatus':_0x24d86d[_0xada29f(0x1f0)],'extend':_0x431da6[_0xada29f(0x1cc)]},_0x7f4dbf['cookie']);const _0x24b511=await getSmartAppRecord(_0x373d1e,_0x7f4dbf[_0xada29f(0x1ce)]),_0x2261e9=parseObject(_0x24b511[_0xada29f(0x1f9)],_0xada29f(0x1c5));if(_0x24b511['id']!==_0x24d86d['id']||_0x24b511[_0xada29f(0x1f0)]!==_0x24d86d[_0xada29f(0x1f0)]||!isDeepStrictEqual(_0x2261e9,_0x431da6[_0xada29f(0x1cc)]))throw CliErrors[_0xada29f(0x1fe)](_0xada29f(0x1ef));return{'ok':!![],'data':{'appCode':_0x373d1e,'appName':_0x909c4,'updated':!![],'resources':_0x54def6,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0xada29f(0x1ea)+_0x909c4+'\x20in\x20menu\x20host\x20'+_0x373d1e+_0xada29f(0x1db)};}};
|