@lovrabet/rabetbase-cli 2.5.9 → 2.5.10-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.d.ts +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 +0 -28
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/instant-api-policy/endpoints.d.ts +8 -0
- package/lib/core/instant-api-policy/endpoints.js +1 -0
- package/lib/core/kb-management-client.d.ts +3 -9
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.d.ts +1 -4
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +3 -2
- package/skills/rabetbase/SKILL.md +2 -2
- package/skills/rabetbase-dataset-generation/SKILL.md +2 -2
- package/skills/rabetbase-page-generation/SKILL.md +2 -2
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2cd413,_0x490edd){const _0x1f856f=a175_0x5d0a,_0x1fceb2=_0x2cd413();while(!![]){try{const _0x4afc22=-parseInt(_0x1f856f(0x83))/0x1*(-parseInt(_0x1f856f(0x80))/0x2)+parseInt(_0x1f856f(0x98))/0x3+-parseInt(_0x1f856f(0x7e))/0x4*(-parseInt(_0x1f856f(0x90))/0x5)+-parseInt(_0x1f856f(0x9f))/0x6*(-parseInt(_0x1f856f(0x97))/0x7)+-parseInt(_0x1f856f(0x7f))/0x8*(-parseInt(_0x1f856f(0x86))/0x9)+parseInt(_0x1f856f(0xaa))/0xa+parseInt(_0x1f856f(0x99))/0xb*(-parseInt(_0x1f856f(0xa0))/0xc);if(_0x4afc22===_0x490edd)break;else _0x1fceb2['push'](_0x1fceb2['shift']());}catch(_0x46673a){_0x1fceb2['push'](_0x1fceb2['shift']());}}}(a175_0x10ba,0xe2d61));import{createHash}from'node:crypto';import{getMenuTree}from'../../../core/api-client.js';export async function fetchMenuSnapshot(_0x408167,_0x45ba23,_0x3a3d4a={}){const _0x2c3bf9=a175_0x5d0a,_0x4b466d=await getMenuTree(_0x408167,_0x45ba23);return buildMenuSnapshot(Array[_0x2c3bf9(0x92)](_0x4b466d)?_0x4b466d:[],_0x3a3d4a);}export function buildMenuSnapshot(_0x3d7d1d,_0x5a4c74={}){const _0x592cca=a175_0x5d0a,_0x42b6a1=flattenMenuItems(_0x3d7d1d,{'verbose':_0x5a4c74[_0x592cca(0xab)]===!![],'parentId':null,'depth':0x0}),_0x2595b4=new Map(_0x42b6a1[_0x592cca(0x87)](_0x2a5a50=>[_0x2a5a50['id'],_0x2a5a50])),_0x4f9e10=createHash(_0x592cca(0x8c))['update'](JSON[_0x592cca(0xa2)](_0x42b6a1[_0x592cca(0x87)](toHashInput)))[_0x592cca(0xae)]('hex');return{'total':_0x42b6a1[_0x592cca(0xa4)],'hash':_0x592cca(0xaf)+_0x4f9e10,'menus':_0x42b6a1,'byId':_0x2595b4};}function a175_0x10ba(){const _0x389e90=['sha256','pageId','path','label','670265pXVdPj','parentId','isArray','number','depth','datasetCode','visible','21HRHsaa','1285992NzhxpV','37542329oCAOCY','item','children','sort','filter','updateUserName','2090526aZqicm','12FHTzUB','type','stringify','index','length','string','url','values','push','extend','3131670lOYXxP','verbose','updateUserId','valid','digest','sha256:','20yBLYyI','49136nJcKVz','2BMlLIt','modelType','pageType','772999cNUdXj','datasetId','POSITIVE_INFINITY','1629OWueQo','map','updateTime','resources','childrenIds','isFinite'];a175_0x10ba=function(){return _0x389e90;};return a175_0x10ba();}export function toProcessedMenuItem(_0xb78e29){const _0xcd4a45=a175_0x5d0a;return{'id':_0xb78e29['id'],'path':_0xb78e29['path'],'label':_0xb78e29[_0xcd4a45(0x8f)],'resources':[..._0xb78e29[_0xcd4a45(0x89)]],'extend':_0xb78e29[_0xcd4a45(0xa9)]??null,'type':_0xb78e29[_0xcd4a45(0xa1)],'parentId':_0xb78e29[_0xcd4a45(0x91)]};}export function toMenuListItem(_0x60bd35){const {modelType:_0x1cb113,datasetId:_0xa513ec,datasetCode:_0x48d731,resourcesValid:_0x5e6c25,..._0x5a6ecb}=_0x60bd35;return _0x5a6ecb;}export function getChildren(_0xf4303,_0x2267e8){const _0xc506d2=a175_0x5d0a;return _0xf4303['menus'][_0xc506d2(0x9d)](_0x5a6ceb=>_0x5a6ceb[_0xc506d2(0x91)]===_0x2267e8);}function flattenMenuItems(_0x37b766,_0x169637){const _0xeeb259=a175_0x5d0a,_0x4fec3a=sortMenuItems(_0x37b766),_0x1c4b86=[];for(const _0x36d418 of _0x4fec3a){const _0x8dd7fd=sortMenuItems(Array[_0xeeb259(0x92)](_0x36d418[_0xeeb259(0x9b)])?_0x36d418[_0xeeb259(0x9b)]:[]);_0x1c4b86['push'](toMenuFact(_0x36d418,_0x8dd7fd,_0x169637)),_0x8dd7fd[_0xeeb259(0xa4)]>0x0&&_0x1c4b86[_0xeeb259(0xa8)](...flattenMenuItems(_0x8dd7fd,{'verbose':_0x169637[_0xeeb259(0xab)],'parentId':_0x36d418['id'],'depth':_0x169637['depth']+0x1}));}return _0x1c4b86;}function sortMenuItems(_0x214e21){const _0x286f0a=a175_0x5d0a;return _0x214e21[_0x286f0a(0x87)]((_0x2a30e1,_0x14dcba)=>({'item':_0x2a30e1,'index':_0x14dcba}))[_0x286f0a(0x9c)]((_0xb6454b,_0x586918)=>{const _0x344ff2=_0x286f0a,_0x152c77=normalizeSort(_0xb6454b[_0x344ff2(0x9a)][_0x344ff2(0x9c)]),_0x5ae901=normalizeSort(_0x586918[_0x344ff2(0x9a)][_0x344ff2(0x9c)]);if(_0x152c77!==_0x5ae901)return _0x152c77-_0x5ae901;return _0xb6454b[_0x344ff2(0xa3)]-_0x586918['index'];})[_0x286f0a(0x87)](({item:_0x49f91b})=>_0x49f91b);}function toMenuFact(_0x22408d,_0x2aa0a1,_0x5b57cc){const _0x1e4a81=a175_0x5d0a,_0x419c04=normalizeResourceValue(_0x22408d[_0x1e4a81(0xa9)]?.[_0x1e4a81(0x89)]),_0x4cba19={'id':_0x22408d['id'],'parentId':_0x5b57cc[_0x1e4a81(0x91)],'depth':_0x5b57cc[_0x1e4a81(0x94)],'label':normalizeString(_0x22408d[_0x1e4a81(0x8f)]),'path':normalizeString(_0x22408d[_0x1e4a81(0x8e)]),'url':normalizeString(_0x22408d['url']),'type':normalizeString(_0x22408d[_0x1e4a81(0xa1)]),'visible':typeof _0x22408d[_0x1e4a81(0x96)]==='boolean'?_0x22408d['visible']:null,'sort':typeof _0x22408d[_0x1e4a81(0x9c)]===_0x1e4a81(0x93)&&Number[_0x1e4a81(0x8b)](_0x22408d[_0x1e4a81(0x9c)])?_0x22408d[_0x1e4a81(0x9c)]:null,'resources':_0x419c04[_0x1e4a81(0xa7)],'resourcesValid':_0x419c04[_0x1e4a81(0xad)],'childrenIds':_0x2aa0a1['map'](_0xc68c5a=>_0xc68c5a['id']),'childrenCount':_0x2aa0a1[_0x1e4a81(0xa4)],'pageId':normalizeNullableNumber(_0x22408d[_0x1e4a81(0x8d)]),'pageType':normalizeString(_0x22408d[_0x1e4a81(0x82)]),'modelType':normalizeString(_0x22408d[_0x1e4a81(0x81)]),'datasetId':normalizeNullableNumber(_0x22408d[_0x1e4a81(0x84)]),'datasetCode':normalizeString(_0x22408d[_0x1e4a81(0x95)]),'updateUserId':normalizeNullableString(_0x22408d[_0x1e4a81(0xac)]),'updateUserName':normalizeNullableString(_0x22408d[_0x1e4a81(0x9e)]),'updateTime':normalizeNullableTimestamp(_0x22408d[_0x1e4a81(0x88)])};return _0x5b57cc[_0x1e4a81(0xab)]&&(_0x4cba19['extend']=_0x22408d[_0x1e4a81(0xa9)]??null),_0x4cba19;}function a175_0x5d0a(_0x417e3c,_0x3872e1){_0x417e3c=_0x417e3c-0x7e;const _0x10ba66=a175_0x10ba();let _0x5d0a88=_0x10ba66[_0x417e3c];return _0x5d0a88;}function toHashInput(_0xd2a3d){const _0x21a600=a175_0x5d0a;return{'id':_0xd2a3d['id'],'parentId':_0xd2a3d[_0x21a600(0x91)],'label':_0xd2a3d[_0x21a600(0x8f)],'path':_0xd2a3d['path'],'url':_0xd2a3d[_0x21a600(0xa6)],'type':_0xd2a3d[_0x21a600(0xa1)],'visible':_0xd2a3d['visible'],'sort':_0xd2a3d[_0x21a600(0x9c)],'resources':_0xd2a3d[_0x21a600(0x89)],'resourcesValid':_0xd2a3d['resourcesValid'],'childrenIds':_0xd2a3d[_0x21a600(0x8a)],'pageId':_0xd2a3d[_0x21a600(0x8d)],'pageType':_0xd2a3d[_0x21a600(0x82)],'modelType':_0xd2a3d[_0x21a600(0x81)],'datasetId':_0xd2a3d[_0x21a600(0x84)],'datasetCode':_0xd2a3d[_0x21a600(0x95)],'updateUserId':_0xd2a3d['updateUserId'],'updateUserName':_0xd2a3d[_0x21a600(0x9e)],'updateTime':_0xd2a3d[_0x21a600(0x88)]};}function normalizeSort(_0x26a54f){const _0x1fe37a=a175_0x5d0a;return typeof _0x26a54f===_0x1fe37a(0x93)&&Number[_0x1fe37a(0x8b)](_0x26a54f)?_0x26a54f:Number[_0x1fe37a(0x85)];}function normalizeString(_0x57611d){const _0x7d5692=a175_0x5d0a;return typeof _0x57611d===_0x7d5692(0xa5)?_0x57611d:'';}function normalizeNullableNumber(_0x377351){const _0x411596=a175_0x5d0a;return typeof _0x377351===_0x411596(0x93)&&Number[_0x411596(0x8b)](_0x377351)?_0x377351:null;}function normalizeNullableString(_0x3e9ee3){const _0x5ae917=a175_0x5d0a;return typeof _0x3e9ee3===_0x5ae917(0xa5)&&_0x3e9ee3[_0x5ae917(0xa4)]>0x0?_0x3e9ee3:null;}function normalizeNullableTimestamp(_0x143ae2){const _0x100de7=a175_0x5d0a;if(typeof _0x143ae2===_0x100de7(0xa5))return _0x143ae2['length']>0x0?_0x143ae2:null;return typeof _0x143ae2===_0x100de7(0x93)&&Number[_0x100de7(0x8b)](_0x143ae2)?_0x143ae2:null;}export function normalizeResources(_0x128312){const _0x426026=a175_0x5d0a;return normalizeResourceValue(_0x128312)[_0x426026(0xa7)];}function normalizeResourceValue(_0x2d5f7f){const _0x5d93fd=a175_0x5d0a;if(_0x2d5f7f==null)return{'values':[],'valid':!![]};if(Array['isArray'](_0x2d5f7f))return{'values':_0x2d5f7f['map'](String),'valid':!![]};if(typeof _0x2d5f7f!=='string')return{'values':[],'valid':![]};try{const _0x5cb591=JSON['parse'](_0x2d5f7f);return Array[_0x5d93fd(0x92)](_0x5cb591)?{'values':_0x5cb591[_0x5d93fd(0x87)](String),'valid':!![]}:{'values':[],'valid':![]};}catch{return{'values':[],'valid':![]};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x237e03,_0x55511b){var _0x5f4934=a176_0x25db,_0x43978b=_0x237e03();while(!![]){try{var _0x4b6bde=parseInt(_0x5f4934(0xc1))/0x1*(parseInt(_0x5f4934(0xc0))/0x2)+-parseInt(_0x5f4934(0xbc))/0x3+parseInt(_0x5f4934(0xc5))/0x4*(-parseInt(_0x5f4934(0xbe))/0x5)+parseInt(_0x5f4934(0xbd))/0x6+parseInt(_0x5f4934(0xc3))/0x7*(parseInt(_0x5f4934(0xc4))/0x8)+-parseInt(_0x5f4934(0xbf))/0x9+parseInt(_0x5f4934(0xc2))/0xa;if(_0x4b6bde===_0x55511b)break;else _0x43978b['push'](_0x43978b['shift']());}catch(_0x402648){_0x43978b['push'](_0x43978b['shift']());}}}(a176_0x452e,0x25068));export*from'../../../commands/menu/shared/types.js';export*from'../../../commands/menu/shared/logic.js';export*from'../../../commands/menu/shared/compare-table.js';export*from'../../../commands/menu/shared/inquirer.js';export*from'../../../commands/menu/shared/valid-url.js';export*from'../../../commands/menu/shared/local-pages.js';export*from'../../../commands/menu/shared/service.js';function a176_0x452e(){var _0x5254bd=['3756tSYPcI','197982cYDWSL','962190ayksVI','330eCxVbM','1763217ifGdLu','6eSJmzz','45842jlFFQE','227720tSdDkp','7IybITg','1238992TInJhe'];a176_0x452e=function(){return _0x5254bd;};return a176_0x452e();}function a176_0x25db(_0x367e32,_0x2489fe){_0x367e32=_0x367e32-0xbc;var _0x452e24=a176_0x452e();var _0x25dbcc=_0x452e24[_0x367e32];return _0x25dbcc;}export*from'../../../commands/menu/shared/sync-core.js';export*from'../../../commands/menu/shared/update-core.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x50c24b,_0x446a50){const _0x59afd3=a177_0x4cbf,_0x4cc32b=_0x50c24b();while(!![]){try{const _0x291190=parseInt(_0x59afd3(0x1b4))/0x1+parseInt(_0x59afd3(0x1bc))/0x2*(-parseInt(_0x59afd3(0x1d8))/0x3)+-parseInt(_0x59afd3(0x1d5))/0x4+parseInt(_0x59afd3(0x1bd))/0x5*(parseInt(_0x59afd3(0x1bf))/0x6)+-parseInt(_0x59afd3(0x1d4))/0x7*(-parseInt(_0x59afd3(0x1cc))/0x8)+parseInt(_0x59afd3(0x1c3))/0x9*(-parseInt(_0x59afd3(0x1c6))/0xa)+parseInt(_0x59afd3(0x1ba))/0xb*(parseInt(_0x59afd3(0x1b7))/0xc);if(_0x291190===_0x446a50)break;else _0x4cc32b['push'](_0x4cc32b['shift']());}catch(_0xa3f51e){_0x4cc32b['push'](_0x4cc32b['shift']());}}}(a177_0x4019,0xdfdd3));import a177_0x2b8619 from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a177_0x47bce2 from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x5ef294){const _0x2d560b=a177_0x4cbf;return _0x5ef294[_0x2d560b(0x1c9)](_0x17bea7=>{const _0x10c4cf=_0x2d560b;if(_0x17bea7?.[_0x10c4cf(0x1d0)]===_0x10c4cf(0x1c4))throw CliErrors[_0x10c4cf(0x1c1)](_0x10c4cf(0x1d7));throw _0x17bea7;});}export function startSpinner(_0x47cb9e){const _0x4c02cf=a177_0x4cbf;return a177_0x47bce2({'text':_0x47cb9e,'color':'cyan'})[_0x4c02cf(0x1ca)]();}function a177_0x4cbf(_0x17a0b1,_0x57352d){_0x17a0b1=_0x17a0b1-0x1b4;const _0x401938=a177_0x4019();let _0x4cbff8=_0x401938[_0x17a0b1];return _0x4cbff8;}export function stopSpinner(_0xc739d2,_0xc907ca,_0x2819e8){const _0xb7823d=a177_0x4cbf;_0x2819e8?_0xc739d2['succeed'](_0xc907ca):_0xc739d2[_0xb7823d(0x1c0)](_0xc907ca);}export async function askConfirm(_0x21492a){return onCancel(confirm({'message':_0x21492a,'theme':{'prefix':''}}));}function a177_0x4019(){const _0x17becb=['name','map','CSS\x20URL\x20checked','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','29253wejQeI','1935624Biflue','path','Cancelled.','15vgwbsX','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','[new]','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','length','JS\x20URL\x20check\x20failed','label','\x20\x20JS\x20URL:','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','117007ctciRp','\x20\x20Checking\x20CSS\x20URL\x20reachability...','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','13749180IWCvPm','filter','error','33lxxJIc','JS\x20URL\x20checked','505534uKNoME','111380bJlYuy','includes','174iUPjVW','fail','cancelled','isTTY','197946lSUwTY','ExitPromptError','CSS\x20URL\x20check\x20failed','740XZbaSe','test','green','catch','start','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','176iwrdNo','red','trim','gray'];a177_0x4019=function(){return _0x17becb;};return a177_0x4019();}export async function askJsUrl(_0x5406db){const _0x3f4528=a177_0x4cbf;while(!![]){const _0x3356b7=await onCancel(input({'message':_0x3f4528(0x1df),'default':_0x5406db,'theme':{'prefix':''}}));if(_0x3356b7[_0x3f4528(0x1ce)]()==='')throw CliErrors[_0x3f4528(0x1c1)]('Cancelled.');if(!/^https:\/\/.+\.js(\?.*)?$/[_0x3f4528(0x1c7)](_0x3356b7[_0x3f4528(0x1ce)]())){console[_0x3f4528(0x1b9)](a177_0x2b8619[_0x3f4528(0x1cd)](_0x3f4528(0x1d9)));continue;}const _0x45116f=startSpinner('\x20\x20Checking\x20JS\x20URL\x20reachability...');try{const _0x2dfada=await isUrlReachable(_0x3356b7[_0x3f4528(0x1ce)]());stopSpinner(_0x45116f,_0x3f4528(0x1bb),_0x2dfada);if(!_0x2dfada){console[_0x3f4528(0x1b9)](a177_0x2b8619[_0x3f4528(0x1cd)](_0x3f4528(0x1d3)));continue;}return _0x3356b7[_0x3f4528(0x1ce)]();}catch(_0x1349f0){stopSpinner(_0x45116f,_0x3f4528(0x1dd),![]);throw _0x1349f0;}}}export async function askCssUrl(_0x52b920){const _0x4e499a=a177_0x4cbf;while(!![]){const _0x135ccd=await onCancel(input({'message':'\x20\x20CSS\x20URL:','default':_0x52b920,'theme':{'prefix':''}}));if(_0x135ccd[_0x4e499a(0x1ce)]()==='')throw CliErrors[_0x4e499a(0x1c1)](_0x4e499a(0x1d7));if(!/^https:\/\/.+\.css(\?.*)?$/[_0x4e499a(0x1c7)](_0x135ccd[_0x4e499a(0x1ce)]())){console[_0x4e499a(0x1b9)](a177_0x2b8619['red'](_0x4e499a(0x1b6)));continue;}const _0x376b0f=startSpinner(_0x4e499a(0x1b5));try{const _0x4d74ff=await isUrlReachable(_0x135ccd[_0x4e499a(0x1ce)]());stopSpinner(_0x376b0f,_0x4e499a(0x1d2),_0x4d74ff);if(!_0x4d74ff){console[_0x4e499a(0x1b9)](a177_0x2b8619[_0x4e499a(0x1cd)](_0x4e499a(0x1cb)));continue;}return _0x135ccd[_0x4e499a(0x1ce)]();}catch(_0x57a7a8){stopSpinner(_0x376b0f,_0x4e499a(0x1c5),![]);throw _0x57a7a8;}}}export async function selectPages(_0x5d5636,_0x40df9b){const _0xb9f342=a177_0x4cbf,_0x51d8ef=_0x5d5636[_0xb9f342(0x1d1)](_0x36819f=>{const _0xd23913=_0xb9f342,_0x4c7f6a=_0x40df9b['has'](menuPathKey(_0x36819f[_0xd23913(0x1d6)]));return{'name':_0x36819f[_0xd23913(0x1de)]+'\x20\x20'+a177_0x2b8619[_0xd23913(0x1cf)](_0x36819f[_0xd23913(0x1d6)])+'\x20\x20'+(_0x4c7f6a?a177_0x2b8619[_0xd23913(0x1cf)]('[already\x20on\x20platform]'):a177_0x2b8619[_0xd23913(0x1c8)](_0xd23913(0x1da))),'value':_0x36819f['path'],'checked':!_0x4c7f6a,'disabled':_0x4c7f6a};});if(_0x51d8ef[_0xb9f342(0x1dc)]===0x0)throw new Error('No\x20local\x20pages\x20found.');const _0xea4fab=await onCancel(checkbox({'message':_0xb9f342(0x1e0),'choices':_0x51d8ef,'loop':![],'theme':{'prefix':''}}));if(_0xea4fab[_0xb9f342(0x1dc)]===0x0)throw new Error('No\x20menus\x20selected.');return _0x5d5636[_0xb9f342(0x1b8)](_0x3a220e=>_0xea4fab[_0xb9f342(0x1be)](_0x3a220e[_0xb9f342(0x1d6)]));}export function isInteractive(){const _0x4f5f92=a177_0x4cbf;return process['stdin'][_0x4f5f92(0x1c2)]===!![];}export function requireInteractive(){const _0xcf73d=a177_0x4cbf;if(!isInteractive())throw new Error('This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20'+_0xcf73d(0x1db));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a178_0x9f0a57=a178_0x2251;(function(_0x65f2a1,_0x3b240e){const _0x4a23b7=a178_0x2251,_0x158bf7=_0x65f2a1();while(!![]){try{const _0x3d71b8=parseInt(_0x4a23b7(0x1e2))/0x1*(parseInt(_0x4a23b7(0x1e8))/0x2)+parseInt(_0x4a23b7(0x1d6))/0x3*(-parseInt(_0x4a23b7(0x1d2))/0x4)+parseInt(_0x4a23b7(0x1da))/0x5+parseInt(_0x4a23b7(0x1c9))/0x6+-parseInt(_0x4a23b7(0x1c4))/0x7+-parseInt(_0x4a23b7(0x1dc))/0x8+parseInt(_0x4a23b7(0x1de))/0x9;if(_0x3d71b8===_0x3b240e)break;else _0x158bf7['push'](_0x158bf7['shift']());}catch(_0x201d8c){_0x158bf7['push'](_0x158bf7['shift']());}}}(a178_0x4c57,0x72755));import{existsSync,readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';function a178_0x4c57(){const _0x3eab1c=[':$1','endsWith','filter','test','forEach','label','has','src/pages','slice','order','isArray','Invalid\x20route\x20manifest\x20','pageFile','\x20disagrees\x20with\x20pageFile\x20','1531131cdOEmn','cwd','visible','length','parse','314514LLuOty','Route\x20','utf-8','utf8','trim','Invalid\x20route\x20group\x20for\x20',':\x20path,\x20label,\x20pageFile\x20and\x20visible\x20are\x20required','isDirectory','join','44uFqnPx','Invalid\x20route\x20order\x20for\x20','index.tsx','replace','206508YgxKsR','isInteger','Invalid\x20route\x20manifest\x20row\x20','path','1426805iRQlsH','group','3344064ePbZvx','match','13283757PksFnY','Duplicate\x20route\x20path\x20in\x20manifest:\x20','Route\x20page\x20file\x20does\x20not\x20exist:\x20','string','135vPUpJw','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','Route\x20manifest\x20must\x20contain\x20an\x20array:\x20','map','index','src/pages/','726YTPXwV','replaceAll','boolean'];a178_0x4c57=function(){return _0x3eab1c;};return a178_0x4c57();}const pagesDir=resolve(process[a178_0x9f0a57(0x1c5)](),a178_0x9f0a57(0x1f2));function a178_0x2251(_0x3afc55,_0x137ef4){_0x3afc55=_0x3afc55-0x1be;const _0x4c570c=a178_0x4c57();let _0x22518b=_0x4c570c[_0x3afc55];return _0x22518b;}export function extractTitleFromComment(_0x230129){const _0x530161=a178_0x9f0a57;try{const _0x4bb727=readFileSync(_0x230129,_0x530161(0x1cb)),_0x5bcf79=_0x4bb727[_0x530161(0x1dd)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x5bcf79&&_0x5bcf79[0x1]){const _0x5512cd=_0x5bcf79[0x1],_0x58ac98=_0x5512cd[_0x530161(0x1dd)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x58ac98&&_0x58ac98[0x1])return _0x58ac98[0x1][_0x530161(0x1cd)]();}let _0x6277f=null;const _0x379c8d=_0x4bb727['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x379c8d&&_0x379c8d[0x1]&&(_0x6277f=_0x379c8d[0x1]);if(!_0x6277f){const _0x52cc7c=_0x4bb727[_0x530161(0x1dd)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x52cc7c&&_0x52cc7c[0x1]&&(_0x6277f=_0x52cc7c[0x1]);}if(_0x6277f){const _0x1aa0bb=new RegExp('\x5cb'+_0x6277f+_0x530161(0x1e3)),_0x2b487c=_0x4bb727[_0x530161(0x1dd)](_0x1aa0bb);if(_0x2b487c&&_0x2b487c[0x1])return _0x2b487c[0x1];return _0x6277f;}return null;}catch(_0x476572){return null;}}export function getLocalPages(_0x50eb52=pagesDir,_0x4fff51=pagesDir,_0x329944=process['cwd']()){const _0x4f2d6e=a178_0x9f0a57;if(resolve(_0x50eb52)===resolve(_0x4fff51)){const _0xcb7fcc=join(_0x329944,'src/features/routing/routes.json');if(existsSync(_0xcb7fcc))return getDeclaredPages(_0xcb7fcc,_0x329944);}let _0x426f6a=[];const _0x558683=readdirSync(_0x50eb52);return _0x558683[_0x4f2d6e(0x1ef)](_0x15376a=>{const _0x121ad0=_0x4f2d6e,_0x4421dd=join(_0x50eb52,_0x15376a),_0x5496d9=statSync(_0x4421dd);if(_0x5496d9&&_0x5496d9[_0x121ad0(0x1d0)]())_0x426f6a=_0x426f6a['concat'](getLocalPages(_0x4421dd,_0x4fff51,_0x329944));else{if(_0x15376a[_0x121ad0(0x1ec)]('.tsx')){let _0x27489d=relative(_0x4fff51,_0x4421dd);_0x27489d['endsWith'](_0x121ad0(0x1d4))?_0x27489d=_0x27489d[_0x121ad0(0x1d5)](/index\.tsx$/,''):_0x27489d=_0x27489d['replace'](/\.tsx$/,'');_0x27489d['endsWith'](sep)&&(_0x27489d=_0x27489d[_0x121ad0(0x1be)](0x0,-0x1));const _0x23d58b=_0x27489d['split'](sep)[_0x121ad0(0x1d1)]('/'),_0x465a78=extractTitleFromComment(_0x4421dd),_0x235fca=_0x465a78||_0x23d58b;_0x426f6a['push']({'path':_0x23d58b[_0x121ad0(0x1e9)]('$',':'),'label':_0x235fca});}}}),_0x426f6a[_0x4f2d6e(0x1ed)](_0x3589db=>_0x3589db[_0x4f2d6e(0x1d9)]!=='');}function getDeclaredPages(_0x46d944,_0xe737a8){const _0x57ae30=a178_0x9f0a57;let _0x39efb3;try{_0x39efb3=JSON[_0x57ae30(0x1c8)](readFileSync(_0x46d944,_0x57ae30(0x1cc)));}catch(_0x39f6d6){throw new Error(_0x57ae30(0x1c1)+_0x46d944+':\x20'+String(_0x39f6d6));}if(!Array[_0x57ae30(0x1c0)](_0x39efb3))throw new Error(_0x57ae30(0x1e4)+_0x46d944);const _0x2dd77e=new Set();return _0x39efb3[_0x57ae30(0x1e5)]((_0x35d53f,_0x4b0f5c)=>{const _0x5ed2f3=_0x57ae30;if(!_0x35d53f||typeof _0x35d53f!=='object'||Array['isArray'](_0x35d53f))throw new Error(_0x5ed2f3(0x1d8)+(_0x4b0f5c+0x1));const _0x57296e=_0x35d53f,_0x55d7f3=_0x57296e[_0x5ed2f3(0x1d9)],_0x1f1b2b=_0x57296e[_0x5ed2f3(0x1f0)],_0xf80061=_0x57296e[_0x5ed2f3(0x1c2)];if(typeof _0x55d7f3!==_0x5ed2f3(0x1e1)||!/^\/(?!\/)[^?#]*$/['test'](_0x55d7f3)||typeof _0x1f1b2b!==_0x5ed2f3(0x1e1)||!_0x1f1b2b[_0x5ed2f3(0x1cd)]()||typeof _0xf80061!==_0x5ed2f3(0x1e1)||!/^src\/pages\/(?!.*\.\.)[^/].*\.tsx$/[_0x5ed2f3(0x1ee)](_0xf80061)||typeof _0x57296e[_0x5ed2f3(0x1c6)]!==_0x5ed2f3(0x1ea))throw new Error(_0x5ed2f3(0x1d8)+(_0x4b0f5c+0x1)+_0x5ed2f3(0x1cf));if(_0x2dd77e[_0x5ed2f3(0x1f1)](_0x55d7f3))throw new Error(_0x5ed2f3(0x1df)+_0x55d7f3);_0x2dd77e['add'](_0x55d7f3);if(!existsSync(resolve(_0xe737a8,_0xf80061)))throw new Error(_0x5ed2f3(0x1e0)+_0xf80061);const _0x219036=_0xf80061[_0x5ed2f3(0x1be)](_0x5ed2f3(0x1e7)[_0x5ed2f3(0x1c7)])['replace'](/\/index\.tsx$/,'')[_0x5ed2f3(0x1d5)](/\.tsx$/,'')[_0x5ed2f3(0x1e9)]('$',':')['replace'](/\[([^/\]]+)\]/g,_0x5ed2f3(0x1eb)),_0x173a6d=_0x219036===_0x5ed2f3(0x1e6)?'/':'/'+_0x219036;if(_0x55d7f3!==_0x173a6d)throw new Error(_0x5ed2f3(0x1ca)+_0x55d7f3+_0x5ed2f3(0x1c3)+_0xf80061+';\x20expected\x20'+_0x173a6d);if(_0x57296e[_0x5ed2f3(0x1db)]!==undefined&&(typeof _0x57296e['group']!==_0x5ed2f3(0x1e1)||!_0x57296e[_0x5ed2f3(0x1db)]['trim']()))throw new Error(_0x5ed2f3(0x1ce)+_0x55d7f3);if(_0x57296e[_0x5ed2f3(0x1bf)]!==undefined&&(!Number[_0x5ed2f3(0x1d7)](_0x57296e['order'])||_0x57296e[_0x5ed2f3(0x1bf)]<0x0))throw new Error(_0x5ed2f3(0x1d3)+_0x55d7f3);return{'path':_0x55d7f3,'label':_0x1f1b2b[_0x5ed2f3(0x1cd)](),'visible':_0x57296e['visible'],..._0x57296e['group']===undefined?{}:{'group':_0x57296e['group'][_0x5ed2f3(0x1cd)]()},..._0x57296e[_0x5ed2f3(0x1bf)]===undefined?{}:{'order':_0x57296e[_0x5ed2f3(0x1bf)]}};});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5566bb,_0x1e1fd0){const _0x3ca6bd=a179_0x178d,_0x23eb82=_0x5566bb();while(!![]){try{const _0x456ae0=-parseInt(_0x3ca6bd(0xa3))/0x1+parseInt(_0x3ca6bd(0xac))/0x2*(parseInt(_0x3ca6bd(0xaa))/0x3)+parseInt(_0x3ca6bd(0xb0))/0x4*(-parseInt(_0x3ca6bd(0xa5))/0x5)+-parseInt(_0x3ca6bd(0xae))/0x6*(-parseInt(_0x3ca6bd(0xa1))/0x7)+-parseInt(_0x3ca6bd(0xad))/0x8*(parseInt(_0x3ca6bd(0xb6))/0x9)+parseInt(_0x3ca6bd(0xa2))/0xa*(-parseInt(_0x3ca6bd(0xa0))/0xb)+parseInt(_0x3ca6bd(0xb4))/0xc;if(_0x456ae0===_0x1e1fd0)break;else _0x23eb82['push'](_0x23eb82['shift']());}catch(_0x5daaaf){_0x23eb82['push'](_0x23eb82['shift']());}}}(a179_0x4385,0x6f8cb));import{menuPathKey}from'../../../commands/menu/shared/path.js';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(_0x571a4b){const _0x4b696e=a179_0x178d,_0x154931=[];return!isValidJsHttpsUrl(_0x571a4b)&&_0x154931[_0x4b696e(0xa8)]('JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'),{'ok':_0x154931[_0x4b696e(0xa7)]===0x0,'errors':_0x154931};}function a179_0x4385(){const _0x59c1d4=['1252750qrbDbb','872656pikgNU','JS\x20URL\x20is\x20unreachable','1294045UrYsgh','errors','length','push','has','1674rureah','resources','2072mihkKF','872HELhnk','37740kijoVV','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','12dEjmho','CSS\x20URL\x20is\x20unreachable','path','label','21259848qBwUut','map','69552IMBuXb','22ZDmMUR','945wFYNxO'];a179_0x4385=function(){return _0x59c1d4;};return a179_0x4385();}export function validateCssUrl(_0x1e3e4f){const _0x41dc94=a179_0x178d,_0x160e45=[];return!isValidCssHttpsUrl(_0x1e3e4f)&&_0x160e45['push'](_0x41dc94(0xaf)),{'ok':_0x160e45[_0x41dc94(0xa7)]===0x0,'errors':_0x160e45};}export async function validateJsUrlReachable(_0x249378){const _0x59e121=a179_0x178d,_0x510879=validateJsUrl(_0x249378);if(!_0x510879['ok'])return _0x510879;const _0x195abc=await isUrlReachable(_0x249378);if(!_0x195abc)_0x510879['errors'][_0x59e121(0xa8)](_0x59e121(0xa4));return{'ok':_0x510879[_0x59e121(0xa6)]['length']===0x0,'errors':_0x510879['errors']};}export async function validateCssUrlReachable(_0x2ce3da){const _0x4a9d59=a179_0x178d,_0x371c08=validateCssUrl(_0x2ce3da);if(!_0x371c08['ok'])return _0x371c08;const _0x12015c=await isUrlReachable(_0x2ce3da);if(!_0x12015c)_0x371c08[_0x4a9d59(0xa6)][_0x4a9d59(0xa8)](_0x4a9d59(0xb1));return{'ok':_0x371c08[_0x4a9d59(0xa6)]['length']===0x0,'errors':_0x371c08[_0x4a9d59(0xa6)]};}export function buildCompareRows(_0x29df4f,_0x16748a){const _0x1ccf2e=a179_0x178d;return _0x29df4f[_0x1ccf2e(0xb5)](_0x565c2d=>({'label':_0x565c2d['label'],'path':_0x565c2d[_0x1ccf2e(0xb2)],'local':!![],'online':_0x16748a[_0x1ccf2e(0xa9)](menuPathKey(_0x565c2d[_0x1ccf2e(0xb2)]))}));}export async function doCreateMenus(_0x235126,_0x364216,_0x3127d1,_0x2affc8,_0x279ce7){const _0x44a4ef=a179_0x178d,_0x29d574=_0x279ce7?await createMenus(_0x235126,_0x364216,_0x3127d1,_0x2affc8,_0x279ce7):await createMenus(_0x235126,_0x364216,_0x3127d1,_0x2affc8);return{'created':_0x29d574[_0x44a4ef(0xa7)],'failed':0x0,'labels':_0x3127d1[_0x44a4ef(0xb5)](_0x3e8c24=>_0x3e8c24[_0x44a4ef(0xb3)]),'menus':_0x29d574};}function a179_0x178d(_0x380906,_0x2ee414){_0x380906=_0x380906-0xa0;const _0x43856b=a179_0x4385();let _0x178dd4=_0x43856b[_0x380906];return _0x178dd4;}export function filterMenusWithResources(_0x26e7c5){const _0x56018b=a179_0x178d;return _0x26e7c5['filter'](_0x3fb387=>_0x3fb387[_0x56018b(0xab)][_0x56018b(0xa7)]>0x0);}export async function fetchMenuData(_0x1333a7,_0x3fcf54){const _0x3464c8=a179_0x178d,_0x3bb4ec=getLocalPages(),_0x207652=await getOnlineMenuList(_0x1333a7,_0x3fcf54),_0x3b503e=new Set(_0x207652[_0x3464c8(0xb5)](_0x2f79f0=>menuPathKey(_0x2f79f0[_0x3464c8(0xb2)])));return{'localPages':_0x3bb4ec,'onlineMenuList':_0x207652,'onlinePaths':_0x3b503e};}export async function fetchOnlineMenuList(_0x5835c8,_0x5bf656){return getOnlineMenuList(_0x5835c8,_0x5bf656);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a180_0x4f6c0f=a180_0x3b8b;(function(_0x581fc6,_0x19b88d){const _0x351399=a180_0x3b8b,_0x5e20fc=_0x581fc6();while(!![]){try{const _0x5788cd=-parseInt(_0x351399(0xda))/0x1+parseInt(_0x351399(0xcf))/0x2+parseInt(_0x351399(0xfa))/0x3+parseInt(_0x351399(0x118))/0x4+parseInt(_0x351399(0xd2))/0x5+-parseInt(_0x351399(0x110))/0x6*(-parseInt(_0x351399(0xdd))/0x7)+-parseInt(_0x351399(0xe0))/0x8;if(_0x5788cd===_0x19b88d)break;else _0x5e20fc['push'](_0x5e20fc['shift']());}catch(_0x31f262){_0x5e20fc['push'](_0x5e20fc['shift']());}}}(a180_0x3ca1,0x74ed8));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_0x4f6c0f(0xc4),'required':!![],'description':a180_0x4f6c0f(0x10e)};export const MENU_SORT_FLAG={'name':a180_0x4f6c0f(0xf0),'type':a180_0x4f6c0f(0xc4),'description':a180_0x4f6c0f(0xc9)};export const MENU_PARENT_ID_FLAG={'name':a180_0x4f6c0f(0x105),'type':'string','description':a180_0x4f6c0f(0xf4)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a180_0x4f6c0f(0xee),'type':'string','description':a180_0x4f6c0f(0x102)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a180_0x4f6c0f(0xe1),'type':a180_0x4f6c0f(0xeb),'description':'Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches'},{'name':'expected-children-count','type':a180_0x4f6c0f(0xc4),'description':'Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches'}];export function validateExactId(_0x4a9b84){const _0x464272=a180_0x4f6c0f,_0x2d3328=_0x4a9b84[_0x464272(0xf6)]('id');if(!Number['isSafeInteger'](_0x2d3328)||_0x2d3328<=0x0)throw CliErrors[_0x464272(0xe3)](_0x464272(0x10a));return _0x2d3328;}export function validateSort(_0x526e18,_0x25c10d=a180_0x4f6c0f(0xf0)){const _0x29baf4=a180_0x4f6c0f;if(!hasFlag(_0x526e18,_0x25c10d))return undefined;const _0x5ff994=_0x526e18['num'](_0x25c10d);if(!Number[_0x29baf4(0xdf)](_0x5ff994)||_0x5ff994<0x0||_0x5ff994>MAX_MENU_SORT)throw menuError('menu_sort_invalid','--'+_0x25c10d+_0x29baf4(0xc5)+MAX_MENU_SORT+'.','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.');return _0x5ff994;}export function nextSiblingSort(_0x5cb1a9,_0x2bdd39,_0x2fcaba){const _0x12ebd2=a180_0x4f6c0f,_0x3e1c63=getChildren(_0x5cb1a9,_0x2bdd39)[_0x12ebd2(0x11c)](_0x17b4fa=>_0x17b4fa['sort'])[_0x12ebd2(0xd8)](_0x3aabc4=>typeof _0x3aabc4===_0x12ebd2(0xc4));if(_0x3e1c63[_0x12ebd2(0x104)]===0x0)return 0x0;const _0x219720=Math[_0x12ebd2(0x11a)](..._0x3e1c63);if(_0x219720>=MAX_MENU_SORT)throw menuError(_0x12ebd2(0x10d),_0x12ebd2(0x12f)+_0x2fcaba+_0x12ebd2(0xea)+_0x219720+'.',_0x12ebd2(0x113)+MAX_MENU_SORT+_0x12ebd2(0xcb));return _0x219720+0x1;}export function requireExplicitYes(_0x1ba839){const _0x3ad8b0=a180_0x4f6c0f;if(_0x1ba839['bool']('dry-run'))return;if(!_0x1ba839[_0x3ad8b0(0x108)](_0x3ad8b0(0xed)))throw menuError(_0x3ad8b0(0x107),_0x3ad8b0(0xe7),_0x3ad8b0(0xf7));}export async function fetchMutationSnapshot(_0x1fb477,_0x5658c3,_0x2b75fb){const _0x3081ed=a180_0x4f6c0f;try{return await fetchMenuSnapshot(_0x1fb477[_0x3081ed(0x124)],_0x1fb477[_0x3081ed(0x117)]);}catch(_0x51bf8b){throw mapMenuApiError(_0x51bf8b,_0x3081ed(0x128)+_0x5658c3,_0x2b75fb);}}export async function recheckMutationSnapshot(_0x22a2c2,_0x25190d,_0x35ce5c,_0x5d0cab){const _0x4a3157=a180_0x4f6c0f;let _0x4d7f57;try{_0x4d7f57=await fetchMenuSnapshot(_0x22a2c2[_0x4a3157(0x124)],_0x22a2c2[_0x4a3157(0x117)]);}catch(_0x1e2b3e){const _0x5f2fd8=mapMenuApiError(_0x1e2b3e,_0x4a3157(0x11b)+_0x35ce5c,_0x5d0cab);throw menuFailure(_0x5f2fd8,_0x25190d,{'stage':_0x4a3157(0xe5),'failed':_0x5d0cab==null?{}:{'id':_0x5d0cab}});}if(_0x4d7f57['hash']!==_0x25190d[_0x4a3157(0xf2)]){const _0x54c7db=menuError(_0x4a3157(0x119),'Online\x20menu\x20state\x20changed\x20before\x20'+_0x35ce5c+_0x4a3157(0x10c),_0x4a3157(0x115));throw menuFailure(_0x54c7db,_0x25190d,{'stage':'pre-write-recheck','failed':{..._0x5d0cab==null?{}:{'id':_0x5d0cab},'expectedSnapshotHash':_0x25190d[_0x4a3157(0xf2)],'currentSnapshotHash':_0x4d7f57[_0x4a3157(0xcc)]}});}return _0x4d7f57;}export function parseParentId(_0x487d58,_0x4413d1,_0x4b63d3={}){const _0x109f8a=a180_0x4f6c0f;if(!hasFlag(_0x487d58,_0x4413d1)){if(_0x4b63d3[_0x109f8a(0x11f)])throw CliErrors['flagMissing'](_0x4413d1);return undefined;}const _0x562aa5=_0x487d58[_0x109f8a(0xec)](_0x4413d1)[_0x109f8a(0xe4)]();if(_0x562aa5[_0x109f8a(0x10f)]()===_0x109f8a(0x100))return null;if(!/^\d+$/[_0x109f8a(0x125)](_0x562aa5))throw CliErrors['validation']('--'+_0x4413d1+_0x109f8a(0xdc));const _0x1ea2a8=Number(_0x562aa5);if(!Number[_0x109f8a(0xdf)](_0x1ea2a8)||_0x1ea2a8<=0x0)throw CliErrors['validation']('--'+_0x4413d1+_0x109f8a(0xdc));return _0x1ea2a8;}export function requireMenu(_0x2656ff,_0x34f9e7){const _0x20d3c9=a180_0x4f6c0f,_0x35d507=_0x2656ff[_0x20d3c9(0xc3)][_0x20d3c9(0xd6)](_0x34f9e7);if(!_0x35d507)throw menuError(_0x20d3c9(0xc7),_0x20d3c9(0xfb)+_0x34f9e7,_0x20d3c9(0x120));return _0x35d507;}export function requireFolder(_0x136c53,_0x2937e0){const _0x4f7ac4=a180_0x4f6c0f,_0x3d7f41=requireMenu(_0x136c53,_0x2937e0);if(_0x3d7f41[_0x4f7ac4(0xe2)]!==_0x4f7ac4(0x126))throw menuError(_0x4f7ac4(0x112),_0x4f7ac4(0x114)+_0x2937e0+_0x4f7ac4(0x10b)+(_0x3d7f41[_0x4f7ac4(0xe2)]||_0x4f7ac4(0xca))+_0x4f7ac4(0xff),_0x4f7ac4(0x103));return _0x3d7f41;}export function assertExpectedState(_0x36cc55,_0x40011a){const _0xe9fc6a=a180_0x4f6c0f;if(hasFlag(_0x36cc55,'expect-parent-id')){const _0x2e5e80=parseParentId(_0x36cc55,_0xe9fc6a(0xee),{'required':!![]});if(_0x40011a[_0xe9fc6a(0x121)]!==_0x2e5e80)throw stateDrift(_0xe9fc6a(0x114)+_0x40011a['id']+'\x20parent\x20changed:\x20expected\x20'+formatParent(_0x2e5e80)+',\x20current\x20'+formatParent(_0x40011a[_0xe9fc6a(0x121)])+'.');}if(hasFlag(_0x36cc55,_0xe9fc6a(0xe1))){const _0x4a9a7c=_0x36cc55[_0xe9fc6a(0xec)](_0xe9fc6a(0xe1));if(_0x40011a[_0xe9fc6a(0x101)]!==_0x4a9a7c)throw stateDrift('Menu\x20'+_0x40011a['id']+'\x20path\x20changed:\x20expected\x20'+JSON[_0xe9fc6a(0xd1)](_0x4a9a7c)+',\x20current\x20'+JSON['stringify'](_0x40011a[_0xe9fc6a(0x101)])+'.');}if(hasFlag(_0x36cc55,_0xe9fc6a(0xfc))){const _0xdf76c2=_0x36cc55[_0xe9fc6a(0xf6)](_0xe9fc6a(0xfc));if(!Number[_0xe9fc6a(0xdf)](_0xdf76c2)||_0xdf76c2<0x0)throw CliErrors[_0xe9fc6a(0xe3)](_0xe9fc6a(0xde));if(_0x40011a[_0xe9fc6a(0xd4)]!==_0xdf76c2)throw stateDrift('Menu\x20'+_0x40011a['id']+_0xe9fc6a(0x11e)+_0xdf76c2+_0xe9fc6a(0xd3)+_0x40011a[_0xe9fc6a(0xd4)]+'.');}}export function assertVerified(_0x340d1a,_0x4c7f82,_0x16f46d=a180_0x4f6c0f(0x123)){if(!_0x340d1a)throw menuError('menu_verification_failed',_0x4c7f82,_0x16f46d);}function a180_0x3b8b(_0xfe1cdc,_0x513f98){_0xfe1cdc=_0xfe1cdc-0xc3;const _0x3ca112=a180_0x3ca1();let _0x3b8bf1=_0x3ca112[_0xfe1cdc];return _0x3b8bf1;}export function mutationResult(_0x479457){const _0x5df7c8=a180_0x4f6c0f;return{'operation':_0x479457[_0x5df7c8(0x12a)],'selector':_0x479457[_0x5df7c8(0xd9)],'before':_0x479457[_0x5df7c8(0xd7)],'after':_0x479457[_0x5df7c8(0xce)],'dryRun':_0x479457[_0x5df7c8(0xf3)],'backend':_0x479457[_0x5df7c8(0x11d)],..._0x479457['plannedActions']?{'plannedActions':_0x479457['plannedActions']}:{},..._0x479457[_0x5df7c8(0xd5)]?{'targets':_0x479457[_0x5df7c8(0xd5)]}:{},..._0x479457[_0x5df7c8(0x12e)]?{'deleteOrder':_0x479457['deleteOrder']}:{},'snapshotHash':_0x479457['snapshotHash'],..._0x479457[_0x5df7c8(0x129)]?{'cascade':_0x479457[_0x5df7c8(0x129)]}:{},..._0x479457['planFile']?{'planFile':_0x479457[_0x5df7c8(0xe8)]}:{},'succeeded':_0x479457[_0x5df7c8(0xfd)]??[],'failed':_0x479457[_0x5df7c8(0xef)]??[],'warnings':_0x479457[_0x5df7c8(0x12c)]??[],'verification':_0x479457[_0x5df7c8(0xdb)],'error':_0x479457['error']};}export function menuDryRunResult(_0x5cdbce,_0x288341){return{..._0x5cdbce,..._0x288341};}export function menuFailure(_0x384693,_0x351441,_0x5580bf){const _0x3bd589=a180_0x4f6c0f,_0x57fa87=mutationResult({..._0x351441,'after':_0x5580bf[_0x3bd589(0xce)]===undefined?_0x351441[_0x3bd589(0xce)]:_0x5580bf[_0x3bd589(0xce)],'backend':_0x5580bf[_0x3bd589(0x11d)]??_0x351441[_0x3bd589(0x11d)],'dryRun':![],'succeeded':_0x5580bf[_0x3bd589(0xfd)]??[],'failed':_0x5580bf['failedRecords']??[{..._0x5580bf['failed']??{},'stage':_0x5580bf[_0x3bd589(0xe6)],'code':_0x384693['code'],'message':_0x384693[_0x3bd589(0xcd)]}],'warnings':[..._0x351441[_0x3bd589(0x12c)],..._0x5580bf[_0x3bd589(0x12c)]??[]],'verification':_0x5580bf['verification'],'error':{'code':_0x384693[_0x3bd589(0x106)],'message':_0x384693[_0x3bd589(0xcd)],..._0x384693[_0x3bd589(0x109)]?{'hint':_0x384693['hint']}:{}}});return Object[_0x3bd589(0x122)](_0x384693,_0x3bd589(0xf9),{'value':_0x57fa87,'enumerable':!![],'configurable':!![]}),_0x384693;}export function asVerificationError(_0x186dbb,_0x2b3796){const _0x5ba40f=a180_0x4f6c0f;if(_0x186dbb instanceof CliError&&_0x186dbb['code']===_0x5ba40f(0x127))return _0x186dbb;const _0x15843b=_0x186dbb instanceof Error?_0x186dbb[_0x5ba40f(0xcd)]:String(_0x186dbb);return menuError(_0x5ba40f(0x127),''+_0x2b3796+(_0x15843b?':\x20'+_0x15843b:''),_0x5ba40f(0xf1));}export function describeMenuErrorCause(_0x2726f8,_0x284a07,_0x2dc808){const _0x13f4b6=a180_0x4f6c0f,_0x5bcaf9=mapMenuApiError(_0x2726f8,_0x284a07,_0x2dc808);return{'causeCode':_0x5bcaf9[_0x13f4b6(0x106)],'causeMessage':_0x5bcaf9[_0x13f4b6(0xcd)]};}export function hasFlag(_0x2e1f7,_0x23be20){const _0x58277e=a180_0x4f6c0f;return Object[_0x58277e(0xf5)][_0x58277e(0xc6)][_0x58277e(0xf8)](_0x2e1f7['rawFlags'],_0x23be20)&&_0x2e1f7['rawFlags'][_0x23be20]!==undefined;}export function toApiParentId(_0x6932ff){return _0x6932ff??0x0;}function a180_0x3ca1(){const _0x1c3226=['after','474678yoPKqW','Permission\x20denied\x20while\x20attempting\x20to\x20','stringify','4040900xeoZLJ',',\x20current\x20','childrenCount','targets','get','before','filter','selector','578177DVgyru','verification','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','793709CguioT','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','isSafeInteger','20946592AaUDiy','expect-path','type','validation','trim','pre-write-recheck','stage','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','planFile','\x20menu\x20','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','string','str','yes','expect-parent-id','failed','sort','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','snapshotHash','dryRun','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','prototype','num','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','call','data','2305452DSMcAw','Online\x20menu\x20not\x20found:\x20','expected-children-count','succeeded','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','\x22,\x20not\x20folder.','root','path','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','length','parent-id','code','menu_confirmation_required','bool','hint','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','\x20is\x20type\x20\x22',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','menu_sort_overflow','Exact\x20online\x20menu\x20id','toLowerCase','48dfxOPI','Failed\x20to\x20','menu_parent_not_folder','Reorder\x20sibling\x20menus\x20below\x20','Menu\x20','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','cookie','3817352obrgSq','menu_state_drift','max','recheck\x20online\x20menu\x20facts\x20before\x20','map','backend','\x20child\x20count\x20changed:\x20expected\x20','required','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','parentId','defineProperty','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','appCode','test','folder','menu_verification_failed','read\x20online\x20menu\x20facts\x20before\x20','cascade','operation','api_error','warnings','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','deleteOrder','Cannot\x20append\x20a\x20','byId','number','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','hasOwnProperty','menu_not_found','menu_permission_denied','Sibling\x20sort\x20value\x20(non-negative\x20integer)','unknown',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','hash','message'];a180_0x3ca1=function(){return _0x1c3226;};return a180_0x3ca1();}export function formatParent(_0x956819){return _0x956819==null?'root':String(_0x956819);}export function menuError(_0x5db20a,_0x1d50d5,_0x805d8d){return new CliError(_0x5db20a,0x1,_0x1d50d5,_0x805d8d);}export function mapMenuApiError(_0x263ac9,_0x31c068,_0x1813e4){const _0x4b142f=a180_0x4f6c0f;if(_0x263ac9 instanceof CliError&&_0x263ac9[_0x4b142f(0x106)]!==_0x4b142f(0x12b))return _0x263ac9;const _0x51694a=_0x263ac9 instanceof Error?_0x263ac9[_0x4b142f(0xcd)]:String(_0x263ac9);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x4b142f(0x125)](_0x51694a))return menuError(_0x4b142f(0xc8),_0x4b142f(0xd0)+_0x31c068+(_0x1813e4?'\x20menu\x20'+_0x1813e4:'')+'.',_0x4b142f(0xfe));return menuError('menu_mutation_failed',_0x4b142f(0x111)+_0x31c068+(_0x1813e4?_0x4b142f(0xe9)+_0x1813e4:'')+':\x20'+_0x51694a,_0x4b142f(0x12d));}export function isMenuResponseLoss(_0x29ef87){const _0x5a8a38=a180_0x4f6c0f,_0x115014=_0x29ef87 instanceof Error?_0x29ef87['message']:String(_0x29ef87);if(_0x29ef87 instanceof CliError)return _0x29ef87['code']==='api_error'&&/^Request (?:failed|timeout):/i[_0x5a8a38(0x125)](_0x115014);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x5a8a38(0x125)](_0x115014);}function stateDrift(_0x1b0633){const _0x2fb8d9=a180_0x4f6c0f;return menuError('menu_state_drift',_0x1b0633,_0x2fb8d9(0x116));}
|
|
1
|
+
const a180_0x941e73=a180_0xc719;(function(_0x3ac30f,_0x50839f){const _0x20de0f=a180_0xc719,_0x27fa85=_0x3ac30f();while(!![]){try{const _0x877d8d=-parseInt(_0x20de0f(0xd7))/0x1*(parseInt(_0x20de0f(0xd1))/0x2)+-parseInt(_0x20de0f(0xf2))/0x3*(parseInt(_0x20de0f(0xb9))/0x4)+-parseInt(_0x20de0f(0xed))/0x5*(parseInt(_0x20de0f(0xbf))/0x6)+-parseInt(_0x20de0f(0xba))/0x7+parseInt(_0x20de0f(0xb1))/0x8*(-parseInt(_0x20de0f(0xd0))/0x9)+-parseInt(_0x20de0f(0xc3))/0xa*(parseInt(_0x20de0f(0xcb))/0xb)+parseInt(_0x20de0f(0xc8))/0xc;if(_0x877d8d===_0x50839f)break;else _0x27fa85['push'](_0x27fa85['shift']());}catch(_0x5235b9){_0x27fa85['push'](_0x27fa85['shift']());}}}(a180_0x3e60,0x93f5b));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':a180_0x941e73(0x106),'type':'number','description':'Sibling\x20sort\x20value\x20(non-negative\x20integer)'};export const MENU_PARENT_ID_FLAG={'name':a180_0x941e73(0xec),'type':a180_0x941e73(0xdd),'description':'Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node'};function a180_0x3e60(){const _0x16c6f8=['deleteOrder','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','\x20child\x20count\x20changed:\x20expected\x20','menu_sort_invalid','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','string','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','verification','toLowerCase','succeeded','length','folder','backend','map','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','unknown','cascade','dryRun','Menu\x20','parent-id','1632785aYZXZp','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','\x20path\x20changed:\x20expected\x20','menu_permission_denied','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','33CyPnKo','warnings','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','read\x20online\x20menu\x20facts\x20before\x20','snapshotHash','childrenCount',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','num','code','hasOwnProperty','appCode','dry-run','\x22,\x20not\x20folder.','parentId','flagMissing','stringify','filter','plannedActions','expect-path','cookie','sort','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','failed','message','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','byId','Reorder\x20sibling\x20menus\x20below\x20','data','prototype','expected-children-count','Failed\x20to\x20','\x20parent\x20changed:\x20expected\x20','type','menu_mutation_failed','Online\x20menu\x20state\x20changed\x20before\x20','menu_sort_overflow','menu_confirmation_required','yes','root','menu_parent_not_folder','targets','27872obLWRW','\x20is\x20type\x20\x22','test','hash','max','validation','menu_state_drift','number','352784aHergE','80647HKHpBa','trim',',\x20current\x20','after','expect-parent-id','6IRXdtF','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','menu_verification_failed','470TpvAUg','rawFlags','pre-write-recheck','bool','hint','59485140edRJsa','Permission\x20denied\x20while\x20attempting\x20to\x20','api_error','176429couDOb','menu_not_found','path','str','planFile','3123dvDUcf','14FBvbcE','Online\x20menu\x20not\x20found:\x20','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','isSafeInteger','Cannot\x20append\x20a\x20','selector','154291eeGWeO'];a180_0x3e60=function(){return _0x16c6f8;};return a180_0x3e60();}export const MENU_EXPECT_PARENT_ID_FLAG={'name':a180_0x941e73(0xbe),'type':a180_0x941e73(0xdd),'description':a180_0x941e73(0xde)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a180_0x941e73(0x104),'type':'string','description':a180_0x941e73(0xc1)},{'name':a180_0x941e73(0x10f),'type':a180_0x941e73(0xb8),'description':a180_0x941e73(0xf4)}];export function validateExactId(_0x2ccbfd){const _0x486075=a180_0x941e73,_0x214691=_0x2ccbfd[_0x486075(0xf9)]('id');if(!Number[_0x486075(0xd4)](_0x214691)||_0x214691<=0x0)throw CliErrors[_0x486075(0xb6)](_0x486075(0xdf));return _0x214691;}export function validateSort(_0x1fa591,_0xfe5301=a180_0x941e73(0x106)){const _0x9fa676=a180_0x941e73;if(!hasFlag(_0x1fa591,_0xfe5301))return undefined;const _0x478d35=_0x1fa591[_0x9fa676(0xf9)](_0xfe5301);if(!Number['isSafeInteger'](_0x478d35)||_0x478d35<0x0||_0x478d35>MAX_MENU_SORT)throw menuError(_0x9fa676(0xdb),'--'+_0xfe5301+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x9fa676(0x107));return _0x478d35;}export function nextSiblingSort(_0x10ed09,_0x371369,_0x2cf5fc){const _0x268c36=a180_0x941e73,_0x33e2a7=getChildren(_0x10ed09,_0x371369)[_0x268c36(0xe6)](_0x8186c=>_0x8186c[_0x268c36(0x106)])[_0x268c36(0x102)](_0x1ab787=>typeof _0x1ab787===_0x268c36(0xb8));if(_0x33e2a7[_0x268c36(0xe3)]===0x0)return 0x0;const _0x47d91d=Math[_0x268c36(0xb5)](..._0x33e2a7);if(_0x47d91d>=MAX_MENU_SORT)throw menuError(_0x268c36(0xab),_0x268c36(0xd5)+_0x2cf5fc+_0x268c36(0xee)+_0x47d91d+'.',_0x268c36(0x10c)+MAX_MENU_SORT+_0x268c36(0xf8));return _0x47d91d+0x1;}export function requireExplicitYes(_0x4e9c5b){const _0x353e4e=a180_0x941e73;if(_0x4e9c5b[_0x353e4e(0xc6)](_0x353e4e(0xfd)))return;if(!_0x4e9c5b[_0x353e4e(0xc6)](_0x353e4e(0xad)))throw menuError(_0x353e4e(0xac),'This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0x1f368e,_0x1eec88,_0x393559){const _0x52132c=a180_0x941e73;try{return await fetchMenuSnapshot(_0x1f368e['appCode'],_0x1f368e[_0x52132c(0x105)]);}catch(_0x8377e7){throw mapMenuApiError(_0x8377e7,_0x52132c(0xf5)+_0x1eec88,_0x393559);}}export async function recheckMutationSnapshot(_0x21b375,_0x3e264c,_0x45540c,_0x1e1e15){const _0xce78b7=a180_0x941e73;let _0x4beaa5;try{_0x4beaa5=await fetchMenuSnapshot(_0x21b375[_0xce78b7(0xfc)],_0x21b375[_0xce78b7(0x105)]);}catch(_0x530279){const _0x93236=mapMenuApiError(_0x530279,'recheck\x20online\x20menu\x20facts\x20before\x20'+_0x45540c,_0x1e1e15);throw menuFailure(_0x93236,_0x3e264c,{'stage':'pre-write-recheck','failed':_0x1e1e15==null?{}:{'id':_0x1e1e15}});}if(_0x4beaa5[_0xce78b7(0xb4)]!==_0x3e264c['snapshotHash']){const _0x188bd2=menuError(_0xce78b7(0xb7),_0xce78b7(0x114)+_0x45540c+';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.',_0xce78b7(0xd9));throw menuFailure(_0x188bd2,_0x3e264c,{'stage':_0xce78b7(0xc5),'failed':{..._0x1e1e15==null?{}:{'id':_0x1e1e15},'expectedSnapshotHash':_0x3e264c[_0xce78b7(0xf6)],'currentSnapshotHash':_0x4beaa5[_0xce78b7(0xb4)]}});}return _0x4beaa5;}export function parseParentId(_0x36caa8,_0x264024,_0x4d17f0={}){const _0xf86f=a180_0x941e73;if(!hasFlag(_0x36caa8,_0x264024)){if(_0x4d17f0['required'])throw CliErrors[_0xf86f(0x100)](_0x264024);return undefined;}const _0x2de1f3=_0x36caa8[_0xf86f(0xce)](_0x264024)[_0xf86f(0xbb)]();if(_0x2de1f3[_0xf86f(0xe1)]()==='root')return null;if(!/^\d+$/['test'](_0x2de1f3))throw CliErrors[_0xf86f(0xb6)]('--'+_0x264024+_0xf86f(0xd3));const _0x211f10=Number(_0x2de1f3);if(!Number[_0xf86f(0xd4)](_0x211f10)||_0x211f10<=0x0)throw CliErrors[_0xf86f(0xb6)]('--'+_0x264024+_0xf86f(0xd3));return _0x211f10;}export function requireMenu(_0xde4f5d,_0x1fa108){const _0x5a330a=a180_0x941e73,_0x2306a5=_0xde4f5d[_0x5a330a(0x10b)]['get'](_0x1fa108);if(!_0x2306a5)throw menuError(_0x5a330a(0xcc),_0x5a330a(0xd2)+_0x1fa108,'Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.');return _0x2306a5;}export function requireFolder(_0x1b3083,_0x67e7a){const _0x9ec5fc=a180_0x941e73,_0x5d6229=requireMenu(_0x1b3083,_0x67e7a);if(_0x5d6229[_0x9ec5fc(0x112)]!==_0x9ec5fc(0xe4))throw menuError(_0x9ec5fc(0xaf),_0x9ec5fc(0xeb)+_0x67e7a+_0x9ec5fc(0xb2)+(_0x5d6229['type']||_0x9ec5fc(0xe8))+_0x9ec5fc(0xfe),_0x9ec5fc(0xc0));return _0x5d6229;}export function assertExpectedState(_0x354338,_0x28553a){const _0x21c441=a180_0x941e73;if(hasFlag(_0x354338,_0x21c441(0xbe))){const _0x781da5=parseParentId(_0x354338,_0x21c441(0xbe),{'required':!![]});if(_0x28553a[_0x21c441(0xff)]!==_0x781da5)throw stateDrift('Menu\x20'+_0x28553a['id']+_0x21c441(0x111)+formatParent(_0x781da5)+_0x21c441(0xbc)+formatParent(_0x28553a[_0x21c441(0xff)])+'.');}if(hasFlag(_0x354338,_0x21c441(0x104))){const _0x22ce1e=_0x354338[_0x21c441(0xce)](_0x21c441(0x104));if(_0x28553a[_0x21c441(0xcd)]!==_0x22ce1e)throw stateDrift(_0x21c441(0xeb)+_0x28553a['id']+_0x21c441(0xef)+JSON[_0x21c441(0x101)](_0x22ce1e)+',\x20current\x20'+JSON['stringify'](_0x28553a[_0x21c441(0xcd)])+'.');}if(hasFlag(_0x354338,'expected-children-count')){const _0x3a34e7=_0x354338['num'](_0x21c441(0x10f));if(!Number[_0x21c441(0xd4)](_0x3a34e7)||_0x3a34e7<0x0)throw CliErrors['validation'](_0x21c441(0xdc));if(_0x28553a[_0x21c441(0xf7)]!==_0x3a34e7)throw stateDrift(_0x21c441(0xeb)+_0x28553a['id']+_0x21c441(0xda)+_0x3a34e7+_0x21c441(0xbc)+_0x28553a['childrenCount']+'.');}}export function assertVerified(_0x297963,_0x28d575,_0x4a5c38='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){const _0x3d4268=a180_0x941e73;if(!_0x297963)throw menuError(_0x3d4268(0xc2),_0x28d575,_0x4a5c38);}export function mutationResult(_0x268f5a){const _0x1bb364=a180_0x941e73;return{'operation':_0x268f5a['operation'],'selector':_0x268f5a[_0x1bb364(0xd6)],'before':_0x268f5a['before'],'after':_0x268f5a[_0x1bb364(0xbd)],'dryRun':_0x268f5a[_0x1bb364(0xea)],'backend':_0x268f5a[_0x1bb364(0xe5)],..._0x268f5a[_0x1bb364(0x103)]?{'plannedActions':_0x268f5a[_0x1bb364(0x103)]}:{},..._0x268f5a[_0x1bb364(0xb0)]?{'targets':_0x268f5a[_0x1bb364(0xb0)]}:{},..._0x268f5a[_0x1bb364(0xd8)]?{'deleteOrder':_0x268f5a[_0x1bb364(0xd8)]}:{},'snapshotHash':_0x268f5a[_0x1bb364(0xf6)],..._0x268f5a[_0x1bb364(0xe9)]?{'cascade':_0x268f5a[_0x1bb364(0xe9)]}:{},..._0x268f5a[_0x1bb364(0xcf)]?{'planFile':_0x268f5a[_0x1bb364(0xcf)]}:{},'succeeded':_0x268f5a[_0x1bb364(0xe2)]??[],'failed':_0x268f5a[_0x1bb364(0x108)]??[],'warnings':_0x268f5a[_0x1bb364(0xf3)]??[],'verification':_0x268f5a[_0x1bb364(0xe0)],'error':_0x268f5a['error']};}export function menuDryRunResult(_0x5d95aa,_0xb39198){return{..._0x5d95aa,..._0xb39198};}export function menuFailure(_0x1975a0,_0x3afbec,_0x82a97d){const _0x331f85=a180_0x941e73,_0x2b3c31=mutationResult({..._0x3afbec,'after':_0x82a97d[_0x331f85(0xbd)]===undefined?_0x3afbec[_0x331f85(0xbd)]:_0x82a97d[_0x331f85(0xbd)],'backend':_0x82a97d['backend']??_0x3afbec[_0x331f85(0xe5)],'dryRun':![],'succeeded':_0x82a97d[_0x331f85(0xe2)]??[],'failed':_0x82a97d['failedRecords']??[{..._0x82a97d[_0x331f85(0x108)]??{},'stage':_0x82a97d['stage'],'code':_0x1975a0[_0x331f85(0xfa)],'message':_0x1975a0[_0x331f85(0x109)]}],'warnings':[..._0x3afbec[_0x331f85(0xf3)],..._0x82a97d[_0x331f85(0xf3)]??[]],'verification':_0x82a97d[_0x331f85(0xe0)],'error':{'code':_0x1975a0[_0x331f85(0xfa)],'message':_0x1975a0['message'],..._0x1975a0[_0x331f85(0xc7)]?{'hint':_0x1975a0[_0x331f85(0xc7)]}:{}}});return Object['defineProperty'](_0x1975a0,_0x331f85(0x10d),{'value':_0x2b3c31,'enumerable':!![],'configurable':!![]}),_0x1975a0;}export function asVerificationError(_0x53b4ac,_0x20d8a9){const _0x62654e=a180_0x941e73;if(_0x53b4ac instanceof CliError&&_0x53b4ac[_0x62654e(0xfa)]===_0x62654e(0xc2))return _0x53b4ac;const _0x1142e1=_0x53b4ac instanceof Error?_0x53b4ac[_0x62654e(0x109)]:String(_0x53b4ac);return menuError(_0x62654e(0xc2),''+_0x20d8a9+(_0x1142e1?':\x20'+_0x1142e1:''),_0x62654e(0x10a));}export function describeMenuErrorCause(_0x15d62d,_0x452a08,_0x3c5a8b){const _0x2c0969=a180_0x941e73,_0xb104aa=mapMenuApiError(_0x15d62d,_0x452a08,_0x3c5a8b);return{'causeCode':_0xb104aa[_0x2c0969(0xfa)],'causeMessage':_0xb104aa[_0x2c0969(0x109)]};}export function hasFlag(_0x4e0330,_0x47bd82){const _0x55e8ae=a180_0x941e73;return Object[_0x55e8ae(0x10e)][_0x55e8ae(0xfb)]['call'](_0x4e0330['rawFlags'],_0x47bd82)&&_0x4e0330[_0x55e8ae(0xc4)][_0x47bd82]!==undefined;}export function toApiParentId(_0x306f7c){return _0x306f7c??0x0;}export function formatParent(_0x252102){const _0x35a700=a180_0x941e73;return _0x252102==null?_0x35a700(0xae):String(_0x252102);}export function menuError(_0x207113,_0x364353,_0x1091c2){return new CliError(_0x207113,0x1,_0x364353,_0x1091c2);}function a180_0xc719(_0x4e6c66,_0x21a812){_0x4e6c66=_0x4e6c66-0xab;const _0x3e60a5=a180_0x3e60();let _0xc71925=_0x3e60a5[_0x4e6c66];return _0xc71925;}export function mapMenuApiError(_0x273768,_0x38a3e8,_0x3e8c28){const _0x4005e2=a180_0x941e73;if(_0x273768 instanceof CliError&&_0x273768['code']!==_0x4005e2(0xca))return _0x273768;const _0x2ed1b4=_0x273768 instanceof Error?_0x273768[_0x4005e2(0x109)]:String(_0x273768);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x4005e2(0xb3)](_0x2ed1b4))return menuError(_0x4005e2(0xf0),_0x4005e2(0xc9)+_0x38a3e8+(_0x3e8c28?'\x20menu\x20'+_0x3e8c28:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x4005e2(0x113),_0x4005e2(0x110)+_0x38a3e8+(_0x3e8c28?'\x20menu\x20'+_0x3e8c28:'')+':\x20'+_0x2ed1b4,_0x4005e2(0xf1));}export function isMenuResponseLoss(_0x1ae4ec){const _0x903880=a180_0x941e73,_0x70e489=_0x1ae4ec instanceof Error?_0x1ae4ec[_0x903880(0x109)]:String(_0x1ae4ec);if(_0x1ae4ec instanceof CliError)return _0x1ae4ec[_0x903880(0xfa)]==='api_error'&&/^Request (?:failed|timeout):/i[_0x903880(0xb3)](_0x70e489);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'](_0x70e489);}function stateDrift(_0x5a36f1){const _0x241a4a=a180_0x941e73;return menuError(_0x241a4a(0xb7),_0x5a36f1,_0x241a4a(0xe7));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a181_0xd3a1(_0x1866c5,_0x53751d){_0x1866c5=_0x1866c5-0x108;const _0x1dce1d=a181_0x1dce();let _0xd3a182=_0x1dce1d[_0x1866c5];return _0xd3a182;}function a181_0x1dce(){const _0x3d405c=['2141170MXOknA','5250707ZWDBOG','replace','1084GiscZv','156042fXtHRQ','1602054SiYrNh','6tOZWiB','26618iwwLAR','8mxQFBB','2892euaXGJ','65GwLcWM','13233jaSouA','12215ZsOSTb','trim'];a181_0x1dce=function(){return _0x3d405c;};return a181_0x1dce();}(function(_0x3c69e9,_0x4b2ef2){const _0x39dbaf=a181_0xd3a1,_0x6d2b9=_0x3c69e9();while(!![]){try{const _0x5b428c=-parseInt(_0x39dbaf(0x10b))/0x1*(-parseInt(_0x39dbaf(0x108))/0x2)+parseInt(_0x39dbaf(0x114))/0x3+-parseInt(_0x39dbaf(0x112))/0x4*(-parseInt(_0x39dbaf(0x10d))/0x5)+-parseInt(_0x39dbaf(0x115))/0x6*(parseInt(_0x39dbaf(0x110))/0x7)+-parseInt(_0x39dbaf(0x109))/0x8*(parseInt(_0x39dbaf(0x113))/0x9)+-parseInt(_0x39dbaf(0x10f))/0xa+-parseInt(_0x39dbaf(0x10c))/0xb*(parseInt(_0x39dbaf(0x10a))/0xc);if(_0x5b428c===_0x4b2ef2)break;else _0x6d2b9['push'](_0x6d2b9['shift']());}catch(_0x3cc46e){_0x6d2b9['push'](_0x6d2b9['shift']());}}}(a181_0x1dce,0xc0cad));export function menuPathKey(_0x18b8de){const _0x1608ff=a181_0xd3a1,_0x411e36=_0x18b8de[_0x1608ff(0x10e)]();if(!_0x411e36)return'';return _0x411e36['replace'](/^\/+/,'')[_0x1608ff(0x111)](/\/+$/,'')||'/';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1c3f03,_0x1e75fa){const _0x413540=a182_0x4b6c,_0x5953b9=_0x1c3f03();while(!![]){try{const _0x4b7012=parseInt(_0x413540(0x1a8))/0x1+-parseInt(_0x413540(0x1a9))/0x2*(parseInt(_0x413540(0x183))/0x3)+parseInt(_0x413540(0x19d))/0x4+parseInt(_0x413540(0x18f))/0x5*(parseInt(_0x413540(0x194))/0x6)+-parseInt(_0x413540(0x198))/0x7*(parseInt(_0x413540(0x18d))/0x8)+parseInt(_0x413540(0x189))/0x9*(parseInt(_0x413540(0x1ad))/0xa)+parseInt(_0x413540(0x1ab))/0xb*(-parseInt(_0x413540(0x1ac))/0xc);if(_0x4b7012===_0x1e75fa)break;else _0x5953b9['push'](_0x5953b9['shift']());}catch(_0x1942e4){_0x5953b9['push'](_0x5953b9['shift']());}}}(a182_0x4466,0x2696f));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_0x214450,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x3d0617,_0x4e66d8){const _0x1e7fe5=a182_0x4b6c,_0x204339=getEnv();logger['info']('get-online-menu-list',isProduction(_0x204339)?_0x1e7fe5(0x192)+_0x3d0617+')':_0x1e7fe5(0x18b)+_0x3d0617+')');const _0x3ec37a=await fetchMenuSnapshot(_0x3d0617,_0x4e66d8,{'verbose':!![]});return logger[_0x1e7fe5(0x19b)]('get-online-menu-list',_0x1e7fe5(0x19f)+_0x3ec37a[_0x1e7fe5(0x1a4)]+'\x20online\x20menus\x20successfully'),_0x3ec37a['menus'][_0x1e7fe5(0x182)](toProcessedMenuItem);}export async function createMenu(_0x1b31a8,_0x5e5581,_0x3096c0){const _0x164456=a182_0x4b6c;logger[_0x164456(0x19b)](_0x164456(0x1a0),_0x164456(0x19c)+_0x3096c0[_0x164456(0x18c)]+'\x20('+_0x3096c0[_0x164456(0x19a)]+')');const _0x3c20e6={'appCode':_0x1b31a8,'type':_0x164456(0x1ae),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x3096c0[_0x164456(0x185)]?JSON['stringify'](_0x3096c0[_0x164456(0x185)]):undefined},..._0x3096c0},_0x194e1f=await createMenuRecord(_0x3c20e6,_0x5e5581,_0x164456(0x186)+_0x3096c0[_0x164456(0x18c)]+'\x22');return logger[_0x164456(0x19b)](_0x164456(0x1a0),_0x164456(0x191)+_0x3096c0[_0x164456(0x18c)]),_0x194e1f;}async function createSingleMenu(_0x1a46e0,_0x39a682,_0x4cbb89,_0x554bb3,_0x14f91e){const _0x4abced=a182_0x4b6c,_0x24240f={'appCode':_0x1a46e0,'type':_0x4abced(0x1ae),'sort':_0x4abced(0x18a)in _0x4cbb89&&typeof _0x4cbb89[_0x4abced(0x18a)]===_0x4abced(0x1aa)?_0x4cbb89['order']:0x0,..._0x4abced(0x190)in _0x4cbb89&&typeof _0x4cbb89['visible']===_0x4abced(0x184)?{'visible':_0x4cbb89[_0x4abced(0x190)]}:{},..._0x4abced(0x196)in _0x4cbb89&&typeof _0x4cbb89[_0x4abced(0x196)]===_0x4abced(0x1aa)?{'parentId':_0x4cbb89[_0x4abced(0x196)]}:{},'extend':{..._0x14f91e?.[_0x4abced(0x1a7)]?{'appName':_0x14f91e[_0x4abced(0x1a7)]}:{},'loadScriptMode':'import','resources':_0x554bb3?JSON[_0x4abced(0x1a1)](_0x554bb3):undefined},'label':_0x4cbb89[_0x4abced(0x18c)],'path':_0x4cbb89[_0x4abced(0x19a)]},_0x2c5618=await createMenuRecord(_0x24240f,_0x39a682,_0x4abced(0x186)+_0x4cbb89[_0x4abced(0x18c)]+'\x22');return logger[_0x4abced(0x19b)]('create-menu',_0x4abced(0x191)+_0x4cbb89[_0x4abced(0x18c)]),_0x2c5618;}function a182_0x4b6c(_0x384d42,_0x2ed070){_0x384d42=_0x384d42-0x181;const _0x4466ce=a182_0x4466();let _0x4b6cb0=_0x4466ce[_0x384d42];return _0x4b6cb0;}function a182_0x4466(){const _0x458cf7=['Creating\x20menu:\x20','412244rHEjbh','Regroup\x20','Fetched\x20','create-menu','stringify','menuGroups','Start\x20batch\x20menu\x20creation,\x20total\x20','total','Update\x20menu\x20','loadScriptMode','appName','200585olQjtM','171398mUXZdJ','number','11TjmFNz','3094536OfcQLs','10KUHcZr','procode','Menu\x20assets\x20synced:\x20','map','3BpySoU','boolean','resources','Create\x20menu\x20\x22','create-menus','Delete\x20','680337USPzTB','order','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','label','8XmDUCc','\x20menu\x20group(s)','201010CdYHNm','visible','Menu\x20created\x20successfully:\x20','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','Update\x20menu\x20assets\x20\x22','42nbjXdH','update-menu-cdn-url','parentId','\x20menu','1113091nSVCQT','length','path','info'];a182_0x4466=function(){return _0x458cf7;};return a182_0x4466();}export async function createMenus(_0x3f2b80,_0x4c272f,_0x2eaabf,_0x835f25,_0x2c7318){const _0x2a305a=a182_0x4b6c;logger[_0x2a305a(0x19b)](_0x2a305a(0x187),_0x2a305a(0x1a3)+_0x2eaabf[_0x2a305a(0x199)]);const _0x3e8753=await Promise['all'](_0x2eaabf[_0x2a305a(0x182)](_0x3ce9e5=>createSingleMenu(_0x3f2b80,_0x4c272f,_0x3ce9e5,_0x835f25,_0x2c7318)));return logger[_0x2a305a(0x19b)]('create-menus','Batch\x20menu\x20creation\x20completed,\x20total\x20'+_0x2eaabf[_0x2a305a(0x199)]),_0x3e8753;}export async function updateMenuCdnUrl(_0x3ecf87,_0x55d432,_0x5595d1){const _0x235050=a182_0x4b6c;logger[_0x235050(0x19b)](_0x235050(0x195),'Updating\x20menu\x20asset\x20links:\x20'+_0x5595d1['label']+'\x20('+_0x5595d1[_0x235050(0x19a)]+')');const _0x8d4127={'id':_0x5595d1['id'],'appCode':_0x3ecf87,'extend':{..._0x5595d1['extend']??{},..._0x5595d1[_0x235050(0x1a6)]?{'loadScriptMode':_0x5595d1[_0x235050(0x1a6)]}:{},'resources':_0x5595d1[_0x235050(0x185)]?JSON[_0x235050(0x1a1)](_0x5595d1[_0x235050(0x185)]):undefined}},_0x8fac54=await updateMenuRecord(_0x8d4127,_0x55d432,_0x235050(0x193)+_0x5595d1[_0x235050(0x18c)]+'\x22');return logger[_0x235050(0x19b)](_0x235050(0x195),_0x235050(0x181)+_0x5595d1[_0x235050(0x18c)],undefined),_0x8fac54;}export async function createMenuEntity(_0x1ada54,_0x141a29,_0x215073){const _0x32726b=a182_0x4b6c;return createMenuRecord({'appCode':_0x1ada54,..._0x215073},_0x141a29,_0x32726b(0x186)+_0x215073[_0x32726b(0x18c)]+'\x22');}export async function updateMenuEntity(_0x30f6a0,_0x1dc678,_0x32486f){const _0x52bf89=a182_0x4b6c;return updateMenuRecord({'appCode':_0x30f6a0,..._0x32486f},_0x1dc678,_0x52bf89(0x1a5)+_0x32486f['id']);}export async function batchDeleteMenuEntities(_0x273dc7,_0x613a9f){const _0x846aaf=a182_0x4b6c;return batchDeleteMenuRecords(_0x613a9f,_0x273dc7,_0x846aaf(0x188)+_0x613a9f[_0x846aaf(0x199)]+_0x846aaf(0x197)+(_0x613a9f[_0x846aaf(0x199)]===0x1?'':'s'));}export async function startMenuRegroup(_0x5b663c,_0xdff7e2){const _0x4a22ca=a182_0x4b6c;return a182_0x214450(_0xdff7e2,_0x5b663c,_0x4a22ca(0x19e)+_0xdff7e2[_0x4a22ca(0x1a2)][_0x4a22ca(0x199)]+_0x4a22ca(0x18e));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a183_0x740e75=a183_0x3a82;(function(_0x4713eb,_0x32b7fe){const _0x24faa0=a183_0x3a82,_0x2d4940=_0x4713eb();while(!![]){try{const _0x259a3b=-parseInt(_0x24faa0(0x190))/0x1*(-parseInt(_0x24faa0(0x199))/0x2)+parseInt(_0x24faa0(0x19c))/0x3+-parseInt(_0x24faa0(0x1ac))/0x4*(parseInt(_0x24faa0(0x198))/0x5)+parseInt(_0x24faa0(0x1af))/0x6+-parseInt(_0x24faa0(0x192))/0x7+parseInt(_0x24faa0(0x19a))/0x8+-parseInt(_0x24faa0(0x1a1))/0x9*(-parseInt(_0x24faa0(0x1a6))/0xa);if(_0x259a3b===_0x32b7fe)break;else _0x2d4940['push'](_0x2d4940['shift']());}catch(_0x36b169){_0x2d4940['push'](_0x2d4940['shift']());}}}(a183_0x3e79,0x479f1));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';function a183_0x3a82(_0x46f7f6,_0x2472bb){_0x46f7f6=_0x46f7f6-0x185;const _0x3e79e6=a183_0x3e79();let _0x3a826f=_0x3e79e6[_0x46f7f6];return _0x3a826f;}function a183_0x3e79(){const _0x21246d=['No\x20shared\x20resources\x20configured\x20for\x20','3213847KuRBXv','parse','basename','app.extend.assets[','appCode','app-name','83145mpSnzG','2tCvAdl','570736vBwlxj','app.extend.assets','259086rRSKlp','app.extend.assets\x20must\x20be\x20an\x20array.','validation','sharedConfigured','filter','9vcXqAh','path','trim','appName','message','6104090AMWwJh','\x20resources','str','stringify','string','object','24YCfrjQ','app','length','407310NvJGRm','map','extend','menu\x20','app.extend','assets','isArray','\x20must\x20be\x20an\x20array\x20of\x20URLs.','subapp.resources','menu','\x20must\x20be\x20a\x20JSON\x20object.','resources','16258bbbBSo'];a183_0x3e79=function(){return _0x21246d;};return a183_0x3e79();}import{CliErrors}from'../../../errors.js';function objectValue(_0x14ddad,_0x20c812){const _0x170073=a183_0x3a82,_0x12ed9d=typeof _0x14ddad===_0x170073(0x1aa)?parseJson(_0x14ddad,_0x20c812):_0x14ddad;if(!_0x12ed9d||typeof _0x12ed9d!==_0x170073(0x1ab)||Array[_0x170073(0x18a)](_0x12ed9d))throw CliErrors[_0x170073(0x19e)](_0x20c812+_0x170073(0x18e));return _0x12ed9d;}function parseJson(_0x5125cc,_0x92540a){const _0x47153a=a183_0x3a82;try{return JSON[_0x47153a(0x193)](_0x5125cc);}catch{throw CliErrors['validation'](_0x92540a+'\x20contains\x20invalid\x20JSON.');}}function resourceList(_0x2f97f4,_0x29adb2){const _0x424c06=a183_0x3a82;if(typeof _0x2f97f4!==_0x424c06(0x1aa))throw CliErrors['validation'](_0x29adb2+'\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.');const _0x4807b7=parseJson(_0x2f97f4,_0x29adb2);if(!Array['isArray'](_0x4807b7)||_0x4807b7['some'](_0x2b0c65=>typeof _0x2b0c65!==_0x424c06(0x1aa)))throw CliErrors[_0x424c06(0x19e)](_0x29adb2+_0x424c06(0x18b));return _0x4807b7;}export function buildSubappAssetsStatus(_0x279c00,_0x356030,_0x2a60e7){const _0x2dc17a=a183_0x3a82,_0x1e5897=_0x279c00['extend']==null?{}:objectValue(_0x279c00['extend'],_0x2dc17a(0x188)),_0x4b63ec=_0x1e5897['assets']==null?[]:typeof _0x1e5897[_0x2dc17a(0x189)]===_0x2dc17a(0x1aa)?parseJson(_0x1e5897['assets'],_0x2dc17a(0x19b)):_0x1e5897[_0x2dc17a(0x189)];if(!Array[_0x2dc17a(0x18a)](_0x4b63ec))throw CliErrors[_0x2dc17a(0x19e)](_0x2dc17a(0x19d));const _0x1dff1b=_0x4b63ec[_0x2dc17a(0x185)]((_0xbf733f,_0x555339)=>objectValue(_0xbf733f,_0x2dc17a(0x195)+_0x555339+']')),_0x58252d=_0x1dff1b['filter'](_0x1db98d=>_0x1db98d[_0x2dc17a(0x1a4)]===_0x2a60e7);if(_0x58252d[_0x2dc17a(0x1ae)]>0x1)throw CliErrors['validation']('Duplicate\x20subapp\x20records\x20for\x20'+_0x2a60e7+'.');const _0x29de8b=_0x58252d[0x0],_0x4a6b59=_0x29de8b?.['resources']==null?[]:resourceList(_0x29de8b[_0x2dc17a(0x18f)],_0x2dc17a(0x18c)),_0x4eb1b4=_0x356030[_0x2dc17a(0x1a0)](_0x348094=>_0x348094[_0x2dc17a(0x186)]?.[_0x2dc17a(0x1a4)]===_0x2a60e7),_0x3b8f36=_0x4eb1b4[_0x2dc17a(0x185)](_0x292d7f=>{const _0x425acc=_0x2dc17a;let _0x558eab=null,_0x522c89=null;try{_0x558eab=_0x292d7f[_0x425acc(0x186)]?.[_0x425acc(0x18f)]==null?_0x292d7f[_0x425acc(0x18f)]:resourceList(_0x292d7f['extend']['resources'],_0x425acc(0x187)+_0x292d7f['id']+_0x425acc(0x1a7));}catch(_0x433523){_0x522c89=_0x433523 instanceof Error?_0x433523[_0x425acc(0x1a5)]:String(_0x433523);}const _0x478943=_0x4a6b59[_0x425acc(0x1ae)]>0x0?_0x425acc(0x1ad):_0x425acc(0x18d),_0x3f7d91=_0x478943==='app'?_0x4a6b59:_0x558eab;return{'id':_0x292d7f['id'],'path':_0x292d7f[_0x425acc(0x1a2)],'preferredSourceIfSupported':_0x478943,'preferredResourcesIfSupported':_0x3f7d91,'menuFallbackResources':_0x558eab,'menuFallbackError':_0x522c89,'fallbackDiffers':_0x558eab===null?null:_0x478943===_0x425acc(0x1ad)&&_0x558eab[_0x425acc(0x1ae)]>0x0&&JSON[_0x425acc(0x1a9)](_0x558eab)!==JSON['stringify'](_0x3f7d91)};});return{'appName':_0x2a60e7,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x29de8b),'sharedResources':_0x4a6b59,'loadScriptMode':_0x29de8b?.['loadScriptMode']??null,'basename':_0x29de8b?.[_0x2dc17a(0x194)]??null,'boundMenus':_0x3b8f36[_0x2dc17a(0x1ae)],'staleMenuFallbacks':_0x3b8f36[_0x2dc17a(0x1a0)](_0x22e171=>_0x22e171['fallbackDiffers'])[_0x2dc17a(0x1ae)],'menus':_0x3b8f36};}export async function assertSharedResourcesConfigured(_0x25f942,_0x30665e,_0x11f172){const _0x3ef424=a183_0x3a82,_0x23f762=await getSmartAppRecord(_0x25f942,_0x30665e),_0x138ac2=buildSubappAssetsStatus(_0x23f762,[],_0x11f172);if(!_0x138ac2[_0x3ef424(0x19f)]||_0x138ac2['sharedResources'][_0x3ef424(0x1ae)]===0x0)throw CliErrors[_0x3ef424(0x19e)](_0x3ef424(0x191)+_0x11f172+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':'Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app'},{'name':a183_0x740e75(0x197),'type':a183_0x740e75(0x1aa),'required':!![],'description':'Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code'}];export function getSubappSelector(_0x217e4f){const _0x1267fc=a183_0x740e75,_0x4fc074=_0x217e4f[_0x1267fc(0x196)],_0x5ecf68=_0x217e4f[_0x1267fc(0x1a8)](_0x1267fc(0x197))[_0x1267fc(0x1a3)]();if(!_0x5ecf68)throw CliErrors[_0x1267fc(0x19e)]('--app-name\x20is\x20required.');return{'appCode':_0x4fc074,'appName':_0x5ecf68};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a184_0x51da87=a184_0x5e4c;(function(_0x5dfb9d,_0x3d2312){const _0x56543c=a184_0x5e4c,_0x2f0d9f=_0x5dfb9d();while(!![]){try{const _0x111f59=-parseInt(_0x56543c(0x13c))/0x1*(parseInt(_0x56543c(0x112))/0x2)+-parseInt(_0x56543c(0x106))/0x3+parseInt(_0x56543c(0x124))/0x4+-parseInt(_0x56543c(0x12c))/0x5+parseInt(_0x56543c(0x12d))/0x6+-parseInt(_0x56543c(0x138))/0x7+parseInt(_0x56543c(0x102))/0x8;if(_0x111f59===_0x3d2312)break;else _0x2f0d9f['push'](_0x2f0d9f['shift']());}catch(_0x308a14){_0x2f0d9f['push'](_0x2f0d9f['shift']());}}}(a184_0xf385,0x192c5));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a184_0x5e4c(_0xb8f0f7,_0x4f84fb){_0xb8f0f7=_0xb8f0f7-0x102;const _0xf38584=a184_0xf385();let _0x5e4c8b=_0xf38584[_0xb8f0f7];return _0x5e4c8b;}import{menuPathKey}from'../../../commands/menu/shared/path.js';function a184_0xf385(){const _0x52bd23=['251130meuBJh','98262QgFIxm','Invalid\x20--params:\x20','folder','visible','--params.','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','cwd','join','filter','path','Invalid\x20--params\x20JSON.','1018143cRyTbG',':\x20expected\x20a\x20non-empty\x20string.','appName','parse','2976WATMlQ','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','jsUrl','group','1661296HUNGHB',';\x20found\x20','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','map','27099aRDuvk','cssUrl','Invalid\x20--params\x20fields:\x20','Start\x20non-interactive\x20menu\x20sync','Invalid\x20--params.','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','push','trim','Parent\x20','parentId','pages','isInteger','8SuKjGY','JS\x20URL\x20is\x20unreachable:\x20','label','keys','setLogPath','type','Menu\x20sync\x20completed','hasOwn','dryRun','Expected\x20one\x20folder\x20named\x20\x22','length','import','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','string','has','CSS\x20URL\x20is\x20unreachable:\x20','menu-sync','message','382728zUsFpj','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','isArray','\x22\x20for\x20','order','\x0a\x20\x20Available\x20local\x20paths:\x20','procode'];a184_0xf385=function(){return _0x52bd23;};return a184_0xf385();}import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set([a184_0x51da87(0x13e),a184_0x51da87(0x107),a184_0x51da87(0x13a),a184_0x51da87(0x130),a184_0x51da87(0x10f)]);export function resolvePage(_0x26eee4,_0x4560cc,_0x51ff07){const _0x5dc9fa=a184_0x51da87;let _0x5441a6=_0x4560cc[_0x5dc9fa(0x10f)]??_0x26eee4[_0x5dc9fa(0x10f)];if(_0x5441a6===undefined&&_0x26eee4[_0x5dc9fa(0x13f)]){const _0x1ce2f6=_0x51ff07[_0x5dc9fa(0x135)](_0x502b98=>_0x502b98[_0x5dc9fa(0x117)]===_0x5dc9fa(0x12f)&&_0x502b98[_0x5dc9fa(0x114)]===_0x26eee4[_0x5dc9fa(0x13f)]);if(_0x1ce2f6['length']!==0x1)throw new Error(_0x5dc9fa(0x11b)+_0x26eee4[_0x5dc9fa(0x13f)]+_0x5dc9fa(0x128)+_0x26eee4['path']+_0x5dc9fa(0x103)+_0x1ce2f6[_0x5dc9fa(0x11c)]);_0x5441a6=_0x1ce2f6[0x0]['id'];}if(_0x5441a6!==undefined&&_0x5441a6!==0x0&&_0x51ff07[_0x5dc9fa(0x135)](_0x4d32d7=>_0x4d32d7['id']===_0x5441a6&&_0x4d32d7[_0x5dc9fa(0x117)]===_0x5dc9fa(0x12f))[_0x5dc9fa(0x11c)]!==0x1)throw new Error(_0x5dc9fa(0x10e)+_0x5441a6+_0x5dc9fa(0x132));return{..._0x26eee4,..._0x5441a6===undefined?{}:{'parentId':_0x5441a6},..._0x4560cc[_0x5dc9fa(0x130)]===undefined?{}:{'visible':_0x4560cc['visible']}};}function validateParams(_0x45e227){const _0x5b9740=a184_0x51da87,_0x449949=[];return _0x45e227['jsUrl']&&!isValidJsHttpsUrl(_0x45e227[_0x5b9740(0x13e)])&&_0x449949[_0x5b9740(0x10c)]({'field':'jsUrl','message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x45e227[_0x5b9740(0x107)]&&!isValidCssHttpsUrl(_0x45e227[_0x5b9740(0x107)])&&_0x449949[_0x5b9740(0x10c)]({'field':_0x5b9740(0x107),'message':_0x5b9740(0x11e)}),_0x449949;}export async function runMenuSyncCore(_0x1fc77c,_0xb924de,_0x41036c=[],_0x5c8500,_0x52910d={}){const _0x4f84e6=a184_0x51da87,_0x174ed6=parseMenuSyncParams(_0x5c8500),_0x7350f8=[...new Set(_0x41036c[_0x4f84e6(0x105)](_0x13a98e=>_0x13a98e['trim']())[_0x4f84e6(0x135)](Boolean)[_0x4f84e6(0x105)](menuPathKey))],_0xc9fa39=_0x174ed6[_0x4f84e6(0x13e)],_0x1a2e3d=_0x174ed6[_0x4f84e6(0x107)],_0x30c9e3=[];if(_0xc9fa39)_0x30c9e3[_0x4f84e6(0x10c)](_0xc9fa39);if(_0x1a2e3d)_0x30c9e3[_0x4f84e6(0x10c)](_0x1a2e3d);const _0x531b9e=validateParams(_0x174ed6);if(_0x531b9e[_0x4f84e6(0x11c)]>0x0){const _0x2da98a=_0x531b9e['map'](_0x5a2222=>_0x4f84e6(0x131)+_0x5a2222['field']+':\x20'+_0x5a2222[_0x4f84e6(0x123)])['join'](';\x20');throw new Error(_0x4f84e6(0x12e)+_0x2da98a);}logger[_0x4f84e6(0x116)](process[_0x4f84e6(0x133)]()),logger['info'](_0x4f84e6(0x122),_0x4f84e6(0x109),{'appCode':_0x1fc77c,'selectedCount':_0x7350f8[_0x4f84e6(0x11c)],'jsUrl':_0xc9fa39,'cssUrl':_0x1a2e3d});if(_0xc9fa39){const _0xa81e72=await isUrlReachable(_0xc9fa39);if(!_0xa81e72)throw new Error(_0x4f84e6(0x113)+_0xc9fa39);}if(_0x1a2e3d){const _0x4fadb1=await isUrlReachable(_0x1a2e3d);if(!_0x4fadb1)throw new Error(_0x4f84e6(0x121)+_0x1a2e3d);}const _0x2b1dbf=getLocalPages();if(_0x2b1dbf['length']===0x0){if(_0x7350f8[_0x4f84e6(0x11c)]>0x0)throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x7350f8[_0x4f84e6(0x134)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x52910d[_0x4f84e6(0x11a)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x59f480=await getOnlineMenuList(_0x1fc77c,_0xb924de),_0x183a10=new Set(_0x59f480[_0x4f84e6(0x105)](_0x392f11=>menuPathKey(_0x392f11[_0x4f84e6(0x136)])));let _0x2f114f;if(_0x7350f8[_0x4f84e6(0x11c)]>0x0){const _0x8f97c1=new Map(_0x2b1dbf['map'](_0x3abaaa=>[menuPathKey(_0x3abaaa[_0x4f84e6(0x136)]),_0x3abaaa])),_0x5f4319=_0x7350f8[_0x4f84e6(0x135)](_0x5b3d61=>!_0x8f97c1[_0x4f84e6(0x120)](_0x5b3d61));if(_0x5f4319['length']>0x0){const _0x2a2a20=_0x2b1dbf[_0x4f84e6(0x105)](_0x2326ba=>_0x2326ba[_0x4f84e6(0x136)])['join'](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x5f4319['join'](',\x20')+_0x4f84e6(0x12a)+_0x2a2a20);}const _0x4a823d=_0x7350f8[_0x4f84e6(0x135)](_0x335e34=>_0x183a10[_0x4f84e6(0x120)](_0x335e34));if(_0x4a823d[_0x4f84e6(0x11c)]>0x0)throw new Error(_0x4f84e6(0x125)+_0x4a823d[_0x4f84e6(0x134)](',\x20'));_0x2f114f=_0x7350f8[_0x4f84e6(0x105)](_0x337fb4=>_0x8f97c1['get'](_0x337fb4));}else _0x2f114f=_0x2b1dbf[_0x4f84e6(0x135)](_0x4bc18f=>!_0x183a10[_0x4f84e6(0x120)](menuPathKey(_0x4bc18f[_0x4f84e6(0x136)])));if(_0x2f114f[_0x4f84e6(0x11c)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x52910d['dryRun']===!![],'targetPages':[],'plannedMenus':[]};_0x2f114f=_0x2f114f[_0x4f84e6(0x105)](_0x3abf06=>resolvePage(_0x3abf06,_0x174ed6,_0x59f480));_0x174ed6[_0x4f84e6(0x13a)]&&_0x30c9e3[_0x4f84e6(0x11c)]===0x0&&await assertSharedResourcesConfigured(_0x1fc77c,_0xb924de,_0x174ed6[_0x4f84e6(0x13a)]);const _0x366b24=_0x2f114f[_0x4f84e6(0x105)](_0x27633f=>({'type':_0x4f84e6(0x12b),'path':_0x27633f[_0x4f84e6(0x136)],'label':_0x27633f[_0x4f84e6(0x114)],'loadScriptMode':_0x4f84e6(0x11d),'resources':[..._0x30c9e3],..._0x27633f[_0x4f84e6(0x130)]===undefined?{}:{'visible':_0x27633f[_0x4f84e6(0x130)]},..._0x27633f['parentId']===undefined?{}:{'parentId':_0x27633f[_0x4f84e6(0x10f)]},..._0x27633f[_0x4f84e6(0x129)]===undefined?{}:{'sort':_0x27633f[_0x4f84e6(0x129)]},..._0x174ed6['appName']===undefined?{}:{'appName':_0x174ed6[_0x4f84e6(0x13a)]}}));if(_0x52910d['dryRun'])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x2f114f,'plannedMenus':_0x366b24};const _0x213bb5=_0x174ed6[_0x4f84e6(0x13a)]?await createMenus(_0x1fc77c,_0xb924de,_0x2f114f,_0x30c9e3[_0x4f84e6(0x11c)]>0x0?_0x30c9e3:undefined,{'appName':_0x174ed6['appName']}):await createMenus(_0x1fc77c,_0xb924de,_0x2f114f,_0x30c9e3[_0x4f84e6(0x11c)]>0x0?_0x30c9e3:undefined);return logger['info'](_0x4f84e6(0x122),_0x4f84e6(0x118),{'count':_0x2f114f['length'],'resources':_0x30c9e3}),{'created':_0x213bb5[_0x4f84e6(0x11c)],'skipped':![],'dryRun':![],'targetPages':_0x2f114f,'plannedMenus':_0x366b24,'menus':_0x213bb5};}export function parseMenuSyncParams(_0x3c4196){const _0x470844=a184_0x51da87;if(!_0x3c4196||typeof _0x3c4196!=='string')return{};let _0x16d82f;try{_0x16d82f=JSON[_0x470844(0x13b)](_0x3c4196);}catch{throw new Error(_0x470844(0x137));}if(typeof _0x16d82f!=='object'||_0x16d82f===null||Array[_0x470844(0x127)](_0x16d82f))throw new Error(_0x470844(0x126));const _0x45ca96=_0x16d82f;if(Object[_0x470844(0x119)](_0x45ca96,_0x470844(0x110)))throw new Error(_0x470844(0x13d));const _0x4fe240=Object[_0x470844(0x115)](_0x45ca96)[_0x470844(0x135)](_0x20cdb5=>!MENU_SYNC_PARAM_KEYS[_0x470844(0x120)](_0x20cdb5));if(_0x4fe240[_0x470844(0x11c)]>0x0)throw new Error(_0x470844(0x108)+_0x4fe240[_0x470844(0x134)](',\x20')+'.');for(const _0x24611b of[_0x470844(0x13e),_0x470844(0x107),_0x470844(0x13a)]){const _0x1639a3=_0x45ca96[_0x24611b];if(_0x1639a3!==undefined&&(typeof _0x1639a3!==_0x470844(0x11f)||_0x1639a3[_0x470844(0x10d)]()===''))throw new Error(_0x470844(0x10a)+_0x24611b+_0x470844(0x139));}if(_0x45ca96[_0x470844(0x130)]!==undefined&&typeof _0x45ca96[_0x470844(0x130)]!=='boolean')throw new Error(_0x470844(0x104));if(_0x45ca96[_0x470844(0x10f)]!==undefined&&(!Number[_0x470844(0x111)](_0x45ca96[_0x470844(0x10f)])||_0x45ca96[_0x470844(0x10f)]<0x0))throw new Error(_0x470844(0x10b));return{'jsUrl':typeof _0x45ca96[_0x470844(0x13e)]==='string'?_0x45ca96['jsUrl'][_0x470844(0x10d)]():undefined,'cssUrl':typeof _0x45ca96[_0x470844(0x107)]===_0x470844(0x11f)?_0x45ca96[_0x470844(0x107)]['trim']():undefined,'appName':typeof _0x45ca96[_0x470844(0x13a)]===_0x470844(0x11f)?_0x45ca96[_0x470844(0x13a)]['trim']():undefined,'visible':typeof _0x45ca96[_0x470844(0x130)]==='boolean'?_0x45ca96[_0x470844(0x130)]:undefined,'parentId':typeof _0x45ca96[_0x470844(0x10f)]==='number'?_0x45ca96['parentId']:undefined};}
|
|
1
|
+
const a184_0xbbcf83=a184_0x2dd4;(function(_0x4778a4,_0x63ff49){const _0x361f31=a184_0x2dd4,_0x23e3d5=_0x4778a4();while(!![]){try{const _0xbbe445=parseInt(_0x361f31(0xc8))/0x1*(-parseInt(_0x361f31(0xdb))/0x2)+-parseInt(_0x361f31(0xc7))/0x3*(-parseInt(_0x361f31(0xd9))/0x4)+-parseInt(_0x361f31(0xab))/0x5*(parseInt(_0x361f31(0xd2))/0x6)+parseInt(_0x361f31(0xc6))/0x7+parseInt(_0x361f31(0xc3))/0x8*(-parseInt(_0x361f31(0xa9))/0x9)+parseInt(_0x361f31(0xb3))/0xa+parseInt(_0x361f31(0xd0))/0xb;if(_0xbbe445===_0x63ff49)break;else _0x23e3d5['push'](_0x23e3d5['shift']());}catch(_0x278b72){_0x23e3d5['push'](_0x23e3d5['shift']());}}}(a184_0x5d5c,0x5f7d3));function a184_0x2dd4(_0x467c50,_0x479b41){_0x467c50=_0x467c50-0xa3;const _0x5d5c2b=a184_0x5d5c();let _0x2dd4d2=_0x5d5c2b[_0x467c50];return _0x2dd4d2;}import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a184_0x5d5c(){const _0x1621a0=['Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','path','Invalid\x20--params\x20JSON.','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','has','setLogPath','JS\x20URL\x20is\x20unreachable:\x20','hasOwn','jsUrl',':\x20expected\x20a\x20non-empty\x20string.','Invalid\x20--params:\x20','dryRun','length',';\x20found\x20','menu-sync','16011WUxfRW','Expected\x20one\x20folder\x20named\x20\x22','11885DzMyMO','order','info','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','Start\x20non-interactive\x20menu\x20sync','isInteger','trim','appName','1178060DdUlyA','\x0a\x20\x20Available\x20local\x20paths:\x20','type','Parent\x20','string','isArray','keys','--params.','object','message','parentId','group','folder','field','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','number','3032viOIKV','map','boolean','3890285ugePHW','82362tOJaou','1bCLzPo','filter','push','label','visible','pages','join','import','12174052YYYqtl','procode','1446kkQdWo','cwd','get','cssUrl','Menu\x20sync\x20completed','parse','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','4TmSubB','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','339052odZTcR','No\x20local\x20pages\x20matched\x20paths:\x20'];a184_0x5d5c=function(){return _0x1621a0;};return a184_0x5d5c();}import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set([a184_0xbbcf83(0xe6),a184_0xbbcf83(0xd5),a184_0xbbcf83(0xb2),a184_0xbbcf83(0xcc),a184_0xbbcf83(0xbd)]);export function resolvePage(_0x283401,_0xe1112b,_0x5e67b8){const _0x2eb851=a184_0xbbcf83;let _0x448ecf=_0xe1112b[_0x2eb851(0xbd)]??_0x283401['parentId'];if(_0x448ecf===undefined&&_0x283401[_0x2eb851(0xbe)]){const _0x4579bf=_0x5e67b8[_0x2eb851(0xc9)](_0x1d86bb=>_0x1d86bb[_0x2eb851(0xb5)]===_0x2eb851(0xbf)&&_0x1d86bb[_0x2eb851(0xcb)]===_0x283401[_0x2eb851(0xbe)]);if(_0x4579bf[_0x2eb851(0xa6)]!==0x1)throw new Error(_0x2eb851(0xaa)+_0x283401[_0x2eb851(0xbe)]+'\x22\x20for\x20'+_0x283401[_0x2eb851(0xdf)]+_0x2eb851(0xa7)+_0x4579bf[_0x2eb851(0xa6)]);_0x448ecf=_0x4579bf[0x0]['id'];}if(_0x448ecf!==undefined&&_0x448ecf!==0x0&&_0x5e67b8[_0x2eb851(0xc9)](_0x192204=>_0x192204['id']===_0x448ecf&&_0x192204[_0x2eb851(0xb5)]===_0x2eb851(0xbf))[_0x2eb851(0xa6)]!==0x1)throw new Error(_0x2eb851(0xb6)+_0x448ecf+_0x2eb851(0xe1));return{..._0x283401,..._0x448ecf===undefined?{}:{'parentId':_0x448ecf},..._0xe1112b[_0x2eb851(0xcc)]===undefined?{}:{'visible':_0xe1112b[_0x2eb851(0xcc)]}};}function validateParams(_0x56ab27){const _0x51f3a3=a184_0xbbcf83,_0x1676dc=[];return _0x56ab27[_0x51f3a3(0xe6)]&&!isValidJsHttpsUrl(_0x56ab27['jsUrl'])&&_0x1676dc[_0x51f3a3(0xca)]({'field':_0x51f3a3(0xe6),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x56ab27[_0x51f3a3(0xd5)]&&!isValidCssHttpsUrl(_0x56ab27['cssUrl'])&&_0x1676dc[_0x51f3a3(0xca)]({'field':_0x51f3a3(0xd5),'message':_0x51f3a3(0xda)}),_0x1676dc;}export async function runMenuSyncCore(_0x1691ed,_0x122a2c,_0x38addc=[],_0xf8fe12,_0x30f0f9={}){const _0x15c6c3=a184_0xbbcf83,_0xae9ba=parseMenuSyncParams(_0xf8fe12),_0x5ede02=[...new Set(_0x38addc['map'](_0x1809bd=>_0x1809bd[_0x15c6c3(0xb1)]())['filter'](Boolean)[_0x15c6c3(0xc4)](menuPathKey))],_0x18e589=_0xae9ba[_0x15c6c3(0xe6)],_0x52501b=_0xae9ba[_0x15c6c3(0xd5)],_0x4cf94f=[];if(_0x18e589)_0x4cf94f[_0x15c6c3(0xca)](_0x18e589);if(_0x52501b)_0x4cf94f[_0x15c6c3(0xca)](_0x52501b);const _0x21147f=validateParams(_0xae9ba);if(_0x21147f[_0x15c6c3(0xa6)]>0x0){const _0xfefd61=_0x21147f[_0x15c6c3(0xc4)](_0x5b5879=>_0x15c6c3(0xba)+_0x5b5879[_0x15c6c3(0xc0)]+':\x20'+_0x5b5879[_0x15c6c3(0xbc)])[_0x15c6c3(0xce)](';\x20');throw new Error(_0x15c6c3(0xa4)+_0xfefd61);}logger[_0x15c6c3(0xe3)](process[_0x15c6c3(0xd3)]()),logger[_0x15c6c3(0xad)](_0x15c6c3(0xa8),_0x15c6c3(0xaf),{'appCode':_0x1691ed,'selectedCount':_0x5ede02[_0x15c6c3(0xa6)],'jsUrl':_0x18e589,'cssUrl':_0x52501b});if(_0x18e589){const _0x516714=await isUrlReachable(_0x18e589);if(!_0x516714)throw new Error(_0x15c6c3(0xe4)+_0x18e589);}if(_0x52501b){const _0x2489ee=await isUrlReachable(_0x52501b);if(!_0x2489ee)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x52501b);}const _0x264905=getLocalPages();if(_0x264905[_0x15c6c3(0xa6)]===0x0){if(_0x5ede02[_0x15c6c3(0xa6)]>0x0)throw new Error(_0x15c6c3(0xdc)+_0x5ede02[_0x15c6c3(0xce)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x30f0f9[_0x15c6c3(0xa5)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x506ca2=await getOnlineMenuList(_0x1691ed,_0x122a2c),_0x43d4e9=new Set(_0x506ca2[_0x15c6c3(0xc4)](_0x1401bb=>menuPathKey(_0x1401bb[_0x15c6c3(0xdf)])));let _0x1775f7;if(_0x5ede02['length']>0x0){const _0x3e3843=new Map(_0x264905[_0x15c6c3(0xc4)](_0x5aacd3=>[menuPathKey(_0x5aacd3[_0x15c6c3(0xdf)]),_0x5aacd3])),_0x153783=_0x5ede02[_0x15c6c3(0xc9)](_0x473fa7=>!_0x3e3843['has'](_0x473fa7));if(_0x153783[_0x15c6c3(0xa6)]>0x0){const _0x47d768=_0x264905[_0x15c6c3(0xc4)](_0x1c0197=>_0x1c0197[_0x15c6c3(0xdf)])[_0x15c6c3(0xce)](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x153783[_0x15c6c3(0xce)](',\x20')+_0x15c6c3(0xb4)+_0x47d768);}const _0x1a7b08=_0x5ede02[_0x15c6c3(0xc9)](_0x432172=>_0x43d4e9['has'](_0x432172));if(_0x1a7b08['length']>0x0)throw new Error(_0x15c6c3(0xae)+_0x1a7b08[_0x15c6c3(0xce)](',\x20'));_0x1775f7=_0x5ede02[_0x15c6c3(0xc4)](_0x56b05e=>_0x3e3843[_0x15c6c3(0xd4)](_0x56b05e));}else _0x1775f7=_0x264905[_0x15c6c3(0xc9)](_0x7f1b67=>!_0x43d4e9[_0x15c6c3(0xe2)](menuPathKey(_0x7f1b67['path'])));if(_0x1775f7['length']===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x30f0f9[_0x15c6c3(0xa5)]===!![],'targetPages':[],'plannedMenus':[]};_0x1775f7=_0x1775f7[_0x15c6c3(0xc4)](_0x4f3ea9=>resolvePage(_0x4f3ea9,_0xae9ba,_0x506ca2));_0xae9ba[_0x15c6c3(0xb2)]&&_0x4cf94f[_0x15c6c3(0xa6)]===0x0&&await assertSharedResourcesConfigured(_0x1691ed,_0x122a2c,_0xae9ba[_0x15c6c3(0xb2)]);const _0x20ce34=_0x1775f7[_0x15c6c3(0xc4)](_0x3e514a=>({'type':_0x15c6c3(0xd1),'path':_0x3e514a[_0x15c6c3(0xdf)],'label':_0x3e514a['label'],'loadScriptMode':_0x15c6c3(0xcf),'resources':[..._0x4cf94f],..._0x3e514a[_0x15c6c3(0xcc)]===undefined?{}:{'visible':_0x3e514a[_0x15c6c3(0xcc)]},..._0x3e514a[_0x15c6c3(0xbd)]===undefined?{}:{'parentId':_0x3e514a[_0x15c6c3(0xbd)]},..._0x3e514a[_0x15c6c3(0xac)]===undefined?{}:{'sort':_0x3e514a[_0x15c6c3(0xac)]},..._0xae9ba[_0x15c6c3(0xb2)]===undefined?{}:{'appName':_0xae9ba[_0x15c6c3(0xb2)]}}));if(_0x30f0f9[_0x15c6c3(0xa5)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x1775f7,'plannedMenus':_0x20ce34};const _0x378129=_0xae9ba[_0x15c6c3(0xb2)]?await createMenus(_0x1691ed,_0x122a2c,_0x1775f7,_0x4cf94f[_0x15c6c3(0xa6)]>0x0?_0x4cf94f:undefined,{'appName':_0xae9ba[_0x15c6c3(0xb2)]}):await createMenus(_0x1691ed,_0x122a2c,_0x1775f7,_0x4cf94f[_0x15c6c3(0xa6)]>0x0?_0x4cf94f:undefined);return logger['info'](_0x15c6c3(0xa8),_0x15c6c3(0xd6),{'count':_0x1775f7['length'],'resources':_0x4cf94f}),{'created':_0x378129[_0x15c6c3(0xa6)],'skipped':![],'dryRun':![],'targetPages':_0x1775f7,'plannedMenus':_0x20ce34,'menus':_0x378129};}export function parseMenuSyncParams(_0x2eb2f6){const _0x3280e0=a184_0xbbcf83;if(!_0x2eb2f6||typeof _0x2eb2f6!==_0x3280e0(0xb7))return{};let _0x3cea87;try{_0x3cea87=JSON[_0x3280e0(0xd7)](_0x2eb2f6);}catch{throw new Error(_0x3280e0(0xe0));}if(typeof _0x3cea87!==_0x3280e0(0xbb)||_0x3cea87===null||Array[_0x3280e0(0xb8)](_0x3cea87))throw new Error(_0x3280e0(0xd8));const _0x4020f5=_0x3cea87;if(Object[_0x3280e0(0xe5)](_0x4020f5,_0x3280e0(0xcd)))throw new Error(_0x3280e0(0xc1));const _0x379661=Object[_0x3280e0(0xb9)](_0x4020f5)[_0x3280e0(0xc9)](_0x45f8c9=>!MENU_SYNC_PARAM_KEYS['has'](_0x45f8c9));if(_0x379661[_0x3280e0(0xa6)]>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x379661[_0x3280e0(0xce)](',\x20')+'.');for(const _0x29eac8 of[_0x3280e0(0xe6),_0x3280e0(0xd5),'appName']){const _0x17b065=_0x4020f5[_0x29eac8];if(_0x17b065!==undefined&&(typeof _0x17b065!==_0x3280e0(0xb7)||_0x17b065[_0x3280e0(0xb1)]()===''))throw new Error('Invalid\x20--params.'+_0x29eac8+_0x3280e0(0xa3));}if(_0x4020f5['visible']!==undefined&&typeof _0x4020f5[_0x3280e0(0xcc)]!==_0x3280e0(0xc5))throw new Error(_0x3280e0(0xde));if(_0x4020f5[_0x3280e0(0xbd)]!==undefined&&(!Number[_0x3280e0(0xb0)](_0x4020f5[_0x3280e0(0xbd)])||_0x4020f5[_0x3280e0(0xbd)]<0x0))throw new Error(_0x3280e0(0xdd));return{'jsUrl':typeof _0x4020f5[_0x3280e0(0xe6)]==='string'?_0x4020f5[_0x3280e0(0xe6)]['trim']():undefined,'cssUrl':typeof _0x4020f5[_0x3280e0(0xd5)]===_0x3280e0(0xb7)?_0x4020f5[_0x3280e0(0xd5)][_0x3280e0(0xb1)]():undefined,'appName':typeof _0x4020f5[_0x3280e0(0xb2)]===_0x3280e0(0xb7)?_0x4020f5[_0x3280e0(0xb2)]['trim']():undefined,'visible':typeof _0x4020f5[_0x3280e0(0xcc)]===_0x3280e0(0xc5)?_0x4020f5[_0x3280e0(0xcc)]:undefined,'parentId':typeof _0x4020f5[_0x3280e0(0xbd)]===_0x3280e0(0xc2)?_0x4020f5['parentId']:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5bcea2,_0x1f770d){const _0x30a035=a186_0xc74f,_0x17fb13=_0x5bcea2();while(!![]){try{const _0x47b3e3=parseInt(_0x30a035(0x1a6))/0x1*(parseInt(_0x30a035(0x1e3))/0x2)+-parseInt(_0x30a035(0x1a5))/0x3+-parseInt(_0x30a035(0x1c8))/0x4*(parseInt(_0x30a035(0x1ac))/0x5)+parseInt(_0x30a035(0x1dc))/0x6+parseInt(_0x30a035(0x1c6))/0x7*(parseInt(_0x30a035(0x1be))/0x8)+parseInt(_0x30a035(0x1d8))/0x9*(parseInt(_0x30a035(0x1b6))/0xa)+-parseInt(_0x30a035(0x1c5))/0xb;if(_0x47b3e3===_0x1f770d)break;else _0x17fb13['push'](_0x17fb13['shift']());}catch(_0x26c55a){_0x17fb13['push'](_0x17fb13['shift']());}}}(a186_0x46b3,0x36d89));function a186_0x46b3(){const _0x4d8582=['value','66182eCaRHL','cwd','1292910TgXkok','1siFLZI','trim','cssUrl','join','string','label','116420ZXQFll','force','path','\x20existing\x20JS\x20resources\x20for\x20\x22','info','selection','some','Start\x20non-interactive\x20menu\x20asset\x20update','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','180DcvkIk',').\x20','.\x20Allowed\x20values:\x20replace,\x20patch','.js','extend','loadScriptMode','all','push','16YHdgJO','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','rejected','menuIds','jsUrl','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','paths','2851101oEegCl','624743bNiMUf','menu-asset-update','12uBvcix','map','patch','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','unshift','filter','JS\x20URL\x20is\x20unreachable:\x20','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','dryRun','after','replace','menu\x20asset-update\x20cannot\x20patch\x20','field','length','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','Invalid\x20--mode:\x20','218061jliHSN','resources','isArray','toLowerCase','2021706COpdnE','message','--params.','has','endsWith','\x22\x20('];a186_0x46b3=function(){return _0x4d8582;};return a186_0x46b3();}import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a186_0xc74f(_0x3a766a,_0x3fca6f){_0x3a766a=_0x3a766a-0x1a5;const _0x46b3fb=a186_0x46b3();let _0xc74f66=_0x46b3fb[_0x3a766a];return _0xc74f66;}import{logger}from'../../../utils/logger.js';function validateParams(_0x3f67ce){const _0x166a87=a186_0xc74f,_0x7b0a8b=[];return _0x3f67ce[_0x166a87(0x1c2)]&&!isValidJsHttpsUrl(_0x3f67ce['jsUrl'])&&_0x7b0a8b[_0x166a87(0x1bd)]({'field':_0x166a87(0x1c2),'message':_0x166a87(0x1bf)}),_0x3f67ce[_0x166a87(0x1a8)]&&!isValidCssHttpsUrl(_0x3f67ce[_0x166a87(0x1a8)])&&_0x7b0a8b['push']({'field':'cssUrl','message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x7b0a8b;}export async function runMenuUpdateCore(_0x18d8c5,_0x4fd09f,_0x329805,_0x397b3d={}){const _0x11e108=a186_0xc74f,_0x22bd6a=parseUpdateParamsFlag(_0x329805),_0x5f2848=normalizeMode(_0x397b3d['mode']);validateSelection(_0x397b3d[_0x11e108(0x1b1)]);const _0x1680f4=[];if(_0x22bd6a[_0x11e108(0x1c2)])_0x1680f4[_0x11e108(0x1bd)](_0x22bd6a[_0x11e108(0x1c2)]);if(_0x22bd6a[_0x11e108(0x1a8)])_0x1680f4[_0x11e108(0x1bd)](_0x22bd6a[_0x11e108(0x1a8)]);const _0x1eb1e1=validateParams(_0x22bd6a);if(_0x1eb1e1[_0x11e108(0x1d5)]>0x0){const _0x52907f=_0x1eb1e1[_0x11e108(0x1c9)](_0x5a122c=>_0x11e108(0x1de)+_0x5a122c[_0x11e108(0x1d4)]+':\x20'+_0x5a122c[_0x11e108(0x1dd)])[_0x11e108(0x1a9)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x52907f);}if(_0x1680f4[_0x11e108(0x1d5)]===0x0)throw new Error(_0x11e108(0x1b4)+_0x11e108(0x1cb));logger['setLogPath'](process[_0x11e108(0x1e4)]()),logger[_0x11e108(0x1b0)](_0x11e108(0x1c7),_0x11e108(0x1b3),{'appCode':_0x18d8c5,'jsUrl':_0x22bd6a[_0x11e108(0x1c2)],'cssUrl':_0x22bd6a[_0x11e108(0x1a8)],'mode':_0x5f2848,'dryRun':_0x397b3d[_0x11e108(0x1d0)]===!![]});if(_0x22bd6a[_0x11e108(0x1c2)]){const _0x4b17e8=await isUrlReachable(_0x22bd6a[_0x11e108(0x1c2)]);if(!_0x4b17e8)throw new Error(_0x11e108(0x1ce)+_0x22bd6a[_0x11e108(0x1c2)]);}if(_0x22bd6a[_0x11e108(0x1a8)]){const _0x3f4ead=await isUrlReachable(_0x22bd6a[_0x11e108(0x1a8)]);if(!_0x3f4ead)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x22bd6a['cssUrl']);}const _0x234059=await getOnlineMenuList(_0x18d8c5,_0x4fd09f),_0x5eeb35=_0x234059[_0x11e108(0x1cd)](_0x41428c=>_0x41428c[_0x11e108(0x1d9)][_0x11e108(0x1d5)]>0x0),_0x2770c5=selectMenusForUpdate(_0x5eeb35,_0x397b3d[_0x11e108(0x1b1)]);if(_0x2770c5[_0x11e108(0x1d5)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x397b3d[_0x11e108(0x1d0)]===!![]};const _0x2437ae=_0x2770c5[_0x11e108(0x1c9)](_0x5b1eab=>buildMenuUpdateDiff(_0x5b1eab,_0x22bd6a,_0x5f2848,_0x397b3d[_0x11e108(0x1ad)]===!![],_0x397b3d[_0x11e108(0x1bb)]));if(_0x397b3d[_0x11e108(0x1d0)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x2437ae};const _0xc7b453=await Promise['allSettled'](_0x2770c5[_0x11e108(0x1c9)]((_0x2df9f8,_0x194747)=>updateMenuCdnUrl(_0x18d8c5,_0x4fd09f,{'id':_0x2df9f8['id'],'label':_0x2df9f8[_0x11e108(0x1ab)],'path':_0x2df9f8[_0x11e108(0x1ae)],'resources':_0x2437ae[_0x194747][_0x11e108(0x1d1)][_0x11e108(0x1d9)],'extend':_0x2df9f8[_0x11e108(0x1ba)]??null,'loadScriptMode':_0x397b3d[_0x11e108(0x1bb)]}))),_0x3dda0f=_0xc7b453['filter'](_0x56df90=>_0x56df90['status']==='fulfilled')[_0x11e108(0x1c9)](_0xb4929f=>_0xb4929f[_0x11e108(0x1e2)]),_0xf0746f=_0xc7b453['filter'](_0x4987c9=>_0x4987c9['status']===_0x11e108(0x1c0))[_0x11e108(0x1d5)];return logger[_0x11e108(0x1b0)](_0x11e108(0x1c7),'Menu\x20asset\x20update\x20completed',{'count':_0x2770c5[_0x11e108(0x1d5)],'resources':_0x1680f4}),{'updated':_0x3dda0f[_0x11e108(0x1d5)],'failed':_0xf0746f,'skipped':![],'menus':_0x3dda0f};}function validateSelection(_0x454c02){const _0x3eed76=a186_0xc74f;if(!_0x454c02)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x454c02[_0x3eed76(0x1bc)]&&(_0x454c02['menuIds'][_0x3eed76(0x1d5)]>0x0||_0x454c02[_0x3eed76(0x1c4)]['length']>0x0))throw new Error('--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.');if(!_0x454c02[_0x3eed76(0x1bc)]&&_0x454c02[_0x3eed76(0x1c1)][_0x3eed76(0x1d5)]===0x0&&_0x454c02[_0x3eed76(0x1c4)][_0x3eed76(0x1d5)]===0x0)throw new Error(_0x3eed76(0x1b5));}export function selectMenusForUpdate(_0x376123,_0x19ce1a){const _0x45dc89=a186_0xc74f;validateSelection(_0x19ce1a);if(_0x19ce1a[_0x45dc89(0x1bc)])return _0x376123;const _0x5b62b5=new Set(_0x376123[_0x45dc89(0x1c9)](_0x5cc163=>_0x5cc163['id'])),_0x3b6363=new Set(_0x376123[_0x45dc89(0x1c9)](_0x4a1d52=>_0x4a1d52[_0x45dc89(0x1ae)])),_0xd968d0=_0x19ce1a[_0x45dc89(0x1c1)][_0x45dc89(0x1cd)](_0x568056=>!_0x5b62b5[_0x45dc89(0x1df)](_0x568056)),_0x103b57=_0x19ce1a['paths'][_0x45dc89(0x1cd)](_0x4979d8=>!_0x3b6363[_0x45dc89(0x1df)](_0x4979d8));if(_0xd968d0[_0x45dc89(0x1d5)]>0x0||_0x103b57[_0x45dc89(0x1d5)]>0x0){const _0x32a5c6=[..._0xd968d0[_0x45dc89(0x1c9)](_0x3995c9=>String(_0x3995c9)),..._0x103b57][_0x45dc89(0x1a9)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x32a5c6);}const _0x2dfb0d=new Set(_0x19ce1a[_0x45dc89(0x1c1)]),_0x123a02=new Set(_0x19ce1a[_0x45dc89(0x1c4)]);return _0x376123[_0x45dc89(0x1cd)](_0x3f8177=>_0x2dfb0d[_0x45dc89(0x1df)](_0x3f8177['id'])||_0x123a02[_0x45dc89(0x1df)](_0x3f8177[_0x45dc89(0x1ae)]));}function normalizeMode(_0x3d96cd){const _0x1a51f4=a186_0xc74f;if(!_0x3d96cd)return _0x1a51f4(0x1ca);if(_0x3d96cd===_0x1a51f4(0x1d2)||_0x3d96cd===_0x1a51f4(0x1ca))return _0x3d96cd;throw new Error(_0x1a51f4(0x1d7)+_0x3d96cd+_0x1a51f4(0x1b8));}function buildMenuUpdateDiff(_0xc661a8,_0x1669ae,_0x3aac9d,_0x53b81c,_0x3d6a19){const _0x4ff6cb=a186_0xc74f,_0x4611bd=[..._0xc661a8[_0x4ff6cb(0x1d9)]];_0x3aac9d==='patch'&&assertUnambiguousPatchResources(_0xc661a8,_0x4611bd,_0x1669ae);const _0xbdb1b6=_0x3aac9d===_0x4ff6cb(0x1ca)?patchResources(_0x4611bd,_0x1669ae):replaceResources(_0x1669ae),_0x292ce8=[],_0x35e6de=_0x4611bd[_0x4ff6cb(0x1b2)](isJsResource),_0x1457c8=_0xbdb1b6[_0x4ff6cb(0x1b2)](isJsResource);if(_0x35e6de&&!_0x1457c8){const _0x4acd2f=_0x4ff6cb(0x1c3)+_0xc661a8[_0x4ff6cb(0x1ab)]+_0x4ff6cb(0x1e1)+_0xc661a8[_0x4ff6cb(0x1ae)]+_0x4ff6cb(0x1b7)+_0x4ff6cb(0x1d6);if(!_0x53b81c)throw new Error(_0x4acd2f);_0x292ce8[_0x4ff6cb(0x1bd)](_0x4acd2f);}const _0x390a34=_0x4611bd[_0x4ff6cb(0x1b2)](isCssResource),_0x164690=_0xbdb1b6[_0x4ff6cb(0x1b2)](isCssResource);_0x390a34&&!_0x164690&&_0x292ce8[_0x4ff6cb(0x1bd)]('menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22'+_0xc661a8['label']+'\x22\x20('+_0xc661a8['path']+').');const _0x568576=typeof _0xc661a8['extend']?.[_0x4ff6cb(0x1bb)]==='string'?_0xc661a8[_0x4ff6cb(0x1ba)][_0x4ff6cb(0x1bb)]:null,_0x59aabc=_0x3d6a19?{'loadScriptMode':_0x568576}:{},_0x5969ff=_0x3d6a19?{'loadScriptMode':_0x3d6a19}:{};return{'id':_0xc661a8['id'],'label':_0xc661a8[_0x4ff6cb(0x1ab)],'path':_0xc661a8[_0x4ff6cb(0x1ae)],'mode':_0x3aac9d,'before':{'resources':_0x4611bd,..._0x59aabc},'after':{'resources':_0xbdb1b6,..._0x5969ff},'warnings':_0x292ce8};}function replaceResources(_0xf60296){const _0x3a68a7=a186_0xc74f;return[_0xf60296['jsUrl'],_0xf60296[_0x3a68a7(0x1a8)]]['filter'](_0x329664=>!!_0x329664);}function assertUnambiguousPatchResources(_0x3cf6c3,_0x4a3359,_0x2cf874){const _0x193205=a186_0xc74f,_0x275b03=_0x4a3359['filter'](isJsResource)[_0x193205(0x1d5)];if(_0x2cf874['jsUrl']&&_0x275b03>0x1)throw new Error(_0x193205(0x1d3)+_0x275b03+_0x193205(0x1af)+_0x3cf6c3[_0x193205(0x1ab)]+_0x193205(0x1e1)+_0x3cf6c3[_0x193205(0x1ae)]+')\x20'+'with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');const _0x46c4d2=_0x4a3359[_0x193205(0x1cd)](isCssResource)[_0x193205(0x1d5)];if(_0x2cf874[_0x193205(0x1a8)]&&_0x46c4d2>0x1)throw new Error(_0x193205(0x1d3)+_0x46c4d2+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x3cf6c3['label']+'\x22\x20('+_0x3cf6c3[_0x193205(0x1ae)]+')\x20'+_0x193205(0x1cf));}function patchResources(_0x1ea2f8,_0x522362){const _0x50dc24=a186_0xc74f;let _0x2c027f=![],_0x5eb259=![];const _0x15d398=[];for(const _0x5a10c8 of _0x1ea2f8){if(isJsResource(_0x5a10c8)){if(_0x522362['jsUrl']&&!_0x2c027f)_0x15d398[_0x50dc24(0x1bd)](_0x522362[_0x50dc24(0x1c2)]),_0x2c027f=!![];else!_0x522362[_0x50dc24(0x1c2)]&&_0x15d398['push'](_0x5a10c8);continue;}if(isCssResource(_0x5a10c8)){if(_0x522362['cssUrl']&&!_0x5eb259)_0x15d398[_0x50dc24(0x1bd)](_0x522362['cssUrl']),_0x5eb259=!![];else!_0x522362[_0x50dc24(0x1a8)]&&_0x15d398[_0x50dc24(0x1bd)](_0x5a10c8);continue;}_0x15d398[_0x50dc24(0x1bd)](_0x5a10c8);}return _0x522362['jsUrl']&&!_0x2c027f&&_0x15d398[_0x50dc24(0x1cc)](_0x522362[_0x50dc24(0x1c2)]),_0x522362['cssUrl']&&!_0x5eb259&&_0x15d398[_0x50dc24(0x1bd)](_0x522362[_0x50dc24(0x1a8)]),_0x15d398;}function isJsResource(_0x1539b5){const _0x4f3f9c=a186_0xc74f;return stripQuery(_0x1539b5)[_0x4f3f9c(0x1db)]()[_0x4f3f9c(0x1e0)](_0x4f3f9c(0x1b9));}function isCssResource(_0x28af03){const _0x302270=a186_0xc74f;return stripQuery(_0x28af03)[_0x302270(0x1db)]()['endsWith']('.css');}function stripQuery(_0x20c96e){return _0x20c96e['split']('?')[0x0]??_0x20c96e;}function parseUpdateParamsFlag(_0x4a9367){const _0x6aa450=a186_0xc74f;if(!_0x4a9367||typeof _0x4a9367!=='string')return{};try{const _0x466290=JSON['parse'](_0x4a9367);if(typeof _0x466290!=='object'||_0x466290===null||Array[_0x6aa450(0x1da)](_0x466290))return{};return{'jsUrl':typeof _0x466290[_0x6aa450(0x1c2)]===_0x6aa450(0x1aa)?_0x466290['jsUrl']['trim']():undefined,'cssUrl':typeof _0x466290[_0x6aa450(0x1a8)]==='string'?_0x466290[_0x6aa450(0x1a8)][_0x6aa450(0x1a7)]():undefined};}catch{return{};}}
|
|
1
|
+
function a186_0x3ce7(_0x4d5297,_0x4140eb){_0x4d5297=_0x4d5297-0xfe;const _0x21706e=a186_0x2170();let _0x3ce7c6=_0x21706e[_0x4d5297];return _0x3ce7c6;}(function(_0x59998e,_0x3203dc){const _0x20f5b1=a186_0x3ce7,_0x3062f6=_0x59998e();while(!![]){try{const _0x16874a=-parseInt(_0x20f5b1(0x111))/0x1*(parseInt(_0x20f5b1(0x140))/0x2)+-parseInt(_0x20f5b1(0x141))/0x3+-parseInt(_0x20f5b1(0x126))/0x4+parseInt(_0x20f5b1(0x13c))/0x5+parseInt(_0x20f5b1(0x10a))/0x6*(-parseInt(_0x20f5b1(0x142))/0x7)+parseInt(_0x20f5b1(0x12a))/0x8+parseInt(_0x20f5b1(0x11c))/0x9;if(_0x16874a===_0x3203dc)break;else _0x3062f6['push'](_0x3062f6['shift']());}catch(_0x193f1a){_0x3062f6['push'](_0x3062f6['shift']());}}}(a186_0x2170,0x1eb82));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_0x2170(){const _0x5f5c4d=['1TMflnW','label','message','object','resources','loadScriptMode','rejected','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','\x20existing\x20JS\x20resources\x20for\x20\x22','Invalid\x20--mode:\x20','allSettled','5017608dxWAFo','Invalid\x20--params:\x20','JS\x20URL\x20is\x20unreachable:\x20','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','dryRun','all','paths','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','cwd','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','776832TQaRlM','has','menu\x20asset-update\x20cannot\x20patch\x20','Menu\x20asset\x20update\x20completed','383512auNUKH','jsUrl',').\x20','replace','\x20existing\x20CSS\x20resources\x20for\x20\x22','menu-asset-update','.js','extend','value','unshift','length','.\x20Allowed\x20values:\x20replace,\x20patch','map','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','filter','setLogPath','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','menuIds','122660LfLRJe','cssUrl','patch','push','301394fvilmE','378165JGfWpc','2611SGkDPn','isArray','toLowerCase','after','force','some','.css','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','status','endsWith','info','split','\x22\x20(','534SGSEPA','path','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','join','string','mode','fulfilled'];a186_0x2170=function(){return _0x5f5c4d;};return a186_0x2170();}function validateParams(_0x2c3881){const _0x1bdac0=a186_0x3ce7,_0x200715=[];return _0x2c3881[_0x1bdac0(0x12b)]&&!isValidJsHttpsUrl(_0x2c3881[_0x1bdac0(0x12b)])&&_0x200715[_0x1bdac0(0x13f)]({'field':_0x1bdac0(0x12b),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x2c3881[_0x1bdac0(0x13d)]&&!isValidCssHttpsUrl(_0x2c3881['cssUrl'])&&_0x200715[_0x1bdac0(0x13f)]({'field':_0x1bdac0(0x13d),'message':_0x1bdac0(0x104)}),_0x200715;}export async function runMenuUpdateCore(_0x2373ed,_0x3b30bf,_0x29152d,_0x1adf05={}){const _0x58111d=a186_0x3ce7,_0x1fdc2c=parseUpdateParamsFlag(_0x29152d),_0x112295=normalizeMode(_0x1adf05[_0x58111d(0x10f)]);validateSelection(_0x1adf05['selection']);const _0x112322=[];if(_0x1fdc2c[_0x58111d(0x12b)])_0x112322[_0x58111d(0x13f)](_0x1fdc2c[_0x58111d(0x12b)]);if(_0x1fdc2c[_0x58111d(0x13d)])_0x112322[_0x58111d(0x13f)](_0x1fdc2c[_0x58111d(0x13d)]);const _0x3f1524=validateParams(_0x1fdc2c);if(_0x3f1524[_0x58111d(0x134)]>0x0){const _0x5d0574=_0x3f1524[_0x58111d(0x136)](_0x3897e0=>'--params.'+_0x3897e0['field']+':\x20'+_0x3897e0[_0x58111d(0x113)])[_0x58111d(0x10d)](';\x20');throw new Error(_0x58111d(0x11d)+_0x5d0574);}if(_0x112322[_0x58111d(0x134)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x58111d(0x13a));logger[_0x58111d(0x139)](process[_0x58111d(0x124)]()),logger[_0x58111d(0x107)](_0x58111d(0x12f),'Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x2373ed,'jsUrl':_0x1fdc2c[_0x58111d(0x12b)],'cssUrl':_0x1fdc2c['cssUrl'],'mode':_0x112295,'dryRun':_0x1adf05[_0x58111d(0x120)]===!![]});if(_0x1fdc2c['jsUrl']){const _0x214891=await isUrlReachable(_0x1fdc2c[_0x58111d(0x12b)]);if(!_0x214891)throw new Error(_0x58111d(0x11e)+_0x1fdc2c[_0x58111d(0x12b)]);}if(_0x1fdc2c[_0x58111d(0x13d)]){const _0x4ce3b6=await isUrlReachable(_0x1fdc2c[_0x58111d(0x13d)]);if(!_0x4ce3b6)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x1fdc2c[_0x58111d(0x13d)]);}const _0x66ec99=await getOnlineMenuList(_0x2373ed,_0x3b30bf),_0x375563=_0x66ec99[_0x58111d(0x138)](_0x34f6ff=>_0x34f6ff['resources'][_0x58111d(0x134)]>0x0),_0x6c4d22=selectMenusForUpdate(_0x375563,_0x1adf05['selection']);if(_0x6c4d22[_0x58111d(0x134)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x1adf05[_0x58111d(0x120)]===!![]};const _0x14fa6b=_0x6c4d22[_0x58111d(0x136)](_0x1ed109=>buildMenuUpdateDiff(_0x1ed109,_0x1fdc2c,_0x112295,_0x1adf05[_0x58111d(0x101)]===!![],_0x1adf05[_0x58111d(0x116)]));if(_0x1adf05[_0x58111d(0x120)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x14fa6b};const _0x5f5b0b=await Promise[_0x58111d(0x11b)](_0x6c4d22[_0x58111d(0x136)]((_0x3aa355,_0x4648c9)=>updateMenuCdnUrl(_0x2373ed,_0x3b30bf,{'id':_0x3aa355['id'],'label':_0x3aa355[_0x58111d(0x112)],'path':_0x3aa355[_0x58111d(0x10b)],'resources':_0x14fa6b[_0x4648c9][_0x58111d(0x100)][_0x58111d(0x115)],'extend':_0x3aa355['extend']??null,'loadScriptMode':_0x1adf05[_0x58111d(0x116)]}))),_0x385094=_0x5f5b0b[_0x58111d(0x138)](_0x224cd7=>_0x224cd7[_0x58111d(0x105)]===_0x58111d(0x110))[_0x58111d(0x136)](_0x344730=>_0x344730[_0x58111d(0x132)]),_0x42f35d=_0x5f5b0b[_0x58111d(0x138)](_0x57b9a7=>_0x57b9a7['status']===_0x58111d(0x117))[_0x58111d(0x134)];return logger[_0x58111d(0x107)](_0x58111d(0x12f),_0x58111d(0x129),{'count':_0x6c4d22[_0x58111d(0x134)],'resources':_0x112322}),{'updated':_0x385094['length'],'failed':_0x42f35d,'skipped':![],'menus':_0x385094};}function validateSelection(_0x470352){const _0x2f346f=a186_0x3ce7;if(!_0x470352)throw new Error(_0x2f346f(0x118));if(_0x470352[_0x2f346f(0x121)]&&(_0x470352['menuIds']['length']>0x0||_0x470352[_0x2f346f(0x122)]['length']>0x0))throw new Error(_0x2f346f(0x123));if(!_0x470352[_0x2f346f(0x121)]&&_0x470352['menuIds'][_0x2f346f(0x134)]===0x0&&_0x470352[_0x2f346f(0x122)][_0x2f346f(0x134)]===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0xac7744,_0xd69a12){const _0x3cb9ca=a186_0x3ce7;validateSelection(_0xd69a12);if(_0xd69a12[_0x3cb9ca(0x121)])return _0xac7744;const _0x518310=new Set(_0xac7744[_0x3cb9ca(0x136)](_0x56ede5=>_0x56ede5['id'])),_0x424033=new Set(_0xac7744[_0x3cb9ca(0x136)](_0x31f101=>_0x31f101[_0x3cb9ca(0x10b)])),_0x28fc5a=_0xd69a12[_0x3cb9ca(0x13b)][_0x3cb9ca(0x138)](_0x1f50bd=>!_0x518310[_0x3cb9ca(0x127)](_0x1f50bd)),_0x3de860=_0xd69a12[_0x3cb9ca(0x122)][_0x3cb9ca(0x138)](_0x11b9bf=>!_0x424033['has'](_0x11b9bf));if(_0x28fc5a['length']>0x0||_0x3de860['length']>0x0){const _0x249811=[..._0x28fc5a['map'](_0x504a41=>String(_0x504a41)),..._0x3de860]['join'](',\x20');throw new Error(_0x3cb9ca(0x10c)+_0x249811);}const _0x4b6abd=new Set(_0xd69a12[_0x3cb9ca(0x13b)]),_0x1179e5=new Set(_0xd69a12[_0x3cb9ca(0x122)]);return _0xac7744[_0x3cb9ca(0x138)](_0x3120b2=>_0x4b6abd[_0x3cb9ca(0x127)](_0x3120b2['id'])||_0x1179e5[_0x3cb9ca(0x127)](_0x3120b2[_0x3cb9ca(0x10b)]));}function normalizeMode(_0x362439){const _0xa2c75a=a186_0x3ce7;if(!_0x362439)return'patch';if(_0x362439===_0xa2c75a(0x12d)||_0x362439==='patch')return _0x362439;throw new Error(_0xa2c75a(0x11a)+_0x362439+_0xa2c75a(0x135));}function buildMenuUpdateDiff(_0x5f466d,_0x359e26,_0x8a4708,_0x253ab1,_0x3c4c38){const _0x11c8c8=a186_0x3ce7,_0x322fa2=[..._0x5f466d['resources']];_0x8a4708===_0x11c8c8(0x13e)&&assertUnambiguousPatchResources(_0x5f466d,_0x322fa2,_0x359e26);const _0x3acd96=_0x8a4708===_0x11c8c8(0x13e)?patchResources(_0x322fa2,_0x359e26):replaceResources(_0x359e26),_0x1fa329=[],_0xe2df3f=_0x322fa2[_0x11c8c8(0x102)](isJsResource),_0x4eca53=_0x3acd96['some'](isJsResource);if(_0xe2df3f&&!_0x4eca53){const _0x27be43='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x5f466d['label']+_0x11c8c8(0x109)+_0x5f466d[_0x11c8c8(0x10b)]+_0x11c8c8(0x12c)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0x253ab1)throw new Error(_0x27be43);_0x1fa329['push'](_0x27be43);}const _0x512e7a=_0x322fa2[_0x11c8c8(0x102)](isCssResource),_0x9b4492=_0x3acd96[_0x11c8c8(0x102)](isCssResource);_0x512e7a&&!_0x9b4492&&_0x1fa329[_0x11c8c8(0x13f)](_0x11c8c8(0x125)+_0x5f466d[_0x11c8c8(0x112)]+_0x11c8c8(0x109)+_0x5f466d[_0x11c8c8(0x10b)]+').');const _0xabcc6a=typeof _0x5f466d[_0x11c8c8(0x131)]?.[_0x11c8c8(0x116)]===_0x11c8c8(0x10e)?_0x5f466d['extend'][_0x11c8c8(0x116)]:null,_0x2807c5=_0x3c4c38?{'loadScriptMode':_0xabcc6a}:{},_0x1bb5e9=_0x3c4c38?{'loadScriptMode':_0x3c4c38}:{};return{'id':_0x5f466d['id'],'label':_0x5f466d[_0x11c8c8(0x112)],'path':_0x5f466d[_0x11c8c8(0x10b)],'mode':_0x8a4708,'before':{'resources':_0x322fa2,..._0x2807c5},'after':{'resources':_0x3acd96,..._0x1bb5e9},'warnings':_0x1fa329};}function replaceResources(_0x50dde9){const _0x2c66dc=a186_0x3ce7;return[_0x50dde9[_0x2c66dc(0x12b)],_0x50dde9[_0x2c66dc(0x13d)]][_0x2c66dc(0x138)](_0xa37405=>!!_0xa37405);}function assertUnambiguousPatchResources(_0x5add04,_0x588621,_0x292444){const _0x2db011=a186_0x3ce7,_0x538f57=_0x588621[_0x2db011(0x138)](isJsResource)[_0x2db011(0x134)];if(_0x292444['jsUrl']&&_0x538f57>0x1)throw new Error(_0x2db011(0x128)+_0x538f57+_0x2db011(0x119)+_0x5add04[_0x2db011(0x112)]+_0x2db011(0x109)+_0x5add04[_0x2db011(0x10b)]+')\x20'+_0x2db011(0x11f));const _0x4c2666=_0x588621[_0x2db011(0x138)](isCssResource)[_0x2db011(0x134)];if(_0x292444[_0x2db011(0x13d)]&&_0x4c2666>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x4c2666+_0x2db011(0x12e)+_0x5add04[_0x2db011(0x112)]+_0x2db011(0x109)+_0x5add04[_0x2db011(0x10b)]+')\x20'+_0x2db011(0x137));}function patchResources(_0x471a81,_0x2527c6){const _0xec27d0=a186_0x3ce7;let _0x5b0426=![],_0x17cc20=![];const _0x3adc05=[];for(const _0x1d2399 of _0x471a81){if(isJsResource(_0x1d2399)){if(_0x2527c6[_0xec27d0(0x12b)]&&!_0x5b0426)_0x3adc05[_0xec27d0(0x13f)](_0x2527c6[_0xec27d0(0x12b)]),_0x5b0426=!![];else!_0x2527c6[_0xec27d0(0x12b)]&&_0x3adc05['push'](_0x1d2399);continue;}if(isCssResource(_0x1d2399)){if(_0x2527c6['cssUrl']&&!_0x17cc20)_0x3adc05[_0xec27d0(0x13f)](_0x2527c6[_0xec27d0(0x13d)]),_0x17cc20=!![];else!_0x2527c6[_0xec27d0(0x13d)]&&_0x3adc05['push'](_0x1d2399);continue;}_0x3adc05['push'](_0x1d2399);}return _0x2527c6[_0xec27d0(0x12b)]&&!_0x5b0426&&_0x3adc05[_0xec27d0(0x133)](_0x2527c6[_0xec27d0(0x12b)]),_0x2527c6[_0xec27d0(0x13d)]&&!_0x17cc20&&_0x3adc05[_0xec27d0(0x13f)](_0x2527c6[_0xec27d0(0x13d)]),_0x3adc05;}function isJsResource(_0x2e0bf5){const _0x165651=a186_0x3ce7;return stripQuery(_0x2e0bf5)[_0x165651(0xff)]()[_0x165651(0x106)](_0x165651(0x130));}function isCssResource(_0x41dbd9){const _0x109f1b=a186_0x3ce7;return stripQuery(_0x41dbd9)[_0x109f1b(0xff)]()[_0x109f1b(0x106)](_0x109f1b(0x103));}function stripQuery(_0x275099){const _0x575202=a186_0x3ce7;return _0x275099[_0x575202(0x108)]('?')[0x0]??_0x275099;}function parseUpdateParamsFlag(_0xc76040){const _0x40caa8=a186_0x3ce7;if(!_0xc76040||typeof _0xc76040!=='string')return{};try{const _0x5ab361=JSON['parse'](_0xc76040);if(typeof _0x5ab361!==_0x40caa8(0x114)||_0x5ab361===null||Array[_0x40caa8(0xfe)](_0x5ab361))return{};return{'jsUrl':typeof _0x5ab361[_0x40caa8(0x12b)]==='string'?_0x5ab361['jsUrl']['trim']():undefined,'cssUrl':typeof _0x5ab361[_0x40caa8(0x13d)]===_0x40caa8(0x10e)?_0x5ab361[_0x40caa8(0x13d)]['trim']():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a187_0x20bf(_0x2373c4,_0x134e6d){_0x2373c4=_0x2373c4-0x10b;const _0x1a116a=a187_0x1a11();let _0x20bfd0=_0x1a116a[_0x2373c4];return _0x20bfd0;}function a187_0x1a11(){const _0x4a9877=['2073510vhjsFt','GET','406940EPvzOM','6JcqWax','1YTyImH','3509231SdHeOe','cancel','1094578QsoNvD','133648uIcMLp','170HbmTNf','8BZTrLb','4618523jLJidS','test','7016391DwZRmm','body','HEAD'];a187_0x1a11=function(){return _0x4a9877;};return a187_0x1a11();}(function(_0x563ce4,_0x27f9a3){const _0x1dbb0b=a187_0x20bf,_0x3672d9=_0x563ce4();while(!![]){try{const _0x518581=-parseInt(_0x1dbb0b(0x113))/0x1*(-parseInt(_0x1dbb0b(0x116))/0x2)+parseInt(_0x1dbb0b(0x10f))/0x3+parseInt(_0x1dbb0b(0x117))/0x4*(-parseInt(_0x1dbb0b(0x118))/0x5)+parseInt(_0x1dbb0b(0x112))/0x6*(-parseInt(_0x1dbb0b(0x11a))/0x7)+-parseInt(_0x1dbb0b(0x119))/0x8*(-parseInt(_0x1dbb0b(0x10c))/0x9)+parseInt(_0x1dbb0b(0x111))/0xa+parseInt(_0x1dbb0b(0x114))/0xb;if(_0x518581===_0x27f9a3)break;else _0x3672d9['push'](_0x3672d9['shift']());}catch(_0x87a286){_0x3672d9['push'](_0x3672d9['shift']());}}}(a187_0x1a11,0x8e158));export function isValidJsHttpsUrl(_0xb9de1){const _0x4fed6d=a187_0x20bf;return/^https:\/\/.+\.js(\?.*)?$/[_0x4fed6d(0x10b)](_0xb9de1['trim']());}export function isValidCssHttpsUrl(_0x195903){const _0x216ece=a187_0x20bf;return/^https:\/\/.+\.css(\?.*)?$/[_0x216ece(0x10b)](_0x195903['trim']());}export async function isUrlReachable(_0x13f71b){const _0x91be79=a187_0x20bf;try{const _0x49c501=await fetch(_0x13f71b,{'method':_0x91be79(0x10e)});if(_0x49c501['ok'])return!![];}catch{}try{const _0x152705=await fetch(_0x13f71b,{'method':_0x91be79(0x110),'headers':{'Range':'bytes=0-0'}}),_0x1904a7=_0x152705['ok'];try{await _0x152705[_0x91be79(0x10d)]?.[_0x91be79(0x115)]();}catch{}return _0x1904a7;}catch{return![];}}
|