@lovrabet/rabetbase-cli 2.3.16-beta.4 → 2.3.16-beta.6

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 (560) hide show
  1. package/lib/api/api-doc.d.ts +9 -0
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.d.ts +2 -0
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.d.ts +8 -0
  6. package/lib/api/generate-api-file.js +1 -1
  7. package/lib/auth/auth-server-ui.d.ts +13 -0
  8. package/lib/auth/auth-server-ui.js +1 -1
  9. package/lib/auth/auth-server.d.ts +25 -0
  10. package/lib/auth/auth-server.js +1 -1
  11. package/lib/auth/constant.d.ts +2 -0
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.d.ts +1 -0
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.d.ts +51 -0
  16. package/lib/auth/get-session-user.js +1 -1
  17. package/lib/auth/is-session-valid.d.ts +1 -0
  18. package/lib/auth/is-session-valid.js +1 -1
  19. package/lib/auth/login-success-html.d.ts +5 -0
  20. package/lib/auth/login-success-html.js +1 -1
  21. package/lib/auth/logout.d.ts +1 -0
  22. package/lib/auth/logout.js +1 -1
  23. package/lib/cli-flags.d.ts +12 -0
  24. package/lib/cli-flags.js +1 -1
  25. package/lib/cli.d.ts +2 -0
  26. package/lib/cli.js +1 -1
  27. package/lib/commands/api/generate.d.ts +2 -0
  28. package/lib/commands/api/generate.js +1 -1
  29. package/lib/commands/api/index.d.ts +2 -0
  30. package/lib/commands/api/index.js +1 -1
  31. package/lib/commands/api/list.d.ts +2 -0
  32. package/lib/commands/api/list.js +1 -1
  33. package/lib/commands/api/pull.d.ts +2 -0
  34. package/lib/commands/api/pull.js +1 -1
  35. package/lib/commands/api/shared.d.ts +18 -0
  36. package/lib/commands/api/shared.js +1 -1
  37. package/lib/commands/app/index.d.ts +5 -0
  38. package/lib/commands/app/index.js +1 -1
  39. package/lib/commands/app/list.d.ts +10 -0
  40. package/lib/commands/app/list.js +1 -1
  41. package/lib/commands/app/members-list.d.ts +2 -0
  42. package/lib/commands/app/members-list.js +1 -1
  43. package/lib/commands/app/remote-directory.d.ts +11 -0
  44. package/lib/commands/app/remote-directory.js +1 -1
  45. package/lib/commands/app/shared.d.ts +46 -0
  46. package/lib/commands/app/shared.js +1 -1
  47. package/lib/commands/app-config/delete.d.ts +2 -0
  48. package/lib/commands/app-config/delete.js +1 -1
  49. package/lib/commands/app-config/get.d.ts +2 -0
  50. package/lib/commands/app-config/get.js +1 -1
  51. package/lib/commands/app-config/index.d.ts +2 -0
  52. package/lib/commands/app-config/index.js +1 -1
  53. package/lib/commands/app-config/list.d.ts +2 -0
  54. package/lib/commands/app-config/list.js +1 -1
  55. package/lib/commands/app-config/set.d.ts +2 -0
  56. package/lib/commands/app-config/set.js +1 -1
  57. package/lib/commands/app-config/shared.d.ts +105 -0
  58. package/lib/commands/app-config/shared.js +1 -1
  59. package/lib/commands/auth/index.d.ts +2 -0
  60. package/lib/commands/auth/index.js +1 -1
  61. package/lib/commands/bff/create.d.ts +4 -0
  62. package/lib/commands/bff/create.js +1 -1
  63. package/lib/commands/bff/delete.d.ts +2 -0
  64. package/lib/commands/bff/delete.js +1 -1
  65. package/lib/commands/bff/detail.d.ts +2 -0
  66. package/lib/commands/bff/detail.js +1 -1
  67. package/lib/commands/bff/index.d.ts +5 -0
  68. package/lib/commands/bff/index.js +1 -1
  69. package/lib/commands/bff/list.d.ts +2 -0
  70. package/lib/commands/bff/list.js +1 -1
  71. package/lib/commands/bff/pull.d.ts +2 -0
  72. package/lib/commands/bff/pull.js +1 -1
  73. package/lib/commands/bff/push.d.ts +2 -0
  74. package/lib/commands/bff/push.js +1 -1
  75. package/lib/commands/bff/status.d.ts +2 -0
  76. package/lib/commands/bff/status.js +1 -1
  77. package/lib/commands/cli-skill/index.d.ts +8 -0
  78. package/lib/commands/cli-skill/index.js +1 -1
  79. package/lib/commands/cli-update.d.ts +2 -0
  80. package/lib/commands/cli-update.js +1 -1
  81. package/lib/commands/codegen/index.d.ts +2 -0
  82. package/lib/commands/codegen/index.js +1 -1
  83. package/lib/commands/codegen/sdk.d.ts +2 -0
  84. package/lib/commands/codegen/sdk.js +1 -1
  85. package/lib/commands/codegen/sql.d.ts +2 -0
  86. package/lib/commands/codegen/sql.js +1 -1
  87. package/lib/commands/common/app-registry.d.ts +17 -0
  88. package/lib/commands/common/app-registry.js +1 -1
  89. package/lib/commands/common/app-selector.d.ts +17 -0
  90. package/lib/commands/common/app-selector.js +1 -1
  91. package/lib/commands/common/async-task.d.ts +11 -0
  92. package/lib/commands/common/async-task.js +1 -1
  93. package/lib/commands/common/dry-run.d.ts +12 -0
  94. package/lib/commands/common/dry-run.js +1 -1
  95. package/lib/commands/common/flags.d.ts +26 -0
  96. package/lib/commands/common/flags.js +1 -1
  97. package/lib/commands/common/local-file.d.ts +6 -0
  98. package/lib/commands/common/local-file.js +1 -1
  99. package/lib/commands/common/validate.d.ts +13 -0
  100. package/lib/commands/common/validate.js +1 -1
  101. package/lib/commands/config/get.d.ts +5 -0
  102. package/lib/commands/config/get.js +1 -1
  103. package/lib/commands/config/index.d.ts +5 -0
  104. package/lib/commands/config/index.js +1 -1
  105. package/lib/commands/config/list.d.ts +5 -0
  106. package/lib/commands/config/list.js +1 -1
  107. package/lib/commands/config/set.d.ts +5 -0
  108. package/lib/commands/config/set.js +1 -1
  109. package/lib/commands/config/shared.d.ts +16 -0
  110. package/lib/commands/config/shared.js +1 -1
  111. package/lib/commands/data/filter.d.ts +7 -0
  112. package/lib/commands/data/filter.js +1 -1
  113. package/lib/commands/data/getOne.d.ts +7 -0
  114. package/lib/commands/data/getOne.js +1 -1
  115. package/lib/commands/data/index.d.ts +8 -0
  116. package/lib/commands/data/index.js +1 -1
  117. package/lib/commands/data/shared.d.ts +33 -0
  118. package/lib/commands/data/shared.js +1 -1
  119. package/lib/commands/dataset/business-group-update.d.ts +18 -0
  120. package/lib/commands/dataset/business-group-update.js +1 -1
  121. package/lib/commands/dataset/capability.d.ts +11 -0
  122. package/lib/commands/dataset/capability.js +1 -1
  123. package/lib/commands/dataset/delete.d.ts +2 -0
  124. package/lib/commands/dataset/delete.js +1 -1
  125. package/lib/commands/dataset/detail.d.ts +2 -0
  126. package/lib/commands/dataset/detail.js +1 -1
  127. package/lib/commands/dataset/extend-update.d.ts +26 -0
  128. package/lib/commands/dataset/extend-update.js +1 -1
  129. package/lib/commands/dataset/field-update.d.ts +27 -0
  130. package/lib/commands/dataset/field-update.js +1 -1
  131. package/lib/commands/dataset/generate.d.ts +3 -0
  132. package/lib/commands/dataset/generate.js +1 -1
  133. package/lib/commands/dataset/index.d.ts +2 -0
  134. package/lib/commands/dataset/index.js +1 -1
  135. package/lib/commands/dataset/list.d.ts +2 -0
  136. package/lib/commands/dataset/list.js +1 -1
  137. package/lib/commands/dataset/operations.d.ts +2 -0
  138. package/lib/commands/dataset/operations.js +1 -1
  139. package/lib/commands/dataset/relation-audit.d.ts +2 -0
  140. package/lib/commands/dataset/relation-audit.js +1 -1
  141. package/lib/commands/dataset/relation-create.d.ts +2 -0
  142. package/lib/commands/dataset/relation-create.js +1 -1
  143. package/lib/commands/dataset/relation-delete.d.ts +2 -0
  144. package/lib/commands/dataset/relation-delete.js +1 -1
  145. package/lib/commands/dataset/relation-shared.d.ts +128 -0
  146. package/lib/commands/dataset/relation-shared.js +1 -1
  147. package/lib/commands/dataset/relation-update.d.ts +2 -0
  148. package/lib/commands/dataset/relation-update.js +1 -1
  149. package/lib/commands/dataset/relations.d.ts +53 -0
  150. package/lib/commands/dataset/relations.js +1 -1
  151. package/lib/commands/dataset/rename.d.ts +17 -0
  152. package/lib/commands/dataset/rename.js +1 -1
  153. package/lib/commands/dataset/restore.d.ts +2 -0
  154. package/lib/commands/dataset/restore.js +1 -1
  155. package/lib/commands/db/analysis-batching.d.ts +30 -0
  156. package/lib/commands/db/analysis-batching.js +1 -1
  157. package/lib/commands/db/analyze-batch-plan.d.ts +2 -0
  158. package/lib/commands/db/analyze-batch-plan.js +1 -1
  159. package/lib/commands/db/analyze-cancel.d.ts +2 -0
  160. package/lib/commands/db/analyze-cancel.js +1 -1
  161. package/lib/commands/db/analyze-start.d.ts +2 -0
  162. package/lib/commands/db/analyze-start.js +1 -1
  163. package/lib/commands/db/analyze-status.d.ts +2 -0
  164. package/lib/commands/db/analyze-status.js +1 -1
  165. package/lib/commands/db/create.d.ts +2 -0
  166. package/lib/commands/db/create.js +1 -1
  167. package/lib/commands/db/delete.d.ts +2 -0
  168. package/lib/commands/db/delete.js +1 -1
  169. package/lib/commands/db/detail.d.ts +2 -0
  170. package/lib/commands/db/detail.js +1 -1
  171. package/lib/commands/db/diff.d.ts +2 -0
  172. package/lib/commands/db/diff.js +1 -1
  173. package/lib/commands/db/index.d.ts +5 -0
  174. package/lib/commands/db/index.js +1 -1
  175. package/lib/commands/db/list.d.ts +2 -0
  176. package/lib/commands/db/list.js +1 -1
  177. package/lib/commands/db/shared.d.ts +15 -0
  178. package/lib/commands/db/shared.js +1 -1
  179. package/lib/commands/db/tables.d.ts +2 -0
  180. package/lib/commands/db/tables.js +1 -1
  181. package/lib/commands/db/test.d.ts +2 -0
  182. package/lib/commands/db/test.js +1 -1
  183. package/lib/commands/db/update.d.ts +2 -0
  184. package/lib/commands/db/update.js +1 -1
  185. package/lib/commands/doctor.d.ts +2 -0
  186. package/lib/commands/doctor.js +1 -1
  187. package/lib/commands/file/index.d.ts +2 -0
  188. package/lib/commands/file/index.js +1 -1
  189. package/lib/commands/init/index.d.ts +11 -0
  190. package/lib/commands/init/index.js +1 -1
  191. package/lib/commands/issue/index.d.ts +2 -0
  192. package/lib/commands/issue/index.js +1 -1
  193. package/lib/commands/issue/nudge.d.ts +23 -0
  194. package/lib/commands/issue/nudge.js +1 -1
  195. package/lib/commands/issue/report.d.ts +2 -0
  196. package/lib/commands/issue/report.js +1 -1
  197. package/lib/commands/issue/shared.d.ts +32 -0
  198. package/lib/commands/issue/shared.js +1 -1
  199. package/lib/commands/kb/create.d.ts +2 -0
  200. package/lib/commands/kb/create.js +1 -1
  201. package/lib/commands/kb/delete.d.ts +2 -0
  202. package/lib/commands/kb/delete.js +1 -1
  203. package/lib/commands/kb/detail.d.ts +2 -0
  204. package/lib/commands/kb/detail.js +1 -1
  205. package/lib/commands/kb/index.d.ts +2 -0
  206. package/lib/commands/kb/index.js +1 -1
  207. package/lib/commands/kb/list.d.ts +2 -0
  208. package/lib/commands/kb/list.js +1 -1
  209. package/lib/commands/kb/shared.d.ts +33 -0
  210. package/lib/commands/kb/shared.js +1 -1
  211. package/lib/commands/kb/update.d.ts +2 -0
  212. package/lib/commands/kb/update.js +1 -1
  213. package/lib/commands/logs/index.d.ts +5 -0
  214. package/lib/commands/logs/index.js +1 -1
  215. package/lib/commands/menu/asset-update.d.ts +2 -0
  216. package/lib/commands/menu/asset-update.js +1 -1
  217. package/lib/commands/menu/delete.d.ts +2 -0
  218. package/lib/commands/menu/delete.js +1 -1
  219. package/lib/commands/menu/external-link-create.d.ts +3 -0
  220. package/lib/commands/menu/external-link-create.js +1 -1
  221. package/lib/commands/menu/external-link-update.d.ts +2 -0
  222. package/lib/commands/menu/external-link-update.js +1 -1
  223. package/lib/commands/menu/group-create.d.ts +2 -0
  224. package/lib/commands/menu/group-create.js +1 -1
  225. package/lib/commands/menu/group-update.d.ts +2 -0
  226. package/lib/commands/menu/group-update.js +1 -1
  227. package/lib/commands/menu/index.d.ts +17 -0
  228. package/lib/commands/menu/index.js +1 -1
  229. package/lib/commands/menu/list.d.ts +2 -0
  230. package/lib/commands/menu/list.js +1 -1
  231. package/lib/commands/menu/move.d.ts +2 -0
  232. package/lib/commands/menu/move.js +1 -1
  233. package/lib/commands/menu/regroup-start.d.ts +2 -0
  234. package/lib/commands/menu/regroup-start.js +1 -1
  235. package/lib/commands/menu/rename.d.ts +2 -0
  236. package/lib/commands/menu/rename.js +1 -1
  237. package/lib/commands/menu/shared/compare-table.d.ts +27 -0
  238. package/lib/commands/menu/shared/compare-table.js +1 -1
  239. package/lib/commands/menu/shared/delete-plan.d.ts +51 -0
  240. package/lib/commands/menu/shared/delete-plan.js +1 -1
  241. package/lib/commands/menu/shared/facts.d.ts +12 -0
  242. package/lib/commands/menu/shared/facts.js +1 -1
  243. package/lib/commands/menu/shared/index.d.ts +12 -0
  244. package/lib/commands/menu/shared/index.js +1 -1
  245. package/lib/commands/menu/shared/inquirer.d.ts +10 -0
  246. package/lib/commands/menu/shared/inquirer.js +1 -1
  247. package/lib/commands/menu/shared/local-pages.d.ts +12 -0
  248. package/lib/commands/menu/shared/local-pages.js +1 -1
  249. package/lib/commands/menu/shared/logic.d.ts +28 -0
  250. package/lib/commands/menu/shared/logic.js +1 -1
  251. package/lib/commands/menu/shared/mutations.d.ts +69 -0
  252. package/lib/commands/menu/shared/mutations.js +1 -1
  253. package/lib/commands/menu/shared/service.d.ts +17 -0
  254. package/lib/commands/menu/shared/service.js +1 -1
  255. package/lib/commands/menu/shared/sync-core.d.ts +7 -0
  256. package/lib/commands/menu/shared/sync-core.js +1 -1
  257. package/lib/commands/menu/shared/types.d.ts +162 -0
  258. package/lib/commands/menu/shared/update-core.d.ts +11 -0
  259. package/lib/commands/menu/shared/update-core.js +1 -1
  260. package/lib/commands/menu/shared/valid-url.d.ts +6 -0
  261. package/lib/commands/menu/shared/valid-url.js +1 -1
  262. package/lib/commands/menu/sync.d.ts +2 -0
  263. package/lib/commands/menu/sync.js +1 -1
  264. package/lib/commands/notification/config-list.d.ts +2 -0
  265. package/lib/commands/notification/config-list.js +1 -1
  266. package/lib/commands/notification/index.d.ts +2 -0
  267. package/lib/commands/notification/index.js +1 -1
  268. package/lib/commands/ocr/index.d.ts +2 -0
  269. package/lib/commands/ocr/index.js +1 -1
  270. package/lib/commands/page/generate-start.d.ts +2 -0
  271. package/lib/commands/page/generate-start.js +1 -1
  272. package/lib/commands/page/generate-status.d.ts +2 -0
  273. package/lib/commands/page/generate-status.js +1 -1
  274. package/lib/commands/page/index.d.ts +2 -0
  275. package/lib/commands/page/index.js +1 -1
  276. package/lib/commands/page/pull.d.ts +2 -0
  277. package/lib/commands/page/pull.js +1 -1
  278. package/lib/commands/page/push.d.ts +2 -0
  279. package/lib/commands/page/push.js +1 -1
  280. package/lib/commands/page/relation-audit.d.ts +2 -0
  281. package/lib/commands/page/relation-audit.js +1 -1
  282. package/lib/commands/page/restore.d.ts +2 -0
  283. package/lib/commands/page/restore.js +1 -1
  284. package/lib/commands/page/shared.d.ts +105 -0
  285. package/lib/commands/page/shared.js +1 -1
  286. package/lib/commands/page/standard-page-status.d.ts +2 -0
  287. package/lib/commands/page/standard-page-status.js +1 -1
  288. package/lib/commands/page/sync.d.ts +2 -0
  289. package/lib/commands/page/sync.js +1 -1
  290. package/lib/commands/permit/index.d.ts +2 -0
  291. package/lib/commands/permit/index.js +1 -1
  292. package/lib/commands/permit/page-get.d.ts +2 -0
  293. package/lib/commands/permit/page-get.js +1 -1
  294. package/lib/commands/permit/page-set.d.ts +2 -0
  295. package/lib/commands/permit/page-set.js +1 -1
  296. package/lib/commands/permit/role-apis-set.d.ts +2 -0
  297. package/lib/commands/permit/role-apis-set.js +1 -1
  298. package/lib/commands/permit/role-menus-set.d.ts +2 -0
  299. package/lib/commands/permit/role-menus-set.js +1 -1
  300. package/lib/commands/permit/role-menus.d.ts +2 -0
  301. package/lib/commands/permit/role-menus.js +1 -1
  302. package/lib/commands/permit/shared.d.ts +74 -0
  303. package/lib/commands/permit/shared.js +1 -1
  304. package/lib/commands/project/create/enhanced-guided-create.d.ts +7 -0
  305. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  306. package/lib/commands/project/create/format-elapsed.d.ts +1 -0
  307. package/lib/commands/project/create/format-elapsed.js +1 -1
  308. package/lib/commands/project/create/main.d.ts +6 -0
  309. package/lib/commands/project/create/main.js +1 -1
  310. package/lib/commands/project/create/non-interactive.d.ts +9 -0
  311. package/lib/commands/project/create/non-interactive.js +1 -1
  312. package/lib/commands/project/create/project-template-path.d.ts +4 -0
  313. package/lib/commands/project/create/project-template-path.js +1 -1
  314. package/lib/commands/project/create/use-copy-project-template.d.ts +1 -0
  315. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  316. package/lib/commands/project/create/use-format-code.d.ts +1 -0
  317. package/lib/commands/project/create/use-format-code.js +1 -1
  318. package/lib/commands/project/create/use-install-dependencies.d.ts +1 -0
  319. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  320. package/lib/commands/project/index.d.ts +2 -0
  321. package/lib/commands/project/index.js +1 -1
  322. package/lib/commands/project/upgrade.d.ts +1 -0
  323. package/lib/commands/project/upgrade.js +1 -1
  324. package/lib/commands/registry.d.ts +66 -0
  325. package/lib/commands/registry.js +1 -1
  326. package/lib/commands/role/create.d.ts +2 -0
  327. package/lib/commands/role/create.js +1 -1
  328. package/lib/commands/role/delete.d.ts +2 -0
  329. package/lib/commands/role/delete.js +1 -1
  330. package/lib/commands/role/detail.d.ts +2 -0
  331. package/lib/commands/role/detail.js +1 -1
  332. package/lib/commands/role/index.d.ts +2 -0
  333. package/lib/commands/role/index.js +1 -1
  334. package/lib/commands/role/list.d.ts +2 -0
  335. package/lib/commands/role/list.js +1 -1
  336. package/lib/commands/role/shared.d.ts +107 -0
  337. package/lib/commands/role/shared.js +1 -1
  338. package/lib/commands/role/update.d.ts +2 -0
  339. package/lib/commands/role/update.js +1 -1
  340. package/lib/commands/role/user-add.d.ts +2 -0
  341. package/lib/commands/role/user-add.js +1 -1
  342. package/lib/commands/role/user-remove.d.ts +2 -0
  343. package/lib/commands/role/user-remove.js +1 -1
  344. package/lib/commands/role/user-resolve.d.ts +2 -0
  345. package/lib/commands/role/user-resolve.js +1 -1
  346. package/lib/commands/run/index.d.ts +2 -0
  347. package/lib/commands/run/index.js +1 -1
  348. package/lib/commands/schema.d.ts +5 -0
  349. package/lib/commands/schema.js +1 -1
  350. package/lib/commands/sql/create.d.ts +10 -0
  351. package/lib/commands/sql/create.js +1 -1
  352. package/lib/commands/sql/delete.d.ts +5 -0
  353. package/lib/commands/sql/delete.js +1 -1
  354. package/lib/commands/sql/detail.d.ts +2 -0
  355. package/lib/commands/sql/detail.js +1 -1
  356. package/lib/commands/sql/exec.d.ts +2 -0
  357. package/lib/commands/sql/exec.js +1 -1
  358. package/lib/commands/sql/index.d.ts +5 -0
  359. package/lib/commands/sql/index.js +1 -1
  360. package/lib/commands/sql/list.d.ts +2 -0
  361. package/lib/commands/sql/list.js +1 -1
  362. package/lib/commands/sql/pull.d.ts +5 -0
  363. package/lib/commands/sql/pull.js +1 -1
  364. package/lib/commands/sql/push.d.ts +5 -0
  365. package/lib/commands/sql/push.js +1 -1
  366. package/lib/commands/sql/shared.d.ts +23 -0
  367. package/lib/commands/sql/shared.js +1 -1
  368. package/lib/commands/sql/status.d.ts +5 -0
  369. package/lib/commands/sql/status.js +1 -1
  370. package/lib/commands/sql/validate.d.ts +2 -0
  371. package/lib/commands/sql/validate.js +1 -1
  372. package/lib/commands/task/index.d.ts +2 -0
  373. package/lib/commands/task/index.js +1 -1
  374. package/lib/commands/task/status.d.ts +2 -0
  375. package/lib/commands/task/status.js +1 -1
  376. package/lib/commands/tenant/index.d.ts +2 -0
  377. package/lib/commands/tenant/index.js +1 -1
  378. package/lib/commands/tenant/members-list.d.ts +2 -0
  379. package/lib/commands/tenant/members-list.js +1 -1
  380. package/lib/commands/tenant/shared.d.ts +10 -0
  381. package/lib/commands/tenant/shared.js +1 -1
  382. package/lib/commands/workspace/add.d.ts +6 -0
  383. package/lib/commands/workspace/add.js +1 -1
  384. package/lib/commands/workspace/index.d.ts +11 -0
  385. package/lib/commands/workspace/index.js +1 -1
  386. package/lib/commands/workspace/remove.d.ts +6 -0
  387. package/lib/commands/workspace/remove.js +1 -1
  388. package/lib/config/schema.d.ts +50 -0
  389. package/lib/config/schema.js +1 -1
  390. package/lib/constant/cdn.d.ts +1 -0
  391. package/lib/constant/cdn.js +1 -1
  392. package/lib/constant/cli.d.ts +34 -0
  393. package/lib/constant/cli.js +1 -1
  394. package/lib/constant/defaults.d.ts +10 -0
  395. package/lib/constant/defaults.js +1 -1
  396. package/lib/constant/domain.d.ts +14 -0
  397. package/lib/constant/domain.js +1 -1
  398. package/lib/constant/env.d.ts +11 -0
  399. package/lib/constant/env.js +1 -1
  400. package/lib/constant/output.d.ts +1 -0
  401. package/lib/constant/output.js +1 -1
  402. package/lib/constant/paths.d.ts +5 -0
  403. package/lib/constant/paths.js +1 -1
  404. package/lib/constant/risk.d.ts +1 -0
  405. package/lib/constant/risk.js +1 -1
  406. package/lib/context/app-resolver.d.ts +36 -0
  407. package/lib/context/app-resolver.js +1 -1
  408. package/lib/context/auth-resolver.d.ts +5 -0
  409. package/lib/context/auth-resolver.js +1 -1
  410. package/lib/context/config-loader.d.ts +61 -0
  411. package/lib/context/config-loader.js +1 -1
  412. package/lib/context.d.ts +102 -0
  413. package/lib/context.js +1 -1
  414. package/lib/core/alias-resolver.d.ts +31 -0
  415. package/lib/core/alias-resolver.js +1 -1
  416. package/lib/core/api-client.d.ts +1018 -0
  417. package/lib/core/api-client.js +1 -1
  418. package/lib/core/bff/config.d.ts +8 -0
  419. package/lib/core/bff/config.js +1 -1
  420. package/lib/core/bff/file-system.d.ts +28 -0
  421. package/lib/core/bff/file-system.js +1 -1
  422. package/lib/core/bff/hash.d.ts +7 -0
  423. package/lib/core/bff/hash.js +1 -1
  424. package/lib/core/bff/lock.d.ts +25 -0
  425. package/lib/core/bff/lock.js +1 -1
  426. package/lib/core/bff/types.d.ts +92 -0
  427. package/lib/core/bff/utils.d.ts +25 -0
  428. package/lib/core/bff/utils.js +1 -1
  429. package/lib/core/db-resolver.d.ts +43 -0
  430. package/lib/core/db-resolver.js +1 -1
  431. package/lib/core/page/file-system.d.ts +6 -0
  432. package/lib/core/page/file-system.js +1 -1
  433. package/lib/core/page/hash.d.ts +4 -0
  434. package/lib/core/page/hash.js +1 -1
  435. package/lib/core/page/lock.d.ts +8 -0
  436. package/lib/core/page/lock.js +1 -1
  437. package/lib/core/page/types.d.ts +22 -0
  438. package/lib/core/sql-index-auditor.d.ts +33 -0
  439. package/lib/core/sql-index-auditor.js +1 -1
  440. package/lib/core/sql-sync/config.d.ts +7 -0
  441. package/lib/core/sql-sync/config.js +1 -1
  442. package/lib/core/sql-sync/file-system.d.ts +7 -0
  443. package/lib/core/sql-sync/file-system.js +1 -1
  444. package/lib/core/sql-sync/hash.d.ts +5 -0
  445. package/lib/core/sql-sync/hash.js +1 -1
  446. package/lib/core/sql-sync/lock.d.ts +14 -0
  447. package/lib/core/sql-sync/lock.js +1 -1
  448. package/lib/core/sql-sync/types.d.ts +43 -0
  449. package/lib/core/sql-sync/utils.d.ts +10 -0
  450. package/lib/core/sql-sync/utils.js +1 -1
  451. package/lib/core/sql-validator.d.ts +34 -0
  452. package/lib/core/sql-validator.js +1 -1
  453. package/lib/errors.d.ts +3 -0
  454. package/lib/errors.js +1 -1
  455. package/lib/framework/build-all-flags.d.ts +2 -0
  456. package/lib/framework/build-all-flags.js +1 -1
  457. package/lib/framework/error-output.d.ts +9 -0
  458. package/lib/framework/error-output.js +1 -1
  459. package/lib/framework/explicit-yes.d.ts +3 -0
  460. package/lib/framework/explicit-yes.js +1 -1
  461. package/lib/framework/flags.d.ts +3 -0
  462. package/lib/framework/flags.js +1 -1
  463. package/lib/framework/help.d.ts +4 -0
  464. package/lib/framework/help.js +1 -1
  465. package/lib/framework/index.d.ts +11 -0
  466. package/lib/framework/index.js +1 -1
  467. package/lib/framework/output.d.ts +15 -0
  468. package/lib/framework/output.js +1 -1
  469. package/lib/framework/response.d.ts +2 -0
  470. package/lib/framework/response.js +1 -1
  471. package/lib/framework/runner-alias.d.ts +14 -0
  472. package/lib/framework/runner-alias.js +1 -1
  473. package/lib/framework/runner.d.ts +36 -0
  474. package/lib/framework/runner.js +1 -1
  475. package/lib/framework/schema-export.d.ts +3 -0
  476. package/lib/framework/schema-export.js +1 -1
  477. package/lib/framework/types.d.ts +63 -0
  478. package/lib/framework/types.js +1 -1
  479. package/lib/generated/build-info.d.ts +4 -0
  480. package/lib/generated/build-info.js +1 -1
  481. package/lib/help.d.ts +1 -0
  482. package/lib/help.js +1 -1
  483. package/lib/runtime/confirmation.d.ts +4 -0
  484. package/lib/runtime/confirmation.js +1 -0
  485. package/lib/runtime/event.d.ts +5 -0
  486. package/lib/runtime/event.js +1 -0
  487. package/lib/runtime/index.d.ts +7 -0
  488. package/lib/runtime/index.js +1 -0
  489. package/lib/runtime/queue.d.ts +5 -0
  490. package/lib/runtime/queue.js +1 -0
  491. package/lib/runtime/resolve.d.ts +8 -0
  492. package/lib/runtime/resolve.js +1 -0
  493. package/lib/runtime/types.d.ts +50 -0
  494. package/lib/runtime/types.js +1 -0
  495. package/lib/skills/main.d.ts +41 -0
  496. package/lib/skills/main.js +1 -1
  497. package/lib/skills/npx-skills-add.d.ts +99 -0
  498. package/lib/skills/npx-skills-add.js +1 -1
  499. package/lib/skills/skill-presence.d.ts +44 -0
  500. package/lib/skills/skill-presence.js +1 -1
  501. package/lib/telemetry/cli-command-trace.d.ts +12 -0
  502. package/lib/telemetry/cli-command-trace.js +1 -1
  503. package/lib/telemetry/cli-help-trace.d.ts +8 -0
  504. package/lib/telemetry/cli-help-trace.js +1 -1
  505. package/lib/telemetry/ensure-cli-otel-config.d.ts +6 -0
  506. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  507. package/lib/telemetry/register-otel-exit-shutdown.d.ts +3 -0
  508. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  509. package/lib/telemetry/send-cli-trace-log.d.ts +17 -0
  510. package/lib/telemetry/send-cli-trace-log.js +1 -1
  511. package/lib/telemetry/send-platform-issue-collect-log.d.ts +26 -0
  512. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  513. package/lib/types/index.d.ts +93 -0
  514. package/lib/utils/ai_config.d.ts +47 -0
  515. package/lib/utils/ai_config.js +1 -1
  516. package/lib/utils/apply-jq-filter.d.ts +1 -0
  517. package/lib/utils/apply-jq-filter.js +1 -1
  518. package/lib/utils/cdn-config.d.ts +42 -0
  519. package/lib/utils/cdn-config.js +1 -1
  520. package/lib/utils/check-sdk-version.d.ts +23 -0
  521. package/lib/utils/check-sdk-version.js +1 -1
  522. package/lib/utils/cli-version-check.d.ts +37 -0
  523. package/lib/utils/cli-version-check.js +1 -1
  524. package/lib/utils/cli-version-policy.d.ts +9 -0
  525. package/lib/utils/cli-version-policy.js +1 -1
  526. package/lib/utils/config.d.ts +42 -0
  527. package/lib/utils/config.js +1 -1
  528. package/lib/utils/copy-directory.d.ts +1 -0
  529. package/lib/utils/copy-directory.js +1 -1
  530. package/lib/utils/entity-with-id.d.ts +30 -0
  531. package/lib/utils/entity-with-id.js +1 -1
  532. package/lib/utils/file-utils.d.ts +25 -0
  533. package/lib/utils/file-utils.js +1 -1
  534. package/lib/utils/guides-cdn.d.ts +80 -0
  535. package/lib/utils/guides-cdn.js +1 -1
  536. package/lib/utils/http-client.d.ts +30 -0
  537. package/lib/utils/http-client.js +1 -1
  538. package/lib/utils/is-non-interactive.d.ts +7 -0
  539. package/lib/utils/is-non-interactive.js +1 -1
  540. package/lib/utils/logger.d.ts +62 -0
  541. package/lib/utils/logger.js +1 -1
  542. package/lib/utils/params.d.ts +15 -0
  543. package/lib/utils/params.js +1 -1
  544. package/lib/utils/platform.d.ts +21 -0
  545. package/lib/utils/platform.js +1 -1
  546. package/lib/utils/rules-cdn.d.ts +38 -0
  547. package/lib/utils/rules-cdn.js +1 -1
  548. package/lib/utils/sleep.d.ts +1 -0
  549. package/lib/utils/sleep.js +1 -1
  550. package/lib/utils/template-replacer.d.ts +55 -0
  551. package/lib/utils/template-replacer.js +1 -1
  552. package/lib/utils/update-notice.d.ts +10 -0
  553. package/lib/utils/update-notice.js +1 -1
  554. package/lib/utils/version.d.ts +1 -0
  555. package/lib/utils/version.js +1 -1
  556. package/lib/utils/with-active-cookie.d.ts +1 -0
  557. package/lib/utils/with-active-cookie.js +1 -1
  558. package/lib/utils/write-cli-side-channel.d.ts +6 -0
  559. package/lib/utils/write-cli-side-channel.js +1 -1
  560. package/package.json +9 -1
@@ -1 +1 @@
1
- const a148_0x1bc822=a148_0x3c2d;function a148_0x3c2d(_0x224d13,_0x2ac38b){_0x224d13=_0x224d13-0xd2;const _0x6e63c0=a148_0x6e63();let _0x3c2d7d=_0x6e63c0[_0x224d13];return _0x3c2d7d;}(function(_0x14383a,_0x1eb109){const _0x1fedf1=a148_0x3c2d,_0x338d36=_0x14383a();while(!![]){try{const _0x5c9f55=parseInt(_0x1fedf1(0xd8))/0x1*(parseInt(_0x1fedf1(0xe9))/0x2)+parseInt(_0x1fedf1(0xe2))/0x3*(-parseInt(_0x1fedf1(0xf0))/0x4)+parseInt(_0x1fedf1(0xeb))/0x5*(parseInt(_0x1fedf1(0xd3))/0x6)+parseInt(_0x1fedf1(0xd7))/0x7*(parseInt(_0x1fedf1(0xe8))/0x8)+parseInt(_0x1fedf1(0xf8))/0x9+parseInt(_0x1fedf1(0xf5))/0xa*(parseInt(_0x1fedf1(0xea))/0xb)+-parseInt(_0x1fedf1(0xf4))/0xc;if(_0x5c9f55===_0x1eb109)break;else _0x338d36['push'](_0x338d36['shift']());}catch(_0x56fd35){_0x338d36['push'](_0x338d36['shift']());}}}(a148_0x6e63,0xea928));import{getRoleApiResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,DATASETS_FLAG,flattenApiResources,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';function a148_0x6e63(){const _0x44fe19=['API','revoke','push','4oCNSbG','action','join','has','49485396qicAkR','10piLYJV','Pass\x20--datasets\x20<datasetCode,...>.','filter','16124994FNsEzj','high-risk-write','18ROknmJ','datasetCodes','appCode','validation','651KfhYUN','861562PaKjyj','length','get','role-apis-set','str','set','bool','Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20','permit','selector','2395641HOIPOa','POST','Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','Missing\x20--revoke.','flagMissing','datasets','129936cADGHz','2GoQGtd','924649lcJyaT','2725575AcXdxM','role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).'];a148_0x6e63=function(){return _0x44fe19;};return a148_0x6e63();}import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';async function buildPlan(_0x3d3e55,_0x323804){const _0x408f41=a148_0x3c2d,_0x3a21e8=await resolveRoleRef(_0x3d3e55[_0x408f41(0xd5)],readRoleRef(_0x3d3e55));assertPermConfigurable(_0x3a21e8);if(!_0x3d3e55['bool'](_0x408f41(0xee)))throw CliErrors[_0x408f41(0xd6)](_0x408f41(0xe5),_0x408f41(0xec));const _0x2d64ac=splitList(_0x3d3e55['str'](_0x408f41(0xe7)));if(_0x2d64ac[_0x408f41(0xd9)]===0x0)throw CliErrors[_0x408f41(0xe6)](_0x408f41(0xe7),_0x408f41(0xf6));const _0x129ad1=await getRoleApiResources(_0x3d3e55[_0x408f41(0xd5)],_0x3a21e8['id']),{byCode:_0x58c9bf,byDataset:_0x396511}=flattenApiResources(_0x129ad1),_0x5b1863=_0x2d64ac[_0x408f41(0xf7)](_0x4eabab=>!_0x396511[_0x408f41(0xf3)](_0x4eabab));if(_0x5b1863['length']>0x0)throw CliErrors[_0x408f41(0xd6)](_0x408f41(0xdf)+_0x5b1863[_0x408f41(0xf2)](',\x20')+'.','Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.');const _0x20a12c=new Map(),_0x20bb2d=[],_0x3346c4=[];for(const _0x4212e2 of _0x2d64ac){for(const _0x33653a of _0x396511[_0x408f41(0xda)](_0x4212e2)){const _0x5c872c=_0x58c9bf['get'](_0x33653a);_0x20a12c[_0x408f41(0xdd)](_0x33653a,'0'),_0x20bb2d[_0x408f41(0xef)]({'resourceCode':_0x33653a,'datasetCode':_0x4212e2,'action':_0x5c872c[_0x408f41(0xf1)]}),_0x3346c4[_0x408f41(0xef)]({'resourceCode':_0x33653a,'datasetCode':_0x4212e2,'action':'0'});}}const _0x54a536=buildPermits(_0x58c9bf,_0x20a12c),_0xbacabb={'operation':'api-revoke','selector':{'appCode':_0x3d3e55[_0x408f41(0xd5)],'roleId':_0x3a21e8['id'],'roleName':_0x3a21e8['roleName'],'datasetCodes':_0x2d64ac},'before':_0x20bb2d,'after':_0x3346c4,'dryRun':_0x323804,'backend':{'method':_0x408f41(0xe3),'path':UPDATE_PATH,'roleType':'API'},'warnings':[]};return{'role':_0x3a21e8,'permits':_0x54a536,'mutation':_0xbacabb};}export const permitRoleApisSet={'service':a148_0x1bc822(0xe0),'command':a148_0x1bc822(0xdb),'description':a148_0x1bc822(0xe4),'risk':a148_0x1bc822(0xd2),'flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x57ffcf){const _0x53b1f9=a148_0x1bc822;if(!_0x57ffcf[_0x53b1f9(0xde)](_0x53b1f9(0xee)))throw CliErrors['validation']('Missing\x20--revoke.',_0x53b1f9(0xec));if(splitList(_0x57ffcf[_0x53b1f9(0xdc)](_0x53b1f9(0xe7)))[_0x53b1f9(0xd9)]===0x0)throw CliErrors[_0x53b1f9(0xe6)](_0x53b1f9(0xe7),_0x53b1f9(0xf6));},async 'dryRun'(_0x16057b){const {mutation:_0x3b5171}=await buildPlan(_0x16057b,!![]);return asDryRunResult(_0x3b5171,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x532dc1){const _0x1bf1f2=a148_0x1bc822,{role:_0xc38cf5,permits:_0x555cd,mutation:_0x1a846d}=await buildPlan(_0x532dc1,![]);return await updateAppRole({'id':_0xc38cf5['id'],'appCode':_0x532dc1[_0x1bf1f2(0xd5)],'roleType':_0x1bf1f2(0xed),'permits':_0x555cd}),{'ok':!![],'data':_0x1a846d,'message':'Revoked\x20API\x20access\x20for\x20'+_0x1a846d[_0x1bf1f2(0xe1)][_0x1bf1f2(0xd4)][_0x1bf1f2(0xd9)]+'\x20dataset(s)\x20on\x20role\x20'+_0xc38cf5['roleName']};}};
1
+ const a148_0x133f0a=a148_0x9e9a;(function(_0x280b1c,_0x527f72){const _0xf842c1=a148_0x9e9a,_0x26a29b=_0x280b1c();while(!![]){try{const _0x43f722=parseInt(_0xf842c1(0x6a))/0x1*(-parseInt(_0xf842c1(0x88))/0x2)+-parseInt(_0xf842c1(0x87))/0x3+parseInt(_0xf842c1(0x71))/0x4+-parseInt(_0xf842c1(0x85))/0x5+parseInt(_0xf842c1(0x69))/0x6*(parseInt(_0xf842c1(0x7f))/0x7)+-parseInt(_0xf842c1(0x6f))/0x8+parseInt(_0xf842c1(0x86))/0x9*(parseInt(_0xf842c1(0x6c))/0xa);if(_0x43f722===_0x527f72)break;else _0x26a29b['push'](_0x26a29b['shift']());}catch(_0x136f44){_0x26a29b['push'](_0x26a29b['shift']());}}}(a148_0x49db,0xc769f));import{getRoleApiResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a148_0x9e9a(_0x3ce3d6,_0x5df486){_0x3ce3d6=_0x3ce3d6-0x69;const _0x49db53=a148_0x49db();let _0x9e9adc=_0x49db53[_0x3ce3d6];return _0x9e9adc;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,DATASETS_FLAG,flattenApiResources,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a148_0x133f0a(0x83);async function buildPlan(_0xbb1dd9,_0x50645c){const _0x48386d=a148_0x133f0a,_0x57c0d0=await resolveRoleRef(_0xbb1dd9['appCode'],readRoleRef(_0xbb1dd9));assertPermConfigurable(_0x57c0d0);if(!_0xbb1dd9[_0x48386d(0x8b)](_0x48386d(0x7e)))throw CliErrors[_0x48386d(0x80)]('Missing\x20--revoke.',_0x48386d(0x89));const _0x58b425=splitList(_0xbb1dd9[_0x48386d(0x84)](_0x48386d(0x6e)));if(_0x58b425['length']===0x0)throw CliErrors[_0x48386d(0x79)](_0x48386d(0x6e),'Pass\x20--datasets\x20<datasetCode,...>.');const _0x435be5=await getRoleApiResources(_0xbb1dd9['appCode'],_0x57c0d0['id']),{byCode:_0x177f49,byDataset:_0x1b7927}=flattenApiResources(_0x435be5),_0x4182d1=_0x58b425[_0x48386d(0x70)](_0x47066d=>!_0x1b7927[_0x48386d(0x74)](_0x47066d));if(_0x4182d1[_0x48386d(0x8d)]>0x0)throw CliErrors[_0x48386d(0x80)]('Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20'+_0x4182d1[_0x48386d(0x78)](',\x20')+'.','Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.');const _0x2e663=new Map(),_0x3305f9=[],_0x1977f0=[];for(const _0x6e12e2 of _0x58b425){for(const _0x2fb744 of _0x1b7927[_0x48386d(0x73)](_0x6e12e2)){const _0x4006a3=_0x177f49[_0x48386d(0x73)](_0x2fb744);_0x2e663[_0x48386d(0x76)](_0x2fb744,'0'),_0x3305f9['push']({'resourceCode':_0x2fb744,'datasetCode':_0x6e12e2,'action':_0x4006a3[_0x48386d(0x75)]}),_0x1977f0['push']({'resourceCode':_0x2fb744,'datasetCode':_0x6e12e2,'action':'0'});}}const _0x35cf77=buildPermits(_0x177f49,_0x2e663),_0x41d061={'operation':_0x48386d(0x8c),'selector':{'appCode':_0xbb1dd9[_0x48386d(0x7a)],'roleId':_0x57c0d0['id'],'roleName':_0x57c0d0[_0x48386d(0x72)],'datasetCodes':_0x58b425},'before':_0x3305f9,'after':_0x1977f0,'dryRun':_0x50645c,'backend':{'method':_0x48386d(0x7c),'path':UPDATE_PATH,'roleType':_0x48386d(0x7b)},'warnings':[]};return{'role':_0x57c0d0,'permits':_0x35cf77,'mutation':_0x41d061};}function a148_0x49db(){const _0x1938bc=['datasets','12084016UjDsTX','filter','2903316ZKwdjH','roleName','get','has','action','set','Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','join','flagMissing','appCode','API','POST','Missing\x20--revoke.','revoke','63frRihV','validation','Revoked\x20API\x20access\x20for\x20','datasetCodes','/smartapi/permit/role/update','str','5103890iJGjDI','306UMXIqe','1612599ChUVJN','8ALQjBL','role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).','role-apis-set','bool','api-revoke','length','permit','447522dyhZSU','143963SCfloY','high-risk-write','901280MLZYab','Pass\x20--datasets\x20<datasetCode,...>.'];a148_0x49db=function(){return _0x1938bc;};return a148_0x49db();}export const permitRoleApisSet={'service':a148_0x133f0a(0x8e),'command':a148_0x133f0a(0x8a),'description':a148_0x133f0a(0x77),'risk':a148_0x133f0a(0x6b),'flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x53d168){const _0x1d9a89=a148_0x133f0a;if(!_0x53d168[_0x1d9a89(0x8b)](_0x1d9a89(0x7e)))throw CliErrors['validation'](_0x1d9a89(0x7d),_0x1d9a89(0x89));if(splitList(_0x53d168[_0x1d9a89(0x84)](_0x1d9a89(0x6e)))[_0x1d9a89(0x8d)]===0x0)throw CliErrors[_0x1d9a89(0x79)](_0x1d9a89(0x6e),_0x1d9a89(0x6d));},async 'dryRun'(_0x31e27c){const {mutation:_0x561af7}=await buildPlan(_0x31e27c,!![]);return asDryRunResult(_0x561af7,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x3f90e9){const _0x35a6f2=a148_0x133f0a,{role:_0x30261d,permits:_0x2f34fd,mutation:_0xbfa685}=await buildPlan(_0x3f90e9,![]);return await updateAppRole({'id':_0x30261d['id'],'appCode':_0x3f90e9[_0x35a6f2(0x7a)],'roleType':_0x35a6f2(0x7b),'permits':_0x2f34fd}),{'ok':!![],'data':_0xbfa685,'message':_0x35a6f2(0x81)+_0xbfa685['selector'][_0x35a6f2(0x82)]['length']+'\x20dataset(s)\x20on\x20role\x20'+_0x30261d['roleName']};}};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const permitRoleMenusSet: CommandDefinition;
@@ -1 +1 @@
1
- function a149_0x3f9e(_0x57733a,_0x1088b3){_0x57733a=_0x57733a-0x8f;const _0x3a6156=a149_0x3a61();let _0x3f9e6f=_0x3a6156[_0x57733a];return _0x3f9e6f;}const a149_0x247a6f=a149_0x3f9e;(function(_0x13e762,_0x273439){const _0x2e353e=a149_0x3f9e,_0x1142d8=_0x13e762();while(!![]){try{const _0x552e9c=parseInt(_0x2e353e(0xa2))/0x1+-parseInt(_0x2e353e(0xa0))/0x2+parseInt(_0x2e353e(0xab))/0x3*(-parseInt(_0x2e353e(0xa7))/0x4)+parseInt(_0x2e353e(0xaa))/0x5+-parseInt(_0x2e353e(0x96))/0x6*(-parseInt(_0x2e353e(0x93))/0x7)+-parseInt(_0x2e353e(0xa8))/0x8*(-parseInt(_0x2e353e(0x8f))/0x9)+parseInt(_0x2e353e(0x91))/0xa*(parseInt(_0x2e353e(0xad))/0xb);if(_0x552e9c===_0x273439)break;else _0x1142d8['push'](_0x1142d8['shift']());}catch(_0x4d9903){_0x1142d8['push'](_0x1142d8['shift']());}}}(a149_0x3a61,0xe6e01));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';async function buildPlan(_0x2d9863,_0x48eb5f){const _0x472153=a149_0x3f9e,_0x578134=await resolveRoleRef(_0x2d9863[_0x472153(0xa1)],readRoleRef(_0x2d9863));assertPermConfigurable(_0x578134);const _0x3f4566=readGrantRevoke(_0x2d9863),_0x5a6dd6=splitList(_0x2d9863[_0x472153(0xa5)](_0x472153(0xaf)));if(_0x5a6dd6[_0x472153(0xa3)]===0x0)throw CliErrors[_0x472153(0xa4)](_0x472153(0xaf),_0x472153(0x92));const _0x2ebd76=await getRoleMenuResources(_0x2d9863[_0x472153(0xa1)],_0x578134['id']),_0x46d057=flattenMenuResources(_0x2ebd76),_0x55f9a8=_0x5a6dd6[_0x472153(0x9e)](_0x4a65cc=>!_0x46d057[_0x472153(0x99)](_0x4a65cc));if(_0x55f9a8[_0x472153(0xa3)]>0x0)throw CliErrors[_0x472153(0xa9)](_0x472153(0x9a)+_0x55f9a8[_0x472153(0x9b)](',\x20')+'.',_0x472153(0x9f));const _0x1d4c11=new Map(),_0x56e08c=[],_0x5afa58=[];for(const _0x214d2f of _0x5a6dd6){const _0x22bffd=_0x46d057['get'](_0x214d2f);_0x1d4c11['set'](_0x214d2f,_0x3f4566),_0x56e08c[_0x472153(0x98)]({'resourceCode':_0x214d2f,'action':_0x22bffd[_0x472153(0x90)]}),_0x5afa58['push']({'resourceCode':_0x214d2f,'action':_0x3f4566});}const _0x3b1004=buildPermits(_0x46d057,_0x1d4c11),_0x2cfc19={'operation':_0x3f4566==='access'?_0x472153(0x94):'menu-revoke','selector':{'appCode':_0x2d9863['appCode'],'roleId':_0x578134['id'],'roleName':_0x578134[_0x472153(0xa6)],'resourceCodes':_0x5a6dd6},'before':_0x56e08c,'after':_0x5afa58,'dryRun':_0x48eb5f,'backend':{'method':_0x472153(0x95),'path':UPDATE_PATH,'roleType':_0x472153(0x9c)},'warnings':[]};return{'role':_0x578134,'permits':_0x3b1004,'mutation':_0x2cfc19};}export const permitRoleMenusSet={'service':a149_0x247a6f(0xae),'command':a149_0x247a6f(0x9d),'description':'Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','risk':a149_0x247a6f(0x97),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3da903){const _0x343ca9=a149_0x247a6f;readGrantRevoke(_0x3da903);if(splitList(_0x3da903['str'](_0x343ca9(0xaf)))['length']===0x0)throw CliErrors['flagMissing'](_0x343ca9(0xaf),'Pass\x20--menus\x20<resourceCode,...>.');},async 'dryRun'(_0x10ef39){const _0x38cd9b=a149_0x247a6f,{mutation:_0x326e52}=await buildPlan(_0x10ef39,!![]);return asDryRunResult(_0x326e52,{'method':_0x38cd9b(0x95),'url':UPDATE_PATH});},async 'execute'(_0x34216e){const _0x2e989b=a149_0x247a6f,{role:_0x980f5c,permits:_0xd21653,mutation:_0x46afd3}=await buildPlan(_0x34216e,![]);return await updateAppRole({'id':_0x980f5c['id'],'appCode':_0x34216e['appCode'],'roleType':_0x2e989b(0x9c),'permits':_0xd21653}),{'ok':!![],'data':_0x46afd3,'message':'Updated\x20'+_0x46afd3['selector'][_0x2e989b(0xac)][_0x2e989b(0xa3)]+'\x20menu\x20permit(s)\x20for\x20role\x20'+_0x980f5c[_0x2e989b(0xa6)]};}};function a149_0x3a61(){const _0x4fd717=['validation','2834390InTAdG','2042862HqJyGv','resourceCodes','12606ClKpzi','permit','menus','2699208hfvEos','action','4450WARlQG','Pass\x20--menus\x20<resourceCode,...>.','21kYrnWG','menu-grant','POST','1360014VoCWSm','high-risk-write','push','has','Unknown\x20menu\x20resourceCode(s):\x20','join','PAGE','role-menus-set','filter','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','2458540IWgLab','appCode','280428qmKIgo','length','flagMissing','str','roleName','8CriLur','40kqGypo'];a149_0x3a61=function(){return _0x4fd717;};return a149_0x3a61();}
1
+ const a149_0x379e14=a149_0x41b5;(function(_0x21a866,_0x45b2b5){const _0x434654=a149_0x41b5,_0x112801=_0x21a866();while(!![]){try{const _0x2c6d55=-parseInt(_0x434654(0x1cd))/0x1+parseInt(_0x434654(0x1c6))/0x2+-parseInt(_0x434654(0x1bf))/0x3+-parseInt(_0x434654(0x1d8))/0x4+-parseInt(_0x434654(0x1c9))/0x5+parseInt(_0x434654(0x1d0))/0x6*(-parseInt(_0x434654(0x1d6))/0x7)+parseInt(_0x434654(0x1da))/0x8;if(_0x2c6d55===_0x45b2b5)break;else _0x112801['push'](_0x112801['shift']());}catch(_0x56c722){_0x112801['push'](_0x112801['shift']());}}}(a149_0x4729,0x1e403));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';function a149_0x41b5(_0x13963d,_0x3679f1){_0x13963d=_0x13963d-0x1bc;const _0x47298f=a149_0x4729();let _0x41b577=_0x47298f[_0x13963d];return _0x41b577;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a149_0x4729(){const _0x3f0825=['menu-revoke','703125IuJBSP','push','\x20menu\x20permit(s)\x20for\x20role\x20','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','PAGE','roleName','has','85412lYVtHp','appCode','POST','912965Cbaccz','get','high-risk-write','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','200140nrlOCG','length','/smartapi/permit/role/update','597624UEozYM','join','menu-grant','Pass\x20--menus\x20<resourceCode,...>.','selector','menus','7FGjJth','str','580288nAcEsW','permit','7543880JViucd','action','validation','filter','flagMissing'];a149_0x4729=function(){return _0x3f0825;};return a149_0x4729();}import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a149_0x379e14(0x1cf);async function buildPlan(_0x2048e9,_0x2f2088){const _0x4f4316=a149_0x379e14,_0xba019b=await resolveRoleRef(_0x2048e9['appCode'],readRoleRef(_0x2048e9));assertPermConfigurable(_0xba019b);const _0x5dbe01=readGrantRevoke(_0x2048e9),_0x8202ea=splitList(_0x2048e9[_0x4f4316(0x1d7)]('menus'));if(_0x8202ea[_0x4f4316(0x1ce)]===0x0)throw CliErrors[_0x4f4316(0x1bd)](_0x4f4316(0x1d5),_0x4f4316(0x1d3));const _0x36c7cf=await getRoleMenuResources(_0x2048e9['appCode'],_0xba019b['id']),_0x51e905=flattenMenuResources(_0x36c7cf),_0x3468f4=_0x8202ea[_0x4f4316(0x1bc)](_0x396416=>!_0x51e905[_0x4f4316(0x1c5)](_0x396416));if(_0x3468f4[_0x4f4316(0x1ce)]>0x0)throw CliErrors[_0x4f4316(0x1dc)]('Unknown\x20menu\x20resourceCode(s):\x20'+_0x3468f4[_0x4f4316(0x1d1)](',\x20')+'.',_0x4f4316(0x1c2));const _0x1b0dcd=new Map(),_0x2ef2c6=[],_0x26cd53=[];for(const _0x3a35c2 of _0x8202ea){const _0x23236b=_0x51e905[_0x4f4316(0x1ca)](_0x3a35c2);_0x1b0dcd['set'](_0x3a35c2,_0x5dbe01),_0x2ef2c6[_0x4f4316(0x1c0)]({'resourceCode':_0x3a35c2,'action':_0x23236b[_0x4f4316(0x1db)]}),_0x26cd53[_0x4f4316(0x1c0)]({'resourceCode':_0x3a35c2,'action':_0x5dbe01});}const _0x32c40f=buildPermits(_0x51e905,_0x1b0dcd),_0x1fc2f2={'operation':_0x5dbe01==='access'?_0x4f4316(0x1d2):_0x4f4316(0x1be),'selector':{'appCode':_0x2048e9['appCode'],'roleId':_0xba019b['id'],'roleName':_0xba019b[_0x4f4316(0x1c4)],'resourceCodes':_0x8202ea},'before':_0x2ef2c6,'after':_0x26cd53,'dryRun':_0x2f2088,'backend':{'method':'POST','path':UPDATE_PATH,'roleType':_0x4f4316(0x1c3)},'warnings':[]};return{'role':_0xba019b,'permits':_0x32c40f,'mutation':_0x1fc2f2};}export const permitRoleMenusSet={'service':a149_0x379e14(0x1d9),'command':'role-menus-set','description':a149_0x379e14(0x1cc),'risk':a149_0x379e14(0x1cb),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x197721){const _0x2702ca=a149_0x379e14;readGrantRevoke(_0x197721);if(splitList(_0x197721['str'](_0x2702ca(0x1d5)))[_0x2702ca(0x1ce)]===0x0)throw CliErrors[_0x2702ca(0x1bd)](_0x2702ca(0x1d5),_0x2702ca(0x1d3));},async 'dryRun'(_0x57a25d){const _0x324834=a149_0x379e14,{mutation:_0x4537d6}=await buildPlan(_0x57a25d,!![]);return asDryRunResult(_0x4537d6,{'method':_0x324834(0x1c8),'url':UPDATE_PATH});},async 'execute'(_0x47dd01){const _0xe4ae53=a149_0x379e14,{role:_0x4ccfc2,permits:_0x370416,mutation:_0x4e377a}=await buildPlan(_0x47dd01,![]);return await updateAppRole({'id':_0x4ccfc2['id'],'appCode':_0x47dd01[_0xe4ae53(0x1c7)],'roleType':'PAGE','permits':_0x370416}),{'ok':!![],'data':_0x4e377a,'message':'Updated\x20'+_0x4e377a[_0xe4ae53(0x1d4)]['resourceCodes'][_0xe4ae53(0x1ce)]+_0xe4ae53(0x1c1)+_0x4ccfc2[_0xe4ae53(0x1c4)]};}};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const permitRoleMenus: CommandDefinition;
@@ -1 +1 @@
1
- const a150_0x29c5c7=a150_0x2a5d;(function(_0x52949e,_0x5e5ea8){const _0x35dae9=a150_0x2a5d,_0x8a43ab=_0x52949e();while(!![]){try{const _0x3451e5=-parseInt(_0x35dae9(0xcf))/0x1*(parseInt(_0x35dae9(0xd7))/0x2)+parseInt(_0x35dae9(0xde))/0x3+-parseInt(_0x35dae9(0xd5))/0x4+-parseInt(_0x35dae9(0xce))/0x5*(-parseInt(_0x35dae9(0xd0))/0x6)+-parseInt(_0x35dae9(0xe2))/0x7+parseInt(_0x35dae9(0xcd))/0x8+-parseInt(_0x35dae9(0xe0))/0x9*(-parseInt(_0x35dae9(0xdc))/0xa);if(_0x3451e5===_0x5e5ea8)break;else _0x8a43ab['push'](_0x8a43ab['shift']());}catch(_0x54a2e9){_0x8a43ab['push'](_0x8a43ab['shift']());}}}(a150_0x4631,0x35491));function a150_0x2a5d(_0x12391d,_0x2ed69c){_0x12391d=_0x12391d-0xcb;const _0x4631f8=a150_0x4631();let _0x2a5d9d=_0x4631f8[_0x12391d];return _0x2a5d9d;}function a150_0x4631(){const _0x51622b=['653874KdrLDQ','from','\x20menu(s)\x20allowed','allowed','role-menus','737312OxuLef','read','2058arASjz','Role\x20','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','\x20has\x20','length','30LorkJh','values','1177935Sdtivv','roleName','16776BvIwRF','permit','2078727TFfILu','appCode','action','map','1974936bwFTNX','5wfFjjN','53ZsjYBp'];a150_0x4631=function(){return _0x51622b;};return a150_0x4631();}import{getRoleMenuResources}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{flattenMenuResources,readRoleRef,ROLE_REF_FLAG}from'../../commands/permit/shared.js';import{resolveRoleRef}from'../../commands/role/shared.js';export const permitRoleMenus={'service':a150_0x29c5c7(0xe1),'command':a150_0x29c5c7(0xd4),'description':a150_0x29c5c7(0xd9),'risk':a150_0x29c5c7(0xd6),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x816c3a){const _0x396c4d=a150_0x29c5c7,_0x532d80=await resolveRoleRef(_0x816c3a[_0x396c4d(0xe3)],readRoleRef(_0x816c3a)),_0x3eafb6=await getRoleMenuResources(_0x816c3a['appCode'],_0x532d80['id']),_0x258c27=flattenMenuResources(_0x3eafb6),_0x2394b3=Array[_0x396c4d(0xd1)](_0x258c27[_0x396c4d(0xdd)]())[_0x396c4d(0xcc)](_0x4b6dcc=>({'resourceCode':_0x4b6dcc['resourceCode'],'resourceName':_0x4b6dcc['resourceName'],'allowed':_0x4b6dcc['action']==='access','action':_0x4b6dcc[_0x396c4d(0xcb)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x816c3a[_0x396c4d(0xe3)],'roleId':_0x532d80['id'],'roleName':_0x532d80[_0x396c4d(0xdf)]},'menus':_0x2394b3},'message':_0x396c4d(0xd8)+_0x532d80[_0x396c4d(0xdf)]+_0x396c4d(0xda)+_0x2394b3['filter'](_0x5a59d3=>_0x5a59d3[_0x396c4d(0xd3)])[_0x396c4d(0xdb)]+'/'+_0x2394b3[_0x396c4d(0xdb)]+_0x396c4d(0xd2)};}};
1
+ const a150_0x3802c8=a150_0x351d;(function(_0x5a2a43,_0xa26e94){const _0x1df1fe=a150_0x351d,_0xc968b6=_0x5a2a43();while(!![]){try{const _0x4ed73e=parseInt(_0x1df1fe(0xd6))/0x1+-parseInt(_0x1df1fe(0xcc))/0x2*(-parseInt(_0x1df1fe(0xd3))/0x3)+parseInt(_0x1df1fe(0xd1))/0x4+parseInt(_0x1df1fe(0xde))/0x5*(-parseInt(_0x1df1fe(0xdc))/0x6)+parseInt(_0x1df1fe(0xce))/0x7*(parseInt(_0x1df1fe(0xc7))/0x8)+parseInt(_0x1df1fe(0xdd))/0x9*(parseInt(_0x1df1fe(0xd9))/0xa)+-parseInt(_0x1df1fe(0xcb))/0xb*(parseInt(_0x1df1fe(0xc9))/0xc);if(_0x4ed73e===_0xa26e94)break;else _0xc968b6['push'](_0xc968b6['shift']());}catch(_0x320027){_0xc968b6['push'](_0xc968b6['shift']());}}}(a150_0x4e8e,0x6fac0));function a150_0x4e8e(){const _0x31db18=['7vQXAtn','resourceCode','\x20menu(s)\x20allowed','1487896sCzHEX','appCode','88059flzgMp','roleName','length','794996PNDyqS','access','read','760BBdXmX','map','action','306QCkgta','1899IafSfr','51395niTbOj','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','permit','role-menus','5129792DpsaPM','from','576fPXXhy','values','347809hxHKGa','46RQXNEh','Role\x20'];a150_0x4e8e=function(){return _0x31db18;};return a150_0x4e8e();}import{getRoleMenuResources}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{flattenMenuResources,readRoleRef,ROLE_REF_FLAG}from'../../commands/permit/shared.js';import{resolveRoleRef}from'../../commands/role/shared.js';function a150_0x351d(_0x120995,_0x1530b2){_0x120995=_0x120995-0xc6;const _0x4e8e7b=a150_0x4e8e();let _0x351d69=_0x4e8e7b[_0x120995];return _0x351d69;}export const permitRoleMenus={'service':a150_0x3802c8(0xe0),'command':a150_0x3802c8(0xc6),'description':a150_0x3802c8(0xdf),'risk':a150_0x3802c8(0xd8),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x3b40c2){const _0x494560=a150_0x3802c8,_0x233de9=await resolveRoleRef(_0x3b40c2['appCode'],readRoleRef(_0x3b40c2)),_0xe9b6e2=await getRoleMenuResources(_0x3b40c2[_0x494560(0xd2)],_0x233de9['id']),_0xac6cd9=flattenMenuResources(_0xe9b6e2),_0x292cc2=Array[_0x494560(0xc8)](_0xac6cd9[_0x494560(0xca)]())[_0x494560(0xda)](_0x2a83dd=>({'resourceCode':_0x2a83dd[_0x494560(0xcf)],'resourceName':_0x2a83dd['resourceName'],'allowed':_0x2a83dd[_0x494560(0xdb)]===_0x494560(0xd7),'action':_0x2a83dd[_0x494560(0xdb)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x3b40c2['appCode'],'roleId':_0x233de9['id'],'roleName':_0x233de9[_0x494560(0xd4)]},'menus':_0x292cc2},'message':_0x494560(0xcd)+_0x233de9[_0x494560(0xd4)]+'\x20has\x20'+_0x292cc2['filter'](_0x473f2b=>_0x473f2b['allowed'])[_0x494560(0xd5)]+'/'+_0x292cc2[_0x494560(0xd5)]+_0x494560(0xd0)};}};
@@ -0,0 +1,74 @@
1
+ /**
2
+ * permit service 共享逻辑(SSOT)
3
+ *
4
+ * 集中:角色字面量(SELF/ALL/id/name)解析、page 权限槽字段映射、
5
+ * menu / api 资源树扁平化与 permits patch 构造。
6
+ * 命令文件只引用这里,不重复解析/合并规则。
7
+ */
8
+ import { type AppRole, type ApiResource, type MenuResource, type PagePermit, type PagePermitResourceSlot, type PermitAction } from "../../core/api-client.js";
9
+ import type { FlagDef, RuntimeContext } from "../../framework/types.js";
10
+ export declare const MENU_ID_FLAG: FlagDef;
11
+ export declare const ROLE_REF_FLAG: FlagDef;
12
+ export declare const GRANT_FLAG: FlagDef;
13
+ export declare const REVOKE_FLAG: FlagDef;
14
+ export declare const MENUS_FLAG: FlagDef;
15
+ export declare const DATASETS_FLAG: FlagDef;
16
+ /** page-set 的角色列表 flags → PagePermit 槽位映射 */
17
+ export interface PageSlotSpec {
18
+ flag: string;
19
+ key: keyof Pick<PagePermit, "menuPermit" | "dataCreate" | "dataUpdate" | "dataDelete" | "dataDetail" | "dataExport" | "dataPermit">;
20
+ /** 是否允许 SELF(仅 row-roles = dataPermit 允许行级 SELF) */
21
+ allowSelf: boolean;
22
+ label: string;
23
+ }
24
+ export declare const PAGE_SLOT_SPECS: PageSlotSpec[];
25
+ export declare const PAGE_SET_ROLE_FLAGS: FlagDef[];
26
+ export declare function splitList(raw: string): string[];
27
+ export interface RoleRefProjection {
28
+ id: number;
29
+ roleName: string;
30
+ roleType: AppRole["roleType"];
31
+ }
32
+ export declare function projectRoleRef(role: AppRole): RoleRefProjection;
33
+ /**
34
+ * 解析角色字面量数组(SELF/ALL/id/name)为 AppRole[]。
35
+ * 所有解析基于一次 get-permit-list(含特殊组 ALL/SELF)。
36
+ * allowSelf=false 时拒绝 SELF(与工作台一致:菜单/操作权限不含行级 SELF)。
37
+ */
38
+ export declare function resolvePermitRoles(appCode: string, refs: string[], opts: {
39
+ allowSelf: boolean;
40
+ label: string;
41
+ }): Promise<AppRole[]>;
42
+ export declare function projectPageSlot(slot: PagePermitResourceSlot | undefined): {
43
+ resourceCode: string;
44
+ roles: RoleRefProjection[];
45
+ } | null;
46
+ export declare function projectPagePermit(page: PagePermit): Record<string, unknown>;
47
+ export interface FlatMenuResource {
48
+ resourceCode: string;
49
+ resourceName: string;
50
+ action: PermitAction;
51
+ }
52
+ /** 递归扁平化菜单资源树(含 pageNodeList),resourceCode → 当前动作 */
53
+ export declare function flattenMenuResources(resources: MenuResource[]): Map<string, FlatMenuResource>;
54
+ export interface FlatApiResource {
55
+ resourceCode: string;
56
+ resourceName: string;
57
+ datasetCode: string;
58
+ action: PermitAction;
59
+ }
60
+ export declare function flattenApiResources(resources: ApiResource[]): {
61
+ byCode: Map<string, FlatApiResource>;
62
+ byDataset: Map<string, string[]>;
63
+ };
64
+ /**
65
+ * 由「当前全量动作 map」+「目标 resourceCode → 新动作」构造完整 permits 回写体。
66
+ * 未在 changes 中的 resourceCode 保持当前动作(与工作台 permissionState 全量回写一致)。
67
+ */
68
+ export declare function buildPermits(current: Map<string, {
69
+ action: PermitAction;
70
+ }>, changes: Map<string, PermitAction>): Record<string, PermitAction[]>;
71
+ /** 读取 --role flag(permit 侧) */
72
+ export declare function readRoleRef(ctx: RuntimeContext): string;
73
+ /** 解析 grant/revoke 互斥标记 */
74
+ export declare function readGrantRevoke(ctx: RuntimeContext): "access" | "0";
@@ -1 +1 @@
1
- const a151_0x336e15=a151_0x4b11;(function(_0x270b11,_0xeb37d2){const _0x25611e=a151_0x4b11,_0x32717c=_0x270b11();while(!![]){try{const _0x10f126=-parseInt(_0x25611e(0x1b1))/0x1+-parseInt(_0x25611e(0x1c5))/0x2+parseInt(_0x25611e(0x17f))/0x3*(parseInt(_0x25611e(0x196))/0x4)+parseInt(_0x25611e(0x18d))/0x5*(parseInt(_0x25611e(0x1b5))/0x6)+-parseInt(_0x25611e(0x1c8))/0x7*(-parseInt(_0x25611e(0x179))/0x8)+parseInt(_0x25611e(0x1bb))/0x9*(parseInt(_0x25611e(0x1bd))/0xa)+parseInt(_0x25611e(0x1d0))/0xb*(-parseInt(_0x25611e(0x1a9))/0xc);if(_0x10f126===_0xeb37d2)break;else _0x32717c['push'](_0x32717c['shift']());}catch(_0x4a0046){_0x32717c['push'](_0x32717c['shift']());}}}(a151_0xa844,0xe6e4d));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a151_0x336e15(0x181),'type':a151_0x336e15(0x1cc),'required':!![],'description':a151_0x336e15(0x18c)};export const ROLE_REF_FLAG={'name':a151_0x336e15(0x18e),'type':a151_0x336e15(0x19c),'required':!![],'description':a151_0x336e15(0x17a)};export const GRANT_FLAG={'name':'grant','type':a151_0x336e15(0x1c1),'required':![],'description':a151_0x336e15(0x191)};export const REVOKE_FLAG={'name':a151_0x336e15(0x1ce),'type':'boolean','required':![],'description':a151_0x336e15(0x1b2)};export const MENUS_FLAG={'name':a151_0x336e15(0x197),'type':a151_0x336e15(0x19c),'required':!![],'description':a151_0x336e15(0x1ad)};export const DATASETS_FLAG={'name':a151_0x336e15(0x1b7),'type':a151_0x336e15(0x19c),'required':!![],'description':a151_0x336e15(0x1ab)};export const PAGE_SLOT_SPECS=[{'flag':a151_0x336e15(0x18b),'key':'menuPermit','allowSelf':![],'label':a151_0x336e15(0x1b8)},{'flag':'create-roles','key':a151_0x336e15(0x19e),'allowSelf':![],'label':a151_0x336e15(0x1ca)},{'flag':a151_0x336e15(0x183),'key':'dataUpdate','allowSelf':![],'label':a151_0x336e15(0x1a3)},{'flag':a151_0x336e15(0x178),'key':a151_0x336e15(0x19b),'allowSelf':![],'label':a151_0x336e15(0x195)},{'flag':a151_0x336e15(0x19a),'key':'dataDetail','allowSelf':![],'label':'data\x20detail'},{'flag':'export-roles','key':a151_0x336e15(0x18f),'allowSelf':![],'label':a151_0x336e15(0x186)},{'flag':a151_0x336e15(0x1a7),'key':a151_0x336e15(0x1c3),'allowSelf':!![],'label':a151_0x336e15(0x1a4)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a151_0x336e15(0x1a0)](_0x1580ee=>({'name':_0x1580ee[a151_0x336e15(0x177)],'type':a151_0x336e15(0x19c),'required':![],'description':a151_0x336e15(0x1a1)+_0x1580ee[a151_0x336e15(0x1a2)]+a151_0x336e15(0x1a8)+(_0x1580ee['allowSelf']?a151_0x336e15(0x17b):'')}));export function splitList(_0x4c69ff){const _0x1b4d5f=a151_0x336e15;return _0x4c69ff['split'](',')['map'](_0x273df4=>_0x273df4[_0x1b4d5f(0x180)]())[_0x1b4d5f(0x188)](Boolean);}export function projectRoleRef(_0x5bd7d8){return{'id':_0x5bd7d8['id'],'roleName':_0x5bd7d8['roleName'],'roleType':_0x5bd7d8['roleType']};}export async function resolvePermitRoles(_0x12ede8,_0x5968cb,_0x217c2c){const _0xde2225=a151_0x336e15,_0xf466a5=await listPermitRoles(_0x12ede8,{'needSelf':!![],'needPublic':!![]}),_0x1df45d=[];for(const _0x3a854e of _0x5968cb){const _0x4b3d90=resolveOnePermitRole(_0xf466a5,_0x3a854e);if(!_0x217c2c['allowSelf']&&_0x4b3d90['roleType']==='SELF')throw CliErrors[_0xde2225(0x1bf)](_0xde2225(0x1cb)+_0x217c2c[_0xde2225(0x1a2)]+'.','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.');if(!_0x1df45d['some'](_0x567f8e=>_0x567f8e['id']===_0x4b3d90['id']))_0x1df45d['push'](_0x4b3d90);}return _0x1df45d;}function a151_0x4b11(_0x3eebac,_0xc4028f){_0x3eebac=_0x3eebac-0x177;const _0xa8448e=a151_0xa844();let _0x4b11b2=_0xa8448e[_0x3eebac];return _0x4b11b2;}function resolveOnePermitRole(_0x3c4621,_0x43ce62){const _0x582a33=a151_0x336e15,_0x462f96=_0x43ce62['trim'](),_0xe4aa00=_0x462f96[_0x582a33(0x17d)]();if(_0xe4aa00==='SELF'||_0xe4aa00===_0x582a33(0x1ac)){const _0x57ad4f=_0x3c4621[_0x582a33(0x1c7)](_0x169e63=>_0x169e63[_0x582a33(0x1b6)]===_0xe4aa00);if(!_0x57ad4f)throw CliErrors[_0x582a33(0x1bf)](_0x582a33(0x199)+_0xe4aa00+_0x582a33(0x194));return _0x57ad4f;}if(/^-?\d+$/[_0x582a33(0x185)](_0x462f96)){const _0x3c6077=Number(_0x462f96),_0x2a9e05=_0x3c4621[_0x582a33(0x1c7)](_0x57935a=>_0x57935a['id']===_0x3c6077);if(!_0x2a9e05)throw CliErrors[_0x582a33(0x1bf)](_0x582a33(0x1a6)+_0x3c6077+_0x582a33(0x1cd),'Run\x20`role\x20list`.');return _0x2a9e05;}const _0x2ea9bf=_0x3c4621[_0x582a33(0x188)](_0x14d49e=>_0x14d49e[_0x582a33(0x182)]===_0x462f96);if(_0x2ea9bf[_0x582a33(0x1cf)]===0x0)throw CliErrors[_0x582a33(0x1bf)](_0x582a33(0x1c6)+_0x462f96+_0x582a33(0x1c0),_0x582a33(0x1c4));if(_0x2ea9bf[_0x582a33(0x1cf)]>0x1)throw CliErrors[_0x582a33(0x1bf)]('Role\x20\x22'+_0x462f96+_0x582a33(0x1c9)+_0x2ea9bf['map'](_0x1127ff=>_0x1127ff['id'])[_0x582a33(0x1b4)](',\x20')+').','Disambiguate\x20with\x20an\x20id.');return _0x2ea9bf[0x0];}export function projectPageSlot(_0x135a0f){const _0x5d3563=a151_0x336e15;if(!_0x135a0f)return null;return{'resourceCode':_0x135a0f[_0x5d3563(0x18a)],'roles':(_0x135a0f['rolePermit']??[])[_0x5d3563(0x1a0)](projectRoleRef)};}export function projectPagePermit(_0xd4b537){const _0x13fecd=a151_0x336e15,_0x2c4514={'menuId':_0xd4b537[_0x13fecd(0x190)],'appCode':_0xd4b537[_0x13fecd(0x1b0)],'menuPermit':projectPageSlot(_0xd4b537[_0x13fecd(0x184)])};for(const _0x4dc8b2 of PAGE_SLOT_SPECS){if(_0x4dc8b2[_0x13fecd(0x19d)]===_0x13fecd(0x184))continue;_0x2c4514[_0x4dc8b2[_0x13fecd(0x19d)]]=projectPageSlot(_0xd4b537[_0x4dc8b2[_0x13fecd(0x19d)]]);}return _0x2c4514;}function a151_0xa844(){const _0x391c46=['dataCreate','action','map','Roles\x20for\x20','label','data\x20update','row\x20visibility','pageNodeList','Role\x20id\x20','row-roles','\x20(comma-separated\x20SELF/ALL/id/name)','12gHbpXI','resourceName','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','ALL','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','flagMissing','datasetCode','appCode','406244MhvudG','Revoke\x20access\x20to\x20the\x20listed\x20resources','Pass\x20--role\x20<id|name>.','join','102SCECxg','roleType','datasets','menu\x20visibility','set','apiList','139644yRfJfy','grant','330YKMEeU','allowedActions','validation','\x22\x20not\x20found.','boolean','bool','dataPermit','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','1378428MKWLbP','Role\x20\x22','find','14091VWXUOA','\x22\x20is\x20ambiguous\x20(ids:\x20','data\x20create','SELF\x20is\x20not\x20allowed\x20for\x20','number','\x20not\x20found.','revoke','length','22315953KlgvcY','flag','delete-roles','3904zEoPUN','Role\x20id\x20or\x20role\x20name',';\x20SELF\x20=\x20only\x20own\x20rows','get','toUpperCase','entries','164283xdxUeN','trim','menu-id','roleName','update-roles','menuPermit','test','data\x20export','Missing\x20action.','filter','str','resourceCode','menu-roles','Menu\x20id\x20(from\x20`menu\x20list`)','419285nIFnHD','role','dataExport','menuId','Grant\x20access\x20to\x20the\x20listed\x20resources','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','\x20is\x20not\x20available\x20for\x20this\x20app.','data\x20delete','84RZxflm','menus','access','Special\x20role\x20','detail-roles','dataDelete','string','key'];a151_0xa844=function(){return _0x391c46;};return a151_0xa844();}export function flattenMenuResources(_0x580554){const _0x4be453=new Map(),_0x4c7f65=_0x4a2f9b=>{const _0x14b63b=a151_0x4b11;for(const _0x276479 of _0x4a2f9b??[]){_0x4be453[_0x14b63b(0x1b9)](_0x276479['resourceCode'],{'resourceCode':_0x276479[_0x14b63b(0x18a)],'resourceName':_0x276479['resourceName'],'action':_0x276479[_0x14b63b(0x1be)]?.[0x0]??'0'});if(_0x276479[_0x14b63b(0x1a5)])_0x4c7f65(_0x276479[_0x14b63b(0x1a5)]);}};return _0x4c7f65(_0x580554),_0x4be453;}export function flattenApiResources(_0x487d62){const _0x395a51=a151_0x336e15,_0x25fad5=new Map(),_0x2d8cd1=new Map();for(const _0x204b40 of _0x487d62){const _0xa43fb4=_0x204b40[_0x395a51(0x1ba)]??{};for(const [_0x1c4e40,_0x357bf5]of Object[_0x395a51(0x17e)](_0xa43fb4)){_0x25fad5[_0x395a51(0x1b9)](_0x1c4e40,{'resourceCode':_0x1c4e40,'resourceName':_0x204b40[_0x395a51(0x1aa)],'datasetCode':_0x204b40[_0x395a51(0x1af)],'action':_0x357bf5?.[0x0]??'0'});const _0x1a4ac6=_0x2d8cd1[_0x395a51(0x17c)](_0x204b40['datasetCode'])??[];_0x1a4ac6['push'](_0x1c4e40),_0x2d8cd1[_0x395a51(0x1b9)](_0x204b40[_0x395a51(0x1af)],_0x1a4ac6);}}return{'byCode':_0x25fad5,'byDataset':_0x2d8cd1};}export function buildPermits(_0x32a3fe,_0x9c2c3f){const _0x492be4=a151_0x336e15,_0x5894d8={};for(const [_0x2d2794,_0x1a8b46]of _0x32a3fe){const _0xfebdd8=_0x9c2c3f[_0x492be4(0x17c)](_0x2d2794)??_0x1a8b46[_0x492be4(0x19f)];_0x5894d8[_0x2d2794]=[_0xfebdd8];}return _0x5894d8;}export function readRoleRef(_0x2efb3b){const _0xa386e9=a151_0x336e15,_0x2d0c0d=_0x2efb3b[_0xa386e9(0x189)]('role')[_0xa386e9(0x180)]();if(!_0x2d0c0d)throw CliErrors[_0xa386e9(0x1ae)](_0xa386e9(0x18e),_0xa386e9(0x1b3));return _0x2d0c0d;}export function readGrantRevoke(_0x40a51c){const _0xf248bf=a151_0x336e15,_0x39721a=_0x40a51c[_0xf248bf(0x1c2)](_0xf248bf(0x1bc)),_0x4e5c42=_0x40a51c['bool'](_0xf248bf(0x1ce));if(_0x39721a&&_0x4e5c42)throw CliErrors[_0xf248bf(0x1bf)](_0xf248bf(0x193));if(!_0x39721a&&!_0x4e5c42)throw CliErrors['validation'](_0xf248bf(0x187),_0xf248bf(0x192));return _0x39721a?_0xf248bf(0x198):'0';}
1
+ const a151_0x714ad8=a151_0xcb0b;(function(_0x2e16c7,_0x5eb52c){const _0x50ce35=a151_0xcb0b,_0x42d508=_0x2e16c7();while(!![]){try{const _0x366723=-parseInt(_0x50ce35(0x21f))/0x1*(-parseInt(_0x50ce35(0x223))/0x2)+-parseInt(_0x50ce35(0x211))/0x3*(parseInt(_0x50ce35(0x1eb))/0x4)+-parseInt(_0x50ce35(0x228))/0x5+parseInt(_0x50ce35(0x1ee))/0x6+-parseInt(_0x50ce35(0x1f5))/0x7*(-parseInt(_0x50ce35(0x1df))/0x8)+parseInt(_0x50ce35(0x1fb))/0x9+-parseInt(_0x50ce35(0x20a))/0xa;if(_0x366723===_0x5eb52c)break;else _0x42d508['push'](_0x42d508['shift']());}catch(_0x34bef9){_0x42d508['push'](_0x42d508['shift']());}}}(a151_0x3712,0x4c274));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a151_0x714ad8(0x1f2),'type':a151_0x714ad8(0x210),'required':!![],'description':'Menu\x20id\x20(from\x20`menu\x20list`)'};function a151_0xcb0b(_0x5f4670,_0x1a1a85){_0x5f4670=_0x5f4670-0x1de;const _0x37127e=a151_0x3712();let _0xcb0b63=_0x37127e[_0x5f4670];return _0xcb0b63;}export const ROLE_REF_FLAG={'name':a151_0x714ad8(0x1ed),'type':a151_0x714ad8(0x22f),'required':!![],'description':a151_0x714ad8(0x217)};export const GRANT_FLAG={'name':a151_0x714ad8(0x21a),'type':a151_0x714ad8(0x1e6),'required':![],'description':a151_0x714ad8(0x1f3)};export const REVOKE_FLAG={'name':a151_0x714ad8(0x206),'type':a151_0x714ad8(0x1e6),'required':![],'description':'Revoke\x20access\x20to\x20the\x20listed\x20resources'};export const MENUS_FLAG={'name':a151_0x714ad8(0x22c),'type':a151_0x714ad8(0x22f),'required':!![],'description':a151_0x714ad8(0x22a)};export const DATASETS_FLAG={'name':a151_0x714ad8(0x202),'type':a151_0x714ad8(0x22f),'required':!![],'description':a151_0x714ad8(0x233)};export const PAGE_SLOT_SPECS=[{'flag':a151_0x714ad8(0x1ec),'key':a151_0x714ad8(0x1f6),'allowSelf':![],'label':a151_0x714ad8(0x212)},{'flag':'create-roles','key':a151_0x714ad8(0x1e7),'allowSelf':![],'label':a151_0x714ad8(0x203)},{'flag':a151_0x714ad8(0x227),'key':a151_0x714ad8(0x1e0),'allowSelf':![],'label':a151_0x714ad8(0x1fe)},{'flag':a151_0x714ad8(0x214),'key':'dataDelete','allowSelf':![],'label':a151_0x714ad8(0x1e8)},{'flag':a151_0x714ad8(0x208),'key':a151_0x714ad8(0x1f7),'allowSelf':![],'label':a151_0x714ad8(0x219)},{'flag':'export-roles','key':a151_0x714ad8(0x22d),'allowSelf':![],'label':'data\x20export'},{'flag':a151_0x714ad8(0x21b),'key':a151_0x714ad8(0x232),'allowSelf':!![],'label':a151_0x714ad8(0x200)}];function a151_0x3712(){const _0x37d56f=['row-roles','test','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','resourceName','303775JmEiAJ','resourceCode','some','pageNodeList','2GFNYcx','Pass\x20--role\x20<id|name>.','allowSelf','\x22\x20is\x20ambiguous\x20(ids:\x20','update-roles','1596815xJdece','access','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','\x20(comma-separated\x20SELF/ALL/id/name)','menus','dataExport','length','string','SELF','Run\x20`role\x20list`.','dataPermit','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','set','get','validation','1662448Waxhim','dataUpdate','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','push','SELF\x20is\x20not\x20allowed\x20for\x20','Roles\x20for\x20','datasetCode','boolean','dataCreate','data\x20delete','roleType','join','348QYUnhx','menu-roles','role','243582JUhGYi','rolePermit','\x20not\x20found.','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','menu-id','Grant\x20access\x20to\x20the\x20listed\x20resources','map','14lkswDK','menuPermit','dataDetail','appCode','bool','split','4654035FdLyJh','roleName','find','data\x20update','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','row\x20visibility','filter','datasets','data\x20create','menuId','Role\x20\x22','revoke',';\x20SELF\x20=\x20only\x20own\x20rows','detail-roles','key','4023860PmSJgK','\x22\x20not\x20found.','flagMissing','action','apiList','Disambiguate\x20with\x20an\x20id.','number','8394zeenxO','menu\x20visibility','trim','delete-roles','Special\x20role\x20','Missing\x20action.','Role\x20id\x20or\x20role\x20name','\x20is\x20not\x20available\x20for\x20this\x20app.','data\x20detail','grant'];a151_0x3712=function(){return _0x37d56f;};return a151_0x3712();}export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS['map'](_0x2fb7ee=>({'name':_0x2fb7ee['flag'],'type':'string','required':![],'description':a151_0x714ad8(0x1e4)+_0x2fb7ee['label']+a151_0x714ad8(0x22b)+(_0x2fb7ee[a151_0x714ad8(0x225)]?a151_0x714ad8(0x207):'')}));export function splitList(_0x124d05){const _0x1f7290=a151_0x714ad8;return _0x124d05[_0x1f7290(0x1fa)](',')[_0x1f7290(0x1f4)](_0x4bef1c=>_0x4bef1c[_0x1f7290(0x213)]())[_0x1f7290(0x201)](Boolean);}export function projectRoleRef(_0x467d4e){const _0x4cb582=a151_0x714ad8;return{'id':_0x467d4e['id'],'roleName':_0x467d4e[_0x4cb582(0x1fc)],'roleType':_0x467d4e[_0x4cb582(0x1e9)]};}export async function resolvePermitRoles(_0x216164,_0x27e108,_0x29ecc2){const _0x49f7c9=a151_0x714ad8,_0x146085=await listPermitRoles(_0x216164,{'needSelf':!![],'needPublic':!![]}),_0x5b9e02=[];for(const _0x3742dd of _0x27e108){const _0x36510b=resolveOnePermitRole(_0x146085,_0x3742dd);if(!_0x29ecc2[_0x49f7c9(0x225)]&&_0x36510b[_0x49f7c9(0x1e9)]==='SELF')throw CliErrors[_0x49f7c9(0x1de)](_0x49f7c9(0x1e3)+_0x29ecc2['label']+'.',_0x49f7c9(0x21d));if(!_0x5b9e02[_0x49f7c9(0x221)](_0x1ffbbb=>_0x1ffbbb['id']===_0x36510b['id']))_0x5b9e02[_0x49f7c9(0x1e2)](_0x36510b);}return _0x5b9e02;}function resolveOnePermitRole(_0x155190,_0x5c766e){const _0x269aff=a151_0x714ad8,_0x5d8d59=_0x5c766e[_0x269aff(0x213)](),_0x352bbd=_0x5d8d59['toUpperCase']();if(_0x352bbd===_0x269aff(0x230)||_0x352bbd==='ALL'){const _0x3c8d1e=_0x155190[_0x269aff(0x1fd)](_0x4c3868=>_0x4c3868['roleType']===_0x352bbd);if(!_0x3c8d1e)throw CliErrors[_0x269aff(0x1de)](_0x269aff(0x215)+_0x352bbd+_0x269aff(0x218));return _0x3c8d1e;}if(/^-?\d+$/[_0x269aff(0x21c)](_0x5d8d59)){const _0x1d9f77=Number(_0x5d8d59),_0x2bde85=_0x155190[_0x269aff(0x1fd)](_0x2811d3=>_0x2811d3['id']===_0x1d9f77);if(!_0x2bde85)throw CliErrors[_0x269aff(0x1de)]('Role\x20id\x20'+_0x1d9f77+_0x269aff(0x1f0),_0x269aff(0x231));return _0x2bde85;}const _0x323ae2=_0x155190[_0x269aff(0x201)](_0x253988=>_0x253988[_0x269aff(0x1fc)]===_0x5d8d59);if(_0x323ae2[_0x269aff(0x22e)]===0x0)throw CliErrors[_0x269aff(0x1de)](_0x269aff(0x205)+_0x5d8d59+_0x269aff(0x20b),_0x269aff(0x1ff));if(_0x323ae2[_0x269aff(0x22e)]>0x1)throw CliErrors[_0x269aff(0x1de)]('Role\x20\x22'+_0x5d8d59+_0x269aff(0x226)+_0x323ae2[_0x269aff(0x1f4)](_0x3c4890=>_0x3c4890['id'])[_0x269aff(0x1ea)](',\x20')+').',_0x269aff(0x20f));return _0x323ae2[0x0];}export function projectPageSlot(_0x949396){const _0x2f1a9e=a151_0x714ad8;if(!_0x949396)return null;return{'resourceCode':_0x949396['resourceCode'],'roles':(_0x949396[_0x2f1a9e(0x1ef)]??[])[_0x2f1a9e(0x1f4)](projectRoleRef)};}export function projectPagePermit(_0x33a593){const _0x51f581=a151_0x714ad8,_0x4135b4={'menuId':_0x33a593[_0x51f581(0x204)],'appCode':_0x33a593[_0x51f581(0x1f8)],'menuPermit':projectPageSlot(_0x33a593[_0x51f581(0x1f6)])};for(const _0x2eb9e9 of PAGE_SLOT_SPECS){if(_0x2eb9e9['key']==='menuPermit')continue;_0x4135b4[_0x2eb9e9[_0x51f581(0x209)]]=projectPageSlot(_0x33a593[_0x2eb9e9['key']]);}return _0x4135b4;}export function flattenMenuResources(_0x1e2c81){const _0x2c07c8=new Map(),_0xc36a7b=_0x409a0b=>{const _0x5dd923=a151_0xcb0b;for(const _0x3d65e9 of _0x409a0b??[]){_0x2c07c8['set'](_0x3d65e9[_0x5dd923(0x220)],{'resourceCode':_0x3d65e9['resourceCode'],'resourceName':_0x3d65e9[_0x5dd923(0x21e)],'action':_0x3d65e9['allowedActions']?.[0x0]??'0'});if(_0x3d65e9[_0x5dd923(0x222)])_0xc36a7b(_0x3d65e9['pageNodeList']);}};return _0xc36a7b(_0x1e2c81),_0x2c07c8;}export function flattenApiResources(_0x58df56){const _0x1afb58=a151_0x714ad8,_0x59eff5=new Map(),_0x2a1c15=new Map();for(const _0x192fc0 of _0x58df56){const _0x5976a2=_0x192fc0[_0x1afb58(0x20e)]??{};for(const [_0x385b32,_0xca3abe]of Object['entries'](_0x5976a2)){_0x59eff5[_0x1afb58(0x234)](_0x385b32,{'resourceCode':_0x385b32,'resourceName':_0x192fc0['resourceName'],'datasetCode':_0x192fc0[_0x1afb58(0x1e5)],'action':_0xca3abe?.[0x0]??'0'});const _0x449b1c=_0x2a1c15[_0x1afb58(0x235)](_0x192fc0['datasetCode'])??[];_0x449b1c['push'](_0x385b32),_0x2a1c15[_0x1afb58(0x234)](_0x192fc0[_0x1afb58(0x1e5)],_0x449b1c);}}return{'byCode':_0x59eff5,'byDataset':_0x2a1c15};}export function buildPermits(_0x4ab411,_0x570867){const _0x360bd2=a151_0x714ad8,_0x37df4a={};for(const [_0x4bd36d,_0x107e04]of _0x4ab411){const _0x4017e3=_0x570867[_0x360bd2(0x235)](_0x4bd36d)??_0x107e04[_0x360bd2(0x20d)];_0x37df4a[_0x4bd36d]=[_0x4017e3];}return _0x37df4a;}export function readRoleRef(_0x23f88c){const _0x29d4a2=a151_0x714ad8,_0x4bafe6=_0x23f88c['str'](_0x29d4a2(0x1ed))[_0x29d4a2(0x213)]();if(!_0x4bafe6)throw CliErrors[_0x29d4a2(0x20c)](_0x29d4a2(0x1ed),_0x29d4a2(0x224));return _0x4bafe6;}export function readGrantRevoke(_0x3be3ac){const _0x2a5b5b=a151_0x714ad8,_0x21022b=_0x3be3ac[_0x2a5b5b(0x1f9)](_0x2a5b5b(0x21a)),_0x5e16c1=_0x3be3ac[_0x2a5b5b(0x1f9)](_0x2a5b5b(0x206));if(_0x21022b&&_0x5e16c1)throw CliErrors[_0x2a5b5b(0x1de)](_0x2a5b5b(0x1f1));if(!_0x21022b&&!_0x5e16c1)throw CliErrors[_0x2a5b5b(0x1de)](_0x2a5b5b(0x216),_0x2a5b5b(0x1e1));return _0x21022b?_0x2a5b5b(0x229):'0';}
@@ -0,0 +1,7 @@
1
+ interface ProjectConfig {
2
+ projectName: string;
3
+ appCode?: string;
4
+ env?: string;
5
+ }
6
+ export declare function guidedCreateProject(onCreate: (config: ProjectConfig) => Promise<void>, cliEnv?: string, cookie?: string): Promise<void>;
7
+ export {};
@@ -1 +1 @@
1
- (function(_0x50b78c,_0x204239){const _0x16289b=a152_0x53a1,_0x8d8585=_0x50b78c();while(!![]){try{const _0xe87d0f=-parseInt(_0x16289b(0x209))/0x1+parseInt(_0x16289b(0x1f4))/0x2*(parseInt(_0x16289b(0x1ed))/0x3)+-parseInt(_0x16289b(0x1f5))/0x4+-parseInt(_0x16289b(0x200))/0x5*(-parseInt(_0x16289b(0x1ec))/0x6)+-parseInt(_0x16289b(0x20c))/0x7+parseInt(_0x16289b(0x206))/0x8*(-parseInt(_0x16289b(0x207))/0x9)+parseInt(_0x16289b(0x202))/0xa*(parseInt(_0x16289b(0x1f3))/0xb);if(_0xe87d0f===_0x204239)break;else _0x8d8585['push'](_0x8d8585['shift']());}catch(_0x4e6c07){_0x8d8585['push'](_0x8d8585['shift']());}}}(a152_0x5c70,0x1fa7c));import{existsSync}from'node:fs';import a152_0x17e19c from'node:path';import a152_0x24c42f from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a152_0x5c70(){const _0x564366=['No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','Directory\x20\x22','test','10mYpZqK','my-app','10TSKUaa','Skipped','Project\x20name:','length','48qWXXYJ','85167KYSFni','resolve','59695ueovhM','Project\x20name\x20cannot\x20exceed\x2050\x20characters','green','135261AzAoJf','Not\x20set','58044daPIwB','15ebjpsO','√\x20Login\x20status:\x20','Logged\x20in','Login\x20failed','cwd','log','4841111HmHMkX','23860RqFVQi','1014572ZwWMAm','production','√\x20App\x20Code:\x20','cyan','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','string','\x22\x20already\x20exists','env'];a152_0x5c70=function(){return _0x564366;};return a152_0x5c70();}import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';function a152_0x53a1(_0x287863,_0x39ab52){_0x287863=_0x287863-0x1ec;const _0x5c70a9=a152_0x5c70();let _0x53a145=_0x5c70a9[_0x287863];return _0x53a145;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x386df5,_0x50c7a9,_0x3063ff){const _0x4210ac=a152_0x53a1,_0x1656ea=_0x4210ac(0x201),_0x179b46=readConfig(),_0x49b68e=typeof _0x179b46['env']===_0x4210ac(0x1fa)?_0x179b46[_0x4210ac(0x1fc)]:undefined,_0x67581=await input({'message':_0x4210ac(0x204),'default':_0x1656ea,'validate':_0x51284f=>{const _0x33401d=_0x4210ac,_0x249841=_0x51284f['trim']()||_0x1656ea;if(_0x249841[_0x33401d(0x205)]>0x32)return _0x33401d(0x20a);const _0x396483=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x249841&&!_0x396483[_0x33401d(0x1ff)](_0x249841))return _0x33401d(0x1f9);const _0x1e70f7=a152_0x17e19c[_0x33401d(0x208)](process[_0x33401d(0x1f1)](),_0x249841);if(existsSync(_0x1e70f7))return _0x33401d(0x1fe)+_0x249841+_0x33401d(0x1fb);return!![];}});console[_0x4210ac(0x1f2)](a152_0x24c42f[_0x4210ac(0x20b)]('√\x20Project\x20Name:\x20'+a152_0x24c42f[_0x4210ac(0x1f8)](_0x67581)));const _0x3f7c5c=await selectSingleAppcode(_0x3063ff);console['log'](a152_0x24c42f[_0x4210ac(0x20b)](_0x4210ac(0x1f7)+a152_0x24c42f[_0x4210ac(0x1f8)](_0x3f7c5c||_0x4210ac(0x20d))));if(_0x3f7c5c){const _0x2ce32e=await getIsSessionValid();if(!_0x2ce32e){const _0x31a555=await confirm({'message':_0x4210ac(0x1fd),'default':!![]});if(_0x31a555){const _0x543513=await authServer({'silent':!![]});console[_0x4210ac(0x1f2)](a152_0x24c42f[_0x4210ac(0x20b)](_0x4210ac(0x1ee)+a152_0x24c42f[_0x4210ac(0x1f8)](_0x543513?_0x4210ac(0x1ef):_0x4210ac(0x1f0))));}else console['log'](a152_0x24c42f[_0x4210ac(0x20b)](_0x4210ac(0x1ee)+a152_0x24c42f[_0x4210ac(0x1f8)](_0x4210ac(0x203))));}await _0x386df5({'projectName':_0x67581,'appCode':_0x3f7c5c,'env':_0x50c7a9||_0x49b68e||'production'});}else await _0x386df5({'projectName':_0x67581,'env':_0x50c7a9||_0x49b68e||_0x4210ac(0x1f6)});}
1
+ (function(_0x2193a7,_0x11afb4){const _0x276113=a152_0x66bc,_0xa82ab1=_0x2193a7();while(!![]){try{const _0x10c657=parseInt(_0x276113(0x128))/0x1+-parseInt(_0x276113(0x115))/0x2*(-parseInt(_0x276113(0x116))/0x3)+parseInt(_0x276113(0x11e))/0x4*(parseInt(_0x276113(0x12e))/0x5)+-parseInt(_0x276113(0x118))/0x6+-parseInt(_0x276113(0x123))/0x7*(-parseInt(_0x276113(0x120))/0x8)+-parseInt(_0x276113(0x113))/0x9*(parseInt(_0x276113(0x131))/0xa)+parseInt(_0x276113(0x121))/0xb*(parseInt(_0x276113(0x124))/0xc);if(_0x10c657===_0x11afb4)break;else _0xa82ab1['push'](_0xa82ab1['shift']());}catch(_0x14bbb0){_0xa82ab1['push'](_0xa82ab1['shift']());}}}(a152_0x2770,0x469d4));import{existsSync}from'node:fs';import a152_0x289b26 from'node:path';function a152_0x66bc(_0x3d5e76,_0x275a22){_0x3d5e76=_0x3d5e76-0x113;const _0x277065=a152_0x2770();let _0x66bcfa=_0x277065[_0x3d5e76];return _0x66bcfa;}function a152_0x2770(){const _0x5b9e44=['log','500LlFYNJ','100089XKRvLH','env','914882XsIkCr','3XkKTDa','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','2682738oRibmN','trim','√\x20App\x20Code:\x20','green','Project\x20name:','Skipped','4TDzPzy','cwd','86696PIuThc','11chUCns','resolve','14PrPBcD','1713468gaMrir','test','string','Logged\x20in','530213mYfRkk','√\x20Project\x20Name:\x20','Project\x20name\x20cannot\x20exceed\x2050\x20characters','my-app','√\x20Login\x20status:\x20','production','701460ZENElg','cyan'];a152_0x2770=function(){return _0x5b9e44;};return a152_0x2770();}import a152_0x138336 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x248f1a,_0x17902e,_0x3c0b80){const _0xd1fcae=a152_0x66bc,_0x765a1e=_0xd1fcae(0x12b),_0xf063fe=readConfig(),_0x5b064d=typeof _0xf063fe['env']===_0xd1fcae(0x126)?_0xf063fe[_0xd1fcae(0x114)]:undefined,_0x152a3d=await input({'message':_0xd1fcae(0x11c),'default':_0x765a1e,'validate':_0x3b984f=>{const _0x3e86dd=_0xd1fcae,_0x43e5ed=_0x3b984f[_0x3e86dd(0x119)]()||_0x765a1e;if(_0x43e5ed['length']>0x32)return _0x3e86dd(0x12a);const _0x417401=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x43e5ed&&!_0x417401[_0x3e86dd(0x125)](_0x43e5ed))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0xb6967b=a152_0x289b26[_0x3e86dd(0x122)](process[_0x3e86dd(0x11f)](),_0x43e5ed);if(existsSync(_0xb6967b))return'Directory\x20\x22'+_0x43e5ed+'\x22\x20already\x20exists';return!![];}});console[_0xd1fcae(0x130)](a152_0x138336[_0xd1fcae(0x11b)](_0xd1fcae(0x129)+a152_0x138336[_0xd1fcae(0x12f)](_0x152a3d)));const _0x49ff08=await selectSingleAppcode(_0x3c0b80);console[_0xd1fcae(0x130)](a152_0x138336[_0xd1fcae(0x11b)](_0xd1fcae(0x11a)+a152_0x138336[_0xd1fcae(0x12f)](_0x49ff08||'Not\x20set')));if(_0x49ff08){const _0x50a940=await getIsSessionValid();if(!_0x50a940){const _0x1ff4e7=await confirm({'message':_0xd1fcae(0x117),'default':!![]});if(_0x1ff4e7){const _0x50acc0=await authServer({'silent':!![]});console[_0xd1fcae(0x130)](a152_0x138336[_0xd1fcae(0x11b)](_0xd1fcae(0x12c)+a152_0x138336['cyan'](_0x50acc0?_0xd1fcae(0x127):'Login\x20failed')));}else console[_0xd1fcae(0x130)](a152_0x138336[_0xd1fcae(0x11b)](_0xd1fcae(0x12c)+a152_0x138336[_0xd1fcae(0x12f)](_0xd1fcae(0x11d))));}await _0x248f1a({'projectName':_0x152a3d,'appCode':_0x49ff08,'env':_0x17902e||_0x5b064d||_0xd1fcae(0x12d)});}else await _0x248f1a({'projectName':_0x152a3d,'env':_0x17902e||_0x5b064d||_0xd1fcae(0x12d)});}
@@ -0,0 +1 @@
1
+ export declare function formatElapsed(start: number): string;
@@ -1 +1 @@
1
- function a153_0x2e9e(_0x60b9d,_0x573845){_0x60b9d=_0x60b9d-0xbe;const _0x3e8b42=a153_0x3e8b();let _0x2e9e6d=_0x3e8b42[_0x60b9d];return _0x2e9e6d;}(function(_0x3af756,_0x178435){const _0x3a8ac7=a153_0x2e9e,_0x2da2fb=_0x3af756();while(!![]){try{const _0x435d05=-parseInt(_0x3a8ac7(0xc2))/0x1+-parseInt(_0x3a8ac7(0xc9))/0x2*(parseInt(_0x3a8ac7(0xc3))/0x3)+-parseInt(_0x3a8ac7(0xc6))/0x4+-parseInt(_0x3a8ac7(0xc1))/0x5+parseInt(_0x3a8ac7(0xc4))/0x6+parseInt(_0x3a8ac7(0xc5))/0x7*(parseInt(_0x3a8ac7(0xca))/0x8)+parseInt(_0x3a8ac7(0xbf))/0x9*(parseInt(_0x3a8ac7(0xc0))/0xa);if(_0x435d05===_0x178435)break;else _0x2da2fb['push'](_0x2da2fb['shift']());}catch(_0x1a7044){_0x2da2fb['push'](_0x2da2fb['shift']());}}}(a153_0x3e8b,0x1dc99));export function formatElapsed(_0x1e72a7){const _0x54e08d=a153_0x2e9e,_0x47448b=Date[_0x54e08d(0xc8)]()-_0x1e72a7;if(_0x47448b<0x3e8)return _0x47448b+'ms';const _0x4806e9=(_0x47448b/0x3e8)[_0x54e08d(0xc7)](0x2),_0x1281f4=_0x4806e9[_0x54e08d(0xbe)](/\.?0+$/u,'');return _0x1281f4+'s';}function a153_0x3e8b(){const _0x225eb3=['now','670JnbnUP','8vviviz','replace','3396303nyZDVr','10IYHjal','1154035EctZgG','48138zNESyT','1311fEjRqU','1225140pijcPa','469987EtOjiT','405396ZOIiRH','toFixed'];a153_0x3e8b=function(){return _0x225eb3;};return a153_0x3e8b();}
1
+ function a153_0xd5ba(){const _0x4fd61f=['26248gHnVKJ','14KOyHPh','5872869qiFKIF','169456IwZhdP','24446510YGbyDg','replace','6741828LOlznO','8MxFNHn','2842580OmkWXY','1662535WiuJsy','408hmsTDJ'];a153_0xd5ba=function(){return _0x4fd61f;};return a153_0xd5ba();}function a153_0x2d99(_0x4ac479,_0x297de1){_0x4ac479=_0x4ac479-0x1d2;const _0xd5ba0f=a153_0xd5ba();let _0x2d99de=_0xd5ba0f[_0x4ac479];return _0x2d99de;}(function(_0x34bd8a,_0x318d52){const _0x1f71f8=a153_0x2d99,_0x2fa08f=_0x34bd8a();while(!![]){try{const _0xea9608=-parseInt(_0x1f71f8(0x1d6))/0x1*(-parseInt(_0x1f71f8(0x1d8))/0x2)+parseInt(_0x1f71f8(0x1d4))/0x3*(parseInt(_0x1f71f8(0x1d5))/0x4)+-parseInt(_0x1f71f8(0x1d2))/0x5+parseInt(_0x1f71f8(0x1db))/0x6+-parseInt(_0x1f71f8(0x1d3))/0x7*(parseInt(_0x1f71f8(0x1dc))/0x8)+parseInt(_0x1f71f8(0x1d7))/0x9+-parseInt(_0x1f71f8(0x1d9))/0xa;if(_0xea9608===_0x318d52)break;else _0x2fa08f['push'](_0x2fa08f['shift']());}catch(_0xad7d2a){_0x2fa08f['push'](_0x2fa08f['shift']());}}}(a153_0xd5ba,0x937e3));export function formatElapsed(_0x261257){const _0x1f4742=a153_0x2d99,_0x2095b4=Date['now']()-_0x261257;if(_0x2095b4<0x3e8)return _0x2095b4+'ms';const _0x57767b=(_0x2095b4/0x3e8)['toFixed'](0x2),_0x1e7c9c=_0x57767b[_0x1f4742(0x1da)](/\.?0+$/u,'');return _0x1e7c9c+'s';}
@@ -0,0 +1,6 @@
1
+ export declare function createApp(props: {
2
+ projectCode?: string;
3
+ appCode?: string;
4
+ env?: string;
5
+ cookie?: string;
6
+ }): Promise<void>;
@@ -1 +1 @@
1
- (function(_0x35f8c3,_0x21ac80){const _0x40715b=a154_0x127c,_0x8dbf17=_0x35f8c3();while(!![]){try{const _0x5afe27=-parseInt(_0x40715b(0x174))/0x1+parseInt(_0x40715b(0x193))/0x2+-parseInt(_0x40715b(0x1bc))/0x3+-parseInt(_0x40715b(0x1a7))/0x4+parseInt(_0x40715b(0x1cf))/0x5*(parseInt(_0x40715b(0x195))/0x6)+-parseInt(_0x40715b(0x1c4))/0x7*(-parseInt(_0x40715b(0x1bf))/0x8)+parseInt(_0x40715b(0x196))/0x9*(parseInt(_0x40715b(0x1ba))/0xa);if(_0x5afe27===_0x21ac80)break;else _0x8dbf17['push'](_0x8dbf17['shift']());}catch(_0x16625b){_0x8dbf17['push'](_0x8dbf17['shift']());}}}(a154_0x46f4,0x4d9cc));import a154_0x359673 from'path';import a154_0x2ebb38 from'fs';import a154_0x25b015 from'chalk';import a154_0xc62288 from'ora';function a154_0x127c(_0x3e6afd,_0x59a31a){_0x3e6afd=_0x3e6afd-0x16f;const _0x46f401=a154_0x46f4();let _0x127c1b=_0x46f401[_0x3e6afd];return _0x127c1b;}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{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{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';export async function createApp(_0x57b57d){const _0x5563f8=a154_0x127c,_0x1c029f=await checkCliVersion();(_0x1c029f[_0x5563f8(0x175)]||_0x1c029f[_0x5563f8(0x176)])&&(printCliUpgradeWarning(_0x1c029f),assertCliVersionSupported(_0x1c029f),logger['info'](_0x5563f8(0x192),_0x5563f8(0x1c0),{'currentVersion':_0x1c029f[_0x5563f8(0x1b6)],'stableVersion':_0x1c029f[_0x5563f8(0x1b8)],'minimumVersion':_0x1c029f[_0x5563f8(0x1ae)],'needsUpgrade':_0x1c029f[_0x5563f8(0x175)],'belowMinimum':_0x1c029f[_0x5563f8(0x176)]}));if(_0x57b57d[_0x5563f8(0x180)]&&_0x57b57d['appCode'])await runCreate({'projectName':_0x57b57d[_0x5563f8(0x180)],'appCode':_0x57b57d[_0x5563f8(0x191)],'env':_0x57b57d[_0x5563f8(0x1c3)]},_0x57b57d);else{if(_0x57b57d['projectCode']){const _0xbff859=await selectSingleAppcode(_0x57b57d[_0x5563f8(0x19a)]);await runCreate({'projectName':_0x57b57d[_0x5563f8(0x180)],'appCode':_0xbff859||undefined,'env':_0x57b57d['env']},_0x57b57d);}else await guidedCreateProject(_0x46d48c=>runCreate(_0x46d48c,_0x57b57d),_0x57b57d[_0x5563f8(0x1c3)],_0x57b57d[_0x5563f8(0x19a)]);}}async function runCreate(_0x25012a,_0x45c374){const _0x238db5=a154_0x127c;if(!_0x25012a[_0x238db5(0x1c6)]||_0x25012a[_0x238db5(0x1c6)][_0x238db5(0x1a1)]()==='')throw new Error(_0x238db5(0x1b4));const _0x1deaaa=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1deaaa[_0x238db5(0x1c1)](_0x25012a[_0x238db5(0x1c6)]))throw new Error(_0x238db5(0x18c));if(_0x25012a[_0x238db5(0x1c6)][_0x238db5(0x183)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x290371=a154_0x359673[_0x238db5(0x1ac)](process[_0x238db5(0x197)](),_0x25012a[_0x238db5(0x1c6)]);if(a154_0x2ebb38[_0x238db5(0x190)](_0x290371))throw new Error(_0x238db5(0x1bb)+_0x25012a[_0x238db5(0x1c6)]+_0x238db5(0x17d));try{a154_0x2ebb38[_0x238db5(0x1c2)](a154_0x359673[_0x238db5(0x1c7)](_0x290371),a154_0x2ebb38[_0x238db5(0x1a5)][_0x238db5(0x1d2)]);}catch{throw new Error(_0x238db5(0x181));}logger[_0x238db5(0x1b2)](_0x290371),logger[_0x238db5(0x172)](_0x238db5(0x192),_0x238db5(0x178)+_0x25012a[_0x238db5(0x1c6)],{'projectDir':_0x290371,'appCode':_0x25012a[_0x238db5(0x191)]}),console[_0x238db5(0x19b)](),console[_0x238db5(0x19b)](a154_0x25b015[_0x238db5(0x1ca)](_0x238db5(0x173))+_0x238db5(0x19d)+a154_0x25b015[_0x238db5(0x1ca)](_0x25012a['projectName'])+(_0x25012a[_0x238db5(0x191)]?_0x238db5(0x1cb)+a154_0x25b015[_0x238db5(0x186)](_0x25012a['appCode']):''));try{await runTask(_0x238db5(0x1b1),()=>copyProjectTemplate(_0x25012a[_0x238db5(0x1c6)])),await updatePackageJsonName(_0x25012a['projectName']),await runTask(_0x238db5(0x1cc),()=>installDependencies(_0x25012a[_0x238db5(0x1c6)])),await runTask(_0x238db5(0x1b3),()=>formatProjectCode(_0x25012a[_0x238db5(0x1c6)])),await configureAppCode(_0x25012a['projectName'],_0x25012a['appCode']||'',_0x25012a[_0x238db5(0x1c3)]);let _0x1222d8=![];if(_0x25012a[_0x238db5(0x191)]){console['log'](_0x238db5(0x1a6));const _0x3f41c7=process[_0x238db5(0x197)]();try{process[_0x238db5(0x1a9)](_0x290371);const _0x2698ec=_0x25012a[_0x238db5(0x1c3)]||_0x238db5(0x1d1);initEnv(_0x2698ec);const {configArray:_0x1fae43}=await fetchModelList(_0x25012a[_0x238db5(0x191)],_0x45c374[_0x238db5(0x19a)]||''),_0x106d1e=DEFAULT_API_DIR,_0x21ed1e=await generateApiFile(_0x1fae43,'',_0x25012a[_0x238db5(0x191)],!![],_0x2698ec,_0x106d1e);console[_0x238db5(0x19b)](_0x238db5(0x184)+_0x1fae43['length']+'\x20dataset(s),\x20generated\x20'+_0x21ed1e['modelCount']+_0x238db5(0x1d3)),logger[_0x238db5(0x172)](_0x238db5(0x192),_0x238db5(0x17e)+_0x25012a[_0x238db5(0x191)]);}catch(_0x14514e){_0x1222d8=!![],console[_0x238db5(0x19b)](_0x238db5(0x189)),logger[_0x238db5(0x170)](_0x238db5(0x192),_0x238db5(0x17a),{'error':_0x14514e instanceof Error?_0x14514e[_0x238db5(0x1c8)]:String(_0x14514e)});}finally{process['chdir'](_0x3f41c7);}}logger[_0x238db5(0x1b7)](_0x238db5(0x192),_0x238db5(0x1d4)+_0x25012a[_0x238db5(0x1c6)]),console[_0x238db5(0x19b)](),console[_0x238db5(0x19b)](a154_0x25b015[_0x238db5(0x1ca)]('─'[_0x238db5(0x1aa)](0x3c))),console['log'](a154_0x25b015[_0x238db5(0x186)][_0x238db5(0x194)](_0x238db5(0x1a0))),console[_0x238db5(0x19b)](),console[_0x238db5(0x19b)](_0x238db5(0x199)+a154_0x25b015[_0x238db5(0x186)]['bold'](_0x238db5(0x182)+_0x25012a[_0x238db5(0x1c6)]+_0x238db5(0x1af)+CLI_BIN_NAME+_0x238db5(0x1a3))),_0x1222d8&&console[_0x238db5(0x19b)](_0x238db5(0x1ad)+a154_0x25b015['cyan'][_0x238db5(0x194)](CLI_BIN_NAME+'\x20api\x20pull')),console['log'](a154_0x25b015[_0x238db5(0x1ca)]('─'['repeat'](0x3c)));}catch(_0x33c5e8){logger[_0x238db5(0x18b)](_0x238db5(0x192),'项目创建失败:\x20'+_0x25012a[_0x238db5(0x1c6)],{'error':_0x33c5e8 instanceof Error?_0x33c5e8['message']:String(_0x33c5e8)});try{a154_0x2ebb38[_0x238db5(0x190)](_0x290371)&&(console['log'](_0x238db5(0x1ce)+_0x290371),a154_0x2ebb38[_0x238db5(0x177)](_0x290371,{'recursive':!![],'force':!![]}));}catch{logger[_0x238db5(0x170)](_0x238db5(0x192),_0x238db5(0x16f)+_0x290371);}throw _0x33c5e8;}}async function runTask(_0x48a47b,_0x2f6b98){const _0x1f9dee=a154_0x127c,_0x18367c=a154_0xc62288(_0x48a47b+_0x1f9dee(0x1c9))[_0x1f9dee(0x179)]();try{const _0xaf4697=await _0x2f6b98();_0x18367c['stop'](),console['log'](''+a154_0x25b015[_0x1f9dee(0x1ca)](_0x1f9dee(0x173))+_0x48a47b+'\x20'+a154_0x25b015[_0x1f9dee(0x1c5)]('['+_0xaf4697+']'));}catch(_0x5c7e1d){_0x18367c[_0x1f9dee(0x1ab)](_0x48a47b);throw _0x5c7e1d;}}async function updatePackageJsonName(_0x4a9714){const _0x37042b=a154_0x127c,_0x265968=a154_0x359673[_0x37042b(0x1ac)](process['cwd'](),_0x4a9714),_0x106a6b=a154_0x359673[_0x37042b(0x18e)](_0x265968,_0x37042b(0x1bd));try{console[_0x37042b(0x19b)](_0x37042b(0x1be));const _0x533453=getRabetbaseCliPackageRoot(),_0x2c0ca1=a154_0x359673[_0x37042b(0x18e)](_0x533453,'package.json');let _0x4416b8='1.0.0';try{const _0x5821dd=JSON[_0x37042b(0x171)](a154_0x2ebb38[_0x37042b(0x1a8)](_0x2c0ca1,_0x37042b(0x198)));_0x4416b8=_0x5821dd['version']||_0x37042b(0x18d);}catch{}const _0x105f9d=a154_0x2ebb38[_0x37042b(0x1a8)](_0x106a6b,_0x37042b(0x198)),_0x6bdac4=JSON[_0x37042b(0x171)](_0x105f9d);_0x6bdac4[_0x37042b(0x1b0)]=_0x4a9714,_0x6bdac4[_0x37042b(0x18a)]=_0x4a9714+_0x37042b(0x1cd)+_0x4416b8,a154_0x2ebb38[_0x37042b(0x1a4)](_0x106a6b,JSON[_0x37042b(0x17f)](_0x6bdac4,null,0x2)+'\x0a','utf8'),console[_0x37042b(0x19b)](_0x37042b(0x1b5)+_0x4a9714),logger[_0x37042b(0x172)](_0x37042b(0x192),'更新\x20package.json\x20name');}catch(_0x47b698){logger[_0x37042b(0x18b)]('create',_0x37042b(0x19c));throw _0x47b698;}}async function configureAppCode(_0x55537b,_0x3663cf,_0x104e8c){const _0x2496d3=a154_0x127c,_0x477b88=a154_0x359673['resolve'](process[_0x2496d3(0x197)](),_0x55537b),_0x525348=a154_0x359673['join'](_0x477b88,NEW_CONFIG_NAME);try{_0x3663cf?console[_0x2496d3(0x19b)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x55537b+':\x20'+_0x3663cf):console['log'](_0x2496d3(0x187)+_0x55537b);const _0x2c0c1f=getRabetbaseCliPackageRoot(),_0x520cc1=a154_0x359673[_0x2496d3(0x18e)](_0x2c0c1f,'package.json');let _0x2749ca=_0x2496d3(0x18d);try{const _0x5da8a8=JSON[_0x2496d3(0x171)](a154_0x2ebb38[_0x2496d3(0x1a8)](_0x520cc1,'utf8'));_0x2749ca=_0x5da8a8[_0x2496d3(0x19f)]||_0x2496d3(0x18d);}catch{}const _0x9ab26b=readConfig(),_0x31963f=typeof _0x9ab26b[_0x2496d3(0x1c3)]===_0x2496d3(0x17b)?_0x9ab26b['env']:undefined,_0x50ae48={};for(const _0xb26ec6 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x9ab26b[_0xb26ec6]!=null)_0x50ae48[_0xb26ec6]=_0x9ab26b[_0xb26ec6];}const _0x492654=buildCanonicalProjectConfig(_0x50ae48,{'appCodes':_0x3663cf?[_0x3663cf]:[],'env':_0x104e8c||_0x31963f||_0x2496d3(0x1d1),'metadata':{'createdAt':new Date()[_0x2496d3(0x17c)](),'version':_0x2749ca}});writeConfigFile(_0x525348,_0x492654),_0x3663cf?console[_0x2496d3(0x19b)](_0x2496d3(0x188)+Object[_0x2496d3(0x19e)](_0x492654[_0x2496d3(0x1b9)]||{})['join'](',\x20')+_0x2496d3(0x185)+_0x492654[_0x2496d3(0x1d0)]):console[_0x2496d3(0x19b)](_0x2496d3(0x1a2)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger['info'](_0x2496d3(0x192),'配置应用AppCode:\x20'+_0x3663cf);}catch(_0x548e00){logger[_0x2496d3(0x18b)](_0x2496d3(0x192),_0x2496d3(0x18f));}}function a154_0x46f4(){const _0x521fb8=['trim','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','\x20run\x20start','writeFileSync','constants','*\x20Pulling\x20API\x20configuration...','721536IdZMSw','readFileSync','chdir','repeat','fail','resolve','\x20\x202.\x20Pull\x20API\x20configuration:\x20','minimumVersion','\x20&&\x20','name','Copy\x20project\x20files','setLogPath','Format\x20code','Project\x20name\x20cannot\x20be\x20empty','√\x20package.json\x20updated:\x20name=','currentVersion','success','stableVersion','apps','80YhsEkU','Project\x20directory\x20','1421976zsRARG','package.json','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','8QmQozE','CLI\x20版本检查','test','accessSync','env','3224431dLpbUq','gray','projectName','dirname','message','...','green','\x20|\x20AppCode:\x20','Install\x20dependencies','\x20Generated\x20by\x20rabetbase\x20cli\x20','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','30mIzwXS','defaultApp','production','W_OK','\x20model(s)','项目创建完成:\x20','清理项目目录失败:\x20','warn','parse','info','\x20√\x20','499036OLSZQU','needsUpgrade','belowMinimum','rmSync','开始创建项目:\x20','start','API\x20配置拉取异常','string','toLocaleString','\x20already\x20exists','API\x20configuration\x20pulled:\x20','stringify','projectCode','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','cd\x20','length','√\x20Pulled\x20','\x20|\x20Default:\x20','cyan','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','√\x20Configuration\x20file\x20created,\x20Apps:\x20','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','description','error','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','1.0.0','join','配置应用AppCode失败','existsSync','appCode','create','229270UCjtNg','bold','609972MuuSSv','321831dkysEt','cwd','utf8','\x20\x201.\x20Start\x20project:\x20','cookie','log','更新\x20package.json\x20失败','Project\x20name:\x20','keys','version','🚀\x20Next\x20Steps:'];a154_0x46f4=function(){return _0x521fb8;};return a154_0x46f4();}
1
+ (function(_0x489807,_0x8ade53){const _0x9f8fa5=a154_0x31f7,_0x324de0=_0x489807();while(!![]){try{const _0x3ca3f6=parseInt(_0x9f8fa5(0x10a))/0x1+-parseInt(_0x9f8fa5(0xf5))/0x2+-parseInt(_0x9f8fa5(0x111))/0x3*(parseInt(_0x9f8fa5(0x10b))/0x4)+parseInt(_0x9f8fa5(0xe2))/0x5*(-parseInt(_0x9f8fa5(0xea))/0x6)+-parseInt(_0x9f8fa5(0x11b))/0x7+-parseInt(_0x9f8fa5(0x108))/0x8+parseInt(_0x9f8fa5(0xd4))/0x9;if(_0x3ca3f6===_0x8ade53)break;else _0x324de0['push'](_0x324de0['shift']());}catch(_0x41da1d){_0x324de0['push'](_0x324de0['shift']());}}}(a154_0x5333,0x79eb3));import a154_0x1c4608 from'path';import a154_0x4c40ce from'fs';import a154_0x23c5ea from'chalk';import a154_0x3e6580 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{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';function a154_0x31f7(_0x54d93e,_0x4b4f3a){_0x54d93e=_0x54d93e-0xc5;const _0x533362=a154_0x5333();let _0x31f731=_0x533362[_0x54d93e];return _0x31f731;}import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';function a154_0x5333(){const _0x7417c8=['stringify','repeat','\x20|\x20Default:\x20','projectCode','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','6CKcWjO','Project\x20directory\x20','Project\x20name\x20cannot\x20be\x20empty','1.0.0','cwd','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','...','配置应用AppCode失败','error','env','readFileSync','1582656qfAWYx','\x20run\x20start','\x20model(s)','writeFileSync','\x20√\x20','join','utf8','CLI\x20版本检查','*\x20Pulling\x20API\x20configuration...','toLocaleString','chdir','version','needsUpgrade','green','appCode','Install\x20dependencies','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','production','bold','645816FRJVzv','apps','522368HyDViS','201844KAfqsx','package.json','keys','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','\x20|\x20AppCode:\x20','cyan','3PZjrgy','\x20api\x20pull','API\x20配置拉取异常','\x20already\x20exists','success','log','create','项目创建完成:\x20','stop','warn','5646648kLWCNp','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','项目创建失败:\x20','dirname','更新\x20package.json\x20name','description','setLogPath','start','🚀\x20Next\x20Steps:','Format\x20code','string','message','\x20Generated\x20by\x20rabetbase\x20cli\x20','\x20dataset(s),\x20generated\x20','\x20\x202.\x20Pull\x20API\x20configuration:\x20','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','existsSync','16688340zoBlWx','modelCount','parse','projectName','更新\x20package.json\x20失败','√\x20Configuration\x20file\x20created,\x20Apps:\x20','currentVersion','\x20config\x20set\x20appcode\x20<app-code>\x27','cookie','*\x20Configuring\x20AppCode\x20for\x20project\x20','resolve','belowMinimum','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','info','740345LXxWeI','length','配置应用AppCode:\x20'];a154_0x5333=function(){return _0x7417c8;};return a154_0x5333();}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';export async function createApp(_0xc1f49b){const _0x1a4736=a154_0x31f7,_0x4dcf6e=await checkCliVersion();(_0x4dcf6e[_0x1a4736(0x101)]||_0x4dcf6e['belowMinimum'])&&(printCliUpgradeWarning(_0x4dcf6e),assertCliVersionSupported(_0x4dcf6e),logger['info'](_0x1a4736(0x117),_0x1a4736(0xfc),{'currentVersion':_0x4dcf6e[_0x1a4736(0xda)],'stableVersion':_0x4dcf6e['stableVersion'],'minimumVersion':_0x4dcf6e['minimumVersion'],'needsUpgrade':_0x4dcf6e[_0x1a4736(0x101)],'belowMinimum':_0x4dcf6e[_0x1a4736(0xdf)]}));if(_0xc1f49b[_0x1a4736(0xe8)]&&_0xc1f49b['appCode'])await runCreate({'projectName':_0xc1f49b['projectCode'],'appCode':_0xc1f49b[_0x1a4736(0x103)],'env':_0xc1f49b[_0x1a4736(0xf3)]},_0xc1f49b);else{if(_0xc1f49b[_0x1a4736(0xe8)]){const _0x208a8c=await selectSingleAppcode(_0xc1f49b[_0x1a4736(0xdc)]);await runCreate({'projectName':_0xc1f49b['projectCode'],'appCode':_0x208a8c||undefined,'env':_0xc1f49b[_0x1a4736(0xf3)]},_0xc1f49b);}else await guidedCreateProject(_0x2f7b14=>runCreate(_0x2f7b14,_0xc1f49b),_0xc1f49b[_0x1a4736(0xf3)],_0xc1f49b[_0x1a4736(0xdc)]);}}async function runCreate(_0x1388fe,_0x1f9fe5){const _0x4cb3e0=a154_0x31f7;if(!_0x1388fe[_0x4cb3e0(0xd7)]||_0x1388fe[_0x4cb3e0(0xd7)]['trim']()==='')throw new Error(_0x4cb3e0(0xec));const _0x5d558a=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x5d558a['test'](_0x1388fe[_0x4cb3e0(0xd7)]))throw new Error(_0x4cb3e0(0xd2));if(_0x1388fe[_0x4cb3e0(0xd7)][_0x4cb3e0(0xe3)]>0x64)throw new Error(_0x4cb3e0(0xef));const _0x1e1aef=a154_0x1c4608[_0x4cb3e0(0xde)](process['cwd'](),_0x1388fe[_0x4cb3e0(0xd7)]);if(a154_0x4c40ce[_0x4cb3e0(0xd3)](_0x1e1aef))throw new Error(_0x4cb3e0(0xeb)+_0x1388fe[_0x4cb3e0(0xd7)]+_0x4cb3e0(0x114));try{a154_0x4c40ce['accessSync'](a154_0x1c4608[_0x4cb3e0(0xc6)](_0x1e1aef),a154_0x4c40ce['constants']['W_OK']);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x4cb3e0(0xc9)](_0x1e1aef),logger[_0x4cb3e0(0xe1)](_0x4cb3e0(0x117),'开始创建项目:\x20'+_0x1388fe[_0x4cb3e0(0xd7)],{'projectDir':_0x1e1aef,'appCode':_0x1388fe['appCode']}),console[_0x4cb3e0(0x116)](),console['log'](a154_0x23c5ea[_0x4cb3e0(0x102)](_0x4cb3e0(0xf9))+'Project\x20name:\x20'+a154_0x23c5ea[_0x4cb3e0(0x102)](_0x1388fe[_0x4cb3e0(0xd7)])+(_0x1388fe[_0x4cb3e0(0x103)]?_0x4cb3e0(0x10f)+a154_0x23c5ea[_0x4cb3e0(0x110)](_0x1388fe['appCode']):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x1388fe[_0x4cb3e0(0xd7)])),await updatePackageJsonName(_0x1388fe[_0x4cb3e0(0xd7)]),await runTask(_0x4cb3e0(0x104),()=>installDependencies(_0x1388fe['projectName'])),await runTask(_0x4cb3e0(0xcc),()=>formatProjectCode(_0x1388fe[_0x4cb3e0(0xd7)])),await configureAppCode(_0x1388fe['projectName'],_0x1388fe[_0x4cb3e0(0x103)]||'',_0x1388fe[_0x4cb3e0(0xf3)]);let _0x46870e=![];if(_0x1388fe['appCode']){console['log'](_0x4cb3e0(0xfd));const _0x4d2345=process[_0x4cb3e0(0xee)]();try{process['chdir'](_0x1e1aef);const _0x33c793=_0x1388fe[_0x4cb3e0(0xf3)]||_0x4cb3e0(0x106);initEnv(_0x33c793);const {configArray:_0x4d2235}=await fetchModelList(_0x1388fe[_0x4cb3e0(0x103)],_0x1f9fe5[_0x4cb3e0(0xdc)]||''),_0x2cc289=DEFAULT_API_DIR,_0x226ea3=await generateApiFile(_0x4d2235,'',_0x1388fe[_0x4cb3e0(0x103)],!![],_0x33c793,_0x2cc289);console[_0x4cb3e0(0x116)]('√\x20Pulled\x20'+_0x4d2235[_0x4cb3e0(0xe3)]+_0x4cb3e0(0xd0)+_0x226ea3[_0x4cb3e0(0xd5)]+_0x4cb3e0(0xf7)),logger[_0x4cb3e0(0xe1)]('create','API\x20configuration\x20pulled:\x20'+_0x1388fe[_0x4cb3e0(0x103)]);}catch(_0x2e3af4){_0x46870e=!![],console[_0x4cb3e0(0x116)](_0x4cb3e0(0xe9)),logger[_0x4cb3e0(0x11a)](_0x4cb3e0(0x117),_0x4cb3e0(0x113),{'error':_0x2e3af4 instanceof Error?_0x2e3af4[_0x4cb3e0(0xce)]:String(_0x2e3af4)});}finally{process[_0x4cb3e0(0xff)](_0x4d2345);}}logger[_0x4cb3e0(0x115)](_0x4cb3e0(0x117),_0x4cb3e0(0x118)+_0x1388fe[_0x4cb3e0(0xd7)]),console[_0x4cb3e0(0x116)](),console[_0x4cb3e0(0x116)](a154_0x23c5ea['green']('─'[_0x4cb3e0(0xe6)](0x3c))),console[_0x4cb3e0(0x116)](a154_0x23c5ea[_0x4cb3e0(0x110)][_0x4cb3e0(0x107)](_0x4cb3e0(0xcb))),console[_0x4cb3e0(0x116)](),console[_0x4cb3e0(0x116)]('\x20\x201.\x20Start\x20project:\x20'+a154_0x23c5ea['cyan'][_0x4cb3e0(0x107)]('cd\x20'+_0x1388fe[_0x4cb3e0(0xd7)]+'\x20&&\x20'+CLI_BIN_NAME+_0x4cb3e0(0xf6))),_0x46870e&&console[_0x4cb3e0(0x116)](_0x4cb3e0(0xd1)+a154_0x23c5ea[_0x4cb3e0(0x110)][_0x4cb3e0(0x107)](CLI_BIN_NAME+_0x4cb3e0(0x112))),console[_0x4cb3e0(0x116)](a154_0x23c5ea[_0x4cb3e0(0x102)]('─'[_0x4cb3e0(0xe6)](0x3c)));}catch(_0x4b40e7){logger[_0x4cb3e0(0xf2)](_0x4cb3e0(0x117),_0x4cb3e0(0xc5)+_0x1388fe['projectName'],{'error':_0x4b40e7 instanceof Error?_0x4b40e7[_0x4cb3e0(0xce)]:String(_0x4b40e7)});try{a154_0x4c40ce['existsSync'](_0x1e1aef)&&(console[_0x4cb3e0(0x116)](_0x4cb3e0(0x105)+_0x1e1aef),a154_0x4c40ce['rmSync'](_0x1e1aef,{'recursive':!![],'force':!![]}));}catch{logger[_0x4cb3e0(0x11a)](_0x4cb3e0(0x117),'清理项目目录失败:\x20'+_0x1e1aef);}throw _0x4b40e7;}}async function runTask(_0x1fa2d6,_0x58d33f){const _0x5b9aa2=a154_0x31f7,_0x21827d=a154_0x3e6580(_0x1fa2d6+_0x5b9aa2(0xf0))[_0x5b9aa2(0xca)]();try{const _0x4ccd21=await _0x58d33f();_0x21827d[_0x5b9aa2(0x119)](),console['log'](''+a154_0x23c5ea[_0x5b9aa2(0x102)]('\x20√\x20')+_0x1fa2d6+'\x20'+a154_0x23c5ea['gray']('['+_0x4ccd21+']'));}catch(_0x20a9a5){_0x21827d['fail'](_0x1fa2d6);throw _0x20a9a5;}}async function updatePackageJsonName(_0x23ed8a){const _0x22e138=a154_0x31f7,_0x23b9c8=a154_0x1c4608[_0x22e138(0xde)](process[_0x22e138(0xee)](),_0x23ed8a),_0x349a56=a154_0x1c4608[_0x22e138(0xfa)](_0x23b9c8,_0x22e138(0x10c));try{console[_0x22e138(0x116)](_0x22e138(0x11c));const _0x139d03=getRabetbaseCliPackageRoot(),_0x4cf360=a154_0x1c4608[_0x22e138(0xfa)](_0x139d03,_0x22e138(0x10c));let _0x287f24=_0x22e138(0xed);try{const _0x1bac1f=JSON['parse'](a154_0x4c40ce[_0x22e138(0xf4)](_0x4cf360,'utf8'));_0x287f24=_0x1bac1f[_0x22e138(0x100)]||'1.0.0';}catch{}const _0x328762=a154_0x4c40ce[_0x22e138(0xf4)](_0x349a56,_0x22e138(0xfb)),_0x2783ab=JSON[_0x22e138(0xd6)](_0x328762);_0x2783ab['name']=_0x23ed8a,_0x2783ab[_0x22e138(0xc8)]=_0x23ed8a+_0x22e138(0xcf)+_0x287f24,a154_0x4c40ce[_0x22e138(0xf8)](_0x349a56,JSON[_0x22e138(0xe5)](_0x2783ab,null,0x2)+'\x0a',_0x22e138(0xfb)),console[_0x22e138(0x116)]('√\x20package.json\x20updated:\x20name='+_0x23ed8a),logger[_0x22e138(0xe1)]('create',_0x22e138(0xc7));}catch(_0x193d5a){logger[_0x22e138(0xf2)](_0x22e138(0x117),_0x22e138(0xd8));throw _0x193d5a;}}async function configureAppCode(_0x251052,_0x29ec47,_0x1a5b52){const _0x4dff74=a154_0x31f7,_0x3ecb12=a154_0x1c4608['resolve'](process[_0x4dff74(0xee)](),_0x251052),_0x3d7749=a154_0x1c4608[_0x4dff74(0xfa)](_0x3ecb12,NEW_CONFIG_NAME);try{_0x29ec47?console[_0x4dff74(0x116)](_0x4dff74(0xdd)+_0x251052+':\x20'+_0x29ec47):console['log'](_0x4dff74(0xe0)+_0x251052);const _0x23dfc3=getRabetbaseCliPackageRoot(),_0x4bca39=a154_0x1c4608['join'](_0x23dfc3,_0x4dff74(0x10c));let _0x13e953=_0x4dff74(0xed);try{const _0x1def39=JSON[_0x4dff74(0xd6)](a154_0x4c40ce[_0x4dff74(0xf4)](_0x4bca39,_0x4dff74(0xfb)));_0x13e953=_0x1def39[_0x4dff74(0x100)]||_0x4dff74(0xed);}catch{}const _0x101f37=readConfig(),_0x5c3bf2=typeof _0x101f37['env']===_0x4dff74(0xcd)?_0x101f37[_0x4dff74(0xf3)]:undefined,_0x19d9fd={};for(const _0x45a067 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x101f37[_0x45a067]!=null)_0x19d9fd[_0x45a067]=_0x101f37[_0x45a067];}const _0x2eaa75=buildCanonicalProjectConfig(_0x19d9fd,{'appCodes':_0x29ec47?[_0x29ec47]:[],'env':_0x1a5b52||_0x5c3bf2||_0x4dff74(0x106),'metadata':{'createdAt':new Date()[_0x4dff74(0xfe)](),'version':_0x13e953}});writeConfigFile(_0x3d7749,_0x2eaa75),_0x29ec47?console['log'](_0x4dff74(0xd9)+Object[_0x4dff74(0x10d)](_0x2eaa75[_0x4dff74(0x109)]||{})[_0x4dff74(0xfa)](',\x20')+_0x4dff74(0xe7)+_0x2eaa75['defaultApp']):console[_0x4dff74(0x116)](_0x4dff74(0x10e)+CLI_BIN_NAME+_0x4dff74(0xdb)),logger['info'](_0x4dff74(0x117),_0x4dff74(0xe4)+_0x29ec47);}catch(_0xc9835f){logger['error'](_0x4dff74(0x117),_0x4dff74(0xf1));}}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 非交互模式的项目创建逻辑
3
+ *
4
+ * 用于 CI/CD 环境或没有 TTY 的场景
5
+ */
6
+ /**
7
+ * 非交互模式创建项目
8
+ */
9
+ export declare function createProjectNonInteractive(projectName: string, env?: string, appCode?: string, cookie?: string): Promise<void>;
@@ -1 +1 @@
1
- (function(_0x5bd049,_0x5afc59){const _0x200de7=a155_0x2af8,_0x45ba78=_0x5bd049();while(!![]){try{const _0x4ce4cf=-parseInt(_0x200de7(0x11f))/0x1*(-parseInt(_0x200de7(0x13b))/0x2)+parseInt(_0x200de7(0x12b))/0x3+parseInt(_0x200de7(0x149))/0x4*(parseInt(_0x200de7(0x142))/0x5)+-parseInt(_0x200de7(0x143))/0x6*(-parseInt(_0x200de7(0x12a))/0x7)+parseInt(_0x200de7(0x13c))/0x8+-parseInt(_0x200de7(0x120))/0x9*(-parseInt(_0x200de7(0x116))/0xa)+-parseInt(_0x200de7(0x13a))/0xb;if(_0x4ce4cf===_0x5afc59)break;else _0x45ba78['push'](_0x45ba78['shift']());}catch(_0x2c04e2){_0x45ba78['push'](_0x45ba78['shift']());}}}(a155_0x26a1,0x199c4));import a155_0x3d2eca from'path';import a155_0x108a0a from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';function a155_0x26a1(){const _0x5cb937=['writeFile','\x0a\x20\x20cd\x20','readFile','string','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','trim','5006122DlYZYB','198HdUczW','817792DQePvr','belowMinimum','*\x20Creating\x20project\x20','W_OK','description','length','290aHzHLz','6PQeZVL','...','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x20\x20Pulling\x20API\x20configuration...','\x0a√\x20Project\x20','Project\x20directory\x20\x22','4220lxemTR','\x22\x20already\x20exists.','\x20api\x20pull`\x20manually\x20later.','ignore','test','needsUpgrade','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','\x20\x20√\x20Pulled\x20','join','Check\x20directory\x20permissions.','\x20\x20rabetbase\x20run\x20start\x0a','10NGUIGa','parse','log','npm','\x20\x20√\x20Project\x20template\x20created','bun','\x20\x20Installing\x20dependencies...','modelCount','bun\x20run\x20format','13GHYZwl','554157HOQOUP','production','access','\x20\x20√\x20package.json\x20updated','resolve','\x20created\x20successfully!','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','\x20\x20√\x20Configuration\x20file\x20created','bun\x20--version','Project\x20name\x20contains\x20invalid\x20characters.','1329846yakgIS','431250boureS','\x20dataset(s),\x20generated\x20','validation','package.json','chdir','dirname','Use\x20a\x20different\x20project\x20name.','cwd','toLocaleString'];a155_0x26a1=function(){return _0x5cb937;};return a155_0x26a1();}import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';function a155_0x2af8(_0x119073,_0x3e9813){_0x119073=_0x119073-0x10c;const _0x26a1ce=a155_0x26a1();let _0x2af821=_0x26a1ce[_0x119073];return _0x2af821;}import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x3618e9,_0x86e5f1,_0x4567a3,_0x5e7783){const _0x44ca26=a155_0x2af8,_0x2f9ca9=await checkCliVersion();(_0x2f9ca9[_0x44ca26(0x110)]||_0x2f9ca9[_0x44ca26(0x13d)])&&(printCliUpgradeWarning(_0x2f9ca9),assertCliVersionSupported(_0x2f9ca9));if(!_0x3618e9||_0x3618e9[_0x44ca26(0x139)]()==='')throw CliErrors['validation']('Project\x20name\x20cannot\x20be\x20empty.');const _0x513e8e=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x513e8e[_0x44ca26(0x10f)](_0x3618e9))throw CliErrors[_0x44ca26(0x12d)](_0x44ca26(0x129),_0x44ca26(0x138));if(_0x3618e9[_0x44ca26(0x141)]>0x64)throw CliErrors[_0x44ca26(0x12d)](_0x44ca26(0x126));const _0x5f4b24=a155_0x3d2eca['resolve'](process[_0x44ca26(0x132)](),_0x3618e9);if(existsSync(_0x5f4b24))throw CliErrors['validation'](_0x44ca26(0x148)+_0x3618e9+_0x44ca26(0x10c),_0x44ca26(0x131));try{const _0x40a41f=a155_0x3d2eca[_0x44ca26(0x130)](_0x5f4b24);await a155_0x108a0a[_0x44ca26(0x122)](_0x40a41f,a155_0x108a0a['constants'][_0x44ca26(0x13f)]);}catch{throw CliErrors[_0x44ca26(0x12d)](_0x44ca26(0x145),_0x44ca26(0x114));}try{console['log'](_0x44ca26(0x13e)+_0x3618e9+_0x44ca26(0x144));const _0x46835d=getSubAppReactDemoTemplateDir();await copyDirectory(_0x46835d,_0x5f4b24),console[_0x44ca26(0x118)](_0x44ca26(0x11a)),await updatePackageJsonName(_0x3618e9),console[_0x44ca26(0x118)](_0x44ca26(0x123)),console[_0x44ca26(0x118)](_0x44ca26(0x11c)),console['log']('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x5f4b24),console[_0x44ca26(0x118)]('\x20\x20√\x20Code\x20formatted'),await configureProject(_0x3618e9,_0x4567a3,_0x86e5f1),console[_0x44ca26(0x118)](_0x44ca26(0x127)),_0x4567a3&&await pullApiConfig(_0x5f4b24,_0x4567a3,_0x86e5f1,_0x5e7783),console[_0x44ca26(0x118)](_0x44ca26(0x147)+_0x3618e9+_0x44ca26(0x125)),console[_0x44ca26(0x118)](_0x44ca26(0x135)+_0x3618e9),console[_0x44ca26(0x118)](_0x44ca26(0x115));}catch(_0x45c7ef){try{existsSync(_0x5f4b24)&&await a155_0x108a0a['rm'](_0x5f4b24,{'recursive':!![],'force':!![]});}catch{}throw _0x45c7ef;}}async function updatePackageJsonName(_0x4f0241){const _0x3aa607=a155_0x2af8,_0x4b80b4=a155_0x3d2eca['resolve'](process[_0x3aa607(0x132)](),_0x4f0241),_0x3a29d9=a155_0x3d2eca['join'](_0x4b80b4,_0x3aa607(0x12e)),_0x43fdc7=await a155_0x108a0a[_0x3aa607(0x136)](_0x3a29d9,'utf-8'),_0x57e86d=JSON[_0x3aa607(0x117)](_0x43fdc7);_0x57e86d['name']=_0x4f0241,_0x57e86d[_0x3aa607(0x140)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a155_0x108a0a[_0x3aa607(0x134)](_0x3a29d9,JSON['stringify'](_0x57e86d,null,0x2)+'\x0a');}function detectPackageManager(){const _0x38a9a0=a155_0x2af8;try{return execSync(_0x38a9a0(0x128),{'stdio':_0x38a9a0(0x10e)}),_0x38a9a0(0x11b);}catch{return _0x38a9a0(0x119);}}async function formatCode(_0xb6c172){const _0x6630a1=a155_0x2af8;try{await execAsync(_0x6630a1(0x11e),{'cwd':_0xb6c172});}catch{}}async function configureProject(_0x4c852c,_0x51d9e0,_0x286fff){const _0x32564c=a155_0x2af8,_0x46d256=a155_0x3d2eca[_0x32564c(0x124)](process[_0x32564c(0x132)](),_0x4c852c),_0xd00453=a155_0x3d2eca[_0x32564c(0x113)](_0x46d256,NEW_CONFIG_NAME),_0x176d10=readConfig(),_0x5c8d53=typeof _0x176d10['env']===_0x32564c(0x137)?_0x176d10['env']:undefined,_0x516e8d={};for(const _0x1b2d67 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x176d10[_0x1b2d67]!=null)_0x516e8d[_0x1b2d67]=_0x176d10[_0x1b2d67];}const _0x2fed5c=buildCanonicalProjectConfig(_0x516e8d,{'appCodes':_0x51d9e0?[_0x51d9e0]:[],'env':_0x286fff||_0x5c8d53||_0x32564c(0x121),'metadata':{'createdAt':new Date()[_0x32564c(0x133)](),'version':getCliVersion()}});writeConfigFile(_0xd00453,_0x2fed5c);}async function pullApiConfig(_0x7969c0,_0x58e817,_0x4bc345,_0x5309a8){const _0x3af761=a155_0x2af8,_0x330047=process[_0x3af761(0x132)]();try{process[_0x3af761(0x12f)](_0x7969c0);const _0x6018ec=_0x4bc345||_0x3af761(0x121);initEnv(_0x6018ec),console[_0x3af761(0x118)](_0x3af761(0x146));const {configArray:_0x2fb828}=await fetchModelList(_0x58e817,_0x5309a8||''),_0x3ecc18=await generateApiFile(_0x2fb828,'',_0x58e817,!![],_0x6018ec,DEFAULT_API_DIR);console['log'](_0x3af761(0x112)+_0x2fb828[_0x3af761(0x141)]+_0x3af761(0x12c)+_0x3ecc18[_0x3af761(0x11d)]+'\x20model(s)');}catch(_0xa17fa3){console[_0x3af761(0x118)](_0x3af761(0x111)+CLI_BIN_NAME+_0x3af761(0x10d));}finally{process[_0x3af761(0x12f)](_0x330047);}}
1
+ (function(_0x395b25,_0x339846){const _0x37fd9b=a155_0x4d9a,_0x19ef02=_0x395b25();while(!![]){try{const _0x49e2fd=-parseInt(_0x37fd9b(0x19f))/0x1+-parseInt(_0x37fd9b(0x19a))/0x2+parseInt(_0x37fd9b(0x1ba))/0x3*(parseInt(_0x37fd9b(0x197))/0x4)+-parseInt(_0x37fd9b(0x1a5))/0x5+-parseInt(_0x37fd9b(0x1ad))/0x6+parseInt(_0x37fd9b(0x1b5))/0x7+parseInt(_0x37fd9b(0x1b3))/0x8;if(_0x49e2fd===_0x339846)break;else _0x19ef02['push'](_0x19ef02['shift']());}catch(_0x292779){_0x19ef02['push'](_0x19ef02['shift']());}}}(a155_0x250c,0xf1b04));import a155_0x3bc7fd from'path';import a155_0x2ae80b from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';function a155_0x4d9a(_0x212fd4,_0x433c52){_0x212fd4=_0x212fd4-0x18a;const _0x250c95=a155_0x250c();let _0x4d9a13=_0x250c95[_0x212fd4];return _0x4d9a13;}import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';function a155_0x250c(){const _0x3c7f8a=['268945LAfcjy','toLocaleString','description','W_OK','bun\x20run\x20format','writeFile','\x0a\x20\x20cd\x20','Project\x20directory\x20\x22','7668996oLZwjx','ignore','modelCount','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x20\x20√\x20Code\x20formatted','\x20dataset(s),\x20generated\x20','34509912DdScTl','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','3864287vOIGDt','cwd','readFile','\x20\x20√\x20Pulled\x20','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','2597355kkgrIl','length','test','bun','\x20api\x20pull`\x20manually\x20later.','constants','Use\x20a\x20different\x20project\x20name.','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','env','npm','name','join','bun\x20--version','...','access','Project\x20name\x20cannot\x20be\x20empty.','log','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','4tXzddz','validation','parse','3769168AWGWhx','*\x20Creating\x20project\x20','production','chdir','resolve','1525070kqqaxn','needsUpgrade','\x20\x20√\x20Project\x20template\x20created','stringify','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','\x22\x20already\x20exists.'];a155_0x250c=function(){return _0x3c7f8a;};return a155_0x250c();}import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x3cbcbc,_0xa5d811,_0x1091fd,_0x442f7a){const _0x1c60c8=a155_0x4d9a,_0x10443e=await checkCliVersion();(_0x10443e[_0x1c60c8(0x1a0)]||_0x10443e['belowMinimum'])&&(printCliUpgradeWarning(_0x10443e),assertCliVersionSupported(_0x10443e));if(!_0x3cbcbc||_0x3cbcbc['trim']()==='')throw CliErrors[_0x1c60c8(0x198)](_0x1c60c8(0x194));const _0x2abae2=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x2abae2[_0x1c60c8(0x1bc)](_0x3cbcbc))throw CliErrors['validation']('Project\x20name\x20contains\x20invalid\x20characters.',_0x1c60c8(0x1a3));if(_0x3cbcbc[_0x1c60c8(0x1bb)]>0x64)throw CliErrors[_0x1c60c8(0x198)](_0x1c60c8(0x196));const _0x5c668c=a155_0x3bc7fd[_0x1c60c8(0x19e)](process[_0x1c60c8(0x1b6)](),_0x3cbcbc);if(existsSync(_0x5c668c))throw CliErrors[_0x1c60c8(0x198)](_0x1c60c8(0x1ac)+_0x3cbcbc+_0x1c60c8(0x1a4),_0x1c60c8(0x18b));try{const _0x2f15d9=a155_0x3bc7fd['dirname'](_0x5c668c);await a155_0x2ae80b[_0x1c60c8(0x193)](_0x2f15d9,a155_0x2ae80b[_0x1c60c8(0x18a)][_0x1c60c8(0x1a8)]);}catch{throw CliErrors[_0x1c60c8(0x198)](_0x1c60c8(0x1b0),'Check\x20directory\x20permissions.');}try{console[_0x1c60c8(0x195)](_0x1c60c8(0x19b)+_0x3cbcbc+_0x1c60c8(0x192));const _0x56329d=getSubAppReactDemoTemplateDir();await copyDirectory(_0x56329d,_0x5c668c),console[_0x1c60c8(0x195)](_0x1c60c8(0x1a1)),await updatePackageJsonName(_0x3cbcbc),console['log']('\x20\x20√\x20package.json\x20updated'),console[_0x1c60c8(0x195)]('\x20\x20Installing\x20dependencies...'),console[_0x1c60c8(0x195)](_0x1c60c8(0x1b9)),await formatCode(_0x5c668c),console['log'](_0x1c60c8(0x1b1)),await configureProject(_0x3cbcbc,_0x1091fd,_0xa5d811),console[_0x1c60c8(0x195)]('\x20\x20√\x20Configuration\x20file\x20created'),_0x1091fd&&await pullApiConfig(_0x5c668c,_0x1091fd,_0xa5d811,_0x442f7a),console[_0x1c60c8(0x195)]('\x0a√\x20Project\x20'+_0x3cbcbc+'\x20created\x20successfully!'),console[_0x1c60c8(0x195)](_0x1c60c8(0x1ab)+_0x3cbcbc),console[_0x1c60c8(0x195)]('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0x245236){try{existsSync(_0x5c668c)&&await a155_0x2ae80b['rm'](_0x5c668c,{'recursive':!![],'force':!![]});}catch{}throw _0x245236;}}async function updatePackageJsonName(_0x29eb18){const _0xc56250=a155_0x4d9a,_0x373218=a155_0x3bc7fd[_0xc56250(0x19e)](process['cwd'](),_0x29eb18),_0x5012ca=a155_0x3bc7fd[_0xc56250(0x190)](_0x373218,'package.json'),_0x167c31=await a155_0x2ae80b[_0xc56250(0x1b7)](_0x5012ca,'utf-8'),_0x3ce19f=JSON[_0xc56250(0x199)](_0x167c31);_0x3ce19f[_0xc56250(0x18f)]=_0x29eb18,_0x3ce19f[_0xc56250(0x1a7)]=_0xc56250(0x18c),await a155_0x2ae80b[_0xc56250(0x1aa)](_0x5012ca,JSON[_0xc56250(0x1a2)](_0x3ce19f,null,0x2)+'\x0a');}function detectPackageManager(){const _0x3ab8a2=a155_0x4d9a;try{return execSync(_0x3ab8a2(0x191),{'stdio':_0x3ab8a2(0x1ae)}),_0x3ab8a2(0x1bd);}catch{return _0x3ab8a2(0x18e);}}async function formatCode(_0x1edd41){const _0x4e6855=a155_0x4d9a;try{await execAsync(_0x4e6855(0x1a9),{'cwd':_0x1edd41});}catch{}}async function configureProject(_0x5967f6,_0x27da72,_0x1a1ff3){const _0x4948f6=a155_0x4d9a,_0x33d532=a155_0x3bc7fd['resolve'](process['cwd'](),_0x5967f6),_0x16225b=a155_0x3bc7fd[_0x4948f6(0x190)](_0x33d532,NEW_CONFIG_NAME),_0x4d0e9d=readConfig(),_0xd50367=typeof _0x4d0e9d[_0x4948f6(0x18d)]==='string'?_0x4d0e9d['env']:undefined,_0x2a39de={};for(const _0x47721c of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x4d0e9d[_0x47721c]!=null)_0x2a39de[_0x47721c]=_0x4d0e9d[_0x47721c];}const _0x98c524=buildCanonicalProjectConfig(_0x2a39de,{'appCodes':_0x27da72?[_0x27da72]:[],'env':_0x1a1ff3||_0xd50367||_0x4948f6(0x19c),'metadata':{'createdAt':new Date()[_0x4948f6(0x1a6)](),'version':getCliVersion()}});writeConfigFile(_0x16225b,_0x98c524);}async function pullApiConfig(_0x22244c,_0x146a1c,_0xb0c541,_0x3db003){const _0x4826ca=a155_0x4d9a,_0x241bc1=process[_0x4826ca(0x1b6)]();try{process['chdir'](_0x22244c);const _0x4e95e5=_0xb0c541||'production';initEnv(_0x4e95e5),console[_0x4826ca(0x195)]('\x20\x20Pulling\x20API\x20configuration...');const {configArray:_0x407fd0}=await fetchModelList(_0x146a1c,_0x3db003||''),_0x23586f=await generateApiFile(_0x407fd0,'',_0x146a1c,!![],_0x4e95e5,DEFAULT_API_DIR);console['log'](_0x4826ca(0x1b8)+_0x407fd0[_0x4826ca(0x1bb)]+_0x4826ca(0x1b2)+_0x23586f[_0x4826ca(0x1af)]+'\x20model(s)');}catch(_0x37dd68){console[_0x4826ca(0x195)](_0x4826ca(0x1b4)+CLI_BIN_NAME+_0x4826ca(0x1be));}finally{process[_0x4826ca(0x19d)](_0x241bc1);}}
@@ -0,0 +1,4 @@
1
+ /** rabetbase-cli 包根目录(含 package.json、templates/) */
2
+ export declare function getRabetbaseCliPackageRoot(): string;
3
+ /** 子应用 React 脚手架模板目录 */
4
+ export declare function getSubAppReactDemoTemplateDir(): string;
@@ -1 +1 @@
1
- function a156_0xd36d(_0x3422c8,_0x86cb99){_0x3422c8=_0x3422c8-0xb8;const _0x103f0f=a156_0x103f();let _0xd36d92=_0x103f0f[_0x3422c8];return _0xd36d92;}(function(_0x263c37,_0x34765a){const _0x5e8761=a156_0xd36d,_0xdf5134=_0x263c37();while(!![]){try{const _0x59f3e9=-parseInt(_0x5e8761(0xbf))/0x1*(parseInt(_0x5e8761(0xc1))/0x2)+parseInt(_0x5e8761(0xc3))/0x3+parseInt(_0x5e8761(0xbc))/0x4+-parseInt(_0x5e8761(0xbd))/0x5*(parseInt(_0x5e8761(0xbe))/0x6)+-parseInt(_0x5e8761(0xc4))/0x7*(parseInt(_0x5e8761(0xc2))/0x8)+-parseInt(_0x5e8761(0xc7))/0x9*(parseInt(_0x5e8761(0xc0))/0xa)+-parseInt(_0x5e8761(0xc6))/0xb*(-parseInt(_0x5e8761(0xbb))/0xc);if(_0x59f3e9===_0x34765a)break;else _0xdf5134['push'](_0xdf5134['shift']());}catch(_0x458561){_0xdf5134['push'](_0xdf5134['shift']());}}}(a156_0x103f,0xd487d));import a156_0x504195 from'node:path';function a156_0x103f(){const _0x42d640=['30983412JBVAHv','68856LHxBCh','14095vbcgxW','1578PnzYWn','37585luIBrO','2823910Bjowyf','18lGcnpz','72oMUsPo','3191877ueoBrz','673372KBWjLQ','resolve','11WheqzY','27znluXZ','sub-app-react-demo','../../../../','join','projects'];a156_0x103f=function(){return _0x42d640;};return a156_0x103f();}import{fileURLToPath}from'node:url';const __dirname=a156_0x504195['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x3a2b2e=a156_0xd36d;return a156_0x504195[_0x3a2b2e(0xc5)](__dirname,_0x3a2b2e(0xb8));}export function getSubAppReactDemoTemplateDir(){const _0x475613=a156_0xd36d;return a156_0x504195[_0x475613(0xb9)](getRabetbaseCliPackageRoot(),'templates',_0x475613(0xba),_0x475613(0xc8));}
1
+ function a156_0x4139(){const _0x2c3161=['205920ziSvea','../../../../','10608633sBDVqg','templates','dirname','6602766HeLosv','24YiajGk','2448733cfuPbk','143558wAkIGT','24861dzMbgc','resolve','8nPFRyw','202805TzPnGv','join'];a156_0x4139=function(){return _0x2c3161;};return a156_0x4139();}const a156_0x4b4b9d=a156_0x32c3;(function(_0x111b4f,_0x5873d7){const _0x519b88=a156_0x32c3,_0x433c86=_0x111b4f();while(!![]){try{const _0x17414a=-parseInt(_0x519b88(0xcc))/0x1+-parseInt(_0x519b88(0xc6))/0x2+parseInt(_0x519b88(0xc7))/0x3+parseInt(_0x519b88(0xc9))/0x4*(parseInt(_0x519b88(0xca))/0x5)+-parseInt(_0x519b88(0xc3))/0x6+-parseInt(_0x519b88(0xc5))/0x7*(-parseInt(_0x519b88(0xc4))/0x8)+parseInt(_0x519b88(0xc0))/0x9;if(_0x17414a===_0x5873d7)break;else _0x433c86['push'](_0x433c86['shift']());}catch(_0x2292b6){_0x433c86['push'](_0x433c86['shift']());}}}(a156_0x4139,0xe55b3));function a156_0x32c3(_0x5cf0db,_0x3042b4){_0x5cf0db=_0x5cf0db-0xbf;const _0x413985=a156_0x4139();let _0x32c399=_0x413985[_0x5cf0db];return _0x32c399;}import a156_0x536f45 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a156_0x536f45[a156_0x4b4b9d(0xc2)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x185e2f=a156_0x4b4b9d;return a156_0x536f45[_0x185e2f(0xc8)](__dirname,_0x185e2f(0xbf));}export function getSubAppReactDemoTemplateDir(){const _0x5c92cd=a156_0x4b4b9d;return a156_0x536f45[_0x5c92cd(0xcb)](getRabetbaseCliPackageRoot(),_0x5c92cd(0xc1),'projects','sub-app-react-demo');}
@@ -0,0 +1 @@
1
+ export declare function copyProjectTemplate(projectCode: string): Promise<string>;
@@ -1 +1 @@
1
- function a157_0x3d56(_0x597835,_0x14b193){_0x597835=_0x597835-0x198;const _0x2f8eae=a157_0x2f8e();let _0x3d56ab=_0x2f8eae[_0x597835];return _0x3d56ab;}(function(_0x23cde5,_0xcd815a){const _0x252db3=a157_0x3d56,_0x2eff79=_0x23cde5();while(!![]){try{const _0x16cea7=-parseInt(_0x252db3(0x19f))/0x1+-parseInt(_0x252db3(0x19b))/0x2+-parseInt(_0x252db3(0x1a7))/0x3+parseInt(_0x252db3(0x198))/0x4*(-parseInt(_0x252db3(0x19a))/0x5)+-parseInt(_0x252db3(0x1a0))/0x6+-parseInt(_0x252db3(0x1a3))/0x7*(-parseInt(_0x252db3(0x1a8))/0x8)+parseInt(_0x252db3(0x19e))/0x9;if(_0x16cea7===_0xcd815a)break;else _0x2eff79['push'](_0x2eff79['shift']());}catch(_0x512965){_0x2eff79['push'](_0x2eff79['shift']());}}}(a157_0x2f8e,0x80efb));function a157_0x2f8e(){const _0x4d7839=['3699480gjoMVV','success','cwd','2513vinaFc','开始复制项目模板','项目模板复制完成','message','233862DiFwqW','14256DXEbcy','8XXSFKL','now','2564975SJpgNx','698730OGdqIV','error','copy','24016365SzGOTl','710211jeEVKw'];a157_0x2f8e=function(){return _0x4d7839;};return a157_0x2f8e();}import a157_0x3e9092 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x5a1e6f){const _0x58d681=a157_0x3d56,_0x2b56b6=Date[_0x58d681(0x199)](),_0x47254e=a157_0x3e9092['resolve'](process[_0x58d681(0x1a2)](),_0x5a1e6f);try{logger['info']('copy',_0x58d681(0x1a4),{'projectCode':_0x5a1e6f,'templateDir':templateDir}),await copyDirectory(templateDir,_0x47254e);const _0x9fb3df=Date['now']()-_0x2b56b6;logger[_0x58d681(0x1a1)](_0x58d681(0x19d),_0x58d681(0x1a5),_0x9fb3df,{'projectCode':_0x5a1e6f});}catch(_0x56a435){const _0x224d2b=Date['now']()-_0x2b56b6;logger[_0x58d681(0x19c)](_0x58d681(0x19d),'项目模板复制失败',{'projectCode':_0x5a1e6f,'error':_0x56a435 instanceof Error?_0x56a435[_0x58d681(0x1a6)]:String(_0x56a435),'duration':_0x224d2b});throw _0x56a435;}return formatElapsed(_0x2b56b6);}
1
+ (function(_0x75b324,_0x40f7eb){const _0x57bc84=a157_0x22aa,_0x16cd3d=_0x75b324();while(!![]){try{const _0xdb6b3e=-parseInt(_0x57bc84(0x121))/0x1+-parseInt(_0x57bc84(0x11d))/0x2*(parseInt(_0x57bc84(0x12f))/0x3)+parseInt(_0x57bc84(0x125))/0x4*(parseInt(_0x57bc84(0x12e))/0x5)+parseInt(_0x57bc84(0x126))/0x6+parseInt(_0x57bc84(0x12d))/0x7*(-parseInt(_0x57bc84(0x130))/0x8)+parseInt(_0x57bc84(0x129))/0x9*(-parseInt(_0x57bc84(0x127))/0xa)+parseInt(_0x57bc84(0x124))/0xb;if(_0xdb6b3e===_0x40f7eb)break;else _0x16cd3d['push'](_0x16cd3d['shift']());}catch(_0x10b565){_0x16cd3d['push'](_0x16cd3d['shift']());}}}(a157_0x54dc,0xd3178));import a157_0x32d6dd from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';function a157_0x22aa(_0x117760,_0x30079c){_0x117760=_0x117760-0x11d;const _0x54dc29=a157_0x54dc();let _0x22aa59=_0x54dc29[_0x117760];return _0x22aa59;}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a157_0x54dc(){const _0x502900=['8567720qftDTl','error','9QIYecO','开始复制项目模板','info','now','7514619BzARpw','28915gUEPzh','3DqAffA','8uCiaKz','项目模板复制完成','1728516qSplac','resolve','项目模板复制失败','message','985459WvjUUr','copy','cwd','25125375ISkPtR','572xWVsoL','9201264ILJoZR'];a157_0x54dc=function(){return _0x502900;};return a157_0x54dc();}import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x1fe4a4){const _0x503ba3=a157_0x22aa,_0x52000b=Date[_0x503ba3(0x12c)](),_0x32d370=a157_0x32d6dd[_0x503ba3(0x11e)](process[_0x503ba3(0x123)](),_0x1fe4a4);try{logger[_0x503ba3(0x12b)]('copy',_0x503ba3(0x12a),{'projectCode':_0x1fe4a4,'templateDir':templateDir}),await copyDirectory(templateDir,_0x32d370);const _0x4c7be2=Date[_0x503ba3(0x12c)]()-_0x52000b;logger['success'](_0x503ba3(0x122),_0x503ba3(0x131),_0x4c7be2,{'projectCode':_0x1fe4a4});}catch(_0x53302f){const _0x3680ed=Date[_0x503ba3(0x12c)]()-_0x52000b;logger[_0x503ba3(0x128)](_0x503ba3(0x122),_0x503ba3(0x11f),{'projectCode':_0x1fe4a4,'error':_0x53302f instanceof Error?_0x53302f[_0x503ba3(0x120)]:String(_0x53302f),'duration':_0x3680ed});throw _0x53302f;}return formatElapsed(_0x52000b);}
@@ -0,0 +1 @@
1
+ export declare function formatProjectCode(projectCode: string): Promise<string>;
@@ -1 +1 @@
1
- (function(_0x1edfec,_0x23baf1){const _0x3de3da=a158_0x5e47,_0x17f9ae=_0x1edfec();while(!![]){try{const _0x408096=parseInt(_0x3de3da(0x108))/0x1*(parseInt(_0x3de3da(0x106))/0x2)+-parseInt(_0x3de3da(0x10a))/0x3*(-parseInt(_0x3de3da(0xfb))/0x4)+-parseInt(_0x3de3da(0xfc))/0x5+parseInt(_0x3de3da(0x105))/0x6*(parseInt(_0x3de3da(0x104))/0x7)+parseInt(_0x3de3da(0x107))/0x8*(parseInt(_0x3de3da(0xff))/0x9)+-parseInt(_0x3de3da(0xfd))/0xa+parseInt(_0x3de3da(0x102))/0xb*(-parseInt(_0x3de3da(0xfe))/0xc);if(_0x408096===_0x23baf1)break;else _0x17f9ae['push'](_0x17f9ae['shift']());}catch(_0x522172){_0x17f9ae['push'](_0x17f9ae['shift']());}}}(a158_0x3d73,0x46527));import a158_0x3ffc49 from'node:path';function a158_0x5e47(_0x388dee,_0x5519c4){_0x388dee=_0x388dee-0xf9;const _0x3d7348=a158_0x3d73();let _0x5e4797=_0x3d7348[_0x388dee];return _0x5e4797;}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x140476){const _0x123b5c=a158_0x5e47,_0x270521=Date[_0x123b5c(0xfa)](),_0x36288c=a158_0x3ffc49['resolve'](process['cwd'](),_0x140476);try{logger[_0x123b5c(0x10c)](_0x123b5c(0x10b),'开始格式化代码',{'projectCode':_0x140476}),await execa(resolveNpmBin('npx'),[_0x123b5c(0xf9),_0x123b5c(0x101),'.'],{'cwd':_0x36288c});const _0x2127c4=Date[_0x123b5c(0xfa)]()-_0x270521;logger['success'](_0x123b5c(0x10b),_0x123b5c(0x109),_0x2127c4,{'projectCode':_0x140476});}catch(_0x4cc535){const _0x4a87a9=Date[_0x123b5c(0xfa)]()-_0x270521;logger[_0x123b5c(0x103)](_0x123b5c(0x10b),_0x123b5c(0x100),{'projectCode':_0x140476,'error':_0x4cc535 instanceof Error?_0x4cc535[_0x123b5c(0x10d)]:String(_0x4cc535),'duration':_0x4a87a9});throw _0x4cc535;}return formatElapsed(_0x270521);}function a158_0x3d73(){const _0x44315b=['3VHKCBR','format','info','message','prettier','now','2293336gxBZWx','1219065fZyZWz','1214450uPPcvu','60uAvbis','9xPeosL','代码格式化失败','--write','2095819wFyldF','error','590723HGALuF','30wXdDhX','26WzldiQ','1254040hYFrCu','34916XxxCEK','代码格式化完成'];a158_0x3d73=function(){return _0x44315b;};return a158_0x3d73();}
1
+ function a158_0x5eef(){const _0xd7b869=['18599vnmvjb','cwd','281224wRdYTa','--write','代码格式化完成','11256odwWOS','resolve','代码格式化失败','success','format','message','63MuqINK','1632205esoYVS','610068DpqPWC','now','94380sWIyLa','175756ghTyTI','prettier','6RaEzgx','npx'];a158_0x5eef=function(){return _0xd7b869;};return a158_0x5eef();}(function(_0xa24776,_0x30f4fd){const _0x75b34=a158_0x36ba,_0x1f98d8=_0xa24776();while(!![]){try{const _0x211588=parseInt(_0x75b34(0xbf))/0x1+parseInt(_0x75b34(0xce))/0x2+parseInt(_0x75b34(0xcc))/0x3+parseInt(_0x75b34(0xc4))/0x4+-parseInt(_0x75b34(0xcb))/0x5*(parseInt(_0x75b34(0xbd))/0x6)+-parseInt(_0x75b34(0xbb))/0x7+parseInt(_0x75b34(0xc1))/0x8*(parseInt(_0x75b34(0xca))/0x9);if(_0x211588===_0x30f4fd)break;else _0x1f98d8['push'](_0x1f98d8['shift']());}catch(_0x356005){_0x1f98d8['push'](_0x1f98d8['shift']());}}}(a158_0x5eef,0x28a51));import a158_0x39804c from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a158_0x36ba(_0x25d251,_0x1025c4){_0x25d251=_0x25d251-0xbb;const _0x5eefe1=a158_0x5eef();let _0x36baff=_0x5eefe1[_0x25d251];return _0x36baff;}import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x265f6a){const _0x35ff74=a158_0x36ba,_0x3a948f=Date[_0x35ff74(0xcd)](),_0x1b29c2=a158_0x39804c[_0x35ff74(0xc5)](process[_0x35ff74(0xc0)](),_0x265f6a);try{logger['info'](_0x35ff74(0xc8),'开始格式化代码',{'projectCode':_0x265f6a}),await execa(resolveNpmBin(_0x35ff74(0xbe)),[_0x35ff74(0xbc),_0x35ff74(0xc2),'.'],{'cwd':_0x1b29c2});const _0x448f5d=Date['now']()-_0x3a948f;logger[_0x35ff74(0xc7)]('format',_0x35ff74(0xc3),_0x448f5d,{'projectCode':_0x265f6a});}catch(_0x1002e8){const _0x29123b=Date[_0x35ff74(0xcd)]()-_0x3a948f;logger['error']('format',_0x35ff74(0xc6),{'projectCode':_0x265f6a,'error':_0x1002e8 instanceof Error?_0x1002e8[_0x35ff74(0xc9)]:String(_0x1002e8),'duration':_0x29123b});throw _0x1002e8;}return formatElapsed(_0x3a948f);}
@@ -0,0 +1 @@
1
+ export declare function installDependencies(projectCode: string): Promise<string>;
@@ -1 +1 @@
1
- function a159_0x4a2c(_0x120b97,_0x264bbf){_0x120b97=_0x120b97-0x14e;const _0x158ea1=a159_0x158e();let _0x4a2cd1=_0x158ea1[_0x120b97];return _0x4a2cd1;}(function(_0x502ce7,_0x3fa33c){const _0x46c640=a159_0x4a2c,_0x5b05c8=_0x502ce7();while(!![]){try{const _0x2e728e=parseInt(_0x46c640(0x155))/0x1+-parseInt(_0x46c640(0x14f))/0x2*(parseInt(_0x46c640(0x162))/0x3)+parseInt(_0x46c640(0x159))/0x4+parseInt(_0x46c640(0x156))/0x5*(-parseInt(_0x46c640(0x15b))/0x6)+-parseInt(_0x46c640(0x157))/0x7*(-parseInt(_0x46c640(0x15d))/0x8)+parseInt(_0x46c640(0x152))/0x9+parseInt(_0x46c640(0x153))/0xa;if(_0x2e728e===_0x3fa33c)break;else _0x5b05c8['push'](_0x5b05c8['shift']());}catch(_0x347d43){_0x5b05c8['push'](_0x5b05c8['shift']());}}}(a159_0x158e,0xa4073));import a159_0x19d611 from'node:path';function a159_0x158e(){const _0x3c1a42=['install','message','resolve','info','297lzNwHp','success','5488cIRLrC','--registry','error','6220638vVktgQ','7275520uDJAAC','https://registry.npmmirror.com','555339ZTyDpU','3244695DzCqwk','581KLKnyS','依赖安装完成','776788CnSuFc','now','12HVNoaM','依赖安装失败','7048HOtLBD'];a159_0x158e=function(){return _0x3c1a42;};return a159_0x158e();}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(_0x1d8177){const _0x4f04dc=a159_0x4a2c,_0x200d22=Date[_0x4f04dc(0x15a)](),_0x12cc3f=a159_0x19d611[_0x4f04dc(0x160)](process['cwd'](),_0x1d8177);try{logger[_0x4f04dc(0x161)](_0x4f04dc(0x15e),'开始安装依赖',{'projectCode':_0x1d8177,'registry':_0x4f04dc(0x154)}),await execa(resolveNpmBin('npm'),[_0x4f04dc(0x15e),_0x4f04dc(0x150),'https://registry.npmmirror.com'],{'cwd':_0x12cc3f});const _0x3b481f=Date[_0x4f04dc(0x15a)]()-_0x200d22;logger[_0x4f04dc(0x14e)](_0x4f04dc(0x15e),_0x4f04dc(0x158),_0x3b481f,{'projectCode':_0x1d8177});}catch(_0x41ceb5){const _0x3963a3=Date[_0x4f04dc(0x15a)]()-_0x200d22;logger[_0x4f04dc(0x151)](_0x4f04dc(0x15e),_0x4f04dc(0x15c),{'projectCode':_0x1d8177,'error':_0x41ceb5 instanceof Error?_0x41ceb5[_0x4f04dc(0x15f)]:String(_0x41ceb5),'duration':_0x3963a3});throw _0x41ceb5;}return formatElapsed(_0x200d22);}
1
+ (function(_0x46d0e8,_0x49a1f5){const _0x37fd0d=a159_0xdcd4,_0x43e8cc=_0x46d0e8();while(!![]){try{const _0x42c972=parseInt(_0x37fd0d(0x162))/0x1+parseInt(_0x37fd0d(0x15b))/0x2+parseInt(_0x37fd0d(0x15c))/0x3*(parseInt(_0x37fd0d(0x159))/0x4)+-parseInt(_0x37fd0d(0x153))/0x5+parseInt(_0x37fd0d(0x15a))/0x6+parseInt(_0x37fd0d(0x152))/0x7*(parseInt(_0x37fd0d(0x15e))/0x8)+-parseInt(_0x37fd0d(0x161))/0x9*(parseInt(_0x37fd0d(0x15d))/0xa);if(_0x42c972===_0x49a1f5)break;else _0x43e8cc['push'](_0x43e8cc['shift']());}catch(_0x1af927){_0x43e8cc['push'](_0x43e8cc['shift']());}}}(a159_0x326c,0x79364));import a159_0x3377eb from'node:path';import{execa}from'execa';function a159_0xdcd4(_0xab0867,_0x5da34c){_0xab0867=_0xab0867-0x152;const _0x326c06=a159_0x326c();let _0xdcd4bc=_0x326c06[_0xab0867];return _0xdcd4bc;}function a159_0x326c(){const _0x1f5620=['490136TnVzWB','info','install','error','resolve','45052dpNdes','1351385ThzDzC','message','开始安装依赖','npm','cwd','--registry','68TNDvPK','1110588kopfNU','233002WoXSYf','150723cVWsHL','350lovcCo','1072twcsWc','依赖安装完成','now','447813hswJPc'];a159_0x326c=function(){return _0x1f5620;};return a159_0x326c();}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(_0x323a0d){const _0x408c2d=a159_0xdcd4,_0x204f9d=Date['now'](),_0x19ff30=a159_0x3377eb[_0x408c2d(0x166)](process[_0x408c2d(0x157)](),_0x323a0d);try{logger[_0x408c2d(0x163)](_0x408c2d(0x164),_0x408c2d(0x155),{'projectCode':_0x323a0d,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin(_0x408c2d(0x156)),[_0x408c2d(0x164),_0x408c2d(0x158),'https://registry.npmmirror.com'],{'cwd':_0x19ff30});const _0x45aaf6=Date[_0x408c2d(0x160)]()-_0x204f9d;logger['success'](_0x408c2d(0x164),_0x408c2d(0x15f),_0x45aaf6,{'projectCode':_0x323a0d});}catch(_0x57f7b9){const _0x2584d8=Date[_0x408c2d(0x160)]()-_0x204f9d;logger[_0x408c2d(0x165)](_0x408c2d(0x164),'依赖安装失败',{'projectCode':_0x323a0d,'error':_0x57f7b9 instanceof Error?_0x57f7b9[_0x408c2d(0x154)]:String(_0x57f7b9),'duration':_0x2584d8});throw _0x57f7b9;}return formatElapsed(_0x204f9d);}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const projectDefinitions: CommandDefinition[];