@lovrabet/rabetbase-cli 2.5.9 → 2.5.10-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/README.md +1 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/api-group.js +1 -1
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.js +1 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/api/legacy-api-file.js +1 -1
  8. package/lib/api/model-registry-file.js +1 -1
  9. package/lib/api/model-registry-scaffold.js +1 -1
  10. package/lib/api/model-source.js +1 -1
  11. package/lib/auth/auth-server-ui.js +1 -1
  12. package/lib/auth/auth-server.js +1 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.js +1 -1
  16. package/lib/auth/is-session-valid.js +1 -1
  17. package/lib/auth/login-success-html.js +1 -1
  18. package/lib/auth/logout.js +1 -1
  19. package/lib/cli-flags.js +1 -1
  20. package/lib/cli.js +1 -1
  21. package/lib/commands/api/generate.js +1 -1
  22. package/lib/commands/api/index.js +1 -1
  23. package/lib/commands/api/list.js +1 -1
  24. package/lib/commands/api/pull.js +1 -1
  25. package/lib/commands/api/shared.js +1 -1
  26. package/lib/commands/app/detail.js +1 -1
  27. package/lib/commands/app/index.js +1 -1
  28. package/lib/commands/app/list.js +1 -1
  29. package/lib/commands/app/members-list.js +1 -1
  30. package/lib/commands/app/remote-directory.js +1 -1
  31. package/lib/commands/app/shared.js +1 -1
  32. package/lib/commands/app-config/delete.js +1 -1
  33. package/lib/commands/app-config/get.js +1 -1
  34. package/lib/commands/app-config/index.js +1 -1
  35. package/lib/commands/app-config/list.js +1 -1
  36. package/lib/commands/app-config/set.js +1 -1
  37. package/lib/commands/app-config/shared.js +1 -1
  38. package/lib/commands/auth/index.js +1 -1
  39. package/lib/commands/bff/create.js +1 -1
  40. package/lib/commands/bff/delete.js +1 -1
  41. package/lib/commands/bff/detail.js +1 -1
  42. package/lib/commands/bff/index.js +1 -1
  43. package/lib/commands/bff/list.js +1 -1
  44. package/lib/commands/bff/logs.js +1 -1
  45. package/lib/commands/bff/pull.js +1 -1
  46. package/lib/commands/bff/push.js +1 -1
  47. package/lib/commands/bff/status.js +1 -1
  48. package/lib/commands/cli-skill/index.js +1 -1
  49. package/lib/commands/cli-update.js +1 -1
  50. package/lib/commands/codegen/index.js +1 -1
  51. package/lib/commands/codegen/sdk.js +1 -1
  52. package/lib/commands/codegen/sql.js +1 -1
  53. package/lib/commands/common/app-registry.js +1 -1
  54. package/lib/commands/common/app-selector.js +1 -1
  55. package/lib/commands/common/async-task.js +1 -1
  56. package/lib/commands/common/dry-run.js +1 -1
  57. package/lib/commands/common/flags.js +1 -1
  58. package/lib/commands/common/local-file.js +1 -1
  59. package/lib/commands/common/validate.js +1 -1
  60. package/lib/commands/config/delete.js +1 -1
  61. package/lib/commands/config/get.js +1 -1
  62. package/lib/commands/config/index.js +1 -1
  63. package/lib/commands/config/init.js +1 -1
  64. package/lib/commands/config/list.js +1 -1
  65. package/lib/commands/config/set.js +1 -1
  66. package/lib/commands/config/shared.js +1 -1
  67. package/lib/commands/dataset/batch-design.js +1 -1
  68. package/lib/commands/dataset/business-group-update.js +1 -1
  69. package/lib/commands/dataset/business-groups.js +1 -1
  70. package/lib/commands/dataset/capability.js +1 -1
  71. package/lib/commands/dataset/cross-relation-create.js +1 -1
  72. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  73. package/lib/commands/dataset/cross-relation-list.js +1 -1
  74. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  75. package/lib/commands/dataset/cross-relation-update.js +1 -1
  76. package/lib/commands/dataset/delete.js +1 -1
  77. package/lib/commands/dataset/design-context.js +1 -1
  78. package/lib/commands/dataset/design-start.js +1 -1
  79. package/lib/commands/dataset/design-status.js +1 -1
  80. package/lib/commands/dataset/design-sync-retry.js +1 -1
  81. package/lib/commands/dataset/design-sync-status.js +1 -1
  82. package/lib/commands/dataset/design-validate.js +1 -1
  83. package/lib/commands/dataset/detail.js +1 -1
  84. package/lib/commands/dataset/extend-update.js +1 -1
  85. package/lib/commands/dataset/field-restore.js +1 -1
  86. package/lib/commands/dataset/field-update.js +1 -1
  87. package/lib/commands/dataset/generate.js +1 -1
  88. package/lib/commands/dataset/index.js +1 -1
  89. package/lib/commands/dataset/list.js +1 -1
  90. package/lib/commands/dataset/operations.js +1 -1
  91. package/lib/commands/dataset/relation-audit.js +1 -1
  92. package/lib/commands/dataset/relation-create.js +1 -1
  93. package/lib/commands/dataset/relation-delete.js +1 -1
  94. package/lib/commands/dataset/relation-shared.js +1 -1
  95. package/lib/commands/dataset/relation-update.js +1 -1
  96. package/lib/commands/dataset/relations.js +1 -1
  97. package/lib/commands/dataset/rename.js +1 -1
  98. package/lib/commands/dataset/restore.js +1 -1
  99. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  100. package/lib/commands/db/analysis-batching.js +1 -1
  101. package/lib/commands/db/analyze-batch-plan.js +1 -1
  102. package/lib/commands/db/analyze-cancel.js +1 -1
  103. package/lib/commands/db/analyze-start.js +1 -1
  104. package/lib/commands/db/analyze-status.js +1 -1
  105. package/lib/commands/db/create.js +1 -1
  106. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  109. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  110. package/lib/commands/db/delete.js +1 -1
  111. package/lib/commands/db/detail.js +1 -1
  112. package/lib/commands/db/diff-refresh-start.js +1 -1
  113. package/lib/commands/db/diff-refresh-status.js +1 -1
  114. package/lib/commands/db/diff.js +1 -1
  115. package/lib/commands/db/index.js +1 -1
  116. package/lib/commands/db/list.js +1 -1
  117. package/lib/commands/db/shared.js +1 -1
  118. package/lib/commands/db/table-diff-shared.js +1 -1
  119. package/lib/commands/db/tables.js +1 -1
  120. package/lib/commands/db/test.js +1 -1
  121. package/lib/commands/db/update.js +1 -1
  122. package/lib/commands/deployment/index.js +1 -1
  123. package/lib/commands/deployment/sync-all.js +1 -1
  124. package/lib/commands/deployment/sync-jobs.js +1 -1
  125. package/lib/commands/deployment/sync-status.js +1 -1
  126. package/lib/commands/doctor.js +1 -1
  127. package/lib/commands/file/index.js +1 -1
  128. package/lib/commands/flow/create.js +1 -1
  129. package/lib/commands/flow/detail.js +1 -1
  130. package/lib/commands/flow/index.js +1 -1
  131. package/lib/commands/flow/list.js +1 -1
  132. package/lib/commands/flow/page-list.js +1 -1
  133. package/lib/commands/flow/publish.js +1 -1
  134. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  135. package/lib/commands/flow/runtime-role-list.js +1 -1
  136. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  137. package/lib/commands/flow/runtime-user-search.js +1 -1
  138. package/lib/commands/flow/shared.js +1 -1
  139. package/lib/commands/flow/update.js +1 -1
  140. package/lib/commands/flow/validate.js +1 -1
  141. package/lib/commands/instant-api-policy/current.js +1 -1
  142. package/lib/commands/instant-api-policy/index.js +1 -1
  143. package/lib/commands/instant-api-policy/init.js +1 -1
  144. package/lib/commands/instant-api-policy/publish.js +1 -1
  145. package/lib/commands/instant-api-policy/pull.js +1 -1
  146. package/lib/commands/instant-api-policy/revision.js +1 -1
  147. package/lib/commands/instant-api-policy/revisions.js +1 -1
  148. package/lib/commands/instant-api-policy/rollback.js +1 -1
  149. package/lib/commands/instant-api-policy/shared.d.ts +1 -1
  150. package/lib/commands/instant-api-policy/shared.js +1 -1
  151. package/lib/commands/instant-api-policy/validate.js +1 -1
  152. package/lib/commands/issue/index.js +1 -1
  153. package/lib/commands/issue/nudge.js +1 -1
  154. package/lib/commands/issue/report.js +1 -1
  155. package/lib/commands/issue/shared.js +1 -1
  156. package/lib/commands/kb/create.js +1 -1
  157. package/lib/commands/kb/delete.js +1 -1
  158. package/lib/commands/kb/detail.js +1 -1
  159. package/lib/commands/kb/index.js +1 -1
  160. package/lib/commands/kb/list.js +1 -1
  161. package/lib/commands/kb/search.js +1 -1
  162. package/lib/commands/kb/shared.js +1 -1
  163. package/lib/commands/kb/update.js +1 -1
  164. package/lib/commands/logs/index.js +1 -1
  165. package/lib/commands/menu/asset-update.js +1 -1
  166. package/lib/commands/menu/delete.js +1 -1
  167. package/lib/commands/menu/external-link-create.js +1 -1
  168. package/lib/commands/menu/external-link-update.js +1 -1
  169. package/lib/commands/menu/group-create.js +1 -1
  170. package/lib/commands/menu/group-update.js +1 -1
  171. package/lib/commands/menu/index.js +1 -1
  172. package/lib/commands/menu/list.js +1 -1
  173. package/lib/commands/menu/move.js +1 -1
  174. package/lib/commands/menu/regroup-start.js +1 -1
  175. package/lib/commands/menu/rename.js +1 -1
  176. package/lib/commands/menu/shared/compare-table.js +1 -1
  177. package/lib/commands/menu/shared/delete-plan.js +1 -1
  178. package/lib/commands/menu/shared/facts.js +1 -1
  179. package/lib/commands/menu/shared/index.js +1 -1
  180. package/lib/commands/menu/shared/inquirer.js +1 -1
  181. package/lib/commands/menu/shared/local-pages.js +1 -1
  182. package/lib/commands/menu/shared/logic.js +1 -1
  183. package/lib/commands/menu/shared/mutations.js +1 -1
  184. package/lib/commands/menu/shared/path.js +1 -1
  185. package/lib/commands/menu/shared/service.js +1 -1
  186. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  187. package/lib/commands/menu/shared/sync-core.js +1 -1
  188. package/lib/commands/menu/shared/update-core.js +1 -1
  189. package/lib/commands/menu/shared/valid-url.js +1 -1
  190. package/lib/commands/menu/subapp-assets-status.js +1 -1
  191. package/lib/commands/menu/subapp-assets-update.js +1 -1
  192. package/lib/commands/menu/sync.js +1 -1
  193. package/lib/commands/menu/visibility-update.js +1 -1
  194. package/lib/commands/notification/config-create.js +1 -1
  195. package/lib/commands/notification/config-delete.js +1 -1
  196. package/lib/commands/notification/config-list.js +1 -1
  197. package/lib/commands/notification/config-update.js +1 -1
  198. package/lib/commands/notification/index.js +1 -1
  199. package/lib/commands/notification/shared.js +1 -1
  200. package/lib/commands/ocr/index.js +1 -1
  201. package/lib/commands/page/create.js +1 -1
  202. package/lib/commands/page/custom/detail.js +1 -1
  203. package/lib/commands/page/custom/list.js +1 -1
  204. package/lib/commands/page/custom/publish.js +1 -1
  205. package/lib/commands/page/custom/shared.js +1 -1
  206. package/lib/commands/page/custom/syntax.js +1 -1
  207. package/lib/commands/page/custom/update.js +1 -1
  208. package/lib/commands/page/data-list-status.js +1 -1
  209. package/lib/commands/page/generate-start.js +1 -1
  210. package/lib/commands/page/generate-status.js +1 -1
  211. package/lib/commands/page/index.js +1 -1
  212. package/lib/commands/page/pull.js +1 -1
  213. package/lib/commands/page/push.js +1 -1
  214. package/lib/commands/page/relation-audit.js +1 -1
  215. package/lib/commands/page/restore.js +1 -1
  216. package/lib/commands/page/shared.js +1 -1
  217. package/lib/commands/page/sync.js +1 -1
  218. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  219. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  220. package/lib/commands/project/create/format-elapsed.js +1 -1
  221. package/lib/commands/project/create/main.js +1 -1
  222. package/lib/commands/project/create/materialize-project-template.js +1 -1
  223. package/lib/commands/project/create/project-name.js +1 -1
  224. package/lib/commands/project/create/project-template-archive.js +1 -1
  225. package/lib/commands/project/create/project-template-path.js +1 -1
  226. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  227. package/lib/commands/project/create/use-format-code.js +1 -1
  228. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  229. package/lib/commands/project/domain-routing-sync.js +1 -1
  230. package/lib/commands/project/index.js +1 -1
  231. package/lib/commands/project/upgrade.js +1 -1
  232. package/lib/commands/registry.js +1 -1
  233. package/lib/commands/role/delete.js +1 -1
  234. package/lib/commands/role/detail.js +1 -1
  235. package/lib/commands/role/index.js +1 -1
  236. package/lib/commands/role/list.js +1 -1
  237. package/lib/commands/role/shared.js +1 -1
  238. package/lib/commands/role/update.js +1 -1
  239. package/lib/commands/role/user-add.js +1 -1
  240. package/lib/commands/role/user-remove.js +1 -1
  241. package/lib/commands/role/user-resolve.js +1 -1
  242. package/lib/commands/rule/get.js +1 -1
  243. package/lib/commands/rule/index.js +1 -1
  244. package/lib/commands/rule/list.js +1 -1
  245. package/lib/commands/rule/set.js +1 -1
  246. package/lib/commands/rule/shared.js +1 -1
  247. package/lib/commands/run/index.js +1 -1
  248. package/lib/commands/schema.js +1 -1
  249. package/lib/commands/sql/create.js +1 -1
  250. package/lib/commands/sql/delete.js +1 -1
  251. package/lib/commands/sql/detail.js +1 -1
  252. package/lib/commands/sql/exec.js +1 -1
  253. package/lib/commands/sql/index.js +1 -1
  254. package/lib/commands/sql/list.js +1 -1
  255. package/lib/commands/sql/pull.js +1 -1
  256. package/lib/commands/sql/push.js +1 -1
  257. package/lib/commands/sql/shared.js +1 -1
  258. package/lib/commands/sql/status.js +1 -1
  259. package/lib/commands/sql/validate.js +1 -1
  260. package/lib/commands/task/index.js +1 -1
  261. package/lib/commands/task/status.js +1 -1
  262. package/lib/commands/tenant/index.js +1 -1
  263. package/lib/commands/tenant/members-list.js +1 -1
  264. package/lib/commands/tenant/shared.js +1 -1
  265. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  266. package/lib/commands/user-account/feishu-bind.js +1 -1
  267. package/lib/commands/user-account/index.js +1 -1
  268. package/lib/commands/workspace/add.js +1 -1
  269. package/lib/commands/workspace/index.js +1 -1
  270. package/lib/commands/workspace/remove.js +1 -1
  271. package/lib/config/domain-config.js +1 -1
  272. package/lib/config/project-domain-routing.js +1 -1
  273. package/lib/config/region-config.js +1 -1
  274. package/lib/config/schema.js +1 -1
  275. package/lib/constant/cdn.js +1 -1
  276. package/lib/constant/cli.js +1 -1
  277. package/lib/constant/defaults.js +1 -1
  278. package/lib/constant/domain.js +1 -1
  279. package/lib/constant/env.js +1 -1
  280. package/lib/constant/output.js +1 -1
  281. package/lib/constant/paths.js +1 -1
  282. package/lib/constant/region.js +1 -1
  283. package/lib/constant/risk.js +1 -1
  284. package/lib/constant/routing-profile.js +1 -1
  285. package/lib/context/app-resolver.js +1 -1
  286. package/lib/context/auth-resolver.js +1 -1
  287. package/lib/context/config-loader.js +1 -1
  288. package/lib/context.js +1 -1
  289. package/lib/core/alias-resolver.js +1 -1
  290. package/lib/core/api-client.d.ts +0 -28
  291. package/lib/core/api-client.js +1 -1
  292. package/lib/core/bff/config.js +1 -1
  293. package/lib/core/bff/file-system.js +1 -1
  294. package/lib/core/bff/hash.js +1 -1
  295. package/lib/core/bff/hook-directory.js +1 -1
  296. package/lib/core/bff/lock.js +1 -1
  297. package/lib/core/bff/utils.js +1 -1
  298. package/lib/core/cross-db-analysis.js +1 -1
  299. package/lib/core/cross-db-relation.js +1 -1
  300. package/lib/core/db-resolver.js +1 -1
  301. package/lib/core/flow-config.js +1 -1
  302. package/lib/core/instant-api-policy/config.js +1 -1
  303. package/lib/core/instant-api-policy/endpoints.d.ts +8 -0
  304. package/lib/core/instant-api-policy/endpoints.js +1 -0
  305. package/lib/core/kb-management-client.d.ts +3 -9
  306. package/lib/core/kb-management-client.js +1 -1
  307. package/lib/core/kb-search-client.d.ts +1 -4
  308. package/lib/core/kb-search-client.js +1 -1
  309. package/lib/core/page/file-system.js +1 -1
  310. package/lib/core/page/hash.js +1 -1
  311. package/lib/core/page/lock.js +1 -1
  312. package/lib/core/page/lr-smart-jsx.js +1 -1
  313. package/lib/core/sql-index-auditor.js +1 -1
  314. package/lib/core/sql-sync/config.js +1 -1
  315. package/lib/core/sql-sync/file-system.js +1 -1
  316. package/lib/core/sql-sync/hash.js +1 -1
  317. package/lib/core/sql-sync/lock.js +1 -1
  318. package/lib/core/sql-sync/utils.js +1 -1
  319. package/lib/core/sql-validator.js +1 -1
  320. package/lib/errors.js +1 -1
  321. package/lib/framework/build-all-flags.js +1 -1
  322. package/lib/framework/error-output.js +1 -1
  323. package/lib/framework/explicit-yes.js +1 -1
  324. package/lib/framework/flags.js +1 -1
  325. package/lib/framework/help.js +1 -1
  326. package/lib/framework/index.js +1 -1
  327. package/lib/framework/output.js +1 -1
  328. package/lib/framework/response.js +1 -1
  329. package/lib/framework/runner-alias.js +1 -1
  330. package/lib/framework/runner.js +1 -1
  331. package/lib/framework/schema-export.js +1 -1
  332. package/lib/framework/supported-flags.js +1 -1
  333. package/lib/framework/types.js +1 -1
  334. package/lib/generated/build-info.d.ts +4 -4
  335. package/lib/generated/build-info.js +1 -1
  336. package/lib/generated/official-routing.js +1 -1
  337. package/lib/generated/routing-contract.js +1 -1
  338. package/lib/help.js +1 -1
  339. package/lib/postinstall.js +1 -1
  340. package/lib/runtime/confirmation.js +1 -1
  341. package/lib/runtime/event.js +1 -1
  342. package/lib/runtime/index.js +1 -1
  343. package/lib/runtime/queue.js +1 -1
  344. package/lib/runtime/resolve.js +1 -1
  345. package/lib/services/dataset-design/checkpoint.js +1 -1
  346. package/lib/services/dataset-design/commands.js +1 -1
  347. package/lib/services/dataset-design/contract.js +1 -1
  348. package/lib/skills/builtin-skill.js +1 -1
  349. package/lib/skills/main.js +1 -1
  350. package/lib/skills/npx-skills-add.js +1 -1
  351. package/lib/skills/skill-presence.js +1 -1
  352. package/lib/telemetry/cli-command-trace.js +1 -1
  353. package/lib/telemetry/cli-help-trace.js +1 -1
  354. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  355. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  356. package/lib/telemetry/send-cli-trace-log.js +1 -1
  357. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  358. package/lib/utils/ai_config.js +1 -1
  359. package/lib/utils/apply-jq-filter.js +1 -1
  360. package/lib/utils/cdn-config.js +1 -1
  361. package/lib/utils/check-sdk-version.js +1 -1
  362. package/lib/utils/cli-version-check.js +1 -1
  363. package/lib/utils/cli-version-policy.js +1 -1
  364. package/lib/utils/config.js +1 -1
  365. package/lib/utils/entity-with-id.js +1 -1
  366. package/lib/utils/file-utils.js +1 -1
  367. package/lib/utils/guides-cdn.js +1 -1
  368. package/lib/utils/http-client.js +1 -1
  369. package/lib/utils/is-non-interactive.js +1 -1
  370. package/lib/utils/logger.js +1 -1
  371. package/lib/utils/params.js +1 -1
  372. package/lib/utils/platform.js +1 -1
  373. package/lib/utils/sleep.js +1 -1
  374. package/lib/utils/template-replacer.js +1 -1
  375. package/lib/utils/update-notice.js +1 -1
  376. package/lib/utils/version.js +1 -1
  377. package/lib/utils/with-active-cookie.js +1 -1
  378. package/lib/utils/write-cli-side-channel.js +1 -1
  379. package/package.json +3 -2
  380. package/skills/rabetbase/SKILL.md +2 -2
  381. package/skills/rabetbase-dataset-generation/SKILL.md +2 -2
  382. package/skills/rabetbase-page-generation/SKILL.md +2 -2
  383. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a216_0x8b7b3c=a216_0x3e62;(function(_0x23ff52,_0x3d4df4){const _0xdea77f=a216_0x3e62,_0x285e15=_0x23ff52();while(!![]){try{const _0x5466c5=-parseInt(_0xdea77f(0xad))/0x1*(-parseInt(_0xdea77f(0xc3))/0x2)+-parseInt(_0xdea77f(0xb7))/0x3+-parseInt(_0xdea77f(0xa6))/0x4*(-parseInt(_0xdea77f(0xcb))/0x5)+-parseInt(_0xdea77f(0xdd))/0x6*(parseInt(_0xdea77f(0xb0))/0x7)+parseInt(_0xdea77f(0xd9))/0x8+-parseInt(_0xdea77f(0xd6))/0x9+parseInt(_0xdea77f(0xb2))/0xa;if(_0x5466c5===_0x3d4df4)break;else _0x285e15['push'](_0x285e15['shift']());}catch(_0x3b828f){_0x285e15['push'](_0x285e15['shift']());}}}(a216_0x7787,0x7155d));import{copyFileSync,existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import a216_0x31d3a6 from'node:path';import{getMultiAppConfigs,initMultiAppEnvironment,readConfigFile,writeConfigFile}from'../../context.js';import{DEFAULT_API_DIR}from'../../constant/paths.js';import{getRuntimeDomain}from'../../constant/domain.js';import{getRegistryGroup,resolveApiProfileLayouts}from'../../api/api-group.js';import{MODEL_REGISTRY_FILE_NAME,MODEL_RUNTIME_FILE_NAME,readModelRegistry,updateModelRegistry}from'../../api/model-registry-file.js';import{isLegacyGeneratedApiScaffold,isLegacyGeneratedClientScaffold,parseLegacyApiModels}from'../../api/legacy-api-file.js';import{renderModelRegistryScaffold}from'../../api/model-registry-scaffold.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';const MIGRATION_ID=a216_0x8b7b3c(0xbf),SDK_CONFIG_SOURCE='/**\x0a\x20*\x20Lovrabet\x20SDK\x20runtime\x20routing.\x0a\x20*\x20Generated\x20by\x20Rabetbase\x20CLI.\x20Do\x20not\x20add\x20credentials\x20to\x20this\x20file.\x0a\x20*/\x0aexport\x20const\x20LOVRABET_SDK_CONFIG\x20=\x20{}\x20as\x20const;\x0a';function a216_0x3e62(_0x258dae,_0x7599a1){_0x258dae=_0x258dae-0x99;const _0x7787b5=a216_0x7787();let _0x3e62ef=_0x7787b5[_0x258dae];return _0x3e62ef;}function relativeMigrationDir(_0x41c46b,_0x48d3fe){const _0x3030f8=a216_0x8b7b3c,_0x2ba658=a216_0x31d3a6['relative'](_0x41c46b,_0x48d3fe);return _0x2ba658&&!_0x2ba658[_0x3030f8(0xa3)]('..')?_0x2ba658:_0x3030f8(0xa7);}function candidatePath(_0x3a56ff,_0xc75a4c,_0x50cf0c){const _0x42d099=a216_0x8b7b3c;return a216_0x31d3a6[_0x42d099(0xd4)](_0x3a56ff,_0x42d099(0xa5),_0x42d099(0xa9),MIGRATION_ID,_0x42d099(0xd8),relativeMigrationDir(_0x3a56ff,_0xc75a4c),_0x50cf0c);}function backupPath(_0x2cdea9,_0x196876,_0x2c3d91){const _0x20d11b=a216_0x8b7b3c;return a216_0x31d3a6[_0x20d11b(0xd4)](_0x2cdea9,'.rabetbase',_0x20d11b(0xa9),MIGRATION_ID,'backups',relativeMigrationDir(_0x2cdea9,_0x196876),_0x2c3d91);}function readOptional(_0x5395ab){const _0x448199=a216_0x8b7b3c;try{return readFileSync(_0x5395ab,_0x448199(0xb9));}catch{return undefined;}}function readJsonObject(_0x470921){const _0x56deac=a216_0x8b7b3c;try{const _0x2a4529=JSON[_0x56deac(0xc2)](readFileSync(_0x470921,'utf8'));return _0x2a4529&&typeof _0x2a4529===_0x56deac(0xb1)?_0x2a4529:{};}catch{return{};}}function planEntrypoint(_0x248068,_0x25f417,_0x2dd565,_0x210d45){const _0x31a341=a216_0x8b7b3c,_0x4472f8=a216_0x31d3a6['join'](_0x25f417,_0x2dd565),_0x172813=readOptional(_0x4472f8);if(_0x172813===undefined)return{'path':_0x4472f8,'action':_0x31a341(0xaf)};if(_0x2dd565===_0x31a341(0xa1)?_0x172813['includes'](_0x31a341(0xb8))&&_0x172813['includes'](_0x31a341(0xcf)):_0x172813['includes'](_0x31a341(0xb3)))return{'path':_0x4472f8,'action':_0x31a341(0xd1)};if(_0x210d45(_0x172813))return{'path':_0x4472f8,'action':'replace-generated','reason':'Recognized\x20legacy\x20CLI\x20scaffold;\x20a\x20backup\x20will\x20be\x20retained.'};return{'path':_0x4472f8,'action':_0x31a341(0xb6),'reason':_0x31a341(0xba),'candidatePath':candidatePath(_0x248068,_0x25f417,_0x2dd565)};}function syntheticApps(_0x364008){const _0x42acd4=a216_0x8b7b3c,_0xacab21=_0x364008[_0x42acd4(0xcd)]&&typeof _0x364008[_0x42acd4(0xcd)]===_0x42acd4(0xb1)?_0x364008['apps']:undefined;if(_0xacab21&&Object[_0x42acd4(0xab)](_0xacab21)['length']>0x0){const _0x34093c=typeof _0x364008[_0x42acd4(0x9f)]===_0x42acd4(0x9a)?_0x364008['defaultApp']:Object[_0x42acd4(0xab)](_0xacab21)[_0x42acd4(0xae)]===0x1?Object[_0x42acd4(0xab)](_0xacab21)[0x0]:undefined;return Object[_0x42acd4(0xc6)](_0xacab21)[_0x42acd4(0xc7)](([_0x3deb86,_0x5df6e3])=>{const _0x4e9993=_0x42acd4,_0x279781=_0x5df6e3,_0x3397d=typeof _0x279781[_0x4e9993(0xb4)]===_0x4e9993(0x9a)?_0x279781['appcode']:'';return _0x3397d?[{'name':_0x3deb86,'appcode':_0x3397d,'apiGroup':typeof _0x279781[_0x4e9993(0xce)]===_0x4e9993(0x9a)?_0x279781['apiGroup']:undefined,'isDefault':_0x3deb86===_0x34093c,'region':'cn','regionSource':_0x4e9993(0xde),'apiDir':typeof _0x279781['apiDir']==='string'?_0x279781[_0x4e9993(0x9b)]:typeof _0x364008[_0x4e9993(0x9b)]===_0x4e9993(0x9a)?_0x364008[_0x4e9993(0x9b)]:undefined,'routingConfig':{}}]:[];});}const _0x29c440=typeof _0x364008[_0x42acd4(0xb4)]===_0x42acd4(0x9a)?_0x364008['appcode']:typeof _0x364008[_0x42acd4(0x9c)]==='string'?_0x364008[_0x42acd4(0x9c)]:undefined;if(!_0x29c440)return[];return[{'name':_0x29c440,'appcode':_0x29c440,'isDefault':!![],'region':'cn','regionSource':_0x42acd4(0xde),'apiDir':typeof _0x364008[_0x42acd4(0x9b)]===_0x42acd4(0x9a)?_0x364008['apiDir']:undefined,'routingConfig':{}}];}function configuredLayouts(_0x1b2845,_0x3ba8cc){const _0x5e04f8=a216_0x8b7b3c;return resolveApiProfileLayouts(_0x3ba8cc,_0xdd6e38=>a216_0x31d3a6[_0x5e04f8(0x99)](_0x1b2845,_0xdd6e38[_0x5e04f8(0x9b)]||DEFAULT_API_DIR),_0x1b2845);}function uniqueRegistryGroups(_0x2df849){const _0x181e1e=a216_0x8b7b3c,_0x2cf902=[],_0x4f05b5=new Set(),_0x1992e5=new Set();for(const _0x5e308a of _0x2df849){const _0x3d5a18=getRegistryGroup(_0x2df849,_0x5e308a);if(!_0x3d5a18){_0x4f05b5[_0x181e1e(0xdf)](_0x5e308a[_0x181e1e(0xaa)]);continue;}const _0x382273=_0x5e308a[_0x181e1e(0xd0)]+'\x00'+(_0x5e308a[_0x181e1e(0xce)]??_0x181e1e(0xc8));!_0x1992e5[_0x181e1e(0xe1)](_0x382273)&&(_0x2cf902[_0x181e1e(0xd5)](_0x3d5a18),_0x1992e5[_0x181e1e(0xdf)](_0x382273));}return{'groups':_0x2cf902,'skipped':[..._0x4f05b5]};}function planGroup(_0x227b91,_0x25ad8b){const _0x38b8d4=a216_0x8b7b3c,_0x2290f7=_0x25ad8b[0x0][_0x38b8d4(0xd0)],_0x47fe51=a216_0x31d3a6[_0x38b8d4(0xd4)](_0x2290f7,MODEL_RUNTIME_FILE_NAME),_0x25184a=readOptional(_0x47fe51),_0x3a71a1=_0x25184a!==undefined&&_0x25184a[_0x38b8d4(0xb5)]('Profile-aware\x20model\x20selection\x20generated\x20by\x20Rabetbase\x20CLI')&&_0x25184a[_0x38b8d4(0xb5)](_0x38b8d4(0xbd))&&_0x25184a[_0x38b8d4(0xb5)]('No\x20Lovrabet\x20model\x20profile\x20matches\x20Runtime\x20Domain'),_0x558a8d=a216_0x31d3a6[_0x38b8d4(0xd4)](_0x2290f7,MODEL_REGISTRY_FILE_NAME),_0x3cc1d5=a216_0x31d3a6['join'](_0x2290f7,'sdk-config.ts'),_0x5de607=[planEntrypoint(_0x227b91,_0x2290f7,_0x38b8d4(0xa1),isLegacyGeneratedApiScaffold),planEntrypoint(_0x227b91,_0x2290f7,_0x38b8d4(0xc5),isLegacyGeneratedClientScaffold),{'path':_0x47fe51,'action':_0x25184a===undefined?_0x38b8d4(0xaf):_0x3a71a1?'unchanged':_0x38b8d4(0xb6),'reason':_0x25184a===undefined?undefined:'The\x20existing\x20runtime\x20selector\x20is\x20not\x20a\x20recognized\x20current\x20generated\x20file.',..._0x25184a!==undefined&&!_0x3a71a1?{'candidatePath':candidatePath(_0x227b91,_0x2290f7,MODEL_RUNTIME_FILE_NAME)}:{}},{'path':_0x558a8d,'action':existsSync(_0x558a8d)?_0x38b8d4(0xa4):_0x38b8d4(0xaf),'reason':_0x38b8d4(0xac)},{'path':_0x3cc1d5,'action':existsSync(_0x3cc1d5)?_0x38b8d4(0xa4):'create'}];return{'apiDir':_0x2290f7,'profiles':_0x25ad8b[_0x38b8d4(0xdb)](_0x4c5210=>_0x4c5210[_0x38b8d4(0x9c)][_0x38b8d4(0xc0)]),'files':_0x5de607};}export function analyzeProjectApiArchitecture(_0x27b3e1,_0x24836e){const _0xed3336=a216_0x8b7b3c,_0x397fe2=a216_0x31d3a6[_0xed3336(0xd4)](_0x27b3e1,_0xed3336(0xe0)),_0x2315ce=_0x24836e??(existsSync(_0x397fe2)?readJsonObject(_0x397fe2):{}),_0x585933=syntheticApps(_0x2315ce);if(_0x585933['length']===0x0)return{'migration':MIGRATION_ID,'needed':![],'configAction':_0xed3336(0xbe),'groups':[],'skippedLegacyDirectories':[],'manualMergeRequired':![]};const _0x197f42=_0x2315ce[_0xed3336(0xcd)]?_0xed3336(0xd1):_0xed3336(0xca),{groups:_0x5df961,skipped:_0xcfa8ab}=uniqueRegistryGroups(configuredLayouts(_0x27b3e1,_0x585933)),_0x3266f8=_0x5df961['map'](_0x3a799c=>planGroup(_0x27b3e1,_0x3a799c)),_0x348ce5=_0x3266f8[_0xed3336(0xc4)](_0x2d7ebb=>_0x2d7ebb[_0xed3336(0xc9)][_0xed3336(0xc4)](_0xea11fa=>_0xea11fa[_0xed3336(0xd7)]===_0xed3336(0xb6))),_0x942bc4=_0x197f42===_0xed3336(0xca)||_0x3266f8[_0xed3336(0xc4)](_0x5b1ea4=>_0x5b1ea4['files'][_0xed3336(0xc4)](_0x2cf4e8=>![_0xed3336(0xd1),_0xed3336(0xa4)][_0xed3336(0xb5)](_0x2cf4e8['action'])));return{'migration':MIGRATION_ID,'needed':_0x942bc4,'configAction':_0x197f42,'groups':_0x3266f8,'skippedLegacyDirectories':_0xcfa8ab,'manualMergeRequired':_0x348ce5};}function a216_0x7787(){const _0x4d5c68=['api.ts','api','startsWith','preserve','.rabetbase','4vVBFSE','external-api-dir','basename','project-upgrade','outputDir','keys','Model\x20facts\x20are\x20preserved\x20and\x20completed\x20from\x20legacy\x20generated\x20files\x20when\x20possible.','3763vVvuCR','length','create','45822XlkxOg','object','4924800pSywTf','LOVRABET_RUNTIME_DOMAIN','appcode','includes','manual-merge','1550898mUhBHE','./models.generated','utf8','The\x20file\x20contains\x20project-owned\x20code\x20and\x20will\x20not\x20be\x20overwritten.','manualMergeRequired','candidatePath','Multiple\x20Lovrabet\x20model\x20profiles\x20match\x20Runtime\x20Domain','unconfigured','api-model-registry-v2','name','replace-generated','parse','114PXSgzT','some','client.ts','entries','flatMap','single','files','migrate-single-app','2159060AZZVJa','profiles','apps','apiGroup','./model-runtime','normalizedApiDir','unchanged','find','-api.ts','join','push','527697vTZVVN','action','candidates','2612216upGyjC','client','map','path','390xAWRmb','default','add','.rabetbase.json','has','modelRuntime','resolve','string','apiDir','app','dirname','sdk-config.ts','defaultApp','isDefault'];a216_0x7787=function(){return _0x4d5c68;};return a216_0x7787();}function migrateSingleAppConfig(_0x5bc4ff){const _0x2e963d=a216_0x8b7b3c,_0x39eabf=a216_0x31d3a6[_0x2e963d(0xd4)](_0x5bc4ff,_0x2e963d(0xe0));if(!existsSync(_0x39eabf))return;const _0x315699=readConfigFile(_0x39eabf);if(_0x315699['apps']&&typeof _0x315699[_0x2e963d(0xcd)]==='object')return;const _0x41266a=typeof _0x315699['appcode']===_0x2e963d(0x9a)?_0x315699['appcode']:typeof _0x315699[_0x2e963d(0x9c)]===_0x2e963d(0x9a)?_0x315699[_0x2e963d(0x9c)]:undefined;if(!_0x41266a)return;_0x315699['apps']={[_0x41266a]:{'appcode':_0x41266a}},_0x315699['defaultApp']=_0x41266a,delete _0x315699['app'],delete _0x315699[_0x2e963d(0xb4)],writeConfigFile(_0x39eabf,_0x315699);}function legacyApiPath(_0x47ef9f,_0x27a57a){const _0x535a0f=a216_0x8b7b3c,_0x41fba5=_0x27a57a[_0x535a0f(0xd0)],_0x3a9f64=_0x47ef9f[_0x535a0f(0xae)]===0x1||_0x27a57a['app'][_0x535a0f(0xa0)]?[a216_0x31d3a6[_0x535a0f(0xd4)](_0x41fba5,_0x535a0f(0xa1)),a216_0x31d3a6[_0x535a0f(0xd4)](_0x41fba5,_0x27a57a['app'][_0x535a0f(0xc0)]+'-api.ts')]:[a216_0x31d3a6['join'](_0x41fba5,_0x27a57a['app']['name']+_0x535a0f(0xd3))];return _0x3a9f64[_0x535a0f(0xd2)](existsSync);}function writeCandidateOrEntrypoint(_0x599797,_0x5a59fb,_0x22640a,_0x32fc74){const _0x78d143=a216_0x8b7b3c;if(_0x22640a[_0x78d143(0xd7)]===_0x78d143(0xd1)||_0x22640a[_0x78d143(0xd7)]===_0x78d143(0xa4))return;if(_0x22640a[_0x78d143(0xd7)]===_0x78d143(0xb6)){const _0x2109c9=_0x22640a[_0x78d143(0xbc)];mkdirSync(a216_0x31d3a6['dirname'](_0x2109c9),{'recursive':!![]}),writeFileSync(_0x2109c9,_0x32fc74,'utf8');return;}if(_0x22640a[_0x78d143(0xd7)]===_0x78d143(0xc1)){const _0x2ceb2e=backupPath(_0x599797,_0x5a59fb,a216_0x31d3a6['basename'](_0x22640a['path']));mkdirSync(a216_0x31d3a6[_0x78d143(0x9d)](_0x2ceb2e),{'recursive':!![]}),copyFileSync(_0x22640a[_0x78d143(0xdc)],_0x2ceb2e);}mkdirSync(a216_0x31d3a6['dirname'](_0x22640a[_0x78d143(0xdc)]),{'recursive':!![]}),writeFileSync(_0x22640a['path'],_0x32fc74,_0x78d143(0xb9));}export async function upgradeProjectApiArchitecture(_0x4ef07e){const _0x4cfa78=a216_0x8b7b3c,_0x3f8d1b=analyzeProjectApiArchitecture(_0x4ef07e);migrateSingleAppConfig(_0x4ef07e);const _0x4ade2b=getMultiAppConfigs('project',_0x4ef07e)??[],_0x2e3d53=configuredLayouts(_0x4ef07e,_0x4ade2b),{groups:_0x1b33e9}=uniqueRegistryGroups(_0x2e3d53);let _0x1d801e;for(const _0x21d4a7 of _0x1b33e9){const _0x4dafd1=_0x21d4a7[0x0]['normalizedApiDir'];mkdirSync(_0x4dafd1,{'recursive':!![]});const _0x5755c8=_0x21d4a7[_0x4cfa78(0xd2)](_0x4b7e14=>_0x4b7e14[_0x4cfa78(0x9c)][_0x4cfa78(0xa0)])??_0x21d4a7[0x0];for(const _0x11d90e of _0x21d4a7){const _0x3c0b87=a216_0x31d3a6['join'](_0x4dafd1,MODEL_REGISTRY_FILE_NAME),_0x53f26f=readModelRegistry(_0x3c0b87);if(_0x53f26f?.[_0x4cfa78(0xcc)][_0x11d90e['app'][_0x4cfa78(0xc0)]])continue;const _0x1ce955=legacyApiPath(_0x21d4a7,_0x11d90e),_0x142524=_0x1ce955?readOptional(_0x1ce955):undefined;await initMultiAppEnvironment(_0x11d90e['app']),updateModelRegistry({'outputDir':_0x4dafd1,'profileName':_0x11d90e['app'][_0x4cfa78(0xc0)],'defaultProfile':_0x5755c8[_0x4cfa78(0x9c)][_0x4cfa78(0xc0)],'appCode':_0x11d90e[_0x4cfa78(0x9c)][_0x4cfa78(0xb4)],'runtimeDomain':getRuntimeDomain(),'models':_0x142524?parseLegacyApiModels(_0x142524):[]});}const _0x3ecdbc=await renderModelRegistryScaffold(_0x4dafd1,_0x4ef07e),_0x23d355=planGroup(_0x4ef07e,_0x21d4a7);for(const _0x500681 of _0x23d355[_0x4cfa78(0xc9)]){const _0x417fdf=a216_0x31d3a6[_0x4cfa78(0xa8)](_0x500681[_0x4cfa78(0xdc)]);if(_0x417fdf===_0x4cfa78(0xa1))writeCandidateOrEntrypoint(_0x4ef07e,_0x4dafd1,_0x500681,_0x3ecdbc[_0x4cfa78(0xa2)]);else{if(_0x417fdf==='client.ts')writeCandidateOrEntrypoint(_0x4ef07e,_0x4dafd1,_0x500681,_0x3ecdbc[_0x4cfa78(0xda)]);else{if(_0x417fdf===MODEL_RUNTIME_FILE_NAME)writeCandidateOrEntrypoint(_0x4ef07e,_0x4dafd1,_0x500681,_0x3ecdbc[_0x4cfa78(0xe2)]);else _0x417fdf===_0x4cfa78(0x9e)&&_0x500681[_0x4cfa78(0xd7)]==='create'&&writeCandidateOrEntrypoint(_0x4ef07e,_0x4dafd1,_0x500681,SDK_CONFIG_SOURCE);}}}}const _0x498915=_0x4ade2b[_0x4cfa78(0xd2)](_0x429aba=>_0x429aba[_0x4cfa78(0xa0)])??_0x4ade2b[0x0];_0x498915&&(await initMultiAppEnvironment(_0x498915),_0x1d801e=writeProjectDomainRoutingManifest(_0x4ef07e)[_0x4cfa78(0xdc)]);const _0x18f8b6=analyzeProjectApiArchitecture(_0x4ef07e);return{..._0x3f8d1b,'completed':!_0x18f8b6['manualMergeRequired'],'manualMergeRequired':_0x18f8b6[_0x4cfa78(0xbb)],'routingPath':_0x1d801e};}
1
+ const a216_0x4e085d=a216_0x5dd7;(function(_0xbf6025,_0x3a65b2){const _0x45ae86=a216_0x5dd7,_0x4a3ee6=_0xbf6025();while(!![]){try{const _0x180ff1=parseInt(_0x45ae86(0x1fe))/0x1*(-parseInt(_0x45ae86(0x200))/0x2)+-parseInt(_0x45ae86(0x1c4))/0x3+-parseInt(_0x45ae86(0x1db))/0x4+parseInt(_0x45ae86(0x1fc))/0x5*(-parseInt(_0x45ae86(0x1e0))/0x6)+parseInt(_0x45ae86(0x1e6))/0x7*(parseInt(_0x45ae86(0x1fd))/0x8)+parseInt(_0x45ae86(0x1dd))/0x9*(-parseInt(_0x45ae86(0x1c8))/0xa)+-parseInt(_0x45ae86(0x1c9))/0xb*(-parseInt(_0x45ae86(0x1cf))/0xc);if(_0x180ff1===_0x3a65b2)break;else _0x4a3ee6['push'](_0x4a3ee6['shift']());}catch(_0x131d5a){_0x4a3ee6['push'](_0x4a3ee6['shift']());}}}(a216_0x4a19,0x5aed9));import{copyFileSync,existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import a216_0xfb611b from'node:path';import{getMultiAppConfigs,initMultiAppEnvironment,readConfigFile,writeConfigFile}from'../../context.js';import{DEFAULT_API_DIR}from'../../constant/paths.js';import{getRuntimeDomain}from'../../constant/domain.js';import{getRegistryGroup,resolveApiProfileLayouts}from'../../api/api-group.js';import{MODEL_REGISTRY_FILE_NAME,MODEL_RUNTIME_FILE_NAME,readModelRegistry,updateModelRegistry}from'../../api/model-registry-file.js';import{isLegacyGeneratedApiScaffold,isLegacyGeneratedClientScaffold,parseLegacyApiModels}from'../../api/legacy-api-file.js';function a216_0x4a19(){const _0x1f9ead=['project','resolve','keys','basename','apiGroup','apiDir','Model\x20facts\x20are\x20preserved\x20and\x20completed\x20from\x20legacy\x20generated\x20files\x20when\x20possible.','replace-generated','893960OTezCB','app','216pDGBND','backups','manualMergeRequired','6yfYHOO','project-upgrade','Multiple\x20Lovrabet\x20model\x20profiles\x20match\x20Runtime\x20Domain','No\x20Lovrabet\x20model\x20profile\x20matches\x20Runtime\x20Domain','unconfigured','includes','7rbugpv','.rabetbase','-api.ts','The\x20file\x20contains\x20project-owned\x20code\x20and\x20will\x20not\x20be\x20overwritten.','outputDir','find','create','api-model-registry-v2','dirname','profiles','map','api.ts','push','LOVRABET_RUNTIME_DOMAIN','object','sdk-config.ts','unchanged','single','manual-merge','action','add','defaultApp','1688920OIkEEJ','1481448hRnnTB','33451ASQahB','/**\x0a\x20*\x20Lovrabet\x20SDK\x20runtime\x20routing.\x0a\x20*\x20Generated\x20by\x20Rabetbase\x20CLI.\x20Do\x20not\x20add\x20credentials\x20to\x20this\x20file.\x0a\x20*/\x0aexport\x20const\x20LOVRABET_SDK_CONFIG\x20=\x20{}\x20as\x20const;\x0a','10hgwhEe','length','flatMap','isDefault','.rabetbase.json','modelRuntime','default','utf8','some','preserve','appcode','api','1936041fBykQB','files','client.ts','name','3800JdALzO','11044ywoCfG','normalizedApiDir','path','migrate-single-app','apps','client','18768nYthQd','string','join','Profile-aware\x20model\x20selection\x20generated\x20by\x20Rabetbase\x20CLI'];a216_0x4a19=function(){return _0x1f9ead;};return a216_0x4a19();}import{renderModelRegistryScaffold}from'../../api/model-registry-scaffold.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';const MIGRATION_ID=a216_0x4e085d(0x1ed),SDK_CONFIG_SOURCE=a216_0x4e085d(0x1ff);function relativeMigrationDir(_0x1bca37,_0x51ce9c){const _0xfa1c73=a216_0xfb611b['relative'](_0x1bca37,_0x51ce9c);return _0xfa1c73&&!_0xfa1c73['startsWith']('..')?_0xfa1c73:'external-api-dir';}function a216_0x5dd7(_0x29e47a,_0x57ff9f){_0x29e47a=_0x29e47a-0x1b9;const _0x4a1933=a216_0x4a19();let _0x5dd72e=_0x4a1933[_0x29e47a];return _0x5dd72e;}function candidatePath(_0x28d85b,_0x1806f4,_0x112bb6){const _0x39b2db=a216_0x4e085d;return a216_0xfb611b[_0x39b2db(0x1d1)](_0x28d85b,_0x39b2db(0x1e7),_0x39b2db(0x1e1),MIGRATION_ID,'candidates',relativeMigrationDir(_0x28d85b,_0x1806f4),_0x112bb6);}function backupPath(_0x4556df,_0x4039d6,_0x5ee858){const _0x553622=a216_0x4e085d;return a216_0xfb611b[_0x553622(0x1d1)](_0x4556df,_0x553622(0x1e7),'project-upgrade',MIGRATION_ID,_0x553622(0x1de),relativeMigrationDir(_0x4556df,_0x4039d6),_0x5ee858);}function readOptional(_0x2efb58){const _0x49ab81=a216_0x4e085d;try{return readFileSync(_0x2efb58,_0x49ab81(0x1bf));}catch{return undefined;}}function readJsonObject(_0x4d4feb){const _0x4fe540=a216_0x4e085d;try{const _0x4a76b7=JSON['parse'](readFileSync(_0x4d4feb,_0x4fe540(0x1bf)));return _0x4a76b7&&typeof _0x4a76b7===_0x4fe540(0x1f4)?_0x4a76b7:{};}catch{return{};}}function planEntrypoint(_0xc5b367,_0x3b4796,_0xcd5cd,_0x27afc2){const _0x338980=a216_0x4e085d,_0x13b0e7=a216_0xfb611b[_0x338980(0x1d1)](_0x3b4796,_0xcd5cd),_0x127726=readOptional(_0x13b0e7);if(_0x127726===undefined)return{'path':_0x13b0e7,'action':_0x338980(0x1ec)};if(_0xcd5cd==='api.ts'?_0x127726[_0x338980(0x1e5)]('./models.generated')&&_0x127726['includes']('./model-runtime'):_0x127726[_0x338980(0x1e5)](_0x338980(0x1f3)))return{'path':_0x13b0e7,'action':'unchanged'};if(_0x27afc2(_0x127726))return{'path':_0x13b0e7,'action':_0x338980(0x1da),'reason':'Recognized\x20legacy\x20CLI\x20scaffold;\x20a\x20backup\x20will\x20be\x20retained.'};return{'path':_0x13b0e7,'action':_0x338980(0x1f8),'reason':_0x338980(0x1e9),'candidatePath':candidatePath(_0xc5b367,_0x3b4796,_0xcd5cd)};}function syntheticApps(_0x460244){const _0x416ac1=a216_0x4e085d,_0x30765a=_0x460244[_0x416ac1(0x1cd)]&&typeof _0x460244[_0x416ac1(0x1cd)]===_0x416ac1(0x1f4)?_0x460244[_0x416ac1(0x1cd)]:undefined;if(_0x30765a&&Object[_0x416ac1(0x1d5)](_0x30765a)[_0x416ac1(0x1b9)]>0x0){const _0x1d8398=typeof _0x460244[_0x416ac1(0x1fb)]===_0x416ac1(0x1d0)?_0x460244[_0x416ac1(0x1fb)]:Object[_0x416ac1(0x1d5)](_0x30765a)[_0x416ac1(0x1b9)]===0x1?Object[_0x416ac1(0x1d5)](_0x30765a)[0x0]:undefined;return Object['entries'](_0x30765a)[_0x416ac1(0x1ba)](([_0x53aa3f,_0x30bdbc])=>{const _0x462036=_0x416ac1,_0x33f3d3=_0x30bdbc,_0x3d1efb=typeof _0x33f3d3[_0x462036(0x1c2)]==='string'?_0x33f3d3[_0x462036(0x1c2)]:'';return _0x3d1efb?[{'name':_0x53aa3f,'appcode':_0x3d1efb,'apiGroup':typeof _0x33f3d3[_0x462036(0x1d7)]===_0x462036(0x1d0)?_0x33f3d3[_0x462036(0x1d7)]:undefined,'isDefault':_0x53aa3f===_0x1d8398,'region':'cn','regionSource':_0x462036(0x1be),'apiDir':typeof _0x33f3d3['apiDir']==='string'?_0x33f3d3[_0x462036(0x1d8)]:typeof _0x460244[_0x462036(0x1d8)]===_0x462036(0x1d0)?_0x460244[_0x462036(0x1d8)]:undefined,'routingConfig':{}}]:[];});}const _0x260922=typeof _0x460244[_0x416ac1(0x1c2)]===_0x416ac1(0x1d0)?_0x460244['appcode']:typeof _0x460244['app']==='string'?_0x460244[_0x416ac1(0x1dc)]:undefined;if(!_0x260922)return[];return[{'name':_0x260922,'appcode':_0x260922,'isDefault':!![],'region':'cn','regionSource':_0x416ac1(0x1be),'apiDir':typeof _0x460244[_0x416ac1(0x1d8)]==='string'?_0x460244[_0x416ac1(0x1d8)]:undefined,'routingConfig':{}}];}function configuredLayouts(_0x38e463,_0xad4a7a){const _0xd34631=a216_0x4e085d;return resolveApiProfileLayouts(_0xad4a7a,_0xdf232e=>a216_0xfb611b[_0xd34631(0x1d4)](_0x38e463,_0xdf232e[_0xd34631(0x1d8)]||DEFAULT_API_DIR),_0x38e463);}function uniqueRegistryGroups(_0x12b0fd){const _0x349f4c=a216_0x4e085d,_0x2112f2=[],_0x3a157e=new Set(),_0x24eb19=new Set();for(const _0x2b69dd of _0x12b0fd){const _0x5da8a2=getRegistryGroup(_0x12b0fd,_0x2b69dd);if(!_0x5da8a2){_0x3a157e[_0x349f4c(0x1fa)](_0x2b69dd[_0x349f4c(0x1ea)]);continue;}const _0x458021=_0x2b69dd['normalizedApiDir']+'\x00'+(_0x2b69dd[_0x349f4c(0x1d7)]??_0x349f4c(0x1f7));!_0x24eb19['has'](_0x458021)&&(_0x2112f2[_0x349f4c(0x1f2)](_0x5da8a2),_0x24eb19[_0x349f4c(0x1fa)](_0x458021));}return{'groups':_0x2112f2,'skipped':[..._0x3a157e]};}function planGroup(_0x2e686a,_0x41f5fb){const _0x45f077=a216_0x4e085d,_0x2633e2=_0x41f5fb[0x0]['normalizedApiDir'],_0x54ffe0=a216_0xfb611b[_0x45f077(0x1d1)](_0x2633e2,MODEL_RUNTIME_FILE_NAME),_0x32f263=readOptional(_0x54ffe0),_0x549bb5=_0x32f263!==undefined&&_0x32f263[_0x45f077(0x1e5)](_0x45f077(0x1d2))&&_0x32f263[_0x45f077(0x1e5)](_0x45f077(0x1e2))&&_0x32f263[_0x45f077(0x1e5)](_0x45f077(0x1e3)),_0x5073f3=a216_0xfb611b[_0x45f077(0x1d1)](_0x2633e2,MODEL_REGISTRY_FILE_NAME),_0x5f0ccc=a216_0xfb611b[_0x45f077(0x1d1)](_0x2633e2,_0x45f077(0x1f5)),_0x386205=[planEntrypoint(_0x2e686a,_0x2633e2,_0x45f077(0x1f1),isLegacyGeneratedApiScaffold),planEntrypoint(_0x2e686a,_0x2633e2,_0x45f077(0x1c6),isLegacyGeneratedClientScaffold),{'path':_0x54ffe0,'action':_0x32f263===undefined?_0x45f077(0x1ec):_0x549bb5?_0x45f077(0x1f6):_0x45f077(0x1f8),'reason':_0x32f263===undefined?undefined:'The\x20existing\x20runtime\x20selector\x20is\x20not\x20a\x20recognized\x20current\x20generated\x20file.',..._0x32f263!==undefined&&!_0x549bb5?{'candidatePath':candidatePath(_0x2e686a,_0x2633e2,MODEL_RUNTIME_FILE_NAME)}:{}},{'path':_0x5073f3,'action':existsSync(_0x5073f3)?'preserve':_0x45f077(0x1ec),'reason':_0x45f077(0x1d9)},{'path':_0x5f0ccc,'action':existsSync(_0x5f0ccc)?_0x45f077(0x1c1):_0x45f077(0x1ec)}];return{'apiDir':_0x2633e2,'profiles':_0x41f5fb['map'](_0x45f2cd=>_0x45f2cd[_0x45f077(0x1dc)][_0x45f077(0x1c7)]),'files':_0x386205};}export function analyzeProjectApiArchitecture(_0x5063ce,_0x39aa30){const _0x5f3d9c=a216_0x4e085d,_0x590d2c=a216_0xfb611b[_0x5f3d9c(0x1d1)](_0x5063ce,_0x5f3d9c(0x1bc)),_0x1260bc=_0x39aa30??(existsSync(_0x590d2c)?readJsonObject(_0x590d2c):{}),_0x1dec0b=syntheticApps(_0x1260bc);if(_0x1dec0b['length']===0x0)return{'migration':MIGRATION_ID,'needed':![],'configAction':_0x5f3d9c(0x1e4),'groups':[],'skippedLegacyDirectories':[],'manualMergeRequired':![]};const _0x42f348=_0x1260bc[_0x5f3d9c(0x1cd)]?_0x5f3d9c(0x1f6):_0x5f3d9c(0x1cc),{groups:_0x2dcf2d,skipped:_0x9770a1}=uniqueRegistryGroups(configuredLayouts(_0x5063ce,_0x1dec0b)),_0x56f1b5=_0x2dcf2d[_0x5f3d9c(0x1f0)](_0x3aa763=>planGroup(_0x5063ce,_0x3aa763)),_0x448c97=_0x56f1b5['some'](_0x19be6a=>_0x19be6a[_0x5f3d9c(0x1c5)][_0x5f3d9c(0x1c0)](_0x1e2c98=>_0x1e2c98['action']===_0x5f3d9c(0x1f8))),_0x1c3b19=_0x42f348==='migrate-single-app'||_0x56f1b5['some'](_0x1516c4=>_0x1516c4[_0x5f3d9c(0x1c5)][_0x5f3d9c(0x1c0)](_0x3db280=>![_0x5f3d9c(0x1f6),_0x5f3d9c(0x1c1)][_0x5f3d9c(0x1e5)](_0x3db280[_0x5f3d9c(0x1f9)])));return{'migration':MIGRATION_ID,'needed':_0x1c3b19,'configAction':_0x42f348,'groups':_0x56f1b5,'skippedLegacyDirectories':_0x9770a1,'manualMergeRequired':_0x448c97};}function migrateSingleAppConfig(_0x35199f){const _0x274049=a216_0x4e085d,_0x56d432=a216_0xfb611b[_0x274049(0x1d1)](_0x35199f,_0x274049(0x1bc));if(!existsSync(_0x56d432))return;const _0xec1b08=readConfigFile(_0x56d432);if(_0xec1b08[_0x274049(0x1cd)]&&typeof _0xec1b08[_0x274049(0x1cd)]===_0x274049(0x1f4))return;const _0x35c987=typeof _0xec1b08['appcode']==='string'?_0xec1b08[_0x274049(0x1c2)]:typeof _0xec1b08['app']===_0x274049(0x1d0)?_0xec1b08['app']:undefined;if(!_0x35c987)return;_0xec1b08['apps']={[_0x35c987]:{'appcode':_0x35c987}},_0xec1b08[_0x274049(0x1fb)]=_0x35c987,delete _0xec1b08[_0x274049(0x1dc)],delete _0xec1b08[_0x274049(0x1c2)],writeConfigFile(_0x56d432,_0xec1b08);}function legacyApiPath(_0x3e9662,_0x399711){const _0x27af34=a216_0x4e085d,_0x2f41cb=_0x399711[_0x27af34(0x1ca)],_0x5caa4a=_0x3e9662[_0x27af34(0x1b9)]===0x1||_0x399711[_0x27af34(0x1dc)][_0x27af34(0x1bb)]?[a216_0xfb611b[_0x27af34(0x1d1)](_0x2f41cb,_0x27af34(0x1f1)),a216_0xfb611b[_0x27af34(0x1d1)](_0x2f41cb,_0x399711[_0x27af34(0x1dc)][_0x27af34(0x1c7)]+_0x27af34(0x1e8))]:[a216_0xfb611b[_0x27af34(0x1d1)](_0x2f41cb,_0x399711[_0x27af34(0x1dc)][_0x27af34(0x1c7)]+_0x27af34(0x1e8))];return _0x5caa4a[_0x27af34(0x1eb)](existsSync);}function writeCandidateOrEntrypoint(_0x237aea,_0xb24fea,_0x148a46,_0x596429){const _0x583c0a=a216_0x4e085d;if(_0x148a46['action']==='unchanged'||_0x148a46['action']===_0x583c0a(0x1c1))return;if(_0x148a46[_0x583c0a(0x1f9)]===_0x583c0a(0x1f8)){const _0x599b96=_0x148a46['candidatePath'];mkdirSync(a216_0xfb611b[_0x583c0a(0x1ee)](_0x599b96),{'recursive':!![]}),writeFileSync(_0x599b96,_0x596429,_0x583c0a(0x1bf));return;}if(_0x148a46[_0x583c0a(0x1f9)]==='replace-generated'){const _0x1cdd3f=backupPath(_0x237aea,_0xb24fea,a216_0xfb611b[_0x583c0a(0x1d6)](_0x148a46[_0x583c0a(0x1cb)]));mkdirSync(a216_0xfb611b[_0x583c0a(0x1ee)](_0x1cdd3f),{'recursive':!![]}),copyFileSync(_0x148a46[_0x583c0a(0x1cb)],_0x1cdd3f);}mkdirSync(a216_0xfb611b[_0x583c0a(0x1ee)](_0x148a46[_0x583c0a(0x1cb)]),{'recursive':!![]}),writeFileSync(_0x148a46[_0x583c0a(0x1cb)],_0x596429,_0x583c0a(0x1bf));}export async function upgradeProjectApiArchitecture(_0x177bce){const _0x4b5aa8=a216_0x4e085d,_0x40aa42=analyzeProjectApiArchitecture(_0x177bce);migrateSingleAppConfig(_0x177bce);const _0x246e5b=getMultiAppConfigs(_0x4b5aa8(0x1d3),_0x177bce)??[],_0x4bec49=configuredLayouts(_0x177bce,_0x246e5b),{groups:_0x1d32e4}=uniqueRegistryGroups(_0x4bec49);let _0xf1525f;for(const _0x4d9e89 of _0x1d32e4){const _0x36e8d7=_0x4d9e89[0x0][_0x4b5aa8(0x1ca)];mkdirSync(_0x36e8d7,{'recursive':!![]});const _0x5a4ef5=_0x4d9e89[_0x4b5aa8(0x1eb)](_0x3c3332=>_0x3c3332[_0x4b5aa8(0x1dc)]['isDefault'])??_0x4d9e89[0x0];for(const _0x34178b of _0x4d9e89){const _0x472161=a216_0xfb611b['join'](_0x36e8d7,MODEL_REGISTRY_FILE_NAME),_0x1ac829=readModelRegistry(_0x472161);if(_0x1ac829?.[_0x4b5aa8(0x1ef)][_0x34178b['app'][_0x4b5aa8(0x1c7)]])continue;const _0x53ece2=legacyApiPath(_0x4d9e89,_0x34178b),_0x3bd2bd=_0x53ece2?readOptional(_0x53ece2):undefined;await initMultiAppEnvironment(_0x34178b[_0x4b5aa8(0x1dc)]),updateModelRegistry({'outputDir':_0x36e8d7,'profileName':_0x34178b[_0x4b5aa8(0x1dc)][_0x4b5aa8(0x1c7)],'defaultProfile':_0x5a4ef5[_0x4b5aa8(0x1dc)][_0x4b5aa8(0x1c7)],'appCode':_0x34178b[_0x4b5aa8(0x1dc)][_0x4b5aa8(0x1c2)],'runtimeDomain':getRuntimeDomain(),'models':_0x3bd2bd?parseLegacyApiModels(_0x3bd2bd):[]});}const _0x5ad475=await renderModelRegistryScaffold(_0x36e8d7,_0x177bce),_0x411637=planGroup(_0x177bce,_0x4d9e89);for(const _0x7831ee of _0x411637[_0x4b5aa8(0x1c5)]){const _0x32813e=a216_0xfb611b['basename'](_0x7831ee[_0x4b5aa8(0x1cb)]);if(_0x32813e===_0x4b5aa8(0x1f1))writeCandidateOrEntrypoint(_0x177bce,_0x36e8d7,_0x7831ee,_0x5ad475[_0x4b5aa8(0x1c3)]);else{if(_0x32813e===_0x4b5aa8(0x1c6))writeCandidateOrEntrypoint(_0x177bce,_0x36e8d7,_0x7831ee,_0x5ad475[_0x4b5aa8(0x1ce)]);else{if(_0x32813e===MODEL_RUNTIME_FILE_NAME)writeCandidateOrEntrypoint(_0x177bce,_0x36e8d7,_0x7831ee,_0x5ad475[_0x4b5aa8(0x1bd)]);else _0x32813e===_0x4b5aa8(0x1f5)&&_0x7831ee[_0x4b5aa8(0x1f9)]==='create'&&writeCandidateOrEntrypoint(_0x177bce,_0x36e8d7,_0x7831ee,SDK_CONFIG_SOURCE);}}}}const _0x315a7c=_0x246e5b[_0x4b5aa8(0x1eb)](_0x529c5a=>_0x529c5a[_0x4b5aa8(0x1bb)])??_0x246e5b[0x0];_0x315a7c&&(await initMultiAppEnvironment(_0x315a7c),_0xf1525f=writeProjectDomainRoutingManifest(_0x177bce)[_0x4b5aa8(0x1cb)]);const _0x24ebfa=analyzeProjectApiArchitecture(_0x177bce);return{..._0x40aa42,'completed':!_0x24ebfa[_0x4b5aa8(0x1df)],'manualMergeRequired':_0x24ebfa[_0x4b5aa8(0x1df)],'routingPath':_0xf1525f};}
@@ -1 +1 @@
1
- (function(_0x37fe99,_0x5c3b55){const _0x2c2c30=a217_0x18ed,_0x2409f4=_0x37fe99();while(!![]){try{const _0x105b7a=parseInt(_0x2c2c30(0xec))/0x1+-parseInt(_0x2c2c30(0xe0))/0x2+-parseInt(_0x2c2c30(0xe4))/0x3+-parseInt(_0x2c2c30(0xed))/0x4+-parseInt(_0x2c2c30(0xeb))/0x5*(parseInt(_0x2c2c30(0xda))/0x6)+-parseInt(_0x2c2c30(0xe9))/0x7+-parseInt(_0x2c2c30(0xdd))/0x8*(-parseInt(_0x2c2c30(0xef))/0x9);if(_0x105b7a===_0x5c3b55)break;else _0x2409f4['push'](_0x2409f4['shift']());}catch(_0xbc97f4){_0x2409f4['push'](_0x2409f4['shift']());}}}(a217_0x69e7,0x22ea7));import{existsSync}from'node:fs';function a217_0x18ed(_0x378814,_0x483676){_0x378814=_0x378814-0xd8;const _0x69e747=a217_0x69e7();let _0x18ed33=_0x69e747[_0x378814];return _0x18ed33;}import a217_0x26afb9 from'node:path';import a217_0x616807 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';function a217_0x69e7(){const _0x1c9822=['green','24TkvtMf','√\x20Project\x20Name:\x20','trim','208944aFodFN','cwd','cyan','my-app','695541PGTsSv','log','Logged\x20in','env','string','862064XxAaUY','Directory\x20\x22','5ALDDsA','158534VFmZAx','893972qlKuid','√\x20App\x20Code:\x20','2547531ifkwKU','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','resolve','Project\x20name:','√\x20Login\x20status:\x20','Skipped','Login\x20failed','1090392LzQcDx','production'];a217_0x69e7=function(){return _0x1c9822;};return a217_0x69e7();}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(_0x402e6d,_0x194ca5,_0x298612){const _0x23ca83=a217_0x18ed,_0x4aebe5=_0x23ca83(0xe3),_0x560a38=readConfig(),_0x1892f1=typeof _0x560a38[_0x23ca83(0xe7)]===_0x23ca83(0xe8)?_0x560a38[_0x23ca83(0xe7)]:undefined,_0x1c5484=await input({'message':_0x23ca83(0xf2),'default':_0x4aebe5,'validate':_0x3f02d8=>{const _0x2e4aab=_0x23ca83,_0x25d231=_0x3f02d8[_0x2e4aab(0xdf)]()||_0x4aebe5,_0x58efeb=getProjectNameValidationError(_0x25d231);if(_0x58efeb)return _0x58efeb;const _0x32a232=a217_0x26afb9[_0x2e4aab(0xf1)](process[_0x2e4aab(0xe1)](),_0x25d231);if(existsSync(_0x32a232))return _0x2e4aab(0xea)+_0x25d231+'\x22\x20already\x20exists';return!![];}});console[_0x23ca83(0xe5)](a217_0x616807[_0x23ca83(0xdc)](_0x23ca83(0xde)+a217_0x616807[_0x23ca83(0xe2)](_0x1c5484)));const _0x164506=await selectSingleAppcode(_0x298612);console[_0x23ca83(0xe5)](a217_0x616807[_0x23ca83(0xdc)](_0x23ca83(0xee)+a217_0x616807[_0x23ca83(0xe2)](_0x164506||'Not\x20set')));if(_0x164506){const _0x580bd5=await getIsSessionValid();if(!_0x580bd5){const _0x534eba=await confirm({'message':_0x23ca83(0xf0),'default':!![]});if(_0x534eba){const _0x17a19b=await authServer({'silent':!![]});console['log'](a217_0x616807[_0x23ca83(0xdc)](_0x23ca83(0xf3)+a217_0x616807[_0x23ca83(0xe2)](_0x17a19b?_0x23ca83(0xe6):_0x23ca83(0xd9))));}else console['log'](a217_0x616807[_0x23ca83(0xdc)]('√\x20Login\x20status:\x20'+a217_0x616807[_0x23ca83(0xe2)](_0x23ca83(0xd8))));}await _0x402e6d({'projectName':_0x1c5484,'appCode':_0x164506,'env':_0x194ca5||_0x1892f1||_0x23ca83(0xdb)});}else await _0x402e6d({'projectName':_0x1c5484,'env':_0x194ca5||_0x1892f1||_0x23ca83(0xdb)});}
1
+ (function(_0x1bf555,_0x4c6566){const _0x4a8c01=a217_0x3a28,_0x56039c=_0x1bf555();while(!![]){try{const _0xa4a90d=-parseInt(_0x4a8c01(0x152))/0x1*(parseInt(_0x4a8c01(0x148))/0x2)+parseInt(_0x4a8c01(0x151))/0x3+parseInt(_0x4a8c01(0x14b))/0x4+-parseInt(_0x4a8c01(0x140))/0x5+parseInt(_0x4a8c01(0x14f))/0x6*(-parseInt(_0x4a8c01(0x153))/0x7)+parseInt(_0x4a8c01(0x142))/0x8*(-parseInt(_0x4a8c01(0x147))/0x9)+parseInt(_0x4a8c01(0x144))/0xa;if(_0xa4a90d===_0x4c6566)break;else _0x56039c['push'](_0x56039c['shift']());}catch(_0x3a1070){_0x56039c['push'](_0x56039c['shift']());}}}(a217_0x170e,0xe3acf));import{existsSync}from'node:fs';import a217_0x48ad92 from'node:path';import a217_0xc49cad from'chalk';function a217_0x3a28(_0x2a9d3e,_0x2cf8d8){_0x2a9d3e=_0x2a9d3e-0x13e;const _0x170e68=a217_0x170e();let _0x3a2882=_0x170e68[_0x2a9d3e];return _0x3a2882;}import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getProjectNameValidationError}from'../../../commands/project/create/project-name.js';export async function guidedCreateProject(_0x559836,_0xea600,_0x23114b){const _0xce41f2=a217_0x3a28,_0x511152=_0xce41f2(0x155),_0x40a3fa=readConfig(),_0x4053d6=typeof _0x40a3fa[_0xce41f2(0x141)]==='string'?_0x40a3fa[_0xce41f2(0x141)]:undefined,_0x392d93=await input({'message':_0xce41f2(0x146),'default':_0x511152,'validate':_0x44c4fb=>{const _0xefc4be=_0xce41f2,_0x40996c=_0x44c4fb['trim']()||_0x511152,_0x16e211=getProjectNameValidationError(_0x40996c);if(_0x16e211)return _0x16e211;const _0x46695a=a217_0x48ad92[_0xefc4be(0x145)](process[_0xefc4be(0x154)](),_0x40996c);if(existsSync(_0x46695a))return _0xefc4be(0x14d)+_0x40996c+_0xefc4be(0x13f);return!![];}});console['log'](a217_0xc49cad[_0xce41f2(0x150)]('√\x20Project\x20Name:\x20'+a217_0xc49cad[_0xce41f2(0x143)](_0x392d93)));const _0x5355dc=await selectSingleAppcode(_0x23114b);console['log'](a217_0xc49cad['green']('√\x20App\x20Code:\x20'+a217_0xc49cad[_0xce41f2(0x143)](_0x5355dc||_0xce41f2(0x149))));if(_0x5355dc){const _0x474fdf=await getIsSessionValid();if(!_0x474fdf){const _0x209e40=await confirm({'message':_0xce41f2(0x14a),'default':!![]});if(_0x209e40){const _0x527b18=await authServer({'silent':!![]});console[_0xce41f2(0x13e)](a217_0xc49cad['green']('√\x20Login\x20status:\x20'+a217_0xc49cad[_0xce41f2(0x143)](_0x527b18?_0xce41f2(0x14c):_0xce41f2(0x14e))));}else console[_0xce41f2(0x13e)](a217_0xc49cad['green']('√\x20Login\x20status:\x20'+a217_0xc49cad[_0xce41f2(0x143)](_0xce41f2(0x157))));}await _0x559836({'projectName':_0x392d93,'appCode':_0x5355dc,'env':_0xea600||_0x4053d6||_0xce41f2(0x156)});}else await _0x559836({'projectName':_0x392d93,'env':_0xea600||_0x4053d6||_0xce41f2(0x156)});}function a217_0x170e(){const _0x170087=['cyan','45068640wxGiHb','resolve','Project\x20name:','12442671yarTnS','30668vHEMfp','Not\x20set','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','3495644MOaZvS','Logged\x20in','Directory\x20\x22','Login\x20failed','1164LhzkmM','green','2245473bRheAB','94TUnDSp','63721uWSKah','cwd','my-app','production','Skipped','log','\x22\x20already\x20exists','3034050zZdRHm','env','8HNtHmH'];a217_0x170e=function(){return _0x170087;};return a217_0x170e();}
@@ -1 +1 @@
1
- function a218_0x2981(_0x5ca714,_0x1655d4){_0x5ca714=_0x5ca714-0xfe;const _0x2f7f90=a218_0x2f7f();let _0x2981ba=_0x2f7f90[_0x5ca714];return _0x2981ba;}function a218_0x2f7f(){const _0x1e0010=['1017892TmqVAb','9020940IJWDeY','1347536uRgIfD','now','replace','8004GiQeFc','toFixed','8855916OqLakR','7YqlbGR','72srApTr','160701AIprVY','52xkeQnr','5037200YEdVsi'];a218_0x2f7f=function(){return _0x1e0010;};return a218_0x2f7f();}(function(_0x42b79c,_0x4ffabd){const _0x57622b=a218_0x2981,_0xb5583c=_0x42b79c();while(!![]){try{const _0x57794b=parseInt(_0x57622b(0x106))/0x1+parseInt(_0x57622b(0x104))/0x2*(parseInt(_0x57622b(0x103))/0x3)+-parseInt(_0x57622b(0xfe))/0x4+-parseInt(_0x57622b(0x107))/0x5+parseInt(_0x57622b(0x100))/0x6*(-parseInt(_0x57622b(0x101))/0x7)+-parseInt(_0x57622b(0x108))/0x8*(-parseInt(_0x57622b(0x102))/0x9)+parseInt(_0x57622b(0x105))/0xa;if(_0x57794b===_0x4ffabd)break;else _0xb5583c['push'](_0xb5583c['shift']());}catch(_0xb05dbc){_0xb5583c['push'](_0xb5583c['shift']());}}}(a218_0x2f7f,0xef303));export function formatElapsed(_0x49a29e){const _0x37a1a3=a218_0x2981,_0x42346c=Date[_0x37a1a3(0x109)]()-_0x49a29e;if(_0x42346c<0x3e8)return _0x42346c+'ms';const _0x379cbe=(_0x42346c/0x3e8)[_0x37a1a3(0xff)](0x2),_0x1e2da2=_0x379cbe[_0x37a1a3(0x10a)](/\.?0+$/u,'');return _0x1e2da2+'s';}
1
+ function a218_0x11b6(){const _0x4b3dca=['replace','500328VPhBIx','2863gjfabg','1535370wKMRYH','393941ysPuzP','603rmXhav','32335WiWWuP','1061890cfuLqV','3194QeKwYH','5752GasXXY','27lQyfEy'];a218_0x11b6=function(){return _0x4b3dca;};return a218_0x11b6();}function a218_0x3a2b(_0x3199d9,_0x16e79a){_0x3199d9=_0x3199d9-0xb3;const _0x11b697=a218_0x11b6();let _0x3a2bdf=_0x11b697[_0x3199d9];return _0x3a2bdf;}(function(_0x929a68,_0x4c5da8){const _0x103422=a218_0x3a2b,_0x18cba9=_0x929a68();while(!![]){try{const _0x17762c=parseInt(_0x103422(0xb8))/0x1+parseInt(_0x103422(0xbc))/0x2*(parseInt(_0x103422(0xb9))/0x3)+-parseInt(_0x103422(0xb5))/0x4+parseInt(_0x103422(0xba))/0x5+parseInt(_0x103422(0xb7))/0x6+-parseInt(_0x103422(0xb6))/0x7*(parseInt(_0x103422(0xbd))/0x8)+-parseInt(_0x103422(0xb3))/0x9*(parseInt(_0x103422(0xbb))/0xa);if(_0x17762c===_0x4c5da8)break;else _0x18cba9['push'](_0x18cba9['shift']());}catch(_0x2d3728){_0x18cba9['push'](_0x18cba9['shift']());}}}(a218_0x11b6,0x3a7dc));export function formatElapsed(_0x29ff12){const _0x6785a4=a218_0x3a2b,_0x4e6b29=Date['now']()-_0x29ff12;if(_0x4e6b29<0x3e8)return _0x4e6b29+'ms';const _0x14818c=(_0x4e6b29/0x3e8)['toFixed'](0x2),_0x22364b=_0x14818c[_0x6785a4(0xb4)](/\.?0+$/u,'');return _0x22364b+'s';}
@@ -1 +1 @@
1
- function a219_0x5d4e(_0x5a128f,_0xf478e8){_0x5a128f=_0x5a128f-0x66;const _0x2aae2b=a219_0x2aae();let _0x5d4e16=_0x2aae2b[_0x5a128f];return _0x5d4e16;}(function(_0xa4882d,_0x39122e){const _0x18d2cd=a219_0x5d4e,_0x3b9f27=_0xa4882d();while(!![]){try{const _0x4e775e=-parseInt(_0x18d2cd(0x67))/0x1*(-parseInt(_0x18d2cd(0xbf))/0x2)+-parseInt(_0x18d2cd(0x90))/0x3+parseInt(_0x18d2cd(0xc6))/0x4*(-parseInt(_0x18d2cd(0xc2))/0x5)+parseInt(_0x18d2cd(0xb0))/0x6*(-parseInt(_0x18d2cd(0xad))/0x7)+parseInt(_0x18d2cd(0xd6))/0x8+-parseInt(_0x18d2cd(0xc0))/0x9*(parseInt(_0x18d2cd(0xa7))/0xa)+parseInt(_0x18d2cd(0xcc))/0xb;if(_0x4e775e===_0x39122e)break;else _0x3b9f27['push'](_0x3b9f27['shift']());}catch(_0x25e8ed){_0x3b9f27['push'](_0x3b9f27['shift']());}}}(a219_0x2aae,0xda08c));import a219_0x467778 from'path';import a219_0x2998a8 from'fs';import a219_0x99b8cb from'chalk';import a219_0x8e80f 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';function a219_0x2aae(){const _0xc29740=['.rabetbase-create-','currentDir','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','...','readdirSync','lstatSync','project','7721208cnmfvW','Configured\x20app\x20AppCode:\x20','API\x20configuration\x20pull\x20failed','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','√\x20Pulled\x20','rmSync','extracting','projectCode','push','toLocaleString','888967iVTpqK','minimumVersion','success','downloading','fail','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','appCode','name','\x20api\x20pull\x20--force\x20--yes','Failed\x20to\x20configure\x20app\x20AppCode','version','production','Project\x20creation\x20failed:\x20','keys','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','Starting\x20project\x20creation:\x20','The\x20current\x20directory\x20must\x20be\x20empty.','error','\x20√\x20','Project\x20template\x20ready','length','\x20|\x20AppCode:\x20','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','cd\x20','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.','readFileSync','Updating\x20package.json\x20name','Copying\x20local\x20template\x20source','\x20&&\x20','dev','create','API\x20configuration\x20pulled:\x20','info','green','package.json','stableVersion','cookie','parse','\x20model(s)','Verifying\x20project\x20template','2817246FQaqth','\x20dataset(s),\x20generated\x20','resolving','*\x20Pulling\x20API\x20configuration...','start','basename','needsUpgrade','belowMinimum','1.0.0','*\x20Configuring\x20AppCode\x20for\x20project\x20','\x20run\x20start','Failed\x20to\x20update\x20package.json','join','\x20\x201.\x20Start\x20project:\x20','existsSync','log','message','apps','Project\x20name:\x20','CLI\x20version\x20check','relative','gray','Resolving\x20project\x20template','4110810YZfOQk','modelCount','warn','repeat','ino','resolve','7JKoMTq','🚀\x20Next\x20Steps:','mkdtempSync','5313180boOyCc','reverse','currentVersion','nonInteractive','cyan','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','\x20already\x20exists','utf8','isDirectory','Format\x20code','description','projectName','verifying','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','2UVJmSx','27ASCADz','string','5199805fiRCZB','Project\x20directory\x20','stop','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','4QjAhXG','env','bold','cwd','setLogPath','√\x20package.json\x20updated:\x20name=','34504426yRQaFi','validation','copying'];a219_0x2aae=function(){return _0xc29740;};return a219_0x2aae();}import{loadRawConfigLayers,writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';import{validateProjectName}from'../../../commands/project/create/project-name.js';import{getRuntimeDomain,getSdkClientRoutingConfig}from'../../../constant/domain.js';import{generateSdkConfigFile}from'../../../api/generate-sdk-config-file.js';import{writeProjectDomainRoutingManifest}from'../../../config/project-domain-routing.js';import{CliErrors}from'../../../errors.js';function readDirectoryIdentity(_0x4c3cce){const _0x443068=a219_0x5d4e;try{const _0x295e16=a219_0x2998a8[_0x443068(0xd4)](_0x4c3cce);if(!_0x295e16[_0x443068(0xb9)]())return null;return{'dev':_0x295e16[_0x443068(0x85)],'ino':_0x295e16[_0x443068(0xab)]};}catch{return null;}}function isSameDirectory(_0x3c54a1,_0x3300bf){const _0x5bbdb2=a219_0x5d4e;return!!_0x3c54a1&&!!_0x3300bf&&_0x3c54a1[_0x5bbdb2(0x85)]===_0x3300bf[_0x5bbdb2(0x85)]&&_0x3c54a1['ino']===_0x3300bf[_0x5bbdb2(0xab)];}function commitCurrentDirectoryProject(_0x4dd1f7,_0x43ddaa,_0x480700){const _0xc8f3cd=a219_0x5d4e;if(!isSameDirectory(readDirectoryIdentity(_0x4dd1f7),_0x480700))throw new Error(_0xc8f3cd(0xbe));const _0x525d7a=a219_0x467778['basename'](_0x43ddaa),_0x34b75b=a219_0x2998a8['readdirSync'](_0x4dd1f7);if(_0x34b75b['length']!==0x1||_0x34b75b[0x0]!==_0x525d7a)throw CliErrors[_0xc8f3cd(0xcd)](_0xc8f3cd(0x80),_0xc8f3cd(0xc5));const _0x21e45e=a219_0x467778[_0xc8f3cd(0x9c)](_0x43ddaa,_0xc8f3cd(0xd5)),_0x3fce3d=[];try{for(const _0x127c02 of a219_0x2998a8[_0xc8f3cd(0xd3)](_0x21e45e)){a219_0x2998a8['renameSync'](a219_0x467778[_0xc8f3cd(0x9c)](_0x21e45e,_0x127c02),a219_0x467778[_0xc8f3cd(0x9c)](_0x4dd1f7,_0x127c02)),_0x3fce3d[_0xc8f3cd(0xde)](_0x127c02);}a219_0x2998a8[_0xc8f3cd(0xdb)](_0x43ddaa,{'recursive':!![],'force':!![]});}catch(_0x23556d){for(const _0x599443 of _0x3fce3d[_0xc8f3cd(0xb1)]()){const _0x55c822=a219_0x467778[_0xc8f3cd(0x9c)](_0x4dd1f7,_0x599443);if(!a219_0x2998a8[_0xc8f3cd(0x9e)](_0x55c822))continue;a219_0x2998a8['renameSync'](_0x55c822,a219_0x467778[_0xc8f3cd(0x9c)](_0x21e45e,_0x599443));}throw _0x23556d;}}export async function createApp(_0x77a3f2){const _0x4179f2=a219_0x5d4e,_0x17f452=await checkCliVersion();(_0x17f452[_0x4179f2(0x96)]||_0x17f452[_0x4179f2(0x97)])&&(printCliUpgradeWarning(_0x17f452),assertCliVersionSupported(_0x17f452),logger['info']('create',_0x4179f2(0xa3),{'currentVersion':_0x17f452[_0x4179f2(0xb2)],'stableVersion':_0x17f452[_0x4179f2(0x8b)],'minimumVersion':_0x17f452[_0x4179f2(0x68)],'needsUpgrade':_0x17f452[_0x4179f2(0x96)],'belowMinimum':_0x17f452['belowMinimum']}));const _0x5af280=_0x77a3f2[_0x4179f2(0xd0)]?a219_0x467778[_0x4179f2(0x95)](process[_0x4179f2(0xc9)]()):_0x77a3f2[_0x4179f2(0xdd)];if(_0x5af280&&(_0x77a3f2['appCode']||_0x77a3f2[_0x4179f2(0xb3)]))await runCreate({'projectName':_0x5af280,'appCode':_0x77a3f2['appCode'],'env':_0x77a3f2[_0x4179f2(0xc7)]},_0x77a3f2);else{if(_0x5af280){const _0x542c98=await selectSingleAppcode(_0x77a3f2['cookie']);await runCreate({'projectName':_0x5af280,'appCode':_0x542c98||undefined,'env':_0x77a3f2[_0x4179f2(0xc7)]},_0x77a3f2);}else await guidedCreateProject(_0x25fdd4=>runCreate(_0x25fdd4,_0x77a3f2),_0x77a3f2['env'],_0x77a3f2[_0x4179f2(0x8c)]);}}async function runCreate(_0x458527,_0x31996d){const _0x31bfce=a219_0x5d4e;_0x458527[_0x31bfce(0xbc)]=validateProjectName(_0x458527[_0x31bfce(0xbc)]);const _0xc28d65=_0x31996d[_0x31bfce(0xd0)]?process[_0x31bfce(0xc9)]():a219_0x467778[_0x31bfce(0xac)](process[_0x31bfce(0xc9)](),_0x458527[_0x31bfce(0xbc)]);if(_0x31996d[_0x31bfce(0xd0)]){if(a219_0x2998a8[_0x31bfce(0xd3)](_0xc28d65)['length']>0x0)throw CliErrors[_0x31bfce(0xcd)](_0x31bfce(0x77),'Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.');}else{if(a219_0x2998a8[_0x31bfce(0x9e)](_0xc28d65))throw new Error(_0x31bfce(0xc3)+_0x458527[_0x31bfce(0xbc)]+_0x31bfce(0xb7));}let _0x4161fe=null;const _0x4c128c=_0x31996d[_0x31bfce(0xd0)]?readDirectoryIdentity(_0xc28d65):null;let _0x47aa2c=null;try{a219_0x2998a8['accessSync'](a219_0x467778['dirname'](_0xc28d65),a219_0x2998a8['constants']['W_OK']);}catch{throw new Error(_0x31bfce(0x7e));}logger[_0x31bfce(0x88)](_0x31bfce(0x86),_0x31bfce(0x76)+_0x458527[_0x31bfce(0xbc)],{'projectDir':_0xc28d65,'appCode':_0x458527['appCode']}),console['log'](),console[_0x31bfce(0x9f)](a219_0x99b8cb[_0x31bfce(0x89)](_0x31bfce(0x79))+_0x31bfce(0xa2)+a219_0x99b8cb[_0x31bfce(0x89)](_0x458527[_0x31bfce(0xbc)])+(_0x458527[_0x31bfce(0x6d)]?_0x31bfce(0x7c)+a219_0x99b8cb['cyan'](_0x458527[_0x31bfce(0x6d)]):''));try{let _0x3843e2=_0x458527[_0x31bfce(0xbc)];_0x31996d[_0x31bfce(0xd0)]&&(_0x47aa2c=a219_0x2998a8[_0x31bfce(0xaf)](a219_0x467778[_0x31bfce(0x9c)](_0xc28d65,_0x31bfce(0xcf))),_0x3843e2=a219_0x467778[_0x31bfce(0xa4)](process[_0x31bfce(0xc9)](),a219_0x467778[_0x31bfce(0x9c)](_0x47aa2c,_0x31bfce(0xd5))));const _0x45792c=a219_0x467778[_0x31bfce(0xac)](process[_0x31bfce(0xc9)](),_0x3843e2);await runTask(_0x31bfce(0xa6),_0x94cc7e=>copyProjectTemplate(_0x3843e2,_0x50f003=>_0x94cc7e(projectTemplateStageLabel(_0x50f003)),_0x31996d['templateSource']),_0x31bfce(0x7a)),_0x4161fe=_0x31996d[_0x31bfce(0xd0)]?null:readDirectoryIdentity(_0xc28d65);if(!_0x31996d[_0x31bfce(0xd0)]&&!_0x4161fe)throw new Error(_0x31bfce(0x75));await updatePackageJsonName(_0x3843e2,_0x458527[_0x31bfce(0xbc)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x3843e2)),await runTask(_0x31bfce(0xba),()=>formatProjectCode(_0x3843e2)),await configureAppCode(_0x3843e2,_0x458527['projectName'],_0x458527['appCode']||'',_0x458527['env']);let _0x17e359=![];if(_0x458527[_0x31bfce(0x6d)]){console[_0x31bfce(0x9f)](_0x31bfce(0x93));const _0x6b033b=process[_0x31bfce(0xc9)]();try{process['chdir'](_0x45792c);const _0x3e5234=_0x458527['env']||_0x31bfce(0x72);initEnv(_0x3e5234);const {configArray:_0x3ad24e}=await fetchModelList(_0x458527[_0x31bfce(0x6d)],_0x31996d[_0x31bfce(0x8c)]||''),_0x5b5c8d=DEFAULT_API_DIR,_0x3cc45a=await generateApiFile(_0x3ad24e,'',_0x458527['appCode'],!![],_0x3e5234,_0x5b5c8d,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![],'modelProfile':{'name':_0x458527[_0x31bfce(0x6d)],'defaultName':_0x458527['appCode'],'runtimeDomain':getRuntimeDomain()}});console['log'](_0x31bfce(0xda)+_0x3ad24e[_0x31bfce(0x7b)]+_0x31bfce(0x91)+_0x3cc45a[_0x31bfce(0xa8)]+_0x31bfce(0x8e)),logger[_0x31bfce(0x88)](_0x31bfce(0x86),_0x31bfce(0x87)+_0x458527[_0x31bfce(0x6d)]);}catch(_0x3fd674){_0x17e359=!![],console[_0x31bfce(0x9f)](_0x31bfce(0x7d)+CLI_BIN_NAME+'\x20api\x20pull\x20--force\x20--yes'),logger[_0x31bfce(0xa9)](_0x31bfce(0x86),_0x31bfce(0xd8),{'error':_0x3fd674 instanceof Error?_0x3fd674[_0x31bfce(0xa0)]:String(_0x3fd674)});}finally{process['chdir'](_0x6b033b);}}if(_0x31996d[_0x31bfce(0xd0)]){if(!_0x47aa2c||!_0x4c128c)throw new Error('Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace');commitCurrentDirectoryProject(_0xc28d65,_0x47aa2c,_0x4c128c),_0x47aa2c=null;}try{logger[_0x31bfce(0xca)](_0xc28d65),logger[_0x31bfce(0x69)](_0x31bfce(0x86),'Project\x20created:\x20'+_0x458527['projectName']);}catch(_0x4dc205){console[_0x31bfce(0xa9)](_0x31bfce(0xb5)+(_0x4dc205 instanceof Error?_0x4dc205[_0x31bfce(0xa0)]:String(_0x4dc205)));}console[_0x31bfce(0x9f)](),console[_0x31bfce(0x9f)](a219_0x99b8cb[_0x31bfce(0x89)]('─'['repeat'](0x3c))),console[_0x31bfce(0x9f)](a219_0x99b8cb['cyan'][_0x31bfce(0xc8)](_0x31bfce(0xae))),console[_0x31bfce(0x9f)]();const _0x4dd22a=_0x31996d[_0x31bfce(0xd0)]?CLI_BIN_NAME+_0x31bfce(0x9a):_0x31bfce(0x7f)+_0x458527[_0x31bfce(0xbc)]+_0x31bfce(0x84)+CLI_BIN_NAME+_0x31bfce(0x9a);console[_0x31bfce(0x9f)](_0x31bfce(0x9d)+a219_0x99b8cb[_0x31bfce(0xb4)][_0x31bfce(0xc8)](_0x4dd22a)),_0x17e359&&console[_0x31bfce(0x9f)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a219_0x99b8cb['cyan'][_0x31bfce(0xc8)](CLI_BIN_NAME+_0x31bfce(0x6f))),console['log'](a219_0x99b8cb[_0x31bfce(0x89)]('─'[_0x31bfce(0xaa)](0x3c)));}catch(_0x3a58bc){logger[_0x31bfce(0x78)](_0x31bfce(0x86),_0x31bfce(0x73)+_0x458527[_0x31bfce(0xbc)],{'error':_0x3a58bc instanceof Error?_0x3a58bc['message']:String(_0x3a58bc)});try{const _0x3354f8=readDirectoryIdentity(_0xc28d65);if(_0x31996d['currentDir']&&_0x47aa2c)a219_0x2998a8['rmSync'](_0x47aa2c,{'recursive':!![],'force':!![]});else{if(_0x4161fe&&_0x3354f8?.[_0x31bfce(0x85)]===_0x4161fe[_0x31bfce(0x85)]&&_0x3354f8[_0x31bfce(0xab)]===_0x4161fe['ino'])console[_0x31bfce(0x9f)](_0x31bfce(0xd9)+_0xc28d65),a219_0x2998a8[_0x31bfce(0xdb)](_0xc28d65,{'recursive':!![],'force':!![]});else _0x3354f8&&logger['warn'](_0x31bfce(0x86),'Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20'+_0xc28d65);}}catch{logger[_0x31bfce(0xa9)](_0x31bfce(0x86),'Failed\x20to\x20clean\x20up\x20project\x20directory:\x20'+_0xc28d65);}throw _0x3a58bc;}}async function runTask(_0xfa3e83,_0x3afa52,_0xeb0cf0=_0xfa3e83){const _0x4bef27=a219_0x5d4e,_0x55e45f=a219_0x8e80f(_0xfa3e83+_0x4bef27(0xd2))[_0x4bef27(0x94)]();try{const _0x3a2a43=await _0x3afa52(_0x3340a5=>{const _0x45baa0=_0x4bef27;_0x55e45f['text']=_0x3340a5+_0x45baa0(0xd2);});_0x55e45f[_0x4bef27(0xc4)](),console[_0x4bef27(0x9f)](''+a219_0x99b8cb[_0x4bef27(0x89)]('\x20√\x20')+_0xeb0cf0+'\x20'+a219_0x99b8cb[_0x4bef27(0xa5)]('['+_0x3a2a43+']'));}catch(_0x5a09fe){_0x55e45f[_0x4bef27(0x6b)](_0xfa3e83);throw _0x5a09fe;}}function projectTemplateStageLabel(_0x334f20){const _0x1e3011=a219_0x5d4e;switch(_0x334f20){case _0x1e3011(0x92):return'Resolving\x20project\x20template';case _0x1e3011(0x6a):return'Downloading\x20project\x20template';case _0x1e3011(0xbd):return _0x1e3011(0x8f);case _0x1e3011(0xdc):return'Extracting\x20project\x20template';case _0x1e3011(0xce):return _0x1e3011(0x83);}}async function updatePackageJsonName(_0x3330eb,_0x24ce5d){const _0x5646e6=a219_0x5d4e,_0x231d79=a219_0x467778[_0x5646e6(0xac)](process[_0x5646e6(0xc9)](),_0x3330eb),_0xafae6b=a219_0x467778[_0x5646e6(0x9c)](_0x231d79,_0x5646e6(0x8a));try{console[_0x5646e6(0x9f)](_0x5646e6(0x6c));const _0x331a70=getRabetbaseCliPackageRoot(),_0x17a4fa=a219_0x467778['join'](_0x331a70,_0x5646e6(0x8a));let _0x56f857=_0x5646e6(0x98);try{const _0xaa9fe9=JSON[_0x5646e6(0x8d)](a219_0x2998a8[_0x5646e6(0x81)](_0x17a4fa,_0x5646e6(0xb8)));_0x56f857=_0xaa9fe9[_0x5646e6(0x71)]||'1.0.0';}catch{}const _0x135b9d=a219_0x2998a8[_0x5646e6(0x81)](_0xafae6b,_0x5646e6(0xb8)),_0x5b5fd6=JSON[_0x5646e6(0x8d)](_0x135b9d);_0x5b5fd6[_0x5646e6(0x6e)]=_0x24ce5d,_0x5b5fd6[_0x5646e6(0xbb)]=_0x24ce5d+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x56f857,a219_0x2998a8['writeFileSync'](_0xafae6b,JSON['stringify'](_0x5b5fd6,null,0x2)+'\x0a',_0x5646e6(0xb8)),console[_0x5646e6(0x9f)](_0x5646e6(0xcb)+_0x24ce5d),logger[_0x5646e6(0x88)]('create',_0x5646e6(0x82));}catch(_0x128343){logger[_0x5646e6(0x78)](_0x5646e6(0x86),_0x5646e6(0x9b));throw _0x128343;}}async function configureAppCode(_0x29945e,_0x490f86,_0x139c3a,_0x12b4fa){const _0xfa8776=a219_0x5d4e,_0x568af3=a219_0x467778[_0xfa8776(0xac)](process[_0xfa8776(0xc9)](),_0x29945e),_0x54ee59=a219_0x467778['join'](_0x568af3,NEW_CONFIG_NAME);try{_0x139c3a?console['log'](_0xfa8776(0x99)+_0x490f86+':\x20'+_0x139c3a):console[_0xfa8776(0x9f)](_0xfa8776(0xb6)+_0x490f86);const _0x513034=getRabetbaseCliPackageRoot(),_0x5a8497=a219_0x467778['join'](_0x513034,_0xfa8776(0x8a));let _0x58b8c1='1.0.0';try{const _0x4c157a=JSON['parse'](a219_0x2998a8[_0xfa8776(0x81)](_0x5a8497,_0xfa8776(0xb8)));_0x58b8c1=_0x4c157a[_0xfa8776(0x71)]||'1.0.0';}catch{}const {globalConfig:_0x3ec46d}=loadRawConfigLayers(),_0x35326f=typeof _0x3ec46d[_0xfa8776(0xc7)]===_0xfa8776(0xc1)?_0x3ec46d[_0xfa8776(0xc7)]:undefined,_0x50fef5={};for(const _0x2cce08 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x3ec46d[_0x2cce08]!=null)_0x50fef5[_0x2cce08]=_0x3ec46d[_0x2cce08];}const _0x39eecd=buildCanonicalProjectConfig(_0x50fef5,{'appCodes':_0x139c3a?[_0x139c3a]:[],'env':_0x12b4fa||_0x35326f||_0xfa8776(0x72),'metadata':{'createdAt':new Date()[_0xfa8776(0x66)](),'version':_0x58b8c1}});writeConfigFile(_0x54ee59,_0x39eecd),await generateSdkConfigFile(a219_0x467778['join'](_0x568af3,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x568af3),_0x139c3a?console[_0xfa8776(0x9f)]('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object[_0xfa8776(0x74)](_0x39eecd[_0xfa8776(0xa1)]||{})[_0xfa8776(0x9c)](',\x20')+'\x20|\x20Default:\x20implicit\x20(single\x20app)'):console[_0xfa8776(0x9f)](_0xfa8776(0xd1)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0xfa8776(0x88)]('create',_0xfa8776(0xd7)+_0x139c3a);}catch(_0x3259b0){logger[_0xfa8776(0x78)](_0xfa8776(0x86),_0xfa8776(0x70));throw _0x3259b0;}}
1
+ (function(_0x45c2d6,_0x2b40e4){const _0x538fdf=a219_0x2d31,_0x1fa9c2=_0x45c2d6();while(!![]){try{const _0x17ea95=-parseInt(_0x538fdf(0xed))/0x1+-parseInt(_0x538fdf(0xdf))/0x2+parseInt(_0x538fdf(0x11e))/0x3+parseInt(_0x538fdf(0xdb))/0x4*(-parseInt(_0x538fdf(0xee))/0x5)+-parseInt(_0x538fdf(0xff))/0x6+-parseInt(_0x538fdf(0xf5))/0x7+parseInt(_0x538fdf(0x100))/0x8;if(_0x17ea95===_0x2b40e4)break;else _0x1fa9c2['push'](_0x1fa9c2['shift']());}catch(_0xa6033b){_0x1fa9c2['push'](_0x1fa9c2['shift']());}}}(a219_0x42f9,0xdb6cb));import a219_0xf3a2c4 from'path';import a219_0x594e4a from'fs';import a219_0x525178 from'chalk';import a219_0x2607b9 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';function a219_0x2d31(_0x3776d5,_0x57213a){_0x3776d5=_0x3776d5-0xca;const _0x42f9cd=a219_0x42f9();let _0x2d3196=_0x42f9cd[_0x3776d5];return _0x2d3196;}import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';function a219_0x42f9(){const _0xdc42db=['Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','string','create','Verifying\x20project\x20template','Project\x20name:\x20','ino','3399qPqLEd','451320uJxeoE','appCode','repeat','Downloading\x20project\x20template','🚀\x20Next\x20Steps:','.rabetbase-create-','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','3193260nvdBDm','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.','cwd','production','*\x20Pulling\x20API\x20configuration...','Project\x20creation\x20failed:\x20','cyan','cookie','existsSync','mkdtempSync','3882192jwFiCf','28678296hcYrXU','stringify','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','downloading','Project\x20template\x20ready','projectName','version','success','\x20|\x20AppCode:\x20','nonInteractive','The\x20current\x20directory\x20must\x20be\x20empty.','setLogPath','basename','constants','warn','project','package.json','templateSource','Project\x20created:\x20','√\x20Pulled\x20','Project\x20directory\x20','error','name','Install\x20dependencies','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','resolve','bold','belowMinimum','join','modelCount','2751447LrXtXZ','√\x20package.json\x20updated:\x20name=','dirname','Resolving\x20project\x20template','keys','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','text','\x20run\x20start','copying','\x20api\x20pull\x20--force\x20--yes','message','gray','projectCode','readdirSync','renameSync','API\x20configuration\x20pulled:\x20','Copying\x20local\x20template\x20source','...','1.0.0','accessSync','needsUpgrade','writeFileSync','description','Failed\x20to\x20update\x20package.json','rmSync','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','env','info','\x20&&\x20','√\x20Configuration\x20file\x20created,\x20Apps:\x20','parse','extracting','dev','\x20model(s)','currentVersion','\x20|\x20Default:\x20implicit\x20(single\x20app)','cd\x20','\x20\x201.\x20Start\x20project:\x20','chdir','toLocaleString','Extracting\x20project\x20template','fail','green','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','W_OK','currentDir','stableVersion','length','log','\x20Generated\x20by\x20rabetbase\x20cli\x20','36OjdcuO','verifying','utf8','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','3368372yKsAYp','validation','start','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','CLI\x20version\x20check','apps','Format\x20code','\x20dataset(s),\x20generated\x20'];a219_0x42f9=function(){return _0xdc42db;};return a219_0x42f9();}import{loadRawConfigLayers,writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';import{validateProjectName}from'../../../commands/project/create/project-name.js';import{getRuntimeDomain,getSdkClientRoutingConfig}from'../../../constant/domain.js';import{generateSdkConfigFile}from'../../../api/generate-sdk-config-file.js';import{writeProjectDomainRoutingManifest}from'../../../config/project-domain-routing.js';import{CliErrors}from'../../../errors.js';function readDirectoryIdentity(_0x594fb2){const _0x57fa09=a219_0x2d31;try{const _0x4953cf=a219_0x594e4a['lstatSync'](_0x594fb2);if(!_0x4953cf['isDirectory']())return null;return{'dev':_0x4953cf['dev'],'ino':_0x4953cf[_0x57fa09(0xec)]};}catch{return null;}}function isSameDirectory(_0x12e2e0,_0x44e93e){const _0x868db7=a219_0x2d31;return!!_0x12e2e0&&!!_0x44e93e&&_0x12e2e0['dev']===_0x44e93e['dev']&&_0x12e2e0[_0x868db7(0xec)]===_0x44e93e['ino'];}function commitCurrentDirectoryProject(_0x50fbfd,_0x211717,_0x53c908){const _0x10bb6b=a219_0x2d31;if(!isSameDirectory(readDirectoryIdentity(_0x50fbfd),_0x53c908))throw new Error(_0x10bb6b(0x137));const _0x26ad74=a219_0xf3a2c4['basename'](_0x211717),_0x7333c8=a219_0x594e4a[_0x10bb6b(0x12b)](_0x50fbfd);if(_0x7333c8[_0x10bb6b(0xd8)]!==0x1||_0x7333c8[0x0]!==_0x26ad74)throw CliErrors[_0x10bb6b(0xe0)](_0x10bb6b(0xf6),_0x10bb6b(0xde));const _0x4d5500=a219_0xf3a2c4[_0x10bb6b(0x11c)](_0x211717,_0x10bb6b(0x10f)),_0x36bfdb=[];try{for(const _0x273e89 of a219_0x594e4a[_0x10bb6b(0x12b)](_0x4d5500)){a219_0x594e4a[_0x10bb6b(0x12c)](a219_0xf3a2c4[_0x10bb6b(0x11c)](_0x4d5500,_0x273e89),a219_0xf3a2c4[_0x10bb6b(0x11c)](_0x50fbfd,_0x273e89)),_0x36bfdb['push'](_0x273e89);}a219_0x594e4a[_0x10bb6b(0x136)](_0x211717,{'recursive':!![],'force':!![]});}catch(_0x2dfa18){for(const _0x52931b of _0x36bfdb['reverse']()){const _0x1062ac=a219_0xf3a2c4[_0x10bb6b(0x11c)](_0x50fbfd,_0x52931b);if(!a219_0x594e4a[_0x10bb6b(0xfd)](_0x1062ac))continue;a219_0x594e4a[_0x10bb6b(0x12c)](_0x1062ac,a219_0xf3a2c4[_0x10bb6b(0x11c)](_0x4d5500,_0x52931b));}throw _0x2dfa18;}}export async function createApp(_0x5d9bad){const _0x54a36c=a219_0x2d31,_0x1e2f54=await checkCliVersion();(_0x1e2f54[_0x54a36c(0x132)]||_0x1e2f54[_0x54a36c(0x11b)])&&(printCliUpgradeWarning(_0x1e2f54),assertCliVersionSupported(_0x1e2f54),logger[_0x54a36c(0x139)](_0x54a36c(0xe9),_0x54a36c(0xe3),{'currentVersion':_0x1e2f54[_0x54a36c(0xcb)],'stableVersion':_0x1e2f54[_0x54a36c(0xd7)],'minimumVersion':_0x1e2f54['minimumVersion'],'needsUpgrade':_0x1e2f54[_0x54a36c(0x132)],'belowMinimum':_0x1e2f54[_0x54a36c(0x11b)]}));const _0xa66884=_0x5d9bad['currentDir']?a219_0xf3a2c4[_0x54a36c(0x10c)](process[_0x54a36c(0xf7)]()):_0x5d9bad[_0x54a36c(0x12a)];if(_0xa66884&&(_0x5d9bad[_0x54a36c(0xef)]||_0x5d9bad[_0x54a36c(0x109)]))await runCreate({'projectName':_0xa66884,'appCode':_0x5d9bad[_0x54a36c(0xef)],'env':_0x5d9bad[_0x54a36c(0x138)]},_0x5d9bad);else{if(_0xa66884){const _0x4c61f3=await selectSingleAppcode(_0x5d9bad[_0x54a36c(0xfc)]);await runCreate({'projectName':_0xa66884,'appCode':_0x4c61f3||undefined,'env':_0x5d9bad[_0x54a36c(0x138)]},_0x5d9bad);}else await guidedCreateProject(_0x5e5baa=>runCreate(_0x5e5baa,_0x5d9bad),_0x5d9bad[_0x54a36c(0x138)],_0x5d9bad[_0x54a36c(0xfc)]);}}async function runCreate(_0x33ba98,_0x2836b8){const _0x2a6844=a219_0x2d31;_0x33ba98[_0x2a6844(0x105)]=validateProjectName(_0x33ba98['projectName']);const _0x9a56e2=_0x2836b8['currentDir']?process[_0x2a6844(0xf7)]():a219_0xf3a2c4[_0x2a6844(0x119)](process[_0x2a6844(0xf7)](),_0x33ba98['projectName']);if(_0x2836b8[_0x2a6844(0xd6)]){if(a219_0x594e4a[_0x2a6844(0x12b)](_0x9a56e2)[_0x2a6844(0xd8)]>0x0)throw CliErrors[_0x2a6844(0xe0)](_0x2a6844(0x10a),'Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.');}else{if(a219_0x594e4a[_0x2a6844(0xfd)](_0x9a56e2))throw new Error(_0x2a6844(0x114)+_0x33ba98[_0x2a6844(0x105)]+'\x20already\x20exists');}let _0x542fd5=null;const _0xd313d3=_0x2836b8[_0x2a6844(0xd6)]?readDirectoryIdentity(_0x9a56e2):null;let _0x542e67=null;try{a219_0x594e4a[_0x2a6844(0x131)](a219_0xf3a2c4[_0x2a6844(0x120)](_0x9a56e2),a219_0x594e4a[_0x2a6844(0x10d)][_0x2a6844(0xd5)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x2a6844(0x139)]('create','Starting\x20project\x20creation:\x20'+_0x33ba98[_0x2a6844(0x105)],{'projectDir':_0x9a56e2,'appCode':_0x33ba98['appCode']}),console[_0x2a6844(0xd9)](),console[_0x2a6844(0xd9)](a219_0x525178[_0x2a6844(0xd3)]('\x20√\x20')+_0x2a6844(0xeb)+a219_0x525178[_0x2a6844(0xd3)](_0x33ba98[_0x2a6844(0x105)])+(_0x33ba98['appCode']?_0x2a6844(0x108)+a219_0x525178[_0x2a6844(0xfb)](_0x33ba98['appCode']):''));try{let _0x3687a8=_0x33ba98[_0x2a6844(0x105)];_0x2836b8[_0x2a6844(0xd6)]&&(_0x542e67=a219_0x594e4a[_0x2a6844(0xfe)](a219_0xf3a2c4['join'](_0x9a56e2,_0x2a6844(0xf3))),_0x3687a8=a219_0xf3a2c4['relative'](process[_0x2a6844(0xf7)](),a219_0xf3a2c4['join'](_0x542e67,'project')));const _0xeb606d=a219_0xf3a2c4[_0x2a6844(0x119)](process[_0x2a6844(0xf7)](),_0x3687a8);await runTask(_0x2a6844(0x121),_0x93e04e=>copyProjectTemplate(_0x3687a8,_0x2f0d17=>_0x93e04e(projectTemplateStageLabel(_0x2f0d17)),_0x2836b8[_0x2a6844(0x111)]),_0x2a6844(0x104)),_0x542fd5=_0x2836b8[_0x2a6844(0xd6)]?null:readDirectoryIdentity(_0x9a56e2);if(!_0x2836b8['currentDir']&&!_0x542fd5)throw new Error('Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory');await updatePackageJsonName(_0x3687a8,_0x33ba98[_0x2a6844(0x105)]),await runTask(_0x2a6844(0x117),()=>installDependencies(_0x3687a8)),await runTask(_0x2a6844(0xe5),()=>formatProjectCode(_0x3687a8)),await configureAppCode(_0x3687a8,_0x33ba98['projectName'],_0x33ba98['appCode']||'',_0x33ba98[_0x2a6844(0x138)]);let _0x20c74e=![];if(_0x33ba98[_0x2a6844(0xef)]){console[_0x2a6844(0xd9)](_0x2a6844(0xf9));const _0x2f1c8a=process[_0x2a6844(0xf7)]();try{process[_0x2a6844(0xcf)](_0xeb606d);const _0x3af90a=_0x33ba98[_0x2a6844(0x138)]||_0x2a6844(0xf8);initEnv(_0x3af90a);const {configArray:_0x1abcd0}=await fetchModelList(_0x33ba98[_0x2a6844(0xef)],_0x2836b8['cookie']||''),_0x57616c=DEFAULT_API_DIR,_0x58679b=await generateApiFile(_0x1abcd0,'',_0x33ba98['appCode'],!![],_0x3af90a,_0x57616c,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![],'modelProfile':{'name':_0x33ba98[_0x2a6844(0xef)],'defaultName':_0x33ba98['appCode'],'runtimeDomain':getRuntimeDomain()}});console[_0x2a6844(0xd9)](_0x2a6844(0x113)+_0x1abcd0['length']+_0x2a6844(0xe6)+_0x58679b[_0x2a6844(0x11d)]+_0x2a6844(0xca)),logger[_0x2a6844(0x139)]('create',_0x2a6844(0x12d)+_0x33ba98[_0x2a6844(0xef)]);}catch(_0x146680){_0x20c74e=!![],console[_0x2a6844(0xd9)](_0x2a6844(0xf4)+CLI_BIN_NAME+'\x20api\x20pull\x20--force\x20--yes'),logger[_0x2a6844(0x10e)](_0x2a6844(0xe9),'API\x20configuration\x20pull\x20failed',{'error':_0x146680 instanceof Error?_0x146680['message']:String(_0x146680)});}finally{process[_0x2a6844(0xcf)](_0x2f1c8a);}}if(_0x2836b8['currentDir']){if(!_0x542e67||!_0xd313d3)throw new Error(_0x2a6844(0xe7));commitCurrentDirectoryProject(_0x9a56e2,_0x542e67,_0xd313d3),_0x542e67=null;}try{logger[_0x2a6844(0x10b)](_0x9a56e2),logger[_0x2a6844(0x107)]('create',_0x2a6844(0x112)+_0x33ba98[_0x2a6844(0x105)]);}catch(_0x433976){console[_0x2a6844(0x10e)](_0x2a6844(0x123)+(_0x433976 instanceof Error?_0x433976['message']:String(_0x433976)));}console[_0x2a6844(0xd9)](),console['log'](a219_0x525178[_0x2a6844(0xd3)]('─'[_0x2a6844(0xf0)](0x3c))),console['log'](a219_0x525178['cyan'][_0x2a6844(0x11a)](_0x2a6844(0xf2))),console[_0x2a6844(0xd9)]();const _0x199348=_0x2836b8['currentDir']?CLI_BIN_NAME+_0x2a6844(0x125):_0x2a6844(0xcd)+_0x33ba98['projectName']+_0x2a6844(0x13a)+CLI_BIN_NAME+_0x2a6844(0x125);console[_0x2a6844(0xd9)](_0x2a6844(0xce)+a219_0x525178[_0x2a6844(0xfb)]['bold'](_0x199348)),_0x20c74e&&console[_0x2a6844(0xd9)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a219_0x525178['cyan'][_0x2a6844(0x11a)](CLI_BIN_NAME+_0x2a6844(0x127))),console[_0x2a6844(0xd9)](a219_0x525178[_0x2a6844(0xd3)]('─'['repeat'](0x3c)));}catch(_0x2561ec){logger['error'](_0x2a6844(0xe9),_0x2a6844(0xfa)+_0x33ba98[_0x2a6844(0x105)],{'error':_0x2561ec instanceof Error?_0x2561ec[_0x2a6844(0x128)]:String(_0x2561ec)});try{const _0x3a0776=readDirectoryIdentity(_0x9a56e2);if(_0x2836b8['currentDir']&&_0x542e67)a219_0x594e4a[_0x2a6844(0x136)](_0x542e67,{'recursive':!![],'force':!![]});else{if(_0x542fd5&&_0x3a0776?.['dev']===_0x542fd5[_0x2a6844(0x13e)]&&_0x3a0776[_0x2a6844(0xec)]===_0x542fd5[_0x2a6844(0xec)])console[_0x2a6844(0xd9)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x9a56e2),a219_0x594e4a[_0x2a6844(0x136)](_0x9a56e2,{'recursive':!![],'force':!![]});else _0x3a0776&&logger[_0x2a6844(0x10e)]('create',_0x2a6844(0xd4)+_0x9a56e2);}}catch{logger[_0x2a6844(0x10e)]('create',_0x2a6844(0x118)+_0x9a56e2);}throw _0x2561ec;}}async function runTask(_0x219ca3,_0x44702c,_0x55ac33=_0x219ca3){const _0x227d66=a219_0x2d31,_0x40432c=a219_0x2607b9(_0x219ca3+'...')[_0x227d66(0xe1)]();try{const _0x174b62=await _0x44702c(_0x1955bc=>{const _0x44320f=_0x227d66;_0x40432c[_0x44320f(0x124)]=_0x1955bc+_0x44320f(0x12f);});_0x40432c['stop'](),console['log'](''+a219_0x525178[_0x227d66(0xd3)]('\x20√\x20')+_0x55ac33+'\x20'+a219_0x525178[_0x227d66(0x129)]('['+_0x174b62+']'));}catch(_0x431294){_0x40432c[_0x227d66(0xd2)](_0x219ca3);throw _0x431294;}}function projectTemplateStageLabel(_0x444cc2){const _0x4ed7a6=a219_0x2d31;switch(_0x444cc2){case'resolving':return _0x4ed7a6(0x121);case _0x4ed7a6(0x103):return _0x4ed7a6(0xf1);case _0x4ed7a6(0xdc):return _0x4ed7a6(0xea);case _0x4ed7a6(0x13d):return _0x4ed7a6(0xd1);case _0x4ed7a6(0x126):return _0x4ed7a6(0x12e);}}async function updatePackageJsonName(_0xa75f3,_0x36533f){const _0x42ed3b=a219_0x2d31,_0x51a10d=a219_0xf3a2c4[_0x42ed3b(0x119)](process[_0x42ed3b(0xf7)](),_0xa75f3),_0x39d01d=a219_0xf3a2c4[_0x42ed3b(0x11c)](_0x51a10d,_0x42ed3b(0x110));try{console[_0x42ed3b(0xd9)](_0x42ed3b(0x102));const _0x453fb9=getRabetbaseCliPackageRoot(),_0x4476a4=a219_0xf3a2c4[_0x42ed3b(0x11c)](_0x453fb9,_0x42ed3b(0x110));let _0x123e33=_0x42ed3b(0x130);try{const _0x266a62=JSON[_0x42ed3b(0x13c)](a219_0x594e4a['readFileSync'](_0x4476a4,_0x42ed3b(0xdd)));_0x123e33=_0x266a62[_0x42ed3b(0x106)]||_0x42ed3b(0x130);}catch{}const _0x41b208=a219_0x594e4a['readFileSync'](_0x39d01d,_0x42ed3b(0xdd)),_0xbab85f=JSON[_0x42ed3b(0x13c)](_0x41b208);_0xbab85f[_0x42ed3b(0x116)]=_0x36533f,_0xbab85f[_0x42ed3b(0x134)]=_0x36533f+_0x42ed3b(0xda)+_0x123e33,a219_0x594e4a[_0x42ed3b(0x133)](_0x39d01d,JSON[_0x42ed3b(0x101)](_0xbab85f,null,0x2)+'\x0a',_0x42ed3b(0xdd)),console[_0x42ed3b(0xd9)](_0x42ed3b(0x11f)+_0x36533f),logger[_0x42ed3b(0x139)](_0x42ed3b(0xe9),'Updating\x20package.json\x20name');}catch(_0x48dad3){logger[_0x42ed3b(0x115)](_0x42ed3b(0xe9),_0x42ed3b(0x135));throw _0x48dad3;}}async function configureAppCode(_0x5b79d,_0x2b2f8a,_0x335ed5,_0x538104){const _0xdf991e=a219_0x2d31,_0x2144eb=a219_0xf3a2c4[_0xdf991e(0x119)](process[_0xdf991e(0xf7)](),_0x5b79d),_0xef0c32=a219_0xf3a2c4['join'](_0x2144eb,NEW_CONFIG_NAME);try{_0x335ed5?console['log']('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x2b2f8a+':\x20'+_0x335ed5):console['log']('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x2b2f8a);const _0x2b50f1=getRabetbaseCliPackageRoot(),_0x472650=a219_0xf3a2c4['join'](_0x2b50f1,_0xdf991e(0x110));let _0x3a8e53=_0xdf991e(0x130);try{const _0x15b586=JSON[_0xdf991e(0x13c)](a219_0x594e4a['readFileSync'](_0x472650,_0xdf991e(0xdd)));_0x3a8e53=_0x15b586['version']||_0xdf991e(0x130);}catch{}const {globalConfig:_0x2f2cf4}=loadRawConfigLayers(),_0x3a5e4f=typeof _0x2f2cf4[_0xdf991e(0x138)]===_0xdf991e(0xe8)?_0x2f2cf4['env']:undefined,_0x2c3ea4={};for(const _0xf3e273 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x2f2cf4[_0xf3e273]!=null)_0x2c3ea4[_0xf3e273]=_0x2f2cf4[_0xf3e273];}const _0x3201ed=buildCanonicalProjectConfig(_0x2c3ea4,{'appCodes':_0x335ed5?[_0x335ed5]:[],'env':_0x538104||_0x3a5e4f||_0xdf991e(0xf8),'metadata':{'createdAt':new Date()[_0xdf991e(0xd0)](),'version':_0x3a8e53}});writeConfigFile(_0xef0c32,_0x3201ed),await generateSdkConfigFile(a219_0xf3a2c4['join'](_0x2144eb,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x2144eb),_0x335ed5?console[_0xdf991e(0xd9)](_0xdf991e(0x13b)+Object[_0xdf991e(0x122)](_0x3201ed[_0xdf991e(0xe4)]||{})[_0xdf991e(0x11c)](',\x20')+_0xdf991e(0xcc)):console[_0xdf991e(0xd9)](_0xdf991e(0xe2)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0xdf991e(0x139)](_0xdf991e(0xe9),'Configured\x20app\x20AppCode:\x20'+_0x335ed5);}catch(_0x2111dc){logger[_0xdf991e(0x115)](_0xdf991e(0xe9),'Failed\x20to\x20configure\x20app\x20AppCode');throw _0x2111dc;}}
@@ -1 +1 @@
1
- const a220_0x517f9c=a220_0x1af5;(function(_0x3b0ad4,_0x47b081){const _0x482b8e=a220_0x1af5,_0x33bc87=_0x3b0ad4();while(!![]){try{const _0x21ae19=parseInt(_0x482b8e(0x149))/0x1+parseInt(_0x482b8e(0x166))/0x2*(parseInt(_0x482b8e(0x168))/0x3)+-parseInt(_0x482b8e(0x157))/0x4+parseInt(_0x482b8e(0x14f))/0x5+-parseInt(_0x482b8e(0x161))/0x6*(-parseInt(_0x482b8e(0x169))/0x7)+parseInt(_0x482b8e(0x159))/0x8*(parseInt(_0x482b8e(0x164))/0x9)+-parseInt(_0x482b8e(0x10e))/0xa;if(_0x21ae19===_0x47b081)break;else _0x33bc87['push'](_0x33bc87['shift']());}catch(_0x5ba9ab){_0x33bc87['push'](_0x33bc87['shift']());}}}(a220_0x3d1b,0xebce4));import{createHash}from'node:crypto';import a220_0x9c1d40 from'node:fs/promises';import a220_0xf110f7 from'node:path';import a220_0xa9d657 from'semver';import{getProjectTemplateRelativeUrl}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{fetchProjectTemplateCdnConfig,isBetaCliVersion,resolveProjectTemplateDescriptor}from'../../../utils/cli-version-policy.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID='sub-app-react-demo',ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x2a505c){const _0x3f23c8=a220_0x1af5;return typeof _0x2a505c===_0x3f23c8(0x111)&&_0x2a505c[_0x3f23c8(0x137)]()?_0x2a505c[_0x3f23c8(0x137)]():null;}function parseDescriptor(_0x305ee8){const _0x1b696b=a220_0x1af5;if(!_0x305ee8||typeof _0x305ee8!==_0x1b696b(0x162))throw new Error(_0x1b696b(0x153)+TEMPLATE_ID+'\x22.');const _0x4d1a2a=_0x305ee8,_0x16c618=nonEmptyString(_0x4d1a2a[_0x1b696b(0x14a)]),_0x653f06=nonEmptyString(_0x4d1a2a[_0x1b696b(0x15e)]),_0x22a961=_0x4d1a2a[_0x1b696b(0x17a)]===undefined?undefined:nonEmptyString(_0x4d1a2a['url'])||undefined,_0xa2e150=nonEmptyString(_0x4d1a2a[_0x1b696b(0x135)])?.['toLowerCase'](),_0x2842d9=_0x4d1a2a[_0x1b696b(0x160)];if(!_0x16c618||!a220_0xa9d657[_0x1b696b(0x112)](_0x16c618)||!_0x653f06||_0x653f06!==a220_0xf110f7['posix']['basename'](_0x653f06)||_0x653f06['includes']('\x5c')||_0x4d1a2a[_0x1b696b(0x17a)]!==undefined&&!_0x22a961||!_0xa2e150||!/^sha256:[a-f0-9]{64}$/[_0x1b696b(0x132)](_0xa2e150)||typeof _0x2842d9!=='number'||!Number[_0x1b696b(0x15c)](_0x2842d9)||_0x2842d9<=0x0||_0x2842d9>MAX_ARCHIVE_SIZE)throw new Error(_0x1b696b(0x172)+TEMPLATE_ID+'\x22.');return{'version':_0x16c618,'name':_0x653f06,'url':_0x22a961,'sha256':_0xa2e150,'size':_0x2842d9};}async function fetchWithTimeout(_0x5e71f9,_0x5ce357,_0x15f735,_0x33a013){const _0x529630=a220_0x1af5,_0x48ab4c=new AbortController(),_0x280b66=setTimeout(()=>_0x48ab4c[_0x529630(0x124)](),_0x5ce357);try{const _0x52c498=await fetch(_0x5e71f9,{'headers':{'Accept':_0x15f735},'redirect':_0x529630(0x131),'signal':_0x48ab4c['signal']});return await _0x33a013(_0x52c498);}finally{clearTimeout(_0x280b66);}}async function fetchTemplateDescriptor(){const _0x17bdee=a220_0x1af5,_0x4cf4b5=getCliVersion(),_0x33a086=isBetaCliVersion(_0x4cf4b5)?_0x17bdee(0x151):_0x17bdee(0x14c),_0x203340=await fetchProjectTemplateCdnConfig();if(!_0x203340)throw new Error('Rabetbase\x20CDN\x20config\x20is\x20unavailable.');const _0x3d629a=parseDescriptor(resolveProjectTemplateDescriptor(_0x203340[_0x17bdee(0x13d)],_0x4cf4b5));return{'descriptor':_0x3d629a,'channel':_0x33a086,'assetBaseUrl':_0x203340[_0x17bdee(0x11a)],'legacyAssetBaseUrl':_0x203340[_0x17bdee(0x13a)]};}function resolveArchiveUrl(_0xb382e2,_0x213ae4,_0xd37740,_0x2ce37e){const _0x3862ee=a220_0x1af5,_0x236b50=new URL(_0xd37740+'/'),_0x4ef87b=[getProjectTemplateRelativeUrl(_0x213ae4),getProjectTemplateRelativeUrl(_0x213ae4,_0xb382e2['version'])];if(_0xb382e2[_0x3862ee(0x17a)]&&!_0x4ef87b[_0x3862ee(0x116)](_0xb382e2[_0x3862ee(0x17a)]))throw new Error(_0x3862ee(0x117));const _0x4a43ea=new URL(_0x2ce37e+'/'),_0x3368c3=_0xb382e2[_0x3862ee(0x17a)]?new URL(_0xb382e2['url'],_0x236b50['origin']):new URL(_0xb382e2[_0x3862ee(0x15e)],_0x4a43ea),_0x4ef19d=_0xb382e2['url']?_0x236b50[_0x3862ee(0x142)]:_0x4a43ea[_0x3862ee(0x142)];if(_0x3368c3[_0x3862ee(0x12b)]!=='https:'||_0x3368c3['origin']!==_0x4ef19d||a220_0xf110f7[_0x3862ee(0x107)][_0x3862ee(0x134)](decodeURIComponent(_0x3368c3[_0x3862ee(0x16f)]))!==_0xb382e2['name']||!_0xb382e2[_0x3862ee(0x17a)]&&!_0x3368c3[_0x3862ee(0x16f)]['startsWith'](_0x4a43ea[_0x3862ee(0x16f)]))throw new Error('CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.');return _0x3368c3[_0x3862ee(0x125)];}async function readResponseBytes(_0x468f41,_0x120995){const _0x42498e=a220_0x1af5;if(!_0x468f41[_0x42498e(0x146)]){const _0xc0d7b5=Buffer[_0x42498e(0x13b)](await _0x468f41[_0x42498e(0x13c)]());if(_0xc0d7b5['length']>_0x120995)throw new Error(_0x42498e(0x105));return _0xc0d7b5;}const _0x1d48f2=_0x468f41[_0x42498e(0x146)][_0x42498e(0x108)](),_0x1e1886=[];let _0x2ab2d3=0x0;try{while(!![]){const {done:_0x421f62,value:_0x58ca50}=await _0x1d48f2[_0x42498e(0x126)]();if(_0x421f62)break;_0x2ab2d3+=_0x58ca50[_0x42498e(0x118)];if(_0x2ab2d3>_0x120995){await _0x1d48f2['cancel']();throw new Error(_0x42498e(0x105));}_0x1e1886[_0x42498e(0x179)](Buffer[_0x42498e(0x13b)](_0x58ca50));}}finally{_0x1d48f2[_0x42498e(0x174)]();}return Buffer['concat'](_0x1e1886,_0x2ab2d3);}async function downloadArchive(_0x58d2f7,_0xfccbae,_0x18397a,_0x49f3dc,_0x4e4a8e,_0x471939){const _0x508e06=a220_0x1af5,_0x586e3e=await fetchWithTimeout(resolveArchiveUrl(_0x58d2f7,_0xfccbae,_0x18397a,_0x49f3dc),ARCHIVE_TIMEOUT_MS,_0x508e06(0x13e),async _0x210929=>{const _0x35e9ed=_0x508e06;if(!_0x210929['ok'])throw new Error('CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20'+_0x210929[_0x35e9ed(0x138)]+'.');const _0x66bd96=Number(_0x210929[_0x35e9ed(0x143)][_0x35e9ed(0x16b)](_0x35e9ed(0x15a)));if(Number['isFinite'](_0x66bd96)&&_0x66bd96>MAX_ARCHIVE_SIZE)throw new Error('CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.');return readResponseBytes(_0x210929,_0x58d2f7[_0x35e9ed(0x160)]);});if(_0x586e3e[_0x508e06(0x114)]!==_0x58d2f7[_0x508e06(0x160)])throw new Error(_0x508e06(0x12f)+_0x58d2f7[_0x508e06(0x160)]+',\x20received\x20'+_0x586e3e[_0x508e06(0x114)]+'.');_0x471939?.(_0x508e06(0x147));const _0x53ef4d=_0x508e06(0x128)+createHash(_0x508e06(0x135))[_0x508e06(0x15f)](_0x586e3e)[_0x508e06(0x121)](_0x508e06(0x156));if(_0x53ef4d!==_0x58d2f7[_0x508e06(0x135)])throw new Error(_0x508e06(0x122));await a220_0x9c1d40[_0x508e06(0x11f)](_0x4e4a8e,_0x586e3e,{'flag':'wx'});}async function assertTemplateRoot(_0x435279){const _0x1af40c=a220_0x1af5,_0x5cdb89=a220_0xf110f7['join'](_0x435279,'package.json'),_0x23e0b1=JSON[_0x1af40c(0x123)](await a220_0x9c1d40[_0x1af40c(0x10f)](_0x5cdb89,_0x1af40c(0x141)));if(!_0x23e0b1||typeof _0x23e0b1!==_0x1af40c(0x162))throw new Error('Project\x20template\x20package.json\x20is\x20invalid.');}const LOCAL_FORBIDDEN_NAMES=new Set(['.DS_Store',a220_0x517f9c(0x12a),a220_0x517f9c(0x167),a220_0x517f9c(0x14d),a220_0x517f9c(0x171),'.lovrabet.log',a220_0x517f9c(0x113),a220_0x517f9c(0x14b),a220_0x517f9c(0x16a),'node_modules']);function a220_0x3d1b(){const _0x22a373=['has','resolving','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','local','message','11940980dnbroo','readFile','cdn','string','valid','.rabetbase','length','EEXIST','includes','CDN\x20project\x20template\x20relative\x20URL\x20must\x20match\x20its\x20release\x20channel\x20or\x20version.','byteLength','ENOENT','assetBaseUrl','isDirectory','template.zip','isAbsolute','relative','writeFile','downloading','digest','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','parse','abort','href','read','mkdir','sha256:','ino','.codegraph','protocol','Project\x20directory\x20already\x20exists:\x20','package.json','Invalid\x20local\x20template\x20source:\x20','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','error','test','copyFile','basename','sha256','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','trim','status','Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.','legacyAssetBaseUrl','from','arrayBuffer','config','application/zip','realpath','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','utf8','origin','headers','.env','readdir','body','verifying','Local\x20template\x20source\x20does\x20not\x20exist:\x20','340813FdQuVI','version','.rabetbase.json','release','.idea','startsWith','3702600DTTuAz','mkdtemp','beta','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','isFile','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','hex','3572760StuwQi','isSymbolicLink','54232XVubXD','content-length','join','isSafeInteger','Unable\x20to\x20claim\x20the\x20project\x20directory.','name','update','size','6WSNgJG','object','.env.','1611kItTOe','lstat','4uefqcw','.git','1044147jjgvwu','435932EtfphQ','dist','get','dirname','Use\x20a\x20different\x20project\x20name.','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','pathname','resolve','.lovrabet.json','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','code','releaseLock','validation','dev','.rabetbase-create-','project','push','url','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','copying','posix','getReader'];a220_0x3d1b=function(){return _0x22a373;};return a220_0x3d1b();}function isForbiddenTemplateEntry(_0x1a16d5){const _0xc36a9d=a220_0x517f9c;if(LOCAL_FORBIDDEN_NAMES[_0xc36a9d(0x109)](_0x1a16d5))return!![];return _0x1a16d5===_0xc36a9d(0x144)||_0x1a16d5['startsWith'](_0xc36a9d(0x163))&&_0x1a16d5!=='.env.example';}function containsPath(_0xcd44bb,_0x21d92b){const _0x5097f9=a220_0x517f9c,_0x25c635=a220_0xf110f7[_0x5097f9(0x11e)](_0xcd44bb,_0x21d92b);return _0x25c635===''||!_0x25c635[_0x5097f9(0x14e)]('..'+a220_0xf110f7['sep'])&&_0x25c635!=='..'&&!a220_0xf110f7[_0x5097f9(0x11d)](_0x25c635);}async function copyLocalTemplateDirectory(_0x446aa4,_0x23ce7b){const _0x500f2f=a220_0x517f9c;await a220_0x9c1d40[_0x500f2f(0x127)](_0x23ce7b,{'recursive':!![]});for(const _0x19d8e1 of await a220_0x9c1d40[_0x500f2f(0x145)](_0x446aa4,{'withFileTypes':!![]})){const _0x46bfbb=a220_0xf110f7[_0x500f2f(0x15b)](_0x446aa4,_0x19d8e1[_0x500f2f(0x15e)]),_0x9f83da=a220_0xf110f7[_0x500f2f(0x15b)](_0x23ce7b,_0x19d8e1[_0x500f2f(0x15e)]);if(isForbiddenTemplateEntry(_0x19d8e1['name']))throw new Error(_0x500f2f(0x152)+_0x46bfbb);const _0x4b6407=await a220_0x9c1d40['lstat'](_0x46bfbb);if(_0x4b6407[_0x500f2f(0x158)]())throw new Error(_0x500f2f(0x136)+_0x46bfbb);if(_0x4b6407[_0x500f2f(0x11b)]()){await copyLocalTemplateDirectory(_0x46bfbb,_0x9f83da);continue;}if(!_0x4b6407[_0x500f2f(0x154)]())continue;await a220_0x9c1d40[_0x500f2f(0x133)](_0x46bfbb,_0x9f83da),await a220_0x9c1d40['chmod'](_0x9f83da,_0x4b6407['mode']&0x1ff);}}async function readTemplateVersion(_0x31a893){const _0xe968fd=a220_0x517f9c,_0x5e304e=JSON[_0xe968fd(0x123)](await a220_0x9c1d40[_0xe968fd(0x10f)](a220_0xf110f7[_0xe968fd(0x15b)](_0x31a893,_0xe968fd(0x12d)),'utf8'));return nonEmptyString(_0x5e304e[_0xe968fd(0x14a)])||'local';}async function readDirectoryIdentity(_0x4b7c81){const _0x336def=a220_0x517f9c;try{const _0x2bd0d5=await a220_0x9c1d40['lstat'](_0x4b7c81);if(!_0x2bd0d5[_0x336def(0x11b)]())return null;return{'dev':_0x2bd0d5[_0x336def(0x176)],'ino':_0x2bd0d5[_0x336def(0x129)]};}catch{return null;}}async function commitStagedProject(_0xd8f3e4,_0x3143ff){const _0x5c116b=a220_0x517f9c;await a220_0x9c1d40[_0x5c116b(0x127)](_0x3143ff);const _0x36913c=await readDirectoryIdentity(_0x3143ff);if(!_0x36913c)throw new Error(_0x5c116b(0x15d));try{for(const _0x364190 of await a220_0x9c1d40[_0x5c116b(0x145)](_0xd8f3e4)){await a220_0x9c1d40['rename'](a220_0xf110f7['join'](_0xd8f3e4,_0x364190),a220_0xf110f7[_0x5c116b(0x15b)](_0x3143ff,_0x364190));}}catch(_0x32285d){const _0x5c4743=await readDirectoryIdentity(_0x3143ff);_0x5c4743?.[_0x5c116b(0x176)]===_0x36913c[_0x5c116b(0x176)]&&_0x5c4743[_0x5c116b(0x129)]===_0x36913c[_0x5c116b(0x129)]&&await a220_0x9c1d40['rm'](_0x3143ff,{'recursive':!![],'force':!![]});throw _0x32285d;}}function a220_0x1af5(_0x21f2a0,_0x1cd0b3){_0x21f2a0=_0x21f2a0-0x105;const _0x3d1b7a=a220_0x3d1b();let _0x1af5fd=_0x3d1b7a[_0x21f2a0];return _0x1af5fd;}export async function materializeProjectTemplate(_0x39eea1,_0x34bb95){const _0x246326=a220_0x517f9c,_0x5e6e2c=a220_0xf110f7['resolve'](_0x39eea1),_0x979fb0=a220_0xf110f7[_0x246326(0x16c)](_0x5e6e2c);try{await a220_0x9c1d40[_0x246326(0x165)](_0x5e6e2c);throw new Error(_0x246326(0x12c)+_0x5e6e2c);}catch(_0x4ceff0){if(_0x4ceff0['code']!==_0x246326(0x119))throw _0x4ceff0;}const _0x513c8f=await a220_0x9c1d40[_0x246326(0x150)](a220_0xf110f7[_0x246326(0x15b)](_0x979fb0,_0x246326(0x177))),_0x44c058=a220_0xf110f7['join'](_0x513c8f,_0x246326(0x178)),_0x20b08b=a220_0xf110f7['join'](_0x513c8f,_0x246326(0x11c));try{try{_0x34bb95?.(_0x246326(0x10a));const {descriptor:_0x336f75,channel:_0x59013a,assetBaseUrl:_0x3e1f11,legacyAssetBaseUrl:_0x3e379f}=await fetchTemplateDescriptor();return _0x34bb95?.(_0x246326(0x120)),await downloadArchive(_0x336f75,_0x59013a,_0x3e1f11,_0x3e379f,_0x20b08b,_0x34bb95),_0x34bb95?.('extracting'),await extractProjectTemplateArchive(_0x20b08b,_0x44c058),await assertTemplateRoot(_0x44c058),await commitStagedProject(_0x44c058,_0x5e6e2c),{'source':_0x246326(0x110),'version':_0x336f75[_0x246326(0x14a)]};}catch(_0x590ff9){if(_0x590ff9[_0x246326(0x173)]===_0x246326(0x115))throw CliErrors[_0x246326(0x175)](_0x246326(0x12c)+_0x5e6e2c,_0x246326(0x16d));const _0x1410b5=_0x590ff9 instanceof Error?_0x590ff9[_0x246326(0x10d)]:String(_0x590ff9);throw CliErrors['validation'](_0x246326(0x140),_0x246326(0x10b)+_0x1410b5);}}finally{await a220_0x9c1d40['rm'](_0x513c8f,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x50abdf,_0x346c9d,_0x1cd4c7){const _0x27b2ca=a220_0x517f9c;let _0x11de99;try{_0x11de99=await a220_0x9c1d40['realpath'](a220_0xf110f7[_0x27b2ca(0x170)](_0x50abdf));}catch{throw CliErrors[_0x27b2ca(0x175)](_0x27b2ca(0x148)+a220_0xf110f7[_0x27b2ca(0x170)](_0x50abdf),_0x27b2ca(0x155));}const _0x19f1bf=await a220_0x9c1d40[_0x27b2ca(0x165)](_0x11de99);if(!_0x19f1bf['isDirectory']())throw CliErrors['validation']('Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20'+_0x11de99);const _0x444145=a220_0xf110f7[_0x27b2ca(0x170)](_0x346c9d),_0x38290b=await a220_0x9c1d40[_0x27b2ca(0x13f)](a220_0xf110f7['dirname'](_0x444145)),_0x4c7048=a220_0xf110f7[_0x27b2ca(0x15b)](_0x38290b,a220_0xf110f7['basename'](_0x444145));if(containsPath(_0x11de99,_0x4c7048)||containsPath(_0x4c7048,_0x11de99))throw CliErrors[_0x27b2ca(0x175)](_0x27b2ca(0x130),_0x27b2ca(0x16e));try{await a220_0x9c1d40['lstat'](_0x4c7048);throw CliErrors[_0x27b2ca(0x175)](_0x27b2ca(0x12c)+_0x4c7048,_0x27b2ca(0x139));}catch(_0x1e6d5c){if(_0x1e6d5c[_0x27b2ca(0x173)]!=='ENOENT')throw _0x1e6d5c;}const _0x3cc907=a220_0xf110f7[_0x27b2ca(0x16c)](_0x4c7048);await a220_0x9c1d40['access'](_0x3cc907);const _0x3c3fbf=await a220_0x9c1d40[_0x27b2ca(0x150)](a220_0xf110f7[_0x27b2ca(0x15b)](_0x3cc907,_0x27b2ca(0x177))),_0x5664f7=a220_0xf110f7[_0x27b2ca(0x15b)](_0x3c3fbf,_0x27b2ca(0x178));try{_0x1cd4c7?.(_0x27b2ca(0x106)),await copyLocalTemplateDirectory(_0x11de99,_0x5664f7),await assertTemplateRoot(_0x5664f7);const _0x51cedb=await readTemplateVersion(_0x5664f7);return await commitStagedProject(_0x5664f7,_0x4c7048),{'source':_0x27b2ca(0x10c),'version':_0x51cedb};}catch(_0x5b5f69){const _0x2c836b=_0x5b5f69 instanceof Error?_0x5b5f69['message']:String(_0x5b5f69);throw CliErrors[_0x27b2ca(0x175)](_0x27b2ca(0x12e)+_0x2c836b,'Check\x20the\x20source\x20directory\x20and\x20retry.');}finally{await a220_0x9c1d40['rm'](_0x3c3fbf,{'recursive':!![],'force':!![]});}}
1
+ const a220_0x537eb5=a220_0x3f41;(function(_0x26997f,_0x438160){const _0x7144e4=a220_0x3f41,_0x187ef4=_0x26997f();while(!![]){try{const _0x4e5d33=-parseInt(_0x7144e4(0x7d))/0x1*(-parseInt(_0x7144e4(0xdc))/0x2)+-parseInt(_0x7144e4(0xc9))/0x3+-parseInt(_0x7144e4(0x87))/0x4+-parseInt(_0x7144e4(0xc5))/0x5*(-parseInt(_0x7144e4(0xa2))/0x6)+parseInt(_0x7144e4(0x83))/0x7*(parseInt(_0x7144e4(0xa6))/0x8)+parseInt(_0x7144e4(0x78))/0x9+-parseInt(_0x7144e4(0xcc))/0xa*(parseInt(_0x7144e4(0xc3))/0xb);if(_0x4e5d33===_0x438160)break;else _0x187ef4['push'](_0x187ef4['shift']());}catch(_0x13f819){_0x187ef4['push'](_0x187ef4['shift']());}}}(a220_0x4376,0x59578));import{createHash}from'node:crypto';import a220_0x30ed82 from'node:fs/promises';import a220_0x55437f from'node:path';import a220_0xd44f5a from'semver';import{getProjectTemplateRelativeUrl}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{fetchProjectTemplateCdnConfig,isBetaCliVersion,resolveProjectTemplateDescriptor}from'../../../utils/cli-version-policy.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';function a220_0x4376(){const _0x556a88=['object','.idea','14619XNwQom','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','245NRlKbm','getReader','basename','rename','877962xvPRlX','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','chmod','5650ovlJme','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','cancel','assetBaseUrl','downloading','isSafeInteger','verifying','.DS_Store','number','Project\x20directory\x20already\x20exists:\x20','mkdir','access','byteLength','package.json','join','isDirectory','86exFmVM','parse','posix','.codegraph','releaseLock','ino','code','hex','Invalid\x20local\x20template\x20source:\x20','extracting','Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.','isAbsolute','update','https:','from','realpath','readFile','project','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','toLowerCase','600759GiKifr','digest','push','body','release','16155eCMYeP','.lovrabet.log','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','arrayBuffer','.rabetbase.json','has','1909817JPfVPG','ENOENT','pathname','CDN\x20project\x20template\x20relative\x20URL\x20must\x20match\x20its\x20release\x20channel\x20or\x20version.','849488kwFYBb','mkdtemp','cdn','content-length','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','headers','protocol','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','origin','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','trim','sha256:','Use\x20a\x20different\x20project\x20name.','.env.','get','.git','relative','string','resolve','legacyAssetBaseUrl','Local\x20template\x20source\x20does\x20not\x20exist:\x20','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','copyFile','signal','valid','.rabetbase','error','71952hcxHua','includes','message','dev','8NQgjlZ','startsWith','readdir','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','size','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','Unable\x20to\x20claim\x20the\x20project\x20directory.','url','lstat','local','validation','name','length','isFinite','.lovrabet.json','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','application/zip','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','version','sep','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','sha256','utf8','copying','dirname','mode','beta'];a220_0x4376=function(){return _0x556a88;};return a220_0x4376();}const TEMPLATE_ID='sub-app-react-demo',ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x4f3b00){const _0xad7ad7=a220_0x3f41;return typeof _0x4f3b00===_0xad7ad7(0x98)&&_0x4f3b00[_0xad7ad7(0x91)]()?_0x4f3b00[_0xad7ad7(0x91)]():null;}function parseDescriptor(_0xa661d){const _0x49dbb7=a220_0x3f41;if(!_0xa661d||typeof _0xa661d!==_0x49dbb7(0xc1))throw new Error(_0x49dbb7(0x76)+TEMPLATE_ID+'\x22.');const _0x4f630e=_0xa661d,_0x3fbd41=nonEmptyString(_0x4f630e[_0x49dbb7(0xb8)]),_0x6a0ff0=nonEmptyString(_0x4f630e[_0x49dbb7(0xb1)]),_0x291ba0=_0x4f630e['url']===undefined?undefined:nonEmptyString(_0x4f630e[_0x49dbb7(0xad)])||undefined,_0x480de7=nonEmptyString(_0x4f630e[_0x49dbb7(0xbb)])?.[_0x49dbb7(0x77)](),_0xb50651=_0x4f630e[_0x49dbb7(0xaa)];if(!_0x3fbd41||!a220_0xd44f5a[_0x49dbb7(0x9f)](_0x3fbd41)||!_0x6a0ff0||_0x6a0ff0!==a220_0x55437f[_0x49dbb7(0xde)]['basename'](_0x6a0ff0)||_0x6a0ff0[_0x49dbb7(0xa3)]('\x5c')||_0x4f630e[_0x49dbb7(0xad)]!==undefined&&!_0x291ba0||!_0x480de7||!/^sha256:[a-f0-9]{64}$/['test'](_0x480de7)||typeof _0xb50651!==_0x49dbb7(0xd4)||!Number[_0x49dbb7(0xd1)](_0xb50651)||_0xb50651<=0x0||_0xb50651>MAX_ARCHIVE_SIZE)throw new Error('CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22'+TEMPLATE_ID+'\x22.');return{'version':_0x3fbd41,'name':_0x6a0ff0,'url':_0x291ba0,'sha256':_0x480de7,'size':_0xb50651};}async function fetchWithTimeout(_0xb9d850,_0x53d6b4,_0x4167a7,_0x1fdd6a){const _0x134348=a220_0x3f41,_0x1c554d=new AbortController(),_0x22713b=setTimeout(()=>_0x1c554d['abort'](),_0x53d6b4);try{const _0x13009a=await fetch(_0xb9d850,{'headers':{'Accept':_0x4167a7},'redirect':_0x134348(0xa1),'signal':_0x1c554d[_0x134348(0x9e)]});return await _0x1fdd6a(_0x13009a);}finally{clearTimeout(_0x22713b);}}function a220_0x3f41(_0x2c02aa,_0x489303){_0x2c02aa=_0x2c02aa-0x68;const _0x437649=a220_0x4376();let _0x3f41b1=_0x437649[_0x2c02aa];return _0x3f41b1;}async function fetchTemplateDescriptor(){const _0x4ec27e=a220_0x3f41,_0x22bc0f=getCliVersion(),_0x3886ea=isBetaCliVersion(_0x22bc0f)?_0x4ec27e(0xc0):_0x4ec27e(0x7c),_0x442413=await fetchProjectTemplateCdnConfig();if(!_0x442413)throw new Error(_0x4ec27e(0x8e));const _0x5cd1b9=parseDescriptor(resolveProjectTemplateDescriptor(_0x442413['config'],_0x22bc0f));return{'descriptor':_0x5cd1b9,'channel':_0x3886ea,'assetBaseUrl':_0x442413[_0x4ec27e(0xcf)],'legacyAssetBaseUrl':_0x442413[_0x4ec27e(0x9a)]};}function resolveArchiveUrl(_0x2e60f7,_0x2537dd,_0x4be42b,_0x29acd8){const _0x4cb137=a220_0x3f41,_0x225ca5=new URL(_0x4be42b+'/'),_0xb7eb34=[getProjectTemplateRelativeUrl(_0x2537dd),getProjectTemplateRelativeUrl(_0x2537dd,_0x2e60f7['version'])];if(_0x2e60f7[_0x4cb137(0xad)]&&!_0xb7eb34[_0x4cb137(0xa3)](_0x2e60f7[_0x4cb137(0xad)]))throw new Error(_0x4cb137(0x86));const _0x12232f=new URL(_0x29acd8+'/'),_0x342fc2=_0x2e60f7[_0x4cb137(0xad)]?new URL(_0x2e60f7[_0x4cb137(0xad)],_0x225ca5[_0x4cb137(0x8f)]):new URL(_0x2e60f7[_0x4cb137(0xb1)],_0x12232f),_0x3d7978=_0x2e60f7['url']?_0x225ca5['origin']:_0x12232f[_0x4cb137(0x8f)];if(_0x342fc2[_0x4cb137(0x8d)]!==_0x4cb137(0x71)||_0x342fc2[_0x4cb137(0x8f)]!==_0x3d7978||a220_0x55437f[_0x4cb137(0xde)][_0x4cb137(0xc7)](decodeURIComponent(_0x342fc2['pathname']))!==_0x2e60f7[_0x4cb137(0xb1)]||!_0x2e60f7[_0x4cb137(0xad)]&&!_0x342fc2[_0x4cb137(0x85)][_0x4cb137(0xa7)](_0x12232f[_0x4cb137(0x85)]))throw new Error(_0x4cb137(0x7f));return _0x342fc2['href'];}async function readResponseBytes(_0x39ad16,_0x4c0fa5){const _0x38e1a2=a220_0x3f41;if(!_0x39ad16[_0x38e1a2(0x7b)]){const _0x143629=Buffer[_0x38e1a2(0x72)](await _0x39ad16[_0x38e1a2(0x80)]());if(_0x143629[_0x38e1a2(0xb2)]>_0x4c0fa5)throw new Error(_0x38e1a2(0xba));return _0x143629;}const _0x2e573d=_0x39ad16[_0x38e1a2(0x7b)][_0x38e1a2(0xc6)](),_0xbc305f=[];let _0x1b09ad=0x0;try{while(!![]){const {done:_0x513baa,value:_0x16a823}=await _0x2e573d['read']();if(_0x513baa)break;_0x1b09ad+=_0x16a823[_0x38e1a2(0xd8)];if(_0x1b09ad>_0x4c0fa5){await _0x2e573d[_0x38e1a2(0xce)]();throw new Error('CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.');}_0xbc305f[_0x38e1a2(0x7a)](Buffer[_0x38e1a2(0x72)](_0x16a823));}}finally{_0x2e573d[_0x38e1a2(0x68)]();}return Buffer['concat'](_0xbc305f,_0x1b09ad);}async function downloadArchive(_0x2bf947,_0x752d19,_0x3f9c71,_0x3edaf9,_0x776fbc,_0xf0dbe6){const _0x56c9ee=a220_0x3f41,_0x27ea49=await fetchWithTimeout(resolveArchiveUrl(_0x2bf947,_0x752d19,_0x3f9c71,_0x3edaf9),ARCHIVE_TIMEOUT_MS,_0x56c9ee(0xb6),async _0x1ca8e1=>{const _0x59dfea=_0x56c9ee;if(!_0x1ca8e1['ok'])throw new Error(_0x59dfea(0x90)+_0x1ca8e1['status']+'.');const _0xca79eb=Number(_0x1ca8e1[_0x59dfea(0x8c)][_0x59dfea(0x95)](_0x59dfea(0x8a)));if(Number[_0x59dfea(0xb3)](_0xca79eb)&&_0xca79eb>MAX_ARCHIVE_SIZE)throw new Error(_0x59dfea(0x8b));return readResponseBytes(_0x1ca8e1,_0x2bf947[_0x59dfea(0xaa)]);});if(_0x27ea49['length']!==_0x2bf947[_0x56c9ee(0xaa)])throw new Error(_0x56c9ee(0xc4)+_0x2bf947[_0x56c9ee(0xaa)]+',\x20received\x20'+_0x27ea49['length']+'.');_0xf0dbe6?.(_0x56c9ee(0xd2));const _0x45ed42=_0x56c9ee(0x92)+createHash(_0x56c9ee(0xbb))[_0x56c9ee(0x70)](_0x27ea49)[_0x56c9ee(0x79)](_0x56c9ee(0x6b));if(_0x45ed42!==_0x2bf947[_0x56c9ee(0xbb)])throw new Error(_0x56c9ee(0xb5));await a220_0x30ed82['writeFile'](_0x776fbc,_0x27ea49,{'flag':'wx'});}async function assertTemplateRoot(_0x122b46){const _0x31b22d=a220_0x3f41,_0x5b3460=a220_0x55437f[_0x31b22d(0xda)](_0x122b46,'package.json'),_0x38b800=JSON[_0x31b22d(0xdd)](await a220_0x30ed82[_0x31b22d(0x74)](_0x5b3460,_0x31b22d(0xbc)));if(!_0x38b800||typeof _0x38b800!==_0x31b22d(0xc1))throw new Error('Project\x20template\x20package.json\x20is\x20invalid.');}const LOCAL_FORBIDDEN_NAMES=new Set([a220_0x537eb5(0xd3),a220_0x537eb5(0xdf),a220_0x537eb5(0x96),a220_0x537eb5(0xc2),a220_0x537eb5(0xb4),a220_0x537eb5(0x7e),a220_0x537eb5(0xa0),a220_0x537eb5(0x81),'dist','node_modules']);function isForbiddenTemplateEntry(_0x18c47b){const _0x544377=a220_0x537eb5;if(LOCAL_FORBIDDEN_NAMES[_0x544377(0x82)](_0x18c47b))return!![];return _0x18c47b==='.env'||_0x18c47b[_0x544377(0xa7)](_0x544377(0x94))&&_0x18c47b!=='.env.example';}function containsPath(_0x3717e7,_0x41bd75){const _0x2848da=a220_0x537eb5,_0x3561a1=a220_0x55437f[_0x2848da(0x97)](_0x3717e7,_0x41bd75);return _0x3561a1===''||!_0x3561a1[_0x2848da(0xa7)]('..'+a220_0x55437f[_0x2848da(0xb9)])&&_0x3561a1!=='..'&&!a220_0x55437f[_0x2848da(0x6f)](_0x3561a1);}async function copyLocalTemplateDirectory(_0x1c9980,_0x534b6d){const _0x3beff5=a220_0x537eb5;await a220_0x30ed82[_0x3beff5(0xd6)](_0x534b6d,{'recursive':!![]});for(const _0x3545a8 of await a220_0x30ed82[_0x3beff5(0xa8)](_0x1c9980,{'withFileTypes':!![]})){const _0x115b35=a220_0x55437f[_0x3beff5(0xda)](_0x1c9980,_0x3545a8['name']),_0x1fac2c=a220_0x55437f['join'](_0x534b6d,_0x3545a8['name']);if(isForbiddenTemplateEntry(_0x3545a8['name']))throw new Error('Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20'+_0x115b35);const _0x1fe935=await a220_0x30ed82[_0x3beff5(0xae)](_0x115b35);if(_0x1fe935['isSymbolicLink']())throw new Error(_0x3beff5(0xca)+_0x115b35);if(_0x1fe935[_0x3beff5(0xdb)]()){await copyLocalTemplateDirectory(_0x115b35,_0x1fac2c);continue;}if(!_0x1fe935['isFile']())continue;await a220_0x30ed82[_0x3beff5(0x9d)](_0x115b35,_0x1fac2c),await a220_0x30ed82[_0x3beff5(0xcb)](_0x1fac2c,_0x1fe935[_0x3beff5(0xbf)]&0x1ff);}}async function readTemplateVersion(_0x77bd65){const _0x54b8e9=a220_0x537eb5,_0x449beb=JSON[_0x54b8e9(0xdd)](await a220_0x30ed82['readFile'](a220_0x55437f[_0x54b8e9(0xda)](_0x77bd65,_0x54b8e9(0xd9)),_0x54b8e9(0xbc)));return nonEmptyString(_0x449beb[_0x54b8e9(0xb8)])||_0x54b8e9(0xaf);}async function readDirectoryIdentity(_0x50c11f){const _0x52e530=a220_0x537eb5;try{const _0x5104d6=await a220_0x30ed82[_0x52e530(0xae)](_0x50c11f);if(!_0x5104d6[_0x52e530(0xdb)]())return null;return{'dev':_0x5104d6['dev'],'ino':_0x5104d6[_0x52e530(0x69)]};}catch{return null;}}async function commitStagedProject(_0x402866,_0xedf96f){const _0xc180cb=a220_0x537eb5;await a220_0x30ed82[_0xc180cb(0xd6)](_0xedf96f);const _0x9bdda=await readDirectoryIdentity(_0xedf96f);if(!_0x9bdda)throw new Error(_0xc180cb(0xac));try{for(const _0x52dde7 of await a220_0x30ed82[_0xc180cb(0xa8)](_0x402866)){await a220_0x30ed82[_0xc180cb(0xc8)](a220_0x55437f[_0xc180cb(0xda)](_0x402866,_0x52dde7),a220_0x55437f['join'](_0xedf96f,_0x52dde7));}}catch(_0x5f503f){const _0x159ba3=await readDirectoryIdentity(_0xedf96f);_0x159ba3?.[_0xc180cb(0xa5)]===_0x9bdda[_0xc180cb(0xa5)]&&_0x159ba3[_0xc180cb(0x69)]===_0x9bdda[_0xc180cb(0x69)]&&await a220_0x30ed82['rm'](_0xedf96f,{'recursive':!![],'force':!![]});throw _0x5f503f;}}export async function materializeProjectTemplate(_0x128027,_0x190026){const _0x5937f1=a220_0x537eb5,_0x530e57=a220_0x55437f['resolve'](_0x128027),_0x2df0e4=a220_0x55437f[_0x5937f1(0xbe)](_0x530e57);try{await a220_0x30ed82['lstat'](_0x530e57);throw new Error(_0x5937f1(0xd5)+_0x530e57);}catch(_0x407837){if(_0x407837['code']!=='ENOENT')throw _0x407837;}const _0x98e575=await a220_0x30ed82[_0x5937f1(0x88)](a220_0x55437f['join'](_0x2df0e4,'.rabetbase-create-')),_0x3ea49a=a220_0x55437f[_0x5937f1(0xda)](_0x98e575,_0x5937f1(0x75)),_0x3b2549=a220_0x55437f[_0x5937f1(0xda)](_0x98e575,'template.zip');try{try{_0x190026?.('resolving');const {descriptor:_0x4c8959,channel:_0x564f69,assetBaseUrl:_0x5b51c1,legacyAssetBaseUrl:_0x2b4a24}=await fetchTemplateDescriptor();return _0x190026?.(_0x5937f1(0xd0)),await downloadArchive(_0x4c8959,_0x564f69,_0x5b51c1,_0x2b4a24,_0x3b2549,_0x190026),_0x190026?.(_0x5937f1(0x6d)),await extractProjectTemplateArchive(_0x3b2549,_0x3ea49a),await assertTemplateRoot(_0x3ea49a),await commitStagedProject(_0x3ea49a,_0x530e57),{'source':_0x5937f1(0x89),'version':_0x4c8959[_0x5937f1(0xb8)]};}catch(_0x2a7978){if(_0x2a7978[_0x5937f1(0x6a)]==='EEXIST')throw CliErrors[_0x5937f1(0xb0)](_0x5937f1(0xd5)+_0x530e57,_0x5937f1(0x93));const _0x42b3eb=_0x2a7978 instanceof Error?_0x2a7978[_0x5937f1(0xa4)]:String(_0x2a7978);throw CliErrors['validation'](_0x5937f1(0xb7),_0x5937f1(0xcd)+_0x42b3eb);}}finally{await a220_0x30ed82['rm'](_0x98e575,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x17c446,_0x797bb5,_0x39c45e){const _0x5b881b=a220_0x537eb5;let _0x6b8f34;try{_0x6b8f34=await a220_0x30ed82[_0x5b881b(0x73)](a220_0x55437f[_0x5b881b(0x99)](_0x17c446));}catch{throw CliErrors[_0x5b881b(0xb0)](_0x5b881b(0x9b)+a220_0x55437f['resolve'](_0x17c446),_0x5b881b(0xa9));}const _0x357f37=await a220_0x30ed82['lstat'](_0x6b8f34);if(!_0x357f37[_0x5b881b(0xdb)]())throw CliErrors[_0x5b881b(0xb0)]('Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20'+_0x6b8f34);const _0xc05c23=a220_0x55437f[_0x5b881b(0x99)](_0x797bb5),_0x387b5e=await a220_0x30ed82[_0x5b881b(0x73)](a220_0x55437f[_0x5b881b(0xbe)](_0xc05c23)),_0x38a92d=a220_0x55437f['join'](_0x387b5e,a220_0x55437f[_0x5b881b(0xc7)](_0xc05c23));if(containsPath(_0x6b8f34,_0x38a92d)||containsPath(_0x38a92d,_0x6b8f34))throw CliErrors['validation'](_0x5b881b(0x9c),_0x5b881b(0xab));try{await a220_0x30ed82[_0x5b881b(0xae)](_0x38a92d);throw CliErrors[_0x5b881b(0xb0)](_0x5b881b(0xd5)+_0x38a92d,_0x5b881b(0x6e));}catch(_0x1769c8){if(_0x1769c8['code']!==_0x5b881b(0x84))throw _0x1769c8;}const _0x5ee01f=a220_0x55437f[_0x5b881b(0xbe)](_0x38a92d);await a220_0x30ed82[_0x5b881b(0xd7)](_0x5ee01f);const _0x25dabf=await a220_0x30ed82['mkdtemp'](a220_0x55437f[_0x5b881b(0xda)](_0x5ee01f,'.rabetbase-create-')),_0x32cb8c=a220_0x55437f['join'](_0x25dabf,_0x5b881b(0x75));try{_0x39c45e?.(_0x5b881b(0xbd)),await copyLocalTemplateDirectory(_0x6b8f34,_0x32cb8c),await assertTemplateRoot(_0x32cb8c);const _0x1cb061=await readTemplateVersion(_0x32cb8c);return await commitStagedProject(_0x32cb8c,_0x38a92d),{'source':_0x5b881b(0xaf),'version':_0x1cb061};}catch(_0x2baf78){const _0xcf4883=_0x2baf78 instanceof Error?_0x2baf78['message']:String(_0x2baf78);throw CliErrors[_0x5b881b(0xb0)](_0x5b881b(0x6c)+_0xcf4883,'Check\x20the\x20source\x20directory\x20and\x20retry.');}finally{await a220_0x30ed82['rm'](_0x25dabf,{'recursive':!![],'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x2dbab0,_0x575110){const _0x4579ed=a221_0x49b4,_0x1f5933=_0x2dbab0();while(!![]){try{const _0x5ca633=-parseInt(_0x4579ed(0xdf))/0x1+parseInt(_0x4579ed(0xe4))/0x2*(-parseInt(_0x4579ed(0xe1))/0x3)+-parseInt(_0x4579ed(0xdb))/0x4*(-parseInt(_0x4579ed(0xdc))/0x5)+parseInt(_0x4579ed(0xe3))/0x6+-parseInt(_0x4579ed(0xe8))/0x7+-parseInt(_0x4579ed(0xe9))/0x8*(parseInt(_0x4579ed(0xe7))/0x9)+-parseInt(_0x4579ed(0xe2))/0xa*(-parseInt(_0x4579ed(0xe6))/0xb);if(_0x5ca633===_0x575110)break;else _0x1f5933['push'](_0x1f5933['shift']());}catch(_0x5b9ae3){_0x1f5933['push'](_0x1f5933['shift']());}}}(a221_0x337d,0x4bda3));import{CliErrors}from'../../../errors.js';const PROJECT_NAME_PATTERN=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i,MAX_PROJECT_NAME_LENGTH=0x64;export function getProjectNameValidationError(_0xb562ae){const _0x375a08=a221_0x49b4,_0x2fa68a=_0xb562ae['trim']();if(!_0x2fa68a)return _0x375a08(0xde);if(_0x2fa68a['length']>MAX_PROJECT_NAME_LENGTH)return _0x375a08(0xdd)+MAX_PROJECT_NAME_LENGTH+'\x20characters';if(!PROJECT_NAME_PATTERN[_0x375a08(0xe5)](_0x2fa68a))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';if(WINDOWS_RESERVED_NAME[_0x375a08(0xe5)](_0x2fa68a))return'Project\x20name\x20\x22'+_0x2fa68a+_0x375a08(0xea);return null;}function a221_0x337d(){const _0x4b8dc1=['2057930jlWawg','272ZNoCQz','\x22\x20is\x20reserved\x20on\x20Windows','Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.','226948ChqOnA','15vkajZN','Project\x20name\x20cannot\x20exceed\x20','Project\x20name\x20cannot\x20be\x20empty','488210mFRTcy','trim','3CdMpRf','20eBVvjx','3261462NOFtKM','1177206CfEqOp','test','5892172GGFmBA','27423dlqNGD'];a221_0x337d=function(){return _0x4b8dc1;};return a221_0x337d();}function a221_0x49b4(_0x1f61f2,_0x5f1ed1){_0x1f61f2=_0x1f61f2-0xdb;const _0x337db3=a221_0x337d();let _0x49b47b=_0x337db3[_0x1f61f2];return _0x49b47b;}export function validateProjectName(_0x32ee66){const _0x47625b=a221_0x49b4,_0xa7a3fb=_0x32ee66[_0x47625b(0xe0)](),_0x379bcf=getProjectNameValidationError(_0xa7a3fb);if(_0x379bcf)throw CliErrors['validation'](_0x379bcf,_0x47625b(0xeb));return _0xa7a3fb;}
1
+ (function(_0x51a187,_0x33a58a){const _0xcb8f2e=a221_0x5e13,_0x33363c=_0x51a187();while(!![]){try{const _0x1b6da0=parseInt(_0xcb8f2e(0xd1))/0x1+parseInt(_0xcb8f2e(0xca))/0x2+parseInt(_0xcb8f2e(0xc6))/0x3*(-parseInt(_0xcb8f2e(0xc1))/0x4)+-parseInt(_0xcb8f2e(0xc2))/0x5+parseInt(_0xcb8f2e(0xd0))/0x6+-parseInt(_0xcb8f2e(0xcd))/0x7+-parseInt(_0xcb8f2e(0xcb))/0x8*(-parseInt(_0xcb8f2e(0xc4))/0x9);if(_0x1b6da0===_0x33a58a)break;else _0x33363c['push'](_0x33363c['shift']());}catch(_0x280c4d){_0x33363c['push'](_0x33363c['shift']());}}}(a221_0x832b,0x7d6d4));function a221_0x5e13(_0x2423e8,_0x4da56e){_0x2423e8=_0x2423e8-0xc0;const _0x832b2a=a221_0x832b();let _0x5e1398=_0x832b2a[_0x2423e8];return _0x5e1398;}import{CliErrors}from'../../../errors.js';const PROJECT_NAME_PATTERN=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i,MAX_PROJECT_NAME_LENGTH=0x64;function a221_0x832b(){const _0x434dac=['8UVFhuD','Project\x20name\x20cannot\x20exceed\x20','4753980UVuPrz','Project\x20name\x20cannot\x20be\x20empty','Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.','2918838jCftwE','562812nejhvZ','trim','1007516TVPruu','977980UyXOdA','validation','4617324AeCVVB','test','6MDEWyL','Project\x20name\x20\x22','\x22\x20is\x20reserved\x20on\x20Windows','length','659842BovgQP'];a221_0x832b=function(){return _0x434dac;};return a221_0x832b();}export function getProjectNameValidationError(_0x2e96c1){const _0x35f861=a221_0x5e13,_0x5e2e2f=_0x2e96c1[_0x35f861(0xc0)]();if(!_0x5e2e2f)return _0x35f861(0xce);if(_0x5e2e2f[_0x35f861(0xc9)]>MAX_PROJECT_NAME_LENGTH)return _0x35f861(0xcc)+MAX_PROJECT_NAME_LENGTH+'\x20characters';if(!PROJECT_NAME_PATTERN[_0x35f861(0xc5)](_0x5e2e2f))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';if(WINDOWS_RESERVED_NAME['test'](_0x5e2e2f))return _0x35f861(0xc7)+_0x5e2e2f+_0x35f861(0xc8);return null;}export function validateProjectName(_0x3a3e75){const _0x3868f4=a221_0x5e13,_0x13f38f=_0x3a3e75[_0x3868f4(0xc0)](),_0x22b087=getProjectNameValidationError(_0x13f38f);if(_0x22b087)throw CliErrors[_0x3868f4(0xc3)](_0x22b087,_0x3868f4(0xcf));return _0x13f38f;}
@@ -1 +1 @@
1
- (function(_0x29aa60,_0x55a8ca){const _0x1c4b5c=a222_0x1c2e,_0x2a770c=_0x29aa60();while(!![]){try{const _0x54424b=parseInt(_0x1c4b5c(0xca))/0x1+parseInt(_0x1c4b5c(0xbe))/0x2+parseInt(_0x1c4b5c(0xaf))/0x3*(-parseInt(_0x1c4b5c(0xba))/0x4)+-parseInt(_0x1c4b5c(0xb6))/0x5*(-parseInt(_0x1c4b5c(0xa9))/0x6)+parseInt(_0x1c4b5c(0xb7))/0x7*(parseInt(_0x1c4b5c(0xb9))/0x8)+-parseInt(_0x1c4b5c(0xcc))/0x9*(parseInt(_0x1c4b5c(0xa6))/0xa)+parseInt(_0x1c4b5c(0xa8))/0xb*(-parseInt(_0x1c4b5c(0xac))/0xc);if(_0x54424b===_0x55a8ca)break;else _0x2a770c['push'](_0x2a770c['shift']());}catch(_0x3bfd17){_0x2a770c['push'](_0x2a770c['shift']());}}}(a222_0x3ce4,0xce9fd));import{createWriteStream}from'node:fs';function a222_0x1c2e(_0x303c9f,_0x1cadc4){_0x303c9f=_0x303c9f-0xa6;const _0x3ce4c6=a222_0x3ce4();let _0x1c2e72=_0x3ce4c6[_0x303c9f];return _0x1c2e72;}import a222_0x3faa41 from'node:fs/promises';import a222_0x5c684a from'node:path';import{pipeline}from'node:stream/promises';function a222_0x3ce4(){const _0x550651=['en-US','split','resolve','test','835060lCubga','35YMxZBt','get','2185016OMEFfG','55636nOXNpd','Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20','Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20','endsWith','154994uujlze','join','fileName','Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20','mkdir','end','isEncrypted','sep','readEntry','Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20','catch','close','254385VzTKCg','once','12766374iKIkIh','dirname','replace','startsWith','Unable\x20to\x20open\x20project\x20template\x20archive.','toLocaleLowerCase','externalFileAttributes','entry','10bDKvOz','openReadStream','18656QXQkAL','24ZQOuBC','Unable\x20to\x20read\x20ZIP\x20entry:\x20','set','516BdZspI','uncompressedSize','ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20','6ErtEtP','Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.','add'];a222_0x3ce4=function(){return _0x550651;};return a222_0x3ce4();}import a222_0x1bb8d9 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(_0x315aff){return new Promise((_0x235b87,_0xea329b)=>{a222_0x1bb8d9['open'](_0x315aff,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0xc52493,_0xaaf9e9)=>{const _0x1d3800=a222_0x1c2e;if(_0xc52493||!_0xaaf9e9){_0xea329b(_0xc52493||new Error(_0x1d3800(0xd0)));return;}_0x235b87(_0xaaf9e9);});});}function openEntryStream(_0x4cfc23,_0x40b493){return new Promise((_0x61fac1,_0x5493be)=>{const _0x38eabd=a222_0x1c2e;_0x4cfc23[_0x38eabd(0xa7)](_0x40b493,(_0x42e154,_0x3766c4)=>{const _0x3a66dc=_0x38eabd;if(_0x42e154||!_0x3766c4){_0x5493be(_0x42e154||new Error(_0x3a66dc(0xaa)+_0x40b493[_0x3a66dc(0xc0)]));return;}_0x61fac1(_0x3766c4);});});}function validateEntryPath(_0x3b7f43){const _0x4ca90b=a222_0x1c2e,_0x13724a=_0x3b7f43[_0x4ca90b(0xce)](/\\/g,'/'),_0x5d6876=_0x13724a[_0x4ca90b(0xbd)]('/'),_0x4e231f=_0x5d6876?_0x13724a['slice'](0x0,-0x1):_0x13724a;if(!_0x4e231f||_0x13724a['startsWith']('/')||/^[A-Za-z]:\//[_0x4ca90b(0xb5)](_0x13724a))throw new Error(_0x4ca90b(0xbc)+_0x3b7f43);const _0x472319=_0x4e231f[_0x4ca90b(0xb3)]('/');for(const _0x1338d5 of _0x472319){if(!_0x1338d5||_0x1338d5==='.'||_0x1338d5==='..'||_0x1338d5[_0x4ca90b(0xbd)]('.')||_0x1338d5['endsWith']('\x20')||WINDOWS_INVALID_CHAR[_0x4ca90b(0xb5)](_0x1338d5)||WINDOWS_RESERVED_NAME[_0x4ca90b(0xb5)](_0x1338d5))throw new Error(_0x4ca90b(0xc7)+_0x3b7f43);}return{'relativePath':_0x472319[_0x4ca90b(0xbf)](a222_0x5c684a['sep']),'directory':_0x5d6876};}function isSymbolicLink(_0x20c967){const _0x16caa1=a222_0x1c2e,_0x537a94=_0x20c967[_0x16caa1(0xd2)]>>>0x10&0xffff;return(_0x537a94&0xf000)===0xa000;}export async function extractProjectTemplateArchive(_0x35958b,_0x482e28){const _0x4c64e5=a222_0x1c2e,_0xaf0096=await openZip(_0x35958b),_0x1d8685=a222_0x5c684a['resolve'](_0x482e28),_0x3614ab=new Set(),_0x54df27=new Map();let _0x495cdb=0x0,_0x44474f=0x0;await a222_0x3faa41[_0x4c64e5(0xc2)](_0x1d8685,{'recursive':!![]}),await new Promise((_0x594f4e,_0x3bdb6c)=>{const _0x20340f=_0x4c64e5;let _0xafe72=![];const _0x45b9d1=_0x19e69c=>{const _0x4d2e94=a222_0x1c2e;if(_0xafe72)return;_0xafe72=!![],_0xaf0096[_0x4d2e94(0xc9)](),_0x3bdb6c(_0x19e69c instanceof Error?_0x19e69c:new Error(String(_0x19e69c)));};_0xaf0096[_0x20340f(0xcb)]('error',_0x45b9d1),_0xaf0096[_0x20340f(0xcb)](_0x20340f(0xc3),()=>{if(_0xafe72)return;_0xafe72=!![],_0x594f4e();}),_0xaf0096['on'](_0x20340f(0xd3),_0x1ca568=>{const _0x2150ce=_0x20340f;void(async()=>{const _0x5ba7b5=a222_0x1c2e;_0x495cdb+=0x1,_0x44474f+=_0x1ca568[_0x5ba7b5(0xad)];if(_0x495cdb>MAX_ENTRY_COUNT)throw new Error('Project\x20template\x20ZIP\x20exceeds\x20'+MAX_ENTRY_COUNT+'\x20entries.');if(_0x44474f>MAX_UNCOMPRESSED_SIZE)throw new Error(_0x5ba7b5(0xb0));if(_0x1ca568[_0x5ba7b5(0xc4)]())throw new Error(_0x5ba7b5(0xc1)+_0x1ca568[_0x5ba7b5(0xc0)]);if(isSymbolicLink(_0x1ca568))throw new Error('Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20'+_0x1ca568[_0x5ba7b5(0xc0)]);const {relativePath:_0x8b50de,directory:_0x15c777}=validateEntryPath(_0x1ca568[_0x5ba7b5(0xc0)]),_0x4af16e=_0x8b50de[_0x5ba7b5(0xb3)](a222_0x5c684a[_0x5ba7b5(0xc5)]);for(let _0x321ee3=0x1;_0x321ee3<=_0x4af16e['length'];_0x321ee3+=0x1){const _0x527418=_0x4af16e['slice'](0x0,_0x321ee3)['join'](a222_0x5c684a[_0x5ba7b5(0xc5)]),_0x296a19=_0x527418[_0x5ba7b5(0xd1)](_0x5ba7b5(0xb2)),_0x516197=_0x54df27[_0x5ba7b5(0xb8)](_0x296a19);if(_0x516197&&_0x516197!==_0x527418)throw new Error('Case-conflicting\x20ZIP\x20entry\x20path:\x20'+_0x1ca568[_0x5ba7b5(0xc0)]);_0x54df27[_0x5ba7b5(0xab)](_0x296a19,_0x527418);}const _0x464ee3=_0x8b50de[_0x5ba7b5(0xd1)](_0x5ba7b5(0xb2));if(_0x3614ab['has'](_0x464ee3))throw new Error(_0x5ba7b5(0xbb)+_0x1ca568['fileName']);_0x3614ab[_0x5ba7b5(0xb1)](_0x464ee3);const _0x3a1817=a222_0x5c684a[_0x5ba7b5(0xb4)](_0x1d8685,_0x8b50de);if(_0x3a1817!==_0x1d8685&&!_0x3a1817[_0x5ba7b5(0xcf)](''+_0x1d8685+a222_0x5c684a[_0x5ba7b5(0xc5)]))throw new Error(_0x5ba7b5(0xae)+_0x1ca568[_0x5ba7b5(0xc0)]);if(_0x15c777)await a222_0x3faa41[_0x5ba7b5(0xc2)](_0x3a1817,{'recursive':!![]});else{await a222_0x3faa41[_0x5ba7b5(0xc2)](a222_0x5c684a[_0x5ba7b5(0xcd)](_0x3a1817),{'recursive':!![]});const _0x2ff061=await openEntryStream(_0xaf0096,_0x1ca568);await pipeline(_0x2ff061,createWriteStream(_0x3a1817,{'flags':'wx','mode':0x1a4}));}_0xaf0096[_0x5ba7b5(0xc6)]();})()[_0x2150ce(0xc8)](_0x45b9d1);}),_0xaf0096['readEntry']();});}
1
+ (function(_0x1e53c7,_0x51834f){const _0xc530c1=a222_0x3b53,_0x3c78d5=_0x1e53c7();while(!![]){try{const _0x4f38ff=parseInt(_0xc530c1(0xc7))/0x1+parseInt(_0xc530c1(0xbc))/0x2+parseInt(_0xc530c1(0xc9))/0x3+parseInt(_0xc530c1(0xd3))/0x4+parseInt(_0xc530c1(0xd7))/0x5*(parseInt(_0xc530c1(0xc4))/0x6)+parseInt(_0xc530c1(0xcd))/0x7+parseInt(_0xc530c1(0xd8))/0x8*(-parseInt(_0xc530c1(0xc1))/0x9);if(_0x4f38ff===_0x51834f)break;else _0x3c78d5['push'](_0x3c78d5['shift']());}catch(_0x53d858){_0x3c78d5['push'](_0x3c78d5['shift']());}}}(a222_0xf166,0x8c844));import{createWriteStream}from'node:fs';import a222_0x30ec9e from'node:fs/promises';import a222_0x1114a9 from'node:path';function a222_0xf166(){const _0x1bad97=['uncompressedSize','test','mkdir','externalFileAttributes','startsWith','has','Case-conflicting\x20ZIP\x20entry\x20path:\x20','join','Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20','800000lotclu','get','slice','Project\x20template\x20ZIP\x20exceeds\x20','error','720xVxpka','endsWith','Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.','294666iAwvkm','split','Unable\x20to\x20read\x20ZIP\x20entry:\x20','413573RWamcv','set','2209494MMSUjA','sep','readEntry','\x20entries.','2144079kSQrxL','Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20','once','en-US','resolve','length','1027228BIGFUs','toLocaleLowerCase','replace','fileName','55WySYVf','207784tqfXJO','catch','end','Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20'];a222_0xf166=function(){return _0x1bad97;};return a222_0xf166();}import{pipeline}from'node:stream/promises';import a222_0x5d4747 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(_0x47f368){return new Promise((_0xd0a8e3,_0xfd7e10)=>{a222_0x5d4747['open'](_0x47f368,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x31bb4d,_0x4922e8)=>{if(_0x31bb4d||!_0x4922e8){_0xfd7e10(_0x31bb4d||new Error('Unable\x20to\x20open\x20project\x20template\x20archive.'));return;}_0xd0a8e3(_0x4922e8);});});}function openEntryStream(_0xa49fe1,_0x1ec46e){return new Promise((_0x59050a,_0x1f383f)=>{_0xa49fe1['openReadStream'](_0x1ec46e,(_0x1d8e30,_0x78c2e)=>{const _0x37d07f=a222_0x3b53;if(_0x1d8e30||!_0x78c2e){_0x1f383f(_0x1d8e30||new Error(_0x37d07f(0xc6)+_0x1ec46e[_0x37d07f(0xd6)]));return;}_0x59050a(_0x78c2e);});});}function a222_0x3b53(_0x46b7b7,_0x163ab6){_0x46b7b7=_0x46b7b7-0xbb;const _0xf16638=a222_0xf166();let _0x3b5309=_0xf16638[_0x46b7b7];return _0x3b5309;}function validateEntryPath(_0x209399){const _0x2b03b1=a222_0x3b53,_0x52347b=_0x209399[_0x2b03b1(0xd5)](/\\/g,'/'),_0x46a902=_0x52347b[_0x2b03b1(0xc2)]('/'),_0x15b142=_0x46a902?_0x52347b[_0x2b03b1(0xbe)](0x0,-0x1):_0x52347b;if(!_0x15b142||_0x52347b[_0x2b03b1(0xe0)]('/')||/^[A-Za-z]:\//[_0x2b03b1(0xdd)](_0x52347b))throw new Error(_0x2b03b1(0xce)+_0x209399);const _0x2adf4b=_0x15b142[_0x2b03b1(0xc5)]('/');for(const _0x1486c8 of _0x2adf4b){if(!_0x1486c8||_0x1486c8==='.'||_0x1486c8==='..'||_0x1486c8[_0x2b03b1(0xc2)]('.')||_0x1486c8['endsWith']('\x20')||WINDOWS_INVALID_CHAR[_0x2b03b1(0xdd)](_0x1486c8)||WINDOWS_RESERVED_NAME[_0x2b03b1(0xdd)](_0x1486c8))throw new Error('Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20'+_0x209399);}return{'relativePath':_0x2adf4b[_0x2b03b1(0xe3)](a222_0x1114a9[_0x2b03b1(0xca)]),'directory':_0x46a902};}function isSymbolicLink(_0x6695ab){const _0x13fba8=a222_0x3b53,_0x40a7d9=_0x6695ab[_0x13fba8(0xdf)]>>>0x10&0xffff;return(_0x40a7d9&0xf000)===0xa000;}export async function extractProjectTemplateArchive(_0x8ca51d,_0xc8ec5){const _0x7a4236=a222_0x3b53,_0x323e63=await openZip(_0x8ca51d),_0x1d5575=a222_0x1114a9[_0x7a4236(0xd1)](_0xc8ec5),_0x601bb4=new Set(),_0x5cff31=new Map();let _0x19bd9c=0x0,_0x454a3c=0x0;await a222_0x30ec9e['mkdir'](_0x1d5575,{'recursive':!![]}),await new Promise((_0x473ce5,_0x3eefe0)=>{const _0xfcf306=_0x7a4236;let _0x59d621=![];const _0x3afa37=_0x16ef67=>{if(_0x59d621)return;_0x59d621=!![],_0x323e63['close'](),_0x3eefe0(_0x16ef67 instanceof Error?_0x16ef67:new Error(String(_0x16ef67)));};_0x323e63[_0xfcf306(0xcf)](_0xfcf306(0xc0),_0x3afa37),_0x323e63[_0xfcf306(0xcf)](_0xfcf306(0xda),()=>{if(_0x59d621)return;_0x59d621=!![],_0x473ce5();}),_0x323e63['on']('entry',_0x3f8165=>{const _0x1a6810=_0xfcf306;void(async()=>{const _0x3d0a6e=a222_0x3b53;_0x19bd9c+=0x1,_0x454a3c+=_0x3f8165[_0x3d0a6e(0xdc)];if(_0x19bd9c>MAX_ENTRY_COUNT)throw new Error(_0x3d0a6e(0xbf)+MAX_ENTRY_COUNT+_0x3d0a6e(0xcc));if(_0x454a3c>MAX_UNCOMPRESSED_SIZE)throw new Error(_0x3d0a6e(0xc3));if(_0x3f8165['isEncrypted']())throw new Error(_0x3d0a6e(0xbb)+_0x3f8165[_0x3d0a6e(0xd6)]);if(isSymbolicLink(_0x3f8165))throw new Error(_0x3d0a6e(0xdb)+_0x3f8165[_0x3d0a6e(0xd6)]);const {relativePath:_0xc18617,directory:_0x197d25}=validateEntryPath(_0x3f8165[_0x3d0a6e(0xd6)]),_0x5498f1=_0xc18617[_0x3d0a6e(0xc5)](a222_0x1114a9['sep']);for(let _0x4d827d=0x1;_0x4d827d<=_0x5498f1[_0x3d0a6e(0xd2)];_0x4d827d+=0x1){const _0x50eba3=_0x5498f1[_0x3d0a6e(0xbe)](0x0,_0x4d827d)[_0x3d0a6e(0xe3)](a222_0x1114a9[_0x3d0a6e(0xca)]),_0x562cab=_0x50eba3[_0x3d0a6e(0xd4)]('en-US'),_0x55a795=_0x5cff31[_0x3d0a6e(0xbd)](_0x562cab);if(_0x55a795&&_0x55a795!==_0x50eba3)throw new Error(_0x3d0a6e(0xe2)+_0x3f8165[_0x3d0a6e(0xd6)]);_0x5cff31[_0x3d0a6e(0xc8)](_0x562cab,_0x50eba3);}const _0x5b9e9d=_0xc18617[_0x3d0a6e(0xd4)](_0x3d0a6e(0xd0));if(_0x601bb4[_0x3d0a6e(0xe1)](_0x5b9e9d))throw new Error('Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20'+_0x3f8165['fileName']);_0x601bb4['add'](_0x5b9e9d);const _0x179fb1=a222_0x1114a9['resolve'](_0x1d5575,_0xc18617);if(_0x179fb1!==_0x1d5575&&!_0x179fb1[_0x3d0a6e(0xe0)](''+_0x1d5575+a222_0x1114a9[_0x3d0a6e(0xca)]))throw new Error('ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20'+_0x3f8165[_0x3d0a6e(0xd6)]);if(_0x197d25)await a222_0x30ec9e['mkdir'](_0x179fb1,{'recursive':!![]});else{await a222_0x30ec9e[_0x3d0a6e(0xde)](a222_0x1114a9['dirname'](_0x179fb1),{'recursive':!![]});const _0x3894dd=await openEntryStream(_0x323e63,_0x3f8165);await pipeline(_0x3894dd,createWriteStream(_0x179fb1,{'flags':'wx','mode':0x1a4}));}_0x323e63['readEntry']();})()[_0x1a6810(0xd9)](_0x3afa37);}),_0x323e63[_0xfcf306(0xcb)]();});}
@@ -1 +1 @@
1
- const a223_0x378c3c=a223_0x21cf;(function(_0x5f570b,_0x17f3c0){const _0x53d88d=a223_0x21cf,_0x2485ee=_0x5f570b();while(!![]){try{const _0x18f1c4=parseInt(_0x53d88d(0xe4))/0x1+-parseInt(_0x53d88d(0xe8))/0x2+parseInt(_0x53d88d(0xe5))/0x3+parseInt(_0x53d88d(0xe7))/0x4*(-parseInt(_0x53d88d(0xdf))/0x5)+parseInt(_0x53d88d(0xe2))/0x6+parseInt(_0x53d88d(0xe0))/0x7*(-parseInt(_0x53d88d(0xe6))/0x8)+-parseInt(_0x53d88d(0xe1))/0x9*(-parseInt(_0x53d88d(0xe3))/0xa);if(_0x18f1c4===_0x17f3c0)break;else _0x2485ee['push'](_0x2485ee['shift']());}catch(_0xbf2c82){_0x2485ee['push'](_0x2485ee['shift']());}}}(a223_0x3398,0x87e6d));import a223_0x4efc9e from'node:path';function a223_0x3398(){const _0x551ba9=['1076ByeMDH','1372492mTolGC','dirname','../../../../','9305dQciBn','175eMxugO','11165463wKvjDR','5790282sScVuI','10lUoNwq','74623IHxXvz','1563918zpgAzw','338584iXpjei'];a223_0x3398=function(){return _0x551ba9;};return a223_0x3398();}function a223_0x21cf(_0x384483,_0x46fbd3){_0x384483=_0x384483-0xdd;const _0x3398c1=a223_0x3398();let _0x21cfca=_0x3398c1[_0x384483];return _0x21cfca;}import{fileURLToPath}from'node:url';const __dirname=a223_0x4efc9e[a223_0x378c3c(0xdd)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x1224da=a223_0x378c3c;return a223_0x4efc9e['resolve'](__dirname,_0x1224da(0xde));}
1
+ const a223_0x45a377=a223_0x4ec4;function a223_0x60c9(){const _0xbc71e3=['1055787kGBCSh','4jIOpVW','5864090qEGaxh','4321vikiaK','580FNOxvJ','81zlPerY','5433946kAzExa','dirname','6439098rHArPC','../../../../','372ptLLNk','resolve','533434MHMpFI','32424hVdKnL'];a223_0x60c9=function(){return _0xbc71e3;};return a223_0x60c9();}(function(_0x594ecd,_0x195973){const _0x21b66f=a223_0x4ec4,_0x3cd62a=_0x594ecd();while(!![]){try{const _0x5c9089=parseInt(_0x21b66f(0x17d))/0x1*(parseInt(_0x21b66f(0x184))/0x2)+-parseInt(_0x21b66f(0x17a))/0x3+-parseInt(_0x21b66f(0x17b))/0x4*(-parseInt(_0x21b66f(0x17c))/0x5)+parseInt(_0x21b66f(0x182))/0x6+parseInt(_0x21b66f(0x180))/0x7+parseInt(_0x21b66f(0x179))/0x8*(-parseInt(_0x21b66f(0x17f))/0x9)+parseInt(_0x21b66f(0x17e))/0xa*(-parseInt(_0x21b66f(0x178))/0xb);if(_0x5c9089===_0x195973)break;else _0x3cd62a['push'](_0x3cd62a['shift']());}catch(_0x2727d5){_0x3cd62a['push'](_0x3cd62a['shift']());}}}(a223_0x60c9,0x9891f));function a223_0x4ec4(_0x835e33,_0x5727f7){_0x835e33=_0x835e33-0x177;const _0x60c94d=a223_0x60c9();let _0x4ec4c6=_0x60c94d[_0x835e33];return _0x4ec4c6;}import a223_0x5e2409 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a223_0x5e2409[a223_0x45a377(0x181)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x1eb9e4=a223_0x45a377;return a223_0x5e2409[_0x1eb9e4(0x177)](__dirname,_0x1eb9e4(0x183));}
@@ -1 +1 @@
1
- function a224_0x27be(){const _0x1f131b=['42942vJtSOK','version','2UEpjih','91431nXmIqg','success','3556392zjvqJZ','1286856xsurpT','source','1158013zabbis','message','1298384FubTQk','Failed\x20to\x20copy\x20project\x20template','cwd','copy','535nPTnwr','resolve','now','940WBkqTd','error','1442511jjlQxN'];a224_0x27be=function(){return _0x1f131b;};return a224_0x27be();}(function(_0x2584c4,_0x4226e1){const _0x789d9e=a224_0x5485,_0x279020=_0x2584c4();while(!![]){try{const _0xd01fbe=-parseInt(_0x789d9e(0x9e))/0x1*(-parseInt(_0x789d9e(0x98))/0x2)+-parseInt(_0x789d9e(0x9c))/0x3+parseInt(_0x789d9e(0xa0))/0x4+parseInt(_0x789d9e(0xa4))/0x5*(-parseInt(_0x789d9e(0x96))/0x6)+-parseInt(_0x789d9e(0x95))/0x7+-parseInt(_0x789d9e(0x9b))/0x8+parseInt(_0x789d9e(0x99))/0x9*(parseInt(_0x789d9e(0x93))/0xa);if(_0xd01fbe===_0x4226e1)break;else _0x279020['push'](_0x279020['shift']());}catch(_0x3c2d7b){_0x279020['push'](_0x279020['shift']());}}}(a224_0x27be,0x90936));import a224_0x56b1c5 from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a224_0x5485(_0x2627b2,_0x340402){_0x2627b2=_0x2627b2-0x93;const _0x27be30=a224_0x27be();let _0x54859f=_0x27be30[_0x2627b2];return _0x54859f;}import{logger}from'../../../utils/logger.js';import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';export async function copyProjectTemplate(_0x2deb6,_0x21d5aa,_0x37e3d1){const _0x554a71=a224_0x5485,_0x4f7536=Date[_0x554a71(0xa6)](),_0x3b0407=a224_0x56b1c5[_0x554a71(0xa5)](process[_0x554a71(0xa2)](),_0x2deb6);try{logger['info'](_0x554a71(0xa3),'Starting\x20project\x20template\x20creation',{'projectCode':_0x2deb6});const _0x1b3b78=_0x37e3d1?await materializeLocalProjectTemplate(_0x37e3d1,_0x3b0407,_0x21d5aa):await materializeProjectTemplate(_0x3b0407,_0x21d5aa),_0xbb2ba4=Date[_0x554a71(0xa6)]()-_0x4f7536;logger[_0x554a71(0x9a)](_0x554a71(0xa3),'Project\x20template\x20created',_0xbb2ba4,{'projectCode':_0x2deb6,'templateSource':_0x1b3b78[_0x554a71(0x9d)],'templateVersion':_0x1b3b78[_0x554a71(0x97)]});}catch(_0x168700){const _0x12755e=Date[_0x554a71(0xa6)]()-_0x4f7536;logger[_0x554a71(0x94)]('copy',_0x554a71(0xa1),{'projectCode':_0x2deb6,'error':_0x168700 instanceof Error?_0x168700[_0x554a71(0x9f)]:String(_0x168700),'duration':_0x12755e});throw _0x168700;}return formatElapsed(_0x4f7536);}
1
+ function a224_0x5edf(_0x4ff580,_0xf00d4a){_0x4ff580=_0x4ff580-0x91;const _0x4b6fdf=a224_0x4b6f();let _0x5edff9=_0x4b6fdf[_0x4ff580];return _0x5edff9;}(function(_0x47a268,_0xe1f912){const _0x2853b7=a224_0x5edf,_0x4539db=_0x47a268();while(!![]){try{const _0x2b46ca=parseInt(_0x2853b7(0xa3))/0x1*(parseInt(_0x2853b7(0x9c))/0x2)+-parseInt(_0x2853b7(0xa1))/0x3*(parseInt(_0x2853b7(0xa2))/0x4)+-parseInt(_0x2853b7(0x9d))/0x5*(-parseInt(_0x2853b7(0x91))/0x6)+parseInt(_0x2853b7(0xa5))/0x7+-parseInt(_0x2853b7(0x98))/0x8+-parseInt(_0x2853b7(0x9f))/0x9*(-parseInt(_0x2853b7(0x9b))/0xa)+parseInt(_0x2853b7(0xa6))/0xb*(-parseInt(_0x2853b7(0xa4))/0xc);if(_0x2b46ca===_0xe1f912)break;else _0x4539db['push'](_0x4539db['shift']());}catch(_0xf36a0c){_0x4539db['push'](_0x4539db['shift']());}}}(a224_0x4b6f,0xb0876));function a224_0x4b6f(){const _0x417aff=['Starting\x20project\x20template\x20creation','9063goWVQe','version','1719nwGMdT','4388yQdCcp','377708MoYAbZ','60mYeLaY','3938291xlkmVo','3774331ZnZBxH','54EPNETd','cwd','now','Project\x20template\x20created','resolve','message','Failed\x20to\x20copy\x20project\x20template','2863064FdfehY','copy','source','13410HIyAOw','2pjaqwt','630235NzQjhI'];a224_0x4b6f=function(){return _0x417aff;};return a224_0x4b6f();}import a224_0x15df76 from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';export async function copyProjectTemplate(_0x10db61,_0x5b66d2,_0x343fdd){const _0x5422db=a224_0x5edf,_0x3d9a62=Date[_0x5422db(0x93)](),_0x26e353=a224_0x15df76[_0x5422db(0x95)](process[_0x5422db(0x92)](),_0x10db61);try{logger['info'](_0x5422db(0x99),_0x5422db(0x9e),{'projectCode':_0x10db61});const _0x1fad30=_0x343fdd?await materializeLocalProjectTemplate(_0x343fdd,_0x26e353,_0x5b66d2):await materializeProjectTemplate(_0x26e353,_0x5b66d2),_0x247023=Date['now']()-_0x3d9a62;logger['success'](_0x5422db(0x99),_0x5422db(0x94),_0x247023,{'projectCode':_0x10db61,'templateSource':_0x1fad30[_0x5422db(0x9a)],'templateVersion':_0x1fad30[_0x5422db(0xa0)]});}catch(_0x3248f1){const _0x393e57=Date['now']()-_0x3d9a62;logger['error']('copy',_0x5422db(0x97),{'projectCode':_0x10db61,'error':_0x3248f1 instanceof Error?_0x3248f1[_0x5422db(0x96)]:String(_0x3248f1),'duration':_0x393e57});throw _0x3248f1;}return formatElapsed(_0x3d9a62);}
@@ -1 +1 @@
1
- (function(_0x1a0b3f,_0x236b88){const _0xdcee46=a225_0x2756,_0x19d606=_0x1a0b3f();while(!![]){try{const _0x255a85=-parseInt(_0xdcee46(0x135))/0x1*(parseInt(_0xdcee46(0x124))/0x2)+-parseInt(_0xdcee46(0x132))/0x3+parseInt(_0xdcee46(0x134))/0x4+-parseInt(_0xdcee46(0x133))/0x5*(parseInt(_0xdcee46(0x12d))/0x6)+parseInt(_0xdcee46(0x128))/0x7+parseInt(_0xdcee46(0x137))/0x8+parseInt(_0xdcee46(0x12f))/0x9;if(_0x255a85===_0x236b88)break;else _0x19d606['push'](_0x19d606['shift']());}catch(_0x536fb0){_0x19d606['push'](_0x19d606['shift']());}}}(a225_0x1317,0x43392));import a225_0x115af3 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a225_0x1317(){const _0x2c2ce9=['npx','1238713weUNfy','--write','prettier','error','Code\x20format\x20completed','2070402BANDbK','resolve','3191643QuZTSx','Code\x20format\x20failed','info','481182PkXqZv','5OKGOvb','642860jdfPlX','101427PmuJnG','now','1519464FZrVhk','cwd','format','2AyGSKv','Starting\x20code\x20format','success'];a225_0x1317=function(){return _0x2c2ce9;};return a225_0x1317();}function a225_0x2756(_0x11bf06,_0x2e6243){_0x11bf06=_0x11bf06-0x122;const _0x131709=a225_0x1317();let _0x275680=_0x131709[_0x11bf06];return _0x275680;}export async function formatProjectCode(_0x4c1cf5){const _0x53679b=a225_0x2756,_0x35257f=Date[_0x53679b(0x136)](),_0x4eb5e0=a225_0x115af3[_0x53679b(0x12e)](process[_0x53679b(0x122)](),_0x4c1cf5);try{logger[_0x53679b(0x131)](_0x53679b(0x123),_0x53679b(0x125),{'projectCode':_0x4c1cf5}),await execa(resolveNpmBin(_0x53679b(0x127)),[_0x53679b(0x12a),_0x53679b(0x129),'.'],{'cwd':_0x4eb5e0});const _0x325d21=Date[_0x53679b(0x136)]()-_0x35257f;logger[_0x53679b(0x126)](_0x53679b(0x123),_0x53679b(0x12c),_0x325d21,{'projectCode':_0x4c1cf5});}catch(_0x1e8ac8){const _0x199ce2=Date[_0x53679b(0x136)]()-_0x35257f;logger[_0x53679b(0x12b)]('format',_0x53679b(0x130),{'projectCode':_0x4c1cf5,'error':_0x1e8ac8 instanceof Error?_0x1e8ac8['message']:String(_0x1e8ac8),'duration':_0x199ce2});throw _0x1e8ac8;}return formatElapsed(_0x35257f);}
1
+ (function(_0x3ddca7,_0x1dc022){const _0x8de0a9=a225_0x1a5f,_0xf27f0b=_0x3ddca7();while(!![]){try{const _0x55c22c=-parseInt(_0x8de0a9(0x1c7))/0x1*(parseInt(_0x8de0a9(0x1d0))/0x2)+parseInt(_0x8de0a9(0x1bf))/0x3*(parseInt(_0x8de0a9(0x1c4))/0x4)+-parseInt(_0x8de0a9(0x1be))/0x5+parseInt(_0x8de0a9(0x1bd))/0x6*(-parseInt(_0x8de0a9(0x1d4))/0x7)+-parseInt(_0x8de0a9(0x1c8))/0x8+parseInt(_0x8de0a9(0x1c3))/0x9+-parseInt(_0x8de0a9(0x1c0))/0xa*(-parseInt(_0x8de0a9(0x1cf))/0xb);if(_0x55c22c===_0x1dc022)break;else _0xf27f0b['push'](_0xf27f0b['shift']());}catch(_0x408403){_0xf27f0b['push'](_0xf27f0b['shift']());}}}(a225_0x5f5b,0xba0e1));import a225_0xa9dc00 from'node:path';import{execa}from'execa';function a225_0x1a5f(_0x5a455d,_0x52fffc){_0x5a455d=_0x5a455d-0x1bd;const _0x5f5b4f=a225_0x5f5b();let _0x1a5f9c=_0x5f5b4f[_0x5a455d];return _0x1a5f9c;}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a225_0x5f5b(){const _0x577ecc=['cwd','336AdsjRf','870uoTthu','6539860VhCNaP','27aHSMRp','748390XluloZ','error','Code\x20format\x20failed','11108898ZCEjTa','58184FWcrKi','--write','npx','104562ZDMcLy','4844816VsxUeF','success','resolve','format','Code\x20format\x20completed','Starting\x20code\x20format','now','209TRNDwv','2ZnpCjA','prettier','message'];a225_0x5f5b=function(){return _0x577ecc;};return a225_0x5f5b();}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x5fdb2){const _0x37a15e=a225_0x1a5f,_0x47950b=Date[_0x37a15e(0x1ce)](),_0x3f8581=a225_0xa9dc00[_0x37a15e(0x1ca)](process[_0x37a15e(0x1d3)](),_0x5fdb2);try{logger['info']('format',_0x37a15e(0x1cd),{'projectCode':_0x5fdb2}),await execa(resolveNpmBin(_0x37a15e(0x1c6)),[_0x37a15e(0x1d1),_0x37a15e(0x1c5),'.'],{'cwd':_0x3f8581});const _0x312d8d=Date[_0x37a15e(0x1ce)]()-_0x47950b;logger[_0x37a15e(0x1c9)]('format',_0x37a15e(0x1cc),_0x312d8d,{'projectCode':_0x5fdb2});}catch(_0x38e4c2){const _0x3a35ec=Date[_0x37a15e(0x1ce)]()-_0x47950b;logger[_0x37a15e(0x1c1)](_0x37a15e(0x1cb),_0x37a15e(0x1c2),{'projectCode':_0x5fdb2,'error':_0x38e4c2 instanceof Error?_0x38e4c2[_0x37a15e(0x1d2)]:String(_0x38e4c2),'duration':_0x3a35ec});throw _0x38e4c2;}return formatElapsed(_0x47950b);}
@@ -1 +1 @@
1
- (function(_0x1fa17d,_0x127afb){const _0x19feec=a226_0x200e,_0x3b7ec2=_0x1fa17d();while(!![]){try{const _0x52ee46=-parseInt(_0x19feec(0x10b))/0x1*(parseInt(_0x19feec(0x106))/0x2)+parseInt(_0x19feec(0x114))/0x3*(parseInt(_0x19feec(0x10d))/0x4)+parseInt(_0x19feec(0x10e))/0x5*(-parseInt(_0x19feec(0xff))/0x6)+parseInt(_0x19feec(0x103))/0x7*(parseInt(_0x19feec(0x102))/0x8)+parseInt(_0x19feec(0x108))/0x9*(-parseInt(_0x19feec(0x109))/0xa)+-parseInt(_0x19feec(0x107))/0xb+parseInt(_0x19feec(0x10a))/0xc;if(_0x52ee46===_0x127afb)break;else _0x3b7ec2['push'](_0x3b7ec2['shift']());}catch(_0x54bf9d){_0x3b7ec2['push'](_0x3b7ec2['shift']());}}}(a226_0x3992,0x82163));import a226_0x583da7 from'node:path';import{execa}from'execa';function a226_0x200e(_0x403759,_0x1580ce){_0x403759=_0x403759-0xfe;const _0x39922e=a226_0x3992();let _0x200edd=_0x39922e[_0x403759];return _0x200edd;}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(_0x54c8e3){const _0x3a6bda=a226_0x200e,_0x1e53a6=Date[_0x3a6bda(0x112)](),_0x14a765=a226_0x583da7[_0x3a6bda(0x105)](process[_0x3a6bda(0x10c)](),_0x54c8e3);try{logger[_0x3a6bda(0x110)](_0x3a6bda(0x10f),_0x3a6bda(0x101),{'projectCode':_0x54c8e3,'registry':_0x3a6bda(0x113)}),await execa(resolveNpmBin(_0x3a6bda(0x104)),[_0x3a6bda(0x10f),_0x3a6bda(0x100),'https://registry.npmmirror.com'],{'cwd':_0x14a765});const _0x34161b=Date['now']()-_0x1e53a6;logger[_0x3a6bda(0xfe)](_0x3a6bda(0x10f),'Dependency\x20install\x20completed',_0x34161b,{'projectCode':_0x54c8e3});}catch(_0x43e0f9){const _0x30063b=Date[_0x3a6bda(0x112)]()-_0x1e53a6;logger[_0x3a6bda(0x115)]('install',_0x3a6bda(0x111),{'projectCode':_0x54c8e3,'error':_0x43e0f9 instanceof Error?_0x43e0f9['message']:String(_0x43e0f9),'duration':_0x30063b});throw _0x43e0f9;}return formatElapsed(_0x1e53a6);}function a226_0x3992(){const _0x2e5276=['Dependency\x20install\x20failed','now','https://registry.npmmirror.com','4629CkkTET','error','success','50802KMPxEd','--registry','Starting\x20dependency\x20install','72VJmNOX','202531SYRTNf','npm','resolve','6SKFdmk','3469994KkdPOO','171vOzXfd','381460ENlbPY','13551552cCWMmO','91435Ebgprp','cwd','1384PxvwvU','45iNnufq','install','info'];a226_0x3992=function(){return _0x2e5276;};return a226_0x3992();}
1
+ function a226_0x2f5e(){const _0x118891=['now','install','10852604VoYfHa','9355720dIIOoz','https://registry.npmmirror.com','1932855klIeYP','message','117AcZuRa','30lznFIj','--registry','error','55612FQJXMt','info','2571300eyaaOP','3224630VrJClT','722124QWPpMJ','resolve','Dependency\x20install\x20completed','6JxmKic'];a226_0x2f5e=function(){return _0x118891;};return a226_0x2f5e();}(function(_0x5bb396,_0x227c15){const _0x49eafb=a226_0x2308,_0xa42fd2=_0x5bb396();while(!![]){try{const _0x38090e=parseInt(_0x49eafb(0x10f))/0x1+parseInt(_0x49eafb(0x120))/0x2+parseInt(_0x49eafb(0x11b))/0x3*(-parseInt(_0x49eafb(0x11e))/0x4)+parseInt(_0x49eafb(0x118))/0x5+parseInt(_0x49eafb(0x112))/0x6*(parseInt(_0x49eafb(0x115))/0x7)+parseInt(_0x49eafb(0x116))/0x8+parseInt(_0x49eafb(0x11a))/0x9*(-parseInt(_0x49eafb(0x121))/0xa);if(_0x38090e===_0x227c15)break;else _0xa42fd2['push'](_0xa42fd2['shift']());}catch(_0x528e73){_0xa42fd2['push'](_0xa42fd2['shift']());}}}(a226_0x2f5e,0xbf31d));import a226_0x2103b5 from'node:path';function a226_0x2308(_0x1055d8,_0x470e41){_0x1055d8=_0x1055d8-0x10f;const _0x2f5eb6=a226_0x2f5e();let _0x2308f8=_0x2f5eb6[_0x1055d8];return _0x2308f8;}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x4b885){const _0x1e362c=a226_0x2308,_0x15131f=Date[_0x1e362c(0x113)](),_0x53d069=a226_0x2103b5[_0x1e362c(0x110)](process['cwd'](),_0x4b885);try{logger[_0x1e362c(0x11f)]('install','Starting\x20dependency\x20install',{'projectCode':_0x4b885,'registry':_0x1e362c(0x117)}),await execa(resolveNpmBin('npm'),[_0x1e362c(0x114),_0x1e362c(0x11c),'https://registry.npmmirror.com'],{'cwd':_0x53d069});const _0x23a578=Date[_0x1e362c(0x113)]()-_0x15131f;logger['success'](_0x1e362c(0x114),_0x1e362c(0x111),_0x23a578,{'projectCode':_0x4b885});}catch(_0xb97ed2){const _0x192189=Date['now']()-_0x15131f;logger[_0x1e362c(0x11d)](_0x1e362c(0x114),'Dependency\x20install\x20failed',{'projectCode':_0x4b885,'error':_0xb97ed2 instanceof Error?_0xb97ed2[_0x1e362c(0x119)]:String(_0xb97ed2),'duration':_0x192189});throw _0xb97ed2;}return formatElapsed(_0x15131f);}
@@ -1 +1 @@
1
- const a227_0x2e254e=a227_0x5524;function a227_0x234f(){const _0x17536f=['45817794swPTuc','project','domain-routing-sync','\x20workspace\x20init\x20--appcode\x20<code>\x20in\x20the\x20project\x20directory\x20first.','928165glInGr','Run\x20','Synchronize\x20the\x20current\x20project\x27s\x20public\x20Domain\x20routing','path','read','validation','1018162voYjkZ','91638ncJTEi','30TakWvS','No\x20Rabetbase\x20project\x20configuration\x20was\x20found.','846881yplSgL','3458772KOTyyw','8eCXzxZ','3051100KAqdwM'];a227_0x234f=function(){return _0x17536f;};return a227_0x234f();}function a227_0x5524(_0x56d6ce,_0x5bb456){_0x56d6ce=_0x56d6ce-0xc6;const _0x234f49=a227_0x234f();let _0x5524ed=_0x234f49[_0x56d6ce];return _0x5524ed;}(function(_0x174d5a,_0x210163){const _0x5a11b2=a227_0x5524,_0x41357a=_0x174d5a();while(!![]){try{const _0x994bc5=-parseInt(_0x5a11b2(0xce))/0x1+-parseInt(_0x5a11b2(0xd5))/0x2+parseInt(_0x5a11b2(0xcf))/0x3+-parseInt(_0x5a11b2(0xd3))/0x4+-parseInt(_0x5a11b2(0xc8))/0x5*(parseInt(_0x5a11b2(0xd0))/0x6)+-parseInt(_0x5a11b2(0xd2))/0x7*(-parseInt(_0x5a11b2(0xd4))/0x8)+parseInt(_0x5a11b2(0xd6))/0x9;if(_0x994bc5===_0x210163)break;else _0x41357a['push'](_0x41357a['shift']());}catch(_0x1bb1ff){_0x41357a['push'](_0x41357a['shift']());}}}(a227_0x234f,0xdd261));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';export const projectDomainRoutingSyncDefinition={'service':a227_0x2e254e(0xd7),'command':a227_0x2e254e(0xc6),'description':a227_0x2e254e(0xca),'risk':a227_0x2e254e(0xcc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(){const _0x5e14c6=a227_0x2e254e,_0x1a489c=findProjectRootDirectory();if(!resolveConfigPath(_0x1a489c))throw CliErrors[_0x5e14c6(0xcd)](_0x5e14c6(0xd1),_0x5e14c6(0xc9)+CLI_BIN_NAME+_0x5e14c6(0xc7));const _0xfcfdfa=writeProjectDomainRoutingManifest(_0x1a489c);return{'ok':!![],'message':'Domain\x20routing\x20synchronized:\x20'+_0xfcfdfa[_0x5e14c6(0xcb)],'data':_0xfcfdfa};}};
1
+ const a227_0x39fde3=a227_0x5446;function a227_0x5446(_0x27a4d8,_0x61a1a9){_0x27a4d8=_0x27a4d8-0x87;const _0xebc5b6=a227_0xebc5();let _0x5446e3=_0xebc5b6[_0x27a4d8];return _0x5446e3;}(function(_0x37142e,_0x4cf3c8){const _0x2811e7=a227_0x5446,_0x2e4ccf=_0x37142e();while(!![]){try{const _0x194139=parseInt(_0x2811e7(0x93))/0x1+-parseInt(_0x2811e7(0x99))/0x2*(parseInt(_0x2811e7(0x8b))/0x3)+parseInt(_0x2811e7(0x95))/0x4+parseInt(_0x2811e7(0x96))/0x5+-parseInt(_0x2811e7(0x8c))/0x6*(parseInt(_0x2811e7(0x98))/0x7)+parseInt(_0x2811e7(0x8d))/0x8*(-parseInt(_0x2811e7(0x87))/0x9)+parseInt(_0x2811e7(0x89))/0xa*(-parseInt(_0x2811e7(0x8e))/0xb);if(_0x194139===_0x4cf3c8)break;else _0x2e4ccf['push'](_0x2e4ccf['shift']());}catch(_0x4c608b){_0x2e4ccf['push'](_0x2e4ccf['shift']());}}}(a227_0xebc5,0x87d65));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a227_0xebc5(){const _0xec48db=['No\x20Rabetbase\x20project\x20configuration\x20was\x20found.','1429128UgBjTF','3781980pXcqUK','validation','56Ftajpt','22924GBmrmb','18EKWiqV','Run\x20','37430eihCJe','domain-routing-sync','87NxDfNy','365106UkvUlO','726456NHMEWC','77hvwvti','path','project','\x20workspace\x20init\x20--appcode\x20<code>\x20in\x20the\x20project\x20directory\x20first.','Domain\x20routing\x20synchronized:\x20','469732OdBWVG'];a227_0xebc5=function(){return _0xec48db;};return a227_0xebc5();}import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';export const projectDomainRoutingSyncDefinition={'service':a227_0x39fde3(0x90),'command':a227_0x39fde3(0x8a),'description':'Synchronize\x20the\x20current\x20project\x27s\x20public\x20Domain\x20routing','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(){const _0x3d7a07=a227_0x39fde3,_0x4c502f=findProjectRootDirectory();if(!resolveConfigPath(_0x4c502f))throw CliErrors[_0x3d7a07(0x97)](_0x3d7a07(0x94),_0x3d7a07(0x88)+CLI_BIN_NAME+_0x3d7a07(0x91));const _0xbd4093=writeProjectDomainRoutingManifest(_0x4c502f);return{'ok':!![],'message':_0x3d7a07(0x92)+_0xbd4093[_0x3d7a07(0x8f)],'data':_0xbd4093};}};
@@ -1 +1 @@
1
- const a228_0x45397a=a228_0x2953;(function(_0x2412d6,_0x1adb93){const _0x46e90d=a228_0x2953,_0x8a2b82=_0x2412d6();while(!![]){try{const _0x1c2d58=-parseInt(_0x46e90d(0x78))/0x1+-parseInt(_0x46e90d(0x7b))/0x2*(-parseInt(_0x46e90d(0x83))/0x3)+-parseInt(_0x46e90d(0x6a))/0x4+parseInt(_0x46e90d(0x6b))/0x5+-parseInt(_0x46e90d(0x95))/0x6*(parseInt(_0x46e90d(0x84))/0x7)+parseInt(_0x46e90d(0x79))/0x8+parseInt(_0x46e90d(0x6f))/0x9;if(_0x1c2d58===_0x1adb93)break;else _0x8a2b82['push'](_0x8a2b82['shift']());}catch(_0x28e362){_0x8a2b82['push'](_0x8a2b82['shift']());}}}(a228_0x7215,0x98066));function a228_0x2953(_0x53f48d,_0x22d834){_0x53f48d=_0x53f48d-0x67;const _0x7215da=a228_0x7215();let _0x29533c=_0x7215da[_0x53f48d];return _0x29533c;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{analyseProjectUpgrade,upgradeApp}from'../../commands/project/upgrade.js';import{projectDomainRoutingSyncDefinition}from'../../commands/project/domain-routing-sync.js';const createFlags=[{'name':'name','type':a228_0x45397a(0x73),'description':a228_0x45397a(0x7e)},{'name':'env','type':a228_0x45397a(0x73),'description':a228_0x45397a(0x88)},{'name':'appcode','type':'string','description':a228_0x45397a(0x90)},{'name':a228_0x45397a(0x8b),'type':a228_0x45397a(0x76),'description':a228_0x45397a(0x92),'default':![]},{'name':'template-source','type':'string','description':a228_0x45397a(0x75)}],upgradeFlags=[{'name':'yes','type':a228_0x45397a(0x76),'description':a228_0x45397a(0x70),'default':![]}];function a228_0x7215(){const _0x45a645=['Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Usage:\x20','trim','4766312iNXpfN','2457545aJTwvh','Create\x20a\x20new\x20project','Run\x20','project-name','16642800ltUsFF','Skip\x20confirmation\x20prompt','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]\x20from\x20the\x20empty\x20target\x20directory.','template-source','string','cwd','Prepared\x20local\x20project\x20template\x20directory','boolean','appcode','1211121OVTIHl','3497800VEFQRx','validation','2302754KWxMww','project','Would\x20upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure\x20without\x20overwriting\x20project-owned\x20entrypoints','Project\x20name','nonInteractive','yes','cancelled','bool','3vxTYPE','26698dNZIgZ','write','cookie','args','Target\x20environment','completed','../../commands/project/create/main.js','current-dir','PATCH','--current-dir\x20cannot\x20be\x20combined\x20with\x20a\x20project\x20name.','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','str','Initialize\x20the\x20current\x20empty\x20directory\x20instead\x20of\x20creating\x20a\x20child\x20directory','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]\x20or\x20','env','1422cSxyhg'];a228_0x7215=function(){return _0x45a645;};return a228_0x7215();}export const projectDefinitions=[{'service':a228_0x45397a(0x7c),'command':'create','description':a228_0x45397a(0x6c),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a228_0x45397a(0x6e),'description':a228_0x45397a(0x8f),'required':![]}],'flags':createFlags,async 'execute'(_0x18640e){const _0xbac311=a228_0x45397a,{createApp:_0x3b0d6f}=await import(_0xbac311(0x8a)),_0x3d52f2=_0x18640e[_0xbac311(0x91)]('name')[_0xbac311(0x69)]()||_0x18640e[_0xbac311(0x87)][0x0]?.[_0xbac311(0x69)](),_0x8bc4=_0x18640e[_0xbac311(0x91)](_0xbac311(0x94))||undefined,_0x46a057=_0x18640e[_0xbac311(0x91)](_0xbac311(0x77))||undefined,_0x11744e=_0x18640e[_0xbac311(0x91)](_0xbac311(0x72))[_0xbac311(0x69)]()||undefined,_0x1c5d3a=_0x18640e[_0xbac311(0x82)](_0xbac311(0x8b));if(_0x1c5d3a&&_0x3d52f2)throw CliErrors[_0xbac311(0x7a)](_0xbac311(0x8d),_0xbac311(0x6d)+CLI_BIN_NAME+_0xbac311(0x71));if(_0x18640e['nonInteractive']){if(!_0x3d52f2&&!_0x1c5d3a)throw CliErrors[_0xbac311(0x7a)](_0xbac311(0x67),_0xbac311(0x68)+CLI_BIN_NAME+_0xbac311(0x93)+CLI_BIN_NAME+_0xbac311(0x8e));await _0x3b0d6f({'projectCode':_0x3d52f2,'appCode':_0x46a057,'env':_0x8bc4,'cookie':_0x18640e['cookie'],'currentDir':_0x1c5d3a,'nonInteractive':!![],'templateSource':_0x11744e});}else await _0x3b0d6f({'projectCode':_0x3d52f2,'appCode':_0x46a057,'env':_0x8bc4,'cookie':_0x18640e[_0xbac311(0x86)],'currentDir':_0x1c5d3a,'templateSource':_0x11744e});return{'ok':!![]};}},projectDomainRoutingSyncDefinition,{'service':'project','command':'upgrade','description':'Upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure','risk':a228_0x45397a(0x85),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'dryRun'(){const _0x338b22=a228_0x45397a,_0x25f83d=analyseProjectUpgrade(process['cwd']());return{'method':_0x338b22(0x8c),'url':process[_0x338b22(0x74)](),'body':_0x25f83d,'description':_0x338b22(0x7d)};},async 'execute'(_0x48207d){const _0x4a5363=a228_0x45397a,_0x581bc5=await upgradeApp(_0x48207d[_0x4a5363(0x7f)],{'yes':_0x48207d[_0x4a5363(0x82)](_0x4a5363(0x80))});return{'ok':_0x581bc5[_0x4a5363(0x89)]||_0x581bc5['cancelled']===!![],'message':_0x581bc5[_0x4a5363(0x81)]?'Upgrade\x20cancelled.':_0x581bc5[_0x4a5363(0x89)]?'Project\x20upgrade\x20completed.':'Project\x20upgrade\x20completed\x20with\x20follow-up\x20work.','data':_0x581bc5};}}];
1
+ const a228_0x5c0251=a228_0x194f;(function(_0x552a19,_0x558f03){const _0x2b6c75=a228_0x194f,_0x5285f7=_0x552a19();while(!![]){try{const _0xbff46f=parseInt(_0x2b6c75(0x171))/0x1+parseInt(_0x2b6c75(0x198))/0x2*(-parseInt(_0x2b6c75(0x186))/0x3)+parseInt(_0x2b6c75(0x17f))/0x4+parseInt(_0x2b6c75(0x187))/0x5+-parseInt(_0x2b6c75(0x16e))/0x6+-parseInt(_0x2b6c75(0x193))/0x7+-parseInt(_0x2b6c75(0x190))/0x8*(-parseInt(_0x2b6c75(0x16b))/0x9);if(_0xbff46f===_0x558f03)break;else _0x5285f7['push'](_0x5285f7['shift']());}catch(_0x54dbb0){_0x5285f7['push'](_0x5285f7['shift']());}}}(a228_0x1f9d,0x645bc));function a228_0x1f9d(){const _0xf7e723=['521300hQmdhW','write','Upgrade\x20cancelled.','create','nonInteractive','Would\x20upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure\x20without\x20overwriting\x20project-owned\x20entrypoints','yes','3GmrEre','1693780GXoMyX','cwd','str','Initialize\x20the\x20current\x20empty\x20directory\x20instead\x20of\x20creating\x20a\x20child\x20directory','Project\x20name','Skip\x20confirmation\x20prompt','bool','Run\x20','completed','7738392KhILOD','project','Project\x20upgrade\x20completed\x20with\x20follow-up\x20work.','1931363pSFjLC','Usage:\x20','../../commands/project/create/main.js','project-name','validation','1376930lDSvAa','cookie','boolean','Project\x20upgrade\x20completed.','9iPXvbt','PATCH','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','1545768gtLUEL','string','args','196690IZXPly','Create\x20a\x20new\x20project','name','trim','env','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','appcode','Prepared\x20local\x20project\x20template\x20directory','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]\x20or\x20','cancelled','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]\x20from\x20the\x20empty\x20target\x20directory.','current-dir','Upgrade\x20project\x20dependencies\x20and\x20application\x20source\x20structure','template-source'];a228_0x1f9d=function(){return _0xf7e723;};return a228_0x1f9d();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{analyseProjectUpgrade,upgradeApp}from'../../commands/project/upgrade.js';import{projectDomainRoutingSyncDefinition}from'../../commands/project/domain-routing-sync.js';function a228_0x194f(_0x1555eb,_0x61f757){_0x1555eb=_0x1555eb-0x169;const _0x1f9db2=a228_0x1f9d();let _0x194f49=_0x1f9db2[_0x1555eb];return _0x194f49;}const createFlags=[{'name':a228_0x5c0251(0x173),'type':a228_0x5c0251(0x16f),'description':a228_0x5c0251(0x18b)},{'name':a228_0x5c0251(0x175),'type':a228_0x5c0251(0x16f),'description':'Target\x20environment'},{'name':a228_0x5c0251(0x177),'type':a228_0x5c0251(0x16f),'description':a228_0x5c0251(0x16d)},{'name':'current-dir','type':a228_0x5c0251(0x169),'description':a228_0x5c0251(0x18a),'default':![]},{'name':a228_0x5c0251(0x17e),'type':a228_0x5c0251(0x16f),'description':a228_0x5c0251(0x178)}],upgradeFlags=[{'name':a228_0x5c0251(0x185),'type':'boolean','description':a228_0x5c0251(0x18c),'default':![]}];export const projectDefinitions=[{'service':a228_0x5c0251(0x191),'command':a228_0x5c0251(0x182),'description':a228_0x5c0251(0x172),'risk':a228_0x5c0251(0x180),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a228_0x5c0251(0x196),'description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x1e748a){const _0x39fa1a=a228_0x5c0251,{createApp:_0x4f7744}=await import(_0x39fa1a(0x195)),_0x16aa36=_0x1e748a[_0x39fa1a(0x189)](_0x39fa1a(0x173))[_0x39fa1a(0x174)]()||_0x1e748a[_0x39fa1a(0x170)][0x0]?.[_0x39fa1a(0x174)](),_0x378122=_0x1e748a[_0x39fa1a(0x189)](_0x39fa1a(0x175))||undefined,_0x4c0177=_0x1e748a[_0x39fa1a(0x189)](_0x39fa1a(0x177))||undefined,_0x4158fd=_0x1e748a[_0x39fa1a(0x189)]('template-source')['trim']()||undefined,_0x501905=_0x1e748a[_0x39fa1a(0x18d)](_0x39fa1a(0x17c));if(_0x501905&&_0x16aa36)throw CliErrors[_0x39fa1a(0x197)]('--current-dir\x20cannot\x20be\x20combined\x20with\x20a\x20project\x20name.',_0x39fa1a(0x18e)+CLI_BIN_NAME+_0x39fa1a(0x17b));if(_0x1e748a[_0x39fa1a(0x183)]){if(!_0x16aa36&&!_0x501905)throw CliErrors[_0x39fa1a(0x197)](_0x39fa1a(0x176),_0x39fa1a(0x194)+CLI_BIN_NAME+_0x39fa1a(0x179)+CLI_BIN_NAME+'\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]');await _0x4f7744({'projectCode':_0x16aa36,'appCode':_0x4c0177,'env':_0x378122,'cookie':_0x1e748a[_0x39fa1a(0x199)],'currentDir':_0x501905,'nonInteractive':!![],'templateSource':_0x4158fd});}else await _0x4f7744({'projectCode':_0x16aa36,'appCode':_0x4c0177,'env':_0x378122,'cookie':_0x1e748a[_0x39fa1a(0x199)],'currentDir':_0x501905,'templateSource':_0x4158fd});return{'ok':!![]};}},projectDomainRoutingSyncDefinition,{'service':a228_0x5c0251(0x191),'command':'upgrade','description':a228_0x5c0251(0x17d),'risk':a228_0x5c0251(0x180),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'dryRun'(){const _0x2ad6e1=a228_0x5c0251,_0x62c45b=analyseProjectUpgrade(process[_0x2ad6e1(0x188)]());return{'method':_0x2ad6e1(0x16c),'url':process[_0x2ad6e1(0x188)](),'body':_0x62c45b,'description':_0x2ad6e1(0x184)};},async 'execute'(_0x27f9ad){const _0x1e3773=a228_0x5c0251,_0x2ee84b=await upgradeApp(_0x27f9ad[_0x1e3773(0x183)],{'yes':_0x27f9ad[_0x1e3773(0x18d)](_0x1e3773(0x185))});return{'ok':_0x2ee84b[_0x1e3773(0x18f)]||_0x2ee84b[_0x1e3773(0x17a)]===!![],'message':_0x2ee84b[_0x1e3773(0x17a)]?_0x1e3773(0x181):_0x2ee84b['completed']?_0x1e3773(0x16a):_0x1e3773(0x192),'data':_0x2ee84b};}}];