@lovrabet/rabetbase-cli 2.4.3 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/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-refresh-start.d.ts +2 -0
- package/lib/commands/db/diff-refresh-start.js +1 -0
- package/lib/commands/db/diff-refresh-status.d.ts +2 -0
- package/lib/commands/db/diff-refresh-status.js +1 -0
- 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-create.d.ts +2 -0
- package/lib/commands/notification/config-create.js +1 -0
- package/lib/commands/notification/config-delete.d.ts +2 -0
- package/lib/commands/notification/config-delete.js +1 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.d.ts +2 -0
- package/lib/commands/notification/config-update.js +1 -0
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.d.ts +97 -0
- package/lib/commands/notification/shared.js +1 -0
- 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.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/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.d.ts +1 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.d.ts +11 -0
- package/lib/commands/project/create/materialize-project-template.js +1 -0
- package/lib/commands/project/create/project-name.d.ts +2 -0
- package/lib/commands/project/create/project-name.js +1 -0
- package/lib/commands/project/create/project-template-archive.d.ts +6 -0
- package/lib/commands/project/create/project-template-archive.js +1 -0
- package/lib/commands/project/create/project-template-path.d.ts +1 -3
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +2 -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.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.d.ts +2 -0
- 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.d.ts +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +29 -2
- 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.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +13 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/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 -4
- package/skills/rabetbase/SKILL.md +33 -22
- package/skills/rabetbase/guides/backend-function.md +5 -3
- package/skills/rabetbase/guides/bff-creation-workflow.md +2 -2
- package/skills/rabetbase/guides/conflict-detection.md +2 -2
- package/skills/rabetbase/guides/database-connection-workflow.md +39 -5
- package/skills/rabetbase/guides/react-custom-page-workflow.md +16 -4
- package/skills/rabetbase/guides/sql-creation-workflow.md +4 -2
- package/skills/rabetbase/guides/sql-mybatis.md +2 -2
- package/skills/rabetbase/knowledge/page-schema/YtPage.md +3 -37
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +14 -3
- package/skills/rabetbase/references/rabetbase-app-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-bff-push.md +4 -5
- package/skills/rabetbase/references/rabetbase-bff-save.md +3 -3
- package/skills/rabetbase/references/rabetbase-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-detail.md +3 -0
- package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +53 -0
- package/skills/rabetbase/references/rabetbase-db-diff.md +40 -21
- package/skills/rabetbase/references/rabetbase-db-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +5 -3
- package/skills/rabetbase/references/rabetbase-menu-asset-update.md +9 -10
- package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +1 -3
- package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +2 -3
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-notification-config-mutations.md +56 -0
- package/skills/rabetbase/references/rabetbase-page-react-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-react-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-react-publish.md +2 -2
- package/skills/rabetbase/references/rabetbase-project-create.md +3 -0
- package/skills/rabetbase/references/rabetbase-run.md +1 -1
- package/skills/rabetbase/references/rabetbase-sql-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-sql-push.md +3 -4
- package/skills/rabetbase/references/rabetbase-user-account.md +0 -1
- package/skills/rabetbase.manifest.json +5 -5
- package/templates/README.md +14 -2
- package/lib/commands/project/create/non-interactive.d.ts +0 -9
- package/lib/commands/project/create/non-interactive.js +0 -1
- package/lib/utils/copy-directory.d.ts +0 -1
- package/lib/utils/copy-directory.js +0 -1
- package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +0 -291
- package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +0 -223
- package/templates/projects/sub-app-react-demo/.prettierrc +0 -1
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +0 -67
- package/templates/projects/sub-app-react-demo/README.md +0 -246
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +0 -245
- package/templates/projects/sub-app-react-demo/index.html +0 -27
- package/templates/projects/sub-app-react-demo/package.json +0 -34
- package/templates/projects/sub-app-react-demo/public/logo.svg +0 -1
- package/templates/projects/sub-app-react-demo/public/vite.svg +0 -1
- package/templates/projects/sub-app-react-demo/src/api/api.ts +0 -26
- package/templates/projects/sub-app-react-demo/src/api/client.ts +0 -32
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +0 -28
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +0 -55
- package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +0 -308
- package/templates/projects/sub-app-react-demo/src/main.tsx +0 -52
- package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +0 -570
- package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +0 -531
- package/templates/projects/sub-app-react-demo/src/pages/index.module.css +0 -500
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +0 -641
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +0 -536
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +0 -295
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +0 -242
- package/templates/projects/sub-app-react-demo/src/router/index.tsx +0 -30
- package/templates/projects/sub-app-react-demo/src/style.css +0 -108
- package/templates/projects/sub-app-react-demo/src/utils/api.ts +0 -12
- package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +0 -2
- package/templates/projects/sub-app-react-demo/tsconfig.json +0 -26
- package/templates/projects/sub-app-react-demo/vite.config.ts +0 -111
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a157_0x1a99(_0x3e6dc6,_0xcaf557){_0x3e6dc6=_0x3e6dc6-0xa2;const _0x5a9366=a157_0x5a93();let _0x1a9990=_0x5a9366[_0x3e6dc6];return _0x1a9990;}const a157_0x2cbda0=a157_0x1a99;(function(_0x4c0138,_0x248c06){const _0x26e673=a157_0x1a99,_0x494e5c=_0x4c0138();while(!![]){try{const _0x58e129=-parseInt(_0x26e673(0xb8))/0x1+parseInt(_0x26e673(0xba))/0x2*(parseInt(_0x26e673(0xb9))/0x3)+-parseInt(_0x26e673(0xac))/0x4+parseInt(_0x26e673(0xb0))/0x5*(-parseInt(_0x26e673(0xb1))/0x6)+-parseInt(_0x26e673(0xbe))/0x7+-parseInt(_0x26e673(0xab))/0x8*(parseInt(_0x26e673(0xb3))/0x9)+-parseInt(_0x26e673(0xa3))/0xa*(-parseInt(_0x26e673(0xa9))/0xb);if(_0x58e129===_0x248c06)break;else _0x494e5c['push'](_0x494e5c['shift']());}catch(_0x15e11a){_0x494e5c['push'](_0x494e5c['shift']());}}}(a157_0x5a93,0x5f1ca));import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assessStandardPageState,getUndeletedRelatedPages,loadDatasetDetailForPage,loadStandardPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';function a157_0x5a93(){const _0x424578=['name','read','source','related-pages-fallback','764996LxTGif','747801AVLqYu','2UgMHhD','/smartapi/lovrabet/dataset/','alias','relatedPages','1821134UsKdDG','code','8250kfzZLo','status','compress','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','/standard-page-status?appCode=','appCode','42493PiiOUj','standard-page-status','40QHNHYm','2922948bdshVP','query-standard-page-status','string','length','1097540qYPIDC','18iGkVcn','page','1138041EeNRtE'];a157_0x5a93=function(){return _0x424578;};return a157_0x5a93();}export const pageStandardPageStatus={'service':a157_0x2cbda0(0xb2),'command':a157_0x2cbda0(0xaa),'description':'Query\x20Smart\x20List\x20Page\x20facts\x20for\x20a\x20dataset','risk':a157_0x2cbda0(0xb5),'defaultOutputFormat':a157_0x2cbda0(0xa5),'flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a157_0x2cbda0(0xbc),'type':a157_0x2cbda0(0xae),'description':a157_0x2cbda0(0xa6)}],async 'validate'(_0x467e73){validateDatasetSelector(_0x467e73);},async 'dryRun'(_0x26da60){const _0x4c3ddb=a157_0x2cbda0,_0x2fe323=await loadDatasetDetailForPage(_0x26da60);return{'method':'GET','url':_0x4c3ddb(0xbb)+_0x2fe323[_0x4c3ddb(0xa2)]+_0x4c3ddb(0xa7)+encodeURIComponent(_0x26da60[_0x4c3ddb(0xa8)]),'description':serializeDryRunDescription({'dataset':{'id':_0x2fe323['id'],'code':_0x2fe323[_0x4c3ddb(0xa2)],'name':_0x2fe323[_0x4c3ddb(0xb4)]},'action':_0x4c3ddb(0xad)})};},async 'execute'(_0x4090ef){const _0x22a8b5=a157_0x2cbda0,_0xbf27e1=await loadDatasetDetailForPage(_0x4090ef),_0x16bcfc=await loadStandardPageStatusForGenerate(_0x4090ef,_0xbf27e1[_0x22a8b5(0xa2)]),_0x59cf8f=getUndeletedRelatedPages(_0xbf27e1),_0x15bea0=assessStandardPageState(_0xbf27e1[_0x22a8b5(0xa2)],_0x16bcfc,{'fallbackUndeletedPages':_0x59cf8f});return{'ok':!![],'data':{'datasetCode':_0xbf27e1[_0x22a8b5(0xa2)],'precheckSource':_0x16bcfc?.[_0x22a8b5(0xb6)]??_0x22a8b5(0xb7),'status':_0x15bea0[_0x22a8b5(0xa4)],'manualResolutionRequired':_0x15bea0['manualResolutionRequired'],'nextAction':_0x15bea0['nextAction'],'standardPageStatus':_0x16bcfc,'relatedPages':{'total':_0xbf27e1[_0x22a8b5(0xbd)]['length'],'undeletedCount':_0x59cf8f[_0x22a8b5(0xaf)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a158_0x5982f1=a158_0x4c44;(function(_0x4b78a1,_0xc80a1){const _0x44a456=a158_0x4c44,_0x329835=_0x4b78a1();while(!![]){try{const _0x348d97=-parseInt(_0x44a456(0x10d))/0x1+parseInt(_0x44a456(0x10a))/0x2*(-parseInt(_0x44a456(0x11a))/0x3)+parseInt(_0x44a456(0x116))/0x4*(-parseInt(_0x44a456(0x119))/0x5)+-parseInt(_0x44a456(0x108))/0x6*(-parseInt(_0x44a456(0x109))/0x7)+-parseInt(_0x44a456(0x11e))/0x8*(parseInt(_0x44a456(0x105))/0x9)+parseInt(_0x44a456(0x10f))/0xa+parseInt(_0x44a456(0x10b))/0xb*(parseInt(_0x44a456(0x110))/0xc);if(_0x348d97===_0xc80a1)break;else _0x329835['push'](_0x329835['shift']());}catch(_0x15e768){_0x329835['push'](_0x329835['shift']());}}}(a158_0x4071,0x2dcb1));function a158_0x4c44(_0x3678ab,_0x7cb979){_0x3678ab=_0x3678ab-0x100;const _0x4071c5=a158_0x4071();let _0x4c4416=_0x4071c5[_0x3678ab];return _0x4c4416;}import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{loadDatasetDetailForPage,prepareDatasetAction,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';import{syncStandardPages}from'../../core/api-client.js';export const pageSync={'service':a158_0x5982f1(0x101),'command':a158_0x5982f1(0x11f),'description':a158_0x5982f1(0x118),'risk':a158_0x5982f1(0x10c),'defaultOutputFormat':'compress','flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a158_0x5982f1(0x114),'type':a158_0x5982f1(0x100),'description':'Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)'}],async 'validate'(_0x187d04){validateDatasetSelector(_0x187d04);},async 'dryRun'(_0x427076){const _0x467833=a158_0x5982f1,_0x107497=await prepare(_0x427076);return{'method':'POST','url':_0x467833(0x11d)+_0x107497[_0x467833(0x115)][_0x467833(0x11b)]+_0x467833(0x103),'body':{'appCode':_0x427076[_0x467833(0x111)]},'description':serializeDryRunDescription({'dataset':{'id':_0x107497[_0x467833(0x115)]['id'],'code':_0x107497['dataset'][_0x467833(0x11b)],'name':_0x107497['dataset']['name'],'fieldCount':_0x107497[_0x467833(0x115)][_0x467833(0x104)]},'relatedPages':{'total':_0x107497[_0x467833(0x115)][_0x467833(0x113)][_0x467833(0x11c)],'undeletedCount':_0x107497[_0x467833(0x10e)][_0x467833(0x11c)]},'action':'sync','reason':_0x107497[_0x467833(0x10e)][_0x467833(0x11c)]+_0x467833(0x117)})};},async 'execute'(_0xb85aac){const _0x6bb581=a158_0x5982f1,_0x514d6b=await prepare(_0xb85aac),_0x5890d2=await syncStandardPages(_0xb85aac[_0x6bb581(0x111)],_0x514d6b[_0x6bb581(0x115)][_0x6bb581(0x11b)]),_0x2c917e=Array[_0x6bb581(0x112)](_0x5890d2[_0x6bb581(0x107)])&&_0x5890d2[_0x6bb581(0x107)][_0x6bb581(0x11c)]>0x0,_0x26f660=_0x2c917e?_0x6bb581(0x106):_0x6bb581(0x102);return{'ok':!![],'message':_0x26f660,'data':{'datasetCode':_0x514d6b[_0x6bb581(0x115)][_0x6bb581(0x11b)],..._0x5890d2}};}};async function prepare(_0x4ebe1b){const _0x3e3bd7=a158_0x5982f1,_0x5e54b6=await loadDatasetDetailForPage(_0x4ebe1b);return prepareDatasetAction(_0x5e54b6,_0x3e3bd7(0x11f));}function a158_0x4071(){const _0x449d03=['48472CpYsCi','\x20undeleted\x20related\x20page(s)\x20found','Sync\x20dataset\x20changes\x20to\x20related\x20Smart\x20List\x20Pages','40dqBOcr','213hgCSBl','code','length','/smartapi/lovrabet/dataset/','632JrrhkH','sync','string','page','同步成功','/sync-to-pages','fieldCount','33291bXVwJH','部分页面同步失败','failedPages','404526hfexOD','21AEZWCf','1574LhhZYo','3997411dryNxq','write','107199WSZpwp','undeletedPages','1741460dBuLTD','12NPBZeo','appCode','isArray','relatedPages','alias','dataset'];a158_0x4071=function(){return _0x449d03;};return a158_0x4071();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x418ff9,_0x46ea66){const _0x409401=a159_0x317b,_0x27623f=_0x418ff9();while(!![]){try{const _0x3655d9=parseInt(_0x409401(0xe5))/0x1+-parseInt(_0x409401(0xde))/0x2*(-parseInt(_0x409401(0xe2))/0x3)+-parseInt(_0x409401(0xdd))/0x4*(parseInt(_0x409401(0xe4))/0x5)+-parseInt(_0x409401(0xda))/0x6*(parseInt(_0x409401(0xdf))/0x7)+-parseInt(_0x409401(0xdb))/0x8*(parseInt(_0x409401(0xdc))/0x9)+parseInt(_0x409401(0xe3))/0xa*(-parseInt(_0x409401(0xe0))/0xb)+parseInt(_0x409401(0xe1))/0xc;if(_0x3655d9===_0x46ea66)break;else _0x27623f['push'](_0x27623f['shift']());}catch(_0x178fa1){_0x27623f['push'](_0x27623f['shift']());}}}(a159_0x2851,0x27d4e));function a159_0x2851(){const _0x322de9=['209340MJZcrx','20rEBZbs','10jeYiVz','304032KkRpBD','51294iqcSzv','72uGRSQK','79911nqqOWE','553792ouLIno','2TwtWdd','91CMNaoD','1760913oVqckh','6929376bPkMTS'];a159_0x2851=function(){return _0x322de9;};return a159_0x2851();}import{permitPageGet}from'../../commands/permit/page-get.js';import{permitPageSet}from'../../commands/permit/page-set.js';import{permitRoleMenus}from'../../commands/permit/role-menus.js';import{permitRoleMenusSet}from'../../commands/permit/role-menus-set.js';function a159_0x317b(_0x4eb0a1,_0x33bd65){_0x4eb0a1=_0x4eb0a1-0xda;const _0x2851f9=a159_0x2851();let _0x317b4b=_0x2851f9[_0x4eb0a1];return _0x317b4b;}import{permitRoleApisSet}from'../../commands/permit/role-apis-set.js';export const permitDefinitions=[permitPageGet,permitPageSet,permitRoleMenus,permitRoleMenusSet,permitRoleApisSet];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a160_0x59f255=a160_0x102c;function a160_0x102c(_0x448da5,_0x46dcf7){_0x448da5=_0x448da5-0x96;const _0x4babd2=a160_0x4bab();let _0x102c57=_0x4babd2[_0x448da5];return _0x102c57;}(function(_0x141dfa,_0x345c99){const _0xd4f99b=a160_0x102c,_0x34e9b3=_0x141dfa();while(!![]){try{const _0x1b1bc0=parseInt(_0xd4f99b(0x9b))/0x1+parseInt(_0xd4f99b(0x9d))/0x2+-parseInt(_0xd4f99b(0xa3))/0x3+parseInt(_0xd4f99b(0x9f))/0x4+parseInt(_0xd4f99b(0x97))/0x5*(parseInt(_0xd4f99b(0x9e))/0x6)+parseInt(_0xd4f99b(0xa2))/0x7*(-parseInt(_0xd4f99b(0x96))/0x8)+-parseInt(_0xd4f99b(0x9a))/0x9*(parseInt(_0xd4f99b(0x98))/0xa);if(_0x1b1bc0===_0x345c99)break;else _0x34e9b3['push'](_0x34e9b3['shift']());}catch(_0x5a32e3){_0x34e9b3['push'](_0x34e9b3['shift']());}}}(a160_0x4bab,0x82545));import{getPagePermit}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{MENU_ID_FLAG,projectPagePermit}from'../../commands/permit/shared.js';export const permitPageGet={'service':a160_0x59f255(0xa0),'command':a160_0x59f255(0xa1),'description':'Show\x20the\x20page\x20permission\x20snapshot\x20for\x20a\x20menu','risk':'read','flags':[MENU_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x2cd705){const _0x50ed0b=a160_0x59f255,_0x4f0b59=_0x2cd705[_0x50ed0b(0x99)](_0x50ed0b(0x9c)),_0x1da8f6=await getPagePermit(_0x4f0b59);return{'ok':!![],'data':{'page':projectPagePermit(_0x1da8f6)},'message':'Page\x20permit\x20for\x20menu\x20'+_0x4f0b59};}};function a160_0x4bab(){const _0x596458=['num','9gtzBZp','333691qqrOAX','menu-id','1401174sJpJDX','18QuipZe','1719380pmcLMj','permit','page-get','5374446KRBrJY','361110IwlNSg','8NQuSOS','609395dGxdoy','4077830BBIuyL'];a160_0x4bab=function(){return _0x596458;};return a160_0x4bab();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a161_0x2b0c69=a161_0x388b;(function(_0x553c08,_0x39e606){const _0x32bc42=a161_0x388b,_0x5f1e1b=_0x553c08();while(!![]){try{const _0x57a60c=parseInt(_0x32bc42(0x1a4))/0x1*(-parseInt(_0x32bc42(0x1bb))/0x2)+parseInt(_0x32bc42(0x1ad))/0x3*(parseInt(_0x32bc42(0x1b6))/0x4)+parseInt(_0x32bc42(0x1b2))/0x5*(parseInt(_0x32bc42(0x199))/0x6)+parseInt(_0x32bc42(0x1b5))/0x7+-parseInt(_0x32bc42(0x1b1))/0x8*(-parseInt(_0x32bc42(0x1aa))/0x9)+parseInt(_0x32bc42(0x1ab))/0xa*(parseInt(_0x32bc42(0x1bd))/0xb)+-parseInt(_0x32bc42(0x1a5))/0xc;if(_0x57a60c===_0x39e606)break;else _0x5f1e1b['push'](_0x5f1e1b['shift']());}catch(_0x552317){_0x5f1e1b['push'](_0x5f1e1b['shift']());}}}(a161_0x6d0c,0xe9f7d));import{getPagePermit,savePagePermit}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a161_0x388b(_0x41876a,_0x48c383){_0x41876a=_0x41876a-0x199;const _0x6d0cd6=a161_0x6d0c();let _0x388b75=_0x6d0cd6[_0x41876a];return _0x388b75;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{MENU_ID_FLAG,PAGE_SET_ROLE_FLAGS,PAGE_SLOT_SPECS,projectPageSlot,resolvePermitRoles,splitList}from'../../commands/permit/shared.js';const SAVE_PATH=a161_0x2b0c69(0x1a2);function a161_0x6d0c(){const _0x4d60c8=['2136042ycGcsa','158890XrQUJP','num','99660DdtACM','validation','Only\x20slots\x20present\x20in\x20`permit\x20page-get`\x20can\x20be\x20set.','selector','8BcQcGd','5FASHGD','Set\x20page\x20permissions\x20for\x20a\x20menu\x20(menu/create/update/delete/detail/export/row\x20roles);\x20requires\x20--yes','menu-id','5950392CYcmvK','176iHMdqc','flag','page-set','label','join','116xVvJui','menuId','649oIvzcz','key','5027718DlxzAi','Pass\x20at\x20least\x20one\x20of:\x20','Pass\x20at\x20least\x20one\x20role,\x20or\x20omit\x20the\x20flag.\x20Clearing\x20permissions\x20is\x20not\x20supported\x20by\x20this\x20command.','This\x20page\x20has\x20no\x20\x22','Nothing\x20to\x20set.','allowSelf','length','push','map','/smartapi/permit/page/save','Updated\x20page\x20permit\x20for\x20menu\x20','23931oYDFCA','23737764CVbdBa','appCode','spec','permit','POST'];a161_0x6d0c=function(){return _0x4d60c8;};return a161_0x6d0c();}function collectRequestedSlots(_0x3555c5){const _0x11a843=a161_0x2b0c69,_0x536dfe=[];for(const _0x34123f of PAGE_SLOT_SPECS){const _0x8b8a9e=_0x3555c5[_0x11a843(0x1b7)](_0x34123f[_0x11a843(0x1b7)]);if(_0x8b8a9e===undefined||_0x8b8a9e===null)continue;const _0x14a42b=splitList(String(_0x8b8a9e));if(_0x14a42b[_0x11a843(0x19f)]===0x0)throw CliErrors['validation']('--'+_0x34123f[_0x11a843(0x1b7)]+'\x20cannot\x20be\x20empty.',_0x11a843(0x19b));_0x536dfe[_0x11a843(0x1a0)]({'spec':_0x34123f,'refs':_0x14a42b});}return _0x536dfe;}async function buildPlan(_0x5c9716,_0x1f2a85){const _0x3a773b=a161_0x2b0c69,_0x1ca63d=_0x5c9716[_0x3a773b(0x1ac)](_0x3a773b(0x1b4)),_0x2c022e=collectRequestedSlots(_0x5c9716);if(_0x2c022e['length']===0x0)throw CliErrors[_0x3a773b(0x1ae)](_0x3a773b(0x19d),'Pass\x20at\x20least\x20one\x20of:\x20'+PAGE_SLOT_SPECS[_0x3a773b(0x1a1)](_0x457687=>'--'+_0x457687[_0x3a773b(0x1b7)])[_0x3a773b(0x1ba)](',\x20')+'.');const _0x39919b=await getPagePermit(_0x1ca63d),_0x747eef={},_0x53d40e={},_0x554930=[];for(const {spec:_0x266c5b,refs:_0x10bf82}of _0x2c022e){const _0x194bf2=_0x39919b[_0x266c5b[_0x3a773b(0x1be)]];if(!_0x194bf2)throw CliErrors['validation'](_0x3a773b(0x19c)+_0x266c5b['label']+'\x22\x20permission\x20slot\x20('+_0x266c5b[_0x3a773b(0x1be)]+').',_0x3a773b(0x1af));_0x747eef[_0x266c5b[_0x3a773b(0x1be)]]=projectPageSlot(_0x194bf2);const _0x406128=await resolvePermitRoles(_0x5c9716[_0x3a773b(0x1a6)],_0x10bf82,{'allowSelf':_0x266c5b[_0x3a773b(0x19e)],'label':_0x266c5b[_0x3a773b(0x1b9)]});_0x194bf2['rolePermit']=_0x406128,_0x53d40e[_0x266c5b[_0x3a773b(0x1be)]]=projectPageSlot(_0x194bf2);}const _0x2bcf1f={'operation':_0x3a773b(0x1b8),'selector':{'appCode':_0x5c9716[_0x3a773b(0x1a6)],'menuId':_0x1ca63d,'slots':_0x2c022e[_0x3a773b(0x1a1)](_0x2eb4a9=>_0x2eb4a9[_0x3a773b(0x1a7)][_0x3a773b(0x1be)])},'before':_0x747eef,'after':_0x53d40e,'dryRun':_0x1f2a85,'backend':{'method':_0x3a773b(0x1a9),'path':SAVE_PATH},'warnings':_0x554930};return{'page':_0x39919b,'mutation':_0x2bcf1f};}export const permitPageSet={'service':a161_0x2b0c69(0x1a8),'command':a161_0x2b0c69(0x1b8),'description':a161_0x2b0c69(0x1b3),'risk':'high-risk-write','flags':[MENU_ID_FLAG,...PAGE_SET_ROLE_FLAGS,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2f11a5){const _0x1f1673=a161_0x2b0c69,_0x499b2e=collectRequestedSlots(_0x2f11a5);if(_0x499b2e['length']===0x0)throw CliErrors[_0x1f1673(0x1ae)](_0x1f1673(0x19d),_0x1f1673(0x19a)+PAGE_SLOT_SPECS[_0x1f1673(0x1a1)](_0x454335=>'--'+_0x454335[_0x1f1673(0x1b7)])[_0x1f1673(0x1ba)](',\x20')+'.');},async 'dryRun'(_0x376627){const _0x636640=a161_0x2b0c69,{mutation:_0x20942c}=await buildPlan(_0x376627,!![]);return asDryRunResult(_0x20942c,{'method':_0x636640(0x1a9),'url':SAVE_PATH});},async 'execute'(_0x4f5f77){const _0x2f9549=a161_0x2b0c69,{page:_0xe87eac,mutation:_0x1a7dbb}=await buildPlan(_0x4f5f77,![]);return await savePagePermit(_0xe87eac),{'ok':!![],'data':_0x1a7dbb,'message':_0x2f9549(0x1a3)+_0x1a7dbb[_0x2f9549(0x1b0)][_0x2f9549(0x1bc)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a162_0x5684ae=a162_0x2207;(function(_0x5f41fd,_0x4c9205){const _0x2015b8=a162_0x2207,_0x53188f=_0x5f41fd();while(!![]){try{const _0x223019=-parseInt(_0x2015b8(0x1a3))/0x1+parseInt(_0x2015b8(0x1bb))/0x2+-parseInt(_0x2015b8(0x1ba))/0x3+-parseInt(_0x2015b8(0x19c))/0x4*(parseInt(_0x2015b8(0x1a1))/0x5)+parseInt(_0x2015b8(0x19f))/0x6+-parseInt(_0x2015b8(0x1a7))/0x7+parseInt(_0x2015b8(0x1be))/0x8;if(_0x223019===_0x4c9205)break;else _0x53188f['push'](_0x53188f['shift']());}catch(_0x29702d){_0x53188f['push'](_0x53188f['shift']());}}}(a162_0x3bd5,0x3162f));import{getRoleApiResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,DATASETS_FLAG,flattenApiResources,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';function a162_0x2207(_0x48f706,_0x53d46f){_0x48f706=_0x48f706-0x19a;const _0x3bd586=a162_0x3bd5();let _0x220774=_0x3bd586[_0x48f706];return _0x220774;}const UPDATE_PATH=a162_0x5684ae(0x19d);async function buildPlan(_0x58c159,_0x204eda){const _0x2ef75e=a162_0x5684ae,_0xb93a25=await resolveRoleRef(_0x58c159[_0x2ef75e(0x1af)],readRoleRef(_0x58c159));assertPermConfigurable(_0xb93a25);if(!_0x58c159[_0x2ef75e(0x19e)](_0x2ef75e(0x1a4)))throw CliErrors[_0x2ef75e(0x1a8)](_0x2ef75e(0x1b4),_0x2ef75e(0x1b8));const _0x5dd45e=splitList(_0x58c159['str']('datasets'));if(_0x5dd45e['length']===0x0)throw CliErrors[_0x2ef75e(0x1a5)](_0x2ef75e(0x1b7),_0x2ef75e(0x1ae));const _0x35a043=await getRoleApiResources(_0x58c159['appCode'],_0xb93a25['id']),{byCode:_0x39da20,byDataset:_0x106030}=flattenApiResources(_0x35a043),_0x497749=_0x5dd45e[_0x2ef75e(0x1b9)](_0x4f9a8a=>!_0x106030[_0x2ef75e(0x1aa)](_0x4f9a8a));if(_0x497749[_0x2ef75e(0x1a9)]>0x0)throw CliErrors[_0x2ef75e(0x1a8)](_0x2ef75e(0x1b5)+_0x497749['join'](',\x20')+'.',_0x2ef75e(0x1ad));const _0x1b3b05=new Map(),_0x2441d7=[],_0x262fe9=[];for(const _0x5e2808 of _0x5dd45e){for(const _0x478dd8 of _0x106030[_0x2ef75e(0x1b3)](_0x5e2808)){const _0x3434dc=_0x39da20['get'](_0x478dd8);_0x1b3b05['set'](_0x478dd8,'0'),_0x2441d7['push']({'resourceCode':_0x478dd8,'datasetCode':_0x5e2808,'action':_0x3434dc[_0x2ef75e(0x1b6)]}),_0x262fe9['push']({'resourceCode':_0x478dd8,'datasetCode':_0x5e2808,'action':'0'});}}const _0x5237d2=buildPermits(_0x39da20,_0x1b3b05),_0x40b84c={'operation':_0x2ef75e(0x1ac),'selector':{'appCode':_0x58c159['appCode'],'roleId':_0xb93a25['id'],'roleName':_0xb93a25['roleName'],'datasetCodes':_0x5dd45e},'before':_0x2441d7,'after':_0x262fe9,'dryRun':_0x204eda,'backend':{'method':_0x2ef75e(0x1ab),'path':UPDATE_PATH,'roleType':'API'},'warnings':[]};return{'role':_0xb93a25,'permits':_0x5237d2,'mutation':_0x40b84c};}export const permitRoleApisSet={'service':a162_0x5684ae(0x1bd),'command':a162_0x5684ae(0x19b),'description':a162_0x5684ae(0x1b0),'risk':a162_0x5684ae(0x1b1),'flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1a93b5){const _0x28f19e=a162_0x5684ae;if(!_0x1a93b5[_0x28f19e(0x19e)](_0x28f19e(0x1a4)))throw CliErrors[_0x28f19e(0x1a8)](_0x28f19e(0x1b4),_0x28f19e(0x1b8));if(splitList(_0x1a93b5['str'](_0x28f19e(0x1b7)))['length']===0x0)throw CliErrors[_0x28f19e(0x1a5)](_0x28f19e(0x1b7),_0x28f19e(0x1ae));},async 'dryRun'(_0x103f5f){const {mutation:_0x583825}=await buildPlan(_0x103f5f,!![]);return asDryRunResult(_0x583825,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x2f4b92){const _0x3fc2e5=a162_0x5684ae,{role:_0x2b98fe,permits:_0x2c3061,mutation:_0x3f76de}=await buildPlan(_0x2f4b92,![]);return await updateAppRole({'id':_0x2b98fe['id'],'appCode':_0x2f4b92[_0x3fc2e5(0x1af)],'roleType':_0x3fc2e5(0x19a),'permits':_0x2c3061}),{'ok':!![],'data':_0x3f76de,'message':_0x3fc2e5(0x1bc)+_0x3f76de[_0x3fc2e5(0x1a6)][_0x3fc2e5(0x1a0)]['length']+_0x3fc2e5(0x1b2)+_0x2b98fe[_0x3fc2e5(0x1a2)]};}};function a162_0x3bd5(){const _0x44cbb0=['datasetCodes','405Jmcgaf','roleName','283942fknZIJ','revoke','flagMissing','selector','834673QTtoJu','validation','length','has','POST','api-revoke','Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.','Pass\x20--datasets\x20<datasetCode,...>.','appCode','Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','high-risk-write','\x20dataset(s)\x20on\x20role\x20','get','Missing\x20--revoke.','Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20','action','datasets','role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).','filter','340833IBSYwN','66348ZvjCgA','Revoked\x20API\x20access\x20for\x20','permit','6064152HjEbIf','API','role-apis-set','5548zJwonr','/smartapi/permit/role/update','bool','241398EYvTXL'];a162_0x3bd5=function(){return _0x44cbb0;};return a162_0x3bd5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a163_0x4eaa9d=a163_0x3ad5;(function(_0x2b246b,_0x2abb33){const _0x5376b3=a163_0x3ad5,_0x2bd902=_0x2b246b();while(!![]){try{const _0x37eddb=-parseInt(_0x5376b3(0x1ad))/0x1+-parseInt(_0x5376b3(0x1b0))/0x2*(-parseInt(_0x5376b3(0x1c1))/0x3)+parseInt(_0x5376b3(0x1aa))/0x4*(-parseInt(_0x5376b3(0x1a8))/0x5)+parseInt(_0x5376b3(0x1be))/0x6+parseInt(_0x5376b3(0x1b3))/0x7*(-parseInt(_0x5376b3(0x19f))/0x8)+parseInt(_0x5376b3(0x1b5))/0x9+parseInt(_0x5376b3(0x1a5))/0xa*(parseInt(_0x5376b3(0x1bc))/0xb);if(_0x37eddb===_0x2abb33)break;else _0x2bd902['push'](_0x2bd902['shift']());}catch(_0x4e1576){_0x2bd902['push'](_0x2bd902['shift']());}}}(a163_0x5b99,0x75612));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a163_0x3ad5(_0x4d21ae,_0x214f2b){_0x4d21ae=_0x4d21ae-0x19f;const _0x5b9993=a163_0x5b99();let _0x3ad594=_0x5b9993[_0x4d21ae];return _0x3ad594;}import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a163_0x4eaa9d(0x1a0);async function buildPlan(_0x5ba980,_0x2e2f6d){const _0x4d8d87=a163_0x4eaa9d,_0x2ba216=await resolveRoleRef(_0x5ba980[_0x4d8d87(0x1ba)],readRoleRef(_0x5ba980));assertPermConfigurable(_0x2ba216);const _0x4917fc=readGrantRevoke(_0x5ba980),_0x31e0f9=splitList(_0x5ba980[_0x4d8d87(0x1ab)](_0x4d8d87(0x1b4)));if(_0x31e0f9[_0x4d8d87(0x1bd)]===0x0)throw CliErrors[_0x4d8d87(0x1b1)](_0x4d8d87(0x1b4),'Pass\x20--menus\x20<resourceCode,...>.');const _0x12911d=await getRoleMenuResources(_0x5ba980[_0x4d8d87(0x1ba)],_0x2ba216['id']),_0xe6b55=flattenMenuResources(_0x12911d),_0x502f90=_0x31e0f9[_0x4d8d87(0x1b6)](_0x5268c2=>!_0xe6b55[_0x4d8d87(0x1a4)](_0x5268c2));if(_0x502f90[_0x4d8d87(0x1bd)]>0x0)throw CliErrors[_0x4d8d87(0x1a2)](_0x4d8d87(0x1ae)+_0x502f90[_0x4d8d87(0x1c2)](',\x20')+'.','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.');const _0x1961a0=new Map(),_0x5d5c26=[],_0x1ddc73=[];for(const _0xd32a57 of _0x31e0f9){const _0x5088ab=_0xe6b55[_0x4d8d87(0x1a9)](_0xd32a57);_0x1961a0[_0x4d8d87(0x1af)](_0xd32a57,_0x4917fc),_0x5d5c26['push']({'resourceCode':_0xd32a57,'action':_0x5088ab[_0x4d8d87(0x1b9)]}),_0x1ddc73['push']({'resourceCode':_0xd32a57,'action':_0x4917fc});}const _0x53a8db=buildPermits(_0xe6b55,_0x1961a0),_0x274000={'operation':_0x4917fc===_0x4d8d87(0x1a7)?_0x4d8d87(0x1b7):_0x4d8d87(0x1ac),'selector':{'appCode':_0x5ba980[_0x4d8d87(0x1ba)],'roleId':_0x2ba216['id'],'roleName':_0x2ba216['roleName'],'resourceCodes':_0x31e0f9},'before':_0x5d5c26,'after':_0x1ddc73,'dryRun':_0x2e2f6d,'backend':{'method':'POST','path':UPDATE_PATH,'roleType':_0x4d8d87(0x1bf)},'warnings':[]};return{'role':_0x2ba216,'permits':_0x53a8db,'mutation':_0x274000};}export const permitRoleMenusSet={'service':a163_0x4eaa9d(0x1a3),'command':'role-menus-set','description':a163_0x4eaa9d(0x1a1),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1b203c){const _0x49bbca=a163_0x4eaa9d;readGrantRevoke(_0x1b203c);if(splitList(_0x1b203c[_0x49bbca(0x1ab)](_0x49bbca(0x1b4)))[_0x49bbca(0x1bd)]===0x0)throw CliErrors[_0x49bbca(0x1b1)]('menus',_0x49bbca(0x1b8));},async 'dryRun'(_0x31adac){const _0x25c257=a163_0x4eaa9d,{mutation:_0x2ef1b4}=await buildPlan(_0x31adac,!![]);return asDryRunResult(_0x2ef1b4,{'method':_0x25c257(0x1c3),'url':UPDATE_PATH});},async 'execute'(_0x3a9de1){const _0x39f90c=a163_0x4eaa9d,{role:_0x1557d4,permits:_0x3da0ea,mutation:_0x479ffb}=await buildPlan(_0x3a9de1,![]);return await updateAppRole({'id':_0x1557d4['id'],'appCode':_0x3a9de1[_0x39f90c(0x1ba)],'roleType':_0x39f90c(0x1bf),'permits':_0x3da0ea}),{'ok':!![],'data':_0x479ffb,'message':'Updated\x20'+_0x479ffb[_0x39f90c(0x1b2)][_0x39f90c(0x1bb)][_0x39f90c(0x1bd)]+_0x39f90c(0x1a6)+_0x1557d4[_0x39f90c(0x1c0)]};}};function a163_0x5b99(){const _0x25d230=['1393HPhmVI','menus','1885185EkOxQG','filter','menu-grant','Pass\x20--menus\x20<resourceCode,...>.','action','appCode','resourceCodes','5114219xpdJeg','length','2465118HtqVcx','PAGE','roleName','3romXbY','join','POST','3592yGXxwh','/smartapi/permit/role/update','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','validation','permit','has','10PsIYLh','\x20menu\x20permit(s)\x20for\x20role\x20','access','74055fhakuk','get','120DUyOnP','str','menu-revoke','359798DBMvxQ','Unknown\x20menu\x20resourceCode(s):\x20','set','578036dDSfWV','flagMissing','selector'];a163_0x5b99=function(){return _0x25d230;};return a163_0x5b99();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a164_0x19002f=a164_0x5544;function a164_0x1851(){const _0x28384d=['filter','allowed','map','2440521onGnPn','appCode','341538XNDHcY','24FILfPx','resourceName','Role\x20','permit','25356iGzsWl','length','98AWMkGT','26534160tmLwRb','125glQWDb','values','roleName','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','8629075wjGRMV','action','role-menus','from','6275624XawniM','412267vGLaGx','\x20has\x20','read'];a164_0x1851=function(){return _0x28384d;};return a164_0x1851();}(function(_0x49ebea,_0x1d22ae){const _0x5b1bc9=a164_0x5544,_0x4864ae=_0x49ebea();while(!![]){try{const _0x3d866a=-parseInt(_0x5b1bc9(0x134))/0x1+parseInt(_0x5b1bc9(0x143))/0x2*(-parseInt(_0x5b1bc9(0x141))/0x3)+-parseInt(_0x5b1bc9(0x133))/0x4+parseInt(_0x5b1bc9(0x145))/0x5*(-parseInt(_0x5b1bc9(0x13c))/0x6)+parseInt(_0x5b1bc9(0x12f))/0x7+parseInt(_0x5b1bc9(0x13d))/0x8*(parseInt(_0x5b1bc9(0x13a))/0x9)+parseInt(_0x5b1bc9(0x144))/0xa;if(_0x3d866a===_0x1d22ae)break;else _0x4864ae['push'](_0x4864ae['shift']());}catch(_0x5e7f63){_0x4864ae['push'](_0x4864ae['shift']());}}}(a164_0x1851,0xd7264));function a164_0x5544(_0x1793d0,_0x39a162){_0x1793d0=_0x1793d0-0x12f;const _0x185143=a164_0x1851();let _0x5544ff=_0x185143[_0x1793d0];return _0x5544ff;}import{getRoleMenuResources}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{flattenMenuResources,readRoleRef,ROLE_REF_FLAG}from'../../commands/permit/shared.js';import{resolveRoleRef}from'../../commands/role/shared.js';export const permitRoleMenus={'service':a164_0x19002f(0x140),'command':a164_0x19002f(0x131),'description':a164_0x19002f(0x148),'risk':a164_0x19002f(0x136),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x28a7f0){const _0x32edd6=a164_0x19002f,_0x55ffb1=await resolveRoleRef(_0x28a7f0[_0x32edd6(0x13b)],readRoleRef(_0x28a7f0)),_0x4e60d7=await getRoleMenuResources(_0x28a7f0[_0x32edd6(0x13b)],_0x55ffb1['id']),_0x5ad6f9=flattenMenuResources(_0x4e60d7),_0x24e926=Array[_0x32edd6(0x132)](_0x5ad6f9[_0x32edd6(0x146)]())[_0x32edd6(0x139)](_0x4237ba=>({'resourceCode':_0x4237ba['resourceCode'],'resourceName':_0x4237ba[_0x32edd6(0x13e)],'allowed':_0x4237ba[_0x32edd6(0x130)]==='access','action':_0x4237ba[_0x32edd6(0x130)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x28a7f0[_0x32edd6(0x13b)],'roleId':_0x55ffb1['id'],'roleName':_0x55ffb1['roleName']},'menus':_0x24e926},'message':_0x32edd6(0x13f)+_0x55ffb1[_0x32edd6(0x147)]+_0x32edd6(0x135)+_0x24e926[_0x32edd6(0x137)](_0x4cbffa=>_0x4cbffa[_0x32edd6(0x138)])[_0x32edd6(0x142)]+'/'+_0x24e926['length']+'\x20menu(s)\x20allowed'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a165_0x20172d=a165_0x5e05;(function(_0x1c8241,_0xf01c31){const _0x29df42=a165_0x5e05,_0x289cb6=_0x1c8241();while(!![]){try{const _0x2d9e5b=parseInt(_0x29df42(0x230))/0x1+parseInt(_0x29df42(0x217))/0x2*(-parseInt(_0x29df42(0x222))/0x3)+-parseInt(_0x29df42(0x208))/0x4*(-parseInt(_0x29df42(0x237))/0x5)+parseInt(_0x29df42(0x21b))/0x6+-parseInt(_0x29df42(0x209))/0x7+parseInt(_0x29df42(0x23b))/0x8*(parseInt(_0x29df42(0x211))/0x9)+-parseInt(_0x29df42(0x21a))/0xa;if(_0x2d9e5b===_0xf01c31)break;else _0x289cb6['push'](_0x289cb6['shift']());}catch(_0x3fbbb0){_0x289cb6['push'](_0x289cb6['shift']());}}}(a165_0x3a07,0xa038a));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':'menu-id','type':a165_0x20172d(0x21c),'required':!![],'description':'Menu\x20id\x20(from\x20`menu\x20list`)'};export const ROLE_REF_FLAG={'name':'role','type':a165_0x20172d(0x1f5),'required':!![],'description':'Role\x20id\x20or\x20role\x20name'};export const GRANT_FLAG={'name':'grant','type':a165_0x20172d(0x1fc),'required':![],'description':a165_0x20172d(0x204)};export const REVOKE_FLAG={'name':'revoke','type':a165_0x20172d(0x1fc),'required':![],'description':'Revoke\x20access\x20to\x20the\x20listed\x20resources'};export const MENUS_FLAG={'name':a165_0x20172d(0x202),'type':a165_0x20172d(0x1f5),'required':!![],'description':a165_0x20172d(0x20c)};export const DATASETS_FLAG={'name':a165_0x20172d(0x212),'type':a165_0x20172d(0x1f5),'required':!![],'description':a165_0x20172d(0x1fd)};export const PAGE_SLOT_SPECS=[{'flag':a165_0x20172d(0x213),'key':a165_0x20172d(0x1f3),'allowSelf':![],'label':'menu\x20visibility'},{'flag':a165_0x20172d(0x228),'key':'dataCreate','allowSelf':![],'label':a165_0x20172d(0x21d)},{'flag':a165_0x20172d(0x216),'key':a165_0x20172d(0x20a),'allowSelf':![],'label':a165_0x20172d(0x22b)},{'flag':a165_0x20172d(0x243),'key':a165_0x20172d(0x1f2),'allowSelf':![],'label':'data\x20delete'},{'flag':a165_0x20172d(0x218),'key':a165_0x20172d(0x221),'allowSelf':![],'label':a165_0x20172d(0x242)},{'flag':a165_0x20172d(0x201),'key':'dataExport','allowSelf':![],'label':a165_0x20172d(0x226)},{'flag':a165_0x20172d(0x23c),'key':a165_0x20172d(0x1fe),'allowSelf':!![],'label':a165_0x20172d(0x1f6)}];function a165_0x5e05(_0x3ab875,_0x2079ab){_0x3ab875=_0x3ab875-0x1f1;const _0x3a073c=a165_0x3a07();let _0x5e05a2=_0x3a073c[_0x3ab875];return _0x5e05a2;}export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a165_0x20172d(0x23f)](_0x598691=>({'name':_0x598691['flag'],'type':a165_0x20172d(0x1f5),'required':![],'description':a165_0x20172d(0x210)+_0x598691[a165_0x20172d(0x22a)]+'\x20(comma-separated\x20SELF/ALL/id/name)'+(_0x598691[a165_0x20172d(0x227)]?a165_0x20172d(0x241):'')}));export function splitList(_0x574b5c){const _0x31dbf7=a165_0x20172d;return _0x574b5c[_0x31dbf7(0x21f)](',')[_0x31dbf7(0x23f)](_0x2a26e3=>_0x2a26e3[_0x31dbf7(0x1fb)]())['filter'](Boolean);}export function projectRoleRef(_0xf61263){const _0x42a7fa=a165_0x20172d;return{'id':_0xf61263['id'],'roleName':_0xf61263['roleName'],'roleType':_0xf61263[_0x42a7fa(0x239)]};}export async function resolvePermitRoles(_0x751b95,_0xea6e7f,_0x1744b4){const _0x1c2e99=a165_0x20172d,_0x386c7f=await listPermitRoles(_0x751b95,{'needSelf':!![],'needPublic':!![]}),_0x1a562f=[];for(const _0x50344c of _0xea6e7f){const _0x1de4bf=resolveOnePermitRole(_0x386c7f,_0x50344c);if(!_0x1744b4[_0x1c2e99(0x227)]&&_0x1de4bf[_0x1c2e99(0x239)]===_0x1c2e99(0x1f4))throw CliErrors[_0x1c2e99(0x225)](_0x1c2e99(0x206)+_0x1744b4[_0x1c2e99(0x22a)]+'.',_0x1c2e99(0x205));if(!_0x1a562f[_0x1c2e99(0x236)](_0x832058=>_0x832058['id']===_0x1de4bf['id']))_0x1a562f[_0x1c2e99(0x1f9)](_0x1de4bf);}return _0x1a562f;}function resolveOnePermitRole(_0x4f71f8,_0x26bcac){const _0x5a2ae2=a165_0x20172d,_0x5dc011=_0x26bcac[_0x5a2ae2(0x1fb)](),_0x3fbc4e=_0x5dc011[_0x5a2ae2(0x223)]();if(_0x3fbc4e===_0x5a2ae2(0x1f4)||_0x3fbc4e===_0x5a2ae2(0x20d)){const _0x5d1e0a=_0x4f71f8[_0x5a2ae2(0x240)](_0x5a7cc4=>_0x5a7cc4[_0x5a2ae2(0x239)]===_0x3fbc4e);if(!_0x5d1e0a)throw CliErrors[_0x5a2ae2(0x225)](_0x5a2ae2(0x232)+_0x3fbc4e+_0x5a2ae2(0x224));return _0x5d1e0a;}if(/^-?\d+$/[_0x5a2ae2(0x229)](_0x5dc011)){const _0x4f3ba3=Number(_0x5dc011),_0x4c9142=_0x4f71f8[_0x5a2ae2(0x240)](_0x356617=>_0x356617['id']===_0x4f3ba3);if(!_0x4c9142)throw CliErrors[_0x5a2ae2(0x225)](_0x5a2ae2(0x1f1)+_0x4f3ba3+_0x5a2ae2(0x20f),_0x5a2ae2(0x23a));return _0x4c9142;}const _0x9babe7=_0x4f71f8[_0x5a2ae2(0x23e)](_0x123af6=>_0x123af6[_0x5a2ae2(0x1ff)]===_0x5dc011);if(_0x9babe7[_0x5a2ae2(0x200)]===0x0)throw CliErrors[_0x5a2ae2(0x225)](_0x5a2ae2(0x207)+_0x5dc011+'\x22\x20not\x20found.','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.');if(_0x9babe7[_0x5a2ae2(0x200)]>0x1)throw CliErrors[_0x5a2ae2(0x225)](_0x5a2ae2(0x207)+_0x5dc011+_0x5a2ae2(0x215)+_0x9babe7[_0x5a2ae2(0x23f)](_0x438e64=>_0x438e64['id'])['join'](',\x20')+').','Disambiguate\x20with\x20an\x20id.');return _0x9babe7[0x0];}export function projectPageSlot(_0x36ec19){const _0x560b13=a165_0x20172d;if(!_0x36ec19)return null;return{'resourceCode':_0x36ec19[_0x560b13(0x1f7)],'roles':(_0x36ec19[_0x560b13(0x22c)]??[])['map'](projectRoleRef)};}export function projectPagePermit(_0x3d380a){const _0x35d5ad=a165_0x20172d,_0x4bfe03={'menuId':_0x3d380a[_0x35d5ad(0x220)],'appCode':_0x3d380a[_0x35d5ad(0x20b)],'menuPermit':projectPageSlot(_0x3d380a[_0x35d5ad(0x1f3)])};for(const _0x2355d0 of PAGE_SLOT_SPECS){if(_0x2355d0[_0x35d5ad(0x1fa)]==='menuPermit')continue;_0x4bfe03[_0x2355d0[_0x35d5ad(0x1fa)]]=projectPageSlot(_0x3d380a[_0x2355d0[_0x35d5ad(0x1fa)]]);}return _0x4bfe03;}export function flattenMenuResources(_0x28e162){const _0x58ee38=new Map(),_0xeeb05e=_0x4f7cca=>{const _0x318b61=a165_0x5e05;for(const _0x48d265 of _0x4f7cca??[]){_0x58ee38[_0x318b61(0x214)](_0x48d265['resourceCode'],{'resourceCode':_0x48d265[_0x318b61(0x1f7)],'resourceName':_0x48d265[_0x318b61(0x22d)],'action':_0x48d265['allowedActions']?.[0x0]??'0'});if(_0x48d265[_0x318b61(0x234)])_0xeeb05e(_0x48d265[_0x318b61(0x234)]);}};return _0xeeb05e(_0x28e162),_0x58ee38;}export function flattenApiResources(_0x18c082){const _0x57abcf=a165_0x20172d,_0x28e1b0=new Map(),_0x5c50b2=new Map();for(const _0x2ec1d1 of _0x18c082){const _0x2d3edb=_0x2ec1d1[_0x57abcf(0x219)]??{};for(const [_0x24f1b3,_0x45e9c9]of Object[_0x57abcf(0x238)](_0x2d3edb)){_0x28e1b0['set'](_0x24f1b3,{'resourceCode':_0x24f1b3,'resourceName':_0x2ec1d1['resourceName'],'datasetCode':_0x2ec1d1[_0x57abcf(0x21e)],'action':_0x45e9c9?.[0x0]??'0'});const _0x4eb361=_0x5c50b2[_0x57abcf(0x1f8)](_0x2ec1d1[_0x57abcf(0x21e)])??[];_0x4eb361[_0x57abcf(0x1f9)](_0x24f1b3),_0x5c50b2[_0x57abcf(0x214)](_0x2ec1d1[_0x57abcf(0x21e)],_0x4eb361);}}return{'byCode':_0x28e1b0,'byDataset':_0x5c50b2};}function a165_0x3a07(){const _0x3353fb=['row\x20visibility','resourceCode','get','push','key','trim','boolean','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','dataPermit','roleName','length','export-roles','menus','Pass\x20--role\x20<id|name>.','Grant\x20access\x20to\x20the\x20listed\x20resources','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','SELF\x20is\x20not\x20allowed\x20for\x20','Role\x20\x22','3140JPbHZx','2533041LZIlZV','dataUpdate','appCode','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','ALL','role','\x20not\x20found.','Roles\x20for\x20','2961495gnSwFo','datasets','menu-roles','set','\x22\x20is\x20ambiguous\x20(ids:\x20','update-roles','38uEIRxz','detail-roles','apiList','3163860lTrPmW','5578692rFsMwe','number','data\x20create','datasetCode','split','menuId','dataDetail','162321aCSKPj','toUpperCase','\x20is\x20not\x20available\x20for\x20this\x20app.','validation','data\x20export','allowSelf','create-roles','test','label','data\x20update','rolePermit','resourceName','grant','Missing\x20action.','1083301bqAgzC','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','Special\x20role\x20','str','pageNodeList','bool','some','130eqNZOx','entries','roleType','Run\x20`role\x20list`.','8iIuHbb','row-roles','revoke','filter','map','find',';\x20SELF\x20=\x20only\x20own\x20rows','data\x20detail','delete-roles','access','Role\x20id\x20','dataDelete','menuPermit','SELF','string'];a165_0x3a07=function(){return _0x3353fb;};return a165_0x3a07();}export function buildPermits(_0x138475,_0x235ae6){const _0x13a964={};for(const [_0xce5fa1,_0xcb289a]of _0x138475){const _0x429757=_0x235ae6['get'](_0xce5fa1)??_0xcb289a['action'];_0x13a964[_0xce5fa1]=[_0x429757];}return _0x13a964;}export function readRoleRef(_0x55c6d0){const _0x139c5d=a165_0x20172d,_0x3521e0=_0x55c6d0[_0x139c5d(0x233)](_0x139c5d(0x20e))[_0x139c5d(0x1fb)]();if(!_0x3521e0)throw CliErrors['flagMissing'](_0x139c5d(0x20e),_0x139c5d(0x203));return _0x3521e0;}export function readGrantRevoke(_0x517d03){const _0x34f5e7=a165_0x20172d,_0x3c1802=_0x517d03[_0x34f5e7(0x235)](_0x34f5e7(0x22e)),_0x344b7a=_0x517d03[_0x34f5e7(0x235)](_0x34f5e7(0x23d));if(_0x3c1802&&_0x344b7a)throw CliErrors[_0x34f5e7(0x225)]('--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.');if(!_0x3c1802&&!_0x344b7a)throw CliErrors[_0x34f5e7(0x225)](_0x34f5e7(0x22f),_0x34f5e7(0x231));return _0x3c1802?_0x34f5e7(0x244):'0';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x53c00d,_0x3379d5){const _0x2da691=a166_0x4acb,_0x19efca=_0x53c00d();while(!![]){try{const _0x2b2c07=parseInt(_0x2da691(0x93))/0x1*(-parseInt(_0x2da691(0x90))/0x2)+-parseInt(_0x2da691(0x92))/0x3*(parseInt(_0x2da691(0x9b))/0x4)+-parseInt(_0x2da691(0xa5))/0x5+-parseInt(_0x2da691(0x94))/0x6*(-parseInt(_0x2da691(0x8d))/0x7)+parseInt(_0x2da691(0x9d))/0x8+parseInt(_0x2da691(0xa1))/0x9+-parseInt(_0x2da691(0x95))/0xa;if(_0x2b2c07===_0x3379d5)break;else _0x19efca['push'](_0x19efca['shift']());}catch(_0x523ed2){_0x19efca['push'](_0x19efca['shift']());}}}(a166_0x5170,0x5c00e));import{existsSync}from'node:fs';import a166_0x4a5742 from'node:path';import a166_0x428e12 from'chalk';function a166_0x4acb(_0x32f4ed,_0x396365){_0x32f4ed=_0x32f4ed-0x8c;const _0x51706f=a166_0x5170();let _0x4acb51=_0x51706f[_0x32f4ed];return _0x4acb51;}function a166_0x5170(){const _0x825294=['trim','log','1854RKfpIZ','resolve','3fYsCBV','563jOtvOl','4363134VmghcD','2602500gLCyRG','Logged\x20in','\x22\x20already\x20exists','cwd','my-app','cyan','1451116GNzSpX','env','3552584sazaIq','√\x20Project\x20Name:\x20','√\x20App\x20Code:\x20','production','4658598UYKUhN','√\x20Login\x20status:\x20','Login\x20failed','string','835540rGHguq','green','7gZJWHH'];a166_0x5170=function(){return _0x825294;};return a166_0x5170();}import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getProjectNameValidationError}from'../../../commands/project/create/project-name.js';export async function guidedCreateProject(_0x2bd69e,_0x4bf4b7,_0x1d576f){const _0x5a4cd3=a166_0x4acb,_0x45d935=_0x5a4cd3(0x99),_0x194e3b=readConfig(),_0x1de5d3=typeof _0x194e3b[_0x5a4cd3(0x9c)]===_0x5a4cd3(0xa4)?_0x194e3b[_0x5a4cd3(0x9c)]:undefined,_0x3e1cc4=await input({'message':'Project\x20name:','default':_0x45d935,'validate':_0x2d245a=>{const _0x339358=_0x5a4cd3,_0x581171=_0x2d245a[_0x339358(0x8e)]()||_0x45d935,_0x366b49=getProjectNameValidationError(_0x581171);if(_0x366b49)return _0x366b49;const _0x44e757=a166_0x4a5742[_0x339358(0x91)](process[_0x339358(0x98)](),_0x581171);if(existsSync(_0x44e757))return'Directory\x20\x22'+_0x581171+_0x339358(0x97);return!![];}});console[_0x5a4cd3(0x8f)](a166_0x428e12[_0x5a4cd3(0x8c)](_0x5a4cd3(0x9e)+a166_0x428e12[_0x5a4cd3(0x9a)](_0x3e1cc4)));const _0x317fe3=await selectSingleAppcode(_0x1d576f);console[_0x5a4cd3(0x8f)](a166_0x428e12[_0x5a4cd3(0x8c)](_0x5a4cd3(0x9f)+a166_0x428e12[_0x5a4cd3(0x9a)](_0x317fe3||'Not\x20set')));if(_0x317fe3){const _0x147cd5=await getIsSessionValid();if(!_0x147cd5){const _0x4eff5d=await confirm({'message':'No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','default':!![]});if(_0x4eff5d){const _0x432bf7=await authServer({'silent':!![]});console[_0x5a4cd3(0x8f)](a166_0x428e12[_0x5a4cd3(0x8c)](_0x5a4cd3(0xa2)+a166_0x428e12[_0x5a4cd3(0x9a)](_0x432bf7?_0x5a4cd3(0x96):_0x5a4cd3(0xa3))));}else console[_0x5a4cd3(0x8f)](a166_0x428e12[_0x5a4cd3(0x8c)](_0x5a4cd3(0xa2)+a166_0x428e12[_0x5a4cd3(0x9a)]('Skipped')));}await _0x2bd69e({'projectName':_0x3e1cc4,'appCode':_0x317fe3,'env':_0x4bf4b7||_0x1de5d3||_0x5a4cd3(0xa0)});}else await _0x2bd69e({'projectName':_0x3e1cc4,'env':_0x4bf4b7||_0x1de5d3||_0x5a4cd3(0xa0)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2144ef,_0x41c61f){const _0x79a852=a167_0x5d98,_0x4a6894=_0x2144ef();while(!![]){try{const _0x49954e=parseInt(_0x79a852(0xd2))/0x1*(parseInt(_0x79a852(0xdd))/0x2)+parseInt(_0x79a852(0xd8))/0x3*(-parseInt(_0x79a852(0xd6))/0x4)+parseInt(_0x79a852(0xd9))/0x5+-parseInt(_0x79a852(0xda))/0x6*(-parseInt(_0x79a852(0xd5))/0x7)+-parseInt(_0x79a852(0xd1))/0x8*(parseInt(_0x79a852(0xd4))/0x9)+parseInt(_0x79a852(0xdc))/0xa+-parseInt(_0x79a852(0xd3))/0xb*(parseInt(_0x79a852(0xdb))/0xc);if(_0x49954e===_0x41c61f)break;else _0x4a6894['push'](_0x4a6894['shift']());}catch(_0x57bb1e){_0x4a6894['push'](_0x4a6894['shift']());}}}(a167_0x5dbe,0x33176));function a167_0x5d98(_0x54c0d8,_0x3b3e04){_0x54c0d8=_0x54c0d8-0xd1;const _0x5dbe18=a167_0x5dbe();let _0x5d983f=_0x5dbe18[_0x54c0d8];return _0x5d983f;}export function formatElapsed(_0x38b38c){const _0x1adedd=a167_0x5d98,_0x2fb807=Date[_0x1adedd(0xd7)]()-_0x38b38c;if(_0x2fb807<0x3e8)return _0x2fb807+'ms';const _0x3bfe4b=(_0x2fb807/0x3e8)['toFixed'](0x2),_0x3b9bae=_0x3bfe4b[_0x1adedd(0xde)](/\.?0+$/u,'');return _0x3b9bae+'s';}function a167_0x5dbe(){const _0x20897a=['217XXqmvO','164362wBXoak','9FFqVyU','2007943HIndZl','12fghpki','now','219852kOTCsp','1852805KKwFIE','6XrLeuJ','120HrRSzh','1680450RebNpF','1364oYPefO','replace','3159256ECXiCd'];a167_0x5dbe=function(){return _0x20897a;};return a167_0x5dbe();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x53fd2d,_0x108c03){const _0x578661=a162_0x44a1,_0x51e41a=_0x53fd2d();while(!![]){try{const _0x1d71da=parseInt(_0x578661(0x151))/0x1*(parseInt(_0x578661(0x168))/0x2)+-parseInt(_0x578661(0x138))/0x3*(parseInt(_0x578661(0x12f))/0x4)+-parseInt(_0x578661(0x130))/0x5*(-parseInt(_0x578661(0x157))/0x6)+parseInt(_0x578661(0x17a))/0x7*(-parseInt(_0x578661(0x15e))/0x8)+parseInt(_0x578661(0x139))/0x9*(parseInt(_0x578661(0x158))/0xa)+parseInt(_0x578661(0x177))/0xb*(parseInt(_0x578661(0x170))/0xc)+-parseInt(_0x578661(0x126))/0xd*(parseInt(_0x578661(0x156))/0xe);if(_0x1d71da===_0x108c03)break;else _0x51e41a['push'](_0x51e41a['shift']());}catch(_0x228762){_0x51e41a['push'](_0x51e41a['shift']());}}}(a162_0x1242,0x1bb5b));import a162_0x2d010c from'path';import a162_0x30089b from'fs';import a162_0x1363af from'chalk';import a162_0x4b9ee7 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';function a162_0x44a1(_0x178f13,_0x386596){_0x178f13=_0x178f13-0x11a;const _0x1242f6=a162_0x1242();let _0x44a19e=_0x1242f6[_0x178f13];return _0x44a19e;}import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x57a24b){const _0x3a7fd1=a162_0x44a1,_0x541a40=await checkCliVersion();(_0x541a40['needsUpgrade']||_0x541a40['belowMinimum'])&&(printCliUpgradeWarning(_0x541a40),assertCliVersionSupported(_0x541a40),logger[_0x3a7fd1(0x124)]('create',_0x3a7fd1(0x125),{'currentVersion':_0x541a40[_0x3a7fd1(0x136)],'stableVersion':_0x541a40[_0x3a7fd1(0x178)],'minimumVersion':_0x541a40['minimumVersion'],'needsUpgrade':_0x541a40['needsUpgrade'],'belowMinimum':_0x541a40['belowMinimum']}));if(_0x57a24b[_0x3a7fd1(0x134)]&&_0x57a24b[_0x3a7fd1(0x160)])await runCreate({'projectName':_0x57a24b['projectCode'],'appCode':_0x57a24b[_0x3a7fd1(0x160)],'env':_0x57a24b[_0x3a7fd1(0x149)]},_0x57a24b);else{if(_0x57a24b['projectCode']){const _0x584a4a=await selectSingleAppcode(_0x57a24b[_0x3a7fd1(0x16e)]);await runCreate({'projectName':_0x57a24b[_0x3a7fd1(0x134)],'appCode':_0x584a4a||undefined,'env':_0x57a24b[_0x3a7fd1(0x149)]},_0x57a24b);}else await guidedCreateProject(_0x47f519=>runCreate(_0x47f519,_0x57a24b),_0x57a24b[_0x3a7fd1(0x149)],_0x57a24b[_0x3a7fd1(0x16e)]);}}async function runCreate(_0x2a714f,_0x2afd91){const _0xb3569d=a162_0x44a1;if(!_0x2a714f[_0xb3569d(0x140)]||_0x2a714f[_0xb3569d(0x140)][_0xb3569d(0x13a)]()==='')throw new Error(_0xb3569d(0x11a));const _0x3e5266=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x3e5266[_0xb3569d(0x135)](_0x2a714f[_0xb3569d(0x140)]))throw new Error(_0xb3569d(0x131));if(_0x2a714f[_0xb3569d(0x140)][_0xb3569d(0x13d)]>0x64)throw new Error(_0xb3569d(0x166));const _0xa658dc=a162_0x2d010c[_0xb3569d(0x171)](process[_0xb3569d(0x146)](),_0x2a714f[_0xb3569d(0x140)]);if(a162_0x30089b[_0xb3569d(0x13f)](_0xa658dc))throw new Error('Project\x20directory\x20'+_0x2a714f[_0xb3569d(0x140)]+_0xb3569d(0x137));try{a162_0x30089b[_0xb3569d(0x153)](a162_0x2d010c[_0xb3569d(0x121)](_0xa658dc),a162_0x30089b[_0xb3569d(0x15b)][_0xb3569d(0x11e)]);}catch{throw new Error(_0xb3569d(0x12d));}logger[_0xb3569d(0x172)](_0xa658dc),logger[_0xb3569d(0x124)](_0xb3569d(0x12c),_0xb3569d(0x175)+_0x2a714f[_0xb3569d(0x140)],{'projectDir':_0xa658dc,'appCode':_0x2a714f[_0xb3569d(0x160)]}),console['log'](),console[_0xb3569d(0x143)](a162_0x1363af['green'](_0xb3569d(0x12a))+_0xb3569d(0x155)+a162_0x1363af['green'](_0x2a714f[_0xb3569d(0x140)])+(_0x2a714f[_0xb3569d(0x160)]?'\x20|\x20AppCode:\x20'+a162_0x1363af[_0xb3569d(0x11c)](_0x2a714f[_0xb3569d(0x160)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x2a714f[_0xb3569d(0x140)])),await updatePackageJsonName(_0x2a714f[_0xb3569d(0x140)]),await runTask(_0xb3569d(0x14e),()=>installDependencies(_0x2a714f['projectName'])),await runTask(_0xb3569d(0x13c),()=>formatProjectCode(_0x2a714f[_0xb3569d(0x140)])),await configureAppCode(_0x2a714f[_0xb3569d(0x140)],_0x2a714f[_0xb3569d(0x160)]||'',_0x2a714f[_0xb3569d(0x149)]);let _0x3019ad=![];if(_0x2a714f[_0xb3569d(0x160)]){console['log'](_0xb3569d(0x14a));const _0x354bd0=process[_0xb3569d(0x146)]();try{process[_0xb3569d(0x16a)](_0xa658dc);const _0x538328=_0x2a714f[_0xb3569d(0x149)]||_0xb3569d(0x174);initEnv(_0x538328);const {configArray:_0x538d33}=await fetchModelList(_0x2a714f[_0xb3569d(0x160)],_0x2afd91[_0xb3569d(0x16e)]||''),_0xf50104=DEFAULT_API_DIR,_0x3268cf=await generateApiFile(_0x538d33,'',_0x2a714f[_0xb3569d(0x160)],!![],_0x538328,_0xf50104);console[_0xb3569d(0x143)](_0xb3569d(0x145)+_0x538d33[_0xb3569d(0x13d)]+_0xb3569d(0x141)+_0x3268cf[_0xb3569d(0x150)]+_0xb3569d(0x15a)),logger[_0xb3569d(0x124)](_0xb3569d(0x12c),_0xb3569d(0x133)+_0x2a714f[_0xb3569d(0x160)]);}catch(_0x2160b3){_0x3019ad=!![],console['log'](_0xb3569d(0x17d)),logger['warn']('create',_0xb3569d(0x129),{'error':_0x2160b3 instanceof Error?_0x2160b3['message']:String(_0x2160b3)});}finally{process[_0xb3569d(0x16a)](_0x354bd0);}}logger[_0xb3569d(0x123)](_0xb3569d(0x12c),'项目创建完成:\x20'+_0x2a714f[_0xb3569d(0x140)]),console[_0xb3569d(0x143)](),console[_0xb3569d(0x143)](a162_0x1363af[_0xb3569d(0x14f)]('─'[_0xb3569d(0x16b)](0x3c))),console[_0xb3569d(0x143)](a162_0x1363af[_0xb3569d(0x11c)][_0xb3569d(0x162)](_0xb3569d(0x15c))),console[_0xb3569d(0x143)](),console['log'](_0xb3569d(0x127)+a162_0x1363af[_0xb3569d(0x11c)][_0xb3569d(0x162)](_0xb3569d(0x12b)+_0x2a714f[_0xb3569d(0x140)]+_0xb3569d(0x161)+CLI_BIN_NAME+'\x20run\x20start')),_0x3019ad&&console['log'](_0xb3569d(0x120)+a162_0x1363af['cyan']['bold'](CLI_BIN_NAME+_0xb3569d(0x11b))),console[_0xb3569d(0x143)](a162_0x1363af[_0xb3569d(0x14f)]('─'[_0xb3569d(0x16b)](0x3c)));}catch(_0xaf5887){logger[_0xb3569d(0x15f)](_0xb3569d(0x12c),_0xb3569d(0x16d)+_0x2a714f[_0xb3569d(0x140)],{'error':_0xaf5887 instanceof Error?_0xaf5887['message']:String(_0xaf5887)});try{a162_0x30089b['existsSync'](_0xa658dc)&&(console[_0xb3569d(0x143)](_0xb3569d(0x14c)+_0xa658dc),a162_0x30089b[_0xb3569d(0x169)](_0xa658dc,{'recursive':!![],'force':!![]}));}catch{logger['warn']('create',_0xb3569d(0x13b)+_0xa658dc);}throw _0xaf5887;}}async function runTask(_0x15eb10,_0xc83a93){const _0x368fb2=a162_0x44a1,_0x111c46=a162_0x4b9ee7(_0x15eb10+'...')['start']();try{const _0x517c1a=await _0xc83a93();_0x111c46[_0x368fb2(0x14b)](),console[_0x368fb2(0x143)](''+a162_0x1363af[_0x368fb2(0x14f)](_0x368fb2(0x12a))+_0x15eb10+'\x20'+a162_0x1363af[_0x368fb2(0x165)]('['+_0x517c1a+']'));}catch(_0x31bf22){_0x111c46[_0x368fb2(0x167)](_0x15eb10);throw _0x31bf22;}}async function updatePackageJsonName(_0x2e377d){const _0x4f2331=a162_0x44a1,_0x2621ce=a162_0x2d010c['resolve'](process['cwd'](),_0x2e377d),_0x527d53=a162_0x2d010c[_0x4f2331(0x12e)](_0x2621ce,'package.json');try{console[_0x4f2331(0x143)](_0x4f2331(0x128));const _0x471fe8=getRabetbaseCliPackageRoot(),_0x2791ff=a162_0x2d010c[_0x4f2331(0x12e)](_0x471fe8,_0x4f2331(0x147));let _0x499127=_0x4f2331(0x148);try{const _0xb7c96b=JSON[_0x4f2331(0x17b)](a162_0x30089b['readFileSync'](_0x2791ff,_0x4f2331(0x132)));_0x499127=_0xb7c96b[_0x4f2331(0x144)]||_0x4f2331(0x148);}catch{}const _0x1a7f73=a162_0x30089b['readFileSync'](_0x527d53,_0x4f2331(0x132)),_0x1ef9db=JSON['parse'](_0x1a7f73);_0x1ef9db['name']=_0x2e377d,_0x1ef9db[_0x4f2331(0x179)]=_0x2e377d+_0x4f2331(0x122)+_0x499127,a162_0x30089b['writeFileSync'](_0x527d53,JSON[_0x4f2331(0x16f)](_0x1ef9db,null,0x2)+'\x0a',_0x4f2331(0x132)),console[_0x4f2331(0x143)](_0x4f2331(0x159)+_0x2e377d),logger[_0x4f2331(0x124)](_0x4f2331(0x12c),'更新\x20package.json\x20name');}catch(_0x1b4ee4){logger['error']('create',_0x4f2331(0x173));throw _0x1b4ee4;}}async function configureAppCode(_0x4b9287,_0x44c3e6,_0x3eeab9){const _0x828da=a162_0x44a1,_0x3da33f=a162_0x2d010c[_0x828da(0x171)](process[_0x828da(0x146)](),_0x4b9287),_0x3e7dbe=a162_0x2d010c[_0x828da(0x12e)](_0x3da33f,NEW_CONFIG_NAME);try{_0x44c3e6?console['log'](_0x828da(0x164)+_0x4b9287+':\x20'+_0x44c3e6):console['log']('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x4b9287);const _0x3b085f=getRabetbaseCliPackageRoot(),_0x18ca75=a162_0x2d010c[_0x828da(0x12e)](_0x3b085f,'package.json');let _0x729d5=_0x828da(0x148);try{const _0xdd2656=JSON[_0x828da(0x17b)](a162_0x30089b[_0x828da(0x13e)](_0x18ca75,'utf8'));_0x729d5=_0xdd2656[_0x828da(0x144)]||_0x828da(0x148);}catch{}const _0x6d2170=readConfig(),_0x1ee105=typeof _0x6d2170[_0x828da(0x149)]===_0x828da(0x154)?_0x6d2170[_0x828da(0x149)]:undefined,_0x932c9={};for(const _0x38179f of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x6d2170[_0x38179f]!=null)_0x932c9[_0x38179f]=_0x6d2170[_0x38179f];}const _0x22f167=buildCanonicalProjectConfig(_0x932c9,{'appCodes':_0x44c3e6?[_0x44c3e6]:[],'env':_0x3eeab9||_0x1ee105||_0x828da(0x174),'metadata':{'createdAt':new Date()[_0x828da(0x152)](),'version':_0x729d5}});writeConfigFile(_0x3e7dbe,_0x22f167),_0x44c3e6?console['log'](_0x828da(0x11d)+Object[_0x828da(0x176)](_0x22f167[_0x828da(0x163)]||{})['join'](',\x20')+_0x828da(0x142)+_0x22f167[_0x828da(0x16c)]):console[_0x828da(0x143)](_0x828da(0x11f)+CLI_BIN_NAME+_0x828da(0x14d)),logger[_0x828da(0x124)](_0x828da(0x12c),_0x828da(0x17c)+_0x44c3e6);}catch(_0x53450f){logger[_0x828da(0x15f)](_0x828da(0x12c),_0x828da(0x15d));}}function a162_0x1242(){const _0x5ce11b=['Format\x20code','length','readFileSync','existsSync','projectName','\x20dataset(s),\x20generated\x20','\x20|\x20Default:\x20','log','version','√\x20Pulled\x20','cwd','package.json','1.0.0','env','*\x20Pulling\x20API\x20configuration...','stop','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','Install\x20dependencies','green','modelCount','3Lhsuls','toLocaleString','accessSync','string','Project\x20name:\x20','60606eAQniC','331332MbPUqL','379550YBEOpk','√\x20package.json\x20updated:\x20name=','\x20model(s)','constants','🚀\x20Next\x20Steps:','配置应用AppCode失败','152CTVPGv','error','appCode','\x20&&\x20','bold','apps','*\x20Configuring\x20AppCode\x20for\x20project\x20','gray','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','fail','4514xEzsFP','rmSync','chdir','repeat','defaultApp','项目创建失败:\x20','cookie','stringify','80364GLIjHE','resolve','setLogPath','更新\x20package.json\x20失败','production','开始创建项目:\x20','keys','341SCVRhi','stableVersion','description','46984hRLUDU','parse','配置应用AppCode:\x20','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','Project\x20name\x20cannot\x20be\x20empty','\x20api\x20pull','cyan','√\x20Configuration\x20file\x20created,\x20Apps:\x20','W_OK','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','\x20\x202.\x20Pull\x20API\x20configuration:\x20','dirname','\x20Generated\x20by\x20rabetbase\x20cli\x20','success','info','CLI\x20版本检查','637luwwlT','\x20\x201.\x20Start\x20project:\x20','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','API\x20配置拉取异常','\x20√\x20','cd\x20','create','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','join','52JzUkwW','5RnzwMv','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','utf8','API\x20configuration\x20pulled:\x20','projectCode','test','currentVersion','\x20already\x20exists','1437tTrIHn','45MNAwaB','trim','清理项目目录失败:\x20'];a162_0x1242=function(){return _0x5ce11b;};return a162_0x1242();}
|
|
1
|
+
(function(_0x5a4836,_0x1a3efa){const _0x1c3074=a168_0x1356,_0xb45f2e=_0x5a4836();while(!![]){try{const _0x3f76ce=parseInt(_0x1c3074(0x1be))/0x1*(parseInt(_0x1c3074(0x195))/0x2)+-parseInt(_0x1c3074(0x171))/0x3*(parseInt(_0x1c3074(0x1a5))/0x4)+parseInt(_0x1c3074(0x19e))/0x5+parseInt(_0x1c3074(0x18a))/0x6+parseInt(_0x1c3074(0x1c1))/0x7*(parseInt(_0x1c3074(0x1b0))/0x8)+-parseInt(_0x1c3074(0x189))/0x9*(-parseInt(_0x1c3074(0x1c2))/0xa)+-parseInt(_0x1c3074(0x1d5))/0xb;if(_0x3f76ce===_0x1a3efa)break;else _0xb45f2e['push'](_0xb45f2e['shift']());}catch(_0x241292){_0xb45f2e['push'](_0xb45f2e['shift']());}}}(a168_0x541e,0x90468));import a168_0x52c8d1 from'path';import a168_0x25765f from'fs';import a168_0x37817f from'chalk';import a168_0xb6b12c from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';import{validateProjectName}from'../../../commands/project/create/project-name.js';function readDirectoryIdentity(_0x530071){const _0x31bf97=a168_0x1356;try{const _0x367007=a168_0x25765f[_0x31bf97(0x1aa)](_0x530071);if(!_0x367007[_0x31bf97(0x1c4)]())return null;return{'dev':_0x367007[_0x31bf97(0x198)],'ino':_0x367007[_0x31bf97(0x17b)]};}catch{return null;}}export async function createApp(_0x12df20){const _0x469bff=a168_0x1356,_0x599d4a=await checkCliVersion();(_0x599d4a[_0x469bff(0x1d2)]||_0x599d4a['belowMinimum'])&&(printCliUpgradeWarning(_0x599d4a),assertCliVersionSupported(_0x599d4a),logger['info'](_0x469bff(0x1c5),'CLI\x20版本检查',{'currentVersion':_0x599d4a[_0x469bff(0x17e)],'stableVersion':_0x599d4a[_0x469bff(0x1cc)],'minimumVersion':_0x599d4a['minimumVersion'],'needsUpgrade':_0x599d4a['needsUpgrade'],'belowMinimum':_0x599d4a[_0x469bff(0x179)]}));if(_0x12df20[_0x469bff(0x1cd)]&&(_0x12df20['appCode']||_0x12df20['nonInteractive']))await runCreate({'projectName':_0x12df20[_0x469bff(0x1cd)],'appCode':_0x12df20[_0x469bff(0x1bf)],'env':_0x12df20[_0x469bff(0x173)]},_0x12df20);else{if(_0x12df20['projectCode']){const _0x54e70f=await selectSingleAppcode(_0x12df20['cookie']);await runCreate({'projectName':_0x12df20[_0x469bff(0x1cd)],'appCode':_0x54e70f||undefined,'env':_0x12df20[_0x469bff(0x173)]},_0x12df20);}else await guidedCreateProject(_0x1ff779=>runCreate(_0x1ff779,_0x12df20),_0x12df20[_0x469bff(0x173)],_0x12df20[_0x469bff(0x19c)]);}}function a168_0x541e(){const _0x1e6aa=['1417950PtQquP','downloading','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','配置应用AppCode:\x20','toLocaleString','chdir','项目创建完成:\x20','2037768wrhDKZ','\x20|\x20AppCode:\x20','utf8','\x20dataset(s),\x20generated\x20','parse','lstatSync','\x20config\x20set\x20appcode\x20<app-code>\x27','Install\x20dependencies','Format\x20code','Project\x20template\x20ready','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','32XYZwmb','text','length','√\x20Configuration\x20file\x20created,\x20Apps:\x20','清理项目目录失败:\x20','existsSync','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','gray','modelCount','defaultApp','cyan','writeFileSync','Project\x20name:\x20','name','38803DufZAP','appCode','readFileSync','1427797MpUGDn','11127230nXtHkX','description','isDirectory','create','\x20√\x20','\x20&&\x20','跳过清理:项目目录所有权已变化:\x20','verifying','\x20\x201.\x20Start\x20project:\x20','stringify','stableVersion','projectCode','Downloading\x20project\x20template','cd\x20','repeat','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','needsUpgrade','error','resolving','10819446DNULUz','resolve','success','rmSync','W_OK','\x20run\x20start','...','6VmruEN','log','env','projectName','info','warn','constants','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','belowMinimum','\x20\x202.\x20Pull\x20API\x20configuration:\x20','ino','\x20api\x20pull','accessSync','currentVersion','Project\x20directory\x20','production','更新\x20package.json\x20失败','message','package.json','apps','配置应用AppCode失败','version','API\x20configuration\x20pulled:\x20','\x20Generated\x20by\x20rabetbase\x20cli\x20','9xprZJv','191988kMeSXw','\x20model(s)','stop','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','🚀\x20Next\x20Steps:','start','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','\x20already\x20exists','√\x20Pulled\x20','1.0.0','Extracting\x20project\x20template','18jZIPsA','cwd','green','dev','*\x20Pulling\x20API\x20configuration...','bold','API\x20配置拉取异常','cookie','join'];a168_0x541e=function(){return _0x1e6aa;};return a168_0x541e();}async function runCreate(_0xbae7e2,_0x2d9cec){const _0x5cce00=a168_0x1356;_0xbae7e2[_0x5cce00(0x174)]=validateProjectName(_0xbae7e2[_0x5cce00(0x174)]);const _0x3ed98b=a168_0x52c8d1[_0x5cce00(0x1d6)](process[_0x5cce00(0x196)](),_0xbae7e2[_0x5cce00(0x174)]);if(a168_0x25765f[_0x5cce00(0x1b5)](_0x3ed98b))throw new Error(_0x5cce00(0x17f)+_0xbae7e2[_0x5cce00(0x174)]+_0x5cce00(0x191));let _0x2d08b2=null;try{a168_0x25765f[_0x5cce00(0x17d)](a168_0x52c8d1['dirname'](_0x3ed98b),a168_0x25765f[_0x5cce00(0x177)][_0x5cce00(0x16e)]);}catch{throw new Error(_0x5cce00(0x1d1));}logger[_0x5cce00(0x175)](_0x5cce00(0x1c5),'开始创建项目:\x20'+_0xbae7e2['projectName'],{'projectDir':_0x3ed98b,'appCode':_0xbae7e2['appCode']}),console[_0x5cce00(0x172)](),console[_0x5cce00(0x172)](a168_0x37817f['green'](_0x5cce00(0x1c6))+_0x5cce00(0x1bc)+a168_0x37817f[_0x5cce00(0x197)](_0xbae7e2['projectName'])+(_0xbae7e2[_0x5cce00(0x1bf)]?_0x5cce00(0x1a6)+a168_0x37817f[_0x5cce00(0x1ba)](_0xbae7e2['appCode']):''));try{await runTask('Resolving\x20project\x20template',_0x5cccf3=>copyProjectTemplate(_0xbae7e2[_0x5cce00(0x174)],_0xd457cd=>_0x5cccf3(projectTemplateStageLabel(_0xd457cd))),_0x5cce00(0x1ae)),_0x2d08b2=readDirectoryIdentity(_0x3ed98b);if(!_0x2d08b2)throw new Error(_0x5cce00(0x178));await updatePackageJsonName(_0xbae7e2[_0x5cce00(0x174)]),await runTask(_0x5cce00(0x1ac),()=>installDependencies(_0xbae7e2[_0x5cce00(0x174)])),await runTask(_0x5cce00(0x1ad),()=>formatProjectCode(_0xbae7e2[_0x5cce00(0x174)])),await configureAppCode(_0xbae7e2['projectName'],_0xbae7e2[_0x5cce00(0x1bf)]||'',_0xbae7e2[_0x5cce00(0x173)]);let _0x477f96=![];if(_0xbae7e2[_0x5cce00(0x1bf)]){console[_0x5cce00(0x172)](_0x5cce00(0x199));const _0x5fb2d6=process[_0x5cce00(0x196)]();try{process[_0x5cce00(0x1a3)](_0x3ed98b);const _0x391703=_0xbae7e2[_0x5cce00(0x173)]||_0x5cce00(0x180);initEnv(_0x391703);const {configArray:_0x1c82e1}=await fetchModelList(_0xbae7e2['appCode'],_0x2d9cec[_0x5cce00(0x19c)]||''),_0x418992=DEFAULT_API_DIR,_0x30c2b0=await generateApiFile(_0x1c82e1,'',_0xbae7e2['appCode'],!![],_0x391703,_0x418992);console[_0x5cce00(0x172)](_0x5cce00(0x192)+_0x1c82e1[_0x5cce00(0x1b2)]+_0x5cce00(0x1a8)+_0x30c2b0[_0x5cce00(0x1b8)]+_0x5cce00(0x18b)),logger[_0x5cce00(0x175)](_0x5cce00(0x1c5),_0x5cce00(0x187)+_0xbae7e2[_0x5cce00(0x1bf)]);}catch(_0x156586){_0x477f96=!![],console[_0x5cce00(0x172)](_0x5cce00(0x1b6)),logger[_0x5cce00(0x176)]('create',_0x5cce00(0x19b),{'error':_0x156586 instanceof Error?_0x156586['message']:String(_0x156586)});}finally{process[_0x5cce00(0x1a3)](_0x5fb2d6);}}logger['setLogPath'](_0x3ed98b),logger[_0x5cce00(0x1d7)](_0x5cce00(0x1c5),_0x5cce00(0x1a4)+_0xbae7e2['projectName']),console[_0x5cce00(0x172)](),console[_0x5cce00(0x172)](a168_0x37817f[_0x5cce00(0x197)]('─'['repeat'](0x3c))),console[_0x5cce00(0x172)](a168_0x37817f['cyan'][_0x5cce00(0x19a)](_0x5cce00(0x18e))),console[_0x5cce00(0x172)](),console[_0x5cce00(0x172)](_0x5cce00(0x1ca)+a168_0x37817f['cyan'][_0x5cce00(0x19a)](_0x5cce00(0x1cf)+_0xbae7e2[_0x5cce00(0x174)]+_0x5cce00(0x1c7)+CLI_BIN_NAME+_0x5cce00(0x16f))),_0x477f96&&console[_0x5cce00(0x172)](_0x5cce00(0x17a)+a168_0x37817f[_0x5cce00(0x1ba)][_0x5cce00(0x19a)](CLI_BIN_NAME+_0x5cce00(0x17c))),console['log'](a168_0x37817f[_0x5cce00(0x197)]('─'[_0x5cce00(0x1d0)](0x3c)));}catch(_0x44a90a){logger[_0x5cce00(0x1d3)](_0x5cce00(0x1c5),'项目创建失败:\x20'+_0xbae7e2[_0x5cce00(0x174)],{'error':_0x44a90a instanceof Error?_0x44a90a[_0x5cce00(0x182)]:String(_0x44a90a)});try{const _0x55f024=readDirectoryIdentity(_0x3ed98b);if(_0x2d08b2&&_0x55f024?.[_0x5cce00(0x198)]===_0x2d08b2[_0x5cce00(0x198)]&&_0x55f024[_0x5cce00(0x17b)]===_0x2d08b2[_0x5cce00(0x17b)])console[_0x5cce00(0x172)](_0x5cce00(0x190)+_0x3ed98b),a168_0x25765f[_0x5cce00(0x1d8)](_0x3ed98b,{'recursive':!![],'force':!![]});else _0x55f024&&logger[_0x5cce00(0x176)](_0x5cce00(0x1c5),_0x5cce00(0x1c8)+_0x3ed98b);}catch{logger['warn'](_0x5cce00(0x1c5),_0x5cce00(0x1b4)+_0x3ed98b);}throw _0x44a90a;}}async function runTask(_0x7032e,_0x2896d1,_0x2a60df=_0x7032e){const _0x50aa55=a168_0x1356,_0x1bb425=a168_0xb6b12c(_0x7032e+_0x50aa55(0x170))[_0x50aa55(0x18f)]();try{const _0x2d50d9=await _0x2896d1(_0xad49ca=>{const _0x2a0ec6=_0x50aa55;_0x1bb425[_0x2a0ec6(0x1b1)]=_0xad49ca+_0x2a0ec6(0x170);});_0x1bb425[_0x50aa55(0x18c)](),console['log'](''+a168_0x37817f[_0x50aa55(0x197)]('\x20√\x20')+_0x2a60df+'\x20'+a168_0x37817f[_0x50aa55(0x1b7)]('['+_0x2d50d9+']'));}catch(_0x4bde86){_0x1bb425['fail'](_0x7032e);throw _0x4bde86;}}function projectTemplateStageLabel(_0x2bbd41){const _0x5ca193=a168_0x1356;switch(_0x2bbd41){case _0x5ca193(0x1d4):return'Resolving\x20project\x20template';case _0x5ca193(0x19f):return _0x5ca193(0x1ce);case _0x5ca193(0x1c9):return'Verifying\x20project\x20template';case'extracting':return _0x5ca193(0x194);}}function a168_0x1356(_0x283d8d,_0x8e1cb9){_0x283d8d=_0x283d8d-0x16e;const _0x541efb=a168_0x541e();let _0x13568d=_0x541efb[_0x283d8d];return _0x13568d;}async function updatePackageJsonName(_0xf4e2d4){const _0x15968d=a168_0x1356,_0x5bad68=a168_0x52c8d1[_0x15968d(0x1d6)](process[_0x15968d(0x196)](),_0xf4e2d4),_0xcf8efb=a168_0x52c8d1[_0x15968d(0x19d)](_0x5bad68,_0x15968d(0x183));try{console[_0x15968d(0x172)](_0x15968d(0x18d));const _0x29620b=getRabetbaseCliPackageRoot(),_0x43fcb0=a168_0x52c8d1[_0x15968d(0x19d)](_0x29620b,'package.json');let _0x405c32=_0x15968d(0x193);try{const _0x15e0da=JSON[_0x15968d(0x1a9)](a168_0x25765f[_0x15968d(0x1c0)](_0x43fcb0,_0x15968d(0x1a7)));_0x405c32=_0x15e0da[_0x15968d(0x186)]||_0x15968d(0x193);}catch{}const _0x6d5293=a168_0x25765f[_0x15968d(0x1c0)](_0xcf8efb,'utf8'),_0x4e38c8=JSON['parse'](_0x6d5293);_0x4e38c8[_0x15968d(0x1bd)]=_0xf4e2d4,_0x4e38c8[_0x15968d(0x1c3)]=_0xf4e2d4+_0x15968d(0x188)+_0x405c32,a168_0x25765f[_0x15968d(0x1bb)](_0xcf8efb,JSON[_0x15968d(0x1cb)](_0x4e38c8,null,0x2)+'\x0a',_0x15968d(0x1a7)),console[_0x15968d(0x172)]('√\x20package.json\x20updated:\x20name='+_0xf4e2d4),logger[_0x15968d(0x175)](_0x15968d(0x1c5),'更新\x20package.json\x20name');}catch(_0x2638c5){logger[_0x15968d(0x1d3)](_0x15968d(0x1c5),_0x15968d(0x181));throw _0x2638c5;}}async function configureAppCode(_0xe0fee7,_0x4a5748,_0x5f3c42){const _0x1eefd0=a168_0x1356,_0x1646e5=a168_0x52c8d1['resolve'](process['cwd'](),_0xe0fee7),_0x1328d8=a168_0x52c8d1[_0x1eefd0(0x19d)](_0x1646e5,NEW_CONFIG_NAME);try{_0x4a5748?console[_0x1eefd0(0x172)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0xe0fee7+':\x20'+_0x4a5748):console['log'](_0x1eefd0(0x1a0)+_0xe0fee7);const _0x15a916=getRabetbaseCliPackageRoot(),_0x226f85=a168_0x52c8d1[_0x1eefd0(0x19d)](_0x15a916,_0x1eefd0(0x183));let _0x293643='1.0.0';try{const _0xf49a6f=JSON['parse'](a168_0x25765f['readFileSync'](_0x226f85,_0x1eefd0(0x1a7)));_0x293643=_0xf49a6f['version']||_0x1eefd0(0x193);}catch{}const _0x5c98d5=readConfig(),_0x57caf2=typeof _0x5c98d5['env']==='string'?_0x5c98d5[_0x1eefd0(0x173)]:undefined,_0x3f5544={};for(const _0x4573a3 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x5c98d5[_0x4573a3]!=null)_0x3f5544[_0x4573a3]=_0x5c98d5[_0x4573a3];}const _0x2d2d4b=buildCanonicalProjectConfig(_0x3f5544,{'appCodes':_0x4a5748?[_0x4a5748]:[],'env':_0x5f3c42||_0x57caf2||_0x1eefd0(0x180),'metadata':{'createdAt':new Date()[_0x1eefd0(0x1a2)](),'version':_0x293643}});writeConfigFile(_0x1328d8,_0x2d2d4b),_0x4a5748?console[_0x1eefd0(0x172)](_0x1eefd0(0x1b3)+Object['keys'](_0x2d2d4b[_0x1eefd0(0x184)]||{})[_0x1eefd0(0x19d)](',\x20')+'\x20|\x20Default:\x20'+_0x2d2d4b[_0x1eefd0(0x1b9)]):console[_0x1eefd0(0x172)](_0x1eefd0(0x1af)+CLI_BIN_NAME+_0x1eefd0(0x1ab)),logger['info'](_0x1eefd0(0x1c5),_0x1eefd0(0x1a1)+_0x4a5748);}catch(_0x1e9d2b){logger['error']('create',_0x1eefd0(0x185));throw _0x1e9d2b;}}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ProjectTemplateMaterialization {
|
|
2
|
+
source: "cdn";
|
|
3
|
+
version: string;
|
|
4
|
+
}
|
|
5
|
+
export type ProjectTemplateStage = "resolving" | "downloading" | "verifying" | "extracting";
|
|
6
|
+
export type ProjectTemplateProgress = (stage: ProjectTemplateStage) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Materialize the project template into a new target directory.
|
|
9
|
+
* CDN is the single source for project templates.
|
|
10
|
+
*/
|
|
11
|
+
export declare function materializeProjectTemplate(projectDir: string, onProgress?: ProjectTemplateProgress): Promise<ProjectTemplateMaterialization>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a169_0x5b2af7=a169_0x3471;(function(_0x37d60a,_0x2d5f20){const _0x1ebea7=a169_0x3471,_0x3d12bb=_0x37d60a();while(!![]){try{const _0x37a225=-parseInt(_0x1ebea7(0x1f0))/0x1*(parseInt(_0x1ebea7(0x1e8))/0x2)+-parseInt(_0x1ebea7(0x1c2))/0x3+parseInt(_0x1ebea7(0x1e7))/0x4+parseInt(_0x1ebea7(0x1c7))/0x5+-parseInt(_0x1ebea7(0x1c8))/0x6*(parseInt(_0x1ebea7(0x1f7))/0x7)+parseInt(_0x1ebea7(0x1c9))/0x8*(-parseInt(_0x1ebea7(0x1fc))/0x9)+-parseInt(_0x1ebea7(0x1fa))/0xa*(-parseInt(_0x1ebea7(0x1d4))/0xb);if(_0x37a225===_0x2d5f20)break;else _0x3d12bb['push'](_0x3d12bb['shift']());}catch(_0x1a47e5){_0x3d12bb['push'](_0x3d12bb['shift']());}}}(a169_0x53cd,0xc9b6e));import{createHash}from'node:crypto';import a169_0x32b02e from'node:fs/promises';import a169_0x5b8fba from'node:path';import{PROJECT_TEMPLATE_ASSET_BASE_URL}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{getRabetbaseCdnConfig}from'../../../utils/cli-version-policy.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID=a169_0x5b2af7(0x1f8),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x22cb16){const _0x51064d=a169_0x5b2af7;return typeof _0x22cb16===_0x51064d(0x206)&&_0x22cb16[_0x51064d(0x1ee)]()?_0x22cb16[_0x51064d(0x1ee)]():null;}function parseDescriptor(_0x14f80b){const _0x35764f=a169_0x5b2af7;if(!_0x14f80b||typeof _0x14f80b!=='object')throw new Error('CDN\x20config\x20does\x20not\x20define\x20template\x20\x22'+TEMPLATE_ID+'\x22.');const _0x499e33=_0x14f80b,_0x15f2c8=nonEmptyString(_0x499e33[_0x35764f(0x1fd)]),_0x34c77f=nonEmptyString(_0x499e33[_0x35764f(0x1f4)]),_0x4865e9=nonEmptyString(_0x499e33[_0x35764f(0x1d6)])?.['toLowerCase'](),_0x5472f7=_0x499e33[_0x35764f(0x1db)];if(!_0x15f2c8||!_0x34c77f||_0x34c77f!==a169_0x5b8fba['posix'][_0x35764f(0x1e6)](_0x34c77f)||_0x34c77f['includes']('\x5c')||!_0x4865e9||!/^sha256:[a-f0-9]{64}$/[_0x35764f(0x1d5)](_0x4865e9)||typeof _0x5472f7!=='number'||!Number[_0x35764f(0x1f2)](_0x5472f7)||_0x5472f7<=0x0||_0x5472f7>MAX_ARCHIVE_SIZE)throw new Error(_0x35764f(0x20b)+TEMPLATE_ID+'\x22.');return{'version':_0x15f2c8,'name':_0x34c77f,'sha256':_0x4865e9,'size':_0x5472f7};}async function fetchWithTimeout(_0xe99493,_0x1135c1,_0x2fb328,_0x3cee83){const _0x687f8d=a169_0x5b2af7,_0x3079b0=new AbortController(),_0x185921=setTimeout(()=>_0x3079b0[_0x687f8d(0x1ef)](),_0x1135c1);try{const _0xa8b300=await fetch(_0xe99493,{'headers':{'Accept':_0x2fb328},'signal':_0x3079b0[_0x687f8d(0x1f3)]});return await _0x3cee83(_0xa8b300);}finally{clearTimeout(_0x185921);}}async function fetchTemplateDescriptor(){const _0x5d3df0=a169_0x5b2af7,_0x4a62bf=await getRabetbaseCdnConfig();if(!_0x4a62bf)throw new Error('Rabetbase\x20CDN\x20config\x20is\x20unavailable.');return parseDescriptor(_0x4a62bf[_0x5d3df0(0x1f1)]);}function resolveArchiveUrl(_0x12fcbc){const _0x26263c=a169_0x5b2af7,_0x50fd51=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0x2c8910=new URL(_0x12fcbc,_0x50fd51);if(_0x2c8910['protocol']!==_0x26263c(0x1e3)||_0x2c8910[_0x26263c(0x1d8)]!==_0x50fd51['origin']||!_0x2c8910[_0x26263c(0x1da)][_0x26263c(0x1ce)](_0x50fd51[_0x26263c(0x1da)]))throw new Error('CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.');return _0x2c8910[_0x26263c(0x1ea)];}async function readResponseBytes(_0x3dda86,_0x313b9e){const _0x73b565=a169_0x5b2af7;if(!_0x3dda86[_0x73b565(0x1c1)]){const _0x60db10=Buffer['from'](await _0x3dda86['arrayBuffer']());if(_0x60db10[_0x73b565(0x1ec)]>_0x313b9e)throw new Error(_0x73b565(0x1e4));return _0x60db10;}const _0x46832c=_0x3dda86[_0x73b565(0x1c1)]['getReader'](),_0x1e503c=[];let _0x2fbc59=0x0;try{while(!![]){const {done:_0x47e571,value:_0x595099}=await _0x46832c[_0x73b565(0x1e2)]();if(_0x47e571)break;_0x2fbc59+=_0x595099['byteLength'];if(_0x2fbc59>_0x313b9e){await _0x46832c[_0x73b565(0x202)]();throw new Error(_0x73b565(0x1e4));}_0x1e503c[_0x73b565(0x1c6)](Buffer['from'](_0x595099));}}finally{_0x46832c[_0x73b565(0x204)]();}return Buffer[_0x73b565(0x1fb)](_0x1e503c,_0x2fbc59);}async function downloadArchive(_0x567a41,_0x24b4cd,_0x1d48aa){const _0x2d3836=a169_0x5b2af7,_0xbdd0de=await fetchWithTimeout(resolveArchiveUrl(_0x567a41[_0x2d3836(0x1f4)]),ARCHIVE_TIMEOUT_MS,_0x2d3836(0x1e5),async _0x11d314=>{const _0x265ca2=_0x2d3836;if(!_0x11d314['ok'])throw new Error(_0x265ca2(0x1d7)+_0x11d314[_0x265ca2(0x1f5)]+'.');const _0x4fb0b5=Number(_0x11d314[_0x265ca2(0x207)]['get'](_0x265ca2(0x1ca)));if(Number[_0x265ca2(0x200)](_0x4fb0b5)&&_0x4fb0b5>MAX_ARCHIVE_SIZE)throw new Error(_0x265ca2(0x1df));return readResponseBytes(_0x11d314,_0x567a41['size']);});if(_0xbdd0de['length']!==_0x567a41[_0x2d3836(0x1db)])throw new Error(_0x2d3836(0x203)+_0x567a41[_0x2d3836(0x1db)]+',\x20received\x20'+_0xbdd0de[_0x2d3836(0x1ec)]+'.');_0x1d48aa?.('verifying');const _0x504122='sha256:'+createHash('sha256')[_0x2d3836(0x20c)](_0xbdd0de)[_0x2d3836(0x208)](_0x2d3836(0x1e0));if(_0x504122!==_0x567a41[_0x2d3836(0x1d6)])throw new Error('CDN\x20project\x20template\x20checksum\x20verification\x20failed.');await a169_0x32b02e[_0x2d3836(0x1dc)](_0x24b4cd,_0xbdd0de,{'flag':'wx'});}function a169_0x3471(_0x4b9185,_0x292ba0){_0x4b9185=_0x4b9185-0x1c1;const _0x53cd6a=a169_0x53cd();let _0x3471bf=_0x53cd6a[_0x4b9185];return _0x3471bf;}async function assertTemplateRoot(_0x190786){const _0x3ece64=a169_0x5b2af7,_0x200863=a169_0x5b8fba[_0x3ece64(0x1cc)](_0x190786,'package.json'),_0x1e66b1=JSON['parse'](await a169_0x32b02e['readFile'](_0x200863,_0x3ece64(0x1cb)));if(!_0x1e66b1||typeof _0x1e66b1!=='object')throw new Error(_0x3ece64(0x1cd));}async function readDirectoryIdentity(_0x2486dc){const _0x3f3ad7=a169_0x5b2af7;try{const _0x15da84=await a169_0x32b02e[_0x3f3ad7(0x201)](_0x2486dc);if(!_0x15da84[_0x3f3ad7(0x1eb)]())return null;return{'dev':_0x15da84[_0x3f3ad7(0x1c3)],'ino':_0x15da84['ino']};}catch{return null;}}async function commitStagedProject(_0x4da6de,_0x44f27a){const _0x32f818=a169_0x5b2af7;await a169_0x32b02e[_0x32f818(0x1d9)](_0x44f27a);const _0x40d24e=await readDirectoryIdentity(_0x44f27a);if(!_0x40d24e)throw new Error('Unable\x20to\x20claim\x20the\x20project\x20directory.');try{for(const _0x49bd05 of await a169_0x32b02e['readdir'](_0x4da6de)){await a169_0x32b02e[_0x32f818(0x1d0)](a169_0x5b8fba['join'](_0x4da6de,_0x49bd05),a169_0x5b8fba[_0x32f818(0x1cc)](_0x44f27a,_0x49bd05));}}catch(_0x92d4e5){const _0x4f8baf=await readDirectoryIdentity(_0x44f27a);_0x4f8baf?.['dev']===_0x40d24e[_0x32f818(0x1c3)]&&_0x4f8baf['ino']===_0x40d24e[_0x32f818(0x205)]&&await a169_0x32b02e['rm'](_0x44f27a,{'recursive':!![],'force':!![]});throw _0x92d4e5;}}function a169_0x53cd(){const _0x8f8715=['CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','releaseLock','ino','string','headers','digest','message','downloading','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','update','body','4219275MNLBdq','dev','code','mkdtemp','push','5862935xbodmD','6AHExpB','103600wkKOhT','content-length','utf8','join','Project\x20template\x20package.json\x20is\x20invalid.','startsWith','validation','rename','EEXIST','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','resolving','13508cakmZZ','test','sha256','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','origin','mkdir','pathname','size','writeFile','cdn','Use\x20a\x20different\x20project\x20name.','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','hex','resolve','read','https:','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','application/zip','basename','5830740NTZoRQ','4KkLHDr','ENOENT','href','isDirectory','length','Project\x20directory\x20already\x20exists:\x20','trim','abort','134863DsuLyq','projectTemplate','isSafeInteger','signal','name','status','extracting','2119047IjvrDu','sub-app-react-demo','project','1740kzgSPk','concat','27mXWmAp','version','template.zip','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','isFinite','lstat','cancel'];a169_0x53cd=function(){return _0x8f8715;};return a169_0x53cd();}export async function materializeProjectTemplate(_0x59ecfd,_0x41e790){const _0x1d3d57=a169_0x5b2af7,_0x26f48b=a169_0x5b8fba[_0x1d3d57(0x1e1)](_0x59ecfd),_0x48aa31=a169_0x5b8fba['dirname'](_0x26f48b);try{await a169_0x32b02e[_0x1d3d57(0x201)](_0x26f48b);throw new Error(_0x1d3d57(0x1ed)+_0x26f48b);}catch(_0xc10123){if(_0xc10123['code']!==_0x1d3d57(0x1e9))throw _0xc10123;}const _0x13f398=await a169_0x32b02e[_0x1d3d57(0x1c5)](a169_0x5b8fba['join'](_0x48aa31,'.rabetbase-create-')),_0x4f07f4=a169_0x5b8fba[_0x1d3d57(0x1cc)](_0x13f398,_0x1d3d57(0x1f9)),_0x443492=a169_0x5b8fba[_0x1d3d57(0x1cc)](_0x13f398,_0x1d3d57(0x1fe));try{try{_0x41e790?.(_0x1d3d57(0x1d3));const _0x32ae75=await fetchTemplateDescriptor();return _0x41e790?.(_0x1d3d57(0x20a)),await downloadArchive(_0x32ae75,_0x443492,_0x41e790),_0x41e790?.(_0x1d3d57(0x1f6)),await extractProjectTemplateArchive(_0x443492,_0x4f07f4),await assertTemplateRoot(_0x4f07f4),await commitStagedProject(_0x4f07f4,_0x26f48b),{'source':_0x1d3d57(0x1dd),'version':_0x32ae75[_0x1d3d57(0x1fd)]};}catch(_0x14a590){if(_0x14a590[_0x1d3d57(0x1c4)]===_0x1d3d57(0x1d1))throw CliErrors[_0x1d3d57(0x1cf)](_0x1d3d57(0x1ed)+_0x26f48b,_0x1d3d57(0x1de));const _0x33c956=_0x14a590 instanceof Error?_0x14a590[_0x1d3d57(0x209)]:String(_0x14a590);throw CliErrors[_0x1d3d57(0x1cf)](_0x1d3d57(0x1ff),_0x1d3d57(0x1d2)+_0x33c956);}}finally{await a169_0x32b02e['rm'](_0x13f398,{'recursive':!![],'force':!![]});}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x3e4c5f,_0xe0888e){const _0x43e0e5=a170_0x1492,_0x265397=_0x3e4c5f();while(!![]){try{const _0x25ffbb=-parseInt(_0x43e0e5(0x19d))/0x1*(-parseInt(_0x43e0e5(0x18c))/0x2)+parseInt(_0x43e0e5(0x195))/0x3*(-parseInt(_0x43e0e5(0x18e))/0x4)+-parseInt(_0x43e0e5(0x18a))/0x5+parseInt(_0x43e0e5(0x18f))/0x6+-parseInt(_0x43e0e5(0x18b))/0x7*(-parseInt(_0x43e0e5(0x193))/0x8)+parseInt(_0x43e0e5(0x197))/0x9*(parseInt(_0x43e0e5(0x192))/0xa)+-parseInt(_0x43e0e5(0x198))/0xb*(parseInt(_0x43e0e5(0x190))/0xc);if(_0x25ffbb===_0xe0888e)break;else _0x265397['push'](_0x265397['shift']());}catch(_0x3205f2){_0x265397['push'](_0x265397['shift']());}}}(a170_0x4a7e,0x5000d));function a170_0x4a7e(){const _0x2e364b=['Project\x20name\x20cannot\x20be\x20empty','1375641ihMTis','test','73611YcCpPu','1067ThbDRH','\x22\x20is\x20reserved\x20on\x20Windows','length','Project\x20name\x20\x22','\x20characters','481181uefurw','Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.','3079655WZzayy','536333gxPbFe','2oIFAxk','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','4KdoIsk','3092490TayhWC','41100mWkqIb','trim','340usaJwq','48PFMIUM'];a170_0x4a7e=function(){return _0x2e364b;};return a170_0x4a7e();}import{CliErrors}from'../../../errors.js';const PROJECT_NAME_PATTERN=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i,MAX_PROJECT_NAME_LENGTH=0x64;function a170_0x1492(_0x4220a4,_0x239813){_0x4220a4=_0x4220a4-0x18a;const _0x4a7edb=a170_0x4a7e();let _0x1492d4=_0x4a7edb[_0x4220a4];return _0x1492d4;}export function getProjectNameValidationError(_0x4a5d6d){const _0x1180ac=a170_0x1492,_0x1e3284=_0x4a5d6d['trim']();if(!_0x1e3284)return _0x1180ac(0x194);if(_0x1e3284[_0x1180ac(0x19a)]>MAX_PROJECT_NAME_LENGTH)return'Project\x20name\x20cannot\x20exceed\x20'+MAX_PROJECT_NAME_LENGTH+_0x1180ac(0x19c);if(!PROJECT_NAME_PATTERN[_0x1180ac(0x196)](_0x1e3284))return _0x1180ac(0x18d);if(WINDOWS_RESERVED_NAME[_0x1180ac(0x196)](_0x1e3284))return _0x1180ac(0x19b)+_0x1e3284+_0x1180ac(0x199);return null;}export function validateProjectName(_0x311912){const _0x185777=a170_0x1492,_0x18f363=_0x311912[_0x185777(0x191)](),_0x425e49=getProjectNameValidationError(_0x18f363);if(_0x425e49)throw CliErrors['validation'](_0x425e49,_0x185777(0x19e));return _0x18f363;}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract a project template ZIP without relying on OS-specific archive tools.
|
|
3
|
+
* Entries are bounded and validated for traversal, symlinks, Windows naming,
|
|
4
|
+
* case-insensitive collisions, and ZIP bombs before they are written.
|
|
5
|
+
*/
|
|
6
|
+
export declare function extractProjectTemplateArchive(zipPath: string, destinationDir: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a171_0x3b1f(){const _0x41d947=['3275454VtpPhD','has','once','resolve','Project\x20template\x20ZIP\x20exceeds\x20','26TxcrYY','replace','openReadStream','45qVLLum','close','fileName','toLocaleLowerCase','startsWith','16347090vzeYEp','readEntry','isEncrypted','get','2031666WqtDkH','endsWith','Unable\x20to\x20read\x20ZIP\x20entry:\x20','44854iISJXc','1073164nSJJAJ','Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20','join','10VebhPF','test','set','Case-conflicting\x20ZIP\x20entry\x20path:\x20','dirname','open','3115086XnOxQq','sep','length','split','923408flYaKL','add','\x20entries.','slice','mkdir','catch'];a171_0x3b1f=function(){return _0x41d947;};return a171_0x3b1f();}(function(_0xdf71dc,_0x4224f1){const _0x500e50=a171_0x1a1f,_0x9248d5=_0xdf71dc();while(!![]){try{const _0x5409dc=-parseInt(_0x500e50(0xa7))/0x1*(-parseInt(_0x500e50(0x98))/0x2)+-parseInt(_0x500e50(0xa4))/0x3+-parseInt(_0x500e50(0xa8))/0x4*(parseInt(_0x500e50(0xab))/0x5)+-parseInt(_0x500e50(0xb1))/0x6+parseInt(_0x500e50(0x93))/0x7+parseInt(_0x500e50(0xb5))/0x8*(-parseInt(_0x500e50(0x9b))/0x9)+parseInt(_0x500e50(0xa0))/0xa;if(_0x5409dc===_0x4224f1)break;else _0x9248d5['push'](_0x9248d5['shift']());}catch(_0x395c1b){_0x9248d5['push'](_0x9248d5['shift']());}}}(a171_0x3b1f,0x5bb42));import{createWriteStream}from'node:fs';import a171_0x580ff9 from'node:fs/promises';import a171_0x558d41 from'node:path';import{pipeline}from'node:stream/promises';import a171_0x25caf0 from'yauzl';const MAX_ENTRY_COUNT=0x7d0,MAX_UNCOMPRESSED_SIZE=0x32*0x400*0x400,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i,WINDOWS_INVALID_CHAR=/[<>:"|?*\x00-\x1f]/;function openZip(_0x2a4170){return new Promise((_0x501f1b,_0x220371)=>{const _0x19de26=a171_0x1a1f;a171_0x25caf0[_0x19de26(0xb0)](_0x2a4170,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x51d756,_0x50ae26)=>{if(_0x51d756||!_0x50ae26){_0x220371(_0x51d756||new Error('Unable\x20to\x20open\x20project\x20template\x20archive.'));return;}_0x501f1b(_0x50ae26);});});}function openEntryStream(_0x5a8d1e,_0x1acd09){return new Promise((_0x3e01c5,_0x1a53d1)=>{const _0xff94a3=a171_0x1a1f;_0x5a8d1e[_0xff94a3(0x9a)](_0x1acd09,(_0x1d3c58,_0x31801f)=>{const _0x467b93=_0xff94a3;if(_0x1d3c58||!_0x31801f){_0x1a53d1(_0x1d3c58||new Error(_0x467b93(0xa6)+_0x1acd09[_0x467b93(0x9d)]));return;}_0x3e01c5(_0x31801f);});});}function validateEntryPath(_0xfad2da){const _0x3a9e94=a171_0x1a1f,_0x3b5818=_0xfad2da[_0x3a9e94(0x99)](/\\/g,'/'),_0x3ad25a=_0x3b5818[_0x3a9e94(0xa5)]('/'),_0x45c93e=_0x3ad25a?_0x3b5818[_0x3a9e94(0x90)](0x0,-0x1):_0x3b5818;if(!_0x45c93e||_0x3b5818[_0x3a9e94(0x9f)]('/')||/^[A-Za-z]:\//['test'](_0x3b5818))throw new Error(_0x3a9e94(0xa9)+_0xfad2da);const _0xb74eb4=_0x45c93e[_0x3a9e94(0xb4)]('/');for(const _0x120b58 of _0xb74eb4){if(!_0x120b58||_0x120b58==='.'||_0x120b58==='..'||_0x120b58['endsWith']('.')||_0x120b58[_0x3a9e94(0xa5)]('\x20')||WINDOWS_INVALID_CHAR[_0x3a9e94(0xac)](_0x120b58)||WINDOWS_RESERVED_NAME[_0x3a9e94(0xac)](_0x120b58))throw new Error('Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20'+_0xfad2da);}return{'relativePath':_0xb74eb4[_0x3a9e94(0xaa)](a171_0x558d41[_0x3a9e94(0xb2)]),'directory':_0x3ad25a};}function a171_0x1a1f(_0x1e4abd,_0x3b156b){_0x1e4abd=_0x1e4abd-0x90;const _0x3b1f01=a171_0x3b1f();let _0x1a1fab=_0x3b1f01[_0x1e4abd];return _0x1a1fab;}function isSymbolicLink(_0x595010){const _0xce63ce=_0x595010['externalFileAttributes']>>>0x10&0xffff;return(_0xce63ce&0xf000)===0xa000;}export async function extractProjectTemplateArchive(_0x54dbac,_0x16f7a2){const _0x2f608a=a171_0x1a1f,_0x4f0bac=await openZip(_0x54dbac),_0x50997f=a171_0x558d41[_0x2f608a(0x96)](_0x16f7a2),_0x317f10=new Set(),_0x326a09=new Map();let _0x4d7e0b=0x0,_0x2eea46=0x0;await a171_0x580ff9[_0x2f608a(0x91)](_0x50997f,{'recursive':!![]}),await new Promise((_0x21f171,_0x1f2d3b)=>{const _0x3bd46c=_0x2f608a;let _0x266780=![];const _0x557e74=_0x42f1bc=>{const _0x225074=a171_0x1a1f;if(_0x266780)return;_0x266780=!![],_0x4f0bac[_0x225074(0x9c)](),_0x1f2d3b(_0x42f1bc instanceof Error?_0x42f1bc:new Error(String(_0x42f1bc)));};_0x4f0bac[_0x3bd46c(0x95)]('error',_0x557e74),_0x4f0bac[_0x3bd46c(0x95)]('end',()=>{if(_0x266780)return;_0x266780=!![],_0x21f171();}),_0x4f0bac['on']('entry',_0x4a6221=>{const _0x2a4cac=_0x3bd46c;void(async()=>{const _0x551a9a=a171_0x1a1f;_0x4d7e0b+=0x1,_0x2eea46+=_0x4a6221['uncompressedSize'];if(_0x4d7e0b>MAX_ENTRY_COUNT)throw new Error(_0x551a9a(0x97)+MAX_ENTRY_COUNT+_0x551a9a(0xb7));if(_0x2eea46>MAX_UNCOMPRESSED_SIZE)throw new Error('Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.');if(_0x4a6221[_0x551a9a(0xa2)]())throw new Error('Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20'+_0x4a6221[_0x551a9a(0x9d)]);if(isSymbolicLink(_0x4a6221))throw new Error('Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20'+_0x4a6221[_0x551a9a(0x9d)]);const {relativePath:_0x22f4c5,directory:_0x57da93}=validateEntryPath(_0x4a6221['fileName']),_0x24dacb=_0x22f4c5[_0x551a9a(0xb4)](a171_0x558d41[_0x551a9a(0xb2)]);for(let _0x5613c6=0x1;_0x5613c6<=_0x24dacb[_0x551a9a(0xb3)];_0x5613c6+=0x1){const _0x4425e3=_0x24dacb[_0x551a9a(0x90)](0x0,_0x5613c6)[_0x551a9a(0xaa)](a171_0x558d41[_0x551a9a(0xb2)]),_0x5693cd=_0x4425e3['toLocaleLowerCase']('en-US'),_0x698c78=_0x326a09[_0x551a9a(0xa3)](_0x5693cd);if(_0x698c78&&_0x698c78!==_0x4425e3)throw new Error(_0x551a9a(0xae)+_0x4a6221['fileName']);_0x326a09[_0x551a9a(0xad)](_0x5693cd,_0x4425e3);}const _0xfcb664=_0x22f4c5[_0x551a9a(0x9e)]('en-US');if(_0x317f10[_0x551a9a(0x94)](_0xfcb664))throw new Error('Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20'+_0x4a6221[_0x551a9a(0x9d)]);_0x317f10[_0x551a9a(0xb6)](_0xfcb664);const _0x1cf96b=a171_0x558d41[_0x551a9a(0x96)](_0x50997f,_0x22f4c5);if(_0x1cf96b!==_0x50997f&&!_0x1cf96b[_0x551a9a(0x9f)](''+_0x50997f+a171_0x558d41[_0x551a9a(0xb2)]))throw new Error('ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20'+_0x4a6221[_0x551a9a(0x9d)]);if(_0x57da93)await a171_0x580ff9['mkdir'](_0x1cf96b,{'recursive':!![]});else{await a171_0x580ff9['mkdir'](a171_0x558d41[_0x551a9a(0xaf)](_0x1cf96b),{'recursive':!![]});const _0x3e03d4=await openEntryStream(_0x4f0bac,_0x4a6221);await pipeline(_0x3e03d4,createWriteStream(_0x1cf96b,{'flags':'wx','mode':0x1a4}));}_0x4f0bac[_0x551a9a(0xa1)]();})()[_0x2a4cac(0x92)](_0x557e74);}),_0x4f0bac[_0x3bd46c(0xa1)]();});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a172_0x390b5d=a172_0x3d15;(function(_0x5a19ed,_0x3e90f1){const _0x3ab9a2=a172_0x3d15,_0x2a7905=_0x5a19ed();while(!![]){try{const _0x4d2c35=parseInt(_0x3ab9a2(0x10b))/0x1+-parseInt(_0x3ab9a2(0x111))/0x2+-parseInt(_0x3ab9a2(0x10c))/0x3+-parseInt(_0x3ab9a2(0x108))/0x4+-parseInt(_0x3ab9a2(0x109))/0x5*(-parseInt(_0x3ab9a2(0x10e))/0x6)+-parseInt(_0x3ab9a2(0x10d))/0x7+parseInt(_0x3ab9a2(0x110))/0x8;if(_0x4d2c35===_0x3e90f1)break;else _0x2a7905['push'](_0x2a7905['shift']());}catch(_0x12759a){_0x2a7905['push'](_0x2a7905['shift']());}}}(a172_0x24a0,0x4024d));import a172_0xcff20 from'node:path';function a172_0x3d15(_0x4a89f7,_0xade9be){_0x4a89f7=_0x4a89f7-0x108;const _0x24a06a=a172_0x24a0();let _0x3d1543=_0x24a06a[_0x4a89f7];return _0x3d1543;}import{fileURLToPath}from'node:url';function a172_0x24a0(){const _0x56e3d6=['173538cNUvdY','1550295uBFcVw','2198245ulPoZz','930OYXwxs','dirname','9915112FWEPdP','231610GpTgda','978656MIpPsK','1325ikjBAZ','resolve'];a172_0x24a0=function(){return _0x56e3d6;};return a172_0x24a0();}const __dirname=a172_0xcff20[a172_0x390b5d(0x10f)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x19cbed=a172_0x390b5d;return a172_0xcff20[_0x19cbed(0x10a)](__dirname,'../../../../');}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ProjectTemplateProgress } from "../../../commands/project/create/materialize-project-template.js";
|
|
2
|
+
export declare function copyProjectTemplate(projectCode: string, onProgress?: ProjectTemplateProgress): Promise<string>;
|