@lovrabet/rabetbase-cli 2.5.4-beta.1 → 2.5.4-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- 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.d.ts +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/feishu-bind.d.ts +2 -0
- package/lib/commands/user-account/feishu-bind.js +1 -0
- 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.d.ts +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.d.ts +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +4 -0
- 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.d.ts +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.d.ts +14 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.d.ts +1 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +2 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/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.d.ts +15 -3
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +2 -2
- 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.d.ts +5 -0
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +4 -3
- package/skills/rabetbase/guides/sql-creation-workflow.md +1 -1
- package/skills/rabetbase/guides/sql-mybatis.md +12 -8
- package/skills/rabetbase/references/rabetbase-config.md +6 -4
- package/skills/rabetbase/references/rabetbase-init.md +7 -5
- package/skills/rabetbase/references/rabetbase-kb.md +8 -6
- package/skills/rabetbase/references/rabetbase-user-account.md +20 -2
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a200_0x1b034d=a200_0x571b;(function(_0x37d4f5,_0x25d8a8){const _0x519c80=a200_0x571b,_0x2bd134=_0x37d4f5();while(!![]){try{const _0x2391fe=-parseInt(_0x519c80(0x116))/0x1*(parseInt(_0x519c80(0x11e))/0x2)+-parseInt(_0x519c80(0x117))/0x3*(-parseInt(_0x519c80(0x138))/0x4)+parseInt(_0x519c80(0x113))/0x5+-parseInt(_0x519c80(0x11c))/0x6*(parseInt(_0x519c80(0x14b))/0x7)+-parseInt(_0x519c80(0x10a))/0x8+parseInt(_0x519c80(0x120))/0x9*(-parseInt(_0x519c80(0x11b))/0xa)+-parseInt(_0x519c80(0x133))/0xb*(-parseInt(_0x519c80(0x114))/0xc);if(_0x2391fe===_0x25d8a8)break;else _0x2bd134['push'](_0x2bd134['shift']());}catch(_0x507dfc){_0x2bd134['push'](_0x2bd134['shift']());}}}(a200_0x45b9,0x8bd64));import{copyFileSync,existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import a200_0x5ebcce from'node:path';function a200_0x571b(_0x47b857,_0x40fe35){_0x47b857=_0x47b857-0xff;const _0x45b99c=a200_0x45b9();let _0x571b30=_0x45b99c[_0x47b857];return _0x571b30;}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';function a200_0x45b9(){const _0x5d0c61=['11gQgSZp','replace-generated','includes','apiGroup','backups','44sKDAmG','unconfigured','client','path','push','relative','action','preserve','default','app','unchanged','object','join','has','The\x20file\x20contains\x20project-owned\x20code\x20and\x20will\x20not\x20be\x20overwritten.','./models.generated','flatMap','apiDir','manual-merge','305823DXzSZm','defaultApp','Multiple\x20Lovrabet\x20model\x20profiles\x20match\x20Runtime\x20Domain','client.ts','find','dirname','name','utf8','Recognized\x20legacy\x20CLI\x20scaffold;\x20a\x20backup\x20will\x20be\x20retained.','.rabetbase.json','candidates','candidatePath','/**\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','1146424TVgprF','api.ts','files','isDefault','.rabetbase','create','outputDir','LOVRABET_RUNTIME_DOMAIN','keys','1895495mkOlWB','25785132hbPkWc','map','2yUIVBm','178905mzQJuc','length','api-model-registry-v2','-api.ts','4870WvKVGh','126oLtzbI','single','702434qsvBLF','Model\x20facts\x20are\x20preserved\x20and\x20completed\x20from\x20legacy\x20generated\x20files\x20when\x20possible.','15669OzdfID','add','Profile-aware\x20model\x20selection\x20generated\x20by\x20Rabetbase\x20CLI','startsWith','api','sdk-config.ts','modelRuntime','apps','project-upgrade','some','migrate-single-app','project','basename','manualMergeRequired','string','normalizedApiDir','appcode','The\x20existing\x20runtime\x20selector\x20is\x20not\x20a\x20recognized\x20current\x20generated\x20file.','No\x20Lovrabet\x20model\x20profile\x20matches\x20Runtime\x20Domain'];a200_0x45b9=function(){return _0x5d0c61;};return a200_0x45b9();}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_0x1b034d(0x119),SDK_CONFIG_SOURCE=a200_0x1b034d(0x109);function relativeMigrationDir(_0x402a19,_0x993ea9){const _0x29a8bb=a200_0x1b034d,_0x242787=a200_0x5ebcce[_0x29a8bb(0x13d)](_0x402a19,_0x993ea9);return _0x242787&&!_0x242787[_0x29a8bb(0x123)]('..')?_0x242787:'external-api-dir';}function candidatePath(_0xd9563b,_0x4b7516,_0xfffced){const _0x451c5f=a200_0x1b034d;return a200_0x5ebcce[_0x451c5f(0x144)](_0xd9563b,_0x451c5f(0x10e),_0x451c5f(0x128),MIGRATION_ID,_0x451c5f(0x107),relativeMigrationDir(_0xd9563b,_0x4b7516),_0xfffced);}function backupPath(_0x50af55,_0x76558c,_0x556bb3){const _0x3c14a9=a200_0x1b034d;return a200_0x5ebcce[_0x3c14a9(0x144)](_0x50af55,_0x3c14a9(0x10e),_0x3c14a9(0x128),MIGRATION_ID,_0x3c14a9(0x137),relativeMigrationDir(_0x50af55,_0x76558c),_0x556bb3);}function readOptional(_0x356726){try{return readFileSync(_0x356726,'utf8');}catch{return undefined;}}function readJsonObject(_0x4afc8a){const _0x61e9cc=a200_0x1b034d;try{const _0xf1e429=JSON['parse'](readFileSync(_0x4afc8a,_0x61e9cc(0x104)));return _0xf1e429&&typeof _0xf1e429===_0x61e9cc(0x143)?_0xf1e429:{};}catch{return{};}}function planEntrypoint(_0x1bf137,_0x4595b8,_0x593eae,_0x536bb7){const _0x241ba4=a200_0x1b034d,_0x445d00=a200_0x5ebcce['join'](_0x4595b8,_0x593eae),_0x524866=readOptional(_0x445d00);if(_0x524866===undefined)return{'path':_0x445d00,'action':_0x241ba4(0x10f)};if(_0x593eae==='api.ts'?_0x524866[_0x241ba4(0x135)](_0x241ba4(0x147))&&_0x524866[_0x241ba4(0x135)]('./model-runtime'):_0x524866['includes'](_0x241ba4(0x111)))return{'path':_0x445d00,'action':_0x241ba4(0x142)};if(_0x536bb7(_0x524866))return{'path':_0x445d00,'action':'replace-generated','reason':_0x241ba4(0x105)};return{'path':_0x445d00,'action':_0x241ba4(0x14a),'reason':_0x241ba4(0x146),'candidatePath':candidatePath(_0x1bf137,_0x4595b8,_0x593eae)};}function syntheticApps(_0x2f061b){const _0x46deb8=a200_0x1b034d,_0x249dfd=_0x2f061b['apps']&&typeof _0x2f061b[_0x46deb8(0x127)]==='object'?_0x2f061b[_0x46deb8(0x127)]:undefined;if(_0x249dfd&&Object[_0x46deb8(0x112)](_0x249dfd)[_0x46deb8(0x118)]>0x0){const _0x168637=typeof _0x2f061b['defaultApp']===_0x46deb8(0x12e)?_0x2f061b[_0x46deb8(0x14c)]:Object[_0x46deb8(0x112)](_0x249dfd)[_0x46deb8(0x118)]===0x1?Object[_0x46deb8(0x112)](_0x249dfd)[0x0]:undefined;return Object['entries'](_0x249dfd)[_0x46deb8(0x148)](([_0x26638d,_0x1743a2])=>{const _0x2a0b08=_0x46deb8,_0x344bc8=_0x1743a2,_0x59a57d=typeof _0x344bc8['appcode']===_0x2a0b08(0x12e)?_0x344bc8[_0x2a0b08(0x130)]:'';return _0x59a57d?[{'name':_0x26638d,'appcode':_0x59a57d,'apiGroup':typeof _0x344bc8['apiGroup']==='string'?_0x344bc8[_0x2a0b08(0x136)]:undefined,'isDefault':_0x26638d===_0x168637,'region':'cn','regionSource':_0x2a0b08(0x140),'apiDir':typeof _0x344bc8[_0x2a0b08(0x149)]===_0x2a0b08(0x12e)?_0x344bc8[_0x2a0b08(0x149)]:typeof _0x2f061b[_0x2a0b08(0x149)]===_0x2a0b08(0x12e)?_0x2f061b[_0x2a0b08(0x149)]:undefined,'routingConfig':{}}]:[];});}const _0x1897b2=typeof _0x2f061b[_0x46deb8(0x130)]==='string'?_0x2f061b['appcode']:typeof _0x2f061b[_0x46deb8(0x141)]===_0x46deb8(0x12e)?_0x2f061b[_0x46deb8(0x141)]:undefined;if(!_0x1897b2)return[];return[{'name':_0x1897b2,'appcode':_0x1897b2,'isDefault':!![],'region':'cn','regionSource':'default','apiDir':typeof _0x2f061b[_0x46deb8(0x149)]==='string'?_0x2f061b['apiDir']:undefined,'routingConfig':{}}];}function configuredLayouts(_0x350c2e,_0x16f0c6){const _0x270757=a200_0x1b034d;return resolveApiProfileLayouts(_0x16f0c6,_0x584a43=>a200_0x5ebcce['resolve'](_0x350c2e,_0x584a43[_0x270757(0x149)]||DEFAULT_API_DIR),_0x350c2e);}function uniqueRegistryGroups(_0x246147){const _0x9cd157=a200_0x1b034d,_0x3816e4=[],_0x5785d9=new Set(),_0x5710bd=new Set();for(const _0x25cde3 of _0x246147){const _0x36a830=getRegistryGroup(_0x246147,_0x25cde3);if(!_0x36a830){_0x5785d9[_0x9cd157(0x121)](_0x25cde3[_0x9cd157(0x110)]);continue;}const _0x54ae83=_0x25cde3[_0x9cd157(0x12f)]+'\x00'+(_0x25cde3['apiGroup']??_0x9cd157(0x11d));!_0x5710bd[_0x9cd157(0x145)](_0x54ae83)&&(_0x3816e4[_0x9cd157(0x13c)](_0x36a830),_0x5710bd[_0x9cd157(0x121)](_0x54ae83));}return{'groups':_0x3816e4,'skipped':[..._0x5785d9]};}function planGroup(_0xbb29e9,_0x243546){const _0x51e278=a200_0x1b034d,_0x5e1a60=_0x243546[0x0][_0x51e278(0x12f)],_0x21ff9d=a200_0x5ebcce['join'](_0x5e1a60,MODEL_RUNTIME_FILE_NAME),_0x422e90=readOptional(_0x21ff9d),_0x48841f=_0x422e90!==undefined&&_0x422e90[_0x51e278(0x135)](_0x51e278(0x122))&&_0x422e90[_0x51e278(0x135)](_0x51e278(0xff))&&_0x422e90[_0x51e278(0x135)](_0x51e278(0x132)),_0x1503b7=a200_0x5ebcce['join'](_0x5e1a60,MODEL_REGISTRY_FILE_NAME),_0x42864f=a200_0x5ebcce[_0x51e278(0x144)](_0x5e1a60,_0x51e278(0x125)),_0x8dc0a4=[planEntrypoint(_0xbb29e9,_0x5e1a60,_0x51e278(0x10b),isLegacyGeneratedApiScaffold),planEntrypoint(_0xbb29e9,_0x5e1a60,_0x51e278(0x100),isLegacyGeneratedClientScaffold),{'path':_0x21ff9d,'action':_0x422e90===undefined?'create':_0x48841f?_0x51e278(0x142):_0x51e278(0x14a),'reason':_0x422e90===undefined?undefined:_0x51e278(0x131),..._0x422e90!==undefined&&!_0x48841f?{'candidatePath':candidatePath(_0xbb29e9,_0x5e1a60,MODEL_RUNTIME_FILE_NAME)}:{}},{'path':_0x1503b7,'action':existsSync(_0x1503b7)?'preserve':_0x51e278(0x10f),'reason':_0x51e278(0x11f)},{'path':_0x42864f,'action':existsSync(_0x42864f)?'preserve':'create'}];return{'apiDir':_0x5e1a60,'profiles':_0x243546[_0x51e278(0x115)](_0x109880=>_0x109880[_0x51e278(0x141)][_0x51e278(0x103)]),'files':_0x8dc0a4};}export function analyzeProjectApiArchitecture(_0x5d1ecd,_0x20dc5d){const _0x2c584a=a200_0x1b034d,_0x194faa=a200_0x5ebcce[_0x2c584a(0x144)](_0x5d1ecd,'.rabetbase.json'),_0x22a123=_0x20dc5d??(existsSync(_0x194faa)?readJsonObject(_0x194faa):{}),_0x8bcaf6=syntheticApps(_0x22a123);if(_0x8bcaf6[_0x2c584a(0x118)]===0x0)return{'migration':MIGRATION_ID,'needed':![],'configAction':_0x2c584a(0x139),'groups':[],'skippedLegacyDirectories':[],'manualMergeRequired':![]};const _0x432f6a=_0x22a123[_0x2c584a(0x127)]?_0x2c584a(0x142):_0x2c584a(0x12a),{groups:_0x3c5ac3,skipped:_0x34871f}=uniqueRegistryGroups(configuredLayouts(_0x5d1ecd,_0x8bcaf6)),_0x1c8615=_0x3c5ac3[_0x2c584a(0x115)](_0x5d615e=>planGroup(_0x5d1ecd,_0x5d615e)),_0x3a2888=_0x1c8615[_0x2c584a(0x129)](_0x3a4deb=>_0x3a4deb[_0x2c584a(0x10c)]['some'](_0x5da6ca=>_0x5da6ca['action']===_0x2c584a(0x14a))),_0x350422=_0x432f6a===_0x2c584a(0x12a)||_0x1c8615[_0x2c584a(0x129)](_0x299f9a=>_0x299f9a[_0x2c584a(0x10c)][_0x2c584a(0x129)](_0x11cc86=>!['unchanged',_0x2c584a(0x13f)][_0x2c584a(0x135)](_0x11cc86['action'])));return{'migration':MIGRATION_ID,'needed':_0x350422,'configAction':_0x432f6a,'groups':_0x1c8615,'skippedLegacyDirectories':_0x34871f,'manualMergeRequired':_0x3a2888};}function migrateSingleAppConfig(_0x422da5){const _0x2f3302=a200_0x1b034d,_0x9bbc0b=a200_0x5ebcce[_0x2f3302(0x144)](_0x422da5,_0x2f3302(0x106));if(!existsSync(_0x9bbc0b))return;const _0x17e581=readConfigFile(_0x9bbc0b);if(_0x17e581['apps']&&typeof _0x17e581['apps']===_0x2f3302(0x143))return;const _0xdacd4a=typeof _0x17e581[_0x2f3302(0x130)]===_0x2f3302(0x12e)?_0x17e581['appcode']:typeof _0x17e581[_0x2f3302(0x141)]===_0x2f3302(0x12e)?_0x17e581[_0x2f3302(0x141)]:undefined;if(!_0xdacd4a)return;_0x17e581[_0x2f3302(0x127)]={[_0xdacd4a]:{'appcode':_0xdacd4a}},_0x17e581['defaultApp']=_0xdacd4a,delete _0x17e581['app'],delete _0x17e581['appcode'],writeConfigFile(_0x9bbc0b,_0x17e581);}function legacyApiPath(_0x486c55,_0x38aaad){const _0x4f4f90=a200_0x1b034d,_0x26c9c0=_0x38aaad[_0x4f4f90(0x12f)],_0x1cdeb3=_0x486c55[_0x4f4f90(0x118)]===0x1||_0x38aaad[_0x4f4f90(0x141)][_0x4f4f90(0x10d)]?[a200_0x5ebcce['join'](_0x26c9c0,'api.ts'),a200_0x5ebcce[_0x4f4f90(0x144)](_0x26c9c0,_0x38aaad['app']['name']+'-api.ts')]:[a200_0x5ebcce[_0x4f4f90(0x144)](_0x26c9c0,_0x38aaad[_0x4f4f90(0x141)][_0x4f4f90(0x103)]+_0x4f4f90(0x11a))];return _0x1cdeb3[_0x4f4f90(0x101)](existsSync);}function writeCandidateOrEntrypoint(_0x33e6b0,_0x5cde71,_0x55466e,_0x328d66){const _0x479412=a200_0x1b034d;if(_0x55466e[_0x479412(0x13e)]==='unchanged'||_0x55466e[_0x479412(0x13e)]==='preserve')return;if(_0x55466e['action']===_0x479412(0x14a)){const _0x55b915=_0x55466e[_0x479412(0x108)];mkdirSync(a200_0x5ebcce[_0x479412(0x102)](_0x55b915),{'recursive':!![]}),writeFileSync(_0x55b915,_0x328d66,'utf8');return;}if(_0x55466e[_0x479412(0x13e)]===_0x479412(0x134)){const _0x2bb030=backupPath(_0x33e6b0,_0x5cde71,a200_0x5ebcce[_0x479412(0x12c)](_0x55466e[_0x479412(0x13b)]));mkdirSync(a200_0x5ebcce['dirname'](_0x2bb030),{'recursive':!![]}),copyFileSync(_0x55466e[_0x479412(0x13b)],_0x2bb030);}mkdirSync(a200_0x5ebcce['dirname'](_0x55466e[_0x479412(0x13b)]),{'recursive':!![]}),writeFileSync(_0x55466e[_0x479412(0x13b)],_0x328d66,_0x479412(0x104));}export async function upgradeProjectApiArchitecture(_0x4985e5){const _0x3fef2a=a200_0x1b034d,_0x128c62=analyzeProjectApiArchitecture(_0x4985e5);migrateSingleAppConfig(_0x4985e5);const _0x516a06=getMultiAppConfigs(_0x3fef2a(0x12b),_0x4985e5)??[],_0x5b24e2=configuredLayouts(_0x4985e5,_0x516a06),{groups:_0x21d0aa}=uniqueRegistryGroups(_0x5b24e2);let _0x461667;for(const _0xf9665b of _0x21d0aa){const _0x1eb40e=_0xf9665b[0x0][_0x3fef2a(0x12f)];mkdirSync(_0x1eb40e,{'recursive':!![]});const _0x4ba791=_0xf9665b[_0x3fef2a(0x101)](_0x30810b=>_0x30810b[_0x3fef2a(0x141)][_0x3fef2a(0x10d)])??_0xf9665b[0x0];for(const _0x2dbd77 of _0xf9665b){const _0x373cfb=a200_0x5ebcce[_0x3fef2a(0x144)](_0x1eb40e,MODEL_REGISTRY_FILE_NAME),_0x342165=readModelRegistry(_0x373cfb);if(_0x342165?.['profiles'][_0x2dbd77[_0x3fef2a(0x141)][_0x3fef2a(0x103)]])continue;const _0x53c3f8=legacyApiPath(_0xf9665b,_0x2dbd77),_0xed0deb=_0x53c3f8?readOptional(_0x53c3f8):undefined;await initMultiAppEnvironment(_0x2dbd77[_0x3fef2a(0x141)]),updateModelRegistry({'outputDir':_0x1eb40e,'profileName':_0x2dbd77[_0x3fef2a(0x141)][_0x3fef2a(0x103)],'defaultProfile':_0x4ba791['app'][_0x3fef2a(0x103)],'appCode':_0x2dbd77['app'][_0x3fef2a(0x130)],'runtimeDomain':getRuntimeDomain(),'models':_0xed0deb?parseLegacyApiModels(_0xed0deb):[]});}const _0x29ff21=await renderModelRegistryScaffold(_0x1eb40e,_0x4985e5),_0x5c5ae2=planGroup(_0x4985e5,_0xf9665b);for(const _0x43f6c6 of _0x5c5ae2[_0x3fef2a(0x10c)]){const _0x1f3b0e=a200_0x5ebcce[_0x3fef2a(0x12c)](_0x43f6c6[_0x3fef2a(0x13b)]);if(_0x1f3b0e==='api.ts')writeCandidateOrEntrypoint(_0x4985e5,_0x1eb40e,_0x43f6c6,_0x29ff21[_0x3fef2a(0x124)]);else{if(_0x1f3b0e===_0x3fef2a(0x100))writeCandidateOrEntrypoint(_0x4985e5,_0x1eb40e,_0x43f6c6,_0x29ff21[_0x3fef2a(0x13a)]);else{if(_0x1f3b0e===MODEL_RUNTIME_FILE_NAME)writeCandidateOrEntrypoint(_0x4985e5,_0x1eb40e,_0x43f6c6,_0x29ff21[_0x3fef2a(0x126)]);else _0x1f3b0e===_0x3fef2a(0x125)&&_0x43f6c6[_0x3fef2a(0x13e)]==='create'&&writeCandidateOrEntrypoint(_0x4985e5,_0x1eb40e,_0x43f6c6,SDK_CONFIG_SOURCE);}}}}const _0x579162=_0x516a06[_0x3fef2a(0x101)](_0x235272=>_0x235272[_0x3fef2a(0x10d)])??_0x516a06[0x0];_0x579162&&(await initMultiAppEnvironment(_0x579162),_0x461667=writeProjectDomainRoutingManifest(_0x4985e5)[_0x3fef2a(0x13b)]);const _0x104300=analyzeProjectApiArchitecture(_0x4985e5);return{..._0x128c62,'completed':!_0x104300['manualMergeRequired'],'manualMergeRequired':_0x104300[_0x3fef2a(0x12d)],'routingPath':_0x461667};}
|
|
1
|
+
function a200_0x12de(_0x4f0b8b,_0x6e145e){_0x4f0b8b=_0x4f0b8b-0x1c8;const _0x1ed6fe=a200_0x1ed6();let _0x12de35=_0x1ed6fe[_0x4f0b8b];return _0x12de35;}const a200_0x480e72=a200_0x12de;(function(_0x4277dd,_0x2f3e92){const _0x266669=a200_0x12de,_0x47e1a5=_0x4277dd();while(!![]){try{const _0x389b3e=-parseInt(_0x266669(0x206))/0x1*(parseInt(_0x266669(0x1d3))/0x2)+-parseInt(_0x266669(0x1ce))/0x3*(parseInt(_0x266669(0x1ff))/0x4)+-parseInt(_0x266669(0x211))/0x5+-parseInt(_0x266669(0x202))/0x6+parseInt(_0x266669(0x1de))/0x7*(parseInt(_0x266669(0x1ee))/0x8)+parseInt(_0x266669(0x1fd))/0x9+-parseInt(_0x266669(0x1ca))/0xa*(-parseInt(_0x266669(0x1fc))/0xb);if(_0x389b3e===_0x2f3e92)break;else _0x47e1a5['push'](_0x47e1a5['shift']());}catch(_0x155b2e){_0x47e1a5['push'](_0x47e1a5['shift']());}}}(a200_0x1ed6,0xd81a5));import{copyFileSync,existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import a200_0x52928d 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';function a200_0x1ed6(){const _0x2a4371=['8QzPYke','basename','apiGroup','.rabetbase.json','backups','single','preserve','default','Model\x20facts\x20are\x20preserved\x20and\x20completed\x20from\x20legacy\x20generated\x20files\x20when\x20possible.','Recognized\x20legacy\x20CLI\x20scaffold;\x20a\x20backup\x20will\x20be\x20retained.','action','includes','string','Multiple\x20Lovrabet\x20model\x20profiles\x20match\x20Runtime\x20Domain','67925fFwLsx','11083140tMlQKO','create','36bzkefF','apiDir','some','9721110bIpcnN','find','./models.generated','candidates','5467KDuUow','client.ts','appcode','api.ts','./model-runtime','startsWith','dirname','No\x20Lovrabet\x20model\x20profile\x20matches\x20Runtime\x20Domain','defaultApp','candidatePath','migrate-single-app','3910535kkklpf','The\x20existing\x20runtime\x20selector\x20is\x20not\x20a\x20recognized\x20current\x20generated\x20file.','keys','outputDir','replace-generated','2060AyOohv','/**\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','.rabetbase','files','57129bGUOKh','push','relative','sdk-config.ts','object','116ItKxAE','entries','unchanged','map','length','normalizedApiDir','profiles','name','unconfigured','path','apps','8906884pNUTqv','parse','-api.ts','api-model-registry-v2','LOVRABET_RUNTIME_DOMAIN','Profile-aware\x20model\x20selection\x20generated\x20by\x20Rabetbase\x20CLI','project','modelRuntime','join','client','isDefault','project-upgrade','manual-merge','utf8','app','add'];a200_0x1ed6=function(){return _0x2a4371;};return a200_0x1ed6();}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_0x480e72(0x1e1),SDK_CONFIG_SOURCE=a200_0x480e72(0x1cb);function relativeMigrationDir(_0x41f446,_0xf834f1){const _0x1a96c0=a200_0x480e72,_0x491862=a200_0x52928d[_0x1a96c0(0x1d0)](_0x41f446,_0xf834f1);return _0x491862&&!_0x491862[_0x1a96c0(0x20b)]('..')?_0x491862:'external-api-dir';}function candidatePath(_0x29a262,_0x38ce6a,_0x438aca){const _0x5210ad=a200_0x480e72;return a200_0x52928d[_0x5210ad(0x1e6)](_0x29a262,_0x5210ad(0x1cc),'project-upgrade',MIGRATION_ID,_0x5210ad(0x205),relativeMigrationDir(_0x29a262,_0x38ce6a),_0x438aca);}function backupPath(_0x2f299e,_0x48a423,_0x8c85b6){const _0x38c895=a200_0x480e72;return a200_0x52928d['join'](_0x2f299e,_0x38c895(0x1cc),_0x38c895(0x1e9),MIGRATION_ID,_0x38c895(0x1f2),relativeMigrationDir(_0x2f299e,_0x48a423),_0x8c85b6);}function readOptional(_0x18c2b4){const _0x5e61e5=a200_0x480e72;try{return readFileSync(_0x18c2b4,_0x5e61e5(0x1eb));}catch{return undefined;}}function readJsonObject(_0x1ce4ac){const _0x5d412c=a200_0x480e72;try{const _0x3d8fb8=JSON[_0x5d412c(0x1df)](readFileSync(_0x1ce4ac,_0x5d412c(0x1eb)));return _0x3d8fb8&&typeof _0x3d8fb8===_0x5d412c(0x1d2)?_0x3d8fb8:{};}catch{return{};}}function planEntrypoint(_0xe7024b,_0x4d58d9,_0x3a8f5e,_0x5cc243){const _0xd5f092=a200_0x480e72,_0x30064=a200_0x52928d[_0xd5f092(0x1e6)](_0x4d58d9,_0x3a8f5e),_0x3fbac9=readOptional(_0x30064);if(_0x3fbac9===undefined)return{'path':_0x30064,'action':'create'};if(_0x3a8f5e==='api.ts'?_0x3fbac9[_0xd5f092(0x1f9)](_0xd5f092(0x204))&&_0x3fbac9['includes'](_0xd5f092(0x20a)):_0x3fbac9['includes'](_0xd5f092(0x1e2)))return{'path':_0x30064,'action':_0xd5f092(0x1d5)};if(_0x5cc243(_0x3fbac9))return{'path':_0x30064,'action':_0xd5f092(0x1c9),'reason':_0xd5f092(0x1f7)};return{'path':_0x30064,'action':_0xd5f092(0x1ea),'reason':'The\x20file\x20contains\x20project-owned\x20code\x20and\x20will\x20not\x20be\x20overwritten.','candidatePath':candidatePath(_0xe7024b,_0x4d58d9,_0x3a8f5e)};}function syntheticApps(_0x145b9e){const _0xc6084d=a200_0x480e72,_0x1231be=_0x145b9e[_0xc6084d(0x1dd)]&&typeof _0x145b9e[_0xc6084d(0x1dd)]===_0xc6084d(0x1d2)?_0x145b9e[_0xc6084d(0x1dd)]:undefined;if(_0x1231be&&Object[_0xc6084d(0x213)](_0x1231be)['length']>0x0){const _0x33bbf0=typeof _0x145b9e[_0xc6084d(0x20e)]===_0xc6084d(0x1fa)?_0x145b9e['defaultApp']:Object[_0xc6084d(0x213)](_0x1231be)['length']===0x1?Object[_0xc6084d(0x213)](_0x1231be)[0x0]:undefined;return Object[_0xc6084d(0x1d4)](_0x1231be)['flatMap'](([_0x1a6305,_0x5e71b9])=>{const _0x583282=_0xc6084d,_0x5a7fe2=_0x5e71b9,_0xeaee74=typeof _0x5a7fe2[_0x583282(0x208)]===_0x583282(0x1fa)?_0x5a7fe2['appcode']:'';return _0xeaee74?[{'name':_0x1a6305,'appcode':_0xeaee74,'apiGroup':typeof _0x5a7fe2[_0x583282(0x1f0)]===_0x583282(0x1fa)?_0x5a7fe2[_0x583282(0x1f0)]:undefined,'isDefault':_0x1a6305===_0x33bbf0,'region':'cn','regionSource':_0x583282(0x1f5),'apiDir':typeof _0x5a7fe2[_0x583282(0x200)]===_0x583282(0x1fa)?_0x5a7fe2[_0x583282(0x200)]:typeof _0x145b9e[_0x583282(0x200)]==='string'?_0x145b9e[_0x583282(0x200)]:undefined,'routingConfig':{}}]:[];});}const _0x21e868=typeof _0x145b9e['appcode']===_0xc6084d(0x1fa)?_0x145b9e['appcode']:typeof _0x145b9e[_0xc6084d(0x1ec)]===_0xc6084d(0x1fa)?_0x145b9e[_0xc6084d(0x1ec)]:undefined;if(!_0x21e868)return[];return[{'name':_0x21e868,'appcode':_0x21e868,'isDefault':!![],'region':'cn','regionSource':'default','apiDir':typeof _0x145b9e[_0xc6084d(0x200)]===_0xc6084d(0x1fa)?_0x145b9e[_0xc6084d(0x200)]:undefined,'routingConfig':{}}];}function configuredLayouts(_0x5e5626,_0x53b55c){const _0x3f6f3f=a200_0x480e72;return resolveApiProfileLayouts(_0x53b55c,_0x1faddb=>a200_0x52928d['resolve'](_0x5e5626,_0x1faddb[_0x3f6f3f(0x200)]||DEFAULT_API_DIR),_0x5e5626);}function uniqueRegistryGroups(_0x23e365){const _0x25ffe9=a200_0x480e72,_0x28da4e=[],_0x22ffd3=new Set(),_0x118800=new Set();for(const _0x4af18a of _0x23e365){const _0x2ed489=getRegistryGroup(_0x23e365,_0x4af18a);if(!_0x2ed489){_0x22ffd3['add'](_0x4af18a[_0x25ffe9(0x1c8)]);continue;}const _0x1a60a7=_0x4af18a[_0x25ffe9(0x1d8)]+'\x00'+(_0x4af18a['apiGroup']??_0x25ffe9(0x1f3));!_0x118800['has'](_0x1a60a7)&&(_0x28da4e[_0x25ffe9(0x1cf)](_0x2ed489),_0x118800[_0x25ffe9(0x1ed)](_0x1a60a7));}return{'groups':_0x28da4e,'skipped':[..._0x22ffd3]};}function planGroup(_0x4c954,_0xfba51a){const _0x652f4c=a200_0x480e72,_0x3d61a3=_0xfba51a[0x0]['normalizedApiDir'],_0x1179a1=a200_0x52928d['join'](_0x3d61a3,MODEL_RUNTIME_FILE_NAME),_0x13b979=readOptional(_0x1179a1),_0x23402e=_0x13b979!==undefined&&_0x13b979[_0x652f4c(0x1f9)](_0x652f4c(0x1e3))&&_0x13b979['includes'](_0x652f4c(0x1fb))&&_0x13b979[_0x652f4c(0x1f9)](_0x652f4c(0x20d)),_0xd5ba20=a200_0x52928d[_0x652f4c(0x1e6)](_0x3d61a3,MODEL_REGISTRY_FILE_NAME),_0x3d6995=a200_0x52928d[_0x652f4c(0x1e6)](_0x3d61a3,_0x652f4c(0x1d1)),_0x13a393=[planEntrypoint(_0x4c954,_0x3d61a3,_0x652f4c(0x209),isLegacyGeneratedApiScaffold),planEntrypoint(_0x4c954,_0x3d61a3,'client.ts',isLegacyGeneratedClientScaffold),{'path':_0x1179a1,'action':_0x13b979===undefined?_0x652f4c(0x1fe):_0x23402e?_0x652f4c(0x1d5):_0x652f4c(0x1ea),'reason':_0x13b979===undefined?undefined:_0x652f4c(0x212),..._0x13b979!==undefined&&!_0x23402e?{'candidatePath':candidatePath(_0x4c954,_0x3d61a3,MODEL_RUNTIME_FILE_NAME)}:{}},{'path':_0xd5ba20,'action':existsSync(_0xd5ba20)?_0x652f4c(0x1f4):'create','reason':_0x652f4c(0x1f6)},{'path':_0x3d6995,'action':existsSync(_0x3d6995)?_0x652f4c(0x1f4):_0x652f4c(0x1fe)}];return{'apiDir':_0x3d61a3,'profiles':_0xfba51a[_0x652f4c(0x1d6)](_0x3480b2=>_0x3480b2[_0x652f4c(0x1ec)]['name']),'files':_0x13a393};}export function analyzeProjectApiArchitecture(_0xd9af65,_0x2b3d9e){const _0x168866=a200_0x480e72,_0x466cf0=a200_0x52928d[_0x168866(0x1e6)](_0xd9af65,_0x168866(0x1f1)),_0x25e1e0=_0x2b3d9e??(existsSync(_0x466cf0)?readJsonObject(_0x466cf0):{}),_0x151c67=syntheticApps(_0x25e1e0);if(_0x151c67[_0x168866(0x1d7)]===0x0)return{'migration':MIGRATION_ID,'needed':![],'configAction':_0x168866(0x1db),'groups':[],'skippedLegacyDirectories':[],'manualMergeRequired':![]};const _0x44202b=_0x25e1e0[_0x168866(0x1dd)]?_0x168866(0x1d5):_0x168866(0x210),{groups:_0xf29ac,skipped:_0x39f30c}=uniqueRegistryGroups(configuredLayouts(_0xd9af65,_0x151c67)),_0x252518=_0xf29ac[_0x168866(0x1d6)](_0x145efb=>planGroup(_0xd9af65,_0x145efb)),_0x32a45e=_0x252518[_0x168866(0x201)](_0x3481b7=>_0x3481b7[_0x168866(0x1cd)]['some'](_0x2edbe6=>_0x2edbe6[_0x168866(0x1f8)]===_0x168866(0x1ea))),_0x5d8b4f=_0x44202b===_0x168866(0x210)||_0x252518[_0x168866(0x201)](_0x710696=>_0x710696['files'][_0x168866(0x201)](_0x113178=>![_0x168866(0x1d5),_0x168866(0x1f4)][_0x168866(0x1f9)](_0x113178['action'])));return{'migration':MIGRATION_ID,'needed':_0x5d8b4f,'configAction':_0x44202b,'groups':_0x252518,'skippedLegacyDirectories':_0x39f30c,'manualMergeRequired':_0x32a45e};}function migrateSingleAppConfig(_0x5e5d15){const _0xd0cc22=a200_0x480e72,_0x4b001b=a200_0x52928d[_0xd0cc22(0x1e6)](_0x5e5d15,_0xd0cc22(0x1f1));if(!existsSync(_0x4b001b))return;const _0x2e0610=readConfigFile(_0x4b001b);if(_0x2e0610[_0xd0cc22(0x1dd)]&&typeof _0x2e0610[_0xd0cc22(0x1dd)]==='object')return;const _0x37ed46=typeof _0x2e0610[_0xd0cc22(0x208)]==='string'?_0x2e0610[_0xd0cc22(0x208)]:typeof _0x2e0610[_0xd0cc22(0x1ec)]===_0xd0cc22(0x1fa)?_0x2e0610[_0xd0cc22(0x1ec)]:undefined;if(!_0x37ed46)return;_0x2e0610[_0xd0cc22(0x1dd)]={[_0x37ed46]:{'appcode':_0x37ed46}},_0x2e0610['defaultApp']=_0x37ed46,delete _0x2e0610['app'],delete _0x2e0610[_0xd0cc22(0x208)],writeConfigFile(_0x4b001b,_0x2e0610);}function legacyApiPath(_0x3a06c3,_0x483689){const _0x18e1a1=a200_0x480e72,_0x11345d=_0x483689[_0x18e1a1(0x1d8)],_0x2a47bc=_0x3a06c3[_0x18e1a1(0x1d7)]===0x1||_0x483689[_0x18e1a1(0x1ec)][_0x18e1a1(0x1e8)]?[a200_0x52928d[_0x18e1a1(0x1e6)](_0x11345d,'api.ts'),a200_0x52928d['join'](_0x11345d,_0x483689[_0x18e1a1(0x1ec)][_0x18e1a1(0x1da)]+'-api.ts')]:[a200_0x52928d['join'](_0x11345d,_0x483689[_0x18e1a1(0x1ec)][_0x18e1a1(0x1da)]+_0x18e1a1(0x1e0))];return _0x2a47bc['find'](existsSync);}function writeCandidateOrEntrypoint(_0x23f9d3,_0x3ca359,_0x5cb817,_0x27cdd5){const _0x31ec67=a200_0x480e72;if(_0x5cb817['action']==='unchanged'||_0x5cb817['action']===_0x31ec67(0x1f4))return;if(_0x5cb817[_0x31ec67(0x1f8)]===_0x31ec67(0x1ea)){const _0x524c53=_0x5cb817[_0x31ec67(0x20f)];mkdirSync(a200_0x52928d[_0x31ec67(0x20c)](_0x524c53),{'recursive':!![]}),writeFileSync(_0x524c53,_0x27cdd5,'utf8');return;}if(_0x5cb817[_0x31ec67(0x1f8)]===_0x31ec67(0x1c9)){const _0x3d7a96=backupPath(_0x23f9d3,_0x3ca359,a200_0x52928d[_0x31ec67(0x1ef)](_0x5cb817[_0x31ec67(0x1dc)]));mkdirSync(a200_0x52928d[_0x31ec67(0x20c)](_0x3d7a96),{'recursive':!![]}),copyFileSync(_0x5cb817[_0x31ec67(0x1dc)],_0x3d7a96);}mkdirSync(a200_0x52928d[_0x31ec67(0x20c)](_0x5cb817[_0x31ec67(0x1dc)]),{'recursive':!![]}),writeFileSync(_0x5cb817[_0x31ec67(0x1dc)],_0x27cdd5,_0x31ec67(0x1eb));}export async function upgradeProjectApiArchitecture(_0x25d390){const _0x2a76f6=a200_0x480e72,_0x45a273=analyzeProjectApiArchitecture(_0x25d390);migrateSingleAppConfig(_0x25d390);const _0x43d7c7=getMultiAppConfigs(_0x2a76f6(0x1e4),_0x25d390)??[],_0xa204dc=configuredLayouts(_0x25d390,_0x43d7c7),{groups:_0x25f154}=uniqueRegistryGroups(_0xa204dc);let _0x12a26f;for(const _0x550f96 of _0x25f154){const _0x489d7c=_0x550f96[0x0][_0x2a76f6(0x1d8)];mkdirSync(_0x489d7c,{'recursive':!![]});const _0x577b3d=_0x550f96[_0x2a76f6(0x203)](_0x1738bb=>_0x1738bb[_0x2a76f6(0x1ec)]['isDefault'])??_0x550f96[0x0];for(const _0x2f4161 of _0x550f96){const _0x30672b=a200_0x52928d[_0x2a76f6(0x1e6)](_0x489d7c,MODEL_REGISTRY_FILE_NAME),_0x3eb601=readModelRegistry(_0x30672b);if(_0x3eb601?.[_0x2a76f6(0x1d9)][_0x2f4161[_0x2a76f6(0x1ec)][_0x2a76f6(0x1da)]])continue;const _0x47eb41=legacyApiPath(_0x550f96,_0x2f4161),_0xc00a35=_0x47eb41?readOptional(_0x47eb41):undefined;await initMultiAppEnvironment(_0x2f4161[_0x2a76f6(0x1ec)]),updateModelRegistry({'outputDir':_0x489d7c,'profileName':_0x2f4161['app']['name'],'defaultProfile':_0x577b3d['app'][_0x2a76f6(0x1da)],'appCode':_0x2f4161[_0x2a76f6(0x1ec)][_0x2a76f6(0x208)],'runtimeDomain':getRuntimeDomain(),'models':_0xc00a35?parseLegacyApiModels(_0xc00a35):[]});}const _0x143c95=await renderModelRegistryScaffold(_0x489d7c,_0x25d390),_0x474657=planGroup(_0x25d390,_0x550f96);for(const _0x35aa17 of _0x474657[_0x2a76f6(0x1cd)]){const _0xecc341=a200_0x52928d[_0x2a76f6(0x1ef)](_0x35aa17[_0x2a76f6(0x1dc)]);if(_0xecc341===_0x2a76f6(0x209))writeCandidateOrEntrypoint(_0x25d390,_0x489d7c,_0x35aa17,_0x143c95['api']);else{if(_0xecc341===_0x2a76f6(0x207))writeCandidateOrEntrypoint(_0x25d390,_0x489d7c,_0x35aa17,_0x143c95[_0x2a76f6(0x1e7)]);else{if(_0xecc341===MODEL_RUNTIME_FILE_NAME)writeCandidateOrEntrypoint(_0x25d390,_0x489d7c,_0x35aa17,_0x143c95[_0x2a76f6(0x1e5)]);else _0xecc341==='sdk-config.ts'&&_0x35aa17[_0x2a76f6(0x1f8)]===_0x2a76f6(0x1fe)&&writeCandidateOrEntrypoint(_0x25d390,_0x489d7c,_0x35aa17,SDK_CONFIG_SOURCE);}}}}const _0x1e386a=_0x43d7c7[_0x2a76f6(0x203)](_0xccd14b=>_0xccd14b[_0x2a76f6(0x1e8)])??_0x43d7c7[0x0];_0x1e386a&&(await initMultiAppEnvironment(_0x1e386a),_0x12a26f=writeProjectDomainRoutingManifest(_0x25d390)[_0x2a76f6(0x1dc)]);const _0x2ab9cd=analyzeProjectApiArchitecture(_0x25d390);return{..._0x45a273,'completed':!_0x2ab9cd['manualMergeRequired'],'manualMergeRequired':_0x2ab9cd['manualMergeRequired'],'routingPath':_0x12a26f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x448497,_0x1a6647){const _0x26eada=a201_0x360a,_0x4ac601=_0x448497();while(!![]){try{const _0x3a7dfa=parseInt(_0x26eada(0x1ee))/0x1*(parseInt(_0x26eada(0x1f5))/0x2)+parseInt(_0x26eada(0x1e2))/0x3*(parseInt(_0x26eada(0x1e5))/0x4)+parseInt(_0x26eada(0x1de))/0x5*(parseInt(_0x26eada(0x1ed))/0x6)+-parseInt(_0x26eada(0x1f1))/0x7+-parseInt(_0x26eada(0x1f2))/0x8+parseInt(_0x26eada(0x1e8))/0x9+-parseInt(_0x26eada(0x1e6))/0xa;if(_0x3a7dfa===_0x1a6647)break;else _0x4ac601['push'](_0x4ac601['shift']());}catch(_0x5c52cc){_0x4ac601['push'](_0x4ac601['shift']());}}}(a201_0x138d,0x9a29b));import{existsSync}from'node:fs';import a201_0x5e3d5c from'node:path';import a201_0x38d702 from'chalk';import{input,confirm}from'@inquirer/prompts';function a201_0x360a(_0x3132a5,_0x2a70ef){_0x3132a5=_0x3132a5-0x1dd;const _0x138d40=a201_0x138d();let _0x360a0f=_0x138d40[_0x3132a5];return _0x360a0f;}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(_0x3cd8f3,_0x4c5a8a,_0x4a73f4){const _0xf3fed0=a201_0x360a,_0x24355a=_0xf3fed0(0x1dd),_0x4b1201=readConfig(),_0x176bdd=typeof _0x4b1201[_0xf3fed0(0x1e1)]===_0xf3fed0(0x1f8)?_0x4b1201[_0xf3fed0(0x1e1)]:undefined,_0x5bb10f=await input({'message':'Project\x20name:','default':_0x24355a,'validate':_0x19eef4=>{const _0x284f21=_0xf3fed0,_0x454de8=_0x19eef4[_0x284f21(0x1f9)]()||_0x24355a,_0x26478c=getProjectNameValidationError(_0x454de8);if(_0x26478c)return _0x26478c;const _0x1fe1b2=a201_0x5e3d5c['resolve'](process[_0x284f21(0x1f7)](),_0x454de8);if(existsSync(_0x1fe1b2))return _0x284f21(0x1f4)+_0x454de8+_0x284f21(0x1e0);return!![];}});console[_0xf3fed0(0x1e9)](a201_0x38d702[_0xf3fed0(0x1e3)](_0xf3fed0(0x1e7)+a201_0x38d702[_0xf3fed0(0x1ec)](_0x5bb10f)));const _0x257b0b=await selectSingleAppcode(_0x4a73f4);console[_0xf3fed0(0x1e9)](a201_0x38d702[_0xf3fed0(0x1e3)](_0xf3fed0(0x1ea)+a201_0x38d702[_0xf3fed0(0x1ec)](_0x257b0b||_0xf3fed0(0x1f0))));if(_0x257b0b){const _0x14308a=await getIsSessionValid();if(!_0x14308a){const _0x1d26a2=await confirm({'message':_0xf3fed0(0x1eb),'default':!![]});if(_0x1d26a2){const _0x4f2115=await authServer({'silent':!![]});console[_0xf3fed0(0x1e9)](a201_0x38d702[_0xf3fed0(0x1e3)](_0xf3fed0(0x1f6)+a201_0x38d702[_0xf3fed0(0x1ec)](_0x4f2115?_0xf3fed0(0x1e4):_0xf3fed0(0x1ef))));}else console[_0xf3fed0(0x1e9)](a201_0x38d702['green'](_0xf3fed0(0x1f6)+a201_0x38d702[_0xf3fed0(0x1ec)](_0xf3fed0(0x1f3))));}await _0x3cd8f3({'projectName':_0x5bb10f,'appCode':_0x257b0b,'env':_0x4c5a8a||_0x176bdd||_0xf3fed0(0x1df)});}else await _0x3cd8f3({'projectName':_0x5bb10f,'env':_0x4c5a8a||_0x176bdd||_0xf3fed0(0x1df)});}function a201_0x138d(){const _0x17545a=['my-app','20fesmuF','production','\x22\x20already\x20exists','env','3385545VfGpFD','green','Logged\x20in','4dQyFoX','3902750oGRVSk','√\x20Project\x20Name:\x20','6785280YgnwAY','log','√\x20App\x20Code:\x20','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','cyan','894378OQPeUU','1fOLgNg','Login\x20failed','Not\x20set','2965116jvyibq','8619448OBYkfJ','Skipped','Directory\x20\x22','88116senxFz','√\x20Login\x20status:\x20','cwd','string','trim'];a201_0x138d=function(){return _0x17545a;};return a201_0x138d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a202_0x539f(_0x105bc5,_0x1cb1c6){_0x105bc5=_0x105bc5-0x17e;const _0x124f4d=a202_0x124f();let _0x539fc7=_0x124f4d[_0x105bc5];return _0x539fc7;}(function(_0x244782,_0x59b4a2){const _0x1fa49=a202_0x539f,_0xdd5377=_0x244782();while(!![]){try{const _0xf1ac2=parseInt(_0x1fa49(0x181))/0x1*(parseInt(_0x1fa49(0x185))/0x2)+-parseInt(_0x1fa49(0x184))/0x3*(-parseInt(_0x1fa49(0x18a))/0x4)+parseInt(_0x1fa49(0x17e))/0x5+parseInt(_0x1fa49(0x189))/0x6+parseInt(_0x1fa49(0x180))/0x7*(-parseInt(_0x1fa49(0x183))/0x8)+parseInt(_0x1fa49(0x17f))/0x9*(-parseInt(_0x1fa49(0x18c))/0xa)+-parseInt(_0x1fa49(0x18b))/0xb*(-parseInt(_0x1fa49(0x188))/0xc);if(_0xf1ac2===_0x59b4a2)break;else _0xdd5377['push'](_0xdd5377['shift']());}catch(_0x87a306){_0xdd5377['push'](_0xdd5377['shift']());}}}(a202_0x124f,0x9b21b));function a202_0x124f(){const _0x1990e1=['48567FsyBLe','1439532VZjvWv','now','replace','4829880FZHhob','2164446UrToKK','164TTDEDs','22vbuZqu','240aYjGjp','1059505FWBizr','469647gWoahv','36827GrvffX','1GcTbJJ','toFixed','1328eFrfVh'];a202_0x124f=function(){return _0x1990e1;};return a202_0x124f();}export function formatElapsed(_0x341fbe){const _0x1e2c5c=a202_0x539f,_0x1fe4b5=Date[_0x1e2c5c(0x186)]()-_0x341fbe;if(_0x1fe4b5<0x3e8)return _0x1fe4b5+'ms';const _0x4eb3aa=(_0x1fe4b5/0x3e8)[_0x1e2c5c(0x182)](0x2),_0x32cf38=_0x4eb3aa[_0x1e2c5c(0x187)](/\.?0+$/u,'');return _0x32cf38+'s';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2e1d48,_0x50d4b0){const _0x3990c2=a203_0x392e,_0x5108ea=_0x2e1d48();while(!![]){try{const _0x1ad283=-parseInt(_0x3990c2(0x1ce))/0x1*(-parseInt(_0x3990c2(0x1ad))/0x2)+parseInt(_0x3990c2(0x1b7))/0x3+parseInt(_0x3990c2(0x20a))/0x4+parseInt(_0x3990c2(0x1e9))/0x5*(-parseInt(_0x3990c2(0x1ec))/0x6)+-parseInt(_0x3990c2(0x1ac))/0x7*(-parseInt(_0x3990c2(0x1a7))/0x8)+-parseInt(_0x3990c2(0x1e6))/0x9+-parseInt(_0x3990c2(0x1c1))/0xa;if(_0x1ad283===_0x50d4b0)break;else _0x5108ea['push'](_0x5108ea['shift']());}catch(_0xf85878){_0x5108ea['push'](_0x5108ea['shift']());}}}(a203_0x1e00,0x4dc04));import a203_0x298087 from'path';import a203_0x1ccca2 from'fs';import a203_0xd8fa06 from'chalk';import a203_0x291321 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';function a203_0x392e(_0x4c6e19,_0x16c99e){_0x4c6e19=_0x4c6e19-0x19f;const _0x1e0034=a203_0x1e00();let _0x392edb=_0x1e0034[_0x4c6e19];return _0x392edb;}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';function a203_0x1e00(){const _0x56bd72=['√\x20package.json\x20updated:\x20name=','constants','Failed\x20to\x20configure\x20app\x20AppCode','9338070xJzcZi','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','\x20dataset(s),\x20generated\x20','stringify','modelCount','API\x20configuration\x20pull\x20failed','utf8','currentDir','validation','currentVersion','existsSync','renameSync','636023MCIMOw','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','repeat','Verifying\x20project\x20template','Install\x20dependencies','Copying\x20local\x20template\x20source','Project\x20template\x20ready','green','push','warn','cwd','text','\x20&&\x20','cd\x20','dev','apps','create','\x20√\x20','CLI\x20version\x20check','stop','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','W_OK','\x20api\x20pull\x20--force\x20--yes','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','4505274YIDbgn','\x20already\x20exists','\x20model(s)','2845ovOpki','env','Project\x20directory\x20','96jANcVM','Format\x20code','readdirSync','basename','ino','The\x20current\x20directory\x20must\x20be\x20empty.','keys','description','join','Project\x20created:\x20','templateSource','copying','log','appCode','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','\x20run\x20start','package.json','needsUpgrade','lstatSync','start','cyan','1.0.0','Resolving\x20project\x20template','chdir','production','√\x20Pulled\x20','info','\x20\x202.\x20Pull\x20API\x20configuration:\x20','Project\x20creation\x20failed:\x20','verifying','1464752mKyLxr','projectCode','message','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','resolve','name','readFileSync','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.','Configured\x20app\x20AppCode:\x20','*\x20Pulling\x20API\x20configuration...','belowMinimum','dirname','length','parse','setLogPath','extracting','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','Project\x20name:\x20','Downloading\x20project\x20template','version','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','mkdtempSync','8stchtf','...','bold','error','toLocaleString','2778237GdkZrH','2ItZYVw','rmSync','Updating\x20package.json\x20name','\x20\x201.\x20Start\x20project:\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','Starting\x20project\x20creation:\x20','gray','projectName','relative','downloading','1088589AEFnIn','cookie','reverse','\x20|\x20Default:\x20implicit\x20(single\x20app)','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','project'];a203_0x1e00=function(){return _0x56bd72;};return a203_0x1e00();}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(_0x5329b9){const _0x51fa24=a203_0x392e;try{const _0x254fdf=a203_0x1ccca2[_0x51fa24(0x1fe)](_0x5329b9);if(!_0x254fdf['isDirectory']())return null;return{'dev':_0x254fdf['dev'],'ino':_0x254fdf[_0x51fa24(0x1f0)]};}catch{return null;}}function isSameDirectory(_0x1dd915,_0x55d9bf){const _0x5edc39=a203_0x392e;return!!_0x1dd915&&!!_0x55d9bf&&_0x1dd915[_0x5edc39(0x1dc)]===_0x55d9bf[_0x5edc39(0x1dc)]&&_0x1dd915[_0x5edc39(0x1f0)]===_0x55d9bf[_0x5edc39(0x1f0)];}function commitCurrentDirectoryProject(_0x4eeec4,_0x2ae298,_0x430cf9){const _0x3590bf=a203_0x392e;if(!isSameDirectory(readDirectoryIdentity(_0x4eeec4),_0x430cf9))throw new Error(_0x3590bf(0x1a1));const _0x41555b=a203_0x298087[_0x3590bf(0x1ef)](_0x2ae298),_0x24585b=a203_0x1ccca2[_0x3590bf(0x1ee)](_0x4eeec4);if(_0x24585b[_0x3590bf(0x216)]!==0x1||_0x24585b[0x0]!==_0x41555b)throw CliErrors[_0x3590bf(0x1ca)](_0x3590bf(0x211),_0x3590bf(0x1bc));const _0x31113b=a203_0x298087['join'](_0x2ae298,_0x3590bf(0x1bd)),_0x41928d=[];try{for(const _0x4b5b75 of a203_0x1ccca2[_0x3590bf(0x1ee)](_0x31113b)){a203_0x1ccca2[_0x3590bf(0x1cd)](a203_0x298087['join'](_0x31113b,_0x4b5b75),a203_0x298087['join'](_0x4eeec4,_0x4b5b75)),_0x41928d[_0x3590bf(0x1d6)](_0x4b5b75);}a203_0x1ccca2[_0x3590bf(0x1ae)](_0x2ae298,{'recursive':!![],'force':!![]});}catch(_0x8f14d){for(const _0x3a7fcc of _0x41928d[_0x3590bf(0x1b9)]()){const _0x38a59e=a203_0x298087[_0x3590bf(0x1f4)](_0x4eeec4,_0x3a7fcc);if(!a203_0x1ccca2[_0x3590bf(0x1cc)](_0x38a59e))continue;a203_0x1ccca2['renameSync'](_0x38a59e,a203_0x298087[_0x3590bf(0x1f4)](_0x31113b,_0x3a7fcc));}throw _0x8f14d;}}export async function createApp(_0x344c48){const _0x5e3cd0=a203_0x392e,_0x35f858=await checkCliVersion();(_0x35f858[_0x5e3cd0(0x1fd)]||_0x35f858[_0x5e3cd0(0x214)])&&(printCliUpgradeWarning(_0x35f858),assertCliVersionSupported(_0x35f858),logger[_0x5e3cd0(0x206)]('create',_0x5e3cd0(0x1e0),{'currentVersion':_0x35f858[_0x5e3cd0(0x1cb)],'stableVersion':_0x35f858['stableVersion'],'minimumVersion':_0x35f858['minimumVersion'],'needsUpgrade':_0x35f858['needsUpgrade'],'belowMinimum':_0x35f858['belowMinimum']}));const _0x498b5c=_0x344c48[_0x5e3cd0(0x1c9)]?a203_0x298087[_0x5e3cd0(0x1ef)](process[_0x5e3cd0(0x1d8)]()):_0x344c48[_0x5e3cd0(0x20b)];if(_0x498b5c&&(_0x344c48[_0x5e3cd0(0x1f9)]||_0x344c48['nonInteractive']))await runCreate({'projectName':_0x498b5c,'appCode':_0x344c48['appCode'],'env':_0x344c48[_0x5e3cd0(0x1ea)]},_0x344c48);else{if(_0x498b5c){const _0x4514a3=await selectSingleAppcode(_0x344c48[_0x5e3cd0(0x1b8)]);await runCreate({'projectName':_0x498b5c,'appCode':_0x4514a3||undefined,'env':_0x344c48['env']},_0x344c48);}else await guidedCreateProject(_0x3de665=>runCreate(_0x3de665,_0x344c48),_0x344c48['env'],_0x344c48[_0x5e3cd0(0x1b8)]);}}async function runCreate(_0x41450f,_0x1a6104){const _0x18b422=a203_0x392e;_0x41450f[_0x18b422(0x1b4)]=validateProjectName(_0x41450f['projectName']);const _0x39eb5f=_0x1a6104['currentDir']?process['cwd']():a203_0x298087['resolve'](process['cwd'](),_0x41450f['projectName']);if(_0x1a6104[_0x18b422(0x1c9)]){if(a203_0x1ccca2[_0x18b422(0x1ee)](_0x39eb5f)[_0x18b422(0x216)]>0x0)throw CliErrors[_0x18b422(0x1ca)](_0x18b422(0x1f1),_0x18b422(0x1e5));}else{if(a203_0x1ccca2[_0x18b422(0x1cc)](_0x39eb5f))throw new Error(_0x18b422(0x1eb)+_0x41450f[_0x18b422(0x1b4)]+_0x18b422(0x1e7));}let _0x24c271=null;const _0xbdf52d=_0x1a6104[_0x18b422(0x1c9)]?readDirectoryIdentity(_0x39eb5f):null;let _0x1fa17a=null;try{a203_0x1ccca2['accessSync'](a203_0x298087[_0x18b422(0x215)](_0x39eb5f),a203_0x1ccca2[_0x18b422(0x1bf)][_0x18b422(0x1e3)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x18b422(0x206)](_0x18b422(0x1de),_0x18b422(0x1b2)+_0x41450f[_0x18b422(0x1b4)],{'projectDir':_0x39eb5f,'appCode':_0x41450f[_0x18b422(0x1f9)]}),console['log'](),console[_0x18b422(0x1f8)](a203_0xd8fa06[_0x18b422(0x1d5)](_0x18b422(0x1df))+_0x18b422(0x1a2)+a203_0xd8fa06[_0x18b422(0x1d5)](_0x41450f[_0x18b422(0x1b4)])+(_0x41450f[_0x18b422(0x1f9)]?'\x20|\x20AppCode:\x20'+a203_0xd8fa06[_0x18b422(0x200)](_0x41450f['appCode']):''));try{let _0x41b950=_0x41450f[_0x18b422(0x1b4)];_0x1a6104[_0x18b422(0x1c9)]&&(_0x1fa17a=a203_0x1ccca2[_0x18b422(0x1a6)](a203_0x298087['join'](_0x39eb5f,'.rabetbase-create-')),_0x41b950=a203_0x298087[_0x18b422(0x1b5)](process['cwd'](),a203_0x298087[_0x18b422(0x1f4)](_0x1fa17a,_0x18b422(0x1bd))));const _0xc6a80=a203_0x298087[_0x18b422(0x20e)](process[_0x18b422(0x1d8)](),_0x41b950);await runTask(_0x18b422(0x202),_0x180156=>copyProjectTemplate(_0x41b950,_0x4bdd3b=>_0x180156(projectTemplateStageLabel(_0x4bdd3b)),_0x1a6104[_0x18b422(0x1f6)]),_0x18b422(0x1d4)),_0x24c271=_0x1a6104['currentDir']?null:readDirectoryIdentity(_0x39eb5f);if(!_0x1a6104[_0x18b422(0x1c9)]&&!_0x24c271)throw new Error(_0x18b422(0x1fa));await updatePackageJsonName(_0x41b950,_0x41450f[_0x18b422(0x1b4)]),await runTask(_0x18b422(0x1d2),()=>installDependencies(_0x41b950)),await runTask(_0x18b422(0x1ed),()=>formatProjectCode(_0x41b950)),await configureAppCode(_0x41b950,_0x41450f[_0x18b422(0x1b4)],_0x41450f['appCode']||'',_0x41450f[_0x18b422(0x1ea)]);let _0x5a1ee9=![];if(_0x41450f['appCode']){console[_0x18b422(0x1f8)](_0x18b422(0x213));const _0x49b01a=process[_0x18b422(0x1d8)]();try{process[_0x18b422(0x203)](_0xc6a80);const _0x131e3d=_0x41450f[_0x18b422(0x1ea)]||_0x18b422(0x204);initEnv(_0x131e3d);const {configArray:_0x46e261}=await fetchModelList(_0x41450f[_0x18b422(0x1f9)],_0x1a6104['cookie']||''),_0x3c5988=DEFAULT_API_DIR,_0x36e860=await generateApiFile(_0x46e261,'',_0x41450f['appCode'],!![],_0x131e3d,_0x3c5988,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![],'modelProfile':{'name':_0x41450f[_0x18b422(0x1f9)],'defaultName':_0x41450f[_0x18b422(0x1f9)],'runtimeDomain':getRuntimeDomain()}});console[_0x18b422(0x1f8)](_0x18b422(0x205)+_0x46e261['length']+_0x18b422(0x1c4)+_0x36e860[_0x18b422(0x1c6)]+_0x18b422(0x1e8)),logger['info'](_0x18b422(0x1de),'API\x20configuration\x20pulled:\x20'+_0x41450f[_0x18b422(0x1f9)]);}catch(_0x3d2f2a){_0x5a1ee9=!![],console[_0x18b422(0x1f8)](_0x18b422(0x1bb)+CLI_BIN_NAME+'\x20api\x20pull\x20--force\x20--yes'),logger[_0x18b422(0x1d7)]('create',_0x18b422(0x1c7),{'error':_0x3d2f2a instanceof Error?_0x3d2f2a[_0x18b422(0x20c)]:String(_0x3d2f2a)});}finally{process['chdir'](_0x49b01a);}}if(_0x1a6104[_0x18b422(0x1c9)]){if(!_0x1fa17a||!_0xbdf52d)throw new Error(_0x18b422(0x1c2));commitCurrentDirectoryProject(_0x39eb5f,_0x1fa17a,_0xbdf52d),_0x1fa17a=null;}try{logger[_0x18b422(0x19f)](_0x39eb5f),logger['success'](_0x18b422(0x1de),_0x18b422(0x1f5)+_0x41450f[_0x18b422(0x1b4)]);}catch(_0x45d9e2){console[_0x18b422(0x1d7)]('!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20'+(_0x45d9e2 instanceof Error?_0x45d9e2[_0x18b422(0x20c)]:String(_0x45d9e2)));}console[_0x18b422(0x1f8)](),console[_0x18b422(0x1f8)](a203_0xd8fa06[_0x18b422(0x1d5)]('─'[_0x18b422(0x1d0)](0x3c))),console[_0x18b422(0x1f8)](a203_0xd8fa06[_0x18b422(0x200)][_0x18b422(0x1a9)]('🚀\x20Next\x20Steps:')),console['log']();const _0x57b667=_0x1a6104[_0x18b422(0x1c9)]?CLI_BIN_NAME+_0x18b422(0x1fb):_0x18b422(0x1db)+_0x41450f[_0x18b422(0x1b4)]+_0x18b422(0x1da)+CLI_BIN_NAME+_0x18b422(0x1fb);console[_0x18b422(0x1f8)](_0x18b422(0x1b0)+a203_0xd8fa06[_0x18b422(0x200)]['bold'](_0x57b667)),_0x5a1ee9&&console['log'](_0x18b422(0x207)+a203_0xd8fa06[_0x18b422(0x200)][_0x18b422(0x1a9)](CLI_BIN_NAME+_0x18b422(0x1e4))),console[_0x18b422(0x1f8)](a203_0xd8fa06[_0x18b422(0x1d5)]('─'[_0x18b422(0x1d0)](0x3c)));}catch(_0x65df56){logger[_0x18b422(0x1aa)](_0x18b422(0x1de),_0x18b422(0x208)+_0x41450f['projectName'],{'error':_0x65df56 instanceof Error?_0x65df56[_0x18b422(0x20c)]:String(_0x65df56)});try{const _0x597cc5=readDirectoryIdentity(_0x39eb5f);if(_0x1a6104[_0x18b422(0x1c9)]&&_0x1fa17a)a203_0x1ccca2[_0x18b422(0x1ae)](_0x1fa17a,{'recursive':!![],'force':!![]});else{if(_0x24c271&&_0x597cc5?.['dev']===_0x24c271['dev']&&_0x597cc5[_0x18b422(0x1f0)]===_0x24c271['ino'])console[_0x18b422(0x1f8)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x39eb5f),a203_0x1ccca2[_0x18b422(0x1ae)](_0x39eb5f,{'recursive':!![],'force':!![]});else _0x597cc5&&logger[_0x18b422(0x1d7)]('create',_0x18b422(0x1e2)+_0x39eb5f);}}catch{logger['warn']('create',_0x18b422(0x1c3)+_0x39eb5f);}throw _0x65df56;}}async function runTask(_0x49e2bd,_0x1f3f7d,_0x38aa2e=_0x49e2bd){const _0x223eb0=a203_0x392e,_0x3f90bf=a203_0x291321(_0x49e2bd+_0x223eb0(0x1a8))[_0x223eb0(0x1ff)]();try{const _0x20213a=await _0x1f3f7d(_0x2fcca9=>{const _0x236bc0=_0x223eb0;_0x3f90bf[_0x236bc0(0x1d9)]=_0x2fcca9+_0x236bc0(0x1a8);});_0x3f90bf[_0x223eb0(0x1e1)](),console[_0x223eb0(0x1f8)](''+a203_0xd8fa06[_0x223eb0(0x1d5)]('\x20√\x20')+_0x38aa2e+'\x20'+a203_0xd8fa06[_0x223eb0(0x1b3)]('['+_0x20213a+']'));}catch(_0xa4bf61){_0x3f90bf['fail'](_0x49e2bd);throw _0xa4bf61;}}function projectTemplateStageLabel(_0x344a77){const _0x55501b=a203_0x392e;switch(_0x344a77){case'resolving':return _0x55501b(0x202);case _0x55501b(0x1b6):return _0x55501b(0x1a3);case _0x55501b(0x209):return _0x55501b(0x1d1);case _0x55501b(0x1a0):return'Extracting\x20project\x20template';case _0x55501b(0x1f7):return _0x55501b(0x1d3);}}async function updatePackageJsonName(_0x2463ab,_0x537d66){const _0x5af336=a203_0x392e,_0x5d70bf=a203_0x298087[_0x5af336(0x20e)](process[_0x5af336(0x1d8)](),_0x2463ab),_0x11b367=a203_0x298087[_0x5af336(0x1f4)](_0x5d70bf,'package.json');try{console[_0x5af336(0x1f8)](_0x5af336(0x1a5));const _0x540c0b=getRabetbaseCliPackageRoot(),_0x379fa5=a203_0x298087[_0x5af336(0x1f4)](_0x540c0b,_0x5af336(0x1fc));let _0x4bdf30=_0x5af336(0x201);try{const _0x260485=JSON[_0x5af336(0x217)](a203_0x1ccca2['readFileSync'](_0x379fa5,_0x5af336(0x1c8)));_0x4bdf30=_0x260485[_0x5af336(0x1a4)]||_0x5af336(0x201);}catch{}const _0x172a46=a203_0x1ccca2[_0x5af336(0x210)](_0x11b367,_0x5af336(0x1c8)),_0x13f0ea=JSON[_0x5af336(0x217)](_0x172a46);_0x13f0ea[_0x5af336(0x20f)]=_0x537d66,_0x13f0ea[_0x5af336(0x1f3)]=_0x537d66+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x4bdf30,a203_0x1ccca2['writeFileSync'](_0x11b367,JSON[_0x5af336(0x1c5)](_0x13f0ea,null,0x2)+'\x0a',_0x5af336(0x1c8)),console['log'](_0x5af336(0x1be)+_0x537d66),logger['info'](_0x5af336(0x1de),_0x5af336(0x1af));}catch(_0x3044dd){logger[_0x5af336(0x1aa)](_0x5af336(0x1de),'Failed\x20to\x20update\x20package.json');throw _0x3044dd;}}async function configureAppCode(_0x448689,_0x2f78fc,_0x58503d,_0x1e0547){const _0xd8e162=a203_0x392e,_0x4e8a42=a203_0x298087[_0xd8e162(0x20e)](process['cwd'](),_0x448689),_0x7003c=a203_0x298087[_0xd8e162(0x1f4)](_0x4e8a42,NEW_CONFIG_NAME);try{_0x58503d?console[_0xd8e162(0x1f8)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x2f78fc+':\x20'+_0x58503d):console[_0xd8e162(0x1f8)](_0xd8e162(0x20d)+_0x2f78fc);const _0x333e3a=getRabetbaseCliPackageRoot(),_0x4e0377=a203_0x298087[_0xd8e162(0x1f4)](_0x333e3a,_0xd8e162(0x1fc));let _0x142465=_0xd8e162(0x201);try{const _0x23da18=JSON[_0xd8e162(0x217)](a203_0x1ccca2[_0xd8e162(0x210)](_0x4e0377,_0xd8e162(0x1c8)));_0x142465=_0x23da18[_0xd8e162(0x1a4)]||'1.0.0';}catch{}const {globalConfig:_0x5325d5}=loadRawConfigLayers(),_0x11d908=typeof _0x5325d5['env']==='string'?_0x5325d5['env']:undefined,_0x3adfc2={};for(const _0x30f74f of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x5325d5[_0x30f74f]!=null)_0x3adfc2[_0x30f74f]=_0x5325d5[_0x30f74f];}const _0x134204=buildCanonicalProjectConfig(_0x3adfc2,{'appCodes':_0x58503d?[_0x58503d]:[],'env':_0x1e0547||_0x11d908||_0xd8e162(0x204),'metadata':{'createdAt':new Date()[_0xd8e162(0x1ab)](),'version':_0x142465}});writeConfigFile(_0x7003c,_0x134204),await generateSdkConfigFile(a203_0x298087[_0xd8e162(0x1f4)](_0x4e8a42,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x4e8a42),_0x58503d?console[_0xd8e162(0x1f8)]('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object[_0xd8e162(0x1f2)](_0x134204[_0xd8e162(0x1dd)]||{})[_0xd8e162(0x1f4)](',\x20')+_0xd8e162(0x1ba)):console[_0xd8e162(0x1f8)](_0xd8e162(0x1cf)+CLI_BIN_NAME+_0xd8e162(0x1b1)),logger[_0xd8e162(0x206)](_0xd8e162(0x1de),_0xd8e162(0x212)+_0x58503d);}catch(_0x3594d8){logger['error']('create',_0xd8e162(0x1c0));throw _0x3594d8;}}
|
|
1
|
+
(function(_0x284302,_0x36a32c){const _0x30cf04=a203_0x3bdb,_0x539324=_0x284302();while(!![]){try{const _0x4107c6=parseInt(_0x30cf04(0x1ce))/0x1+parseInt(_0x30cf04(0x165))/0x2+parseInt(_0x30cf04(0x161))/0x3+-parseInt(_0x30cf04(0x1c7))/0x4*(-parseInt(_0x30cf04(0x16d))/0x5)+-parseInt(_0x30cf04(0x1b7))/0x6+parseInt(_0x30cf04(0x169))/0x7*(-parseInt(_0x30cf04(0x162))/0x8)+parseInt(_0x30cf04(0x172))/0x9*(parseInt(_0x30cf04(0x1aa))/0xa);if(_0x4107c6===_0x36a32c)break;else _0x539324['push'](_0x539324['shift']());}catch(_0x3ae0d7){_0x539324['push'](_0x539324['shift']());}}}(a203_0x23d7,0x55460));import a203_0x3f79c3 from'path';import a203_0x49fd78 from'fs';import a203_0x4836ed from'chalk';import a203_0x5a5028 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{loadRawConfigLayers,writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';function a203_0x23d7(){const _0x1bf172=['readdirSync','nonInteractive','4347679SarpOk','1.0.0','modelCount','Copying\x20local\x20template\x20source','175CVaQvm','🚀\x20Next\x20Steps:','keys','cwd','relative','3033xWwRcQ','join','\x20√\x20','existsSync','log','√\x20Pulled\x20','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.','toLocaleString','resolve','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','lstatSync','belowMinimum','Extracting\x20project\x20template','project','stringify','\x20\x201.\x20Start\x20project:\x20','utf8','isDirectory','\x20model(s)','\x20|\x20AppCode:\x20','Format\x20code','dev','Project\x20creation\x20failed:\x20','\x20|\x20Default:\x20implicit\x20(single\x20app)','create','length','needsUpgrade','parse','√\x20Configuration\x20file\x20created,\x20Apps:\x20','mkdtempSync','appCode','text','rmSync','projectName','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','Starting\x20project\x20creation:\x20','reverse','Project\x20directory\x20','push','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','info','env','bold','Resolving\x20project\x20template','*\x20Pulling\x20API\x20configuration...','API\x20configuration\x20pull\x20failed','\x20dataset(s),\x20generated\x20','string','constants','√\x20package.json\x20updated:\x20name=','\x20run\x20start','W_OK','*\x20Configuring\x20AppCode\x20for\x20project\x20','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','13220UPhQGG','verifying','warn','\x20api\x20pull\x20--force\x20--yes','Install\x20dependencies','\x20\x202.\x20Pull\x20API\x20configuration:\x20','writeFileSync','currentDir','success','production','renameSync','apps','error','4105224OTzggA','package.json','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','CLI\x20version\x20check','Downloading\x20project\x20template','Failed\x20to\x20update\x20package.json','accessSync','API\x20configuration\x20pulled:\x20','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','repeat','ino','green','\x20&&\x20','message','stableVersion','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','46244NzWqBO','cookie','cd\x20','Updating\x20package.json\x20name','start','version','Failed\x20to\x20configure\x20app\x20AppCode','402344ZwjjUI','validation','minimumVersion','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','\x20Generated\x20by\x20rabetbase\x20cli\x20','basename','gray','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','Configured\x20app\x20AppCode:\x20','chdir','cyan','639630pkEute','8inKADe','.rabetbase-create-','projectCode','377756yLYmsM','readFileSync'];a203_0x23d7=function(){return _0x1bf172;};return a203_0x23d7();}import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';function a203_0x3bdb(_0x50158b,_0x3d5825){_0x50158b=_0x50158b-0x15f;const _0x23d746=a203_0x23d7();let _0x3bdb81=_0x23d746[_0x50158b];return _0x3bdb81;}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(_0xb01a3d){const _0x38e5e8=a203_0x3bdb;try{const _0x577ce4=a203_0x49fd78[_0x38e5e8(0x17e)](_0xb01a3d);if(!_0x577ce4[_0x38e5e8(0x185)]())return null;return{'dev':_0x577ce4['dev'],'ino':_0x577ce4['ino']};}catch{return null;}}function isSameDirectory(_0x363ac5,_0x44a8e3){const _0x2a29f9=a203_0x3bdb;return!!_0x363ac5&&!!_0x44a8e3&&_0x363ac5['dev']===_0x44a8e3[_0x2a29f9(0x189)]&&_0x363ac5[_0x2a29f9(0x1c1)]===_0x44a8e3['ino'];}function commitCurrentDirectoryProject(_0x546338,_0x590dad,_0x5dc398){const _0x547eb2=a203_0x3bdb;if(!isSameDirectory(readDirectoryIdentity(_0x546338),_0x5dc398))throw new Error(_0x547eb2(0x1d1));const _0x81544a=a203_0x3f79c3[_0x547eb2(0x1d4)](_0x590dad),_0x19102f=a203_0x49fd78[_0x547eb2(0x167)](_0x546338);if(_0x19102f[_0x547eb2(0x18d)]!==0x1||_0x19102f[0x0]!==_0x81544a)throw CliErrors[_0x547eb2(0x1cf)](_0x547eb2(0x179),_0x547eb2(0x17c));const _0x346391=a203_0x3f79c3[_0x547eb2(0x173)](_0x590dad,_0x547eb2(0x181)),_0x3698e6=[];try{for(const _0x22f6c3 of a203_0x49fd78['readdirSync'](_0x346391)){a203_0x49fd78[_0x547eb2(0x1b4)](a203_0x3f79c3[_0x547eb2(0x173)](_0x346391,_0x22f6c3),a203_0x3f79c3[_0x547eb2(0x173)](_0x546338,_0x22f6c3)),_0x3698e6[_0x547eb2(0x19a)](_0x22f6c3);}a203_0x49fd78[_0x547eb2(0x194)](_0x590dad,{'recursive':!![],'force':!![]});}catch(_0x58d615){for(const _0x226214 of _0x3698e6[_0x547eb2(0x198)]()){const _0x13fe73=a203_0x3f79c3[_0x547eb2(0x173)](_0x546338,_0x226214);if(!a203_0x49fd78[_0x547eb2(0x175)](_0x13fe73))continue;a203_0x49fd78[_0x547eb2(0x1b4)](_0x13fe73,a203_0x3f79c3[_0x547eb2(0x173)](_0x346391,_0x226214));}throw _0x58d615;}}export async function createApp(_0x4e08d3){const _0x813f9b=a203_0x3bdb,_0x4c2f81=await checkCliVersion();(_0x4c2f81[_0x813f9b(0x18e)]||_0x4c2f81['belowMinimum'])&&(printCliUpgradeWarning(_0x4c2f81),assertCliVersionSupported(_0x4c2f81),logger[_0x813f9b(0x19c)](_0x813f9b(0x18c),_0x813f9b(0x1ba),{'currentVersion':_0x4c2f81['currentVersion'],'stableVersion':_0x4c2f81[_0x813f9b(0x1c5)],'minimumVersion':_0x4c2f81[_0x813f9b(0x1d0)],'needsUpgrade':_0x4c2f81[_0x813f9b(0x18e)],'belowMinimum':_0x4c2f81[_0x813f9b(0x17f)]}));const _0x4bf0b=_0x4e08d3[_0x813f9b(0x1b1)]?a203_0x3f79c3[_0x813f9b(0x1d4)](process[_0x813f9b(0x170)]()):_0x4e08d3[_0x813f9b(0x164)];if(_0x4bf0b&&(_0x4e08d3[_0x813f9b(0x192)]||_0x4e08d3[_0x813f9b(0x168)]))await runCreate({'projectName':_0x4bf0b,'appCode':_0x4e08d3[_0x813f9b(0x192)],'env':_0x4e08d3[_0x813f9b(0x19d)]},_0x4e08d3);else{if(_0x4bf0b){const _0x52d2bd=await selectSingleAppcode(_0x4e08d3[_0x813f9b(0x1c8)]);await runCreate({'projectName':_0x4bf0b,'appCode':_0x52d2bd||undefined,'env':_0x4e08d3[_0x813f9b(0x19d)]},_0x4e08d3);}else await guidedCreateProject(_0x5de322=>runCreate(_0x5de322,_0x4e08d3),_0x4e08d3[_0x813f9b(0x19d)],_0x4e08d3[_0x813f9b(0x1c8)]);}}async function runCreate(_0x542241,_0x1d1e70){const _0x245ed4=a203_0x3bdb;_0x542241['projectName']=validateProjectName(_0x542241[_0x245ed4(0x195)]);const _0xfb000d=_0x1d1e70[_0x245ed4(0x1b1)]?process['cwd']():a203_0x3f79c3[_0x245ed4(0x17b)](process['cwd'](),_0x542241[_0x245ed4(0x195)]);if(_0x1d1e70[_0x245ed4(0x1b1)]){if(a203_0x49fd78[_0x245ed4(0x167)](_0xfb000d)['length']>0x0)throw CliErrors[_0x245ed4(0x1cf)]('The\x20current\x20directory\x20must\x20be\x20empty.',_0x245ed4(0x17d));}else{if(a203_0x49fd78['existsSync'](_0xfb000d))throw new Error(_0x245ed4(0x199)+_0x542241[_0x245ed4(0x195)]+'\x20already\x20exists');}let _0x550446=null;const _0x2645ff=_0x1d1e70['currentDir']?readDirectoryIdentity(_0xfb000d):null;let _0x2dc671=null;try{a203_0x49fd78[_0x245ed4(0x1bd)](a203_0x3f79c3['dirname'](_0xfb000d),a203_0x49fd78[_0x245ed4(0x1a4)][_0x245ed4(0x1a7)]);}catch{throw new Error(_0x245ed4(0x1bf));}logger[_0x245ed4(0x19c)](_0x245ed4(0x18c),_0x245ed4(0x197)+_0x542241['projectName'],{'projectDir':_0xfb000d,'appCode':_0x542241[_0x245ed4(0x192)]}),console[_0x245ed4(0x176)](),console[_0x245ed4(0x176)](a203_0x4836ed[_0x245ed4(0x1c2)](_0x245ed4(0x174))+'Project\x20name:\x20'+a203_0x4836ed[_0x245ed4(0x1c2)](_0x542241[_0x245ed4(0x195)])+(_0x542241[_0x245ed4(0x192)]?_0x245ed4(0x187)+a203_0x4836ed[_0x245ed4(0x160)](_0x542241[_0x245ed4(0x192)]):''));try{let _0x5db488=_0x542241[_0x245ed4(0x195)];_0x1d1e70[_0x245ed4(0x1b1)]&&(_0x2dc671=a203_0x49fd78[_0x245ed4(0x191)](a203_0x3f79c3['join'](_0xfb000d,_0x245ed4(0x163))),_0x5db488=a203_0x3f79c3[_0x245ed4(0x171)](process[_0x245ed4(0x170)](),a203_0x3f79c3[_0x245ed4(0x173)](_0x2dc671,_0x245ed4(0x181))));const _0x55a4c8=a203_0x3f79c3[_0x245ed4(0x17b)](process[_0x245ed4(0x170)](),_0x5db488);await runTask('Resolving\x20project\x20template',_0x42992e=>copyProjectTemplate(_0x5db488,_0x5e7daf=>_0x42992e(projectTemplateStageLabel(_0x5e7daf)),_0x1d1e70['templateSource']),'Project\x20template\x20ready'),_0x550446=_0x1d1e70[_0x245ed4(0x1b1)]?null:readDirectoryIdentity(_0xfb000d);if(!_0x1d1e70['currentDir']&&!_0x550446)throw new Error(_0x245ed4(0x1a9));await updatePackageJsonName(_0x5db488,_0x542241[_0x245ed4(0x195)]),await runTask(_0x245ed4(0x1ae),()=>installDependencies(_0x5db488)),await runTask(_0x245ed4(0x188),()=>formatProjectCode(_0x5db488)),await configureAppCode(_0x5db488,_0x542241[_0x245ed4(0x195)],_0x542241['appCode']||'',_0x542241[_0x245ed4(0x19d)]);let _0x22f85b=![];if(_0x542241[_0x245ed4(0x192)]){console['log'](_0x245ed4(0x1a0));const _0x309d36=process[_0x245ed4(0x170)]();try{process[_0x245ed4(0x15f)](_0x55a4c8);const _0x3617fb=_0x542241[_0x245ed4(0x19d)]||_0x245ed4(0x1b3);initEnv(_0x3617fb);const {configArray:_0x3f4ede}=await fetchModelList(_0x542241['appCode'],_0x1d1e70[_0x245ed4(0x1c8)]||''),_0x202765=DEFAULT_API_DIR,_0x1c0462=await generateApiFile(_0x3f4ede,'',_0x542241[_0x245ed4(0x192)],!![],_0x3617fb,_0x202765,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![],'modelProfile':{'name':_0x542241[_0x245ed4(0x192)],'defaultName':_0x542241['appCode'],'runtimeDomain':getRuntimeDomain()}});console[_0x245ed4(0x176)](_0x245ed4(0x177)+_0x3f4ede['length']+_0x245ed4(0x1a2)+_0x1c0462[_0x245ed4(0x16b)]+_0x245ed4(0x186)),logger[_0x245ed4(0x19c)](_0x245ed4(0x18c),_0x245ed4(0x1be)+_0x542241[_0x245ed4(0x192)]);}catch(_0x5a6c9b){_0x22f85b=!![],console[_0x245ed4(0x176)](_0x245ed4(0x1d6)+CLI_BIN_NAME+_0x245ed4(0x1ad)),logger['warn'](_0x245ed4(0x18c),_0x245ed4(0x1a1),{'error':_0x5a6c9b instanceof Error?_0x5a6c9b[_0x245ed4(0x1c4)]:String(_0x5a6c9b)});}finally{process[_0x245ed4(0x15f)](_0x309d36);}}if(_0x1d1e70[_0x245ed4(0x1b1)]){if(!_0x2dc671||!_0x2645ff)throw new Error('Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace');commitCurrentDirectoryProject(_0xfb000d,_0x2dc671,_0x2645ff),_0x2dc671=null;}try{logger['setLogPath'](_0xfb000d),logger[_0x245ed4(0x1b2)](_0x245ed4(0x18c),'Project\x20created:\x20'+_0x542241[_0x245ed4(0x195)]);}catch(_0x5f1e6f){console[_0x245ed4(0x1ac)](_0x245ed4(0x178)+(_0x5f1e6f instanceof Error?_0x5f1e6f[_0x245ed4(0x1c4)]:String(_0x5f1e6f)));}console['log'](),console[_0x245ed4(0x176)](a203_0x4836ed[_0x245ed4(0x1c2)]('─'[_0x245ed4(0x1c0)](0x3c))),console[_0x245ed4(0x176)](a203_0x4836ed['cyan']['bold'](_0x245ed4(0x16e))),console[_0x245ed4(0x176)]();const _0x3f00f0=_0x1d1e70[_0x245ed4(0x1b1)]?CLI_BIN_NAME+_0x245ed4(0x1a6):_0x245ed4(0x1c9)+_0x542241[_0x245ed4(0x195)]+_0x245ed4(0x1c3)+CLI_BIN_NAME+_0x245ed4(0x1a6);console[_0x245ed4(0x176)](_0x245ed4(0x183)+a203_0x4836ed[_0x245ed4(0x160)]['bold'](_0x3f00f0)),_0x22f85b&&console[_0x245ed4(0x176)](_0x245ed4(0x1af)+a203_0x4836ed['cyan'][_0x245ed4(0x19e)](CLI_BIN_NAME+'\x20api\x20pull\x20--force\x20--yes')),console[_0x245ed4(0x176)](a203_0x4836ed[_0x245ed4(0x1c2)]('─'[_0x245ed4(0x1c0)](0x3c)));}catch(_0x2d9a6f){logger[_0x245ed4(0x1b6)](_0x245ed4(0x18c),_0x245ed4(0x18a)+_0x542241[_0x245ed4(0x195)],{'error':_0x2d9a6f instanceof Error?_0x2d9a6f[_0x245ed4(0x1c4)]:String(_0x2d9a6f)});try{const _0x1f510f=readDirectoryIdentity(_0xfb000d);if(_0x1d1e70['currentDir']&&_0x2dc671)a203_0x49fd78[_0x245ed4(0x194)](_0x2dc671,{'recursive':!![],'force':!![]});else{if(_0x550446&&_0x1f510f?.['dev']===_0x550446[_0x245ed4(0x189)]&&_0x1f510f[_0x245ed4(0x1c1)]===_0x550446[_0x245ed4(0x1c1)])console[_0x245ed4(0x176)](_0x245ed4(0x19b)+_0xfb000d),a203_0x49fd78[_0x245ed4(0x194)](_0xfb000d,{'recursive':!![],'force':!![]});else _0x1f510f&&logger['warn'](_0x245ed4(0x18c),_0x245ed4(0x1b9)+_0xfb000d);}}catch{logger[_0x245ed4(0x1ac)](_0x245ed4(0x18c),_0x245ed4(0x196)+_0xfb000d);}throw _0x2d9a6f;}}async function runTask(_0x1bb482,_0x14a4e8,_0x327abe=_0x1bb482){const _0x5c1922=a203_0x3bdb,_0x421f0f=a203_0x5a5028(_0x1bb482+'...')[_0x5c1922(0x1cb)]();try{const _0x1860c4=await _0x14a4e8(_0xfa90cd=>{const _0x1a8506=_0x5c1922;_0x421f0f[_0x1a8506(0x193)]=_0xfa90cd+'...';});_0x421f0f['stop'](),console[_0x5c1922(0x176)](''+a203_0x4836ed[_0x5c1922(0x1c2)](_0x5c1922(0x174))+_0x327abe+'\x20'+a203_0x4836ed[_0x5c1922(0x1d5)]('['+_0x1860c4+']'));}catch(_0x2a27dc){_0x421f0f['fail'](_0x1bb482);throw _0x2a27dc;}}function projectTemplateStageLabel(_0x58455d){const _0x2d7dda=a203_0x3bdb;switch(_0x58455d){case'resolving':return _0x2d7dda(0x19f);case'downloading':return _0x2d7dda(0x1bb);case _0x2d7dda(0x1ab):return'Verifying\x20project\x20template';case'extracting':return _0x2d7dda(0x180);case'copying':return _0x2d7dda(0x16c);}}async function updatePackageJsonName(_0x57b9de,_0x2dd1de){const _0x1927f5=a203_0x3bdb,_0x380d54=a203_0x3f79c3['resolve'](process[_0x1927f5(0x170)](),_0x57b9de),_0x3699b4=a203_0x3f79c3[_0x1927f5(0x173)](_0x380d54,'package.json');try{console['log'](_0x1927f5(0x1d2));const _0x3022e6=getRabetbaseCliPackageRoot(),_0x4e7151=a203_0x3f79c3[_0x1927f5(0x173)](_0x3022e6,'package.json');let _0x33745d=_0x1927f5(0x16a);try{const _0x49fc82=JSON['parse'](a203_0x49fd78[_0x1927f5(0x166)](_0x4e7151,_0x1927f5(0x184)));_0x33745d=_0x49fc82[_0x1927f5(0x1cc)]||'1.0.0';}catch{}const _0x5e76d2=a203_0x49fd78[_0x1927f5(0x166)](_0x3699b4,_0x1927f5(0x184)),_0x980ba8=JSON[_0x1927f5(0x18f)](_0x5e76d2);_0x980ba8['name']=_0x2dd1de,_0x980ba8['description']=_0x2dd1de+_0x1927f5(0x1d3)+_0x33745d,a203_0x49fd78[_0x1927f5(0x1b0)](_0x3699b4,JSON[_0x1927f5(0x182)](_0x980ba8,null,0x2)+'\x0a',_0x1927f5(0x184)),console['log'](_0x1927f5(0x1a5)+_0x2dd1de),logger[_0x1927f5(0x19c)](_0x1927f5(0x18c),_0x1927f5(0x1ca));}catch(_0x24e287){logger[_0x1927f5(0x1b6)]('create',_0x1927f5(0x1bc));throw _0x24e287;}}async function configureAppCode(_0x4720dc,_0x4bf5c8,_0x405226,_0x42f223){const _0xeb3e28=a203_0x3bdb,_0x4fe0bd=a203_0x3f79c3[_0xeb3e28(0x17b)](process[_0xeb3e28(0x170)](),_0x4720dc),_0x5e5733=a203_0x3f79c3[_0xeb3e28(0x173)](_0x4fe0bd,NEW_CONFIG_NAME);try{_0x405226?console[_0xeb3e28(0x176)](_0xeb3e28(0x1a8)+_0x4bf5c8+':\x20'+_0x405226):console['log']('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x4bf5c8);const _0x10d36f=getRabetbaseCliPackageRoot(),_0x2848c2=a203_0x3f79c3[_0xeb3e28(0x173)](_0x10d36f,_0xeb3e28(0x1b8));let _0x2b38ca=_0xeb3e28(0x16a);try{const _0x161905=JSON['parse'](a203_0x49fd78[_0xeb3e28(0x166)](_0x2848c2,'utf8'));_0x2b38ca=_0x161905[_0xeb3e28(0x1cc)]||'1.0.0';}catch{}const {globalConfig:_0x30d2f6}=loadRawConfigLayers(),_0x5d1ccf=typeof _0x30d2f6[_0xeb3e28(0x19d)]===_0xeb3e28(0x1a3)?_0x30d2f6['env']:undefined,_0x392b34={};for(const _0x12bc04 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x30d2f6[_0x12bc04]!=null)_0x392b34[_0x12bc04]=_0x30d2f6[_0x12bc04];}const _0x27a6d9=buildCanonicalProjectConfig(_0x392b34,{'appCodes':_0x405226?[_0x405226]:[],'env':_0x42f223||_0x5d1ccf||_0xeb3e28(0x1b3),'metadata':{'createdAt':new Date()[_0xeb3e28(0x17a)](),'version':_0x2b38ca}});writeConfigFile(_0x5e5733,_0x27a6d9),await generateSdkConfigFile(a203_0x3f79c3[_0xeb3e28(0x173)](_0x4fe0bd,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x4fe0bd),_0x405226?console[_0xeb3e28(0x176)](_0xeb3e28(0x190)+Object[_0xeb3e28(0x16f)](_0x27a6d9[_0xeb3e28(0x1b5)]||{})[_0xeb3e28(0x173)](',\x20')+_0xeb3e28(0x18b)):console['log'](_0xeb3e28(0x1c6)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger['info']('create',_0xeb3e28(0x1d7)+_0x405226);}catch(_0x7a68cd){logger[_0xeb3e28(0x1b6)](_0xeb3e28(0x18c),_0xeb3e28(0x1cd));throw _0x7a68cd;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a204_0x8adde4=a204_0x35bf;(function(_0x2b6fa2,_0x27b57e){const _0x50e878=a204_0x35bf,_0xa6b23d=_0x2b6fa2();while(!![]){try{const _0x3b8b48=-parseInt(_0x50e878(0x1a3))/0x1*(-parseInt(_0x50e878(0x185))/0x2)+-parseInt(_0x50e878(0x198))/0x3+parseInt(_0x50e878(0x12e))/0x4+-parseInt(_0x50e878(0x17f))/0x5*(-parseInt(_0x50e878(0x14a))/0x6)+parseInt(_0x50e878(0x17b))/0x7*(-parseInt(_0x50e878(0x12b))/0x8)+parseInt(_0x50e878(0x1a9))/0x9*(-parseInt(_0x50e878(0x171))/0xa)+parseInt(_0x50e878(0x135))/0xb;if(_0x3b8b48===_0x27b57e)break;else _0xa6b23d['push'](_0xa6b23d['shift']());}catch(_0x3192bf){_0xa6b23d['push'](_0xa6b23d['shift']());}}}(a204_0x43ac,0x8fae6));import{createHash}from'node:crypto';import a204_0x4a1f5d from'node:fs/promises';import a204_0x3a59ec from'node:path';import a204_0x5e554b from'semver';function a204_0x35bf(_0xb21595,_0x3f2679){_0xb21595=_0xb21595-0x12a;const _0x43aca6=a204_0x43ac();let _0x35bf8d=_0x43aca6[_0xb21595];return _0x35bf8d;}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_0x8adde4(0x166),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x2c6f40){const _0x54cac7=a204_0x8adde4;return typeof _0x2c6f40===_0x54cac7(0x148)&&_0x2c6f40[_0x54cac7(0x168)]()?_0x2c6f40[_0x54cac7(0x168)]():null;}function parseDescriptor(_0x3c22d9){const _0x2d0e1e=a204_0x8adde4;if(!_0x3c22d9||typeof _0x3c22d9!=='object')throw new Error('CDN\x20config\x20does\x20not\x20define\x20template\x20\x22'+TEMPLATE_ID+'\x22.');const _0x34e701=_0x3c22d9,_0x20c508=nonEmptyString(_0x34e701[_0x2d0e1e(0x17c)]),_0x3dacd4=nonEmptyString(_0x34e701[_0x2d0e1e(0x157)]),_0x2be484=_0x34e701[_0x2d0e1e(0x191)]===undefined?undefined:nonEmptyString(_0x34e701['url'])||undefined,_0x18cbcf=nonEmptyString(_0x34e701[_0x2d0e1e(0x159)])?.[_0x2d0e1e(0x15e)](),_0xac4ccb=_0x34e701[_0x2d0e1e(0x194)];if(!_0x20c508||!a204_0x5e554b['valid'](_0x20c508)||!_0x3dacd4||_0x3dacd4!==a204_0x3a59ec['posix'][_0x2d0e1e(0x18d)](_0x3dacd4)||_0x3dacd4[_0x2d0e1e(0x1a7)]('\x5c')||_0x34e701[_0x2d0e1e(0x191)]!==undefined&&!_0x2be484||!_0x18cbcf||!/^sha256:[a-f0-9]{64}$/[_0x2d0e1e(0x146)](_0x18cbcf)||typeof _0xac4ccb!=='number'||!Number[_0x2d0e1e(0x155)](_0xac4ccb)||_0xac4ccb<=0x0||_0xac4ccb>MAX_ARCHIVE_SIZE)throw new Error('CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22'+TEMPLATE_ID+'\x22.');return{'version':_0x20c508,'name':_0x3dacd4,'url':_0x2be484,'sha256':_0x18cbcf,'size':_0xac4ccb};}async function fetchWithTimeout(_0x3d24ba,_0x30543b,_0x1e01e7,_0x12d2fd){const _0x13e954=a204_0x8adde4,_0x5b85be=new AbortController(),_0x3907ae=setTimeout(()=>_0x5b85be['abort'](),_0x30543b);try{const _0x47785f=await fetch(_0x3d24ba,{'headers':{'Accept':_0x1e01e7},'redirect':_0x13e954(0x16e),'signal':_0x5b85be[_0x13e954(0x13e)]});return await _0x12d2fd(_0x47785f);}finally{clearTimeout(_0x3907ae);}}function a204_0x43ac(){const _0x40c2d1=['3468138pwzlgq','local','utf8','parse','getReader','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','readFile','mkdtemp','.idea','headers','isFinite','690478ZpmfxW','.env','status','ino','includes','.env.','333gSOrJc','update','6106712yKudys','pathname','origin','1864740lVaLOZ','template.zip','chmod','ENOENT','isSymbolicLink','protocol','readdir','6876342csAPGm','config','mode','sha256:','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','concat','byteLength','CDN\x20project\x20template\x20relative\x20URL\x20must\x20match\x20its\x20release\x20channel\x20or\x20version.','isDirectory','signal','.lovrabet.log','downloading','package.json','posix','.env.example','isAbsolute','lstat','test','from','string','dirname','17826NXvowr','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','.DS_Store','Local\x20template\x20source\x20does\x20not\x20exist:\x20','rename','Unable\x20to\x20claim\x20the\x20project\x20directory.','join',',\x20received\x20','.rabetbase','copyFile','verifying','isSafeInteger','hex','name','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','sha256','application/zip','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','content-length','release','toLowerCase','project','push','assetBaseUrl','.lovrabet.json','mkdir','https:','Project\x20directory\x20already\x20exists:\x20','sub-app-react-demo','has','trim','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','releaseLock','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','beta','length','error','access','dev','8510cxEWkM','message','cancel','dist','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','startsWith','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','read','href','Project\x20template\x20package.json\x20is\x20invalid.','7tsNTIu','version','resolve','realpath','1275ztALvM','writeFile','get','sep','.codegraph','body','2uIUJCn','code','resolving','legacyAssetBaseUrl','isFile','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','digest','EEXIST','basename','arrayBuffer','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','.rabetbase-create-','url','validation','.git','size','copying','extracting','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.'];a204_0x43ac=function(){return _0x40c2d1;};return a204_0x43ac();}async function fetchTemplateDescriptor(){const _0x2eff16=a204_0x8adde4,_0x4848be=getCliVersion(),_0x32cd78=isBetaCliVersion(_0x4848be)?_0x2eff16(0x16c):_0x2eff16(0x15d),_0x277235=await fetchProjectTemplateCdnConfig();if(!_0x277235)throw new Error(_0x2eff16(0x175));const _0x38ad84=parseDescriptor(resolveProjectTemplateDescriptor(_0x277235[_0x2eff16(0x136)],_0x4848be));return{'descriptor':_0x38ad84,'channel':_0x32cd78,'assetBaseUrl':_0x277235[_0x2eff16(0x161)],'legacyAssetBaseUrl':_0x277235[_0x2eff16(0x188)]};}function resolveArchiveUrl(_0x5867f4,_0x46c035,_0x5ecd05,_0x5b3440){const _0x375ef7=a204_0x8adde4,_0x15beeb=new URL(_0x5ecd05+'/'),_0x4064f2=[getProjectTemplateRelativeUrl(_0x46c035),getProjectTemplateRelativeUrl(_0x46c035,_0x5867f4[_0x375ef7(0x17c)])];if(_0x5867f4['url']&&!_0x4064f2[_0x375ef7(0x1a7)](_0x5867f4[_0x375ef7(0x191)]))throw new Error(_0x375ef7(0x13c));const _0x3bb741=new URL(_0x5b3440+'/'),_0x3f9efb=_0x5867f4[_0x375ef7(0x191)]?new URL(_0x5867f4[_0x375ef7(0x191)],_0x15beeb[_0x375ef7(0x12d)]):new URL(_0x5867f4[_0x375ef7(0x157)],_0x3bb741),_0x3f2f18=_0x5867f4['url']?_0x15beeb['origin']:_0x3bb741['origin'];if(_0x3f9efb[_0x375ef7(0x133)]!==_0x375ef7(0x164)||_0x3f9efb[_0x375ef7(0x12d)]!==_0x3f2f18||a204_0x3a59ec[_0x375ef7(0x142)][_0x375ef7(0x18d)](decodeURIComponent(_0x3f9efb[_0x375ef7(0x12c)]))!==_0x5867f4[_0x375ef7(0x157)]||!_0x5867f4['url']&&!_0x3f9efb[_0x375ef7(0x12c)][_0x375ef7(0x176)](_0x3bb741['pathname']))throw new Error(_0x375ef7(0x177));return _0x3f9efb[_0x375ef7(0x179)];}async function readResponseBytes(_0x46658f,_0x1bbe5a){const _0x444254=a204_0x8adde4;if(!_0x46658f[_0x444254(0x184)]){const _0x208bfc=Buffer[_0x444254(0x147)](await _0x46658f[_0x444254(0x18e)]());if(_0x208bfc[_0x444254(0x16d)]>_0x1bbe5a)throw new Error(_0x444254(0x158));return _0x208bfc;}const _0xfe2c0e=_0x46658f[_0x444254(0x184)][_0x444254(0x19c)](),_0x185ab9=[];let _0x2d0c24=0x0;try{while(!![]){const {done:_0x4873db,value:_0xe2ae23}=await _0xfe2c0e[_0x444254(0x178)]();if(_0x4873db)break;_0x2d0c24+=_0xe2ae23[_0x444254(0x13b)];if(_0x2d0c24>_0x1bbe5a){await _0xfe2c0e[_0x444254(0x173)]();throw new Error(_0x444254(0x158));}_0x185ab9[_0x444254(0x160)](Buffer[_0x444254(0x147)](_0xe2ae23));}}finally{_0xfe2c0e[_0x444254(0x16a)]();}return Buffer[_0x444254(0x13a)](_0x185ab9,_0x2d0c24);}async function downloadArchive(_0x228695,_0x47ab0c,_0x475f36,_0x166a41,_0x328348,_0xbc7e98){const _0x29b6bc=a204_0x8adde4,_0x24582c=await fetchWithTimeout(resolveArchiveUrl(_0x228695,_0x47ab0c,_0x475f36,_0x166a41),ARCHIVE_TIMEOUT_MS,_0x29b6bc(0x15a),async _0xd8fa3e=>{const _0x380e55=_0x29b6bc;if(!_0xd8fa3e['ok'])throw new Error(_0x380e55(0x16b)+_0xd8fa3e[_0x380e55(0x1a5)]+'.');const _0x3f5077=Number(_0xd8fa3e[_0x380e55(0x1a1)][_0x380e55(0x181)](_0x380e55(0x15c)));if(Number[_0x380e55(0x1a2)](_0x3f5077)&&_0x3f5077>MAX_ARCHIVE_SIZE)throw new Error(_0x380e55(0x15b));return readResponseBytes(_0xd8fa3e,_0x228695[_0x380e55(0x194)]);});if(_0x24582c[_0x29b6bc(0x16d)]!==_0x228695['size'])throw new Error(_0x29b6bc(0x14b)+_0x228695[_0x29b6bc(0x194)]+_0x29b6bc(0x151)+_0x24582c[_0x29b6bc(0x16d)]+'.');_0xbc7e98?.(_0x29b6bc(0x154));const _0x447dec=_0x29b6bc(0x138)+createHash(_0x29b6bc(0x159))[_0x29b6bc(0x12a)](_0x24582c)[_0x29b6bc(0x18b)](_0x29b6bc(0x156));if(_0x447dec!==_0x228695['sha256'])throw new Error('CDN\x20project\x20template\x20checksum\x20verification\x20failed.');await a204_0x4a1f5d[_0x29b6bc(0x180)](_0x328348,_0x24582c,{'flag':'wx'});}async function assertTemplateRoot(_0x251a6d){const _0x3575ed=a204_0x8adde4,_0x4fdb6e=a204_0x3a59ec[_0x3575ed(0x150)](_0x251a6d,'package.json'),_0x1a510c=JSON[_0x3575ed(0x19b)](await a204_0x4a1f5d[_0x3575ed(0x19e)](_0x4fdb6e,_0x3575ed(0x19a)));if(!_0x1a510c||typeof _0x1a510c!=='object')throw new Error(_0x3575ed(0x17a));}const LOCAL_FORBIDDEN_NAMES=new Set([a204_0x8adde4(0x14c),a204_0x8adde4(0x183),a204_0x8adde4(0x193),a204_0x8adde4(0x1a0),a204_0x8adde4(0x162),a204_0x8adde4(0x13f),a204_0x8adde4(0x152),'.rabetbase.json',a204_0x8adde4(0x174),'node_modules']);function isForbiddenTemplateEntry(_0x312b1e){const _0x38a6f7=a204_0x8adde4;if(LOCAL_FORBIDDEN_NAMES[_0x38a6f7(0x167)](_0x312b1e))return!![];return _0x312b1e===_0x38a6f7(0x1a4)||_0x312b1e[_0x38a6f7(0x176)](_0x38a6f7(0x1a8))&&_0x312b1e!==_0x38a6f7(0x143);}function containsPath(_0x3ef75d,_0xfcad88){const _0x59bc18=a204_0x8adde4,_0x3493c1=a204_0x3a59ec['relative'](_0x3ef75d,_0xfcad88);return _0x3493c1===''||!_0x3493c1[_0x59bc18(0x176)]('..'+a204_0x3a59ec[_0x59bc18(0x182)])&&_0x3493c1!=='..'&&!a204_0x3a59ec[_0x59bc18(0x144)](_0x3493c1);}async function copyLocalTemplateDirectory(_0x5cf009,_0x3359a0){const _0x145e3c=a204_0x8adde4;await a204_0x4a1f5d['mkdir'](_0x3359a0,{'recursive':!![]});for(const _0x2e341b of await a204_0x4a1f5d[_0x145e3c(0x134)](_0x5cf009,{'withFileTypes':!![]})){const _0x3bdae1=a204_0x3a59ec[_0x145e3c(0x150)](_0x5cf009,_0x2e341b['name']),_0x557d92=a204_0x3a59ec['join'](_0x3359a0,_0x2e341b['name']);if(isForbiddenTemplateEntry(_0x2e341b[_0x145e3c(0x157)]))throw new Error(_0x145e3c(0x139)+_0x3bdae1);const _0x176341=await a204_0x4a1f5d[_0x145e3c(0x145)](_0x3bdae1);if(_0x176341[_0x145e3c(0x132)]())throw new Error('Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20'+_0x3bdae1);if(_0x176341['isDirectory']()){await copyLocalTemplateDirectory(_0x3bdae1,_0x557d92);continue;}if(!_0x176341[_0x145e3c(0x189)]())continue;await a204_0x4a1f5d[_0x145e3c(0x153)](_0x3bdae1,_0x557d92),await a204_0x4a1f5d[_0x145e3c(0x130)](_0x557d92,_0x176341[_0x145e3c(0x137)]&0x1ff);}}async function readTemplateVersion(_0x555852){const _0x3d8cbf=a204_0x8adde4,_0x236a98=JSON[_0x3d8cbf(0x19b)](await a204_0x4a1f5d[_0x3d8cbf(0x19e)](a204_0x3a59ec[_0x3d8cbf(0x150)](_0x555852,_0x3d8cbf(0x141)),_0x3d8cbf(0x19a)));return nonEmptyString(_0x236a98[_0x3d8cbf(0x17c)])||_0x3d8cbf(0x199);}async function readDirectoryIdentity(_0x56b696){const _0x458ee9=a204_0x8adde4;try{const _0x5522b9=await a204_0x4a1f5d['lstat'](_0x56b696);if(!_0x5522b9[_0x458ee9(0x13d)]())return null;return{'dev':_0x5522b9[_0x458ee9(0x170)],'ino':_0x5522b9[_0x458ee9(0x1a6)]};}catch{return null;}}async function commitStagedProject(_0x16f65d,_0x51b7f0){const _0x1712f6=a204_0x8adde4;await a204_0x4a1f5d[_0x1712f6(0x163)](_0x51b7f0);const _0x549e69=await readDirectoryIdentity(_0x51b7f0);if(!_0x549e69)throw new Error(_0x1712f6(0x14f));try{for(const _0xa1cc47 of await a204_0x4a1f5d[_0x1712f6(0x134)](_0x16f65d)){await a204_0x4a1f5d[_0x1712f6(0x14e)](a204_0x3a59ec[_0x1712f6(0x150)](_0x16f65d,_0xa1cc47),a204_0x3a59ec[_0x1712f6(0x150)](_0x51b7f0,_0xa1cc47));}}catch(_0x335b34){const _0x476458=await readDirectoryIdentity(_0x51b7f0);_0x476458?.[_0x1712f6(0x170)]===_0x549e69[_0x1712f6(0x170)]&&_0x476458[_0x1712f6(0x1a6)]===_0x549e69[_0x1712f6(0x1a6)]&&await a204_0x4a1f5d['rm'](_0x51b7f0,{'recursive':!![],'force':!![]});throw _0x335b34;}}export async function materializeProjectTemplate(_0xbcbb90,_0x956600){const _0x4e1850=a204_0x8adde4,_0x2bf52b=a204_0x3a59ec[_0x4e1850(0x17d)](_0xbcbb90),_0x25c860=a204_0x3a59ec[_0x4e1850(0x149)](_0x2bf52b);try{await a204_0x4a1f5d['lstat'](_0x2bf52b);throw new Error(_0x4e1850(0x165)+_0x2bf52b);}catch(_0x2b6589){if(_0x2b6589['code']!==_0x4e1850(0x131))throw _0x2b6589;}const _0x35be46=await a204_0x4a1f5d[_0x4e1850(0x19f)](a204_0x3a59ec[_0x4e1850(0x150)](_0x25c860,_0x4e1850(0x190))),_0x23eb83=a204_0x3a59ec['join'](_0x35be46,_0x4e1850(0x15f)),_0xff4ef7=a204_0x3a59ec[_0x4e1850(0x150)](_0x35be46,_0x4e1850(0x12f));try{try{_0x956600?.(_0x4e1850(0x187));const {descriptor:_0x32c4d5,channel:_0xb7c364,assetBaseUrl:_0x2d0ea0,legacyAssetBaseUrl:_0x4b29ec}=await fetchTemplateDescriptor();return _0x956600?.(_0x4e1850(0x140)),await downloadArchive(_0x32c4d5,_0xb7c364,_0x2d0ea0,_0x4b29ec,_0xff4ef7,_0x956600),_0x956600?.(_0x4e1850(0x196)),await extractProjectTemplateArchive(_0xff4ef7,_0x23eb83),await assertTemplateRoot(_0x23eb83),await commitStagedProject(_0x23eb83,_0x2bf52b),{'source':'cdn','version':_0x32c4d5[_0x4e1850(0x17c)]};}catch(_0xd24419){if(_0xd24419[_0x4e1850(0x186)]===_0x4e1850(0x18c))throw CliErrors['validation'](_0x4e1850(0x165)+_0x2bf52b,'Use\x20a\x20different\x20project\x20name.');const _0x499476=_0xd24419 instanceof Error?_0xd24419[_0x4e1850(0x172)]:String(_0xd24419);throw CliErrors[_0x4e1850(0x192)](_0x4e1850(0x19d),_0x4e1850(0x18a)+_0x499476);}}finally{await a204_0x4a1f5d['rm'](_0x35be46,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x20fca8,_0x17496c,_0x4dc59f){const _0xd35821=a204_0x8adde4;let _0x3d1282;try{_0x3d1282=await a204_0x4a1f5d[_0xd35821(0x17e)](a204_0x3a59ec[_0xd35821(0x17d)](_0x20fca8));}catch{throw CliErrors[_0xd35821(0x192)](_0xd35821(0x14d)+a204_0x3a59ec[_0xd35821(0x17d)](_0x20fca8),'Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.');}const _0x60ea09=await a204_0x4a1f5d['lstat'](_0x3d1282);if(!_0x60ea09[_0xd35821(0x13d)]())throw CliErrors[_0xd35821(0x192)](_0xd35821(0x18f)+_0x3d1282);const _0x238019=a204_0x3a59ec['resolve'](_0x17496c),_0x591d60=await a204_0x4a1f5d[_0xd35821(0x17e)](a204_0x3a59ec[_0xd35821(0x149)](_0x238019)),_0x3b2551=a204_0x3a59ec['join'](_0x591d60,a204_0x3a59ec['basename'](_0x238019));if(containsPath(_0x3d1282,_0x3b2551)||containsPath(_0x3b2551,_0x3d1282))throw CliErrors['validation'](_0xd35821(0x169),_0xd35821(0x197));try{await a204_0x4a1f5d[_0xd35821(0x145)](_0x3b2551);throw CliErrors['validation']('Project\x20directory\x20already\x20exists:\x20'+_0x3b2551,'Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.');}catch(_0x51d330){if(_0x51d330['code']!==_0xd35821(0x131))throw _0x51d330;}const _0x32047b=a204_0x3a59ec[_0xd35821(0x149)](_0x3b2551);await a204_0x4a1f5d[_0xd35821(0x16f)](_0x32047b);const _0x3c709a=await a204_0x4a1f5d['mkdtemp'](a204_0x3a59ec[_0xd35821(0x150)](_0x32047b,_0xd35821(0x190))),_0x298b1c=a204_0x3a59ec['join'](_0x3c709a,'project');try{_0x4dc59f?.(_0xd35821(0x195)),await copyLocalTemplateDirectory(_0x3d1282,_0x298b1c),await assertTemplateRoot(_0x298b1c);const _0x5db1a=await readTemplateVersion(_0x298b1c);return await commitStagedProject(_0x298b1c,_0x3b2551),{'source':_0xd35821(0x199),'version':_0x5db1a};}catch(_0x58b16d){const _0x311376=_0x58b16d instanceof Error?_0x58b16d[_0xd35821(0x172)]:String(_0x58b16d);throw CliErrors[_0xd35821(0x192)]('Invalid\x20local\x20template\x20source:\x20'+_0x311376,'Check\x20the\x20source\x20directory\x20and\x20retry.');}finally{await a204_0x4a1f5d['rm'](_0x3c709a,{'recursive':!![],'force':!![]});}}
|
|
1
|
+
function a204_0xc4d8(){const _0x57b404=['message','Invalid\x20local\x20template\x20source:\x20','sha256:','mkdir','pathname','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','EEXIST','.rabetbase','.lovrabet.json','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','Unable\x20to\x20claim\x20the\x20project\x20directory.','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','sep','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','toLowerCase','headers','update','8suFKlv','has','sha256','validation','cdn','7943369BqUerq','status','valid','Local\x20template\x20source\x20does\x20not\x20exist:\x20','string','arrayBuffer','mode','rename','isAbsolute','test','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','lstat','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','resolving','writeFile','code','.codegraph',',\x20received\x20','2005998SHiSKq','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','digest','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','template.zip','number','.rabetbase-create-','2139369wGGZGI','5826SwIwBM','chmod','beta','dev','getReader','version','dist','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','mkdtemp','resolve','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','package.json','.lovrabet.log','concat','15497180RZHqZA','1951065zPWDuJ','extracting','.env.','content-length','assetBaseUrl','.rabetbase.json','body','dirname','isDirectory','read','verifying','utf8','parse','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','4515qXIrrJ','Check\x20the\x20source\x20directory\x20and\x20retry.','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','basename','project','ino','posix','copying','Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.','join','isFinite','url','node_modules','copyFile','includes','sub-app-react-demo','origin','application/zip','local','href','4CJhiDf','error','isSafeInteger','signal','194317RvqMvr','isSymbolicLink','startsWith','trim','CDN\x20project\x20template\x20relative\x20URL\x20must\x20match\x20its\x20release\x20channel\x20or\x20version.','downloading','length','get','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','.env.example','from','Project\x20directory\x20already\x20exists:\x20','config','ENOENT','.env','https:','name','readdir','object','Project\x20template\x20package.json\x20is\x20invalid.','realpath','size'];a204_0xc4d8=function(){return _0x57b404;};return a204_0xc4d8();}const a204_0x511336=a204_0x3b42;(function(_0x53b61d,_0x39d316){const _0x1d3518=a204_0x3b42,_0x47a497=_0x53b61d();while(!![]){try{const _0x144ac7=parseInt(_0x1d3518(0x8b))/0x1+-parseInt(_0x1d3518(0xca))/0x2+-parseInt(_0x1d3518(0xd1))/0x3*(-parseInt(_0x1d3518(0x87))/0x4)+parseInt(_0x1d3518(0x73))/0x5*(parseInt(_0x1d3518(0xd2))/0x6)+-parseInt(_0x1d3518(0xb7))/0x7*(-parseInt(_0x1d3518(0xb2))/0x8)+parseInt(_0x1d3518(0xe1))/0x9+-parseInt(_0x1d3518(0xe0))/0xa;if(_0x144ac7===_0x39d316)break;else _0x47a497['push'](_0x47a497['shift']());}catch(_0x592d9f){_0x47a497['push'](_0x47a497['shift']());}}}(a204_0xc4d8,0x8e5b0));import{createHash}from'node:crypto';import a204_0x11e0ca from'node:fs/promises';import a204_0x45838c from'node:path';import a204_0x170d7e 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_0x511336(0x82),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x36dfc0){const _0x13b025=a204_0x511336;return typeof _0x36dfc0===_0x13b025(0xbb)&&_0x36dfc0[_0x13b025(0x8e)]()?_0x36dfc0[_0x13b025(0x8e)]():null;}function parseDescriptor(_0x14588b){const _0x4c052e=a204_0x511336;if(!_0x14588b||typeof _0x14588b!==_0x4c052e(0x9d))throw new Error(_0x4c052e(0xae)+TEMPLATE_ID+'\x22.');const _0x495c78=_0x14588b,_0x135f64=nonEmptyString(_0x495c78[_0x4c052e(0xd7)]),_0x1cbe85=nonEmptyString(_0x495c78[_0x4c052e(0x9b)]),_0x1965dc=_0x495c78[_0x4c052e(0x7e)]===undefined?undefined:nonEmptyString(_0x495c78[_0x4c052e(0x7e)])||undefined,_0x247552=nonEmptyString(_0x495c78[_0x4c052e(0xb4)])?.[_0x4c052e(0xaf)](),_0x457ec5=_0x495c78['size'];if(!_0x135f64||!a204_0x170d7e[_0x4c052e(0xb9)](_0x135f64)||!_0x1cbe85||_0x1cbe85!==a204_0x45838c[_0x4c052e(0x79)][_0x4c052e(0x76)](_0x1cbe85)||_0x1cbe85['includes']('\x5c')||_0x495c78[_0x4c052e(0x7e)]!==undefined&&!_0x1965dc||!_0x247552||!/^sha256:[a-f0-9]{64}$/[_0x4c052e(0xc0)](_0x247552)||typeof _0x457ec5!==_0x4c052e(0xcf)||!Number[_0x4c052e(0x89)](_0x457ec5)||_0x457ec5<=0x0||_0x457ec5>MAX_ARCHIVE_SIZE)throw new Error(_0x4c052e(0x72)+TEMPLATE_ID+'\x22.');return{'version':_0x135f64,'name':_0x1cbe85,'url':_0x1965dc,'sha256':_0x247552,'size':_0x457ec5};}async function fetchWithTimeout(_0x2beffa,_0x26aed1,_0xd49417,_0x162102){const _0x36ea67=a204_0x511336,_0x58964c=new AbortController(),_0x273ada=setTimeout(()=>_0x58964c['abort'](),_0x26aed1);try{const _0x5ee699=await fetch(_0x2beffa,{'headers':{'Accept':_0xd49417},'redirect':_0x36ea67(0x88),'signal':_0x58964c[_0x36ea67(0x8a)]});return await _0x162102(_0x5ee699);}finally{clearTimeout(_0x273ada);}}async function fetchTemplateDescriptor(){const _0x50c8e9=a204_0x511336,_0x4a89bb=getCliVersion(),_0xfe9d52=isBetaCliVersion(_0x4a89bb)?_0x50c8e9(0xd4):'release',_0x2203e0=await fetchProjectTemplateCdnConfig();if(!_0x2203e0)throw new Error('Rabetbase\x20CDN\x20config\x20is\x20unavailable.');const _0x67098c=parseDescriptor(resolveProjectTemplateDescriptor(_0x2203e0[_0x50c8e9(0x97)],_0x4a89bb));return{'descriptor':_0x67098c,'channel':_0xfe9d52,'assetBaseUrl':_0x2203e0[_0x50c8e9(0xe5)],'legacyAssetBaseUrl':_0x2203e0['legacyAssetBaseUrl']};}function resolveArchiveUrl(_0x46dd66,_0x196ba0,_0x165e1e,_0x18a20d){const _0x15e090=a204_0x511336,_0x219fa4=new URL(_0x165e1e+'/'),_0x2f846a=[getProjectTemplateRelativeUrl(_0x196ba0),getProjectTemplateRelativeUrl(_0x196ba0,_0x46dd66['version'])];if(_0x46dd66[_0x15e090(0x7e)]&&!_0x2f846a[_0x15e090(0x81)](_0x46dd66[_0x15e090(0x7e)]))throw new Error(_0x15e090(0x8f));const _0xe156e6=new URL(_0x18a20d+'/'),_0x37d0fa=_0x46dd66['url']?new URL(_0x46dd66[_0x15e090(0x7e)],_0x219fa4['origin']):new URL(_0x46dd66[_0x15e090(0x9b)],_0xe156e6),_0x3ebaf1=_0x46dd66[_0x15e090(0x7e)]?_0x219fa4[_0x15e090(0x83)]:_0xe156e6[_0x15e090(0x83)];if(_0x37d0fa['protocol']!==_0x15e090(0x9a)||_0x37d0fa[_0x15e090(0x83)]!==_0x3ebaf1||a204_0x45838c['posix'][_0x15e090(0x76)](decodeURIComponent(_0x37d0fa[_0x15e090(0xa5)]))!==_0x46dd66[_0x15e090(0x9b)]||!_0x46dd66[_0x15e090(0x7e)]&&!_0x37d0fa[_0x15e090(0xa5)][_0x15e090(0x8d)](_0xe156e6[_0x15e090(0xa5)]))throw new Error(_0x15e090(0xaa));return _0x37d0fa[_0x15e090(0x86)];}async function readResponseBytes(_0x22025d,_0x36eff3){const _0x275d68=a204_0x511336;if(!_0x22025d[_0x275d68(0xe7)]){const _0x5aba15=Buffer[_0x275d68(0x95)](await _0x22025d[_0x275d68(0xbc)]());if(_0x5aba15['length']>_0x36eff3)throw new Error(_0x275d68(0xcd));return _0x5aba15;}const _0x2624ad=_0x22025d[_0x275d68(0xe7)][_0x275d68(0xd6)](),_0x3eaf79=[];let _0x15a2cd=0x0;try{while(!![]){const {done:_0x49caac,value:_0x3861ec}=await _0x2624ad[_0x275d68(0x6e)]();if(_0x49caac)break;_0x15a2cd+=_0x3861ec['byteLength'];if(_0x15a2cd>_0x36eff3){await _0x2624ad['cancel']();throw new Error(_0x275d68(0xcd));}_0x3eaf79['push'](Buffer[_0x275d68(0x95)](_0x3861ec));}}finally{_0x2624ad['releaseLock']();}return Buffer[_0x275d68(0xdf)](_0x3eaf79,_0x15a2cd);}async function downloadArchive(_0x46014c,_0x5d8d5c,_0x288713,_0x1f21c7,_0x9bf7f8,_0x53bea4){const _0x5bd706=a204_0x511336,_0x104b7b=await fetchWithTimeout(resolveArchiveUrl(_0x46014c,_0x5d8d5c,_0x288713,_0x1f21c7),ARCHIVE_TIMEOUT_MS,_0x5bd706(0x84),async _0x454e80=>{const _0x5672d0=_0x5bd706;if(!_0x454e80['ok'])throw new Error(_0x5672d0(0xd9)+_0x454e80[_0x5672d0(0xb8)]+'.');const _0x22c468=Number(_0x454e80[_0x5672d0(0xb0)][_0x5672d0(0x92)](_0x5672d0(0xe4)));if(Number[_0x5672d0(0x7d)](_0x22c468)&&_0x22c468>MAX_ARCHIVE_SIZE)throw new Error(_0x5672d0(0xcb));return readResponseBytes(_0x454e80,_0x46014c[_0x5672d0(0xa0)]);});if(_0x104b7b[_0x5bd706(0x91)]!==_0x46014c[_0x5bd706(0xa0)])throw new Error(_0x5bd706(0xdc)+_0x46014c[_0x5bd706(0xa0)]+_0x5bd706(0xc9)+_0x104b7b[_0x5bd706(0x91)]+'.');_0x53bea4?.(_0x5bd706(0x6f));const _0x32f51c=_0x5bd706(0xa3)+createHash(_0x5bd706(0xb4))[_0x5bd706(0xb1)](_0x104b7b)[_0x5bd706(0xcc)]('hex');if(_0x32f51c!==_0x46014c[_0x5bd706(0xb4)])throw new Error(_0x5bd706(0xc4));await a204_0x11e0ca[_0x5bd706(0xc6)](_0x9bf7f8,_0x104b7b,{'flag':'wx'});}function a204_0x3b42(_0x112863,_0x3217ce){_0x112863=_0x112863-0x6d;const _0xc4d8d3=a204_0xc4d8();let _0x3b42a2=_0xc4d8d3[_0x112863];return _0x3b42a2;}async function assertTemplateRoot(_0x24a768){const _0x525adc=a204_0x511336,_0x130962=a204_0x45838c['join'](_0x24a768,_0x525adc(0xdd)),_0x5d5b51=JSON[_0x525adc(0x71)](await a204_0x11e0ca['readFile'](_0x130962,_0x525adc(0x70)));if(!_0x5d5b51||typeof _0x5d5b51!==_0x525adc(0x9d))throw new Error(_0x525adc(0x9e));}const LOCAL_FORBIDDEN_NAMES=new Set(['.DS_Store',a204_0x511336(0xc8),'.git','.idea',a204_0x511336(0xa9),a204_0x511336(0xde),a204_0x511336(0xa8),a204_0x511336(0xe6),a204_0x511336(0xd8),a204_0x511336(0x7f)]);function isForbiddenTemplateEntry(_0xf775f){const _0x2b2340=a204_0x511336;if(LOCAL_FORBIDDEN_NAMES[_0x2b2340(0xb3)](_0xf775f))return!![];return _0xf775f===_0x2b2340(0x99)||_0xf775f[_0x2b2340(0x8d)](_0x2b2340(0xe3))&&_0xf775f!==_0x2b2340(0x94);}function containsPath(_0x1312a0,_0x57a0aa){const _0x39f162=a204_0x511336,_0xb4698c=a204_0x45838c['relative'](_0x1312a0,_0x57a0aa);return _0xb4698c===''||!_0xb4698c[_0x39f162(0x8d)]('..'+a204_0x45838c[_0x39f162(0xad)])&&_0xb4698c!=='..'&&!a204_0x45838c[_0x39f162(0xbf)](_0xb4698c);}async function copyLocalTemplateDirectory(_0x9762bb,_0x16e718){const _0x4e9e53=a204_0x511336;await a204_0x11e0ca[_0x4e9e53(0xa4)](_0x16e718,{'recursive':!![]});for(const _0x1c407b of await a204_0x11e0ca[_0x4e9e53(0x9c)](_0x9762bb,{'withFileTypes':!![]})){const _0x4fb058=a204_0x45838c[_0x4e9e53(0x7c)](_0x9762bb,_0x1c407b[_0x4e9e53(0x9b)]),_0x471cb7=a204_0x45838c[_0x4e9e53(0x7c)](_0x16e718,_0x1c407b[_0x4e9e53(0x9b)]);if(isForbiddenTemplateEntry(_0x1c407b[_0x4e9e53(0x9b)]))throw new Error(_0x4e9e53(0xa6)+_0x4fb058);const _0x480705=await a204_0x11e0ca[_0x4e9e53(0xc3)](_0x4fb058);if(_0x480705[_0x4e9e53(0x8c)]())throw new Error(_0x4e9e53(0xac)+_0x4fb058);if(_0x480705[_0x4e9e53(0x6d)]()){await copyLocalTemplateDirectory(_0x4fb058,_0x471cb7);continue;}if(!_0x480705['isFile']())continue;await a204_0x11e0ca[_0x4e9e53(0x80)](_0x4fb058,_0x471cb7),await a204_0x11e0ca[_0x4e9e53(0xd3)](_0x471cb7,_0x480705[_0x4e9e53(0xbd)]&0x1ff);}}async function readTemplateVersion(_0x1bab54){const _0x255aa5=a204_0x511336,_0x23e3d0=JSON[_0x255aa5(0x71)](await a204_0x11e0ca['readFile'](a204_0x45838c['join'](_0x1bab54,_0x255aa5(0xdd)),_0x255aa5(0x70)));return nonEmptyString(_0x23e3d0['version'])||_0x255aa5(0x85);}async function readDirectoryIdentity(_0x30f7f3){const _0x3a552c=a204_0x511336;try{const _0x4bd4fd=await a204_0x11e0ca['lstat'](_0x30f7f3);if(!_0x4bd4fd[_0x3a552c(0x6d)]())return null;return{'dev':_0x4bd4fd[_0x3a552c(0xd5)],'ino':_0x4bd4fd[_0x3a552c(0x78)]};}catch{return null;}}async function commitStagedProject(_0x35efcd,_0x5f3254){const _0x30a83e=a204_0x511336;await a204_0x11e0ca['mkdir'](_0x5f3254);const _0x16968b=await readDirectoryIdentity(_0x5f3254);if(!_0x16968b)throw new Error(_0x30a83e(0xab));try{for(const _0x4d6c84 of await a204_0x11e0ca[_0x30a83e(0x9c)](_0x35efcd)){await a204_0x11e0ca[_0x30a83e(0xbe)](a204_0x45838c[_0x30a83e(0x7c)](_0x35efcd,_0x4d6c84),a204_0x45838c[_0x30a83e(0x7c)](_0x5f3254,_0x4d6c84));}}catch(_0x3567ea){const _0x13efe7=await readDirectoryIdentity(_0x5f3254);_0x13efe7?.[_0x30a83e(0xd5)]===_0x16968b[_0x30a83e(0xd5)]&&_0x13efe7[_0x30a83e(0x78)]===_0x16968b[_0x30a83e(0x78)]&&await a204_0x11e0ca['rm'](_0x5f3254,{'recursive':!![],'force':!![]});throw _0x3567ea;}}export async function materializeProjectTemplate(_0x509e62,_0x27d443){const _0x5d7da3=a204_0x511336,_0x1925a6=a204_0x45838c[_0x5d7da3(0xdb)](_0x509e62),_0xfc7075=a204_0x45838c[_0x5d7da3(0xe8)](_0x1925a6);try{await a204_0x11e0ca[_0x5d7da3(0xc3)](_0x1925a6);throw new Error(_0x5d7da3(0x96)+_0x1925a6);}catch(_0xd361b9){if(_0xd361b9[_0x5d7da3(0xc7)]!=='ENOENT')throw _0xd361b9;}const _0xd816cd=await a204_0x11e0ca['mkdtemp'](a204_0x45838c[_0x5d7da3(0x7c)](_0xfc7075,'.rabetbase-create-')),_0x3a26e3=a204_0x45838c[_0x5d7da3(0x7c)](_0xd816cd,_0x5d7da3(0x77)),_0x1d60c0=a204_0x45838c['join'](_0xd816cd,_0x5d7da3(0xce));try{try{_0x27d443?.(_0x5d7da3(0xc5));const {descriptor:_0x26dffc,channel:_0x3baf1d,assetBaseUrl:_0x381092,legacyAssetBaseUrl:_0x3a871b}=await fetchTemplateDescriptor();return _0x27d443?.(_0x5d7da3(0x90)),await downloadArchive(_0x26dffc,_0x3baf1d,_0x381092,_0x3a871b,_0x1d60c0,_0x27d443),_0x27d443?.(_0x5d7da3(0xe2)),await extractProjectTemplateArchive(_0x1d60c0,_0x3a26e3),await assertTemplateRoot(_0x3a26e3),await commitStagedProject(_0x3a26e3,_0x1925a6),{'source':_0x5d7da3(0xb6),'version':_0x26dffc['version']};}catch(_0x393085){if(_0x393085[_0x5d7da3(0xc7)]===_0x5d7da3(0xa7))throw CliErrors['validation']('Project\x20directory\x20already\x20exists:\x20'+_0x1925a6,'Use\x20a\x20different\x20project\x20name.');const _0x135463=_0x393085 instanceof Error?_0x393085[_0x5d7da3(0xa1)]:String(_0x393085);throw CliErrors[_0x5d7da3(0xb5)](_0x5d7da3(0xc2),_0x5d7da3(0xc1)+_0x135463);}}finally{await a204_0x11e0ca['rm'](_0xd816cd,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x4315f0,_0xfb289c,_0x465ca){const _0x3cd6a5=a204_0x511336;let _0xa58eee;try{_0xa58eee=await a204_0x11e0ca['realpath'](a204_0x45838c[_0x3cd6a5(0xdb)](_0x4315f0));}catch{throw CliErrors['validation'](_0x3cd6a5(0xba)+a204_0x45838c['resolve'](_0x4315f0),'Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.');}const _0x28d0da=await a204_0x11e0ca[_0x3cd6a5(0xc3)](_0xa58eee);if(!_0x28d0da['isDirectory']())throw CliErrors[_0x3cd6a5(0xb5)]('Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20'+_0xa58eee);const _0x3fac1c=a204_0x45838c[_0x3cd6a5(0xdb)](_0xfb289c),_0x1100d2=await a204_0x11e0ca[_0x3cd6a5(0x9f)](a204_0x45838c[_0x3cd6a5(0xe8)](_0x3fac1c)),_0x1a017c=a204_0x45838c[_0x3cd6a5(0x7c)](_0x1100d2,a204_0x45838c[_0x3cd6a5(0x76)](_0x3fac1c));if(containsPath(_0xa58eee,_0x1a017c)||containsPath(_0x1a017c,_0xa58eee))throw CliErrors['validation'](_0x3cd6a5(0x75),_0x3cd6a5(0x93));try{await a204_0x11e0ca[_0x3cd6a5(0xc3)](_0x1a017c);throw CliErrors[_0x3cd6a5(0xb5)](_0x3cd6a5(0x96)+_0x1a017c,_0x3cd6a5(0x7b));}catch(_0x1f985e){if(_0x1f985e[_0x3cd6a5(0xc7)]!==_0x3cd6a5(0x98))throw _0x1f985e;}const _0x4a90bb=a204_0x45838c[_0x3cd6a5(0xe8)](_0x1a017c);await a204_0x11e0ca['access'](_0x4a90bb);const _0x147f3f=await a204_0x11e0ca[_0x3cd6a5(0xda)](a204_0x45838c[_0x3cd6a5(0x7c)](_0x4a90bb,_0x3cd6a5(0xd0))),_0x50964b=a204_0x45838c[_0x3cd6a5(0x7c)](_0x147f3f,'project');try{_0x465ca?.(_0x3cd6a5(0x7a)),await copyLocalTemplateDirectory(_0xa58eee,_0x50964b),await assertTemplateRoot(_0x50964b);const _0xe91586=await readTemplateVersion(_0x50964b);return await commitStagedProject(_0x50964b,_0x1a017c),{'source':_0x3cd6a5(0x85),'version':_0xe91586};}catch(_0x17d75c){const _0x203e09=_0x17d75c instanceof Error?_0x17d75c[_0x3cd6a5(0xa1)]:String(_0x17d75c);throw CliErrors[_0x3cd6a5(0xb5)](_0x3cd6a5(0xa2)+_0x203e09,_0x3cd6a5(0x74));}finally{await a204_0x11e0ca['rm'](_0x147f3f,{'recursive':!![],'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x139b2a,_0x28a947){const _0x2eee09=a205_0x4dd7,_0x2dd413=_0x139b2a();while(!![]){try{const _0x5c8cc5=-parseInt(_0x2eee09(0x1e3))/0x1*(parseInt(_0x2eee09(0x1eb))/0x2)+parseInt(_0x2eee09(0x1ed))/0x3*(parseInt(_0x2eee09(0x1ef))/0x4)+-parseInt(_0x2eee09(0x1e0))/0x5+parseInt(_0x2eee09(0x1e6))/0x6*(-parseInt(_0x2eee09(0x1e7))/0x7)+-parseInt(_0x2eee09(0x1e8))/0x8*(-parseInt(_0x2eee09(0x1e1))/0x9)+-parseInt(_0x2eee09(0x1ea))/0xa*(parseInt(_0x2eee09(0x1df))/0xb)+parseInt(_0x2eee09(0x1e2))/0xc;if(_0x5c8cc5===_0x28a947)break;else _0x2dd413['push'](_0x2dd413['shift']());}catch(_0xcfe881){_0x2dd413['push'](_0x2dd413['shift']());}}}(a205_0x4bc3,0x67a38));import{CliErrors}from'../../../errors.js';function a205_0x4bc3(){const _0x2172fd=['7350YUDWKt','1288IxqBxW','8JIszyt','length','40xFxfFq','1697672spzxJy','trim','1983759xowDbB','test','4WyiPMG','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','Project\x20name\x20\x22','632852kfjdba','3514545azmNlh','5182695oicZOb','14336028BZVTou','1HMXTAU','\x22\x20is\x20reserved\x20on\x20Windows','Project\x20name\x20cannot\x20exceed\x20'];a205_0x4bc3=function(){return _0x2172fd;};return a205_0x4bc3();}const PROJECT_NAME_PATTERN=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i,MAX_PROJECT_NAME_LENGTH=0x64;export function getProjectNameValidationError(_0x1198de){const _0x2cbe87=a205_0x4dd7,_0x472160=_0x1198de[_0x2cbe87(0x1ec)]();if(!_0x472160)return'Project\x20name\x20cannot\x20be\x20empty';if(_0x472160[_0x2cbe87(0x1e9)]>MAX_PROJECT_NAME_LENGTH)return _0x2cbe87(0x1e5)+MAX_PROJECT_NAME_LENGTH+'\x20characters';if(!PROJECT_NAME_PATTERN[_0x2cbe87(0x1ee)](_0x472160))return _0x2cbe87(0x1dd);if(WINDOWS_RESERVED_NAME[_0x2cbe87(0x1ee)](_0x472160))return _0x2cbe87(0x1de)+_0x472160+_0x2cbe87(0x1e4);return null;}function a205_0x4dd7(_0x17fdb1,_0x4b7d38){_0x17fdb1=_0x17fdb1-0x1dd;const _0x4bc3cc=a205_0x4bc3();let _0x4dd7c8=_0x4bc3cc[_0x17fdb1];return _0x4dd7c8;}export function validateProjectName(_0x55651d){const _0x304a2d=a205_0x4dd7,_0x3df5bf=_0x55651d[_0x304a2d(0x1ec)](),_0x560823=getProjectNameValidationError(_0x3df5bf);if(_0x560823)throw CliErrors['validation'](_0x560823,'Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.');return _0x3df5bf;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b414b,_0x4c9d2f){const _0x25b3f5=a206_0x5167,_0x2c2fd6=_0x4b414b();while(!![]){try{const _0x28493c=-parseInt(_0x25b3f5(0x181))/0x1*(parseInt(_0x25b3f5(0x183))/0x2)+parseInt(_0x25b3f5(0x192))/0x3*(-parseInt(_0x25b3f5(0x18d))/0x4)+parseInt(_0x25b3f5(0x199))/0x5*(-parseInt(_0x25b3f5(0x188))/0x6)+-parseInt(_0x25b3f5(0x1aa))/0x7+-parseInt(_0x25b3f5(0x1a4))/0x8*(parseInt(_0x25b3f5(0x18a))/0x9)+-parseInt(_0x25b3f5(0x195))/0xa+parseInt(_0x25b3f5(0x189))/0xb*(parseInt(_0x25b3f5(0x1a7))/0xc);if(_0x28493c===_0x4c9d2f)break;else _0x2c2fd6['push'](_0x2c2fd6['shift']());}catch(_0x258a64){_0x2c2fd6['push'](_0x2c2fd6['shift']());}}}(a206_0xcde8,0x4b17e));import{createWriteStream}from'node:fs';function a206_0xcde8(){const _0x3e6ad3=['\x20entries.','Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20','771740SsOncp','Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20','split','startsWith','205pstymc','add','get','resolve','catch','en-US','Project\x20template\x20ZIP\x20exceeds\x20','replace','set','dirname','fileName','136ptpvpg','ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20','endsWith','324kUvDiE','has','slice','3184517tAJXHo','close','mkdir','open','Unable\x20to\x20read\x20ZIP\x20entry:\x20','openReadStream','test','Case-conflicting\x20ZIP\x20entry\x20path:\x20','error','214qpQqaz','isEncrypted','1042vvdMpn','uncompressedSize','readEntry','Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20','sep','11346MeXDHE','814253KHNmpW','242856xtGTbZ','toLocaleLowerCase','once','185884MtgORY','Unable\x20to\x20open\x20project\x20template\x20archive.','externalFileAttributes','Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20','end','33QmYRSW'];a206_0xcde8=function(){return _0x3e6ad3;};return a206_0xcde8();}import a206_0x15ffe8 from'node:fs/promises';import a206_0xc67e4b from'node:path';function a206_0x5167(_0x177bb1,_0x33f2c6){_0x177bb1=_0x177bb1-0x17a;const _0xcde85c=a206_0xcde8();let _0x51677f=_0xcde85c[_0x177bb1];return _0x51677f;}import{pipeline}from'node:stream/promises';import a206_0x560817 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(_0x2efd94){return new Promise((_0x5b3955,_0x32fc5d)=>{const _0x3555a7=a206_0x5167;a206_0x560817[_0x3555a7(0x17b)](_0x2efd94,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x198edc,_0x5e4afc)=>{const _0x296138=_0x3555a7;if(_0x198edc||!_0x5e4afc){_0x32fc5d(_0x198edc||new Error(_0x296138(0x18e)));return;}_0x5b3955(_0x5e4afc);});});}function openEntryStream(_0x15a7cb,_0x43f96e){return new Promise((_0x4fc8ac,_0x9eb850)=>{const _0x1e9514=a206_0x5167;_0x15a7cb[_0x1e9514(0x17d)](_0x43f96e,(_0x45f145,_0x40b429)=>{const _0x3a52bc=_0x1e9514;if(_0x45f145||!_0x40b429){_0x9eb850(_0x45f145||new Error(_0x3a52bc(0x17c)+_0x43f96e[_0x3a52bc(0x1a3)]));return;}_0x4fc8ac(_0x40b429);});});}function validateEntryPath(_0x1d43a8){const _0xeab0e5=a206_0x5167,_0xd25b34=_0x1d43a8[_0xeab0e5(0x1a0)](/\\/g,'/'),_0x450b02=_0xd25b34[_0xeab0e5(0x1a6)]('/'),_0x1ba71a=_0x450b02?_0xd25b34[_0xeab0e5(0x1a9)](0x0,-0x1):_0xd25b34;if(!_0x1ba71a||_0xd25b34[_0xeab0e5(0x198)]('/')||/^[A-Za-z]:\//['test'](_0xd25b34))throw new Error('Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20'+_0x1d43a8);const _0xb73d5e=_0x1ba71a[_0xeab0e5(0x197)]('/');for(const _0x3d4f2f of _0xb73d5e){if(!_0x3d4f2f||_0x3d4f2f==='.'||_0x3d4f2f==='..'||_0x3d4f2f[_0xeab0e5(0x1a6)]('.')||_0x3d4f2f['endsWith']('\x20')||WINDOWS_INVALID_CHAR[_0xeab0e5(0x17e)](_0x3d4f2f)||WINDOWS_RESERVED_NAME[_0xeab0e5(0x17e)](_0x3d4f2f))throw new Error(_0xeab0e5(0x196)+_0x1d43a8);}return{'relativePath':_0xb73d5e['join'](a206_0xc67e4b[_0xeab0e5(0x187)]),'directory':_0x450b02};}function isSymbolicLink(_0x2a54f4){const _0x2c4939=a206_0x5167,_0xb5f82f=_0x2a54f4[_0x2c4939(0x18f)]>>>0x10&0xffff;return(_0xb5f82f&0xf000)===0xa000;}export async function extractProjectTemplateArchive(_0x46b62d,_0x40193b){const _0x4bcca0=a206_0x5167,_0x38ca75=await openZip(_0x46b62d),_0x4dd666=a206_0xc67e4b[_0x4bcca0(0x19c)](_0x40193b),_0x19c601=new Set(),_0x491534=new Map();let _0x56297a=0x0,_0x386941=0x0;await a206_0x15ffe8[_0x4bcca0(0x17a)](_0x4dd666,{'recursive':!![]}),await new Promise((_0x5c2b6e,_0x3479ad)=>{const _0x89a28=_0x4bcca0;let _0x311033=![];const _0x3cd55c=_0x23e2de=>{const _0x3443c2=a206_0x5167;if(_0x311033)return;_0x311033=!![],_0x38ca75[_0x3443c2(0x1ab)](),_0x3479ad(_0x23e2de instanceof Error?_0x23e2de:new Error(String(_0x23e2de)));};_0x38ca75[_0x89a28(0x18c)](_0x89a28(0x180),_0x3cd55c),_0x38ca75[_0x89a28(0x18c)](_0x89a28(0x191),()=>{if(_0x311033)return;_0x311033=!![],_0x5c2b6e();}),_0x38ca75['on']('entry',_0x212346=>{const _0x4a3e41=_0x89a28;void(async()=>{const _0x3f061b=a206_0x5167;_0x56297a+=0x1,_0x386941+=_0x212346[_0x3f061b(0x184)];if(_0x56297a>MAX_ENTRY_COUNT)throw new Error(_0x3f061b(0x19f)+MAX_ENTRY_COUNT+_0x3f061b(0x193));if(_0x386941>MAX_UNCOMPRESSED_SIZE)throw new Error('Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.');if(_0x212346[_0x3f061b(0x182)]())throw new Error(_0x3f061b(0x194)+_0x212346[_0x3f061b(0x1a3)]);if(isSymbolicLink(_0x212346))throw new Error(_0x3f061b(0x190)+_0x212346[_0x3f061b(0x1a3)]);const {relativePath:_0x3034b7,directory:_0x444e83}=validateEntryPath(_0x212346['fileName']),_0xc9e08d=_0x3034b7[_0x3f061b(0x197)](a206_0xc67e4b[_0x3f061b(0x187)]);for(let _0x459bcc=0x1;_0x459bcc<=_0xc9e08d['length'];_0x459bcc+=0x1){const _0x1f8887=_0xc9e08d[_0x3f061b(0x1a9)](0x0,_0x459bcc)['join'](a206_0xc67e4b[_0x3f061b(0x187)]),_0x43ae6f=_0x1f8887[_0x3f061b(0x18b)](_0x3f061b(0x19e)),_0x8fa054=_0x491534[_0x3f061b(0x19b)](_0x43ae6f);if(_0x8fa054&&_0x8fa054!==_0x1f8887)throw new Error(_0x3f061b(0x17f)+_0x212346[_0x3f061b(0x1a3)]);_0x491534[_0x3f061b(0x1a1)](_0x43ae6f,_0x1f8887);}const _0x11af77=_0x3034b7[_0x3f061b(0x18b)](_0x3f061b(0x19e));if(_0x19c601[_0x3f061b(0x1a8)](_0x11af77))throw new Error(_0x3f061b(0x186)+_0x212346[_0x3f061b(0x1a3)]);_0x19c601[_0x3f061b(0x19a)](_0x11af77);const _0x13c697=a206_0xc67e4b['resolve'](_0x4dd666,_0x3034b7);if(_0x13c697!==_0x4dd666&&!_0x13c697[_0x3f061b(0x198)](''+_0x4dd666+a206_0xc67e4b[_0x3f061b(0x187)]))throw new Error(_0x3f061b(0x1a5)+_0x212346[_0x3f061b(0x1a3)]);if(_0x444e83)await a206_0x15ffe8[_0x3f061b(0x17a)](_0x13c697,{'recursive':!![]});else{await a206_0x15ffe8[_0x3f061b(0x17a)](a206_0xc67e4b[_0x3f061b(0x1a2)](_0x13c697),{'recursive':!![]});const _0x2c23ee=await openEntryStream(_0x38ca75,_0x212346);await pipeline(_0x2c23ee,createWriteStream(_0x13c697,{'flags':'wx','mode':0x1a4}));}_0x38ca75['readEntry']();})()[_0x4a3e41(0x19d)](_0x3cd55c);}),_0x38ca75[_0x89a28(0x185)]();});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a207_0x2495(){const _0x1d7de6=['2134062PyzNBy','1101458yTGnKv','11tUuWJS','7cmUxJe','resolve','3854406zHkqpu','2nvPBjh','10nuhgab','4817004FmkCwZ','../../../../','316YQRrDE','dirname','7065MBlyCi','70729044xiiCqK','12655696NKUyLt'];a207_0x2495=function(){return _0x1d7de6;};return a207_0x2495();}const a207_0x4c9407=a207_0x74bd;(function(_0x383f6c,_0x59d7bc){const _0x3c5efd=a207_0x74bd,_0x411860=_0x383f6c();while(!![]){try{const _0x34e5b7=parseInt(_0x3c5efd(0x1cb))/0x1*(-parseInt(_0x3c5efd(0x1d0))/0x2)+-parseInt(_0x3c5efd(0x1d2))/0x3+-parseInt(_0x3c5efd(0x1d4))/0x4*(-parseInt(_0x3c5efd(0x1d6))/0x5)+-parseInt(_0x3c5efd(0x1cf))/0x6*(parseInt(_0x3c5efd(0x1cd))/0x7)+-parseInt(_0x3c5efd(0x1c9))/0x8+-parseInt(_0x3c5efd(0x1ca))/0x9*(parseInt(_0x3c5efd(0x1d1))/0xa)+parseInt(_0x3c5efd(0x1cc))/0xb*(parseInt(_0x3c5efd(0x1c8))/0xc);if(_0x34e5b7===_0x59d7bc)break;else _0x411860['push'](_0x411860['shift']());}catch(_0x33bbad){_0x411860['push'](_0x411860['shift']());}}}(a207_0x2495,0xcc5f3));function a207_0x74bd(_0x466bff,_0x15b475){_0x466bff=_0x466bff-0x1c8;const _0x249572=a207_0x2495();let _0x74bd16=_0x249572[_0x466bff];return _0x74bd16;}import a207_0x46b241 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a207_0x46b241[a207_0x4c9407(0x1d5)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x6e2740=a207_0x4c9407;return a207_0x46b241[_0x6e2740(0x1ce)](__dirname,_0x6e2740(0x1d3));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b634c,_0x2507b9){const _0x52440a=a208_0x4df5,_0x579bf0=_0x4b634c();while(!![]){try{const _0x5d9fee=-parseInt(_0x52440a(0x9d))/0x1+-parseInt(_0x52440a(0xa1))/0x2*(parseInt(_0x52440a(0x9c))/0x3)+-parseInt(_0x52440a(0x9e))/0x4*(parseInt(_0x52440a(0xa6))/0x5)+-parseInt(_0x52440a(0x98))/0x6+parseInt(_0x52440a(0xa0))/0x7+-parseInt(_0x52440a(0xaa))/0x8+parseInt(_0x52440a(0xa2))/0x9*(parseInt(_0x52440a(0x9f))/0xa);if(_0x5d9fee===_0x2507b9)break;else _0x579bf0['push'](_0x579bf0['shift']());}catch(_0x215454){_0x579bf0['push'](_0x579bf0['shift']());}}}(a208_0x59fa,0x52698));import a208_0x228b6e from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a208_0x4df5(_0x495c11,_0x2f9e63){_0x495c11=_0x495c11-0x97;const _0x59fae1=a208_0x59fa();let _0x4df5b6=_0x59fae1[_0x495c11];return _0x4df5b6;}import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';function a208_0x59fa(){const _0x52db51=['success','info','error','20ZMELsx','version','Starting\x20project\x20template\x20creation','now','1615336AyjJel','cwd','905748ajqaPT','Failed\x20to\x20copy\x20project\x20template','copy','message','246930Nrdolq','35355vaocNM','328996UtjYge','20PqGuEs','2749740UZebyI','12fFZSQC','5201217MaMslp'];a208_0x59fa=function(){return _0x52db51;};return a208_0x59fa();}export async function copyProjectTemplate(_0x5b9092,_0x3a4ab0,_0x5b4b9f){const _0x534b7f=a208_0x4df5,_0x4f8e34=Date[_0x534b7f(0xa9)](),_0x1f9d2=a208_0x228b6e['resolve'](process[_0x534b7f(0x97)](),_0x5b9092);try{logger[_0x534b7f(0xa4)]('copy',_0x534b7f(0xa8),{'projectCode':_0x5b9092});const _0x332542=_0x5b4b9f?await materializeLocalProjectTemplate(_0x5b4b9f,_0x1f9d2,_0x3a4ab0):await materializeProjectTemplate(_0x1f9d2,_0x3a4ab0),_0x1beb3e=Date['now']()-_0x4f8e34;logger[_0x534b7f(0xa3)](_0x534b7f(0x9a),'Project\x20template\x20created',_0x1beb3e,{'projectCode':_0x5b9092,'templateSource':_0x332542['source'],'templateVersion':_0x332542[_0x534b7f(0xa7)]});}catch(_0x487b0e){const _0x25a06d=Date['now']()-_0x4f8e34;logger[_0x534b7f(0xa5)]('copy',_0x534b7f(0x99),{'projectCode':_0x5b9092,'error':_0x487b0e instanceof Error?_0x487b0e[_0x534b7f(0x9b)]:String(_0x487b0e),'duration':_0x25a06d});throw _0x487b0e;}return formatElapsed(_0x4f8e34);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3274b6,_0xedd74f){const _0x35f9d6=a209_0x5863,_0x20a9f4=_0x3274b6();while(!![]){try{const _0x5b0fa9=-parseInt(_0x35f9d6(0xd8))/0x1+-parseInt(_0x35f9d6(0xd1))/0x2+parseInt(_0x35f9d6(0xd3))/0x3+-parseInt(_0x35f9d6(0xdc))/0x4*(-parseInt(_0x35f9d6(0xce))/0x5)+-parseInt(_0x35f9d6(0xda))/0x6+parseInt(_0x35f9d6(0xcd))/0x7+parseInt(_0x35f9d6(0xd2))/0x8;if(_0x5b0fa9===_0xedd74f)break;else _0x20a9f4['push'](_0x20a9f4['shift']());}catch(_0x1a6b2a){_0x20a9f4['push'](_0x20a9f4['shift']());}}}(a209_0x2b58,0xaa5ff));import a209_0x5d909a from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a209_0x2b58(){const _0x583b85=['success','resolve','8435084WdcPSE','7915HZFaAQ','--write','Code\x20format\x20failed','1898400pSofmN','12598240QCMlJM','1266798oUCSJc','message','prettier','now','error','1364015fkVBQC','cwd','6455310xsSNZi','format','2236ecgPOw'];a209_0x2b58=function(){return _0x583b85;};return a209_0x2b58();}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a209_0x5863(_0x1c28e5,_0x1e7096){_0x1c28e5=_0x1c28e5-0xcc;const _0x2b58c8=a209_0x2b58();let _0x586396=_0x2b58c8[_0x1c28e5];return _0x586396;}export async function formatProjectCode(_0xe4570e){const _0x14de1b=a209_0x5863,_0x1c77c9=Date[_0x14de1b(0xd6)](),_0x39e151=a209_0x5d909a[_0x14de1b(0xcc)](process[_0x14de1b(0xd9)](),_0xe4570e);try{logger['info'](_0x14de1b(0xdb),'Starting\x20code\x20format',{'projectCode':_0xe4570e}),await execa(resolveNpmBin('npx'),[_0x14de1b(0xd5),_0x14de1b(0xcf),'.'],{'cwd':_0x39e151});const _0x10a712=Date['now']()-_0x1c77c9;logger[_0x14de1b(0xdd)](_0x14de1b(0xdb),'Code\x20format\x20completed',_0x10a712,{'projectCode':_0xe4570e});}catch(_0x53d933){const _0x26f247=Date['now']()-_0x1c77c9;logger[_0x14de1b(0xd7)](_0x14de1b(0xdb),_0x14de1b(0xd0),{'projectCode':_0xe4570e,'error':_0x53d933 instanceof Error?_0x53d933[_0x14de1b(0xd4)]:String(_0x53d933),'duration':_0x26f247});throw _0x53d933;}return formatElapsed(_0x1c77c9);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2e0ebc,_0x8dc11b){const _0x4e2859=a210_0xd63d,_0x3da7d1=_0x2e0ebc();while(!![]){try{const _0xc7ce3a=parseInt(_0x4e2859(0x79))/0x1*(parseInt(_0x4e2859(0x84))/0x2)+-parseInt(_0x4e2859(0x7a))/0x3*(-parseInt(_0x4e2859(0x81))/0x4)+parseInt(_0x4e2859(0x75))/0x5*(-parseInt(_0x4e2859(0x7b))/0x6)+-parseInt(_0x4e2859(0x85))/0x7+parseInt(_0x4e2859(0x71))/0x8*(parseInt(_0x4e2859(0x80))/0x9)+parseInt(_0x4e2859(0x74))/0xa+-parseInt(_0x4e2859(0x78))/0xb;if(_0xc7ce3a===_0x8dc11b)break;else _0x3da7d1['push'](_0x3da7d1['shift']());}catch(_0x3dbcc2){_0x3da7d1['push'](_0x3da7d1['shift']());}}}(a210_0x4b14,0xad4df));import a210_0x113f35 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a210_0xd63d(_0x267902,_0x17fc31){_0x267902=_0x267902-0x71;const _0x4b1416=a210_0x4b14();let _0xd63d2a=_0x4b1416[_0x267902];return _0xd63d2a;}function a210_0x4b14(){const _0x1188a3=['5jUNxuK','5559KaAKki','60lIvtBZ','npm','Starting\x20dependency\x20install','message','Dependency\x20install\x20completed','11907684gyAORP','2100QQkZhK','https://registry.npmmirror.com','--registry','5490FXLaPx','3977442nebpmw','info','success','8lxPpJy','Dependency\x20install\x20failed','install','2522870jdMYEt','530195UWhmpl','cwd','now','2458082SyblXJ'];a210_0x4b14=function(){return _0x1188a3;};return a210_0x4b14();}export async function installDependencies(_0xa6f59a){const _0x4c4ef1=a210_0xd63d,_0x5f3862=Date[_0x4c4ef1(0x77)](),_0x11608f=a210_0x113f35['resolve'](process[_0x4c4ef1(0x76)](),_0xa6f59a);try{logger[_0x4c4ef1(0x86)]('install',_0x4c4ef1(0x7d),{'projectCode':_0xa6f59a,'registry':_0x4c4ef1(0x82)}),await execa(resolveNpmBin(_0x4c4ef1(0x7c)),[_0x4c4ef1(0x73),_0x4c4ef1(0x83),_0x4c4ef1(0x82)],{'cwd':_0x11608f});const _0x464a63=Date[_0x4c4ef1(0x77)]()-_0x5f3862;logger[_0x4c4ef1(0x87)](_0x4c4ef1(0x73),_0x4c4ef1(0x7f),_0x464a63,{'projectCode':_0xa6f59a});}catch(_0x2cee7b){const _0x2e3587=Date['now']()-_0x5f3862;logger['error'](_0x4c4ef1(0x73),_0x4c4ef1(0x72),{'projectCode':_0xa6f59a,'error':_0x2cee7b instanceof Error?_0x2cee7b[_0x4c4ef1(0x7e)]:String(_0x2cee7b),'duration':_0x2e3587});throw _0x2cee7b;}return formatElapsed(_0x5f3862);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a211_0x2f9a4c=a211_0x442d;(function(_0x6154f8,_0x48bd2b){const _0x4299fb=a211_0x442d,_0x170e67=_0x6154f8();while(!![]){try{const _0xa040d1=parseInt(_0x4299fb(0x1ee))/0x1+parseInt(_0x4299fb(0x1f0))/0x2*(parseInt(_0x4299fb(0x1ef))/0x3)+parseInt(_0x4299fb(0x1ec))/0x4+-parseInt(_0x4299fb(0x1f6))/0x5*(parseInt(_0x4299fb(0x1f2))/0x6)+-parseInt(_0x4299fb(0x1eb))/0x7*(-parseInt(_0x4299fb(0x1fb))/0x8)+parseInt(_0x4299fb(0x1f9))/0x9*(parseInt(_0x4299fb(0x1f4))/0xa)+-parseInt(_0x4299fb(0x1fc))/0xb;if(_0xa040d1===_0x48bd2b)break;else _0x170e67['push'](_0x170e67['shift']());}catch(_0x4b5939){_0x170e67['push'](_0x170e67['shift']());}}}(a211_0x2d30,0x569c1));import{CliErrors}from'../../errors.js';function a211_0x2d30(){const _0x19e1d6=['293893nKzcNV','513852YUPquj','8qJrnIh','validation','18iqUVgB','read','10xUFEeL','domain-routing-sync','175855BQcyBE','path','No\x20Rabetbase\x20project\x20configuration\x20was\x20found.','4206411kUJEyi','Domain\x20routing\x20synchronized:\x20','8bOWipn','21052196zHAmBJ','2169839WbJQkI','2470868XBtGIj','Synchronize\x20the\x20current\x20project\x27s\x20public\x20Domain\x20routing'];a211_0x2d30=function(){return _0x19e1d6;};return a211_0x2d30();}function a211_0x442d(_0xb911a2,_0x2c10d9){_0xb911a2=_0xb911a2-0x1eb;const _0x2d3046=a211_0x2d30();let _0x442d3c=_0x2d3046[_0xb911a2];return _0x442d3c;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';export const projectDomainRoutingSyncDefinition={'service':'project','command':a211_0x2f9a4c(0x1f5),'description':a211_0x2f9a4c(0x1ed),'risk':a211_0x2f9a4c(0x1f3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(){const _0x3688c8=a211_0x2f9a4c,_0x403ed4=findProjectRootDirectory();if(!resolveConfigPath(_0x403ed4))throw CliErrors[_0x3688c8(0x1f1)](_0x3688c8(0x1f8),'Run\x20'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>\x20in\x20the\x20project\x20directory\x20first.');const _0x34959a=writeProjectDomainRoutingManifest(_0x403ed4);return{'ok':!![],'message':_0x3688c8(0x1fa)+_0x34959a[_0x3688c8(0x1f7)],'data':_0x34959a};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a212_0x22716a=a212_0x225b;function a212_0x225b(_0x361695,_0x5e9059){_0x361695=_0x361695-0x10d;const _0x282eed=a212_0x282e();let _0x225b8c=_0x282eed[_0x361695];return _0x225b8c;}(function(_0x4d8321,_0x5c26ea){const _0x2a405b=a212_0x225b,_0x4e7aaa=_0x4d8321();while(!![]){try{const _0x51aa3b=-parseInt(_0x2a405b(0x134))/0x1+parseInt(_0x2a405b(0x10f))/0x2*(parseInt(_0x2a405b(0x122))/0x3)+parseInt(_0x2a405b(0x10e))/0x4+-parseInt(_0x2a405b(0x12d))/0x5*(parseInt(_0x2a405b(0x12f))/0x6)+-parseInt(_0x2a405b(0x13d))/0x7+-parseInt(_0x2a405b(0x139))/0x8*(parseInt(_0x2a405b(0x123))/0x9)+-parseInt(_0x2a405b(0x12b))/0xa*(-parseInt(_0x2a405b(0x130))/0xb);if(_0x51aa3b===_0x5c26ea)break;else _0x4e7aaa['push'](_0x4e7aaa['shift']());}catch(_0x361bec){_0x4e7aaa['push'](_0x4e7aaa['shift']());}}}(a212_0x282e,0xd2b66));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{analyseProjectUpgrade,upgradeApp}from'../../commands/project/upgrade.js';import{projectDomainRoutingSyncDefinition}from'../../commands/project/domain-routing-sync.js';const createFlags=[{'name':a212_0x22716a(0x113),'type':a212_0x22716a(0x118),'description':a212_0x22716a(0x121)},{'name':'env','type':'string','description':a212_0x22716a(0x129)},{'name':a212_0x22716a(0x119),'type':a212_0x22716a(0x118),'description':a212_0x22716a(0x11c)},{'name':a212_0x22716a(0x114),'type':a212_0x22716a(0x12a),'description':'Initialize\x20the\x20current\x20empty\x20directory\x20instead\x20of\x20creating\x20a\x20child\x20directory','default':![]},{'name':a212_0x22716a(0x131),'type':a212_0x22716a(0x118),'description':a212_0x22716a(0x128)}],upgradeFlags=[{'name':'yes','type':'boolean','description':a212_0x22716a(0x110),'default':![]}];export const projectDefinitions=[{'service':a212_0x22716a(0x111),'command':a212_0x22716a(0x132),'description':a212_0x22716a(0x11b),'risk':a212_0x22716a(0x13b),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a212_0x22716a(0x10d),'description':a212_0x22716a(0x12c),'required':![]}],'flags':createFlags,async 'execute'(_0x322a9f){const _0x5ad0f5=a212_0x22716a,{createApp:_0xdf496c}=await import(_0x5ad0f5(0x13a)),_0x194f46=_0x322a9f[_0x5ad0f5(0x120)]('name')['trim']()||_0x322a9f[_0x5ad0f5(0x138)][0x0]?.['trim'](),_0x1e6a09=_0x322a9f[_0x5ad0f5(0x120)]('env')||undefined,_0x855896=_0x322a9f[_0x5ad0f5(0x120)](_0x5ad0f5(0x119))||undefined,_0x46d89c=_0x322a9f['str'](_0x5ad0f5(0x131))[_0x5ad0f5(0x112)]()||undefined,_0x305fa5=_0x322a9f[_0x5ad0f5(0x126)](_0x5ad0f5(0x114));if(_0x305fa5&&_0x194f46)throw CliErrors[_0x5ad0f5(0x11f)]('--current-dir\x20cannot\x20be\x20combined\x20with\x20a\x20project\x20name.',_0x5ad0f5(0x125)+CLI_BIN_NAME+_0x5ad0f5(0x133));if(_0x322a9f[_0x5ad0f5(0x116)]){if(!_0x194f46&&!_0x305fa5)throw CliErrors[_0x5ad0f5(0x11f)](_0x5ad0f5(0x12e),_0x5ad0f5(0x11e)+CLI_BIN_NAME+_0x5ad0f5(0x137)+CLI_BIN_NAME+'\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]');await _0xdf496c({'projectCode':_0x194f46,'appCode':_0x855896,'env':_0x1e6a09,'cookie':_0x322a9f[_0x5ad0f5(0x135)],'currentDir':_0x305fa5,'nonInteractive':!![],'templateSource':_0x46d89c});}else await _0xdf496c({'projectCode':_0x194f46,'appCode':_0x855896,'env':_0x1e6a09,'cookie':_0x322a9f[_0x5ad0f5(0x135)],'currentDir':_0x305fa5,'templateSource':_0x46d89c});return{'ok':!![]};}},projectDomainRoutingSyncDefinition,{'service':a212_0x22716a(0x111),'command':a212_0x22716a(0x13c),'description':a212_0x22716a(0x115),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'dryRun'(){const _0x41df18=a212_0x22716a,_0x528d55=analyseProjectUpgrade(process[_0x41df18(0x11a)]());return{'method':'PATCH','url':process[_0x41df18(0x11a)](),'body':_0x528d55,'description':'Would\x20upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure\x20without\x20overwriting\x20project-owned\x20entrypoints'};},async 'execute'(_0x441a29){const _0x2ea2fc=a212_0x22716a,_0x599d24=await upgradeApp(_0x441a29[_0x2ea2fc(0x116)],{'yes':_0x441a29[_0x2ea2fc(0x126)](_0x2ea2fc(0x11d))});return{'ok':_0x599d24[_0x2ea2fc(0x117)]||_0x599d24['cancelled']===!![],'message':_0x599d24[_0x2ea2fc(0x127)]?_0x2ea2fc(0x124):_0x599d24[_0x2ea2fc(0x117)]?_0x2ea2fc(0x136):'Project\x20upgrade\x20completed\x20with\x20follow-up\x20work.','data':_0x599d24};}}];function a212_0x282e(){const _0x5c1468=['upgrade','3326897kRVqfX','project-name','3506632BHeSiH','26reILCm','Skip\x20confirmation\x20prompt','project','trim','name','current-dir','Upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure','nonInteractive','completed','string','appcode','cwd','Create\x20a\x20new\x20project','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','yes','Usage:\x20','validation','str','Project\x20name','24519UzuVdN','13632696kUaLmk','Upgrade\x20cancelled.','Run\x20','bool','cancelled','Prepared\x20local\x20project\x20template\x20directory','Target\x20environment','boolean','340XNWkrE','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','120GRRNjh','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','28962hgNDBx','1111363RbZcHR','template-source','create','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]\x20from\x20the\x20empty\x20target\x20directory.','1449088kBOZYv','cookie','Project\x20upgrade\x20completed.','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]\x20or\x20','args','8doRGcR','../../commands/project/create/main.js','write'];a212_0x282e=function(){return _0x5c1468;};return a212_0x282e();}
|