@lovrabet/rabetbase-cli 2.5.8 → 2.5.9-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.d.ts +8 -5
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.d.ts +5 -3
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +14 -11
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-management-client.d.ts +2 -2
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.d.ts +3 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +17 -15
- package/skills/rabetbase/references/rabetbase-rule.md +8 -6
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a216_0x455092=a216_0x2a95;(function(_0x384072,_0x1203c4){const _0x3a20fe=a216_0x2a95,_0x31f50f=_0x384072();while(!![]){try{const _0x319c69=parseInt(_0x3a20fe(0xa7))/0x1+parseInt(_0x3a20fe(0x8a))/0x2+parseInt(_0x3a20fe(0x88))/0x3*(-parseInt(_0x3a20fe(0xd1))/0x4)+-parseInt(_0x3a20fe(0xc3))/0x5+parseInt(_0x3a20fe(0xc7))/0x6+parseInt(_0x3a20fe(0xcc))/0x7*(parseInt(_0x3a20fe(0xcb))/0x8)+parseInt(_0x3a20fe(0xa1))/0x9*(-parseInt(_0x3a20fe(0xbb))/0xa);if(_0x319c69===_0x1203c4)break;else _0x31f50f['push'](_0x31f50f['shift']());}catch(_0x1446fc){_0x31f50f['push'](_0x31f50f['shift']());}}}(a216_0x49e8,0x771bf));import{copyFileSync,existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import a216_0x5cdfd4 from'node:path';function a216_0x49e8(){const _0x4055ad=['string','add','keys','startsWith','807565WuknCq','.rabetbase','object','some','4372020xlrXaE','apiDir','Multiple\x20Lovrabet\x20model\x20profiles\x20match\x20Runtime\x20Domain','manualMergeRequired','722576hbvJNH','21bxsoob','map','sdk-config.ts','No\x20Lovrabet\x20model\x20profile\x20matches\x20Runtime\x20Domain','utf8','24916WOpnqE','resolve','69RMyAwX','name','1654842hUDvzu','api-model-registry-v2','Model\x20facts\x20are\x20preserved\x20and\x20completed\x20from\x20legacy\x20generated\x20files\x20when\x20possible.','candidates','normalizedApiDir','has','path','profiles','The\x20existing\x20runtime\x20selector\x20is\x20not\x20a\x20recognized\x20current\x20generated\x20file.','The\x20file\x20contains\x20project-owned\x20code\x20and\x20will\x20not\x20be\x20overwritten.','find','backups','entries','push','dirname','basename','action','unconfigured','length','flatMap','single','preserve','/**\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','1602zZoMTA','app','appcode','join','unchanged','migrate-single-app','164246zYzJuH','Recognized\x20legacy\x20CLI\x20scaffold;\x20a\x20backup\x20will\x20be\x20retained.','project-upgrade','api.ts','manual-merge','defaultApp','-api.ts','replace-generated','.rabetbase.json','external-api-dir','apps','relative','client.ts','default','modelRuntime','create','api','includes','apiGroup','./model-runtime','67340ZBNLBb','isDefault','./models.generated','files'];a216_0x49e8=function(){return _0x4055ad;};return a216_0x49e8();}import{getMultiAppConfigs,initMultiAppEnvironment,readConfigFile,writeConfigFile}from'../../context.js';import{DEFAULT_API_DIR}from'../../constant/paths.js';import{getRuntimeDomain}from'../../constant/domain.js';import{getRegistryGroup,resolveApiProfileLayouts}from'../../api/api-group.js';import{MODEL_REGISTRY_FILE_NAME,MODEL_RUNTIME_FILE_NAME,readModelRegistry,updateModelRegistry}from'../../api/model-registry-file.js';import{isLegacyGeneratedApiScaffold,isLegacyGeneratedClientScaffold,parseLegacyApiModels}from'../../api/legacy-api-file.js';import{renderModelRegistryScaffold}from'../../api/model-registry-scaffold.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';function a216_0x2a95(_0xa2fece,_0x3584bc){_0xa2fece=_0xa2fece-0x87;const _0x49e850=a216_0x49e8();let _0x2a9553=_0x49e850[_0xa2fece];return _0x2a9553;}const MIGRATION_ID=a216_0x455092(0x8b),SDK_CONFIG_SOURCE=a216_0x455092(0xa0);function relativeMigrationDir(_0x1c1748,_0x1e94f3){const _0x23d2d0=a216_0x455092,_0x3f69e4=a216_0x5cdfd4[_0x23d2d0(0xb2)](_0x1c1748,_0x1e94f3);return _0x3f69e4&&!_0x3f69e4[_0x23d2d0(0xc2)]('..')?_0x3f69e4:_0x23d2d0(0xb0);}function candidatePath(_0x4b111c,_0x1285b2,_0x1d018c){const _0x5e18e2=a216_0x455092;return a216_0x5cdfd4[_0x5e18e2(0xa4)](_0x4b111c,_0x5e18e2(0xc4),_0x5e18e2(0xa9),MIGRATION_ID,_0x5e18e2(0x8d),relativeMigrationDir(_0x4b111c,_0x1285b2),_0x1d018c);}function backupPath(_0x536055,_0x561144,_0x97b3b6){const _0x37c624=a216_0x455092;return a216_0x5cdfd4[_0x37c624(0xa4)](_0x536055,_0x37c624(0xc4),_0x37c624(0xa9),MIGRATION_ID,_0x37c624(0x95),relativeMigrationDir(_0x536055,_0x561144),_0x97b3b6);}function readOptional(_0x1845eb){const _0x5ec596=a216_0x455092;try{return readFileSync(_0x1845eb,_0x5ec596(0xd0));}catch{return undefined;}}function readJsonObject(_0x56e84d){const _0x3fe64b=a216_0x455092;try{const _0x4ab88b=JSON['parse'](readFileSync(_0x56e84d,'utf8'));return _0x4ab88b&&typeof _0x4ab88b===_0x3fe64b(0xc5)?_0x4ab88b:{};}catch{return{};}}function planEntrypoint(_0x351342,_0x24f310,_0x563e8b,_0x468873){const _0x362e54=a216_0x455092,_0x21a5c4=a216_0x5cdfd4[_0x362e54(0xa4)](_0x24f310,_0x563e8b),_0x158cb6=readOptional(_0x21a5c4);if(_0x158cb6===undefined)return{'path':_0x21a5c4,'action':_0x362e54(0xb6)};if(_0x563e8b===_0x362e54(0xaa)?_0x158cb6[_0x362e54(0xb8)](_0x362e54(0xbd))&&_0x158cb6[_0x362e54(0xb8)](_0x362e54(0xba)):_0x158cb6[_0x362e54(0xb8)]('LOVRABET_RUNTIME_DOMAIN'))return{'path':_0x21a5c4,'action':'unchanged'};if(_0x468873(_0x158cb6))return{'path':_0x21a5c4,'action':_0x362e54(0xae),'reason':_0x362e54(0xa8)};return{'path':_0x21a5c4,'action':_0x362e54(0xab),'reason':_0x362e54(0x93),'candidatePath':candidatePath(_0x351342,_0x24f310,_0x563e8b)};}function syntheticApps(_0x27a7ae){const _0x1f17ca=a216_0x455092,_0x29c6e9=_0x27a7ae['apps']&&typeof _0x27a7ae[_0x1f17ca(0xb1)]==='object'?_0x27a7ae['apps']:undefined;if(_0x29c6e9&&Object['keys'](_0x29c6e9)['length']>0x0){const _0x285214=typeof _0x27a7ae['defaultApp']===_0x1f17ca(0xbf)?_0x27a7ae[_0x1f17ca(0xac)]:Object['keys'](_0x29c6e9)[_0x1f17ca(0x9c)]===0x1?Object[_0x1f17ca(0xc1)](_0x29c6e9)[0x0]:undefined;return Object[_0x1f17ca(0x96)](_0x29c6e9)[_0x1f17ca(0x9d)](([_0x39f71f,_0x279a0e])=>{const _0x3677c0=_0x1f17ca,_0x2225f1=_0x279a0e,_0x1808c5=typeof _0x2225f1[_0x3677c0(0xa3)]===_0x3677c0(0xbf)?_0x2225f1[_0x3677c0(0xa3)]:'';return _0x1808c5?[{'name':_0x39f71f,'appcode':_0x1808c5,'apiGroup':typeof _0x2225f1[_0x3677c0(0xb9)]===_0x3677c0(0xbf)?_0x2225f1[_0x3677c0(0xb9)]:undefined,'isDefault':_0x39f71f===_0x285214,'region':'cn','regionSource':_0x3677c0(0xb4),'apiDir':typeof _0x2225f1[_0x3677c0(0xc8)]===_0x3677c0(0xbf)?_0x2225f1[_0x3677c0(0xc8)]:typeof _0x27a7ae[_0x3677c0(0xc8)]==='string'?_0x27a7ae[_0x3677c0(0xc8)]:undefined,'routingConfig':{}}]:[];});}const _0x2f5d9d=typeof _0x27a7ae['appcode']===_0x1f17ca(0xbf)?_0x27a7ae[_0x1f17ca(0xa3)]:typeof _0x27a7ae['app']==='string'?_0x27a7ae[_0x1f17ca(0xa2)]:undefined;if(!_0x2f5d9d)return[];return[{'name':_0x2f5d9d,'appcode':_0x2f5d9d,'isDefault':!![],'region':'cn','regionSource':_0x1f17ca(0xb4),'apiDir':typeof _0x27a7ae['apiDir']===_0x1f17ca(0xbf)?_0x27a7ae['apiDir']:undefined,'routingConfig':{}}];}function configuredLayouts(_0xaef64,_0x33ffb9){const _0x5cb0de=a216_0x455092;return resolveApiProfileLayouts(_0x33ffb9,_0x49b2e9=>a216_0x5cdfd4[_0x5cb0de(0x87)](_0xaef64,_0x49b2e9[_0x5cb0de(0xc8)]||DEFAULT_API_DIR),_0xaef64);}function uniqueRegistryGroups(_0x3f7f2d){const _0x5d5a0e=a216_0x455092,_0x125e80=[],_0x1dbaf5=new Set(),_0x420d51=new Set();for(const _0x964829 of _0x3f7f2d){const _0x3e4fed=getRegistryGroup(_0x3f7f2d,_0x964829);if(!_0x3e4fed){_0x1dbaf5[_0x5d5a0e(0xc0)](_0x964829['outputDir']);continue;}const _0x1e600f=_0x964829[_0x5d5a0e(0x8e)]+'\x00'+(_0x964829[_0x5d5a0e(0xb9)]??_0x5d5a0e(0x9e));!_0x420d51[_0x5d5a0e(0x8f)](_0x1e600f)&&(_0x125e80[_0x5d5a0e(0x97)](_0x3e4fed),_0x420d51[_0x5d5a0e(0xc0)](_0x1e600f));}return{'groups':_0x125e80,'skipped':[..._0x1dbaf5]};}function planGroup(_0x6e3cbb,_0x2d82c1){const _0x25e7be=a216_0x455092,_0x507e5c=_0x2d82c1[0x0][_0x25e7be(0x8e)],_0x278e6b=a216_0x5cdfd4[_0x25e7be(0xa4)](_0x507e5c,MODEL_RUNTIME_FILE_NAME),_0x399843=readOptional(_0x278e6b),_0x39a2f8=_0x399843!==undefined&&_0x399843[_0x25e7be(0xb8)]('Profile-aware\x20model\x20selection\x20generated\x20by\x20Rabetbase\x20CLI')&&_0x399843[_0x25e7be(0xb8)](_0x25e7be(0xc9))&&_0x399843[_0x25e7be(0xb8)](_0x25e7be(0xcf)),_0x208431=a216_0x5cdfd4['join'](_0x507e5c,MODEL_REGISTRY_FILE_NAME),_0x4d53ee=a216_0x5cdfd4[_0x25e7be(0xa4)](_0x507e5c,_0x25e7be(0xce)),_0x15b5d6=[planEntrypoint(_0x6e3cbb,_0x507e5c,'api.ts',isLegacyGeneratedApiScaffold),planEntrypoint(_0x6e3cbb,_0x507e5c,_0x25e7be(0xb3),isLegacyGeneratedClientScaffold),{'path':_0x278e6b,'action':_0x399843===undefined?_0x25e7be(0xb6):_0x39a2f8?_0x25e7be(0xa5):_0x25e7be(0xab),'reason':_0x399843===undefined?undefined:_0x25e7be(0x92),..._0x399843!==undefined&&!_0x39a2f8?{'candidatePath':candidatePath(_0x6e3cbb,_0x507e5c,MODEL_RUNTIME_FILE_NAME)}:{}},{'path':_0x208431,'action':existsSync(_0x208431)?_0x25e7be(0x9f):'create','reason':_0x25e7be(0x8c)},{'path':_0x4d53ee,'action':existsSync(_0x4d53ee)?_0x25e7be(0x9f):_0x25e7be(0xb6)}];return{'apiDir':_0x507e5c,'profiles':_0x2d82c1[_0x25e7be(0xcd)](_0x446352=>_0x446352[_0x25e7be(0xa2)][_0x25e7be(0x89)]),'files':_0x15b5d6};}export function analyzeProjectApiArchitecture(_0x40965a,_0x442bb4){const _0x3da8a1=a216_0x455092,_0x39917f=a216_0x5cdfd4[_0x3da8a1(0xa4)](_0x40965a,_0x3da8a1(0xaf)),_0x21d34e=_0x442bb4??(existsSync(_0x39917f)?readJsonObject(_0x39917f):{}),_0x3c014e=syntheticApps(_0x21d34e);if(_0x3c014e[_0x3da8a1(0x9c)]===0x0)return{'migration':MIGRATION_ID,'needed':![],'configAction':_0x3da8a1(0x9b),'groups':[],'skippedLegacyDirectories':[],'manualMergeRequired':![]};const _0x48f9af=_0x21d34e[_0x3da8a1(0xb1)]?_0x3da8a1(0xa5):_0x3da8a1(0xa6),{groups:_0x318609,skipped:_0x6ef84d}=uniqueRegistryGroups(configuredLayouts(_0x40965a,_0x3c014e)),_0x58e745=_0x318609['map'](_0x1fa97f=>planGroup(_0x40965a,_0x1fa97f)),_0x1f03d8=_0x58e745[_0x3da8a1(0xc6)](_0x14f69a=>_0x14f69a[_0x3da8a1(0xbe)][_0x3da8a1(0xc6)](_0x52b130=>_0x52b130[_0x3da8a1(0x9a)]===_0x3da8a1(0xab))),_0x4669c5=_0x48f9af===_0x3da8a1(0xa6)||_0x58e745['some'](_0x324451=>_0x324451[_0x3da8a1(0xbe)][_0x3da8a1(0xc6)](_0x3f53e3=>![_0x3da8a1(0xa5),'preserve'][_0x3da8a1(0xb8)](_0x3f53e3[_0x3da8a1(0x9a)])));return{'migration':MIGRATION_ID,'needed':_0x4669c5,'configAction':_0x48f9af,'groups':_0x58e745,'skippedLegacyDirectories':_0x6ef84d,'manualMergeRequired':_0x1f03d8};}function migrateSingleAppConfig(_0x2176f7){const _0x5afb97=a216_0x455092,_0x4e5b0c=a216_0x5cdfd4[_0x5afb97(0xa4)](_0x2176f7,_0x5afb97(0xaf));if(!existsSync(_0x4e5b0c))return;const _0x74dd6a=readConfigFile(_0x4e5b0c);if(_0x74dd6a[_0x5afb97(0xb1)]&&typeof _0x74dd6a[_0x5afb97(0xb1)]===_0x5afb97(0xc5))return;const _0x331c7d=typeof _0x74dd6a[_0x5afb97(0xa3)]===_0x5afb97(0xbf)?_0x74dd6a[_0x5afb97(0xa3)]:typeof _0x74dd6a['app']==='string'?_0x74dd6a[_0x5afb97(0xa2)]:undefined;if(!_0x331c7d)return;_0x74dd6a[_0x5afb97(0xb1)]={[_0x331c7d]:{'appcode':_0x331c7d}},_0x74dd6a[_0x5afb97(0xac)]=_0x331c7d,delete _0x74dd6a[_0x5afb97(0xa2)],delete _0x74dd6a[_0x5afb97(0xa3)],writeConfigFile(_0x4e5b0c,_0x74dd6a);}function legacyApiPath(_0x46096b,_0x520e08){const _0x29114d=a216_0x455092,_0x34f6ce=_0x520e08['normalizedApiDir'],_0x1272ce=_0x46096b[_0x29114d(0x9c)]===0x1||_0x520e08[_0x29114d(0xa2)]['isDefault']?[a216_0x5cdfd4[_0x29114d(0xa4)](_0x34f6ce,_0x29114d(0xaa)),a216_0x5cdfd4[_0x29114d(0xa4)](_0x34f6ce,_0x520e08[_0x29114d(0xa2)][_0x29114d(0x89)]+'-api.ts')]:[a216_0x5cdfd4['join'](_0x34f6ce,_0x520e08[_0x29114d(0xa2)][_0x29114d(0x89)]+_0x29114d(0xad))];return _0x1272ce[_0x29114d(0x94)](existsSync);}function writeCandidateOrEntrypoint(_0x44b99e,_0x44f9df,_0x570781,_0x5d736e){const _0x5e963b=a216_0x455092;if(_0x570781['action']==='unchanged'||_0x570781[_0x5e963b(0x9a)]===_0x5e963b(0x9f))return;if(_0x570781[_0x5e963b(0x9a)]===_0x5e963b(0xab)){const _0x256c84=_0x570781['candidatePath'];mkdirSync(a216_0x5cdfd4[_0x5e963b(0x98)](_0x256c84),{'recursive':!![]}),writeFileSync(_0x256c84,_0x5d736e,_0x5e963b(0xd0));return;}if(_0x570781[_0x5e963b(0x9a)]===_0x5e963b(0xae)){const _0x1d7b4e=backupPath(_0x44b99e,_0x44f9df,a216_0x5cdfd4[_0x5e963b(0x99)](_0x570781['path']));mkdirSync(a216_0x5cdfd4['dirname'](_0x1d7b4e),{'recursive':!![]}),copyFileSync(_0x570781[_0x5e963b(0x90)],_0x1d7b4e);}mkdirSync(a216_0x5cdfd4[_0x5e963b(0x98)](_0x570781[_0x5e963b(0x90)]),{'recursive':!![]}),writeFileSync(_0x570781[_0x5e963b(0x90)],_0x5d736e,_0x5e963b(0xd0));}export async function upgradeProjectApiArchitecture(_0x4231c3){const _0xe0305=a216_0x455092,_0x43dcac=analyzeProjectApiArchitecture(_0x4231c3);migrateSingleAppConfig(_0x4231c3);const _0x261c38=getMultiAppConfigs('project',_0x4231c3)??[],_0x415a0b=configuredLayouts(_0x4231c3,_0x261c38),{groups:_0x54ab4c}=uniqueRegistryGroups(_0x415a0b);let _0x3ab8f4;for(const _0x5e263c of _0x54ab4c){const _0xaa3773=_0x5e263c[0x0][_0xe0305(0x8e)];mkdirSync(_0xaa3773,{'recursive':!![]});const _0x2d4fdb=_0x5e263c[_0xe0305(0x94)](_0x1dd3b5=>_0x1dd3b5[_0xe0305(0xa2)][_0xe0305(0xbc)])??_0x5e263c[0x0];for(const _0x58cf09 of _0x5e263c){const _0x1c4abd=a216_0x5cdfd4[_0xe0305(0xa4)](_0xaa3773,MODEL_REGISTRY_FILE_NAME),_0x17d8f8=readModelRegistry(_0x1c4abd);if(_0x17d8f8?.[_0xe0305(0x91)][_0x58cf09['app'][_0xe0305(0x89)]])continue;const _0x1e6311=legacyApiPath(_0x5e263c,_0x58cf09),_0x4d93b8=_0x1e6311?readOptional(_0x1e6311):undefined;await initMultiAppEnvironment(_0x58cf09['app']),updateModelRegistry({'outputDir':_0xaa3773,'profileName':_0x58cf09[_0xe0305(0xa2)][_0xe0305(0x89)],'defaultProfile':_0x2d4fdb[_0xe0305(0xa2)][_0xe0305(0x89)],'appCode':_0x58cf09['app'][_0xe0305(0xa3)],'runtimeDomain':getRuntimeDomain(),'models':_0x4d93b8?parseLegacyApiModels(_0x4d93b8):[]});}const _0x65e3b8=await renderModelRegistryScaffold(_0xaa3773,_0x4231c3),_0x3e3eec=planGroup(_0x4231c3,_0x5e263c);for(const _0x3de42c of _0x3e3eec['files']){const _0x232884=a216_0x5cdfd4[_0xe0305(0x99)](_0x3de42c['path']);if(_0x232884===_0xe0305(0xaa))writeCandidateOrEntrypoint(_0x4231c3,_0xaa3773,_0x3de42c,_0x65e3b8[_0xe0305(0xb7)]);else{if(_0x232884===_0xe0305(0xb3))writeCandidateOrEntrypoint(_0x4231c3,_0xaa3773,_0x3de42c,_0x65e3b8['client']);else{if(_0x232884===MODEL_RUNTIME_FILE_NAME)writeCandidateOrEntrypoint(_0x4231c3,_0xaa3773,_0x3de42c,_0x65e3b8[_0xe0305(0xb5)]);else _0x232884===_0xe0305(0xce)&&_0x3de42c['action']==='create'&&writeCandidateOrEntrypoint(_0x4231c3,_0xaa3773,_0x3de42c,SDK_CONFIG_SOURCE);}}}}const _0x340a70=_0x261c38[_0xe0305(0x94)](_0xa72958=>_0xa72958[_0xe0305(0xbc)])??_0x261c38[0x0];_0x340a70&&(await initMultiAppEnvironment(_0x340a70),_0x3ab8f4=writeProjectDomainRoutingManifest(_0x4231c3)[_0xe0305(0x90)]);const _0xf2050=analyzeProjectApiArchitecture(_0x4231c3);return{..._0x43dcac,'completed':!_0xf2050[_0xe0305(0xca)],'manualMergeRequired':_0xf2050[_0xe0305(0xca)],'routingPath':_0x3ab8f4};}
|
|
1
|
+
const a216_0x52c82e=a216_0x2489;(function(_0x5a980e,_0x44053f){const _0xd90b53=a216_0x2489,_0x5ba943=_0x5a980e();while(!![]){try{const _0x2e4043=-parseInt(_0xd90b53(0x17f))/0x1*(-parseInt(_0xd90b53(0x194))/0x2)+parseInt(_0xd90b53(0x17b))/0x3+-parseInt(_0xd90b53(0x169))/0x4+-parseInt(_0xd90b53(0x185))/0x5*(parseInt(_0xd90b53(0x18f))/0x6)+-parseInt(_0xd90b53(0x184))/0x7*(-parseInt(_0xd90b53(0x16f))/0x8)+parseInt(_0xd90b53(0x171))/0x9*(parseInt(_0xd90b53(0x1a9))/0xa)+parseInt(_0xd90b53(0x19f))/0xb;if(_0x2e4043===_0x44053f)break;else _0x5ba943['push'](_0x5ba943['shift']());}catch(_0x59251e){_0x5ba943['push'](_0x5ba943['shift']());}}}(a216_0x449e,0x826ac));import{copyFileSync,existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import a216_0x240e3c from'node:path';import{getMultiAppConfigs,initMultiAppEnvironment,readConfigFile,writeConfigFile}from'../../context.js';import{DEFAULT_API_DIR}from'../../constant/paths.js';import{getRuntimeDomain}from'../../constant/domain.js';import{getRegistryGroup,resolveApiProfileLayouts}from'../../api/api-group.js';import{MODEL_REGISTRY_FILE_NAME,MODEL_RUNTIME_FILE_NAME,readModelRegistry,updateModelRegistry}from'../../api/model-registry-file.js';import{isLegacyGeneratedApiScaffold,isLegacyGeneratedClientScaffold,parseLegacyApiModels}from'../../api/legacy-api-file.js';function a216_0x2489(_0x412ce7,_0x3c0e64){_0x412ce7=_0x412ce7-0x168;const _0x449e3e=a216_0x449e();let _0x24890a=_0x449e3e[_0x412ce7];return _0x24890a;}import{renderModelRegistryScaffold}from'../../api/model-registry-scaffold.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';const MIGRATION_ID='api-model-registry-v2',SDK_CONFIG_SOURCE=a216_0x52c82e(0x174);function relativeMigrationDir(_0x51dbf0,_0x4b947c){const _0x438604=a216_0x52c82e,_0x3f883c=a216_0x240e3c[_0x438604(0x187)](_0x51dbf0,_0x4b947c);return _0x3f883c&&!_0x3f883c[_0x438604(0x189)]('..')?_0x3f883c:_0x438604(0x175);}function a216_0x449e(){const _0x1702d0=['path','name','manual-merge','entries','No\x20Lovrabet\x20model\x20profile\x20matches\x20Runtime\x20Domain','1074344Lvirkt','.rabetbase','1777536GqqBkR','apps','files','/**\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','external-api-dir','api.ts','outputDir','flatMap','profiles','sdk-config.ts','1542423nqlQpf','candidatePath','unchanged','project','1vzTNhs','default','utf8','join','some','7vprskH','208235VDLGMa','apiDir','relative','./models.generated','startsWith','string','includes','isDefault','-api.ts','apiGroup','78OucuNG','defaultApp','project-upgrade','LOVRABET_RUNTIME_DOMAIN','.rabetbase.json','194078tByHYM','normalizedApiDir','parse','add','action','has','The\x20file\x20contains\x20project-owned\x20code\x20and\x20will\x20not\x20be\x20overwritten.','object','migrate-single-app','basename','single','6225428wCuXvt','api','modelRuntime','replace-generated','find','candidates','appcode','Multiple\x20Lovrabet\x20model\x20profiles\x20match\x20Runtime\x20Domain','app','create','20uLhjNc','map','length','dirname','preserve','keys','backups','Model\x20facts\x20are\x20preserved\x20and\x20completed\x20from\x20legacy\x20generated\x20files\x20when\x20possible.','client.ts','2523320NOGgvv'];a216_0x449e=function(){return _0x1702d0;};return a216_0x449e();}function candidatePath(_0x3545a1,_0x1af8ba,_0x2e0ad5){const _0x46f2fb=a216_0x52c82e;return a216_0x240e3c['join'](_0x3545a1,'.rabetbase',_0x46f2fb(0x191),MIGRATION_ID,_0x46f2fb(0x1a4),relativeMigrationDir(_0x3545a1,_0x1af8ba),_0x2e0ad5);}function backupPath(_0x20d837,_0x1718cc,_0x145eff){const _0x20f7db=a216_0x52c82e;return a216_0x240e3c['join'](_0x20d837,_0x20f7db(0x170),_0x20f7db(0x191),MIGRATION_ID,_0x20f7db(0x1af),relativeMigrationDir(_0x20d837,_0x1718cc),_0x145eff);}function readOptional(_0xc17a3){const _0x1cabae=a216_0x52c82e;try{return readFileSync(_0xc17a3,_0x1cabae(0x181));}catch{return undefined;}}function readJsonObject(_0x4e982d){const _0x555a39=a216_0x52c82e;try{const _0x45f3d0=JSON[_0x555a39(0x196)](readFileSync(_0x4e982d,_0x555a39(0x181)));return _0x45f3d0&&typeof _0x45f3d0===_0x555a39(0x19b)?_0x45f3d0:{};}catch{return{};}}function planEntrypoint(_0x9e7f42,_0x5d32c7,_0x1ee868,_0x3be086){const _0x14863d=a216_0x52c82e,_0x3ff140=a216_0x240e3c[_0x14863d(0x182)](_0x5d32c7,_0x1ee868),_0x35d446=readOptional(_0x3ff140);if(_0x35d446===undefined)return{'path':_0x3ff140,'action':_0x14863d(0x1a8)};if(_0x1ee868===_0x14863d(0x176)?_0x35d446[_0x14863d(0x18b)](_0x14863d(0x188))&&_0x35d446['includes']('./model-runtime'):_0x35d446[_0x14863d(0x18b)](_0x14863d(0x192)))return{'path':_0x3ff140,'action':'unchanged'};if(_0x3be086(_0x35d446))return{'path':_0x3ff140,'action':'replace-generated','reason':'Recognized\x20legacy\x20CLI\x20scaffold;\x20a\x20backup\x20will\x20be\x20retained.'};return{'path':_0x3ff140,'action':'manual-merge','reason':_0x14863d(0x19a),'candidatePath':candidatePath(_0x9e7f42,_0x5d32c7,_0x1ee868)};}function syntheticApps(_0x36c61b){const _0x31f582=a216_0x52c82e,_0x518e9a=_0x36c61b['apps']&&typeof _0x36c61b[_0x31f582(0x172)]===_0x31f582(0x19b)?_0x36c61b[_0x31f582(0x172)]:undefined;if(_0x518e9a&&Object[_0x31f582(0x1ae)](_0x518e9a)['length']>0x0){const _0x4894e0=typeof _0x36c61b[_0x31f582(0x190)]===_0x31f582(0x18a)?_0x36c61b['defaultApp']:Object[_0x31f582(0x1ae)](_0x518e9a)[_0x31f582(0x1ab)]===0x1?Object[_0x31f582(0x1ae)](_0x518e9a)[0x0]:undefined;return Object[_0x31f582(0x16d)](_0x518e9a)[_0x31f582(0x178)](([_0x41c948,_0x16016d])=>{const _0x1a71b4=_0x31f582,_0x595e3b=_0x16016d,_0x5e3cde=typeof _0x595e3b[_0x1a71b4(0x1a5)]===_0x1a71b4(0x18a)?_0x595e3b[_0x1a71b4(0x1a5)]:'';return _0x5e3cde?[{'name':_0x41c948,'appcode':_0x5e3cde,'apiGroup':typeof _0x595e3b[_0x1a71b4(0x18e)]==='string'?_0x595e3b[_0x1a71b4(0x18e)]:undefined,'isDefault':_0x41c948===_0x4894e0,'region':'cn','regionSource':_0x1a71b4(0x180),'apiDir':typeof _0x595e3b['apiDir']===_0x1a71b4(0x18a)?_0x595e3b[_0x1a71b4(0x186)]:typeof _0x36c61b[_0x1a71b4(0x186)]==='string'?_0x36c61b[_0x1a71b4(0x186)]:undefined,'routingConfig':{}}]:[];});}const _0x455484=typeof _0x36c61b[_0x31f582(0x1a5)]===_0x31f582(0x18a)?_0x36c61b[_0x31f582(0x1a5)]:typeof _0x36c61b[_0x31f582(0x1a7)]===_0x31f582(0x18a)?_0x36c61b[_0x31f582(0x1a7)]:undefined;if(!_0x455484)return[];return[{'name':_0x455484,'appcode':_0x455484,'isDefault':!![],'region':'cn','regionSource':_0x31f582(0x180),'apiDir':typeof _0x36c61b[_0x31f582(0x186)]===_0x31f582(0x18a)?_0x36c61b['apiDir']:undefined,'routingConfig':{}}];}function configuredLayouts(_0x23ae06,_0x528d71){const _0x514bb4=a216_0x52c82e;return resolveApiProfileLayouts(_0x528d71,_0x1ca455=>a216_0x240e3c['resolve'](_0x23ae06,_0x1ca455[_0x514bb4(0x186)]||DEFAULT_API_DIR),_0x23ae06);}function uniqueRegistryGroups(_0x34bc6b){const _0x31efa5=a216_0x52c82e,_0x2304a8=[],_0x13203e=new Set(),_0x3fe5cc=new Set();for(const _0x460c10 of _0x34bc6b){const _0x550f12=getRegistryGroup(_0x34bc6b,_0x460c10);if(!_0x550f12){_0x13203e['add'](_0x460c10[_0x31efa5(0x177)]);continue;}const _0x6af19d=_0x460c10[_0x31efa5(0x195)]+'\x00'+(_0x460c10['apiGroup']??_0x31efa5(0x19e));!_0x3fe5cc[_0x31efa5(0x199)](_0x6af19d)&&(_0x2304a8['push'](_0x550f12),_0x3fe5cc[_0x31efa5(0x197)](_0x6af19d));}return{'groups':_0x2304a8,'skipped':[..._0x13203e]};}function planGroup(_0x42b542,_0x1fa8c9){const _0x495c8b=a216_0x52c82e,_0x22c0aa=_0x1fa8c9[0x0][_0x495c8b(0x195)],_0x33bb84=a216_0x240e3c[_0x495c8b(0x182)](_0x22c0aa,MODEL_RUNTIME_FILE_NAME),_0x4c229c=readOptional(_0x33bb84),_0x441a53=_0x4c229c!==undefined&&_0x4c229c[_0x495c8b(0x18b)]('Profile-aware\x20model\x20selection\x20generated\x20by\x20Rabetbase\x20CLI')&&_0x4c229c[_0x495c8b(0x18b)](_0x495c8b(0x1a6))&&_0x4c229c['includes'](_0x495c8b(0x16e)),_0x2bee0c=a216_0x240e3c[_0x495c8b(0x182)](_0x22c0aa,MODEL_REGISTRY_FILE_NAME),_0x2e0f73=a216_0x240e3c[_0x495c8b(0x182)](_0x22c0aa,'sdk-config.ts'),_0x5706f8=[planEntrypoint(_0x42b542,_0x22c0aa,_0x495c8b(0x176),isLegacyGeneratedApiScaffold),planEntrypoint(_0x42b542,_0x22c0aa,_0x495c8b(0x168),isLegacyGeneratedClientScaffold),{'path':_0x33bb84,'action':_0x4c229c===undefined?_0x495c8b(0x1a8):_0x441a53?'unchanged':'manual-merge','reason':_0x4c229c===undefined?undefined:'The\x20existing\x20runtime\x20selector\x20is\x20not\x20a\x20recognized\x20current\x20generated\x20file.',..._0x4c229c!==undefined&&!_0x441a53?{'candidatePath':candidatePath(_0x42b542,_0x22c0aa,MODEL_RUNTIME_FILE_NAME)}:{}},{'path':_0x2bee0c,'action':existsSync(_0x2bee0c)?_0x495c8b(0x1ad):_0x495c8b(0x1a8),'reason':_0x495c8b(0x1b0)},{'path':_0x2e0f73,'action':existsSync(_0x2e0f73)?_0x495c8b(0x1ad):_0x495c8b(0x1a8)}];return{'apiDir':_0x22c0aa,'profiles':_0x1fa8c9[_0x495c8b(0x1aa)](_0x38a469=>_0x38a469[_0x495c8b(0x1a7)][_0x495c8b(0x16b)]),'files':_0x5706f8};}export function analyzeProjectApiArchitecture(_0x554c75,_0x4179e2){const _0x224f2e=a216_0x52c82e,_0xb2ec08=a216_0x240e3c['join'](_0x554c75,'.rabetbase.json'),_0x234be7=_0x4179e2??(existsSync(_0xb2ec08)?readJsonObject(_0xb2ec08):{}),_0x4e2a23=syntheticApps(_0x234be7);if(_0x4e2a23[_0x224f2e(0x1ab)]===0x0)return{'migration':MIGRATION_ID,'needed':![],'configAction':'unconfigured','groups':[],'skippedLegacyDirectories':[],'manualMergeRequired':![]};const _0x37f703=_0x234be7[_0x224f2e(0x172)]?_0x224f2e(0x17d):_0x224f2e(0x19c),{groups:_0x4e444e,skipped:_0x1e3e69}=uniqueRegistryGroups(configuredLayouts(_0x554c75,_0x4e2a23)),_0x41a1d2=_0x4e444e['map'](_0x156038=>planGroup(_0x554c75,_0x156038)),_0x20bc06=_0x41a1d2[_0x224f2e(0x183)](_0x10a84e=>_0x10a84e['files'][_0x224f2e(0x183)](_0x31eecc=>_0x31eecc['action']===_0x224f2e(0x16c))),_0x3727fe=_0x37f703===_0x224f2e(0x19c)||_0x41a1d2[_0x224f2e(0x183)](_0x2a5d5a=>_0x2a5d5a[_0x224f2e(0x173)]['some'](_0x460556=>![_0x224f2e(0x17d),_0x224f2e(0x1ad)][_0x224f2e(0x18b)](_0x460556[_0x224f2e(0x198)])));return{'migration':MIGRATION_ID,'needed':_0x3727fe,'configAction':_0x37f703,'groups':_0x41a1d2,'skippedLegacyDirectories':_0x1e3e69,'manualMergeRequired':_0x20bc06};}function migrateSingleAppConfig(_0x22ec4d){const _0x3622d0=a216_0x52c82e,_0x17d8dd=a216_0x240e3c[_0x3622d0(0x182)](_0x22ec4d,_0x3622d0(0x193));if(!existsSync(_0x17d8dd))return;const _0x21c456=readConfigFile(_0x17d8dd);if(_0x21c456[_0x3622d0(0x172)]&&typeof _0x21c456['apps']===_0x3622d0(0x19b))return;const _0x4d2674=typeof _0x21c456[_0x3622d0(0x1a5)]==='string'?_0x21c456[_0x3622d0(0x1a5)]:typeof _0x21c456[_0x3622d0(0x1a7)]==='string'?_0x21c456[_0x3622d0(0x1a7)]:undefined;if(!_0x4d2674)return;_0x21c456[_0x3622d0(0x172)]={[_0x4d2674]:{'appcode':_0x4d2674}},_0x21c456[_0x3622d0(0x190)]=_0x4d2674,delete _0x21c456['app'],delete _0x21c456['appcode'],writeConfigFile(_0x17d8dd,_0x21c456);}function legacyApiPath(_0x41c87e,_0x6ada63){const _0x30ff8d=a216_0x52c82e,_0x2fa710=_0x6ada63[_0x30ff8d(0x195)],_0x549848=_0x41c87e[_0x30ff8d(0x1ab)]===0x1||_0x6ada63[_0x30ff8d(0x1a7)][_0x30ff8d(0x18c)]?[a216_0x240e3c[_0x30ff8d(0x182)](_0x2fa710,_0x30ff8d(0x176)),a216_0x240e3c[_0x30ff8d(0x182)](_0x2fa710,_0x6ada63[_0x30ff8d(0x1a7)][_0x30ff8d(0x16b)]+_0x30ff8d(0x18d))]:[a216_0x240e3c['join'](_0x2fa710,_0x6ada63[_0x30ff8d(0x1a7)]['name']+'-api.ts')];return _0x549848[_0x30ff8d(0x1a3)](existsSync);}function writeCandidateOrEntrypoint(_0x23f477,_0x553e0d,_0x5a8580,_0x250818){const _0x334193=a216_0x52c82e;if(_0x5a8580[_0x334193(0x198)]===_0x334193(0x17d)||_0x5a8580[_0x334193(0x198)]===_0x334193(0x1ad))return;if(_0x5a8580[_0x334193(0x198)]===_0x334193(0x16c)){const _0x2f667b=_0x5a8580[_0x334193(0x17c)];mkdirSync(a216_0x240e3c[_0x334193(0x1ac)](_0x2f667b),{'recursive':!![]}),writeFileSync(_0x2f667b,_0x250818,_0x334193(0x181));return;}if(_0x5a8580[_0x334193(0x198)]===_0x334193(0x1a2)){const _0x5edbbd=backupPath(_0x23f477,_0x553e0d,a216_0x240e3c[_0x334193(0x19d)](_0x5a8580[_0x334193(0x16a)]));mkdirSync(a216_0x240e3c['dirname'](_0x5edbbd),{'recursive':!![]}),copyFileSync(_0x5a8580['path'],_0x5edbbd);}mkdirSync(a216_0x240e3c[_0x334193(0x1ac)](_0x5a8580[_0x334193(0x16a)]),{'recursive':!![]}),writeFileSync(_0x5a8580[_0x334193(0x16a)],_0x250818,_0x334193(0x181));}export async function upgradeProjectApiArchitecture(_0x1ee580){const _0x3aa769=a216_0x52c82e,_0x41bf24=analyzeProjectApiArchitecture(_0x1ee580);migrateSingleAppConfig(_0x1ee580);const _0x1a4a2b=getMultiAppConfigs(_0x3aa769(0x17e),_0x1ee580)??[],_0x38ad35=configuredLayouts(_0x1ee580,_0x1a4a2b),{groups:_0x552328}=uniqueRegistryGroups(_0x38ad35);let _0x2a3243;for(const _0x5d9e13 of _0x552328){const _0x2645e1=_0x5d9e13[0x0][_0x3aa769(0x195)];mkdirSync(_0x2645e1,{'recursive':!![]});const _0x2fab75=_0x5d9e13['find'](_0x14cd83=>_0x14cd83[_0x3aa769(0x1a7)][_0x3aa769(0x18c)])??_0x5d9e13[0x0];for(const _0x22cfa0 of _0x5d9e13){const _0x175704=a216_0x240e3c[_0x3aa769(0x182)](_0x2645e1,MODEL_REGISTRY_FILE_NAME),_0x5700a8=readModelRegistry(_0x175704);if(_0x5700a8?.[_0x3aa769(0x179)][_0x22cfa0[_0x3aa769(0x1a7)][_0x3aa769(0x16b)]])continue;const _0x302d21=legacyApiPath(_0x5d9e13,_0x22cfa0),_0x30e11b=_0x302d21?readOptional(_0x302d21):undefined;await initMultiAppEnvironment(_0x22cfa0[_0x3aa769(0x1a7)]),updateModelRegistry({'outputDir':_0x2645e1,'profileName':_0x22cfa0[_0x3aa769(0x1a7)][_0x3aa769(0x16b)],'defaultProfile':_0x2fab75[_0x3aa769(0x1a7)][_0x3aa769(0x16b)],'appCode':_0x22cfa0[_0x3aa769(0x1a7)][_0x3aa769(0x1a5)],'runtimeDomain':getRuntimeDomain(),'models':_0x30e11b?parseLegacyApiModels(_0x30e11b):[]});}const _0x2b4f7d=await renderModelRegistryScaffold(_0x2645e1,_0x1ee580),_0x3750e4=planGroup(_0x1ee580,_0x5d9e13);for(const _0x4ee517 of _0x3750e4[_0x3aa769(0x173)]){const _0x160dea=a216_0x240e3c[_0x3aa769(0x19d)](_0x4ee517[_0x3aa769(0x16a)]);if(_0x160dea==='api.ts')writeCandidateOrEntrypoint(_0x1ee580,_0x2645e1,_0x4ee517,_0x2b4f7d[_0x3aa769(0x1a0)]);else{if(_0x160dea===_0x3aa769(0x168))writeCandidateOrEntrypoint(_0x1ee580,_0x2645e1,_0x4ee517,_0x2b4f7d['client']);else{if(_0x160dea===MODEL_RUNTIME_FILE_NAME)writeCandidateOrEntrypoint(_0x1ee580,_0x2645e1,_0x4ee517,_0x2b4f7d[_0x3aa769(0x1a1)]);else _0x160dea===_0x3aa769(0x17a)&&_0x4ee517[_0x3aa769(0x198)]===_0x3aa769(0x1a8)&&writeCandidateOrEntrypoint(_0x1ee580,_0x2645e1,_0x4ee517,SDK_CONFIG_SOURCE);}}}}const _0x5efe2b=_0x1a4a2b[_0x3aa769(0x1a3)](_0x148156=>_0x148156['isDefault'])??_0x1a4a2b[0x0];_0x5efe2b&&(await initMultiAppEnvironment(_0x5efe2b),_0x2a3243=writeProjectDomainRoutingManifest(_0x1ee580)[_0x3aa769(0x16a)]);const _0x59fb43=analyzeProjectApiArchitecture(_0x1ee580);return{..._0x41bf24,'completed':!_0x59fb43['manualMergeRequired'],'manualMergeRequired':_0x59fb43['manualMergeRequired'],'routingPath':_0x2a3243};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1be6b8,_0x18b3ea){const _0x30e798=a217_0x52da,_0x3c3be2=_0x1be6b8();while(!![]){try{const _0x57a2c6=-parseInt(_0x30e798(0xc0))/0x1+-parseInt(_0x30e798(0xcf))/0x2*(-parseInt(_0x30e798(0xb8))/0x3)+parseInt(_0x30e798(0xc4))/0x4*(-parseInt(_0x30e798(0xbc))/0x5)+-parseInt(_0x30e798(0xbb))/0x6*(-parseInt(_0x30e798(0xd0))/0x7)+-parseInt(_0x30e798(0xd5))/0x8*(-parseInt(_0x30e798(0xc1))/0x9)+-parseInt(_0x30e798(0xcd))/0xa*(parseInt(_0x30e798(0xce))/0xb)+parseInt(_0x30e798(0xc6))/0xc;if(_0x57a2c6===_0x18b3ea)break;else _0x3c3be2['push'](_0x3c3be2['shift']());}catch(_0x51baf8){_0x3c3be2['push'](_0x3c3be2['shift']());}}}(a217_0x449a,0x5076a));import{existsSync}from'node:fs';import a217_0x5b4ffd from'node:path';import a217_0x899600 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';function a217_0x52da(_0x5d31d7,_0x5880f2){_0x5d31d7=_0x5d31d7-0xb7;const _0x449ac4=a217_0x449a();let _0x52da09=_0x449ac4[_0x5d31d7];return _0x52da09;}import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';function a217_0x449a(){const _0x3c592d=['3376518IaALYr','10nwUuLZ','production','Skipped','trim','350129OcBBys','6129cLYijJ','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','my-app','937268VQFkGp','Directory\x20\x22','7943316yybmuS','Project\x20name:','cwd','Not\x20set','resolve','string','env','17720tvegzp','3311mPmVgs','4308YxqVfS','7jebsXs','Logged\x20in','\x22\x20already\x20exists','log','cyan','4888fJlLID','√\x20App\x20Code:\x20','57NPjiZs','√\x20Project\x20Name:\x20','green'];a217_0x449a=function(){return _0x3c592d;};return a217_0x449a();}import{getProjectNameValidationError}from'../../../commands/project/create/project-name.js';export async function guidedCreateProject(_0x3a598f,_0x29566c,_0x498d7e){const _0x11f9e7=a217_0x52da,_0x24b0c5=_0x11f9e7(0xc3),_0x2dc1e8=readConfig(),_0x185499=typeof _0x2dc1e8[_0x11f9e7(0xcc)]===_0x11f9e7(0xcb)?_0x2dc1e8[_0x11f9e7(0xcc)]:undefined,_0x17be35=await input({'message':_0x11f9e7(0xc7),'default':_0x24b0c5,'validate':_0x558e98=>{const _0x145277=_0x11f9e7,_0x27d956=_0x558e98[_0x145277(0xbf)]()||_0x24b0c5,_0x1c22b0=getProjectNameValidationError(_0x27d956);if(_0x1c22b0)return _0x1c22b0;const _0x3b95bc=a217_0x5b4ffd[_0x145277(0xca)](process[_0x145277(0xc8)](),_0x27d956);if(existsSync(_0x3b95bc))return _0x145277(0xc5)+_0x27d956+_0x145277(0xd2);return!![];}});console[_0x11f9e7(0xd3)](a217_0x899600['green'](_0x11f9e7(0xb9)+a217_0x899600[_0x11f9e7(0xd4)](_0x17be35)));const _0x19cc26=await selectSingleAppcode(_0x498d7e);console[_0x11f9e7(0xd3)](a217_0x899600['green'](_0x11f9e7(0xb7)+a217_0x899600[_0x11f9e7(0xd4)](_0x19cc26||_0x11f9e7(0xc9))));if(_0x19cc26){const _0xfb7a88=await getIsSessionValid();if(!_0xfb7a88){const _0x23ffa7=await confirm({'message':_0x11f9e7(0xc2),'default':!![]});if(_0x23ffa7){const _0x61c835=await authServer({'silent':!![]});console['log'](a217_0x899600[_0x11f9e7(0xba)]('√\x20Login\x20status:\x20'+a217_0x899600[_0x11f9e7(0xd4)](_0x61c835?_0x11f9e7(0xd1):'Login\x20failed')));}else console[_0x11f9e7(0xd3)](a217_0x899600[_0x11f9e7(0xba)]('√\x20Login\x20status:\x20'+a217_0x899600[_0x11f9e7(0xd4)](_0x11f9e7(0xbe))));}await _0x3a598f({'projectName':_0x17be35,'appCode':_0x19cc26,'env':_0x29566c||_0x185499||_0x11f9e7(0xbd)});}else await _0x3a598f({'projectName':_0x17be35,'env':_0x29566c||_0x185499||_0x11f9e7(0xbd)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27566d,_0x2f477d){const _0xf3feeb=a218_0x351f,_0x4ea083=_0x27566d();while(!![]){try{const _0x1b16d6=parseInt(_0xf3feeb(0x169))/0x1+-parseInt(_0xf3feeb(0x16d))/0x2+-parseInt(_0xf3feeb(0x16e))/0x3*(parseInt(_0xf3feeb(0x166))/0x4)+-parseInt(_0xf3feeb(0x171))/0x5+parseInt(_0xf3feeb(0x16a))/0x6*(parseInt(_0xf3feeb(0x16c))/0x7)+-parseInt(_0xf3feeb(0x16b))/0x8*(parseInt(_0xf3feeb(0x167))/0x9)+parseInt(_0xf3feeb(0x170))/0xa;if(_0x1b16d6===_0x2f477d)break;else _0x4ea083['push'](_0x4ea083['shift']());}catch(_0x5da9ff){_0x4ea083['push'](_0x4ea083['shift']());}}}(a218_0x7713,0x4fd84));function a218_0x7713(){const _0x3c20aa=['1061919fiLseb','toFixed','365415rcoKPU','109068YyCOgW','8smXDHi','217pAmKco','576994KhzeAj','15981eOoBZu','now','6204380SakmHO','1495600Dmdynu','388PCzNJt'];a218_0x7713=function(){return _0x3c20aa;};return a218_0x7713();}function a218_0x351f(_0x5b690d,_0xc11a68){_0x5b690d=_0x5b690d-0x166;const _0x771394=a218_0x7713();let _0x351fe3=_0x771394[_0x5b690d];return _0x351fe3;}export function formatElapsed(_0x9074b8){const _0x54490e=a218_0x351f,_0x596d3b=Date[_0x54490e(0x16f)]()-_0x9074b8;if(_0x596d3b<0x3e8)return _0x596d3b+'ms';const _0x1bcd64=(_0x596d3b/0x3e8)[_0x54490e(0x168)](0x2),_0x4f5790=_0x1bcd64['replace'](/\.?0+$/u,'');return _0x4f5790+'s';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4d62d8,_0x5a786d){const _0x870790=a219_0x23f6,_0x4e10fd=_0x4d62d8();while(!![]){try{const _0x49f96e=parseInt(_0x870790(0x147))/0x1*(-parseInt(_0x870790(0x13f))/0x2)+-parseInt(_0x870790(0x11f))/0x3*(-parseInt(_0x870790(0x12b))/0x4)+parseInt(_0x870790(0x15a))/0x5+parseInt(_0x870790(0x134))/0x6*(-parseInt(_0x870790(0x10a))/0x7)+-parseInt(_0x870790(0x13a))/0x8+-parseInt(_0x870790(0x143))/0x9+parseInt(_0x870790(0x12d))/0xa*(parseInt(_0x870790(0x15b))/0xb);if(_0x49f96e===_0x5a786d)break;else _0x4e10fd['push'](_0x4e10fd['shift']());}catch(_0xcd5220){_0x4e10fd['push'](_0x4e10fd['shift']());}}}(a219_0x2924,0x32828));import a219_0x37931a from'path';function a219_0x2924(){const _0x1d36c6=['relative','reverse','message','rmSync','modelCount','renameSync','apps','success','writeFileSync','stringify','√\x20Configuration\x20file\x20created,\x20Apps:\x20','templateSource','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','stop','cyan','setLogPath','Project\x20template\x20ready','1.0.0','\x20api\x20pull\x20--force\x20--yes','info','readFileSync','\x20config\x20set\x20appcode\x20<app-code>\x27','\x20already\x20exists','W_OK','nonInteractive','\x20\x201.\x20Start\x20project:\x20','\x20\x202.\x20Pull\x20API\x20configuration:\x20','basename','...','log','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','parse','189721KeygRt','repeat','Format\x20code','green','env','\x20model(s)','package.json','stableVersion','version','mkdtempSync','projectName','cwd','fail','\x20|\x20Default:\x20implicit\x20(single\x20app)','constants','Project\x20creation\x20failed:\x20','appCode','join','extracting','Downloading\x20project\x20template','Project\x20created:\x20','3216ZtKNCf','\x20√\x20','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','verifying','√\x20package.json\x20updated:\x20name=','Verifying\x20project\x20template','utf8','Failed\x20to\x20update\x20package.json','keys','Configured\x20app\x20AppCode:\x20','length','error','1436HXyjTq','ino','130ydyAUM','toLocaleString','minimumVersion','resolve','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','needsUpgrade','readdirSync','66bULpds','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','cookie','belowMinimum','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','\x20|\x20AppCode:\x20','2885704yeayXT','Failed\x20to\x20configure\x20app\x20AppCode','project','chdir','push','506036mJCIaf','existsSync','.rabetbase-create-','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','3015369QyOKBK','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','text','dirname','1bNEiNr','create','√\x20Pulled\x20','dev','Install\x20dependencies','bold','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','\x20run\x20start','currentDir','API\x20configuration\x20pulled:\x20','🚀\x20Next\x20Steps:','resolving','\x20&&\x20','projectCode','warn','downloading','Updating\x20package.json\x20name','*\x20Configuring\x20AppCode\x20for\x20project\x20','production','1985590aVamkC','568469KfslIC','Project\x20directory\x20','validation','\x20dataset(s),\x20generated\x20'];a219_0x2924=function(){return _0x1d36c6;};return a219_0x2924();}import a219_0x1f19b9 from'fs';import a219_0x368a2a from'chalk';import a219_0x22665b 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';function a219_0x23f6(_0x3d411d,_0x30522a){_0x3d411d=_0x3d411d-0x104;const _0x292454=a219_0x2924();let _0x23f6ee=_0x292454[_0x3d411d];return _0x23f6ee;}import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';import{validateProjectName}from'../../../commands/project/create/project-name.js';import{getRuntimeDomain,getSdkClientRoutingConfig}from'../../../constant/domain.js';import{generateSdkConfigFile}from'../../../api/generate-sdk-config-file.js';import{writeProjectDomainRoutingManifest}from'../../../config/project-domain-routing.js';import{CliErrors}from'../../../errors.js';function readDirectoryIdentity(_0x5c3ff2){const _0x353759=a219_0x23f6;try{const _0x427bfa=a219_0x1f19b9['lstatSync'](_0x5c3ff2);if(!_0x427bfa['isDirectory']())return null;return{'dev':_0x427bfa[_0x353759(0x14a)],'ino':_0x427bfa[_0x353759(0x12c)]};}catch{return null;}}function isSameDirectory(_0x4d5407,_0x5d2017){const _0x180fd0=a219_0x23f6;return!!_0x4d5407&&!!_0x5d2017&&_0x4d5407[_0x180fd0(0x14a)]===_0x5d2017[_0x180fd0(0x14a)]&&_0x4d5407['ino']===_0x5d2017[_0x180fd0(0x12c)];}function commitCurrentDirectoryProject(_0xed20dc,_0x2b2c2f,_0x5470a0){const _0x43a1a4=a219_0x23f6;if(!isSameDirectory(readDirectoryIdentity(_0xed20dc),_0x5470a0))throw new Error('Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation');const _0x39dd4d=a219_0x37931a['basename'](_0x2b2c2f),_0x387f2c=a219_0x1f19b9['readdirSync'](_0xed20dc);if(_0x387f2c[_0x43a1a4(0x129)]!==0x1||_0x387f2c[0x0]!==_0x39dd4d)throw CliErrors[_0x43a1a4(0x15d)]('The\x20current\x20directory\x20changed\x20during\x20project\x20creation.',_0x43a1a4(0x144));const _0x3641ed=a219_0x37931a['join'](_0x2b2c2f,'project'),_0x231d7b=[];try{for(const _0x3cf0c7 of a219_0x1f19b9[_0x43a1a4(0x133)](_0x3641ed)){a219_0x1f19b9[_0x43a1a4(0x164)](a219_0x37931a[_0x43a1a4(0x11b)](_0x3641ed,_0x3cf0c7),a219_0x37931a[_0x43a1a4(0x11b)](_0xed20dc,_0x3cf0c7)),_0x231d7b[_0x43a1a4(0x13e)](_0x3cf0c7);}a219_0x1f19b9[_0x43a1a4(0x162)](_0x2b2c2f,{'recursive':!![],'force':!![]});}catch(_0x3afbd2){for(const _0x13dddc of _0x231d7b[_0x43a1a4(0x160)]()){const _0x1e31fc=a219_0x37931a[_0x43a1a4(0x11b)](_0xed20dc,_0x13dddc);if(!a219_0x1f19b9['existsSync'](_0x1e31fc))continue;a219_0x1f19b9[_0x43a1a4(0x164)](_0x1e31fc,a219_0x37931a[_0x43a1a4(0x11b)](_0x3641ed,_0x13dddc));}throw _0x3afbd2;}}export async function createApp(_0x930cd1){const _0x55f75d=a219_0x23f6,_0x469476=await checkCliVersion();(_0x469476[_0x55f75d(0x132)]||_0x469476[_0x55f75d(0x137)])&&(printCliUpgradeWarning(_0x469476),assertCliVersionSupported(_0x469476),logger[_0x55f75d(0x172)]('create','CLI\x20version\x20check',{'currentVersion':_0x469476['currentVersion'],'stableVersion':_0x469476[_0x55f75d(0x111)],'minimumVersion':_0x469476[_0x55f75d(0x12f)],'needsUpgrade':_0x469476[_0x55f75d(0x132)],'belowMinimum':_0x469476[_0x55f75d(0x137)]}));const _0x58597e=_0x930cd1['currentDir']?a219_0x37931a[_0x55f75d(0x104)](process[_0x55f75d(0x115)]()):_0x930cd1[_0x55f75d(0x154)];if(_0x58597e&&(_0x930cd1[_0x55f75d(0x11a)]||_0x930cd1[_0x55f75d(0x177)]))await runCreate({'projectName':_0x58597e,'appCode':_0x930cd1[_0x55f75d(0x11a)],'env':_0x930cd1[_0x55f75d(0x10e)]},_0x930cd1);else{if(_0x58597e){const _0x14ad00=await selectSingleAppcode(_0x930cd1[_0x55f75d(0x136)]);await runCreate({'projectName':_0x58597e,'appCode':_0x14ad00||undefined,'env':_0x930cd1[_0x55f75d(0x10e)]},_0x930cd1);}else await guidedCreateProject(_0x3f435e=>runCreate(_0x3f435e,_0x930cd1),_0x930cd1[_0x55f75d(0x10e)],_0x930cd1[_0x55f75d(0x136)]);}}async function runCreate(_0x4829a5,_0x5be732){const _0x55db59=a219_0x23f6;_0x4829a5[_0x55db59(0x114)]=validateProjectName(_0x4829a5['projectName']);const _0x593d4b=_0x5be732[_0x55db59(0x14f)]?process[_0x55db59(0x115)]():a219_0x37931a[_0x55db59(0x130)](process['cwd'](),_0x4829a5[_0x55db59(0x114)]);if(_0x5be732[_0x55db59(0x14f)]){if(a219_0x1f19b9[_0x55db59(0x133)](_0x593d4b)[_0x55db59(0x129)]>0x0)throw CliErrors[_0x55db59(0x15d)]('The\x20current\x20directory\x20must\x20be\x20empty.',_0x55db59(0x16b));}else{if(a219_0x1f19b9[_0x55db59(0x140)](_0x593d4b))throw new Error(_0x55db59(0x15c)+_0x4829a5[_0x55db59(0x114)]+_0x55db59(0x175));}let _0x56b53f=null;const _0x11268b=_0x5be732[_0x55db59(0x14f)]?readDirectoryIdentity(_0x593d4b):null;let _0x4c02f8=null;try{a219_0x1f19b9['accessSync'](a219_0x37931a[_0x55db59(0x146)](_0x593d4b),a219_0x1f19b9[_0x55db59(0x118)][_0x55db59(0x176)]);}catch{throw new Error(_0x55db59(0x121));}logger[_0x55db59(0x172)](_0x55db59(0x148),'Starting\x20project\x20creation:\x20'+_0x4829a5['projectName'],{'projectDir':_0x593d4b,'appCode':_0x4829a5[_0x55db59(0x11a)]}),console[_0x55db59(0x106)](),console[_0x55db59(0x106)](a219_0x368a2a[_0x55db59(0x10d)](_0x55db59(0x120))+'Project\x20name:\x20'+a219_0x368a2a[_0x55db59(0x10d)](_0x4829a5['projectName'])+(_0x4829a5[_0x55db59(0x11a)]?_0x55db59(0x139)+a219_0x368a2a['cyan'](_0x4829a5[_0x55db59(0x11a)]):''));try{let _0x12cac7=_0x4829a5[_0x55db59(0x114)];_0x5be732[_0x55db59(0x14f)]&&(_0x4c02f8=a219_0x1f19b9[_0x55db59(0x113)](a219_0x37931a[_0x55db59(0x11b)](_0x593d4b,_0x55db59(0x141))),_0x12cac7=a219_0x37931a[_0x55db59(0x15f)](process[_0x55db59(0x115)](),a219_0x37931a[_0x55db59(0x11b)](_0x4c02f8,_0x55db59(0x13c))));const _0x3806dd=a219_0x37931a[_0x55db59(0x130)](process[_0x55db59(0x115)](),_0x12cac7);await runTask('Resolving\x20project\x20template',_0x277b13=>copyProjectTemplate(_0x12cac7,_0x4b009c=>_0x277b13(projectTemplateStageLabel(_0x4b009c)),_0x5be732[_0x55db59(0x16a)]),_0x55db59(0x16f)),_0x56b53f=_0x5be732[_0x55db59(0x14f)]?null:readDirectoryIdentity(_0x593d4b);if(!_0x5be732['currentDir']&&!_0x56b53f)throw new Error(_0x55db59(0x131));await updatePackageJsonName(_0x12cac7,_0x4829a5[_0x55db59(0x114)]),await runTask(_0x55db59(0x14b),()=>installDependencies(_0x12cac7)),await runTask(_0x55db59(0x10c),()=>formatProjectCode(_0x12cac7)),await configureAppCode(_0x12cac7,_0x4829a5[_0x55db59(0x114)],_0x4829a5[_0x55db59(0x11a)]||'',_0x4829a5[_0x55db59(0x10e)]);let _0x18150e=![];if(_0x4829a5['appCode']){console[_0x55db59(0x106)]('*\x20Pulling\x20API\x20configuration...');const _0x3d4039=process[_0x55db59(0x115)]();try{process[_0x55db59(0x13d)](_0x3806dd);const _0x5ca25e=_0x4829a5[_0x55db59(0x10e)]||_0x55db59(0x159);initEnv(_0x5ca25e);const {configArray:_0x554d91}=await fetchModelList(_0x4829a5[_0x55db59(0x11a)],_0x5be732[_0x55db59(0x136)]||''),_0x54eff4=DEFAULT_API_DIR,_0x3cd215=await generateApiFile(_0x554d91,'',_0x4829a5['appCode'],!![],_0x5ca25e,_0x54eff4,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![],'modelProfile':{'name':_0x4829a5[_0x55db59(0x11a)],'defaultName':_0x4829a5[_0x55db59(0x11a)],'runtimeDomain':getRuntimeDomain()}});console['log'](_0x55db59(0x149)+_0x554d91[_0x55db59(0x129)]+_0x55db59(0x15e)+_0x3cd215[_0x55db59(0x163)]+_0x55db59(0x10f)),logger['info'](_0x55db59(0x148),_0x55db59(0x150)+_0x4829a5[_0x55db59(0x11a)]);}catch(_0x21ff6f){_0x18150e=!![],console['log'](_0x55db59(0x14d)+CLI_BIN_NAME+_0x55db59(0x171)),logger[_0x55db59(0x155)](_0x55db59(0x148),'API\x20configuration\x20pull\x20failed',{'error':_0x21ff6f instanceof Error?_0x21ff6f[_0x55db59(0x161)]:String(_0x21ff6f)});}finally{process[_0x55db59(0x13d)](_0x3d4039);}}if(_0x5be732[_0x55db59(0x14f)]){if(!_0x4c02f8||!_0x11268b)throw new Error('Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace');commitCurrentDirectoryProject(_0x593d4b,_0x4c02f8,_0x11268b),_0x4c02f8=null;}try{logger[_0x55db59(0x16e)](_0x593d4b),logger[_0x55db59(0x166)](_0x55db59(0x148),_0x55db59(0x11e)+_0x4829a5[_0x55db59(0x114)]);}catch(_0x38dc37){console[_0x55db59(0x155)](_0x55db59(0x135)+(_0x38dc37 instanceof Error?_0x38dc37[_0x55db59(0x161)]:String(_0x38dc37)));}console[_0x55db59(0x106)](),console['log'](a219_0x368a2a[_0x55db59(0x10d)]('─'[_0x55db59(0x10b)](0x3c))),console['log'](a219_0x368a2a[_0x55db59(0x16d)][_0x55db59(0x14c)](_0x55db59(0x151))),console[_0x55db59(0x106)]();const _0x4075d2=_0x5be732['currentDir']?CLI_BIN_NAME+_0x55db59(0x14e):'cd\x20'+_0x4829a5[_0x55db59(0x114)]+_0x55db59(0x153)+CLI_BIN_NAME+_0x55db59(0x14e);console[_0x55db59(0x106)](_0x55db59(0x178)+a219_0x368a2a[_0x55db59(0x16d)][_0x55db59(0x14c)](_0x4075d2)),_0x18150e&&console[_0x55db59(0x106)](_0x55db59(0x179)+a219_0x368a2a['cyan']['bold'](CLI_BIN_NAME+_0x55db59(0x171))),console[_0x55db59(0x106)](a219_0x368a2a['green']('─'['repeat'](0x3c)));}catch(_0x3be111){logger['error'](_0x55db59(0x148),_0x55db59(0x119)+_0x4829a5[_0x55db59(0x114)],{'error':_0x3be111 instanceof Error?_0x3be111[_0x55db59(0x161)]:String(_0x3be111)});try{const _0x3df641=readDirectoryIdentity(_0x593d4b);if(_0x5be732[_0x55db59(0x14f)]&&_0x4c02f8)a219_0x1f19b9[_0x55db59(0x162)](_0x4c02f8,{'recursive':!![],'force':!![]});else{if(_0x56b53f&&_0x3df641?.['dev']===_0x56b53f[_0x55db59(0x14a)]&&_0x3df641['ino']===_0x56b53f[_0x55db59(0x12c)])console[_0x55db59(0x106)](_0x55db59(0x142)+_0x593d4b),a219_0x1f19b9[_0x55db59(0x162)](_0x593d4b,{'recursive':!![],'force':!![]});else _0x3df641&&logger[_0x55db59(0x155)](_0x55db59(0x148),'Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20'+_0x593d4b);}}catch{logger[_0x55db59(0x155)](_0x55db59(0x148),_0x55db59(0x138)+_0x593d4b);}throw _0x3be111;}}async function runTask(_0x48bb1a,_0x2e2797,_0x52554b=_0x48bb1a){const _0x1fc450=a219_0x23f6,_0x36a770=a219_0x22665b(_0x48bb1a+_0x1fc450(0x105))['start']();try{const _0x2313cd=await _0x2e2797(_0x4ee730=>{const _0x30e365=_0x1fc450;_0x36a770[_0x30e365(0x145)]=_0x4ee730+'...';});_0x36a770[_0x1fc450(0x16c)](),console[_0x1fc450(0x106)](''+a219_0x368a2a['green']('\x20√\x20')+_0x52554b+'\x20'+a219_0x368a2a['gray']('['+_0x2313cd+']'));}catch(_0x4d1604){_0x36a770[_0x1fc450(0x116)](_0x48bb1a);throw _0x4d1604;}}function projectTemplateStageLabel(_0x2c40df){const _0x2adf31=a219_0x23f6;switch(_0x2c40df){case _0x2adf31(0x152):return'Resolving\x20project\x20template';case _0x2adf31(0x156):return _0x2adf31(0x11d);case _0x2adf31(0x122):return _0x2adf31(0x124);case _0x2adf31(0x11c):return'Extracting\x20project\x20template';case'copying':return'Copying\x20local\x20template\x20source';}}async function updatePackageJsonName(_0x39805c,_0x1be072){const _0x54569d=a219_0x23f6,_0x5c7f21=a219_0x37931a[_0x54569d(0x130)](process[_0x54569d(0x115)](),_0x39805c),_0x1a6bbb=a219_0x37931a[_0x54569d(0x11b)](_0x5c7f21,_0x54569d(0x110));try{console['log'](_0x54569d(0x107));const _0x4a685e=getRabetbaseCliPackageRoot(),_0x4f8bdc=a219_0x37931a[_0x54569d(0x11b)](_0x4a685e,_0x54569d(0x110));let _0x5e606e=_0x54569d(0x170);try{const _0x31c2b8=JSON[_0x54569d(0x109)](a219_0x1f19b9['readFileSync'](_0x4f8bdc,_0x54569d(0x125)));_0x5e606e=_0x31c2b8[_0x54569d(0x112)]||_0x54569d(0x170);}catch{}const _0x13c16e=a219_0x1f19b9[_0x54569d(0x173)](_0x1a6bbb,_0x54569d(0x125)),_0x52028e=JSON[_0x54569d(0x109)](_0x13c16e);_0x52028e['name']=_0x1be072,_0x52028e['description']=_0x1be072+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x5e606e,a219_0x1f19b9[_0x54569d(0x167)](_0x1a6bbb,JSON[_0x54569d(0x168)](_0x52028e,null,0x2)+'\x0a','utf8'),console['log'](_0x54569d(0x123)+_0x1be072),logger[_0x54569d(0x172)]('create',_0x54569d(0x157));}catch(_0x7026b0){logger[_0x54569d(0x12a)]('create',_0x54569d(0x126));throw _0x7026b0;}}async function configureAppCode(_0x67e1d2,_0x5ce52c,_0x34daa3,_0x2e25b0){const _0x178c6e=a219_0x23f6,_0x147467=a219_0x37931a[_0x178c6e(0x130)](process[_0x178c6e(0x115)](),_0x67e1d2),_0x4077db=a219_0x37931a['join'](_0x147467,NEW_CONFIG_NAME);try{_0x34daa3?console[_0x178c6e(0x106)](_0x178c6e(0x158)+_0x5ce52c+':\x20'+_0x34daa3):console[_0x178c6e(0x106)](_0x178c6e(0x108)+_0x5ce52c);const _0x25b09f=getRabetbaseCliPackageRoot(),_0x305263=a219_0x37931a[_0x178c6e(0x11b)](_0x25b09f,_0x178c6e(0x110));let _0xc7fd5a=_0x178c6e(0x170);try{const _0x411688=JSON[_0x178c6e(0x109)](a219_0x1f19b9[_0x178c6e(0x173)](_0x305263,_0x178c6e(0x125)));_0xc7fd5a=_0x411688['version']||_0x178c6e(0x170);}catch{}const {globalConfig:_0xe5e2eb}=loadRawConfigLayers(),_0xb5fd0a=typeof _0xe5e2eb[_0x178c6e(0x10e)]==='string'?_0xe5e2eb[_0x178c6e(0x10e)]:undefined,_0x4440d9={};for(const _0x5b327e of PROJECT_CREATE_INHERITABLE_KEYS){if(_0xe5e2eb[_0x5b327e]!=null)_0x4440d9[_0x5b327e]=_0xe5e2eb[_0x5b327e];}const _0x30a422=buildCanonicalProjectConfig(_0x4440d9,{'appCodes':_0x34daa3?[_0x34daa3]:[],'env':_0x2e25b0||_0xb5fd0a||_0x178c6e(0x159),'metadata':{'createdAt':new Date()[_0x178c6e(0x12e)](),'version':_0xc7fd5a}});writeConfigFile(_0x4077db,_0x30a422),await generateSdkConfigFile(a219_0x37931a['join'](_0x147467,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x147467),_0x34daa3?console[_0x178c6e(0x106)](_0x178c6e(0x169)+Object[_0x178c6e(0x127)](_0x30a422[_0x178c6e(0x165)]||{})['join'](',\x20')+_0x178c6e(0x117)):console['log']('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x178c6e(0x174)),logger['info'](_0x178c6e(0x148),_0x178c6e(0x128)+_0x34daa3);}catch(_0x216804){logger[_0x178c6e(0x12a)](_0x178c6e(0x148),_0x178c6e(0x13b));throw _0x216804;}}
|
|
1
|
+
(function(_0x339ac9,_0x402ef9){const _0x42ee33=a219_0xe492,_0x1d78f0=_0x339ac9();while(!![]){try{const _0x57bf15=parseInt(_0x42ee33(0xd8))/0x1+-parseInt(_0x42ee33(0xa5))/0x2+-parseInt(_0x42ee33(0xe1))/0x3*(-parseInt(_0x42ee33(0xe9))/0x4)+-parseInt(_0x42ee33(0xaf))/0x5+parseInt(_0x42ee33(0xec))/0x6*(parseInt(_0x42ee33(0xa3))/0x7)+-parseInt(_0x42ee33(0x7d))/0x8+parseInt(_0x42ee33(0xb1))/0x9;if(_0x57bf15===_0x402ef9)break;else _0x1d78f0['push'](_0x1d78f0['shift']());}catch(_0x59c60d){_0x1d78f0['push'](_0x1d78f0['shift']());}}}(a219_0x428f,0x5a66b));import a219_0x475f7a from'path';import a219_0x1ac73f from'fs';import a219_0x1a0b76 from'chalk';import a219_0x303a27 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{loadRawConfigLayers,writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';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(_0x2a5f22){const _0x2f4742=a219_0xe492;try{const _0x1fc81f=a219_0x1ac73f[_0x2f4742(0xa1)](_0x2a5f22);if(!_0x1fc81f['isDirectory']())return null;return{'dev':_0x1fc81f[_0x2f4742(0xc0)],'ino':_0x1fc81f[_0x2f4742(0xda)]};}catch{return null;}}function isSameDirectory(_0x25d045,_0x5e77cc){const _0x5d9fb5=a219_0xe492;return!!_0x25d045&&!!_0x5e77cc&&_0x25d045[_0x5d9fb5(0xc0)]===_0x5e77cc[_0x5d9fb5(0xc0)]&&_0x25d045[_0x5d9fb5(0xda)]===_0x5e77cc[_0x5d9fb5(0xda)];}function commitCurrentDirectoryProject(_0x45fae7,_0x273f25,_0x202dc4){const _0x223888=a219_0xe492;if(!isSameDirectory(readDirectoryIdentity(_0x45fae7),_0x202dc4))throw new Error(_0x223888(0x9a));const _0x90dd19=a219_0x475f7a['basename'](_0x273f25),_0x202c44=a219_0x1ac73f[_0x223888(0x7b)](_0x45fae7);if(_0x202c44['length']!==0x1||_0x202c44[0x0]!==_0x90dd19)throw CliErrors[_0x223888(0xab)](_0x223888(0x76),_0x223888(0x9c));const _0x4edb18=a219_0x475f7a[_0x223888(0x7c)](_0x273f25,_0x223888(0xbb)),_0x4c695d=[];try{for(const _0x32b4e4 of a219_0x1ac73f[_0x223888(0x7b)](_0x4edb18)){a219_0x1ac73f[_0x223888(0x9f)](a219_0x475f7a[_0x223888(0x7c)](_0x4edb18,_0x32b4e4),a219_0x475f7a['join'](_0x45fae7,_0x32b4e4)),_0x4c695d[_0x223888(0xe8)](_0x32b4e4);}a219_0x1ac73f[_0x223888(0x93)](_0x273f25,{'recursive':!![],'force':!![]});}catch(_0x4d9de4){for(const _0x6a3155 of _0x4c695d[_0x223888(0xe4)]()){const _0x1135bb=a219_0x475f7a['join'](_0x45fae7,_0x6a3155);if(!a219_0x1ac73f[_0x223888(0x90)](_0x1135bb))continue;a219_0x1ac73f[_0x223888(0x9f)](_0x1135bb,a219_0x475f7a[_0x223888(0x7c)](_0x4edb18,_0x6a3155));}throw _0x4d9de4;}}function a219_0x428f(){const _0x5c29ba=['Project\x20created:\x20','*\x20Pulling\x20API\x20configuration...','gray','Configured\x20app\x20AppCode:\x20','fail','setLogPath','\x20Generated\x20by\x20rabetbase\x20cli\x20','\x20model(s)','cyan','√\x20package.json\x20updated:\x20name=','env','\x20api\x20pull\x20--force\x20--yes','\x20config\x20set\x20appcode\x20<app-code>\x27','name','API\x20configuration\x20pulled:\x20','Failed\x20to\x20update\x20package.json','...','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','currentDir','Project\x20directory\x20','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','cookie','constants','465289HnUvUr','appCode','ino','belowMinimum','cd\x20','warn','Updating\x20package.json\x20name','1.0.0','green','1137flWSFn','string','repeat','reverse','nonInteractive','message','Starting\x20project\x20creation:\x20','push','644JJEGGL','length','\x20√\x20','464796KlSqil','Extracting\x20project\x20template','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.','\x20already\x20exists','bold','\x20|\x20AppCode:\x20','projectName','readdirSync','join','2944704ROUHEt','readFileSync','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','\x20\x202.\x20Pull\x20API\x20configuration:\x20','text','parse','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','error','√\x20Pulled\x20','CLI\x20version\x20check','version','dirname','stableVersion','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','stop','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','\x20run\x20start','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','existsSync','info','Copying\x20local\x20template\x20source','rmSync','start','verifying','cwd','Format\x20code','package.json','needsUpgrade','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','√\x20Configuration\x20file\x20created,\x20Apps:\x20','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','chdir','copying','renameSync','The\x20current\x20directory\x20must\x20be\x20empty.','lstatSync','production','56RFsHvS','create','707434FyLFIA','stringify','Resolving\x20project\x20template','Verifying\x20project\x20template','downloading','W_OK','validation','Failed\x20to\x20configure\x20app\x20AppCode','Project\x20template\x20ready','utf8','816585KxQKId','Install\x20dependencies','984321iSyWag','apps','resolving','resolve','\x20&&\x20','basename','log','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','\x20|\x20Default:\x20implicit\x20(single\x20app)','writeFileSync','project','templateSource','toLocaleString','extracting','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','dev'];a219_0x428f=function(){return _0x5c29ba;};return a219_0x428f();}export async function createApp(_0x243508){const _0x3ef1ab=a219_0xe492,_0x17779a=await checkCliVersion();(_0x17779a[_0x3ef1ab(0x99)]||_0x17779a[_0x3ef1ab(0xdb)])&&(printCliUpgradeWarning(_0x17779a),assertCliVersionSupported(_0x17779a),logger[_0x3ef1ab(0x91)](_0x3ef1ab(0xa4),_0x3ef1ab(0x86),{'currentVersion':_0x17779a['currentVersion'],'stableVersion':_0x17779a[_0x3ef1ab(0x89)],'minimumVersion':_0x17779a['minimumVersion'],'needsUpgrade':_0x17779a[_0x3ef1ab(0x99)],'belowMinimum':_0x17779a[_0x3ef1ab(0xdb)]}));const _0x5867d0=_0x243508[_0x3ef1ab(0xd3)]?a219_0x475f7a[_0x3ef1ab(0xb6)](process[_0x3ef1ab(0x96)]()):_0x243508['projectCode'];if(_0x5867d0&&(_0x243508[_0x3ef1ab(0xd9)]||_0x243508[_0x3ef1ab(0xe5)]))await runCreate({'projectName':_0x5867d0,'appCode':_0x243508[_0x3ef1ab(0xd9)],'env':_0x243508[_0x3ef1ab(0xcb)]},_0x243508);else{if(_0x5867d0){const _0x1ca453=await selectSingleAppcode(_0x243508[_0x3ef1ab(0xd6)]);await runCreate({'projectName':_0x5867d0,'appCode':_0x1ca453||undefined,'env':_0x243508[_0x3ef1ab(0xcb)]},_0x243508);}else await guidedCreateProject(_0x18b8ea=>runCreate(_0x18b8ea,_0x243508),_0x243508['env'],_0x243508['cookie']);}}async function runCreate(_0x4c4e58,_0x3ad6d0){const _0x533d2b=a219_0xe492;_0x4c4e58[_0x533d2b(0x7a)]=validateProjectName(_0x4c4e58['projectName']);const _0x2bf4a6=_0x3ad6d0[_0x533d2b(0xd3)]?process[_0x533d2b(0x96)]():a219_0x475f7a[_0x533d2b(0xb4)](process['cwd'](),_0x4c4e58[_0x533d2b(0x7a)]);if(_0x3ad6d0[_0x533d2b(0xd3)]){if(a219_0x1ac73f[_0x533d2b(0x7b)](_0x2bf4a6)[_0x533d2b(0xea)]>0x0)throw CliErrors[_0x533d2b(0xab)](_0x533d2b(0xa0),'Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.');}else{if(a219_0x1ac73f[_0x533d2b(0x90)](_0x2bf4a6))throw new Error(_0x533d2b(0xd4)+_0x4c4e58['projectName']+_0x533d2b(0x77));}let _0x51cf8e=null;const _0x1ae92e=_0x3ad6d0[_0x533d2b(0xd3)]?readDirectoryIdentity(_0x2bf4a6):null;let _0x493008=null;try{a219_0x1ac73f['accessSync'](a219_0x475f7a[_0x533d2b(0x88)](_0x2bf4a6),a219_0x1ac73f[_0x533d2b(0xd7)][_0x533d2b(0xaa)]);}catch{throw new Error(_0x533d2b(0x8c));}logger[_0x533d2b(0x91)](_0x533d2b(0xa4),_0x533d2b(0xe7)+_0x4c4e58['projectName'],{'projectDir':_0x2bf4a6,'appCode':_0x4c4e58['appCode']}),console['log'](),console['log'](a219_0x1a0b76[_0x533d2b(0xe0)](_0x533d2b(0xeb))+'Project\x20name:\x20'+a219_0x1a0b76[_0x533d2b(0xe0)](_0x4c4e58[_0x533d2b(0x7a)])+(_0x4c4e58['appCode']?_0x533d2b(0x79)+a219_0x1a0b76[_0x533d2b(0xc9)](_0x4c4e58[_0x533d2b(0xd9)]):''));try{let _0x961059=_0x4c4e58[_0x533d2b(0x7a)];_0x3ad6d0['currentDir']&&(_0x493008=a219_0x1ac73f['mkdtempSync'](a219_0x475f7a[_0x533d2b(0x7c)](_0x2bf4a6,'.rabetbase-create-')),_0x961059=a219_0x475f7a['relative'](process['cwd'](),a219_0x475f7a[_0x533d2b(0x7c)](_0x493008,_0x533d2b(0xbb))));const _0x28006c=a219_0x475f7a[_0x533d2b(0xb4)](process[_0x533d2b(0x96)](),_0x961059);await runTask(_0x533d2b(0xa7),_0x4c0c9d=>copyProjectTemplate(_0x961059,_0x680366=>_0x4c0c9d(projectTemplateStageLabel(_0x680366)),_0x3ad6d0[_0x533d2b(0xbc)]),_0x533d2b(0xad)),_0x51cf8e=_0x3ad6d0[_0x533d2b(0xd3)]?null:readDirectoryIdentity(_0x2bf4a6);if(!_0x3ad6d0[_0x533d2b(0xd3)]&&!_0x51cf8e)throw new Error(_0x533d2b(0x8f));await updatePackageJsonName(_0x961059,_0x4c4e58[_0x533d2b(0x7a)]),await runTask(_0x533d2b(0xb0),()=>installDependencies(_0x961059)),await runTask(_0x533d2b(0x97),()=>formatProjectCode(_0x961059)),await configureAppCode(_0x961059,_0x4c4e58[_0x533d2b(0x7a)],_0x4c4e58['appCode']||'',_0x4c4e58['env']);let _0x4a4523=![];if(_0x4c4e58['appCode']){console[_0x533d2b(0xb7)](_0x533d2b(0xc2));const _0x55d106=process[_0x533d2b(0x96)]();try{process[_0x533d2b(0x9d)](_0x28006c);const _0x967ff7=_0x4c4e58['env']||_0x533d2b(0xa2);initEnv(_0x967ff7);const {configArray:_0x31b9af}=await fetchModelList(_0x4c4e58[_0x533d2b(0xd9)],_0x3ad6d0['cookie']||''),_0x2551c7=DEFAULT_API_DIR,_0x1bc13e=await generateApiFile(_0x31b9af,'',_0x4c4e58[_0x533d2b(0xd9)],!![],_0x967ff7,_0x2551c7,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![],'modelProfile':{'name':_0x4c4e58[_0x533d2b(0xd9)],'defaultName':_0x4c4e58[_0x533d2b(0xd9)],'runtimeDomain':getRuntimeDomain()}});console[_0x533d2b(0xb7)](_0x533d2b(0x85)+_0x31b9af[_0x533d2b(0xea)]+'\x20dataset(s),\x20generated\x20'+_0x1bc13e['modelCount']+_0x533d2b(0xc8)),logger['info'](_0x533d2b(0xa4),_0x533d2b(0xcf)+_0x4c4e58['appCode']);}catch(_0x1ae6e4){_0x4a4523=!![],console['log'](_0x533d2b(0xb8)+CLI_BIN_NAME+_0x533d2b(0xcc)),logger[_0x533d2b(0xdd)](_0x533d2b(0xa4),'API\x20configuration\x20pull\x20failed',{'error':_0x1ae6e4 instanceof Error?_0x1ae6e4[_0x533d2b(0xe6)]:String(_0x1ae6e4)});}finally{process[_0x533d2b(0x9d)](_0x55d106);}}if(_0x3ad6d0['currentDir']){if(!_0x493008||!_0x1ae92e)throw new Error(_0x533d2b(0x7f));commitCurrentDirectoryProject(_0x2bf4a6,_0x493008,_0x1ae92e),_0x493008=null;}try{logger[_0x533d2b(0xc6)](_0x2bf4a6),logger['success'](_0x533d2b(0xa4),_0x533d2b(0xc1)+_0x4c4e58[_0x533d2b(0x7a)]);}catch(_0x5a3300){console[_0x533d2b(0xdd)](_0x533d2b(0xd5)+(_0x5a3300 instanceof Error?_0x5a3300['message']:String(_0x5a3300)));}console[_0x533d2b(0xb7)](),console['log'](a219_0x1a0b76[_0x533d2b(0xe0)]('─'[_0x533d2b(0xe3)](0x3c))),console[_0x533d2b(0xb7)](a219_0x1a0b76[_0x533d2b(0xc9)]['bold']('🚀\x20Next\x20Steps:')),console[_0x533d2b(0xb7)]();const _0x3a0f64=_0x3ad6d0[_0x533d2b(0xd3)]?CLI_BIN_NAME+_0x533d2b(0x8d):_0x533d2b(0xdc)+_0x4c4e58[_0x533d2b(0x7a)]+_0x533d2b(0xb5)+CLI_BIN_NAME+_0x533d2b(0x8d);console['log']('\x20\x201.\x20Start\x20project:\x20'+a219_0x1a0b76[_0x533d2b(0xc9)][_0x533d2b(0x78)](_0x3a0f64)),_0x4a4523&&console[_0x533d2b(0xb7)](_0x533d2b(0x80)+a219_0x1a0b76[_0x533d2b(0xc9)]['bold'](CLI_BIN_NAME+'\x20api\x20pull\x20--force\x20--yes')),console[_0x533d2b(0xb7)](a219_0x1a0b76[_0x533d2b(0xe0)]('─'[_0x533d2b(0xe3)](0x3c)));}catch(_0x200812){logger['error']('create','Project\x20creation\x20failed:\x20'+_0x4c4e58['projectName'],{'error':_0x200812 instanceof Error?_0x200812[_0x533d2b(0xe6)]:String(_0x200812)});try{const _0x4275b8=readDirectoryIdentity(_0x2bf4a6);if(_0x3ad6d0[_0x533d2b(0xd3)]&&_0x493008)a219_0x1ac73f[_0x533d2b(0x93)](_0x493008,{'recursive':!![],'force':!![]});else{if(_0x51cf8e&&_0x4275b8?.[_0x533d2b(0xc0)]===_0x51cf8e[_0x533d2b(0xc0)]&&_0x4275b8[_0x533d2b(0xda)]===_0x51cf8e[_0x533d2b(0xda)])console['log'](_0x533d2b(0x8a)+_0x2bf4a6),a219_0x1ac73f[_0x533d2b(0x93)](_0x2bf4a6,{'recursive':!![],'force':!![]});else _0x4275b8&&logger[_0x533d2b(0xdd)](_0x533d2b(0xa4),_0x533d2b(0x8e)+_0x2bf4a6);}}catch{logger['warn'](_0x533d2b(0xa4),_0x533d2b(0xd2)+_0x2bf4a6);}throw _0x200812;}}async function runTask(_0x2cefd5,_0xec4a0f,_0xb6eebd=_0x2cefd5){const _0x42a400=a219_0xe492,_0x41ed06=a219_0x303a27(_0x2cefd5+_0x42a400(0xd1))[_0x42a400(0x94)]();try{const _0x1314c4=await _0xec4a0f(_0x45fece=>{const _0x1bce41=_0x42a400;_0x41ed06[_0x1bce41(0x81)]=_0x45fece+_0x1bce41(0xd1);});_0x41ed06[_0x42a400(0x8b)](),console[_0x42a400(0xb7)](''+a219_0x1a0b76['green'](_0x42a400(0xeb))+_0xb6eebd+'\x20'+a219_0x1a0b76[_0x42a400(0xc3)]('['+_0x1314c4+']'));}catch(_0x15c9ba){_0x41ed06[_0x42a400(0xc5)](_0x2cefd5);throw _0x15c9ba;}}function projectTemplateStageLabel(_0x148b37){const _0x2c700e=a219_0xe492;switch(_0x148b37){case _0x2c700e(0xb3):return'Resolving\x20project\x20template';case _0x2c700e(0xa9):return'Downloading\x20project\x20template';case _0x2c700e(0x95):return _0x2c700e(0xa8);case _0x2c700e(0xbe):return _0x2c700e(0xed);case _0x2c700e(0x9e):return _0x2c700e(0x92);}}async function updatePackageJsonName(_0x5c7325,_0x5e1935){const _0x28f27d=a219_0xe492,_0x5229e7=a219_0x475f7a['resolve'](process[_0x28f27d(0x96)](),_0x5c7325),_0x57e4e5=a219_0x475f7a[_0x28f27d(0x7c)](_0x5229e7,_0x28f27d(0x98));try{console[_0x28f27d(0xb7)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x4f795d=getRabetbaseCliPackageRoot(),_0x23440f=a219_0x475f7a[_0x28f27d(0x7c)](_0x4f795d,_0x28f27d(0x98));let _0x56e605=_0x28f27d(0xdf);try{const _0x52c3a3=JSON[_0x28f27d(0x82)](a219_0x1ac73f[_0x28f27d(0x7e)](_0x23440f,_0x28f27d(0xae)));_0x56e605=_0x52c3a3[_0x28f27d(0x87)]||'1.0.0';}catch{}const _0x3399be=a219_0x1ac73f['readFileSync'](_0x57e4e5,_0x28f27d(0xae)),_0x68e10f=JSON[_0x28f27d(0x82)](_0x3399be);_0x68e10f[_0x28f27d(0xce)]=_0x5e1935,_0x68e10f['description']=_0x5e1935+_0x28f27d(0xc7)+_0x56e605,a219_0x1ac73f[_0x28f27d(0xba)](_0x57e4e5,JSON[_0x28f27d(0xa6)](_0x68e10f,null,0x2)+'\x0a',_0x28f27d(0xae)),console['log'](_0x28f27d(0xca)+_0x5e1935),logger[_0x28f27d(0x91)](_0x28f27d(0xa4),_0x28f27d(0xde));}catch(_0x3e9a72){logger[_0x28f27d(0x84)](_0x28f27d(0xa4),_0x28f27d(0xd0));throw _0x3e9a72;}}function a219_0xe492(_0x2b1a0e,_0x5a14b3){_0x2b1a0e=_0x2b1a0e-0x76;const _0x428f82=a219_0x428f();let _0xe492b8=_0x428f82[_0x2b1a0e];return _0xe492b8;}async function configureAppCode(_0x5270ca,_0x3a894f,_0xcebba5,_0xe2f670){const _0x48ccce=a219_0xe492,_0x21237c=a219_0x475f7a[_0x48ccce(0xb4)](process[_0x48ccce(0x96)](),_0x5270ca),_0x36a5b5=a219_0x475f7a[_0x48ccce(0x7c)](_0x21237c,NEW_CONFIG_NAME);try{_0xcebba5?console[_0x48ccce(0xb7)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x3a894f+':\x20'+_0xcebba5):console[_0x48ccce(0xb7)](_0x48ccce(0x83)+_0x3a894f);const _0x420b77=getRabetbaseCliPackageRoot(),_0x529b58=a219_0x475f7a['join'](_0x420b77,'package.json');let _0x215578=_0x48ccce(0xdf);try{const _0x1f0292=JSON[_0x48ccce(0x82)](a219_0x1ac73f[_0x48ccce(0x7e)](_0x529b58,_0x48ccce(0xae)));_0x215578=_0x1f0292[_0x48ccce(0x87)]||_0x48ccce(0xdf);}catch{}const {globalConfig:_0xa0fe95}=loadRawConfigLayers(),_0x2c0ee9=typeof _0xa0fe95[_0x48ccce(0xcb)]===_0x48ccce(0xe2)?_0xa0fe95[_0x48ccce(0xcb)]:undefined,_0x3b93a4={};for(const _0x177b6e of PROJECT_CREATE_INHERITABLE_KEYS){if(_0xa0fe95[_0x177b6e]!=null)_0x3b93a4[_0x177b6e]=_0xa0fe95[_0x177b6e];}const _0x2a199c=buildCanonicalProjectConfig(_0x3b93a4,{'appCodes':_0xcebba5?[_0xcebba5]:[],'env':_0xe2f670||_0x2c0ee9||_0x48ccce(0xa2),'metadata':{'createdAt':new Date()[_0x48ccce(0xbd)](),'version':_0x215578}});writeConfigFile(_0x36a5b5,_0x2a199c),await generateSdkConfigFile(a219_0x475f7a['join'](_0x21237c,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x21237c),_0xcebba5?console[_0x48ccce(0xb7)](_0x48ccce(0x9b)+Object['keys'](_0x2a199c[_0x48ccce(0xb2)]||{})[_0x48ccce(0x7c)](',\x20')+_0x48ccce(0xb9)):console[_0x48ccce(0xb7)](_0x48ccce(0xbf)+CLI_BIN_NAME+_0x48ccce(0xcd)),logger[_0x48ccce(0x91)](_0x48ccce(0xa4),_0x48ccce(0xc4)+_0xcebba5);}catch(_0x112522){logger[_0x48ccce(0x84)](_0x48ccce(0xa4),_0x48ccce(0xac));throw _0x112522;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a220_0x48bc99=a220_0x13dc;(function(_0x50b035,_0x194b0a){const _0x14ac33=a220_0x13dc,_0x155a6a=_0x50b035();while(!![]){try{const _0x1e297d=parseInt(_0x14ac33(0xba))/0x1*(parseInt(_0x14ac33(0xb0))/0x2)+parseInt(_0x14ac33(0xca))/0x3+-parseInt(_0x14ac33(0xd7))/0x4*(parseInt(_0x14ac33(0xd6))/0x5)+parseInt(_0x14ac33(0xb5))/0x6+parseInt(_0x14ac33(0xf8))/0x7*(-parseInt(_0x14ac33(0xdd))/0x8)+parseInt(_0x14ac33(0x114))/0x9+parseInt(_0x14ac33(0x119))/0xa*(-parseInt(_0x14ac33(0x116))/0xb);if(_0x1e297d===_0x194b0a)break;else _0x155a6a['push'](_0x155a6a['shift']());}catch(_0x40dee5){_0x155a6a['push'](_0x155a6a['shift']());}}}(a220_0x96eb,0xbda1a));import{createHash}from'node:crypto';import a220_0x3349d0 from'node:fs/promises';import a220_0xae1750 from'node:path';import a220_0x120681 from'semver';import{getProjectTemplateRelativeUrl}from'../../../constant/cdn.js';function a220_0x96eb(){const _0x3964bf=['readdir','abort','sha256','4944060XSOpRK','isDirectory','22VehGwy',',\x20received\x20','number','356270wCbsgA','includes','signal','ENOENT','realpath','.DS_Store','local','basename','lstat','resolve','Project\x20directory\x20already\x20exists:\x20','.rabetbase.json','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','origin','10gXrKrt','sep','version','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','get','4604298imxybT','utf8','Local\x20template\x20source\x20does\x20not\x20exist:\x20','sub-app-react-demo','node_modules','232644QnvmIJ','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','Unable\x20to\x20claim\x20the\x20project\x20directory.','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','pathname','project','mkdir','Project\x20template\x20package.json\x20is\x20invalid.','object','error','read','headers','readFile','valid','package.json','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','1757256vTirYb','access','Use\x20a\x20different\x20project\x20name.','cdn','push','isSymbolicLink','test','name','posix','code','length','.env.example','35eQeZRG','527944FIIgbm','ino','update','mkdtemp','beta','sha256:','8WmKmyY','protocol','copying','.lovrabet.log','cancel','url','hex','relative','dirname','validation','message','legacyAssetBaseUrl','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','mode','href','CDN\x20project\x20template\x20relative\x20URL\x20must\x20match\x20its\x20release\x20channel\x20or\x20version.','verifying','.git','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','.rabetbase-create-','toLowerCase','body','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','chmod','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','has','digest','9056663EHDNGS','application/zip','https:','template.zip','.codegraph','rename','releaseLock','assetBaseUrl','resolving','join','isAbsolute','EEXIST','config','Check\x20the\x20source\x20directory\x20and\x20retry.','status','isFile','getReader','Invalid\x20local\x20template\x20source:\x20','content-length','size','dist','trim','startsWith','dev','parse'];a220_0x96eb=function(){return _0x3964bf;};return a220_0x96eb();}import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{fetchProjectTemplateCdnConfig,isBetaCliVersion,resolveProjectTemplateDescriptor}from'../../../utils/cli-version-policy.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID=a220_0x48bc99(0xb8),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x1b2215){const _0x4bf21d=a220_0x48bc99;return typeof _0x1b2215==='string'&&_0x1b2215[_0x4bf21d(0x10d)]()?_0x1b2215[_0x4bf21d(0x10d)]():null;}function parseDescriptor(_0x1dc340){const _0x3b2a90=a220_0x48bc99;if(!_0x1dc340||typeof _0x1dc340!==_0x3b2a90(0xc2))throw new Error(_0x3b2a90(0xbb)+TEMPLATE_ID+'\x22.');const _0x40364f=_0x1dc340,_0x190d16=nonEmptyString(_0x40364f[_0x3b2a90(0xb2)]),_0x376d34=nonEmptyString(_0x40364f['name']),_0x1180cc=_0x40364f[_0x3b2a90(0xe2)]===undefined?undefined:nonEmptyString(_0x40364f[_0x3b2a90(0xe2)])||undefined,_0x50d68e=nonEmptyString(_0x40364f[_0x3b2a90(0x113)])?.[_0x3b2a90(0xf1)](),_0x4ea9d9=_0x40364f[_0x3b2a90(0x10b)];if(!_0x190d16||!a220_0x120681[_0x3b2a90(0xc7)](_0x190d16)||!_0x376d34||_0x376d34!==a220_0xae1750[_0x3b2a90(0xd2)][_0x3b2a90(0xa9)](_0x376d34)||_0x376d34['includes']('\x5c')||_0x40364f[_0x3b2a90(0xe2)]!==undefined&&!_0x1180cc||!_0x50d68e||!/^sha256:[a-f0-9]{64}$/[_0x3b2a90(0xd0)](_0x50d68e)||typeof _0x4ea9d9!==_0x3b2a90(0x118)||!Number['isSafeInteger'](_0x4ea9d9)||_0x4ea9d9<=0x0||_0x4ea9d9>MAX_ARCHIVE_SIZE)throw new Error(_0x3b2a90(0xbd)+TEMPLATE_ID+'\x22.');return{'version':_0x190d16,'name':_0x376d34,'url':_0x1180cc,'sha256':_0x50d68e,'size':_0x4ea9d9};}async function fetchWithTimeout(_0x3f4e6c,_0x1ba5cf,_0x1e4d8d,_0x5a411c){const _0x595a34=a220_0x48bc99,_0x400974=new AbortController(),_0x296a57=setTimeout(()=>_0x400974[_0x595a34(0x112)](),_0x1ba5cf);try{const _0x3cdaf7=await fetch(_0x3f4e6c,{'headers':{'Accept':_0x1e4d8d},'redirect':_0x595a34(0xc3),'signal':_0x400974[_0x595a34(0xa4)]});return await _0x5a411c(_0x3cdaf7);}finally{clearTimeout(_0x296a57);}}async function fetchTemplateDescriptor(){const _0xcc1ee5=a220_0x48bc99,_0x5acc7f=getCliVersion(),_0x1a936a=isBetaCliVersion(_0x5acc7f)?_0xcc1ee5(0xdb):'release',_0x5e3352=await fetchProjectTemplateCdnConfig();if(!_0x5e3352)throw new Error(_0xcc1ee5(0xf5));const _0x1d79b6=parseDescriptor(resolveProjectTemplateDescriptor(_0x5e3352[_0xcc1ee5(0x104)],_0x5acc7f));return{'descriptor':_0x1d79b6,'channel':_0x1a936a,'assetBaseUrl':_0x5e3352[_0xcc1ee5(0xff)],'legacyAssetBaseUrl':_0x5e3352[_0xcc1ee5(0xe8)]};}function resolveArchiveUrl(_0x4638bb,_0x448d6e,_0x115b7e,_0x455409){const _0x394b56=a220_0x48bc99,_0x5b2cfc=new URL(_0x115b7e+'/'),_0x422157=[getProjectTemplateRelativeUrl(_0x448d6e),getProjectTemplateRelativeUrl(_0x448d6e,_0x4638bb[_0x394b56(0xb2)])];if(_0x4638bb[_0x394b56(0xe2)]&&!_0x422157[_0x394b56(0x11a)](_0x4638bb[_0x394b56(0xe2)]))throw new Error(_0x394b56(0xec));const _0x468c13=new URL(_0x455409+'/'),_0x1ba07c=_0x4638bb[_0x394b56(0xe2)]?new URL(_0x4638bb['url'],_0x5b2cfc[_0x394b56(0xaf)]):new URL(_0x4638bb[_0x394b56(0xd1)],_0x468c13),_0x3d0c70=_0x4638bb[_0x394b56(0xe2)]?_0x5b2cfc[_0x394b56(0xaf)]:_0x468c13[_0x394b56(0xaf)];if(_0x1ba07c[_0x394b56(0xde)]!==_0x394b56(0xfa)||_0x1ba07c[_0x394b56(0xaf)]!==_0x3d0c70||a220_0xae1750[_0x394b56(0xd2)][_0x394b56(0xa9)](decodeURIComponent(_0x1ba07c[_0x394b56(0xbe)]))!==_0x4638bb['name']||!_0x4638bb[_0x394b56(0xe2)]&&!_0x1ba07c[_0x394b56(0xbe)]['startsWith'](_0x468c13['pathname']))throw new Error(_0x394b56(0xb3));return _0x1ba07c[_0x394b56(0xeb)];}function a220_0x13dc(_0x2511c6,_0x37d9ad){_0x2511c6=_0x2511c6-0xa4;const _0x96eb20=a220_0x96eb();let _0x13dce1=_0x96eb20[_0x2511c6];return _0x13dce1;}async function readResponseBytes(_0x4e3696,_0x2d68a1){const _0x584a60=a220_0x48bc99;if(!_0x4e3696['body']){const _0x922b66=Buffer['from'](await _0x4e3696['arrayBuffer']());if(_0x922b66[_0x584a60(0xd4)]>_0x2d68a1)throw new Error(_0x584a60(0xef));return _0x922b66;}const _0x3f2b27=_0x4e3696[_0x584a60(0xf2)][_0x584a60(0x108)](),_0x51a3e2=[];let _0x157270=0x0;try{while(!![]){const {done:_0x344d7a,value:_0x29d613}=await _0x3f2b27[_0x584a60(0xc4)]();if(_0x344d7a)break;_0x157270+=_0x29d613['byteLength'];if(_0x157270>_0x2d68a1){await _0x3f2b27[_0x584a60(0xe1)]();throw new Error('CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.');}_0x51a3e2[_0x584a60(0xce)](Buffer['from'](_0x29d613));}}finally{_0x3f2b27[_0x584a60(0xfe)]();}return Buffer['concat'](_0x51a3e2,_0x157270);}async function downloadArchive(_0x2a3aee,_0x386a07,_0x3a4892,_0x3ef015,_0x93a9c2,_0x16e326){const _0x262ead=a220_0x48bc99,_0x4bbf5a=await fetchWithTimeout(resolveArchiveUrl(_0x2a3aee,_0x386a07,_0x3a4892,_0x3ef015),ARCHIVE_TIMEOUT_MS,_0x262ead(0xf9),async _0x1ab577=>{const _0x4e85cb=_0x262ead;if(!_0x1ab577['ok'])throw new Error('CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20'+_0x1ab577[_0x4e85cb(0x106)]+'.');const _0x5ab485=Number(_0x1ab577[_0x4e85cb(0xc5)][_0x4e85cb(0xb4)](_0x4e85cb(0x10a)));if(Number['isFinite'](_0x5ab485)&&_0x5ab485>MAX_ARCHIVE_SIZE)throw new Error('CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.');return readResponseBytes(_0x1ab577,_0x2a3aee[_0x4e85cb(0x10b)]);});if(_0x4bbf5a[_0x262ead(0xd4)]!==_0x2a3aee[_0x262ead(0x10b)])throw new Error(_0x262ead(0xc9)+_0x2a3aee[_0x262ead(0x10b)]+_0x262ead(0x117)+_0x4bbf5a[_0x262ead(0xd4)]+'.');_0x16e326?.(_0x262ead(0xed));const _0x6d1c68=_0x262ead(0xdc)+createHash(_0x262ead(0x113))[_0x262ead(0xd9)](_0x4bbf5a)[_0x262ead(0xf7)](_0x262ead(0xe3));if(_0x6d1c68!==_0x2a3aee[_0x262ead(0x113)])throw new Error('CDN\x20project\x20template\x20checksum\x20verification\x20failed.');await a220_0x3349d0['writeFile'](_0x93a9c2,_0x4bbf5a,{'flag':'wx'});}async function assertTemplateRoot(_0x49b173){const _0x3ab874=a220_0x48bc99,_0x168c45=a220_0xae1750[_0x3ab874(0x101)](_0x49b173,_0x3ab874(0xc8)),_0x43d665=JSON[_0x3ab874(0x110)](await a220_0x3349d0['readFile'](_0x168c45,_0x3ab874(0xb6)));if(!_0x43d665||typeof _0x43d665!==_0x3ab874(0xc2))throw new Error(_0x3ab874(0xc1));}const LOCAL_FORBIDDEN_NAMES=new Set([a220_0x48bc99(0xa7),a220_0x48bc99(0xfc),a220_0x48bc99(0xee),'.idea','.lovrabet.json',a220_0x48bc99(0xe0),'.rabetbase',a220_0x48bc99(0xad),a220_0x48bc99(0x10c),a220_0x48bc99(0xb9)]);function isForbiddenTemplateEntry(_0x551678){const _0x630677=a220_0x48bc99;if(LOCAL_FORBIDDEN_NAMES[_0x630677(0xf6)](_0x551678))return!![];return _0x551678==='.env'||_0x551678[_0x630677(0x10e)]('.env.')&&_0x551678!==_0x630677(0xd5);}function containsPath(_0xd3e5a1,_0x534086){const _0x1151e6=a220_0x48bc99,_0x3cbfbd=a220_0xae1750[_0x1151e6(0xe4)](_0xd3e5a1,_0x534086);return _0x3cbfbd===''||!_0x3cbfbd[_0x1151e6(0x10e)]('..'+a220_0xae1750[_0x1151e6(0xb1)])&&_0x3cbfbd!=='..'&&!a220_0xae1750[_0x1151e6(0x102)](_0x3cbfbd);}async function copyLocalTemplateDirectory(_0x44dd3d,_0x635d48){const _0x4debd1=a220_0x48bc99;await a220_0x3349d0[_0x4debd1(0xc0)](_0x635d48,{'recursive':!![]});for(const _0x9e68d8 of await a220_0x3349d0[_0x4debd1(0x111)](_0x44dd3d,{'withFileTypes':!![]})){const _0x10fabc=a220_0xae1750[_0x4debd1(0x101)](_0x44dd3d,_0x9e68d8[_0x4debd1(0xd1)]),_0x5f26b4=a220_0xae1750[_0x4debd1(0x101)](_0x635d48,_0x9e68d8[_0x4debd1(0xd1)]);if(isForbiddenTemplateEntry(_0x9e68d8[_0x4debd1(0xd1)]))throw new Error(_0x4debd1(0xf3)+_0x10fabc);const _0x551660=await a220_0x3349d0[_0x4debd1(0xaa)](_0x10fabc);if(_0x551660[_0x4debd1(0xcf)]())throw new Error('Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20'+_0x10fabc);if(_0x551660[_0x4debd1(0x115)]()){await copyLocalTemplateDirectory(_0x10fabc,_0x5f26b4);continue;}if(!_0x551660[_0x4debd1(0x107)]())continue;await a220_0x3349d0['copyFile'](_0x10fabc,_0x5f26b4),await a220_0x3349d0[_0x4debd1(0xf4)](_0x5f26b4,_0x551660[_0x4debd1(0xea)]&0x1ff);}}async function readTemplateVersion(_0x2acffc){const _0x51aac9=a220_0x48bc99,_0x33996c=JSON[_0x51aac9(0x110)](await a220_0x3349d0[_0x51aac9(0xc6)](a220_0xae1750[_0x51aac9(0x101)](_0x2acffc,_0x51aac9(0xc8)),_0x51aac9(0xb6)));return nonEmptyString(_0x33996c[_0x51aac9(0xb2)])||_0x51aac9(0xa8);}async function readDirectoryIdentity(_0x228613){const _0x3c17c5=a220_0x48bc99;try{const _0x3364de=await a220_0x3349d0[_0x3c17c5(0xaa)](_0x228613);if(!_0x3364de['isDirectory']())return null;return{'dev':_0x3364de[_0x3c17c5(0x10f)],'ino':_0x3364de[_0x3c17c5(0xd8)]};}catch{return null;}}async function commitStagedProject(_0x3f7584,_0x3e873d){const _0x18399c=a220_0x48bc99;await a220_0x3349d0[_0x18399c(0xc0)](_0x3e873d);const _0x80ef6f=await readDirectoryIdentity(_0x3e873d);if(!_0x80ef6f)throw new Error(_0x18399c(0xbc));try{for(const _0x161992 of await a220_0x3349d0[_0x18399c(0x111)](_0x3f7584)){await a220_0x3349d0[_0x18399c(0xfd)](a220_0xae1750['join'](_0x3f7584,_0x161992),a220_0xae1750[_0x18399c(0x101)](_0x3e873d,_0x161992));}}catch(_0x55a807){const _0xe26d3e=await readDirectoryIdentity(_0x3e873d);_0xe26d3e?.[_0x18399c(0x10f)]===_0x80ef6f['dev']&&_0xe26d3e[_0x18399c(0xd8)]===_0x80ef6f[_0x18399c(0xd8)]&&await a220_0x3349d0['rm'](_0x3e873d,{'recursive':!![],'force':!![]});throw _0x55a807;}}export async function materializeProjectTemplate(_0x554da6,_0x407d02){const _0x43fc83=a220_0x48bc99,_0x3c57a0=a220_0xae1750[_0x43fc83(0xab)](_0x554da6),_0x31600a=a220_0xae1750[_0x43fc83(0xe5)](_0x3c57a0);try{await a220_0x3349d0['lstat'](_0x3c57a0);throw new Error(_0x43fc83(0xac)+_0x3c57a0);}catch(_0x39934a){if(_0x39934a['code']!=='ENOENT')throw _0x39934a;}const _0x2316c0=await a220_0x3349d0[_0x43fc83(0xda)](a220_0xae1750[_0x43fc83(0x101)](_0x31600a,_0x43fc83(0xf0))),_0x49fa02=a220_0xae1750[_0x43fc83(0x101)](_0x2316c0,_0x43fc83(0xbf)),_0x536e60=a220_0xae1750[_0x43fc83(0x101)](_0x2316c0,_0x43fc83(0xfb));try{try{_0x407d02?.(_0x43fc83(0x100));const {descriptor:_0x292cee,channel:_0x44c95c,assetBaseUrl:_0x45985b,legacyAssetBaseUrl:_0x59c50c}=await fetchTemplateDescriptor();return _0x407d02?.('downloading'),await downloadArchive(_0x292cee,_0x44c95c,_0x45985b,_0x59c50c,_0x536e60,_0x407d02),_0x407d02?.('extracting'),await extractProjectTemplateArchive(_0x536e60,_0x49fa02),await assertTemplateRoot(_0x49fa02),await commitStagedProject(_0x49fa02,_0x3c57a0),{'source':_0x43fc83(0xcd),'version':_0x292cee[_0x43fc83(0xb2)]};}catch(_0x503ad1){if(_0x503ad1[_0x43fc83(0xd3)]===_0x43fc83(0x103))throw CliErrors[_0x43fc83(0xe6)](_0x43fc83(0xac)+_0x3c57a0,_0x43fc83(0xcc));const _0x43f72e=_0x503ad1 instanceof Error?_0x503ad1[_0x43fc83(0xe7)]:String(_0x503ad1);throw CliErrors['validation']('Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20'+_0x43f72e);}}finally{await a220_0x3349d0['rm'](_0x2316c0,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x3b7aae,_0x476866,_0x2dada0){const _0x16a670=a220_0x48bc99;let _0xe19788;try{_0xe19788=await a220_0x3349d0['realpath'](a220_0xae1750['resolve'](_0x3b7aae));}catch{throw CliErrors[_0x16a670(0xe6)](_0x16a670(0xb7)+a220_0xae1750[_0x16a670(0xab)](_0x3b7aae),'Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.');}const _0x5f3763=await a220_0x3349d0[_0x16a670(0xaa)](_0xe19788);if(!_0x5f3763['isDirectory']())throw CliErrors['validation'](_0x16a670(0xae)+_0xe19788);const _0x3f8198=a220_0xae1750[_0x16a670(0xab)](_0x476866),_0x1235c3=await a220_0x3349d0[_0x16a670(0xa6)](a220_0xae1750['dirname'](_0x3f8198)),_0x16ec6a=a220_0xae1750[_0x16a670(0x101)](_0x1235c3,a220_0xae1750[_0x16a670(0xa9)](_0x3f8198));if(containsPath(_0xe19788,_0x16ec6a)||containsPath(_0x16ec6a,_0xe19788))throw CliErrors[_0x16a670(0xe6)](_0x16a670(0xe9),'Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.');try{await a220_0x3349d0[_0x16a670(0xaa)](_0x16ec6a);throw CliErrors['validation'](_0x16a670(0xac)+_0x16ec6a,'Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.');}catch(_0x4da557){if(_0x4da557['code']!==_0x16a670(0xa5))throw _0x4da557;}const _0x1085ce=a220_0xae1750[_0x16a670(0xe5)](_0x16ec6a);await a220_0x3349d0[_0x16a670(0xcb)](_0x1085ce);const _0x519b21=await a220_0x3349d0[_0x16a670(0xda)](a220_0xae1750[_0x16a670(0x101)](_0x1085ce,_0x16a670(0xf0))),_0x405592=a220_0xae1750[_0x16a670(0x101)](_0x519b21,_0x16a670(0xbf));try{_0x2dada0?.(_0x16a670(0xdf)),await copyLocalTemplateDirectory(_0xe19788,_0x405592),await assertTemplateRoot(_0x405592);const _0x5942bd=await readTemplateVersion(_0x405592);return await commitStagedProject(_0x405592,_0x16ec6a),{'source':'local','version':_0x5942bd};}catch(_0x435eca){const _0x1c7891=_0x435eca instanceof Error?_0x435eca[_0x16a670(0xe7)]:String(_0x435eca);throw CliErrors[_0x16a670(0xe6)](_0x16a670(0x109)+_0x1c7891,_0x16a670(0x105));}finally{await a220_0x3349d0['rm'](_0x519b21,{'recursive':!![],'force':!![]});}}
|
|
1
|
+
const a220_0x20ac04=a220_0x1e62;(function(_0x999ddb,_0x1a94fa){const _0x527ab8=a220_0x1e62,_0x1bea85=_0x999ddb();while(!![]){try{const _0x2445bc=-parseInt(_0x527ab8(0x202))/0x1+parseInt(_0x527ab8(0x211))/0x2+-parseInt(_0x527ab8(0x21f))/0x3*(parseInt(_0x527ab8(0x1f3))/0x4)+-parseInt(_0x527ab8(0x1da))/0x5+parseInt(_0x527ab8(0x210))/0x6*(parseInt(_0x527ab8(0x1dd))/0x7)+parseInt(_0x527ab8(0x208))/0x8+parseInt(_0x527ab8(0x1f0))/0x9;if(_0x2445bc===_0x1a94fa)break;else _0x1bea85['push'](_0x1bea85['shift']());}catch(_0x2f7f61){_0x1bea85['push'](_0x1bea85['shift']());}}}(a220_0x2bc9,0x88c1e));import{createHash}from'node:crypto';import a220_0x14ad6f from'node:fs/promises';import a220_0x2b64c9 from'node:path';import a220_0x1f5680 from'semver';import{getProjectTemplateRelativeUrl}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{fetchProjectTemplateCdnConfig,isBetaCliVersion,resolveProjectTemplateDescriptor}from'../../../utils/cli-version-policy.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID=a220_0x20ac04(0x1b3),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x27ec21){return typeof _0x27ec21==='string'&&_0x27ec21['trim']()?_0x27ec21['trim']():null;}function parseDescriptor(_0x597777){const _0x473f6e=a220_0x20ac04;if(!_0x597777||typeof _0x597777!==_0x473f6e(0x1dc))throw new Error('CDN\x20config\x20does\x20not\x20define\x20template\x20\x22'+TEMPLATE_ID+'\x22.');const _0x32e84d=_0x597777,_0x1a5864=nonEmptyString(_0x32e84d[_0x473f6e(0x1ed)]),_0x5e516d=nonEmptyString(_0x32e84d[_0x473f6e(0x212)]),_0x44bc73=_0x32e84d[_0x473f6e(0x1cd)]===undefined?undefined:nonEmptyString(_0x32e84d['url'])||undefined,_0x5a7b09=nonEmptyString(_0x32e84d[_0x473f6e(0x1e9)])?.[_0x473f6e(0x1e8)](),_0x1621c3=_0x32e84d[_0x473f6e(0x1fe)];if(!_0x1a5864||!a220_0x1f5680[_0x473f6e(0x1f2)](_0x1a5864)||!_0x5e516d||_0x5e516d!==a220_0x2b64c9[_0x473f6e(0x1c5)]['basename'](_0x5e516d)||_0x5e516d['includes']('\x5c')||_0x32e84d[_0x473f6e(0x1cd)]!==undefined&&!_0x44bc73||!_0x5a7b09||!/^sha256:[a-f0-9]{64}$/[_0x473f6e(0x220)](_0x5a7b09)||typeof _0x1621c3!==_0x473f6e(0x1c2)||!Number[_0x473f6e(0x1cc)](_0x1621c3)||_0x1621c3<=0x0||_0x1621c3>MAX_ARCHIVE_SIZE)throw new Error(_0x473f6e(0x206)+TEMPLATE_ID+'\x22.');return{'version':_0x1a5864,'name':_0x5e516d,'url':_0x44bc73,'sha256':_0x5a7b09,'size':_0x1621c3};}async function fetchWithTimeout(_0x16dde6,_0x486eaa,_0x44aabf,_0x17a248){const _0x3c881f=a220_0x20ac04,_0x2550e3=new AbortController(),_0x99e3a5=setTimeout(()=>_0x2550e3[_0x3c881f(0x1d3)](),_0x486eaa);try{const _0xd2a251=await fetch(_0x16dde6,{'headers':{'Accept':_0x44aabf},'redirect':'error','signal':_0x2550e3[_0x3c881f(0x1fb)]});return await _0x17a248(_0xd2a251);}finally{clearTimeout(_0x99e3a5);}}async function fetchTemplateDescriptor(){const _0x1349d5=a220_0x20ac04,_0x56bc36=getCliVersion(),_0x29c95d=isBetaCliVersion(_0x56bc36)?_0x1349d5(0x218):_0x1349d5(0x1b2),_0x2837eb=await fetchProjectTemplateCdnConfig();if(!_0x2837eb)throw new Error('Rabetbase\x20CDN\x20config\x20is\x20unavailable.');const _0x104f0a=parseDescriptor(resolveProjectTemplateDescriptor(_0x2837eb[_0x1349d5(0x1bd)],_0x56bc36));return{'descriptor':_0x104f0a,'channel':_0x29c95d,'assetBaseUrl':_0x2837eb[_0x1349d5(0x1be)],'legacyAssetBaseUrl':_0x2837eb['legacyAssetBaseUrl']};}function a220_0x2bc9(){const _0x34b1f7=['valid','1018824AhGHPV','mode','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','Unable\x20to\x20claim\x20the\x20project\x20directory.','utf8','cancel','pathname','concat','signal','has','startsWith','size','body','copyFile','EEXIST','321211cuvXBD','Local\x20template\x20source\x20does\x20not\x20exist:\x20','read','.env.','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','digest','6020480WUJNNK','downloading','ino','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','lstat','extracting','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','.rabetbase.json','6108rNorfI','922508mkPcev','name','.DS_Store','template.zip','from','headers','origin','beta','basename','length','.env.example','update','writeFile','rename','3ZNYgQq','test','.git','mkdtemp','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','push','.codegraph','getReader','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','.env','readdir','dev','.rabetbase-create-','arrayBuffer','release','sub-app-react-demo','includes','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','resolve','application/zip','releaseLock','code','dirname','mkdir','protocol','config','assetBaseUrl','dist','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','Project\x20template\x20package.json\x20is\x20invalid.','number','local','Check\x20the\x20source\x20directory\x20and\x20retry.','posix','.idea','content-length','join','copying','package.json','sha256:','isSafeInteger','url','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','realpath','isDirectory','.lovrabet.json','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','abort','Invalid\x20local\x20template\x20source:\x20','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20',',\x20received\x20','status','get','access','4851120UrwbSW','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','object','3808lbWrDG','project','Project\x20directory\x20already\x20exists:\x20','isSymbolicLink','message','validation','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','readFile','verifying','ENOENT','toLowerCase','sha256','https:','.lovrabet.log','parse','version','isAbsolute','byteLength','3048237XfsmlU','hex'];a220_0x2bc9=function(){return _0x34b1f7;};return a220_0x2bc9();}function resolveArchiveUrl(_0x49dc9c,_0x5d536b,_0x1d9baf,_0x1e6005){const _0x1ff636=a220_0x20ac04,_0xa25909=new URL(_0x1d9baf+'/'),_0x3e6275=[getProjectTemplateRelativeUrl(_0x5d536b),getProjectTemplateRelativeUrl(_0x5d536b,_0x49dc9c[_0x1ff636(0x1ed)])];if(_0x49dc9c[_0x1ff636(0x1cd)]&&!_0x3e6275[_0x1ff636(0x1b4)](_0x49dc9c[_0x1ff636(0x1cd)]))throw new Error('CDN\x20project\x20template\x20relative\x20URL\x20must\x20match\x20its\x20release\x20channel\x20or\x20version.');const _0x295934=new URL(_0x1e6005+'/'),_0x3e679d=_0x49dc9c[_0x1ff636(0x1cd)]?new URL(_0x49dc9c['url'],_0xa25909[_0x1ff636(0x217)]):new URL(_0x49dc9c[_0x1ff636(0x212)],_0x295934),_0x3fef64=_0x49dc9c[_0x1ff636(0x1cd)]?_0xa25909[_0x1ff636(0x217)]:_0x295934['origin'];if(_0x3e679d[_0x1ff636(0x1bc)]!==_0x1ff636(0x1ea)||_0x3e679d[_0x1ff636(0x217)]!==_0x3fef64||a220_0x2b64c9[_0x1ff636(0x1c5)][_0x1ff636(0x219)](decodeURIComponent(_0x3e679d[_0x1ff636(0x1f9)]))!==_0x49dc9c[_0x1ff636(0x212)]||!_0x49dc9c['url']&&!_0x3e679d[_0x1ff636(0x1f9)][_0x1ff636(0x1fd)](_0x295934[_0x1ff636(0x1f9)]))throw new Error(_0x1ff636(0x1db));return _0x3e679d['href'];}async function readResponseBytes(_0x56d01a,_0x394361){const _0x587418=a220_0x20ac04;if(!_0x56d01a[_0x587418(0x1ff)]){const _0x2e2e12=Buffer[_0x587418(0x215)](await _0x56d01a[_0x587418(0x1b1)]());if(_0x2e2e12[_0x587418(0x21a)]>_0x394361)throw new Error(_0x587418(0x1ce));return _0x2e2e12;}const _0x22d5c6=_0x56d01a[_0x587418(0x1ff)][_0x587418(0x1ab)](),_0x533ca0=[];let _0x497bbf=0x0;try{while(!![]){const {done:_0x312cea,value:_0x287b67}=await _0x22d5c6[_0x587418(0x204)]();if(_0x312cea)break;_0x497bbf+=_0x287b67[_0x587418(0x1ef)];if(_0x497bbf>_0x394361){await _0x22d5c6[_0x587418(0x1f8)]();throw new Error(_0x587418(0x1ce));}_0x533ca0[_0x587418(0x1a9)](Buffer[_0x587418(0x215)](_0x287b67));}}finally{_0x22d5c6[_0x587418(0x1b8)]();}return Buffer[_0x587418(0x1fa)](_0x533ca0,_0x497bbf);}async function downloadArchive(_0x3bdf09,_0x2ee0f0,_0x121bea,_0xc19f07,_0xe9500a,_0x216cd5){const _0x30b776=a220_0x20ac04,_0x436f07=await fetchWithTimeout(resolveArchiveUrl(_0x3bdf09,_0x2ee0f0,_0x121bea,_0xc19f07),ARCHIVE_TIMEOUT_MS,_0x30b776(0x1b7),async _0x549e27=>{const _0x196a18=_0x30b776;if(!_0x549e27['ok'])throw new Error(_0x196a18(0x20e)+_0x549e27[_0x196a18(0x1d7)]+'.');const _0x5d855d=Number(_0x549e27[_0x196a18(0x216)][_0x196a18(0x1d8)](_0x196a18(0x1c7)));if(Number['isFinite'](_0x5d855d)&&_0x5d855d>MAX_ARCHIVE_SIZE)throw new Error(_0x196a18(0x1c0));return readResponseBytes(_0x549e27,_0x3bdf09['size']);});if(_0x436f07['length']!==_0x3bdf09[_0x30b776(0x1fe)])throw new Error(_0x30b776(0x1d5)+_0x3bdf09[_0x30b776(0x1fe)]+_0x30b776(0x1d6)+_0x436f07['length']+'.');_0x216cd5?.(_0x30b776(0x1e6));const _0x45d7f4=_0x30b776(0x1cb)+createHash(_0x30b776(0x1e9))[_0x30b776(0x21c)](_0x436f07)[_0x30b776(0x207)](_0x30b776(0x1f1));if(_0x45d7f4!==_0x3bdf09[_0x30b776(0x1e9)])throw new Error(_0x30b776(0x223));await a220_0x14ad6f[_0x30b776(0x21d)](_0xe9500a,_0x436f07,{'flag':'wx'});}async function assertTemplateRoot(_0x252950){const _0x35a03d=a220_0x20ac04,_0x4b9261=a220_0x2b64c9[_0x35a03d(0x1c8)](_0x252950,_0x35a03d(0x1ca)),_0x5d4850=JSON[_0x35a03d(0x1ec)](await a220_0x14ad6f[_0x35a03d(0x1e5)](_0x4b9261,_0x35a03d(0x1f7)));if(!_0x5d4850||typeof _0x5d4850!==_0x35a03d(0x1dc))throw new Error(_0x35a03d(0x1c1));}const LOCAL_FORBIDDEN_NAMES=new Set([a220_0x20ac04(0x213),a220_0x20ac04(0x1aa),a220_0x20ac04(0x221),a220_0x20ac04(0x1c6),a220_0x20ac04(0x1d1),a220_0x20ac04(0x1eb),'.rabetbase',a220_0x20ac04(0x20f),a220_0x20ac04(0x1bf),'node_modules']);function a220_0x1e62(_0xd65687,_0x9b8c14){_0xd65687=_0xd65687-0x1a9;const _0x2bc948=a220_0x2bc9();let _0x1e6290=_0x2bc948[_0xd65687];return _0x1e6290;}function isForbiddenTemplateEntry(_0x2e92b9){const _0x2e2814=a220_0x20ac04;if(LOCAL_FORBIDDEN_NAMES[_0x2e2814(0x1fc)](_0x2e92b9))return!![];return _0x2e92b9===_0x2e2814(0x1ad)||_0x2e92b9[_0x2e2814(0x1fd)](_0x2e2814(0x205))&&_0x2e92b9!==_0x2e2814(0x21b);}function containsPath(_0x34b1e9,_0x34e739){const _0x3c9f9d=a220_0x20ac04,_0x2308c7=a220_0x2b64c9['relative'](_0x34b1e9,_0x34e739);return _0x2308c7===''||!_0x2308c7['startsWith']('..'+a220_0x2b64c9['sep'])&&_0x2308c7!=='..'&&!a220_0x2b64c9[_0x3c9f9d(0x1ee)](_0x2308c7);}async function copyLocalTemplateDirectory(_0x3aeb95,_0x2a85dd){const _0x407a9f=a220_0x20ac04;await a220_0x14ad6f[_0x407a9f(0x1bb)](_0x2a85dd,{'recursive':!![]});for(const _0x38cccb of await a220_0x14ad6f[_0x407a9f(0x1ae)](_0x3aeb95,{'withFileTypes':!![]})){const _0x5782ef=a220_0x2b64c9[_0x407a9f(0x1c8)](_0x3aeb95,_0x38cccb['name']),_0x238bb2=a220_0x2b64c9[_0x407a9f(0x1c8)](_0x2a85dd,_0x38cccb['name']);if(isForbiddenTemplateEntry(_0x38cccb[_0x407a9f(0x212)]))throw new Error(_0x407a9f(0x20b)+_0x5782ef);const _0x204bf7=await a220_0x14ad6f[_0x407a9f(0x20c)](_0x5782ef);if(_0x204bf7[_0x407a9f(0x1e0)]())throw new Error(_0x407a9f(0x1e4)+_0x5782ef);if(_0x204bf7[_0x407a9f(0x1d0)]()){await copyLocalTemplateDirectory(_0x5782ef,_0x238bb2);continue;}if(!_0x204bf7['isFile']())continue;await a220_0x14ad6f[_0x407a9f(0x200)](_0x5782ef,_0x238bb2),await a220_0x14ad6f['chmod'](_0x238bb2,_0x204bf7[_0x407a9f(0x1f4)]&0x1ff);}}async function readTemplateVersion(_0x445abf){const _0x420a42=a220_0x20ac04,_0x502b3b=JSON['parse'](await a220_0x14ad6f[_0x420a42(0x1e5)](a220_0x2b64c9[_0x420a42(0x1c8)](_0x445abf,_0x420a42(0x1ca)),_0x420a42(0x1f7)));return nonEmptyString(_0x502b3b['version'])||_0x420a42(0x1c3);}async function readDirectoryIdentity(_0x26a2a8){const _0x6803db=a220_0x20ac04;try{const _0x3dd2a7=await a220_0x14ad6f[_0x6803db(0x20c)](_0x26a2a8);if(!_0x3dd2a7[_0x6803db(0x1d0)]())return null;return{'dev':_0x3dd2a7[_0x6803db(0x1af)],'ino':_0x3dd2a7[_0x6803db(0x20a)]};}catch{return null;}}async function commitStagedProject(_0x515556,_0x3292e6){const _0x3f93c0=a220_0x20ac04;await a220_0x14ad6f[_0x3f93c0(0x1bb)](_0x3292e6);const _0x1be8e7=await readDirectoryIdentity(_0x3292e6);if(!_0x1be8e7)throw new Error(_0x3f93c0(0x1f6));try{for(const _0x5e7e84 of await a220_0x14ad6f[_0x3f93c0(0x1ae)](_0x515556)){await a220_0x14ad6f[_0x3f93c0(0x21e)](a220_0x2b64c9[_0x3f93c0(0x1c8)](_0x515556,_0x5e7e84),a220_0x2b64c9[_0x3f93c0(0x1c8)](_0x3292e6,_0x5e7e84));}}catch(_0x43641f){const _0x456bb5=await readDirectoryIdentity(_0x3292e6);_0x456bb5?.[_0x3f93c0(0x1af)]===_0x1be8e7['dev']&&_0x456bb5[_0x3f93c0(0x20a)]===_0x1be8e7['ino']&&await a220_0x14ad6f['rm'](_0x3292e6,{'recursive':!![],'force':!![]});throw _0x43641f;}}export async function materializeProjectTemplate(_0x2f213a,_0x2a2d6c){const _0x13c30c=a220_0x20ac04,_0x3b6b54=a220_0x2b64c9[_0x13c30c(0x1b6)](_0x2f213a),_0x5d8d3f=a220_0x2b64c9[_0x13c30c(0x1ba)](_0x3b6b54);try{await a220_0x14ad6f[_0x13c30c(0x20c)](_0x3b6b54);throw new Error(_0x13c30c(0x1df)+_0x3b6b54);}catch(_0x40c0d9){if(_0x40c0d9[_0x13c30c(0x1b9)]!==_0x13c30c(0x1e7))throw _0x40c0d9;}const _0x69bb06=await a220_0x14ad6f[_0x13c30c(0x222)](a220_0x2b64c9[_0x13c30c(0x1c8)](_0x5d8d3f,_0x13c30c(0x1b0))),_0x2fc62d=a220_0x2b64c9[_0x13c30c(0x1c8)](_0x69bb06,_0x13c30c(0x1de)),_0x52d21e=a220_0x2b64c9[_0x13c30c(0x1c8)](_0x69bb06,_0x13c30c(0x214));try{try{_0x2a2d6c?.('resolving');const {descriptor:_0x3d4c77,channel:_0x30220a,assetBaseUrl:_0x5dd6bf,legacyAssetBaseUrl:_0x1e9c92}=await fetchTemplateDescriptor();return _0x2a2d6c?.(_0x13c30c(0x209)),await downloadArchive(_0x3d4c77,_0x30220a,_0x5dd6bf,_0x1e9c92,_0x52d21e,_0x2a2d6c),_0x2a2d6c?.(_0x13c30c(0x20d)),await extractProjectTemplateArchive(_0x52d21e,_0x2fc62d),await assertTemplateRoot(_0x2fc62d),await commitStagedProject(_0x2fc62d,_0x3b6b54),{'source':'cdn','version':_0x3d4c77[_0x13c30c(0x1ed)]};}catch(_0x31049f){if(_0x31049f[_0x13c30c(0x1b9)]===_0x13c30c(0x201))throw CliErrors[_0x13c30c(0x1e2)](_0x13c30c(0x1df)+_0x3b6b54,'Use\x20a\x20different\x20project\x20name.');const _0x559b38=_0x31049f instanceof Error?_0x31049f[_0x13c30c(0x1e1)]:String(_0x31049f);throw CliErrors[_0x13c30c(0x1e2)](_0x13c30c(0x1f5),_0x13c30c(0x1b5)+_0x559b38);}}finally{await a220_0x14ad6f['rm'](_0x69bb06,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x330e5e,_0x4339a,_0x1885fc){const _0x2a00a1=a220_0x20ac04;let _0x4f512b;try{_0x4f512b=await a220_0x14ad6f[_0x2a00a1(0x1cf)](a220_0x2b64c9[_0x2a00a1(0x1b6)](_0x330e5e));}catch{throw CliErrors[_0x2a00a1(0x1e2)](_0x2a00a1(0x203)+a220_0x2b64c9['resolve'](_0x330e5e),_0x2a00a1(0x1e3));}const _0x57eaee=await a220_0x14ad6f[_0x2a00a1(0x20c)](_0x4f512b);if(!_0x57eaee[_0x2a00a1(0x1d0)]())throw CliErrors[_0x2a00a1(0x1e2)](_0x2a00a1(0x1ac)+_0x4f512b);const _0x38e108=a220_0x2b64c9[_0x2a00a1(0x1b6)](_0x4339a),_0xd78eb3=await a220_0x14ad6f[_0x2a00a1(0x1cf)](a220_0x2b64c9[_0x2a00a1(0x1ba)](_0x38e108)),_0x36474b=a220_0x2b64c9['join'](_0xd78eb3,a220_0x2b64c9['basename'](_0x38e108));if(containsPath(_0x4f512b,_0x36474b)||containsPath(_0x36474b,_0x4f512b))throw CliErrors[_0x2a00a1(0x1e2)]('Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.',_0x2a00a1(0x1d2));try{await a220_0x14ad6f[_0x2a00a1(0x20c)](_0x36474b);throw CliErrors[_0x2a00a1(0x1e2)]('Project\x20directory\x20already\x20exists:\x20'+_0x36474b,'Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.');}catch(_0x58478b){if(_0x58478b[_0x2a00a1(0x1b9)]!=='ENOENT')throw _0x58478b;}const _0x47e97e=a220_0x2b64c9['dirname'](_0x36474b);await a220_0x14ad6f[_0x2a00a1(0x1d9)](_0x47e97e);const _0x5204b3=await a220_0x14ad6f[_0x2a00a1(0x222)](a220_0x2b64c9[_0x2a00a1(0x1c8)](_0x47e97e,_0x2a00a1(0x1b0))),_0x210c04=a220_0x2b64c9[_0x2a00a1(0x1c8)](_0x5204b3,_0x2a00a1(0x1de));try{_0x1885fc?.(_0x2a00a1(0x1c9)),await copyLocalTemplateDirectory(_0x4f512b,_0x210c04),await assertTemplateRoot(_0x210c04);const _0x56dde4=await readTemplateVersion(_0x210c04);return await commitStagedProject(_0x210c04,_0x36474b),{'source':_0x2a00a1(0x1c3),'version':_0x56dde4};}catch(_0x204ed8){const _0x350243=_0x204ed8 instanceof Error?_0x204ed8[_0x2a00a1(0x1e1)]:String(_0x204ed8);throw CliErrors[_0x2a00a1(0x1e2)](_0x2a00a1(0x1d4)+_0x350243,_0x2a00a1(0x1c4));}finally{await a220_0x14ad6f['rm'](_0x5204b3,{'recursive':!![],'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5339ac,_0x459a2c){const _0x5eb6f7=a221_0xbd0c,_0x3f0506=_0x5339ac();while(!![]){try{const _0xe2af93=parseInt(_0x5eb6f7(0xa6))/0x1*(parseInt(_0x5eb6f7(0x95))/0x2)+parseInt(_0x5eb6f7(0x9d))/0x3*(parseInt(_0x5eb6f7(0x9e))/0x4)+-parseInt(_0x5eb6f7(0xa5))/0x5*(-parseInt(_0x5eb6f7(0x9c))/0x6)+-parseInt(_0x5eb6f7(0xa3))/0x7+-parseInt(_0x5eb6f7(0x98))/0x8+parseInt(_0x5eb6f7(0x96))/0x9*(parseInt(_0x5eb6f7(0x9b))/0xa)+-parseInt(_0x5eb6f7(0xa8))/0xb;if(_0xe2af93===_0x459a2c)break;else _0x3f0506['push'](_0x3f0506['shift']());}catch(_0x4d7b0d){_0x3f0506['push'](_0x3f0506['shift']());}}}(a221_0xba4e,0x2acf7));function a221_0xba4e(){const _0x343e21=['length','172520cXAHme','Project\x20name\x20cannot\x20exceed\x20','\x20characters','310CChwyD','306pHqohP','3cHHlGA','365764NqqNuk','Project\x20name\x20\x22','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','trim','validation','1272586sKACAm','Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.','13175RjAWZd','9113lBRAAy','\x22\x20is\x20reserved\x20on\x20Windows','2946284bqHFLr','Project\x20name\x20cannot\x20be\x20empty','test','62kDiiDH','40131vBcjSm'];a221_0xba4e=function(){return _0x343e21;};return a221_0xba4e();}function a221_0xbd0c(_0x35bfa0,_0x380358){_0x35bfa0=_0x35bfa0-0x95;const _0xba4ec0=a221_0xba4e();let _0xbd0ca8=_0xba4ec0[_0x35bfa0];return _0xbd0ca8;}import{CliErrors}from'../../../errors.js';const PROJECT_NAME_PATTERN=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i,MAX_PROJECT_NAME_LENGTH=0x64;export function getProjectNameValidationError(_0x50736e){const _0x28d3ae=a221_0xbd0c,_0xb0907=_0x50736e[_0x28d3ae(0xa1)]();if(!_0xb0907)return _0x28d3ae(0xa9);if(_0xb0907[_0x28d3ae(0x97)]>MAX_PROJECT_NAME_LENGTH)return _0x28d3ae(0x99)+MAX_PROJECT_NAME_LENGTH+_0x28d3ae(0x9a);if(!PROJECT_NAME_PATTERN[_0x28d3ae(0xaa)](_0xb0907))return _0x28d3ae(0xa0);if(WINDOWS_RESERVED_NAME[_0x28d3ae(0xaa)](_0xb0907))return _0x28d3ae(0x9f)+_0xb0907+_0x28d3ae(0xa7);return null;}export function validateProjectName(_0x20d2da){const _0x410786=a221_0xbd0c,_0x1dc555=_0x20d2da[_0x410786(0xa1)](),_0x142632=getProjectNameValidationError(_0x1dc555);if(_0x142632)throw CliErrors[_0x410786(0xa2)](_0x142632,_0x410786(0xa4));return _0x1dc555;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xeac917,_0x39e99b){const _0x583fe2=a222_0x6953,_0x257dc2=_0xeac917();while(!![]){try{const _0x4fcc8b=-parseInt(_0x583fe2(0xff))/0x1*(parseInt(_0x583fe2(0x11d))/0x2)+parseInt(_0x583fe2(0x120))/0x3+-parseInt(_0x583fe2(0x107))/0x4*(-parseInt(_0x583fe2(0xf6))/0x5)+-parseInt(_0x583fe2(0x10f))/0x6*(parseInt(_0x583fe2(0x11c))/0x7)+parseInt(_0x583fe2(0x100))/0x8+-parseInt(_0x583fe2(0xf1))/0x9*(parseInt(_0x583fe2(0x11e))/0xa)+parseInt(_0x583fe2(0x121))/0xb*(parseInt(_0x583fe2(0x10e))/0xc);if(_0x4fcc8b===_0x39e99b)break;else _0x257dc2['push'](_0x257dc2['shift']());}catch(_0x32394f){_0x257dc2['push'](_0x257dc2['shift']());}}}(a222_0x37a3,0x5588e));import{createWriteStream}from'node:fs';import a222_0x24029e from'node:fs/promises';import a222_0x29c7f2 from'node:path';import{pipeline}from'node:stream/promises';import a222_0x16c39c 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(_0x10e5d1){return new Promise((_0x35ec85,_0x1edb95)=>{const _0xd9fe8c=a222_0x6953;a222_0x16c39c[_0xd9fe8c(0x11b)](_0x10e5d1,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x5a3d83,_0x19c77e)=>{const _0x156c65=_0xd9fe8c;if(_0x5a3d83||!_0x19c77e){_0x1edb95(_0x5a3d83||new Error(_0x156c65(0x112)));return;}_0x35ec85(_0x19c77e);});});}function a222_0x37a3(){const _0x31abab=['1852491gvLBzn','121IPnDYM','Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20','split','sep','1380294JKVmtf','Project\x20template\x20ZIP\x20exceeds\x20','Unable\x20to\x20read\x20ZIP\x20entry:\x20','openReadStream','externalFileAttributes','5wTGTyE','Case-conflicting\x20ZIP\x20entry\x20path:\x20','readEntry','once','endsWith','set','Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20','toLocaleLowerCase','Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20','554163cwgbGZ','2661808RHtQOV','add','has','catch','mkdir','en-US','replace','510028JBtwlp','close','test','slice','isEncrypted','Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20','Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20','367296ubjOTi','6pKNmMB','ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20','entry','Unable\x20to\x20open\x20project\x20template\x20archive.','get','error','uncompressedSize','resolve','dirname','length','fileName','startsWith','open','348649oSwdVq','2PblAks','30SbAybr','join'];a222_0x37a3=function(){return _0x31abab;};return a222_0x37a3();}function openEntryStream(_0x3b8774,_0x19604d){return new Promise((_0x218325,_0x516372)=>{const _0x290c31=a222_0x6953;_0x3b8774[_0x290c31(0xf4)](_0x19604d,(_0x477e81,_0x56682e)=>{const _0x3016ed=_0x290c31;if(_0x477e81||!_0x56682e){_0x516372(_0x477e81||new Error(_0x3016ed(0xf3)+_0x19604d[_0x3016ed(0x119)]));return;}_0x218325(_0x56682e);});});}function validateEntryPath(_0xe05e4c){const _0x34ccfd=a222_0x6953,_0x5eb8e4=_0xe05e4c[_0x34ccfd(0x106)](/\\/g,'/'),_0x273cdc=_0x5eb8e4[_0x34ccfd(0xfa)]('/'),_0x52a7e7=_0x273cdc?_0x5eb8e4[_0x34ccfd(0x10a)](0x0,-0x1):_0x5eb8e4;if(!_0x52a7e7||_0x5eb8e4[_0x34ccfd(0x11a)]('/')||/^[A-Za-z]:\//[_0x34ccfd(0x109)](_0x5eb8e4))throw new Error(_0x34ccfd(0x10c)+_0xe05e4c);const _0x51cea3=_0x52a7e7[_0x34ccfd(0xef)]('/');for(const _0x1054a3 of _0x51cea3){if(!_0x1054a3||_0x1054a3==='.'||_0x1054a3==='..'||_0x1054a3[_0x34ccfd(0xfa)]('.')||_0x1054a3[_0x34ccfd(0xfa)]('\x20')||WINDOWS_INVALID_CHAR[_0x34ccfd(0x109)](_0x1054a3)||WINDOWS_RESERVED_NAME[_0x34ccfd(0x109)](_0x1054a3))throw new Error(_0x34ccfd(0x10d)+_0xe05e4c);}return{'relativePath':_0x51cea3[_0x34ccfd(0x11f)](a222_0x29c7f2[_0x34ccfd(0xf0)]),'directory':_0x273cdc};}function isSymbolicLink(_0x3f4084){const _0x4feed8=a222_0x6953,_0x3778da=_0x3f4084[_0x4feed8(0xf5)]>>>0x10&0xffff;return(_0x3778da&0xf000)===0xa000;}function a222_0x6953(_0x12bdc7,_0x11fe22){_0x12bdc7=_0x12bdc7-0xef;const _0x37a380=a222_0x37a3();let _0x695319=_0x37a380[_0x12bdc7];return _0x695319;}export async function extractProjectTemplateArchive(_0x8c6bff,_0x15ffc5){const _0x5acd78=a222_0x6953,_0x19fde0=await openZip(_0x8c6bff),_0x269909=a222_0x29c7f2[_0x5acd78(0x116)](_0x15ffc5),_0x43bed0=new Set(),_0x2e9297=new Map();let _0x468592=0x0,_0x3d0cb4=0x0;await a222_0x24029e[_0x5acd78(0x104)](_0x269909,{'recursive':!![]}),await new Promise((_0x1af178,_0x22e44b)=>{const _0x21a359=_0x5acd78;let _0x187d8a=![];const _0x3821d9=_0xc4ca83=>{const _0x594b1a=a222_0x6953;if(_0x187d8a)return;_0x187d8a=!![],_0x19fde0[_0x594b1a(0x108)](),_0x22e44b(_0xc4ca83 instanceof Error?_0xc4ca83:new Error(String(_0xc4ca83)));};_0x19fde0[_0x21a359(0xf9)](_0x21a359(0x114),_0x3821d9),_0x19fde0[_0x21a359(0xf9)]('end',()=>{if(_0x187d8a)return;_0x187d8a=!![],_0x1af178();}),_0x19fde0['on'](_0x21a359(0x111),_0x4835ab=>{const _0x66656d=_0x21a359;void(async()=>{const _0x25185c=a222_0x6953;_0x468592+=0x1,_0x3d0cb4+=_0x4835ab[_0x25185c(0x115)];if(_0x468592>MAX_ENTRY_COUNT)throw new Error(_0x25185c(0xf2)+MAX_ENTRY_COUNT+'\x20entries.');if(_0x3d0cb4>MAX_UNCOMPRESSED_SIZE)throw new Error('Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.');if(_0x4835ab[_0x25185c(0x10b)]())throw new Error(_0x25185c(0xfc)+_0x4835ab['fileName']);if(isSymbolicLink(_0x4835ab))throw new Error(_0x25185c(0x122)+_0x4835ab[_0x25185c(0x119)]);const {relativePath:_0xfc57f8,directory:_0x2ecf25}=validateEntryPath(_0x4835ab[_0x25185c(0x119)]),_0xc76d38=_0xfc57f8[_0x25185c(0xef)](a222_0x29c7f2['sep']);for(let _0x372a6d=0x1;_0x372a6d<=_0xc76d38[_0x25185c(0x118)];_0x372a6d+=0x1){const _0x344ae6=_0xc76d38[_0x25185c(0x10a)](0x0,_0x372a6d)[_0x25185c(0x11f)](a222_0x29c7f2[_0x25185c(0xf0)]),_0x394b0d=_0x344ae6[_0x25185c(0xfd)](_0x25185c(0x105)),_0x4532e8=_0x2e9297[_0x25185c(0x113)](_0x394b0d);if(_0x4532e8&&_0x4532e8!==_0x344ae6)throw new Error(_0x25185c(0xf7)+_0x4835ab['fileName']);_0x2e9297[_0x25185c(0xfb)](_0x394b0d,_0x344ae6);}const _0x2e1ecb=_0xfc57f8['toLocaleLowerCase'](_0x25185c(0x105));if(_0x43bed0[_0x25185c(0x102)](_0x2e1ecb))throw new Error(_0x25185c(0xfe)+_0x4835ab[_0x25185c(0x119)]);_0x43bed0[_0x25185c(0x101)](_0x2e1ecb);const _0x23a6c3=a222_0x29c7f2[_0x25185c(0x116)](_0x269909,_0xfc57f8);if(_0x23a6c3!==_0x269909&&!_0x23a6c3[_0x25185c(0x11a)](''+_0x269909+a222_0x29c7f2[_0x25185c(0xf0)]))throw new Error(_0x25185c(0x110)+_0x4835ab[_0x25185c(0x119)]);if(_0x2ecf25)await a222_0x24029e[_0x25185c(0x104)](_0x23a6c3,{'recursive':!![]});else{await a222_0x24029e[_0x25185c(0x104)](a222_0x29c7f2[_0x25185c(0x117)](_0x23a6c3),{'recursive':!![]});const _0x146fd6=await openEntryStream(_0x19fde0,_0x4835ab);await pipeline(_0x146fd6,createWriteStream(_0x23a6c3,{'flags':'wx','mode':0x1a4}));}_0x19fde0[_0x25185c(0xf8)]();})()[_0x66656d(0x103)](_0x3821d9);}),_0x19fde0[_0x21a359(0xf8)]();});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a223_0x4a12(_0x115b30,_0x29e49f){_0x115b30=_0x115b30-0x7c;const _0x49b6ca=a223_0x49b6();let _0x4a129d=_0x49b6ca[_0x115b30];return _0x4a129d;}(function(_0x2541e7,_0x63cfed){const _0x26d37f=a223_0x4a12,_0x13f544=_0x2541e7();while(!![]){try{const _0x44350b=-parseInt(_0x26d37f(0x85))/0x1*(parseInt(_0x26d37f(0x83))/0x2)+parseInt(_0x26d37f(0x87))/0x3+parseInt(_0x26d37f(0x86))/0x4+parseInt(_0x26d37f(0x81))/0x5*(parseInt(_0x26d37f(0x7e))/0x6)+-parseInt(_0x26d37f(0x7d))/0x7+-parseInt(_0x26d37f(0x80))/0x8+-parseInt(_0x26d37f(0x82))/0x9*(-parseInt(_0x26d37f(0x7c))/0xa);if(_0x44350b===_0x63cfed)break;else _0x13f544['push'](_0x13f544['shift']());}catch(_0x50f892){_0x13f544['push'](_0x13f544['shift']());}}}(a223_0x49b6,0x228e3));function a223_0x49b6(){const _0x1ced41=['18vBgCmQ','6PCNUdF','../../../../','3259FLCiTK','842776eDwZko','230841srzVdL','127790KQnmlV','1109010yjnTpu','2562HILGfI','resolve','1209560KzbsGm','1730wFGQVo'];a223_0x49b6=function(){return _0x1ced41;};return a223_0x49b6();}import a223_0x50790a from'node:path';import{fileURLToPath}from'node:url';const __dirname=a223_0x50790a['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x57d6d5=a223_0x4a12;return a223_0x50790a[_0x57d6d5(0x7f)](__dirname,_0x57d6d5(0x84));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1f8c97,_0x53a8d8){const _0xf5eb70=a224_0x26ed,_0x3f54bf=_0x1f8c97();while(!![]){try{const _0xc686b3=parseInt(_0xf5eb70(0x8b))/0x1*(-parseInt(_0xf5eb70(0x89))/0x2)+parseInt(_0xf5eb70(0x7b))/0x3+-parseInt(_0xf5eb70(0x83))/0x4+parseInt(_0xf5eb70(0x81))/0x5+parseInt(_0xf5eb70(0x7e))/0x6+parseInt(_0xf5eb70(0x87))/0x7*(-parseInt(_0xf5eb70(0x7a))/0x8)+-parseInt(_0xf5eb70(0x80))/0x9;if(_0xc686b3===_0x53a8d8)break;else _0x3f54bf['push'](_0x3f54bf['shift']());}catch(_0x383ceb){_0x3f54bf['push'](_0x3f54bf['shift']());}}}(a224_0x2ca0,0xc366f));import a224_0x5dfe04 from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a224_0x2ca0(){const _0x4cfedd=['421202WRTjUY','copy','3YkujOI','2865736xUHrly','3915291pcwNvC','info','message','1314372GoYSWb','now','2853342DKFBlA','5660940QOQYgv','cwd','762820bFvDJm','Starting\x20project\x20template\x20creation','error','Project\x20template\x20created','14cSGeOC','Failed\x20to\x20copy\x20project\x20template'];a224_0x2ca0=function(){return _0x4cfedd;};return a224_0x2ca0();}import{logger}from'../../../utils/logger.js';import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';function a224_0x26ed(_0x4687d4,_0x1729e8){_0x4687d4=_0x4687d4-0x7a;const _0x2ca090=a224_0x2ca0();let _0x26edc1=_0x2ca090[_0x4687d4];return _0x26edc1;}export async function copyProjectTemplate(_0x342280,_0x5902eb,_0x8b768f){const _0xdea5b0=a224_0x26ed,_0x957cf7=Date[_0xdea5b0(0x7f)](),_0x31f17a=a224_0x5dfe04['resolve'](process[_0xdea5b0(0x82)](),_0x342280);try{logger[_0xdea5b0(0x7c)](_0xdea5b0(0x8a),_0xdea5b0(0x84),{'projectCode':_0x342280});const _0x4779e6=_0x8b768f?await materializeLocalProjectTemplate(_0x8b768f,_0x31f17a,_0x5902eb):await materializeProjectTemplate(_0x31f17a,_0x5902eb),_0x2bfb11=Date[_0xdea5b0(0x7f)]()-_0x957cf7;logger['success'](_0xdea5b0(0x8a),_0xdea5b0(0x86),_0x2bfb11,{'projectCode':_0x342280,'templateSource':_0x4779e6['source'],'templateVersion':_0x4779e6['version']});}catch(_0x3d55af){const _0x3d4ef1=Date['now']()-_0x957cf7;logger[_0xdea5b0(0x85)](_0xdea5b0(0x8a),_0xdea5b0(0x88),{'projectCode':_0x342280,'error':_0x3d55af instanceof Error?_0x3d55af[_0xdea5b0(0x7d)]:String(_0x3d55af),'duration':_0x3d4ef1});throw _0x3d55af;}return formatElapsed(_0x957cf7);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a225_0x299e(_0x273751,_0x5b0e09){_0x273751=_0x273751-0x1b9;const _0x445398=a225_0x4453();let _0x299ed3=_0x445398[_0x273751];return _0x299ed3;}(function(_0x1ae3b4,_0x56a502){const _0x497f49=a225_0x299e,_0x37f39b=_0x1ae3b4();while(!![]){try{const _0x4e0b7e=parseInt(_0x497f49(0x1c6))/0x1+-parseInt(_0x497f49(0x1bd))/0x2*(-parseInt(_0x497f49(0x1c2))/0x3)+-parseInt(_0x497f49(0x1c4))/0x4*(parseInt(_0x497f49(0x1ba))/0x5)+-parseInt(_0x497f49(0x1c8))/0x6+parseInt(_0x497f49(0x1c3))/0x7+parseInt(_0x497f49(0x1b9))/0x8*(parseInt(_0x497f49(0x1bc))/0x9)+-parseInt(_0x497f49(0x1c1))/0xa*(parseInt(_0x497f49(0x1bf))/0xb);if(_0x4e0b7e===_0x56a502)break;else _0x37f39b['push'](_0x37f39b['shift']());}catch(_0x3cb68f){_0x37f39b['push'](_0x37f39b['shift']());}}}(a225_0x4453,0x4c923));function a225_0x4453(){const _0x377d1e=['npx','23720YaWhVS','84090Tlvxkv','format','702sHckri','74110VfnhKw','Code\x20format\x20failed','550iJHYsI','error','201350nzRPVp','27QyhDhC','3369898ilGmxC','36ZpjADu','resolve','512460WjoBkC','--write','521352sbZAPi','cwd','message','now','prettier','Starting\x20code\x20format','success'];a225_0x4453=function(){return _0x377d1e;};return a225_0x4453();}import a225_0x2139a2 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';export async function formatProjectCode(_0x5dcc3b){const _0x45fa87=a225_0x299e,_0x41c284=Date[_0x45fa87(0x1cb)](),_0x197c49=a225_0x2139a2[_0x45fa87(0x1c5)](process[_0x45fa87(0x1c9)](),_0x5dcc3b);try{logger['info']('format',_0x45fa87(0x1cd),{'projectCode':_0x5dcc3b}),await execa(resolveNpmBin(_0x45fa87(0x1cf)),[_0x45fa87(0x1cc),_0x45fa87(0x1c7),'.'],{'cwd':_0x197c49});const _0x4cca4d=Date[_0x45fa87(0x1cb)]()-_0x41c284;logger[_0x45fa87(0x1ce)](_0x45fa87(0x1bb),'Code\x20format\x20completed',_0x4cca4d,{'projectCode':_0x5dcc3b});}catch(_0x3db85f){const _0x43322e=Date[_0x45fa87(0x1cb)]()-_0x41c284;logger[_0x45fa87(0x1c0)](_0x45fa87(0x1bb),_0x45fa87(0x1be),{'projectCode':_0x5dcc3b,'error':_0x3db85f instanceof Error?_0x3db85f[_0x45fa87(0x1ca)]:String(_0x3db85f),'duration':_0x43322e});throw _0x3db85f;}return formatElapsed(_0x41c284);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a226_0x6423(){const _0x2e415e=['message','install','info','3520792ZcYqRK','1534176wgGejn','npm','Dependency\x20install\x20completed','2416lYuVCl','585510bYMNrX','--registry','878420FwNMMz','resolve','125vzQQVB','Starting\x20dependency\x20install','1720928EDvHfy','now','https://registry.npmmirror.com','Dependency\x20install\x20failed','cwd','1305846XzrJMy','success'];a226_0x6423=function(){return _0x2e415e;};return a226_0x6423();}function a226_0x91d6(_0x186493,_0x469685){_0x186493=_0x186493-0x12f;const _0x642303=a226_0x6423();let _0x91d68a=_0x642303[_0x186493];return _0x91d68a;}(function(_0x1fe55a,_0x56cb55){const _0x6fe2d9=a226_0x91d6,_0x1a2006=_0x1fe55a();while(!![]){try{const _0x5af0b3=-parseInt(_0x6fe2d9(0x135))/0x1*(-parseInt(_0x6fe2d9(0x130))/0x2)+parseInt(_0x6fe2d9(0x131))/0x3+parseInt(_0x6fe2d9(0x137))/0x4+parseInt(_0x6fe2d9(0x133))/0x5+-parseInt(_0x6fe2d9(0x13c))/0x6+parseInt(_0x6fe2d9(0x142))/0x7+-parseInt(_0x6fe2d9(0x141))/0x8;if(_0x5af0b3===_0x56cb55)break;else _0x1a2006['push'](_0x1a2006['shift']());}catch(_0x268d05){_0x1a2006['push'](_0x1a2006['shift']());}}}(a226_0x6423,0x7d5ea));import a226_0x477ee1 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';export async function installDependencies(_0x1e9434){const _0x43a373=a226_0x91d6,_0x104f13=Date[_0x43a373(0x138)](),_0xfb151c=a226_0x477ee1[_0x43a373(0x134)](process[_0x43a373(0x13b)](),_0x1e9434);try{logger[_0x43a373(0x140)](_0x43a373(0x13f),_0x43a373(0x136),{'projectCode':_0x1e9434,'registry':_0x43a373(0x139)}),await execa(resolveNpmBin(_0x43a373(0x143)),[_0x43a373(0x13f),_0x43a373(0x132),_0x43a373(0x139)],{'cwd':_0xfb151c});const _0xa2ba06=Date[_0x43a373(0x138)]()-_0x104f13;logger[_0x43a373(0x13d)]('install',_0x43a373(0x12f),_0xa2ba06,{'projectCode':_0x1e9434});}catch(_0x2ac783){const _0x34c17e=Date[_0x43a373(0x138)]()-_0x104f13;logger['error'](_0x43a373(0x13f),_0x43a373(0x13a),{'projectCode':_0x1e9434,'error':_0x2ac783 instanceof Error?_0x2ac783[_0x43a373(0x13e)]:String(_0x2ac783),'duration':_0x34c17e});throw _0x2ac783;}return formatElapsed(_0x104f13);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a227_0x635e44=a227_0x2767;(function(_0x34f5cd,_0x11f063){const _0x1554d2=a227_0x2767,_0xd0628a=_0x34f5cd();while(!![]){try{const _0x554e79=parseInt(_0x1554d2(0x18a))/0x1*(-parseInt(_0x1554d2(0x191))/0x2)+-parseInt(_0x1554d2(0x195))/0x3*(parseInt(_0x1554d2(0x19c))/0x4)+-parseInt(_0x1554d2(0x198))/0x5*(-parseInt(_0x1554d2(0x193))/0x6)+-parseInt(_0x1554d2(0x194))/0x7+parseInt(_0x1554d2(0x192))/0x8*(parseInt(_0x1554d2(0x18f))/0x9)+-parseInt(_0x1554d2(0x18c))/0xa*(parseInt(_0x1554d2(0x199))/0xb)+parseInt(_0x1554d2(0x197))/0xc;if(_0x554e79===_0x11f063)break;else _0xd0628a['push'](_0xd0628a['shift']());}catch(_0xdfc9ac){_0xd0628a['push'](_0xd0628a['shift']());}}}(a227_0x12d5,0xb5947));import{CliErrors}from'../../errors.js';function a227_0x2767(_0x3475c7,_0x3070ae){_0x3475c7=_0x3475c7-0x18a;const _0x12d563=a227_0x12d5();let _0x2767fd=_0x12d563[_0x3475c7];return _0x2767fd;}import{CLI_BIN_NAME}from'../../constant/cli.js';function a227_0x12d5(){const _0x5d8818=['35KlcLRt','1076471mzENHq','Synchronize\x20the\x20current\x20project\x27s\x20public\x20Domain\x20routing','domain-routing-sync','88HKCHbh','262271TMBGVx','read','90AoRfWM','No\x20Rabetbase\x20project\x20configuration\x20was\x20found.','path','18fpWgSW','project','2DjbpCD','4194200RFoqgk','269898EOzLvu','885906hZMwKW','78471fgyIzJ','Domain\x20routing\x20synchronized:\x20','14704224cpSyqf'];a227_0x12d5=function(){return _0x5d8818;};return a227_0x12d5();}import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';export const projectDomainRoutingSyncDefinition={'service':a227_0x635e44(0x190),'command':a227_0x635e44(0x19b),'description':a227_0x635e44(0x19a),'risk':a227_0x635e44(0x18b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(){const _0x37baea=a227_0x635e44,_0x3e626a=findProjectRootDirectory();if(!resolveConfigPath(_0x3e626a))throw CliErrors['validation'](_0x37baea(0x18d),'Run\x20'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>\x20in\x20the\x20project\x20directory\x20first.');const _0x4a44bc=writeProjectDomainRoutingManifest(_0x3e626a);return{'ok':!![],'message':_0x37baea(0x196)+_0x4a44bc[_0x37baea(0x18e)],'data':_0x4a44bc};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a228_0x267043=a228_0x2205;(function(_0x5e58d7,_0x409511){const _0x241cc2=a228_0x2205,_0x3ba35f=_0x5e58d7();while(!![]){try{const _0x2253c0=parseInt(_0x241cc2(0x10e))/0x1+-parseInt(_0x241cc2(0x12a))/0x2+parseInt(_0x241cc2(0x123))/0x3+parseInt(_0x241cc2(0x116))/0x4+parseInt(_0x241cc2(0x113))/0x5*(-parseInt(_0x241cc2(0x12e))/0x6)+parseInt(_0x241cc2(0x117))/0x7*(-parseInt(_0x241cc2(0x121))/0x8)+-parseInt(_0x241cc2(0x10c))/0x9*(-parseInt(_0x241cc2(0x12f))/0xa);if(_0x2253c0===_0x409511)break;else _0x3ba35f['push'](_0x3ba35f['shift']());}catch(_0x10e746){_0x3ba35f['push'](_0x3ba35f['shift']());}}}(a228_0x8301,0x86322));import{CliErrors}from'../../errors.js';function a228_0x8301(){const _0x5bf635=['Target\x20environment','cancelled','2124624fYJpjI','10OLWjqq','env','yes','template-source','Create\x20a\x20new\x20project','Upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure','string','Usage:\x20','Project\x20upgrade\x20completed\x20with\x20follow-up\x20work.','cookie','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]','9792693rokJpI','write','134504eurjIy','nonInteractive','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]\x20or\x20','completed','Project\x20name','10lfvamE','cwd','PATCH','3060344kpfBPb','7vrSoJK','args','boolean','appcode','upgrade','../../commands/project/create/main.js','--current-dir\x20cannot\x20be\x20combined\x20with\x20a\x20project\x20name.','validation','Initialize\x20the\x20current\x20empty\x20directory\x20instead\x20of\x20creating\x20a\x20child\x20directory','current-dir','5792792FjBXQd','Prepared\x20local\x20project\x20template\x20directory','1191195ypwiJJ','bool','Run\x20','str','trim','project','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','805518werLOH','Upgrade\x20cancelled.'];a228_0x8301=function(){return _0x5bf635;};return a228_0x8301();}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';function a228_0x2205(_0x5ad85f,_0x5bf30c){_0x5ad85f=_0x5ad85f-0x103;const _0x8301d=a228_0x8301();let _0x22051d=_0x8301d[_0x5ad85f];return _0x22051d;}const createFlags=[{'name':'name','type':a228_0x267043(0x107),'description':a228_0x267043(0x112)},{'name':a228_0x267043(0x130),'type':a228_0x267043(0x107),'description':a228_0x267043(0x12c)},{'name':a228_0x267043(0x11a),'type':a228_0x267043(0x107),'description':'App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'},{'name':a228_0x267043(0x120),'type':a228_0x267043(0x119),'description':a228_0x267043(0x11f),'default':![]},{'name':a228_0x267043(0x104),'type':a228_0x267043(0x107),'description':a228_0x267043(0x122)}],upgradeFlags=[{'name':'yes','type':a228_0x267043(0x119),'description':'Skip\x20confirmation\x20prompt','default':![]}];export const projectDefinitions=[{'service':a228_0x267043(0x128),'command':'create','description':a228_0x267043(0x105),'risk':a228_0x267043(0x10d),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'project-name','description':a228_0x267043(0x129),'required':![]}],'flags':createFlags,async 'execute'(_0x53ee46){const _0x410de3=a228_0x267043,{createApp:_0x142a90}=await import(_0x410de3(0x11c)),_0x47c78a=_0x53ee46[_0x410de3(0x126)]('name')['trim']()||_0x53ee46[_0x410de3(0x118)][0x0]?.['trim'](),_0x540845=_0x53ee46['str'](_0x410de3(0x130))||undefined,_0x2bb85b=_0x53ee46[_0x410de3(0x126)](_0x410de3(0x11a))||undefined,_0x41db43=_0x53ee46[_0x410de3(0x126)](_0x410de3(0x104))[_0x410de3(0x127)]()||undefined,_0x21277a=_0x53ee46[_0x410de3(0x124)](_0x410de3(0x120));if(_0x21277a&&_0x47c78a)throw CliErrors[_0x410de3(0x11e)](_0x410de3(0x11d),_0x410de3(0x125)+CLI_BIN_NAME+'\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]\x20from\x20the\x20empty\x20target\x20directory.');if(_0x53ee46['nonInteractive']){if(!_0x47c78a&&!_0x21277a)throw CliErrors[_0x410de3(0x11e)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x410de3(0x108)+CLI_BIN_NAME+_0x410de3(0x110)+CLI_BIN_NAME+_0x410de3(0x10b));await _0x142a90({'projectCode':_0x47c78a,'appCode':_0x2bb85b,'env':_0x540845,'cookie':_0x53ee46[_0x410de3(0x10a)],'currentDir':_0x21277a,'nonInteractive':!![],'templateSource':_0x41db43});}else await _0x142a90({'projectCode':_0x47c78a,'appCode':_0x2bb85b,'env':_0x540845,'cookie':_0x53ee46[_0x410de3(0x10a)],'currentDir':_0x21277a,'templateSource':_0x41db43});return{'ok':!![]};}},projectDomainRoutingSyncDefinition,{'service':'project','command':a228_0x267043(0x11b),'description':a228_0x267043(0x106),'risk':a228_0x267043(0x10d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'dryRun'(){const _0xcf931c=a228_0x267043,_0x54e91c=analyseProjectUpgrade(process['cwd']());return{'method':_0xcf931c(0x115),'url':process[_0xcf931c(0x114)](),'body':_0x54e91c,'description':'Would\x20upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure\x20without\x20overwriting\x20project-owned\x20entrypoints'};},async 'execute'(_0x3a228f){const _0x4fc9bb=a228_0x267043,_0x3445c9=await upgradeApp(_0x3a228f[_0x4fc9bb(0x10f)],{'yes':_0x3a228f['bool'](_0x4fc9bb(0x103))});return{'ok':_0x3445c9['completed']||_0x3445c9[_0x4fc9bb(0x12d)]===!![],'message':_0x3445c9[_0x4fc9bb(0x12d)]?_0x4fc9bb(0x12b):_0x3445c9[_0x4fc9bb(0x111)]?'Project\x20upgrade\x20completed.':_0x4fc9bb(0x109),'data':_0x3445c9};}}];
|