@lovrabet/rabetbase-cli 2.5.2-beta.3 → 2.5.2-beta.5
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 +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/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/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/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/auto-sync.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/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.d.ts +0 -8
- 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/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.d.ts +4 -0
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.d.ts +5 -1
- package/lib/config/project-domain-routing.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 +0 -26
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.d.ts +43 -0
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.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.d.ts +6 -5
- 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 +2 -1
- package/skills/rabetbase/SKILL.md +5 -5
- package/skills/rabetbase/guides/custom-page-workflow.md +35 -17
- package/skills/rabetbase/guides/page-development-workflow.md +1 -1
- package/skills/rabetbase/knowledge/components.md +292 -0
- package/skills/rabetbase/knowledge/custom-page/generation-standards.md +74 -4
- package/skills/rabetbase/knowledge/custom-page/page-templates.md +68 -0
- package/skills/rabetbase/references/rabetbase-page-create.md +21 -9
- package/skills/rabetbase/references/rabetbase-page-custom-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-custom-update.md +13 -9
- package/skills/rabetbase/references/rabetbase-project-create.md +5 -2
- package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +2 -2
- package/skills/rabetbase/references/rabetbase-run.md +1 -0
- package/skills/rabetbase.manifest.json +5 -4
- package/templates/README.md +10 -4
- package/templates/custom-pages/blank.json +5 -0
- package/templates/custom-pages/dashboard.json +5 -0
- package/templates/custom-pages/onepage.json +5 -0
- package/templates/generate-api/api.ts.tpl +1 -1
- package/lib/commands/page/custom/template.d.ts +0 -8
- package/lib/commands/page/custom/template.js +0 -1
- package/skills/rabetbase/knowledge/custom-page/components.md +0 -225
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x592ba2,_0x1fcc79){const _0x21e14f=a178_0x4ca2,_0x339f3e=_0x592ba2();while(!![]){try{const _0x807e1f=parseInt(_0x21e14f(0x1b7))/0x1+parseInt(_0x21e14f(0x1ac))/0x2*(-parseInt(_0x21e14f(0x1ad))/0x3)+parseInt(_0x21e14f(0x1b5))/0x4*(-parseInt(_0x21e14f(0x1b6))/0x5)+parseInt(_0x21e14f(0x1ae))/0x6+-parseInt(_0x21e14f(0x1b4))/0x7*(-parseInt(_0x21e14f(0x1bd))/0x8)+-parseInt(_0x21e14f(0x1ba))/0x9+parseInt(_0x21e14f(0x1be))/0xa;if(_0x807e1f===_0x1fcc79)break;else _0x339f3e['push'](_0x339f3e['shift']());}catch(_0x566ccb){_0x339f3e['push'](_0x339f3e['shift']());}}}(a178_0x3dc5,0xaac46));import{existsSync}from'node:fs';import a178_0x433774 from'node:path';import a178_0x36d707 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';function a178_0x4ca2(_0x4cf641,_0xb18e13){_0x4cf641=_0x4cf641-0x1a5;const _0x3dc591=a178_0x3dc5();let _0x4ca2df=_0x3dc591[_0x4cf641];return _0x4ca2df;}import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getProjectNameValidationError}from'../../../commands/project/create/project-name.js';export async function guidedCreateProject(_0x430d21,_0xbfb48c,_0x4c0032){const _0x4d0468=a178_0x4ca2,_0xba5b4f='my-app',_0x11eee9=readConfig(),_0x27ddff=typeof _0x11eee9[_0x4d0468(0x1aa)]===_0x4d0468(0x1c0)?_0x11eee9[_0x4d0468(0x1aa)]:undefined,_0x31aa0f=await input({'message':_0x4d0468(0x1af),'default':_0xba5b4f,'validate':_0x1aedc2=>{const _0x396862=_0x4d0468,_0x3a4710=_0x1aedc2[_0x396862(0x1b1)]()||_0xba5b4f,_0x224918=getProjectNameValidationError(_0x3a4710);if(_0x224918)return _0x224918;const _0x32b67d=a178_0x433774['resolve'](process[_0x396862(0x1b0)](),_0x3a4710);if(existsSync(_0x32b67d))return _0x396862(0x1b3)+_0x3a4710+_0x396862(0x1ab);return!![];}});console[_0x4d0468(0x1b9)](a178_0x36d707[_0x4d0468(0x1a5)](_0x4d0468(0x1a8)+a178_0x36d707[_0x4d0468(0x1b8)](_0x31aa0f)));const _0x11c199=await selectSingleAppcode(_0x4c0032);console[_0x4d0468(0x1b9)](a178_0x36d707[_0x4d0468(0x1a5)](_0x4d0468(0x1bb)+a178_0x36d707[_0x4d0468(0x1b8)](_0x11c199||_0x4d0468(0x1a7))));if(_0x11c199){const _0x1e5327=await getIsSessionValid();if(!_0x1e5327){const _0x72a717=await confirm({'message':_0x4d0468(0x1a9),'default':!![]});if(_0x72a717){const _0x49d85f=await authServer({'silent':!![]});console[_0x4d0468(0x1b9)](a178_0x36d707[_0x4d0468(0x1a5)](_0x4d0468(0x1bc)+a178_0x36d707['cyan'](_0x49d85f?_0x4d0468(0x1a6):_0x4d0468(0x1b2))));}else console[_0x4d0468(0x1b9)](a178_0x36d707[_0x4d0468(0x1a5)](_0x4d0468(0x1bc)+a178_0x36d707[_0x4d0468(0x1b8)]('Skipped')));}await _0x430d21({'projectName':_0x31aa0f,'appCode':_0x11c199,'env':_0xbfb48c||_0x27ddff||_0x4d0468(0x1bf)});}else await _0x430d21({'projectName':_0x31aa0f,'env':_0xbfb48c||_0x27ddff||_0x4d0468(0x1bf)});}function a178_0x3dc5(){const _0xe6c29f=['Directory\x20\x22','7mgfUhO','4YRUCjf','4553815zVIPeq','202508ERwEdc','cyan','log','7143669edxXLx','√\x20App\x20Code:\x20','√\x20Login\x20status:\x20','6888968oiNDxx','16897550xLQkZI','production','string','green','Logged\x20in','Not\x20set','√\x20Project\x20Name:\x20','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','env','\x22\x20already\x20exists','2agOXwv','4029687JhJMXh','5962866BZWKci','Project\x20name:','cwd','trim','Login\x20failed'];a178_0x3dc5=function(){return _0xe6c29f;};return a178_0x3dc5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a179_0x2553(_0x2c0279,_0x4afbb1){_0x2c0279=_0x2c0279-0x1dd;const _0x125be6=a179_0x125b();let _0x25534e=_0x125be6[_0x2c0279];return _0x25534e;}(function(_0x52b682,_0x54b7cd){const _0x3e0967=a179_0x2553,_0x5cd869=_0x52b682();while(!![]){try{const _0x48a27d=parseInt(_0x3e0967(0x1de))/0x1+-parseInt(_0x3e0967(0x1e3))/0x2*(parseInt(_0x3e0967(0x1ea))/0x3)+parseInt(_0x3e0967(0x1eb))/0x4*(-parseInt(_0x3e0967(0x1e6))/0x5)+-parseInt(_0x3e0967(0x1e1))/0x6*(parseInt(_0x3e0967(0x1e7))/0x7)+-parseInt(_0x3e0967(0x1dd))/0x8*(parseInt(_0x3e0967(0x1ec))/0x9)+parseInt(_0x3e0967(0x1e0))/0xa*(-parseInt(_0x3e0967(0x1e5))/0xb)+-parseInt(_0x3e0967(0x1e4))/0xc*(-parseInt(_0x3e0967(0x1e2))/0xd);if(_0x48a27d===_0x54b7cd)break;else _0x5cd869['push'](_0x5cd869['shift']());}catch(_0x5c2eca){_0x5cd869['push'](_0x5cd869['shift']());}}}(a179_0x125b,0x6d7c2));export function formatElapsed(_0x338077){const _0x22308a=a179_0x2553,_0x597c12=Date[_0x22308a(0x1e9)]()-_0x338077;if(_0x597c12<0x3e8)return _0x597c12+'ms';const _0x3df1a2=(_0x597c12/0x3e8)[_0x22308a(0x1df)](0x2),_0x3e88bb=_0x3df1a2[_0x22308a(0x1e8)](/\.?0+$/u,'');return _0x3e88bb+'s';}function a179_0x125b(){const _0x125875=['now','141NqIfNb','28clVyFB','9dcLiOR','2879080qtHLYb','733148eXpeFw','toFixed','890QXtUqt','3194238lwYbnW','7163kSngQd','3046MYZjFA','46392qdRsdZ','97163JtPIKG','474920YVRoKM','7tmmlfW','replace'];a179_0x125b=function(){return _0x125875;};return a179_0x125b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x126e3e,_0x32660b){const _0x1ba9a7=a181_0x5df7,_0x3f7dd7=_0x126e3e();while(!![]){try{const _0x555783=parseInt(_0x1ba9a7(0x118))/0x1*(-parseInt(_0x1ba9a7(0xb9))/0x2)+parseInt(_0x1ba9a7(0xbb))/0x3+parseInt(_0x1ba9a7(0xd2))/0x4*(parseInt(_0x1ba9a7(0xbf))/0x5)+parseInt(_0x1ba9a7(0x117))/0x6+parseInt(_0x1ba9a7(0xdd))/0x7*(parseInt(_0x1ba9a7(0xde))/0x8)+parseInt(_0x1ba9a7(0xfc))/0x9*(parseInt(_0x1ba9a7(0xdc))/0xa)+-parseInt(_0x1ba9a7(0x128))/0xb;if(_0x555783===_0x32660b)break;else _0x3f7dd7['push'](_0x3f7dd7['shift']());}catch(_0x296a4a){_0x3f7dd7['push'](_0x3f7dd7['shift']());}}}(a181_0x22e7,0x3fdb8));import a181_0x24c8a2 from'path';import a181_0x2d24f7 from'fs';import a181_0x151d20 from'chalk';import a181_0x55881e from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{loadRawConfigLayers,writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';function a181_0x5df7(_0x2f1e6d,_0x48ea7c){_0x2f1e6d=_0x2f1e6d-0xb8;const _0x22e755=a181_0x22e7();let _0x5df75c=_0x22e755[_0x2f1e6d];return _0x5df75c;}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{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(_0x954816){const _0x5389b7=a181_0x5df7;try{const _0x42ce9c=a181_0x2d24f7[_0x5389b7(0xf5)](_0x954816);if(!_0x42ce9c[_0x5389b7(0xbe)]())return null;return{'dev':_0x42ce9c['dev'],'ino':_0x42ce9c[_0x5389b7(0xe9)]};}catch{return null;}}function isSameDirectory(_0x28af73,_0x206960){const _0x440f14=a181_0x5df7;return!!_0x28af73&&!!_0x206960&&_0x28af73[_0x440f14(0xfa)]===_0x206960['dev']&&_0x28af73[_0x440f14(0xe9)]===_0x206960['ino'];}function commitCurrentDirectoryProject(_0x33bd7f,_0x5ce66e,_0x16a6cf){const _0xa4a448=a181_0x5df7;if(!isSameDirectory(readDirectoryIdentity(_0x33bd7f),_0x16a6cf))throw new Error(_0xa4a448(0x12d));const _0x4ab500=a181_0x24c8a2['basename'](_0x5ce66e),_0x3f0ddc=a181_0x2d24f7['readdirSync'](_0x33bd7f);if(_0x3f0ddc['length']!==0x1||_0x3f0ddc[0x0]!==_0x4ab500)throw CliErrors[_0xa4a448(0xe2)](_0xa4a448(0xc7),'Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.');const _0x20b744=a181_0x24c8a2['join'](_0x5ce66e,_0xa4a448(0x11d)),_0x23cf91=[];try{for(const _0x5938c3 of a181_0x2d24f7['readdirSync'](_0x20b744)){a181_0x2d24f7[_0xa4a448(0xba)](a181_0x24c8a2[_0xa4a448(0xf7)](_0x20b744,_0x5938c3),a181_0x24c8a2['join'](_0x33bd7f,_0x5938c3)),_0x23cf91['push'](_0x5938c3);}a181_0x2d24f7[_0xa4a448(0xf2)](_0x5ce66e,{'recursive':!![],'force':!![]});}catch(_0x247754){for(const _0x28ab2c of _0x23cf91[_0xa4a448(0x11a)]()){const _0x5a386f=a181_0x24c8a2['join'](_0x33bd7f,_0x28ab2c);if(!a181_0x2d24f7[_0xa4a448(0xd4)](_0x5a386f))continue;a181_0x2d24f7[_0xa4a448(0xba)](_0x5a386f,a181_0x24c8a2['join'](_0x20b744,_0x28ab2c));}throw _0x247754;}}export async function createApp(_0xffb395){const _0x4e1d4a=a181_0x5df7,_0x4e698a=await checkCliVersion();(_0x4e698a[_0x4e1d4a(0xea)]||_0x4e698a[_0x4e1d4a(0x113)])&&(printCliUpgradeWarning(_0x4e698a),assertCliVersionSupported(_0x4e698a),logger[_0x4e1d4a(0x11e)](_0x4e1d4a(0xed),_0x4e1d4a(0x104),{'currentVersion':_0x4e698a[_0x4e1d4a(0xef)],'stableVersion':_0x4e698a['stableVersion'],'minimumVersion':_0x4e698a[_0x4e1d4a(0xdb)],'needsUpgrade':_0x4e698a[_0x4e1d4a(0xea)],'belowMinimum':_0x4e698a['belowMinimum']}));const _0x309c3f=_0xffb395[_0x4e1d4a(0x130)]?a181_0x24c8a2[_0x4e1d4a(0x108)](process[_0x4e1d4a(0x110)]()):_0xffb395['projectCode'];if(_0x309c3f&&(_0xffb395[_0x4e1d4a(0xb8)]||_0xffb395[_0x4e1d4a(0x119)]))await runCreate({'projectName':_0x309c3f,'appCode':_0xffb395[_0x4e1d4a(0xb8)],'env':_0xffb395[_0x4e1d4a(0x106)]},_0xffb395);else{if(_0x309c3f){const _0x54187c=await selectSingleAppcode(_0xffb395[_0x4e1d4a(0x100)]);await runCreate({'projectName':_0x309c3f,'appCode':_0x54187c||undefined,'env':_0xffb395['env']},_0xffb395);}else await guidedCreateProject(_0x337c61=>runCreate(_0x337c61,_0xffb395),_0xffb395[_0x4e1d4a(0x106)],_0xffb395[_0x4e1d4a(0x100)]);}}async function runCreate(_0x30e4e7,_0xe0a441){const _0x2c1419=a181_0x5df7;_0x30e4e7['projectName']=validateProjectName(_0x30e4e7['projectName']);const _0x2c5812=_0xe0a441[_0x2c1419(0x130)]?process[_0x2c1419(0x110)]():a181_0x24c8a2[_0x2c1419(0x107)](process['cwd'](),_0x30e4e7[_0x2c1419(0x105)]);if(_0xe0a441['currentDir']){if(a181_0x2d24f7[_0x2c1419(0x109)](_0x2c5812)[_0x2c1419(0xc3)]>0x0)throw CliErrors[_0x2c1419(0xe2)](_0x2c1419(0xeb),_0x2c1419(0xe3));}else{if(a181_0x2d24f7[_0x2c1419(0xd4)](_0x2c5812))throw new Error(_0x2c1419(0x126)+_0x30e4e7[_0x2c1419(0x105)]+'\x20already\x20exists');}let _0x594fc7=null;const _0x55e580=_0xe0a441[_0x2c1419(0x130)]?readDirectoryIdentity(_0x2c5812):null;let _0x5c9531=null;try{a181_0x2d24f7['accessSync'](a181_0x24c8a2[_0x2c1419(0xc9)](_0x2c5812),a181_0x2d24f7[_0x2c1419(0xc2)]['W_OK']);}catch{throw new Error(_0x2c1419(0x103));}logger['info'](_0x2c1419(0xed),_0x2c1419(0xe5)+_0x30e4e7['projectName'],{'projectDir':_0x2c5812,'appCode':_0x30e4e7['appCode']}),console['log'](),console[_0x2c1419(0xbc)](a181_0x151d20['green'](_0x2c1419(0xcb))+_0x2c1419(0xcf)+a181_0x151d20[_0x2c1419(0xd1)](_0x30e4e7['projectName'])+(_0x30e4e7[_0x2c1419(0xb8)]?_0x2c1419(0xe4)+a181_0x151d20['cyan'](_0x30e4e7[_0x2c1419(0xb8)]):''));try{let _0x4e1dd6=_0x30e4e7[_0x2c1419(0x105)];_0xe0a441['currentDir']&&(_0x5c9531=a181_0x2d24f7['mkdtempSync'](a181_0x24c8a2[_0x2c1419(0xf7)](_0x2c5812,_0x2c1419(0x129))),_0x4e1dd6=a181_0x24c8a2[_0x2c1419(0x121)](process[_0x2c1419(0x110)](),a181_0x24c8a2[_0x2c1419(0xf7)](_0x5c9531,_0x2c1419(0x11d))));const _0x36345a=a181_0x24c8a2[_0x2c1419(0x107)](process[_0x2c1419(0x110)](),_0x4e1dd6);await runTask(_0x2c1419(0x12a),_0x13b239=>copyProjectTemplate(_0x4e1dd6,_0x2c9cca=>_0x13b239(projectTemplateStageLabel(_0x2c9cca)),_0xe0a441[_0x2c1419(0xda)]),_0x2c1419(0xfe)),_0x594fc7=_0xe0a441[_0x2c1419(0x130)]?null:readDirectoryIdentity(_0x2c5812);if(!_0xe0a441['currentDir']&&!_0x594fc7)throw new Error(_0x2c1419(0x125));await updatePackageJsonName(_0x4e1dd6,_0x30e4e7[_0x2c1419(0x105)]),await runTask(_0x2c1419(0x123),()=>installDependencies(_0x4e1dd6)),await runTask('Format\x20code',()=>formatProjectCode(_0x4e1dd6)),await configureAppCode(_0x4e1dd6,_0x30e4e7['projectName'],_0x30e4e7[_0x2c1419(0xb8)]||'',_0x30e4e7[_0x2c1419(0x106)]);let _0xee0b3f=![];if(_0x30e4e7[_0x2c1419(0xb8)]){console[_0x2c1419(0xbc)](_0x2c1419(0xca));const _0x540658=process[_0x2c1419(0x110)]();try{process[_0x2c1419(0xe7)](_0x36345a);const _0xc1696=_0x30e4e7[_0x2c1419(0x106)]||_0x2c1419(0xe6);initEnv(_0xc1696);const {configArray:_0x55df5f}=await fetchModelList(_0x30e4e7[_0x2c1419(0xb8)],_0xe0a441[_0x2c1419(0x100)]||''),_0x12bfa0=DEFAULT_API_DIR,_0x4e34f6=await generateApiFile(_0x55df5f,'',_0x30e4e7[_0x2c1419(0xb8)],!![],_0xc1696,_0x12bfa0,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![]});console[_0x2c1419(0xbc)](_0x2c1419(0xce)+_0x55df5f[_0x2c1419(0xc3)]+_0x2c1419(0x12c)+_0x4e34f6[_0x2c1419(0x116)]+_0x2c1419(0xbd)),logger[_0x2c1419(0x11e)](_0x2c1419(0xed),'API\x20configuration\x20pulled:\x20'+_0x30e4e7[_0x2c1419(0xb8)]);}catch(_0x4b912f){_0xee0b3f=!![],console[_0x2c1419(0xbc)](_0x2c1419(0xe1)+CLI_BIN_NAME+_0x2c1419(0xec)),logger[_0x2c1419(0x10c)]('create',_0x2c1419(0x120),{'error':_0x4b912f instanceof Error?_0x4b912f[_0x2c1419(0x112)]:String(_0x4b912f)});}finally{process[_0x2c1419(0xe7)](_0x540658);}}if(_0xe0a441['currentDir']){if(!_0x5c9531||!_0x55e580)throw new Error(_0x2c1419(0xd8));commitCurrentDirectoryProject(_0x2c5812,_0x5c9531,_0x55e580),_0x5c9531=null;}try{logger[_0x2c1419(0xff)](_0x2c5812),logger[_0x2c1419(0xd9)](_0x2c1419(0xed),'Project\x20created:\x20'+_0x30e4e7[_0x2c1419(0x105)]);}catch(_0x5b4f3b){console[_0x2c1419(0x10c)](_0x2c1419(0xf9)+(_0x5b4f3b instanceof Error?_0x5b4f3b[_0x2c1419(0x112)]:String(_0x5b4f3b)));}console[_0x2c1419(0xbc)](),console['log'](a181_0x151d20['green']('─'[_0x2c1419(0x115)](0x3c))),console['log'](a181_0x151d20[_0x2c1419(0x10e)][_0x2c1419(0xf1)](_0x2c1419(0x11b))),console[_0x2c1419(0xbc)]();const _0x175d98=_0xe0a441['currentDir']?CLI_BIN_NAME+'\x20run\x20start':_0x2c1419(0xdf)+_0x30e4e7[_0x2c1419(0x105)]+_0x2c1419(0xf0)+CLI_BIN_NAME+'\x20run\x20start';console[_0x2c1419(0xbc)](_0x2c1419(0xc6)+a181_0x151d20[_0x2c1419(0x10e)]['bold'](_0x175d98)),_0xee0b3f&&console[_0x2c1419(0xbc)](_0x2c1419(0x127)+a181_0x151d20[_0x2c1419(0x10e)][_0x2c1419(0xf1)](CLI_BIN_NAME+'\x20api\x20pull\x20--force\x20--yes')),console['log'](a181_0x151d20[_0x2c1419(0xd1)]('─'[_0x2c1419(0x115)](0x3c)));}catch(_0x276d81){logger[_0x2c1419(0x12e)](_0x2c1419(0xed),'Project\x20creation\x20failed:\x20'+_0x30e4e7[_0x2c1419(0x105)],{'error':_0x276d81 instanceof Error?_0x276d81[_0x2c1419(0x112)]:String(_0x276d81)});try{const _0x2c2c7c=readDirectoryIdentity(_0x2c5812);if(_0xe0a441['currentDir']&&_0x5c9531)a181_0x2d24f7[_0x2c1419(0xf2)](_0x5c9531,{'recursive':!![],'force':!![]});else{if(_0x594fc7&&_0x2c2c7c?.['dev']===_0x594fc7[_0x2c1419(0xfa)]&&_0x2c2c7c['ino']===_0x594fc7[_0x2c1419(0xe9)])console['log'](_0x2c1419(0x11c)+_0x2c5812),a181_0x2d24f7[_0x2c1419(0xf2)](_0x2c5812,{'recursive':!![],'force':!![]});else _0x2c2c7c&&logger[_0x2c1419(0x10c)](_0x2c1419(0xed),'Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20'+_0x2c5812);}}catch{logger[_0x2c1419(0x10c)]('create',_0x2c1419(0xfd)+_0x2c5812);}throw _0x276d81;}}async function runTask(_0x3502db,_0x361322,_0x27ddce=_0x3502db){const _0x4979f1=a181_0x5df7,_0x41576a=a181_0x55881e(_0x3502db+'...')[_0x4979f1(0x122)]();try{const _0x4b0432=await _0x361322(_0x4625b5=>{_0x41576a['text']=_0x4625b5+'...';});_0x41576a[_0x4979f1(0xe0)](),console[_0x4979f1(0xbc)](''+a181_0x151d20[_0x4979f1(0xd1)](_0x4979f1(0xcb))+_0x27ddce+'\x20'+a181_0x151d20[_0x4979f1(0x10b)]('['+_0x4b0432+']'));}catch(_0x2fa798){_0x41576a[_0x4979f1(0xd7)](_0x3502db);throw _0x2fa798;}}function a181_0x22e7(){const _0x58ca08=['√\x20Configuration\x20file\x20created,\x20Apps:\x20','dirname','*\x20Pulling\x20API\x20configuration...','\x20√\x20','√\x20package.json\x20updated:\x20name=','name','√\x20Pulled\x20','Project\x20name:\x20','stringify','green','372irgQlz','readFileSync','existsSync','Configured\x20app\x20AppCode:\x20','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','fail','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','success','templateSource','minimumVersion','10DiMxGU','24493VoRczf','1176USseaQ','cd\x20','stop','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','validation','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','\x20|\x20AppCode:\x20','Starting\x20project\x20creation:\x20','production','chdir','parse','ino','needsUpgrade','The\x20current\x20directory\x20must\x20be\x20empty.','\x20api\x20pull\x20--force\x20--yes','create','extracting','currentVersion','\x20&&\x20','bold','rmSync','Failed\x20to\x20configure\x20app\x20AppCode','Updating\x20package.json\x20name','lstatSync','*\x20Configuring\x20AppCode\x20for\x20project\x20','join','Failed\x20to\x20update\x20package.json','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','dev','copying','1369107oOGDPg','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','Project\x20template\x20ready','setLogPath','cookie','utf8','1.0.0','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','CLI\x20version\x20check','projectName','env','resolve','basename','readdirSync','\x20config\x20set\x20appcode\x20<app-code>\x27','gray','warn','\x20Generated\x20by\x20rabetbase\x20cli\x20','cyan','resolving','cwd','Extracting\x20project\x20template','message','belowMinimum','version','repeat','modelCount','18078LmukIo','109eAGnpZ','nonInteractive','reverse','🚀\x20Next\x20Steps:','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','project','info','string','API\x20configuration\x20pull\x20failed','relative','start','Install\x20dependencies','package.json','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','Project\x20directory\x20','\x20\x202.\x20Pull\x20API\x20configuration:\x20','8247184dSbQZD','.rabetbase-create-','Resolving\x20project\x20template','Copying\x20local\x20template\x20source','\x20dataset(s),\x20generated\x20','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','error','verifying','currentDir','appCode','8922xXNcEk','renameSync','1062966cUsrOy','log','\x20model(s)','isDirectory','25470pTPMoj','downloading','\x20|\x20Default:\x20implicit\x20(single\x20app)','constants','length','apps','Verifying\x20project\x20template','\x20\x201.\x20Start\x20project:\x20','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.'];a181_0x22e7=function(){return _0x58ca08;};return a181_0x22e7();}function projectTemplateStageLabel(_0x52f70a){const _0x37e872=a181_0x5df7;switch(_0x52f70a){case _0x37e872(0x10f):return _0x37e872(0x12a);case _0x37e872(0xc0):return'Downloading\x20project\x20template';case _0x37e872(0x12f):return _0x37e872(0xc5);case _0x37e872(0xee):return _0x37e872(0x111);case _0x37e872(0xfb):return _0x37e872(0x12b);}}async function updatePackageJsonName(_0x249c45,_0x101fdb){const _0x5177f9=a181_0x5df7,_0x13f540=a181_0x24c8a2[_0x5177f9(0x107)](process[_0x5177f9(0x110)](),_0x249c45),_0x882daf=a181_0x24c8a2[_0x5177f9(0xf7)](_0x13f540,_0x5177f9(0x124));try{console['log'](_0x5177f9(0xd6));const _0x15979e=getRabetbaseCliPackageRoot(),_0x4ffee2=a181_0x24c8a2['join'](_0x15979e,_0x5177f9(0x124));let _0x1d326b=_0x5177f9(0x102);try{const _0x14fb1e=JSON[_0x5177f9(0xe8)](a181_0x2d24f7['readFileSync'](_0x4ffee2,_0x5177f9(0x101)));_0x1d326b=_0x14fb1e[_0x5177f9(0x114)]||_0x5177f9(0x102);}catch{}const _0x4a1641=a181_0x2d24f7[_0x5177f9(0xd3)](_0x882daf,_0x5177f9(0x101)),_0x4a9a8f=JSON[_0x5177f9(0xe8)](_0x4a1641);_0x4a9a8f[_0x5177f9(0xcd)]=_0x101fdb,_0x4a9a8f['description']=_0x101fdb+_0x5177f9(0x10d)+_0x1d326b,a181_0x2d24f7['writeFileSync'](_0x882daf,JSON[_0x5177f9(0xd0)](_0x4a9a8f,null,0x2)+'\x0a',_0x5177f9(0x101)),console[_0x5177f9(0xbc)](_0x5177f9(0xcc)+_0x101fdb),logger[_0x5177f9(0x11e)](_0x5177f9(0xed),_0x5177f9(0xf4));}catch(_0x54de4){logger['error']('create',_0x5177f9(0xf8));throw _0x54de4;}}async function configureAppCode(_0x9ec1a4,_0x5d6088,_0x2dff7f,_0x19e01d){const _0x2a64b4=a181_0x5df7,_0x232174=a181_0x24c8a2['resolve'](process[_0x2a64b4(0x110)](),_0x9ec1a4),_0x26a357=a181_0x24c8a2['join'](_0x232174,NEW_CONFIG_NAME);try{_0x2dff7f?console[_0x2a64b4(0xbc)](_0x2a64b4(0xf6)+_0x5d6088+':\x20'+_0x2dff7f):console[_0x2a64b4(0xbc)]('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x5d6088);const _0x229e2d=getRabetbaseCliPackageRoot(),_0x5e559e=a181_0x24c8a2[_0x2a64b4(0xf7)](_0x229e2d,'package.json');let _0x6f32b9=_0x2a64b4(0x102);try{const _0x35cd8f=JSON['parse'](a181_0x2d24f7[_0x2a64b4(0xd3)](_0x5e559e,_0x2a64b4(0x101)));_0x6f32b9=_0x35cd8f[_0x2a64b4(0x114)]||'1.0.0';}catch{}const {globalConfig:_0x15f2d0}=loadRawConfigLayers(),_0x271014=typeof _0x15f2d0[_0x2a64b4(0x106)]===_0x2a64b4(0x11f)?_0x15f2d0[_0x2a64b4(0x106)]:undefined,_0x37eacb={};for(const _0x5e9cdd of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x15f2d0[_0x5e9cdd]!=null)_0x37eacb[_0x5e9cdd]=_0x15f2d0[_0x5e9cdd];}const _0x496de0=buildCanonicalProjectConfig(_0x37eacb,{'appCodes':_0x2dff7f?[_0x2dff7f]:[],'env':_0x19e01d||_0x271014||_0x2a64b4(0xe6),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x6f32b9}});writeConfigFile(_0x26a357,_0x496de0),await generateSdkConfigFile(a181_0x24c8a2[_0x2a64b4(0xf7)](_0x232174,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x232174),_0x2dff7f?console['log'](_0x2a64b4(0xc8)+Object['keys'](_0x496de0[_0x2a64b4(0xc4)]||{})[_0x2a64b4(0xf7)](',\x20')+_0x2a64b4(0xc1)):console[_0x2a64b4(0xbc)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x2a64b4(0x10a)),logger[_0x2a64b4(0x11e)](_0x2a64b4(0xed),_0x2a64b4(0xd5)+_0x2dff7f);}catch(_0x540acb){logger[_0x2a64b4(0x12e)]('create',_0x2a64b4(0xf3));throw _0x540acb;}}
|
|
1
|
+
(function(_0x2874c7,_0x2cd943){const _0x94afb8=a180_0x3ebd,_0x476f4d=_0x2874c7();while(!![]){try{const _0x664ff7=parseInt(_0x94afb8(0x1e9))/0x1*(parseInt(_0x94afb8(0x217))/0x2)+-parseInt(_0x94afb8(0x1fd))/0x3+parseInt(_0x94afb8(0x219))/0x4*(-parseInt(_0x94afb8(0x1ce))/0x5)+-parseInt(_0x94afb8(0x21a))/0x6+parseInt(_0x94afb8(0x21d))/0x7*(-parseInt(_0x94afb8(0x1f9))/0x8)+-parseInt(_0x94afb8(0x1cb))/0x9*(parseInt(_0x94afb8(0x1cc))/0xa)+parseInt(_0x94afb8(0x1c5))/0xb*(parseInt(_0x94afb8(0x1d8))/0xc);if(_0x664ff7===_0x2cd943)break;else _0x476f4d['push'](_0x476f4d['shift']());}catch(_0x5a3971){_0x476f4d['push'](_0x476f4d['shift']());}}}(a180_0x2bda,0xb406f));function a180_0x3ebd(_0x531014,_0x5e159a){_0x531014=_0x531014-0x1c1;const _0x2bda22=a180_0x2bda();let _0x3ebd03=_0x2bda22[_0x531014];return _0x3ebd03;}import a180_0x4e7068 from'path';import a180_0x1c4ae1 from'fs';import a180_0x3b6d22 from'chalk';import a180_0x1f66fc 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{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(_0x16641d){const _0x4bf5b7=a180_0x3ebd;try{const _0x319f23=a180_0x1c4ae1[_0x4bf5b7(0x1fa)](_0x16641d);if(!_0x319f23[_0x4bf5b7(0x1f8)]())return null;return{'dev':_0x319f23[_0x4bf5b7(0x1f5)],'ino':_0x319f23[_0x4bf5b7(0x1ff)]};}catch{return null;}}function isSameDirectory(_0x2b9fbb,_0x16768e){const _0x35819c=a180_0x3ebd;return!!_0x2b9fbb&&!!_0x16768e&&_0x2b9fbb[_0x35819c(0x1f5)]===_0x16768e[_0x35819c(0x1f5)]&&_0x2b9fbb['ino']===_0x16768e['ino'];}function commitCurrentDirectoryProject(_0x296559,_0x2102ec,_0x5d7247){const _0x18a2f8=a180_0x3ebd;if(!isSameDirectory(readDirectoryIdentity(_0x296559),_0x5d7247))throw new Error(_0x18a2f8(0x1f4));const _0x583e74=a180_0x4e7068[_0x18a2f8(0x212)](_0x2102ec),_0x3a6ea9=a180_0x1c4ae1[_0x18a2f8(0x20a)](_0x296559);if(_0x3a6ea9[_0x18a2f8(0x1e3)]!==0x1||_0x3a6ea9[0x0]!==_0x583e74)throw CliErrors[_0x18a2f8(0x1c9)](_0x18a2f8(0x225),_0x18a2f8(0x21b));const _0xd265e5=a180_0x4e7068[_0x18a2f8(0x1fc)](_0x2102ec,_0x18a2f8(0x1e6)),_0x1a0ffd=[];try{for(const _0x579cbc of a180_0x1c4ae1['readdirSync'](_0xd265e5)){a180_0x1c4ae1[_0x18a2f8(0x1c8)](a180_0x4e7068[_0x18a2f8(0x1fc)](_0xd265e5,_0x579cbc),a180_0x4e7068[_0x18a2f8(0x1fc)](_0x296559,_0x579cbc)),_0x1a0ffd[_0x18a2f8(0x22c)](_0x579cbc);}a180_0x1c4ae1[_0x18a2f8(0x207)](_0x2102ec,{'recursive':!![],'force':!![]});}catch(_0x35c2ef){for(const _0x14e09f of _0x1a0ffd[_0x18a2f8(0x1cf)]()){const _0x5c3049=a180_0x4e7068[_0x18a2f8(0x1fc)](_0x296559,_0x14e09f);if(!a180_0x1c4ae1[_0x18a2f8(0x22d)](_0x5c3049))continue;a180_0x1c4ae1[_0x18a2f8(0x1c8)](_0x5c3049,a180_0x4e7068[_0x18a2f8(0x1fc)](_0xd265e5,_0x14e09f));}throw _0x35c2ef;}}export async function createApp(_0x20f317){const _0x22eca7=a180_0x3ebd,_0x149677=await checkCliVersion();(_0x149677[_0x22eca7(0x22e)]||_0x149677[_0x22eca7(0x203)])&&(printCliUpgradeWarning(_0x149677),assertCliVersionSupported(_0x149677),logger['info'](_0x22eca7(0x21e),_0x22eca7(0x1c6),{'currentVersion':_0x149677[_0x22eca7(0x218)],'stableVersion':_0x149677[_0x22eca7(0x216)],'minimumVersion':_0x149677[_0x22eca7(0x20c)],'needsUpgrade':_0x149677['needsUpgrade'],'belowMinimum':_0x149677[_0x22eca7(0x203)]}));const _0x13ca7a=_0x20f317['currentDir']?a180_0x4e7068[_0x22eca7(0x212)](process[_0x22eca7(0x1f0)]()):_0x20f317[_0x22eca7(0x1d0)];if(_0x13ca7a&&(_0x20f317['appCode']||_0x20f317[_0x22eca7(0x205)]))await runCreate({'projectName':_0x13ca7a,'appCode':_0x20f317[_0x22eca7(0x233)],'env':_0x20f317[_0x22eca7(0x20b)]},_0x20f317);else{if(_0x13ca7a){const _0x4cd97c=await selectSingleAppcode(_0x20f317[_0x22eca7(0x1e4)]);await runCreate({'projectName':_0x13ca7a,'appCode':_0x4cd97c||undefined,'env':_0x20f317[_0x22eca7(0x20b)]},_0x20f317);}else await guidedCreateProject(_0x5e6f78=>runCreate(_0x5e6f78,_0x20f317),_0x20f317[_0x22eca7(0x20b)],_0x20f317[_0x22eca7(0x1e4)]);}}async function runCreate(_0x4a3281,_0x118099){const _0x39b251=a180_0x3ebd;_0x4a3281[_0x39b251(0x20e)]=validateProjectName(_0x4a3281['projectName']);const _0x1fa7ae=_0x118099['currentDir']?process[_0x39b251(0x1f0)]():a180_0x4e7068['resolve'](process[_0x39b251(0x1f0)](),_0x4a3281[_0x39b251(0x20e)]);if(_0x118099[_0x39b251(0x1f3)]){if(a180_0x1c4ae1[_0x39b251(0x20a)](_0x1fa7ae)[_0x39b251(0x1e3)]>0x0)throw CliErrors[_0x39b251(0x1c9)]('The\x20current\x20directory\x20must\x20be\x20empty.',_0x39b251(0x204));}else{if(a180_0x1c4ae1['existsSync'](_0x1fa7ae))throw new Error(_0x39b251(0x1dc)+_0x4a3281[_0x39b251(0x20e)]+_0x39b251(0x1f1));}let _0x2e4a46=null;const _0x223189=_0x118099[_0x39b251(0x1f3)]?readDirectoryIdentity(_0x1fa7ae):null;let _0xca87b6=null;try{a180_0x1c4ae1[_0x39b251(0x22f)](a180_0x4e7068['dirname'](_0x1fa7ae),a180_0x1c4ae1['constants'][_0x39b251(0x21c)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger['info']('create','Starting\x20project\x20creation:\x20'+_0x4a3281[_0x39b251(0x20e)],{'projectDir':_0x1fa7ae,'appCode':_0x4a3281[_0x39b251(0x233)]}),console[_0x39b251(0x1e5)](),console[_0x39b251(0x1e5)](a180_0x3b6d22[_0x39b251(0x1e7)](_0x39b251(0x20d))+'Project\x20name:\x20'+a180_0x3b6d22[_0x39b251(0x1e7)](_0x4a3281['projectName'])+(_0x4a3281[_0x39b251(0x233)]?_0x39b251(0x1d7)+a180_0x3b6d22[_0x39b251(0x1d3)](_0x4a3281[_0x39b251(0x233)]):''));try{let _0x47250e=_0x4a3281[_0x39b251(0x20e)];_0x118099[_0x39b251(0x1f3)]&&(_0xca87b6=a180_0x1c4ae1['mkdtempSync'](a180_0x4e7068['join'](_0x1fa7ae,_0x39b251(0x1e2))),_0x47250e=a180_0x4e7068[_0x39b251(0x1da)](process[_0x39b251(0x1f0)](),a180_0x4e7068[_0x39b251(0x1fc)](_0xca87b6,_0x39b251(0x1e6))));const _0x184828=a180_0x4e7068[_0x39b251(0x1fb)](process['cwd'](),_0x47250e);await runTask(_0x39b251(0x1ea),_0x1652c9=>copyProjectTemplate(_0x47250e,_0x34155d=>_0x1652c9(projectTemplateStageLabel(_0x34155d)),_0x118099['templateSource']),_0x39b251(0x1ca)),_0x2e4a46=_0x118099['currentDir']?null:readDirectoryIdentity(_0x1fa7ae);if(!_0x118099[_0x39b251(0x1f3)]&&!_0x2e4a46)throw new Error('Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory');await updatePackageJsonName(_0x47250e,_0x4a3281['projectName']),await runTask('Install\x20dependencies',()=>installDependencies(_0x47250e)),await runTask(_0x39b251(0x211),()=>formatProjectCode(_0x47250e)),await configureAppCode(_0x47250e,_0x4a3281[_0x39b251(0x20e)],_0x4a3281['appCode']||'',_0x4a3281[_0x39b251(0x20b)]);let _0x20772f=![];if(_0x4a3281[_0x39b251(0x233)]){console[_0x39b251(0x1e5)]('*\x20Pulling\x20API\x20configuration...');const _0x6fd091=process[_0x39b251(0x1f0)]();try{process[_0x39b251(0x1f7)](_0x184828);const _0x49e42f=_0x4a3281['env']||_0x39b251(0x1fe);initEnv(_0x49e42f);const {configArray:_0x49f399}=await fetchModelList(_0x4a3281[_0x39b251(0x233)],_0x118099[_0x39b251(0x1e4)]||''),_0x206ce1=DEFAULT_API_DIR,_0x1de2d3=await generateApiFile(_0x49f399,'',_0x4a3281[_0x39b251(0x233)],!![],_0x49e42f,_0x206ce1,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![]});console[_0x39b251(0x1e5)](_0x39b251(0x1c2)+_0x49f399[_0x39b251(0x1e3)]+_0x39b251(0x20f)+_0x1de2d3[_0x39b251(0x227)]+'\x20model(s)'),logger['info'](_0x39b251(0x21e),'API\x20configuration\x20pulled:\x20'+_0x4a3281[_0x39b251(0x233)]);}catch(_0x2352ae){_0x20772f=!![],console[_0x39b251(0x1e5)]('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20'+CLI_BIN_NAME+_0x39b251(0x1d4)),logger[_0x39b251(0x22a)](_0x39b251(0x21e),_0x39b251(0x201),{'error':_0x2352ae instanceof Error?_0x2352ae[_0x39b251(0x208)]:String(_0x2352ae)});}finally{process[_0x39b251(0x1f7)](_0x6fd091);}}if(_0x118099[_0x39b251(0x1f3)]){if(!_0xca87b6||!_0x223189)throw new Error(_0x39b251(0x1e0));commitCurrentDirectoryProject(_0x1fa7ae,_0xca87b6,_0x223189),_0xca87b6=null;}try{logger['setLogPath'](_0x1fa7ae),logger[_0x39b251(0x1ed)]('create',_0x39b251(0x228)+_0x4a3281[_0x39b251(0x20e)]);}catch(_0xdd15f1){console[_0x39b251(0x22a)](_0x39b251(0x206)+(_0xdd15f1 instanceof Error?_0xdd15f1['message']:String(_0xdd15f1)));}console[_0x39b251(0x1e5)](),console['log'](a180_0x3b6d22[_0x39b251(0x1e7)]('─'['repeat'](0x3c))),console[_0x39b251(0x1e5)](a180_0x3b6d22[_0x39b251(0x1d3)][_0x39b251(0x224)](_0x39b251(0x1d2))),console['log']();const _0x356e6a=_0x118099[_0x39b251(0x1f3)]?CLI_BIN_NAME+'\x20run\x20start':_0x39b251(0x223)+_0x4a3281[_0x39b251(0x20e)]+_0x39b251(0x22b)+CLI_BIN_NAME+_0x39b251(0x221);console[_0x39b251(0x1e5)]('\x20\x201.\x20Start\x20project:\x20'+a180_0x3b6d22[_0x39b251(0x1d3)]['bold'](_0x356e6a)),_0x20772f&&console[_0x39b251(0x1e5)](_0x39b251(0x1dd)+a180_0x3b6d22[_0x39b251(0x1d3)][_0x39b251(0x224)](CLI_BIN_NAME+_0x39b251(0x1d4))),console[_0x39b251(0x1e5)](a180_0x3b6d22['green']('─'[_0x39b251(0x1ee)](0x3c)));}catch(_0x28fa5c){logger[_0x39b251(0x1c4)](_0x39b251(0x21e),_0x39b251(0x231)+_0x4a3281['projectName'],{'error':_0x28fa5c instanceof Error?_0x28fa5c[_0x39b251(0x208)]:String(_0x28fa5c)});try{const _0x51ab7c=readDirectoryIdentity(_0x1fa7ae);if(_0x118099[_0x39b251(0x1f3)]&&_0xca87b6)a180_0x1c4ae1[_0x39b251(0x207)](_0xca87b6,{'recursive':!![],'force':!![]});else{if(_0x2e4a46&&_0x51ab7c?.[_0x39b251(0x1f5)]===_0x2e4a46[_0x39b251(0x1f5)]&&_0x51ab7c[_0x39b251(0x1ff)]===_0x2e4a46[_0x39b251(0x1ff)])console[_0x39b251(0x1e5)](_0x39b251(0x1c3)+_0x1fa7ae),a180_0x1c4ae1[_0x39b251(0x207)](_0x1fa7ae,{'recursive':!![],'force':!![]});else _0x51ab7c&&logger[_0x39b251(0x22a)](_0x39b251(0x21e),_0x39b251(0x210)+_0x1fa7ae);}}catch{logger['warn'](_0x39b251(0x21e),_0x39b251(0x222)+_0x1fa7ae);}throw _0x28fa5c;}}function a180_0x2bda(){const _0x267b10=['\x20dataset(s),\x20generated\x20','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','Format\x20code','basename','copying','√\x20package.json\x20updated:\x20name=','writeFileSync','stableVersion','2624IbQmmU','currentVersion','82932koPjsd','7857468wutYEa','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','W_OK','7TUFQqk','create','package.json','Failed\x20to\x20configure\x20app\x20AppCode','\x20run\x20start','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','cd\x20','bold','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','modelCount','Project\x20created:\x20','Extracting\x20project\x20template','warn','\x20&&\x20','push','existsSync','needsUpgrade','accessSync','keys','Project\x20creation\x20failed:\x20','1.0.0','appCode','gray','√\x20Pulled\x20','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','error','31647oSODzZ','CLI\x20version\x20check','description','renameSync','validation','Project\x20template\x20ready','243OrtUgU','163520GiFVRx','version','305fxRvTN','reverse','projectCode','\x20config\x20set\x20appcode\x20<app-code>\x27','🚀\x20Next\x20Steps:','cyan','\x20api\x20pull\x20--force\x20--yes','extracting','text','\x20|\x20AppCode:\x20','15612eqnVPv','name','relative','resolving','Project\x20directory\x20','\x20\x202.\x20Pull\x20API\x20configuration:\x20','start','utf8','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','info','.rabetbase-create-','length','cookie','log','project','green','apps','857tIBsJQ','Resolving\x20project\x20template','toLocaleString','parse','success','repeat','...','cwd','\x20already\x20exists','Configured\x20app\x20AppCode:\x20','currentDir','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','dev','\x20|\x20Default:\x20implicit\x20(single\x20app)','chdir','isDirectory','7175416ylPesh','lstatSync','resolve','join','651744ZyUqgm','production','ino','Downloading\x20project\x20template','API\x20configuration\x20pull\x20failed','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','belowMinimum','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','nonInteractive','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','rmSync','message','readFileSync','readdirSync','env','minimumVersion','\x20√\x20','projectName'];a180_0x2bda=function(){return _0x267b10;};return a180_0x2bda();}async function runTask(_0x201f25,_0x20eeb8,_0x999f2e=_0x201f25){const _0x45f33b=a180_0x3ebd,_0x51e888=a180_0x1f66fc(_0x201f25+'...')[_0x45f33b(0x1de)]();try{const _0x56a05e=await _0x20eeb8(_0x50afdf=>{const _0x1fadbb=_0x45f33b;_0x51e888[_0x1fadbb(0x1d6)]=_0x50afdf+_0x1fadbb(0x1ef);});_0x51e888['stop'](),console['log'](''+a180_0x3b6d22[_0x45f33b(0x1e7)](_0x45f33b(0x20d))+_0x999f2e+'\x20'+a180_0x3b6d22[_0x45f33b(0x1c1)]('['+_0x56a05e+']'));}catch(_0x1a8abe){_0x51e888['fail'](_0x201f25);throw _0x1a8abe;}}function projectTemplateStageLabel(_0x584941){const _0x53acca=a180_0x3ebd;switch(_0x584941){case _0x53acca(0x1db):return'Resolving\x20project\x20template';case'downloading':return _0x53acca(0x200);case'verifying':return'Verifying\x20project\x20template';case _0x53acca(0x1d5):return _0x53acca(0x229);case _0x53acca(0x213):return'Copying\x20local\x20template\x20source';}}async function updatePackageJsonName(_0x50d4ab,_0x5bf168){const _0x44ca4f=a180_0x3ebd,_0x38d356=a180_0x4e7068[_0x44ca4f(0x1fb)](process[_0x44ca4f(0x1f0)](),_0x50d4ab),_0xd954c=a180_0x4e7068['join'](_0x38d356,_0x44ca4f(0x21f));try{console[_0x44ca4f(0x1e5)](_0x44ca4f(0x202));const _0x4598ae=getRabetbaseCliPackageRoot(),_0x5971a1=a180_0x4e7068[_0x44ca4f(0x1fc)](_0x4598ae,_0x44ca4f(0x21f));let _0x40ec1d='1.0.0';try{const _0xae2aa8=JSON[_0x44ca4f(0x1ec)](a180_0x1c4ae1['readFileSync'](_0x5971a1,_0x44ca4f(0x1df)));_0x40ec1d=_0xae2aa8['version']||_0x44ca4f(0x232);}catch{}const _0x29e273=a180_0x1c4ae1[_0x44ca4f(0x209)](_0xd954c,_0x44ca4f(0x1df)),_0x4d68d4=JSON[_0x44ca4f(0x1ec)](_0x29e273);_0x4d68d4[_0x44ca4f(0x1d9)]=_0x5bf168,_0x4d68d4[_0x44ca4f(0x1c7)]=_0x5bf168+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x40ec1d,a180_0x1c4ae1[_0x44ca4f(0x215)](_0xd954c,JSON['stringify'](_0x4d68d4,null,0x2)+'\x0a',_0x44ca4f(0x1df)),console[_0x44ca4f(0x1e5)](_0x44ca4f(0x214)+_0x5bf168),logger['info'](_0x44ca4f(0x21e),'Updating\x20package.json\x20name');}catch(_0x365f7d){logger[_0x44ca4f(0x1c4)](_0x44ca4f(0x21e),'Failed\x20to\x20update\x20package.json');throw _0x365f7d;}}async function configureAppCode(_0xd76a2a,_0x1dfe20,_0x770cff,_0x3fe538){const _0xfd39c5=a180_0x3ebd,_0x5bfd62=a180_0x4e7068[_0xfd39c5(0x1fb)](process[_0xfd39c5(0x1f0)](),_0xd76a2a),_0x592c63=a180_0x4e7068[_0xfd39c5(0x1fc)](_0x5bfd62,NEW_CONFIG_NAME);try{_0x770cff?console['log']('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x1dfe20+':\x20'+_0x770cff):console[_0xfd39c5(0x1e5)](_0xfd39c5(0x226)+_0x1dfe20);const _0x526239=getRabetbaseCliPackageRoot(),_0x4f60a1=a180_0x4e7068[_0xfd39c5(0x1fc)](_0x526239,_0xfd39c5(0x21f));let _0x18c4ba=_0xfd39c5(0x232);try{const _0x4ea7ae=JSON['parse'](a180_0x1c4ae1[_0xfd39c5(0x209)](_0x4f60a1,_0xfd39c5(0x1df)));_0x18c4ba=_0x4ea7ae[_0xfd39c5(0x1cd)]||'1.0.0';}catch{}const {globalConfig:_0x426cf4}=loadRawConfigLayers(),_0x2b6f66=typeof _0x426cf4['env']==='string'?_0x426cf4[_0xfd39c5(0x20b)]:undefined,_0x469d3f={};for(const _0x385b96 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x426cf4[_0x385b96]!=null)_0x469d3f[_0x385b96]=_0x426cf4[_0x385b96];}const _0x3d5d8e=buildCanonicalProjectConfig(_0x469d3f,{'appCodes':_0x770cff?[_0x770cff]:[],'env':_0x3fe538||_0x2b6f66||_0xfd39c5(0x1fe),'metadata':{'createdAt':new Date()[_0xfd39c5(0x1eb)](),'version':_0x18c4ba}});writeConfigFile(_0x592c63,_0x3d5d8e),await generateSdkConfigFile(a180_0x4e7068['join'](_0x5bfd62,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x5bfd62),_0x770cff?console[_0xfd39c5(0x1e5)]('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object[_0xfd39c5(0x230)](_0x3d5d8e[_0xfd39c5(0x1e8)]||{})[_0xfd39c5(0x1fc)](',\x20')+_0xfd39c5(0x1f6)):console[_0xfd39c5(0x1e5)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0xfd39c5(0x1d1)),logger[_0xfd39c5(0x1e1)](_0xfd39c5(0x21e),_0xfd39c5(0x1f2)+_0x770cff);}catch(_0x3a4910){logger[_0xfd39c5(0x1c4)](_0xfd39c5(0x21e),_0xfd39c5(0x220));throw _0x3a4910;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a182_0x5a9855=a182_0x5a9b;(function(_0x3dce44,_0x50a073){const _0x4443a8=a182_0x5a9b,_0x45bea6=_0x3dce44();while(!![]){try{const _0x300403=-parseInt(_0x4443a8(0x1df))/0x1+-parseInt(_0x4443a8(0x1d1))/0x2+parseInt(_0x4443a8(0x1e3))/0x3+parseInt(_0x4443a8(0x1f2))/0x4*(parseInt(_0x4443a8(0x1d2))/0x5)+-parseInt(_0x4443a8(0x22c))/0x6*(-parseInt(_0x4443a8(0x1fd))/0x7)+parseInt(_0x4443a8(0x216))/0x8*(parseInt(_0x4443a8(0x1f3))/0x9)+-parseInt(_0x4443a8(0x1d3))/0xa;if(_0x300403===_0x50a073)break;else _0x45bea6['push'](_0x45bea6['shift']());}catch(_0x1bbad5){_0x45bea6['push'](_0x45bea6['shift']());}}}(a182_0x2cf3,0xb4cbe));function a182_0x2cf3(){const _0x3fa58b=['copying','realpath','.rabetbase-create-','downloading','origin','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','object','signal','sep','cdn','has','extracting','ino','project','6YuIwnO','string','concat','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','hex','number','projectTemplate','body','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','byteLength','version','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','href','toLowerCase','digest','Use\x20a\x20different\x20project\x20name.','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','pathname','protocol','sha256:','length','trim','.idea','583660qwLIwN','295cPNuuw','15351480TkVfsS','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','.rabetbase.json','posix','.codegraph','node_modules','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','includes','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','getReader','readdir','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','37282KoyfgR',',\x20received\x20','sha256','Project\x20template\x20package.json\x20is\x20invalid.','2935578woJHqi','isSymbolicLink','update','.lovrabet.log','relative','message','utf8','Unable\x20to\x20claim\x20the\x20project\x20directory.','isFinite','Check\x20the\x20source\x20directory\x20and\x20retry.','application/zip','local','startsWith','from','readFile','7884EcsGGH','36QdllaW','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','code','resolve','Local\x20template\x20source\x20does\x20not\x20exist:\x20','cancel','validation','dirname','EEXIST','size','6498317gYfceH','resolving','.env.','isAbsolute','sub-app-react-demo','releaseLock','chmod','verifying','abort','status','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','dev','parse','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','Project\x20directory\x20already\x20exists:\x20','name','get','join','isFile','access','mode','.lovrabet.json','.rabetbase','package.json','https:','1163312tKyAVu','.env.example','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','isDirectory','lstat','mkdtemp'];a182_0x2cf3=function(){return _0x3fa58b;};return a182_0x2cf3();}import{createHash}from'node:crypto';import a182_0x211a90 from'node:fs/promises';function a182_0x5a9b(_0x10c1f1,_0x2fc166){_0x10c1f1=_0x10c1f1-0x1c5;const _0x2cf337=a182_0x2cf3();let _0x5a9b84=_0x2cf337[_0x10c1f1];return _0x5a9b84;}import a182_0x166faa from'node:path';import{PROJECT_TEMPLATE_ASSET_BASE_URL}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{getRabetbaseCdnConfig}from'../../../utils/cli-version-policy.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID=a182_0x5a9855(0x201),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x3ccd1b){const _0x213f1c=a182_0x5a9855;return typeof _0x3ccd1b===_0x213f1c(0x22d)&&_0x3ccd1b['trim']()?_0x3ccd1b[_0x213f1c(0x1cf)]():null;}function parseDescriptor(_0x593a21){const _0x34ed79=a182_0x5a9855;if(!_0x593a21||typeof _0x593a21!==_0x34ed79(0x224))throw new Error(_0x34ed79(0x20a)+TEMPLATE_ID+'\x22.');const _0x56d112=_0x593a21,_0x344dfb=nonEmptyString(_0x56d112['version']),_0x472aff=nonEmptyString(_0x56d112[_0x34ed79(0x20c)]),_0x3e7427=nonEmptyString(_0x56d112[_0x34ed79(0x1e1)])?.[_0x34ed79(0x1c7)](),_0xf99125=_0x56d112[_0x34ed79(0x1fc)];if(!_0x344dfb||!_0x472aff||_0x472aff!==a182_0x166faa[_0x34ed79(0x1d6)]['basename'](_0x472aff)||_0x472aff[_0x34ed79(0x1da)]('\x5c')||!_0x3e7427||!/^sha256:[a-f0-9]{64}$/['test'](_0x3e7427)||typeof _0xf99125!==_0x34ed79(0x232)||!Number['isSafeInteger'](_0xf99125)||_0xf99125<=0x0||_0xf99125>MAX_ARCHIVE_SIZE)throw new Error('CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22'+TEMPLATE_ID+'\x22.');return{'version':_0x344dfb,'name':_0x472aff,'sha256':_0x3e7427,'size':_0xf99125};}async function fetchWithTimeout(_0x506a04,_0x40e887,_0x3eef15,_0xd0415){const _0xbae6bf=a182_0x5a9855,_0x5d5c1a=new AbortController(),_0x1c73d4=setTimeout(()=>_0x5d5c1a[_0xbae6bf(0x205)](),_0x40e887);try{const _0x3a8409=await fetch(_0x506a04,{'headers':{'Accept':_0x3eef15},'signal':_0x5d5c1a[_0xbae6bf(0x225)]});return await _0xd0415(_0x3a8409);}finally{clearTimeout(_0x1c73d4);}}async function fetchTemplateDescriptor(){const _0x299dbe=a182_0x5a9855,_0x420555=await getRabetbaseCdnConfig();if(!_0x420555)throw new Error(_0x299dbe(0x223));return parseDescriptor(_0x420555[_0x299dbe(0x233)]);}function resolveArchiveUrl(_0x23f809){const _0x37b32c=a182_0x5a9855,_0x4cffdb=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0x1f0002=new URL(_0x23f809,_0x4cffdb);if(_0x1f0002[_0x37b32c(0x1cc)]!==_0x37b32c(0x215)||_0x1f0002[_0x37b32c(0x221)]!==_0x4cffdb['origin']||!_0x1f0002[_0x37b32c(0x1cb)][_0x37b32c(0x1ef)](_0x4cffdb[_0x37b32c(0x1cb)]))throw new Error(_0x37b32c(0x1c5));return _0x1f0002[_0x37b32c(0x1c6)];}async function readResponseBytes(_0x3d158d,_0x3f32d8){const _0x3160a4=a182_0x5a9855;if(!_0x3d158d[_0x3160a4(0x234)]){const _0x53447c=Buffer['from'](await _0x3d158d['arrayBuffer']());if(_0x53447c[_0x3160a4(0x1ce)]>_0x3f32d8)throw new Error(_0x3160a4(0x1d9));return _0x53447c;}const _0x3369d1=_0x3d158d[_0x3160a4(0x234)][_0x3160a4(0x1dc)](),_0x2cb7c9=[];let _0x454436=0x0;try{while(!![]){const {done:_0x3893c2,value:_0x55153d}=await _0x3369d1['read']();if(_0x3893c2)break;_0x454436+=_0x55153d[_0x3160a4(0x236)];if(_0x454436>_0x3f32d8){await _0x3369d1[_0x3160a4(0x1f8)]();throw new Error(_0x3160a4(0x1d9));}_0x2cb7c9['push'](Buffer[_0x3160a4(0x1f0)](_0x55153d));}}finally{_0x3369d1[_0x3160a4(0x202)]();}return Buffer[_0x3160a4(0x22e)](_0x2cb7c9,_0x454436);}async function downloadArchive(_0x111034,_0x3d8195,_0x5bdaf0){const _0x2f4253=a182_0x5a9855,_0x3992dd=await fetchWithTimeout(resolveArchiveUrl(_0x111034[_0x2f4253(0x20c)]),ARCHIVE_TIMEOUT_MS,_0x2f4253(0x1ed),async _0xae8d3b=>{const _0x10898c=_0x2f4253;if(!_0xae8d3b['ok'])throw new Error(_0x10898c(0x219)+_0xae8d3b[_0x10898c(0x206)]+'.');const _0x122a87=Number(_0xae8d3b['headers'][_0x10898c(0x20d)]('content-length'));if(Number[_0x10898c(0x1eb)](_0x122a87)&&_0x122a87>MAX_ARCHIVE_SIZE)throw new Error(_0x10898c(0x230));return readResponseBytes(_0xae8d3b,_0x111034[_0x10898c(0x1fc)]);});if(_0x3992dd[_0x2f4253(0x1ce)]!==_0x111034[_0x2f4253(0x1fc)])throw new Error(_0x2f4253(0x1de)+_0x111034[_0x2f4253(0x1fc)]+_0x2f4253(0x1e0)+_0x3992dd[_0x2f4253(0x1ce)]+'.');_0x5bdaf0?.(_0x2f4253(0x204));const _0x2266f3=_0x2f4253(0x1cd)+createHash(_0x2f4253(0x1e1))[_0x2f4253(0x1e5)](_0x3992dd)[_0x2f4253(0x1c8)](_0x2f4253(0x231));if(_0x2266f3!==_0x111034[_0x2f4253(0x1e1)])throw new Error(_0x2f4253(0x1db));await a182_0x211a90['writeFile'](_0x3d8195,_0x3992dd,{'flag':'wx'});}async function assertTemplateRoot(_0x2dca3b){const _0x51fb76=a182_0x5a9855,_0x46928e=a182_0x166faa[_0x51fb76(0x20e)](_0x2dca3b,_0x51fb76(0x214)),_0x177dd4=JSON['parse'](await a182_0x211a90[_0x51fb76(0x1f1)](_0x46928e,_0x51fb76(0x1e9)));if(!_0x177dd4||typeof _0x177dd4!==_0x51fb76(0x224))throw new Error(_0x51fb76(0x1e2));}const LOCAL_FORBIDDEN_NAMES=new Set(['.DS_Store',a182_0x5a9855(0x1d7),'.git',a182_0x5a9855(0x1d0),a182_0x5a9855(0x212),a182_0x5a9855(0x1e6),a182_0x5a9855(0x213),a182_0x5a9855(0x1d5),'dist',a182_0x5a9855(0x1d8)]);function isForbiddenTemplateEntry(_0x50756e){const _0x6480b5=a182_0x5a9855;if(LOCAL_FORBIDDEN_NAMES[_0x6480b5(0x228)](_0x50756e))return!![];return _0x50756e==='.env'||_0x50756e['startsWith'](_0x6480b5(0x1ff))&&_0x50756e!==_0x6480b5(0x217);}function containsPath(_0x23c476,_0x56e6f6){const _0x42982c=a182_0x5a9855,_0x12bca1=a182_0x166faa[_0x42982c(0x1e7)](_0x23c476,_0x56e6f6);return _0x12bca1===''||!_0x12bca1[_0x42982c(0x1ef)]('..'+a182_0x166faa[_0x42982c(0x226)])&&_0x12bca1!=='..'&&!a182_0x166faa[_0x42982c(0x200)](_0x12bca1);}async function copyLocalTemplateDirectory(_0x54f5e2,_0x3fb9bc){const _0x1b0d20=a182_0x5a9855;await a182_0x211a90['mkdir'](_0x3fb9bc,{'recursive':!![]});for(const _0xee6069 of await a182_0x211a90[_0x1b0d20(0x1dd)](_0x54f5e2,{'withFileTypes':!![]})){const _0x168ca1=a182_0x166faa[_0x1b0d20(0x20e)](_0x54f5e2,_0xee6069[_0x1b0d20(0x20c)]),_0x1c3280=a182_0x166faa['join'](_0x3fb9bc,_0xee6069[_0x1b0d20(0x20c)]);if(isForbiddenTemplateEntry(_0xee6069[_0x1b0d20(0x20c)]))throw new Error(_0x1b0d20(0x207)+_0x168ca1);const _0x39f611=await a182_0x211a90['lstat'](_0x168ca1);if(_0x39f611[_0x1b0d20(0x1e4)]())throw new Error(_0x1b0d20(0x1d4)+_0x168ca1);if(_0x39f611[_0x1b0d20(0x21a)]()){await copyLocalTemplateDirectory(_0x168ca1,_0x1c3280);continue;}if(!_0x39f611[_0x1b0d20(0x20f)]())continue;await a182_0x211a90['copyFile'](_0x168ca1,_0x1c3280),await a182_0x211a90[_0x1b0d20(0x203)](_0x1c3280,_0x39f611[_0x1b0d20(0x211)]&0x1ff);}}async function readTemplateVersion(_0x18fc42){const _0x11e566=a182_0x5a9855,_0x4bad8a=JSON[_0x11e566(0x209)](await a182_0x211a90[_0x11e566(0x1f1)](a182_0x166faa[_0x11e566(0x20e)](_0x18fc42,_0x11e566(0x214)),_0x11e566(0x1e9)));return nonEmptyString(_0x4bad8a[_0x11e566(0x237)])||_0x11e566(0x1ee);}async function readDirectoryIdentity(_0x58d2fb){const _0x2a4035=a182_0x5a9855;try{const _0x778353=await a182_0x211a90[_0x2a4035(0x21b)](_0x58d2fb);if(!_0x778353['isDirectory']())return null;return{'dev':_0x778353[_0x2a4035(0x208)],'ino':_0x778353[_0x2a4035(0x22a)]};}catch{return null;}}async function commitStagedProject(_0x4cf4eb,_0xa9e2e2){const _0x4827f5=a182_0x5a9855;await a182_0x211a90['mkdir'](_0xa9e2e2);const _0x346bce=await readDirectoryIdentity(_0xa9e2e2);if(!_0x346bce)throw new Error(_0x4827f5(0x1ea));try{for(const _0x3ac11e of await a182_0x211a90['readdir'](_0x4cf4eb)){await a182_0x211a90['rename'](a182_0x166faa[_0x4827f5(0x20e)](_0x4cf4eb,_0x3ac11e),a182_0x166faa[_0x4827f5(0x20e)](_0xa9e2e2,_0x3ac11e));}}catch(_0x575cbf){const _0x4a98ee=await readDirectoryIdentity(_0xa9e2e2);_0x4a98ee?.[_0x4827f5(0x208)]===_0x346bce[_0x4827f5(0x208)]&&_0x4a98ee[_0x4827f5(0x22a)]===_0x346bce['ino']&&await a182_0x211a90['rm'](_0xa9e2e2,{'recursive':!![],'force':!![]});throw _0x575cbf;}}export async function materializeProjectTemplate(_0x405ddd,_0x22d6a4){const _0x5ba559=a182_0x5a9855,_0x46d5cf=a182_0x166faa['resolve'](_0x405ddd),_0x698bee=a182_0x166faa[_0x5ba559(0x1fa)](_0x46d5cf);try{await a182_0x211a90[_0x5ba559(0x21b)](_0x46d5cf);throw new Error('Project\x20directory\x20already\x20exists:\x20'+_0x46d5cf);}catch(_0x3962ca){if(_0x3962ca['code']!=='ENOENT')throw _0x3962ca;}const _0x11b9f2=await a182_0x211a90[_0x5ba559(0x21c)](a182_0x166faa[_0x5ba559(0x20e)](_0x698bee,_0x5ba559(0x21f))),_0x474ecb=a182_0x166faa[_0x5ba559(0x20e)](_0x11b9f2,_0x5ba559(0x22b)),_0x53cabf=a182_0x166faa[_0x5ba559(0x20e)](_0x11b9f2,'template.zip');try{try{_0x22d6a4?.(_0x5ba559(0x1fe));const _0x9098e7=await fetchTemplateDescriptor();return _0x22d6a4?.(_0x5ba559(0x220)),await downloadArchive(_0x9098e7,_0x53cabf,_0x22d6a4),_0x22d6a4?.(_0x5ba559(0x229)),await extractProjectTemplateArchive(_0x53cabf,_0x474ecb),await assertTemplateRoot(_0x474ecb),await commitStagedProject(_0x474ecb,_0x46d5cf),{'source':_0x5ba559(0x227),'version':_0x9098e7[_0x5ba559(0x237)]};}catch(_0x3f20a2){if(_0x3f20a2['code']===_0x5ba559(0x1fb))throw CliErrors[_0x5ba559(0x1f9)](_0x5ba559(0x20b)+_0x46d5cf,_0x5ba559(0x1c9));const _0x43dbb7=_0x3f20a2 instanceof Error?_0x3f20a2[_0x5ba559(0x1e8)]:String(_0x3f20a2);throw CliErrors[_0x5ba559(0x1f9)](_0x5ba559(0x1f4),_0x5ba559(0x22f)+_0x43dbb7);}}finally{await a182_0x211a90['rm'](_0x11b9f2,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x3c2b24,_0xb9b853,_0x361ec2){const _0x16af06=a182_0x5a9855;let _0x3cb7a7;try{_0x3cb7a7=await a182_0x211a90['realpath'](a182_0x166faa[_0x16af06(0x1f6)](_0x3c2b24));}catch{throw CliErrors[_0x16af06(0x1f9)](_0x16af06(0x1f7)+a182_0x166faa['resolve'](_0x3c2b24),_0x16af06(0x235));}const _0x3d3b12=await a182_0x211a90['lstat'](_0x3cb7a7);if(!_0x3d3b12[_0x16af06(0x21a)]())throw CliErrors[_0x16af06(0x1f9)](_0x16af06(0x222)+_0x3cb7a7);const _0x1d9af8=a182_0x166faa[_0x16af06(0x1f6)](_0xb9b853),_0xde38d5=await a182_0x211a90[_0x16af06(0x21e)](a182_0x166faa[_0x16af06(0x1fa)](_0x1d9af8)),_0x227dde=a182_0x166faa[_0x16af06(0x20e)](_0xde38d5,a182_0x166faa['basename'](_0x1d9af8));if(containsPath(_0x3cb7a7,_0x227dde)||containsPath(_0x227dde,_0x3cb7a7))throw CliErrors[_0x16af06(0x1f9)](_0x16af06(0x218),_0x16af06(0x1ca));try{await a182_0x211a90[_0x16af06(0x21b)](_0x227dde);throw CliErrors[_0x16af06(0x1f9)](_0x16af06(0x20b)+_0x227dde,'Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.');}catch(_0x1bee7e){if(_0x1bee7e[_0x16af06(0x1f5)]!=='ENOENT')throw _0x1bee7e;}const _0x1f0765=a182_0x166faa[_0x16af06(0x1fa)](_0x227dde);await a182_0x211a90[_0x16af06(0x210)](_0x1f0765);const _0x212cf3=await a182_0x211a90['mkdtemp'](a182_0x166faa[_0x16af06(0x20e)](_0x1f0765,_0x16af06(0x21f))),_0x257182=a182_0x166faa[_0x16af06(0x20e)](_0x212cf3,'project');try{_0x361ec2?.(_0x16af06(0x21d)),await copyLocalTemplateDirectory(_0x3cb7a7,_0x257182),await assertTemplateRoot(_0x257182);const _0x247ff3=await readTemplateVersion(_0x257182);return await commitStagedProject(_0x257182,_0x227dde),{'source':_0x16af06(0x1ee),'version':_0x247ff3};}catch(_0x503e0f){const _0x2b4b6f=_0x503e0f instanceof Error?_0x503e0f['message']:String(_0x503e0f);throw CliErrors['validation']('Invalid\x20local\x20template\x20source:\x20'+_0x2b4b6f,_0x16af06(0x1ec));}finally{await a182_0x211a90['rm'](_0x212cf3,{'recursive':!![],'force':!![]});}}
|
|
1
|
+
const a181_0x2c1ab3=a181_0x59ed;(function(_0x381118,_0x32628e){const _0xdca143=a181_0x59ed,_0x5bec54=_0x381118();while(!![]){try{const _0x1d70d2=-parseInt(_0xdca143(0xf6))/0x1*(parseInt(_0xdca143(0xc0))/0x2)+-parseInt(_0xdca143(0xa6))/0x3+-parseInt(_0xdca143(0xab))/0x4+parseInt(_0xdca143(0xf9))/0x5+-parseInt(_0xdca143(0xd3))/0x6+-parseInt(_0xdca143(0xcc))/0x7*(parseInt(_0xdca143(0xd5))/0x8)+-parseInt(_0xdca143(0xcb))/0x9*(-parseInt(_0xdca143(0xea))/0xa);if(_0x1d70d2===_0x32628e)break;else _0x5bec54['push'](_0x5bec54['shift']());}catch(_0x3153a8){_0x5bec54['push'](_0x5bec54['shift']());}}}(a181_0x1647,0x48ce0));import{createHash}from'node:crypto';import a181_0x1e0944 from'node:fs/promises';import a181_0x3b58f8 from'node:path';import{PROJECT_TEMPLATE_ASSET_BASE_URL}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{getRabetbaseCdnConfig}from'../../../utils/cli-version-policy.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID=a181_0x2c1ab3(0xaa),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x256617){const _0x93c42c=a181_0x2c1ab3;return typeof _0x256617===_0x93c42c(0xcd)&&_0x256617[_0x93c42c(0xc4)]()?_0x256617['trim']():null;}function parseDescriptor(_0x290df8){const _0x5a501b=a181_0x2c1ab3;if(!_0x290df8||typeof _0x290df8!==_0x5a501b(0x9e))throw new Error(_0x5a501b(0xd7)+TEMPLATE_ID+'\x22.');const _0xf66c92=_0x290df8,_0x21e275=nonEmptyString(_0xf66c92['version']),_0x54c6ad=nonEmptyString(_0xf66c92[_0x5a501b(0xa8)]),_0x2447c7=nonEmptyString(_0xf66c92[_0x5a501b(0xb9)])?.['toLowerCase'](),_0x32c475=_0xf66c92[_0x5a501b(0x98)];if(!_0x21e275||!_0x54c6ad||_0x54c6ad!==a181_0x3b58f8[_0x5a501b(0x96)][_0x5a501b(0xe8)](_0x54c6ad)||_0x54c6ad[_0x5a501b(0xd1)]('\x5c')||!_0x2447c7||!/^sha256:[a-f0-9]{64}$/[_0x5a501b(0xca)](_0x2447c7)||typeof _0x32c475!==_0x5a501b(0xbf)||!Number[_0x5a501b(0xf1)](_0x32c475)||_0x32c475<=0x0||_0x32c475>MAX_ARCHIVE_SIZE)throw new Error('CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22'+TEMPLATE_ID+'\x22.');return{'version':_0x21e275,'name':_0x54c6ad,'sha256':_0x2447c7,'size':_0x32c475};}async function fetchWithTimeout(_0x170f5b,_0x4caa40,_0x19db6a,_0x4320d1){const _0x54caf2=a181_0x2c1ab3,_0x4c450e=new AbortController(),_0x2ca93e=setTimeout(()=>_0x4c450e[_0x54caf2(0xac)](),_0x4caa40);try{const _0x339728=await fetch(_0x170f5b,{'headers':{'Accept':_0x19db6a},'signal':_0x4c450e['signal']});return await _0x4320d1(_0x339728);}finally{clearTimeout(_0x2ca93e);}}async function fetchTemplateDescriptor(){const _0x261117=a181_0x2c1ab3,_0x12d703=await getRabetbaseCdnConfig();if(!_0x12d703)throw new Error(_0x261117(0xda));return parseDescriptor(_0x12d703[_0x261117(0xf8)]);}function resolveArchiveUrl(_0x5d4255){const _0x102081=a181_0x2c1ab3,_0x5afb4d=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0x1f7c37=new URL(_0x5d4255,_0x5afb4d);if(_0x1f7c37['protocol']!==_0x102081(0xad)||_0x1f7c37[_0x102081(0xd4)]!==_0x5afb4d[_0x102081(0xd4)]||!_0x1f7c37[_0x102081(0xd8)]['startsWith'](_0x5afb4d[_0x102081(0xd8)]))throw new Error(_0x102081(0xa3));return _0x1f7c37['href'];}async function readResponseBytes(_0x3b1473,_0x91d746){const _0x1cd71e=a181_0x2c1ab3;if(!_0x3b1473[_0x1cd71e(0xa0)]){const _0x46c22c=Buffer['from'](await _0x3b1473[_0x1cd71e(0xe0)]());if(_0x46c22c[_0x1cd71e(0x9b)]>_0x91d746)throw new Error(_0x1cd71e(0xb2));return _0x46c22c;}const _0x15f7ba=_0x3b1473[_0x1cd71e(0xa0)][_0x1cd71e(0xce)](),_0x5f4c28=[];let _0x184716=0x0;try{while(!![]){const {done:_0x54b907,value:_0x197da8}=await _0x15f7ba[_0x1cd71e(0x92)]();if(_0x54b907)break;_0x184716+=_0x197da8[_0x1cd71e(0xb1)];if(_0x184716>_0x91d746){await _0x15f7ba['cancel']();throw new Error(_0x1cd71e(0xb2));}_0x5f4c28[_0x1cd71e(0xb7)](Buffer[_0x1cd71e(0xf5)](_0x197da8));}}finally{_0x15f7ba['releaseLock']();}return Buffer[_0x1cd71e(0xe6)](_0x5f4c28,_0x184716);}async function downloadArchive(_0x33fd9e,_0xb7288e,_0x57920b){const _0x1b2fcc=a181_0x2c1ab3,_0x380560=await fetchWithTimeout(resolveArchiveUrl(_0x33fd9e['name']),ARCHIVE_TIMEOUT_MS,_0x1b2fcc(0xeb),async _0x2526c8=>{const _0x1784fb=_0x1b2fcc;if(!_0x2526c8['ok'])throw new Error(_0x1784fb(0xa7)+_0x2526c8[_0x1784fb(0xbe)]+'.');const _0x2a0462=Number(_0x2526c8[_0x1784fb(0xc2)]['get']('content-length'));if(Number[_0x1784fb(0xfa)](_0x2a0462)&&_0x2a0462>MAX_ARCHIVE_SIZE)throw new Error(_0x1784fb(0xd9));return readResponseBytes(_0x2526c8,_0x33fd9e['size']);});if(_0x380560[_0x1b2fcc(0x9b)]!==_0x33fd9e[_0x1b2fcc(0x98)])throw new Error('CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20'+_0x33fd9e['size']+',\x20received\x20'+_0x380560[_0x1b2fcc(0x9b)]+'.');_0x57920b?.(_0x1b2fcc(0xc8));const _0x5870b4=_0x1b2fcc(0x100)+createHash(_0x1b2fcc(0xb9))[_0x1b2fcc(0xd0)](_0x380560)['digest'](_0x1b2fcc(0xd2));if(_0x5870b4!==_0x33fd9e['sha256'])throw new Error(_0x1b2fcc(0xc9));await a181_0x1e0944[_0x1b2fcc(0xa4)](_0xb7288e,_0x380560,{'flag':'wx'});}async function assertTemplateRoot(_0x98bbff){const _0x57055d=a181_0x2c1ab3,_0x4f5dec=a181_0x3b58f8[_0x57055d(0xe7)](_0x98bbff,'package.json'),_0x1a8aab=JSON[_0x57055d(0xf2)](await a181_0x1e0944[_0x57055d(0x94)](_0x4f5dec,'utf8'));if(!_0x1a8aab||typeof _0x1a8aab!==_0x57055d(0x9e))throw new Error(_0x57055d(0x97));}const LOCAL_FORBIDDEN_NAMES=new Set([a181_0x2c1ab3(0x95),a181_0x2c1ab3(0x93),a181_0x2c1ab3(0xb0),'.idea',a181_0x2c1ab3(0xb8),a181_0x2c1ab3(0xb4),a181_0x2c1ab3(0xa9),a181_0x2c1ab3(0xb3),a181_0x2c1ab3(0xed),a181_0x2c1ab3(0xc7)]);function a181_0x1647(){const _0x321968=['2630192BeoSwA','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','pathname','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','package.json','isSymbolicLink','message','local','copying','arrayBuffer','.env.','resolve','resolving','Project\x20directory\x20already\x20exists:\x20','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','concat','join','basename','downloading','4444600LpMwwo','application/zip','realpath','dist','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','extracting','chmod','isSafeInteger','parse','ENOENT','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','from','85MmupmZ','template.zip','projectTemplate','1144565EEKCdX','isFinite','readdir','dirname','lstat','validation','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','sha256:','read','.codegraph','readFile','.DS_Store','posix','Project\x20template\x20package.json\x20is\x20invalid.','size','Unable\x20to\x20claim\x20the\x20project\x20directory.','.env','length','mkdir','isAbsolute','object','code','body','ino','Use\x20a\x20different\x20project\x20name.','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','writeFile','mode','1528185RBruCu','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','name','.rabetbase','sub-app-react-demo','1565296HHrzDK','abort','https:','EEXIST','.rabetbase-create-','.git','byteLength','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','.rabetbase.json','.lovrabet.log','.env.example','dev','push','.lovrabet.json','sha256','copyFile','Check\x20the\x20source\x20directory\x20and\x20retry.','isDirectory','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','status','number','10490SjpfWF','rename','headers','access','trim','version','Local\x20template\x20source\x20does\x20not\x20exist:\x20','node_modules','verifying','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','test','45HbfjdA','7pyVqRE','string','getReader','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','update','includes','hex','2866122fPDbpc','origin'];a181_0x1647=function(){return _0x321968;};return a181_0x1647();}function isForbiddenTemplateEntry(_0x2bc454){const _0xeade30=a181_0x2c1ab3;if(LOCAL_FORBIDDEN_NAMES['has'](_0x2bc454))return!![];return _0x2bc454===_0xeade30(0x9a)||_0x2bc454['startsWith'](_0xeade30(0xe1))&&_0x2bc454!==_0xeade30(0xb5);}function containsPath(_0x1055d1,_0x5d2192){const _0x4e6123=a181_0x2c1ab3,_0x34f5d3=a181_0x3b58f8['relative'](_0x1055d1,_0x5d2192);return _0x34f5d3===''||!_0x34f5d3['startsWith']('..'+a181_0x3b58f8['sep'])&&_0x34f5d3!=='..'&&!a181_0x3b58f8[_0x4e6123(0x9d)](_0x34f5d3);}async function copyLocalTemplateDirectory(_0x3e8259,_0x3be07c){const _0x304baa=a181_0x2c1ab3;await a181_0x1e0944[_0x304baa(0x9c)](_0x3be07c,{'recursive':!![]});for(const _0x124bf4 of await a181_0x1e0944[_0x304baa(0xfb)](_0x3e8259,{'withFileTypes':!![]})){const _0x11dcb9=a181_0x3b58f8['join'](_0x3e8259,_0x124bf4[_0x304baa(0xa8)]),_0x108d71=a181_0x3b58f8[_0x304baa(0xe7)](_0x3be07c,_0x124bf4['name']);if(isForbiddenTemplateEntry(_0x124bf4['name']))throw new Error(_0x304baa(0xcf)+_0x11dcb9);const _0x2021bf=await a181_0x1e0944['lstat'](_0x11dcb9);if(_0x2021bf[_0x304baa(0xdc)]())throw new Error(_0x304baa(0xee)+_0x11dcb9);if(_0x2021bf['isDirectory']()){await copyLocalTemplateDirectory(_0x11dcb9,_0x108d71);continue;}if(!_0x2021bf['isFile']())continue;await a181_0x1e0944[_0x304baa(0xba)](_0x11dcb9,_0x108d71),await a181_0x1e0944[_0x304baa(0xf0)](_0x108d71,_0x2021bf[_0x304baa(0xa5)]&0x1ff);}}async function readTemplateVersion(_0x59120c){const _0x30ab5a=a181_0x2c1ab3,_0x2dc04c=JSON[_0x30ab5a(0xf2)](await a181_0x1e0944[_0x30ab5a(0x94)](a181_0x3b58f8[_0x30ab5a(0xe7)](_0x59120c,_0x30ab5a(0xdb)),'utf8'));return nonEmptyString(_0x2dc04c[_0x30ab5a(0xc5)])||'local';}async function readDirectoryIdentity(_0x54bf58){const _0x89e212=a181_0x2c1ab3;try{const _0x35c0da=await a181_0x1e0944[_0x89e212(0xfd)](_0x54bf58);if(!_0x35c0da['isDirectory']())return null;return{'dev':_0x35c0da[_0x89e212(0xb6)],'ino':_0x35c0da[_0x89e212(0xa1)]};}catch{return null;}}async function commitStagedProject(_0x3e53c3,_0x2a9a01){const _0x1fadae=a181_0x2c1ab3;await a181_0x1e0944[_0x1fadae(0x9c)](_0x2a9a01);const _0x229a46=await readDirectoryIdentity(_0x2a9a01);if(!_0x229a46)throw new Error(_0x1fadae(0x99));try{for(const _0x285d98 of await a181_0x1e0944['readdir'](_0x3e53c3)){await a181_0x1e0944[_0x1fadae(0xc1)](a181_0x3b58f8[_0x1fadae(0xe7)](_0x3e53c3,_0x285d98),a181_0x3b58f8[_0x1fadae(0xe7)](_0x2a9a01,_0x285d98));}}catch(_0x2da49c){const _0x240625=await readDirectoryIdentity(_0x2a9a01);_0x240625?.[_0x1fadae(0xb6)]===_0x229a46[_0x1fadae(0xb6)]&&_0x240625[_0x1fadae(0xa1)]===_0x229a46[_0x1fadae(0xa1)]&&await a181_0x1e0944['rm'](_0x2a9a01,{'recursive':!![],'force':!![]});throw _0x2da49c;}}export async function materializeProjectTemplate(_0x19c877,_0x1da7d9){const _0x35b0b9=a181_0x2c1ab3,_0x295f66=a181_0x3b58f8[_0x35b0b9(0xe2)](_0x19c877),_0x351357=a181_0x3b58f8[_0x35b0b9(0xfc)](_0x295f66);try{await a181_0x1e0944[_0x35b0b9(0xfd)](_0x295f66);throw new Error(_0x35b0b9(0xe4)+_0x295f66);}catch(_0x4a8fb4){if(_0x4a8fb4[_0x35b0b9(0x9f)]!==_0x35b0b9(0xf3))throw _0x4a8fb4;}const _0x3d43e1=await a181_0x1e0944['mkdtemp'](a181_0x3b58f8[_0x35b0b9(0xe7)](_0x351357,_0x35b0b9(0xaf))),_0x2f1d3d=a181_0x3b58f8[_0x35b0b9(0xe7)](_0x3d43e1,'project'),_0x2149fa=a181_0x3b58f8['join'](_0x3d43e1,_0x35b0b9(0xf7));try{try{_0x1da7d9?.(_0x35b0b9(0xe3));const _0x17ad8f=await fetchTemplateDescriptor();return _0x1da7d9?.(_0x35b0b9(0xe9)),await downloadArchive(_0x17ad8f,_0x2149fa,_0x1da7d9),_0x1da7d9?.(_0x35b0b9(0xef)),await extractProjectTemplateArchive(_0x2149fa,_0x2f1d3d),await assertTemplateRoot(_0x2f1d3d),await commitStagedProject(_0x2f1d3d,_0x295f66),{'source':'cdn','version':_0x17ad8f['version']};}catch(_0x49bda5){if(_0x49bda5[_0x35b0b9(0x9f)]===_0x35b0b9(0xae))throw CliErrors[_0x35b0b9(0xfe)]('Project\x20directory\x20already\x20exists:\x20'+_0x295f66,_0x35b0b9(0xa2));const _0x4a6e29=_0x49bda5 instanceof Error?_0x49bda5['message']:String(_0x49bda5);throw CliErrors[_0x35b0b9(0xfe)](_0x35b0b9(0xf4),_0x35b0b9(0xd6)+_0x4a6e29);}}finally{await a181_0x1e0944['rm'](_0x3d43e1,{'recursive':!![],'force':!![]});}}function a181_0x59ed(_0x1b469f,_0x43a9b3){_0x1b469f=_0x1b469f-0x92;const _0x164732=a181_0x1647();let _0x59eda3=_0x164732[_0x1b469f];return _0x59eda3;}export async function materializeLocalProjectTemplate(_0x11d448,_0x5531ba,_0x569cfd){const _0x3f0e7f=a181_0x2c1ab3;let _0x58e369;try{_0x58e369=await a181_0x1e0944['realpath'](a181_0x3b58f8[_0x3f0e7f(0xe2)](_0x11d448));}catch{throw CliErrors[_0x3f0e7f(0xfe)](_0x3f0e7f(0xc6)+a181_0x3b58f8['resolve'](_0x11d448),'Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.');}const _0x24d679=await a181_0x1e0944[_0x3f0e7f(0xfd)](_0x58e369);if(!_0x24d679[_0x3f0e7f(0xbc)]())throw CliErrors[_0x3f0e7f(0xfe)](_0x3f0e7f(0xbd)+_0x58e369);const _0x2b0ac5=a181_0x3b58f8[_0x3f0e7f(0xe2)](_0x5531ba),_0x1b1c6f=await a181_0x1e0944[_0x3f0e7f(0xec)](a181_0x3b58f8[_0x3f0e7f(0xfc)](_0x2b0ac5)),_0x3e6faf=a181_0x3b58f8['join'](_0x1b1c6f,a181_0x3b58f8[_0x3f0e7f(0xe8)](_0x2b0ac5));if(containsPath(_0x58e369,_0x3e6faf)||containsPath(_0x3e6faf,_0x58e369))throw CliErrors['validation'](_0x3f0e7f(0xff),_0x3f0e7f(0xe5));try{await a181_0x1e0944['lstat'](_0x3e6faf);throw CliErrors[_0x3f0e7f(0xfe)](_0x3f0e7f(0xe4)+_0x3e6faf,'Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.');}catch(_0x133fd0){if(_0x133fd0[_0x3f0e7f(0x9f)]!=='ENOENT')throw _0x133fd0;}const _0x1dbc21=a181_0x3b58f8[_0x3f0e7f(0xfc)](_0x3e6faf);await a181_0x1e0944[_0x3f0e7f(0xc3)](_0x1dbc21);const _0x1fbecb=await a181_0x1e0944['mkdtemp'](a181_0x3b58f8[_0x3f0e7f(0xe7)](_0x1dbc21,_0x3f0e7f(0xaf))),_0x3b9c08=a181_0x3b58f8[_0x3f0e7f(0xe7)](_0x1fbecb,'project');try{_0x569cfd?.(_0x3f0e7f(0xdf)),await copyLocalTemplateDirectory(_0x58e369,_0x3b9c08),await assertTemplateRoot(_0x3b9c08);const _0x512e22=await readTemplateVersion(_0x3b9c08);return await commitStagedProject(_0x3b9c08,_0x3e6faf),{'source':_0x3f0e7f(0xde),'version':_0x512e22};}catch(_0x5e9568){const _0x226637=_0x5e9568 instanceof Error?_0x5e9568[_0x3f0e7f(0xdd)]:String(_0x5e9568);throw CliErrors[_0x3f0e7f(0xfe)]('Invalid\x20local\x20template\x20source:\x20'+_0x226637,_0x3f0e7f(0xbb));}finally{await a181_0x1e0944['rm'](_0x1fbecb,{'recursive':!![],'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x195b8b,_0x3f182c){const _0x5ed314=a182_0x3dd9,_0x308ce1=_0x195b8b();while(!![]){try{const _0x1d5b61=-parseInt(_0x5ed314(0x1b7))/0x1+-parseInt(_0x5ed314(0x1bd))/0x2+-parseInt(_0x5ed314(0x1b5))/0x3+parseInt(_0x5ed314(0x1bf))/0x4*(parseInt(_0x5ed314(0x1b0))/0x5)+parseInt(_0x5ed314(0x1c0))/0x6+parseInt(_0x5ed314(0x1bc))/0x7+parseInt(_0x5ed314(0x1b3))/0x8*(parseInt(_0x5ed314(0x1b8))/0x9);if(_0x1d5b61===_0x3f182c)break;else _0x308ce1['push'](_0x308ce1['shift']());}catch(_0x3cf9b0){_0x308ce1['push'](_0x308ce1['shift']());}}}(a182_0x1be9,0x788ef));import{CliErrors}from'../../../errors.js';function a182_0x1be9(){const _0x575c4f=['4kXUbMQ','1006878kjnBDr','3241260FSeuha','trim','\x20characters','2160352qykHJg','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','2674368jiKema','validation','215165cHkHHE','36rzVAjL','test','length','\x22\x20is\x20reserved\x20on\x20Windows','484085EZJnhR','729936pddCNX','Project\x20name\x20cannot\x20exceed\x20'];a182_0x1be9=function(){return _0x575c4f;};return a182_0x1be9();}const PROJECT_NAME_PATTERN=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i,MAX_PROJECT_NAME_LENGTH=0x64;function a182_0x3dd9(_0x20551d,_0x30b37f){_0x20551d=_0x20551d-0x1b0;const _0x1be953=a182_0x1be9();let _0x3dd988=_0x1be953[_0x20551d];return _0x3dd988;}export function getProjectNameValidationError(_0x58f2aa){const _0x51aefa=a182_0x3dd9,_0x9b8580=_0x58f2aa[_0x51aefa(0x1b1)]();if(!_0x9b8580)return'Project\x20name\x20cannot\x20be\x20empty';if(_0x9b8580[_0x51aefa(0x1ba)]>MAX_PROJECT_NAME_LENGTH)return _0x51aefa(0x1be)+MAX_PROJECT_NAME_LENGTH+_0x51aefa(0x1b2);if(!PROJECT_NAME_PATTERN['test'](_0x9b8580))return _0x51aefa(0x1b4);if(WINDOWS_RESERVED_NAME[_0x51aefa(0x1b9)](_0x9b8580))return'Project\x20name\x20\x22'+_0x9b8580+_0x51aefa(0x1bb);return null;}export function validateProjectName(_0x579a73){const _0x40d606=a182_0x3dd9,_0x29cfb1=_0x579a73['trim'](),_0x10dbff=getProjectNameValidationError(_0x29cfb1);if(_0x10dbff)throw CliErrors[_0x40d606(0x1b6)](_0x10dbff,'Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.');return _0x29cfb1;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5e180e,_0x205f31){const _0x2a6718=a183_0x3ba7,_0x11cc72=_0x5e180e();while(!![]){try{const _0x2f2b24=-parseInt(_0x2a6718(0xc6))/0x1+-parseInt(_0x2a6718(0xb9))/0x2*(-parseInt(_0x2a6718(0xb5))/0x3)+-parseInt(_0x2a6718(0xe0))/0x4*(-parseInt(_0x2a6718(0xbd))/0x5)+parseInt(_0x2a6718(0xd1))/0x6+-parseInt(_0x2a6718(0xcd))/0x7*(parseInt(_0x2a6718(0xd9))/0x8)+-parseInt(_0x2a6718(0xd4))/0x9+parseInt(_0x2a6718(0xc8))/0xa*(parseInt(_0x2a6718(0xc1))/0xb);if(_0x2f2b24===_0x205f31)break;else _0x11cc72['push'](_0x11cc72['shift']());}catch(_0x55481e){_0x11cc72['push'](_0x11cc72['shift']());}}}(a183_0x40c4,0xdd44a));import{createWriteStream}from'node:fs';function a183_0x3ba7(_0x542df0,_0x38b94e){_0x542df0=_0x542df0-0xb5;const _0x40c49f=a183_0x40c4();let _0x3ba761=_0x40c49f[_0x542df0];return _0x3ba761;}import a183_0xffbab from'node:fs/promises';import a183_0x3ac23d from'node:path';function a183_0x40c4(){const _0x31cd6c=['split','Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20','9132480IELwIG','length','endsWith','14661117VDZrcL','mkdir','Unable\x20to\x20read\x20ZIP\x20entry:\x20','replace','close','1174408qVkHLK','test','catch','resolve','dirname','Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20','slice','934572kDMhYr','entry','33yxvcUo','get','ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20','fileName','67278LulEIg','readEntry','add','uncompressedSize','5MoayTG','has','startsWith','externalFileAttributes','9739433KNERYv','Project\x20template\x20ZIP\x20exceeds\x20','Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.','set','Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20','186823xjOcEl','join','20xLevNH','toLocaleLowerCase','Unable\x20to\x20open\x20project\x20template\x20archive.','open','sep','56OeCfya','error'];a183_0x40c4=function(){return _0x31cd6c;};return a183_0x40c4();}import{pipeline}from'node:stream/promises';import a183_0x15a94c 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(_0x50055e){return new Promise((_0x4c4377,_0x36140e)=>{const _0x3022dd=a183_0x3ba7;a183_0x15a94c[_0x3022dd(0xcb)](_0x50055e,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x2869b6,_0x267120)=>{const _0x54e953=_0x3022dd;if(_0x2869b6||!_0x267120){_0x36140e(_0x2869b6||new Error(_0x54e953(0xca)));return;}_0x4c4377(_0x267120);});});}function openEntryStream(_0x42fa1f,_0x4b25c8){return new Promise((_0x33d0d9,_0x8d19d4)=>{_0x42fa1f['openReadStream'](_0x4b25c8,(_0x4e94ec,_0x299608)=>{const _0x6563ea=a183_0x3ba7;if(_0x4e94ec||!_0x299608){_0x8d19d4(_0x4e94ec||new Error(_0x6563ea(0xd6)+_0x4b25c8['fileName']));return;}_0x33d0d9(_0x299608);});});}function validateEntryPath(_0x3cac9d){const _0x3e859a=a183_0x3ba7,_0x1f4c9b=_0x3cac9d[_0x3e859a(0xd7)](/\\/g,'/'),_0x3057e7=_0x1f4c9b[_0x3e859a(0xd3)]('/'),_0x34288b=_0x3057e7?_0x1f4c9b[_0x3e859a(0xdf)](0x0,-0x1):_0x1f4c9b;if(!_0x34288b||_0x1f4c9b[_0x3e859a(0xbf)]('/')||/^[A-Za-z]:\//['test'](_0x1f4c9b))throw new Error(_0x3e859a(0xde)+_0x3cac9d);const _0x585904=_0x34288b['split']('/');for(const _0x548dd4 of _0x585904){if(!_0x548dd4||_0x548dd4==='.'||_0x548dd4==='..'||_0x548dd4[_0x3e859a(0xd3)]('.')||_0x548dd4[_0x3e859a(0xd3)]('\x20')||WINDOWS_INVALID_CHAR[_0x3e859a(0xda)](_0x548dd4)||WINDOWS_RESERVED_NAME[_0x3e859a(0xda)](_0x548dd4))throw new Error(_0x3e859a(0xc5)+_0x3cac9d);}return{'relativePath':_0x585904[_0x3e859a(0xc7)](a183_0x3ac23d[_0x3e859a(0xcc)]),'directory':_0x3057e7};}function isSymbolicLink(_0x4863b2){const _0x23507e=a183_0x3ba7,_0x376148=_0x4863b2[_0x23507e(0xc0)]>>>0x10&0xffff;return(_0x376148&0xf000)===0xa000;}export async function extractProjectTemplateArchive(_0xdd17d,_0x44b878){const _0x5ba741=a183_0x3ba7,_0x1c0a22=await openZip(_0xdd17d),_0x41cc2f=a183_0x3ac23d[_0x5ba741(0xdc)](_0x44b878),_0x3edc65=new Set(),_0x21792e=new Map();let _0xea00f4=0x0,_0x5dd258=0x0;await a183_0xffbab[_0x5ba741(0xd5)](_0x41cc2f,{'recursive':!![]}),await new Promise((_0x54ecae,_0x1b78c3)=>{const _0x6d00a7=_0x5ba741;let _0x205731=![];const _0x48a2d4=_0x3736a2=>{const _0x760f34=a183_0x3ba7;if(_0x205731)return;_0x205731=!![],_0x1c0a22[_0x760f34(0xd8)](),_0x1b78c3(_0x3736a2 instanceof Error?_0x3736a2:new Error(String(_0x3736a2)));};_0x1c0a22['once'](_0x6d00a7(0xce),_0x48a2d4),_0x1c0a22['once']('end',()=>{if(_0x205731)return;_0x205731=!![],_0x54ecae();}),_0x1c0a22['on'](_0x6d00a7(0xe1),_0x4d1834=>{const _0x1b80fa=_0x6d00a7;void(async()=>{const _0x3ab44=a183_0x3ba7;_0xea00f4+=0x1,_0x5dd258+=_0x4d1834[_0x3ab44(0xbc)];if(_0xea00f4>MAX_ENTRY_COUNT)throw new Error(_0x3ab44(0xc2)+MAX_ENTRY_COUNT+'\x20entries.');if(_0x5dd258>MAX_UNCOMPRESSED_SIZE)throw new Error(_0x3ab44(0xc3));if(_0x4d1834['isEncrypted']())throw new Error('Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20'+_0x4d1834[_0x3ab44(0xb8)]);if(isSymbolicLink(_0x4d1834))throw new Error(_0x3ab44(0xd0)+_0x4d1834[_0x3ab44(0xb8)]);const {relativePath:_0x1e8ec8,directory:_0x178a2c}=validateEntryPath(_0x4d1834['fileName']),_0x131cc2=_0x1e8ec8[_0x3ab44(0xcf)](a183_0x3ac23d[_0x3ab44(0xcc)]);for(let _0x384711=0x1;_0x384711<=_0x131cc2[_0x3ab44(0xd2)];_0x384711+=0x1){const _0x398475=_0x131cc2[_0x3ab44(0xdf)](0x0,_0x384711)['join'](a183_0x3ac23d[_0x3ab44(0xcc)]),_0x3cb16c=_0x398475[_0x3ab44(0xc9)]('en-US'),_0xa82697=_0x21792e[_0x3ab44(0xb6)](_0x3cb16c);if(_0xa82697&&_0xa82697!==_0x398475)throw new Error('Case-conflicting\x20ZIP\x20entry\x20path:\x20'+_0x4d1834['fileName']);_0x21792e[_0x3ab44(0xc4)](_0x3cb16c,_0x398475);}const _0x1ce9b0=_0x1e8ec8[_0x3ab44(0xc9)]('en-US');if(_0x3edc65[_0x3ab44(0xbe)](_0x1ce9b0))throw new Error('Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20'+_0x4d1834[_0x3ab44(0xb8)]);_0x3edc65[_0x3ab44(0xbb)](_0x1ce9b0);const _0x1cddc8=a183_0x3ac23d[_0x3ab44(0xdc)](_0x41cc2f,_0x1e8ec8);if(_0x1cddc8!==_0x41cc2f&&!_0x1cddc8['startsWith'](''+_0x41cc2f+a183_0x3ac23d[_0x3ab44(0xcc)]))throw new Error(_0x3ab44(0xb7)+_0x4d1834['fileName']);if(_0x178a2c)await a183_0xffbab['mkdir'](_0x1cddc8,{'recursive':!![]});else{await a183_0xffbab['mkdir'](a183_0x3ac23d[_0x3ab44(0xdd)](_0x1cddc8),{'recursive':!![]});const _0x7734cb=await openEntryStream(_0x1c0a22,_0x4d1834);await pipeline(_0x7734cb,createWriteStream(_0x1cddc8,{'flags':'wx','mode':0x1a4}));}_0x1c0a22[_0x3ab44(0xba)]();})()[_0x1b80fa(0xdb)](_0x48a2d4);}),_0x1c0a22[_0x6d00a7(0xba)]();});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a184_0x4d46(_0x5c5a30,_0x140b79){_0x5c5a30=_0x5c5a30-0x16f;const _0x44dfa6=a184_0x44df();let _0x4d4687=_0x44dfa6[_0x5c5a30];return _0x4d4687;}(function(_0x17ea1e,_0x45ae3e){const _0x499ab1=a184_0x4d46,_0x5bf331=_0x17ea1e();while(!![]){try{const _0x46fbd5=parseInt(_0x499ab1(0x176))/0x1*(parseInt(_0x499ab1(0x175))/0x2)+parseInt(_0x499ab1(0x173))/0x3+-parseInt(_0x499ab1(0x16f))/0x4+-parseInt(_0x499ab1(0x171))/0x5*(-parseInt(_0x499ab1(0x177))/0x6)+-parseInt(_0x499ab1(0x174))/0x7+parseInt(_0x499ab1(0x179))/0x8*(-parseInt(_0x499ab1(0x170))/0x9)+parseInt(_0x499ab1(0x178))/0xa;if(_0x46fbd5===_0x45ae3e)break;else _0x5bf331['push'](_0x5bf331['shift']());}catch(_0x175291){_0x5bf331['push'](_0x5bf331['shift']());}}}(a184_0x44df,0x7feb2));function a184_0x44df(){const _0x111761=['1802220wHjoEJ','140402uLNhGU','2HNUHYu','168xCHMEB','1608630SohWLU','1295256hWVpLx','2993828cSflSa','9tSMRXB','130155vigWIZ','resolve','1984935shvuFK'];a184_0x44df=function(){return _0x111761;};return a184_0x44df();}import a184_0x38bfa1 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a184_0x38bfa1['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x359811=a184_0x4d46;return a184_0x38bfa1[_0x359811(0x172)](__dirname,'../../../../');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x131a84,_0x122f33){const _0x5d1e46=a185_0x3785,_0x495e78=_0x131a84();while(!![]){try{const _0x3f9a3f=-parseInt(_0x5d1e46(0x90))/0x1*(-parseInt(_0x5d1e46(0x91))/0x2)+-parseInt(_0x5d1e46(0x8a))/0x3+-parseInt(_0x5d1e46(0x8e))/0x4+parseInt(_0x5d1e46(0x85))/0x5*(-parseInt(_0x5d1e46(0x97))/0x6)+-parseInt(_0x5d1e46(0x93))/0x7*(-parseInt(_0x5d1e46(0x88))/0x8)+parseInt(_0x5d1e46(0x84))/0x9*(-parseInt(_0x5d1e46(0x92))/0xa)+-parseInt(_0x5d1e46(0x8d))/0xb*(-parseInt(_0x5d1e46(0x96))/0xc);if(_0x3f9a3f===_0x122f33)break;else _0x495e78['push'](_0x495e78['shift']());}catch(_0x3f743f){_0x495e78['push'](_0x495e78['shift']());}}}(a185_0xd137,0x98328));import a185_0x44b02b from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a185_0x3785(_0x58d0d8,_0x2ce6ad){_0x58d0d8=_0x58d0d8-0x84;const _0xd13734=a185_0xd137();let _0x37854b=_0xd13734[_0x58d0d8];return _0x37854b;}import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';function a185_0xd137(){const _0x178422=['copy','message','209ingjAO','1352448jhPzCQ','version','1gfWTuf','167798zrrZof','1867640PwaBxG','959EiEWal','Project\x20template\x20created','cwd','1900332SkRIoa','6930246SnzvGD','source','error','9uNQVuI','5JXDZiK','Starting\x20project\x20template\x20creation','Failed\x20to\x20copy\x20project\x20template','2584iAznPZ','now','2501076ZupDhc'];a185_0xd137=function(){return _0x178422;};return a185_0xd137();}export async function copyProjectTemplate(_0x23d366,_0x37cd13,_0x4aa151){const _0x18404c=a185_0x3785,_0x1c8f1e=Date[_0x18404c(0x89)](),_0x7cc8df=a185_0x44b02b['resolve'](process[_0x18404c(0x95)](),_0x23d366);try{logger['info'](_0x18404c(0x8b),_0x18404c(0x86),{'projectCode':_0x23d366});const _0x57c9b4=_0x4aa151?await materializeLocalProjectTemplate(_0x4aa151,_0x7cc8df,_0x37cd13):await materializeProjectTemplate(_0x7cc8df,_0x37cd13),_0x2afddd=Date['now']()-_0x1c8f1e;logger['success']('copy',_0x18404c(0x94),_0x2afddd,{'projectCode':_0x23d366,'templateSource':_0x57c9b4[_0x18404c(0x98)],'templateVersion':_0x57c9b4[_0x18404c(0x8f)]});}catch(_0x4705cd){const _0x152b3f=Date[_0x18404c(0x89)]()-_0x1c8f1e;logger[_0x18404c(0x99)]('copy',_0x18404c(0x87),{'projectCode':_0x23d366,'error':_0x4705cd instanceof Error?_0x4705cd[_0x18404c(0x8c)]:String(_0x4705cd),'duration':_0x152b3f});throw _0x4705cd;}return formatElapsed(_0x1c8f1e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1898a4,_0x445c0e){const _0x4162d1=a186_0x9c08,_0x456f5c=_0x1898a4();while(!![]){try{const _0x4aa6b2=parseInt(_0x4162d1(0x1c3))/0x1*(-parseInt(_0x4162d1(0x1c0))/0x2)+parseInt(_0x4162d1(0x1c2))/0x3+parseInt(_0x4162d1(0x1d6))/0x4+parseInt(_0x4162d1(0x1cd))/0x5*(-parseInt(_0x4162d1(0x1d5))/0x6)+-parseInt(_0x4162d1(0x1c9))/0x7*(parseInt(_0x4162d1(0x1ca))/0x8)+parseInt(_0x4162d1(0x1cb))/0x9+parseInt(_0x4162d1(0x1c7))/0xa;if(_0x4aa6b2===_0x445c0e)break;else _0x456f5c['push'](_0x456f5c['shift']());}catch(_0x5ebd3c){_0x456f5c['push'](_0x456f5c['shift']());}}}(a186_0x519f,0xce995));import a186_0x216ea4 from'node:path';function a186_0x9c08(_0x1f5933,_0x4a5b3a){_0x1f5933=_0x1f5933-0x1c0;const _0x519fe4=a186_0x519f();let _0x9c0860=_0x519fe4[_0x1f5933];return _0x9c0860;}import{execa}from'execa';function a186_0x519f(){const _0x54c26c=['message','Code\x20format\x20completed','npx','cwd','6qpLZpj','3958284gQBBzv','878732hVIWrz','prettier','695910HeHshe','2AVdSTS','now','success','resolve','1476750WRCgHx','Starting\x20code\x20format','1558991loMItX','8ZGHmNO','10057608fjSlIK','--write','2695270EracKa','format','info','error'];a186_0x519f=function(){return _0x54c26c;};return a186_0x519f();}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(_0x160a01){const _0x38fc69=a186_0x9c08,_0x5a7813=Date['now'](),_0x257e61=a186_0x216ea4[_0x38fc69(0x1c6)](process[_0x38fc69(0x1d4)](),_0x160a01);try{logger[_0x38fc69(0x1cf)](_0x38fc69(0x1ce),_0x38fc69(0x1c8),{'projectCode':_0x160a01}),await execa(resolveNpmBin(_0x38fc69(0x1d3)),[_0x38fc69(0x1c1),_0x38fc69(0x1cc),'.'],{'cwd':_0x257e61});const _0xfcae54=Date[_0x38fc69(0x1c4)]()-_0x5a7813;logger[_0x38fc69(0x1c5)](_0x38fc69(0x1ce),_0x38fc69(0x1d2),_0xfcae54,{'projectCode':_0x160a01});}catch(_0x57ad08){const _0x5d2b27=Date[_0x38fc69(0x1c4)]()-_0x5a7813;logger[_0x38fc69(0x1d0)](_0x38fc69(0x1ce),'Code\x20format\x20failed',{'projectCode':_0x160a01,'error':_0x57ad08 instanceof Error?_0x57ad08[_0x38fc69(0x1d1)]:String(_0x57ad08),'duration':_0x5d2b27});throw _0x57ad08;}return formatElapsed(_0x5a7813);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x48ea29,_0x33f676){const _0x1b1b5d=a187_0xd8fa,_0x3e2a68=_0x48ea29();while(!![]){try{const _0x5acac8=parseInt(_0x1b1b5d(0x167))/0x1+-parseInt(_0x1b1b5d(0x168))/0x2+-parseInt(_0x1b1b5d(0x173))/0x3*(-parseInt(_0x1b1b5d(0x178))/0x4)+parseInt(_0x1b1b5d(0x172))/0x5*(parseInt(_0x1b1b5d(0x174))/0x6)+parseInt(_0x1b1b5d(0x16d))/0x7*(-parseInt(_0x1b1b5d(0x165))/0x8)+-parseInt(_0x1b1b5d(0x177))/0x9*(parseInt(_0x1b1b5d(0x171))/0xa)+parseInt(_0x1b1b5d(0x175))/0xb;if(_0x5acac8===_0x33f676)break;else _0x3e2a68['push'](_0x3e2a68['shift']());}catch(_0x56ea57){_0x3e2a68['push'](_0x3e2a68['shift']());}}}(a187_0x196d,0x2460b));import a187_0x33ccf7 from'node:path';function a187_0x196d(){const _0x6c3e9d=['error','https://registry.npmmirror.com','install','1256675HYZazn','Starting\x20dependency\x20install','now','resolve','50uolpSa','52645cGMgOT','65253tdkkuu','162qjPncH','1820137GqHwgb','message','15957CzgIVV','8tgyVmD','info','npm','8nXrgIX','cwd','30209ArFiUB','372136fZCfXn','Dependency\x20install\x20failed'];a187_0x196d=function(){return _0x6c3e9d;};return a187_0x196d();}import{execa}from'execa';function a187_0xd8fa(_0x574090,_0x419c82){_0x574090=_0x574090-0x163;const _0x196d5b=a187_0x196d();let _0xd8fa83=_0x196d5b[_0x574090];return _0xd8fa83;}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(_0x1f30fd){const _0x34e54c=a187_0xd8fa,_0x87a5b2=Date['now'](),_0x143ae7=a187_0x33ccf7[_0x34e54c(0x170)](process[_0x34e54c(0x166)](),_0x1f30fd);try{logger[_0x34e54c(0x163)](_0x34e54c(0x16c),_0x34e54c(0x16e),{'projectCode':_0x1f30fd,'registry':_0x34e54c(0x16b)}),await execa(resolveNpmBin(_0x34e54c(0x164)),[_0x34e54c(0x16c),'--registry','https://registry.npmmirror.com'],{'cwd':_0x143ae7});const _0x1b571d=Date['now']()-_0x87a5b2;logger['success']('install','Dependency\x20install\x20completed',_0x1b571d,{'projectCode':_0x1f30fd});}catch(_0x3b6645){const _0x4ecc0e=Date[_0x34e54c(0x16f)]()-_0x87a5b2;logger[_0x34e54c(0x16a)](_0x34e54c(0x16c),_0x34e54c(0x169),{'projectCode':_0x1f30fd,'error':_0x3b6645 instanceof Error?_0x3b6645[_0x34e54c(0x176)]:String(_0x3b6645),'duration':_0x4ecc0e});throw _0x3b6645;}return formatElapsed(_0x87a5b2);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a188_0x518b44=a188_0x3c34;(function(_0x3d012b,_0x3d0f5f){const _0x410033=a188_0x3c34,_0x4495cc=_0x3d012b();while(!![]){try{const _0x354503=-parseInt(_0x410033(0xd1))/0x1*(parseInt(_0x410033(0xcf))/0x2)+parseInt(_0x410033(0xc4))/0x3*(parseInt(_0x410033(0xca))/0x4)+-parseInt(_0x410033(0xcd))/0x5*(parseInt(_0x410033(0xc1))/0x6)+parseInt(_0x410033(0xd0))/0x7*(-parseInt(_0x410033(0xcb))/0x8)+parseInt(_0x410033(0xc5))/0x9+parseInt(_0x410033(0xc8))/0xa*(parseInt(_0x410033(0xbe))/0xb)+parseInt(_0x410033(0xce))/0xc;if(_0x354503===_0x3d0f5f)break;else _0x4495cc['push'](_0x4495cc['shift']());}catch(_0x4590ef){_0x4495cc['push'](_0x4495cc['shift']());}}}(a188_0x3f09,0x482cf));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a188_0x3f09(){const _0x1435e5=['path','domain-routing-sync','144XQdhBH','Run\x20','No\x20Rabetbase\x20project\x20configuration\x20was\x20found.','591DCAbEP','508086ywhJLY','Domain\x20routing\x20synchronized:\x20','\x20workspace\x20init\x20--appcode\x20<code>\x20in\x20the\x20project\x20directory\x20first.','50udoeEj','Synchronize\x20the\x20current\x20project\x27s\x20public\x20Domain\x20routing','4748PwPKlA','2350776zIOGXB','validation','66540PbbvkH','5475384aROCrI','152256KfDadU','7ofHLDv','5ZziYtd','read','1194457wuQvoQ'];a188_0x3f09=function(){return _0x1435e5;};return a188_0x3f09();}import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';function a188_0x3c34(_0x2d9754,_0x4552d1){_0x2d9754=_0x2d9754-0xbd;const _0x3f093e=a188_0x3f09();let _0x3c344f=_0x3f093e[_0x2d9754];return _0x3c344f;}import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';export const projectDomainRoutingSyncDefinition={'service':'project','command':a188_0x518b44(0xc0),'description':a188_0x518b44(0xc9),'risk':a188_0x518b44(0xbd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(){const _0x33bbcc=a188_0x518b44,_0x377ef4=findProjectRootDirectory();if(!resolveConfigPath(_0x377ef4))throw CliErrors[_0x33bbcc(0xcc)](_0x33bbcc(0xc3),_0x33bbcc(0xc2)+CLI_BIN_NAME+_0x33bbcc(0xc7));const _0x45b6a=writeProjectDomainRoutingManifest(_0x377ef4);return{'ok':!![],'message':_0x33bbcc(0xc6)+_0x45b6a[_0x33bbcc(0xbf)],'data':_0x45b6a};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a189_0x279e94=a189_0xdc8b;(function(_0x44a769,_0x371867){const _0x32920f=a189_0xdc8b,_0x593e67=_0x44a769();while(!![]){try{const _0x5f193f=parseInt(_0x32920f(0x1d3))/0x1+parseInt(_0x32920f(0x1cc))/0x2+parseInt(_0x32920f(0x1b1))/0x3*(parseInt(_0x32920f(0x1c1))/0x4)+-parseInt(_0x32920f(0x1c2))/0x5+parseInt(_0x32920f(0x1cb))/0x6*(parseInt(_0x32920f(0x1bf))/0x7)+-parseInt(_0x32920f(0x1ce))/0x8*(-parseInt(_0x32920f(0x1b3))/0x9)+-parseInt(_0x32920f(0x1d6))/0xa;if(_0x5f193f===_0x371867)break;else _0x593e67['push'](_0x593e67['shift']());}catch(_0x166eef){_0x593e67['push'](_0x593e67['shift']());}}}(a189_0x4b09,0x70179));import{CliErrors}from'../../errors.js';function a189_0xdc8b(_0x2a3dc6,_0x5b688e){_0x2a3dc6=_0x2a3dc6-0x1b1;const _0x4b09c5=a189_0x4b09();let _0xdc8b82=_0x4b09c5[_0x2a3dc6];return _0xdc8b82;}function a189_0x4b09(){const _0x1cd861=['../../commands/project/create/main.js','create','boolean','yes','project-name','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]','str','66xaNGCh','1690118fyfrWE','write','43864kuZHYY','name','trim','Run\x20','env','484874vyEOWX','appcode','cookie','7221000lsGOTZ','validation','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','args','3EYbpgG','upgrade','45yeSrWK','template-source','nonInteractive','Prepared\x20local\x20project\x20template\x20directory','Skip\x20confirmation\x20prompt','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','bool','--current-dir\x20cannot\x20be\x20combined\x20with\x20a\x20project\x20name.','project','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]\x20or\x20','string','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]\x20from\x20the\x20empty\x20target\x20directory.','2191tzhVLt','Target\x20environment','2110748basUEP','3536245DNYXLw','current-dir'];a189_0x4b09=function(){return _0x1cd861;};return a189_0x4b09();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';import{projectDomainRoutingSyncDefinition}from'../../commands/project/domain-routing-sync.js';const createFlags=[{'name':a189_0x279e94(0x1cf),'type':a189_0x279e94(0x1bd),'description':'Project\x20name'},{'name':a189_0x279e94(0x1d2),'type':'string','description':a189_0x279e94(0x1c0)},{'name':'appcode','type':'string','description':'App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'},{'name':a189_0x279e94(0x1c3),'type':a189_0x279e94(0x1c6),'description':'Initialize\x20the\x20current\x20empty\x20directory\x20instead\x20of\x20creating\x20a\x20child\x20directory','default':![]},{'name':a189_0x279e94(0x1b4),'type':'string','description':a189_0x279e94(0x1b6)}],upgradeFlags=[{'name':a189_0x279e94(0x1c7),'type':a189_0x279e94(0x1c6),'description':a189_0x279e94(0x1b7),'default':![]}];export const projectDefinitions=[{'service':a189_0x279e94(0x1bb),'command':a189_0x279e94(0x1c5),'description':'Create\x20a\x20new\x20project','risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a189_0x279e94(0x1c8),'description':a189_0x279e94(0x1d8),'required':![]}],'flags':createFlags,async 'execute'(_0x518f6b){const _0x2dec7f=a189_0x279e94,{createApp:_0x5f1cf3}=await import(_0x2dec7f(0x1c4)),_0x965c36=_0x518f6b[_0x2dec7f(0x1ca)]('name')[_0x2dec7f(0x1d0)]()||_0x518f6b[_0x2dec7f(0x1d9)][0x0]?.[_0x2dec7f(0x1d0)](),_0x339cc8=_0x518f6b[_0x2dec7f(0x1ca)](_0x2dec7f(0x1d2))||undefined,_0x16a380=_0x518f6b[_0x2dec7f(0x1ca)](_0x2dec7f(0x1d4))||undefined,_0x2e773f=_0x518f6b['str'](_0x2dec7f(0x1b4))[_0x2dec7f(0x1d0)]()||undefined,_0x56a4bd=_0x518f6b['bool'](_0x2dec7f(0x1c3));if(_0x56a4bd&&_0x965c36)throw CliErrors[_0x2dec7f(0x1d7)](_0x2dec7f(0x1ba),_0x2dec7f(0x1d1)+CLI_BIN_NAME+_0x2dec7f(0x1be));if(_0x518f6b[_0x2dec7f(0x1b5)]){if(!_0x965c36&&!_0x56a4bd)throw CliErrors['validation']('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Usage:\x20'+CLI_BIN_NAME+_0x2dec7f(0x1bc)+CLI_BIN_NAME+_0x2dec7f(0x1c9));await _0x5f1cf3({'projectCode':_0x965c36,'appCode':_0x16a380,'env':_0x339cc8,'cookie':_0x518f6b[_0x2dec7f(0x1d5)],'currentDir':_0x56a4bd,'nonInteractive':!![],'templateSource':_0x2e773f});}else await _0x5f1cf3({'projectCode':_0x965c36,'appCode':_0x16a380,'env':_0x339cc8,'cookie':_0x518f6b['cookie'],'currentDir':_0x56a4bd,'templateSource':_0x2e773f});return{'ok':!![]};}},projectDomainRoutingSyncDefinition,{'service':a189_0x279e94(0x1bb),'command':a189_0x279e94(0x1b2),'description':a189_0x279e94(0x1b8),'risk':a189_0x279e94(0x1cd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x3c3ded){const _0x22d7df=a189_0x279e94;return await upgradeApp(_0x3c3ded['nonInteractive'],{'yes':_0x3c3ded[_0x22d7df(0x1b9)]('yes')}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a191_0x56c7b3=a191_0x14b0;(function(_0x523ecf,_0x4fabdc){const _0x30afe9=a191_0x14b0,_0x58f5e4=_0x523ecf();while(!![]){try{const _0x2e227d=parseInt(_0x30afe9(0x241))/0x1+-parseInt(_0x30afe9(0x23b))/0x2*(parseInt(_0x30afe9(0x20b))/0x3)+-parseInt(_0x30afe9(0x233))/0x4*(parseInt(_0x30afe9(0x1e0))/0x5)+parseInt(_0x30afe9(0x1ee))/0x6+parseInt(_0x30afe9(0x1e2))/0x7+parseInt(_0x30afe9(0x23a))/0x8*(-parseInt(_0x30afe9(0x1e6))/0x9)+parseInt(_0x30afe9(0x209))/0xa;if(_0x2e227d===_0x4fabdc)break;else _0x58f5e4['push'](_0x58f5e4['shift']());}catch(_0x502f7b){_0x58f5e4['push'](_0x58f5e4['shift']());}}}(a191_0x4c12,0xb001d));import a191_0x56ef4e from'chalk';function a191_0x4c12(){const _0xc22929=['label','undefined','\x20\x20\x20\x20\x20\x20\x20','includes','@lovrabet/sdk','start','===\x20Upgrade\x20Summary\x20===','\x20\x20Fields\x20to\x20migrate:\x20','.cursor/mcp.json','Proceed\x20with\x20upgrade?','fields','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','cyan','\x20\x20#\x20or','inherit','needed','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','\x20\x20New\x20config\x20(.rabetbase.json):\x20','MCP\x20config:','error','yellow','bold','FOUND','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','@lovrabet/dataset-mcp-server','succeed','message','Step\x201/7:\x20Config\x20migration\x20—\x20','\x20\x20Action:\x20delete','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','join','Install\x20new\x20skill','files','push','red','Upgrade\x20cancelled.','already\x20exists\x20(will\x20merge)','Remove\x20old\x20skill','4hxkyYW','===\x20Upgrade\x20Analysis\x20===','fail','@lovrabet/sdk:','\x20\x20bun\x20install','no\x20legacy\x20entry','Upgrade\x20@lovrabet/sdk','920snnKpc','15470nVoPKP','info','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','\x20removed','args','isArray','1369069idusoe','\x20from\x20','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','.bak','object','not\x20found\x20(will\x20create)','keys','lovrabet/rabetbase\x20installed\x20globally','failed','oldMcpConfig','\x20(backup:\x20','Remove\x20.lovrabet/','latest','parse','exit\x20','CANCEL','string','gray','not\x20found\x20or\x20already\x20at\x20latest','oldArtifacts','log','Step\x204/7:\x20MCP\x20config\x20—\x20','skipped','no\x20legacy\x20config\x20found','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','detail','\x20→\x20','Config\x20migration','mcpServers','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','5994565MesHcL','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','9385957kkdGXA','Legacy\x20artifacts:','Remove\x20legacy\x20artifacts','stringify','49239YjPOwm','length','isDirectory','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','Clean\x20MCP\x20config','lovrabet/lovrabet-skill\x20removed','utf8','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','1677906buwiqF','\x20\x20npm\x20install','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','Step\x205/7:\x20Removing\x20old\x20skill...','Step\x204/7:\x20Cleaning\x20MCP\x20config...','Config\x20file:','step','oldPath','Upgrade\x20completed\x20successfully!','removed\x20','hasNewConfig','.claude/skills/lovrabet','white','none\x20found','green','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','done','sdkUpgrade','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','status','Step\x201/7:\x20Migrating\x20config...','path','.lovrabet.json','\x20\x20Step\x20','cwd','entries','\x20removed\x20(','2633170NDwQUX','some','273ODmqJP','package.json'];a191_0x4c12=function(){return _0xc22929;};return a191_0x4c12();}import a191_0x900295 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=[a191_0x56c7b3(0x204),'.lovrabetrc'];function collectIdeSkillFiles(_0x4cfc1c){const _0x1356f8=a191_0x56c7b3,_0x9efbd1=[];for(const _0x2c1246 of Object['values'](CORE_IDE_CONFIGS)){if(_0x2c1246[_0x1356f8(0x22d)])for(const _0x214875 of _0x2c1246['files']){_0x9efbd1[_0x1356f8(0x22e)](resolve(_0x4cfc1c,_0x214875[_0x1356f8(0x203)]));}}return _0x9efbd1;}function analyse(_0x3b9617){const _0x1ed961=a191_0x56c7b3;let _0x4a4446=null;const _0x3aafa2=resolve(_0x3b9617,NEW_CONFIG_NAME),_0x14a999=existsSync(_0x3aafa2);for(const _0xd561b0 of LEGACY_CONFIG_NAMES){const _0x24a256=resolve(_0x3b9617,_0xd561b0);if(existsSync(_0x24a256)){const _0xb89fa7=readConfigFile(_0x24a256),_0x332fcd=Object[_0x1ed961(0x247)](_0xb89fa7)['filter'](_0x2e2232=>typeof _0xb89fa7[_0x2e2232]!==_0x1ed961(0x20e));_0x4a4446={'oldPath':_0x24a256,'hasNewConfig':_0x14a999,'fields':_0x332fcd};break;}}const _0x59b499=[],_0x42e9bb=resolve(_0x3b9617,'.lovrabet');if(existsSync(_0x42e9bb))_0x59b499['push'](_0x42e9bb);const _0x4e7db8=resolve(_0x3b9617,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x4e7db8))_0x59b499[_0x1ed961(0x22e)](_0x4e7db8);const _0x590a10=resolve(_0x3b9617,_0x1ed961(0x1f9));if(existsSync(_0x590a10))_0x59b499[_0x1ed961(0x22e)](_0x590a10);for(const _0x233397 of collectIdeSkillFiles(_0x3b9617)){if(existsSync(_0x233397))_0x59b499[_0x1ed961(0x22e)](_0x233397);}let _0x1736aa=null;const _0x1fa885=resolve(_0x3b9617,_0x1ed961(0x215));if(existsSync(_0x1fa885))try{const _0x3cae47=JSON[_0x1ed961(0x24e)](readFileSync(_0x1fa885,_0x1ed961(0x1ec)));if(_0x3cae47?.[_0x1ed961(0x1de)]&&typeof _0x3cae47['mcpServers']==='object'){const _0x400c2d=[];for(const [_0x2a478f,_0x116d3b]of Object['entries'](_0x3cae47[_0x1ed961(0x1de)])){const _0xd921a8=_0x116d3b;_0xd921a8?.['args']&&Array[_0x1ed961(0x240)](_0xd921a8[_0x1ed961(0x23f)])&&_0xd921a8[_0x1ed961(0x23f)][_0x1ed961(0x20a)](_0x3db1f5=>typeof _0x3db1f5===_0x1ed961(0x1d1)&&_0x3db1f5['includes'](_0x1ed961(0x225)))&&_0x400c2d['push'](_0x2a478f);}_0x400c2d[_0x1ed961(0x1e7)]>0x0&&(_0x1736aa={'path':_0x1fa885,'keys':_0x400c2d});}}catch{}const _0x95ea51=_0x59b499['length']>0x0||_0x4a4446!==null;let _0x29c0d0=null;const _0x1f4b56=resolve(_0x3b9617,_0x1ed961(0x20c));if(existsSync(_0x1f4b56))try{const _0x5e8954=JSON[_0x1ed961(0x24e)](readFileSync(_0x1f4b56,'utf8'));for(const _0x479948 of['dependencies','devDependencies']){const _0x3b3b8e=_0x5e8954?.[_0x479948]?.[_0x1ed961(0x211)];if(typeof _0x3b3b8e===_0x1ed961(0x1d1)){_0x3b3b8e!==_0x1ed961(0x24d)&&(_0x29c0d0={'pkgPath':_0x1f4b56,'currentVersion':_0x3b3b8e,'field':_0x479948});break;}}}catch{}return{'configMigration':_0x4a4446,'oldArtifacts':_0x59b499,'oldMcpConfig':_0x1736aa,'needsSkillSwap':_0x95ea51,'sdkUpgrade':_0x29c0d0};}function printReport(_0x9eecc6){const _0x15a78d=a191_0x56c7b3,{configMigration:_0x4048fa,oldArtifacts:_0x507ca0,oldMcpConfig:_0x633d8,needsSkillSwap:_0x1af5c7}=_0x9eecc6;console[_0x15a78d(0x1d5)](''),console['log'](a191_0x56ef4e[_0x15a78d(0x222)](_0x15a78d(0x234))),console[_0x15a78d(0x1d5)]('');_0x4048fa?(console['log'](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x1f3))+('\x20\x20'+a191_0x56ef4e[_0x15a78d(0x221)](_0x4048fa['oldPath']))),console[_0x15a78d(0x1d5)](_0x15a78d(0x21e)+(_0x4048fa[_0x15a78d(0x1f8)]?a191_0x56ef4e[_0x15a78d(0x1fc)](_0x15a78d(0x231)):a191_0x56ef4e[_0x15a78d(0x1d2)](_0x15a78d(0x246)))),console[_0x15a78d(0x1d5)](_0x15a78d(0x214)+_0x4048fa[_0x15a78d(0x217)][_0x15a78d(0x22b)](',\x20')),console['log'](_0x15a78d(0x1da))):console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x1f3))+'\x20\x20'+a191_0x56ef4e['gray'](_0x15a78d(0x1d8)));console[_0x15a78d(0x1d5)]('');if(_0x507ca0[_0x15a78d(0x1e7)]>0x0){console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x1e3)));for(const _0x47be43 of _0x507ca0){console[_0x15a78d(0x1d5)]('\x20\x20'+a191_0x56ef4e[_0x15a78d(0x22f)](_0x15a78d(0x223))+'\x20\x20'+_0x47be43);}console[_0x15a78d(0x1d5)](_0x15a78d(0x229));}else console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x1e3))+'\x20\x20'+a191_0x56ef4e['gray'](_0x15a78d(0x1fb)));console[_0x15a78d(0x1d5)]('');_0x633d8?(console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)]('MCP\x20config:')+('\x20\x20'+a191_0x56ef4e[_0x15a78d(0x221)](_0x633d8[_0x15a78d(0x203)])+'\x20→\x20keys:\x20'+_0x633d8[_0x15a78d(0x247)]['join'](',\x20'))),console[_0x15a78d(0x1d5)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x21f))+'\x20\x20'+a191_0x56ef4e[_0x15a78d(0x1d2)](_0x15a78d(0x238)));console[_0x15a78d(0x1d5)](''),console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)]('Skill\x20swap:')+('\x20\x20'+(_0x1af5c7?a191_0x56ef4e[_0x15a78d(0x221)](_0x15a78d(0x21c)):a191_0x56ef4e[_0x15a78d(0x1fc)]('not\x20needed'))));_0x1af5c7&&console[_0x15a78d(0x1d5)](_0x15a78d(0x1df)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x15a78d(0x1d5)]('');if(_0x9eecc6[_0x15a78d(0x1ff)]){const {currentVersion:_0x5b5a74,field:_0x589e03,pkgPath:_0x14734e}=_0x9eecc6[_0x15a78d(0x1ff)];console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x236))+('\x20\x20'+a191_0x56ef4e[_0x15a78d(0x221)](_0x14734e))),console[_0x15a78d(0x1d5)]('\x20\x20Current\x20version\x20in\x20'+_0x589e03+':\x20'+a191_0x56ef4e[_0x15a78d(0x221)](_0x5b5a74)+_0x15a78d(0x1dc)+a191_0x56ef4e[_0x15a78d(0x1fc)](_0x15a78d(0x24d))),console['log'](_0x15a78d(0x1e9));}else console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)]('@lovrabet/sdk:')+'\x20\x20'+a191_0x56ef4e[_0x15a78d(0x1d2)](_0x15a78d(0x1d3)));console[_0x15a78d(0x1d5)]('');}function execConfigMigration(_0x18c35c,_0x4e6afd){const _0x4bede8=a191_0x56c7b3,{configMigration:_0x76f5cd}=_0x18c35c;if(!_0x76f5cd?.[_0x4bede8(0x1f5)])return{'step':0x1,'label':_0x4bede8(0x1dd),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x32afb2=readConfigFile(_0x76f5cd[_0x4bede8(0x1f5)]),_0x2ed149=resolve(_0x4e6afd,NEW_CONFIG_NAME),_0x399221=_0x76f5cd[_0x4bede8(0x1f8)]?readConfigFile(_0x2ed149):{};for(const [_0xe7a401,_0x5ed07b]of Object['entries'](_0x32afb2)){!(_0xe7a401 in _0x399221)&&(_0x399221[_0xe7a401]=_0x5ed07b);}writeConfigFile(_0x2ed149,_0x399221);const _0x2a0f81=_0x76f5cd[_0x4bede8(0x1f5)]+_0x4bede8(0x244);return renameSync(_0x76f5cd['oldPath'],_0x2a0f81),{'step':0x1,'label':_0x4bede8(0x1dd),'ok':!![],'detail':_0x76f5cd[_0x4bede8(0x1f5)]+_0x4bede8(0x1dc)+_0x2ed149+_0x4bede8(0x24b)+_0x2a0f81+')'};}function execRemoveOldArtifacts(_0x4d97ee){const _0x2a967d=a191_0x56c7b3,_0x52318c=[];for(const _0x262202 of _0x4d97ee){try{if(!existsSync(_0x262202))continue;const _0x392e17=tryStat(_0x262202);_0x392e17?.[_0x2a967d(0x1e8)]()?rmSync(_0x262202,{'recursive':!![],'force':!![]}):unlinkSync(_0x262202);}catch(_0x5ac42c){_0x52318c[_0x2a967d(0x22e)](_0x262202+':\x20'+_0x5ac42c['message']);}}return{'step':0x3,'label':_0x2a967d(0x1e4),'ok':_0x52318c[_0x2a967d(0x1e7)]===0x0,'detail':_0x52318c[_0x2a967d(0x1e7)]>0x0?_0x4d97ee[_0x2a967d(0x1e7)]-_0x52318c['length']+'/'+_0x4d97ee[_0x2a967d(0x1e7)]+_0x2a967d(0x208)+_0x52318c[_0x2a967d(0x22b)](';\x20')+')':_0x4d97ee['length']+_0x2a967d(0x23e)};}function execCleanMcp(_0x56c4d8){const _0x20611f=a191_0x56c7b3;if(!_0x56c4d8[_0x20611f(0x24a)])return{'step':0x4,'label':_0x20611f(0x1ea),'ok':!![],'detail':_0x20611f(0x1d7)};try{const _0x4d990f=readFileSync(_0x56c4d8[_0x20611f(0x24a)][_0x20611f(0x203)],_0x20611f(0x1ec)),_0x15d2f8=JSON[_0x20611f(0x24e)](_0x4d990f);if(_0x15d2f8?.[_0x20611f(0x1de)]&&typeof _0x15d2f8[_0x20611f(0x1de)]===_0x20611f(0x245)){const _0x54b767=[];for(const [_0x220920,_0x49c845]of Object[_0x20611f(0x207)](_0x15d2f8[_0x20611f(0x1de)])){_0x49c845?.['args']&&Array[_0x20611f(0x240)](_0x49c845['args'])&&_0x49c845['args'][_0x20611f(0x20a)](_0x36f043=>typeof _0x36f043===_0x20611f(0x1d1)&&_0x36f043[_0x20611f(0x210)]('@lovrabet/dataset-mcp-server'))&&_0x54b767[_0x20611f(0x22e)](_0x220920);}for(const _0x133df3 of _0x54b767){delete _0x15d2f8[_0x20611f(0x1de)][_0x133df3];}return _0x54b767[_0x20611f(0x1e7)]>0x0&&writeFileSync(_0x56c4d8['oldMcpConfig'][_0x20611f(0x203)],JSON[_0x20611f(0x1e5)](_0x15d2f8,null,0x2)+'\x0a',_0x20611f(0x1ec)),{'step':0x4,'label':_0x20611f(0x1ea),'ok':!![],'detail':_0x20611f(0x1f7)+_0x54b767[_0x20611f(0x22b)](',\x20')+_0x20611f(0x242)+_0x56c4d8[_0x20611f(0x24a)][_0x20611f(0x203)]};}return{'step':0x4,'label':_0x20611f(0x1ea),'ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0x44021c){return{'step':0x4,'label':_0x20611f(0x1ea),'ok':![],'detail':_0x44021c['message']};}}function execSkillsRemove(_0x1ec285,_0x3343d4){const _0xa5bfe8=a191_0x56c7b3,_0x493ba1=runNpxSkillsRemove(_0x1ec285,{'stdio':_0xa5bfe8(0x21b),'yes':_0x3343d4});return{'step':0x5,'label':_0xa5bfe8(0x232),'ok':_0x493ba1['ok'],'detail':_0x493ba1['ok']?_0xa5bfe8(0x1eb):_0x493ba1[_0xa5bfe8(0x220)]??_0xa5bfe8(0x1cf)+_0x493ba1[_0xa5bfe8(0x201)]};}function execSkillsAdd(_0x131e40,_0x32e5fe){const _0x45d85c=a191_0x56c7b3,_0x4e5cae=runNpxSkillsAddGlobal(_0x131e40,'lovrabet/rabetbase',{'stdio':_0x45d85c(0x21b),'yes':_0x32e5fe});return{'step':0x6,'label':_0x45d85c(0x22c),'ok':_0x4e5cae['ok'],'detail':_0x4e5cae['ok']?_0x45d85c(0x248):_0x4e5cae['error']??_0x45d85c(0x1cf)+_0x4e5cae[_0x45d85c(0x201)]};}function execUpgradeSdk(_0x395a20){const _0x246262=a191_0x56c7b3;if(!_0x395a20[_0x246262(0x1ff)])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x246262(0x23d)};const {pkgPath:_0x386dcc,currentVersion:_0x2aaa58,field:_0xe990ab}=_0x395a20[_0x246262(0x1ff)];try{const _0x4e517c=readFileSync(_0x386dcc,_0x246262(0x1ec)),_0x2546e8=JSON[_0x246262(0x24e)](_0x4e517c);return _0x2546e8[_0xe990ab][_0x246262(0x211)]=_0x246262(0x24d),writeFileSync(_0x386dcc,JSON['stringify'](_0x2546e8,null,0x2)+'\x0a',_0x246262(0x1ec)),{'step':0x7,'label':_0x246262(0x239),'ok':!![],'detail':_0xe990ab+'[\x22@lovrabet/sdk\x22]:\x20'+_0x2aaa58+'\x20→\x20latest'};}catch(_0x478826){return{'step':0x7,'label':_0x246262(0x239),'ok':![],'detail':_0x478826[_0x246262(0x227)]};}}function tryStat(_0x1bfc6b){try{return statSync(_0x1bfc6b);}catch{return undefined;}}function a191_0x14b0(_0x2d59dd,_0x1946c0){_0x2d59dd=_0x2d59dd-0x1cf;const _0x4c127d=a191_0x4c12();let _0x14b000=_0x4c127d[_0x2d59dd];return _0x14b000;}function printSummary(_0x5d13c2){const _0x2254fe=a191_0x56c7b3;console[_0x2254fe(0x1d5)](''),console['log'](a191_0x56ef4e[_0x2254fe(0x222)](_0x2254fe(0x213))),console[_0x2254fe(0x1d5)]('');for(const _0x4e89b0 of _0x5d13c2){const _0x5224e7=_0x4e89b0['ok']?a191_0x56ef4e[_0x2254fe(0x1fc)]('OK'):a191_0x56ef4e[_0x2254fe(0x22f)]('FAIL');console[_0x2254fe(0x1d5)]('\x20\x20'+_0x5224e7+_0x2254fe(0x205)+_0x4e89b0[_0x2254fe(0x1f4)]+':\x20'+_0x4e89b0[_0x2254fe(0x20d)]);if(_0x4e89b0['detail'])console['log'](_0x2254fe(0x20f)+a191_0x56ef4e[_0x2254fe(0x1d2)](_0x4e89b0['detail']));}console[_0x2254fe(0x1d5)]('');}export async function upgradeApp(_0x35da62,_0x331380){const _0xe3c05b=a191_0x56c7b3,_0x11effd=process[_0xe3c05b(0x206)](),_0x5768a2=analyse(_0x11effd),_0x49ef70=!_0x5768a2['configMigration']&&_0x5768a2[_0xe3c05b(0x1d4)][_0xe3c05b(0x1e7)]===0x0&&!_0x5768a2['oldMcpConfig']&&!_0x5768a2['needsSkillSwap']&&!_0x5768a2[_0xe3c05b(0x1ff)];if(_0x49ef70){console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1fc)](_0xe3c05b(0x200)));return;}printReport(_0x5768a2);const _0x299c24=!!(_0x331380['yes']||_0x331380['Y']||_0x35da62);if(!_0x299c24)try{const _0x133f10=await askConfirm(_0xe3c05b(0x216));if(!_0x133f10){console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1d2)](_0xe3c05b(0x230)));return;}}catch(_0x33f0bc){if(_0x33f0bc?.['message']===_0xe3c05b(0x1d0)){console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1d2)](_0xe3c05b(0x230)));return;}throw _0x33f0bc;}const _0x56d2e3=[],_0x3b0623=a191_0x900295({'text':_0xe3c05b(0x202),'color':_0xe3c05b(0x219)})[_0xe3c05b(0x212)](),_0x25e62c=execConfigMigration(_0x5768a2,_0x11effd);_0x56d2e3[_0xe3c05b(0x22e)](_0x25e62c),_0x3b0623[_0x25e62c['ok']?_0xe3c05b(0x226):_0xe3c05b(0x235)](_0xe3c05b(0x228)+(_0x25e62c['detail']??(_0x25e62c['ok']?'done':_0xe3c05b(0x249))));const _0x293b5e=resolve(_0x11effd,'.lovrabet'),_0x5273be=a191_0x900295({'text':_0xe3c05b(0x218),'color':_0xe3c05b(0x219)})[_0xe3c05b(0x212)]();if(existsSync(_0x293b5e))try{rmSync(_0x293b5e,{'recursive':!![],'force':!![]}),_0x5273be[_0xe3c05b(0x226)](_0xe3c05b(0x224)),_0x56d2e3[_0xe3c05b(0x22e)]({'step':0x2,'label':_0xe3c05b(0x24c),'ok':!![]});}catch(_0x40fc93){_0x5273be[_0xe3c05b(0x235)](_0xe3c05b(0x1ed)+_0x40fc93[_0xe3c05b(0x227)]),_0x56d2e3[_0xe3c05b(0x22e)]({'step':0x2,'label':_0xe3c05b(0x24c),'ok':![],'detail':_0x40fc93[_0xe3c05b(0x227)]});}else _0x5273be[_0xe3c05b(0x23c)](_0xe3c05b(0x21d)),_0x56d2e3['push']({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0xe3c05b(0x1d7)});const _0x146522=a191_0x900295({'text':_0xe3c05b(0x1d9),'color':_0xe3c05b(0x219)})['start'](),_0x41a75c=execRemoveOldArtifacts(_0x5768a2['oldArtifacts']);_0x56d2e3[_0xe3c05b(0x22e)](_0x41a75c),_0x146522[_0x41a75c['ok']?_0xe3c05b(0x226):_0xe3c05b(0x235)](_0xe3c05b(0x1e1)+(_0x41a75c[_0xe3c05b(0x1db)]??(_0x41a75c['ok']?'done':_0xe3c05b(0x249))));const _0x51f511=a191_0x900295({'text':_0xe3c05b(0x1f2),'color':_0xe3c05b(0x219)})[_0xe3c05b(0x212)](),_0x39fe53=execCleanMcp(_0x5768a2);_0x56d2e3[_0xe3c05b(0x22e)](_0x39fe53),_0x51f511[_0x39fe53['ok']?_0xe3c05b(0x226):_0xe3c05b(0x235)](_0xe3c05b(0x1d6)+(_0x39fe53[_0xe3c05b(0x1db)]??(_0x39fe53['ok']?'done':'failed')));const _0xeb7459=a191_0x900295({'text':_0xe3c05b(0x1f1),'color':_0xe3c05b(0x219)})[_0xe3c05b(0x212)](),_0x15bdb2=execSkillsRemove(_0x11effd,_0x299c24);_0x56d2e3[_0xe3c05b(0x22e)](_0x15bdb2),_0xeb7459[_0x15bdb2['ok']?_0xe3c05b(0x226):_0xe3c05b(0x235)]('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x15bdb2['detail']??(_0x15bdb2['ok']?_0xe3c05b(0x1fe):'failed')));const _0x3ed903=a191_0x900295({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':'cyan'})[_0xe3c05b(0x212)](),_0x5e0bf7=execSkillsAdd(_0x11effd,_0x299c24);_0x56d2e3['push'](_0x5e0bf7),_0x3ed903[_0x5e0bf7['ok']?_0xe3c05b(0x226):'fail'](_0xe3c05b(0x243)+(_0x5e0bf7[_0xe3c05b(0x1db)]??(_0x5e0bf7['ok']?_0xe3c05b(0x1fe):_0xe3c05b(0x249))));const _0x359a7d=a191_0x900295({'text':_0xe3c05b(0x1f0),'color':_0xe3c05b(0x219)})[_0xe3c05b(0x212)](),_0x1e0525=execUpgradeSdk(_0x5768a2);_0x56d2e3[_0xe3c05b(0x22e)](_0x1e0525),_0x359a7d[_0x1e0525['ok']?_0xe3c05b(0x226):_0xe3c05b(0x235)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x1e0525[_0xe3c05b(0x1db)]??(_0x1e0525['ok']?'done':_0xe3c05b(0x249)))),printSummary(_0x56d2e3);const _0x5e12b8=_0x56d2e3[_0xe3c05b(0x20a)](_0xe4aa47=>!_0xe4aa47['ok']);_0x5e12b8?console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x221)](_0xe3c05b(0x22a))):console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1fc)](_0xe3c05b(0x1f6))),_0x1e0525['ok']&&_0x5768a2[_0xe3c05b(0x1ff)]&&(console[_0xe3c05b(0x1d5)](''),console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x222)]['cyan'](_0xe3c05b(0x1fd))),console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x219)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0xe3c05b(0x1d5)](''),console['log'](a191_0x56ef4e[_0xe3c05b(0x1fa)](_0xe3c05b(0x1ef))),console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1fa)](_0xe3c05b(0x21a))),console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1fa)](_0xe3c05b(0x237))),console[_0xe3c05b(0x1d5)](''));}
|
|
1
|
+
const a190_0x4afdb4=a190_0xed96;(function(_0x446e65,_0x387cd8){const _0x54633b=a190_0xed96,_0x12eef0=_0x446e65();while(!![]){try{const _0x3d76fe=parseInt(_0x54633b(0x1f8))/0x1+-parseInt(_0x54633b(0x1d3))/0x2+parseInt(_0x54633b(0x20f))/0x3+-parseInt(_0x54633b(0x1e3))/0x4*(-parseInt(_0x54633b(0x1b8))/0x5)+parseInt(_0x54633b(0x1cc))/0x6+parseInt(_0x54633b(0x1e7))/0x7+parseInt(_0x54633b(0x1b9))/0x8*(-parseInt(_0x54633b(0x1d7))/0x9);if(_0x3d76fe===_0x387cd8)break;else _0x12eef0['push'](_0x12eef0['shift']());}catch(_0xb7a5e9){_0x12eef0['push'](_0x12eef0['shift']());}}}(a190_0x3ab3,0x951eb));import a190_0x113da6 from'chalk';import a190_0x26ee96 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=[a190_0x4afdb4(0x196),a190_0x4afdb4(0x1e2)];function collectIdeSkillFiles(_0x4a12bd){const _0x4a9444=a190_0x4afdb4,_0x366319=[];for(const _0xd5ad07 of Object[_0x4a9444(0x1fa)](CORE_IDE_CONFIGS)){if(_0xd5ad07['files'])for(const _0x270ad2 of _0xd5ad07[_0x4a9444(0x1e9)]){_0x366319[_0x4a9444(0x1a3)](resolve(_0x4a12bd,_0x270ad2[_0x4a9444(0x206)]));}}return _0x366319;}function analyse(_0x5ea8d4){const _0x53b398=a190_0x4afdb4;let _0x22a0bb=null;const _0x6a3822=resolve(_0x5ea8d4,NEW_CONFIG_NAME),_0x325772=existsSync(_0x6a3822);for(const _0x2a09c0 of LEGACY_CONFIG_NAMES){const _0x35e50a=resolve(_0x5ea8d4,_0x2a09c0);if(existsSync(_0x35e50a)){const _0x2ba9dd=readConfigFile(_0x35e50a),_0x468de9=Object['keys'](_0x2ba9dd)['filter'](_0x4c0f2c=>typeof _0x2ba9dd[_0x4c0f2c]!==_0x53b398(0x1c2));_0x22a0bb={'oldPath':_0x35e50a,'hasNewConfig':_0x325772,'fields':_0x468de9};break;}}const _0x4aa4aa=[],_0x3b32e4=resolve(_0x5ea8d4,_0x53b398(0x1f5));if(existsSync(_0x3b32e4))_0x4aa4aa[_0x53b398(0x1a3)](_0x3b32e4);const _0x5f0add=resolve(_0x5ea8d4,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x5f0add))_0x4aa4aa[_0x53b398(0x1a3)](_0x5f0add);const _0x5c9258=resolve(_0x5ea8d4,'.claude/skills/lovrabet');if(existsSync(_0x5c9258))_0x4aa4aa[_0x53b398(0x1a3)](_0x5c9258);for(const _0x2453a5 of collectIdeSkillFiles(_0x5ea8d4)){if(existsSync(_0x2453a5))_0x4aa4aa[_0x53b398(0x1a3)](_0x2453a5);}let _0x4cab5a=null;const _0x2b4dcf=resolve(_0x5ea8d4,_0x53b398(0x201));if(existsSync(_0x2b4dcf))try{const _0x110a9d=JSON[_0x53b398(0x1ca)](readFileSync(_0x2b4dcf,_0x53b398(0x1fc)));if(_0x110a9d?.[_0x53b398(0x192)]&&typeof _0x110a9d[_0x53b398(0x192)]===_0x53b398(0x1d9)){const _0x42f634=[];for(const [_0x1a8ba9,_0x983e50]of Object[_0x53b398(0x1af)](_0x110a9d['mcpServers'])){const _0x51827c=_0x983e50;_0x51827c?.[_0x53b398(0x1f2)]&&Array[_0x53b398(0x1df)](_0x51827c['args'])&&_0x51827c[_0x53b398(0x1f2)]['some'](_0x5ded45=>typeof _0x5ded45===_0x53b398(0x1b5)&&_0x5ded45[_0x53b398(0x1e4)](_0x53b398(0x1f7)))&&_0x42f634[_0x53b398(0x1a3)](_0x1a8ba9);}_0x42f634[_0x53b398(0x1c7)]>0x0&&(_0x4cab5a={'path':_0x2b4dcf,'keys':_0x42f634});}}catch{}const _0x1191c0=_0x4aa4aa['length']>0x0||_0x22a0bb!==null;let _0x28baa3=null;const _0x26ccfb=resolve(_0x5ea8d4,'package.json');if(existsSync(_0x26ccfb))try{const _0x2f1c11=JSON[_0x53b398(0x1ca)](readFileSync(_0x26ccfb,'utf8'));for(const _0x3b4ad3 of[_0x53b398(0x205),_0x53b398(0x1c1)]){const _0x4953a0=_0x2f1c11?.[_0x3b4ad3]?.[_0x53b398(0x1fb)];if(typeof _0x4953a0===_0x53b398(0x1b5)){_0x4953a0!==_0x53b398(0x1a0)&&(_0x28baa3={'pkgPath':_0x26ccfb,'currentVersion':_0x4953a0,'field':_0x3b4ad3});break;}}}catch{}return{'configMigration':_0x22a0bb,'oldArtifacts':_0x4aa4aa,'oldMcpConfig':_0x4cab5a,'needsSkillSwap':_0x1191c0,'sdkUpgrade':_0x28baa3};}function printReport(_0x55538a){const _0xec6517=a190_0x4afdb4,{configMigration:_0x383c49,oldArtifacts:_0x4f8881,oldMcpConfig:_0x3dedcb,needsSkillSwap:_0x64fb82}=_0x55538a;console[_0xec6517(0x19c)](''),console['log'](a190_0x113da6[_0xec6517(0x1dd)](_0xec6517(0x1a7))),console['log']('');_0x383c49?(console['log'](a190_0x113da6[_0xec6517(0x198)](_0xec6517(0x1cb))+('\x20\x20'+a190_0x113da6[_0xec6517(0x1fe)](_0x383c49['oldPath']))),console[_0xec6517(0x19c)](_0xec6517(0x1ef)+(_0x383c49['hasNewConfig']?a190_0x113da6[_0xec6517(0x1bd)]('already\x20exists\x20(will\x20merge)'):a190_0x113da6[_0xec6517(0x20d)]('not\x20found\x20(will\x20create)'))),console[_0xec6517(0x19c)](_0xec6517(0x1e6)+_0x383c49[_0xec6517(0x204)]['join'](',\x20')),console[_0xec6517(0x19c)](_0xec6517(0x1c6))):console[_0xec6517(0x19c)](a190_0x113da6['cyan'](_0xec6517(0x1cb))+'\x20\x20'+a190_0x113da6[_0xec6517(0x20d)]('no\x20legacy\x20config\x20found'));console[_0xec6517(0x19c)]('');if(_0x4f8881[_0xec6517(0x1c7)]>0x0){console['log'](a190_0x113da6[_0xec6517(0x198)](_0xec6517(0x1c4)));for(const _0x3cf8ef of _0x4f8881){console[_0xec6517(0x19c)]('\x20\x20'+a190_0x113da6[_0xec6517(0x1b0)](_0xec6517(0x1ee))+'\x20\x20'+_0x3cf8ef);}console['log'](_0xec6517(0x1b7));}else console['log'](a190_0x113da6[_0xec6517(0x198)](_0xec6517(0x1c4))+'\x20\x20'+a190_0x113da6[_0xec6517(0x20d)](_0xec6517(0x194)));console[_0xec6517(0x19c)]('');_0x3dedcb?(console[_0xec6517(0x19c)](a190_0x113da6[_0xec6517(0x198)](_0xec6517(0x1ae))+('\x20\x20'+a190_0x113da6[_0xec6517(0x1fe)](_0x3dedcb['path'])+'\x20→\x20keys:\x20'+_0x3dedcb['keys'][_0xec6517(0x19f)](',\x20'))),console[_0xec6517(0x19c)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0xec6517(0x19c)](a190_0x113da6[_0xec6517(0x198)](_0xec6517(0x1ae))+'\x20\x20'+a190_0x113da6[_0xec6517(0x20d)](_0xec6517(0x1a8)));console['log'](''),console[_0xec6517(0x19c)](a190_0x113da6['cyan']('Skill\x20swap:')+('\x20\x20'+(_0x64fb82?a190_0x113da6[_0xec6517(0x1fe)](_0xec6517(0x19b)):a190_0x113da6[_0xec6517(0x1bd)](_0xec6517(0x200)))));_0x64fb82&&console[_0xec6517(0x19c)](_0xec6517(0x1d0)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0xec6517(0x19c)]('');if(_0x55538a['sdkUpgrade']){const {currentVersion:_0x495b69,field:_0xf7834d,pkgPath:_0x51df5f}=_0x55538a[_0xec6517(0x1ec)];console[_0xec6517(0x19c)](a190_0x113da6[_0xec6517(0x198)](_0xec6517(0x1dc))+('\x20\x20'+a190_0x113da6[_0xec6517(0x1fe)](_0x51df5f))),console['log'](_0xec6517(0x1ad)+_0xf7834d+':\x20'+a190_0x113da6['yellow'](_0x495b69)+_0xec6517(0x1bf)+a190_0x113da6['green'](_0xec6517(0x1a0))),console[_0xec6517(0x19c)](_0xec6517(0x20a));}else console[_0xec6517(0x19c)](a190_0x113da6[_0xec6517(0x198)]('@lovrabet/sdk:')+'\x20\x20'+a190_0x113da6[_0xec6517(0x20d)](_0xec6517(0x1c5)));console[_0xec6517(0x19c)]('');}function execConfigMigration(_0x516679,_0x130839){const _0x5b27a9=a190_0x4afdb4,{configMigration:_0x45cd72}=_0x516679;if(!_0x45cd72?.[_0x5b27a9(0x1d2)])return{'step':0x1,'label':_0x5b27a9(0x1d8),'ok':!![],'detail':_0x5b27a9(0x1ea)};const _0x3eb3b4=readConfigFile(_0x45cd72[_0x5b27a9(0x1d2)]),_0x400338=resolve(_0x130839,NEW_CONFIG_NAME),_0x5af57a=_0x45cd72[_0x5b27a9(0x1c3)]?readConfigFile(_0x400338):{};for(const [_0x163a45,_0x30a6c4]of Object['entries'](_0x3eb3b4)){!(_0x163a45 in _0x5af57a)&&(_0x5af57a[_0x163a45]=_0x30a6c4);}writeConfigFile(_0x400338,_0x5af57a);const _0x33a7d5=_0x45cd72[_0x5b27a9(0x1d2)]+_0x5b27a9(0x1d6);return renameSync(_0x45cd72[_0x5b27a9(0x1d2)],_0x33a7d5),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x45cd72[_0x5b27a9(0x1d2)]+_0x5b27a9(0x1bf)+_0x400338+_0x5b27a9(0x19a)+_0x33a7d5+')'};}function execRemoveOldArtifacts(_0xf62939){const _0xd0bf1a=a190_0x4afdb4,_0x3460e3=[];for(const _0x113d39 of _0xf62939){try{if(!existsSync(_0x113d39))continue;const _0x473276=tryStat(_0x113d39);_0x473276?.[_0xd0bf1a(0x1d1)]()?rmSync(_0x113d39,{'recursive':!![],'force':!![]}):unlinkSync(_0x113d39);}catch(_0x514a62){_0x3460e3[_0xd0bf1a(0x1a3)](_0x113d39+':\x20'+_0x514a62[_0xd0bf1a(0x1e1)]);}}return{'step':0x3,'label':_0xd0bf1a(0x191),'ok':_0x3460e3[_0xd0bf1a(0x1c7)]===0x0,'detail':_0x3460e3[_0xd0bf1a(0x1c7)]>0x0?_0xf62939[_0xd0bf1a(0x1c7)]-_0x3460e3[_0xd0bf1a(0x1c7)]+'/'+_0xf62939[_0xd0bf1a(0x1c7)]+_0xd0bf1a(0x1e5)+_0x3460e3['join'](';\x20')+')':_0xf62939[_0xd0bf1a(0x1c7)]+'\x20removed'};}function execCleanMcp(_0x2acba6){const _0x231cca=a190_0x4afdb4;if(!_0x2acba6['oldMcpConfig'])return{'step':0x4,'label':_0x231cca(0x1ed),'ok':!![],'detail':_0x231cca(0x1f9)};try{const _0xb1059=readFileSync(_0x2acba6[_0x231cca(0x1f1)][_0x231cca(0x206)],_0x231cca(0x1fc)),_0x20422e=JSON['parse'](_0xb1059);if(_0x20422e?.[_0x231cca(0x192)]&&typeof _0x20422e['mcpServers']===_0x231cca(0x1d9)){const _0x3f7366=[];for(const [_0x4fae27,_0x41e9cf]of Object[_0x231cca(0x1af)](_0x20422e[_0x231cca(0x192)])){_0x41e9cf?.[_0x231cca(0x1f2)]&&Array[_0x231cca(0x1df)](_0x41e9cf[_0x231cca(0x1f2)])&&_0x41e9cf[_0x231cca(0x1f2)][_0x231cca(0x195)](_0x13fa24=>typeof _0x13fa24===_0x231cca(0x1b5)&&_0x13fa24[_0x231cca(0x1e4)](_0x231cca(0x1f7)))&&_0x3f7366[_0x231cca(0x1a3)](_0x4fae27);}for(const _0x1f069d of _0x3f7366){delete _0x20422e['mcpServers'][_0x1f069d];}return _0x3f7366[_0x231cca(0x1c7)]>0x0&&writeFileSync(_0x2acba6[_0x231cca(0x1f1)]['path'],JSON[_0x231cca(0x1c0)](_0x20422e,null,0x2)+'\x0a',_0x231cca(0x1fc)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x231cca(0x1a2)+_0x3f7366[_0x231cca(0x19f)](',\x20')+_0x231cca(0x212)+_0x2acba6[_0x231cca(0x1f1)][_0x231cca(0x206)]};}return{'step':0x4,'label':_0x231cca(0x1ed),'ok':!![],'detail':_0x231cca(0x1ab)};}catch(_0x1029ed){return{'step':0x4,'label':_0x231cca(0x1ed),'ok':![],'detail':_0x1029ed[_0x231cca(0x1e1)]};}}function a190_0x3ab3(){const _0x4777e6=['.lovrabet','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','@lovrabet/dataset-mcp-server','1056598hcwLdi','skipped','values','@lovrabet/sdk','utf8','succeed','yellow','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','not\x20needed','.cursor/mcp.json','needsSkillSwap','label','fields','dependencies','path','status','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','\x20\x20#\x20or','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','\x20\x20bun\x20install','gray','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','2556510FGjvzY','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','\x20→\x20latest','\x20from\x20','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','\x20\x20Step\x20','Remove\x20legacy\x20artifacts','mcpServers','cwd','none\x20found','some','.lovrabet.json','\x20\x20\x20\x20\x20\x20\x20','cyan','Step\x205/7:\x20Removing\x20old\x20skill...','\x20(backup:\x20','needed','log','configMigration','lovrabet/rabetbase','join','latest','Step\x201/7:\x20Migrating\x20config...','removed\x20','push','white','oldArtifacts','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','===\x20Upgrade\x20Analysis\x20===','no\x20legacy\x20entry','Remove\x20old\x20skill','lovrabet/rabetbase\x20installed\x20globally','no\x20matching\x20entry\x20found','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','\x20\x20Current\x20version\x20in\x20','MCP\x20config:','entries','red','fail','inherit','Upgrade\x20cancelled.','Remove\x20.lovrabet/','string','Install\x20new\x20skill','\x20\x20Action:\x20delete','3236435BMncDh','309072mOEMLJ','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','===\x20Upgrade\x20Summary\x20===','green','Proceed\x20with\x20upgrade?','\x20→\x20','stringify','devDependencies','undefined','hasNewConfig','Legacy\x20artifacts:','not\x20found\x20or\x20already\x20at\x20latest','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','length','lovrabet/lovrabet-skill\x20removed','Upgrade\x20@lovrabet/sdk','parse','Config\x20file:','3460122AiMhTe','FAIL','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','step','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','isDirectory','oldPath','187872OOOjLQ','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','\x20\x20npm\x20install','.bak','639hBfslr','Config\x20migration','object','[\x22@lovrabet/sdk\x22]:\x20','done','@lovrabet/sdk:','bold','error','isArray','start','message','.lovrabetrc','4hJAkpF','includes','\x20removed\x20(','\x20\x20Fields\x20to\x20migrate:\x20','2205021XUIGlb','detail','files','skipped\x20(no\x20legacy\x20config)','Step\x204/7:\x20Cleaning\x20MCP\x20config...','sdkUpgrade','Clean\x20MCP\x20config','FOUND','\x20\x20New\x20config\x20(.rabetbase.json):\x20','failed','oldMcpConfig','args','yes','exit\x20'];a190_0x3ab3=function(){return _0x4777e6;};return a190_0x3ab3();}function execSkillsRemove(_0x18fbb0,_0x5752e2){const _0x14d04b=a190_0x4afdb4,_0x486fa6=runNpxSkillsRemove(_0x18fbb0,{'stdio':_0x14d04b(0x1b2),'yes':_0x5752e2});return{'step':0x5,'label':_0x14d04b(0x1a9),'ok':_0x486fa6['ok'],'detail':_0x486fa6['ok']?_0x14d04b(0x1c8):_0x486fa6[_0x14d04b(0x1de)]??_0x14d04b(0x1f4)+_0x486fa6[_0x14d04b(0x207)]};}function execSkillsAdd(_0x3c9ea1,_0x4e1175){const _0x33793c=a190_0x4afdb4,_0x2e752f=runNpxSkillsAddGlobal(_0x3c9ea1,_0x33793c(0x19e),{'stdio':_0x33793c(0x1b2),'yes':_0x4e1175});return{'step':0x6,'label':_0x33793c(0x1b6),'ok':_0x2e752f['ok'],'detail':_0x2e752f['ok']?_0x33793c(0x1aa):_0x2e752f[_0x33793c(0x1de)]??_0x33793c(0x1f4)+_0x2e752f['status']};}function execUpgradeSdk(_0xc9de3){const _0x2e444d=a190_0x4afdb4;if(!_0xc9de3['sdkUpgrade'])return{'step':0x7,'label':_0x2e444d(0x1c9),'ok':!![],'detail':_0x2e444d(0x1bb)};const {pkgPath:_0x1c6103,currentVersion:_0xcb7f70,field:_0x5776af}=_0xc9de3[_0x2e444d(0x1ec)];try{const _0x225b7e=readFileSync(_0x1c6103,_0x2e444d(0x1fc)),_0x418c9e=JSON[_0x2e444d(0x1ca)](_0x225b7e);return _0x418c9e[_0x5776af]['@lovrabet/sdk']=_0x2e444d(0x1a0),writeFileSync(_0x1c6103,JSON[_0x2e444d(0x1c0)](_0x418c9e,null,0x2)+'\x0a',_0x2e444d(0x1fc)),{'step':0x7,'label':_0x2e444d(0x1c9),'ok':!![],'detail':_0x5776af+_0x2e444d(0x1da)+_0xcb7f70+_0x2e444d(0x211)};}catch(_0x1aea23){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x1aea23[_0x2e444d(0x1e1)]};}}function a190_0xed96(_0x41182d,_0x57a567){_0x41182d=_0x41182d-0x191;const _0x3ab3af=a190_0x3ab3();let _0xed967e=_0x3ab3af[_0x41182d];return _0xed967e;}function tryStat(_0x27946a){try{return statSync(_0x27946a);}catch{return undefined;}}function printSummary(_0x397d18){const _0x41c1d3=a190_0x4afdb4;console['log'](''),console[_0x41c1d3(0x19c)](a190_0x113da6[_0x41c1d3(0x1dd)](_0x41c1d3(0x1bc))),console[_0x41c1d3(0x19c)]('');for(const _0x4e7571 of _0x397d18){const _0x3cfb36=_0x4e7571['ok']?a190_0x113da6[_0x41c1d3(0x1bd)]('OK'):a190_0x113da6[_0x41c1d3(0x1b0)](_0x41c1d3(0x1cd));console[_0x41c1d3(0x19c)]('\x20\x20'+_0x3cfb36+_0x41c1d3(0x214)+_0x4e7571[_0x41c1d3(0x1cf)]+':\x20'+_0x4e7571[_0x41c1d3(0x203)]);if(_0x4e7571[_0x41c1d3(0x1e8)])console['log'](_0x41c1d3(0x197)+a190_0x113da6['gray'](_0x4e7571[_0x41c1d3(0x1e8)]));}console[_0x41c1d3(0x19c)]('');}export async function upgradeApp(_0x4f1054,_0x2a8cfd){const _0x14aa32=a190_0x4afdb4,_0x480e8f=process[_0x14aa32(0x193)](),_0x4bd1f6=analyse(_0x480e8f),_0x14e4f7=!_0x4bd1f6[_0x14aa32(0x19d)]&&_0x4bd1f6[_0x14aa32(0x1a5)][_0x14aa32(0x1c7)]===0x0&&!_0x4bd1f6[_0x14aa32(0x1f1)]&&!_0x4bd1f6[_0x14aa32(0x202)]&&!_0x4bd1f6['sdkUpgrade'];if(_0x14e4f7){console[_0x14aa32(0x19c)](a190_0x113da6[_0x14aa32(0x1bd)](_0x14aa32(0x20b)));return;}printReport(_0x4bd1f6);const _0x42ce7a=!!(_0x2a8cfd[_0x14aa32(0x1f3)]||_0x2a8cfd['Y']||_0x4f1054);if(!_0x42ce7a)try{const _0x1694a1=await askConfirm(_0x14aa32(0x1be));if(!_0x1694a1){console[_0x14aa32(0x19c)](a190_0x113da6[_0x14aa32(0x20d)](_0x14aa32(0x1b3)));return;}}catch(_0x37b806){if(_0x37b806?.['message']==='CANCEL'){console[_0x14aa32(0x19c)](a190_0x113da6[_0x14aa32(0x20d)](_0x14aa32(0x1b3)));return;}throw _0x37b806;}const _0x2cf242=[],_0x5037c3=a190_0x26ee96({'text':_0x14aa32(0x1a1),'color':'cyan'})['start'](),_0x455010=execConfigMigration(_0x4bd1f6,_0x480e8f);_0x2cf242[_0x14aa32(0x1a3)](_0x455010),_0x5037c3[_0x455010['ok']?_0x14aa32(0x1fd):_0x14aa32(0x1b1)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0x455010[_0x14aa32(0x1e8)]??(_0x455010['ok']?_0x14aa32(0x1db):_0x14aa32(0x1f0))));const _0x57d3a4=resolve(_0x480e8f,_0x14aa32(0x1f5)),_0x14d092=a190_0x26ee96({'text':_0x14aa32(0x210),'color':_0x14aa32(0x198)})[_0x14aa32(0x1e0)]();if(existsSync(_0x57d3a4))try{rmSync(_0x57d3a4,{'recursive':!![],'force':!![]}),_0x14d092[_0x14aa32(0x1fd)](_0x14aa32(0x1f6)),_0x2cf242[_0x14aa32(0x1a3)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x5177d8){_0x14d092[_0x14aa32(0x1b1)](_0x14aa32(0x1ff)+_0x5177d8[_0x14aa32(0x1e1)]),_0x2cf242[_0x14aa32(0x1a3)]({'step':0x2,'label':_0x14aa32(0x1b4),'ok':![],'detail':_0x5177d8[_0x14aa32(0x1e1)]});}else _0x14d092['info'](_0x14aa32(0x1ac)),_0x2cf242[_0x14aa32(0x1a3)]({'step':0x2,'label':_0x14aa32(0x1b4),'ok':!![],'detail':_0x14aa32(0x1f9)});const _0xab258=a190_0x26ee96({'text':_0x14aa32(0x1a6),'color':_0x14aa32(0x198)})[_0x14aa32(0x1e0)](),_0x2c442a=execRemoveOldArtifacts(_0x4bd1f6['oldArtifacts']);_0x2cf242['push'](_0x2c442a),_0xab258[_0x2c442a['ok']?'succeed':_0x14aa32(0x1b1)]('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x2c442a[_0x14aa32(0x1e8)]??(_0x2c442a['ok']?_0x14aa32(0x1db):'failed')));const _0x5e1545=a190_0x26ee96({'text':_0x14aa32(0x1eb),'color':_0x14aa32(0x198)})[_0x14aa32(0x1e0)](),_0x13bab1=execCleanMcp(_0x4bd1f6);_0x2cf242[_0x14aa32(0x1a3)](_0x13bab1),_0x5e1545[_0x13bab1['ok']?_0x14aa32(0x1fd):_0x14aa32(0x1b1)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x13bab1[_0x14aa32(0x1e8)]??(_0x13bab1['ok']?_0x14aa32(0x1db):_0x14aa32(0x1f0))));const _0x1f5153=a190_0x26ee96({'text':_0x14aa32(0x199),'color':_0x14aa32(0x198)})[_0x14aa32(0x1e0)](),_0x235cb5=execSkillsRemove(_0x480e8f,_0x42ce7a);_0x2cf242[_0x14aa32(0x1a3)](_0x235cb5),_0x1f5153[_0x235cb5['ok']?_0x14aa32(0x1fd):'fail'](_0x14aa32(0x20e)+(_0x235cb5[_0x14aa32(0x1e8)]??(_0x235cb5['ok']?_0x14aa32(0x1db):_0x14aa32(0x1f0))));const _0x1eb452=a190_0x26ee96({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':'cyan'})[_0x14aa32(0x1e0)](),_0x16eae5=execSkillsAdd(_0x480e8f,_0x42ce7a);_0x2cf242[_0x14aa32(0x1a3)](_0x16eae5),_0x1eb452[_0x16eae5['ok']?_0x14aa32(0x1fd):_0x14aa32(0x1b1)](_0x14aa32(0x1ce)+(_0x16eae5['detail']??(_0x16eae5['ok']?_0x14aa32(0x1db):_0x14aa32(0x1f0))));const _0x24262f=a190_0x26ee96({'text':'Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','color':_0x14aa32(0x198)})['start'](),_0x3e9d71=execUpgradeSdk(_0x4bd1f6);_0x2cf242[_0x14aa32(0x1a3)](_0x3e9d71),_0x24262f[_0x3e9d71['ok']?_0x14aa32(0x1fd):_0x14aa32(0x1b1)](_0x14aa32(0x213)+(_0x3e9d71[_0x14aa32(0x1e8)]??(_0x3e9d71['ok']?'done':_0x14aa32(0x1f0)))),printSummary(_0x2cf242);const _0x2828cf=_0x2cf242[_0x14aa32(0x195)](_0x189139=>!_0x189139['ok']);_0x2828cf?console[_0x14aa32(0x19c)](a190_0x113da6[_0x14aa32(0x1fe)](_0x14aa32(0x208))):console['log'](a190_0x113da6[_0x14aa32(0x1bd)]('Upgrade\x20completed\x20successfully!')),_0x3e9d71['ok']&&_0x4bd1f6['sdkUpgrade']&&(console[_0x14aa32(0x19c)](''),console['log'](a190_0x113da6[_0x14aa32(0x1dd)][_0x14aa32(0x198)](_0x14aa32(0x1ba))),console[_0x14aa32(0x19c)](a190_0x113da6['cyan'](_0x14aa32(0x1d4))),console['log'](''),console[_0x14aa32(0x19c)](a190_0x113da6[_0x14aa32(0x1a4)](_0x14aa32(0x1d5))),console[_0x14aa32(0x19c)](a190_0x113da6[_0x14aa32(0x1a4)](_0x14aa32(0x209))),console[_0x14aa32(0x19c)](a190_0x113da6[_0x14aa32(0x1a4)](_0x14aa32(0x20c))),console['log'](''));}
|