@lovrabet/rabetbase-cli 2.5.8-beta.1 → 2.5.8-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +2 -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/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-management-client.d.ts +19 -0
- package/lib/core/kb-management-client.js +1 -0
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +2 -2
- package/skills/rabetbase/references/rabetbase-kb.md +7 -6
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x278a5e,_0x5ae7df){const _0x1f6fa7=a216_0x4d24,_0x212a39=_0x278a5e();while(!![]){try{const _0xae82e5=-parseInt(_0x1f6fa7(0xa9))/0x1+parseInt(_0x1f6fa7(0xb7))/0x2*(-parseInt(_0x1f6fa7(0xc8))/0x3)+-parseInt(_0x1f6fa7(0x85))/0x4+parseInt(_0x1f6fa7(0xbb))/0x5+-parseInt(_0x1f6fa7(0x8f))/0x6*(-parseInt(_0x1f6fa7(0xbd))/0x7)+parseInt(_0x1f6fa7(0xbe))/0x8*(parseInt(_0x1f6fa7(0xc4))/0x9)+parseInt(_0x1f6fa7(0xa4))/0xa;if(_0xae82e5===_0x5ae7df)break;else _0x212a39['push'](_0x212a39['shift']());}catch(_0x43c172){_0x212a39['push'](_0x212a39['shift']());}}}(a216_0x209a,0xc8165));import{copyFileSync,existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import a216_0x58e569 from'node:path';import{getMultiAppConfigs,initMultiAppEnvironment,readConfigFile,writeConfigFile}from'../../context.js';import{DEFAULT_API_DIR}from'../../constant/paths.js';import{getRuntimeDomain}from'../../constant/domain.js';import{getRegistryGroup,resolveApiProfileLayouts}from'../../api/api-group.js';import{MODEL_REGISTRY_FILE_NAME,MODEL_RUNTIME_FILE_NAME,readModelRegistry,updateModelRegistry}from'../../api/model-registry-file.js';import{isLegacyGeneratedApiScaffold,isLegacyGeneratedClientScaffold,parseLegacyApiModels}from'../../api/legacy-api-file.js';import{renderModelRegistryScaffold}from'../../api/model-registry-scaffold.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';const MIGRATION_ID='api-model-registry-v2',SDK_CONFIG_SOURCE='/**\x0a\x20*\x20Lovrabet\x20SDK\x20runtime\x20routing.\x0a\x20*\x20Generated\x20by\x20Rabetbase\x20CLI.\x20Do\x20not\x20add\x20credentials\x20to\x20this\x20file.\x0a\x20*/\x0aexport\x20const\x20LOVRABET_SDK_CONFIG\x20=\x20{}\x20as\x20const;\x0a';function relativeMigrationDir(_0x4c8a2a,_0x33e7f9){const _0x5ebb76=a216_0x4d24,_0x4fa388=a216_0x58e569[_0x5ebb76(0x9c)](_0x4c8a2a,_0x33e7f9);return _0x4fa388&&!_0x4fa388[_0x5ebb76(0x8d)]('..')?_0x4fa388:'external-api-dir';}function candidatePath(_0x1ee8be,_0x2015aa,_0x39a5bd){const _0x30ee14=a216_0x4d24;return a216_0x58e569[_0x30ee14(0xb1)](_0x1ee8be,_0x30ee14(0x84),'project-upgrade',MIGRATION_ID,'candidates',relativeMigrationDir(_0x1ee8be,_0x2015aa),_0x39a5bd);}function backupPath(_0x139f9d,_0x374af9,_0xcb446a){const _0x1decee=a216_0x4d24;return a216_0x58e569[_0x1decee(0xb1)](_0x139f9d,_0x1decee(0x84),_0x1decee(0x97),MIGRATION_ID,_0x1decee(0xaf),relativeMigrationDir(_0x139f9d,_0x374af9),_0xcb446a);}function readOptional(_0x69ff02){const _0x539d5e=a216_0x4d24;try{return readFileSync(_0x69ff02,_0x539d5e(0xa1));}catch{return undefined;}}function a216_0x209a(){const _0x5b51a3=['client.ts','entries','app','relative','map','unchanged','add','flatMap','utf8','default','.rabetbase.json','23826490rBwGWN','LOVRABET_RUNTIME_DOMAIN','files','client','api','1577889qbWqsI','./models.generated','unconfigured','apiDir','apps','-api.ts','backups','sdk-config.ts','join','has','replace-generated','manual-merge','create','The\x20existing\x20runtime\x20selector\x20is\x20not\x20a\x20recognized\x20current\x20generated\x20file.','8290VvRIyi','appcode','apiGroup','action','3235530cQRZwL','includes','7348439fTxodz','40SLcRJe','Recognized\x20legacy\x20CLI\x20scaffold;\x20a\x20backup\x20will\x20be\x20retained.','modelRuntime','basename','preserve','some','975573fcOhgS','normalizedApiDir','string','profiles','954kLtzvd','find','./model-runtime','project','defaultApp','.rabetbase','3623844REGtPD','name','isDefault','manualMergeRequired','object','keys','path','outputDir','startsWith','api.ts','6xPJBDe','Profile-aware\x20model\x20selection\x20generated\x20by\x20Rabetbase\x20CLI','parse','length','migrate-single-app','resolve','Multiple\x20Lovrabet\x20model\x20profiles\x20match\x20Runtime\x20Domain','No\x20Lovrabet\x20model\x20profile\x20matches\x20Runtime\x20Domain','project-upgrade','The\x20file\x20contains\x20project-owned\x20code\x20and\x20will\x20not\x20be\x20overwritten.'];a216_0x209a=function(){return _0x5b51a3;};return a216_0x209a();}function readJsonObject(_0x340bc2){const _0x3aaa18=a216_0x4d24;try{const _0x314785=JSON[_0x3aaa18(0x91)](readFileSync(_0x340bc2,_0x3aaa18(0xa1)));return _0x314785&&typeof _0x314785===_0x3aaa18(0x89)?_0x314785:{};}catch{return{};}}function a216_0x4d24(_0x4ea14c,_0x59d9df){_0x4ea14c=_0x4ea14c-0x81;const _0x209ab2=a216_0x209a();let _0x4d240e=_0x209ab2[_0x4ea14c];return _0x4d240e;}function planEntrypoint(_0x3be61c,_0x234164,_0x56a372,_0x35c4b6){const _0x104a65=a216_0x4d24,_0x3bb838=a216_0x58e569[_0x104a65(0xb1)](_0x234164,_0x56a372),_0x28ae69=readOptional(_0x3bb838);if(_0x28ae69===undefined)return{'path':_0x3bb838,'action':_0x104a65(0xb5)};if(_0x56a372===_0x104a65(0x8e)?_0x28ae69[_0x104a65(0xbc)](_0x104a65(0xaa))&&_0x28ae69[_0x104a65(0xbc)](_0x104a65(0x81)):_0x28ae69[_0x104a65(0xbc)](_0x104a65(0xa5)))return{'path':_0x3bb838,'action':'unchanged'};if(_0x35c4b6(_0x28ae69))return{'path':_0x3bb838,'action':_0x104a65(0xb3),'reason':_0x104a65(0xbf)};return{'path':_0x3bb838,'action':_0x104a65(0xb4),'reason':_0x104a65(0x98),'candidatePath':candidatePath(_0x3be61c,_0x234164,_0x56a372)};}function syntheticApps(_0x116383){const _0x49ce79=a216_0x4d24,_0x14ba8d=_0x116383[_0x49ce79(0xad)]&&typeof _0x116383[_0x49ce79(0xad)]===_0x49ce79(0x89)?_0x116383['apps']:undefined;if(_0x14ba8d&&Object['keys'](_0x14ba8d)[_0x49ce79(0x92)]>0x0){const _0x66027e=typeof _0x116383[_0x49ce79(0x83)]===_0x49ce79(0xc6)?_0x116383[_0x49ce79(0x83)]:Object['keys'](_0x14ba8d)[_0x49ce79(0x92)]===0x1?Object[_0x49ce79(0x8a)](_0x14ba8d)[0x0]:undefined;return Object[_0x49ce79(0x9a)](_0x14ba8d)[_0x49ce79(0xa0)](([_0x2092cd,_0x42be20])=>{const _0x216ff2=_0x49ce79,_0x3348a6=_0x42be20,_0x371a08=typeof _0x3348a6[_0x216ff2(0xb8)]==='string'?_0x3348a6[_0x216ff2(0xb8)]:'';return _0x371a08?[{'name':_0x2092cd,'appcode':_0x371a08,'apiGroup':typeof _0x3348a6[_0x216ff2(0xb9)]==='string'?_0x3348a6['apiGroup']:undefined,'isDefault':_0x2092cd===_0x66027e,'region':'cn','regionSource':_0x216ff2(0xa2),'apiDir':typeof _0x3348a6[_0x216ff2(0xac)]===_0x216ff2(0xc6)?_0x3348a6['apiDir']:typeof _0x116383['apiDir']===_0x216ff2(0xc6)?_0x116383[_0x216ff2(0xac)]:undefined,'routingConfig':{}}]:[];});}const _0x14aeb3=typeof _0x116383['appcode']===_0x49ce79(0xc6)?_0x116383[_0x49ce79(0xb8)]:typeof _0x116383[_0x49ce79(0x9b)]===_0x49ce79(0xc6)?_0x116383[_0x49ce79(0x9b)]:undefined;if(!_0x14aeb3)return[];return[{'name':_0x14aeb3,'appcode':_0x14aeb3,'isDefault':!![],'region':'cn','regionSource':'default','apiDir':typeof _0x116383[_0x49ce79(0xac)]===_0x49ce79(0xc6)?_0x116383[_0x49ce79(0xac)]:undefined,'routingConfig':{}}];}function configuredLayouts(_0x5d5355,_0x174340){const _0xa7733a=a216_0x4d24;return resolveApiProfileLayouts(_0x174340,_0xc8ff8c=>a216_0x58e569[_0xa7733a(0x94)](_0x5d5355,_0xc8ff8c[_0xa7733a(0xac)]||DEFAULT_API_DIR),_0x5d5355);}function uniqueRegistryGroups(_0x4e7257){const _0x13dc98=a216_0x4d24,_0x250dc4=[],_0x4e5c8d=new Set(),_0xf3b030=new Set();for(const _0x4c9535 of _0x4e7257){const _0x4ee472=getRegistryGroup(_0x4e7257,_0x4c9535);if(!_0x4ee472){_0x4e5c8d['add'](_0x4c9535[_0x13dc98(0x8c)]);continue;}const _0x4eceb1=_0x4c9535[_0x13dc98(0xc5)]+'\x00'+(_0x4c9535[_0x13dc98(0xb9)]??'single');!_0xf3b030[_0x13dc98(0xb2)](_0x4eceb1)&&(_0x250dc4['push'](_0x4ee472),_0xf3b030[_0x13dc98(0x9f)](_0x4eceb1));}return{'groups':_0x250dc4,'skipped':[..._0x4e5c8d]};}function planGroup(_0x1263d4,_0x512f42){const _0x3bba14=a216_0x4d24,_0x2adb4a=_0x512f42[0x0]['normalizedApiDir'],_0x19dc36=a216_0x58e569[_0x3bba14(0xb1)](_0x2adb4a,MODEL_RUNTIME_FILE_NAME),_0x2601cf=readOptional(_0x19dc36),_0x1febef=_0x2601cf!==undefined&&_0x2601cf[_0x3bba14(0xbc)](_0x3bba14(0x90))&&_0x2601cf['includes'](_0x3bba14(0x95))&&_0x2601cf[_0x3bba14(0xbc)](_0x3bba14(0x96)),_0x2e8728=a216_0x58e569[_0x3bba14(0xb1)](_0x2adb4a,MODEL_REGISTRY_FILE_NAME),_0x409259=a216_0x58e569[_0x3bba14(0xb1)](_0x2adb4a,_0x3bba14(0xb0)),_0xd5a0a6=[planEntrypoint(_0x1263d4,_0x2adb4a,_0x3bba14(0x8e),isLegacyGeneratedApiScaffold),planEntrypoint(_0x1263d4,_0x2adb4a,_0x3bba14(0x99),isLegacyGeneratedClientScaffold),{'path':_0x19dc36,'action':_0x2601cf===undefined?_0x3bba14(0xb5):_0x1febef?'unchanged':_0x3bba14(0xb4),'reason':_0x2601cf===undefined?undefined:_0x3bba14(0xb6),..._0x2601cf!==undefined&&!_0x1febef?{'candidatePath':candidatePath(_0x1263d4,_0x2adb4a,MODEL_RUNTIME_FILE_NAME)}:{}},{'path':_0x2e8728,'action':existsSync(_0x2e8728)?_0x3bba14(0xc2):_0x3bba14(0xb5),'reason':'Model\x20facts\x20are\x20preserved\x20and\x20completed\x20from\x20legacy\x20generated\x20files\x20when\x20possible.'},{'path':_0x409259,'action':existsSync(_0x409259)?_0x3bba14(0xc2):_0x3bba14(0xb5)}];return{'apiDir':_0x2adb4a,'profiles':_0x512f42['map'](_0x447b05=>_0x447b05['app'][_0x3bba14(0x86)]),'files':_0xd5a0a6};}export function analyzeProjectApiArchitecture(_0x1f8ba7,_0x8db860){const _0x503b60=a216_0x4d24,_0x46b8d7=a216_0x58e569['join'](_0x1f8ba7,'.rabetbase.json'),_0x1ef370=_0x8db860??(existsSync(_0x46b8d7)?readJsonObject(_0x46b8d7):{}),_0x336dd8=syntheticApps(_0x1ef370);if(_0x336dd8[_0x503b60(0x92)]===0x0)return{'migration':MIGRATION_ID,'needed':![],'configAction':_0x503b60(0xab),'groups':[],'skippedLegacyDirectories':[],'manualMergeRequired':![]};const _0x26aef6=_0x1ef370[_0x503b60(0xad)]?_0x503b60(0x9e):_0x503b60(0x93),{groups:_0x1bb9ee,skipped:_0x33fe83}=uniqueRegistryGroups(configuredLayouts(_0x1f8ba7,_0x336dd8)),_0x125a74=_0x1bb9ee[_0x503b60(0x9d)](_0x3c000b=>planGroup(_0x1f8ba7,_0x3c000b)),_0x65bea9=_0x125a74[_0x503b60(0xc3)](_0x29a1cc=>_0x29a1cc['files'][_0x503b60(0xc3)](_0x4ecf41=>_0x4ecf41['action']===_0x503b60(0xb4))),_0x2b09a2=_0x26aef6===_0x503b60(0x93)||_0x125a74[_0x503b60(0xc3)](_0x30d90e=>_0x30d90e[_0x503b60(0xa6)][_0x503b60(0xc3)](_0x331a17=>![_0x503b60(0x9e),_0x503b60(0xc2)]['includes'](_0x331a17['action'])));return{'migration':MIGRATION_ID,'needed':_0x2b09a2,'configAction':_0x26aef6,'groups':_0x125a74,'skippedLegacyDirectories':_0x33fe83,'manualMergeRequired':_0x65bea9};}function migrateSingleAppConfig(_0x1b8069){const _0x479711=a216_0x4d24,_0x28bb7b=a216_0x58e569[_0x479711(0xb1)](_0x1b8069,_0x479711(0xa3));if(!existsSync(_0x28bb7b))return;const _0x2585d6=readConfigFile(_0x28bb7b);if(_0x2585d6[_0x479711(0xad)]&&typeof _0x2585d6['apps']===_0x479711(0x89))return;const _0x25768b=typeof _0x2585d6[_0x479711(0xb8)]===_0x479711(0xc6)?_0x2585d6[_0x479711(0xb8)]:typeof _0x2585d6['app']==='string'?_0x2585d6[_0x479711(0x9b)]:undefined;if(!_0x25768b)return;_0x2585d6[_0x479711(0xad)]={[_0x25768b]:{'appcode':_0x25768b}},_0x2585d6[_0x479711(0x83)]=_0x25768b,delete _0x2585d6[_0x479711(0x9b)],delete _0x2585d6[_0x479711(0xb8)],writeConfigFile(_0x28bb7b,_0x2585d6);}function legacyApiPath(_0x169138,_0x28d8b0){const _0x1a487d=a216_0x4d24,_0x2935f0=_0x28d8b0[_0x1a487d(0xc5)],_0x480262=_0x169138[_0x1a487d(0x92)]===0x1||_0x28d8b0[_0x1a487d(0x9b)][_0x1a487d(0x87)]?[a216_0x58e569[_0x1a487d(0xb1)](_0x2935f0,_0x1a487d(0x8e)),a216_0x58e569[_0x1a487d(0xb1)](_0x2935f0,_0x28d8b0[_0x1a487d(0x9b)][_0x1a487d(0x86)]+_0x1a487d(0xae))]:[a216_0x58e569[_0x1a487d(0xb1)](_0x2935f0,_0x28d8b0[_0x1a487d(0x9b)][_0x1a487d(0x86)]+_0x1a487d(0xae))];return _0x480262[_0x1a487d(0xc9)](existsSync);}function writeCandidateOrEntrypoint(_0xc47520,_0x155d1b,_0x180ba5,_0x2c0135){const _0x13e4c6=a216_0x4d24;if(_0x180ba5['action']==='unchanged'||_0x180ba5[_0x13e4c6(0xba)]==='preserve')return;if(_0x180ba5[_0x13e4c6(0xba)]==='manual-merge'){const _0x418dc5=_0x180ba5['candidatePath'];mkdirSync(a216_0x58e569['dirname'](_0x418dc5),{'recursive':!![]}),writeFileSync(_0x418dc5,_0x2c0135,_0x13e4c6(0xa1));return;}if(_0x180ba5[_0x13e4c6(0xba)]==='replace-generated'){const _0x34200d=backupPath(_0xc47520,_0x155d1b,a216_0x58e569[_0x13e4c6(0xc1)](_0x180ba5[_0x13e4c6(0x8b)]));mkdirSync(a216_0x58e569['dirname'](_0x34200d),{'recursive':!![]}),copyFileSync(_0x180ba5[_0x13e4c6(0x8b)],_0x34200d);}mkdirSync(a216_0x58e569['dirname'](_0x180ba5[_0x13e4c6(0x8b)]),{'recursive':!![]}),writeFileSync(_0x180ba5['path'],_0x2c0135,'utf8');}export async function upgradeProjectApiArchitecture(_0x5b769e){const _0x2e5c8c=a216_0x4d24,_0x2b7e54=analyzeProjectApiArchitecture(_0x5b769e);migrateSingleAppConfig(_0x5b769e);const _0x506a2f=getMultiAppConfigs(_0x2e5c8c(0x82),_0x5b769e)??[],_0x3af56a=configuredLayouts(_0x5b769e,_0x506a2f),{groups:_0xe6150}=uniqueRegistryGroups(_0x3af56a);let _0x26404b;for(const _0x4236fd of _0xe6150){const _0x2dba1c=_0x4236fd[0x0]['normalizedApiDir'];mkdirSync(_0x2dba1c,{'recursive':!![]});const _0x5321f7=_0x4236fd[_0x2e5c8c(0xc9)](_0x382812=>_0x382812[_0x2e5c8c(0x9b)][_0x2e5c8c(0x87)])??_0x4236fd[0x0];for(const _0x4a56b0 of _0x4236fd){const _0x5356c1=a216_0x58e569[_0x2e5c8c(0xb1)](_0x2dba1c,MODEL_REGISTRY_FILE_NAME),_0x7da698=readModelRegistry(_0x5356c1);if(_0x7da698?.[_0x2e5c8c(0xc7)][_0x4a56b0[_0x2e5c8c(0x9b)]['name']])continue;const _0x268164=legacyApiPath(_0x4236fd,_0x4a56b0),_0x1f80e5=_0x268164?readOptional(_0x268164):undefined;await initMultiAppEnvironment(_0x4a56b0[_0x2e5c8c(0x9b)]),updateModelRegistry({'outputDir':_0x2dba1c,'profileName':_0x4a56b0[_0x2e5c8c(0x9b)][_0x2e5c8c(0x86)],'defaultProfile':_0x5321f7[_0x2e5c8c(0x9b)][_0x2e5c8c(0x86)],'appCode':_0x4a56b0['app']['appcode'],'runtimeDomain':getRuntimeDomain(),'models':_0x1f80e5?parseLegacyApiModels(_0x1f80e5):[]});}const _0x3937c7=await renderModelRegistryScaffold(_0x2dba1c,_0x5b769e),_0x3b4096=planGroup(_0x5b769e,_0x4236fd);for(const _0x1b3f62 of _0x3b4096['files']){const _0x523c21=a216_0x58e569[_0x2e5c8c(0xc1)](_0x1b3f62['path']);if(_0x523c21==='api.ts')writeCandidateOrEntrypoint(_0x5b769e,_0x2dba1c,_0x1b3f62,_0x3937c7[_0x2e5c8c(0xa8)]);else{if(_0x523c21===_0x2e5c8c(0x99))writeCandidateOrEntrypoint(_0x5b769e,_0x2dba1c,_0x1b3f62,_0x3937c7[_0x2e5c8c(0xa7)]);else{if(_0x523c21===MODEL_RUNTIME_FILE_NAME)writeCandidateOrEntrypoint(_0x5b769e,_0x2dba1c,_0x1b3f62,_0x3937c7[_0x2e5c8c(0xc0)]);else _0x523c21===_0x2e5c8c(0xb0)&&_0x1b3f62[_0x2e5c8c(0xba)]===_0x2e5c8c(0xb5)&&writeCandidateOrEntrypoint(_0x5b769e,_0x2dba1c,_0x1b3f62,SDK_CONFIG_SOURCE);}}}}const _0x4a9d1e=_0x506a2f[_0x2e5c8c(0xc9)](_0x588271=>_0x588271[_0x2e5c8c(0x87)])??_0x506a2f[0x0];_0x4a9d1e&&(await initMultiAppEnvironment(_0x4a9d1e),_0x26404b=writeProjectDomainRoutingManifest(_0x5b769e)[_0x2e5c8c(0x8b)]);const _0x4ff90c=analyzeProjectApiArchitecture(_0x5b769e);return{..._0x2b7e54,'completed':!_0x4ff90c['manualMergeRequired'],'manualMergeRequired':_0x4ff90c[_0x2e5c8c(0x88)],'routingPath':_0x26404b};}
|
|
1
|
+
const a216_0x5556ae=a216_0x2502;(function(_0x2ebb00,_0x5d2fd8){const _0x32098f=a216_0x2502,_0xf002fb=_0x2ebb00();while(!![]){try{const _0x44920c=parseInt(_0x32098f(0x142))/0x1*(parseInt(_0x32098f(0x14e))/0x2)+-parseInt(_0x32098f(0x166))/0x3*(parseInt(_0x32098f(0x131))/0x4)+-parseInt(_0x32098f(0x12f))/0x5*(-parseInt(_0x32098f(0x165))/0x6)+-parseInt(_0x32098f(0x163))/0x7*(-parseInt(_0x32098f(0x171))/0x8)+parseInt(_0x32098f(0x152))/0x9+parseInt(_0x32098f(0x173))/0xa*(-parseInt(_0x32098f(0x135))/0xb)+-parseInt(_0x32098f(0x16b))/0xc;if(_0x44920c===_0x5d2fd8)break;else _0xf002fb['push'](_0xf002fb['shift']());}catch(_0x3c4c49){_0xf002fb['push'](_0xf002fb['shift']());}}}(a216_0x5b8b,0xe0a04));function a216_0x2502(_0x39279e,_0x28c33d){_0x39279e=_0x39279e-0x12c;const _0x5b8bd7=a216_0x5b8b();let _0x250233=_0x5b8bd7[_0x39279e];return _0x250233;}import{copyFileSync,existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import a216_0x5a61ef from'node:path';import{getMultiAppConfigs,initMultiAppEnvironment,readConfigFile,writeConfigFile}from'../../context.js';import{DEFAULT_API_DIR}from'../../constant/paths.js';function a216_0x5b8b(){const _0x18289e=['client.ts','map','manual-merge','appcode','.rabetbase.json','unconfigured','startsWith','api.ts','candidatePath','6078121pDIvuo','add','186IsdUXL','318OAOLex','outputDir','push','files','migrate-single-app','15885096XVpyOM','string','entries','project-upgrade','has','Multiple\x20Lovrabet\x20model\x20profiles\x20match\x20Runtime\x20Domain','16hsxDMV','dirname','6470PlkFrj','replace-generated','api-model-registry-v2','api','preserve','manualMergeRequired','create','utf8','./models.generated','Recognized\x20legacy\x20CLI\x20scaffold;\x20a\x20backup\x20will\x20be\x20retained.','275995sskFFI','length','27868AfEsRo','resolve','includes','keys','30591KckGHL','flatMap','app','project','profiles','join','Model\x20facts\x20are\x20preserved\x20and\x20completed\x20from\x20legacy\x20generated\x20files\x20when\x20possible.','./model-runtime','.rabetbase','path','client','-api.ts','defaultApp','662714BnGKfE','backups','basename','some','external-api-dir','sdk-config.ts','action','unchanged','normalizedApiDir','apiGroup','The\x20existing\x20runtime\x20selector\x20is\x20not\x20a\x20recognized\x20current\x20generated\x20file.','default','2WQxDbw','object','apps','apiDir','6040314BnGDxk','isDefault','relative','LOVRABET_RUNTIME_DOMAIN','find','Profile-aware\x20model\x20selection\x20generated\x20by\x20Rabetbase\x20CLI','name','single'];a216_0x5b8b=function(){return _0x18289e;};return a216_0x5b8b();}import{getRuntimeDomain}from'../../constant/domain.js';import{getRegistryGroup,resolveApiProfileLayouts}from'../../api/api-group.js';import{MODEL_REGISTRY_FILE_NAME,MODEL_RUNTIME_FILE_NAME,readModelRegistry,updateModelRegistry}from'../../api/model-registry-file.js';import{isLegacyGeneratedApiScaffold,isLegacyGeneratedClientScaffold,parseLegacyApiModels}from'../../api/legacy-api-file.js';import{renderModelRegistryScaffold}from'../../api/model-registry-scaffold.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';const MIGRATION_ID=a216_0x5556ae(0x175),SDK_CONFIG_SOURCE='/**\x0a\x20*\x20Lovrabet\x20SDK\x20runtime\x20routing.\x0a\x20*\x20Generated\x20by\x20Rabetbase\x20CLI.\x20Do\x20not\x20add\x20credentials\x20to\x20this\x20file.\x0a\x20*/\x0aexport\x20const\x20LOVRABET_SDK_CONFIG\x20=\x20{}\x20as\x20const;\x0a';function relativeMigrationDir(_0x505b76,_0x225384){const _0x1c1e55=a216_0x5556ae,_0x409c70=a216_0x5a61ef[_0x1c1e55(0x154)](_0x505b76,_0x225384);return _0x409c70&&!_0x409c70[_0x1c1e55(0x160)]('..')?_0x409c70:_0x1c1e55(0x146);}function candidatePath(_0x505ef1,_0x4b8863,_0x1c73fd){const _0x270e46=a216_0x5556ae;return a216_0x5a61ef[_0x270e46(0x13a)](_0x505ef1,_0x270e46(0x13d),_0x270e46(0x16e),MIGRATION_ID,'candidates',relativeMigrationDir(_0x505ef1,_0x4b8863),_0x1c73fd);}function backupPath(_0x4053cc,_0x1af377,_0x145ba0){const _0x3faa15=a216_0x5556ae;return a216_0x5a61ef['join'](_0x4053cc,_0x3faa15(0x13d),_0x3faa15(0x16e),MIGRATION_ID,_0x3faa15(0x143),relativeMigrationDir(_0x4053cc,_0x1af377),_0x145ba0);}function readOptional(_0x2a9062){const _0x486d5d=a216_0x5556ae;try{return readFileSync(_0x2a9062,_0x486d5d(0x12c));}catch{return undefined;}}function readJsonObject(_0x3ca7d3){const _0x196e83=a216_0x5556ae;try{const _0x4ae16f=JSON['parse'](readFileSync(_0x3ca7d3,_0x196e83(0x12c)));return _0x4ae16f&&typeof _0x4ae16f===_0x196e83(0x14f)?_0x4ae16f:{};}catch{return{};}}function planEntrypoint(_0x11598b,_0x4b8327,_0x398e23,_0x2f14f5){const _0x4320b4=a216_0x5556ae,_0x1346d0=a216_0x5a61ef['join'](_0x4b8327,_0x398e23),_0x2eabfc=readOptional(_0x1346d0);if(_0x2eabfc===undefined)return{'path':_0x1346d0,'action':_0x4320b4(0x179)};if(_0x398e23===_0x4320b4(0x161)?_0x2eabfc['includes'](_0x4320b4(0x12d))&&_0x2eabfc['includes'](_0x4320b4(0x13c)):_0x2eabfc[_0x4320b4(0x133)](_0x4320b4(0x155)))return{'path':_0x1346d0,'action':_0x4320b4(0x149)};if(_0x2f14f5(_0x2eabfc))return{'path':_0x1346d0,'action':_0x4320b4(0x174),'reason':_0x4320b4(0x12e)};return{'path':_0x1346d0,'action':'manual-merge','reason':'The\x20file\x20contains\x20project-owned\x20code\x20and\x20will\x20not\x20be\x20overwritten.','candidatePath':candidatePath(_0x11598b,_0x4b8327,_0x398e23)};}function syntheticApps(_0x202a9c){const _0x6f653f=a216_0x5556ae,_0x4271e4=_0x202a9c[_0x6f653f(0x150)]&&typeof _0x202a9c['apps']===_0x6f653f(0x14f)?_0x202a9c[_0x6f653f(0x150)]:undefined;if(_0x4271e4&&Object['keys'](_0x4271e4)[_0x6f653f(0x130)]>0x0){const _0x32f79e=typeof _0x202a9c[_0x6f653f(0x141)]===_0x6f653f(0x16c)?_0x202a9c[_0x6f653f(0x141)]:Object['keys'](_0x4271e4)[_0x6f653f(0x130)]===0x1?Object[_0x6f653f(0x134)](_0x4271e4)[0x0]:undefined;return Object[_0x6f653f(0x16d)](_0x4271e4)[_0x6f653f(0x136)](([_0x507e32,_0x30c81b])=>{const _0x421fb3=_0x6f653f,_0x295d97=_0x30c81b,_0x52b6b4=typeof _0x295d97['appcode']===_0x421fb3(0x16c)?_0x295d97[_0x421fb3(0x15d)]:'';return _0x52b6b4?[{'name':_0x507e32,'appcode':_0x52b6b4,'apiGroup':typeof _0x295d97[_0x421fb3(0x14b)]===_0x421fb3(0x16c)?_0x295d97[_0x421fb3(0x14b)]:undefined,'isDefault':_0x507e32===_0x32f79e,'region':'cn','regionSource':_0x421fb3(0x14d),'apiDir':typeof _0x295d97[_0x421fb3(0x151)]==='string'?_0x295d97[_0x421fb3(0x151)]:typeof _0x202a9c[_0x421fb3(0x151)]===_0x421fb3(0x16c)?_0x202a9c[_0x421fb3(0x151)]:undefined,'routingConfig':{}}]:[];});}const _0x51e3a4=typeof _0x202a9c[_0x6f653f(0x15d)]===_0x6f653f(0x16c)?_0x202a9c[_0x6f653f(0x15d)]:typeof _0x202a9c[_0x6f653f(0x137)]===_0x6f653f(0x16c)?_0x202a9c[_0x6f653f(0x137)]:undefined;if(!_0x51e3a4)return[];return[{'name':_0x51e3a4,'appcode':_0x51e3a4,'isDefault':!![],'region':'cn','regionSource':'default','apiDir':typeof _0x202a9c[_0x6f653f(0x151)]===_0x6f653f(0x16c)?_0x202a9c[_0x6f653f(0x151)]:undefined,'routingConfig':{}}];}function configuredLayouts(_0x3a04dc,_0x291d75){const _0x514f01=a216_0x5556ae;return resolveApiProfileLayouts(_0x291d75,_0x191016=>a216_0x5a61ef[_0x514f01(0x132)](_0x3a04dc,_0x191016['apiDir']||DEFAULT_API_DIR),_0x3a04dc);}function uniqueRegistryGroups(_0x41953d){const _0x3312ef=a216_0x5556ae,_0x29f727=[],_0x17574a=new Set(),_0x5ad6bc=new Set();for(const _0xc844f8 of _0x41953d){const _0x1d3d97=getRegistryGroup(_0x41953d,_0xc844f8);if(!_0x1d3d97){_0x17574a[_0x3312ef(0x164)](_0xc844f8[_0x3312ef(0x167)]);continue;}const _0x3b639b=_0xc844f8[_0x3312ef(0x14a)]+'\x00'+(_0xc844f8['apiGroup']??_0x3312ef(0x159));!_0x5ad6bc[_0x3312ef(0x16f)](_0x3b639b)&&(_0x29f727[_0x3312ef(0x168)](_0x1d3d97),_0x5ad6bc[_0x3312ef(0x164)](_0x3b639b));}return{'groups':_0x29f727,'skipped':[..._0x17574a]};}function planGroup(_0x5d0254,_0x28da1c){const _0x2036c2=a216_0x5556ae,_0x2513a8=_0x28da1c[0x0]['normalizedApiDir'],_0x466a03=a216_0x5a61ef[_0x2036c2(0x13a)](_0x2513a8,MODEL_RUNTIME_FILE_NAME),_0x184adb=readOptional(_0x466a03),_0x4f9163=_0x184adb!==undefined&&_0x184adb['includes'](_0x2036c2(0x157))&&_0x184adb[_0x2036c2(0x133)](_0x2036c2(0x170))&&_0x184adb[_0x2036c2(0x133)]('No\x20Lovrabet\x20model\x20profile\x20matches\x20Runtime\x20Domain'),_0x490fd6=a216_0x5a61ef[_0x2036c2(0x13a)](_0x2513a8,MODEL_REGISTRY_FILE_NAME),_0x3f2303=a216_0x5a61ef[_0x2036c2(0x13a)](_0x2513a8,_0x2036c2(0x147)),_0x5077ac=[planEntrypoint(_0x5d0254,_0x2513a8,_0x2036c2(0x161),isLegacyGeneratedApiScaffold),planEntrypoint(_0x5d0254,_0x2513a8,_0x2036c2(0x15a),isLegacyGeneratedClientScaffold),{'path':_0x466a03,'action':_0x184adb===undefined?_0x2036c2(0x179):_0x4f9163?_0x2036c2(0x149):_0x2036c2(0x15c),'reason':_0x184adb===undefined?undefined:_0x2036c2(0x14c),..._0x184adb!==undefined&&!_0x4f9163?{'candidatePath':candidatePath(_0x5d0254,_0x2513a8,MODEL_RUNTIME_FILE_NAME)}:{}},{'path':_0x490fd6,'action':existsSync(_0x490fd6)?'preserve':_0x2036c2(0x179),'reason':_0x2036c2(0x13b)},{'path':_0x3f2303,'action':existsSync(_0x3f2303)?_0x2036c2(0x177):_0x2036c2(0x179)}];return{'apiDir':_0x2513a8,'profiles':_0x28da1c[_0x2036c2(0x15b)](_0x31851f=>_0x31851f['app'][_0x2036c2(0x158)]),'files':_0x5077ac};}export function analyzeProjectApiArchitecture(_0x94e715,_0x109ca9){const _0x5188d9=a216_0x5556ae,_0x46c46b=a216_0x5a61ef[_0x5188d9(0x13a)](_0x94e715,_0x5188d9(0x15e)),_0x176dd8=_0x109ca9??(existsSync(_0x46c46b)?readJsonObject(_0x46c46b):{}),_0x52e4c2=syntheticApps(_0x176dd8);if(_0x52e4c2['length']===0x0)return{'migration':MIGRATION_ID,'needed':![],'configAction':_0x5188d9(0x15f),'groups':[],'skippedLegacyDirectories':[],'manualMergeRequired':![]};const _0x21e723=_0x176dd8[_0x5188d9(0x150)]?_0x5188d9(0x149):_0x5188d9(0x16a),{groups:_0x327245,skipped:_0x282eae}=uniqueRegistryGroups(configuredLayouts(_0x94e715,_0x52e4c2)),_0x3b268=_0x327245['map'](_0x81ae5c=>planGroup(_0x94e715,_0x81ae5c)),_0x172100=_0x3b268[_0x5188d9(0x145)](_0x55c559=>_0x55c559[_0x5188d9(0x169)][_0x5188d9(0x145)](_0x28ed0a=>_0x28ed0a[_0x5188d9(0x148)]===_0x5188d9(0x15c))),_0x3479c0=_0x21e723===_0x5188d9(0x16a)||_0x3b268[_0x5188d9(0x145)](_0x32b922=>_0x32b922[_0x5188d9(0x169)][_0x5188d9(0x145)](_0x164b9d=>!['unchanged',_0x5188d9(0x177)][_0x5188d9(0x133)](_0x164b9d['action'])));return{'migration':MIGRATION_ID,'needed':_0x3479c0,'configAction':_0x21e723,'groups':_0x3b268,'skippedLegacyDirectories':_0x282eae,'manualMergeRequired':_0x172100};}function migrateSingleAppConfig(_0x25eb3c){const _0x366ac2=a216_0x5556ae,_0x5e9bb6=a216_0x5a61ef['join'](_0x25eb3c,_0x366ac2(0x15e));if(!existsSync(_0x5e9bb6))return;const _0x3a5f92=readConfigFile(_0x5e9bb6);if(_0x3a5f92[_0x366ac2(0x150)]&&typeof _0x3a5f92[_0x366ac2(0x150)]==='object')return;const _0x343195=typeof _0x3a5f92[_0x366ac2(0x15d)]===_0x366ac2(0x16c)?_0x3a5f92[_0x366ac2(0x15d)]:typeof _0x3a5f92[_0x366ac2(0x137)]===_0x366ac2(0x16c)?_0x3a5f92[_0x366ac2(0x137)]:undefined;if(!_0x343195)return;_0x3a5f92[_0x366ac2(0x150)]={[_0x343195]:{'appcode':_0x343195}},_0x3a5f92[_0x366ac2(0x141)]=_0x343195,delete _0x3a5f92['app'],delete _0x3a5f92['appcode'],writeConfigFile(_0x5e9bb6,_0x3a5f92);}function legacyApiPath(_0xd54a73,_0x12cd2f){const _0x11080e=a216_0x5556ae,_0x4d782b=_0x12cd2f[_0x11080e(0x14a)],_0x1d6bb3=_0xd54a73[_0x11080e(0x130)]===0x1||_0x12cd2f['app']['isDefault']?[a216_0x5a61ef['join'](_0x4d782b,'api.ts'),a216_0x5a61ef[_0x11080e(0x13a)](_0x4d782b,_0x12cd2f['app']['name']+'-api.ts')]:[a216_0x5a61ef['join'](_0x4d782b,_0x12cd2f[_0x11080e(0x137)][_0x11080e(0x158)]+_0x11080e(0x140))];return _0x1d6bb3[_0x11080e(0x156)](existsSync);}function writeCandidateOrEntrypoint(_0x1e527a,_0x4a264d,_0x15773c,_0x26ee7f){const _0xbb41af=a216_0x5556ae;if(_0x15773c[_0xbb41af(0x148)]===_0xbb41af(0x149)||_0x15773c[_0xbb41af(0x148)]===_0xbb41af(0x177))return;if(_0x15773c[_0xbb41af(0x148)]===_0xbb41af(0x15c)){const _0x269ca3=_0x15773c[_0xbb41af(0x162)];mkdirSync(a216_0x5a61ef[_0xbb41af(0x172)](_0x269ca3),{'recursive':!![]}),writeFileSync(_0x269ca3,_0x26ee7f,'utf8');return;}if(_0x15773c[_0xbb41af(0x148)]===_0xbb41af(0x174)){const _0x33b3f4=backupPath(_0x1e527a,_0x4a264d,a216_0x5a61ef['basename'](_0x15773c[_0xbb41af(0x13e)]));mkdirSync(a216_0x5a61ef[_0xbb41af(0x172)](_0x33b3f4),{'recursive':!![]}),copyFileSync(_0x15773c['path'],_0x33b3f4);}mkdirSync(a216_0x5a61ef[_0xbb41af(0x172)](_0x15773c[_0xbb41af(0x13e)]),{'recursive':!![]}),writeFileSync(_0x15773c[_0xbb41af(0x13e)],_0x26ee7f,_0xbb41af(0x12c));}export async function upgradeProjectApiArchitecture(_0x34f3f6){const _0x2af993=a216_0x5556ae,_0x39f95b=analyzeProjectApiArchitecture(_0x34f3f6);migrateSingleAppConfig(_0x34f3f6);const _0x343ee1=getMultiAppConfigs(_0x2af993(0x138),_0x34f3f6)??[],_0x3a9797=configuredLayouts(_0x34f3f6,_0x343ee1),{groups:_0x4f817a}=uniqueRegistryGroups(_0x3a9797);let _0x500acc;for(const _0x5d2a18 of _0x4f817a){const _0x45e683=_0x5d2a18[0x0][_0x2af993(0x14a)];mkdirSync(_0x45e683,{'recursive':!![]});const _0x4f512e=_0x5d2a18[_0x2af993(0x156)](_0x3714b1=>_0x3714b1[_0x2af993(0x137)][_0x2af993(0x153)])??_0x5d2a18[0x0];for(const _0x49d9db of _0x5d2a18){const _0x2bc29b=a216_0x5a61ef[_0x2af993(0x13a)](_0x45e683,MODEL_REGISTRY_FILE_NAME),_0x2692a4=readModelRegistry(_0x2bc29b);if(_0x2692a4?.[_0x2af993(0x139)][_0x49d9db[_0x2af993(0x137)][_0x2af993(0x158)]])continue;const _0x19cb13=legacyApiPath(_0x5d2a18,_0x49d9db),_0x2b7b38=_0x19cb13?readOptional(_0x19cb13):undefined;await initMultiAppEnvironment(_0x49d9db[_0x2af993(0x137)]),updateModelRegistry({'outputDir':_0x45e683,'profileName':_0x49d9db['app']['name'],'defaultProfile':_0x4f512e[_0x2af993(0x137)][_0x2af993(0x158)],'appCode':_0x49d9db[_0x2af993(0x137)]['appcode'],'runtimeDomain':getRuntimeDomain(),'models':_0x2b7b38?parseLegacyApiModels(_0x2b7b38):[]});}const _0x3dc331=await renderModelRegistryScaffold(_0x45e683,_0x34f3f6),_0x288417=planGroup(_0x34f3f6,_0x5d2a18);for(const _0x20052c of _0x288417['files']){const _0x42705e=a216_0x5a61ef[_0x2af993(0x144)](_0x20052c[_0x2af993(0x13e)]);if(_0x42705e===_0x2af993(0x161))writeCandidateOrEntrypoint(_0x34f3f6,_0x45e683,_0x20052c,_0x3dc331[_0x2af993(0x176)]);else{if(_0x42705e==='client.ts')writeCandidateOrEntrypoint(_0x34f3f6,_0x45e683,_0x20052c,_0x3dc331[_0x2af993(0x13f)]);else{if(_0x42705e===MODEL_RUNTIME_FILE_NAME)writeCandidateOrEntrypoint(_0x34f3f6,_0x45e683,_0x20052c,_0x3dc331['modelRuntime']);else _0x42705e==='sdk-config.ts'&&_0x20052c[_0x2af993(0x148)]==='create'&&writeCandidateOrEntrypoint(_0x34f3f6,_0x45e683,_0x20052c,SDK_CONFIG_SOURCE);}}}}const _0x2cff13=_0x343ee1[_0x2af993(0x156)](_0x488621=>_0x488621[_0x2af993(0x153)])??_0x343ee1[0x0];_0x2cff13&&(await initMultiAppEnvironment(_0x2cff13),_0x500acc=writeProjectDomainRoutingManifest(_0x34f3f6)[_0x2af993(0x13e)]);const _0x1ce8c6=analyzeProjectApiArchitecture(_0x34f3f6);return{..._0x39f95b,'completed':!_0x1ce8c6[_0x2af993(0x178)],'manualMergeRequired':_0x1ce8c6[_0x2af993(0x178)],'routingPath':_0x500acc};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x33d248,_0x323573){const _0x4f9d5d=a217_0x387a,_0x4e8916=_0x33d248();while(!![]){try{const _0x389163=-parseInt(_0x4f9d5d(0x1b1))/0x1*(parseInt(_0x4f9d5d(0x1b8))/0x2)+-parseInt(_0x4f9d5d(0x1b0))/0x3+parseInt(_0x4f9d5d(0x1c4))/0x4*(-parseInt(_0x4f9d5d(0x1b6))/0x5)+-parseInt(_0x4f9d5d(0x1c5))/0x6*(-parseInt(_0x4f9d5d(0x1c2))/0x7)+-parseInt(_0x4f9d5d(0x1bb))/0x8*(parseInt(_0x4f9d5d(0x1ba))/0x9)+-parseInt(_0x4f9d5d(0x1b4))/0xa+parseInt(_0x4f9d5d(0x1c6))/0xb;if(_0x389163===_0x323573)break;else _0x4e8916['push'](_0x4e8916['shift']());}catch(_0xb61086){_0x4e8916['push'](_0x4e8916['shift']());}}}(a217_0x4b3f,0x7bd2d));function a217_0x4b3f(){const _0x4a7889=['cwd','250JQxUIg','production','9yhxOwF','7461456BzoKbk','\x22\x20already\x20exists','Not\x20set','Directory\x20\x22','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','log','trim','91qhtbSu','env','1772EDjINA','121776ZSGmAZ','30112390sAjngG','Login\x20failed','Skipped','86172VJGaGr','4451OCPDPW','√\x20Login\x20status:\x20','cyan','2671330ZVsmHF','green','8005ZyMUlm'];a217_0x4b3f=function(){return _0x4a7889;};return a217_0x4b3f();}import{existsSync}from'node:fs';import a217_0x5538c0 from'node:path';import a217_0x5dd57b from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a217_0x387a(_0x159541,_0x701ed6){_0x159541=_0x159541-0x1af;const _0x4b3f3c=a217_0x4b3f();let _0x387a38=_0x4b3f3c[_0x159541];return _0x387a38;}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(_0x5f13bb,_0x113fce,_0x25b691){const _0x514478=a217_0x387a,_0x5dc084='my-app',_0x1502dd=readConfig(),_0x46687a=typeof _0x1502dd[_0x514478(0x1c3)]==='string'?_0x1502dd[_0x514478(0x1c3)]:undefined,_0x1f9700=await input({'message':'Project\x20name:','default':_0x5dc084,'validate':_0x10f3cb=>{const _0x334afc=_0x514478,_0x2605a9=_0x10f3cb[_0x334afc(0x1c1)]()||_0x5dc084,_0x2edb9e=getProjectNameValidationError(_0x2605a9);if(_0x2edb9e)return _0x2edb9e;const _0x45ad65=a217_0x5538c0['resolve'](process[_0x334afc(0x1b7)](),_0x2605a9);if(existsSync(_0x45ad65))return _0x334afc(0x1be)+_0x2605a9+_0x334afc(0x1bc);return!![];}});console[_0x514478(0x1c0)](a217_0x5dd57b['green']('√\x20Project\x20Name:\x20'+a217_0x5dd57b['cyan'](_0x1f9700)));const _0x19dbf4=await selectSingleAppcode(_0x25b691);console[_0x514478(0x1c0)](a217_0x5dd57b[_0x514478(0x1b5)]('√\x20App\x20Code:\x20'+a217_0x5dd57b[_0x514478(0x1b3)](_0x19dbf4||_0x514478(0x1bd))));if(_0x19dbf4){const _0x3828d2=await getIsSessionValid();if(!_0x3828d2){const _0x56157b=await confirm({'message':_0x514478(0x1bf),'default':!![]});if(_0x56157b){const _0x175f40=await authServer({'silent':!![]});console['log'](a217_0x5dd57b[_0x514478(0x1b5)](_0x514478(0x1b2)+a217_0x5dd57b[_0x514478(0x1b3)](_0x175f40?'Logged\x20in':_0x514478(0x1c7))));}else console[_0x514478(0x1c0)](a217_0x5dd57b[_0x514478(0x1b5)](_0x514478(0x1b2)+a217_0x5dd57b[_0x514478(0x1b3)](_0x514478(0x1af))));}await _0x5f13bb({'projectName':_0x1f9700,'appCode':_0x19dbf4,'env':_0x113fce||_0x46687a||_0x514478(0x1b9)});}else await _0x5f13bb({'projectName':_0x1f9700,'env':_0x113fce||_0x46687a||_0x514478(0x1b9)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a218_0x4cfe(){const _0x4a6e82=['1842yhZHQW','349dKYEky','37344DhKYqf','444232CXNfpF','152004rlfYhH','896fgOJJT','toFixed','3585870qssTiS','72IToZmB','4sSJykQ','10065750fktYcw','1116dKwvku','222497XqQbIp'];a218_0x4cfe=function(){return _0x4a6e82;};return a218_0x4cfe();}function a218_0x2bda(_0x50aa96,_0xab424e){_0x50aa96=_0x50aa96-0x131;const _0x4cfe25=a218_0x4cfe();let _0x2bda90=_0x4cfe25[_0x50aa96];return _0x2bda90;}(function(_0x5cc77f,_0x5da858){const _0x578e43=a218_0x2bda,_0x47b8ea=_0x5cc77f();while(!![]){try{const _0x54a34c=parseInt(_0x578e43(0x134))/0x1*(parseInt(_0x578e43(0x133))/0x2)+parseInt(_0x578e43(0x137))/0x3*(parseInt(_0x578e43(0x13c))/0x4)+parseInt(_0x578e43(0x13a))/0x5+-parseInt(_0x578e43(0x135))/0x6*(-parseInt(_0x578e43(0x138))/0x7)+parseInt(_0x578e43(0x136))/0x8*(-parseInt(_0x578e43(0x13b))/0x9)+parseInt(_0x578e43(0x13d))/0xa+-parseInt(_0x578e43(0x132))/0xb*(parseInt(_0x578e43(0x131))/0xc);if(_0x54a34c===_0x5da858)break;else _0x47b8ea['push'](_0x47b8ea['shift']());}catch(_0x591edb){_0x47b8ea['push'](_0x47b8ea['shift']());}}}(a218_0x4cfe,0x8a787));export function formatElapsed(_0x24acfe){const _0x54dadc=a218_0x2bda,_0x31d99c=Date['now']()-_0x24acfe;if(_0x31d99c<0x3e8)return _0x31d99c+'ms';const _0x547744=(_0x31d99c/0x3e8)[_0x54dadc(0x139)](0x2),_0x253ebd=_0x547744['replace'](/\.?0+$/u,'');return _0x253ebd+'s';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1e1d81,_0x15cd3d){const _0x2f53c3=a219_0x234d,_0x2aff5f=_0x1e1d81();while(!![]){try{const _0xab5da7=parseInt(_0x2f53c3(0x153))/0x1*(-parseInt(_0x2f53c3(0x16f))/0x2)+parseInt(_0x2f53c3(0x111))/0x3+-parseInt(_0x2f53c3(0x146))/0x4+parseInt(_0x2f53c3(0x11c))/0x5*(-parseInt(_0x2f53c3(0x127))/0x6)+-parseInt(_0x2f53c3(0x119))/0x7*(-parseInt(_0x2f53c3(0x162))/0x8)+parseInt(_0x2f53c3(0x11e))/0x9+-parseInt(_0x2f53c3(0x10b))/0xa;if(_0xab5da7===_0x15cd3d)break;else _0x2aff5f['push'](_0x2aff5f['shift']());}catch(_0x173126){_0x2aff5f['push'](_0x2aff5f['shift']());}}}(a219_0x3385,0x505fa));import a219_0x5a7308 from'path';import a219_0x31a990 from'fs';import a219_0x530d03 from'chalk';function a219_0x3385(){const _0x42a6fd=['Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','Verifying\x20project\x20template','\x20\x202.\x20Pull\x20API\x20configuration:\x20','Downloading\x20project\x20template','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','existsSync','Extracting\x20project\x20template','27654UgwQFj','join','\x20&&\x20','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','lstatSync','apps','Starting\x20project\x20creation:\x20','currentDir','stableVersion','readdirSync','\x20run\x20start','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','Project\x20directory\x20','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','env','writeFileSync','resolving','stop','\x20|\x20AppCode:\x20','nonInteractive','Configured\x20app\x20AppCode:\x20','Project\x20name:\x20','cookie','\x20model(s)','projectName','bold','info','.rabetbase-create-','resolve','copying','chdir','45228oVcHYT','W_OK','length','fail','CLI\x20version\x20check','Project\x20creation\x20failed:\x20','\x20|\x20Default:\x20implicit\x20(single\x20app)','setLogPath','constants','message','...','green','Project\x20created:\x20','24899nrgGFC','downloading','The\x20current\x20directory\x20must\x20be\x20empty.','extracting','readFileSync','√\x20package.json\x20updated:\x20name=','cyan','name','\x20√\x20','API\x20configuration\x20pull\x20failed','modelCount','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','rmSync','ino','package.json','8pYGhZa','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','warn','Install\x20dependencies','*\x20Pulling\x20API\x20configuration...','string','√\x20Configuration\x20file\x20created,\x20Apps:\x20','toLocaleString','dev','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','isDirectory','\x20dataset(s),\x20generated\x20','keys','42raMesH','🚀\x20Next\x20Steps:','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.','Resolving\x20project\x20template','log','stringify','needsUpgrade','\x20Generated\x20by\x20rabetbase\x20cli\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','push','\x20api\x20pull\x20--force\x20--yes','accessSync','2474070zhYOBR','gray','parse','production','version','utf8','1686294KErYZt','cd\x20','validation','appCode','cwd','project','renameSync','repeat','4241965icQIPy','create','API\x20configuration\x20pulled:\x20','655fSdNoD','1.0.0','4918401iTMSLs','belowMinimum'];a219_0x3385=function(){return _0x42a6fd;};return a219_0x3385();}import a219_0x31ad9d from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';function a219_0x234d(_0x3dd730,_0x3797d8){_0x3dd730=_0x3dd730-0x101;const _0x3385f1=a219_0x3385();let _0x234da5=_0x3385f1[_0x3dd730];return _0x234da5;}import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{loadRawConfigLayers,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';import{getRuntimeDomain,getSdkClientRoutingConfig}from'../../../constant/domain.js';import{generateSdkConfigFile}from'../../../api/generate-sdk-config-file.js';import{writeProjectDomainRoutingManifest}from'../../../config/project-domain-routing.js';import{CliErrors}from'../../../errors.js';function readDirectoryIdentity(_0x4e41d7){const _0x43354a=a219_0x234d;try{const _0x3382f6=a219_0x31a990[_0x43354a(0x12b)](_0x4e41d7);if(!_0x3382f6[_0x43354a(0x16c)]())return null;return{'dev':_0x3382f6[_0x43354a(0x16a)],'ino':_0x3382f6[_0x43354a(0x160)]};}catch{return null;}}function isSameDirectory(_0x447640,_0x4e2021){const _0x4db082=a219_0x234d;return!!_0x447640&&!!_0x4e2021&&_0x447640[_0x4db082(0x16a)]===_0x4e2021[_0x4db082(0x16a)]&&_0x447640[_0x4db082(0x160)]===_0x4e2021[_0x4db082(0x160)];}function commitCurrentDirectoryProject(_0x319ba6,_0x2068bc,_0xe06a6c){const _0x5ec837=a219_0x234d;if(!isSameDirectory(readDirectoryIdentity(_0x319ba6),_0xe06a6c))throw new Error(_0x5ec837(0x16b));const _0x49600d=a219_0x5a7308['basename'](_0x2068bc),_0x53424f=a219_0x31a990[_0x5ec837(0x130)](_0x319ba6);if(_0x53424f['length']!==0x1||_0x53424f[0x0]!==_0x49600d)throw CliErrors[_0x5ec837(0x113)](_0x5ec837(0x101),_0x5ec837(0x120));const _0x497b4a=a219_0x5a7308[_0x5ec837(0x128)](_0x2068bc,_0x5ec837(0x116)),_0x59e26b=[];try{for(const _0x5b1057 of a219_0x31a990[_0x5ec837(0x130)](_0x497b4a)){a219_0x31a990[_0x5ec837(0x117)](a219_0x5a7308[_0x5ec837(0x128)](_0x497b4a,_0x5b1057),a219_0x5a7308['join'](_0x319ba6,_0x5b1057)),_0x59e26b[_0x5ec837(0x108)](_0x5b1057);}a219_0x31a990[_0x5ec837(0x15f)](_0x2068bc,{'recursive':!![],'force':!![]});}catch(_0x3eaff6){for(const _0x2ed74e of _0x59e26b['reverse']()){const _0x288845=a219_0x5a7308[_0x5ec837(0x128)](_0x319ba6,_0x2ed74e);if(!a219_0x31a990[_0x5ec837(0x125)](_0x288845))continue;a219_0x31a990[_0x5ec837(0x117)](_0x288845,a219_0x5a7308[_0x5ec837(0x128)](_0x497b4a,_0x2ed74e));}throw _0x3eaff6;}}export async function createApp(_0x2b4250){const _0x1fb615=a219_0x234d,_0x386852=await checkCliVersion();(_0x386852['needsUpgrade']||_0x386852[_0x1fb615(0x11f)])&&(printCliUpgradeWarning(_0x386852),assertCliVersionSupported(_0x386852),logger[_0x1fb615(0x141)]('create',_0x1fb615(0x14a),{'currentVersion':_0x386852['currentVersion'],'stableVersion':_0x386852[_0x1fb615(0x12f)],'minimumVersion':_0x386852['minimumVersion'],'needsUpgrade':_0x386852[_0x1fb615(0x105)],'belowMinimum':_0x386852[_0x1fb615(0x11f)]}));const _0x416cd2=_0x2b4250[_0x1fb615(0x12e)]?a219_0x5a7308['basename'](process[_0x1fb615(0x115)]()):_0x2b4250['projectCode'];if(_0x416cd2&&(_0x2b4250[_0x1fb615(0x114)]||_0x2b4250[_0x1fb615(0x13a)]))await runCreate({'projectName':_0x416cd2,'appCode':_0x2b4250['appCode'],'env':_0x2b4250[_0x1fb615(0x135)]},_0x2b4250);else{if(_0x416cd2){const _0x8b4b00=await selectSingleAppcode(_0x2b4250[_0x1fb615(0x13d)]);await runCreate({'projectName':_0x416cd2,'appCode':_0x8b4b00||undefined,'env':_0x2b4250['env']},_0x2b4250);}else await guidedCreateProject(_0x3756b1=>runCreate(_0x3756b1,_0x2b4250),_0x2b4250['env'],_0x2b4250[_0x1fb615(0x13d)]);}}async function runCreate(_0x2bc478,_0xc5a032){const _0x2f995c=a219_0x234d;_0x2bc478[_0x2f995c(0x13f)]=validateProjectName(_0x2bc478[_0x2f995c(0x13f)]);const _0xcd6230=_0xc5a032[_0x2f995c(0x12e)]?process['cwd']():a219_0x5a7308['resolve'](process[_0x2f995c(0x115)](),_0x2bc478[_0x2f995c(0x13f)]);if(_0xc5a032[_0x2f995c(0x12e)]){if(a219_0x31a990[_0x2f995c(0x130)](_0xcd6230)[_0x2f995c(0x148)]>0x0)throw CliErrors['validation'](_0x2f995c(0x155),_0x2f995c(0x132));}else{if(a219_0x31a990[_0x2f995c(0x125)](_0xcd6230))throw new Error(_0x2f995c(0x133)+_0x2bc478['projectName']+'\x20already\x20exists');}let _0xa8818f=null;const _0x4c036b=_0xc5a032[_0x2f995c(0x12e)]?readDirectoryIdentity(_0xcd6230):null;let _0x556a05=null;try{a219_0x31a990[_0x2f995c(0x10a)](a219_0x5a7308['dirname'](_0xcd6230),a219_0x31a990[_0x2f995c(0x14e)][_0x2f995c(0x147)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x2f995c(0x141)](_0x2f995c(0x11a),_0x2f995c(0x12d)+_0x2bc478[_0x2f995c(0x13f)],{'projectDir':_0xcd6230,'appCode':_0x2bc478['appCode']}),console[_0x2f995c(0x103)](),console[_0x2f995c(0x103)](a219_0x530d03[_0x2f995c(0x151)](_0x2f995c(0x15b))+_0x2f995c(0x13c)+a219_0x530d03[_0x2f995c(0x151)](_0x2bc478[_0x2f995c(0x13f)])+(_0x2bc478[_0x2f995c(0x114)]?_0x2f995c(0x139)+a219_0x530d03[_0x2f995c(0x159)](_0x2bc478['appCode']):''));try{let _0x3357d0=_0x2bc478['projectName'];_0xc5a032['currentDir']&&(_0x556a05=a219_0x31a990['mkdtempSync'](a219_0x5a7308[_0x2f995c(0x128)](_0xcd6230,_0x2f995c(0x142))),_0x3357d0=a219_0x5a7308['relative'](process[_0x2f995c(0x115)](),a219_0x5a7308[_0x2f995c(0x128)](_0x556a05,_0x2f995c(0x116))));const _0x29e159=a219_0x5a7308['resolve'](process[_0x2f995c(0x115)](),_0x3357d0);await runTask(_0x2f995c(0x102),_0x24b7a4=>copyProjectTemplate(_0x3357d0,_0x584595=>_0x24b7a4(projectTemplateStageLabel(_0x584595)),_0xc5a032['templateSource']),'Project\x20template\x20ready'),_0xa8818f=_0xc5a032['currentDir']?null:readDirectoryIdentity(_0xcd6230);if(!_0xc5a032['currentDir']&&!_0xa8818f)throw new Error('Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory');await updatePackageJsonName(_0x3357d0,_0x2bc478['projectName']),await runTask(_0x2f995c(0x165),()=>installDependencies(_0x3357d0)),await runTask('Format\x20code',()=>formatProjectCode(_0x3357d0)),await configureAppCode(_0x3357d0,_0x2bc478['projectName'],_0x2bc478[_0x2f995c(0x114)]||'',_0x2bc478[_0x2f995c(0x135)]);let _0x486e62=![];if(_0x2bc478[_0x2f995c(0x114)]){console['log'](_0x2f995c(0x166));const _0x1fa672=process['cwd']();try{process[_0x2f995c(0x145)](_0x29e159);const _0x24434d=_0x2bc478['env']||_0x2f995c(0x10e);initEnv(_0x24434d);const {configArray:_0x5f5963}=await fetchModelList(_0x2bc478[_0x2f995c(0x114)],_0xc5a032['cookie']||''),_0x5b391d=DEFAULT_API_DIR,_0x198e75=await generateApiFile(_0x5f5963,'',_0x2bc478['appCode'],!![],_0x24434d,_0x5b391d,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![],'modelProfile':{'name':_0x2bc478[_0x2f995c(0x114)],'defaultName':_0x2bc478[_0x2f995c(0x114)],'runtimeDomain':getRuntimeDomain()}});console[_0x2f995c(0x103)]('√\x20Pulled\x20'+_0x5f5963[_0x2f995c(0x148)]+_0x2f995c(0x16d)+_0x198e75[_0x2f995c(0x15d)]+_0x2f995c(0x13e)),logger[_0x2f995c(0x141)]('create',_0x2f995c(0x11b)+_0x2bc478[_0x2f995c(0x114)]);}catch(_0x4e67a1){_0x486e62=!![],console[_0x2f995c(0x103)]('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20'+CLI_BIN_NAME+_0x2f995c(0x109)),logger[_0x2f995c(0x164)](_0x2f995c(0x11a),_0x2f995c(0x15c),{'error':_0x4e67a1 instanceof Error?_0x4e67a1[_0x2f995c(0x14f)]:String(_0x4e67a1)});}finally{process[_0x2f995c(0x145)](_0x1fa672);}}if(_0xc5a032[_0x2f995c(0x12e)]){if(!_0x556a05||!_0x4c036b)throw new Error(_0x2f995c(0x12a));commitCurrentDirectoryProject(_0xcd6230,_0x556a05,_0x4c036b),_0x556a05=null;}try{logger[_0x2f995c(0x14d)](_0xcd6230),logger['success'](_0x2f995c(0x11a),_0x2f995c(0x152)+_0x2bc478[_0x2f995c(0x13f)]);}catch(_0x1bac66){console[_0x2f995c(0x164)](_0x2f995c(0x15e)+(_0x1bac66 instanceof Error?_0x1bac66[_0x2f995c(0x14f)]:String(_0x1bac66)));}console[_0x2f995c(0x103)](),console[_0x2f995c(0x103)](a219_0x530d03['green']('─'[_0x2f995c(0x118)](0x3c))),console[_0x2f995c(0x103)](a219_0x530d03['cyan'][_0x2f995c(0x140)](_0x2f995c(0x170))),console[_0x2f995c(0x103)]();const _0x158b67=_0xc5a032[_0x2f995c(0x12e)]?CLI_BIN_NAME+_0x2f995c(0x131):_0x2f995c(0x112)+_0x2bc478['projectName']+_0x2f995c(0x129)+CLI_BIN_NAME+_0x2f995c(0x131);console[_0x2f995c(0x103)]('\x20\x201.\x20Start\x20project:\x20'+a219_0x530d03[_0x2f995c(0x159)][_0x2f995c(0x140)](_0x158b67)),_0x486e62&&console[_0x2f995c(0x103)](_0x2f995c(0x122)+a219_0x530d03[_0x2f995c(0x159)][_0x2f995c(0x140)](CLI_BIN_NAME+_0x2f995c(0x109))),console[_0x2f995c(0x103)](a219_0x530d03[_0x2f995c(0x151)]('─'[_0x2f995c(0x118)](0x3c)));}catch(_0x2364ca){logger['error']('create',_0x2f995c(0x14b)+_0x2bc478[_0x2f995c(0x13f)],{'error':_0x2364ca instanceof Error?_0x2364ca[_0x2f995c(0x14f)]:String(_0x2364ca)});try{const _0x36ed90=readDirectoryIdentity(_0xcd6230);if(_0xc5a032[_0x2f995c(0x12e)]&&_0x556a05)a219_0x31a990[_0x2f995c(0x15f)](_0x556a05,{'recursive':!![],'force':!![]});else{if(_0xa8818f&&_0x36ed90?.['dev']===_0xa8818f['dev']&&_0x36ed90[_0x2f995c(0x160)]===_0xa8818f[_0x2f995c(0x160)])console[_0x2f995c(0x103)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0xcd6230),a219_0x31a990[_0x2f995c(0x15f)](_0xcd6230,{'recursive':!![],'force':!![]});else _0x36ed90&&logger[_0x2f995c(0x164)]('create',_0x2f995c(0x134)+_0xcd6230);}}catch{logger['warn']('create',_0x2f995c(0x124)+_0xcd6230);}throw _0x2364ca;}}async function runTask(_0x3dc861,_0x1bef59,_0x2bbd4e=_0x3dc861){const _0x49c33a=a219_0x234d,_0x5b2d9a=a219_0x31ad9d(_0x3dc861+_0x49c33a(0x150))['start']();try{const _0x2e3c38=await _0x1bef59(_0x432124=>{const _0x52b359=_0x49c33a;_0x5b2d9a['text']=_0x432124+_0x52b359(0x150);});_0x5b2d9a[_0x49c33a(0x138)](),console[_0x49c33a(0x103)](''+a219_0x530d03[_0x49c33a(0x151)](_0x49c33a(0x15b))+_0x2bbd4e+'\x20'+a219_0x530d03[_0x49c33a(0x10c)]('['+_0x2e3c38+']'));}catch(_0x13b3b4){_0x5b2d9a[_0x49c33a(0x149)](_0x3dc861);throw _0x13b3b4;}}function projectTemplateStageLabel(_0x17fdd2){const _0x212a42=a219_0x234d;switch(_0x17fdd2){case _0x212a42(0x137):return _0x212a42(0x102);case _0x212a42(0x154):return _0x212a42(0x123);case'verifying':return _0x212a42(0x121);case _0x212a42(0x156):return _0x212a42(0x126);case _0x212a42(0x144):return'Copying\x20local\x20template\x20source';}}async function updatePackageJsonName(_0x384441,_0x4d358d){const _0x355be4=a219_0x234d,_0x281dc8=a219_0x5a7308[_0x355be4(0x143)](process['cwd'](),_0x384441),_0x52fb60=a219_0x5a7308[_0x355be4(0x128)](_0x281dc8,_0x355be4(0x161));try{console[_0x355be4(0x103)](_0x355be4(0x163));const _0x534f03=getRabetbaseCliPackageRoot(),_0x19530b=a219_0x5a7308['join'](_0x534f03,_0x355be4(0x161));let _0x62103d='1.0.0';try{const _0x5878e0=JSON[_0x355be4(0x10d)](a219_0x31a990[_0x355be4(0x157)](_0x19530b,_0x355be4(0x110)));_0x62103d=_0x5878e0[_0x355be4(0x10f)]||_0x355be4(0x11d);}catch{}const _0x3ee6cf=a219_0x31a990[_0x355be4(0x157)](_0x52fb60,_0x355be4(0x110)),_0x4b9125=JSON[_0x355be4(0x10d)](_0x3ee6cf);_0x4b9125[_0x355be4(0x15a)]=_0x4d358d,_0x4b9125['description']=_0x4d358d+_0x355be4(0x106)+_0x62103d,a219_0x31a990[_0x355be4(0x136)](_0x52fb60,JSON[_0x355be4(0x104)](_0x4b9125,null,0x2)+'\x0a',_0x355be4(0x110)),console[_0x355be4(0x103)](_0x355be4(0x158)+_0x4d358d),logger['info'](_0x355be4(0x11a),'Updating\x20package.json\x20name');}catch(_0x29a1ac){logger['error'](_0x355be4(0x11a),'Failed\x20to\x20update\x20package.json');throw _0x29a1ac;}}async function configureAppCode(_0x412e61,_0x197085,_0x303d4c,_0x1f7331){const _0x451e69=a219_0x234d,_0x49a5ea=a219_0x5a7308[_0x451e69(0x143)](process[_0x451e69(0x115)](),_0x412e61),_0x137e59=a219_0x5a7308[_0x451e69(0x128)](_0x49a5ea,NEW_CONFIG_NAME);try{_0x303d4c?console[_0x451e69(0x103)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x197085+':\x20'+_0x303d4c):console['log']('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x197085);const _0x36f7ed=getRabetbaseCliPackageRoot(),_0x3c5b50=a219_0x5a7308[_0x451e69(0x128)](_0x36f7ed,'package.json');let _0x883a8f='1.0.0';try{const _0x52a169=JSON['parse'](a219_0x31a990['readFileSync'](_0x3c5b50,_0x451e69(0x110)));_0x883a8f=_0x52a169[_0x451e69(0x10f)]||_0x451e69(0x11d);}catch{}const {globalConfig:_0x269f18}=loadRawConfigLayers(),_0x115180=typeof _0x269f18[_0x451e69(0x135)]===_0x451e69(0x167)?_0x269f18['env']:undefined,_0x151025={};for(const _0x422243 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x269f18[_0x422243]!=null)_0x151025[_0x422243]=_0x269f18[_0x422243];}const _0x3962a7=buildCanonicalProjectConfig(_0x151025,{'appCodes':_0x303d4c?[_0x303d4c]:[],'env':_0x1f7331||_0x115180||'production','metadata':{'createdAt':new Date()[_0x451e69(0x169)](),'version':_0x883a8f}});writeConfigFile(_0x137e59,_0x3962a7),await generateSdkConfigFile(a219_0x5a7308[_0x451e69(0x128)](_0x49a5ea,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x49a5ea),_0x303d4c?console[_0x451e69(0x103)](_0x451e69(0x168)+Object[_0x451e69(0x16e)](_0x3962a7[_0x451e69(0x12c)]||{})[_0x451e69(0x128)](',\x20')+_0x451e69(0x14c)):console[_0x451e69(0x103)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x451e69(0x107)),logger[_0x451e69(0x141)](_0x451e69(0x11a),_0x451e69(0x13b)+_0x303d4c);}catch(_0x545034){logger['error']('create','Failed\x20to\x20configure\x20app\x20AppCode');throw _0x545034;}}
|
|
1
|
+
(function(_0x152fc9,_0x3c7e9f){const _0x587a75=a219_0x4854,_0x15f654=_0x152fc9();while(!![]){try{const _0x4b5f66=parseInt(_0x587a75(0x13c))/0x1*(parseInt(_0x587a75(0x151))/0x2)+parseInt(_0x587a75(0x11e))/0x3+-parseInt(_0x587a75(0x147))/0x4+-parseInt(_0x587a75(0x10a))/0x5*(parseInt(_0x587a75(0x102))/0x6)+parseInt(_0x587a75(0x122))/0x7*(-parseInt(_0x587a75(0x142))/0x8)+-parseInt(_0x587a75(0xf2))/0x9*(parseInt(_0x587a75(0x118))/0xa)+parseInt(_0x587a75(0xea))/0xb;if(_0x4b5f66===_0x3c7e9f)break;else _0x15f654['push'](_0x15f654['shift']());}catch(_0x344393){_0x15f654['push'](_0x15f654['shift']());}}}(a219_0x2443,0xdb756));import a219_0x425393 from'path';import a219_0x1e47b1 from'fs';import a219_0x38debd from'chalk';import a219_0x55ae66 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{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{loadRawConfigLayers,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';function a219_0x4854(_0x335167,_0x23e662){_0x335167=_0x335167-0xe8;const _0x24438e=a219_0x2443();let _0x4854a0=_0x24438e[_0x335167];return _0x4854a0;}import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';import{validateProjectName}from'../../../commands/project/create/project-name.js';import{getRuntimeDomain,getSdkClientRoutingConfig}from'../../../constant/domain.js';import{generateSdkConfigFile}from'../../../api/generate-sdk-config-file.js';import{writeProjectDomainRoutingManifest}from'../../../config/project-domain-routing.js';function a219_0x2443(){const _0x235239=['create','*\x20Pulling\x20API\x20configuration...','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','currentVersion','start','Resolving\x20project\x20template','stableVersion','nonInteractive','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','belowMinimum','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','project','toLocaleString','currentDir','The\x20current\x20directory\x20must\x20be\x20empty.','13891328UNwIrX','needsUpgrade','cookie','gray','\x20api\x20pull\x20--force\x20--yes','cd\x20','renameSync','string','916983dxQbBE','production','dirname','√\x20package.json\x20updated:\x20name=','green','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','reverse','templateSource','readFileSync','description','dev','repeat','info','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','Failed\x20to\x20update\x20package.json','Project\x20directory\x20','16122JteYyk','length','Install\x20dependencies','Verifying\x20project\x20template','\x20\x201.\x20Start\x20project:\x20','Project\x20created:\x20','...','\x20√\x20','2330FWuigW','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','warn','ino','log','name','writeFileSync','relative','√\x20Configuration\x20file\x20created,\x20Apps:\x20','\x20&&\x20','validation','appCode','env','resolve','90fDkkup','extracting','projectCode','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','error','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','4283736LrrbZo','🚀\x20Next\x20Steps:','Project\x20name:\x20','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','301OAQAVv','W_OK','utf8','isDirectory','modelCount','stop','Updating\x20package.json\x20name','.rabetbase-create-','API\x20configuration\x20pulled:\x20','package.json','mkdtempSync','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','message','push','version','Starting\x20project\x20creation:\x20','constants','Format\x20code','basename','\x20|\x20AppCode:\x20','1.0.0','minimumVersion','lstatSync','projectName','cyan','resolving','1IMSMSE','bold','readdirSync','setLogPath','CLI\x20version\x20check','√\x20Pulled\x20','65104iBHRvC','chdir','\x20model(s)','parse','keys','1031452KbPdmh','rmSync','accessSync','\x20dataset(s),\x20generated\x20','Configured\x20app\x20AppCode:\x20','\x20|\x20Default:\x20implicit\x20(single\x20app)','downloading','join','API\x20configuration\x20pull\x20failed','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','1970128dcCLxy','cwd','verifying'];a219_0x2443=function(){return _0x235239;};return a219_0x2443();}import{CliErrors}from'../../../errors.js';function readDirectoryIdentity(_0x4636b0){const _0x404c46=a219_0x4854;try{const _0x294f77=a219_0x1e47b1[_0x404c46(0x138)](_0x4636b0);if(!_0x294f77[_0x404c46(0x125)]())return null;return{'dev':_0x294f77[_0x404c46(0xfc)],'ino':_0x294f77[_0x404c46(0x10d)]};}catch{return null;}}function isSameDirectory(_0x41eb9e,_0x2fe28f){const _0x2552b3=a219_0x4854;return!!_0x41eb9e&&!!_0x2fe28f&&_0x41eb9e['dev']===_0x2fe28f[_0x2552b3(0xfc)]&&_0x41eb9e['ino']===_0x2fe28f[_0x2552b3(0x10d)];}function commitCurrentDirectoryProject(_0x2191dc,_0xd21019,_0xbdeda4){const _0x4c5435=a219_0x4854;if(!isSameDirectory(readDirectoryIdentity(_0x2191dc),_0xbdeda4))throw new Error('Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation');const _0x54711b=a219_0x425393[_0x4c5435(0x134)](_0xd21019),_0x52ab9f=a219_0x1e47b1['readdirSync'](_0x2191dc);if(_0x52ab9f[_0x4c5435(0x103)]!==0x1||_0x52ab9f[0x0]!==_0x54711b)throw CliErrors[_0x4c5435(0x114)]('The\x20current\x20directory\x20changed\x20during\x20project\x20creation.',_0x4c5435(0x156));const _0x43ad64=a219_0x425393['join'](_0xd21019,_0x4c5435(0x15f)),_0x18ffd4=[];try{for(const _0x126433 of a219_0x1e47b1[_0x4c5435(0x13e)](_0x43ad64)){a219_0x1e47b1[_0x4c5435(0xf0)](a219_0x425393[_0x4c5435(0x14e)](_0x43ad64,_0x126433),a219_0x425393[_0x4c5435(0x14e)](_0x2191dc,_0x126433)),_0x18ffd4[_0x4c5435(0x12f)](_0x126433);}a219_0x1e47b1[_0x4c5435(0x148)](_0xd21019,{'recursive':!![],'force':!![]});}catch(_0x32c9a4){for(const _0x2751c8 of _0x18ffd4[_0x4c5435(0xf8)]()){const _0xc8fe3c=a219_0x425393[_0x4c5435(0x14e)](_0x2191dc,_0x2751c8);if(!a219_0x1e47b1['existsSync'](_0xc8fe3c))continue;a219_0x1e47b1[_0x4c5435(0xf0)](_0xc8fe3c,a219_0x425393[_0x4c5435(0x14e)](_0x43ad64,_0x2751c8));}throw _0x32c9a4;}}export async function createApp(_0x11b09a){const _0x149381=a219_0x4854,_0x10bbe6=await checkCliVersion();(_0x10bbe6[_0x149381(0xeb)]||_0x10bbe6[_0x149381(0x15d)])&&(printCliUpgradeWarning(_0x10bbe6),assertCliVersionSupported(_0x10bbe6),logger['info']('create',_0x149381(0x140),{'currentVersion':_0x10bbe6[_0x149381(0x157)],'stableVersion':_0x10bbe6[_0x149381(0x15a)],'minimumVersion':_0x10bbe6[_0x149381(0x137)],'needsUpgrade':_0x10bbe6['needsUpgrade'],'belowMinimum':_0x10bbe6[_0x149381(0x15d)]}));const _0x39d575=_0x11b09a['currentDir']?a219_0x425393[_0x149381(0x134)](process['cwd']()):_0x11b09a[_0x149381(0x11a)];if(_0x39d575&&(_0x11b09a[_0x149381(0x115)]||_0x11b09a[_0x149381(0x15b)]))await runCreate({'projectName':_0x39d575,'appCode':_0x11b09a[_0x149381(0x115)],'env':_0x11b09a['env']},_0x11b09a);else{if(_0x39d575){const _0x46acb9=await selectSingleAppcode(_0x11b09a['cookie']);await runCreate({'projectName':_0x39d575,'appCode':_0x46acb9||undefined,'env':_0x11b09a[_0x149381(0x116)]},_0x11b09a);}else await guidedCreateProject(_0x4650c9=>runCreate(_0x4650c9,_0x11b09a),_0x11b09a[_0x149381(0x116)],_0x11b09a[_0x149381(0xec)]);}}async function runCreate(_0x4a9e87,_0x1128af){const _0x5eab7f=a219_0x4854;_0x4a9e87[_0x5eab7f(0x139)]=validateProjectName(_0x4a9e87[_0x5eab7f(0x139)]);const _0x265c1c=_0x1128af[_0x5eab7f(0xe8)]?process[_0x5eab7f(0x152)]():a219_0x425393['resolve'](process['cwd'](),_0x4a9e87['projectName']);if(_0x1128af[_0x5eab7f(0xe8)]){if(a219_0x1e47b1[_0x5eab7f(0x13e)](_0x265c1c)['length']>0x0)throw CliErrors[_0x5eab7f(0x114)](_0x5eab7f(0xe9),'Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.');}else{if(a219_0x1e47b1['existsSync'](_0x265c1c))throw new Error(_0x5eab7f(0x101)+_0x4a9e87[_0x5eab7f(0x139)]+'\x20already\x20exists');}let _0x2b3af7=null;const _0x93b3d3=_0x1128af[_0x5eab7f(0xe8)]?readDirectoryIdentity(_0x265c1c):null;let _0x139cd8=null;try{a219_0x1e47b1[_0x5eab7f(0x149)](a219_0x425393[_0x5eab7f(0xf4)](_0x265c1c),a219_0x1e47b1[_0x5eab7f(0x132)][_0x5eab7f(0x123)]);}catch{throw new Error(_0x5eab7f(0x15e));}logger[_0x5eab7f(0xfe)](_0x5eab7f(0x154),_0x5eab7f(0x131)+_0x4a9e87[_0x5eab7f(0x139)],{'projectDir':_0x265c1c,'appCode':_0x4a9e87[_0x5eab7f(0x115)]}),console[_0x5eab7f(0x10e)](),console[_0x5eab7f(0x10e)](a219_0x38debd['green'](_0x5eab7f(0x109))+_0x5eab7f(0x120)+a219_0x38debd['green'](_0x4a9e87['projectName'])+(_0x4a9e87['appCode']?_0x5eab7f(0x135)+a219_0x38debd[_0x5eab7f(0x13a)](_0x4a9e87[_0x5eab7f(0x115)]):''));try{let _0x1b25de=_0x4a9e87[_0x5eab7f(0x139)];_0x1128af[_0x5eab7f(0xe8)]&&(_0x139cd8=a219_0x1e47b1[_0x5eab7f(0x12c)](a219_0x425393['join'](_0x265c1c,_0x5eab7f(0x129))),_0x1b25de=a219_0x425393[_0x5eab7f(0x111)](process[_0x5eab7f(0x152)](),a219_0x425393[_0x5eab7f(0x14e)](_0x139cd8,_0x5eab7f(0x15f))));const _0x3ea345=a219_0x425393[_0x5eab7f(0x117)](process['cwd'](),_0x1b25de);await runTask(_0x5eab7f(0x159),_0x3263d7=>copyProjectTemplate(_0x1b25de,_0x53f923=>_0x3263d7(projectTemplateStageLabel(_0x53f923)),_0x1128af[_0x5eab7f(0xf9)]),'Project\x20template\x20ready'),_0x2b3af7=_0x1128af[_0x5eab7f(0xe8)]?null:readDirectoryIdentity(_0x265c1c);if(!_0x1128af[_0x5eab7f(0xe8)]&&!_0x2b3af7)throw new Error(_0x5eab7f(0x12d));await updatePackageJsonName(_0x1b25de,_0x4a9e87[_0x5eab7f(0x139)]),await runTask(_0x5eab7f(0x104),()=>installDependencies(_0x1b25de)),await runTask(_0x5eab7f(0x133),()=>formatProjectCode(_0x1b25de)),await configureAppCode(_0x1b25de,_0x4a9e87[_0x5eab7f(0x139)],_0x4a9e87[_0x5eab7f(0x115)]||'',_0x4a9e87[_0x5eab7f(0x116)]);let _0x569280=![];if(_0x4a9e87[_0x5eab7f(0x115)]){console[_0x5eab7f(0x10e)](_0x5eab7f(0x155));const _0x7d46a3=process[_0x5eab7f(0x152)]();try{process[_0x5eab7f(0x143)](_0x3ea345);const _0x46c38b=_0x4a9e87[_0x5eab7f(0x116)]||_0x5eab7f(0xf3);initEnv(_0x46c38b);const {configArray:_0x330638}=await fetchModelList(_0x4a9e87[_0x5eab7f(0x115)],_0x1128af[_0x5eab7f(0xec)]||''),_0x3f8cdb=DEFAULT_API_DIR,_0x2e1986=await generateApiFile(_0x330638,'',_0x4a9e87[_0x5eab7f(0x115)],!![],_0x46c38b,_0x3f8cdb,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![],'modelProfile':{'name':_0x4a9e87[_0x5eab7f(0x115)],'defaultName':_0x4a9e87['appCode'],'runtimeDomain':getRuntimeDomain()}});console[_0x5eab7f(0x10e)](_0x5eab7f(0x141)+_0x330638[_0x5eab7f(0x103)]+_0x5eab7f(0x14a)+_0x2e1986[_0x5eab7f(0x126)]+_0x5eab7f(0x144)),logger[_0x5eab7f(0xfe)](_0x5eab7f(0x154),_0x5eab7f(0x12a)+_0x4a9e87[_0x5eab7f(0x115)]);}catch(_0x793d7c){_0x569280=!![],console['log'](_0x5eab7f(0xff)+CLI_BIN_NAME+'\x20api\x20pull\x20--force\x20--yes'),logger['warn']('create',_0x5eab7f(0x14f),{'error':_0x793d7c instanceof Error?_0x793d7c['message']:String(_0x793d7c)});}finally{process['chdir'](_0x7d46a3);}}if(_0x1128af[_0x5eab7f(0xe8)]){if(!_0x139cd8||!_0x93b3d3)throw new Error(_0x5eab7f(0x11b));commitCurrentDirectoryProject(_0x265c1c,_0x139cd8,_0x93b3d3),_0x139cd8=null;}try{logger[_0x5eab7f(0x13f)](_0x265c1c),logger['success'](_0x5eab7f(0x154),_0x5eab7f(0x107)+_0x4a9e87[_0x5eab7f(0x139)]);}catch(_0x34fcde){console['warn']('!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20'+(_0x34fcde instanceof Error?_0x34fcde[_0x5eab7f(0x12e)]:String(_0x34fcde)));}console[_0x5eab7f(0x10e)](),console['log'](a219_0x38debd[_0x5eab7f(0xf6)]('─'['repeat'](0x3c))),console[_0x5eab7f(0x10e)](a219_0x38debd[_0x5eab7f(0x13a)][_0x5eab7f(0x13d)](_0x5eab7f(0x11f))),console[_0x5eab7f(0x10e)]();const _0x1b60d9=_0x1128af[_0x5eab7f(0xe8)]?CLI_BIN_NAME+'\x20run\x20start':_0x5eab7f(0xef)+_0x4a9e87[_0x5eab7f(0x139)]+_0x5eab7f(0x113)+CLI_BIN_NAME+'\x20run\x20start';console['log'](_0x5eab7f(0x106)+a219_0x38debd[_0x5eab7f(0x13a)][_0x5eab7f(0x13d)](_0x1b60d9)),_0x569280&&console['log']('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a219_0x38debd[_0x5eab7f(0x13a)]['bold'](CLI_BIN_NAME+_0x5eab7f(0xee))),console[_0x5eab7f(0x10e)](a219_0x38debd[_0x5eab7f(0xf6)]('─'[_0x5eab7f(0xfd)](0x3c)));}catch(_0x1060e0){logger[_0x5eab7f(0x11c)]('create','Project\x20creation\x20failed:\x20'+_0x4a9e87[_0x5eab7f(0x139)],{'error':_0x1060e0 instanceof Error?_0x1060e0[_0x5eab7f(0x12e)]:String(_0x1060e0)});try{const _0x2d9971=readDirectoryIdentity(_0x265c1c);if(_0x1128af[_0x5eab7f(0xe8)]&&_0x139cd8)a219_0x1e47b1['rmSync'](_0x139cd8,{'recursive':!![],'force':!![]});else{if(_0x2b3af7&&_0x2d9971?.[_0x5eab7f(0xfc)]===_0x2b3af7[_0x5eab7f(0xfc)]&&_0x2d9971[_0x5eab7f(0x10d)]===_0x2b3af7['ino'])console[_0x5eab7f(0x10e)](_0x5eab7f(0x121)+_0x265c1c),a219_0x1e47b1['rmSync'](_0x265c1c,{'recursive':!![],'force':!![]});else _0x2d9971&&logger[_0x5eab7f(0x10c)]('create',_0x5eab7f(0x11d)+_0x265c1c);}}catch{logger['warn']('create',_0x5eab7f(0x150)+_0x265c1c);}throw _0x1060e0;}}async function runTask(_0x32026d,_0x43663b,_0x1b63ed=_0x32026d){const _0x8ed2c8=a219_0x4854,_0x412892=a219_0x55ae66(_0x32026d+_0x8ed2c8(0x108))[_0x8ed2c8(0x158)]();try{const _0x3713dd=await _0x43663b(_0x15671a=>{const _0x50c54c=_0x8ed2c8;_0x412892['text']=_0x15671a+_0x50c54c(0x108);});_0x412892[_0x8ed2c8(0x127)](),console['log'](''+a219_0x38debd[_0x8ed2c8(0xf6)](_0x8ed2c8(0x109))+_0x1b63ed+'\x20'+a219_0x38debd[_0x8ed2c8(0xed)]('['+_0x3713dd+']'));}catch(_0x4b8b01){_0x412892['fail'](_0x32026d);throw _0x4b8b01;}}function projectTemplateStageLabel(_0x371dfd){const _0x3bcdc4=a219_0x4854;switch(_0x371dfd){case _0x3bcdc4(0x13b):return _0x3bcdc4(0x159);case _0x3bcdc4(0x14d):return'Downloading\x20project\x20template';case _0x3bcdc4(0x153):return _0x3bcdc4(0x105);case _0x3bcdc4(0x119):return'Extracting\x20project\x20template';case'copying':return'Copying\x20local\x20template\x20source';}}async function updatePackageJsonName(_0x83855f,_0x32d3b6){const _0x5ea0bd=a219_0x4854,_0x4f8ab4=a219_0x425393[_0x5ea0bd(0x117)](process[_0x5ea0bd(0x152)](),_0x83855f),_0x17cb96=a219_0x425393[_0x5ea0bd(0x14e)](_0x4f8ab4,_0x5ea0bd(0x12b));try{console[_0x5ea0bd(0x10e)](_0x5ea0bd(0xf7));const _0x4e97f9=getRabetbaseCliPackageRoot(),_0x3896f6=a219_0x425393[_0x5ea0bd(0x14e)](_0x4e97f9,_0x5ea0bd(0x12b));let _0xf1e2f0=_0x5ea0bd(0x136);try{const _0x189fc9=JSON[_0x5ea0bd(0x145)](a219_0x1e47b1[_0x5ea0bd(0xfa)](_0x3896f6,_0x5ea0bd(0x124)));_0xf1e2f0=_0x189fc9[_0x5ea0bd(0x130)]||_0x5ea0bd(0x136);}catch{}const _0x290994=a219_0x1e47b1[_0x5ea0bd(0xfa)](_0x17cb96,_0x5ea0bd(0x124)),_0x39d6e4=JSON[_0x5ea0bd(0x145)](_0x290994);_0x39d6e4[_0x5ea0bd(0x10f)]=_0x32d3b6,_0x39d6e4[_0x5ea0bd(0xfb)]=_0x32d3b6+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0xf1e2f0,a219_0x1e47b1[_0x5ea0bd(0x110)](_0x17cb96,JSON['stringify'](_0x39d6e4,null,0x2)+'\x0a',_0x5ea0bd(0x124)),console['log'](_0x5ea0bd(0xf5)+_0x32d3b6),logger[_0x5ea0bd(0xfe)]('create',_0x5ea0bd(0x128));}catch(_0x50a4b1){logger[_0x5ea0bd(0x11c)]('create',_0x5ea0bd(0x100));throw _0x50a4b1;}}async function configureAppCode(_0x4ef3a6,_0x31bf42,_0x34910,_0x4d5bc9){const _0x2c2002=a219_0x4854,_0x4b6533=a219_0x425393[_0x2c2002(0x117)](process['cwd'](),_0x4ef3a6),_0x240741=a219_0x425393['join'](_0x4b6533,NEW_CONFIG_NAME);try{_0x34910?console[_0x2c2002(0x10e)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x31bf42+':\x20'+_0x34910):console[_0x2c2002(0x10e)](_0x2c2002(0x10b)+_0x31bf42);const _0x268433=getRabetbaseCliPackageRoot(),_0x3ec8f1=a219_0x425393['join'](_0x268433,_0x2c2002(0x12b));let _0x1bbe28='1.0.0';try{const _0x4ea2b8=JSON[_0x2c2002(0x145)](a219_0x1e47b1[_0x2c2002(0xfa)](_0x3ec8f1,_0x2c2002(0x124)));_0x1bbe28=_0x4ea2b8[_0x2c2002(0x130)]||_0x2c2002(0x136);}catch{}const {globalConfig:_0x32b84c}=loadRawConfigLayers(),_0xb7131d=typeof _0x32b84c[_0x2c2002(0x116)]===_0x2c2002(0xf1)?_0x32b84c['env']:undefined,_0xe91da5={};for(const _0xec6176 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x32b84c[_0xec6176]!=null)_0xe91da5[_0xec6176]=_0x32b84c[_0xec6176];}const _0x6f8808=buildCanonicalProjectConfig(_0xe91da5,{'appCodes':_0x34910?[_0x34910]:[],'env':_0x4d5bc9||_0xb7131d||_0x2c2002(0xf3),'metadata':{'createdAt':new Date()[_0x2c2002(0x160)](),'version':_0x1bbe28}});writeConfigFile(_0x240741,_0x6f8808),await generateSdkConfigFile(a219_0x425393[_0x2c2002(0x14e)](_0x4b6533,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x4b6533),_0x34910?console[_0x2c2002(0x10e)](_0x2c2002(0x112)+Object[_0x2c2002(0x146)](_0x6f8808['apps']||{})['join'](',\x20')+_0x2c2002(0x14c)):console['log'](_0x2c2002(0x15c)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x2c2002(0xfe)](_0x2c2002(0x154),_0x2c2002(0x14b)+_0x34910);}catch(_0x45caa8){logger[_0x2c2002(0x11c)](_0x2c2002(0x154),'Failed\x20to\x20configure\x20app\x20AppCode');throw _0x45caa8;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a220_0x278feb=a220_0x1825;(function(_0x519263,_0x3b0805){const _0x3862d4=a220_0x1825,_0x6ff47e=_0x519263();while(!![]){try{const _0x20d7fd=parseInt(_0x3862d4(0x180))/0x1*(parseInt(_0x3862d4(0x1b1))/0x2)+parseInt(_0x3862d4(0x178))/0x3+-parseInt(_0x3862d4(0x1ac))/0x4+parseInt(_0x3862d4(0x164))/0x5*(parseInt(_0x3862d4(0x1b4))/0x6)+parseInt(_0x3862d4(0x166))/0x7+parseInt(_0x3862d4(0x175))/0x8+-parseInt(_0x3862d4(0x172))/0x9;if(_0x20d7fd===_0x3b0805)break;else _0x6ff47e['push'](_0x6ff47e['shift']());}catch(_0xf1c6ad){_0x6ff47e['push'](_0x6ff47e['shift']());}}}(a220_0xa0c9,0x9b6d0));import{createHash}from'node:crypto';function a220_0xa0c9(){const _0x581199=['isSymbolicLink','sep','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','join','digest','relative','sub-app-react-demo','.lovrabet.log','.env.','isFile','12303900wZhWFV','.codegraph','get','2558784SJTuLk','status','dev','1493346OsdoJM','CDN\x20project\x20template\x20relative\x20URL\x20must\x20match\x20its\x20release\x20channel\x20or\x20version.','.env.example','extracting','dirname','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','toLowerCase','mkdir','202FjtzEu','mkdtemp','Invalid\x20local\x20template\x20source:\x20','template.zip','number','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','package.json','sha256','object','utf8','arrayBuffer','getReader','project','readFile','beta','validation','writeFile','isDirectory','from','downloading','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','size','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','Check\x20the\x20source\x20directory\x20and\x20retry.','.idea','realpath','rename','ino','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','local','.lovrabet.json','url','application/zip','access','isFinite','name','EEXIST','pathname','parse','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','readdir','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','startsWith','2500288jVIHJm','legacyAssetBaseUrl','version','string','.env','10814mBJPBk','includes','config','810522fVOYQW','error','trim','length','lstat','.rabetbase','content-length','body','basename','verifying','chmod','byteLength','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','posix','sha256:','node_modules','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.',',\x20received\x20','protocol','Project\x20template\x20package.json\x20is\x20invalid.','has','origin','isSafeInteger','release','.rabetbase-create-','signal','resolve','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','Project\x20directory\x20already\x20exists:\x20','ENOENT','code','copyFile','mode','20nXRdTY','.rabetbase.json','1250228JsevUP','message'];a220_0xa0c9=function(){return _0x581199;};return a220_0xa0c9();}import a220_0xa65d96 from'node:fs/promises';import a220_0x3b86a6 from'node:path';import a220_0x2157d7 from'semver';import{getProjectTemplateRelativeUrl}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{fetchProjectTemplateCdnConfig,isBetaCliVersion,resolveProjectTemplateDescriptor}from'../../../utils/cli-version-policy.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID=a220_0x278feb(0x16e),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0xf92d88){const _0x97ef2a=a220_0x278feb;return typeof _0xf92d88===_0x97ef2a(0x1af)&&_0xf92d88[_0x97ef2a(0x1b6)]()?_0xf92d88[_0x97ef2a(0x1b6)]():null;}function parseDescriptor(_0x3dd9d8){const _0x22bacc=a220_0x278feb;if(!_0x3dd9d8||typeof _0x3dd9d8!==_0x22bacc(0x188))throw new Error(_0x22bacc(0x194)+TEMPLATE_ID+'\x22.');const _0x492188=_0x3dd9d8,_0x49b13c=nonEmptyString(_0x492188[_0x22bacc(0x1ae)]),_0x3f2fc5=nonEmptyString(_0x492188[_0x22bacc(0x1a4)]),_0x4b1160=_0x492188['url']===undefined?undefined:nonEmptyString(_0x492188['url'])||undefined,_0x4ab539=nonEmptyString(_0x492188[_0x22bacc(0x187)])?.[_0x22bacc(0x17e)](),_0x33edc4=_0x492188[_0x22bacc(0x195)];if(!_0x49b13c||!a220_0x2157d7['valid'](_0x49b13c)||!_0x3f2fc5||_0x3f2fc5!==a220_0x3b86a6[_0x22bacc(0x1c1)][_0x22bacc(0x1bc)](_0x3f2fc5)||_0x3f2fc5['includes']('\x5c')||_0x492188[_0x22bacc(0x1a0)]!==undefined&&!_0x4b1160||!_0x4ab539||!/^sha256:[a-f0-9]{64}$/['test'](_0x4ab539)||typeof _0x33edc4!==_0x22bacc(0x184)||!Number[_0x22bacc(0x1ca)](_0x33edc4)||_0x33edc4<=0x0||_0x33edc4>MAX_ARCHIVE_SIZE)throw new Error('CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22'+TEMPLATE_ID+'\x22.');return{'version':_0x49b13c,'name':_0x3f2fc5,'url':_0x4b1160,'sha256':_0x4ab539,'size':_0x33edc4};}async function fetchWithTimeout(_0x35652f,_0x19d261,_0xe871a0,_0x241bff){const _0x2eabd1=a220_0x278feb,_0x9048dd=new AbortController(),_0xf7877d=setTimeout(()=>_0x9048dd['abort'](),_0x19d261);try{const _0x32e5f8=await fetch(_0x35652f,{'headers':{'Accept':_0xe871a0},'redirect':_0x2eabd1(0x1b5),'signal':_0x9048dd[_0x2eabd1(0x1cd)]});return await _0x241bff(_0x32e5f8);}finally{clearTimeout(_0xf7877d);}}async function fetchTemplateDescriptor(){const _0x509d15=a220_0x278feb,_0x12b60e=getCliVersion(),_0x4e484d=isBetaCliVersion(_0x12b60e)?_0x509d15(0x18e):_0x509d15(0x1cb),_0x3f2808=await fetchProjectTemplateCdnConfig();if(!_0x3f2808)throw new Error(_0x509d15(0x1a8));const _0x590cba=parseDescriptor(resolveProjectTemplateDescriptor(_0x3f2808[_0x509d15(0x1b3)],_0x12b60e));return{'descriptor':_0x590cba,'channel':_0x4e484d,'assetBaseUrl':_0x3f2808['assetBaseUrl'],'legacyAssetBaseUrl':_0x3f2808[_0x509d15(0x1ad)]};}function resolveArchiveUrl(_0x5c1bd6,_0x21ea34,_0x10c456,_0x189cef){const _0x40b795=a220_0x278feb,_0x731516=new URL(_0x10c456+'/'),_0xb288f8=[getProjectTemplateRelativeUrl(_0x21ea34),getProjectTemplateRelativeUrl(_0x21ea34,_0x5c1bd6[_0x40b795(0x1ae)])];if(_0x5c1bd6[_0x40b795(0x1a0)]&&!_0xb288f8[_0x40b795(0x1b2)](_0x5c1bd6[_0x40b795(0x1a0)]))throw new Error(_0x40b795(0x179));const _0x3c7dbc=new URL(_0x189cef+'/'),_0x32143a=_0x5c1bd6[_0x40b795(0x1a0)]?new URL(_0x5c1bd6[_0x40b795(0x1a0)],_0x731516[_0x40b795(0x1c9)]):new URL(_0x5c1bd6[_0x40b795(0x1a4)],_0x3c7dbc),_0x5663b2=_0x5c1bd6[_0x40b795(0x1a0)]?_0x731516[_0x40b795(0x1c9)]:_0x3c7dbc['origin'];if(_0x32143a[_0x40b795(0x1c6)]!=='https:'||_0x32143a['origin']!==_0x5663b2||a220_0x3b86a6['posix'][_0x40b795(0x1bc)](decodeURIComponent(_0x32143a['pathname']))!==_0x5c1bd6[_0x40b795(0x1a4)]||!_0x5c1bd6[_0x40b795(0x1a0)]&&!_0x32143a['pathname']['startsWith'](_0x3c7dbc[_0x40b795(0x1a6)]))throw new Error(_0x40b795(0x1cf));return _0x32143a['href'];}function a220_0x1825(_0x2384d8,_0x1f49ba){_0x2384d8=_0x2384d8-0x161;const _0xa0c917=a220_0xa0c9();let _0x18255e=_0xa0c917[_0x2384d8];return _0x18255e;}async function readResponseBytes(_0x34e40e,_0x381181){const _0x4abae7=a220_0x278feb;if(!_0x34e40e['body']){const _0x10ec79=Buffer[_0x4abae7(0x192)](await _0x34e40e[_0x4abae7(0x18a)]());if(_0x10ec79[_0x4abae7(0x1b7)]>_0x381181)throw new Error(_0x4abae7(0x17d));return _0x10ec79;}const _0x3a8528=_0x34e40e[_0x4abae7(0x1bb)][_0x4abae7(0x18b)](),_0x592c88=[];let _0x114df5=0x0;try{while(!![]){const {done:_0x358a8d,value:_0x585749}=await _0x3a8528['read']();if(_0x358a8d)break;_0x114df5+=_0x585749[_0x4abae7(0x1bf)];if(_0x114df5>_0x381181){await _0x3a8528['cancel']();throw new Error(_0x4abae7(0x17d));}_0x592c88['push'](Buffer[_0x4abae7(0x192)](_0x585749));}}finally{_0x3a8528['releaseLock']();}return Buffer['concat'](_0x592c88,_0x114df5);}async function downloadArchive(_0x368b32,_0x28af5b,_0x416aac,_0x56dd80,_0x48f2e2,_0x335893){const _0x376470=a220_0x278feb,_0xa27c12=await fetchWithTimeout(resolveArchiveUrl(_0x368b32,_0x28af5b,_0x416aac,_0x56dd80),ARCHIVE_TIMEOUT_MS,_0x376470(0x1a1),async _0x4d3a53=>{const _0x42f722=_0x376470;if(!_0x4d3a53['ok'])throw new Error(_0x42f722(0x185)+_0x4d3a53[_0x42f722(0x176)]+'.');const _0x6a98ca=Number(_0x4d3a53['headers'][_0x42f722(0x174)](_0x42f722(0x1ba)));if(Number[_0x42f722(0x1a3)](_0x6a98ca)&&_0x6a98ca>MAX_ARCHIVE_SIZE)throw new Error(_0x42f722(0x1c0));return readResponseBytes(_0x4d3a53,_0x368b32[_0x42f722(0x195)]);});if(_0xa27c12[_0x376470(0x1b7)]!==_0x368b32['size'])throw new Error('CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20'+_0x368b32[_0x376470(0x195)]+_0x376470(0x1c5)+_0xa27c12[_0x376470(0x1b7)]+'.');_0x335893?.(_0x376470(0x1bd));const _0x2a7591=_0x376470(0x1c2)+createHash(_0x376470(0x187))['update'](_0xa27c12)[_0x376470(0x16c)]('hex');if(_0x2a7591!==_0x368b32[_0x376470(0x187)])throw new Error(_0x376470(0x197));await a220_0xa65d96[_0x376470(0x190)](_0x48f2e2,_0xa27c12,{'flag':'wx'});}async function assertTemplateRoot(_0x2d9530){const _0x59a4e3=a220_0x278feb,_0x384625=a220_0x3b86a6[_0x59a4e3(0x16b)](_0x2d9530,'package.json'),_0x286c66=JSON[_0x59a4e3(0x1a7)](await a220_0xa65d96[_0x59a4e3(0x18d)](_0x384625,_0x59a4e3(0x189)));if(!_0x286c66||typeof _0x286c66!=='object')throw new Error(_0x59a4e3(0x1c7));}const LOCAL_FORBIDDEN_NAMES=new Set(['.DS_Store',a220_0x278feb(0x173),'.git',a220_0x278feb(0x199),a220_0x278feb(0x19f),a220_0x278feb(0x16f),a220_0x278feb(0x1b9),a220_0x278feb(0x165),'dist',a220_0x278feb(0x1c3)]);function isForbiddenTemplateEntry(_0x3654af){const _0xbec261=a220_0x278feb;if(LOCAL_FORBIDDEN_NAMES[_0xbec261(0x1c8)](_0x3654af))return!![];return _0x3654af===_0xbec261(0x1b0)||_0x3654af[_0xbec261(0x1ab)](_0xbec261(0x170))&&_0x3654af!==_0xbec261(0x17a);}function containsPath(_0x4a0ebb,_0x508f61){const _0x5e8807=a220_0x278feb,_0x39ab4c=a220_0x3b86a6[_0x5e8807(0x16d)](_0x4a0ebb,_0x508f61);return _0x39ab4c===''||!_0x39ab4c[_0x5e8807(0x1ab)]('..'+a220_0x3b86a6[_0x5e8807(0x169)])&&_0x39ab4c!=='..'&&!a220_0x3b86a6['isAbsolute'](_0x39ab4c);}async function copyLocalTemplateDirectory(_0x52f9f7,_0x5475c8){const _0x42234d=a220_0x278feb;await a220_0xa65d96['mkdir'](_0x5475c8,{'recursive':!![]});for(const _0x2d6a92 of await a220_0xa65d96[_0x42234d(0x1a9)](_0x52f9f7,{'withFileTypes':!![]})){const _0x3d171f=a220_0x3b86a6[_0x42234d(0x16b)](_0x52f9f7,_0x2d6a92[_0x42234d(0x1a4)]),_0x1c7e18=a220_0x3b86a6[_0x42234d(0x16b)](_0x5475c8,_0x2d6a92[_0x42234d(0x1a4)]);if(isForbiddenTemplateEntry(_0x2d6a92[_0x42234d(0x1a4)]))throw new Error('Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20'+_0x3d171f);const _0x538461=await a220_0xa65d96[_0x42234d(0x1b8)](_0x3d171f);if(_0x538461[_0x42234d(0x168)]())throw new Error(_0x42234d(0x16a)+_0x3d171f);if(_0x538461[_0x42234d(0x191)]()){await copyLocalTemplateDirectory(_0x3d171f,_0x1c7e18);continue;}if(!_0x538461[_0x42234d(0x171)]())continue;await a220_0xa65d96[_0x42234d(0x162)](_0x3d171f,_0x1c7e18),await a220_0xa65d96[_0x42234d(0x1be)](_0x1c7e18,_0x538461[_0x42234d(0x163)]&0x1ff);}}async function readTemplateVersion(_0xc6b2fe){const _0x1b4494=a220_0x278feb,_0xe9a71c=JSON[_0x1b4494(0x1a7)](await a220_0xa65d96[_0x1b4494(0x18d)](a220_0x3b86a6[_0x1b4494(0x16b)](_0xc6b2fe,_0x1b4494(0x186)),'utf8'));return nonEmptyString(_0xe9a71c[_0x1b4494(0x1ae)])||_0x1b4494(0x19e);}async function readDirectoryIdentity(_0x296325){const _0x303e31=a220_0x278feb;try{const _0x394f96=await a220_0xa65d96[_0x303e31(0x1b8)](_0x296325);if(!_0x394f96['isDirectory']())return null;return{'dev':_0x394f96[_0x303e31(0x177)],'ino':_0x394f96[_0x303e31(0x19c)]};}catch{return null;}}async function commitStagedProject(_0xaa921b,_0x16e66a){const _0x2bae8e=a220_0x278feb;await a220_0xa65d96[_0x2bae8e(0x17f)](_0x16e66a);const _0x310e3d=await readDirectoryIdentity(_0x16e66a);if(!_0x310e3d)throw new Error('Unable\x20to\x20claim\x20the\x20project\x20directory.');try{for(const _0x5d9646 of await a220_0xa65d96['readdir'](_0xaa921b)){await a220_0xa65d96[_0x2bae8e(0x19b)](a220_0x3b86a6[_0x2bae8e(0x16b)](_0xaa921b,_0x5d9646),a220_0x3b86a6[_0x2bae8e(0x16b)](_0x16e66a,_0x5d9646));}}catch(_0x40355a){const _0x2318ab=await readDirectoryIdentity(_0x16e66a);_0x2318ab?.[_0x2bae8e(0x177)]===_0x310e3d[_0x2bae8e(0x177)]&&_0x2318ab[_0x2bae8e(0x19c)]===_0x310e3d[_0x2bae8e(0x19c)]&&await a220_0xa65d96['rm'](_0x16e66a,{'recursive':!![],'force':!![]});throw _0x40355a;}}export async function materializeProjectTemplate(_0x2e6b07,_0x1e0b19){const _0x21ec31=a220_0x278feb,_0x25cb2b=a220_0x3b86a6['resolve'](_0x2e6b07),_0x1d22cd=a220_0x3b86a6[_0x21ec31(0x17c)](_0x25cb2b);try{await a220_0xa65d96[_0x21ec31(0x1b8)](_0x25cb2b);throw new Error('Project\x20directory\x20already\x20exists:\x20'+_0x25cb2b);}catch(_0x4701c4){if(_0x4701c4[_0x21ec31(0x161)]!==_0x21ec31(0x1d1))throw _0x4701c4;}const _0x3c0a96=await a220_0xa65d96[_0x21ec31(0x181)](a220_0x3b86a6['join'](_0x1d22cd,_0x21ec31(0x1cc))),_0x979546=a220_0x3b86a6[_0x21ec31(0x16b)](_0x3c0a96,'project'),_0x411171=a220_0x3b86a6['join'](_0x3c0a96,_0x21ec31(0x183));try{try{_0x1e0b19?.('resolving');const {descriptor:_0x5320d1,channel:_0x55a3ba,assetBaseUrl:_0x2ba290,legacyAssetBaseUrl:_0x45cc7f}=await fetchTemplateDescriptor();return _0x1e0b19?.(_0x21ec31(0x193)),await downloadArchive(_0x5320d1,_0x55a3ba,_0x2ba290,_0x45cc7f,_0x411171,_0x1e0b19),_0x1e0b19?.(_0x21ec31(0x17b)),await extractProjectTemplateArchive(_0x411171,_0x979546),await assertTemplateRoot(_0x979546),await commitStagedProject(_0x979546,_0x25cb2b),{'source':'cdn','version':_0x5320d1[_0x21ec31(0x1ae)]};}catch(_0x2d9309){if(_0x2d9309[_0x21ec31(0x161)]===_0x21ec31(0x1a5))throw CliErrors['validation'](_0x21ec31(0x1d0)+_0x25cb2b,'Use\x20a\x20different\x20project\x20name.');const _0x58fd5a=_0x2d9309 instanceof Error?_0x2d9309[_0x21ec31(0x167)]:String(_0x2d9309);throw CliErrors[_0x21ec31(0x18f)](_0x21ec31(0x19d),_0x21ec31(0x196)+_0x58fd5a);}}finally{await a220_0xa65d96['rm'](_0x3c0a96,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x925433,_0x1ec38c,_0x5d5c28){const _0x3bd535=a220_0x278feb;let _0x5d9265;try{_0x5d9265=await a220_0xa65d96[_0x3bd535(0x19a)](a220_0x3b86a6[_0x3bd535(0x1ce)](_0x925433));}catch{throw CliErrors['validation']('Local\x20template\x20source\x20does\x20not\x20exist:\x20'+a220_0x3b86a6[_0x3bd535(0x1ce)](_0x925433),'Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.');}const _0x31540a=await a220_0xa65d96[_0x3bd535(0x1b8)](_0x5d9265);if(!_0x31540a['isDirectory']())throw CliErrors[_0x3bd535(0x18f)]('Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20'+_0x5d9265);const _0x4ccade=a220_0x3b86a6[_0x3bd535(0x1ce)](_0x1ec38c),_0x53134e=await a220_0xa65d96[_0x3bd535(0x19a)](a220_0x3b86a6[_0x3bd535(0x17c)](_0x4ccade)),_0x42a826=a220_0x3b86a6['join'](_0x53134e,a220_0x3b86a6[_0x3bd535(0x1bc)](_0x4ccade));if(containsPath(_0x5d9265,_0x42a826)||containsPath(_0x42a826,_0x5d9265))throw CliErrors[_0x3bd535(0x18f)](_0x3bd535(0x1aa),_0x3bd535(0x1c4));try{await a220_0xa65d96[_0x3bd535(0x1b8)](_0x42a826);throw CliErrors[_0x3bd535(0x18f)](_0x3bd535(0x1d0)+_0x42a826,'Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.');}catch(_0x47710b){if(_0x47710b['code']!=='ENOENT')throw _0x47710b;}const _0x482c66=a220_0x3b86a6[_0x3bd535(0x17c)](_0x42a826);await a220_0xa65d96[_0x3bd535(0x1a2)](_0x482c66);const _0x26474d=await a220_0xa65d96[_0x3bd535(0x181)](a220_0x3b86a6['join'](_0x482c66,_0x3bd535(0x1cc))),_0x5cc672=a220_0x3b86a6[_0x3bd535(0x16b)](_0x26474d,_0x3bd535(0x18c));try{_0x5d5c28?.('copying'),await copyLocalTemplateDirectory(_0x5d9265,_0x5cc672),await assertTemplateRoot(_0x5cc672);const _0x1ddf5=await readTemplateVersion(_0x5cc672);return await commitStagedProject(_0x5cc672,_0x42a826),{'source':'local','version':_0x1ddf5};}catch(_0x523392){const _0x35607c=_0x523392 instanceof Error?_0x523392['message']:String(_0x523392);throw CliErrors[_0x3bd535(0x18f)](_0x3bd535(0x182)+_0x35607c,_0x3bd535(0x198));}finally{await a220_0xa65d96['rm'](_0x26474d,{'recursive':!![],'force':!![]});}}
|
|
1
|
+
const a220_0x5916cd=a220_0x589a;(function(_0x509538,_0x4a74e5){const _0x435585=a220_0x589a,_0x16efda=_0x509538();while(!![]){try{const _0x401c72=-parseInt(_0x435585(0xf3))/0x1+-parseInt(_0x435585(0xa5))/0x2+-parseInt(_0x435585(0xdf))/0x3+parseInt(_0x435585(0xf7))/0x4*(parseInt(_0x435585(0xfe))/0x5)+-parseInt(_0x435585(0xc3))/0x6*(-parseInt(_0x435585(0xf4))/0x7)+-parseInt(_0x435585(0xb1))/0x8+parseInt(_0x435585(0x10b))/0x9;if(_0x401c72===_0x4a74e5)break;else _0x16efda['push'](_0x16efda['shift']());}catch(_0x55022b){_0x16efda['push'](_0x16efda['shift']());}}}(a220_0x45c8,0x2981b));import{createHash}from'node:crypto';import a220_0xd5aa8e from'node:fs/promises';import a220_0x5962e0 from'node:path';import a220_0x1b9ff9 from'semver';import{getProjectTemplateRelativeUrl}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{fetchProjectTemplateCdnConfig,isBetaCliVersion,resolveProjectTemplateDescriptor}from'../../../utils/cli-version-policy.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID=a220_0x5916cd(0xf8),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x298912){const _0x22c99c=a220_0x5916cd;return typeof _0x298912==='string'&&_0x298912[_0x22c99c(0x104)]()?_0x298912[_0x22c99c(0x104)]():null;}function parseDescriptor(_0x5f1a11){const _0x3e934e=a220_0x5916cd;if(!_0x5f1a11||typeof _0x5f1a11!=='object')throw new Error('CDN\x20config\x20does\x20not\x20define\x20template\x20\x22'+TEMPLATE_ID+'\x22.');const _0x58dd9d=_0x5f1a11,_0x10dedd=nonEmptyString(_0x58dd9d[_0x3e934e(0xb8)]),_0x263044=nonEmptyString(_0x58dd9d[_0x3e934e(0xfc)]),_0x948abc=_0x58dd9d['url']===undefined?undefined:nonEmptyString(_0x58dd9d[_0x3e934e(0xfb)])||undefined,_0x5d1f76=nonEmptyString(_0x58dd9d[_0x3e934e(0xad)])?.[_0x3e934e(0xae)](),_0x4ae25f=_0x58dd9d[_0x3e934e(0xd4)];if(!_0x10dedd||!a220_0x1b9ff9[_0x3e934e(0xd9)](_0x10dedd)||!_0x263044||_0x263044!==a220_0x5962e0[_0x3e934e(0xf9)][_0x3e934e(0xcb)](_0x263044)||_0x263044[_0x3e934e(0xaa)]('\x5c')||_0x58dd9d[_0x3e934e(0xfb)]!==undefined&&!_0x948abc||!_0x5d1f76||!/^sha256:[a-f0-9]{64}$/['test'](_0x5d1f76)||typeof _0x4ae25f!=='number'||!Number[_0x3e934e(0xbd)](_0x4ae25f)||_0x4ae25f<=0x0||_0x4ae25f>MAX_ARCHIVE_SIZE)throw new Error(_0x3e934e(0xc8)+TEMPLATE_ID+'\x22.');return{'version':_0x10dedd,'name':_0x263044,'url':_0x948abc,'sha256':_0x5d1f76,'size':_0x4ae25f};}async function fetchWithTimeout(_0x5cb14a,_0x37f6dc,_0x56cac6,_0x4b38a2){const _0x2502ff=a220_0x5916cd,_0x3ee4f7=new AbortController(),_0x195f3a=setTimeout(()=>_0x3ee4f7['abort'](),_0x37f6dc);try{const _0x4028b7=await fetch(_0x5cb14a,{'headers':{'Accept':_0x56cac6},'redirect':_0x2502ff(0xc9),'signal':_0x3ee4f7[_0x2502ff(0x10d)]});return await _0x4b38a2(_0x4028b7);}finally{clearTimeout(_0x195f3a);}}async function fetchTemplateDescriptor(){const _0x3c3628=a220_0x5916cd,_0x5b3fab=getCliVersion(),_0x100059=isBetaCliVersion(_0x5b3fab)?_0x3c3628(0xaf):_0x3c3628(0xe4),_0x5cb71b=await fetchProjectTemplateCdnConfig();if(!_0x5cb71b)throw new Error(_0x3c3628(0xd1));const _0x2d76ee=parseDescriptor(resolveProjectTemplateDescriptor(_0x5cb71b[_0x3c3628(0xec)],_0x5b3fab));return{'descriptor':_0x2d76ee,'channel':_0x100059,'assetBaseUrl':_0x5cb71b[_0x3c3628(0xe9)],'legacyAssetBaseUrl':_0x5cb71b['legacyAssetBaseUrl']};}function resolveArchiveUrl(_0x2ac37d,_0x59f02b,_0x1b6e8e,_0x21f0b9){const _0x5cb6aa=a220_0x5916cd,_0x2da1ae=new URL(_0x1b6e8e+'/'),_0x2b4f5d=[getProjectTemplateRelativeUrl(_0x59f02b),getProjectTemplateRelativeUrl(_0x59f02b,_0x2ac37d[_0x5cb6aa(0xb8)])];if(_0x2ac37d[_0x5cb6aa(0xfb)]&&!_0x2b4f5d[_0x5cb6aa(0xaa)](_0x2ac37d[_0x5cb6aa(0xfb)]))throw new Error(_0x5cb6aa(0xe5));const _0xa42b45=new URL(_0x21f0b9+'/'),_0x25628c=_0x2ac37d[_0x5cb6aa(0xfb)]?new URL(_0x2ac37d[_0x5cb6aa(0xfb)],_0x2da1ae[_0x5cb6aa(0xea)]):new URL(_0x2ac37d[_0x5cb6aa(0xfc)],_0xa42b45),_0x2b9c4d=_0x2ac37d[_0x5cb6aa(0xfb)]?_0x2da1ae[_0x5cb6aa(0xea)]:_0xa42b45[_0x5cb6aa(0xea)];if(_0x25628c[_0x5cb6aa(0xf0)]!==_0x5cb6aa(0xe2)||_0x25628c[_0x5cb6aa(0xea)]!==_0x2b9c4d||a220_0x5962e0['posix']['basename'](decodeURIComponent(_0x25628c[_0x5cb6aa(0xe7)]))!==_0x2ac37d[_0x5cb6aa(0xfc)]||!_0x2ac37d[_0x5cb6aa(0xfb)]&&!_0x25628c[_0x5cb6aa(0xe7)][_0x5cb6aa(0xe0)](_0xa42b45[_0x5cb6aa(0xe7)]))throw new Error('CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.');return _0x25628c[_0x5cb6aa(0x101)];}async function readResponseBytes(_0x20e133,_0x457697){const _0x494579=a220_0x5916cd;if(!_0x20e133[_0x494579(0x10f)]){const _0x485bf3=Buffer['from'](await _0x20e133['arrayBuffer']());if(_0x485bf3['length']>_0x457697)throw new Error(_0x494579(0xc5));return _0x485bf3;}const _0x16140c=_0x20e133[_0x494579(0x10f)]['getReader'](),_0x2f1bdb=[];let _0x56fc04=0x0;try{while(!![]){const {done:_0x291519,value:_0x26daed}=await _0x16140c[_0x494579(0xba)]();if(_0x291519)break;_0x56fc04+=_0x26daed[_0x494579(0xe3)];if(_0x56fc04>_0x457697){await _0x16140c['cancel']();throw new Error('CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.');}_0x2f1bdb[_0x494579(0xa6)](Buffer[_0x494579(0xde)](_0x26daed));}}finally{_0x16140c[_0x494579(0x110)]();}return Buffer[_0x494579(0xfd)](_0x2f1bdb,_0x56fc04);}async function downloadArchive(_0x14194b,_0xf691e7,_0x54b8a1,_0x41e294,_0x55afa3,_0x9416c6){const _0x5c4672=a220_0x5916cd,_0x413517=await fetchWithTimeout(resolveArchiveUrl(_0x14194b,_0xf691e7,_0x54b8a1,_0x41e294),ARCHIVE_TIMEOUT_MS,_0x5c4672(0xe6),async _0x185fbc=>{const _0x7a1b6b=_0x5c4672;if(!_0x185fbc['ok'])throw new Error(_0x7a1b6b(0x108)+_0x185fbc['status']+'.');const _0x52c560=Number(_0x185fbc[_0x7a1b6b(0xcd)]['get'](_0x7a1b6b(0xdd)));if(Number[_0x7a1b6b(0xff)](_0x52c560)&&_0x52c560>MAX_ARCHIVE_SIZE)throw new Error(_0x7a1b6b(0xda));return readResponseBytes(_0x185fbc,_0x14194b[_0x7a1b6b(0xd4)]);});if(_0x413517[_0x5c4672(0x105)]!==_0x14194b[_0x5c4672(0xd4)])throw new Error(_0x5c4672(0xb7)+_0x14194b[_0x5c4672(0xd4)]+_0x5c4672(0xab)+_0x413517[_0x5c4672(0x105)]+'.');_0x9416c6?.('verifying');const _0x2915e0='sha256:'+createHash(_0x5c4672(0xad))[_0x5c4672(0xee)](_0x413517)[_0x5c4672(0x114)](_0x5c4672(0x115));if(_0x2915e0!==_0x14194b[_0x5c4672(0xad)])throw new Error('CDN\x20project\x20template\x20checksum\x20verification\x20failed.');await a220_0xd5aa8e[_0x5c4672(0x113)](_0x55afa3,_0x413517,{'flag':'wx'});}async function assertTemplateRoot(_0x3464bf){const _0x525bfb=a220_0x5916cd,_0x1d8527=a220_0x5962e0[_0x525bfb(0xb9)](_0x3464bf,'package.json'),_0x1350c4=JSON[_0x525bfb(0xe8)](await a220_0xd5aa8e[_0x525bfb(0xe1)](_0x1d8527,_0x525bfb(0xc2)));if(!_0x1350c4||typeof _0x1350c4!=='object')throw new Error(_0x525bfb(0xa8));}const LOCAL_FORBIDDEN_NAMES=new Set([a220_0x5916cd(0xb2),a220_0x5916cd(0xd6),a220_0x5916cd(0xf6),a220_0x5916cd(0xa7),a220_0x5916cd(0xd8),a220_0x5916cd(0x116),a220_0x5916cd(0xef),'.rabetbase.json',a220_0x5916cd(0xc7),a220_0x5916cd(0xb4)]);function isForbiddenTemplateEntry(_0x1f6d94){const _0x138f46=a220_0x5916cd;if(LOCAL_FORBIDDEN_NAMES[_0x138f46(0xc6)](_0x1f6d94))return!![];return _0x1f6d94===_0x138f46(0xce)||_0x1f6d94[_0x138f46(0xe0)](_0x138f46(0xed))&&_0x1f6d94!=='.env.example';}function containsPath(_0xe3fa99,_0x5ef3b2){const _0x1cbc50=a220_0x5916cd,_0x2d94fb=a220_0x5962e0[_0x1cbc50(0xcf)](_0xe3fa99,_0x5ef3b2);return _0x2d94fb===''||!_0x2d94fb[_0x1cbc50(0xe0)]('..'+a220_0x5962e0['sep'])&&_0x2d94fb!=='..'&&!a220_0x5962e0[_0x1cbc50(0x10c)](_0x2d94fb);}async function copyLocalTemplateDirectory(_0x2d145,_0x5e845c){const _0x332d48=a220_0x5916cd;await a220_0xd5aa8e['mkdir'](_0x5e845c,{'recursive':!![]});for(const _0x5f0be1 of await a220_0xd5aa8e[_0x332d48(0xb5)](_0x2d145,{'withFileTypes':!![]})){const _0x4fb722=a220_0x5962e0['join'](_0x2d145,_0x5f0be1[_0x332d48(0xfc)]),_0x33a5f9=a220_0x5962e0[_0x332d48(0xb9)](_0x5e845c,_0x5f0be1[_0x332d48(0xfc)]);if(isForbiddenTemplateEntry(_0x5f0be1['name']))throw new Error('Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20'+_0x4fb722);const _0x3a959b=await a220_0xd5aa8e[_0x332d48(0xf2)](_0x4fb722);if(_0x3a959b[_0x332d48(0xd2)]())throw new Error('Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20'+_0x4fb722);if(_0x3a959b[_0x332d48(0x10e)]()){await copyLocalTemplateDirectory(_0x4fb722,_0x33a5f9);continue;}if(!_0x3a959b['isFile']())continue;await a220_0xd5aa8e[_0x332d48(0xcc)](_0x4fb722,_0x33a5f9),await a220_0xd5aa8e['chmod'](_0x33a5f9,_0x3a959b['mode']&0x1ff);}}function a220_0x589a(_0x261155,_0x4cbdd3){_0x261155=_0x261155-0xa5;const _0x45c86a=a220_0x45c8();let _0x589a3c=_0x45c86a[_0x261155];return _0x589a3c;}async function readTemplateVersion(_0x265361){const _0x1aac24=a220_0x5916cd,_0x3f2eb1=JSON['parse'](await a220_0xd5aa8e[_0x1aac24(0xe1)](a220_0x5962e0[_0x1aac24(0xb9)](_0x265361,_0x1aac24(0xdb)),_0x1aac24(0xc2)));return nonEmptyString(_0x3f2eb1['version'])||'local';}async function readDirectoryIdentity(_0x13bb6d){const _0x57f29c=a220_0x5916cd;try{const _0x1802f9=await a220_0xd5aa8e[_0x57f29c(0xf2)](_0x13bb6d);if(!_0x1802f9[_0x57f29c(0x10e)]())return null;return{'dev':_0x1802f9[_0x57f29c(0xdc)],'ino':_0x1802f9['ino']};}catch{return null;}}async function commitStagedProject(_0x1dfa12,_0x1288c4){const _0xc93e26=a220_0x5916cd;await a220_0xd5aa8e[_0xc93e26(0xbb)](_0x1288c4);const _0x4e0f56=await readDirectoryIdentity(_0x1288c4);if(!_0x4e0f56)throw new Error('Unable\x20to\x20claim\x20the\x20project\x20directory.');try{for(const _0xce954 of await a220_0xd5aa8e['readdir'](_0x1dfa12)){await a220_0xd5aa8e[_0xc93e26(0xf1)](a220_0x5962e0[_0xc93e26(0xb9)](_0x1dfa12,_0xce954),a220_0x5962e0[_0xc93e26(0xb9)](_0x1288c4,_0xce954));}}catch(_0x215e3f){const _0x5e2c8c=await readDirectoryIdentity(_0x1288c4);_0x5e2c8c?.[_0xc93e26(0xdc)]===_0x4e0f56['dev']&&_0x5e2c8c[_0xc93e26(0xbe)]===_0x4e0f56[_0xc93e26(0xbe)]&&await a220_0xd5aa8e['rm'](_0x1288c4,{'recursive':!![],'force':!![]});throw _0x215e3f;}}function a220_0x45c8(){const _0x59a71f=['version','join','read','mkdir','cdn','isSafeInteger','ino','dirname','validation','code','utf8','414ytQczR','.rabetbase-create-','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','has','dist','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','error','mkdtemp','basename','copyFile','headers','.env','relative','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','isSymbolicLink','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','size','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','.codegraph','EEXIST','.lovrabet.json','valid','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','package.json','dev','content-length','from','191859FiaJoW','startsWith','readFile','https:','byteLength','release','CDN\x20project\x20template\x20relative\x20URL\x20must\x20match\x20its\x20release\x20channel\x20or\x20version.','application/zip','pathname','parse','assetBaseUrl','origin','extracting','config','.env.','update','.rabetbase','protocol','rename','lstat','238888aVQpiR','3668oJFKPH','local','.git','1384WDNRdV','sub-app-react-demo','posix','Check\x20the\x20source\x20directory\x20and\x20retry.','url','name','concat','3310ToVIZl','isFinite','Local\x20template\x20source\x20does\x20not\x20exist:\x20','href','project','access','trim','length','realpath','copying','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','message','Project\x20directory\x20already\x20exists:\x20','3128940NxFRQE','isAbsolute','signal','isDirectory','body','releaseLock','downloading','Use\x20a\x20different\x20project\x20name.','writeFile','digest','hex','.lovrabet.log','ENOENT','13846wxlrTj','push','.idea','Project\x20template\x20package.json\x20is\x20invalid.','resolving','includes',',\x20received\x20','Invalid\x20local\x20template\x20source:\x20','sha256','toLowerCase','beta','resolve','1064744QiKDjT','.DS_Store','template.zip','node_modules','readdir','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20'];a220_0x45c8=function(){return _0x59a71f;};return a220_0x45c8();}export async function materializeProjectTemplate(_0x1573ec,_0x14cf35){const _0x2f82d7=a220_0x5916cd,_0x35d238=a220_0x5962e0[_0x2f82d7(0xb0)](_0x1573ec),_0x3c3b71=a220_0x5962e0['dirname'](_0x35d238);try{await a220_0xd5aa8e[_0x2f82d7(0xf2)](_0x35d238);throw new Error(_0x2f82d7(0x10a)+_0x35d238);}catch(_0x3383e7){if(_0x3383e7[_0x2f82d7(0xc1)]!=='ENOENT')throw _0x3383e7;}const _0x4b4a30=await a220_0xd5aa8e['mkdtemp'](a220_0x5962e0[_0x2f82d7(0xb9)](_0x3c3b71,'.rabetbase-create-')),_0x1c7dc3=a220_0x5962e0[_0x2f82d7(0xb9)](_0x4b4a30,'project'),_0x25e29a=a220_0x5962e0['join'](_0x4b4a30,_0x2f82d7(0xb3));try{try{_0x14cf35?.(_0x2f82d7(0xa9));const {descriptor:_0x291673,channel:_0x10e770,assetBaseUrl:_0x5e7969,legacyAssetBaseUrl:_0xc712c5}=await fetchTemplateDescriptor();return _0x14cf35?.(_0x2f82d7(0x111)),await downloadArchive(_0x291673,_0x10e770,_0x5e7969,_0xc712c5,_0x25e29a,_0x14cf35),_0x14cf35?.(_0x2f82d7(0xeb)),await extractProjectTemplateArchive(_0x25e29a,_0x1c7dc3),await assertTemplateRoot(_0x1c7dc3),await commitStagedProject(_0x1c7dc3,_0x35d238),{'source':_0x2f82d7(0xbc),'version':_0x291673[_0x2f82d7(0xb8)]};}catch(_0x474230){if(_0x474230[_0x2f82d7(0xc1)]===_0x2f82d7(0xd7))throw CliErrors['validation']('Project\x20directory\x20already\x20exists:\x20'+_0x35d238,_0x2f82d7(0x112));const _0x1ab4e9=_0x474230 instanceof Error?_0x474230[_0x2f82d7(0x109)]:String(_0x474230);throw CliErrors[_0x2f82d7(0xc0)](_0x2f82d7(0xd0),_0x2f82d7(0xb6)+_0x1ab4e9);}}finally{await a220_0xd5aa8e['rm'](_0x4b4a30,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x23cb59,_0x4caf26,_0x35a9eb){const _0x2ba394=a220_0x5916cd;let _0x47ead3;try{_0x47ead3=await a220_0xd5aa8e['realpath'](a220_0x5962e0[_0x2ba394(0xb0)](_0x23cb59));}catch{throw CliErrors['validation'](_0x2ba394(0x100)+a220_0x5962e0[_0x2ba394(0xb0)](_0x23cb59),_0x2ba394(0xd3));}const _0x3cb049=await a220_0xd5aa8e['lstat'](_0x47ead3);if(!_0x3cb049[_0x2ba394(0x10e)]())throw CliErrors[_0x2ba394(0xc0)](_0x2ba394(0xd5)+_0x47ead3);const _0x20d7a1=a220_0x5962e0[_0x2ba394(0xb0)](_0x4caf26),_0x5919fb=await a220_0xd5aa8e[_0x2ba394(0x106)](a220_0x5962e0[_0x2ba394(0xbf)](_0x20d7a1)),_0x190187=a220_0x5962e0[_0x2ba394(0xb9)](_0x5919fb,a220_0x5962e0[_0x2ba394(0xcb)](_0x20d7a1));if(containsPath(_0x47ead3,_0x190187)||containsPath(_0x190187,_0x47ead3))throw CliErrors[_0x2ba394(0xc0)]('Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.');try{await a220_0xd5aa8e['lstat'](_0x190187);throw CliErrors['validation']('Project\x20directory\x20already\x20exists:\x20'+_0x190187,'Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.');}catch(_0x48ac0d){if(_0x48ac0d[_0x2ba394(0xc1)]!==_0x2ba394(0x117))throw _0x48ac0d;}const _0x37c00a=a220_0x5962e0[_0x2ba394(0xbf)](_0x190187);await a220_0xd5aa8e[_0x2ba394(0x103)](_0x37c00a);const _0x8a71be=await a220_0xd5aa8e[_0x2ba394(0xca)](a220_0x5962e0[_0x2ba394(0xb9)](_0x37c00a,_0x2ba394(0xc4))),_0xdb687e=a220_0x5962e0[_0x2ba394(0xb9)](_0x8a71be,_0x2ba394(0x102));try{_0x35a9eb?.(_0x2ba394(0x107)),await copyLocalTemplateDirectory(_0x47ead3,_0xdb687e),await assertTemplateRoot(_0xdb687e);const _0x3ddfb0=await readTemplateVersion(_0xdb687e);return await commitStagedProject(_0xdb687e,_0x190187),{'source':_0x2ba394(0xf5),'version':_0x3ddfb0};}catch(_0x169974){const _0x312ed2=_0x169974 instanceof Error?_0x169974[_0x2ba394(0x109)]:String(_0x169974);throw CliErrors[_0x2ba394(0xc0)](_0x2ba394(0xac)+_0x312ed2,_0x2ba394(0xfa));}finally{await a220_0xd5aa8e['rm'](_0x8a71be,{'recursive':!![],'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x56607f,_0x5ee454){const _0x2297d7=a221_0x387b,_0x1c5c02=_0x56607f();while(!![]){try{const _0x30ee13=-parseInt(_0x2297d7(0x149))/0x1+parseInt(_0x2297d7(0x146))/0x2*(parseInt(_0x2297d7(0x141))/0x3)+parseInt(_0x2297d7(0x144))/0x4*(parseInt(_0x2297d7(0x145))/0x5)+-parseInt(_0x2297d7(0x143))/0x6+-parseInt(_0x2297d7(0x150))/0x7+parseInt(_0x2297d7(0x14d))/0x8+parseInt(_0x2297d7(0x148))/0x9*(parseInt(_0x2297d7(0x147))/0xa);if(_0x30ee13===_0x5ee454)break;else _0x1c5c02['push'](_0x1c5c02['shift']());}catch(_0x2306b6){_0x1c5c02['push'](_0x1c5c02['shift']());}}}(a221_0x565f,0x995df));function a221_0x387b(_0x4c6eb1,_0x5d1b65){_0x4c6eb1=_0x4c6eb1-0x140;const _0x565f02=a221_0x565f();let _0x387bed=_0x565f02[_0x4c6eb1];return _0x387bed;}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;export function getProjectNameValidationError(_0x2e2b57){const _0x15cf56=a221_0x387b,_0x3f9427=_0x2e2b57[_0x15cf56(0x140)]();if(!_0x3f9427)return _0x15cf56(0x14b);if(_0x3f9427[_0x15cf56(0x142)]>MAX_PROJECT_NAME_LENGTH)return'Project\x20name\x20cannot\x20exceed\x20'+MAX_PROJECT_NAME_LENGTH+_0x15cf56(0x151);if(!PROJECT_NAME_PATTERN[_0x15cf56(0x14f)](_0x3f9427))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';if(WINDOWS_RESERVED_NAME[_0x15cf56(0x14f)](_0x3f9427))return'Project\x20name\x20\x22'+_0x3f9427+_0x15cf56(0x14a);return null;}function a221_0x565f(){const _0x35da64=['27OrlCra','length','231246YeTZjN','28DIyibz','637505KsQJCX','190974YfLoOm','691290LjmsDV','63QETsfS','808378KKQczX','\x22\x20is\x20reserved\x20on\x20Windows','Project\x20name\x20cannot\x20be\x20empty','Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.','3875064GqZNZK','validation','test','8715462DWHpVg','\x20characters','trim'];a221_0x565f=function(){return _0x35da64;};return a221_0x565f();}export function validateProjectName(_0x34e511){const _0x588382=a221_0x387b,_0x353894=_0x34e511[_0x588382(0x140)](),_0x9d1d1f=getProjectNameValidationError(_0x353894);if(_0x9d1d1f)throw CliErrors[_0x588382(0x14e)](_0x9d1d1f,_0x588382(0x14c));return _0x353894;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a222_0x4dcd(_0x12a84e,_0xb7edef){_0x12a84e=_0x12a84e-0x134;const _0x283822=a222_0x2838();let _0x4dcd6d=_0x283822[_0x12a84e];return _0x4dcd6d;}(function(_0x2916d2,_0x2979a7){const _0x41cfa7=a222_0x4dcd,_0x5cce98=_0x2916d2();while(!![]){try{const _0x469925=-parseInt(_0x41cfa7(0x145))/0x1+-parseInt(_0x41cfa7(0x15c))/0x2*(-parseInt(_0x41cfa7(0x15f))/0x3)+parseInt(_0x41cfa7(0x146))/0x4*(parseInt(_0x41cfa7(0x139))/0x5)+-parseInt(_0x41cfa7(0x148))/0x6*(-parseInt(_0x41cfa7(0x144))/0x7)+-parseInt(_0x41cfa7(0x134))/0x8*(parseInt(_0x41cfa7(0x15a))/0x9)+parseInt(_0x41cfa7(0x13d))/0xa*(-parseInt(_0x41cfa7(0x15b))/0xb)+parseInt(_0x41cfa7(0x136))/0xc;if(_0x469925===_0x2979a7)break;else _0x5cce98['push'](_0x5cce98['shift']());}catch(_0xa8aa27){_0x5cce98['push'](_0x5cce98['shift']());}}}(a222_0x2838,0x3a908));import{createWriteStream}from'node:fs';import a222_0x40df6f from'node:fs/promises';import a222_0x334e79 from'node:path';import{pipeline}from'node:stream/promises';import a222_0x1d9e44 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(_0x2b554f){return new Promise((_0x1df6bc,_0x2921af)=>{const _0x34f335=a222_0x4dcd;a222_0x1d9e44[_0x34f335(0x14b)](_0x2b554f,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x4e0a44,_0x4a4792)=>{const _0xb837b0=_0x34f335;if(_0x4e0a44||!_0x4a4792){_0x2921af(_0x4e0a44||new Error(_0xb837b0(0x15d)));return;}_0x1df6bc(_0x4a4792);});});}function openEntryStream(_0x17829b,_0x5d902f){return new Promise((_0x2002f4,_0x26f3aa)=>{_0x17829b['openReadStream'](_0x5d902f,(_0x531c3a,_0x12a3b3)=>{const _0x1de3b5=a222_0x4dcd;if(_0x531c3a||!_0x12a3b3){_0x26f3aa(_0x531c3a||new Error(_0x1de3b5(0x14c)+_0x5d902f[_0x1de3b5(0x142)]));return;}_0x2002f4(_0x12a3b3);});});}function validateEntryPath(_0x4ef59c){const _0x2bb329=a222_0x4dcd,_0x180cc4=_0x4ef59c[_0x2bb329(0x138)](/\\/g,'/'),_0x39f756=_0x180cc4['endsWith']('/'),_0x2c9781=_0x39f756?_0x180cc4['slice'](0x0,-0x1):_0x180cc4;if(!_0x2c9781||_0x180cc4[_0x2bb329(0x155)]('/')||/^[A-Za-z]:\//[_0x2bb329(0x13f)](_0x180cc4))throw new Error(_0x2bb329(0x137)+_0x4ef59c);const _0x387259=_0x2c9781['split']('/');for(const _0x33d9f3 of _0x387259){if(!_0x33d9f3||_0x33d9f3==='.'||_0x33d9f3==='..'||_0x33d9f3[_0x2bb329(0x150)]('.')||_0x33d9f3[_0x2bb329(0x150)]('\x20')||WINDOWS_INVALID_CHAR[_0x2bb329(0x13f)](_0x33d9f3)||WINDOWS_RESERVED_NAME[_0x2bb329(0x13f)](_0x33d9f3))throw new Error('Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20'+_0x4ef59c);}return{'relativePath':_0x387259[_0x2bb329(0x14f)](a222_0x334e79['sep']),'directory':_0x39f756};}function isSymbolicLink(_0x5e3e26){const _0x1e770f=a222_0x4dcd,_0x14fa7c=_0x5e3e26[_0x1e770f(0x157)]>>>0x10&0xffff;return(_0x14fa7c&0xf000)===0xa000;}export async function extractProjectTemplateArchive(_0x3174c3,_0x26e4e6){const _0x125672=a222_0x4dcd,_0x3b5c35=await openZip(_0x3174c3),_0x5232d5=a222_0x334e79[_0x125672(0x141)](_0x26e4e6),_0x361fbe=new Set(),_0x3661cb=new Map();let _0x383d85=0x0,_0x2850c1=0x0;await a222_0x40df6f[_0x125672(0x154)](_0x5232d5,{'recursive':!![]}),await new Promise((_0x57c927,_0x38f3ad)=>{const _0x1a1764=_0x125672;let _0x7ecee6=![];const _0x2da0bb=_0x3df120=>{if(_0x7ecee6)return;_0x7ecee6=!![],_0x3b5c35['close'](),_0x38f3ad(_0x3df120 instanceof Error?_0x3df120:new Error(String(_0x3df120)));};_0x3b5c35['once'](_0x1a1764(0x14a),_0x2da0bb),_0x3b5c35[_0x1a1764(0x147)](_0x1a1764(0x13e),()=>{if(_0x7ecee6)return;_0x7ecee6=!![],_0x57c927();}),_0x3b5c35['on'](_0x1a1764(0x151),_0x146e62=>{const _0x404929=_0x1a1764;void(async()=>{const _0x2cf8cb=a222_0x4dcd;_0x383d85+=0x1,_0x2850c1+=_0x146e62[_0x2cf8cb(0x149)];if(_0x383d85>MAX_ENTRY_COUNT)throw new Error(_0x2cf8cb(0x14d)+MAX_ENTRY_COUNT+_0x2cf8cb(0x13c));if(_0x2850c1>MAX_UNCOMPRESSED_SIZE)throw new Error('Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.');if(_0x146e62['isEncrypted']())throw new Error(_0x2cf8cb(0x143)+_0x146e62['fileName']);if(isSymbolicLink(_0x146e62))throw new Error('Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20'+_0x146e62[_0x2cf8cb(0x142)]);const {relativePath:_0x4e223e,directory:_0xc0e3f1}=validateEntryPath(_0x146e62['fileName']),_0x5a0894=_0x4e223e[_0x2cf8cb(0x152)](a222_0x334e79[_0x2cf8cb(0x14e)]);for(let _0x5dc755=0x1;_0x5dc755<=_0x5a0894['length'];_0x5dc755+=0x1){const _0x57fd5e=_0x5a0894['slice'](0x0,_0x5dc755)[_0x2cf8cb(0x14f)](a222_0x334e79['sep']),_0x2d0306=_0x57fd5e[_0x2cf8cb(0x153)](_0x2cf8cb(0x159)),_0x157096=_0x3661cb[_0x2cf8cb(0x158)](_0x2d0306);if(_0x157096&&_0x157096!==_0x57fd5e)throw new Error(_0x2cf8cb(0x135)+_0x146e62[_0x2cf8cb(0x142)]);_0x3661cb[_0x2cf8cb(0x140)](_0x2d0306,_0x57fd5e);}const _0x2e2c72=_0x4e223e[_0x2cf8cb(0x153)](_0x2cf8cb(0x159));if(_0x361fbe['has'](_0x2e2c72))throw new Error(_0x2cf8cb(0x15e)+_0x146e62[_0x2cf8cb(0x142)]);_0x361fbe[_0x2cf8cb(0x160)](_0x2e2c72);const _0x52fd09=a222_0x334e79[_0x2cf8cb(0x141)](_0x5232d5,_0x4e223e);if(_0x52fd09!==_0x5232d5&&!_0x52fd09['startsWith'](''+_0x5232d5+a222_0x334e79[_0x2cf8cb(0x14e)]))throw new Error('ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20'+_0x146e62['fileName']);if(_0xc0e3f1)await a222_0x40df6f[_0x2cf8cb(0x154)](_0x52fd09,{'recursive':!![]});else{await a222_0x40df6f['mkdir'](a222_0x334e79[_0x2cf8cb(0x13a)](_0x52fd09),{'recursive':!![]});const _0x420dd3=await openEntryStream(_0x3b5c35,_0x146e62);await pipeline(_0x420dd3,createWriteStream(_0x52fd09,{'flags':'wx','mode':0x1a4}));}_0x3b5c35[_0x2cf8cb(0x156)]();})()[_0x404929(0x13b)](_0x2da0bb);}),_0x3b5c35[_0x1a1764(0x156)]();});}function a222_0x2838(){const _0x59ce77=['join','endsWith','entry','split','toLocaleLowerCase','mkdir','startsWith','readEntry','externalFileAttributes','get','en-US','135TkVGSK','69685CnaEax','2qktxPm','Unable\x20to\x20open\x20project\x20template\x20archive.','Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20','725379rbotIC','add','45928CSZizF','Case-conflicting\x20ZIP\x20entry\x20path:\x20','5316264zEkBMg','Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20','replace','6235rLvdZF','dirname','catch','\x20entries.','550OPGUhf','end','test','set','resolve','fileName','Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20','21wskmTt','312446UnrrtS','904amWTkI','once','40458irIJHL','uncompressedSize','error','open','Unable\x20to\x20read\x20ZIP\x20entry:\x20','Project\x20template\x20ZIP\x20exceeds\x20','sep'];a222_0x2838=function(){return _0x59ce77;};return a222_0x2838();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x50937a,_0x59a68c){const _0x31f01f=a223_0x3b59,_0x17cdaf=_0x50937a();while(!![]){try{const _0x5cb925=parseInt(_0x31f01f(0x1b2))/0x1+parseInt(_0x31f01f(0x1b4))/0x2+parseInt(_0x31f01f(0x1b3))/0x3+-parseInt(_0x31f01f(0x1b5))/0x4*(-parseInt(_0x31f01f(0x1b0))/0x5)+parseInt(_0x31f01f(0x1b9))/0x6+parseInt(_0x31f01f(0x1b7))/0x7+parseInt(_0x31f01f(0x1b1))/0x8*(-parseInt(_0x31f01f(0x1b8))/0x9);if(_0x5cb925===_0x59a68c)break;else _0x17cdaf['push'](_0x17cdaf['shift']());}catch(_0x1f2b17){_0x17cdaf['push'](_0x17cdaf['shift']());}}}(a223_0x37c7,0x8dd9a));function a223_0x3b59(_0x5c9de3,_0xb587d1){_0x5c9de3=_0x5c9de3-0x1b0;const _0x37c7fb=a223_0x37c7();let _0x3b59ae=_0x37c7fb[_0x5c9de3];return _0x3b59ae;}function a223_0x37c7(){const _0x241025=['75555lsLExg','2530242OwTyBm','723400cJrEUd','2733892RLNrbm','../../../../','3558086OZCHip','24422085kJpSky','4932858JpkpTQ','5nowcGw','8jcSVjQ'];a223_0x37c7=function(){return _0x241025;};return a223_0x37c7();}import a223_0x3ad4d1 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a223_0x3ad4d1['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x15f11d=a223_0x3b59;return a223_0x3ad4d1['resolve'](__dirname,_0x15f11d(0x1b6));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a224_0x2ce8(){const _0x1e155d=['98pKYRHd','cwd','now','73180KPAIxT','11309904UIdrjy','resolve','8sLtdYE','version','75825czTULj','copy','27379aPPqfi','285840DOKUOV','780tngglZ','Project\x20template\x20created','message','info','Starting\x20project\x20template\x20creation','53094cKPndI','17386FlhjOw','success','48UCljId','85OtVpNX'];a224_0x2ce8=function(){return _0x1e155d;};return a224_0x2ce8();}(function(_0x19e4aa,_0x3570b8){const _0x222249=a224_0x3bb0,_0x478299=_0x19e4aa();while(!![]){try{const _0x56fb2a=-parseInt(_0x222249(0x97))/0x1+-parseInt(_0x222249(0x9e))/0x2*(-parseInt(_0x222249(0x8a))/0x3)+parseInt(_0x222249(0x8f))/0x4*(-parseInt(_0x222249(0x8b))/0x5)+-parseInt(_0x222249(0x9d))/0x6*(parseInt(_0x222249(0x8c))/0x7)+-parseInt(_0x222249(0x92))/0x8*(parseInt(_0x222249(0x94))/0x9)+parseInt(_0x222249(0x98))/0xa*(-parseInt(_0x222249(0x96))/0xb)+parseInt(_0x222249(0x90))/0xc;if(_0x56fb2a===_0x3570b8)break;else _0x478299['push'](_0x478299['shift']());}catch(_0x927c79){_0x478299['push'](_0x478299['shift']());}}}(a224_0x2ce8,0x26a40));function a224_0x3bb0(_0x2027f1,_0x4eac6f){_0x2027f1=_0x2027f1-0x8a;const _0x2ce898=a224_0x2ce8();let _0x3bb078=_0x2ce898[_0x2027f1];return _0x3bb078;}import a224_0x40caff from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';export async function copyProjectTemplate(_0x255596,_0x515ae3,_0x5a66dc){const _0x27053a=a224_0x3bb0,_0x201b5d=Date[_0x27053a(0x8e)](),_0x24f86d=a224_0x40caff[_0x27053a(0x91)](process[_0x27053a(0x8d)](),_0x255596);try{logger[_0x27053a(0x9b)](_0x27053a(0x95),_0x27053a(0x9c),{'projectCode':_0x255596});const _0x328e00=_0x5a66dc?await materializeLocalProjectTemplate(_0x5a66dc,_0x24f86d,_0x515ae3):await materializeProjectTemplate(_0x24f86d,_0x515ae3),_0x41d0db=Date[_0x27053a(0x8e)]()-_0x201b5d;logger[_0x27053a(0x9f)]('copy',_0x27053a(0x99),_0x41d0db,{'projectCode':_0x255596,'templateSource':_0x328e00['source'],'templateVersion':_0x328e00[_0x27053a(0x93)]});}catch(_0x2c1d5d){const _0x1a3a82=Date[_0x27053a(0x8e)]()-_0x201b5d;logger['error'](_0x27053a(0x95),'Failed\x20to\x20copy\x20project\x20template',{'projectCode':_0x255596,'error':_0x2c1d5d instanceof Error?_0x2c1d5d[_0x27053a(0x9a)]:String(_0x2c1d5d),'duration':_0x1a3a82});throw _0x2c1d5d;}return formatElapsed(_0x201b5d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x501cb9,_0x3d247c){const _0x42368d=a225_0x56ee,_0x58f5a8=_0x501cb9();while(!![]){try{const _0x53ed51=-parseInt(_0x42368d(0x148))/0x1+-parseInt(_0x42368d(0x141))/0x2*(parseInt(_0x42368d(0x151))/0x3)+-parseInt(_0x42368d(0x14c))/0x4+-parseInt(_0x42368d(0x14f))/0x5+parseInt(_0x42368d(0x13c))/0x6*(-parseInt(_0x42368d(0x14e))/0x7)+parseInt(_0x42368d(0x140))/0x8*(parseInt(_0x42368d(0x13f))/0x9)+parseInt(_0x42368d(0x144))/0xa*(parseInt(_0x42368d(0x14b))/0xb);if(_0x53ed51===_0x3d247c)break;else _0x58f5a8['push'](_0x58f5a8['shift']());}catch(_0x7cf683){_0x58f5a8['push'](_0x58f5a8['shift']());}}}(a225_0x4204,0xa8b60));import a225_0x5ba93c from'node:path';import{execa}from'execa';function a225_0x56ee(_0x63d53f,_0x4e758b){_0x63d53f=_0x63d53f-0x13c;const _0x420487=a225_0x4204();let _0x56ee27=_0x420487[_0x63d53f];return _0x56ee27;}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a225_0x4204(){const _0x408e06=['3650640IwSzjE','format','91185AelMuF','834BBBmFD','npx','resolve','2853aVpTjA','34064qcTWub','58uMZEvR','--write','now','14851220kxtYjX','info','Starting\x20code\x20format','Code\x20format\x20failed','241299KoGMVA','Code\x20format\x20completed','success','11RFJOHk','1123912KdApJk','cwd','504qOLbal'];a225_0x4204=function(){return _0x408e06;};return a225_0x4204();}import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x43f5ab){const _0xaf68af=a225_0x56ee,_0x569476=Date[_0xaf68af(0x143)](),_0x3a421a=a225_0x5ba93c[_0xaf68af(0x13e)](process[_0xaf68af(0x14d)](),_0x43f5ab);try{logger[_0xaf68af(0x145)](_0xaf68af(0x150),_0xaf68af(0x146),{'projectCode':_0x43f5ab}),await execa(resolveNpmBin(_0xaf68af(0x13d)),['prettier',_0xaf68af(0x142),'.'],{'cwd':_0x3a421a});const _0x54f065=Date[_0xaf68af(0x143)]()-_0x569476;logger[_0xaf68af(0x14a)](_0xaf68af(0x150),_0xaf68af(0x149),_0x54f065,{'projectCode':_0x43f5ab});}catch(_0x4080a0){const _0x4a4fef=Date[_0xaf68af(0x143)]()-_0x569476;logger['error'](_0xaf68af(0x150),_0xaf68af(0x147),{'projectCode':_0x43f5ab,'error':_0x4080a0 instanceof Error?_0x4080a0['message']:String(_0x4080a0),'duration':_0x4a4fef});throw _0x4080a0;}return formatElapsed(_0x569476);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x345647,_0x3e32e5){const _0xded60c=a226_0x1b5f,_0x42ce9d=_0x345647();while(!![]){try{const _0x1561e4=parseInt(_0xded60c(0x7f))/0x1+parseInt(_0xded60c(0x85))/0x2*(-parseInt(_0xded60c(0x83))/0x3)+parseInt(_0xded60c(0x8b))/0x4+parseInt(_0xded60c(0x87))/0x5+-parseInt(_0xded60c(0x80))/0x6+-parseInt(_0xded60c(0x86))/0x7*(-parseInt(_0xded60c(0x8e))/0x8)+-parseInt(_0xded60c(0x7b))/0x9*(-parseInt(_0xded60c(0x8d))/0xa);if(_0x1561e4===_0x3e32e5)break;else _0x42ce9d['push'](_0x42ce9d['shift']());}catch(_0x345106){_0x42ce9d['push'](_0x42ce9d['shift']());}}}(a226_0x52cc,0x58fee));function a226_0x52cc(){const _0x50a7b2=['now','https://registry.npmmirror.com','resolve','481688CTokOI','success','266270USZjNL','2488fGHiTD','cwd','162YtlnhG','Dependency\x20install\x20failed','info','error','499749GTgXFM','3557958fxhAad','install','Dependency\x20install\x20completed','227679xKtyOG','npm','18GFjmgP','1295GhlEEZ','2417820FGiFSE'];a226_0x52cc=function(){return _0x50a7b2;};return a226_0x52cc();}import a226_0x2c2724 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a226_0x1b5f(_0x990617,_0x55eea2){_0x990617=_0x990617-0x7b;const _0x52ccf3=a226_0x52cc();let _0x1b5f0a=_0x52ccf3[_0x990617];return _0x1b5f0a;}export async function installDependencies(_0x40f392){const _0x19b1e4=a226_0x1b5f,_0x22c9d2=Date[_0x19b1e4(0x88)](),_0x5d3f09=a226_0x2c2724[_0x19b1e4(0x8a)](process[_0x19b1e4(0x8f)](),_0x40f392);try{logger[_0x19b1e4(0x7d)](_0x19b1e4(0x81),'Starting\x20dependency\x20install',{'projectCode':_0x40f392,'registry':_0x19b1e4(0x89)}),await execa(resolveNpmBin(_0x19b1e4(0x84)),['install','--registry',_0x19b1e4(0x89)],{'cwd':_0x5d3f09});const _0x7d63ab=Date['now']()-_0x22c9d2;logger[_0x19b1e4(0x8c)](_0x19b1e4(0x81),_0x19b1e4(0x82),_0x7d63ab,{'projectCode':_0x40f392});}catch(_0x48eb64){const _0x1f61f4=Date[_0x19b1e4(0x88)]()-_0x22c9d2;logger[_0x19b1e4(0x7e)](_0x19b1e4(0x81),_0x19b1e4(0x7c),{'projectCode':_0x40f392,'error':_0x48eb64 instanceof Error?_0x48eb64['message']:String(_0x48eb64),'duration':_0x1f61f4});throw _0x48eb64;}return formatElapsed(_0x22c9d2);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a227_0x1cd73c=a227_0x12d8;(function(_0x4b91ee,_0x59d6cd){const _0x1bf73a=a227_0x12d8,_0x4909ea=_0x4b91ee();while(!![]){try{const _0x5c6d58=-parseInt(_0x1bf73a(0x17e))/0x1+parseInt(_0x1bf73a(0x177))/0x2+parseInt(_0x1bf73a(0x17d))/0x3*(-parseInt(_0x1bf73a(0x178))/0x4)+parseInt(_0x1bf73a(0x181))/0x5*(parseInt(_0x1bf73a(0x179))/0x6)+parseInt(_0x1bf73a(0x17c))/0x7+-parseInt(_0x1bf73a(0x182))/0x8*(-parseInt(_0x1bf73a(0x176))/0x9)+-parseInt(_0x1bf73a(0x174))/0xa;if(_0x5c6d58===_0x59d6cd)break;else _0x4909ea['push'](_0x4909ea['shift']());}catch(_0x54decf){_0x4909ea['push'](_0x4909ea['shift']());}}}(a227_0x35de,0x64aab));import{CliErrors}from'../../errors.js';function a227_0x12d8(_0x43a311,_0x12e05c){_0x43a311=_0x43a311-0x174;const _0x35dea4=a227_0x35de();let _0x12d811=_0x35dea4[_0x43a311];return _0x12d811;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';function a227_0x35de(){const _0x16ea82=['256045mSlnQZ','486784GNhOls','read','2729040zYmfYg','Domain\x20routing\x20synchronized:\x20','90qXKWsv','102454BkSywT','1184CwqZuj','24LpBAYA','path','Synchronize\x20the\x20current\x20project\x27s\x20public\x20Domain\x20routing','1857723vTJnGn','1983piANRx','249041WOAVPv','Run\x20','project'];a227_0x35de=function(){return _0x16ea82;};return a227_0x35de();}export const projectDomainRoutingSyncDefinition={'service':a227_0x1cd73c(0x180),'command':'domain-routing-sync','description':a227_0x1cd73c(0x17b),'risk':a227_0x1cd73c(0x183),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(){const _0x44b820=a227_0x1cd73c,_0x1ed31e=findProjectRootDirectory();if(!resolveConfigPath(_0x1ed31e))throw CliErrors['validation']('No\x20Rabetbase\x20project\x20configuration\x20was\x20found.',_0x44b820(0x17f)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>\x20in\x20the\x20project\x20directory\x20first.');const _0x13f013=writeProjectDomainRoutingManifest(_0x1ed31e);return{'ok':!![],'message':_0x44b820(0x175)+_0x13f013[_0x44b820(0x17a)],'data':_0x13f013};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a228_0x4c4db8=a228_0x2610;(function(_0x5f02a3,_0x562e29){const _0x3c2f45=a228_0x2610,_0xada25d=_0x5f02a3();while(!![]){try{const _0x475094=parseInt(_0x3c2f45(0x1db))/0x1*(parseInt(_0x3c2f45(0x1bc))/0x2)+-parseInt(_0x3c2f45(0x1d4))/0x3+-parseInt(_0x3c2f45(0x1da))/0x4*(parseInt(_0x3c2f45(0x1b4))/0x5)+parseInt(_0x3c2f45(0x1d7))/0x6*(-parseInt(_0x3c2f45(0x1c9))/0x7)+parseInt(_0x3c2f45(0x1c1))/0x8+-parseInt(_0x3c2f45(0x1d6))/0x9+parseInt(_0x3c2f45(0x1c4))/0xa*(parseInt(_0x3c2f45(0x1bb))/0xb);if(_0x475094===_0x562e29)break;else _0xada25d['push'](_0xada25d['shift']());}catch(_0xf00d6c){_0xada25d['push'](_0xada25d['shift']());}}}(a228_0x5d32,0x73ccd));function a228_0x2610(_0x3df0e1,_0x1a844b){_0x3df0e1=_0x3df0e1-0x1b1;const _0x5d322b=a228_0x5d32();let _0x2610dd=_0x5d322b[_0x3df0e1];return _0x2610dd;}function a228_0x5d32(){const _0x519eb4=['1556605ZtkEbT','yes','args','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','cancelled','Target\x20environment','str','446413IGMPSy','1322BRfCuO','string','Create\x20a\x20new\x20project','../../commands/project/create/main.js','cookie','5782792LsWjpU','appcode','Would\x20upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure\x20without\x20overwriting\x20project-owned\x20entrypoints','440efHZci','bool','boolean','current-dir','cwd','35OZjIoA','Upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure','Prepared\x20local\x20project\x20template\x20directory','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','Project\x20upgrade\x20completed\x20with\x20follow-up\x20work.','env','project-name','project','Upgrade\x20cancelled.','trim','name','451518APzpom','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','5974281VCzLXY','1008582tmUXMS','upgrade','completed','12xyKawF','839sHtXQq','--current-dir\x20cannot\x20be\x20combined\x20with\x20a\x20project\x20name.','write','Skip\x20confirmation\x20prompt','template-source','nonInteractive','validation','Run\x20','create','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]'];a228_0x5d32=function(){return _0x519eb4;};return a228_0x5d32();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{analyseProjectUpgrade,upgradeApp}from'../../commands/project/upgrade.js';import{projectDomainRoutingSyncDefinition}from'../../commands/project/domain-routing-sync.js';const createFlags=[{'name':a228_0x4c4db8(0x1d3),'type':a228_0x4c4db8(0x1bd),'description':'Project\x20name'},{'name':a228_0x4c4db8(0x1ce),'type':a228_0x4c4db8(0x1bd),'description':a228_0x4c4db8(0x1b9)},{'name':a228_0x4c4db8(0x1c2),'type':a228_0x4c4db8(0x1bd),'description':a228_0x4c4db8(0x1b7)},{'name':a228_0x4c4db8(0x1c7),'type':a228_0x4c4db8(0x1c6),'description':'Initialize\x20the\x20current\x20empty\x20directory\x20instead\x20of\x20creating\x20a\x20child\x20directory','default':![]},{'name':a228_0x4c4db8(0x1df),'type':a228_0x4c4db8(0x1bd),'description':a228_0x4c4db8(0x1cb)}],upgradeFlags=[{'name':'yes','type':a228_0x4c4db8(0x1c6),'description':a228_0x4c4db8(0x1de),'default':![]}];export const projectDefinitions=[{'service':'project','command':a228_0x4c4db8(0x1b2),'description':a228_0x4c4db8(0x1be),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a228_0x4c4db8(0x1cf),'description':a228_0x4c4db8(0x1cc),'required':![]}],'flags':createFlags,async 'execute'(_0x31cca4){const _0x5cbb38=a228_0x4c4db8,{createApp:_0x46f51b}=await import(_0x5cbb38(0x1bf)),_0x3b5f95=_0x31cca4[_0x5cbb38(0x1ba)](_0x5cbb38(0x1d3))[_0x5cbb38(0x1d2)]()||_0x31cca4[_0x5cbb38(0x1b6)][0x0]?.[_0x5cbb38(0x1d2)](),_0x2ab0c0=_0x31cca4[_0x5cbb38(0x1ba)]('env')||undefined,_0x254f0a=_0x31cca4[_0x5cbb38(0x1ba)](_0x5cbb38(0x1c2))||undefined,_0x40a36d=_0x31cca4[_0x5cbb38(0x1ba)](_0x5cbb38(0x1df))[_0x5cbb38(0x1d2)]()||undefined,_0x2b3e88=_0x31cca4[_0x5cbb38(0x1c5)](_0x5cbb38(0x1c7));if(_0x2b3e88&&_0x3b5f95)throw CliErrors[_0x5cbb38(0x1e1)](_0x5cbb38(0x1dc),_0x5cbb38(0x1b1)+CLI_BIN_NAME+'\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]\x20from\x20the\x20empty\x20target\x20directory.');if(_0x31cca4[_0x5cbb38(0x1e0)]){if(!_0x3b5f95&&!_0x2b3e88)throw CliErrors[_0x5cbb38(0x1e1)](_0x5cbb38(0x1d5),'Usage:\x20'+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]\x20or\x20'+CLI_BIN_NAME+_0x5cbb38(0x1b3));await _0x46f51b({'projectCode':_0x3b5f95,'appCode':_0x254f0a,'env':_0x2ab0c0,'cookie':_0x31cca4[_0x5cbb38(0x1c0)],'currentDir':_0x2b3e88,'nonInteractive':!![],'templateSource':_0x40a36d});}else await _0x46f51b({'projectCode':_0x3b5f95,'appCode':_0x254f0a,'env':_0x2ab0c0,'cookie':_0x31cca4[_0x5cbb38(0x1c0)],'currentDir':_0x2b3e88,'templateSource':_0x40a36d});return{'ok':!![]};}},projectDomainRoutingSyncDefinition,{'service':a228_0x4c4db8(0x1d0),'command':a228_0x4c4db8(0x1d8),'description':a228_0x4c4db8(0x1ca),'risk':a228_0x4c4db8(0x1dd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'dryRun'(){const _0x1c735f=a228_0x4c4db8,_0x14d858=analyseProjectUpgrade(process[_0x1c735f(0x1c8)]());return{'method':'PATCH','url':process[_0x1c735f(0x1c8)](),'body':_0x14d858,'description':_0x1c735f(0x1c3)};},async 'execute'(_0x42daab){const _0x2115d2=a228_0x4c4db8,_0x3959fd=await upgradeApp(_0x42daab[_0x2115d2(0x1e0)],{'yes':_0x42daab[_0x2115d2(0x1c5)](_0x2115d2(0x1b5))});return{'ok':_0x3959fd[_0x2115d2(0x1d9)]||_0x3959fd[_0x2115d2(0x1b8)]===!![],'message':_0x3959fd[_0x2115d2(0x1b8)]?_0x2115d2(0x1d1):_0x3959fd['completed']?'Project\x20upgrade\x20completed.':_0x2115d2(0x1cd),'data':_0x3959fd};}}];
|