@lovrabet/rabetbase-cli 2.5.6-beta.1 → 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/README.md +15 -1
- 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.d.ts +1 -0
- package/lib/commands/dataset/design-context.js +1 -0
- package/lib/commands/dataset/design-start.d.ts +1 -0
- package/lib/commands/dataset/design-start.js +1 -0
- package/lib/commands/dataset/design-status.d.ts +1 -0
- package/lib/commands/dataset/design-status.js +1 -0
- package/lib/commands/dataset/design-sync-retry.d.ts +1 -0
- package/lib/commands/dataset/design-sync-retry.js +1 -0
- package/lib/commands/dataset/design-sync-status.d.ts +1 -0
- package/lib/commands/dataset/design-sync-status.js +1 -0
- package/lib/commands/dataset/design-validate.d.ts +1 -0
- package/lib/commands/dataset/design-validate.js +1 -0
- 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 +37 -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.d.ts +17 -0
- package/lib/services/dataset-design/checkpoint.js +1 -0
- package/lib/services/dataset-design/commands.d.ts +6 -0
- package/lib/services/dataset-design/commands.js +1 -0
- package/lib/services/dataset-design/contract.d.ts +7 -0
- package/lib/services/dataset-design/contract.js +1 -0
- 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 +3 -2
- package/skills/rabetbase/SKILL.md +11 -7
- 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-dataset-design.md +25 -0
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +2 -255
- 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 +45 -0
- package/skills/rabetbase-dataset-generation/references/workflow.md +60 -0
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +6 -3
|
@@ -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 a173_0x477942=a173_0xa6ff;(function(_0x2ea76d,_0x15548d){const _0x1724cb=a173_0xa6ff,_0x23263a=_0x2ea76d();while(!![]){try{const _0x8f8b2c=-parseInt(_0x1724cb(0x174))/0x1*(parseInt(_0x1724cb(0x14c))/0x2)+parseInt(_0x1724cb(0x124))/0x3*(parseInt(_0x1724cb(0x164))/0x4)+parseInt(_0x1724cb(0x172))/0x5+-parseInt(_0x1724cb(0x143))/0x6*(-parseInt(_0x1724cb(0x183))/0x7)+parseInt(_0x1724cb(0x12c))/0x8+-parseInt(_0x1724cb(0x17e))/0x9+parseInt(_0x1724cb(0x11e))/0xa;if(_0x8f8b2c===_0x15548d)break;else _0x23263a['push'](_0x23263a['shift']());}catch(_0x2d2fcd){_0x23263a['push'](_0x23263a['shift']());}}}(a173_0xcf53,0x7feaa));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':a173_0x477942(0x17b),'required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':a173_0x477942(0x169),'type':a173_0x477942(0x17b),'description':'Sibling\x20sort\x20value\x20(non-negative\x20integer)'};export const MENU_PARENT_ID_FLAG={'name':a173_0x477942(0x120),'type':'string','description':a173_0x477942(0x180)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a173_0x477942(0x157),'type':'string','description':a173_0x477942(0x144)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a173_0x477942(0x160),'type':a173_0x477942(0x16d),'description':'Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches'},{'name':a173_0x477942(0x136),'type':a173_0x477942(0x17b),'description':a173_0x477942(0x121)}];export function validateExactId(_0x35c44e){const _0x39bab4=a173_0x477942,_0xc94f04=_0x35c44e[_0x39bab4(0x16a)]('id');if(!Number[_0x39bab4(0x16b)](_0xc94f04)||_0xc94f04<=0x0)throw CliErrors[_0x39bab4(0x156)](_0x39bab4(0x166));return _0xc94f04;}export function validateSort(_0x33fec9,_0x477c21=a173_0x477942(0x169)){const _0x17b3e7=a173_0x477942;if(!hasFlag(_0x33fec9,_0x477c21))return undefined;const _0x45c83c=_0x33fec9[_0x17b3e7(0x16a)](_0x477c21);if(!Number['isSafeInteger'](_0x45c83c)||_0x45c83c<0x0||_0x45c83c>MAX_MENU_SORT)throw menuError(_0x17b3e7(0x14d),'--'+_0x477c21+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x17b3e7(0x173));return _0x45c83c;}export function nextSiblingSort(_0x279864,_0x2e17e8,_0x1b3530){const _0x5607bd=a173_0x477942,_0x2f5a92=getChildren(_0x279864,_0x2e17e8)[_0x5607bd(0x15b)](_0x594add=>_0x594add[_0x5607bd(0x169)])['filter'](_0x412d52=>typeof _0x412d52===_0x5607bd(0x17b));if(_0x2f5a92[_0x5607bd(0x127)]===0x0)return 0x0;const _0x4ec06a=Math['max'](..._0x2f5a92);if(_0x4ec06a>=MAX_MENU_SORT)throw menuError('menu_sort_overflow',_0x5607bd(0x15f)+_0x1b3530+'\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20'+_0x4ec06a+'.',_0x5607bd(0x181)+MAX_MENU_SORT+_0x5607bd(0x16c));return _0x4ec06a+0x1;}export function requireExplicitYes(_0x33bd04){const _0x13327a=a173_0x477942;if(_0x33bd04['bool'](_0x13327a(0x14f)))return;if(!_0x33bd04['bool'](_0x13327a(0x184)))throw menuError(_0x13327a(0x133),'This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}function a173_0xa6ff(_0x286bef,_0x4181df){_0x286bef=_0x286bef-0x11e;const _0xcf53a0=a173_0xcf53();let _0xa6ff80=_0xcf53a0[_0x286bef];return _0xa6ff80;}export async function fetchMutationSnapshot(_0x22f166,_0x38c654,_0x3870c8){const _0x5a31a9=a173_0x477942;try{return await fetchMenuSnapshot(_0x22f166[_0x5a31a9(0x178)],_0x22f166[_0x5a31a9(0x13a)]);}catch(_0x317816){throw mapMenuApiError(_0x317816,'read\x20online\x20menu\x20facts\x20before\x20'+_0x38c654,_0x3870c8);}}export async function recheckMutationSnapshot(_0x2febcd,_0x1fddd2,_0x2afb5e,_0x4dc087){const _0x199176=a173_0x477942;let _0x2c1181;try{_0x2c1181=await fetchMenuSnapshot(_0x2febcd[_0x199176(0x178)],_0x2febcd[_0x199176(0x13a)]);}catch(_0x17c563){const _0x1d5a54=mapMenuApiError(_0x17c563,_0x199176(0x13b)+_0x2afb5e,_0x4dc087);throw menuFailure(_0x1d5a54,_0x1fddd2,{'stage':_0x199176(0x163),'failed':_0x4dc087==null?{}:{'id':_0x4dc087}});}if(_0x2c1181[_0x199176(0x12b)]!==_0x1fddd2['snapshotHash']){const _0x1ba4d9=menuError(_0x199176(0x182),_0x199176(0x135)+_0x2afb5e+_0x199176(0x153),_0x199176(0x12f));throw menuFailure(_0x1ba4d9,_0x1fddd2,{'stage':'pre-write-recheck','failed':{..._0x4dc087==null?{}:{'id':_0x4dc087},'expectedSnapshotHash':_0x1fddd2[_0x199176(0x134)],'currentSnapshotHash':_0x2c1181['hash']}});}return _0x2c1181;}export function parseParentId(_0x4f96b1,_0x45308d,_0x1bfa5d={}){const _0x434b16=a173_0x477942;if(!hasFlag(_0x4f96b1,_0x45308d)){if(_0x1bfa5d[_0x434b16(0x138)])throw CliErrors[_0x434b16(0x13e)](_0x45308d);return undefined;}const _0xa9f0e4=_0x4f96b1[_0x434b16(0x12e)](_0x45308d)[_0x434b16(0x187)]();if(_0xa9f0e4['toLowerCase']()===_0x434b16(0x152))return null;if(!/^\d+$/['test'](_0xa9f0e4))throw CliErrors[_0x434b16(0x156)]('--'+_0x45308d+_0x434b16(0x170));const _0x312d32=Number(_0xa9f0e4);if(!Number[_0x434b16(0x16b)](_0x312d32)||_0x312d32<=0x0)throw CliErrors['validation']('--'+_0x45308d+_0x434b16(0x170));return _0x312d32;}export function requireMenu(_0x1c2cd6,_0x4f30cf){const _0x2f5a20=a173_0x477942,_0x5eaf29=_0x1c2cd6[_0x2f5a20(0x14b)][_0x2f5a20(0x176)](_0x4f30cf);if(!_0x5eaf29)throw menuError(_0x2f5a20(0x126),_0x2f5a20(0x123)+_0x4f30cf,_0x2f5a20(0x145));return _0x5eaf29;}export function requireFolder(_0x4c0239,_0x20b79a){const _0x541f48=a173_0x477942,_0x3bbbdb=requireMenu(_0x4c0239,_0x20b79a);if(_0x3bbbdb['type']!==_0x541f48(0x155))throw menuError(_0x541f48(0x128),_0x541f48(0x177)+_0x20b79a+_0x541f48(0x16e)+(_0x3bbbdb[_0x541f48(0x17c)]||_0x541f48(0x185))+_0x541f48(0x137),_0x541f48(0x159));return _0x3bbbdb;}export function assertExpectedState(_0x350507,_0x53d0b5){const _0x100ed7=a173_0x477942;if(hasFlag(_0x350507,'expect-parent-id')){const _0xd78b3b=parseParentId(_0x350507,_0x100ed7(0x157),{'required':!![]});if(_0x53d0b5[_0x100ed7(0x15e)]!==_0xd78b3b)throw stateDrift('Menu\x20'+_0x53d0b5['id']+_0x100ed7(0x17a)+formatParent(_0xd78b3b)+_0x100ed7(0x179)+formatParent(_0x53d0b5['parentId'])+'.');}if(hasFlag(_0x350507,_0x100ed7(0x160))){const _0x27a87b=_0x350507[_0x100ed7(0x12e)](_0x100ed7(0x160));if(_0x53d0b5[_0x100ed7(0x175)]!==_0x27a87b)throw stateDrift(_0x100ed7(0x177)+_0x53d0b5['id']+_0x100ed7(0x158)+JSON[_0x100ed7(0x13c)](_0x27a87b)+_0x100ed7(0x179)+JSON[_0x100ed7(0x13c)](_0x53d0b5[_0x100ed7(0x175)])+'.');}if(hasFlag(_0x350507,_0x100ed7(0x136))){const _0x4b15ef=_0x350507[_0x100ed7(0x16a)](_0x100ed7(0x136));if(!Number[_0x100ed7(0x16b)](_0x4b15ef)||_0x4b15ef<0x0)throw CliErrors[_0x100ed7(0x156)](_0x100ed7(0x151));if(_0x53d0b5[_0x100ed7(0x15c)]!==_0x4b15ef)throw stateDrift('Menu\x20'+_0x53d0b5['id']+_0x100ed7(0x165)+_0x4b15ef+_0x100ed7(0x179)+_0x53d0b5[_0x100ed7(0x15c)]+'.');}}export function assertVerified(_0x4aa8bb,_0x4cfd3c,_0x4bf2aa='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){if(!_0x4aa8bb)throw menuError('menu_verification_failed',_0x4cfd3c,_0x4bf2aa);}export function mutationResult(_0x2af029){const _0x4c4c3c=a173_0x477942;return{'operation':_0x2af029[_0x4c4c3c(0x15d)],'selector':_0x2af029['selector'],'before':_0x2af029[_0x4c4c3c(0x14a)],'after':_0x2af029[_0x4c4c3c(0x132)],'dryRun':_0x2af029[_0x4c4c3c(0x16f)],'backend':_0x2af029[_0x4c4c3c(0x125)],..._0x2af029['plannedActions']?{'plannedActions':_0x2af029[_0x4c4c3c(0x150)]}:{},..._0x2af029[_0x4c4c3c(0x14e)]?{'targets':_0x2af029['targets']}:{},..._0x2af029['deleteOrder']?{'deleteOrder':_0x2af029[_0x4c4c3c(0x11f)]}:{},'snapshotHash':_0x2af029[_0x4c4c3c(0x134)],..._0x2af029[_0x4c4c3c(0x17f)]?{'cascade':_0x2af029[_0x4c4c3c(0x17f)]}:{},..._0x2af029[_0x4c4c3c(0x154)]?{'planFile':_0x2af029[_0x4c4c3c(0x154)]}:{},'succeeded':_0x2af029[_0x4c4c3c(0x140)]??[],'failed':_0x2af029['failed']??[],'warnings':_0x2af029[_0x4c4c3c(0x148)]??[],'verification':_0x2af029[_0x4c4c3c(0x13f)],'error':_0x2af029[_0x4c4c3c(0x131)]};}export function menuDryRunResult(_0x33e054,_0x44c89c){return{..._0x33e054,..._0x44c89c};}export function menuFailure(_0x3ce88c,_0x457b35,_0x51e967){const _0x451740=a173_0x477942,_0xc8402c=mutationResult({..._0x457b35,'after':_0x51e967[_0x451740(0x132)]===undefined?_0x457b35[_0x451740(0x132)]:_0x51e967[_0x451740(0x132)],'backend':_0x51e967[_0x451740(0x125)]??_0x457b35[_0x451740(0x125)],'dryRun':![],'succeeded':_0x51e967[_0x451740(0x140)]??[],'failed':_0x51e967[_0x451740(0x15a)]??[{..._0x51e967[_0x451740(0x168)]??{},'stage':_0x51e967[_0x451740(0x12a)],'code':_0x3ce88c[_0x451740(0x167)],'message':_0x3ce88c[_0x451740(0x12d)]}],'warnings':[..._0x457b35[_0x451740(0x148)],..._0x51e967[_0x451740(0x148)]??[]],'verification':_0x51e967[_0x451740(0x13f)],'error':{'code':_0x3ce88c[_0x451740(0x167)],'message':_0x3ce88c[_0x451740(0x12d)],..._0x3ce88c['hint']?{'hint':_0x3ce88c[_0x451740(0x171)]}:{}}});return Object[_0x451740(0x162)](_0x3ce88c,_0x451740(0x13d),{'value':_0xc8402c,'enumerable':!![],'configurable':!![]}),_0x3ce88c;}export function asVerificationError(_0x3dbef9,_0x32573d){const _0x2f46de=a173_0x477942;if(_0x3dbef9 instanceof CliError&&_0x3dbef9[_0x2f46de(0x167)]===_0x2f46de(0x147))return _0x3dbef9;const _0x40d520=_0x3dbef9 instanceof Error?_0x3dbef9['message']:String(_0x3dbef9);return menuError('menu_verification_failed',''+_0x32573d+(_0x40d520?':\x20'+_0x40d520:''),'The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.');}export function describeMenuErrorCause(_0x2379ff,_0x2614b8,_0x1379a0){const _0x1098a2=a173_0x477942,_0x4b0bba=mapMenuApiError(_0x2379ff,_0x2614b8,_0x1379a0);return{'causeCode':_0x4b0bba['code'],'causeMessage':_0x4b0bba[_0x1098a2(0x12d)]};}export function hasFlag(_0x536e0,_0x1cca1d){const _0x3049eb=a173_0x477942;return Object['prototype'][_0x3049eb(0x186)]['call'](_0x536e0[_0x3049eb(0x17d)],_0x1cca1d)&&_0x536e0[_0x3049eb(0x17d)][_0x1cca1d]!==undefined;}export function toApiParentId(_0xe275f3){return _0xe275f3??0x0;}export function formatParent(_0x5d49c7){const _0x558d72=a173_0x477942;return _0x5d49c7==null?_0x558d72(0x152):String(_0x5d49c7);}function a173_0xcf53(){const _0x2b47f6=['trim','1142040AdzuoM','deleteOrder','parent-id','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','menu_permission_denied','Online\x20menu\x20not\x20found:\x20','10851IRnUmv','backend','menu_not_found','length','menu_parent_not_folder','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','stage','hash','90880vRWbiL','message','str','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','error','after','menu_confirmation_required','snapshotHash','Online\x20menu\x20state\x20changed\x20before\x20','expected-children-count','\x22,\x20not\x20folder.','required','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','cookie','recheck\x20online\x20menu\x20facts\x20before\x20','stringify','data','flagMissing','verification','succeeded','menu_mutation_failed','Permission\x20denied\x20while\x20attempting\x20to\x20','2299182ofsHeg','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','api_error','menu_verification_failed','warnings','\x20menu\x20','before','byId','46670lJpuwZ','menu_sort_invalid','targets','dry-run','plannedActions','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','root',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','planFile','folder','validation','expect-parent-id','\x20path\x20changed:\x20expected\x20','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','failedRecords','map','childrenCount','operation','parentId','Cannot\x20append\x20a\x20','expect-path','test','defineProperty','pre-write-recheck','956ocyCxy','\x20child\x20count\x20changed:\x20expected\x20','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','code','failed','sort','num','isSafeInteger',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','string','\x20is\x20type\x20\x22','dryRun','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','hint','3077970dzDlsT','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','37gTIViZ','path','get','Menu\x20','appCode',',\x20current\x20','\x20parent\x20changed:\x20expected\x20','number','type','rawFlags','8862066ShfEcP','cascade','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','Reorder\x20sibling\x20menus\x20below\x20','menu_state_drift','14plFaoC','yes','unknown','hasOwnProperty'];a173_0xcf53=function(){return _0x2b47f6;};return a173_0xcf53();}export function menuError(_0x436dfb,_0x3ba109,_0x3de924){return new CliError(_0x436dfb,0x1,_0x3ba109,_0x3de924);}export function mapMenuApiError(_0x38784b,_0x23c326,_0x2e3327){const _0xe46a63=a173_0x477942;if(_0x38784b instanceof CliError&&_0x38784b[_0xe46a63(0x167)]!=='api_error')return _0x38784b;const _0x28d479=_0x38784b instanceof Error?_0x38784b[_0xe46a63(0x12d)]:String(_0x38784b);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0xe46a63(0x161)](_0x28d479))return menuError(_0xe46a63(0x122),_0xe46a63(0x142)+_0x23c326+(_0x2e3327?_0xe46a63(0x149)+_0x2e3327:'')+'.',_0xe46a63(0x130));return menuError(_0xe46a63(0x141),'Failed\x20to\x20'+_0x23c326+(_0x2e3327?_0xe46a63(0x149)+_0x2e3327:'')+':\x20'+_0x28d479,_0xe46a63(0x139));}export function isMenuResponseLoss(_0x241473){const _0x45c193=a173_0x477942,_0x172749=_0x241473 instanceof Error?_0x241473[_0x45c193(0x12d)]:String(_0x241473);if(_0x241473 instanceof CliError)return _0x241473[_0x45c193(0x167)]===_0x45c193(0x146)&&/^Request (?:failed|timeout):/i[_0x45c193(0x161)](_0x172749);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'](_0x172749);}function stateDrift(_0x3c3638){const _0x2d11d0=a173_0x477942;return menuError(_0x2d11d0(0x182),_0x3c3638,_0x2d11d0(0x129));}
|
|
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 a177_0x4444e3=a177_0x3294;(function(_0x500ac8,_0x5cbe9c){const _0x627f11=a177_0x3294,_0x31696f=_0x500ac8();while(!![]){try{const _0x2207ef=-parseInt(_0x627f11(0x10f))/0x1*(parseInt(_0x627f11(0xd7))/0x2)+-parseInt(_0x627f11(0x101))/0x3+-parseInt(_0x627f11(0xf8))/0x4+-parseInt(_0x627f11(0xdd))/0x5*(parseInt(_0x627f11(0xef))/0x6)+-parseInt(_0x627f11(0x106))/0x7*(-parseInt(_0x627f11(0xf3))/0x8)+parseInt(_0x627f11(0xed))/0x9*(parseInt(_0x627f11(0xf4))/0xa)+parseInt(_0x627f11(0xd2))/0xb;if(_0x2207ef===_0x5cbe9c)break;else _0x31696f['push'](_0x31696f['shift']());}catch(_0x5a955e){_0x31696f['push'](_0x31696f['shift']());}}}(a177_0x1d0d,0x51e39));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';function a177_0x3294(_0x41792e,_0x20b203){_0x41792e=_0x41792e-0xd1;const _0x1d0d74=a177_0x1d0d();let _0x3294a6=_0x1d0d74[_0x41792e];return _0x3294a6;}import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set([a177_0x4444e3(0xe8),'cssUrl','appName',a177_0x4444e3(0xe1),a177_0x4444e3(0x103)]);export function resolvePage(_0x327f2c,_0x1c9f72,_0x356375){const _0x4f486a=a177_0x4444e3;let _0x3087d5=_0x1c9f72['parentId']??_0x327f2c['parentId'];if(_0x3087d5===undefined&&_0x327f2c[_0x4f486a(0xf0)]){const _0x2f5735=_0x356375[_0x4f486a(0xfb)](_0x3ebd05=>_0x3ebd05['type']===_0x4f486a(0xeb)&&_0x3ebd05['label']===_0x327f2c[_0x4f486a(0xf0)]);if(_0x2f5735[_0x4f486a(0x10a)]!==0x1)throw new Error(_0x4f486a(0x108)+_0x327f2c['group']+_0x4f486a(0xee)+_0x327f2c[_0x4f486a(0x102)]+_0x4f486a(0xfd)+_0x2f5735[_0x4f486a(0x10a)]);_0x3087d5=_0x2f5735[0x0]['id'];}if(_0x3087d5!==undefined&&_0x3087d5!==0x0&&_0x356375['filter'](_0x40f80c=>_0x40f80c['id']===_0x3087d5&&_0x40f80c[_0x4f486a(0x109)]===_0x4f486a(0xeb))[_0x4f486a(0x10a)]!==0x1)throw new Error('Parent\x20'+_0x3087d5+_0x4f486a(0xfe));return{..._0x327f2c,..._0x3087d5===undefined?{}:{'parentId':_0x3087d5},..._0x1c9f72[_0x4f486a(0xe1)]===undefined?{}:{'visible':_0x1c9f72['visible']}};}function validateParams(_0x461539){const _0x140de6=a177_0x4444e3,_0x129e0f=[];return _0x461539[_0x140de6(0xe8)]&&!isValidJsHttpsUrl(_0x461539[_0x140de6(0xe8)])&&_0x129e0f['push']({'field':_0x140de6(0xe8),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x461539[_0x140de6(0xea)]&&!isValidCssHttpsUrl(_0x461539['cssUrl'])&&_0x129e0f[_0x140de6(0xe0)]({'field':_0x140de6(0xea),'message':_0x140de6(0xd3)}),_0x129e0f;}export async function runMenuSyncCore(_0x192435,_0x41dfa6,_0x397fcf=[],_0x47536d,_0x12c6dd={}){const _0x435739=a177_0x4444e3,_0x3f3532=parseMenuSyncParams(_0x47536d),_0x20b761=[...new Set(_0x397fcf['map'](_0x43ab60=>_0x43ab60[_0x435739(0xe4)]())[_0x435739(0xfb)](Boolean)['map'](menuPathKey))],_0xfdb125=_0x3f3532[_0x435739(0xe8)],_0x34a43e=_0x3f3532[_0x435739(0xea)],_0x1f7bb3=[];if(_0xfdb125)_0x1f7bb3[_0x435739(0xe0)](_0xfdb125);if(_0x34a43e)_0x1f7bb3[_0x435739(0xe0)](_0x34a43e);const _0x465032=validateParams(_0x3f3532);if(_0x465032['length']>0x0){const _0x104eaa=_0x465032[_0x435739(0x10b)](_0x501180=>'--params.'+_0x501180[_0x435739(0xdf)]+':\x20'+_0x501180[_0x435739(0xda)])['join'](';\x20');throw new Error(_0x435739(0xe2)+_0x104eaa);}logger[_0x435739(0xf7)](process[_0x435739(0xd5)]()),logger[_0x435739(0x107)](_0x435739(0xff),_0x435739(0xec),{'appCode':_0x192435,'selectedCount':_0x20b761[_0x435739(0x10a)],'jsUrl':_0xfdb125,'cssUrl':_0x34a43e});if(_0xfdb125){const _0x43f36f=await isUrlReachable(_0xfdb125);if(!_0x43f36f)throw new Error(_0x435739(0x10e)+_0xfdb125);}if(_0x34a43e){const _0x2400f8=await isUrlReachable(_0x34a43e);if(!_0x2400f8)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x34a43e);}const _0x533645=getLocalPages();if(_0x533645[_0x435739(0x10a)]===0x0){if(_0x20b761['length']>0x0)throw new Error(_0x435739(0xde)+_0x20b761[_0x435739(0xd6)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x12c6dd[_0x435739(0xf1)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x3f60b5=await getOnlineMenuList(_0x192435,_0x41dfa6),_0xd116ca=new Set(_0x3f60b5[_0x435739(0x10b)](_0x199fd5=>menuPathKey(_0x199fd5['path'])));let _0x4ed0d6;if(_0x20b761[_0x435739(0x10a)]>0x0){const _0x1febb9=new Map(_0x533645['map'](_0x5ce94f=>[menuPathKey(_0x5ce94f['path']),_0x5ce94f])),_0x2b1b4f=_0x20b761[_0x435739(0xfb)](_0x133204=>!_0x1febb9[_0x435739(0x104)](_0x133204));if(_0x2b1b4f['length']>0x0){const _0x37a4ca=_0x533645['map'](_0x35d731=>_0x35d731['path'])[_0x435739(0xd6)](',\x20');throw new Error(_0x435739(0xde)+_0x2b1b4f[_0x435739(0xd6)](',\x20')+_0x435739(0xd8)+_0x37a4ca);}const _0xb7f3b8=_0x20b761[_0x435739(0xfb)](_0x3dc3e4=>_0xd116ca['has'](_0x3dc3e4));if(_0xb7f3b8[_0x435739(0x10a)]>0x0)throw new Error(_0x435739(0xf5)+_0xb7f3b8[_0x435739(0xd6)](',\x20'));_0x4ed0d6=_0x20b761[_0x435739(0x10b)](_0x54cda4=>_0x1febb9[_0x435739(0x100)](_0x54cda4));}else _0x4ed0d6=_0x533645[_0x435739(0xfb)](_0x48f960=>!_0xd116ca[_0x435739(0x104)](menuPathKey(_0x48f960[_0x435739(0x102)])));if(_0x4ed0d6[_0x435739(0x10a)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x12c6dd[_0x435739(0xf1)]===!![],'targetPages':[],'plannedMenus':[]};_0x4ed0d6=_0x4ed0d6[_0x435739(0x10b)](_0x32cda0=>resolvePage(_0x32cda0,_0x3f3532,_0x3f60b5));_0x3f3532[_0x435739(0xdc)]&&_0x1f7bb3[_0x435739(0x10a)]===0x0&&await assertSharedResourcesConfigured(_0x192435,_0x41dfa6,_0x3f3532[_0x435739(0xdc)]);const _0x926157=_0x4ed0d6['map'](_0x41a591=>({'type':'procode','path':_0x41a591[_0x435739(0x102)],'label':_0x41a591[_0x435739(0xf6)],'loadScriptMode':'import','resources':[..._0x1f7bb3],..._0x41a591['visible']===undefined?{}:{'visible':_0x41a591['visible']},..._0x41a591[_0x435739(0x103)]===undefined?{}:{'parentId':_0x41a591['parentId']},..._0x41a591[_0x435739(0xe6)]===undefined?{}:{'sort':_0x41a591[_0x435739(0xe6)]},..._0x3f3532[_0x435739(0xdc)]===undefined?{}:{'appName':_0x3f3532[_0x435739(0xdc)]}}));if(_0x12c6dd[_0x435739(0xf1)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x4ed0d6,'plannedMenus':_0x926157};const _0xc6dceb=_0x3f3532['appName']?await createMenus(_0x192435,_0x41dfa6,_0x4ed0d6,_0x1f7bb3[_0x435739(0x10a)]>0x0?_0x1f7bb3:undefined,{'appName':_0x3f3532[_0x435739(0xdc)]}):await createMenus(_0x192435,_0x41dfa6,_0x4ed0d6,_0x1f7bb3[_0x435739(0x10a)]>0x0?_0x1f7bb3:undefined);return logger['info'](_0x435739(0xff),_0x435739(0xe3),{'count':_0x4ed0d6[_0x435739(0x10a)],'resources':_0x1f7bb3}),{'created':_0xc6dceb[_0x435739(0x10a)],'skipped':![],'dryRun':![],'targetPages':_0x4ed0d6,'plannedMenus':_0x926157,'menus':_0xc6dceb};}export function parseMenuSyncParams(_0x4e6b9d){const _0x10e7b2=a177_0x4444e3;if(!_0x4e6b9d||typeof _0x4e6b9d!==_0x10e7b2(0xfc))return{};let _0xd463d6;try{_0xd463d6=JSON['parse'](_0x4e6b9d);}catch{throw new Error(_0x10e7b2(0x105));}if(typeof _0xd463d6!=='object'||_0xd463d6===null||Array[_0x10e7b2(0xf2)](_0xd463d6))throw new Error(_0x10e7b2(0xdb));const _0x2a4a3a=_0xd463d6;if(Object[_0x10e7b2(0xd4)](_0x2a4a3a,_0x10e7b2(0x10c)))throw new Error(_0x10e7b2(0xd1));const _0x18dd45=Object[_0x10e7b2(0xd9)](_0x2a4a3a)['filter'](_0x5d52ff=>!MENU_SYNC_PARAM_KEYS[_0x10e7b2(0x104)](_0x5d52ff));if(_0x18dd45[_0x10e7b2(0x10a)]>0x0)throw new Error(_0x10e7b2(0xe5)+_0x18dd45[_0x10e7b2(0xd6)](',\x20')+'.');for(const _0x4669c2 of['jsUrl',_0x10e7b2(0xea),_0x10e7b2(0xdc)]){const _0x24db30=_0x2a4a3a[_0x4669c2];if(_0x24db30!==undefined&&(typeof _0x24db30!==_0x10e7b2(0xfc)||_0x24db30[_0x10e7b2(0xe4)]()===''))throw new Error('Invalid\x20--params.'+_0x4669c2+_0x10e7b2(0x10d));}if(_0x2a4a3a['visible']!==undefined&&typeof _0x2a4a3a[_0x10e7b2(0xe1)]!==_0x10e7b2(0xe7))throw new Error(_0x10e7b2(0xfa));if(_0x2a4a3a['parentId']!==undefined&&(!Number[_0x10e7b2(0xe9)](_0x2a4a3a['parentId'])||_0x2a4a3a[_0x10e7b2(0x103)]<0x0))throw new Error('Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.');return{'jsUrl':typeof _0x2a4a3a[_0x10e7b2(0xe8)]==='string'?_0x2a4a3a['jsUrl'][_0x10e7b2(0xe4)]():undefined,'cssUrl':typeof _0x2a4a3a[_0x10e7b2(0xea)]===_0x10e7b2(0xfc)?_0x2a4a3a[_0x10e7b2(0xea)][_0x10e7b2(0xe4)]():undefined,'appName':typeof _0x2a4a3a[_0x10e7b2(0xdc)]===_0x10e7b2(0xfc)?_0x2a4a3a['appName'][_0x10e7b2(0xe4)]():undefined,'visible':typeof _0x2a4a3a[_0x10e7b2(0xe1)]===_0x10e7b2(0xe7)?_0x2a4a3a['visible']:undefined,'parentId':typeof _0x2a4a3a[_0x10e7b2(0x103)]===_0x10e7b2(0xf9)?_0x2a4a3a[_0x10e7b2(0x103)]:undefined};}function a177_0x1d0d(){const _0x292783=['pages',':\x20expected\x20a\x20non-empty\x20string.','JS\x20URL\x20is\x20unreachable:\x20','84aWmlqf','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','14720200RhaGSI','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','hasOwn','cwd','join','5334xXgulq','\x0a\x20\x20Available\x20local\x20paths:\x20','keys','message','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','appName','59195qNtnVR','No\x20local\x20pages\x20matched\x20paths:\x20','field','push','visible','Invalid\x20--params:\x20','Menu\x20sync\x20completed','trim','Invalid\x20--params\x20fields:\x20','order','boolean','jsUrl','isInteger','cssUrl','folder','Start\x20non-interactive\x20menu\x20sync','2871HccYyY','\x22\x20for\x20','264IcQhpN','group','dryRun','isArray','8OHpFpw','6530SCKfNt','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','label','setLogPath','200292lBwTmC','number','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','filter','string',';\x20found\x20','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','menu-sync','get','1680882aqXQPH','path','parentId','has','Invalid\x20--params\x20JSON.','1009547jRGKwG','info','Expected\x20one\x20folder\x20named\x20\x22','type','length','map'];a177_0x1d0d=function(){return _0x292783;};return a177_0x1d0d();}
|
|
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(_0x48013e,_0x476542){const _0x2a0ad3=a179_0x5913,_0x1a4896=_0x48013e();while(!![]){try{const _0x2e51c3=-parseInt(_0x2a0ad3(0x1e5))/0x1+-parseInt(_0x2a0ad3(0x20f))/0x2+parseInt(_0x2a0ad3(0x1e2))/0x3+-parseInt(_0x2a0ad3(0x1db))/0x4+parseInt(_0x2a0ad3(0x1d4))/0x5+-parseInt(_0x2a0ad3(0x1f1))/0x6*(parseInt(_0x2a0ad3(0x1fd))/0x7)+parseInt(_0x2a0ad3(0x1ca))/0x8;if(_0x2e51c3===_0x476542)break;else _0x1a4896['push'](_0x1a4896['shift']());}catch(_0x5dbee3){_0x1a4896['push'](_0x1a4896['shift']());}}}(a179_0x4b78,0x34c94));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a179_0x4b78(){const _0xa5cbb8=['object','.css','120mAjtwI','.js','length','has','JS\x20URL\x20is\x20unreachable:\x20','CSS\x20URL\x20is\x20unreachable:\x20','filter','\x20existing\x20JS\x20resources\x20for\x20\x22','--params.','\x22\x20(','info','paths','141946eRJIxr','replace','.\x20Allowed\x20values:\x20replace,\x20patch','status','trim','message','patch','mode','cssUrl','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','force','push','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','path','255562fRWcBO','menu\x20asset-update\x20cannot\x20patch\x20','value','7569024FoeqFW','rejected','Invalid\x20--mode:\x20','some','map','jsUrl','extend','menuIds','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','menu-asset-update','921750ScPwbF','toLowerCase','Menu\x20asset\x20update\x20completed','allSettled','unshift','selection','string','564868HaCyIa','field','resources','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','isArray','label','365691rTezvD',').\x20','dryRun','361605xiKBqZ','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','loadScriptMode','endsWith','\x20existing\x20CSS\x20resources\x20for\x20\x22','join','fulfilled','all'];a179_0x4b78=function(){return _0xa5cbb8;};return a179_0x4b78();}import{logger}from'../../../utils/logger.js';function validateParams(_0xb80a0f){const _0x4dee95=a179_0x5913,_0x42b226=[];return _0xb80a0f[_0x4dee95(0x1cf)]&&!isValidJsHttpsUrl(_0xb80a0f[_0x4dee95(0x1cf)])&&_0x42b226[_0x4dee95(0x20c)]({'field':'jsUrl','message':_0x4dee95(0x1e6)}),_0xb80a0f['cssUrl']&&!isValidCssHttpsUrl(_0xb80a0f[_0x4dee95(0x205)])&&_0x42b226[_0x4dee95(0x20c)]({'field':_0x4dee95(0x205),'message':_0x4dee95(0x1e7)}),_0x42b226;}export async function runMenuUpdateCore(_0x545ea5,_0x5bdf78,_0x377cc7,_0x3b5c61={}){const _0x3441f8=a179_0x5913,_0x3fb1e3=parseUpdateParamsFlag(_0x377cc7),_0x231c62=normalizeMode(_0x3b5c61[_0x3441f8(0x204)]);validateSelection(_0x3b5c61[_0x3441f8(0x1d9)]);const _0x1b9ec0=[];if(_0x3fb1e3[_0x3441f8(0x1cf)])_0x1b9ec0[_0x3441f8(0x20c)](_0x3fb1e3[_0x3441f8(0x1cf)]);if(_0x3fb1e3[_0x3441f8(0x205)])_0x1b9ec0[_0x3441f8(0x20c)](_0x3fb1e3[_0x3441f8(0x205)]);const _0x399619=validateParams(_0x3fb1e3);if(_0x399619[_0x3441f8(0x1f3)]>0x0){const _0x1dee56=_0x399619[_0x3441f8(0x1ce)](_0xf18ad5=>_0x3441f8(0x1f9)+_0xf18ad5[_0x3441f8(0x1dc)]+':\x20'+_0xf18ad5[_0x3441f8(0x202)])[_0x3441f8(0x1ec)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x1dee56);}if(_0x1b9ec0[_0x3441f8(0x1f3)]===0x0)throw new Error(_0x3441f8(0x208)+_0x3441f8(0x1d2));logger['setLogPath'](process['cwd']()),logger[_0x3441f8(0x1fb)](_0x3441f8(0x1d3),'Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x545ea5,'jsUrl':_0x3fb1e3[_0x3441f8(0x1cf)],'cssUrl':_0x3fb1e3['cssUrl'],'mode':_0x231c62,'dryRun':_0x3b5c61[_0x3441f8(0x1e4)]===!![]});if(_0x3fb1e3[_0x3441f8(0x1cf)]){const _0x1d7c41=await isUrlReachable(_0x3fb1e3[_0x3441f8(0x1cf)]);if(!_0x1d7c41)throw new Error(_0x3441f8(0x1f5)+_0x3fb1e3[_0x3441f8(0x1cf)]);}if(_0x3fb1e3[_0x3441f8(0x205)]){const _0x569ff4=await isUrlReachable(_0x3fb1e3[_0x3441f8(0x205)]);if(!_0x569ff4)throw new Error(_0x3441f8(0x1f6)+_0x3fb1e3['cssUrl']);}const _0x2c114a=await getOnlineMenuList(_0x545ea5,_0x5bdf78),_0x389f2f=_0x2c114a['filter'](_0x38cd02=>_0x38cd02['resources'][_0x3441f8(0x1f3)]>0x0),_0x368b89=selectMenusForUpdate(_0x389f2f,_0x3b5c61[_0x3441f8(0x1d9)]);if(_0x368b89['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x3b5c61['dryRun']===!![]};const _0x4f3e44=_0x368b89[_0x3441f8(0x1ce)](_0x1f0c46=>buildMenuUpdateDiff(_0x1f0c46,_0x3fb1e3,_0x231c62,_0x3b5c61[_0x3441f8(0x20b)]===!![],_0x3b5c61[_0x3441f8(0x1e9)]));if(_0x3b5c61['dryRun'])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x4f3e44};const _0x16d973=await Promise[_0x3441f8(0x1d7)](_0x368b89[_0x3441f8(0x1ce)]((_0x402f5c,_0x1868c1)=>updateMenuCdnUrl(_0x545ea5,_0x5bdf78,{'id':_0x402f5c['id'],'label':_0x402f5c[_0x3441f8(0x1e1)],'path':_0x402f5c[_0x3441f8(0x20e)],'resources':_0x4f3e44[_0x1868c1]['after']['resources'],'extend':_0x402f5c[_0x3441f8(0x1d0)]??null,'loadScriptMode':_0x3b5c61[_0x3441f8(0x1e9)]}))),_0x3480b4=_0x16d973[_0x3441f8(0x1f7)](_0x10b672=>_0x10b672['status']===_0x3441f8(0x1ed))[_0x3441f8(0x1ce)](_0x3188d5=>_0x3188d5[_0x3441f8(0x1c9)]),_0x37cfd0=_0x16d973[_0x3441f8(0x1f7)](_0x34564d=>_0x34564d[_0x3441f8(0x200)]===_0x3441f8(0x1cb))['length'];return logger['info'](_0x3441f8(0x1d3),_0x3441f8(0x1d6),{'count':_0x368b89['length'],'resources':_0x1b9ec0}),{'updated':_0x3480b4[_0x3441f8(0x1f3)],'failed':_0x37cfd0,'skipped':![],'menus':_0x3480b4};}function validateSelection(_0x50df19){const _0x581c60=a179_0x5913;if(!_0x50df19)throw new Error(_0x581c60(0x1df));if(_0x50df19[_0x581c60(0x1ee)]&&(_0x50df19[_0x581c60(0x1d1)][_0x581c60(0x1f3)]>0x0||_0x50df19['paths'][_0x581c60(0x1f3)]>0x0))throw new Error(_0x581c60(0x209));if(!_0x50df19[_0x581c60(0x1ee)]&&_0x50df19[_0x581c60(0x1d1)][_0x581c60(0x1f3)]===0x0&&_0x50df19[_0x581c60(0x1fc)][_0x581c60(0x1f3)]===0x0)throw new Error(_0x581c60(0x1df));}export function selectMenusForUpdate(_0x1d2d41,_0x5e37dc){const _0x485347=a179_0x5913;validateSelection(_0x5e37dc);if(_0x5e37dc[_0x485347(0x1ee)])return _0x1d2d41;const _0x119bee=new Set(_0x1d2d41[_0x485347(0x1ce)](_0x415b07=>_0x415b07['id'])),_0x306b62=new Set(_0x1d2d41[_0x485347(0x1ce)](_0x526106=>_0x526106[_0x485347(0x20e)])),_0x328306=_0x5e37dc[_0x485347(0x1d1)]['filter'](_0x2e1c24=>!_0x119bee[_0x485347(0x1f4)](_0x2e1c24)),_0x143cb0=_0x5e37dc[_0x485347(0x1fc)]['filter'](_0x3a60fd=>!_0x306b62[_0x485347(0x1f4)](_0x3a60fd));if(_0x328306[_0x485347(0x1f3)]>0x0||_0x143cb0[_0x485347(0x1f3)]>0x0){const _0x3965c6=[..._0x328306[_0x485347(0x1ce)](_0x14fd39=>String(_0x14fd39)),..._0x143cb0][_0x485347(0x1ec)](',\x20');throw new Error(_0x485347(0x206)+_0x3965c6);}const _0x1a2a41=new Set(_0x5e37dc['menuIds']),_0x26f931=new Set(_0x5e37dc[_0x485347(0x1fc)]);return _0x1d2d41[_0x485347(0x1f7)](_0x3f5224=>_0x1a2a41['has'](_0x3f5224['id'])||_0x26f931[_0x485347(0x1f4)](_0x3f5224[_0x485347(0x20e)]));}function normalizeMode(_0xb380bb){const _0x49462e=a179_0x5913;if(!_0xb380bb)return _0x49462e(0x203);if(_0xb380bb===_0x49462e(0x1fe)||_0xb380bb==='patch')return _0xb380bb;throw new Error(_0x49462e(0x1cc)+_0xb380bb+_0x49462e(0x1ff));}function a179_0x5913(_0x3ecebc,_0x4af86f){_0x3ecebc=_0x3ecebc-0x1c8;const _0x4b783e=a179_0x4b78();let _0x59134e=_0x4b783e[_0x3ecebc];return _0x59134e;}function buildMenuUpdateDiff(_0x5159d2,_0xdc688e,_0x41e4ce,_0x45bcb4,_0x1c9569){const _0x3224bd=a179_0x5913,_0x175f42=[..._0x5159d2[_0x3224bd(0x1dd)]];_0x41e4ce===_0x3224bd(0x203)&&assertUnambiguousPatchResources(_0x5159d2,_0x175f42,_0xdc688e);const _0x168b6f=_0x41e4ce===_0x3224bd(0x203)?patchResources(_0x175f42,_0xdc688e):replaceResources(_0xdc688e),_0x11a9a9=[],_0x225df2=_0x175f42[_0x3224bd(0x1cd)](isJsResource),_0x40efbf=_0x168b6f[_0x3224bd(0x1cd)](isJsResource);if(_0x225df2&&!_0x40efbf){const _0x32fe31=_0x3224bd(0x1de)+_0x5159d2[_0x3224bd(0x1e1)]+'\x22\x20('+_0x5159d2['path']+_0x3224bd(0x1e3)+_0x3224bd(0x20d);if(!_0x45bcb4)throw new Error(_0x32fe31);_0x11a9a9[_0x3224bd(0x20c)](_0x32fe31);}const _0x1e436d=_0x175f42[_0x3224bd(0x1cd)](isCssResource),_0x4acac7=_0x168b6f['some'](isCssResource);_0x1e436d&&!_0x4acac7&&_0x11a9a9[_0x3224bd(0x20c)](_0x3224bd(0x20a)+_0x5159d2[_0x3224bd(0x1e1)]+_0x3224bd(0x1fa)+_0x5159d2['path']+').');const _0x353ef3=typeof _0x5159d2['extend']?.[_0x3224bd(0x1e9)]===_0x3224bd(0x1da)?_0x5159d2['extend']['loadScriptMode']:null,_0x2814ab=_0x1c9569?{'loadScriptMode':_0x353ef3}:{},_0x5bf2c7=_0x1c9569?{'loadScriptMode':_0x1c9569}:{};return{'id':_0x5159d2['id'],'label':_0x5159d2[_0x3224bd(0x1e1)],'path':_0x5159d2[_0x3224bd(0x20e)],'mode':_0x41e4ce,'before':{'resources':_0x175f42,..._0x2814ab},'after':{'resources':_0x168b6f,..._0x5bf2c7},'warnings':_0x11a9a9};}function replaceResources(_0x868897){const _0x3d3207=a179_0x5913;return[_0x868897[_0x3d3207(0x1cf)],_0x868897['cssUrl']]['filter'](_0x2ea243=>!!_0x2ea243);}function assertUnambiguousPatchResources(_0xa22eed,_0x1c1b74,_0x9c2ac1){const _0x11f0fe=a179_0x5913,_0x557751=_0x1c1b74[_0x11f0fe(0x1f7)](isJsResource)[_0x11f0fe(0x1f3)];if(_0x9c2ac1[_0x11f0fe(0x1cf)]&&_0x557751>0x1)throw new Error(_0x11f0fe(0x1c8)+_0x557751+_0x11f0fe(0x1f8)+_0xa22eed['label']+_0x11f0fe(0x1fa)+_0xa22eed[_0x11f0fe(0x20e)]+')\x20'+_0x11f0fe(0x1e8));const _0x4234b5=_0x1c1b74['filter'](isCssResource)[_0x11f0fe(0x1f3)];if(_0x9c2ac1[_0x11f0fe(0x205)]&&_0x4234b5>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x4234b5+_0x11f0fe(0x1eb)+_0xa22eed[_0x11f0fe(0x1e1)]+_0x11f0fe(0x1fa)+_0xa22eed[_0x11f0fe(0x20e)]+')\x20'+_0x11f0fe(0x207));}function patchResources(_0x5b9b8e,_0x4877bf){const _0x12ffeb=a179_0x5913;let _0x28f762=![],_0x2fd2e7=![];const _0x3bbb73=[];for(const _0x263969 of _0x5b9b8e){if(isJsResource(_0x263969)){if(_0x4877bf[_0x12ffeb(0x1cf)]&&!_0x28f762)_0x3bbb73['push'](_0x4877bf['jsUrl']),_0x28f762=!![];else!_0x4877bf[_0x12ffeb(0x1cf)]&&_0x3bbb73[_0x12ffeb(0x20c)](_0x263969);continue;}if(isCssResource(_0x263969)){if(_0x4877bf[_0x12ffeb(0x205)]&&!_0x2fd2e7)_0x3bbb73['push'](_0x4877bf[_0x12ffeb(0x205)]),_0x2fd2e7=!![];else!_0x4877bf[_0x12ffeb(0x205)]&&_0x3bbb73[_0x12ffeb(0x20c)](_0x263969);continue;}_0x3bbb73[_0x12ffeb(0x20c)](_0x263969);}return _0x4877bf[_0x12ffeb(0x1cf)]&&!_0x28f762&&_0x3bbb73[_0x12ffeb(0x1d8)](_0x4877bf[_0x12ffeb(0x1cf)]),_0x4877bf[_0x12ffeb(0x205)]&&!_0x2fd2e7&&_0x3bbb73[_0x12ffeb(0x20c)](_0x4877bf[_0x12ffeb(0x205)]),_0x3bbb73;}function isJsResource(_0x4ee665){const _0x191a1a=a179_0x5913;return stripQuery(_0x4ee665)[_0x191a1a(0x1d5)]()[_0x191a1a(0x1ea)](_0x191a1a(0x1f2));}function isCssResource(_0x21eab6){const _0x23841c=a179_0x5913;return stripQuery(_0x21eab6)[_0x23841c(0x1d5)]()['endsWith'](_0x23841c(0x1f0));}function stripQuery(_0x183b46){return _0x183b46['split']('?')[0x0]??_0x183b46;}function parseUpdateParamsFlag(_0x3510fa){const _0x42d38d=a179_0x5913;if(!_0x3510fa||typeof _0x3510fa!==_0x42d38d(0x1da))return{};try{const _0x4363c5=JSON['parse'](_0x3510fa);if(typeof _0x4363c5!==_0x42d38d(0x1ef)||_0x4363c5===null||Array[_0x42d38d(0x1e0)](_0x4363c5))return{};return{'jsUrl':typeof _0x4363c5['jsUrl']==='string'?_0x4363c5[_0x42d38d(0x1cf)][_0x42d38d(0x201)]():undefined,'cssUrl':typeof _0x4363c5[_0x42d38d(0x205)]===_0x42d38d(0x1da)?_0x4363c5[_0x42d38d(0x205)][_0x42d38d(0x201)]():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
|
-
const a182_0x222adb=a182_0x1086;(function(_0x468c88,_0x37a416){const _0x5e9d3d=a182_0x1086,_0x10c541=_0x468c88();while(!![]){try{const _0x3cf19f=-parseInt(_0x5e9d3d(0x1d1))/0x1+-parseInt(_0x5e9d3d(0x1e8))/0x2+-parseInt(_0x5e9d3d(0x1dd))/0x3+-parseInt(_0x5e9d3d(0x1d5))/0x4*(-parseInt(_0x5e9d3d(0x1d0))/0x5)+-parseInt(_0x5e9d3d(0x200))/0x6+-parseInt(_0x5e9d3d(0x1d6))/0x7+parseInt(_0x5e9d3d(0x203))/0x8;if(_0x3cf19f===_0x37a416)break;else _0x10c541['push'](_0x10c541['shift']());}catch(_0x1d464d){_0x10c541['push'](_0x10c541['shift']());}}}(a182_0x27f5,0xdbf0d));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a182_0x222adb(0x1f5),a182_0x222adb(0x1c5),a182_0x222adb(0x1c6),a182_0x222adb(0x1f2),a182_0x222adb(0x1f4),a182_0x222adb(0x1d3),a182_0x222adb(0x208),a182_0x222adb(0x205),a182_0x222adb(0x1f9),a182_0x222adb(0x1f6)]);function a182_0x1086(_0x1d9be1,_0x58e077){_0x1d9be1=_0x1d9be1-0x1c0;const _0x27f530=a182_0x27f5();let _0x1086be=_0x27f530[_0x1d9be1];return _0x1086be;}function parseObject(_0xfe71e8,_0x97a085){const _0x41acef=a182_0x222adb;let _0x4b9239=_0xfe71e8;if(typeof _0xfe71e8==='string')try{_0x4b9239=JSON[_0x41acef(0x1e7)](_0xfe71e8);}catch{throw CliErrors[_0x41acef(0x1de)](_0x97a085+'\x20contains\x20invalid\x20JSON.');}if(!_0x4b9239||typeof _0x4b9239!==_0x41acef(0x1df)||Array['isArray'](_0x4b9239))throw CliErrors[_0x41acef(0x1de)](_0x97a085+_0x41acef(0x1f3));return _0x4b9239;}function parseArray(_0x77b7f1,_0x48d653){const _0x2b51eb=a182_0x222adb;let _0x2a5721;try{_0x2a5721=JSON[_0x2b51eb(0x1e7)](_0x77b7f1);}catch{throw CliErrors['validation'](_0x48d653+_0x2b51eb(0x1d2));}if(!Array[_0x2b51eb(0x1c0)](_0x2a5721))throw CliErrors['validation'](_0x48d653+_0x2b51eb(0x1c9));return _0x2a5721['map']((_0x579682,_0x1ff91a)=>parseObject(_0x579682,_0x48d653+'['+_0x1ff91a+']'));}function validateResources(_0x2fe255){const _0x2c6305=a182_0x222adb;if(_0x2fe255[_0x2c6305(0x1fc)]===0x0)throw CliErrors[_0x2c6305(0x1de)](_0x2c6305(0x201));for(const [_0x2df42e,_0x304b3c]of _0x2fe255[_0x2c6305(0x1e3)]()){if(typeof _0x304b3c!==_0x2c6305(0x1e5))throw CliErrors[_0x2c6305(0x1de)](_0x2c6305(0x1c4)+_0x2df42e+']\x20must\x20be\x20a\x20URL\x20string.');try{if(new URL(_0x304b3c)['protocol']!=='https:')throw new Error('not\x20HTTPS');}catch{throw CliErrors['validation'](_0x2c6305(0x1c4)+_0x2df42e+_0x2c6305(0x1f8));}}if(new Set(_0x2fe255)[_0x2c6305(0x1c1)]!==_0x2fe255[_0x2c6305(0x1fc)]||!_0x2fe255[_0x2c6305(0x1cf)](_0x277bf0=>/\.m?js(?:[?#]|$)/i['test'](_0x277bf0)))throw CliErrors['validation']('Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.');return _0x2fe255;}function prepare(_0xfac7eb,_0x1fbb56,_0x47441c){const _0xaf49fa=a182_0x222adb;if(!Number[_0xaf49fa(0x1cc)](_0xfac7eb['id'])||(_0xfac7eb['id']??0x0)<=0x0||typeof _0xfac7eb[_0xaf49fa(0x1da)]!==_0xaf49fa(0x1e5)||!_0xfac7eb[_0xaf49fa(0x1da)])throw CliErrors[_0xaf49fa(0x1de)]('App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.');const _0x49d17a=parseObject(_0xfac7eb[_0xaf49fa(0x1ce)],_0xaf49fa(0x1d7)),_0x512524=Object['keys'](_0x49d17a)[_0xaf49fa(0x206)](_0x1e3eb2=>!KNOWN_EXTEND_KEYS['has'](_0x1e3eb2));if(_0x512524['length'])throw CliErrors[_0xaf49fa(0x1de)]('Unknown\x20app.extend\x20fields:\x20'+_0x512524[_0xaf49fa(0x1e0)](',\x20')+'.\x20Refusing\x20update.');if(typeof _0x49d17a[_0xaf49fa(0x1f2)]!==_0xaf49fa(0x1e5))throw CliErrors['validation'](_0xaf49fa(0x202));const _0x344cc4=parseArray(_0x49d17a[_0xaf49fa(0x1f2)],_0xaf49fa(0x1d9)),_0x882000=_0x344cc4[_0xaf49fa(0x206)](_0x37764d=>_0x37764d[_0xaf49fa(0x1ed)]===_0x1fbb56);if(_0x882000[_0xaf49fa(0x1fc)]!==0x1)throw CliErrors['validation'](_0xaf49fa(0x1e1)+_0x1fbb56+';\x20found\x20'+_0x882000[_0xaf49fa(0x1fc)]+'.');const _0xe4faac=_0x882000[0x0];if(typeof _0xe4faac['resources']!==_0xaf49fa(0x1e5))throw CliErrors['validation'](_0xaf49fa(0x1fa));let _0x1e0383;try{_0x1e0383=JSON['parse'](_0xe4faac[_0xaf49fa(0x204)]);}catch{throw CliErrors['validation'](_0xaf49fa(0x1eb));}if(!Array['isArray'](_0x1e0383)||_0x1e0383['some'](_0x69b4a2=>typeof _0x69b4a2!==_0xaf49fa(0x1e5)))throw CliErrors[_0xaf49fa(0x1de)](_0xaf49fa(0x1cd));const _0x2193b5=_0x344cc4[_0xaf49fa(0x1f7)](_0x1e77a4=>_0x1e77a4===_0xe4faac?{..._0x1e77a4,'resources':JSON[_0xaf49fa(0x1e2)](_0x47441c)}:_0x1e77a4),_0xa06f00={..._0x49d17a,'assets':JSON[_0xaf49fa(0x1e2)](_0x2193b5)},_0x2ae9db=createHash(_0xaf49fa(0x1e9))['update'](JSON['stringify']({'appCode':_0xfac7eb[_0xaf49fa(0x207)],'id':_0xfac7eb['id'],'appPublishStatus':_0xfac7eb['appPublishStatus'],'extend':_0x49d17a,'appName':_0x1fbb56,'resources':_0x47441c}))[_0xaf49fa(0x1e6)]('hex');return{'before':_0x1e0383,'nextExtend':_0xa06f00,'expectedHash':_0x2ae9db,'unchanged':isDeepStrictEqual(_0x1e0383,_0x47441c)};}function flags(_0x34f595){const _0x1eb933=a182_0x222adb,{appCode:_0x4daf37,appName:_0x4e546e}=getSubappSelector(_0x34f595),_0xf8a121=_0x34f595[_0x1eb933(0x1c3)](_0x1eb933(0x204))[_0x1eb933(0x1ca)]();if(!_0xf8a121)throw CliErrors['validation']('--resources\x20is\x20required.');let _0x5bdea1;try{_0x5bdea1=JSON['parse'](_0xf8a121);}catch{throw CliErrors[_0x1eb933(0x1de)](_0x1eb933(0x1d4));}if(!Array[_0x1eb933(0x1c0)](_0x5bdea1))throw CliErrors[_0x1eb933(0x1de)](_0x1eb933(0x1d4));return{'appCode':_0x4daf37,'appName':_0x4e546e,'resources':validateResources(_0x5bdea1)};}function a182_0x27f5(){const _0x595d25=['9230760SdKaIg','app.extend','write','app.extend.assets','appPublishStatus','expectedHash','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','2580834FLZbrH','validation','object','join','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','stringify','entries','\x20in\x20menu\x20host\x20','string','digest','parse','2294738zaRUqj','sha256','/smartapi/app/update','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','subapp-assets-update','appName','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','Would\x20update\x20shared\x20assets\x20for\x20','test','Updated\x20shared\x20resources\x20for\x20','assets','\x20must\x20be\x20a\x20JSON\x20object.','tenantColumn','skinColor','directDbEnabled','map',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','directDbId','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','verified\x20app.extend','length','cookie','POST','nextExtend','3327894Wtqrby','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','38478008FWOEUf','resources','enableAutoSync','filter','appCode','vipDeploy','isArray','size','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','str','resources[','enableOpenApi','accessKey','unchanged','App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.','\x20must\x20be\x20a\x20JSON\x20array.','trim','expected-hash','isSafeInteger','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','extend','some','2080cZgNUB','1440218IpEYVe','\x20contains\x20invalid\x20JSON.','enableSample','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','13580FXwJjY'];a182_0x27f5=function(){return _0x595d25;};return a182_0x27f5();}export const menuSubappAssetsUpdate={'service':'menu','command':a182_0x222adb(0x1ec),'description':'Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','risk':a182_0x222adb(0x1d8),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a182_0x222adb(0x204),'type':a182_0x222adb(0x1e5),'required':!![],'description':a182_0x222adb(0x1c2)},{'name':'expected-hash','type':a182_0x222adb(0x1e5),'description':'Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes'}],async 'validate'(_0x5bf85c){flags(_0x5bf85c);},async 'dryRun'(_0x176b6f){const _0xf93b84=a182_0x222adb,{appCode:_0x499e09,appName:_0x336777,resources:_0x2f45a7}=flags(_0x176b6f),_0xc20ff1=await getSmartAppRecord(_0x499e09,_0x176b6f['cookie']),_0x21ada2=prepare(_0xc20ff1,_0x336777,_0x2f45a7);return{'method':_0xf93b84(0x1fe),'url':_0xf93b84(0x1ea),'body':{'preview':{'appCode':_0x499e09,'appName':_0x336777,'before':_0x21ada2['before'],'after':_0x2f45a7,'expectedHash':_0x21ada2[_0xf93b84(0x1db)],'unchanged':_0x21ada2[_0xf93b84(0x1c7)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x21ada2[_0xf93b84(0x1c7)]?_0xf93b84(0x1dc):_0xf93b84(0x1ef)+_0x336777+'.'};},async 'execute'(_0x2fe76c){const _0x11db67=a182_0x222adb,{appCode:_0x2506b3,appName:_0x4ba5c5,resources:_0x57f320}=flags(_0x2fe76c),_0x498ecc=_0x2fe76c[_0x11db67(0x1c3)](_0x11db67(0x1cb))['trim']();if(!/^[a-f0-9]{64}$/i[_0x11db67(0x1f0)](_0x498ecc))throw CliErrors[_0x11db67(0x1de)]('--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.');const _0xe1b03b=await getSmartAppRecord(_0x2506b3,_0x2fe76c[_0x11db67(0x1fd)]),_0x4d0cc0=prepare(_0xe1b03b,_0x4ba5c5,_0x57f320);if(_0x498ecc!==_0x4d0cc0[_0x11db67(0x1db)])throw CliErrors[_0x11db67(0x1de)]('App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.');if(_0x4d0cc0['unchanged'])return{'ok':!![],'data':{'appCode':_0x2506b3,'appName':_0x4ba5c5,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x11db67(0x1ee)};await updateSmartAppRecord({'id':_0xe1b03b['id'],'appCode':_0x2506b3,'appPublishStatus':_0xe1b03b[_0x11db67(0x1da)],'extend':_0x4d0cc0[_0x11db67(0x1ff)]},_0x2fe76c[_0x11db67(0x1fd)]);const _0x19fda1=await getSmartAppRecord(_0x2506b3,_0x2fe76c[_0x11db67(0x1fd)]),_0x2da10a=parseObject(_0x19fda1[_0x11db67(0x1ce)],_0x11db67(0x1fb));if(_0x19fda1['id']!==_0xe1b03b['id']||_0x19fda1[_0x11db67(0x1da)]!==_0xe1b03b['appPublishStatus']||!isDeepStrictEqual(_0x2da10a,_0x4d0cc0[_0x11db67(0x1ff)]))throw CliErrors['apiError'](_0x11db67(0x1c8));return{'ok':!![],'data':{'appCode':_0x2506b3,'appName':_0x4ba5c5,'updated':!![],'resources':_0x57f320,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x11db67(0x1f1)+_0x4ba5c5+_0x11db67(0x1e4)+_0x2506b3+';\x20independent\x20deployment\x20not\x20verified.'};}};
|
|
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)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a190_0x321164=a190_0x5ae5;(function(_0x572abe,_0xa2706b){const _0x4e3efb=a190_0x5ae5,_0x336c4c=_0x572abe();while(!![]){try{const _0x4a02ad=parseInt(_0x4e3efb(0xcf))/0x1*(parseInt(_0x4e3efb(0xd6))/0x2)+-parseInt(_0x4e3efb(0xff))/0x3*(parseInt(_0x4e3efb(0xca))/0x4)+parseInt(_0x4e3efb(0xde))/0x5*(parseInt(_0x4e3efb(0xe8))/0x6)+-parseInt(_0x4e3efb(0xd0))/0x7*(-parseInt(_0x4e3efb(0x115))/0x8)+parseInt(_0x4e3efb(0x113))/0x9+-parseInt(_0x4e3efb(0x104))/0xa+-parseInt(_0x4e3efb(0xcb))/0xb*(-parseInt(_0x4e3efb(0xdd))/0xc);if(_0x4a02ad===_0xa2706b)break;else _0x336c4c['push'](_0x336c4c['shift']());}catch(_0x661bb1){_0x336c4c['push'](_0x336c4c['shift']());}}}(a190_0x49e5,0xe8aa0));import a190_0x4c5358 from'chalk';function a190_0x49e5(){const _0xfec09=['2547105JfOOvR','created','\x20\x20Create\x20','\x20page(s)','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','Menu\x20sync\x20completed:\x20','Created\x20','Fetching\x20online\x20menu\x20list...','write','menu','6iuAcgx','appCode','onlineMenuList','params','failed','yes','validation','\x20menu(s)\x20bound\x20to\x20','selectedAppName','filter','flag','\x20menu(s)','\x20\x20Continue\x20with\x20creation?','appName','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','size','cookie','Failed\x20to\x20fetch\x20online\x20menu\x20list','POST','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','skipped','string','3764313SXrrUN','length','message','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','Menu\x20creation\x20failed','15057760TSkhfX','jsUrl','paths','Tip:\x20For\x20frontend\x20subapps,\x20prefer\x20Agent-planned\x20menu\x20groups\x20and\x20shared\x20resources.\x20This\x20manual\x20sync\x20workflow\x20remains\x20available\x20as\x20a\x20fallback.','split','Register\x20local\x20pages\x20as\x20platform\x20menus','\x20created.','appcode','str','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','Prefer\x20appName\x20for\x20shared\x20subapp\x20resources\x20and\x20parentId\x20for\x20planned\x20groups.\x20','JSON:\x20{\x22appName\x22:\x22store-app\x22,\x22parentId\x22:42,\x22visible\x22:false};\x20jsUrl\x20and\x20cssUrl\x20remain\x20available\x20for\x20individual\x20menu\x20resources.','\x20menu(s)\x20created','map','\x20\x20Cancelled.','13180446wjxJOw','\x20\x20✓\x20Selected:\x20','8XQrdBQ','4QPeZKO','857098klwZXr','\x20local\x20microfrontend\x20menu(s).','cssUrl','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','1xmOmQn','6613453TAAqSj','\x20menu(s)...','boolean','\x20menu(s)\x20with\x20JS:\x20','trim','\x20and\x20CSS:\x20','1122182EidYZI','rawFlags','\x20created,\x20','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','yellow','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','Menu\x20sync\x20skipped','36FUkgOt'];a190_0x49e5=function(){return _0xfec09;};return a190_0x49e5();}import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';function a190_0x5ae5(_0x44e04c,_0x12d987){_0x44e04c=_0x44e04c-0xca;const _0x49e555=a190_0x49e5();let _0x5ae580=_0x49e555[_0x44e04c];return _0x5ae580;}import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,resolvePage,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';import{assertSharedResourcesConfigured}from'../../commands/menu/shared/subapp-assets.js';export const menuSync={'service':a190_0x321164(0xe7),'command':'sync','description':a190_0x321164(0x109),'risk':a190_0x321164(0xe6),'flags':[{'name':a190_0x321164(0xeb),'type':a190_0x321164(0xfe),'description':a190_0x321164(0x10e)+a190_0x321164(0x10f)},{'name':a190_0x321164(0x106),'type':a190_0x321164(0xfe),'description':a190_0x321164(0xdb)},{'name':'yes','type':a190_0x321164(0xd2),'description':a190_0x321164(0xfb)}],async 'dryRun'(_0x1ffaa0){const _0x1477ab=a190_0x321164;ensureRunnableContext(_0x1ffaa0[_0x1477ab(0xd7)],_0x1ffaa0[_0x1477ab(0xf0)]);const _0x53cf5c=await runMenuSyncCore(_0x1ffaa0[_0x1477ab(0xe9)],_0x1ffaa0[_0x1477ab(0xf8)],parsePaths(_0x1ffaa0['str'](_0x1477ab(0x106))),_0x1ffaa0['str'](_0x1477ab(0xeb)),{'dryRun':!![]});return{'method':_0x1477ab(0xfa),'url':'/smartapi/menu/create','body':_0x53cf5c,'description':_0x53cf5c[_0x1477ab(0xfd)]?_0x1477ab(0xe2):'Would\x20create\x20'+_0x53cf5c['targetPages'][_0x1477ab(0x100)]+_0x1477ab(0xcc)};},async 'execute'(_0x4ca8ff){const _0x2273aa=a190_0x321164;ensureRunnableContext(_0x4ca8ff[_0x2273aa(0xd7)],_0x4ca8ff[_0x2273aa(0xf0)]);const _0xbd161a=_0x4ca8ff[_0x2273aa(0xf2)](_0x2273aa(0xed)),_0x2ca458=_0x4ca8ff[_0x2273aa(0x10c)]('params'),_0x545ebb=parsePaths(_0x4ca8ff['str'](_0x2273aa(0x106))),_0x49babb=parseMenuSyncParams(_0x2ca458);if(_0xbd161a){const _0x385f30=await runMenuSyncCore(_0x4ca8ff[_0x2273aa(0xe9)],_0x4ca8ff[_0x2273aa(0xf8)],_0x545ebb,_0x2ca458);if(_0x385f30[_0x2273aa(0xfd)]){const _0x375ff2=getLocalPages();_0x375ff2[_0x2273aa(0x100)]===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0x2273aa(0xfc));}else writeCliSideChannelLine('✓\x20Menu\x20sync\x20completed:\x20'+_0x385f30[_0x2273aa(0xdf)]+_0x2273aa(0x110));return{'ok':!![],'data':_0x385f30,'message':_0x385f30['skipped']?_0x2273aa(0xdc):_0x2273aa(0xe3)+_0x385f30[_0x2273aa(0xdf)]+_0x2273aa(0x10a)};}if(_0x545ebb[_0x2273aa(0x100)]>0x0)throw CliErrors[_0x2273aa(0xee)]('menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.',_0x2273aa(0xce));if(!isInteractive()&&_0x2ca458)throw CliErrors[_0x2273aa(0xee)](_0x2273aa(0x10d),_0x2273aa(0xce));requireInteractive(),writeCliSideChannelLine(_0x2273aa(0x107));const _0x1e4227=startSpinner(_0x2273aa(0xe5));let _0x2afe96,_0x50868e,_0x1d82e1;try{const _0x1d2355=await fetchMenuData(_0x4ca8ff['appCode'],_0x4ca8ff[_0x2273aa(0xf8)]);_0x2afe96=_0x1d2355['localPages'],_0x50868e=_0x1d2355['onlinePaths'],_0x1d82e1=_0x1d2355[_0x2273aa(0xea)],stopSpinner(_0x1e4227,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x35de77){stopSpinner(_0x1e4227,_0x2273aa(0xf9),![]);throw CliErrors['validation'](_0x35de77 instanceof Error?_0x35de77[_0x2273aa(0x101)]:_0x2273aa(0xf9));}if(_0x2afe96[_0x2273aa(0x100)]===0x0)return writeCliSideChannelLine(a190_0x4c5358[_0x2273aa(0xda)](_0x2273aa(0xd9))),{'ok':!![]};const _0x1dfea4=buildCompareRows(_0x2afe96,_0x50868e);writeCliSideChannelLine(renderCompareTable(_0x1dfea4)),writeCliSideChannelLine('');const _0x3eb395=await selectPages(_0x2afe96,_0x50868e);writeCliSideChannelLine(''),writeCliSideChannelLine(a190_0x4c5358['cyan'](_0x2273aa(0x114)+_0x3eb395[_0x2273aa(0x100)]+_0x2273aa(0xe1)));const _0x544015=_0x49babb[_0x2273aa(0x105)]&&_0x49babb[_0x2273aa(0xcd)];if(!_0x544015){writeCliSideChannelLine(renderSyncSummary(_0x3eb395,_0x50868e[_0x2273aa(0xf7)]>0x0));const _0x1ec884=await askConfirm(_0x2273aa(0xf4));if(!_0x1ec884)return writeCliSideChannelLine(a190_0x4c5358['gray'](_0x2273aa(0x112))),{'ok':!![]};}let _0x352962=_0x49babb[_0x2273aa(0x105)],_0x382203=_0x49babb[_0x2273aa(0xcd)];!_0x352962&&!_0x49babb[_0x2273aa(0xf5)]&&(_0x352962=await askJsUrl());!_0x382203&&!_0x49babb['appName']&&(_0x382203=await askCssUrl());const _0x52ac21=await askConfirm(_0x49babb[_0x2273aa(0xf5)]?_0x2273aa(0xe0)+_0x3eb395['length']+_0x2273aa(0xef)+_0x49babb['appName']+'?':_0x2273aa(0xe0)+_0x3eb395['length']+_0x2273aa(0xd3)+_0x352962+_0x2273aa(0xd5)+_0x382203+'?');if(!_0x52ac21)return writeCliSideChannelLine(a190_0x4c5358['gray'](_0x2273aa(0x112))),{'ok':!![]};const _0x35b64d=[_0x352962,_0x382203]['filter'](_0x212691=>Boolean(_0x212691));_0x49babb[_0x2273aa(0xf5)]&&_0x35b64d[_0x2273aa(0x100)]===0x0&&await assertSharedResourcesConfigured(_0x4ca8ff[_0x2273aa(0xe9)],_0x4ca8ff[_0x2273aa(0xf8)],_0x49babb[_0x2273aa(0xf5)]);const _0x1579cc=startSpinner('Creating\x20'+_0x3eb395[_0x2273aa(0x100)]+_0x2273aa(0xd1));try{const _0x3c0cb5=_0x3eb395[_0x2273aa(0x111)](_0xbcc12a=>resolvePage(_0xbcc12a,_0x49babb,_0x1d82e1)),_0x2ce2f5=await doCreateMenus(_0x4ca8ff['appCode'],_0x4ca8ff['cookie'],_0x3c0cb5,_0x35b64d,_0x49babb['appName']?{'appName':_0x49babb['appName']}:undefined);return stopSpinner(_0x1579cc,_0x2273aa(0xe4)+_0x2ce2f5[_0x2273aa(0xdf)]+_0x2273aa(0xf3),!![]),{'ok':!![],'data':_0x2ce2f5,'message':_0x2273aa(0xe3)+_0x2ce2f5[_0x2273aa(0xdf)]+_0x2273aa(0xd8)+_0x2ce2f5[_0x2273aa(0xec)]+'\x20failed.'};}catch(_0x352245){stopSpinner(_0x1579cc,_0x2273aa(0x103),![]);throw CliErrors[_0x2273aa(0xee)](_0x352245 instanceof Error?_0x352245[_0x2273aa(0x101)]:_0x2273aa(0x103));}}};function ensureRunnableContext(_0x46fe5d,_0x59d182){const _0xb0359e=a190_0x321164,_0x594619=_0x46fe5d[_0xb0359e(0x10b)]?String(_0x46fe5d[_0xb0359e(0x10b)])[_0xb0359e(0xd4)]():'';if(!isInProject()&&!_0x59d182&&!_0x594619)throw CliErrors['validation'](_0xb0359e(0xf6)+_0xb0359e(0x102));}function parsePaths(_0x1672db){const _0x1d296f=a190_0x321164;return[...new Set(_0x1672db[_0x1d296f(0x108)](',')[_0x1d296f(0x111)](_0x7087c7=>_0x7087c7[_0x1d296f(0xd4)]())[_0x1d296f(0xf1)](Boolean))];}
|