@lovrabet/rabetbase-cli 2.5.3-beta.3 → 2.5.3-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/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/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/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/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/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/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/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/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.d.ts +5 -3
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.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-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-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/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +7 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +3 -1
- package/skills/rabetbase/SKILL.md +7 -5
- package/skills/rabetbase/guides/backend-function.md +5 -1
- package/skills/rabetbase/guides/bff-creation-workflow.md +3 -1
- package/skills/rabetbase/guides/cross-database-bff.md +70 -0
- package/skills/rabetbase/guides/data-api-guidelines.md +35 -33
- package/skills/rabetbase/guides/sql-creation-workflow.md +2 -0
- package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +5 -1
- package/skills/rabetbase.manifest.json +4 -3
- package/templates/README.md +41 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
const a200_0x3e96f5=a200_0x2d08;(function(_0x3976b7,_0x4363d9){const _0x5242f0=a200_0x2d08,_0x379dff=_0x3976b7();while(!![]){try{const _0x16fc36=-parseInt(_0x5242f0(0xbb))/0x1*(-parseInt(_0x5242f0(0x94))/0x2)+parseInt(_0x5242f0(0x8e))/0x3+parseInt(_0x5242f0(0xad))/0x4+-parseInt(_0x5242f0(0xaa))/0x5+parseInt(_0x5242f0(0xc0))/0x6*(-parseInt(_0x5242f0(0xb8))/0x7)+-parseInt(_0x5242f0(0xb2))/0x8*(-parseInt(_0x5242f0(0x9c))/0x9)+-parseInt(_0x5242f0(0xab))/0xa;if(_0x16fc36===_0x4363d9)break;else _0x379dff['push'](_0x379dff['shift']());}catch(_0x22a59d){_0x379dff['push'](_0x379dff['shift']());}}}(a200_0x13ac,0x344bd));import{copyFileSync,existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import a200_0x50396c 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=a200_0x3e96f5(0xb0),SDK_CONFIG_SOURCE=a200_0x3e96f5(0xa3);function relativeMigrationDir(_0x51c381,_0x5c8ac1){const _0x3859a9=a200_0x3e96f5,_0x2cf385=a200_0x50396c[_0x3859a9(0x98)](_0x51c381,_0x5c8ac1);return _0x2cf385&&!_0x2cf385[_0x3859a9(0xcb)]('..')?_0x2cf385:_0x3859a9(0xbe);}function candidatePath(_0x5e3a0e,_0x22ce99,_0x165be5){const _0x31d196=a200_0x3e96f5;return a200_0x50396c[_0x31d196(0x8d)](_0x5e3a0e,_0x31d196(0xc1),'project-upgrade',MIGRATION_ID,'candidates',relativeMigrationDir(_0x5e3a0e,_0x22ce99),_0x165be5);}function backupPath(_0xd5a91f,_0x2e4515,_0x1d27c9){const _0x9cec04=a200_0x3e96f5;return a200_0x50396c[_0x9cec04(0x8d)](_0xd5a91f,_0x9cec04(0xc1),'project-upgrade',MIGRATION_ID,'backups',relativeMigrationDir(_0xd5a91f,_0x2e4515),_0x1d27c9);}function a200_0x13ac(){const _0x9f40=['add','external-api-dir','sdk-config.ts','114ILJhzS','.rabetbase','flatMap','appcode','client','utf8','includes','Multiple\x20Lovrabet\x20model\x20profiles\x20match\x20Runtime\x20Domain','Profile-aware\x20model\x20selection\x20generated\x20by\x20Rabetbase\x20CLI','manualMergeRequired','has','startsWith','find','single','LOVRABET_RUNTIME_DOMAIN','modelRuntime','./models.generated','unchanged','api.ts','action','manual-merge','some','join','135654ojrsxZ','resolve','The\x20file\x20contains\x20project-owned\x20code\x20and\x20will\x20not\x20be\x20overwritten.','name','string','keys','144anjwtL','normalizedApiDir','default','./model-runtime','relative','files','-api.ts','.rabetbase.json','6003mTPtnR','create','No\x20Lovrabet\x20model\x20profile\x20matches\x20Runtime\x20Domain','push','apiGroup','api','app','/**\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','apps','project','replace-generated','basename','preserve','The\x20existing\x20runtime\x20selector\x20is\x20not\x20a\x20recognized\x20current\x20generated\x20file.','1314955hMerba','2666470XeuBOb','path','1058800iEIgBv','Model\x20facts\x20are\x20preserved\x20and\x20completed\x20from\x20legacy\x20generated\x20files\x20when\x20possible.','parse','api-model-registry-v2','defaultApp','3048OPaEjE','apiDir','dirname','unconfigured','length','map','35434ODhfye','isDefault','object','3833IdJxGq','client.ts'];a200_0x13ac=function(){return _0x9f40;};return a200_0x13ac();}function readOptional(_0x15c52b){try{return readFileSync(_0x15c52b,'utf8');}catch{return undefined;}}function readJsonObject(_0x28bbfe){const _0x125b01=a200_0x3e96f5;try{const _0xb03502=JSON[_0x125b01(0xaf)](readFileSync(_0x28bbfe,'utf8'));return _0xb03502&&typeof _0xb03502===_0x125b01(0xba)?_0xb03502:{};}catch{return{};}}function planEntrypoint(_0xad463,_0x20df14,_0x306ae2,_0x425324){const _0x1b0ce3=a200_0x3e96f5,_0x2ac48d=a200_0x50396c['join'](_0x20df14,_0x306ae2),_0x104d2f=readOptional(_0x2ac48d);if(_0x104d2f===undefined)return{'path':_0x2ac48d,'action':_0x1b0ce3(0x9d)};if(_0x306ae2===_0x1b0ce3(0xd2)?_0x104d2f[_0x1b0ce3(0xc6)](_0x1b0ce3(0xd0))&&_0x104d2f[_0x1b0ce3(0xc6)](_0x1b0ce3(0x97)):_0x104d2f[_0x1b0ce3(0xc6)](_0x1b0ce3(0xce)))return{'path':_0x2ac48d,'action':'unchanged'};if(_0x425324(_0x104d2f))return{'path':_0x2ac48d,'action':'replace-generated','reason':'Recognized\x20legacy\x20CLI\x20scaffold;\x20a\x20backup\x20will\x20be\x20retained.'};return{'path':_0x2ac48d,'action':_0x1b0ce3(0xd4),'reason':_0x1b0ce3(0x90),'candidatePath':candidatePath(_0xad463,_0x20df14,_0x306ae2)};}function syntheticApps(_0x4fd55d){const _0x4a647d=a200_0x3e96f5,_0x1930db=_0x4fd55d[_0x4a647d(0xa4)]&&typeof _0x4fd55d[_0x4a647d(0xa4)]===_0x4a647d(0xba)?_0x4fd55d[_0x4a647d(0xa4)]:undefined;if(_0x1930db&&Object['keys'](_0x1930db)[_0x4a647d(0xb6)]>0x0){const _0x58bdd2=typeof _0x4fd55d['defaultApp']===_0x4a647d(0x92)?_0x4fd55d['defaultApp']:Object[_0x4a647d(0x93)](_0x1930db)['length']===0x1?Object[_0x4a647d(0x93)](_0x1930db)[0x0]:undefined;return Object['entries'](_0x1930db)[_0x4a647d(0xc2)](([_0x11dc67,_0x283ffa])=>{const _0x1aa8d=_0x4a647d,_0x40459e=_0x283ffa,_0x5ba2c5=typeof _0x40459e['appcode']===_0x1aa8d(0x92)?_0x40459e[_0x1aa8d(0xc3)]:'';return _0x5ba2c5?[{'name':_0x11dc67,'appcode':_0x5ba2c5,'apiGroup':typeof _0x40459e[_0x1aa8d(0xa0)]===_0x1aa8d(0x92)?_0x40459e[_0x1aa8d(0xa0)]:undefined,'isDefault':_0x11dc67===_0x58bdd2,'region':'cn','regionSource':_0x1aa8d(0x96),'apiDir':typeof _0x40459e[_0x1aa8d(0xb3)]===_0x1aa8d(0x92)?_0x40459e[_0x1aa8d(0xb3)]:typeof _0x4fd55d[_0x1aa8d(0xb3)]===_0x1aa8d(0x92)?_0x4fd55d[_0x1aa8d(0xb3)]:undefined,'routingConfig':{}}]:[];});}const _0x2959ab=typeof _0x4fd55d[_0x4a647d(0xc3)]===_0x4a647d(0x92)?_0x4fd55d[_0x4a647d(0xc3)]:typeof _0x4fd55d[_0x4a647d(0xa2)]===_0x4a647d(0x92)?_0x4fd55d[_0x4a647d(0xa2)]:undefined;if(!_0x2959ab)return[];return[{'name':_0x2959ab,'appcode':_0x2959ab,'isDefault':!![],'region':'cn','regionSource':_0x4a647d(0x96),'apiDir':typeof _0x4fd55d[_0x4a647d(0xb3)]===_0x4a647d(0x92)?_0x4fd55d[_0x4a647d(0xb3)]:undefined,'routingConfig':{}}];}function configuredLayouts(_0x36f5c3,_0x22802b){const _0x3b2aef=a200_0x3e96f5;return resolveApiProfileLayouts(_0x22802b,_0x431703=>a200_0x50396c[_0x3b2aef(0x8f)](_0x36f5c3,_0x431703[_0x3b2aef(0xb3)]||DEFAULT_API_DIR),_0x36f5c3);}function uniqueRegistryGroups(_0x39750b){const _0x38ee57=a200_0x3e96f5,_0x10a0c6=[],_0x57eca2=new Set(),_0x3ea087=new Set();for(const _0x3cfdb6 of _0x39750b){const _0x3e89b2=getRegistryGroup(_0x39750b,_0x3cfdb6);if(!_0x3e89b2){_0x57eca2[_0x38ee57(0xbd)](_0x3cfdb6['outputDir']);continue;}const _0x57f31a=_0x3cfdb6['normalizedApiDir']+'\x00'+(_0x3cfdb6[_0x38ee57(0xa0)]??_0x38ee57(0xcd));!_0x3ea087[_0x38ee57(0xca)](_0x57f31a)&&(_0x10a0c6[_0x38ee57(0x9f)](_0x3e89b2),_0x3ea087[_0x38ee57(0xbd)](_0x57f31a));}return{'groups':_0x10a0c6,'skipped':[..._0x57eca2]};}function planGroup(_0x26c9fb,_0x3ac40a){const _0x43203c=a200_0x3e96f5,_0x13e042=_0x3ac40a[0x0][_0x43203c(0x95)],_0x39481f=a200_0x50396c[_0x43203c(0x8d)](_0x13e042,MODEL_RUNTIME_FILE_NAME),_0x59fcb1=readOptional(_0x39481f),_0x4f46b5=_0x59fcb1!==undefined&&_0x59fcb1[_0x43203c(0xc6)](_0x43203c(0xc8))&&_0x59fcb1['includes'](_0x43203c(0xc7))&&_0x59fcb1[_0x43203c(0xc6)](_0x43203c(0x9e)),_0x51f234=a200_0x50396c[_0x43203c(0x8d)](_0x13e042,MODEL_REGISTRY_FILE_NAME),_0x53b94d=a200_0x50396c['join'](_0x13e042,_0x43203c(0xbf)),_0x1b3521=[planEntrypoint(_0x26c9fb,_0x13e042,_0x43203c(0xd2),isLegacyGeneratedApiScaffold),planEntrypoint(_0x26c9fb,_0x13e042,_0x43203c(0xbc),isLegacyGeneratedClientScaffold),{'path':_0x39481f,'action':_0x59fcb1===undefined?_0x43203c(0x9d):_0x4f46b5?_0x43203c(0xd1):_0x43203c(0xd4),'reason':_0x59fcb1===undefined?undefined:_0x43203c(0xa9),..._0x59fcb1!==undefined&&!_0x4f46b5?{'candidatePath':candidatePath(_0x26c9fb,_0x13e042,MODEL_RUNTIME_FILE_NAME)}:{}},{'path':_0x51f234,'action':existsSync(_0x51f234)?_0x43203c(0xa8):_0x43203c(0x9d),'reason':_0x43203c(0xae)},{'path':_0x53b94d,'action':existsSync(_0x53b94d)?_0x43203c(0xa8):_0x43203c(0x9d)}];return{'apiDir':_0x13e042,'profiles':_0x3ac40a[_0x43203c(0xb7)](_0x9aac59=>_0x9aac59[_0x43203c(0xa2)]['name']),'files':_0x1b3521};}export function analyzeProjectApiArchitecture(_0x4baad8,_0x53c9f7){const _0x1f06d8=a200_0x3e96f5,_0x5d431e=a200_0x50396c['join'](_0x4baad8,_0x1f06d8(0x9b)),_0x4f3112=_0x53c9f7??(existsSync(_0x5d431e)?readJsonObject(_0x5d431e):{}),_0x4e11de=syntheticApps(_0x4f3112);if(_0x4e11de[_0x1f06d8(0xb6)]===0x0)return{'migration':MIGRATION_ID,'needed':![],'configAction':_0x1f06d8(0xb5),'groups':[],'skippedLegacyDirectories':[],'manualMergeRequired':![]};const _0x1618ec=_0x4f3112['apps']?'unchanged':'migrate-single-app',{groups:_0x29432f,skipped:_0x9d3cdc}=uniqueRegistryGroups(configuredLayouts(_0x4baad8,_0x4e11de)),_0x4db6da=_0x29432f['map'](_0x3718e0=>planGroup(_0x4baad8,_0x3718e0)),_0x2ab912=_0x4db6da['some'](_0x4d8a4d=>_0x4d8a4d[_0x1f06d8(0x99)][_0x1f06d8(0xd5)](_0x20616b=>_0x20616b[_0x1f06d8(0xd3)]===_0x1f06d8(0xd4))),_0x379e3d=_0x1618ec==='migrate-single-app'||_0x4db6da[_0x1f06d8(0xd5)](_0x23c94f=>_0x23c94f[_0x1f06d8(0x99)]['some'](_0x269818=>![_0x1f06d8(0xd1),_0x1f06d8(0xa8)][_0x1f06d8(0xc6)](_0x269818[_0x1f06d8(0xd3)])));return{'migration':MIGRATION_ID,'needed':_0x379e3d,'configAction':_0x1618ec,'groups':_0x4db6da,'skippedLegacyDirectories':_0x9d3cdc,'manualMergeRequired':_0x2ab912};}function migrateSingleAppConfig(_0x4f788d){const _0x510f0c=a200_0x3e96f5,_0x2e7781=a200_0x50396c['join'](_0x4f788d,_0x510f0c(0x9b));if(!existsSync(_0x2e7781))return;const _0x45744b=readConfigFile(_0x2e7781);if(_0x45744b['apps']&&typeof _0x45744b['apps']==='object')return;const _0x4bf1e2=typeof _0x45744b[_0x510f0c(0xc3)]===_0x510f0c(0x92)?_0x45744b['appcode']:typeof _0x45744b[_0x510f0c(0xa2)]===_0x510f0c(0x92)?_0x45744b['app']:undefined;if(!_0x4bf1e2)return;_0x45744b[_0x510f0c(0xa4)]={[_0x4bf1e2]:{'appcode':_0x4bf1e2}},_0x45744b[_0x510f0c(0xb1)]=_0x4bf1e2,delete _0x45744b[_0x510f0c(0xa2)],delete _0x45744b[_0x510f0c(0xc3)],writeConfigFile(_0x2e7781,_0x45744b);}function legacyApiPath(_0x25d441,_0x392209){const _0x5aee17=a200_0x3e96f5,_0x16c410=_0x392209[_0x5aee17(0x95)],_0x1fcd0f=_0x25d441['length']===0x1||_0x392209[_0x5aee17(0xa2)][_0x5aee17(0xb9)]?[a200_0x50396c[_0x5aee17(0x8d)](_0x16c410,_0x5aee17(0xd2)),a200_0x50396c[_0x5aee17(0x8d)](_0x16c410,_0x392209[_0x5aee17(0xa2)]['name']+_0x5aee17(0x9a))]:[a200_0x50396c[_0x5aee17(0x8d)](_0x16c410,_0x392209[_0x5aee17(0xa2)][_0x5aee17(0x91)]+_0x5aee17(0x9a))];return _0x1fcd0f['find'](existsSync);}function writeCandidateOrEntrypoint(_0x7f3a24,_0x38470d,_0x29c795,_0x1222d0){const _0x333070=a200_0x3e96f5;if(_0x29c795[_0x333070(0xd3)]==='unchanged'||_0x29c795[_0x333070(0xd3)]===_0x333070(0xa8))return;if(_0x29c795[_0x333070(0xd3)]===_0x333070(0xd4)){const _0x46805a=_0x29c795['candidatePath'];mkdirSync(a200_0x50396c[_0x333070(0xb4)](_0x46805a),{'recursive':!![]}),writeFileSync(_0x46805a,_0x1222d0,'utf8');return;}if(_0x29c795['action']===_0x333070(0xa6)){const _0x55c922=backupPath(_0x7f3a24,_0x38470d,a200_0x50396c[_0x333070(0xa7)](_0x29c795['path']));mkdirSync(a200_0x50396c[_0x333070(0xb4)](_0x55c922),{'recursive':!![]}),copyFileSync(_0x29c795[_0x333070(0xac)],_0x55c922);}mkdirSync(a200_0x50396c[_0x333070(0xb4)](_0x29c795[_0x333070(0xac)]),{'recursive':!![]}),writeFileSync(_0x29c795[_0x333070(0xac)],_0x1222d0,_0x333070(0xc5));}function a200_0x2d08(_0x5cf824,_0x343d58){_0x5cf824=_0x5cf824-0x8d;const _0x13ac3d=a200_0x13ac();let _0x2d0886=_0x13ac3d[_0x5cf824];return _0x2d0886;}export async function upgradeProjectApiArchitecture(_0xae9ae6){const _0x593cad=a200_0x3e96f5,_0x29ca6a=analyzeProjectApiArchitecture(_0xae9ae6);migrateSingleAppConfig(_0xae9ae6);const _0x56f3d9=getMultiAppConfigs(_0x593cad(0xa5),_0xae9ae6)??[],_0x178739=configuredLayouts(_0xae9ae6,_0x56f3d9),{groups:_0x3aa0a4}=uniqueRegistryGroups(_0x178739);let _0x4d0de9;for(const _0x41960e of _0x3aa0a4){const _0x4811e0=_0x41960e[0x0][_0x593cad(0x95)];mkdirSync(_0x4811e0,{'recursive':!![]});const _0x35e316=_0x41960e[_0x593cad(0xcc)](_0x45f30a=>_0x45f30a[_0x593cad(0xa2)][_0x593cad(0xb9)])??_0x41960e[0x0];for(const _0x2f2e20 of _0x41960e){const _0x25eb03=a200_0x50396c['join'](_0x4811e0,MODEL_REGISTRY_FILE_NAME),_0x1c940f=readModelRegistry(_0x25eb03);if(_0x1c940f?.['profiles'][_0x2f2e20[_0x593cad(0xa2)][_0x593cad(0x91)]])continue;const _0x407e10=legacyApiPath(_0x41960e,_0x2f2e20),_0x492262=_0x407e10?readOptional(_0x407e10):undefined;await initMultiAppEnvironment(_0x2f2e20[_0x593cad(0xa2)]),updateModelRegistry({'outputDir':_0x4811e0,'profileName':_0x2f2e20['app']['name'],'defaultProfile':_0x35e316[_0x593cad(0xa2)][_0x593cad(0x91)],'appCode':_0x2f2e20['app'][_0x593cad(0xc3)],'runtimeDomain':getRuntimeDomain(),'models':_0x492262?parseLegacyApiModels(_0x492262):[]});}const _0x3df56e=await renderModelRegistryScaffold(_0x4811e0,_0xae9ae6),_0x4003d2=planGroup(_0xae9ae6,_0x41960e);for(const _0x439042 of _0x4003d2[_0x593cad(0x99)]){const _0x4870b4=a200_0x50396c[_0x593cad(0xa7)](_0x439042[_0x593cad(0xac)]);if(_0x4870b4===_0x593cad(0xd2))writeCandidateOrEntrypoint(_0xae9ae6,_0x4811e0,_0x439042,_0x3df56e[_0x593cad(0xa1)]);else{if(_0x4870b4===_0x593cad(0xbc))writeCandidateOrEntrypoint(_0xae9ae6,_0x4811e0,_0x439042,_0x3df56e[_0x593cad(0xc4)]);else{if(_0x4870b4===MODEL_RUNTIME_FILE_NAME)writeCandidateOrEntrypoint(_0xae9ae6,_0x4811e0,_0x439042,_0x3df56e[_0x593cad(0xcf)]);else _0x4870b4===_0x593cad(0xbf)&&_0x439042['action']===_0x593cad(0x9d)&&writeCandidateOrEntrypoint(_0xae9ae6,_0x4811e0,_0x439042,SDK_CONFIG_SOURCE);}}}}const _0x36122e=_0x56f3d9[_0x593cad(0xcc)](_0x15f40b=>_0x15f40b[_0x593cad(0xb9)])??_0x56f3d9[0x0];_0x36122e&&(await initMultiAppEnvironment(_0x36122e),_0x4d0de9=writeProjectDomainRoutingManifest(_0xae9ae6)[_0x593cad(0xac)]);const _0x50b0aa=analyzeProjectApiArchitecture(_0xae9ae6);return{..._0x29ca6a,'completed':!_0x50b0aa[_0x593cad(0xc9)],'manualMergeRequired':_0x50b0aa[_0x593cad(0xc9)],'routingPath':_0x4d0de9};}
|
|
1
|
+
const a200_0x15fafb=a200_0x405d;(function(_0x11422e,_0x424b8f){const _0x14d104=a200_0x405d,_0x577543=_0x11422e();while(!![]){try{const _0x36d66d=parseInt(_0x14d104(0x1e1))/0x1*(parseInt(_0x14d104(0x199))/0x2)+-parseInt(_0x14d104(0x1dd))/0x3*(-parseInt(_0x14d104(0x1df))/0x4)+parseInt(_0x14d104(0x195))/0x5*(parseInt(_0x14d104(0x1d7))/0x6)+-parseInt(_0x14d104(0x1ba))/0x7*(-parseInt(_0x14d104(0x1e0))/0x8)+parseInt(_0x14d104(0x1a5))/0x9*(parseInt(_0x14d104(0x1d2))/0xa)+-parseInt(_0x14d104(0x1cc))/0xb*(-parseInt(_0x14d104(0x1d6))/0xc)+-parseInt(_0x14d104(0x1d1))/0xd;if(_0x36d66d===_0x424b8f)break;else _0x577543['push'](_0x577543['shift']());}catch(_0x338e90){_0x577543['push'](_0x577543['shift']());}}}(a200_0x1554,0x3d854));import{copyFileSync,existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import a200_0x51bbff from'node:path';function a200_0x1554(){const _0x386a3e=['utf8','appcode','project-upgrade','17915aqRTXP','string','default','-api.ts','4TOrJyF','client.ts','name','apiDir','map','api.ts','startsWith','manual-merge','entries','manualMergeRequired','outputDir','files','3873609kPJsFM','action','some','client','.rabetbase.json','replace-generated','defaultApp','has','apps','path','normalizedApiDir','unconfigured','app','create','The\x20existing\x20runtime\x20selector\x20is\x20not\x20a\x20recognized\x20current\x20generated\x20file.','keys','No\x20Lovrabet\x20model\x20profile\x20matches\x20Runtime\x20Domain','./models.generated','parse','Recognized\x20legacy\x20CLI\x20scaffold;\x20a\x20backup\x20will\x20be\x20retained.','single','9415jVeyse','isDefault','candidatePath','preserve','migrate-single-app','add','/**\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','length','object','api','Multiple\x20Lovrabet\x20model\x20profiles\x20match\x20Runtime\x20Domain','apiGroup','candidates','flatMap','Profile-aware\x20model\x20selection\x20generated\x20by\x20Rabetbase\x20CLI','join','relative','.rabetbase','92158fOXESR','includes','profiles','find','./model-runtime','12633699AwKehx','10YPpbXq','The\x20file\x20contains\x20project-owned\x20code\x20and\x20will\x20not\x20be\x20overwritten.','api-model-registry-v2','unchanged','48hAKlSD','498GrTILN','dirname','LOVRABET_RUNTIME_DOMAIN','sdk-config.ts','external-api-dir','basename','2391QAwgni','modelRuntime','668ESYOOJ','48xDeRrd','160670EKsMDA'];a200_0x1554=function(){return _0x386a3e;};return a200_0x1554();}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';function a200_0x405d(_0x3fb2dd,_0x48effe){_0x3fb2dd=_0x3fb2dd-0x193;const _0x1554a6=a200_0x1554();let _0x405db7=_0x1554a6[_0x3fb2dd];return _0x405db7;}import{renderModelRegistryScaffold}from'../../api/model-registry-scaffold.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';const MIGRATION_ID=a200_0x15fafb(0x1d4),SDK_CONFIG_SOURCE=a200_0x15fafb(0x1c0);function relativeMigrationDir(_0x2d5928,_0x45b1cd){const _0xf9e7b8=a200_0x15fafb,_0x1a2f56=a200_0x51bbff[_0xf9e7b8(0x1ca)](_0x2d5928,_0x45b1cd);return _0x1a2f56&&!_0x1a2f56[_0xf9e7b8(0x19f)]('..')?_0x1a2f56:_0xf9e7b8(0x1db);}function candidatePath(_0x2901b3,_0x5860c6,_0xbee95a){const _0x29b675=a200_0x15fafb;return a200_0x51bbff[_0x29b675(0x1c9)](_0x2901b3,_0x29b675(0x1cb),'project-upgrade',MIGRATION_ID,_0x29b675(0x1c6),relativeMigrationDir(_0x2901b3,_0x5860c6),_0xbee95a);}function backupPath(_0x1dd2ae,_0x48528b,_0x18445e){const _0x3cfd5a=a200_0x15fafb;return a200_0x51bbff['join'](_0x1dd2ae,'.rabetbase',_0x3cfd5a(0x194),MIGRATION_ID,'backups',relativeMigrationDir(_0x1dd2ae,_0x48528b),_0x18445e);}function readOptional(_0x35f67a){const _0x4f996b=a200_0x15fafb;try{return readFileSync(_0x35f67a,_0x4f996b(0x1e2));}catch{return undefined;}}function readJsonObject(_0x420fb3){const _0x1f5536=a200_0x15fafb;try{const _0x24d918=JSON[_0x1f5536(0x1b7)](readFileSync(_0x420fb3,_0x1f5536(0x1e2)));return _0x24d918&&typeof _0x24d918===_0x1f5536(0x1c2)?_0x24d918:{};}catch{return{};}}function planEntrypoint(_0x1665cb,_0x3c28b3,_0x513860,_0x577f14){const _0x198e09=a200_0x15fafb,_0xe25ff1=a200_0x51bbff[_0x198e09(0x1c9)](_0x3c28b3,_0x513860),_0x50ae2a=readOptional(_0xe25ff1);if(_0x50ae2a===undefined)return{'path':_0xe25ff1,'action':_0x198e09(0x1b2)};if(_0x513860===_0x198e09(0x19e)?_0x50ae2a[_0x198e09(0x1cd)](_0x198e09(0x1b6))&&_0x50ae2a[_0x198e09(0x1cd)](_0x198e09(0x1d0)):_0x50ae2a[_0x198e09(0x1cd)](_0x198e09(0x1d9)))return{'path':_0xe25ff1,'action':_0x198e09(0x1d5)};if(_0x577f14(_0x50ae2a))return{'path':_0xe25ff1,'action':_0x198e09(0x1aa),'reason':_0x198e09(0x1b8)};return{'path':_0xe25ff1,'action':_0x198e09(0x1a0),'reason':_0x198e09(0x1d3),'candidatePath':candidatePath(_0x1665cb,_0x3c28b3,_0x513860)};}function syntheticApps(_0x200380){const _0x442337=a200_0x15fafb,_0x2f546a=_0x200380['apps']&&typeof _0x200380[_0x442337(0x1ad)]==='object'?_0x200380[_0x442337(0x1ad)]:undefined;if(_0x2f546a&&Object[_0x442337(0x1b4)](_0x2f546a)[_0x442337(0x1c1)]>0x0){const _0x5ef93d=typeof _0x200380[_0x442337(0x1ab)]===_0x442337(0x196)?_0x200380['defaultApp']:Object[_0x442337(0x1b4)](_0x2f546a)['length']===0x1?Object[_0x442337(0x1b4)](_0x2f546a)[0x0]:undefined;return Object[_0x442337(0x1a1)](_0x2f546a)[_0x442337(0x1c7)](([_0x702c04,_0x5cdea4])=>{const _0x5756e4=_0x442337,_0x101bea=_0x5cdea4,_0x1b2926=typeof _0x101bea[_0x5756e4(0x193)]===_0x5756e4(0x196)?_0x101bea['appcode']:'';return _0x1b2926?[{'name':_0x702c04,'appcode':_0x1b2926,'apiGroup':typeof _0x101bea[_0x5756e4(0x1c5)]===_0x5756e4(0x196)?_0x101bea[_0x5756e4(0x1c5)]:undefined,'isDefault':_0x702c04===_0x5ef93d,'region':'cn','regionSource':_0x5756e4(0x197),'apiDir':typeof _0x101bea['apiDir']===_0x5756e4(0x196)?_0x101bea[_0x5756e4(0x19c)]:typeof _0x200380[_0x5756e4(0x19c)]===_0x5756e4(0x196)?_0x200380[_0x5756e4(0x19c)]:undefined,'routingConfig':{}}]:[];});}const _0x22b1f7=typeof _0x200380[_0x442337(0x193)]===_0x442337(0x196)?_0x200380[_0x442337(0x193)]:typeof _0x200380[_0x442337(0x1b1)]===_0x442337(0x196)?_0x200380[_0x442337(0x1b1)]:undefined;if(!_0x22b1f7)return[];return[{'name':_0x22b1f7,'appcode':_0x22b1f7,'isDefault':!![],'region':'cn','regionSource':_0x442337(0x197),'apiDir':typeof _0x200380[_0x442337(0x19c)]===_0x442337(0x196)?_0x200380['apiDir']:undefined,'routingConfig':{}}];}function configuredLayouts(_0x308f91,_0x32a115){return resolveApiProfileLayouts(_0x32a115,_0x10a744=>a200_0x51bbff['resolve'](_0x308f91,_0x10a744['apiDir']||DEFAULT_API_DIR),_0x308f91);}function uniqueRegistryGroups(_0x531706){const _0x32b693=a200_0x15fafb,_0x529803=[],_0x21ff7b=new Set(),_0x13e725=new Set();for(const _0x10ebc7 of _0x531706){const _0x1fc374=getRegistryGroup(_0x531706,_0x10ebc7);if(!_0x1fc374){_0x21ff7b[_0x32b693(0x1bf)](_0x10ebc7[_0x32b693(0x1a3)]);continue;}const _0x3fc81f=_0x10ebc7[_0x32b693(0x1af)]+'\x00'+(_0x10ebc7[_0x32b693(0x1c5)]??_0x32b693(0x1b9));!_0x13e725[_0x32b693(0x1ac)](_0x3fc81f)&&(_0x529803['push'](_0x1fc374),_0x13e725[_0x32b693(0x1bf)](_0x3fc81f));}return{'groups':_0x529803,'skipped':[..._0x21ff7b]};}function planGroup(_0xa525d8,_0x2ed38a){const _0x15c66c=a200_0x15fafb,_0xfecdcc=_0x2ed38a[0x0]['normalizedApiDir'],_0x4bcab5=a200_0x51bbff[_0x15c66c(0x1c9)](_0xfecdcc,MODEL_RUNTIME_FILE_NAME),_0x3fed1b=readOptional(_0x4bcab5),_0x41cbce=_0x3fed1b!==undefined&&_0x3fed1b[_0x15c66c(0x1cd)](_0x15c66c(0x1c8))&&_0x3fed1b[_0x15c66c(0x1cd)](_0x15c66c(0x1c4))&&_0x3fed1b['includes'](_0x15c66c(0x1b5)),_0xf03e5a=a200_0x51bbff[_0x15c66c(0x1c9)](_0xfecdcc,MODEL_REGISTRY_FILE_NAME),_0x5bf5ba=a200_0x51bbff['join'](_0xfecdcc,_0x15c66c(0x1da)),_0x394e5d=[planEntrypoint(_0xa525d8,_0xfecdcc,_0x15c66c(0x19e),isLegacyGeneratedApiScaffold),planEntrypoint(_0xa525d8,_0xfecdcc,_0x15c66c(0x19a),isLegacyGeneratedClientScaffold),{'path':_0x4bcab5,'action':_0x3fed1b===undefined?_0x15c66c(0x1b2):_0x41cbce?_0x15c66c(0x1d5):_0x15c66c(0x1a0),'reason':_0x3fed1b===undefined?undefined:_0x15c66c(0x1b3),..._0x3fed1b!==undefined&&!_0x41cbce?{'candidatePath':candidatePath(_0xa525d8,_0xfecdcc,MODEL_RUNTIME_FILE_NAME)}:{}},{'path':_0xf03e5a,'action':existsSync(_0xf03e5a)?_0x15c66c(0x1bd):_0x15c66c(0x1b2),'reason':'Model\x20facts\x20are\x20preserved\x20and\x20completed\x20from\x20legacy\x20generated\x20files\x20when\x20possible.'},{'path':_0x5bf5ba,'action':existsSync(_0x5bf5ba)?_0x15c66c(0x1bd):_0x15c66c(0x1b2)}];return{'apiDir':_0xfecdcc,'profiles':_0x2ed38a['map'](_0x2c42f6=>_0x2c42f6[_0x15c66c(0x1b1)][_0x15c66c(0x19b)]),'files':_0x394e5d};}export function analyzeProjectApiArchitecture(_0xc465ac,_0x5b5af7){const _0x147c93=a200_0x15fafb,_0xd67acd=a200_0x51bbff[_0x147c93(0x1c9)](_0xc465ac,_0x147c93(0x1a9)),_0x5e5fcb=_0x5b5af7??(existsSync(_0xd67acd)?readJsonObject(_0xd67acd):{}),_0x1b78eb=syntheticApps(_0x5e5fcb);if(_0x1b78eb[_0x147c93(0x1c1)]===0x0)return{'migration':MIGRATION_ID,'needed':![],'configAction':_0x147c93(0x1b0),'groups':[],'skippedLegacyDirectories':[],'manualMergeRequired':![]};const _0x3588fb=_0x5e5fcb[_0x147c93(0x1ad)]?_0x147c93(0x1d5):_0x147c93(0x1be),{groups:_0x15ab23,skipped:_0x1f5dea}=uniqueRegistryGroups(configuredLayouts(_0xc465ac,_0x1b78eb)),_0x18e96c=_0x15ab23[_0x147c93(0x19d)](_0x11a702=>planGroup(_0xc465ac,_0x11a702)),_0x21c137=_0x18e96c[_0x147c93(0x1a7)](_0x3f3ee2=>_0x3f3ee2[_0x147c93(0x1a4)][_0x147c93(0x1a7)](_0x3cbc88=>_0x3cbc88[_0x147c93(0x1a6)]==='manual-merge')),_0x5e2f9f=_0x3588fb===_0x147c93(0x1be)||_0x18e96c['some'](_0x4cdfff=>_0x4cdfff['files'][_0x147c93(0x1a7)](_0x56d402=>![_0x147c93(0x1d5),'preserve'][_0x147c93(0x1cd)](_0x56d402['action'])));return{'migration':MIGRATION_ID,'needed':_0x5e2f9f,'configAction':_0x3588fb,'groups':_0x18e96c,'skippedLegacyDirectories':_0x1f5dea,'manualMergeRequired':_0x21c137};}function migrateSingleAppConfig(_0x31bbb5){const _0x18a418=a200_0x15fafb,_0x629404=a200_0x51bbff['join'](_0x31bbb5,_0x18a418(0x1a9));if(!existsSync(_0x629404))return;const _0xd930b9=readConfigFile(_0x629404);if(_0xd930b9[_0x18a418(0x1ad)]&&typeof _0xd930b9['apps']===_0x18a418(0x1c2))return;const _0x5c890a=typeof _0xd930b9[_0x18a418(0x193)]==='string'?_0xd930b9[_0x18a418(0x193)]:typeof _0xd930b9['app']===_0x18a418(0x196)?_0xd930b9[_0x18a418(0x1b1)]:undefined;if(!_0x5c890a)return;_0xd930b9[_0x18a418(0x1ad)]={[_0x5c890a]:{'appcode':_0x5c890a}},_0xd930b9[_0x18a418(0x1ab)]=_0x5c890a,delete _0xd930b9[_0x18a418(0x1b1)],delete _0xd930b9[_0x18a418(0x193)],writeConfigFile(_0x629404,_0xd930b9);}function legacyApiPath(_0x2f66af,_0x28ae69){const _0x3abcf1=a200_0x15fafb,_0x5c4094=_0x28ae69[_0x3abcf1(0x1af)],_0x311f29=_0x2f66af[_0x3abcf1(0x1c1)]===0x1||_0x28ae69[_0x3abcf1(0x1b1)][_0x3abcf1(0x1bb)]?[a200_0x51bbff[_0x3abcf1(0x1c9)](_0x5c4094,_0x3abcf1(0x19e)),a200_0x51bbff[_0x3abcf1(0x1c9)](_0x5c4094,_0x28ae69[_0x3abcf1(0x1b1)][_0x3abcf1(0x19b)]+_0x3abcf1(0x198))]:[a200_0x51bbff['join'](_0x5c4094,_0x28ae69['app']['name']+'-api.ts')];return _0x311f29['find'](existsSync);}function writeCandidateOrEntrypoint(_0x4e65ed,_0x3589ea,_0x3e5885,_0x2d8ba4){const _0x635158=a200_0x15fafb;if(_0x3e5885[_0x635158(0x1a6)]===_0x635158(0x1d5)||_0x3e5885['action']===_0x635158(0x1bd))return;if(_0x3e5885[_0x635158(0x1a6)]===_0x635158(0x1a0)){const _0x5da3b8=_0x3e5885[_0x635158(0x1bc)];mkdirSync(a200_0x51bbff[_0x635158(0x1d8)](_0x5da3b8),{'recursive':!![]}),writeFileSync(_0x5da3b8,_0x2d8ba4,_0x635158(0x1e2));return;}if(_0x3e5885[_0x635158(0x1a6)]===_0x635158(0x1aa)){const _0x3b795e=backupPath(_0x4e65ed,_0x3589ea,a200_0x51bbff[_0x635158(0x1dc)](_0x3e5885[_0x635158(0x1ae)]));mkdirSync(a200_0x51bbff['dirname'](_0x3b795e),{'recursive':!![]}),copyFileSync(_0x3e5885[_0x635158(0x1ae)],_0x3b795e);}mkdirSync(a200_0x51bbff[_0x635158(0x1d8)](_0x3e5885[_0x635158(0x1ae)]),{'recursive':!![]}),writeFileSync(_0x3e5885[_0x635158(0x1ae)],_0x2d8ba4,_0x635158(0x1e2));}export async function upgradeProjectApiArchitecture(_0x20c49d){const _0x3846f5=a200_0x15fafb,_0x4df75e=analyzeProjectApiArchitecture(_0x20c49d);migrateSingleAppConfig(_0x20c49d);const _0x24de21=getMultiAppConfigs('project',_0x20c49d)??[],_0x54dac0=configuredLayouts(_0x20c49d,_0x24de21),{groups:_0x2f44ce}=uniqueRegistryGroups(_0x54dac0);let _0x3bff62;for(const _0x3a7533 of _0x2f44ce){const _0x29ee19=_0x3a7533[0x0][_0x3846f5(0x1af)];mkdirSync(_0x29ee19,{'recursive':!![]});const _0x16bd56=_0x3a7533[_0x3846f5(0x1cf)](_0x48b097=>_0x48b097[_0x3846f5(0x1b1)][_0x3846f5(0x1bb)])??_0x3a7533[0x0];for(const _0x572aa7 of _0x3a7533){const _0x474170=a200_0x51bbff['join'](_0x29ee19,MODEL_REGISTRY_FILE_NAME),_0x132a67=readModelRegistry(_0x474170);if(_0x132a67?.[_0x3846f5(0x1ce)][_0x572aa7['app'][_0x3846f5(0x19b)]])continue;const _0x41e520=legacyApiPath(_0x3a7533,_0x572aa7),_0x182cc3=_0x41e520?readOptional(_0x41e520):undefined;await initMultiAppEnvironment(_0x572aa7[_0x3846f5(0x1b1)]),updateModelRegistry({'outputDir':_0x29ee19,'profileName':_0x572aa7['app']['name'],'defaultProfile':_0x16bd56[_0x3846f5(0x1b1)]['name'],'appCode':_0x572aa7['app'][_0x3846f5(0x193)],'runtimeDomain':getRuntimeDomain(),'models':_0x182cc3?parseLegacyApiModels(_0x182cc3):[]});}const _0x5529c3=await renderModelRegistryScaffold(_0x29ee19,_0x20c49d),_0x38d809=planGroup(_0x20c49d,_0x3a7533);for(const _0x55defe of _0x38d809[_0x3846f5(0x1a4)]){const _0x7bb44c=a200_0x51bbff[_0x3846f5(0x1dc)](_0x55defe['path']);if(_0x7bb44c===_0x3846f5(0x19e))writeCandidateOrEntrypoint(_0x20c49d,_0x29ee19,_0x55defe,_0x5529c3[_0x3846f5(0x1c3)]);else{if(_0x7bb44c===_0x3846f5(0x19a))writeCandidateOrEntrypoint(_0x20c49d,_0x29ee19,_0x55defe,_0x5529c3[_0x3846f5(0x1a8)]);else{if(_0x7bb44c===MODEL_RUNTIME_FILE_NAME)writeCandidateOrEntrypoint(_0x20c49d,_0x29ee19,_0x55defe,_0x5529c3[_0x3846f5(0x1de)]);else _0x7bb44c===_0x3846f5(0x1da)&&_0x55defe[_0x3846f5(0x1a6)]===_0x3846f5(0x1b2)&&writeCandidateOrEntrypoint(_0x20c49d,_0x29ee19,_0x55defe,SDK_CONFIG_SOURCE);}}}}const _0x1f3c84=_0x24de21[_0x3846f5(0x1cf)](_0x1f247e=>_0x1f247e[_0x3846f5(0x1bb)])??_0x24de21[0x0];_0x1f3c84&&(await initMultiAppEnvironment(_0x1f3c84),_0x3bff62=writeProjectDomainRoutingManifest(_0x20c49d)[_0x3846f5(0x1ae)]);const _0x11992f=analyzeProjectApiArchitecture(_0x20c49d);return{..._0x4df75e,'completed':!_0x11992f[_0x3846f5(0x1a2)],'manualMergeRequired':_0x11992f[_0x3846f5(0x1a2)],'routingPath':_0x3bff62};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a201_0x5d78(){const _0xd835c7=['117Typzfz','315678cZzPEd','Login\x20failed','229373gOFpaQ','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','Not\x20set','524BOvDxL','1339232eVBvnk','Directory\x20\x22','cwd','green','my-app','283850ejfQsZ','resolve','√\x20App\x20Code:\x20','√\x20Login\x20status:\x20','log','Project\x20name:','production','154JYcvrI','106554bYlSIW','Skipped','env','√\x20Project\x20Name:\x20','8315KLWVzC','611596RpXzwG','\x22\x20already\x20exists','cyan'];a201_0x5d78=function(){return _0xd835c7;};return a201_0x5d78();}function a201_0x480e(_0x3c2ba5,_0x336977){_0x3c2ba5=_0x3c2ba5-0x1e0;const _0x5d785b=a201_0x5d78();let _0x480e8f=_0x5d785b[_0x3c2ba5];return _0x480e8f;}(function(_0x1b2485,_0x97192f){const _0x60669b=a201_0x480e,_0xf16d6b=_0x1b2485();while(!![]){try{const _0x1fe3b6=parseInt(_0x60669b(0x1e3))/0x1+-parseInt(_0x60669b(0x1f9))/0x2+-parseInt(_0x60669b(0x1e1))/0x3+parseInt(_0x60669b(0x1e6))/0x4*(parseInt(_0x60669b(0x1f8))/0x5)+parseInt(_0x60669b(0x1f4))/0x6*(parseInt(_0x60669b(0x1f3))/0x7)+parseInt(_0x60669b(0x1e7))/0x8+parseInt(_0x60669b(0x1e0))/0x9*(-parseInt(_0x60669b(0x1ec))/0xa);if(_0x1fe3b6===_0x97192f)break;else _0xf16d6b['push'](_0xf16d6b['shift']());}catch(_0x65018d){_0xf16d6b['push'](_0xf16d6b['shift']());}}}(a201_0x5d78,0x37013));import{existsSync}from'node:fs';import a201_0x51038b from'node:path';import a201_0x3e8e97 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getProjectNameValidationError}from'../../../commands/project/create/project-name.js';export async function guidedCreateProject(_0x1dbafd,_0x4a8274,_0x1c9927){const _0x560cd1=a201_0x480e,_0x2e63d2=_0x560cd1(0x1eb),_0x24070e=readConfig(),_0x19fcd9=typeof _0x24070e[_0x560cd1(0x1f6)]==='string'?_0x24070e['env']:undefined,_0xd7b8e=await input({'message':_0x560cd1(0x1f1),'default':_0x2e63d2,'validate':_0x8bc337=>{const _0x37d68b=_0x560cd1,_0x8b8219=_0x8bc337['trim']()||_0x2e63d2,_0x53ca45=getProjectNameValidationError(_0x8b8219);if(_0x53ca45)return _0x53ca45;const _0x55e413=a201_0x51038b[_0x37d68b(0x1ed)](process[_0x37d68b(0x1e9)](),_0x8b8219);if(existsSync(_0x55e413))return _0x37d68b(0x1e8)+_0x8b8219+_0x37d68b(0x1fa);return!![];}});console[_0x560cd1(0x1f0)](a201_0x3e8e97[_0x560cd1(0x1ea)](_0x560cd1(0x1f7)+a201_0x3e8e97[_0x560cd1(0x1fb)](_0xd7b8e)));const _0x2dcca5=await selectSingleAppcode(_0x1c9927);console[_0x560cd1(0x1f0)](a201_0x3e8e97[_0x560cd1(0x1ea)](_0x560cd1(0x1ee)+a201_0x3e8e97[_0x560cd1(0x1fb)](_0x2dcca5||_0x560cd1(0x1e5))));if(_0x2dcca5){const _0x117e71=await getIsSessionValid();if(!_0x117e71){const _0x40790f=await confirm({'message':_0x560cd1(0x1e4),'default':!![]});if(_0x40790f){const _0x1a3a2b=await authServer({'silent':!![]});console[_0x560cd1(0x1f0)](a201_0x3e8e97[_0x560cd1(0x1ea)](_0x560cd1(0x1ef)+a201_0x3e8e97['cyan'](_0x1a3a2b?'Logged\x20in':_0x560cd1(0x1e2))));}else console[_0x560cd1(0x1f0)](a201_0x3e8e97[_0x560cd1(0x1ea)]('√\x20Login\x20status:\x20'+a201_0x3e8e97[_0x560cd1(0x1fb)](_0x560cd1(0x1f5))));}await _0x1dbafd({'projectName':_0xd7b8e,'appCode':_0x2dcca5,'env':_0x4a8274||_0x19fcd9||_0x560cd1(0x1f2)});}else await _0x1dbafd({'projectName':_0xd7b8e,'env':_0x4a8274||_0x19fcd9||_0x560cd1(0x1f2)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a202_0x4025(_0x37f5ce,_0x443ae7){_0x37f5ce=_0x37f5ce-0x19a;const _0x72a8d7=a202_0x72a8();let _0x402588=_0x72a8d7[_0x37f5ce];return _0x402588;}function a202_0x72a8(){const _0x574c2e=['14035LLxJXq','721888QoAEQH','15OWZBhk','2DyWNdX','472rEOrfi','toFixed','2366744kxQUsE','3171111HtkQvN','now','8296308UFpFta','1405818BBXplM','21134380gNTSmE'];a202_0x72a8=function(){return _0x574c2e;};return a202_0x72a8();}(function(_0x46f555,_0x18d92a){const _0x583c6d=a202_0x4025,_0x292101=_0x46f555();while(!![]){try{const _0x26a8d4=-parseInt(_0x583c6d(0x1a1))/0x1+parseInt(_0x583c6d(0x1a3))/0x2*(parseInt(_0x583c6d(0x19b))/0x3)+parseInt(_0x583c6d(0x19a))/0x4+-parseInt(_0x583c6d(0x1a2))/0x5*(-parseInt(_0x583c6d(0x19e))/0x6)+parseInt(_0x583c6d(0x1a0))/0x7*(parseInt(_0x583c6d(0x1a4))/0x8)+parseInt(_0x583c6d(0x19d))/0x9+-parseInt(_0x583c6d(0x19f))/0xa;if(_0x26a8d4===_0x18d92a)break;else _0x292101['push'](_0x292101['shift']());}catch(_0x4f15ba){_0x292101['push'](_0x292101['shift']());}}}(a202_0x72a8,0x87d7d));export function formatElapsed(_0x3efea2){const _0x46aa21=a202_0x4025,_0x538229=Date[_0x46aa21(0x19c)]()-_0x3efea2;if(_0x538229<0x3e8)return _0x538229+'ms';const _0x1e5159=(_0x538229/0x3e8)[_0x46aa21(0x1a5)](0x2),_0x3b300a=_0x1e5159['replace'](/\.?0+$/u,'');return _0x3b300a+'s';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x43c6de,_0x2d5218){const _0x3c4e8d=a203_0x51bd,_0x1b85bb=_0x43c6de();while(!![]){try{const _0x30bb5c=parseInt(_0x3c4e8d(0x18a))/0x1*(parseInt(_0x3c4e8d(0x168))/0x2)+parseInt(_0x3c4e8d(0x122))/0x3*(-parseInt(_0x3c4e8d(0x152))/0x4)+parseInt(_0x3c4e8d(0x17b))/0x5+parseInt(_0x3c4e8d(0x17a))/0x6*(-parseInt(_0x3c4e8d(0x18d))/0x7)+-parseInt(_0x3c4e8d(0x173))/0x8+-parseInt(_0x3c4e8d(0x124))/0x9*(-parseInt(_0x3c4e8d(0x14e))/0xa)+parseInt(_0x3c4e8d(0x137))/0xb*(-parseInt(_0x3c4e8d(0x165))/0xc);if(_0x30bb5c===_0x2d5218)break;else _0x1b85bb['push'](_0x1b85bb['shift']());}catch(_0xcd9ae7){_0x1b85bb['push'](_0x1b85bb['shift']());}}}(a203_0x5e59,0x54310));import a203_0x4b7179 from'path';function a203_0x51bd(_0x20ad57,_0x2ab928){_0x20ad57=_0x20ad57-0x112;const _0x5e5921=a203_0x5e59();let _0x51bda0=_0x5e5921[_0x20ad57];return _0x51bda0;}import a203_0xe2f7d4 from'fs';import a203_0x545b1b from'chalk';import a203_0xec3469 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';function a203_0x5e59(){const _0x368f89=['templateSource','chdir','stableVersion','√\x20Configuration\x20file\x20created,\x20Apps:\x20','API\x20configuration\x20pulled:\x20','Project\x20creation\x20failed:\x20','Project\x20template\x20ready','Format\x20code','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','107511FnzeMU','env','81hLNcre','package.json','Resolving\x20project\x20template','API\x20configuration\x20pull\x20failed','Copying\x20local\x20template\x20source','\x20api\x20pull\x20--force\x20--yes','needsUpgrade','length','...','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','\x20already\x20exists','mkdtempSync','\x20dataset(s),\x20generated\x20','\x20\x202.\x20Pull\x20API\x20configuration:\x20','reverse','W_OK','project','string','message','11QlCkZw','description','success','currentVersion','projectName','.rabetbase-create-','stringify','name','The\x20current\x20directory\x20must\x20be\x20empty.','cd\x20','existsSync','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','\x20|\x20AppCode:\x20','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','Install\x20dependencies','stop','🚀\x20Next\x20Steps:','fail','isDirectory','belowMinimum','info','create','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','722990rfZLjl','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','√\x20package.json\x20updated:\x20name=','log','56pbZOPc','CLI\x20version\x20check','Downloading\x20project\x20template','warn','copying','text','Failed\x20to\x20update\x20package.json','resolve','\x20\x201.\x20Start\x20project:\x20','projectCode','production','green','\x20model(s)','Project\x20created:\x20','modelCount','lstatSync','Extracting\x20project\x20template','error','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','5662284MvKilB','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','\x20&&\x20','1180474haJEXp','Configured\x20app\x20AppCode:\x20','\x20Generated\x20by\x20rabetbase\x20cli\x20','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.','readFileSync','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','cwd','\x20run\x20start','Project\x20directory\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','538224vKbEwS','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','keys','renameSync','ino','Failed\x20to\x20configure\x20app\x20AppCode','1.0.0','6RnVWId','1225790QkKioZ','appCode','rmSync','readdirSync','apps','cookie','\x20|\x20Default:\x20implicit\x20(single\x20app)','basename','relative','√\x20Pulled\x20','cyan','join','dev','parse','repeat','1TlLRRP','validation','version','702695Nbqfoy','push','utf8','resolving','minimumVersion','verifying','toLocaleString','bold','currentDir','\x20√\x20','Verifying\x20project\x20template'];a203_0x5e59=function(){return _0x368f89;};return a203_0x5e59();}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(_0x10bf9c){const _0x365bc8=a203_0x51bd;try{const _0xc0a5c5=a203_0xe2f7d4[_0x365bc8(0x161)](_0x10bf9c);if(!_0xc0a5c5[_0x365bc8(0x149)]())return null;return{'dev':_0xc0a5c5[_0x365bc8(0x187)],'ino':_0xc0a5c5[_0x365bc8(0x177)]};}catch{return null;}}function isSameDirectory(_0x286c77,_0x2ae2d8){const _0x32dded=a203_0x51bd;return!!_0x286c77&&!!_0x2ae2d8&&_0x286c77['dev']===_0x2ae2d8[_0x32dded(0x187)]&&_0x286c77[_0x32dded(0x177)]===_0x2ae2d8[_0x32dded(0x177)];}function commitCurrentDirectoryProject(_0x255819,_0x5bb2f4,_0x32d899){const _0xe3e400=a203_0x51bd;if(!isSameDirectory(readDirectoryIdentity(_0x255819),_0x32d899))throw new Error(_0xe3e400(0x16e));const _0x538774=a203_0x4b7179[_0xe3e400(0x182)](_0x5bb2f4),_0x404868=a203_0xe2f7d4['readdirSync'](_0x255819);if(_0x404868[_0xe3e400(0x12b)]!==0x1||_0x404868[0x0]!==_0x538774)throw CliErrors[_0xe3e400(0x18b)](_0xe3e400(0x16c),_0xe3e400(0x144));const _0x2038ad=a203_0x4b7179['join'](_0x5bb2f4,_0xe3e400(0x134)),_0x539af1=[];try{for(const _0x3b11bd of a203_0xe2f7d4[_0xe3e400(0x17e)](_0x2038ad)){a203_0xe2f7d4[_0xe3e400(0x176)](a203_0x4b7179[_0xe3e400(0x186)](_0x2038ad,_0x3b11bd),a203_0x4b7179[_0xe3e400(0x186)](_0x255819,_0x3b11bd)),_0x539af1[_0xe3e400(0x18e)](_0x3b11bd);}a203_0xe2f7d4[_0xe3e400(0x17d)](_0x5bb2f4,{'recursive':!![],'force':!![]});}catch(_0x5b85bc){for(const _0x20c699 of _0x539af1[_0xe3e400(0x132)]()){const _0x4b3e0c=a203_0x4b7179[_0xe3e400(0x186)](_0x255819,_0x20c699);if(!a203_0xe2f7d4['existsSync'](_0x4b3e0c))continue;a203_0xe2f7d4[_0xe3e400(0x176)](_0x4b3e0c,a203_0x4b7179[_0xe3e400(0x186)](_0x2038ad,_0x20c699));}throw _0x5b85bc;}}export async function createApp(_0x2108b7){const _0x3f68d8=a203_0x51bd,_0x3ecde2=await checkCliVersion();(_0x3ecde2[_0x3f68d8(0x12a)]||_0x3ecde2[_0x3f68d8(0x14a)])&&(printCliUpgradeWarning(_0x3ecde2),assertCliVersionSupported(_0x3ecde2),logger['info'](_0x3f68d8(0x14c),_0x3f68d8(0x153),{'currentVersion':_0x3ecde2[_0x3f68d8(0x13a)],'stableVersion':_0x3ecde2[_0x3f68d8(0x11b)],'minimumVersion':_0x3ecde2[_0x3f68d8(0x112)],'needsUpgrade':_0x3ecde2[_0x3f68d8(0x12a)],'belowMinimum':_0x3ecde2[_0x3f68d8(0x14a)]}));const _0x37713c=_0x2108b7[_0x3f68d8(0x116)]?a203_0x4b7179['basename'](process[_0x3f68d8(0x16f)]()):_0x2108b7[_0x3f68d8(0x15b)];if(_0x37713c&&(_0x2108b7[_0x3f68d8(0x17c)]||_0x2108b7['nonInteractive']))await runCreate({'projectName':_0x37713c,'appCode':_0x2108b7[_0x3f68d8(0x17c)],'env':_0x2108b7[_0x3f68d8(0x123)]},_0x2108b7);else{if(_0x37713c){const _0x4b3139=await selectSingleAppcode(_0x2108b7[_0x3f68d8(0x180)]);await runCreate({'projectName':_0x37713c,'appCode':_0x4b3139||undefined,'env':_0x2108b7[_0x3f68d8(0x123)]},_0x2108b7);}else await guidedCreateProject(_0x16faac=>runCreate(_0x16faac,_0x2108b7),_0x2108b7[_0x3f68d8(0x123)],_0x2108b7[_0x3f68d8(0x180)]);}}async function runCreate(_0x2b3303,_0x4617ee){const _0x3d853=a203_0x51bd;_0x2b3303[_0x3d853(0x13b)]=validateProjectName(_0x2b3303['projectName']);const _0x3eb39c=_0x4617ee[_0x3d853(0x116)]?process['cwd']():a203_0x4b7179['resolve'](process[_0x3d853(0x16f)](),_0x2b3303[_0x3d853(0x13b)]);if(_0x4617ee[_0x3d853(0x116)]){if(a203_0xe2f7d4['readdirSync'](_0x3eb39c)[_0x3d853(0x12b)]>0x0)throw CliErrors['validation'](_0x3d853(0x13f),_0x3d853(0x142));}else{if(a203_0xe2f7d4[_0x3d853(0x141)](_0x3eb39c))throw new Error(_0x3d853(0x171)+_0x2b3303[_0x3d853(0x13b)]+_0x3d853(0x12e));}let _0x28758d=null;const _0x24a52b=_0x4617ee[_0x3d853(0x116)]?readDirectoryIdentity(_0x3eb39c):null;let _0x53bdea=null;try{a203_0xe2f7d4['accessSync'](a203_0x4b7179['dirname'](_0x3eb39c),a203_0xe2f7d4['constants'][_0x3d853(0x133)]);}catch{throw new Error(_0x3d853(0x174));}logger[_0x3d853(0x14b)](_0x3d853(0x14c),'Starting\x20project\x20creation:\x20'+_0x2b3303['projectName'],{'projectDir':_0x3eb39c,'appCode':_0x2b3303['appCode']}),console['log'](),console['log'](a203_0x545b1b[_0x3d853(0x15d)](_0x3d853(0x117))+'Project\x20name:\x20'+a203_0x545b1b[_0x3d853(0x15d)](_0x2b3303[_0x3d853(0x13b)])+(_0x2b3303[_0x3d853(0x17c)]?_0x3d853(0x143)+a203_0x545b1b[_0x3d853(0x185)](_0x2b3303[_0x3d853(0x17c)]):''));try{let _0x544cb7=_0x2b3303[_0x3d853(0x13b)];_0x4617ee[_0x3d853(0x116)]&&(_0x53bdea=a203_0xe2f7d4[_0x3d853(0x12f)](a203_0x4b7179['join'](_0x3eb39c,_0x3d853(0x13c))),_0x544cb7=a203_0x4b7179[_0x3d853(0x183)](process['cwd'](),a203_0x4b7179[_0x3d853(0x186)](_0x53bdea,'project')));const _0xde08b2=a203_0x4b7179[_0x3d853(0x159)](process['cwd'](),_0x544cb7);await runTask(_0x3d853(0x126),_0x2aa33d=>copyProjectTemplate(_0x544cb7,_0x208405=>_0x2aa33d(projectTemplateStageLabel(_0x208405)),_0x4617ee[_0x3d853(0x119)]),_0x3d853(0x11f)),_0x28758d=_0x4617ee[_0x3d853(0x116)]?null:readDirectoryIdentity(_0x3eb39c);if(!_0x4617ee['currentDir']&&!_0x28758d)throw new Error(_0x3d853(0x14d));await updatePackageJsonName(_0x544cb7,_0x2b3303['projectName']),await runTask(_0x3d853(0x145),()=>installDependencies(_0x544cb7)),await runTask(_0x3d853(0x120),()=>formatProjectCode(_0x544cb7)),await configureAppCode(_0x544cb7,_0x2b3303[_0x3d853(0x13b)],_0x2b3303['appCode']||'',_0x2b3303[_0x3d853(0x123)]);let _0x36be2f=![];if(_0x2b3303['appCode']){console[_0x3d853(0x151)]('*\x20Pulling\x20API\x20configuration...');const _0x166c16=process['cwd']();try{process[_0x3d853(0x11a)](_0xde08b2);const _0x4767cd=_0x2b3303[_0x3d853(0x123)]||_0x3d853(0x15c);initEnv(_0x4767cd);const {configArray:_0x2a0839}=await fetchModelList(_0x2b3303[_0x3d853(0x17c)],_0x4617ee[_0x3d853(0x180)]||''),_0x386235=DEFAULT_API_DIR,_0x3d540f=await generateApiFile(_0x2a0839,'',_0x2b3303[_0x3d853(0x17c)],!![],_0x4767cd,_0x386235,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![],'modelProfile':{'name':_0x2b3303[_0x3d853(0x17c)],'defaultName':_0x2b3303['appCode'],'runtimeDomain':getRuntimeDomain()}});console[_0x3d853(0x151)](_0x3d853(0x184)+_0x2a0839['length']+_0x3d853(0x130)+_0x3d540f[_0x3d853(0x160)]+_0x3d853(0x15e)),logger[_0x3d853(0x14b)](_0x3d853(0x14c),_0x3d853(0x11d)+_0x2b3303['appCode']);}catch(_0x423632){_0x36be2f=!![],console[_0x3d853(0x151)]('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20'+CLI_BIN_NAME+'\x20api\x20pull\x20--force\x20--yes'),logger[_0x3d853(0x155)]('create',_0x3d853(0x127),{'error':_0x423632 instanceof Error?_0x423632['message']:String(_0x423632)});}finally{process['chdir'](_0x166c16);}}if(_0x4617ee[_0x3d853(0x116)]){if(!_0x53bdea||!_0x24a52b)throw new Error(_0x3d853(0x16b));commitCurrentDirectoryProject(_0x3eb39c,_0x53bdea,_0x24a52b),_0x53bdea=null;}try{logger['setLogPath'](_0x3eb39c),logger[_0x3d853(0x139)](_0x3d853(0x14c),_0x3d853(0x15f)+_0x2b3303[_0x3d853(0x13b)]);}catch(_0x195e11){console[_0x3d853(0x155)](_0x3d853(0x12d)+(_0x195e11 instanceof Error?_0x195e11['message']:String(_0x195e11)));}console[_0x3d853(0x151)](),console[_0x3d853(0x151)](a203_0x545b1b['green']('─'[_0x3d853(0x189)](0x3c))),console[_0x3d853(0x151)](a203_0x545b1b[_0x3d853(0x185)][_0x3d853(0x115)](_0x3d853(0x147))),console[_0x3d853(0x151)]();const _0x5afb59=_0x4617ee[_0x3d853(0x116)]?CLI_BIN_NAME+_0x3d853(0x170):_0x3d853(0x140)+_0x2b3303[_0x3d853(0x13b)]+_0x3d853(0x167)+CLI_BIN_NAME+_0x3d853(0x170);console[_0x3d853(0x151)](_0x3d853(0x15a)+a203_0x545b1b[_0x3d853(0x185)][_0x3d853(0x115)](_0x5afb59)),_0x36be2f&&console[_0x3d853(0x151)](_0x3d853(0x131)+a203_0x545b1b[_0x3d853(0x185)][_0x3d853(0x115)](CLI_BIN_NAME+_0x3d853(0x129))),console['log'](a203_0x545b1b[_0x3d853(0x15d)]('─'[_0x3d853(0x189)](0x3c)));}catch(_0x566ea1){logger[_0x3d853(0x163)](_0x3d853(0x14c),_0x3d853(0x11e)+_0x2b3303[_0x3d853(0x13b)],{'error':_0x566ea1 instanceof Error?_0x566ea1[_0x3d853(0x136)]:String(_0x566ea1)});try{const _0x188a8a=readDirectoryIdentity(_0x3eb39c);if(_0x4617ee[_0x3d853(0x116)]&&_0x53bdea)a203_0xe2f7d4['rmSync'](_0x53bdea,{'recursive':!![],'force':!![]});else{if(_0x28758d&&_0x188a8a?.[_0x3d853(0x187)]===_0x28758d[_0x3d853(0x187)]&&_0x188a8a[_0x3d853(0x177)]===_0x28758d[_0x3d853(0x177)])console[_0x3d853(0x151)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x3eb39c),a203_0xe2f7d4[_0x3d853(0x17d)](_0x3eb39c,{'recursive':!![],'force':!![]});else _0x188a8a&&logger[_0x3d853(0x155)]('create',_0x3d853(0x121)+_0x3eb39c);}}catch{logger[_0x3d853(0x155)]('create',_0x3d853(0x164)+_0x3eb39c);}throw _0x566ea1;}}async function runTask(_0x41767d,_0x3d6d0f,_0x15b0f8=_0x41767d){const _0x56b36b=a203_0x51bd,_0x5e1c42=a203_0xec3469(_0x41767d+_0x56b36b(0x12c))['start']();try{const _0x2d2cde=await _0x3d6d0f(_0x4baa30=>{const _0x4d65c7=_0x56b36b;_0x5e1c42[_0x4d65c7(0x157)]=_0x4baa30+_0x4d65c7(0x12c);});_0x5e1c42[_0x56b36b(0x146)](),console[_0x56b36b(0x151)](''+a203_0x545b1b[_0x56b36b(0x15d)](_0x56b36b(0x117))+_0x15b0f8+'\x20'+a203_0x545b1b['gray']('['+_0x2d2cde+']'));}catch(_0x397516){_0x5e1c42[_0x56b36b(0x148)](_0x41767d);throw _0x397516;}}function projectTemplateStageLabel(_0xf70cba){const _0x463e9=a203_0x51bd;switch(_0xf70cba){case _0x463e9(0x190):return _0x463e9(0x126);case'downloading':return _0x463e9(0x154);case _0x463e9(0x113):return _0x463e9(0x118);case'extracting':return _0x463e9(0x162);case _0x463e9(0x156):return _0x463e9(0x128);}}async function updatePackageJsonName(_0x5aaae7,_0x4aa931){const _0x106029=a203_0x51bd,_0x5a3395=a203_0x4b7179[_0x106029(0x159)](process['cwd'](),_0x5aaae7),_0x2b6834=a203_0x4b7179[_0x106029(0x186)](_0x5a3395,_0x106029(0x125));try{console[_0x106029(0x151)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x367b05=getRabetbaseCliPackageRoot(),_0x1fb920=a203_0x4b7179[_0x106029(0x186)](_0x367b05,'package.json');let _0x110f49=_0x106029(0x179);try{const _0xc64bbb=JSON[_0x106029(0x188)](a203_0xe2f7d4[_0x106029(0x16d)](_0x1fb920,_0x106029(0x18f)));_0x110f49=_0xc64bbb[_0x106029(0x18c)]||_0x106029(0x179);}catch{}const _0x5c8692=a203_0xe2f7d4['readFileSync'](_0x2b6834,'utf8'),_0x4a0a09=JSON[_0x106029(0x188)](_0x5c8692);_0x4a0a09[_0x106029(0x13e)]=_0x4aa931,_0x4a0a09[_0x106029(0x138)]=_0x4aa931+_0x106029(0x16a)+_0x110f49,a203_0xe2f7d4['writeFileSync'](_0x2b6834,JSON[_0x106029(0x13d)](_0x4a0a09,null,0x2)+'\x0a',_0x106029(0x18f)),console['log'](_0x106029(0x150)+_0x4aa931),logger[_0x106029(0x14b)](_0x106029(0x14c),'Updating\x20package.json\x20name');}catch(_0xf9300b){logger['error'](_0x106029(0x14c),_0x106029(0x158));throw _0xf9300b;}}async function configureAppCode(_0x576750,_0x4367f7,_0x2ad168,_0x4e2e1d){const _0x1ff0a2=a203_0x51bd,_0x426a19=a203_0x4b7179['resolve'](process[_0x1ff0a2(0x16f)](),_0x576750),_0x522b72=a203_0x4b7179[_0x1ff0a2(0x186)](_0x426a19,NEW_CONFIG_NAME);try{_0x2ad168?console['log']('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x4367f7+':\x20'+_0x2ad168):console['log'](_0x1ff0a2(0x166)+_0x4367f7);const _0x3b9a8d=getRabetbaseCliPackageRoot(),_0x40c6a0=a203_0x4b7179[_0x1ff0a2(0x186)](_0x3b9a8d,_0x1ff0a2(0x125));let _0x46783e=_0x1ff0a2(0x179);try{const _0xa3633e=JSON['parse'](a203_0xe2f7d4[_0x1ff0a2(0x16d)](_0x40c6a0,'utf8'));_0x46783e=_0xa3633e[_0x1ff0a2(0x18c)]||_0x1ff0a2(0x179);}catch{}const {globalConfig:_0x1f1b4b}=loadRawConfigLayers(),_0x411348=typeof _0x1f1b4b[_0x1ff0a2(0x123)]===_0x1ff0a2(0x135)?_0x1f1b4b[_0x1ff0a2(0x123)]:undefined,_0x39c83c={};for(const _0x56b271 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1f1b4b[_0x56b271]!=null)_0x39c83c[_0x56b271]=_0x1f1b4b[_0x56b271];}const _0x449e67=buildCanonicalProjectConfig(_0x39c83c,{'appCodes':_0x2ad168?[_0x2ad168]:[],'env':_0x4e2e1d||_0x411348||_0x1ff0a2(0x15c),'metadata':{'createdAt':new Date()[_0x1ff0a2(0x114)](),'version':_0x46783e}});writeConfigFile(_0x522b72,_0x449e67),await generateSdkConfigFile(a203_0x4b7179['join'](_0x426a19,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x426a19),_0x2ad168?console[_0x1ff0a2(0x151)](_0x1ff0a2(0x11c)+Object[_0x1ff0a2(0x175)](_0x449e67[_0x1ff0a2(0x17f)]||{})['join'](',\x20')+_0x1ff0a2(0x181)):console[_0x1ff0a2(0x151)](_0x1ff0a2(0x14f)+CLI_BIN_NAME+_0x1ff0a2(0x172)),logger[_0x1ff0a2(0x14b)](_0x1ff0a2(0x14c),_0x1ff0a2(0x169)+_0x2ad168);}catch(_0x514912){logger[_0x1ff0a2(0x163)](_0x1ff0a2(0x14c),_0x1ff0a2(0x178));throw _0x514912;}}
|
|
1
|
+
(function(_0xc512f5,_0xe7aab5){const _0x2ae541=a203_0x5bb8,_0x36a911=_0xc512f5();while(!![]){try{const _0x11bdda=-parseInt(_0x2ae541(0x19e))/0x1*(parseInt(_0x2ae541(0x1b6))/0x2)+-parseInt(_0x2ae541(0x1d2))/0x3*(parseInt(_0x2ae541(0x1ae))/0x4)+-parseInt(_0x2ae541(0x1e9))/0x5+-parseInt(_0x2ae541(0x1f2))/0x6+-parseInt(_0x2ae541(0x1b0))/0x7+parseInt(_0x2ae541(0x198))/0x8*(-parseInt(_0x2ae541(0x1ee))/0x9)+-parseInt(_0x2ae541(0x1e6))/0xa*(-parseInt(_0x2ae541(0x1ab))/0xb);if(_0x11bdda===_0xe7aab5)break;else _0x36a911['push'](_0x36a911['shift']());}catch(_0x5b19d8){_0x36a911['push'](_0x36a911['shift']());}}}(a203_0x38bb,0x2841e));import a203_0x3cf9f7 from'path';import a203_0x443a08 from'fs';import a203_0x765d62 from'chalk';import a203_0x2fedf6 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';function a203_0x5bb8(_0x29c90b,_0x10f462){_0x29c90b=_0x29c90b-0x182;const _0x38bb5a=a203_0x38bb();let _0x5bb862=_0x38bb5a[_0x29c90b];return _0x5bb862;}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(_0x4b658a){const _0x218218=a203_0x5bb8;try{const _0x378dff=a203_0x443a08[_0x218218(0x185)](_0x4b658a);if(!_0x378dff[_0x218218(0x1a6)]())return null;return{'dev':_0x378dff[_0x218218(0x1f5)],'ino':_0x378dff[_0x218218(0x1a3)]};}catch{return null;}}function isSameDirectory(_0x306d30,_0x2cd127){const _0x57e0a5=a203_0x5bb8;return!!_0x306d30&&!!_0x2cd127&&_0x306d30['dev']===_0x2cd127[_0x57e0a5(0x1f5)]&&_0x306d30[_0x57e0a5(0x1a3)]===_0x2cd127[_0x57e0a5(0x1a3)];}function commitCurrentDirectoryProject(_0x352015,_0x154337,_0xcf53e2){const _0x7c86ec=a203_0x5bb8;if(!isSameDirectory(readDirectoryIdentity(_0x352015),_0xcf53e2))throw new Error(_0x7c86ec(0x1d5));const _0x47d1c0=a203_0x3cf9f7['basename'](_0x154337),_0x47fcb6=a203_0x443a08[_0x7c86ec(0x1b2)](_0x352015);if(_0x47fcb6[_0x7c86ec(0x190)]!==0x1||_0x47fcb6[0x0]!==_0x47d1c0)throw CliErrors[_0x7c86ec(0x1be)](_0x7c86ec(0x1d3),_0x7c86ec(0x1c6));const _0x55e540=a203_0x3cf9f7[_0x7c86ec(0x199)](_0x154337,_0x7c86ec(0x194)),_0x30099f=[];try{for(const _0x3907ac of a203_0x443a08[_0x7c86ec(0x1b2)](_0x55e540)){a203_0x443a08[_0x7c86ec(0x1eb)](a203_0x3cf9f7['join'](_0x55e540,_0x3907ac),a203_0x3cf9f7[_0x7c86ec(0x199)](_0x352015,_0x3907ac)),_0x30099f[_0x7c86ec(0x193)](_0x3907ac);}a203_0x443a08[_0x7c86ec(0x1a0)](_0x154337,{'recursive':!![],'force':!![]});}catch(_0x1734de){for(const _0x46119c of _0x30099f[_0x7c86ec(0x1c4)]()){const _0x35d329=a203_0x3cf9f7['join'](_0x352015,_0x46119c);if(!a203_0x443a08[_0x7c86ec(0x1c8)](_0x35d329))continue;a203_0x443a08[_0x7c86ec(0x1eb)](_0x35d329,a203_0x3cf9f7['join'](_0x55e540,_0x46119c));}throw _0x1734de;}}export async function createApp(_0x332d81){const _0x58ca21=a203_0x5bb8,_0x11ce36=await checkCliVersion();(_0x11ce36[_0x58ca21(0x1ef)]||_0x11ce36[_0x58ca21(0x1d0)])&&(printCliUpgradeWarning(_0x11ce36),assertCliVersionSupported(_0x11ce36),logger[_0x58ca21(0x18e)](_0x58ca21(0x1c2),'CLI\x20version\x20check',{'currentVersion':_0x11ce36[_0x58ca21(0x196)],'stableVersion':_0x11ce36[_0x58ca21(0x1c0)],'minimumVersion':_0x11ce36['minimumVersion'],'needsUpgrade':_0x11ce36[_0x58ca21(0x1ef)],'belowMinimum':_0x11ce36['belowMinimum']}));const _0x4e229c=_0x332d81['currentDir']?a203_0x3cf9f7[_0x58ca21(0x1d6)](process[_0x58ca21(0x1e4)]()):_0x332d81[_0x58ca21(0x1ba)];if(_0x4e229c&&(_0x332d81[_0x58ca21(0x18f)]||_0x332d81['nonInteractive']))await runCreate({'projectName':_0x4e229c,'appCode':_0x332d81[_0x58ca21(0x18f)],'env':_0x332d81[_0x58ca21(0x1bc)]},_0x332d81);else{if(_0x4e229c){const _0x229541=await selectSingleAppcode(_0x332d81['cookie']);await runCreate({'projectName':_0x4e229c,'appCode':_0x229541||undefined,'env':_0x332d81[_0x58ca21(0x1bc)]},_0x332d81);}else await guidedCreateProject(_0x26c134=>runCreate(_0x26c134,_0x332d81),_0x332d81[_0x58ca21(0x1bc)],_0x332d81['cookie']);}}async function runCreate(_0x1dcce2,_0x2c6da5){const _0x69c5e5=a203_0x5bb8;_0x1dcce2[_0x69c5e5(0x1cb)]=validateProjectName(_0x1dcce2[_0x69c5e5(0x1cb)]);const _0x8aa220=_0x2c6da5[_0x69c5e5(0x1d7)]?process['cwd']():a203_0x3cf9f7[_0x69c5e5(0x1ca)](process[_0x69c5e5(0x1e4)](),_0x1dcce2[_0x69c5e5(0x1cb)]);if(_0x2c6da5[_0x69c5e5(0x1d7)]){if(a203_0x443a08['readdirSync'](_0x8aa220)[_0x69c5e5(0x190)]>0x0)throw CliErrors[_0x69c5e5(0x1be)](_0x69c5e5(0x189),_0x69c5e5(0x1e2));}else{if(a203_0x443a08[_0x69c5e5(0x1c8)](_0x8aa220))throw new Error(_0x69c5e5(0x1cd)+_0x1dcce2['projectName']+_0x69c5e5(0x191));}let _0x5bc556=null;const _0x5443f1=_0x2c6da5[_0x69c5e5(0x1d7)]?readDirectoryIdentity(_0x8aa220):null;let _0x2001aa=null;try{a203_0x443a08[_0x69c5e5(0x1cc)](a203_0x3cf9f7[_0x69c5e5(0x1ea)](_0x8aa220),a203_0x443a08[_0x69c5e5(0x1f3)][_0x69c5e5(0x1af)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x69c5e5(0x18e)]('create',_0x69c5e5(0x1a4)+_0x1dcce2[_0x69c5e5(0x1cb)],{'projectDir':_0x8aa220,'appCode':_0x1dcce2[_0x69c5e5(0x18f)]}),console['log'](),console['log'](a203_0x765d62[_0x69c5e5(0x1f1)](_0x69c5e5(0x197))+'Project\x20name:\x20'+a203_0x765d62[_0x69c5e5(0x1f1)](_0x1dcce2[_0x69c5e5(0x1cb)])+(_0x1dcce2[_0x69c5e5(0x18f)]?_0x69c5e5(0x1e7)+a203_0x765d62[_0x69c5e5(0x1de)](_0x1dcce2['appCode']):''));try{let _0x558102=_0x1dcce2[_0x69c5e5(0x1cb)];_0x2c6da5[_0x69c5e5(0x1d7)]&&(_0x2001aa=a203_0x443a08[_0x69c5e5(0x184)](a203_0x3cf9f7[_0x69c5e5(0x199)](_0x8aa220,'.rabetbase-create-')),_0x558102=a203_0x3cf9f7['relative'](process[_0x69c5e5(0x1e4)](),a203_0x3cf9f7[_0x69c5e5(0x199)](_0x2001aa,_0x69c5e5(0x194))));const _0x354775=a203_0x3cf9f7['resolve'](process[_0x69c5e5(0x1e4)](),_0x558102);await runTask(_0x69c5e5(0x19f),_0x1430c3=>copyProjectTemplate(_0x558102,_0x4f91be=>_0x1430c3(projectTemplateStageLabel(_0x4f91be)),_0x2c6da5['templateSource']),_0x69c5e5(0x1a7)),_0x5bc556=_0x2c6da5[_0x69c5e5(0x1d7)]?null:readDirectoryIdentity(_0x8aa220);if(!_0x2c6da5[_0x69c5e5(0x1d7)]&&!_0x5bc556)throw new Error('Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory');await updatePackageJsonName(_0x558102,_0x1dcce2[_0x69c5e5(0x1cb)]),await runTask(_0x69c5e5(0x18b),()=>installDependencies(_0x558102)),await runTask(_0x69c5e5(0x18c),()=>formatProjectCode(_0x558102)),await configureAppCode(_0x558102,_0x1dcce2['projectName'],_0x1dcce2['appCode']||'',_0x1dcce2[_0x69c5e5(0x1bc)]);let _0xf5c09e=![];if(_0x1dcce2[_0x69c5e5(0x18f)]){console[_0x69c5e5(0x1df)]('*\x20Pulling\x20API\x20configuration...');const _0x2b6d32=process[_0x69c5e5(0x1e4)]();try{process['chdir'](_0x354775);const _0x5c9434=_0x1dcce2[_0x69c5e5(0x1bc)]||_0x69c5e5(0x19a);initEnv(_0x5c9434);const {configArray:_0x2698d5}=await fetchModelList(_0x1dcce2[_0x69c5e5(0x18f)],_0x2c6da5[_0x69c5e5(0x182)]||''),_0xe160c5=DEFAULT_API_DIR,_0x235fa2=await generateApiFile(_0x2698d5,'',_0x1dcce2['appCode'],!![],_0x5c9434,_0xe160c5,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![],'modelProfile':{'name':_0x1dcce2[_0x69c5e5(0x18f)],'defaultName':_0x1dcce2[_0x69c5e5(0x18f)],'runtimeDomain':getRuntimeDomain()}});console[_0x69c5e5(0x1df)](_0x69c5e5(0x1a8)+_0x2698d5[_0x69c5e5(0x190)]+_0x69c5e5(0x1d9)+_0x235fa2['modelCount']+_0x69c5e5(0x1ed)),logger[_0x69c5e5(0x18e)](_0x69c5e5(0x1c2),_0x69c5e5(0x1ce)+_0x1dcce2['appCode']);}catch(_0x5880e1){_0xf5c09e=!![],console[_0x69c5e5(0x1df)](_0x69c5e5(0x1f6)+CLI_BIN_NAME+_0x69c5e5(0x1f7)),logger['warn'](_0x69c5e5(0x1c2),_0x69c5e5(0x1e1),{'error':_0x5880e1 instanceof Error?_0x5880e1[_0x69c5e5(0x1aa)]:String(_0x5880e1)});}finally{process[_0x69c5e5(0x1b5)](_0x2b6d32);}}if(_0x2c6da5[_0x69c5e5(0x1d7)]){if(!_0x2001aa||!_0x5443f1)throw new Error(_0x69c5e5(0x19d));commitCurrentDirectoryProject(_0x8aa220,_0x2001aa,_0x5443f1),_0x2001aa=null;}try{logger[_0x69c5e5(0x1cf)](_0x8aa220),logger[_0x69c5e5(0x186)](_0x69c5e5(0x1c2),_0x69c5e5(0x1b3)+_0x1dcce2['projectName']);}catch(_0x3b59fe){console[_0x69c5e5(0x1c5)](_0x69c5e5(0x1b9)+(_0x3b59fe instanceof Error?_0x3b59fe[_0x69c5e5(0x1aa)]:String(_0x3b59fe)));}console[_0x69c5e5(0x1df)](),console[_0x69c5e5(0x1df)](a203_0x765d62[_0x69c5e5(0x1f1)]('─'['repeat'](0x3c))),console[_0x69c5e5(0x1df)](a203_0x765d62[_0x69c5e5(0x1de)][_0x69c5e5(0x1c3)](_0x69c5e5(0x188))),console['log']();const _0x53ad21=_0x2c6da5[_0x69c5e5(0x1d7)]?CLI_BIN_NAME+_0x69c5e5(0x1c1):'cd\x20'+_0x1dcce2[_0x69c5e5(0x1cb)]+'\x20&&\x20'+CLI_BIN_NAME+_0x69c5e5(0x1c1);console[_0x69c5e5(0x1df)](_0x69c5e5(0x1a2)+a203_0x765d62[_0x69c5e5(0x1de)][_0x69c5e5(0x1c3)](_0x53ad21)),_0xf5c09e&&console[_0x69c5e5(0x1df)](_0x69c5e5(0x1a5)+a203_0x765d62[_0x69c5e5(0x1de)][_0x69c5e5(0x1c3)](CLI_BIN_NAME+_0x69c5e5(0x1f7))),console['log'](a203_0x765d62[_0x69c5e5(0x1f1)]('─'['repeat'](0x3c)));}catch(_0x3abba9){logger['error']('create','Project\x20creation\x20failed:\x20'+_0x1dcce2[_0x69c5e5(0x1cb)],{'error':_0x3abba9 instanceof Error?_0x3abba9[_0x69c5e5(0x1aa)]:String(_0x3abba9)});try{const _0x23c044=readDirectoryIdentity(_0x8aa220);if(_0x2c6da5[_0x69c5e5(0x1d7)]&&_0x2001aa)a203_0x443a08[_0x69c5e5(0x1a0)](_0x2001aa,{'recursive':!![],'force':!![]});else{if(_0x5bc556&&_0x23c044?.[_0x69c5e5(0x1f5)]===_0x5bc556[_0x69c5e5(0x1f5)]&&_0x23c044[_0x69c5e5(0x1a3)]===_0x5bc556[_0x69c5e5(0x1a3)])console[_0x69c5e5(0x1df)](_0x69c5e5(0x1c9)+_0x8aa220),a203_0x443a08['rmSync'](_0x8aa220,{'recursive':!![],'force':!![]});else _0x23c044&&logger[_0x69c5e5(0x1c5)](_0x69c5e5(0x1c2),_0x69c5e5(0x19b)+_0x8aa220);}}catch{logger[_0x69c5e5(0x1c5)](_0x69c5e5(0x1c2),_0x69c5e5(0x1f0)+_0x8aa220);}throw _0x3abba9;}}function a203_0x38bb(){const _0x4bface=['success','Downloading\x20project\x20template','🚀\x20Next\x20Steps:','The\x20current\x20directory\x20must\x20be\x20empty.','Extracting\x20project\x20template','Install\x20dependencies','Format\x20code','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','info','appCode','length','\x20already\x20exists','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','push','project','error','currentVersion','\x20√\x20','2206136lakYaq','join','production','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','writeFileSync','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','1FSXGcQ','Resolving\x20project\x20template','rmSync','resolving','\x20\x201.\x20Start\x20project:\x20','ino','Starting\x20project\x20creation:\x20','\x20\x202.\x20Pull\x20API\x20configuration:\x20','isDirectory','Project\x20template\x20ready','√\x20Pulled\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','message','11382415uqrqYJ','Copying\x20local\x20template\x20source','1.0.0','242388qsuqKQ','W_OK','573153QBqFoj','parse','readdirSync','Project\x20created:\x20','stringify','chdir','317136IeGvXg','verifying','√\x20Configuration\x20file\x20created,\x20Apps:\x20','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','projectCode','√\x20package.json\x20updated:\x20name=','env','description','validation','Updating\x20package.json\x20name','stableVersion','\x20run\x20start','create','bold','reverse','warn','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','downloading','existsSync','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','resolve','projectName','accessSync','Project\x20directory\x20','API\x20configuration\x20pulled:\x20','setLogPath','belowMinimum','Configured\x20app\x20AppCode:\x20','12NYdbAD','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.','Failed\x20to\x20configure\x20app\x20AppCode','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','basename','currentDir','utf8','\x20dataset(s),\x20generated\x20','version','Verifying\x20project\x20template','name','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','cyan','log','...','API\x20configuration\x20pull\x20failed','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','stop','cwd','apps','10xCreqW','\x20|\x20AppCode:\x20','copying','387615rrPPUW','dirname','renameSync','fail','\x20model(s)','9qAssqo','needsUpgrade','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','green','202476FwpOfm','constants','toLocaleString','dev','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','\x20api\x20pull\x20--force\x20--yes','cookie','readFileSync','mkdtempSync','lstatSync'];a203_0x38bb=function(){return _0x4bface;};return a203_0x38bb();}async function runTask(_0x26cf3f,_0x42758d,_0x403d11=_0x26cf3f){const _0x526dd9=a203_0x5bb8,_0x5ef148=a203_0x2fedf6(_0x26cf3f+'...')['start']();try{const _0x1fbd49=await _0x42758d(_0x1efc2=>{const _0x3efa5a=a203_0x5bb8;_0x5ef148['text']=_0x1efc2+_0x3efa5a(0x1e0);});_0x5ef148[_0x526dd9(0x1e3)](),console['log'](''+a203_0x765d62[_0x526dd9(0x1f1)](_0x526dd9(0x197))+_0x403d11+'\x20'+a203_0x765d62['gray']('['+_0x1fbd49+']'));}catch(_0x12a2f2){_0x5ef148[_0x526dd9(0x1ec)](_0x26cf3f);throw _0x12a2f2;}}function projectTemplateStageLabel(_0x51aa5c){const _0x517e6c=a203_0x5bb8;switch(_0x51aa5c){case _0x517e6c(0x1a1):return _0x517e6c(0x19f);case _0x517e6c(0x1c7):return _0x517e6c(0x187);case _0x517e6c(0x1b7):return _0x517e6c(0x1db);case'extracting':return _0x517e6c(0x18a);case _0x517e6c(0x1e8):return _0x517e6c(0x1ac);}}async function updatePackageJsonName(_0x862544,_0x3b02cb){const _0x34c968=a203_0x5bb8,_0x2f388b=a203_0x3cf9f7[_0x34c968(0x1ca)](process['cwd'](),_0x862544),_0x4753b4=a203_0x3cf9f7[_0x34c968(0x199)](_0x2f388b,'package.json');try{console[_0x34c968(0x1df)](_0x34c968(0x1dd));const _0x1d23e1=getRabetbaseCliPackageRoot(),_0x183fdd=a203_0x3cf9f7['join'](_0x1d23e1,'package.json');let _0x394477='1.0.0';try{const _0x5d775b=JSON[_0x34c968(0x1b1)](a203_0x443a08[_0x34c968(0x183)](_0x183fdd,_0x34c968(0x1d8)));_0x394477=_0x5d775b[_0x34c968(0x1da)]||_0x34c968(0x1ad);}catch{}const _0x4e6b3e=a203_0x443a08[_0x34c968(0x183)](_0x4753b4,_0x34c968(0x1d8)),_0x4ef1cb=JSON[_0x34c968(0x1b1)](_0x4e6b3e);_0x4ef1cb[_0x34c968(0x1dc)]=_0x3b02cb,_0x4ef1cb[_0x34c968(0x1bd)]=_0x3b02cb+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x394477,a203_0x443a08[_0x34c968(0x19c)](_0x4753b4,JSON[_0x34c968(0x1b4)](_0x4ef1cb,null,0x2)+'\x0a',_0x34c968(0x1d8)),console[_0x34c968(0x1df)](_0x34c968(0x1bb)+_0x3b02cb),logger['info'](_0x34c968(0x1c2),_0x34c968(0x1bf));}catch(_0x1f9f1e){logger[_0x34c968(0x195)](_0x34c968(0x1c2),'Failed\x20to\x20update\x20package.json');throw _0x1f9f1e;}}async function configureAppCode(_0x142269,_0x2df979,_0x2c9674,_0x24ef34){const _0x5c577a=a203_0x5bb8,_0x570dee=a203_0x3cf9f7[_0x5c577a(0x1ca)](process[_0x5c577a(0x1e4)](),_0x142269),_0x346690=a203_0x3cf9f7['join'](_0x570dee,NEW_CONFIG_NAME);try{_0x2c9674?console[_0x5c577a(0x1df)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x2df979+':\x20'+_0x2c9674):console[_0x5c577a(0x1df)](_0x5c577a(0x18d)+_0x2df979);const _0x353b7c=getRabetbaseCliPackageRoot(),_0x910e6f=a203_0x3cf9f7[_0x5c577a(0x199)](_0x353b7c,'package.json');let _0x3968f7='1.0.0';try{const _0x1a563b=JSON['parse'](a203_0x443a08[_0x5c577a(0x183)](_0x910e6f,_0x5c577a(0x1d8)));_0x3968f7=_0x1a563b[_0x5c577a(0x1da)]||_0x5c577a(0x1ad);}catch{}const {globalConfig:_0x41178d}=loadRawConfigLayers(),_0x5ac661=typeof _0x41178d[_0x5c577a(0x1bc)]==='string'?_0x41178d[_0x5c577a(0x1bc)]:undefined,_0x1f7d41={};for(const _0x14cdf4 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x41178d[_0x14cdf4]!=null)_0x1f7d41[_0x14cdf4]=_0x41178d[_0x14cdf4];}const _0x374234=buildCanonicalProjectConfig(_0x1f7d41,{'appCodes':_0x2c9674?[_0x2c9674]:[],'env':_0x24ef34||_0x5ac661||_0x5c577a(0x19a),'metadata':{'createdAt':new Date()[_0x5c577a(0x1f4)](),'version':_0x3968f7}});writeConfigFile(_0x346690,_0x374234),await generateSdkConfigFile(a203_0x3cf9f7['join'](_0x570dee,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x570dee),_0x2c9674?console['log'](_0x5c577a(0x1b8)+Object['keys'](_0x374234[_0x5c577a(0x1e5)]||{})['join'](',\x20')+'\x20|\x20Default:\x20implicit\x20(single\x20app)'):console[_0x5c577a(0x1df)](_0x5c577a(0x192)+CLI_BIN_NAME+_0x5c577a(0x1a9)),logger['info']('create',_0x5c577a(0x1d1)+_0x2c9674);}catch(_0x32b680){logger[_0x5c577a(0x195)](_0x5c577a(0x1c2),_0x5c577a(0x1d4));throw _0x32b680;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a204_0x30cbc1=a204_0x5ee8;(function(_0x238f82,_0x14f42c){const _0x2fd0e6=a204_0x5ee8,_0x111d01=_0x238f82();while(!![]){try{const _0x41c978=-parseInt(_0x2fd0e6(0xdd))/0x1*(-parseInt(_0x2fd0e6(0x12a))/0x2)+-parseInt(_0x2fd0e6(0xdc))/0x3+parseInt(_0x2fd0e6(0xfe))/0x4+-parseInt(_0x2fd0e6(0x11e))/0x5*(parseInt(_0x2fd0e6(0xf6))/0x6)+parseInt(_0x2fd0e6(0x115))/0x7*(parseInt(_0x2fd0e6(0xd9))/0x8)+-parseInt(_0x2fd0e6(0x116))/0x9*(-parseInt(_0x2fd0e6(0x134))/0xa)+parseInt(_0x2fd0e6(0xff))/0xb;if(_0x41c978===_0x14f42c)break;else _0x111d01['push'](_0x111d01['shift']());}catch(_0x14baa2){_0x111d01['push'](_0x111d01['shift']());}}}(a204_0x3aa3,0xca181));import{createHash}from'node:crypto';import a204_0x4149e3 from'node:fs/promises';import a204_0xe7764 from'node:path';function a204_0x3aa3(){const _0x5c1899=['copyFile','byteLength','isSafeInteger','readdir','mkdir','isDirectory','Use\x20a\x20different\x20project\x20name.','hex','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','validation','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','mode','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','.codegraph','.env.','from','isFinite','content-length','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','node_modules','body','.env.example','156mlKsWZ','sha256:','Project\x20template\x20package.json\x20is\x20invalid.','includes','has','arrayBuffer','resolving','utf8','5181992LUiScv','13512246CaUOzL','template.zip','lstat','dev','status','trim','href','downloading','ino','.rabetbase-create-','sha256','pathname','Check\x20the\x20source\x20directory\x20and\x20retry.','.DS_Store','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','.lovrabet.json','parse','object','message','isSymbolicLink','startsWith','application/zip','7gFfMYh','9WjbbPp','number','cancel','mkdtemp','digest','headers','dist','.env','257760ZURNxe','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','cdn','https:','code','access','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','.git','push','.rabetbase','readFile','origin','14aihNsC','Invalid\x20local\x20template\x20source:\x20','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','sub-app-react-demo','extracting','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','string','EEXIST','Unable\x20to\x20claim\x20the\x20project\x20directory.','project','2730170xQZXqP','copying','getReader','releaseLock','Project\x20directory\x20already\x20exists:\x20','.idea','signal','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','relative','test','posix','package.json','ENOENT','resolve','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','sep','realpath','name','Local\x20template\x20source\x20does\x20not\x20exist:\x20','dirname','isAbsolute','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','length','size','isFile','basename','chmod','concat','1567088VyorwQ','read','join','2507364MVjZVb','1590xZbuPa','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','local'];a204_0x3aa3=function(){return _0x5c1899;};return a204_0x3aa3();}import{PROJECT_TEMPLATE_ASSET_BASE_URL}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{getRabetbaseCdnConfig,resolveProjectTemplateDescriptor}from'../../../utils/cli-version-policy.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID=a204_0x30cbc1(0x12d),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x413564){const _0x10bcc2=a204_0x30cbc1;return typeof _0x413564===_0x10bcc2(0x130)&&_0x413564['trim']()?_0x413564[_0x10bcc2(0x104)]():null;}function parseDescriptor(_0x3c6f4a){const _0x10f938=a204_0x30cbc1;if(!_0x3c6f4a||typeof _0x3c6f4a!==_0x10f938(0x110))throw new Error(_0x10f938(0x124)+TEMPLATE_ID+'\x22.');const _0x2fbb39=_0x3c6f4a,_0x14df58=nonEmptyString(_0x2fbb39['version']),_0x4b069c=nonEmptyString(_0x2fbb39[_0x10f938(0xcd)]),_0x1dd03b=nonEmptyString(_0x2fbb39[_0x10f938(0x109)])?.['toLowerCase'](),_0x69c177=_0x2fbb39[_0x10f938(0xd4)];if(!_0x14df58||!_0x4b069c||_0x4b069c!==a204_0xe7764[_0x10f938(0xc6)][_0x10f938(0xd6)](_0x4b069c)||_0x4b069c[_0x10f938(0xf9)]('\x5c')||!_0x1dd03b||!/^sha256:[a-f0-9]{64}$/[_0x10f938(0xc5)](_0x1dd03b)||typeof _0x69c177!==_0x10f938(0x117)||!Number[_0x10f938(0xe2)](_0x69c177)||_0x69c177<=0x0||_0x69c177>MAX_ARCHIVE_SIZE)throw new Error(_0x10f938(0xe8)+TEMPLATE_ID+'\x22.');return{'version':_0x14df58,'name':_0x4b069c,'sha256':_0x1dd03b,'size':_0x69c177};}async function fetchWithTimeout(_0x46f651,_0x475c64,_0x14d408,_0x3cfd80){const _0x48007f=a204_0x30cbc1,_0x1f22c6=new AbortController(),_0x4bf5ff=setTimeout(()=>_0x1f22c6['abort'](),_0x475c64);try{const _0x26500=await fetch(_0x46f651,{'headers':{'Accept':_0x14d408},'signal':_0x1f22c6[_0x48007f(0x13a)]});return await _0x3cfd80(_0x26500);}finally{clearTimeout(_0x4bf5ff);}}async function fetchTemplateDescriptor(){const _0x4514fb=a204_0x30cbc1,_0x1ff5d4=await getRabetbaseCdnConfig();if(!_0x1ff5d4)throw new Error(_0x4514fb(0xec));return parseDescriptor(resolveProjectTemplateDescriptor(_0x1ff5d4,getCliVersion()));}function resolveArchiveUrl(_0x449c4f){const _0x170b84=a204_0x30cbc1,_0x702ced=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0xd18517=new URL(_0x449c4f,_0x702ced);if(_0xd18517['protocol']!==_0x170b84(0x121)||_0xd18517[_0x170b84(0x129)]!==_0x702ced[_0x170b84(0x129)]||!_0xd18517[_0x170b84(0x10a)][_0x170b84(0x113)](_0x702ced[_0x170b84(0x10a)]))throw new Error('CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.');return _0xd18517[_0x170b84(0x105)];}function a204_0x5ee8(_0x414949,_0x427a12){_0x414949=_0x414949-0xc1;const _0x3aa39a=a204_0x3aa3();let _0x5ee8dd=_0x3aa39a[_0x414949];return _0x5ee8dd;}async function readResponseBytes(_0x1ab1fc,_0xcf14b3){const _0x4b22e5=a204_0x30cbc1;if(!_0x1ab1fc[_0x4b22e5(0xf4)]){const _0x509055=Buffer[_0x4b22e5(0xef)](await _0x1ab1fc[_0x4b22e5(0xfb)]());if(_0x509055[_0x4b22e5(0xd3)]>_0xcf14b3)throw new Error(_0x4b22e5(0xc1));return _0x509055;}const _0x179393=_0x1ab1fc['body'][_0x4b22e5(0x136)](),_0x41073f=[];let _0x19b40a=0x0;try{while(!![]){const {done:_0x227f31,value:_0x356b82}=await _0x179393[_0x4b22e5(0xda)]();if(_0x227f31)break;_0x19b40a+=_0x356b82[_0x4b22e5(0xe1)];if(_0x19b40a>_0xcf14b3){await _0x179393[_0x4b22e5(0x118)]();throw new Error(_0x4b22e5(0xc1));}_0x41073f[_0x4b22e5(0x126)](Buffer[_0x4b22e5(0xef)](_0x356b82));}}finally{_0x179393[_0x4b22e5(0x137)]();}return Buffer[_0x4b22e5(0xd8)](_0x41073f,_0x19b40a);}async function downloadArchive(_0x20371a,_0x3751a2,_0x16a938){const _0x5396fe=a204_0x30cbc1,_0x38bd27=await fetchWithTimeout(resolveArchiveUrl(_0x20371a[_0x5396fe(0xcd)]),ARCHIVE_TIMEOUT_MS,_0x5396fe(0x114),async _0x33da34=>{const _0x5bd71=_0x5396fe;if(!_0x33da34['ok'])throw new Error(_0x5bd71(0xd2)+_0x33da34[_0x5bd71(0x103)]+'.');const _0x3a516a=Number(_0x33da34[_0x5bd71(0x11b)]['get'](_0x5bd71(0xf1)));if(Number[_0x5bd71(0xf0)](_0x3a516a)&&_0x3a516a>MAX_ARCHIVE_SIZE)throw new Error(_0x5bd71(0x10d));return readResponseBytes(_0x33da34,_0x20371a[_0x5bd71(0xd4)]);});if(_0x38bd27[_0x5396fe(0xd3)]!==_0x20371a[_0x5396fe(0xd4)])throw new Error(_0x5396fe(0xca)+_0x20371a[_0x5396fe(0xd4)]+',\x20received\x20'+_0x38bd27[_0x5396fe(0xd3)]+'.');_0x16a938?.('verifying');const _0x617053=_0x5396fe(0xf7)+createHash('sha256')['update'](_0x38bd27)[_0x5396fe(0x11a)](_0x5396fe(0xe7));if(_0x617053!==_0x20371a['sha256'])throw new Error(_0x5396fe(0xea));await a204_0x4149e3['writeFile'](_0x3751a2,_0x38bd27,{'flag':'wx'});}async function assertTemplateRoot(_0x290123){const _0x48e605=a204_0x30cbc1,_0x667d0=a204_0xe7764['join'](_0x290123,_0x48e605(0xc7)),_0x21c49e=JSON[_0x48e605(0x10f)](await a204_0x4149e3[_0x48e605(0x128)](_0x667d0,_0x48e605(0xfd)));if(!_0x21c49e||typeof _0x21c49e!==_0x48e605(0x110))throw new Error(_0x48e605(0xf8));}const LOCAL_FORBIDDEN_NAMES=new Set([a204_0x30cbc1(0x10c),a204_0x30cbc1(0xed),a204_0x30cbc1(0x125),a204_0x30cbc1(0x139),a204_0x30cbc1(0x10e),'.lovrabet.log',a204_0x30cbc1(0x127),'.rabetbase.json',a204_0x30cbc1(0x11c),a204_0x30cbc1(0xf3)]);function isForbiddenTemplateEntry(_0x510019){const _0x554523=a204_0x30cbc1;if(LOCAL_FORBIDDEN_NAMES[_0x554523(0xfa)](_0x510019))return!![];return _0x510019===_0x554523(0x11d)||_0x510019['startsWith'](_0x554523(0xee))&&_0x510019!==_0x554523(0xf5);}function containsPath(_0x6da069,_0x16d9b1){const _0x23aa83=a204_0x30cbc1,_0x46a59d=a204_0xe7764[_0x23aa83(0xc4)](_0x6da069,_0x16d9b1);return _0x46a59d===''||!_0x46a59d[_0x23aa83(0x113)]('..'+a204_0xe7764[_0x23aa83(0xcb)])&&_0x46a59d!=='..'&&!a204_0xe7764[_0x23aa83(0xd0)](_0x46a59d);}async function copyLocalTemplateDirectory(_0x5a5711,_0x3b1163){const _0x37e5d7=a204_0x30cbc1;await a204_0x4149e3[_0x37e5d7(0xe4)](_0x3b1163,{'recursive':!![]});for(const _0x1b64a8 of await a204_0x4149e3[_0x37e5d7(0xe3)](_0x5a5711,{'withFileTypes':!![]})){const _0xa55fd1=a204_0xe7764[_0x37e5d7(0xdb)](_0x5a5711,_0x1b64a8['name']),_0x3181a1=a204_0xe7764[_0x37e5d7(0xdb)](_0x3b1163,_0x1b64a8[_0x37e5d7(0xcd)]);if(isForbiddenTemplateEntry(_0x1b64a8['name']))throw new Error(_0x37e5d7(0xc3)+_0xa55fd1);const _0x2f8ab7=await a204_0x4149e3[_0x37e5d7(0x101)](_0xa55fd1);if(_0x2f8ab7[_0x37e5d7(0x112)]())throw new Error(_0x37e5d7(0xd1)+_0xa55fd1);if(_0x2f8ab7['isDirectory']()){await copyLocalTemplateDirectory(_0xa55fd1,_0x3181a1);continue;}if(!_0x2f8ab7[_0x37e5d7(0xd5)]())continue;await a204_0x4149e3[_0x37e5d7(0xe0)](_0xa55fd1,_0x3181a1),await a204_0x4149e3[_0x37e5d7(0xd7)](_0x3181a1,_0x2f8ab7[_0x37e5d7(0xeb)]&0x1ff);}}async function readTemplateVersion(_0x8f05e5){const _0x1ec56d=a204_0x30cbc1,_0x52a8f0=JSON[_0x1ec56d(0x10f)](await a204_0x4149e3[_0x1ec56d(0x128)](a204_0xe7764[_0x1ec56d(0xdb)](_0x8f05e5,_0x1ec56d(0xc7)),_0x1ec56d(0xfd)));return nonEmptyString(_0x52a8f0['version'])||_0x1ec56d(0xdf);}async function readDirectoryIdentity(_0x3a8bad){const _0x23c914=a204_0x30cbc1;try{const _0x206bb5=await a204_0x4149e3['lstat'](_0x3a8bad);if(!_0x206bb5[_0x23c914(0xe5)]())return null;return{'dev':_0x206bb5[_0x23c914(0x102)],'ino':_0x206bb5['ino']};}catch{return null;}}async function commitStagedProject(_0x18ec5d,_0x48785b){const _0x5e618c=a204_0x30cbc1;await a204_0x4149e3[_0x5e618c(0xe4)](_0x48785b);const _0x466055=await readDirectoryIdentity(_0x48785b);if(!_0x466055)throw new Error(_0x5e618c(0x132));try{for(const _0x45ba6e of await a204_0x4149e3[_0x5e618c(0xe3)](_0x18ec5d)){await a204_0x4149e3['rename'](a204_0xe7764[_0x5e618c(0xdb)](_0x18ec5d,_0x45ba6e),a204_0xe7764[_0x5e618c(0xdb)](_0x48785b,_0x45ba6e));}}catch(_0x10c1e8){const _0x4fbfa8=await readDirectoryIdentity(_0x48785b);_0x4fbfa8?.[_0x5e618c(0x102)]===_0x466055[_0x5e618c(0x102)]&&_0x4fbfa8[_0x5e618c(0x107)]===_0x466055[_0x5e618c(0x107)]&&await a204_0x4149e3['rm'](_0x48785b,{'recursive':!![],'force':!![]});throw _0x10c1e8;}}export async function materializeProjectTemplate(_0x5dd93f,_0x2a97d2){const _0x245200=a204_0x30cbc1,_0x2a7db4=a204_0xe7764[_0x245200(0xc9)](_0x5dd93f),_0x4f73ad=a204_0xe7764[_0x245200(0xcf)](_0x2a7db4);try{await a204_0x4149e3['lstat'](_0x2a7db4);throw new Error(_0x245200(0x138)+_0x2a7db4);}catch(_0x5c88ef){if(_0x5c88ef[_0x245200(0x122)]!==_0x245200(0xc8))throw _0x5c88ef;}const _0x55bb7c=await a204_0x4149e3[_0x245200(0x119)](a204_0xe7764['join'](_0x4f73ad,_0x245200(0x108))),_0x13f5a6=a204_0xe7764[_0x245200(0xdb)](_0x55bb7c,_0x245200(0x133)),_0x5d8f71=a204_0xe7764[_0x245200(0xdb)](_0x55bb7c,_0x245200(0x100));try{try{_0x2a97d2?.(_0x245200(0xfc));const _0x1bb7d1=await fetchTemplateDescriptor();return _0x2a97d2?.(_0x245200(0x106)),await downloadArchive(_0x1bb7d1,_0x5d8f71,_0x2a97d2),_0x2a97d2?.(_0x245200(0x12e)),await extractProjectTemplateArchive(_0x5d8f71,_0x13f5a6),await assertTemplateRoot(_0x13f5a6),await commitStagedProject(_0x13f5a6,_0x2a7db4),{'source':_0x245200(0x120),'version':_0x1bb7d1['version']};}catch(_0x16e069){if(_0x16e069['code']===_0x245200(0x131))throw CliErrors['validation'](_0x245200(0x138)+_0x2a7db4,_0x245200(0xe6));const _0x1d2637=_0x16e069 instanceof Error?_0x16e069[_0x245200(0x111)]:String(_0x16e069);throw CliErrors[_0x245200(0xe9)](_0x245200(0x12c),_0x245200(0x11f)+_0x1d2637);}}finally{await a204_0x4149e3['rm'](_0x55bb7c,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x1a4733,_0x386f65,_0x3c234a){const _0x2a83d0=a204_0x30cbc1;let _0x168bb6;try{_0x168bb6=await a204_0x4149e3[_0x2a83d0(0xcc)](a204_0xe7764['resolve'](_0x1a4733));}catch{throw CliErrors[_0x2a83d0(0xe9)](_0x2a83d0(0xce)+a204_0xe7764[_0x2a83d0(0xc9)](_0x1a4733),_0x2a83d0(0xde));}const _0x63f8f2=await a204_0x4149e3[_0x2a83d0(0x101)](_0x168bb6);if(!_0x63f8f2[_0x2a83d0(0xe5)]())throw CliErrors[_0x2a83d0(0xe9)](_0x2a83d0(0xf2)+_0x168bb6);const _0x438b99=a204_0xe7764[_0x2a83d0(0xc9)](_0x386f65),_0x26c2fa=await a204_0x4149e3[_0x2a83d0(0xcc)](a204_0xe7764[_0x2a83d0(0xcf)](_0x438b99)),_0x572e11=a204_0xe7764[_0x2a83d0(0xdb)](_0x26c2fa,a204_0xe7764[_0x2a83d0(0xd6)](_0x438b99));if(containsPath(_0x168bb6,_0x572e11)||containsPath(_0x572e11,_0x168bb6))throw CliErrors[_0x2a83d0(0xe9)]('Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.',_0x2a83d0(0x12f));try{await a204_0x4149e3[_0x2a83d0(0x101)](_0x572e11);throw CliErrors['validation'](_0x2a83d0(0x138)+_0x572e11,_0x2a83d0(0xc2));}catch(_0x5f2b53){if(_0x5f2b53['code']!=='ENOENT')throw _0x5f2b53;}const _0x1c3cb4=a204_0xe7764[_0x2a83d0(0xcf)](_0x572e11);await a204_0x4149e3[_0x2a83d0(0x123)](_0x1c3cb4);const _0x12efb9=await a204_0x4149e3[_0x2a83d0(0x119)](a204_0xe7764['join'](_0x1c3cb4,_0x2a83d0(0x108))),_0x1b8cf3=a204_0xe7764['join'](_0x12efb9,_0x2a83d0(0x133));try{_0x3c234a?.(_0x2a83d0(0x135)),await copyLocalTemplateDirectory(_0x168bb6,_0x1b8cf3),await assertTemplateRoot(_0x1b8cf3);const _0x24bdcd=await readTemplateVersion(_0x1b8cf3);return await commitStagedProject(_0x1b8cf3,_0x572e11),{'source':_0x2a83d0(0xdf),'version':_0x24bdcd};}catch(_0x1424df){const _0x554304=_0x1424df instanceof Error?_0x1424df['message']:String(_0x1424df);throw CliErrors[_0x2a83d0(0xe9)](_0x2a83d0(0x12b)+_0x554304,_0x2a83d0(0x10b));}finally{await a204_0x4149e3['rm'](_0x12efb9,{'recursive':!![],'force':!![]});}}
|
|
1
|
+
const a204_0x478eee=a204_0x5810;(function(_0x4ba14c,_0x15ddac){const _0x105cb4=a204_0x5810,_0x263310=_0x4ba14c();while(!![]){try{const _0x59efc2=parseInt(_0x105cb4(0x1e7))/0x1*(-parseInt(_0x105cb4(0x24f))/0x2)+-parseInt(_0x105cb4(0x246))/0x3*(parseInt(_0x105cb4(0x1df))/0x4)+-parseInt(_0x105cb4(0x22e))/0x5+-parseInt(_0x105cb4(0x1f5))/0x6+parseInt(_0x105cb4(0x21b))/0x7+-parseInt(_0x105cb4(0x1e5))/0x8+-parseInt(_0x105cb4(0x245))/0x9*(-parseInt(_0x105cb4(0x1de))/0xa);if(_0x59efc2===_0x15ddac)break;else _0x263310['push'](_0x263310['shift']());}catch(_0x2e5c82){_0x263310['push'](_0x263310['shift']());}}}(a204_0x4196,0xe9ca4));function a204_0x4196(){const _0x1d4a7a=['Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','digest','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','posix','get','utf8','cdn','join','1904375ULCgis','startsWith','chmod','access','validation','package.json','push','error','href','writeFile','toLowerCase','.rabetbase','Unable\x20to\x20claim\x20the\x20project\x20directory.','.env.example','dist','basename','dev','resolve','number','copying','EEXIST','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','parse','442989mfcVBc','138wvkotZ','mkdtemp','concat','protocol',',\x20received\x20','Invalid\x20local\x20template\x20source:\x20','valid','.lovrabet.json','ENOENT','2mvacLs','readdir','.env.','.DS_Store','Project\x20directory\x20already\x20exists:\x20','isSafeInteger','610TvxVQL','72528hOdyEd','.rabetbase.json','version','arrayBuffer','Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.','dirname','9493296MpkEhH','isSymbolicLink','355118QYshYC','ino','headers','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','isAbsolute','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','mkdir','.codegraph','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','url','size','relative','.idea','5323596SNSlkg','beta','realpath','abort','read','trim','.rabetbase-create-','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','release','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','Project\x20template\x20package.json\x20is\x20invalid.','extracting','name','length','sha256','includes','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','getReader','Check\x20the\x20source\x20directory\x20and\x20retry.','mode','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','code','template.zip','lstat','byteLength','string','local','project','verifying','pathname','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','update','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','readFile','isDirectory','object','body','message','11193812ZvCFqU','content-length','Local\x20template\x20source\x20does\x20not\x20exist:\x20','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','sub-app-react-demo','origin','https:','from','resolving','status','isFile'];a204_0x4196=function(){return _0x1d4a7a;};return a204_0x4196();}import{createHash}from'node:crypto';import a204_0xb99ab from'node:fs/promises';import a204_0x3f6312 from'node:path';import a204_0x4feda5 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=a204_0x478eee(0x21f),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0xb71b3c){const _0xfe4083=a204_0x478eee;return typeof _0xb71b3c===_0xfe4083(0x20e)&&_0xb71b3c[_0xfe4083(0x1fa)]()?_0xb71b3c[_0xfe4083(0x1fa)]():null;}function a204_0x5810(_0x204f8f,_0x5056dc){_0x204f8f=_0x204f8f-0x1dd;const _0x4196bc=a204_0x4196();let _0x581068=_0x4196bc[_0x204f8f];return _0x581068;}function parseDescriptor(_0x30f287){const _0x3b39d9=a204_0x478eee;if(!_0x30f287||typeof _0x30f287!==_0x3b39d9(0x218))throw new Error(_0x3b39d9(0x209)+TEMPLATE_ID+'\x22.');const _0x4d169f=_0x30f287,_0x1c4539=nonEmptyString(_0x4d169f[_0x3b39d9(0x1e1)]),_0x42e168=nonEmptyString(_0x4d169f[_0x3b39d9(0x201)]),_0x39dfb0=_0x4d169f[_0x3b39d9(0x1f1)]===undefined?undefined:nonEmptyString(_0x4d169f[_0x3b39d9(0x1f1)])||undefined,_0x1a8b86=nonEmptyString(_0x4d169f[_0x3b39d9(0x203)])?.[_0x3b39d9(0x238)](),_0xc8a5f9=_0x4d169f['size'];if(!_0x1c4539||!a204_0x4feda5[_0x3b39d9(0x24c)](_0x1c4539)||!_0x42e168||_0x42e168!==a204_0x3f6312[_0x3b39d9(0x229)][_0x3b39d9(0x23d)](_0x42e168)||_0x42e168[_0x3b39d9(0x204)]('\x5c')||_0x4d169f[_0x3b39d9(0x1f1)]!==undefined&&!_0x39dfb0||!_0x1a8b86||!/^sha256:[a-f0-9]{64}$/['test'](_0x1a8b86)||typeof _0xc8a5f9!==_0x3b39d9(0x240)||!Number[_0x3b39d9(0x1dd)](_0xc8a5f9)||_0xc8a5f9<=0x0||_0xc8a5f9>MAX_ARCHIVE_SIZE)throw new Error(_0x3b39d9(0x1fe)+TEMPLATE_ID+'\x22.');return{'version':_0x1c4539,'name':_0x42e168,'url':_0x39dfb0,'sha256':_0x1a8b86,'size':_0xc8a5f9};}async function fetchWithTimeout(_0x457b5f,_0x3270c5,_0x248d1b,_0x1efbff){const _0x22d370=a204_0x478eee,_0x823e2b=new AbortController(),_0x266990=setTimeout(()=>_0x823e2b[_0x22d370(0x1f8)](),_0x3270c5);try{const _0x3e0e6e=await fetch(_0x457b5f,{'headers':{'Accept':_0x248d1b},'redirect':_0x22d370(0x235),'signal':_0x823e2b['signal']});return await _0x1efbff(_0x3e0e6e);}finally{clearTimeout(_0x266990);}}async function fetchTemplateDescriptor(){const _0x221275=a204_0x478eee,_0x4f7d9d=getCliVersion(),_0x3d7276=isBetaCliVersion(_0x4f7d9d)?_0x221275(0x1f6):_0x221275(0x1fd),_0x4ce01e=await fetchProjectTemplateCdnConfig();if(!_0x4ce01e)throw new Error('Rabetbase\x20CDN\x20config\x20is\x20unavailable.');const _0x276095=parseDescriptor(resolveProjectTemplateDescriptor(_0x4ce01e['config'],_0x4f7d9d));return{'descriptor':_0x276095,'channel':_0x3d7276,'assetBaseUrl':_0x4ce01e['assetBaseUrl'],'legacyAssetBaseUrl':_0x4ce01e['legacyAssetBaseUrl']};}function resolveArchiveUrl(_0x30a2d0,_0x4488d8,_0x189fcc,_0x311539){const _0x516ab1=a204_0x478eee,_0x3923a4=new URL(_0x189fcc+'/'),_0x43060b=[getProjectTemplateRelativeUrl(_0x4488d8),getProjectTemplateRelativeUrl(_0x4488d8,_0x30a2d0['version'])];if(_0x30a2d0[_0x516ab1(0x1f1)]&&!_0x43060b[_0x516ab1(0x204)](_0x30a2d0[_0x516ab1(0x1f1)]))throw new Error('CDN\x20project\x20template\x20relative\x20URL\x20must\x20match\x20its\x20release\x20channel\x20or\x20version.');const _0x585ead=new URL(_0x311539+'/'),_0x4ada25=_0x30a2d0[_0x516ab1(0x1f1)]?new URL(_0x30a2d0[_0x516ab1(0x1f1)],_0x3923a4[_0x516ab1(0x220)]):new URL(_0x30a2d0[_0x516ab1(0x201)],_0x585ead),_0x560c87=_0x30a2d0[_0x516ab1(0x1f1)]?_0x3923a4['origin']:_0x585ead['origin'];if(_0x4ada25[_0x516ab1(0x249)]!==_0x516ab1(0x221)||_0x4ada25[_0x516ab1(0x220)]!==_0x560c87||a204_0x3f6312['posix']['basename'](decodeURIComponent(_0x4ada25[_0x516ab1(0x212)]))!==_0x30a2d0['name']||!_0x30a2d0[_0x516ab1(0x1f1)]&&!_0x4ada25['pathname'][_0x516ab1(0x22f)](_0x585ead[_0x516ab1(0x212)]))throw new Error(_0x516ab1(0x1ed));return _0x4ada25[_0x516ab1(0x236)];}async function readResponseBytes(_0x376450,_0x333610){const _0x37fd1d=a204_0x478eee;if(!_0x376450['body']){const _0x3fca91=Buffer[_0x37fd1d(0x222)](await _0x376450[_0x37fd1d(0x1e2)]());if(_0x3fca91[_0x37fd1d(0x202)]>_0x333610)throw new Error(_0x37fd1d(0x1ea));return _0x3fca91;}const _0x10d24c=_0x376450[_0x37fd1d(0x219)][_0x37fd1d(0x206)](),_0x1d1b80=[];let _0x3af8b4=0x0;try{while(!![]){const {done:_0x533ff8,value:_0x4dfb70}=await _0x10d24c[_0x37fd1d(0x1f9)]();if(_0x533ff8)break;_0x3af8b4+=_0x4dfb70[_0x37fd1d(0x20d)];if(_0x3af8b4>_0x333610){await _0x10d24c['cancel']();throw new Error('CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.');}_0x1d1b80[_0x37fd1d(0x234)](Buffer[_0x37fd1d(0x222)](_0x4dfb70));}}finally{_0x10d24c['releaseLock']();}return Buffer[_0x37fd1d(0x248)](_0x1d1b80,_0x3af8b4);}async function downloadArchive(_0x531188,_0x4020e4,_0x216ad7,_0x4c69a8,_0x3155b5,_0x5c35ff){const _0xbc38ff=a204_0x478eee,_0x369bf1=await fetchWithTimeout(resolveArchiveUrl(_0x531188,_0x4020e4,_0x216ad7,_0x4c69a8),ARCHIVE_TIMEOUT_MS,'application/zip',async _0x31d1a4=>{const _0x53d52f=a204_0x5810;if(!_0x31d1a4['ok'])throw new Error('CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20'+_0x31d1a4[_0x53d52f(0x224)]+'.');const _0x3276c1=Number(_0x31d1a4[_0x53d52f(0x1e9)][_0x53d52f(0x22a)](_0x53d52f(0x21c)));if(Number['isFinite'](_0x3276c1)&&_0x3276c1>MAX_ARCHIVE_SIZE)throw new Error(_0x53d52f(0x205));return readResponseBytes(_0x31d1a4,_0x531188[_0x53d52f(0x1f2)]);});if(_0x369bf1['length']!==_0x531188[_0xbc38ff(0x1f2)])throw new Error(_0xbc38ff(0x21e)+_0x531188[_0xbc38ff(0x1f2)]+_0xbc38ff(0x24a)+_0x369bf1[_0xbc38ff(0x202)]+'.');_0x5c35ff?.(_0xbc38ff(0x211));const _0x520661='sha256:'+createHash('sha256')[_0xbc38ff(0x214)](_0x369bf1)[_0xbc38ff(0x227)]('hex');if(_0x520661!==_0x531188[_0xbc38ff(0x203)])throw new Error('CDN\x20project\x20template\x20checksum\x20verification\x20failed.');await a204_0xb99ab[_0xbc38ff(0x237)](_0x3155b5,_0x369bf1,{'flag':'wx'});}async function assertTemplateRoot(_0x554ebe){const _0x22dba2=a204_0x478eee,_0xfc2d67=a204_0x3f6312[_0x22dba2(0x22d)](_0x554ebe,'package.json'),_0x32ee4f=JSON[_0x22dba2(0x244)](await a204_0xb99ab['readFile'](_0xfc2d67,'utf8'));if(!_0x32ee4f||typeof _0x32ee4f!==_0x22dba2(0x218))throw new Error(_0x22dba2(0x1ff));}const LOCAL_FORBIDDEN_NAMES=new Set([a204_0x478eee(0x252),a204_0x478eee(0x1ef),'.git',a204_0x478eee(0x1f4),a204_0x478eee(0x24d),'.lovrabet.log',a204_0x478eee(0x239),a204_0x478eee(0x1e0),a204_0x478eee(0x23c),'node_modules']);function isForbiddenTemplateEntry(_0x3d4b57){const _0x4b5f75=a204_0x478eee;if(LOCAL_FORBIDDEN_NAMES['has'](_0x3d4b57))return!![];return _0x3d4b57==='.env'||_0x3d4b57[_0x4b5f75(0x22f)](_0x4b5f75(0x251))&&_0x3d4b57!==_0x4b5f75(0x23b);}function containsPath(_0x31b854,_0x1339a7){const _0x1ab434=a204_0x478eee,_0x555031=a204_0x3f6312[_0x1ab434(0x1f3)](_0x31b854,_0x1339a7);return _0x555031===''||!_0x555031[_0x1ab434(0x22f)]('..'+a204_0x3f6312['sep'])&&_0x555031!=='..'&&!a204_0x3f6312[_0x1ab434(0x1ec)](_0x555031);}async function copyLocalTemplateDirectory(_0x2f8c7f,_0x59562a){const _0x4a8f36=a204_0x478eee;await a204_0xb99ab[_0x4a8f36(0x1ee)](_0x59562a,{'recursive':!![]});for(const _0x4d6512 of await a204_0xb99ab[_0x4a8f36(0x250)](_0x2f8c7f,{'withFileTypes':!![]})){const _0x11f246=a204_0x3f6312[_0x4a8f36(0x22d)](_0x2f8c7f,_0x4d6512['name']),_0x1080fa=a204_0x3f6312['join'](_0x59562a,_0x4d6512[_0x4a8f36(0x201)]);if(isForbiddenTemplateEntry(_0x4d6512[_0x4a8f36(0x201)]))throw new Error(_0x4a8f36(0x1fc)+_0x11f246);const _0x435e32=await a204_0xb99ab[_0x4a8f36(0x20c)](_0x11f246);if(_0x435e32[_0x4a8f36(0x1e6)]())throw new Error(_0x4a8f36(0x243)+_0x11f246);if(_0x435e32['isDirectory']()){await copyLocalTemplateDirectory(_0x11f246,_0x1080fa);continue;}if(!_0x435e32[_0x4a8f36(0x225)]())continue;await a204_0xb99ab['copyFile'](_0x11f246,_0x1080fa),await a204_0xb99ab[_0x4a8f36(0x230)](_0x1080fa,_0x435e32[_0x4a8f36(0x208)]&0x1ff);}}async function readTemplateVersion(_0x5b823d){const _0x659b6a=a204_0x478eee,_0x57cbce=JSON[_0x659b6a(0x244)](await a204_0xb99ab[_0x659b6a(0x216)](a204_0x3f6312[_0x659b6a(0x22d)](_0x5b823d,_0x659b6a(0x233)),_0x659b6a(0x22b)));return nonEmptyString(_0x57cbce[_0x659b6a(0x1e1)])||_0x659b6a(0x20f);}async function readDirectoryIdentity(_0x4afde5){const _0x379555=a204_0x478eee;try{const _0x50e70e=await a204_0xb99ab[_0x379555(0x20c)](_0x4afde5);if(!_0x50e70e[_0x379555(0x217)]())return null;return{'dev':_0x50e70e[_0x379555(0x23e)],'ino':_0x50e70e[_0x379555(0x1e8)]};}catch{return null;}}async function commitStagedProject(_0x3d27e9,_0x40d743){const _0x2026de=a204_0x478eee;await a204_0xb99ab[_0x2026de(0x1ee)](_0x40d743);const _0x1e7be1=await readDirectoryIdentity(_0x40d743);if(!_0x1e7be1)throw new Error(_0x2026de(0x23a));try{for(const _0x106d32 of await a204_0xb99ab['readdir'](_0x3d27e9)){await a204_0xb99ab['rename'](a204_0x3f6312['join'](_0x3d27e9,_0x106d32),a204_0x3f6312[_0x2026de(0x22d)](_0x40d743,_0x106d32));}}catch(_0x305f77){const _0x55a380=await readDirectoryIdentity(_0x40d743);_0x55a380?.[_0x2026de(0x23e)]===_0x1e7be1[_0x2026de(0x23e)]&&_0x55a380[_0x2026de(0x1e8)]===_0x1e7be1['ino']&&await a204_0xb99ab['rm'](_0x40d743,{'recursive':!![],'force':!![]});throw _0x305f77;}}export async function materializeProjectTemplate(_0x2c2307,_0x2883e6){const _0x447a12=a204_0x478eee,_0x1df602=a204_0x3f6312['resolve'](_0x2c2307),_0x2db509=a204_0x3f6312[_0x447a12(0x1e4)](_0x1df602);try{await a204_0xb99ab[_0x447a12(0x20c)](_0x1df602);throw new Error(_0x447a12(0x253)+_0x1df602);}catch(_0xf6c242){if(_0xf6c242[_0x447a12(0x20a)]!==_0x447a12(0x24e))throw _0xf6c242;}const _0x2b44c2=await a204_0xb99ab[_0x447a12(0x247)](a204_0x3f6312['join'](_0x2db509,_0x447a12(0x1fb))),_0x364e6d=a204_0x3f6312['join'](_0x2b44c2,_0x447a12(0x210)),_0xe8cc13=a204_0x3f6312['join'](_0x2b44c2,_0x447a12(0x20b));try{try{_0x2883e6?.(_0x447a12(0x223));const {descriptor:_0x35c6a5,channel:_0x2ad362,assetBaseUrl:_0x4c0020,legacyAssetBaseUrl:_0x274050}=await fetchTemplateDescriptor();return _0x2883e6?.('downloading'),await downloadArchive(_0x35c6a5,_0x2ad362,_0x4c0020,_0x274050,_0xe8cc13,_0x2883e6),_0x2883e6?.(_0x447a12(0x200)),await extractProjectTemplateArchive(_0xe8cc13,_0x364e6d),await assertTemplateRoot(_0x364e6d),await commitStagedProject(_0x364e6d,_0x1df602),{'source':_0x447a12(0x22c),'version':_0x35c6a5[_0x447a12(0x1e1)]};}catch(_0x340337){if(_0x340337['code']===_0x447a12(0x242))throw CliErrors[_0x447a12(0x232)](_0x447a12(0x253)+_0x1df602,'Use\x20a\x20different\x20project\x20name.');const _0xb73817=_0x340337 instanceof Error?_0x340337[_0x447a12(0x21a)]:String(_0x340337);throw CliErrors[_0x447a12(0x232)](_0x447a12(0x228),_0x447a12(0x226)+_0xb73817);}}finally{await a204_0xb99ab['rm'](_0x2b44c2,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x200475,_0x1e46d3,_0x4bbeb2){const _0x39e3c3=a204_0x478eee;let _0x19af2e;try{_0x19af2e=await a204_0xb99ab[_0x39e3c3(0x1f7)](a204_0x3f6312[_0x39e3c3(0x23f)](_0x200475));}catch{throw CliErrors[_0x39e3c3(0x232)](_0x39e3c3(0x21d)+a204_0x3f6312[_0x39e3c3(0x23f)](_0x200475),_0x39e3c3(0x1f0));}const _0x3f64f7=await a204_0xb99ab[_0x39e3c3(0x20c)](_0x19af2e);if(!_0x3f64f7[_0x39e3c3(0x217)]())throw CliErrors[_0x39e3c3(0x232)](_0x39e3c3(0x1eb)+_0x19af2e);const _0x4820a7=a204_0x3f6312[_0x39e3c3(0x23f)](_0x1e46d3),_0x2bde7c=await a204_0xb99ab[_0x39e3c3(0x1f7)](a204_0x3f6312[_0x39e3c3(0x1e4)](_0x4820a7)),_0x28675c=a204_0x3f6312[_0x39e3c3(0x22d)](_0x2bde7c,a204_0x3f6312[_0x39e3c3(0x23d)](_0x4820a7));if(containsPath(_0x19af2e,_0x28675c)||containsPath(_0x28675c,_0x19af2e))throw CliErrors['validation'](_0x39e3c3(0x213),_0x39e3c3(0x215));try{await a204_0xb99ab[_0x39e3c3(0x20c)](_0x28675c);throw CliErrors[_0x39e3c3(0x232)](_0x39e3c3(0x253)+_0x28675c,_0x39e3c3(0x1e3));}catch(_0x2d948e){if(_0x2d948e[_0x39e3c3(0x20a)]!==_0x39e3c3(0x24e))throw _0x2d948e;}const _0x474590=a204_0x3f6312['dirname'](_0x28675c);await a204_0xb99ab[_0x39e3c3(0x231)](_0x474590);const _0x4c12b3=await a204_0xb99ab[_0x39e3c3(0x247)](a204_0x3f6312[_0x39e3c3(0x22d)](_0x474590,'.rabetbase-create-')),_0x3aa7e8=a204_0x3f6312[_0x39e3c3(0x22d)](_0x4c12b3,_0x39e3c3(0x210));try{_0x4bbeb2?.(_0x39e3c3(0x241)),await copyLocalTemplateDirectory(_0x19af2e,_0x3aa7e8),await assertTemplateRoot(_0x3aa7e8);const _0x5bc8e5=await readTemplateVersion(_0x3aa7e8);return await commitStagedProject(_0x3aa7e8,_0x28675c),{'source':_0x39e3c3(0x20f),'version':_0x5bc8e5};}catch(_0x358f30){const _0x9ef6ea=_0x358f30 instanceof Error?_0x358f30[_0x39e3c3(0x21a)]:String(_0x358f30);throw CliErrors[_0x39e3c3(0x232)](_0x39e3c3(0x24b)+_0x9ef6ea,_0x39e3c3(0x207));}finally{await a204_0xb99ab['rm'](_0x4c12b3,{'recursive':!![],'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xb058ac,_0x3c151a){const _0x435816=a205_0x2487,_0x3f91e0=_0xb058ac();while(!![]){try{const _0x21888a=parseInt(_0x435816(0x139))/0x1+parseInt(_0x435816(0x142))/0x2*(parseInt(_0x435816(0x13b))/0x3)+-parseInt(_0x435816(0x135))/0x4+parseInt(_0x435816(0x13a))/0x5+-parseInt(_0x435816(0x132))/0x6*(-parseInt(_0x435816(0x140))/0x7)+-parseInt(_0x435816(0x136))/0x8+parseInt(_0x435816(0x131))/0x9;if(_0x21888a===_0x3c151a)break;else _0x3f91e0['push'](_0x3f91e0['shift']());}catch(_0x50feb9){_0x3f91e0['push'](_0x3f91e0['shift']());}}}(a205_0x1d5b,0x53805));function a205_0x2487(_0xd616f2,_0x55e2de){_0xd616f2=_0xd616f2-0x131;const _0x1d5b7c=a205_0x1d5b();let _0x248734=_0x1d5b7c[_0xd616f2];return _0x248734;}import{CliErrors}from'../../../errors.js';const PROJECT_NAME_PATTERN=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i,MAX_PROJECT_NAME_LENGTH=0x64;function a205_0x1d5b(){const _0x536127=['length','Project\x20name\x20cannot\x20exceed\x20','test','448637XMdiMj','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','24470tbnUtT','trim','5036121TWbkMH','6kzWARh','validation','\x22\x20is\x20reserved\x20on\x20Windows','1062588GCodEa','3517600aKadPO','Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.','Project\x20name\x20\x22','49856vLhClV','339885ArcGzC','75ltbdEu','\x20characters'];a205_0x1d5b=function(){return _0x536127;};return a205_0x1d5b();}export function getProjectNameValidationError(_0x16c4e9){const _0x50aec9=a205_0x2487,_0x16f739=_0x16c4e9[_0x50aec9(0x143)]();if(!_0x16f739)return'Project\x20name\x20cannot\x20be\x20empty';if(_0x16f739[_0x50aec9(0x13d)]>MAX_PROJECT_NAME_LENGTH)return _0x50aec9(0x13e)+MAX_PROJECT_NAME_LENGTH+_0x50aec9(0x13c);if(!PROJECT_NAME_PATTERN[_0x50aec9(0x13f)](_0x16f739))return _0x50aec9(0x141);if(WINDOWS_RESERVED_NAME['test'](_0x16f739))return _0x50aec9(0x138)+_0x16f739+_0x50aec9(0x134);return null;}export function validateProjectName(_0x293365){const _0x3bd322=a205_0x2487,_0x5bcaae=_0x293365[_0x3bd322(0x143)](),_0x210e3c=getProjectNameValidationError(_0x5bcaae);if(_0x210e3c)throw CliErrors[_0x3bd322(0x133)](_0x210e3c,_0x3bd322(0x137));return _0x5bcaae;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3dba39,_0x4825af){const _0x5361e0=a206_0x8b59,_0x432024=_0x3dba39();while(!![]){try{const _0x544bed=-parseInt(_0x5361e0(0xdb))/0x1+parseInt(_0x5361e0(0xcc))/0x2*(parseInt(_0x5361e0(0xc6))/0x3)+parseInt(_0x5361e0(0xed))/0x4*(parseInt(_0x5361e0(0xc8))/0x5)+-parseInt(_0x5361e0(0xe0))/0x6+-parseInt(_0x5361e0(0xe1))/0x7*(-parseInt(_0x5361e0(0xdf))/0x8)+parseInt(_0x5361e0(0xd3))/0x9+-parseInt(_0x5361e0(0xe8))/0xa;if(_0x544bed===_0x4825af)break;else _0x432024['push'](_0x432024['shift']());}catch(_0x3976fd){_0x432024['push'](_0x432024['shift']());}}}(a206_0x41cc,0x56fcb));import{createWriteStream}from'node:fs';import a206_0x22a276 from'node:fs/promises';import a206_0x3aaf4d from'node:path';import{pipeline}from'node:stream/promises';import a206_0x4f727a 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(_0xe65c17){return new Promise((_0x2f5e96,_0x3f560c)=>{a206_0x4f727a['open'](_0xe65c17,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x1ffcce,_0x4ae6ac)=>{const _0x502a16=a206_0x8b59;if(_0x1ffcce||!_0x4ae6ac){_0x3f560c(_0x1ffcce||new Error(_0x502a16(0xcf)));return;}_0x2f5e96(_0x4ae6ac);});});}function openEntryStream(_0x318a90,_0x49965d){return new Promise((_0x1ad806,_0x465e9a)=>{const _0x7c0f81=a206_0x8b59;_0x318a90[_0x7c0f81(0xd4)](_0x49965d,(_0x326a4e,_0x13f88d)=>{const _0x15b6f2=_0x7c0f81;if(_0x326a4e||!_0x13f88d){_0x465e9a(_0x326a4e||new Error('Unable\x20to\x20read\x20ZIP\x20entry:\x20'+_0x49965d[_0x15b6f2(0xd0)]));return;}_0x1ad806(_0x13f88d);});});}function validateEntryPath(_0x5bc8f){const _0x505a41=a206_0x8b59,_0x432f9f=_0x5bc8f['replace'](/\\/g,'/'),_0x20f02b=_0x432f9f[_0x505a41(0xee)]('/'),_0x39d7ac=_0x20f02b?_0x432f9f[_0x505a41(0xe6)](0x0,-0x1):_0x432f9f;if(!_0x39d7ac||_0x432f9f[_0x505a41(0xc9)]('/')||/^[A-Za-z]:\//[_0x505a41(0xec)](_0x432f9f))throw new Error('Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20'+_0x5bc8f);const _0x2c1f69=_0x39d7ac[_0x505a41(0xcb)]('/');for(const _0x14d568 of _0x2c1f69){if(!_0x14d568||_0x14d568==='.'||_0x14d568==='..'||_0x14d568[_0x505a41(0xee)]('.')||_0x14d568['endsWith']('\x20')||WINDOWS_INVALID_CHAR[_0x505a41(0xec)](_0x14d568)||WINDOWS_RESERVED_NAME[_0x505a41(0xec)](_0x14d568))throw new Error(_0x505a41(0xc4)+_0x5bc8f);}return{'relativePath':_0x2c1f69[_0x505a41(0xd7)](a206_0x3aaf4d['sep']),'directory':_0x20f02b};}function isSymbolicLink(_0x5e6f8d){const _0x2ce689=a206_0x8b59,_0x322a9a=_0x5e6f8d[_0x2ce689(0xcd)]>>>0x10&0xffff;return(_0x322a9a&0xf000)===0xa000;}function a206_0x8b59(_0x156036,_0x1dbeb9){_0x156036=_0x156036-0xc4;const _0x41cc44=a206_0x41cc();let _0x8b59af=_0x41cc44[_0x156036];return _0x8b59af;}function a206_0x41cc(){const _0x3cac7b=['dirname','58318ljvtTH','get','entry','en-US','48HjIGnq','242070gUMsUl','541618NnrQUj','mkdir','length','Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.','Project\x20template\x20ZIP\x20exceeds\x20','slice','once','8448240GucqWZ','resolve','close','isEncrypted','test','209348KbUdEd','endsWith','end','Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20','sep','507uUkFaz','readEntry','10OEPZyw','startsWith','uncompressedSize','split','6042vFAnKh','externalFileAttributes','ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20','Unable\x20to\x20open\x20project\x20template\x20archive.','fileName','has','\x20entries.','1982871bpnMDv','openReadStream','toLocaleLowerCase','Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20','join','Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20','error'];a206_0x41cc=function(){return _0x3cac7b;};return a206_0x41cc();}export async function extractProjectTemplateArchive(_0x10f67c,_0x6293c4){const _0xb8fa27=a206_0x8b59,_0x514138=await openZip(_0x10f67c),_0x3df41b=a206_0x3aaf4d[_0xb8fa27(0xe9)](_0x6293c4),_0x46f442=new Set(),_0x592cf7=new Map();let _0x2c94be=0x0,_0x509987=0x0;await a206_0x22a276[_0xb8fa27(0xe2)](_0x3df41b,{'recursive':!![]}),await new Promise((_0x500864,_0x18ae9a)=>{const _0x5bb7f2=_0xb8fa27;let _0x52685e=![];const _0x5f3517=_0x231cd2=>{const _0x411f71=a206_0x8b59;if(_0x52685e)return;_0x52685e=!![],_0x514138[_0x411f71(0xea)](),_0x18ae9a(_0x231cd2 instanceof Error?_0x231cd2:new Error(String(_0x231cd2)));};_0x514138['once'](_0x5bb7f2(0xd9),_0x5f3517),_0x514138[_0x5bb7f2(0xe7)](_0x5bb7f2(0xef),()=>{if(_0x52685e)return;_0x52685e=!![],_0x500864();}),_0x514138['on'](_0x5bb7f2(0xdd),_0x1ffaa7=>{void(async()=>{const _0x343c90=a206_0x8b59;_0x2c94be+=0x1,_0x509987+=_0x1ffaa7[_0x343c90(0xca)];if(_0x2c94be>MAX_ENTRY_COUNT)throw new Error(_0x343c90(0xe5)+MAX_ENTRY_COUNT+_0x343c90(0xd2));if(_0x509987>MAX_UNCOMPRESSED_SIZE)throw new Error(_0x343c90(0xe4));if(_0x1ffaa7[_0x343c90(0xeb)]())throw new Error(_0x343c90(0xd8)+_0x1ffaa7['fileName']);if(isSymbolicLink(_0x1ffaa7))throw new Error('Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20'+_0x1ffaa7[_0x343c90(0xd0)]);const {relativePath:_0x22902d,directory:_0x453f23}=validateEntryPath(_0x1ffaa7[_0x343c90(0xd0)]),_0x2edb34=_0x22902d[_0x343c90(0xcb)](a206_0x3aaf4d[_0x343c90(0xc5)]);for(let _0x21f6c1=0x1;_0x21f6c1<=_0x2edb34[_0x343c90(0xe3)];_0x21f6c1+=0x1){const _0xe1c4e7=_0x2edb34[_0x343c90(0xe6)](0x0,_0x21f6c1)[_0x343c90(0xd7)](a206_0x3aaf4d[_0x343c90(0xc5)]),_0x149222=_0xe1c4e7[_0x343c90(0xd5)](_0x343c90(0xde)),_0x47dcd7=_0x592cf7[_0x343c90(0xdc)](_0x149222);if(_0x47dcd7&&_0x47dcd7!==_0xe1c4e7)throw new Error('Case-conflicting\x20ZIP\x20entry\x20path:\x20'+_0x1ffaa7[_0x343c90(0xd0)]);_0x592cf7['set'](_0x149222,_0xe1c4e7);}const _0x4efdda=_0x22902d[_0x343c90(0xd5)](_0x343c90(0xde));if(_0x46f442[_0x343c90(0xd1)](_0x4efdda))throw new Error(_0x343c90(0xd6)+_0x1ffaa7[_0x343c90(0xd0)]);_0x46f442['add'](_0x4efdda);const _0x1bb010=a206_0x3aaf4d[_0x343c90(0xe9)](_0x3df41b,_0x22902d);if(_0x1bb010!==_0x3df41b&&!_0x1bb010['startsWith'](''+_0x3df41b+a206_0x3aaf4d[_0x343c90(0xc5)]))throw new Error(_0x343c90(0xce)+_0x1ffaa7[_0x343c90(0xd0)]);if(_0x453f23)await a206_0x22a276[_0x343c90(0xe2)](_0x1bb010,{'recursive':!![]});else{await a206_0x22a276[_0x343c90(0xe2)](a206_0x3aaf4d[_0x343c90(0xda)](_0x1bb010),{'recursive':!![]});const _0x50b245=await openEntryStream(_0x514138,_0x1ffaa7);await pipeline(_0x50b245,createWriteStream(_0x1bb010,{'flags':'wx','mode':0x1a4}));}_0x514138['readEntry']();})()['catch'](_0x5f3517);}),_0x514138[_0x5bb7f2(0xc7)]();});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a207_0x29bcfe=a207_0x3ae8;function a207_0x3d95(){const _0x4bd7f8=['16RhssFT','87148npnLiw','5DNgLpq','461835OdLdrl','6gCBpLo','2628584VZQgMs','270zLZdyQ','542148uMaNis','resolve','200862rDlebY','../../../../','dirname','281610mNdkqu','1921851qNwqSD'];a207_0x3d95=function(){return _0x4bd7f8;};return a207_0x3d95();}(function(_0x19c506,_0x5272bc){const _0x57cb11=a207_0x3ae8,_0x15b938=_0x19c506();while(!![]){try{const _0x10cec3=parseInt(_0x57cb11(0x184))/0x1+parseInt(_0x57cb11(0x17b))/0x2+-parseInt(_0x57cb11(0x181))/0x3*(parseInt(_0x57cb11(0x17e))/0x4)+-parseInt(_0x57cb11(0x17f))/0x5*(parseInt(_0x57cb11(0x178))/0x6)+parseInt(_0x57cb11(0x182))/0x7+-parseInt(_0x57cb11(0x17d))/0x8*(-parseInt(_0x57cb11(0x17c))/0x9)+parseInt(_0x57cb11(0x183))/0xa*(-parseInt(_0x57cb11(0x180))/0xb);if(_0x10cec3===_0x5272bc)break;else _0x15b938['push'](_0x15b938['shift']());}catch(_0x5a39cf){_0x15b938['push'](_0x15b938['shift']());}}}(a207_0x3d95,0x431d1));import a207_0x105217 from'node:path';function a207_0x3ae8(_0x37ef67,_0x2ac7cb){_0x37ef67=_0x37ef67-0x178;const _0x3d9595=a207_0x3d95();let _0x3ae831=_0x3d9595[_0x37ef67];return _0x3ae831;}import{fileURLToPath}from'node:url';const __dirname=a207_0x105217[a207_0x29bcfe(0x17a)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x2183cc=a207_0x29bcfe;return a207_0x105217[_0x2183cc(0x185)](__dirname,_0x2183cc(0x179));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4ed0a2,_0x2d0409){const _0x498b80=a208_0x8f6a,_0x2a425e=_0x4ed0a2();while(!![]){try{const _0x41b861=-parseInt(_0x498b80(0x189))/0x1+parseInt(_0x498b80(0x18f))/0x2+parseInt(_0x498b80(0x193))/0x3*(parseInt(_0x498b80(0x190))/0x4)+-parseInt(_0x498b80(0x194))/0x5+-parseInt(_0x498b80(0x192))/0x6*(parseInt(_0x498b80(0x199))/0x7)+-parseInt(_0x498b80(0x18c))/0x8*(parseInt(_0x498b80(0x191))/0x9)+parseInt(_0x498b80(0x198))/0xa*(parseInt(_0x498b80(0x195))/0xb);if(_0x41b861===_0x2d0409)break;else _0x2a425e['push'](_0x2a425e['shift']());}catch(_0x3a446e){_0x2a425e['push'](_0x2a425e['shift']());}}}(a208_0x138e,0x7a883));import a208_0x53fba from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a208_0x8f6a(_0x526843,_0x5ecc7e){_0x526843=_0x526843-0x186;const _0x138ef4=a208_0x138e();let _0x8f6a93=_0x138ef4[_0x526843];return _0x8f6a93;}import{logger}from'../../../utils/logger.js';function a208_0x138e(){const _0x2bfa7c=['567328GPXSng','info','Project\x20template\x20created','928RJeeFp','version','error','612266qowwUr','3652hmMTrs','63207nXeNNt','6ZMbpUx','57sFeyeC','3874530bliFKj','472989driNWr','source','message','740pFcOAM','5926291zjAAbl','Starting\x20project\x20template\x20creation','now','copy'];a208_0x138e=function(){return _0x2bfa7c;};return a208_0x138e();}import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';export async function copyProjectTemplate(_0x4cabc5,_0x5bd92f,_0x2bd535){const _0x2f3b4e=a208_0x8f6a,_0x298d2a=Date[_0x2f3b4e(0x187)](),_0x229c8b=a208_0x53fba['resolve'](process['cwd'](),_0x4cabc5);try{logger[_0x2f3b4e(0x18a)](_0x2f3b4e(0x188),_0x2f3b4e(0x186),{'projectCode':_0x4cabc5});const _0x14d54d=_0x2bd535?await materializeLocalProjectTemplate(_0x2bd535,_0x229c8b,_0x5bd92f):await materializeProjectTemplate(_0x229c8b,_0x5bd92f),_0x286a55=Date[_0x2f3b4e(0x187)]()-_0x298d2a;logger['success'](_0x2f3b4e(0x188),_0x2f3b4e(0x18b),_0x286a55,{'projectCode':_0x4cabc5,'templateSource':_0x14d54d[_0x2f3b4e(0x196)],'templateVersion':_0x14d54d[_0x2f3b4e(0x18d)]});}catch(_0x3a7d4d){const _0x23ec69=Date['now']()-_0x298d2a;logger[_0x2f3b4e(0x18e)](_0x2f3b4e(0x188),'Failed\x20to\x20copy\x20project\x20template',{'projectCode':_0x4cabc5,'error':_0x3a7d4d instanceof Error?_0x3a7d4d[_0x2f3b4e(0x197)]:String(_0x3a7d4d),'duration':_0x23ec69});throw _0x3a7d4d;}return formatElapsed(_0x298d2a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3bcb11,_0x523aa5){const _0x476c44=a209_0x2d7b,_0x26557b=_0x3bcb11();while(!![]){try{const _0x24f448=-parseInt(_0x476c44(0xd0))/0x1*(-parseInt(_0x476c44(0xd9))/0x2)+parseInt(_0x476c44(0xd8))/0x3*(parseInt(_0x476c44(0xdb))/0x4)+-parseInt(_0x476c44(0xd3))/0x5*(-parseInt(_0x476c44(0xdd))/0x6)+-parseInt(_0x476c44(0xd5))/0x7+-parseInt(_0x476c44(0xcf))/0x8+-parseInt(_0x476c44(0xcc))/0x9*(parseInt(_0x476c44(0xdc))/0xa)+-parseInt(_0x476c44(0xcd))/0xb;if(_0x24f448===_0x523aa5)break;else _0x26557b['push'](_0x26557b['shift']());}catch(_0x3f4b9a){_0x26557b['push'](_0x26557b['shift']());}}}(a209_0x26bd,0xbc00f));import a209_0x39b447 from'node:path';import{execa}from'execa';function a209_0x26bd(){const _0x4f4bac=['resolve','129475OZnDZP','npx','2903005cGkOKa','Code\x20format\x20failed','--write','1064697fBsLrF','322NKUNRh','now','8nOMTVH','30FlbBer','342yPyWlV','success','Starting\x20code\x20format','format','45513yXTLgT','16465207RYZWVj','Code\x20format\x20completed','4968144oYyRnA','7031kNLSLS','error'];a209_0x26bd=function(){return _0x4f4bac;};return a209_0x26bd();}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a209_0x2d7b(_0x2fb444,_0x4dd0a3){_0x2fb444=_0x2fb444-0xcc;const _0x26bd86=a209_0x26bd();let _0x2d7b18=_0x26bd86[_0x2fb444];return _0x2d7b18;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x4a06a5){const _0xd583f0=a209_0x2d7b,_0x235d8f=Date[_0xd583f0(0xda)](),_0x22f310=a209_0x39b447[_0xd583f0(0xd2)](process['cwd'](),_0x4a06a5);try{logger['info'](_0xd583f0(0xe0),_0xd583f0(0xdf),{'projectCode':_0x4a06a5}),await execa(resolveNpmBin(_0xd583f0(0xd4)),['prettier',_0xd583f0(0xd7),'.'],{'cwd':_0x22f310});const _0xf2b53a=Date['now']()-_0x235d8f;logger[_0xd583f0(0xde)](_0xd583f0(0xe0),_0xd583f0(0xce),_0xf2b53a,{'projectCode':_0x4a06a5});}catch(_0x510499){const _0x574177=Date[_0xd583f0(0xda)]()-_0x235d8f;logger[_0xd583f0(0xd1)](_0xd583f0(0xe0),_0xd583f0(0xd6),{'projectCode':_0x4a06a5,'error':_0x510499 instanceof Error?_0x510499['message']:String(_0x510499),'duration':_0x574177});throw _0x510499;}return formatElapsed(_0x235d8f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x170281,_0xa7c7e6){const _0x5a03f5=a210_0x430b,_0x5a3d5e=_0x170281();while(!![]){try{const _0xa63c29=-parseInt(_0x5a03f5(0x10b))/0x1+-parseInt(_0x5a03f5(0x102))/0x2+-parseInt(_0x5a03f5(0xff))/0x3*(-parseInt(_0x5a03f5(0xfd))/0x4)+parseInt(_0x5a03f5(0xf8))/0x5*(parseInt(_0x5a03f5(0xf7))/0x6)+-parseInt(_0x5a03f5(0xf9))/0x7+parseInt(_0x5a03f5(0x107))/0x8+parseInt(_0x5a03f5(0x105))/0x9;if(_0xa63c29===_0xa7c7e6)break;else _0x5a3d5e['push'](_0x5a3d5e['shift']());}catch(_0x2e9367){_0x5a3d5e['push'](_0x5a3d5e['shift']());}}}(a210_0xcee1,0xb23dd));function a210_0x430b(_0x4dcb99,_0x48c248){_0x4dcb99=_0x4dcb99-0xf7;const _0xcee178=a210_0xcee1();let _0x430b35=_0xcee178[_0x4dcb99];return _0x430b35;}import a210_0x1be2d0 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a210_0xcee1(){const _0x4b5c83=['cwd','68UogsJK','--registry','139539SWZHlZ','Dependency\x20install\x20completed','success','1807518CuQkff','install','Dependency\x20install\x20failed','15435405RLQhtd','https://registry.npmmirror.com','1581816bznzHl','resolve','info','npm','1380201vGRyeP','error','6858pngOYu','2955tZqUWF','2554783sLrENw','now','Starting\x20dependency\x20install'];a210_0xcee1=function(){return _0x4b5c83;};return a210_0xcee1();}import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x7ca24d){const _0x2d80b4=a210_0x430b,_0x2bcc83=Date[_0x2d80b4(0xfa)](),_0x55a34a=a210_0x1be2d0[_0x2d80b4(0x108)](process[_0x2d80b4(0xfc)](),_0x7ca24d);try{logger[_0x2d80b4(0x109)](_0x2d80b4(0x103),_0x2d80b4(0xfb),{'projectCode':_0x7ca24d,'registry':_0x2d80b4(0x106)}),await execa(resolveNpmBin(_0x2d80b4(0x10a)),[_0x2d80b4(0x103),_0x2d80b4(0xfe),_0x2d80b4(0x106)],{'cwd':_0x55a34a});const _0x526a5c=Date[_0x2d80b4(0xfa)]()-_0x2bcc83;logger[_0x2d80b4(0x101)](_0x2d80b4(0x103),_0x2d80b4(0x100),_0x526a5c,{'projectCode':_0x7ca24d});}catch(_0x5438dd){const _0x325970=Date['now']()-_0x2bcc83;logger[_0x2d80b4(0x10c)](_0x2d80b4(0x103),_0x2d80b4(0x104),{'projectCode':_0x7ca24d,'error':_0x5438dd instanceof Error?_0x5438dd['message']:String(_0x5438dd),'duration':_0x325970});throw _0x5438dd;}return formatElapsed(_0x2bcc83);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a211_0x4d2e41=a211_0x1488;function a211_0x1488(_0x430d56,_0x18b938){_0x430d56=_0x430d56-0x143;const _0x220f83=a211_0x220f();let _0x1488e9=_0x220f83[_0x430d56];return _0x1488e9;}(function(_0xda968a,_0x29bf3d){const _0x5aa094=a211_0x1488,_0x6581fb=_0xda968a();while(!![]){try{const _0x2a532b=-parseInt(_0x5aa094(0x145))/0x1+-parseInt(_0x5aa094(0x14f))/0x2*(parseInt(_0x5aa094(0x150))/0x3)+parseInt(_0x5aa094(0x14b))/0x4+parseInt(_0x5aa094(0x14e))/0x5+-parseInt(_0x5aa094(0x149))/0x6+parseInt(_0x5aa094(0x14d))/0x7*(parseInt(_0x5aa094(0x143))/0x8)+-parseInt(_0x5aa094(0x148))/0x9*(-parseInt(_0x5aa094(0x153))/0xa);if(_0x2a532b===_0x29bf3d)break;else _0x6581fb['push'](_0x6581fb['shift']());}catch(_0x17d55f){_0x6581fb['push'](_0x6581fb['shift']());}}}(a211_0x220f,0x3c373));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';function a211_0x220f(){const _0x409654=['3QLJoey','validation','Synchronize\x20the\x20current\x20project\x27s\x20public\x20Domain\x20routing','35610ZBPVvC','\x20workspace\x20init\x20--appcode\x20<code>\x20in\x20the\x20project\x20directory\x20first.','204472iQAMxQ','project','476221LtXLwd','Run\x20','No\x20Rabetbase\x20project\x20configuration\x20was\x20found.','18TlJOIe','535086MAZGuI','read','1049388wsYCRY','Domain\x20routing\x20synchronized:\x20','133vkMSYe','1245085TtZVGZ','384124KaNrxi'];a211_0x220f=function(){return _0x409654;};return a211_0x220f();}import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';export const projectDomainRoutingSyncDefinition={'service':a211_0x4d2e41(0x144),'command':'domain-routing-sync','description':a211_0x4d2e41(0x152),'risk':a211_0x4d2e41(0x14a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(){const _0x1f7e8f=a211_0x4d2e41,_0x4e8a52=findProjectRootDirectory();if(!resolveConfigPath(_0x4e8a52))throw CliErrors[_0x1f7e8f(0x151)](_0x1f7e8f(0x147),_0x1f7e8f(0x146)+CLI_BIN_NAME+_0x1f7e8f(0x154));const _0x14aa10=writeProjectDomainRoutingManifest(_0x4e8a52);return{'ok':!![],'message':_0x1f7e8f(0x14c)+_0x14aa10['path'],'data':_0x14aa10};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a212_0x163eb1=a212_0x2ef3;(function(_0x477c60,_0x4c0c9b){const _0x276a61=a212_0x2ef3,_0x3e5586=_0x477c60();while(!![]){try{const _0x5804aa=parseInt(_0x276a61(0x1fd))/0x1*(parseInt(_0x276a61(0x215))/0x2)+-parseInt(_0x276a61(0x1f8))/0x3*(parseInt(_0x276a61(0x1ea))/0x4)+-parseInt(_0x276a61(0x1f5))/0x5+-parseInt(_0x276a61(0x1ef))/0x6*(parseInt(_0x276a61(0x209))/0x7)+parseInt(_0x276a61(0x208))/0x8*(parseInt(_0x276a61(0x203))/0x9)+parseInt(_0x276a61(0x1e8))/0xa*(-parseInt(_0x276a61(0x1f6))/0xb)+parseInt(_0x276a61(0x202))/0xc;if(_0x5804aa===_0x4c0c9b)break;else _0x3e5586['push'](_0x3e5586['shift']());}catch(_0x300718){_0x3e5586['push'](_0x3e5586['shift']());}}}(a212_0x3450,0x23d99));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{analyseProjectUpgrade,upgradeApp}from'../../commands/project/upgrade.js';function a212_0x2ef3(_0x147bad,_0x59733d){_0x147bad=_0x147bad-0x1e6;const _0x3450ed=a212_0x3450();let _0x2ef31b=_0x3450ed[_0x147bad];return _0x2ef31b;}import{projectDomainRoutingSyncDefinition}from'../../commands/project/domain-routing-sync.js';const createFlags=[{'name':a212_0x163eb1(0x20e),'type':a212_0x163eb1(0x1ee),'description':'Project\x20name'},{'name':'env','type':a212_0x163eb1(0x1ee),'description':a212_0x163eb1(0x210)},{'name':'appcode','type':'string','description':a212_0x163eb1(0x1e7)},{'name':a212_0x163eb1(0x1fa),'type':a212_0x163eb1(0x1f9),'description':a212_0x163eb1(0x1fb),'default':![]},{'name':a212_0x163eb1(0x1f0),'type':'string','description':a212_0x163eb1(0x1e9)}],upgradeFlags=[{'name':'yes','type':'boolean','description':a212_0x163eb1(0x1eb),'default':![]}];function a212_0x3450(){const _0x27a179=['Usage:\x20','8OsqTWv','7DJGQMD','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','PATCH','completed','name','bool','Target\x20environment','../../commands/project/create/main.js','Would\x20upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure\x20without\x20overwriting\x20project-owned\x20entrypoints','cookie','yes','3862xeRHKA','cwd','env','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','2264300IuorpA','Prepared\x20local\x20project\x20template\x20directory','70132LtseHX','Skip\x20confirmation\x20prompt','Project\x20upgrade\x20completed\x20with\x20follow-up\x20work.','cancelled','string','1132980eOVWXq','template-source','Create\x20a\x20new\x20project','str','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]\x20or\x20','trim','684550ACGZPI','11XGEXKI','nonInteractive','3vSdDzI','boolean','current-dir','Initialize\x20the\x20current\x20empty\x20directory\x20instead\x20of\x20creating\x20a\x20child\x20directory','Run\x20','59MavzUw','project-name','Upgrade\x20cancelled.','validation','project','5231232JMpmes','1500111aeBbcZ','upgrade','Project\x20upgrade\x20completed.','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]\x20from\x20the\x20empty\x20target\x20directory.'];a212_0x3450=function(){return _0x27a179;};return a212_0x3450();}export const projectDefinitions=[{'service':a212_0x163eb1(0x201),'command':'create','description':a212_0x163eb1(0x1f1),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a212_0x163eb1(0x1fe),'description':a212_0x163eb1(0x20a),'required':![]}],'flags':createFlags,async 'execute'(_0x39a707){const _0x10a979=a212_0x163eb1,{createApp:_0xadd02}=await import(_0x10a979(0x211)),_0x72e291=_0x39a707[_0x10a979(0x1f2)](_0x10a979(0x20e))[_0x10a979(0x1f4)]()||_0x39a707['args'][0x0]?.[_0x10a979(0x1f4)](),_0x528a0b=_0x39a707[_0x10a979(0x1f2)](_0x10a979(0x1e6))||undefined,_0x262d23=_0x39a707[_0x10a979(0x1f2)]('appcode')||undefined,_0x162082=_0x39a707['str'](_0x10a979(0x1f0))[_0x10a979(0x1f4)]()||undefined,_0x246ce3=_0x39a707[_0x10a979(0x20f)]('current-dir');if(_0x246ce3&&_0x72e291)throw CliErrors[_0x10a979(0x200)]('--current-dir\x20cannot\x20be\x20combined\x20with\x20a\x20project\x20name.',_0x10a979(0x1fc)+CLI_BIN_NAME+_0x10a979(0x206));if(_0x39a707[_0x10a979(0x1f7)]){if(!_0x72e291&&!_0x246ce3)throw CliErrors['validation'](_0x10a979(0x20b),_0x10a979(0x207)+CLI_BIN_NAME+_0x10a979(0x1f3)+CLI_BIN_NAME+'\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]');await _0xadd02({'projectCode':_0x72e291,'appCode':_0x262d23,'env':_0x528a0b,'cookie':_0x39a707[_0x10a979(0x213)],'currentDir':_0x246ce3,'nonInteractive':!![],'templateSource':_0x162082});}else await _0xadd02({'projectCode':_0x72e291,'appCode':_0x262d23,'env':_0x528a0b,'cookie':_0x39a707[_0x10a979(0x213)],'currentDir':_0x246ce3,'templateSource':_0x162082});return{'ok':!![]};}},projectDomainRoutingSyncDefinition,{'service':a212_0x163eb1(0x201),'command':a212_0x163eb1(0x204),'description':'Upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'dryRun'(){const _0x17116b=a212_0x163eb1,_0x41bf4d=analyseProjectUpgrade(process[_0x17116b(0x216)]());return{'method':_0x17116b(0x20c),'url':process['cwd'](),'body':_0x41bf4d,'description':_0x17116b(0x212)};},async 'execute'(_0x1b9b69){const _0x210536=a212_0x163eb1,_0xb54e54=await upgradeApp(_0x1b9b69[_0x210536(0x1f7)],{'yes':_0x1b9b69[_0x210536(0x20f)](_0x210536(0x214))});return{'ok':_0xb54e54[_0x210536(0x20d)]||_0xb54e54['cancelled']===!![],'message':_0xb54e54[_0x210536(0x1ed)]?_0x210536(0x1ff):_0xb54e54[_0x210536(0x20d)]?_0x210536(0x205):_0x210536(0x1ec),'data':_0xb54e54};}}];
|