@lovrabet/rabetbase-cli 2.3.16-beta.7 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -10
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/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/get.js +1 -1
- package/lib/commands/config/index.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/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-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/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.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/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.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/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.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/react/create.d.ts +2 -0
- package/lib/commands/page/react/create.js +1 -0
- package/lib/commands/page/react/detail.d.ts +2 -0
- package/lib/commands/page/react/detail.js +1 -0
- package/lib/commands/page/react/list.d.ts +2 -0
- package/lib/commands/page/react/list.js +1 -0
- package/lib/commands/page/react/publish.d.ts +2 -0
- package/lib/commands/page/react/publish.js +1 -0
- package/lib/commands/page/react/shared.d.ts +78 -0
- package/lib/commands/page/react/shared.js +1 -0
- package/lib/commands/page/react/syntax.d.ts +18 -0
- package/lib/commands/page/react/syntax.js +1 -0
- package/lib/commands/page/react/template.d.ts +8 -0
- package/lib/commands/page/react/template.js +1 -0
- package/lib/commands/page/react/update.d.ts +2 -0
- package/lib/commands/page/react/update.js +1 -0
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.d.ts +1 -0
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.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/non-interactive.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/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.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/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.d.ts +2 -0
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -0
- package/lib/commands/user-account/index.d.ts +2 -0
- package/lib/commands/user-account/index.js +1 -0
- 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/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/risk.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 +117 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.d.ts +3 -0
- package/lib/postinstall.js +1 -0
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.d.ts +37 -0
- package/lib/skills/builtin-skill.js +1 -0
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +4 -2
- 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/copy-directory.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/rules-cdn.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 +9 -3
- package/scripts/postinstall.mjs +24 -0
- package/skills/rabetbase/SKILL.md +493 -0
- package/skills/rabetbase/guides/backend-function.md +835 -0
- package/skills/rabetbase/guides/best-practices.md +137 -0
- package/skills/rabetbase/guides/bff-creation-workflow.md +148 -0
- package/skills/rabetbase/guides/conflict-detection.md +119 -0
- package/skills/rabetbase/guides/data-api-guidelines.md +414 -0
- package/skills/rabetbase/guides/database-connection-workflow.md +169 -0
- package/skills/rabetbase/guides/frontend-development.md +179 -0
- package/skills/rabetbase/guides/legacy-application-blueprint-workflow.md +495 -0
- package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +137 -0
- package/skills/rabetbase/guides/page-development-workflow.md +187 -0
- package/skills/rabetbase/guides/react-custom-page-workflow.md +184 -0
- package/skills/rabetbase/guides/role-permit-workflow.md +127 -0
- package/skills/rabetbase/guides/sql-creation-workflow.md +173 -0
- package/skills/rabetbase/guides/sql-mybatis.md +126 -0
- package/skills/rabetbase/guides/troubleshooting.md +67 -0
- package/skills/rabetbase/guides/typescript-sdk.md +227 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartCreate.md +367 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartDetail.md +153 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +291 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartFilter.md +478 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +119 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +223 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +632 -0
- package/skills/rabetbase/knowledge/page-schema/YtPage.md +172 -0
- package/skills/rabetbase/knowledge/page-schema/dataset-relations.md +126 -0
- package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +232 -0
- package/skills/rabetbase/knowledge/page-schema/field-components.md +312 -0
- package/skills/rabetbase/knowledge/page-schema/syntax-reference.md +278 -0
- package/skills/rabetbase/knowledge/react-page/components.md +225 -0
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +385 -0
- package/skills/rabetbase/references/rabetbase-api-list.md +58 -0
- package/skills/rabetbase/references/rabetbase-api-pull.md +82 -0
- package/skills/rabetbase/references/rabetbase-app-config.md +95 -0
- package/skills/rabetbase/references/rabetbase-app-list.md +79 -0
- package/skills/rabetbase/references/rabetbase-app-members-list.md +64 -0
- package/skills/rabetbase/references/rabetbase-auth-login.md +53 -0
- package/skills/rabetbase/references/rabetbase-auth-logout.md +29 -0
- package/skills/rabetbase/references/rabetbase-bff-create.md +59 -0
- package/skills/rabetbase/references/rabetbase-bff-delete.md +42 -0
- package/skills/rabetbase/references/rabetbase-bff-detail.md +38 -0
- package/skills/rabetbase/references/rabetbase-bff-list.md +61 -0
- package/skills/rabetbase/references/rabetbase-bff-pull.md +42 -0
- package/skills/rabetbase/references/rabetbase-bff-push.md +65 -0
- package/skills/rabetbase/references/rabetbase-bff-save.md +63 -0
- package/skills/rabetbase/references/rabetbase-bff-status.md +37 -0
- package/skills/rabetbase/references/rabetbase-cli-skill-install.md +42 -0
- package/skills/rabetbase/references/rabetbase-codegen-sdk.md +35 -0
- package/skills/rabetbase/references/rabetbase-codegen-sql.md +33 -0
- package/skills/rabetbase/references/rabetbase-config.md +296 -0
- package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +84 -0
- package/skills/rabetbase/references/rabetbase-dataset-delete.md +54 -0
- package/skills/rabetbase/references/rabetbase-dataset-detail.md +106 -0
- package/skills/rabetbase/references/rabetbase-dataset-extend-update.md +70 -0
- package/skills/rabetbase/references/rabetbase-dataset-field-update.md +117 -0
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +206 -0
- package/skills/rabetbase/references/rabetbase-dataset-list.md +42 -0
- package/skills/rabetbase/references/rabetbase-dataset-operations.md +34 -0
- package/skills/rabetbase/references/rabetbase-dataset-relation-audit.md +63 -0
- package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +141 -0
- package/skills/rabetbase/references/rabetbase-dataset-relations.md +71 -0
- package/skills/rabetbase/references/rabetbase-dataset-rename.md +107 -0
- package/skills/rabetbase/references/rabetbase-dataset-restore.md +54 -0
- package/skills/rabetbase/references/rabetbase-db-analyze.md +135 -0
- package/skills/rabetbase/references/rabetbase-db-create.md +54 -0
- package/skills/rabetbase/references/rabetbase-db-delete.md +26 -0
- package/skills/rabetbase/references/rabetbase-db-detail.md +27 -0
- package/skills/rabetbase/references/rabetbase-db-diff.md +57 -0
- package/skills/rabetbase/references/rabetbase-db-list.md +37 -0
- package/skills/rabetbase/references/rabetbase-db-tables.md +25 -0
- package/skills/rabetbase/references/rabetbase-db-test.md +29 -0
- package/skills/rabetbase/references/rabetbase-db-update.md +29 -0
- package/skills/rabetbase/references/rabetbase-doctor.md +62 -0
- package/skills/rabetbase/references/rabetbase-file.md +35 -0
- package/skills/rabetbase/references/rabetbase-init.md +70 -0
- package/skills/rabetbase/references/rabetbase-issue-report.md +132 -0
- package/skills/rabetbase/references/rabetbase-kb.md +62 -0
- package/skills/rabetbase/references/rabetbase-menu-asset-update.md +135 -0
- package/skills/rabetbase/references/rabetbase-menu-delete.md +54 -0
- package/skills/rabetbase/references/rabetbase-menu-external-link-create.md +63 -0
- package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +74 -0
- package/skills/rabetbase/references/rabetbase-menu-group-create.md +33 -0
- package/skills/rabetbase/references/rabetbase-menu-group-update.md +38 -0
- package/skills/rabetbase/references/rabetbase-menu-list.md +144 -0
- package/skills/rabetbase/references/rabetbase-menu-move.md +54 -0
- package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +45 -0
- package/skills/rabetbase/references/rabetbase-menu-rename.md +48 -0
- package/skills/rabetbase/references/rabetbase-menu-sync.md +60 -0
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +80 -0
- package/skills/rabetbase/references/rabetbase-ocr.md +86 -0
- package/skills/rabetbase/references/rabetbase-page-generate-start.md +32 -0
- package/skills/rabetbase/references/rabetbase-page-generate-status.md +32 -0
- package/skills/rabetbase/references/rabetbase-page-pull.md +47 -0
- package/skills/rabetbase/references/rabetbase-page-push.md +45 -0
- package/skills/rabetbase/references/rabetbase-page-react-create.md +29 -0
- package/skills/rabetbase/references/rabetbase-page-react-detail.md +26 -0
- package/skills/rabetbase/references/rabetbase-page-react-list.md +23 -0
- package/skills/rabetbase/references/rabetbase-page-react-publish.md +23 -0
- package/skills/rabetbase/references/rabetbase-page-react-update.md +24 -0
- package/skills/rabetbase/references/rabetbase-page-relation-binding.md +72 -0
- package/skills/rabetbase/references/rabetbase-page-restore.md +45 -0
- package/skills/rabetbase/references/rabetbase-page-sync.md +36 -0
- package/skills/rabetbase/references/rabetbase-permit-page-set.md +69 -0
- package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +53 -0
- package/skills/rabetbase/references/rabetbase-permit-role-menus-set.md +57 -0
- package/skills/rabetbase/references/rabetbase-project-create.md +46 -0
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +57 -0
- package/skills/rabetbase/references/rabetbase-role-list.md +68 -0
- package/skills/rabetbase/references/rabetbase-role-user-add.md +54 -0
- package/skills/rabetbase/references/rabetbase-role-user-resolve.md +27 -0
- package/skills/rabetbase/references/rabetbase-run.md +53 -0
- package/skills/rabetbase/references/rabetbase-schema.md +22 -0
- package/skills/rabetbase/references/rabetbase-sql-create.md +41 -0
- package/skills/rabetbase/references/rabetbase-sql-delete.md +37 -0
- package/skills/rabetbase/references/rabetbase-sql-detail.md +32 -0
- package/skills/rabetbase/references/rabetbase-sql-exec.md +34 -0
- package/skills/rabetbase/references/rabetbase-sql-list.md +54 -0
- package/skills/rabetbase/references/rabetbase-sql-pull.md +54 -0
- package/skills/rabetbase/references/rabetbase-sql-push.md +46 -0
- package/skills/rabetbase/references/rabetbase-sql-status.md +39 -0
- package/skills/rabetbase/references/rabetbase-sql-validate.md +73 -0
- package/skills/rabetbase/references/rabetbase-standard-page-status.md +31 -0
- package/skills/rabetbase/references/rabetbase-task-status.md +40 -0
- package/skills/rabetbase/references/rabetbase-tenant-members-list.md +69 -0
- package/skills/rabetbase/references/rabetbase-update.md +56 -0
- package/skills/rabetbase/references/rabetbase-user-account.md +45 -0
- package/skills/rabetbase/references/rabetbase-workspace.md +60 -0
- package/skills/rabetbase.manifest.json +137 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x306e4b,_0x31a5b9){const _0x4be62b=a122_0x4c3b,_0x189003=_0x306e4b();while(!![]){try{const _0x1a44e6=parseInt(_0x4be62b(0xf1))/0x1+-parseInt(_0x4be62b(0xe5))/0x2+parseInt(_0x4be62b(0xd8))/0x3*(-parseInt(_0x4be62b(0xe7))/0x4)+parseInt(_0x4be62b(0xde))/0x5+parseInt(_0x4be62b(0xe1))/0x6*(-parseInt(_0x4be62b(0xe8))/0x7)+parseInt(_0x4be62b(0xfe))/0x8+parseInt(_0x4be62b(0xfc))/0x9;if(_0x1a44e6===_0x31a5b9)break;else _0x189003['push'](_0x189003['shift']());}catch(_0x5e2462){_0x189003['push'](_0x189003['shift']());}}}(a122_0x155b,0x1d0c0));import a122_0x405e85 from'chalk';function a122_0x4c3b(_0x2437f6,_0x37fedb){_0x2437f6=_0x2437f6-0xd6;const _0x155b76=a122_0x155b();let _0x4c3bb8=_0x155b76[_0x2437f6];return _0x4c3bb8;}import{checkbox,input,confirm}from'@inquirer/prompts';function a122_0x155b(){const _0x29fe92=['Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','No\x20menus\x20selected.','gray','[new]','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','\x20\x20JS\x20URL:','trim','CSS\x20URL\x20check\x20failed','succeed','1711305IbSzsk','\x20\x20Checking\x20CSS\x20URL\x20reachability...','1733872UCdXPD','cyan','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','cancelled','559767uyNRPc','start','path','JS\x20URL\x20checked','[already\x20on\x20platform]','stdin','650090NEAaDQ','label','isTTY','6LHOZQS','has','CSS\x20URL\x20checked','\x20\x20CSS\x20URL:','451102ziGWqH','Cancelled.','4ydPsoF','800317qIjsVR','fail','filter','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','length','catch','error','red','includes','108550EhEpGG','test'];a122_0x155b=function(){return _0x29fe92;};return a122_0x155b();}import a122_0x28de1f from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x35dab2){const _0x55a168=a122_0x4c3b;return _0x35dab2[_0x55a168(0xed)](_0x30998d=>{const _0x2b967e=_0x55a168;if(_0x30998d?.['name']==='ExitPromptError')throw CliErrors[_0x2b967e(0xd7)](_0x2b967e(0xe6));throw _0x30998d;});}export function startSpinner(_0x47ee2a){const _0x3e81ba=a122_0x4c3b;return a122_0x28de1f({'text':_0x47ee2a,'color':_0x3e81ba(0xff)})[_0x3e81ba(0xd9)]();}export function stopSpinner(_0x25eaa5,_0x1d9353,_0xc83d72){const _0x4247fb=a122_0x4c3b;_0xc83d72?_0x25eaa5[_0x4247fb(0xfb)](_0x1d9353):_0x25eaa5[_0x4247fb(0xe9)](_0x1d9353);}export async function askConfirm(_0x248033){return onCancel(confirm({'message':_0x248033,'theme':{'prefix':''}}));}export async function askJsUrl(_0x281569){const _0x1562d4=a122_0x4c3b;while(!![]){const _0x51dcf7=await onCancel(input({'message':_0x1562d4(0xf8),'default':_0x281569,'theme':{'prefix':''}}));if(_0x51dcf7[_0x1562d4(0xf9)]()==='')throw CliErrors[_0x1562d4(0xd7)](_0x1562d4(0xe6));if(!/^https:\/\/.+\.js(\?.*)?$/[_0x1562d4(0xf2)](_0x51dcf7['trim']())){console[_0x1562d4(0xee)](a122_0x405e85['red'](_0x1562d4(0xeb)));continue;}const _0x96659f=startSpinner('\x20\x20Checking\x20JS\x20URL\x20reachability...');try{const _0xcb093b=await isUrlReachable(_0x51dcf7[_0x1562d4(0xf9)]());stopSpinner(_0x96659f,_0x1562d4(0xdb),_0xcb093b);if(!_0xcb093b){console[_0x1562d4(0xee)](a122_0x405e85['red']('\x20\x20✗\x20JS\x20URL\x20is\x20unreachable'));continue;}return _0x51dcf7['trim']();}catch(_0x33c28b){stopSpinner(_0x96659f,'JS\x20URL\x20check\x20failed',![]);throw _0x33c28b;}}}export async function askCssUrl(_0x2ec989){const _0x364a78=a122_0x4c3b;while(!![]){const _0x1d845f=await onCancel(input({'message':_0x364a78(0xe4),'default':_0x2ec989,'theme':{'prefix':''}}));if(_0x1d845f[_0x364a78(0xf9)]()==='')throw CliErrors[_0x364a78(0xd7)](_0x364a78(0xe6));if(!/^https:\/\/.+\.css(\?.*)?$/['test'](_0x1d845f[_0x364a78(0xf9)]())){console['error'](a122_0x405e85[_0x364a78(0xef)](_0x364a78(0xf7)));continue;}const _0x1d9bef=startSpinner(_0x364a78(0xfd));try{const _0x296576=await isUrlReachable(_0x1d845f[_0x364a78(0xf9)]());stopSpinner(_0x1d9bef,_0x364a78(0xe3),_0x296576);if(!_0x296576){console[_0x364a78(0xee)](a122_0x405e85[_0x364a78(0xef)]('\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable'));continue;}return _0x1d845f[_0x364a78(0xf9)]();}catch(_0x4191fd){stopSpinner(_0x1d9bef,_0x364a78(0xfa),![]);throw _0x4191fd;}}}export async function selectPages(_0x5cf59e,_0x8857c0){const _0x4274e7=a122_0x4c3b,_0x4dfdf8=_0x5cf59e['map'](_0x7094c8=>{const _0x1eb787=a122_0x4c3b,_0x370643=_0x8857c0[_0x1eb787(0xe2)](_0x7094c8[_0x1eb787(0xda)]);return{'name':_0x7094c8[_0x1eb787(0xdf)]+'\x20\x20'+a122_0x405e85[_0x1eb787(0xf5)](_0x7094c8[_0x1eb787(0xda)])+'\x20\x20'+(_0x370643?a122_0x405e85[_0x1eb787(0xf5)](_0x1eb787(0xdc)):a122_0x405e85['green'](_0x1eb787(0xf6))),'value':_0x7094c8[_0x1eb787(0xda)],'checked':!_0x370643,'disabled':_0x370643};});if(_0x4dfdf8[_0x4274e7(0xec)]===0x0)throw new Error('No\x20local\x20pages\x20found.');const _0x365dd8=await onCancel(checkbox({'message':_0x4274e7(0xd6),'choices':_0x4dfdf8,'loop':![],'theme':{'prefix':''}}));if(_0x365dd8[_0x4274e7(0xec)]===0x0)throw new Error(_0x4274e7(0xf4));return _0x5cf59e[_0x4274e7(0xea)](_0x534caf=>_0x365dd8[_0x4274e7(0xf0)](_0x534caf['path']));}export function isInteractive(){const _0xc45f29=a122_0x4c3b;return process[_0xc45f29(0xdd)][_0xc45f29(0xe0)]===!![];}export function requireInteractive(){const _0x16a17f=a122_0x4c3b;if(!isInteractive())throw new Error('This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20'+_0x16a17f(0xf3));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a123_0x5360(){const _0x4291e1=['291557tmSbZB','12GkEmDN','forEach','2804549AAShFp','3054eEODnV','204dItBaZ','replaceAll','isDirectory','join','763152sYAseQ','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','56eljlVx','trim','utf-8','match','push','24orHWLu','endsWith','replace','189638ianRZH','220140GHOmHO','45XjQtAI','index.tsx','cwd','3035iZqIJM'];a123_0x5360=function(){return _0x4291e1;};return a123_0x5360();}const a123_0x492f87=a123_0x2b1d;(function(_0x3b2807,_0x179aaa){const _0x78ede1=a123_0x2b1d,_0x2593d4=_0x3b2807();while(!![]){try{const _0x3c0b15=-parseInt(_0x78ede1(0xa9))/0x1+-parseInt(_0x78ede1(0xba))/0x2*(parseInt(_0x78ede1(0xb3))/0x3)+-parseInt(_0x78ede1(0xb8))/0x4+-parseInt(_0x78ede1(0xae))/0x5*(-parseInt(_0x78ede1(0xb4))/0x6)+-parseInt(_0x78ede1(0xaf))/0x7*(-parseInt(_0x78ede1(0xbf))/0x8)+-parseInt(_0x78ede1(0xab))/0x9*(-parseInt(_0x78ede1(0xaa))/0xa)+-parseInt(_0x78ede1(0xb2))/0xb*(-parseInt(_0x78ede1(0xb0))/0xc);if(_0x3c0b15===_0x179aaa)break;else _0x2593d4['push'](_0x2593d4['shift']());}catch(_0x3fb593){_0x2593d4['push'](_0x2593d4['shift']());}}}(a123_0x5360,0x18d3a));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';function a123_0x2b1d(_0x283d3e,_0x2b90a5){_0x283d3e=_0x283d3e-0xa8;const _0x536048=a123_0x5360();let _0x2b1d8b=_0x536048[_0x283d3e];return _0x2b1d8b;}const pagesDir=resolve(process[a123_0x492f87(0xad)](),'src/pages');export function extractTitleFromComment(_0x1cfe0f){const _0x471366=a123_0x492f87;try{const _0x55753c=readFileSync(_0x1cfe0f,_0x471366(0xbc)),_0x15c9e1=_0x55753c[_0x471366(0xbd)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x15c9e1&&_0x15c9e1[0x1]){const _0x2f77b9=_0x15c9e1[0x1],_0x481447=_0x2f77b9[_0x471366(0xbd)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x481447&&_0x481447[0x1])return _0x481447[0x1][_0x471366(0xbb)]();}let _0x416f00=null;const _0x12f8e1=_0x55753c['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x12f8e1&&_0x12f8e1[0x1]&&(_0x416f00=_0x12f8e1[0x1]);if(!_0x416f00){const _0x2cff8f=_0x55753c[_0x471366(0xbd)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x2cff8f&&_0x2cff8f[0x1]&&(_0x416f00=_0x2cff8f[0x1]);}if(_0x416f00){const _0x1f82a6=new RegExp('\x5cb'+_0x416f00+_0x471366(0xb9)),_0x1b304b=_0x55753c[_0x471366(0xbd)](_0x1f82a6);if(_0x1b304b&&_0x1b304b[0x1])return _0x1b304b[0x1];return _0x416f00;}return null;}catch(_0x3e93b7){return null;}}export function getLocalPages(_0x14a031=pagesDir,_0x32a3cf=pagesDir){const _0x5a41cf=a123_0x492f87;let _0x467e1c=[];const _0x4b04b4=readdirSync(_0x14a031);return _0x4b04b4[_0x5a41cf(0xb1)](_0x4dba77=>{const _0x173a0a=_0x5a41cf,_0x555e5=join(_0x14a031,_0x4dba77),_0x4561a4=statSync(_0x555e5);if(_0x4561a4&&_0x4561a4[_0x173a0a(0xb6)]())_0x467e1c=_0x467e1c['concat'](getLocalPages(_0x555e5,_0x32a3cf));else{if(_0x4dba77['endsWith']('.tsx')){let _0x42c9b3=relative(_0x32a3cf,_0x555e5);_0x42c9b3[_0x173a0a(0xc0)](_0x173a0a(0xac))?_0x42c9b3=_0x42c9b3['replace'](/index\.tsx$/,''):_0x42c9b3=_0x42c9b3[_0x173a0a(0xa8)](/\.tsx$/,'');_0x42c9b3[_0x173a0a(0xc0)](sep)&&(_0x42c9b3=_0x42c9b3['slice'](0x0,-0x1));const _0x166de2=_0x42c9b3['split'](sep)[_0x173a0a(0xb7)]('/'),_0x5818bc=extractTitleFromComment(_0x555e5),_0x11418e=_0x5818bc||_0x166de2;_0x467e1c[_0x173a0a(0xbe)]({'path':_0x166de2[_0x173a0a(0xb5)]('$',':'),'label':_0x11418e});}}}),_0x467e1c['filter'](_0x11000a=>_0x11000a['path']!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3339a8,_0x2bdcc9){const _0x21e4ff=a124_0x1cc5,_0x5a0aff=_0x3339a8();while(!![]){try{const _0x3b50e5=parseInt(_0x21e4ff(0x92))/0x1+parseInt(_0x21e4ff(0x90))/0x2*(-parseInt(_0x21e4ff(0x95))/0x3)+-parseInt(_0x21e4ff(0x9c))/0x4*(-parseInt(_0x21e4ff(0x97))/0x5)+parseInt(_0x21e4ff(0x89))/0x6*(-parseInt(_0x21e4ff(0x99))/0x7)+parseInt(_0x21e4ff(0x88))/0x8*(parseInt(_0x21e4ff(0x8b))/0x9)+-parseInt(_0x21e4ff(0x91))/0xa+parseInt(_0x21e4ff(0x9a))/0xb*(parseInt(_0x21e4ff(0x96))/0xc);if(_0x3b50e5===_0x2bdcc9)break;else _0x5a0aff['push'](_0x5a0aff['shift']());}catch(_0x26f917){_0x5a0aff['push'](_0x5a0aff['shift']());}}}(a124_0x5121,0xdfe85));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 a124_0x1cc5(_0x366d4b,_0x32c919){_0x366d4b=_0x366d4b-0x88;const _0x5121b8=a124_0x5121();let _0x1cc522=_0x5121b8[_0x366d4b];return _0x1cc522;}function a124_0x5121(){const _0x371d68=['push','CSS\x20URL\x20is\x20unreachable','filter','resources','753686pEwvtn','9281840rSZxQU','101400ZrRjeX','label','path','6MuRKLT','12ZKSvAQ','102735xbgfLn','map','6181yyHdWf','43182623ceYZiX','has','12WVUGmb','length','540160eKQYci','11958IlOFjU','errors','36RhLwTH'];a124_0x5121=function(){return _0x371d68;};return a124_0x5121();}export function validateJsUrl(_0x237bce){const _0x3cd676=a124_0x1cc5,_0x1f97d1=[];return!isValidJsHttpsUrl(_0x237bce)&&_0x1f97d1[_0x3cd676(0x8c)]('JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'),{'ok':_0x1f97d1[_0x3cd676(0x9d)]===0x0,'errors':_0x1f97d1};}export function validateCssUrl(_0x58daff){const _0x1d8450=a124_0x1cc5,_0x4e7a4a=[];return!isValidCssHttpsUrl(_0x58daff)&&_0x4e7a4a['push']('CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'),{'ok':_0x4e7a4a[_0x1d8450(0x9d)]===0x0,'errors':_0x4e7a4a};}export async function validateJsUrlReachable(_0x2911f2){const _0xfb232=a124_0x1cc5,_0x2671f1=validateJsUrl(_0x2911f2);if(!_0x2671f1['ok'])return _0x2671f1;const _0x5eb5a1=await isUrlReachable(_0x2911f2);if(!_0x5eb5a1)_0x2671f1[_0xfb232(0x8a)]['push']('JS\x20URL\x20is\x20unreachable');return{'ok':_0x2671f1[_0xfb232(0x8a)]['length']===0x0,'errors':_0x2671f1[_0xfb232(0x8a)]};}export async function validateCssUrlReachable(_0x190dcb){const _0x101c6e=a124_0x1cc5,_0x15ea1b=validateCssUrl(_0x190dcb);if(!_0x15ea1b['ok'])return _0x15ea1b;const _0x11e5bd=await isUrlReachable(_0x190dcb);if(!_0x11e5bd)_0x15ea1b[_0x101c6e(0x8a)][_0x101c6e(0x8c)](_0x101c6e(0x8d));return{'ok':_0x15ea1b[_0x101c6e(0x8a)][_0x101c6e(0x9d)]===0x0,'errors':_0x15ea1b[_0x101c6e(0x8a)]};}export function buildCompareRows(_0x483723,_0x4c30ac){const _0x4bb46c=a124_0x1cc5;return _0x483723[_0x4bb46c(0x98)](_0x473f26=>({'label':_0x473f26[_0x4bb46c(0x93)],'path':_0x473f26[_0x4bb46c(0x94)],'local':!![],'online':_0x4c30ac[_0x4bb46c(0x9b)](_0x473f26[_0x4bb46c(0x94)])}));}export async function doCreateMenus(_0x220359,_0x20cbdc,_0x4cce1f,_0x2f690a){const _0x523611=a124_0x1cc5,_0x71d8be=await createMenus(_0x220359,_0x20cbdc,_0x4cce1f,_0x2f690a);return{'created':_0x71d8be[_0x523611(0x9d)],'failed':0x0,'labels':_0x4cce1f[_0x523611(0x98)](_0x30dba0=>_0x30dba0[_0x523611(0x93)]),'menus':_0x71d8be};}export function filterMenusWithResources(_0x4085b4){const _0x3d01cc=a124_0x1cc5;return _0x4085b4[_0x3d01cc(0x8e)](_0x9bdf12=>_0x9bdf12[_0x3d01cc(0x8f)]['length']>0x0);}export async function fetchMenuData(_0x35169d,_0x52d9a2){const _0x57dee4=a124_0x1cc5,_0x24acee=getLocalPages(),_0xd5ab07=await getOnlineMenuList(_0x35169d,_0x52d9a2),_0x434175=new Set(_0xd5ab07[_0x57dee4(0x98)](_0x3b72ea=>_0x3b72ea['path']));return{'localPages':_0x24acee,'onlineMenuList':_0xd5ab07,'onlinePaths':_0x434175};}export async function fetchOnlineMenuList(_0x32bfdc,_0x1f5784){return getOnlineMenuList(_0x32bfdc,_0x1f5784);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a125_0x113ce9=a125_0x1f7b;(function(_0x5d7f04,_0x3691b7){const _0x5bf0f1=a125_0x1f7b,_0x3de40d=_0x5d7f04();while(!![]){try{const _0x3ff363=-parseInt(_0x5bf0f1(0x15a))/0x1+parseInt(_0x5bf0f1(0x18a))/0x2+-parseInt(_0x5bf0f1(0x17f))/0x3*(-parseInt(_0x5bf0f1(0x197))/0x4)+-parseInt(_0x5bf0f1(0x191))/0x5*(parseInt(_0x5bf0f1(0x159))/0x6)+parseInt(_0x5bf0f1(0x132))/0x7*(-parseInt(_0x5bf0f1(0x175))/0x8)+-parseInt(_0x5bf0f1(0x153))/0x9*(-parseInt(_0x5bf0f1(0x188))/0xa)+-parseInt(_0x5bf0f1(0x142))/0xb*(-parseInt(_0x5bf0f1(0x14d))/0xc);if(_0x3ff363===_0x3691b7)break;else _0x3de40d['push'](_0x3de40d['shift']());}catch(_0x560e25){_0x3de40d['push'](_0x3de40d['shift']());}}}(a125_0x4ea6,0x4dfb4));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':a125_0x113ce9(0x16a),'required':!![],'description':a125_0x113ce9(0x15f)};export const MENU_SORT_FLAG={'name':'sort','type':'number','description':a125_0x113ce9(0x189)};export const MENU_PARENT_ID_FLAG={'name':a125_0x113ce9(0x180),'type':a125_0x113ce9(0x160),'description':a125_0x113ce9(0x18f)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a125_0x113ce9(0x155),'type':'string','description':a125_0x113ce9(0x193)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a125_0x113ce9(0x13a),'type':'string','description':a125_0x113ce9(0x16e)},{'name':a125_0x113ce9(0x14e),'type':a125_0x113ce9(0x16a),'description':a125_0x113ce9(0x166)}];export function validateExactId(_0x5468c2){const _0x54e1be=a125_0x113ce9,_0x59c0dc=_0x5468c2['num']('id');if(!Number[_0x54e1be(0x145)](_0x59c0dc)||_0x59c0dc<=0x0)throw CliErrors[_0x54e1be(0x13e)](_0x54e1be(0x178));return _0x59c0dc;}export function validateSort(_0x25e741,_0x101424=a125_0x113ce9(0x149)){const _0x170495=a125_0x113ce9;if(!hasFlag(_0x25e741,_0x101424))return undefined;const _0x1512c7=_0x25e741[_0x170495(0x190)](_0x101424);if(!Number[_0x170495(0x145)](_0x1512c7)||_0x1512c7<0x0||_0x1512c7>MAX_MENU_SORT)throw menuError(_0x170495(0x143),'--'+_0x101424+_0x170495(0x147)+MAX_MENU_SORT+'.',_0x170495(0x19c));return _0x1512c7;}export function nextSiblingSort(_0x1bbd42,_0x21ab6b,_0x1ca1bd){const _0x1a6674=a125_0x113ce9,_0x46544e=getChildren(_0x1bbd42,_0x21ab6b)[_0x1a6674(0x13d)](_0x8cf8d1=>_0x8cf8d1[_0x1a6674(0x149)])['filter'](_0x296f5b=>typeof _0x296f5b==='number');if(_0x46544e[_0x1a6674(0x138)]===0x0)return 0x0;const _0x47b87f=Math[_0x1a6674(0x174)](..._0x46544e);if(_0x47b87f>=MAX_MENU_SORT)throw menuError(_0x1a6674(0x15c),_0x1a6674(0x18b)+_0x1ca1bd+_0x1a6674(0x192)+_0x47b87f+'.','Reorder\x20sibling\x20menus\x20below\x20'+MAX_MENU_SORT+_0x1a6674(0x182));return _0x47b87f+0x1;}export function requireExplicitYes(_0x590862){const _0x7dde56=a125_0x113ce9;if(_0x590862[_0x7dde56(0x165)]('dry-run'))return;if(!_0x590862['bool']('yes'))throw menuError(_0x7dde56(0x183),_0x7dde56(0x133),_0x7dde56(0x15d));}export async function fetchMutationSnapshot(_0x18943a,_0x1838bb,_0x4729fd){const _0xef5be9=a125_0x113ce9;try{return await fetchMenuSnapshot(_0x18943a[_0xef5be9(0x196)],_0x18943a[_0xef5be9(0x19a)]);}catch(_0x1cc6fc){throw mapMenuApiError(_0x1cc6fc,_0xef5be9(0x14b)+_0x1838bb,_0x4729fd);}}export async function recheckMutationSnapshot(_0xf86e70,_0x1a3a3a,_0x2d3971,_0x333749){const _0x44b550=a125_0x113ce9;let _0x79f298;try{_0x79f298=await fetchMenuSnapshot(_0xf86e70[_0x44b550(0x196)],_0xf86e70['cookie']);}catch(_0x27d331){const _0x2ad46b=mapMenuApiError(_0x27d331,_0x44b550(0x131)+_0x2d3971,_0x333749);throw menuFailure(_0x2ad46b,_0x1a3a3a,{'stage':_0x44b550(0x18d),'failed':_0x333749==null?{}:{'id':_0x333749}});}if(_0x79f298['hash']!==_0x1a3a3a[_0x44b550(0x156)]){const _0x12c529=menuError(_0x44b550(0x19d),_0x44b550(0x17d)+_0x2d3971+_0x44b550(0x19e),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.');throw menuFailure(_0x12c529,_0x1a3a3a,{'stage':'pre-write-recheck','failed':{..._0x333749==null?{}:{'id':_0x333749},'expectedSnapshotHash':_0x1a3a3a['snapshotHash'],'currentSnapshotHash':_0x79f298[_0x44b550(0x16b)]}});}return _0x79f298;}export function parseParentId(_0x1c4668,_0x3a8491,_0x2bb6ea={}){const _0x212dc0=a125_0x113ce9;if(!hasFlag(_0x1c4668,_0x3a8491)){if(_0x2bb6ea[_0x212dc0(0x17a)])throw CliErrors[_0x212dc0(0x17e)](_0x3a8491);return undefined;}const _0xbf8d44=_0x1c4668[_0x212dc0(0x181)](_0x3a8491)['trim']();if(_0xbf8d44[_0x212dc0(0x152)]()===_0x212dc0(0x19b))return null;if(!/^\d+$/[_0x212dc0(0x13f)](_0xbf8d44))throw CliErrors[_0x212dc0(0x13e)]('--'+_0x3a8491+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');const _0x4bf45f=Number(_0xbf8d44);if(!Number[_0x212dc0(0x145)](_0x4bf45f)||_0x4bf45f<=0x0)throw CliErrors[_0x212dc0(0x13e)]('--'+_0x3a8491+_0x212dc0(0x144));return _0x4bf45f;}export function requireMenu(_0x18c592,_0x199cc1){const _0x2e7666=a125_0x113ce9,_0x3ba9e1=_0x18c592[_0x2e7666(0x15e)][_0x2e7666(0x194)](_0x199cc1);if(!_0x3ba9e1)throw menuError(_0x2e7666(0x179),'Online\x20menu\x20not\x20found:\x20'+_0x199cc1,_0x2e7666(0x167));return _0x3ba9e1;}export function requireFolder(_0xad7595,_0x5104b7){const _0x2ab3fc=a125_0x113ce9,_0x1aecec=requireMenu(_0xad7595,_0x5104b7);if(_0x1aecec['type']!=='folder')throw menuError(_0x2ab3fc(0x157),'Menu\x20'+_0x5104b7+_0x2ab3fc(0x139)+(_0x1aecec[_0x2ab3fc(0x198)]||_0x2ab3fc(0x154))+_0x2ab3fc(0x170),_0x2ab3fc(0x176));return _0x1aecec;}export function assertExpectedState(_0x371ab1,_0xe273ac){const _0x2437c5=a125_0x113ce9;if(hasFlag(_0x371ab1,_0x2437c5(0x155))){const _0x3e7ef2=parseParentId(_0x371ab1,_0x2437c5(0x155),{'required':!![]});if(_0xe273ac[_0x2437c5(0x171)]!==_0x3e7ef2)throw stateDrift('Menu\x20'+_0xe273ac['id']+_0x2437c5(0x148)+formatParent(_0x3e7ef2)+_0x2437c5(0x17b)+formatParent(_0xe273ac[_0x2437c5(0x171)])+'.');}if(hasFlag(_0x371ab1,_0x2437c5(0x13a))){const _0x3908fc=_0x371ab1['str'](_0x2437c5(0x13a));if(_0xe273ac['path']!==_0x3908fc)throw stateDrift('Menu\x20'+_0xe273ac['id']+'\x20path\x20changed:\x20expected\x20'+JSON[_0x2437c5(0x13c)](_0x3908fc)+_0x2437c5(0x17b)+JSON[_0x2437c5(0x13c)](_0xe273ac['path'])+'.');}if(hasFlag(_0x371ab1,_0x2437c5(0x14e))){const _0x45820b=_0x371ab1[_0x2437c5(0x190)]('expected-children-count');if(!Number[_0x2437c5(0x145)](_0x45820b)||_0x45820b<0x0)throw CliErrors[_0x2437c5(0x13e)](_0x2437c5(0x173));if(_0xe273ac[_0x2437c5(0x134)]!==_0x45820b)throw stateDrift(_0x2437c5(0x169)+_0xe273ac['id']+_0x2437c5(0x16f)+_0x45820b+_0x2437c5(0x17b)+_0xe273ac[_0x2437c5(0x134)]+'.');}}export function assertVerified(_0x14843b,_0x392919,_0x33f9f7=a125_0x113ce9(0x18e)){const _0x5b9563=a125_0x113ce9;if(!_0x14843b)throw menuError(_0x5b9563(0x17c),_0x392919,_0x33f9f7);}export function mutationResult(_0x370cf4){const _0xff5459=a125_0x113ce9;return{'operation':_0x370cf4[_0xff5459(0x135)],'selector':_0x370cf4['selector'],'before':_0x370cf4['before'],'after':_0x370cf4['after'],'dryRun':_0x370cf4[_0xff5459(0x151)],'backend':_0x370cf4['backend'],..._0x370cf4[_0xff5459(0x136)]?{'plannedActions':_0x370cf4[_0xff5459(0x136)]}:{},..._0x370cf4[_0xff5459(0x13b)]?{'targets':_0x370cf4[_0xff5459(0x13b)]}:{},..._0x370cf4['deleteOrder']?{'deleteOrder':_0x370cf4[_0xff5459(0x146)]}:{},'snapshotHash':_0x370cf4[_0xff5459(0x156)],..._0x370cf4['cascade']?{'cascade':_0x370cf4[_0xff5459(0x158)]}:{},..._0x370cf4['planFile']?{'planFile':_0x370cf4[_0xff5459(0x195)]}:{},'succeeded':_0x370cf4[_0xff5459(0x140)]??[],'failed':_0x370cf4['failed']??[],'warnings':_0x370cf4[_0xff5459(0x177)]??[],'verification':_0x370cf4[_0xff5459(0x16d)],'error':_0x370cf4[_0xff5459(0x161)]};}function a125_0x1f7b(_0x32891c,_0x525c55){_0x32891c=_0x32891c-0x131;const _0x4ea65b=a125_0x4ea6();let _0x1f7bf4=_0x4ea65b[_0x32891c];return _0x1f7bf4;}export function menuDryRunResult(_0x1b3196,_0x127414){return{..._0x1b3196,..._0x127414};}export function menuFailure(_0x57e428,_0x5b5806,_0x1361fc){const _0x531f2e=a125_0x113ce9,_0x29324a=mutationResult({..._0x5b5806,'after':_0x1361fc[_0x531f2e(0x184)]===undefined?_0x5b5806[_0x531f2e(0x184)]:_0x1361fc[_0x531f2e(0x184)],'backend':_0x1361fc['backend']??_0x5b5806[_0x531f2e(0x172)],'dryRun':![],'succeeded':_0x1361fc[_0x531f2e(0x140)]??[],'failed':[{..._0x1361fc['failed']??{},'stage':_0x1361fc[_0x531f2e(0x186)],'code':_0x57e428[_0x531f2e(0x15b)],'message':_0x57e428[_0x531f2e(0x187)]}],'warnings':[..._0x5b5806[_0x531f2e(0x177)],..._0x1361fc[_0x531f2e(0x177)]??[]],'verification':_0x1361fc[_0x531f2e(0x16d)],'error':{'code':_0x57e428[_0x531f2e(0x15b)],'message':_0x57e428[_0x531f2e(0x187)],..._0x57e428[_0x531f2e(0x14c)]?{'hint':_0x57e428[_0x531f2e(0x14c)]}:{}}});return Object['defineProperty'](_0x57e428,_0x531f2e(0x168),{'value':_0x29324a,'enumerable':!![],'configurable':!![]}),_0x57e428;}export function asVerificationError(_0x511f4b,_0x14ada2){const _0x44c091=a125_0x113ce9;if(_0x511f4b instanceof CliError&&_0x511f4b[_0x44c091(0x15b)]===_0x44c091(0x17c))return _0x511f4b;const _0x4078e8=_0x511f4b instanceof Error?_0x511f4b[_0x44c091(0x187)]:String(_0x511f4b);return menuError(_0x44c091(0x17c),''+_0x14ada2+(_0x4078e8?':\x20'+_0x4078e8:''),_0x44c091(0x164));}export function describeMenuErrorCause(_0x4c2046,_0x209b85,_0x2c0d47){const _0x4e3ab6=a125_0x113ce9,_0x422cea=mapMenuApiError(_0x4c2046,_0x209b85,_0x2c0d47);return{'causeCode':_0x422cea[_0x4e3ab6(0x15b)],'causeMessage':_0x422cea[_0x4e3ab6(0x187)]};}export function hasFlag(_0x40e7fd,_0x59e690){const _0x56bda7=a125_0x113ce9;return Object[_0x56bda7(0x199)][_0x56bda7(0x14f)]['call'](_0x40e7fd[_0x56bda7(0x185)],_0x59e690)&&_0x40e7fd[_0x56bda7(0x185)][_0x59e690]!==undefined;}export function toApiParentId(_0x37a570){return _0x37a570??0x0;}export function formatParent(_0x45ff02){const _0x52dd71=a125_0x113ce9;return _0x45ff02==null?_0x52dd71(0x19b):String(_0x45ff02);}function a125_0x4ea6(){const _0x3f6ede=['string','error','menu_permission_denied','\x20menu\x20','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','bool','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','data','Menu\x20','number','hash','api_error','verification','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','\x20child\x20count\x20changed:\x20expected\x20','\x22,\x20not\x20folder.','parentId','backend','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','max','1288aRqTYq','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','warnings','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','menu_not_found','required',',\x20current\x20','menu_verification_failed','Online\x20menu\x20state\x20changed\x20before\x20','flagMissing','3xIpPXb','parent-id','str',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','menu_confirmation_required','after','rawFlags','stage','message','31270NcYNbr','Sibling\x20sort\x20value\x20(non-negative\x20integer)','526220oVMcDd','Cannot\x20append\x20a\x20','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','pre-write-recheck','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','num','265fhLnMS','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','get','planFile','appCode','1545500hNdTgr','type','prototype','cookie','root','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','menu_state_drift',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','recheck\x20online\x20menu\x20facts\x20before\x20','3304jvbXyF','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','childrenCount','operation','plannedActions','Failed\x20to\x20','length','\x20is\x20type\x20\x22','expect-path','targets','stringify','map','validation','test','succeeded','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','3432451RgaryT','menu_sort_invalid','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','isSafeInteger','deleteOrder','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','\x20parent\x20changed:\x20expected\x20','sort','Permission\x20denied\x20while\x20attempting\x20to\x20','read\x20online\x20menu\x20facts\x20before\x20','hint','12XyGcWx','expected-children-count','hasOwnProperty','menu_mutation_failed','dryRun','toLowerCase','1557tVPkBe','unknown','expect-parent-id','snapshotHash','menu_parent_not_folder','cascade','62514uOhNwA','554886yKixmH','code','menu_sort_overflow','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','byId','Exact\x20online\x20menu\x20id'];a125_0x4ea6=function(){return _0x3f6ede;};return a125_0x4ea6();}export function menuError(_0x526e5d,_0x2e6ae9,_0xe463e0){return new CliError(_0x526e5d,0x1,_0x2e6ae9,_0xe463e0);}export function mapMenuApiError(_0x5210f2,_0x57f919,_0x1735aa){const _0x24956a=a125_0x113ce9;if(_0x5210f2 instanceof CliError&&_0x5210f2[_0x24956a(0x15b)]!==_0x24956a(0x16c))return _0x5210f2;const _0x567ce0=_0x5210f2 instanceof Error?_0x5210f2[_0x24956a(0x187)]:String(_0x5210f2);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x24956a(0x13f)](_0x567ce0))return menuError(_0x24956a(0x162),_0x24956a(0x14a)+_0x57f919+(_0x1735aa?_0x24956a(0x163)+_0x1735aa:'')+'.',_0x24956a(0x18c));return menuError(_0x24956a(0x150),_0x24956a(0x137)+_0x57f919+(_0x1735aa?_0x24956a(0x163)+_0x1735aa:'')+':\x20'+_0x567ce0,'Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.');}export function isMenuResponseLoss(_0x21b9d5){const _0x296ccf=a125_0x113ce9,_0x341e66=_0x21b9d5 instanceof Error?_0x21b9d5['message']:String(_0x21b9d5);if(_0x21b9d5 instanceof CliError)return _0x21b9d5[_0x296ccf(0x15b)]===_0x296ccf(0x16c)&&/^Request (?:failed|timeout):/i[_0x296ccf(0x13f)](_0x341e66);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'](_0x341e66);}function stateDrift(_0x3fa9a6){const _0x299d09=a125_0x113ce9;return menuError(_0x299d09(0x19d),_0x3fa9a6,_0x299d09(0x141));}
|
|
1
|
+
function a125_0x4b54(){const _0x1c78db=['5qPsViQ','menu_mutation_failed','hash','menu_state_drift','num','code','cascade','required','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','443788lnVXEe','rawFlags','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','map','Reorder\x20sibling\x20menus\x20below\x20','8159355VCigec','menu_sort_invalid','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','appCode','error','prototype','hint','root','expect-path','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','message','max','Online\x20menu\x20not\x20found:\x20','Exact\x20online\x20menu\x20id','pre-write-recheck','\x20parent\x20changed:\x20expected\x20','length','\x20child\x20count\x20changed:\x20expected\x20','selector','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','menu_sort_overflow','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','Menu\x20','deleteOrder','Cannot\x20append\x20a\x20','hasOwnProperty','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','targets','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','\x20path\x20changed:\x20expected\x20','plannedActions','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','test','expect-parent-id','stringify','childrenCount',',\x20current\x20','bool','cookie','operation','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','data','type','isSafeInteger','menu_parent_not_folder','parent-id','258249AvNUnR','string','recheck\x20online\x20menu\x20facts\x20before\x20','parentId','toLowerCase','snapshotHash','Online\x20menu\x20state\x20changed\x20before\x20','menu_not_found','339480zbLEuE',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','Sibling\x20sort\x20value\x20(non-negative\x20integer)','\x20menu\x20','unknown','sort','10740haQDBi','path','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','6UOLOdL','verification','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','578476JjzBNn',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','validation','warnings','expected-children-count','menu_permission_denied','3913mRwnwI','succeeded','after','number','api_error','dry-run','failed','1333144ZiZjUO','call','yes','backend','get','str','menu_verification_failed','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','byId','read\x20online\x20menu\x20facts\x20before\x20'];a125_0x4b54=function(){return _0x1c78db;};return a125_0x4b54();}const a125_0x89a02c=a125_0x493c;(function(_0x5c1703,_0x49a564){const _0xb2a629=a125_0x493c,_0x16a01a=_0x5c1703();while(!![]){try{const _0x517ac0=parseInt(_0xb2a629(0xf5))/0x1+-parseInt(_0xb2a629(0xd1))/0x2*(-parseInt(_0xb2a629(0xbf))/0x3)+parseInt(_0xb2a629(0xd4))/0x4*(-parseInt(_0xb2a629(0xec))/0x5)+-parseInt(_0xb2a629(0xce))/0x6*(parseInt(_0xb2a629(0xda))/0x7)+parseInt(_0xb2a629(0xe1))/0x8+parseInt(_0xb2a629(0xfa))/0x9+-parseInt(_0xb2a629(0xc7))/0xa;if(_0x517ac0===_0x49a564)break;else _0x16a01a['push'](_0x16a01a['shift']());}catch(_0x4500ba){_0x16a01a['push'](_0x16a01a['shift']());}}}(a125_0x4b54,0x91882));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':a125_0x89a02c(0xdd),'required':!![],'description':a125_0x89a02c(0x9e)};export const MENU_SORT_FLAG={'name':a125_0x89a02c(0xcd),'type':a125_0x89a02c(0xdd),'description':a125_0x89a02c(0xca)};export const MENU_PARENT_ID_FLAG={'name':a125_0x89a02c(0xbe),'type':a125_0x89a02c(0xc0),'description':a125_0x89a02c(0x103)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a125_0x89a02c(0xb2),'type':'string','description':a125_0x89a02c(0xc9)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':'expect-path','type':a125_0x89a02c(0xc0),'description':a125_0x89a02c(0xe8)},{'name':a125_0x89a02c(0xd8),'type':a125_0x89a02c(0xdd),'description':a125_0x89a02c(0xe9)}];export function validateExactId(_0x2e4acf){const _0x19bd8f=a125_0x89a02c,_0x2be4b3=_0x2e4acf[_0x19bd8f(0xf0)]('id');if(!Number[_0x19bd8f(0xbc)](_0x2be4b3)||_0x2be4b3<=0x0)throw CliErrors[_0x19bd8f(0xd6)](_0x19bd8f(0xa6));return _0x2be4b3;}export function validateSort(_0x1e61c5,_0x33915f=a125_0x89a02c(0xcd)){const _0x151782=a125_0x89a02c;if(!hasFlag(_0x1e61c5,_0x33915f))return undefined;const _0x7e4be3=_0x1e61c5[_0x151782(0xf0)](_0x33915f);if(!Number[_0x151782(0xbc)](_0x7e4be3)||_0x7e4be3<0x0||_0x7e4be3>MAX_MENU_SORT)throw menuError(_0x151782(0xfb),'--'+_0x33915f+_0x151782(0xad)+MAX_MENU_SORT+'.','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.');return _0x7e4be3;}export function nextSiblingSort(_0x1727a0,_0x1cfc32,_0x152482){const _0xac3923=a125_0x89a02c,_0x4ddf6b=getChildren(_0x1727a0,_0x1cfc32)[_0xac3923(0xf8)](_0x78b3a=>_0x78b3a[_0xac3923(0xcd)])['filter'](_0x339a97=>typeof _0x339a97==='number');if(_0x4ddf6b[_0xac3923(0xa1)]===0x0)return 0x0;const _0x4b180e=Math[_0xac3923(0x9c)](..._0x4ddf6b);if(_0x4b180e>=MAX_MENU_SORT)throw menuError(_0xac3923(0xa5),_0xac3923(0xa9)+_0x152482+_0xac3923(0xf4)+_0x4b180e+'.',_0xac3923(0xf9)+MAX_MENU_SORT+_0xac3923(0xc8));return _0x4b180e+0x1;}export function requireExplicitYes(_0x214d22){const _0x1fb8b1=a125_0x89a02c;if(_0x214d22[_0x1fb8b1(0xb6)](_0x1fb8b1(0xdf)))return;if(!_0x214d22[_0x1fb8b1(0xb6)](_0x1fb8b1(0xe3)))throw menuError('menu_confirmation_required',_0x1fb8b1(0xf7),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0x5417d4,_0x9b5782,_0x42b0bc){const _0x20a285=a125_0x89a02c;try{return await fetchMenuSnapshot(_0x5417d4[_0x20a285(0xfd)],_0x5417d4['cookie']);}catch(_0x1c5948){throw mapMenuApiError(_0x1c5948,_0x20a285(0xeb)+_0x9b5782,_0x42b0bc);}}export async function recheckMutationSnapshot(_0x386cf2,_0x376b96,_0x16a45d,_0x2c10b4){const _0x38e663=a125_0x89a02c;let _0x559b68;try{_0x559b68=await fetchMenuSnapshot(_0x386cf2[_0x38e663(0xfd)],_0x386cf2[_0x38e663(0xb7)]);}catch(_0x452495){const _0xa76795=mapMenuApiError(_0x452495,_0x38e663(0xc1)+_0x16a45d,_0x2c10b4);throw menuFailure(_0xa76795,_0x376b96,{'stage':_0x38e663(0x9f),'failed':_0x2c10b4==null?{}:{'id':_0x2c10b4}});}if(_0x559b68[_0x38e663(0xee)]!==_0x376b96[_0x38e663(0xc4)]){const _0x443df7=menuError(_0x38e663(0xef),_0x38e663(0xc5)+_0x16a45d+_0x38e663(0xd5),_0x38e663(0xab));throw menuFailure(_0x443df7,_0x376b96,{'stage':_0x38e663(0x9f),'failed':{..._0x2c10b4==null?{}:{'id':_0x2c10b4},'expectedSnapshotHash':_0x376b96['snapshotHash'],'currentSnapshotHash':_0x559b68[_0x38e663(0xee)]}});}return _0x559b68;}export function parseParentId(_0x40aa9a,_0xb0f656,_0x3f3889={}){const _0x11468e=a125_0x89a02c;if(!hasFlag(_0x40aa9a,_0xb0f656)){if(_0x3f3889[_0x11468e(0xf3)])throw CliErrors['flagMissing'](_0xb0f656);return undefined;}const _0x47ca6c=_0x40aa9a[_0x11468e(0xe6)](_0xb0f656)['trim']();if(_0x47ca6c[_0x11468e(0xc3)]()===_0x11468e(0x101))return null;if(!/^\d+$/[_0x11468e(0xb1)](_0x47ca6c))throw CliErrors[_0x11468e(0xd6)]('--'+_0xb0f656+_0x11468e(0xa4));const _0x283c6b=Number(_0x47ca6c);if(!Number[_0x11468e(0xbc)](_0x283c6b)||_0x283c6b<=0x0)throw CliErrors[_0x11468e(0xd6)]('--'+_0xb0f656+_0x11468e(0xa4));return _0x283c6b;}export function requireMenu(_0xd08e8d,_0x211db){const _0x5d5a50=a125_0x89a02c,_0x3bc5b0=_0xd08e8d[_0x5d5a50(0xea)][_0x5d5a50(0xe5)](_0x211db);if(!_0x3bc5b0)throw menuError(_0x5d5a50(0xc6),_0x5d5a50(0x9d)+_0x211db,_0x5d5a50(0xfc));return _0x3bc5b0;}export function requireFolder(_0x3b5d7e,_0xd8cdd5){const _0x556904=a125_0x89a02c,_0x12221a=requireMenu(_0x3b5d7e,_0xd8cdd5);if(_0x12221a[_0x556904(0xbb)]!=='folder')throw menuError(_0x556904(0xbd),_0x556904(0xa7)+_0xd8cdd5+'\x20is\x20type\x20\x22'+(_0x12221a[_0x556904(0xbb)]||_0x556904(0xcc))+'\x22,\x20not\x20folder.',_0x556904(0xb9));return _0x12221a;}export function assertExpectedState(_0x2d4aff,_0x1507fd){const _0x5b47dd=a125_0x89a02c;if(hasFlag(_0x2d4aff,_0x5b47dd(0xb2))){const _0x233d95=parseParentId(_0x2d4aff,_0x5b47dd(0xb2),{'required':!![]});if(_0x1507fd[_0x5b47dd(0xc2)]!==_0x233d95)throw stateDrift(_0x5b47dd(0xa7)+_0x1507fd['id']+_0x5b47dd(0xa0)+formatParent(_0x233d95)+',\x20current\x20'+formatParent(_0x1507fd[_0x5b47dd(0xc2)])+'.');}if(hasFlag(_0x2d4aff,_0x5b47dd(0x102))){const _0x2d9031=_0x2d4aff[_0x5b47dd(0xe6)](_0x5b47dd(0x102));if(_0x1507fd[_0x5b47dd(0xcf)]!==_0x2d9031)throw stateDrift(_0x5b47dd(0xa7)+_0x1507fd['id']+_0x5b47dd(0xae)+JSON[_0x5b47dd(0xb3)](_0x2d9031)+_0x5b47dd(0xb5)+JSON['stringify'](_0x1507fd['path'])+'.');}if(hasFlag(_0x2d4aff,_0x5b47dd(0xd8))){const _0x322af8=_0x2d4aff['num'](_0x5b47dd(0xd8));if(!Number[_0x5b47dd(0xbc)](_0x322af8)||_0x322af8<0x0)throw CliErrors['validation'](_0x5b47dd(0xd0));if(_0x1507fd[_0x5b47dd(0xb4)]!==_0x322af8)throw stateDrift(_0x5b47dd(0xa7)+_0x1507fd['id']+_0x5b47dd(0xa2)+_0x322af8+_0x5b47dd(0xb5)+_0x1507fd[_0x5b47dd(0xb4)]+'.');}}export function assertVerified(_0x21f853,_0x424ae5,_0x18febc='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){const _0x23841d=a125_0x89a02c;if(!_0x21f853)throw menuError(_0x23841d(0xe7),_0x424ae5,_0x18febc);}export function mutationResult(_0x1111c2){const _0x3b18da=a125_0x89a02c;return{'operation':_0x1111c2[_0x3b18da(0xb8)],'selector':_0x1111c2[_0x3b18da(0xa3)],'before':_0x1111c2['before'],'after':_0x1111c2['after'],'dryRun':_0x1111c2['dryRun'],'backend':_0x1111c2[_0x3b18da(0xe4)],..._0x1111c2[_0x3b18da(0xaf)]?{'plannedActions':_0x1111c2[_0x3b18da(0xaf)]}:{},..._0x1111c2[_0x3b18da(0xac)]?{'targets':_0x1111c2[_0x3b18da(0xac)]}:{},..._0x1111c2[_0x3b18da(0xa8)]?{'deleteOrder':_0x1111c2['deleteOrder']}:{},'snapshotHash':_0x1111c2[_0x3b18da(0xc4)],..._0x1111c2[_0x3b18da(0xf2)]?{'cascade':_0x1111c2[_0x3b18da(0xf2)]}:{},..._0x1111c2['planFile']?{'planFile':_0x1111c2['planFile']}:{},'succeeded':_0x1111c2['succeeded']??[],'failed':_0x1111c2[_0x3b18da(0xe0)]??[],'warnings':_0x1111c2[_0x3b18da(0xd7)]??[],'verification':_0x1111c2[_0x3b18da(0xd2)],'error':_0x1111c2[_0x3b18da(0xfe)]};}export function menuDryRunResult(_0x94d81c,_0xb0b381){return{..._0x94d81c,..._0xb0b381};}export function menuFailure(_0x4c4863,_0xe23a2,_0x3991f7){const _0x48332d=a125_0x89a02c,_0x2f7846=mutationResult({..._0xe23a2,'after':_0x3991f7['after']===undefined?_0xe23a2[_0x48332d(0xdc)]:_0x3991f7[_0x48332d(0xdc)],'backend':_0x3991f7[_0x48332d(0xe4)]??_0xe23a2[_0x48332d(0xe4)],'dryRun':![],'succeeded':_0x3991f7[_0x48332d(0xdb)]??[],'failed':[{..._0x3991f7[_0x48332d(0xe0)]??{},'stage':_0x3991f7['stage'],'code':_0x4c4863[_0x48332d(0xf1)],'message':_0x4c4863[_0x48332d(0x9b)]}],'warnings':[..._0xe23a2[_0x48332d(0xd7)],..._0x3991f7['warnings']??[]],'verification':_0x3991f7[_0x48332d(0xd2)],'error':{'code':_0x4c4863[_0x48332d(0xf1)],'message':_0x4c4863[_0x48332d(0x9b)],..._0x4c4863[_0x48332d(0x100)]?{'hint':_0x4c4863[_0x48332d(0x100)]}:{}}});return Object['defineProperty'](_0x4c4863,_0x48332d(0xba),{'value':_0x2f7846,'enumerable':!![],'configurable':!![]}),_0x4c4863;}export function asVerificationError(_0xbeff96,_0x197e27){const _0x256d8a=a125_0x89a02c;if(_0xbeff96 instanceof CliError&&_0xbeff96[_0x256d8a(0xf1)]==='menu_verification_failed')return _0xbeff96;const _0x352012=_0xbeff96 instanceof Error?_0xbeff96[_0x256d8a(0x9b)]:String(_0xbeff96);return menuError(_0x256d8a(0xe7),''+_0x197e27+(_0x352012?':\x20'+_0x352012:''),_0x256d8a(0xb0));}export function describeMenuErrorCause(_0x77d706,_0x4206f5,_0x163fb3){const _0x3bfe75=a125_0x89a02c,_0x39bcee=mapMenuApiError(_0x77d706,_0x4206f5,_0x163fb3);return{'causeCode':_0x39bcee[_0x3bfe75(0xf1)],'causeMessage':_0x39bcee[_0x3bfe75(0x9b)]};}export function hasFlag(_0x423311,_0x37e9e1){const _0x4bfb33=a125_0x89a02c;return Object[_0x4bfb33(0xff)][_0x4bfb33(0xaa)][_0x4bfb33(0xe2)](_0x423311[_0x4bfb33(0xf6)],_0x37e9e1)&&_0x423311[_0x4bfb33(0xf6)][_0x37e9e1]!==undefined;}export function toApiParentId(_0xb7d35c){return _0xb7d35c??0x0;}export function formatParent(_0x3b68e1){return _0x3b68e1==null?'root':String(_0x3b68e1);}export function menuError(_0x3f5b8a,_0x413edc,_0x46610c){return new CliError(_0x3f5b8a,0x1,_0x413edc,_0x46610c);}function a125_0x493c(_0x5cadcb,_0x5d9d64){_0x5cadcb=_0x5cadcb-0x9b;const _0x4b5474=a125_0x4b54();let _0x493c33=_0x4b5474[_0x5cadcb];return _0x493c33;}export function mapMenuApiError(_0x315b5f,_0x5b2686,_0x475dd0){const _0x3ce3ac=a125_0x89a02c;if(_0x315b5f instanceof CliError&&_0x315b5f['code']!==_0x3ce3ac(0xde))return _0x315b5f;const _0x5d9efd=_0x315b5f instanceof Error?_0x315b5f['message']:String(_0x315b5f);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x3ce3ac(0xb1)](_0x5d9efd))return menuError(_0x3ce3ac(0xd9),'Permission\x20denied\x20while\x20attempting\x20to\x20'+_0x5b2686+(_0x475dd0?_0x3ce3ac(0xcb)+_0x475dd0:'')+'.',_0x3ce3ac(0xd3));return menuError(_0x3ce3ac(0xed),'Failed\x20to\x20'+_0x5b2686+(_0x475dd0?_0x3ce3ac(0xcb)+_0x475dd0:'')+':\x20'+_0x5d9efd,'Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.');}export function isMenuResponseLoss(_0x468135){const _0x3c78e5=a125_0x89a02c,_0x48435f=_0x468135 instanceof Error?_0x468135[_0x3c78e5(0x9b)]:String(_0x468135);if(_0x468135 instanceof CliError)return _0x468135[_0x3c78e5(0xf1)]==='api_error'&&/^Request (?:failed|timeout):/i[_0x3c78e5(0xb1)](_0x48435f);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x3c78e5(0xb1)](_0x48435f);}function stateDrift(_0x3aa183){const _0x48926f=a125_0x89a02c;return menuError(_0x48926f(0xef),_0x3aa183,'Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x13a6d3,_0x128b22){const _0x35a49a=a126_0x2654,_0x585ef6=_0x13a6d3();while(!![]){try{const _0x566fc3=-parseInt(_0x35a49a(0x123))/0x1*(-parseInt(_0x35a49a(0x146))/0x2)+-parseInt(_0x35a49a(0x12f))/0x3*(-parseInt(_0x35a49a(0x141))/0x4)+parseInt(_0x35a49a(0x139))/0x5*(-parseInt(_0x35a49a(0x128))/0x6)+parseInt(_0x35a49a(0x142))/0x7*(parseInt(_0x35a49a(0x140))/0x8)+-parseInt(_0x35a49a(0x130))/0x9*(-parseInt(_0x35a49a(0x138))/0xa)+-parseInt(_0x35a49a(0x12d))/0xb+-parseInt(_0x35a49a(0x148))/0xc*(parseInt(_0x35a49a(0x14b))/0xd);if(_0x566fc3===_0x128b22)break;else _0x585ef6['push'](_0x585ef6['shift']());}catch(_0x1b93f4){_0x585ef6['push'](_0x585ef6['shift']());}}}(a126_0x3fb4,0x48415));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 a126_0x3961a2,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x2beca5,_0x3e3480){const _0x1ed7f1=a126_0x2654,_0x40346f=getEnv();logger['info'](_0x1ed7f1(0x126),isProduction(_0x40346f)?'Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'+_0x2beca5+')':_0x1ed7f1(0x144)+_0x2beca5+')');const _0x5debc7=await fetchMenuSnapshot(_0x2beca5,_0x3e3480,{'verbose':!![]});return logger[_0x1ed7f1(0x145)]('get-online-menu-list',_0x1ed7f1(0x14c)+_0x5debc7[_0x1ed7f1(0x137)]+'\x20online\x20menus\x20successfully'),_0x5debc7[_0x1ed7f1(0x12a)]['map'](toProcessedMenuItem);}function a126_0x3fb4(){const _0x369a50=['menus','procode','map','4468926ANqinO','label','177PlVona','1710558bFzDUv','loadScriptMode','\x20menu\x20group(s)','Creating\x20menu:\x20','update-menu-cdn-url','Create\x20menu\x20\x22','create-menus','total','30lXgayM','1633895vLHbET','Delete\x20','length','Update\x20menu\x20','\x20menu','extend','Menu\x20created\x20successfully:\x20','2007688QUrXyn','20572npZiJT','14xZufDf','create-menu','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','info','2aSNEPG','Start\x20batch\x20menu\x20creation,\x20total\x20','120QGRxGL','resources','Batch\x20menu\x20creation\x20completed,\x20total\x20','928811ZgeWrz','Fetched\x20','stringify','367927spZfZq','import','Menu\x20assets\x20synced:\x20','get-online-menu-list','Update\x20menu\x20assets\x20\x22','6YqrhKy','path'];a126_0x3fb4=function(){return _0x369a50;};return a126_0x3fb4();}export async function createMenu(_0x23202e,_0x4e8243,_0x13ee7a){const _0x19ab6c=a126_0x2654;logger[_0x19ab6c(0x145)](_0x19ab6c(0x143),_0x19ab6c(0x133)+_0x13ee7a[_0x19ab6c(0x12e)]+'\x20('+_0x13ee7a[_0x19ab6c(0x129)]+')');const _0x290446={'appCode':_0x23202e,'type':_0x19ab6c(0x12b),'sort':0x0,'extend':{'loadScriptMode':_0x19ab6c(0x124),'resources':_0x13ee7a[_0x19ab6c(0x149)]?JSON[_0x19ab6c(0x122)](_0x13ee7a['resources']):undefined},..._0x13ee7a},_0x3c2499=await createMenuRecord(_0x290446,_0x4e8243,_0x19ab6c(0x135)+_0x13ee7a[_0x19ab6c(0x12e)]+'\x22');return logger[_0x19ab6c(0x145)](_0x19ab6c(0x143),'Menu\x20created\x20successfully:\x20'+_0x13ee7a[_0x19ab6c(0x12e)]),_0x3c2499;}async function createSingleMenu(_0x2c1883,_0x4a9866,_0x80b886,_0x28c00e){const _0x4ff5ca=a126_0x2654,_0x3cac32={'appCode':_0x2c1883,'type':_0x4ff5ca(0x12b),'sort':0x0,'extend':{'loadScriptMode':_0x4ff5ca(0x124),'resources':_0x28c00e?JSON[_0x4ff5ca(0x122)](_0x28c00e):undefined},'label':_0x80b886['label'],'path':_0x80b886[_0x4ff5ca(0x129)]},_0xd068fe=await createMenuRecord(_0x3cac32,_0x4a9866,_0x4ff5ca(0x135)+_0x80b886['label']+'\x22');return logger['info'](_0x4ff5ca(0x143),_0x4ff5ca(0x13f)+_0x80b886['label']),_0xd068fe;}export async function createMenus(_0x4f098d,_0x1f09a0,_0x101562,_0x202756){const _0x3610d3=a126_0x2654;logger[_0x3610d3(0x145)]('create-menus',_0x3610d3(0x147)+_0x101562['length']);const _0x1e6a84=await Promise['all'](_0x101562[_0x3610d3(0x12c)](_0x39ede9=>createSingleMenu(_0x4f098d,_0x1f09a0,_0x39ede9,_0x202756)));return logger['info'](_0x3610d3(0x136),_0x3610d3(0x14a)+_0x101562[_0x3610d3(0x13b)]),_0x1e6a84;}export async function updateMenuCdnUrl(_0x5c7e3c,_0x5750ac,_0x480b44){const _0x2f0254=a126_0x2654;logger['info'](_0x2f0254(0x134),'Updating\x20menu\x20asset\x20links:\x20'+_0x480b44[_0x2f0254(0x12e)]+'\x20('+_0x480b44[_0x2f0254(0x129)]+')');const _0x3e2b14={'id':_0x480b44['id'],'appCode':_0x5c7e3c,'extend':{..._0x480b44[_0x2f0254(0x13e)]??{},..._0x480b44[_0x2f0254(0x131)]?{'loadScriptMode':_0x480b44[_0x2f0254(0x131)]}:{},'resources':_0x480b44[_0x2f0254(0x149)]?JSON['stringify'](_0x480b44[_0x2f0254(0x149)]):undefined}},_0x10b9a6=await updateMenuRecord(_0x3e2b14,_0x5750ac,_0x2f0254(0x127)+_0x480b44[_0x2f0254(0x12e)]+'\x22');return logger[_0x2f0254(0x145)](_0x2f0254(0x134),_0x2f0254(0x125)+_0x480b44[_0x2f0254(0x12e)],undefined),_0x10b9a6;}export async function createMenuEntity(_0x35f79c,_0x3fa7bb,_0x33c215){const _0x1d62c5=a126_0x2654;return createMenuRecord({'appCode':_0x35f79c,..._0x33c215},_0x3fa7bb,_0x1d62c5(0x135)+_0x33c215['label']+'\x22');}export async function updateMenuEntity(_0x50c560,_0x1c4c1f,_0x297a9a){const _0x52bd5c=a126_0x2654;return updateMenuRecord({'appCode':_0x50c560,..._0x297a9a},_0x1c4c1f,_0x52bd5c(0x13c)+_0x297a9a['id']);}function a126_0x2654(_0x5c6bba,_0x12520f){_0x5c6bba=_0x5c6bba-0x122;const _0x3fb438=a126_0x3fb4();let _0x2654bc=_0x3fb438[_0x5c6bba];return _0x2654bc;}export async function batchDeleteMenuEntities(_0x3e1a28,_0x5eda7f){const _0xa2089a=a126_0x2654;return batchDeleteMenuRecords(_0x5eda7f,_0x3e1a28,_0xa2089a(0x13a)+_0x5eda7f['length']+_0xa2089a(0x13d)+(_0x5eda7f[_0xa2089a(0x13b)]===0x1?'':'s'));}export async function startMenuRegroup(_0x44c793,_0x1c6266){const _0x605bd2=a126_0x2654;return a126_0x3961a2(_0x1c6266,_0x44c793,'Regroup\x20'+_0x1c6266['menuGroups'][_0x605bd2(0x13b)]+_0x605bd2(0x132));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x19d660=a127_0x338d;(function(_0x1d2cc0,_0x5e3de0){const _0x294526=a127_0x338d,_0x383ecb=_0x1d2cc0();while(!![]){try{const _0x3e7100=-parseInt(_0x294526(0x13b))/0x1*(-parseInt(_0x294526(0x148))/0x2)+parseInt(_0x294526(0x12d))/0x3*(parseInt(_0x294526(0x137))/0x4)+parseInt(_0x294526(0x143))/0x5+-parseInt(_0x294526(0x135))/0x6*(parseInt(_0x294526(0x14b))/0x7)+parseInt(_0x294526(0x142))/0x8+-parseInt(_0x294526(0x12e))/0x9+-parseInt(_0x294526(0x128))/0xa*(parseInt(_0x294526(0x13f))/0xb);if(_0x3e7100===_0x5e3de0)break;else _0x383ecb['push'](_0x383ecb['shift']());}catch(_0xd8f1e0){_0x383ecb['push'](_0x383ecb['shift']());}}}(a127_0xc94f,0x6f516));function a127_0x338d(_0x36fe5,_0x46b841){_0x36fe5=_0x36fe5-0x123;const _0xc94f28=a127_0xc94f();let _0x338d8d=_0xc94f28[_0x36fe5];return _0x338d8d;}import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function a127_0xc94f(){const _0x3c1fc4=['20BbKEpJ','setLogPath','object','path','JS\x20URL\x20is\x20unreachable:\x20','9ObwLcT','3845421cJBqJW','keys','filter','cssUrl','--params.','join','dryRun','42546zTCiGY','\x0a\x20\x20Available\x20local\x20paths:\x20','952708rrSAey','string','push','Invalid\x20--params:\x20','1511abpPQm','Menu\x20sync\x20completed','field','info','9438781phHKZT','trim','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','5198960mqLpFP','3456825EuufcO','cwd','Invalid\x20--params.','label','No\x20local\x20pages\x20matched\x20paths:\x20','804GZZWaF','procode','get','63chYYvS','import','jsUrl','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','Invalid\x20--params\x20fields:\x20','message','length','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','has','map','Invalid\x20--params\x20JSON.','isArray'];a127_0xc94f=function(){return _0x3c1fc4;};return a127_0xc94f();}const MENU_SYNC_PARAM_KEYS=new Set([a127_0x19d660(0x14d),a127_0x19d660(0x131)]);function validateParams(_0x280d3f){const _0x4aac76=a127_0x19d660,_0xce8319=[];return _0x280d3f[_0x4aac76(0x14d)]&&!isValidJsHttpsUrl(_0x280d3f[_0x4aac76(0x14d)])&&_0xce8319[_0x4aac76(0x139)]({'field':_0x4aac76(0x14d),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x280d3f[_0x4aac76(0x131)]&&!isValidCssHttpsUrl(_0x280d3f[_0x4aac76(0x131)])&&_0xce8319[_0x4aac76(0x139)]({'field':_0x4aac76(0x131),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0xce8319;}export async function runMenuSyncCore(_0x18b2da,_0x4452d,_0x5477d1=[],_0x25c800,_0xa95e1e={}){const _0x49ff14=a127_0x19d660,_0x347cc7=parseMenuSyncParams(_0x25c800),_0x247a5b=[...new Set(_0x5477d1[_0x49ff14(0x125)](_0x597904=>_0x597904['trim']())[_0x49ff14(0x130)](Boolean))],_0x3fde63=_0x347cc7[_0x49ff14(0x14d)],_0x4903a4=_0x347cc7[_0x49ff14(0x131)],_0x37f9d7=[];if(_0x3fde63)_0x37f9d7[_0x49ff14(0x139)](_0x3fde63);if(_0x4903a4)_0x37f9d7[_0x49ff14(0x139)](_0x4903a4);const _0x5a768b=validateParams(_0x347cc7);if(_0x5a768b['length']>0x0){const _0x52dcc9=_0x5a768b[_0x49ff14(0x125)](_0x4cd41e=>_0x49ff14(0x132)+_0x4cd41e[_0x49ff14(0x13d)]+':\x20'+_0x4cd41e[_0x49ff14(0x150)])[_0x49ff14(0x133)](';\x20');throw new Error(_0x49ff14(0x13a)+_0x52dcc9);}logger[_0x49ff14(0x129)](process[_0x49ff14(0x144)]()),logger[_0x49ff14(0x13e)]('menu-sync','Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x18b2da,'selectedCount':_0x247a5b[_0x49ff14(0x151)],'jsUrl':_0x3fde63,'cssUrl':_0x4903a4});if(_0x3fde63){const _0x4b32fe=await isUrlReachable(_0x3fde63);if(!_0x4b32fe)throw new Error(_0x49ff14(0x12c)+_0x3fde63);}if(_0x4903a4){const _0x53a075=await isUrlReachable(_0x4903a4);if(!_0x53a075)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x4903a4);}const _0x46ebc7=getLocalPages();if(_0x46ebc7[_0x49ff14(0x151)]===0x0){if(_0x247a5b[_0x49ff14(0x151)]>0x0)throw new Error(_0x49ff14(0x147)+_0x247a5b[_0x49ff14(0x133)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0xa95e1e['dryRun']===!![],'targetPages':[],'plannedMenus':[]};}const _0x5bc8a3=await getOnlineMenuList(_0x18b2da,_0x4452d),_0x2a215b=new Set(_0x5bc8a3[_0x49ff14(0x125)](_0x396be1=>_0x396be1[_0x49ff14(0x12b)]));let _0x2dd1aa;if(_0x247a5b[_0x49ff14(0x151)]>0x0){const _0x45793b=new Map(_0x46ebc7[_0x49ff14(0x125)](_0x3d757d=>[_0x3d757d['path'],_0x3d757d])),_0xf5390b=_0x247a5b['filter'](_0x5eb298=>!_0x45793b['has'](_0x5eb298));if(_0xf5390b['length']>0x0){const _0x260a5b=_0x46ebc7[_0x49ff14(0x125)](_0x4384e2=>_0x4384e2['path'])['join'](',\x20');throw new Error(_0x49ff14(0x147)+_0xf5390b[_0x49ff14(0x133)](',\x20')+_0x49ff14(0x136)+_0x260a5b);}const _0x216430=_0x247a5b[_0x49ff14(0x130)](_0x1f48f3=>_0x2a215b[_0x49ff14(0x124)](_0x1f48f3));if(_0x216430[_0x49ff14(0x151)]>0x0)throw new Error(_0x49ff14(0x141)+_0x216430['join'](',\x20'));_0x2dd1aa=_0x247a5b['map'](_0x687098=>_0x45793b[_0x49ff14(0x14a)](_0x687098));}else _0x2dd1aa=_0x46ebc7['filter'](_0x574a6f=>!_0x2a215b[_0x49ff14(0x124)](_0x574a6f['path']));if(_0x2dd1aa[_0x49ff14(0x151)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0xa95e1e['dryRun']===!![],'targetPages':[],'plannedMenus':[]};const _0xecc97b=_0x2dd1aa['map'](_0x390b83=>({'type':_0x49ff14(0x149),'path':_0x390b83[_0x49ff14(0x12b)],'label':_0x390b83[_0x49ff14(0x146)],'loadScriptMode':_0x49ff14(0x14c),'resources':[..._0x37f9d7]}));if(_0xa95e1e[_0x49ff14(0x134)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x2dd1aa,'plannedMenus':_0xecc97b};const _0xf358c6=await createMenus(_0x18b2da,_0x4452d,_0x2dd1aa,_0x37f9d7['length']>0x0?_0x37f9d7:undefined);return logger[_0x49ff14(0x13e)]('menu-sync',_0x49ff14(0x13c),{'count':_0x2dd1aa[_0x49ff14(0x151)],'resources':_0x37f9d7}),{'created':_0xf358c6['length'],'skipped':![],'dryRun':![],'targetPages':_0x2dd1aa,'plannedMenus':_0xecc97b,'menus':_0xf358c6};}export function parseMenuSyncParams(_0x46a9eb){const _0x823c23=a127_0x19d660;if(!_0x46a9eb||typeof _0x46a9eb!==_0x823c23(0x138))return{};let _0x448191;try{_0x448191=JSON['parse'](_0x46a9eb);}catch{throw new Error(_0x823c23(0x126));}if(typeof _0x448191!==_0x823c23(0x12a)||_0x448191===null||Array[_0x823c23(0x127)](_0x448191))throw new Error(_0x823c23(0x14e));const _0x44e856=_0x448191;if(Object['hasOwn'](_0x44e856,'pages'))throw new Error(_0x823c23(0x123));const _0x320246=Object[_0x823c23(0x12f)](_0x44e856)[_0x823c23(0x130)](_0x2b72a7=>!MENU_SYNC_PARAM_KEYS[_0x823c23(0x124)](_0x2b72a7));if(_0x320246[_0x823c23(0x151)]>0x0)throw new Error(_0x823c23(0x14f)+_0x320246['join'](',\x20')+'.');for(const _0x5a4cef of MENU_SYNC_PARAM_KEYS){const _0x1c0005=_0x44e856[_0x5a4cef];if(_0x1c0005!==undefined&&(typeof _0x1c0005!==_0x823c23(0x138)||_0x1c0005[_0x823c23(0x140)]()===''))throw new Error(_0x823c23(0x145)+_0x5a4cef+':\x20expected\x20a\x20non-empty\x20string.');}return{'jsUrl':typeof _0x44e856[_0x823c23(0x14d)]===_0x823c23(0x138)?_0x44e856['jsUrl'][_0x823c23(0x140)]():undefined,'cssUrl':typeof _0x44e856[_0x823c23(0x131)]===_0x823c23(0x138)?_0x44e856['cssUrl'][_0x823c23(0x140)]():undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3e421b,_0xa2c687){const _0x4e3414=a129_0x1e13,_0x5a0bbb=_0x3e421b();while(!![]){try{const _0x270056=parseInt(_0x4e3414(0x99))/0x1*(-parseInt(_0x4e3414(0x96))/0x2)+parseInt(_0x4e3414(0x70))/0x3+-parseInt(_0x4e3414(0xa7))/0x4*(parseInt(_0x4e3414(0x93))/0x5)+parseInt(_0x4e3414(0x84))/0x6*(-parseInt(_0x4e3414(0xaf))/0x7)+parseInt(_0x4e3414(0x9f))/0x8+-parseInt(_0x4e3414(0xa8))/0x9*(-parseInt(_0x4e3414(0x97))/0xa)+-parseInt(_0x4e3414(0xa3))/0xb*(parseInt(_0x4e3414(0x71))/0xc);if(_0x270056===_0xa2c687)break;else _0x5a0bbb['push'](_0x5a0bbb['shift']());}catch(_0x49fd52){_0x5a0bbb['push'](_0x5a0bbb['shift']());}}}(a129_0x5e62,0x28702));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x872892){const _0x511fe9=a129_0x1e13,_0x19d40a=[];return _0x872892[_0x511fe9(0x94)]&&!isValidJsHttpsUrl(_0x872892[_0x511fe9(0x94)])&&_0x19d40a[_0x511fe9(0x86)]({'field':'jsUrl','message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x872892[_0x511fe9(0xa1)]&&!isValidCssHttpsUrl(_0x872892[_0x511fe9(0xa1)])&&_0x19d40a[_0x511fe9(0x86)]({'field':_0x511fe9(0xa1),'message':_0x511fe9(0xad)}),_0x19d40a;}export async function runMenuUpdateCore(_0x2e2086,_0x510693,_0x3c0dd8,_0x4db005={}){const _0x560403=a129_0x1e13,_0x36bc58=parseUpdateParamsFlag(_0x3c0dd8),_0x24c146=normalizeMode(_0x4db005['mode']);validateSelection(_0x4db005[_0x560403(0x80)]);const _0x37cd8e=[];if(_0x36bc58[_0x560403(0x94)])_0x37cd8e[_0x560403(0x86)](_0x36bc58[_0x560403(0x94)]);if(_0x36bc58[_0x560403(0xa1)])_0x37cd8e[_0x560403(0x86)](_0x36bc58[_0x560403(0xa1)]);const _0x455eb4=validateParams(_0x36bc58);if(_0x455eb4[_0x560403(0x6c)]>0x0){const _0xf4566d=_0x455eb4['map'](_0x4d712b=>_0x560403(0x74)+_0x4d712b['field']+':\x20'+_0x4d712b['message'])['join'](';\x20');throw new Error('Invalid\x20--params:\x20'+_0xf4566d);}if(_0x37cd8e[_0x560403(0x6c)]===0x0)throw new Error(_0x560403(0x8d)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x560403(0x87)](process[_0x560403(0x8a)]()),logger[_0x560403(0x75)](_0x560403(0xa0),'Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x2e2086,'jsUrl':_0x36bc58[_0x560403(0x94)],'cssUrl':_0x36bc58[_0x560403(0xa1)],'mode':_0x24c146,'dryRun':_0x4db005['dryRun']===!![]});if(_0x36bc58[_0x560403(0x94)]){const _0x5ad4fe=await isUrlReachable(_0x36bc58[_0x560403(0x94)]);if(!_0x5ad4fe)throw new Error(_0x560403(0x9c)+_0x36bc58['jsUrl']);}if(_0x36bc58[_0x560403(0xa1)]){const _0x44aa5c=await isUrlReachable(_0x36bc58['cssUrl']);if(!_0x44aa5c)throw new Error(_0x560403(0x88)+_0x36bc58[_0x560403(0xa1)]);}const _0x49fee5=await getOnlineMenuList(_0x2e2086,_0x510693),_0x419abe=_0x49fee5[_0x560403(0xa9)](_0x4db364=>_0x4db364[_0x560403(0x7f)][_0x560403(0x6c)]>0x0),_0x2720f3=selectMenusForUpdate(_0x419abe,_0x4db005[_0x560403(0x80)]);if(_0x2720f3['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x4db005[_0x560403(0x95)]===!![]};const _0x11abae=_0x2720f3[_0x560403(0x90)](_0x5b6785=>buildMenuUpdateDiff(_0x5b6785,_0x36bc58,_0x24c146,_0x4db005[_0x560403(0x78)]===!![],_0x4db005[_0x560403(0x77)]));if(_0x4db005[_0x560403(0x95)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x11abae};const _0x46b300=await Promise[_0x560403(0x82)](_0x2720f3['map']((_0x1a206a,_0xfb32af)=>updateMenuCdnUrl(_0x2e2086,_0x510693,{'id':_0x1a206a['id'],'label':_0x1a206a[_0x560403(0x7d)],'path':_0x1a206a[_0x560403(0x79)],'resources':_0x11abae[_0xfb32af]['after'][_0x560403(0x7f)],'extend':_0x1a206a[_0x560403(0x8f)]??null,'loadScriptMode':_0x4db005['loadScriptMode']}))),_0x591937=_0x46b300[_0x560403(0xa9)](_0x1b2d78=>_0x1b2d78[_0x560403(0x7a)]===_0x560403(0x98))[_0x560403(0x90)](_0x255a99=>_0x255a99[_0x560403(0x8c)]),_0x208467=_0x46b300[_0x560403(0xa9)](_0x2e9d7c=>_0x2e9d7c[_0x560403(0x7a)]===_0x560403(0x9b))[_0x560403(0x6c)];return logger[_0x560403(0x75)](_0x560403(0xa0),_0x560403(0xb0),{'count':_0x2720f3[_0x560403(0x6c)],'resources':_0x37cd8e}),{'updated':_0x591937[_0x560403(0x6c)],'failed':_0x208467,'skipped':![],'menus':_0x591937};}function validateSelection(_0x512026){const _0x626f0d=a129_0x1e13;if(!_0x512026)throw new Error(_0x626f0d(0xab));if(_0x512026[_0x626f0d(0x7c)]&&(_0x512026['menuIds'][_0x626f0d(0x6c)]>0x0||_0x512026[_0x626f0d(0x76)][_0x626f0d(0x6c)]>0x0))throw new Error(_0x626f0d(0x81));if(!_0x512026[_0x626f0d(0x7c)]&&_0x512026['menuIds'][_0x626f0d(0x6c)]===0x0&&_0x512026['paths'][_0x626f0d(0x6c)]===0x0)throw new Error(_0x626f0d(0xab));}export function selectMenusForUpdate(_0x521519,_0x860545){const _0x1af8f1=a129_0x1e13;validateSelection(_0x860545);if(_0x860545[_0x1af8f1(0x7c)])return _0x521519;const _0x1b4b6e=new Set(_0x521519['map'](_0x32c70b=>_0x32c70b['id'])),_0x59c3ce=new Set(_0x521519['map'](_0x41b9ba=>_0x41b9ba[_0x1af8f1(0x79)])),_0xee3cf5=_0x860545[_0x1af8f1(0xac)][_0x1af8f1(0xa9)](_0x34a3d7=>!_0x1b4b6e['has'](_0x34a3d7)),_0x15318d=_0x860545[_0x1af8f1(0x76)]['filter'](_0x226438=>!_0x59c3ce[_0x1af8f1(0x6d)](_0x226438));if(_0xee3cf5[_0x1af8f1(0x6c)]>0x0||_0x15318d[_0x1af8f1(0x6c)]>0x0){const _0x30747f=[..._0xee3cf5[_0x1af8f1(0x90)](_0x449aca=>String(_0x449aca)),..._0x15318d][_0x1af8f1(0x73)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x30747f);}const _0x32a1bd=new Set(_0x860545[_0x1af8f1(0xac)]),_0x5acce9=new Set(_0x860545[_0x1af8f1(0x76)]);return _0x521519['filter'](_0x1c04d7=>_0x32a1bd[_0x1af8f1(0x6d)](_0x1c04d7['id'])||_0x5acce9[_0x1af8f1(0x6d)](_0x1c04d7[_0x1af8f1(0x79)]));}function normalizeMode(_0x3877f1){const _0x2597a4=a129_0x1e13;if(!_0x3877f1)return'patch';if(_0x3877f1==='replace'||_0x3877f1==='patch')return _0x3877f1;throw new Error(_0x2597a4(0x9e)+_0x3877f1+_0x2597a4(0x8e));}function buildMenuUpdateDiff(_0x17239e,_0x113820,_0x281af3,_0x2e54ac,_0x5e3bd8){const _0x25987f=a129_0x1e13,_0x54441d=[..._0x17239e[_0x25987f(0x7f)]];_0x281af3===_0x25987f(0xa6)&&assertUnambiguousPatchResources(_0x17239e,_0x54441d,_0x113820);const _0x40ba8d=_0x281af3===_0x25987f(0xa6)?patchResources(_0x54441d,_0x113820):replaceResources(_0x113820),_0x33b7e7=[],_0x5dc1a7=_0x54441d[_0x25987f(0xaa)](isJsResource),_0x57f95c=_0x40ba8d[_0x25987f(0xaa)](isJsResource);if(_0x5dc1a7&&!_0x57f95c){const _0x3760ae='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x17239e[_0x25987f(0x7d)]+_0x25987f(0x83)+_0x17239e['path']+_0x25987f(0x85)+_0x25987f(0x92);if(!_0x2e54ac)throw new Error(_0x3760ae);_0x33b7e7['push'](_0x3760ae);}const _0x2ba0c5=_0x54441d[_0x25987f(0xaa)](isCssResource),_0x3f1ad8=_0x40ba8d[_0x25987f(0xaa)](isCssResource);_0x2ba0c5&&!_0x3f1ad8&&_0x33b7e7[_0x25987f(0x86)](_0x25987f(0xa2)+_0x17239e['label']+_0x25987f(0x83)+_0x17239e[_0x25987f(0x79)]+').');const _0x18badb=typeof _0x17239e[_0x25987f(0x8f)]?.['loadScriptMode']===_0x25987f(0x91)?_0x17239e['extend'][_0x25987f(0x77)]:null,_0x414512=_0x5e3bd8?{'loadScriptMode':_0x18badb}:{},_0x2a5052=_0x5e3bd8?{'loadScriptMode':_0x5e3bd8}:{};return{'id':_0x17239e['id'],'label':_0x17239e['label'],'path':_0x17239e['path'],'mode':_0x281af3,'before':{'resources':_0x54441d,..._0x414512},'after':{'resources':_0x40ba8d,..._0x2a5052},'warnings':_0x33b7e7};}function a129_0x1e13(_0x57ee52,_0xe37647){_0x57ee52=_0x57ee52-0x6c;const _0x5e622f=a129_0x5e62();let _0x1e1384=_0x5e622f[_0x57ee52];return _0x1e1384;}function replaceResources(_0x2048ca){const _0x3a4f05=a129_0x1e13;return[_0x2048ca[_0x3a4f05(0x94)],_0x2048ca[_0x3a4f05(0xa1)]][_0x3a4f05(0xa9)](_0x20b649=>!!_0x20b649);}function assertUnambiguousPatchResources(_0x4e7406,_0x497f5d,_0x2211b4){const _0x5bca75=a129_0x1e13,_0x33bddb=_0x497f5d[_0x5bca75(0xa9)](isJsResource)[_0x5bca75(0x6c)];if(_0x2211b4[_0x5bca75(0x94)]&&_0x33bddb>0x1)throw new Error(_0x5bca75(0x72)+_0x33bddb+_0x5bca75(0x6e)+_0x4e7406[_0x5bca75(0x7d)]+_0x5bca75(0x83)+_0x4e7406[_0x5bca75(0x79)]+')\x20'+_0x5bca75(0xa4));const _0x5a6cae=_0x497f5d[_0x5bca75(0xa9)](isCssResource)[_0x5bca75(0x6c)];if(_0x2211b4[_0x5bca75(0xa1)]&&_0x5a6cae>0x1)throw new Error(_0x5bca75(0x72)+_0x5a6cae+_0x5bca75(0x89)+_0x4e7406[_0x5bca75(0x7d)]+_0x5bca75(0x83)+_0x4e7406[_0x5bca75(0x79)]+')\x20'+_0x5bca75(0x8b));}function a129_0x5e62(){const _0x51d43b=['isArray','rejected','JS\x20URL\x20is\x20unreachable:\x20','.js','Invalid\x20--mode:\x20','1864928CUQJGz','menu-asset-update','cssUrl','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','69124eteByt','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','split','patch','8oHXgYJ','279rQJUrb','filter','some','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','menuIds','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','endsWith','28jYhoTF','Menu\x20asset\x20update\x20completed','length','has','\x20existing\x20JS\x20resources\x20for\x20\x22','toLowerCase','283236YFomPG','72nCatkO','menu\x20asset-update\x20cannot\x20patch\x20','join','--params.','info','paths','loadScriptMode','force','path','status','object','all','label','trim','resources','selection','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','allSettled','\x22\x20(','148776cBqIOX',').\x20','push','setLogPath','CSS\x20URL\x20is\x20unreachable:\x20','\x20existing\x20CSS\x20resources\x20for\x20\x22','cwd','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','value','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','.\x20Allowed\x20values:\x20replace,\x20patch','extend','map','string','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','259330tCuuHc','jsUrl','dryRun','2lZyaNl','43390LSzgFm','fulfilled','55783DgvREW'];a129_0x5e62=function(){return _0x51d43b;};return a129_0x5e62();}function patchResources(_0xe4782c,_0x3c45f9){const _0x3a39d4=a129_0x1e13;let _0x37218e=![],_0x1581da=![];const _0x20de99=[];for(const _0x4b81f4 of _0xe4782c){if(isJsResource(_0x4b81f4)){if(_0x3c45f9['jsUrl']&&!_0x37218e)_0x20de99[_0x3a39d4(0x86)](_0x3c45f9[_0x3a39d4(0x94)]),_0x37218e=!![];else!_0x3c45f9['jsUrl']&&_0x20de99[_0x3a39d4(0x86)](_0x4b81f4);continue;}if(isCssResource(_0x4b81f4)){if(_0x3c45f9[_0x3a39d4(0xa1)]&&!_0x1581da)_0x20de99[_0x3a39d4(0x86)](_0x3c45f9[_0x3a39d4(0xa1)]),_0x1581da=!![];else!_0x3c45f9['cssUrl']&&_0x20de99[_0x3a39d4(0x86)](_0x4b81f4);continue;}_0x20de99[_0x3a39d4(0x86)](_0x4b81f4);}return _0x3c45f9[_0x3a39d4(0x94)]&&!_0x37218e&&_0x20de99['unshift'](_0x3c45f9[_0x3a39d4(0x94)]),_0x3c45f9[_0x3a39d4(0xa1)]&&!_0x1581da&&_0x20de99[_0x3a39d4(0x86)](_0x3c45f9[_0x3a39d4(0xa1)]),_0x20de99;}function isJsResource(_0x459482){const _0x1508be=a129_0x1e13;return stripQuery(_0x459482)[_0x1508be(0x6f)]()[_0x1508be(0xae)](_0x1508be(0x9d));}function isCssResource(_0x87a43a){const _0x2f6be6=a129_0x1e13;return stripQuery(_0x87a43a)[_0x2f6be6(0x6f)]()[_0x2f6be6(0xae)]('.css');}function stripQuery(_0x4b85b3){const _0x47a696=a129_0x1e13;return _0x4b85b3[_0x47a696(0xa5)]('?')[0x0]??_0x4b85b3;}function parseUpdateParamsFlag(_0x37f2d2){const _0x5d9649=a129_0x1e13;if(!_0x37f2d2||typeof _0x37f2d2!=='string')return{};try{const _0x366b68=JSON['parse'](_0x37f2d2);if(typeof _0x366b68!==_0x5d9649(0x7b)||_0x366b68===null||Array[_0x5d9649(0x9a)](_0x366b68))return{};return{'jsUrl':typeof _0x366b68[_0x5d9649(0x94)]===_0x5d9649(0x91)?_0x366b68[_0x5d9649(0x94)][_0x5d9649(0x7e)]():undefined,'cssUrl':typeof _0x366b68[_0x5d9649(0xa1)]===_0x5d9649(0x91)?_0x366b68[_0x5d9649(0xa1)][_0x5d9649(0x7e)]():undefined};}catch{return{};}}
|
|
1
|
+
(function(_0x336d07,_0x2b8291){const _0x925e02=a129_0xb176,_0x52abb2=_0x336d07();while(!![]){try{const _0x51f5de=parseInt(_0x925e02(0x1bd))/0x1*(parseInt(_0x925e02(0x1e4))/0x2)+-parseInt(_0x925e02(0x1ee))/0x3+parseInt(_0x925e02(0x1e9))/0x4+parseInt(_0x925e02(0x1d9))/0x5*(-parseInt(_0x925e02(0x1ec))/0x6)+-parseInt(_0x925e02(0x1d6))/0x7*(parseInt(_0x925e02(0x1c8))/0x8)+-parseInt(_0x925e02(0x1de))/0x9*(parseInt(_0x925e02(0x1d3))/0xa)+parseInt(_0x925e02(0x1cf))/0xb*(parseInt(_0x925e02(0x1bb))/0xc);if(_0x51f5de===_0x2b8291)break;else _0x52abb2['push'](_0x52abb2['shift']());}catch(_0x26d5a2){_0x52abb2['push'](_0x52abb2['shift']());}}}(a129_0x5755,0x5f2e5));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x5a7b76){const _0x5b0d12=a129_0xb176,_0x1b52d9=[];return _0x5a7b76['jsUrl']&&!isValidJsHttpsUrl(_0x5a7b76[_0x5b0d12(0x1ba)])&&_0x1b52d9[_0x5b0d12(0x1e7)]({'field':_0x5b0d12(0x1ba),'message':_0x5b0d12(0x1d1)}),_0x5a7b76[_0x5b0d12(0x1bf)]&&!isValidCssHttpsUrl(_0x5a7b76['cssUrl'])&&_0x1b52d9[_0x5b0d12(0x1e7)]({'field':_0x5b0d12(0x1bf),'message':_0x5b0d12(0x1ea)}),_0x1b52d9;}export async function runMenuUpdateCore(_0x1dec77,_0x18b022,_0x2ec3a6,_0x3d4bb5={}){const _0x4c7dda=a129_0xb176,_0x3a1a0e=parseUpdateParamsFlag(_0x2ec3a6),_0x4bba1d=normalizeMode(_0x3d4bb5[_0x4c7dda(0x1da)]);validateSelection(_0x3d4bb5['selection']);const _0x2a5a01=[];if(_0x3a1a0e[_0x4c7dda(0x1ba)])_0x2a5a01[_0x4c7dda(0x1e7)](_0x3a1a0e[_0x4c7dda(0x1ba)]);if(_0x3a1a0e[_0x4c7dda(0x1bf)])_0x2a5a01[_0x4c7dda(0x1e7)](_0x3a1a0e['cssUrl']);const _0x34b1c7=validateParams(_0x3a1a0e);if(_0x34b1c7['length']>0x0){const _0xf42b0f=_0x34b1c7['map'](_0x540be6=>'--params.'+_0x540be6[_0x4c7dda(0x1ef)]+':\x20'+_0x540be6[_0x4c7dda(0x1c2)])[_0x4c7dda(0x1d8)](';\x20');throw new Error(_0x4c7dda(0x1cb)+_0xf42b0f);}if(_0x2a5a01[_0x4c7dda(0x1ce)]===0x0)throw new Error(_0x4c7dda(0x1be)+_0x4c7dda(0x1cc));logger[_0x4c7dda(0x1f0)](process[_0x4c7dda(0x1eb)]()),logger[_0x4c7dda(0x1f4)](_0x4c7dda(0x1b1),_0x4c7dda(0x1b4),{'appCode':_0x1dec77,'jsUrl':_0x3a1a0e['jsUrl'],'cssUrl':_0x3a1a0e[_0x4c7dda(0x1bf)],'mode':_0x4bba1d,'dryRun':_0x3d4bb5[_0x4c7dda(0x1ad)]===!![]});if(_0x3a1a0e[_0x4c7dda(0x1ba)]){const _0x59a7f8=await isUrlReachable(_0x3a1a0e[_0x4c7dda(0x1ba)]);if(!_0x59a7f8)throw new Error(_0x4c7dda(0x1b2)+_0x3a1a0e[_0x4c7dda(0x1ba)]);}if(_0x3a1a0e['cssUrl']){const _0x3727f5=await isUrlReachable(_0x3a1a0e['cssUrl']);if(!_0x3727f5)throw new Error(_0x4c7dda(0x1e6)+_0x3a1a0e[_0x4c7dda(0x1bf)]);}const _0x4f64da=await getOnlineMenuList(_0x1dec77,_0x18b022),_0x4c0d40=_0x4f64da['filter'](_0x360a64=>_0x360a64[_0x4c7dda(0x1c4)][_0x4c7dda(0x1ce)]>0x0),_0x726cda=selectMenusForUpdate(_0x4c0d40,_0x3d4bb5[_0x4c7dda(0x1d5)]);if(_0x726cda[_0x4c7dda(0x1ce)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x3d4bb5[_0x4c7dda(0x1ad)]===!![]};const _0x1ea95d=_0x726cda[_0x4c7dda(0x1dd)](_0x4bdd33=>buildMenuUpdateDiff(_0x4bdd33,_0x3a1a0e,_0x4bba1d,_0x3d4bb5[_0x4c7dda(0x1f1)]===!![],_0x3d4bb5[_0x4c7dda(0x1bc)]));if(_0x3d4bb5[_0x4c7dda(0x1ad)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x1ea95d};const _0x173382=await Promise[_0x4c7dda(0x1ab)](_0x726cda[_0x4c7dda(0x1dd)]((_0x9d19a7,_0x837604)=>updateMenuCdnUrl(_0x1dec77,_0x18b022,{'id':_0x9d19a7['id'],'label':_0x9d19a7[_0x4c7dda(0x1d2)],'path':_0x9d19a7['path'],'resources':_0x1ea95d[_0x837604][_0x4c7dda(0x1c0)][_0x4c7dda(0x1c4)],'extend':_0x9d19a7[_0x4c7dda(0x1b7)]??null,'loadScriptMode':_0x3d4bb5['loadScriptMode']}))),_0xdd8df=_0x173382[_0x4c7dda(0x1ac)](_0x2c3549=>_0x2c3549[_0x4c7dda(0x1e8)]===_0x4c7dda(0x1db))[_0x4c7dda(0x1dd)](_0x4ae89e=>_0x4ae89e[_0x4c7dda(0x1df)]),_0x3eb78e=_0x173382['filter'](_0x4560ec=>_0x4560ec[_0x4c7dda(0x1e8)]===_0x4c7dda(0x1c6))[_0x4c7dda(0x1ce)];return logger[_0x4c7dda(0x1f4)]('menu-asset-update','Menu\x20asset\x20update\x20completed',{'count':_0x726cda[_0x4c7dda(0x1ce)],'resources':_0x2a5a01}),{'updated':_0xdd8df[_0x4c7dda(0x1ce)],'failed':_0x3eb78e,'skipped':![],'menus':_0xdd8df};}function validateSelection(_0x1c0a23){const _0xdab442=a129_0xb176;if(!_0x1c0a23)throw new Error(_0xdab442(0x1ae));if(_0x1c0a23[_0xdab442(0x1c3)]&&(_0x1c0a23[_0xdab442(0x1c7)][_0xdab442(0x1ce)]>0x0||_0x1c0a23['paths'][_0xdab442(0x1ce)]>0x0))throw new Error(_0xdab442(0x1d4));if(!_0x1c0a23[_0xdab442(0x1c3)]&&_0x1c0a23['menuIds'][_0xdab442(0x1ce)]===0x0&&_0x1c0a23[_0xdab442(0x1e1)]['length']===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x25f09e,_0x3c035c){const _0x64a069=a129_0xb176;validateSelection(_0x3c035c);if(_0x3c035c[_0x64a069(0x1c3)])return _0x25f09e;const _0x551c59=new Set(_0x25f09e[_0x64a069(0x1dd)](_0x1948b1=>_0x1948b1['id'])),_0x559d77=new Set(_0x25f09e[_0x64a069(0x1dd)](_0x294c39=>_0x294c39[_0x64a069(0x1b5)])),_0x5536d7=_0x3c035c['menuIds']['filter'](_0x10a2c0=>!_0x551c59[_0x64a069(0x1ca)](_0x10a2c0)),_0x56f4d8=_0x3c035c[_0x64a069(0x1e1)][_0x64a069(0x1ac)](_0x37ca1f=>!_0x559d77['has'](_0x37ca1f));if(_0x5536d7[_0x64a069(0x1ce)]>0x0||_0x56f4d8['length']>0x0){const _0x15e2c0=[..._0x5536d7['map'](_0x2bc222=>String(_0x2bc222)),..._0x56f4d8][_0x64a069(0x1d8)](',\x20');throw new Error(_0x64a069(0x1e0)+_0x15e2c0);}const _0x3d62c=new Set(_0x3c035c[_0x64a069(0x1c7)]),_0x5910d3=new Set(_0x3c035c[_0x64a069(0x1e1)]);return _0x25f09e[_0x64a069(0x1ac)](_0x273046=>_0x3d62c[_0x64a069(0x1ca)](_0x273046['id'])||_0x5910d3[_0x64a069(0x1ca)](_0x273046[_0x64a069(0x1b5)]));}function a129_0x5755(){const _0x5f2abe=['235LmhJUA','mode','fulfilled','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','map','9FSazXc','value','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','paths','.\x20Allowed\x20values:\x20replace,\x20patch','\x22\x20(','692126zWdXYq','patch','CSS\x20URL\x20is\x20unreachable:\x20','push','status','321168IwZJbI','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','cwd','14394KATlHm','menu\x20asset-update\x20cannot\x20patch\x20','429027hmPLRH','field','setLogPath','force','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','object','info','allSettled','filter','dryRun','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','toLowerCase','\x20existing\x20CSS\x20resources\x20for\x20\x22','menu-asset-update','JS\x20URL\x20is\x20unreachable:\x20','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','Start\x20non-interactive\x20menu\x20asset\x20update','path','string','extend','\x20existing\x20JS\x20resources\x20for\x20\x22','parse','jsUrl','18816jBzixk','loadScriptMode','1TEbtpf','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','cssUrl','after','replace','message','all','resources','isArray','rejected','menuIds','48920lkjGmk','.css','has','Invalid\x20--params:\x20','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','some','length','5786TxXNWj','endsWith','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','label','796100YbEdWU','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','selection','602eznzto','Invalid\x20--mode:\x20','join'];a129_0x5755=function(){return _0x5f2abe;};return a129_0x5755();}function normalizeMode(_0x52d8e0){const _0x2cef53=a129_0xb176;if(!_0x52d8e0)return _0x2cef53(0x1e5);if(_0x52d8e0===_0x2cef53(0x1c1)||_0x52d8e0===_0x2cef53(0x1e5))return _0x52d8e0;throw new Error(_0x2cef53(0x1d7)+_0x52d8e0+_0x2cef53(0x1e2));}function buildMenuUpdateDiff(_0x274b89,_0x51a5df,_0x42518f,_0x57add6,_0x4ed6cd){const _0x5d5243=a129_0xb176,_0x26b253=[..._0x274b89[_0x5d5243(0x1c4)]];_0x42518f===_0x5d5243(0x1e5)&&assertUnambiguousPatchResources(_0x274b89,_0x26b253,_0x51a5df);const _0x3295e8=_0x42518f===_0x5d5243(0x1e5)?patchResources(_0x26b253,_0x51a5df):replaceResources(_0x51a5df),_0x3614b1=[],_0x5dcb42=_0x26b253[_0x5d5243(0x1cd)](isJsResource),_0x2be83a=_0x3295e8[_0x5d5243(0x1cd)](isJsResource);if(_0x5dcb42&&!_0x2be83a){const _0x33362b=_0x5d5243(0x1b3)+_0x274b89['label']+_0x5d5243(0x1e3)+_0x274b89[_0x5d5243(0x1b5)]+').\x20'+_0x5d5243(0x1dc);if(!_0x57add6)throw new Error(_0x33362b);_0x3614b1['push'](_0x33362b);}const _0x37c239=_0x26b253['some'](isCssResource),_0x5f38c4=_0x3295e8[_0x5d5243(0x1cd)](isCssResource);_0x37c239&&!_0x5f38c4&&_0x3614b1[_0x5d5243(0x1e7)]('menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22'+_0x274b89[_0x5d5243(0x1d2)]+_0x5d5243(0x1e3)+_0x274b89[_0x5d5243(0x1b5)]+').');const _0x73d9af=typeof _0x274b89[_0x5d5243(0x1b7)]?.[_0x5d5243(0x1bc)]===_0x5d5243(0x1b6)?_0x274b89['extend']['loadScriptMode']:null,_0x33175d=_0x4ed6cd?{'loadScriptMode':_0x73d9af}:{},_0x66314f=_0x4ed6cd?{'loadScriptMode':_0x4ed6cd}:{};return{'id':_0x274b89['id'],'label':_0x274b89['label'],'path':_0x274b89[_0x5d5243(0x1b5)],'mode':_0x42518f,'before':{'resources':_0x26b253,..._0x33175d},'after':{'resources':_0x3295e8,..._0x66314f},'warnings':_0x3614b1};}function replaceResources(_0x5855d3){const _0x495a4e=a129_0xb176;return[_0x5855d3[_0x495a4e(0x1ba)],_0x5855d3[_0x495a4e(0x1bf)]][_0x495a4e(0x1ac)](_0x1aece2=>!!_0x1aece2);}function assertUnambiguousPatchResources(_0x6abcf4,_0xf59208,_0x11af9f){const _0x1a4cfb=a129_0xb176,_0xa2cd76=_0xf59208[_0x1a4cfb(0x1ac)](isJsResource)[_0x1a4cfb(0x1ce)];if(_0x11af9f[_0x1a4cfb(0x1ba)]&&_0xa2cd76>0x1)throw new Error(_0x1a4cfb(0x1ed)+_0xa2cd76+_0x1a4cfb(0x1b8)+_0x6abcf4['label']+'\x22\x20('+_0x6abcf4[_0x1a4cfb(0x1b5)]+')\x20'+'with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');const _0xa796f6=_0xf59208[_0x1a4cfb(0x1ac)](isCssResource)['length'];if(_0x11af9f['cssUrl']&&_0xa796f6>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0xa796f6+_0x1a4cfb(0x1b0)+_0x6abcf4[_0x1a4cfb(0x1d2)]+_0x1a4cfb(0x1e3)+_0x6abcf4['path']+')\x20'+_0x1a4cfb(0x1f2));}function patchResources(_0x365310,_0x270825){const _0x2c8e3e=a129_0xb176;let _0x2985cf=![],_0x2fd7ac=![];const _0x2c56eb=[];for(const _0x1b471a of _0x365310){if(isJsResource(_0x1b471a)){if(_0x270825[_0x2c8e3e(0x1ba)]&&!_0x2985cf)_0x2c56eb[_0x2c8e3e(0x1e7)](_0x270825[_0x2c8e3e(0x1ba)]),_0x2985cf=!![];else!_0x270825[_0x2c8e3e(0x1ba)]&&_0x2c56eb[_0x2c8e3e(0x1e7)](_0x1b471a);continue;}if(isCssResource(_0x1b471a)){if(_0x270825[_0x2c8e3e(0x1bf)]&&!_0x2fd7ac)_0x2c56eb[_0x2c8e3e(0x1e7)](_0x270825[_0x2c8e3e(0x1bf)]),_0x2fd7ac=!![];else!_0x270825[_0x2c8e3e(0x1bf)]&&_0x2c56eb[_0x2c8e3e(0x1e7)](_0x1b471a);continue;}_0x2c56eb['push'](_0x1b471a);}return _0x270825[_0x2c8e3e(0x1ba)]&&!_0x2985cf&&_0x2c56eb['unshift'](_0x270825['jsUrl']),_0x270825[_0x2c8e3e(0x1bf)]&&!_0x2fd7ac&&_0x2c56eb[_0x2c8e3e(0x1e7)](_0x270825[_0x2c8e3e(0x1bf)]),_0x2c56eb;}function isJsResource(_0x56aeac){const _0x4c9a1b=a129_0xb176;return stripQuery(_0x56aeac)[_0x4c9a1b(0x1af)]()[_0x4c9a1b(0x1d0)]('.js');}function a129_0xb176(_0x3adc18,_0x35d613){_0x3adc18=_0x3adc18-0x1ab;const _0x575599=a129_0x5755();let _0xb1768e=_0x575599[_0x3adc18];return _0xb1768e;}function isCssResource(_0x32cfb5){const _0x3842ae=a129_0xb176;return stripQuery(_0x32cfb5)['toLowerCase']()[_0x3842ae(0x1d0)](_0x3842ae(0x1c9));}function stripQuery(_0x303dfa){return _0x303dfa['split']('?')[0x0]??_0x303dfa;}function parseUpdateParamsFlag(_0x3fd1b2){const _0x52ddda=a129_0xb176;if(!_0x3fd1b2||typeof _0x3fd1b2!==_0x52ddda(0x1b6))return{};try{const _0x42315f=JSON[_0x52ddda(0x1b9)](_0x3fd1b2);if(typeof _0x42315f!==_0x52ddda(0x1f3)||_0x42315f===null||Array[_0x52ddda(0x1c5)](_0x42315f))return{};return{'jsUrl':typeof _0x42315f[_0x52ddda(0x1ba)]===_0x52ddda(0x1b6)?_0x42315f[_0x52ddda(0x1ba)]['trim']():undefined,'cssUrl':typeof _0x42315f['cssUrl']===_0x52ddda(0x1b6)?_0x42315f[_0x52ddda(0x1bf)]['trim']():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x189c39,_0xf12a3a){const _0x2d267c=a130_0x25c6,_0x1296d2=_0x189c39();while(!![]){try{const _0x47fd24=-parseInt(_0x2d267c(0x104))/0x1*(-parseInt(_0x2d267c(0x10c))/0x2)+parseInt(_0x2d267c(0x108))/0x3*(-parseInt(_0x2d267c(0x112))/0x4)+-parseInt(_0x2d267c(0x10a))/0x5*(-parseInt(_0x2d267c(0x110))/0x6)+-parseInt(_0x2d267c(0x111))/0x7+-parseInt(_0x2d267c(0x109))/0x8+parseInt(_0x2d267c(0x10d))/0x9*(parseInt(_0x2d267c(0x105))/0xa)+parseInt(_0x2d267c(0x106))/0xb*(parseInt(_0x2d267c(0x107))/0xc);if(_0x47fd24===_0xf12a3a)break;else _0x1296d2['push'](_0x1296d2['shift']());}catch(_0x2a2c4f){_0x1296d2['push'](_0x1296d2['shift']());}}}(a130_0xb1d3,0x9ecaa));export function isValidJsHttpsUrl(_0xbae695){const _0x3d9358=a130_0x25c6;return/^https:\/\/.+\.js(\?.*)?$/[_0x3d9358(0x10f)](_0xbae695['trim']());}export function isValidCssHttpsUrl(_0x5510cf){const _0x22c74f=a130_0x25c6;return/^https:\/\/.+\.css(\?.*)?$/[_0x22c74f(0x10f)](_0x5510cf[_0x22c74f(0x10e)]());}function a130_0xb1d3(){const _0x4b17f7=['6tkrgiQ','8453018oBYyYM','151672nTvwdf','175698UKaPgz','10axIPhO','132RWPumM','594732jpChVp','9lYOZRq','9788912XmDlQT','5495855tkxvTh','HEAD','12eiBuUo','4025349pponeY','trim','test'];a130_0xb1d3=function(){return _0x4b17f7;};return a130_0xb1d3();}function a130_0x25c6(_0x3444ca,_0x203577){_0x3444ca=_0x3444ca-0x104;const _0xb1d36c=a130_0xb1d3();let _0x25c67c=_0xb1d36c[_0x3444ca];return _0x25c67c;}export async function isUrlReachable(_0x1edcd1){const _0x492dc6=a130_0x25c6;try{const _0x3fc54d=await fetch(_0x1edcd1,{'method':_0x492dc6(0x10b)});return _0x3fc54d['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x245152=a131_0x19b6;(function(_0x249c85,_0x15c50a){const _0x16d45a=a131_0x19b6,_0x3935c9=_0x249c85();while(!![]){try{const _0x336b39=-parseInt(_0x16d45a(0x195))/0x1+parseInt(_0x16d45a(0x193))/0x2+parseInt(_0x16d45a(0x183))/0x3*(-parseInt(_0x16d45a(0x189))/0x4)+-parseInt(_0x16d45a(0x1c2))/0x5*(parseInt(_0x16d45a(0x1b1))/0x6)+parseInt(_0x16d45a(0x1c6))/0x7*(parseInt(_0x16d45a(0x19b))/0x8)+-parseInt(_0x16d45a(0x196))/0x9*(parseInt(_0x16d45a(0x1bc))/0xa)+-parseInt(_0x16d45a(0x1b6))/0xb*(-parseInt(_0x16d45a(0x1b7))/0xc);if(_0x336b39===_0x15c50a)break;else _0x3935c9['push'](_0x3935c9['shift']());}catch(_0x38f0cc){_0x3935c9['push'](_0x3935c9['shift']());}}}(a131_0x5e99,0x69bf8));import a131_0x5635b4 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';function a131_0x19b6(_0x40b97d,_0x514ce7){_0x40b97d=_0x40b97d-0x17b;const _0x5e99dc=a131_0x5e99();let _0x19b60a=_0x5e99dc[_0x40b97d];return _0x19b60a;}import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';export const menuSync={'service':a131_0x245152(0x1a9),'command':a131_0x245152(0x194),'description':a131_0x245152(0x1a5),'risk':'write','flags':[{'name':a131_0x245152(0x188),'type':a131_0x245152(0x17b),'description':a131_0x245152(0x181)+'JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}'},{'name':a131_0x245152(0x17d),'type':a131_0x245152(0x17b),'description':a131_0x245152(0x180)},{'name':a131_0x245152(0x1a8),'type':a131_0x245152(0x197),'description':'Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages'}],async 'dryRun'(_0x1c63a0){const _0x19db5f=a131_0x245152;ensureRunnableContext(_0x1c63a0[_0x19db5f(0x1b2)],_0x1c63a0[_0x19db5f(0x19a)]);const _0x2b232e=await runMenuSyncCore(_0x1c63a0['appCode'],_0x1c63a0[_0x19db5f(0x1af)],parsePaths(_0x1c63a0[_0x19db5f(0x1b9)](_0x19db5f(0x17d))),_0x1c63a0[_0x19db5f(0x1b9)](_0x19db5f(0x188)),{'dryRun':!![]});return{'method':_0x19db5f(0x1a6),'url':_0x19db5f(0x1a0),'body':_0x2b232e,'description':_0x2b232e[_0x19db5f(0x190)]?_0x19db5f(0x18b):'Would\x20create\x20'+_0x2b232e[_0x19db5f(0x187)][_0x19db5f(0x19c)]+_0x19db5f(0x186)};},async 'execute'(_0x687440){const _0x486810=a131_0x245152;ensureRunnableContext(_0x687440[_0x486810(0x1b2)],_0x687440['selectedAppName']);const _0x2010e7=_0x687440[_0x486810(0x199)](_0x486810(0x1a8)),_0x140e22=_0x687440[_0x486810(0x1b9)](_0x486810(0x188)),_0x4fceb9=parsePaths(_0x687440[_0x486810(0x1b9)](_0x486810(0x17d))),_0x3abc53=parseMenuSyncParams(_0x140e22);if(_0x2010e7){const _0x39174e=await runMenuSyncCore(_0x687440[_0x486810(0x19f)],_0x687440['cookie'],_0x4fceb9,_0x140e22);if(_0x39174e['skipped']){const _0x40d96d=getLocalPages();_0x40d96d['length']===0x0?writeCliSideChannelLine(_0x486810(0x18a)):writeCliSideChannelLine(_0x486810(0x198));}else writeCliSideChannelLine(_0x486810(0x1be)+_0x39174e['created']+_0x486810(0x184));return{'ok':!![],'data':_0x39174e,'message':_0x39174e[_0x486810(0x190)]?_0x486810(0x1ad):_0x486810(0x185)+_0x39174e['created']+_0x486810(0x1c5)};}if(_0x4fceb9[_0x486810(0x19c)]>0x0)throw CliErrors[_0x486810(0x1c4)](_0x486810(0x17e),'Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');if(!isInteractive()&&_0x140e22)throw CliErrors[_0x486810(0x1c4)]('Non-interactive\x20menu\x20sync\x20requires\x20--yes.',_0x486810(0x19e));requireInteractive();const _0x1064b6=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x9bf69e,_0x6015a5,_0x493a1f;try{const _0x146d6b=await fetchMenuData(_0x687440[_0x486810(0x19f)],_0x687440[_0x486810(0x1af)]);_0x9bf69e=_0x146d6b[_0x486810(0x1a2)],_0x6015a5=_0x146d6b[_0x486810(0x1ba)],_0x493a1f=_0x146d6b[_0x486810(0x1b8)],stopSpinner(_0x1064b6,_0x486810(0x182),!![]);}catch(_0x1e594d){stopSpinner(_0x1064b6,_0x486810(0x1ab),![]);throw CliErrors[_0x486810(0x1c4)](_0x1e594d instanceof Error?_0x1e594d[_0x486810(0x1b5)]:_0x486810(0x1ab));}if(_0x9bf69e[_0x486810(0x19c)]===0x0)return writeCliSideChannelLine(a131_0x5635b4['yellow'](_0x486810(0x1c3))),{'ok':!![]};const _0x556ef2=buildCompareRows(_0x9bf69e,_0x6015a5);writeCliSideChannelLine(renderCompareTable(_0x556ef2)),writeCliSideChannelLine('');const _0x1c215d=await selectPages(_0x9bf69e,_0x6015a5);writeCliSideChannelLine(''),writeCliSideChannelLine(a131_0x5635b4[_0x486810(0x1bf)](_0x486810(0x1a1)+_0x1c215d[_0x486810(0x19c)]+_0x486810(0x18c)));const _0xeb3c68=_0x3abc53['jsUrl']&&_0x3abc53[_0x486810(0x1ac)];if(!_0xeb3c68){writeCliSideChannelLine(renderSyncSummary(_0x1c215d,_0x6015a5[_0x486810(0x1a7)]>0x0));const _0x439cda=await askConfirm(_0x486810(0x1b3));if(!_0x439cda)return writeCliSideChannelLine(a131_0x5635b4[_0x486810(0x17f)](_0x486810(0x1bb))),{'ok':!![]};}let _0x5c2ea6=_0x3abc53[_0x486810(0x18f)],_0x90da41=_0x3abc53[_0x486810(0x1ac)];!_0x5c2ea6&&(_0x5c2ea6=await askJsUrl());!_0x90da41&&(_0x90da41=await askCssUrl());const _0x23bc78=await askConfirm('\x20\x20Create\x20'+_0x1c215d[_0x486810(0x19c)]+_0x486810(0x1ae)+_0x5c2ea6+_0x486810(0x1c1)+_0x90da41+'?');if(!_0x23bc78)return writeCliSideChannelLine(a131_0x5635b4['gray'](_0x486810(0x1bb))),{'ok':!![]};const _0x5c8654=[_0x5c2ea6,_0x90da41],_0x441562=startSpinner(_0x486810(0x192)+_0x1c215d['length']+'\x20menu(s)...');try{const _0x204563=await doCreateMenus(_0x687440['appCode'],_0x687440[_0x486810(0x1af)],_0x1c215d,_0x5c8654);return stopSpinner(_0x441562,_0x486810(0x1b0)+_0x204563[_0x486810(0x191)]+'\x20menu(s)',!![]),{'ok':!![],'data':_0x204563,'message':_0x486810(0x185)+_0x204563[_0x486810(0x191)]+_0x486810(0x19d)+_0x204563[_0x486810(0x1aa)]+_0x486810(0x1b4)};}catch(_0x15ce1a){stopSpinner(_0x441562,_0x486810(0x18e),![]);throw CliErrors['validation'](_0x15ce1a instanceof Error?_0x15ce1a[_0x486810(0x1b5)]:'Menu\x20creation\x20failed');}}};function ensureRunnableContext(_0xe36ba5,_0x6eadab){const _0x324c33=a131_0x245152,_0x21cd66=_0xe36ba5[_0x324c33(0x1a3)]?String(_0xe36ba5['appcode'])[_0x324c33(0x1c0)]():'';if(!isInProject()&&!_0x6eadab&&!_0x21cd66)throw CliErrors['validation'](_0x324c33(0x18d)+'Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.');}function parsePaths(_0x1bfc85){const _0x1de287=a131_0x245152;return[...new Set(_0x1bfc85[_0x1de287(0x1a4)](',')[_0x1de287(0x17c)](_0x2c5d73=>_0x2c5d73[_0x1de287(0x1c0)]())[_0x1de287(0x1bd)](Boolean))];}function a131_0x5e99(){const _0x4062fd=['\x20\x20Continue\x20with\x20creation?','\x20failed.','message','11PwBiTY','17594016DdbdRK','onlineMenuList','str','onlinePaths','\x20\x20Cancelled.','190dXZMVm','filter','✓\x20Menu\x20sync\x20completed:\x20','cyan','trim','\x20and\x20CSS:\x20','2323205CqvQPW','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','validation','\x20created.','7EiEpWe','string','map','paths','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','gray','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','Pre-fill\x20JS/CSS\x20URLs.\x20','Online\x20menu\x20list\x20fetched','1174569WzDoyf','\x20menu(s)\x20created','Menu\x20sync\x20completed:\x20','\x20local\x20microfrontend\x20menu(s).','targetPages','params','8xEevtF','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','\x20page(s)','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','Menu\x20creation\x20failed','jsUrl','skipped','created','Creating\x20','572462dfbaQR','sync','259116LSNXLj','37683BTqmkB','boolean','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','flag','selectedAppName','2136808szgjiM','length','\x20created,\x20','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','appCode','/smartapi/menu/create','\x20\x20✓\x20Selected:\x20','localPages','appcode','split','Sync\x20local\x20pages\x20as\x20platform\x20menus','POST','size','yes','menu','failed','Failed\x20to\x20fetch\x20online\x20menu\x20list','cssUrl','Menu\x20sync\x20skipped','\x20menu(s)\x20with\x20JS:\x20','cookie','Created\x20','6urykvv','rawFlags'];a131_0x5e99=function(){return _0x4062fd;};return a131_0x5e99();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0x308dfe=a132_0x5923;(function(_0x5cb336,_0x4cb943){const _0x1f7775=a132_0x5923,_0x5e8141=_0x5cb336();while(!![]){try{const _0x36e8f2=-parseInt(_0x1f7775(0x207))/0x1+-parseInt(_0x1f7775(0x1ff))/0x2*(parseInt(_0x1f7775(0x1f9))/0x3)+-parseInt(_0x1f7775(0x212))/0x4+parseInt(_0x1f7775(0x1fc))/0x5+-parseInt(_0x1f7775(0x20b))/0x6+parseInt(_0x1f7775(0x20f))/0x7*(-parseInt(_0x1f7775(0x1f6))/0x8)+parseInt(_0x1f7775(0x208))/0x9;if(_0x36e8f2===_0x4cb943)break;else _0x5e8141['push'](_0x5e8141['shift']());}catch(_0x5edb85){_0x5e8141['push'](_0x5e8141['shift']());}}}(a132_0x59cf,0x1cfb9));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{listNotificationChannelConfigs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const NOTIFICATION_CHANNEL_TYPES=['EMAIL',a132_0x308dfe(0x211),a132_0x308dfe(0x1f7),a132_0x308dfe(0x218),a132_0x308dfe(0x1f4)];export const notificationConfigList={'service':a132_0x308dfe(0x214),'command':'config-list','description':a132_0x308dfe(0x216),'risk':a132_0x308dfe(0x204),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a132_0x308dfe(0x215),'type':a132_0x308dfe(0x200),'description':a132_0x308dfe(0x20a),'enum':NOTIFICATION_CHANNEL_TYPES,'default':a132_0x308dfe(0x1fd)}],async 'validate'(_0x6cc92d){readChannelType(_0x6cc92d);},async 'execute'(_0x4076da){const _0x343336=a132_0x308dfe,_0x5a66ae=readChannelType(_0x4076da),_0x41bbfd=await listNotificationChannelConfigs(_0x4076da[_0x343336(0x20c)],_0x5a66ae),_0x347fb8=_0x41bbfd[_0x343336(0x206)](projectNotificationConfig);return{'ok':!![],'data':{'appCode':_0x4076da['appCode'],'channelType':_0x5a66ae,'count':_0x347fb8['length'],'configs':_0x347fb8},'message':_0x343336(0x217)+_0x347fb8[_0x343336(0x1fb)]+'\x20'+_0x5a66ae+_0x343336(0x201)};}};function readChannelType(_0x1ceaff){const _0x39d620=a132_0x308dfe,_0x522d98=_0x1ceaff['str'](_0x39d620(0x215))[_0x39d620(0x213)]()||_0x39d620(0x1fd);if(!NOTIFICATION_CHANNEL_TYPES[_0x39d620(0x203)](_0x522d98))throw CliErrors[_0x39d620(0x205)](_0x39d620(0x1f8)+_0x522d98,_0x39d620(0x20e)+NOTIFICATION_CHANNEL_TYPES['join'](',\x20')+'.');return _0x522d98;}function a132_0x5923(_0x224283,_0x527a5b){_0x224283=_0x224283-0x1f1;const _0x59cf90=a132_0x59cf();let _0x592344=_0x59cf90[_0x224283];return _0x592344;}function projectNotificationConfig(_0x7e45ec,_0x37c5d7){const _0x598f7a=a132_0x308dfe;return{'id':typeof _0x7e45ec['id']===_0x598f7a(0x210)?_0x7e45ec['id']:null,'configCode':requireConfigString(_0x7e45ec,_0x598f7a(0x202),_0x37c5d7),'configName':requireConfigString(_0x7e45ec,_0x598f7a(0x1f3),_0x37c5d7),'channelType':requireConfigString(_0x7e45ec,_0x598f7a(0x1f5),_0x37c5d7),'description':normalizeNullableString(_0x7e45ec[_0x598f7a(0x20d)]),'createTime':normalizeNullableString(_0x7e45ec[_0x598f7a(0x209)]),'updateTime':normalizeNullableString(_0x7e45ec[_0x598f7a(0x1f2)])};}function requireConfigString(_0x45e511,_0x48ca83,_0x72e844){const _0x50eb93=a132_0x308dfe,_0x1ec193=_0x45e511[_0x48ca83];if(typeof _0x1ec193!=='string'||_0x1ec193[_0x50eb93(0x213)]()==='')throw CliErrors['apiError'](_0x50eb93(0x1f1),_0x50eb93(0x1fa)+(_0x72e844+0x1)+_0x50eb93(0x1fe)+_0x48ca83+'\x22.');return _0x1ec193[_0x50eb93(0x213)]();}function a132_0x59cf(){const _0x5e9ec0=['string','\x20notification\x20config(s)','configCode','includes','read','validation','map','70113NTqbau','2354823HTXLDi','createTime','Notification\x20channel\x20type','937152vOpEDr','appCode','description','Allowed\x20values:\x20','180915NLTrvE','number','FEISHU','32500ShmBmF','trim','notification','type','List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','Found\x20','WECOM','Invalid\x20notification\x20config\x20response.','updateTime','configName','WEBHOOK','channelType','8hXzEpC','DINGTALK','Invalid\x20--type:\x20','178002UyBXXF','Item\x20','length','883375JlbKJL','EMAIL','\x20is\x20missing\x20required\x20field\x20\x22','2VQSBLW'];a132_0x59cf=function(){return _0x5e9ec0;};return a132_0x59cf();}function normalizeNullableString(_0x3c21bd){const _0x4dac0d=a132_0x308dfe;return typeof _0x3c21bd===_0x4dac0d(0x200)?_0x3c21bd:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x26aae0,_0x39a847){const _0x25421c=a133_0x2498,_0x4aa3de=_0x26aae0();while(!![]){try{const _0x35289d=-parseInt(_0x25421c(0xf7))/0x1*(-parseInt(_0x25421c(0xf4))/0x2)+-parseInt(_0x25421c(0xf9))/0x3*(parseInt(_0x25421c(0xf0))/0x4)+-parseInt(_0x25421c(0xf8))/0x5*(-parseInt(_0x25421c(0xf5))/0x6)+-parseInt(_0x25421c(0xf6))/0x7+parseInt(_0x25421c(0xf2))/0x8*(parseInt(_0x25421c(0xf1))/0x9)+-parseInt(_0x25421c(0xfa))/0xa+parseInt(_0x25421c(0xf3))/0xb;if(_0x35289d===_0x39a847)break;else _0x4aa3de['push'](_0x4aa3de['shift']());}catch(_0x27db88){_0x4aa3de['push'](_0x4aa3de['shift']());}}}(a133_0x4480,0x896a7));function a133_0x2498(_0x20b925,_0x531bd2){_0x20b925=_0x20b925-0xf0;const _0x448001=a133_0x4480();let _0x2498d2=_0x448001[_0x20b925];return _0x2498d2;}import{notificationConfigList}from'../../commands/notification/config-list.js';export const notificationDefinitions=[notificationConfigList];function a133_0x4480(){const _0x525d84=['4xMrbPE','5596569hQYlaI','8fmaPcX','6836863TtGUBM','30634WYrBtc','4830fSOgzR','4880897HKKiUB','35afaLsW','6155cNSoEy','1748118DaAfDa','9275920CVELAD'];a133_0x4480=function(){return _0x525d84;};return a133_0x4480();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x54775b=a134_0x2462;(function(_0x5c16fd,_0xfadea5){const _0x31fca0=a134_0x2462,_0x63658a=_0x5c16fd();while(!![]){try{const _0x183d41=parseInt(_0x31fca0(0x122))/0x1*(parseInt(_0x31fca0(0x10d))/0x2)+parseInt(_0x31fca0(0x120))/0x3*(parseInt(_0x31fca0(0x11f))/0x4)+parseInt(_0x31fca0(0x110))/0x5*(-parseInt(_0x31fca0(0x103))/0x6)+parseInt(_0x31fca0(0x109))/0x7*(-parseInt(_0x31fca0(0x107))/0x8)+-parseInt(_0x31fca0(0x133))/0x9+-parseInt(_0x31fca0(0x12e))/0xa+parseInt(_0x31fca0(0x12d))/0xb;if(_0x183d41===_0xfadea5)break;else _0x63658a['push'](_0x63658a['shift']());}catch(_0x3f0c61){_0x63658a['push'](_0x63658a['shift']());}}}(a134_0x53bf,0xc01c6));function a134_0x2462(_0x2d3066,_0x32cfd5){_0x2d3066=_0x2d3066-0x102;const _0x53bfa3=a134_0x53bf();let _0x2462e8=_0x53bfa3[_0x2d3066];return _0x2462e8;}import{requireDevelopmentUploadFile}from'../../commands/common/local-file.js';import{queryDevelopmentFileUrl,recognizeDevelopmentOcr,uploadDevelopmentFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const SUPPORTED_SCENES=[a134_0x54775b(0x11d),a134_0x54775b(0x116),a134_0x54775b(0x102),a134_0x54775b(0x113)],SCENE_TO_LEGACY_TYPE={'invoice':a134_0x54775b(0x12f),'general':a134_0x54775b(0x131),'form':a134_0x54775b(0x132),'idCard':a134_0x54775b(0x104)},SCENE_FLAG={'name':a134_0x54775b(0x127),'type':a134_0x54775b(0x134),'required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':a134_0x54775b(0x117),'type':'string','description':a134_0x54775b(0x114)},IMAGE_URL_FLAG={'name':a134_0x54775b(0x125),'type':a134_0x54775b(0x134),'description':a134_0x54775b(0x119)};function normalizeScene(_0x272aa2){const _0x3af90d=a134_0x54775b,_0x54ed83=_0x272aa2[_0x3af90d(0x11c)]()['toLowerCase']();if(_0x54ed83===_0x3af90d(0x11b))return _0x3af90d(0x113);if(_0x54ed83===_0x3af90d(0x11d)||_0x54ed83==='general'||_0x54ed83==='form')return _0x54ed83;throw CliErrors['validation']('Unsupported\x20OCR\x20scene:\x20'+_0x272aa2+_0x3af90d(0x128)+SUPPORTED_SCENES[_0x3af90d(0x123)](',\x20'));}function a134_0x53bf(){const _0x823dca=['8612460slXciT','Invoice','filePath','General','Table','6476049GiBuBO','string','toString','<filePath\x20returned\x20by\x20/smartapi/common/uploadFile>','form','26898xszpjC','IdCard','/smartapi/common/uploadFile','GET','37176cUfths','imageFile','1841vwsTOe','length','POST','File\x20URL\x20response\x20missing\x20fileUrl.','512panPCp','<fileUrl\x20returned\x20by\x20/smartapi/common/queryFileUrl>','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','1545IOavag','apiError','read','idCard','Local\x20image\x20or\x20PDF\x20file;\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','\x20OCR\x20from\x20URL','general','image-file','appCode','Publicly\x20accessible\x20image\x20or\x20file\x20URL','filter','idcard','trim','invoice','path','152WafyLc','42696AafACN','fileUrl','2635GzfFcS','join','imageUrl','image-url','Preview:\x20recognize\x20','scene','.\x20Supported\x20scenes:\x20','/smartapi/ocr/recognize-text','ocr','validation','str','41356975uFAcbD'];a134_0x53bf=function(){return _0x823dca;};return a134_0x53bf();}function selectedInputs(_0x33610c){const _0x28918d=a134_0x54775b,_0x960769=_0x33610c[_0x28918d(0x12c)]('image-file')[_0x28918d(0x11c)](),_0x38fb92=_0x33610c['str'](_0x28918d(0x125))[_0x28918d(0x11c)]();return{'imageFile':_0x960769,'imageUrl':_0x38fb92,'count':[_0x960769,_0x38fb92][_0x28918d(0x11a)](Boolean)[_0x28918d(0x10a)]};}function validateInputSelection(_0x58827b){const _0xc90b28=a134_0x54775b,_0x1e9934=selectedInputs(_0x58827b);if(_0x1e9934['count']!==0x1)throw CliErrors[_0xc90b28(0x12b)](_0xc90b28(0x10f));return _0x1e9934;}function withScene(_0x16160a,_0x50e68b,_0x4e2773){const _0x3ae054=a134_0x54775b;return{..._0x16160a,'scene':_0x50e68b,..._0x4e2773?{'sourceFile':{'fileName':_0x4e2773['fileName'],'filePath':_0x4e2773[_0x3ae054(0x130)]}}:{}};}const ocrRecognize={'service':a134_0x54775b(0x12a),'command':'recognize','description':'使用研发态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','risk':a134_0x54775b(0x112),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x223827){const _0x49c6fe=a134_0x54775b,_0x307677=normalizeScene(_0x223827['str'](_0x49c6fe(0x127))),_0x10a07a=SCENE_TO_LEGACY_TYPE[_0x307677],_0x5423b0=validateInputSelection(_0x223827);if(_0x5423b0[_0x49c6fe(0x124)]){const _0x3657e8=new URLSearchParams({'url':_0x5423b0['imageUrl'],'type':_0x10a07a,'appCode':_0x223827[_0x49c6fe(0x118)]});return{'method':'GET','url':'/smartapi/ocr/recognize-text?'+_0x3657e8[_0x49c6fe(0x135)](),'description':_0x49c6fe(0x126)+_0x307677+_0x49c6fe(0x115)};}const _0x5212f4=requireDevelopmentUploadFile(_0x5423b0[_0x49c6fe(0x108)],_0x49c6fe(0x117));return{'method':_0x49c6fe(0x10b),'url':_0x49c6fe(0x105),'body':{'steps':[{'method':_0x49c6fe(0x10b),'url':'/smartapi/common/uploadFile','body':{'appCode':_0x223827[_0x49c6fe(0x118)],'multipart':{'file':_0x5212f4}}},{'method':_0x49c6fe(0x10b),'url':'/smartapi/common/queryFileUrl','body':{'filePath':_0x49c6fe(0x136),'downloadFlag':![]}},{'method':_0x49c6fe(0x106),'url':_0x49c6fe(0x129),'query':{'appCode':_0x223827[_0x49c6fe(0x118)],'url':_0x49c6fe(0x10e),'type':_0x10a07a}}]},'description':'Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x307677+'\x20OCR'};},async 'execute'(_0x5ef3af){const _0x49811a=a134_0x54775b,_0x808d6f=normalizeScene(_0x5ef3af[_0x49811a(0x12c)]('scene')),_0x5e6a14=SCENE_TO_LEGACY_TYPE[_0x808d6f],_0x53e0d5=validateInputSelection(_0x5ef3af);if(_0x53e0d5[_0x49811a(0x124)]){const _0x1142ef=await recognizeDevelopmentOcr(_0x5ef3af['appCode'],{'url':_0x53e0d5[_0x49811a(0x124)],'type':_0x5e6a14});return{'ok':!![],'data':withScene(_0x1142ef,_0x808d6f)};}const _0x5ac735=requireDevelopmentUploadFile(_0x53e0d5[_0x49811a(0x108)],_0x49811a(0x117)),_0x3360df=await uploadDevelopmentFile(_0x5ef3af[_0x49811a(0x118)],_0x5ac735[_0x49811a(0x11e)]);if(!_0x3360df[_0x49811a(0x130)])throw CliErrors[_0x49811a(0x111)]('File\x20upload\x20response\x20missing\x20filePath.');const _0x3cd9d8=await queryDevelopmentFileUrl(_0x3360df[_0x49811a(0x130)],{'download':![]});if(!_0x3cd9d8[_0x49811a(0x121)])throw CliErrors[_0x49811a(0x111)](_0x49811a(0x10c));const _0x2d8f7f=await recognizeDevelopmentOcr(_0x5ef3af[_0x49811a(0x118)],{'url':_0x3cd9d8['fileUrl'],'type':_0x5e6a14});return{'ok':!![],'data':withScene(_0x2d8f7f,_0x808d6f,_0x3360df)};}};export const ocrDefinitions=[ocrRecognize];
|