@lovrabet/rabetbase-cli 2.3.10-beta.1 → 2.3.10-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/db/analysis-batching.js +1 -1
  80. package/lib/commands/db/analyze-batch-plan.js +1 -1
  81. package/lib/commands/db/analyze-cancel.js +1 -1
  82. package/lib/commands/db/analyze-start.js +1 -1
  83. package/lib/commands/db/analyze-status.js +1 -1
  84. package/lib/commands/db/create.js +1 -1
  85. package/lib/commands/db/delete.js +1 -1
  86. package/lib/commands/db/detail.js +1 -1
  87. package/lib/commands/db/diff.js +1 -1
  88. package/lib/commands/db/index.js +1 -1
  89. package/lib/commands/db/list.js +1 -1
  90. package/lib/commands/db/shared.js +1 -1
  91. package/lib/commands/db/tables.js +1 -1
  92. package/lib/commands/db/test.js +1 -1
  93. package/lib/commands/db/update.js +1 -1
  94. package/lib/commands/doctor.js +1 -1
  95. package/lib/commands/file/index.js +1 -1
  96. package/lib/commands/init/index.js +1 -1
  97. package/lib/commands/issue/index.js +1 -1
  98. package/lib/commands/issue/nudge.js +1 -1
  99. package/lib/commands/issue/report.js +1 -1
  100. package/lib/commands/issue/shared.js +1 -1
  101. package/lib/commands/logs/index.js +1 -1
  102. package/lib/commands/menu/delete.js +1 -1
  103. package/lib/commands/menu/external-link-create.js +1 -0
  104. package/lib/commands/menu/group-create.js +1 -1
  105. package/lib/commands/menu/group-update.js +1 -1
  106. package/lib/commands/menu/index.js +1 -1
  107. package/lib/commands/menu/list.js +1 -1
  108. package/lib/commands/menu/regroup-start.js +1 -1
  109. package/lib/commands/menu/shared/compare-table.js +1 -1
  110. package/lib/commands/menu/shared/delete-plan.js +1 -1
  111. package/lib/commands/menu/shared/facts.js +1 -1
  112. package/lib/commands/menu/shared/index.js +1 -1
  113. package/lib/commands/menu/shared/inquirer.js +1 -1
  114. package/lib/commands/menu/shared/local-pages.js +1 -1
  115. package/lib/commands/menu/shared/logic.js +1 -1
  116. package/lib/commands/menu/shared/mutations.js +1 -1
  117. package/lib/commands/menu/shared/service.js +1 -1
  118. package/lib/commands/menu/shared/sync-core.js +1 -1
  119. package/lib/commands/menu/shared/update-core.js +1 -1
  120. package/lib/commands/menu/shared/valid-url.js +1 -1
  121. package/lib/commands/menu/sync.js +1 -1
  122. package/lib/commands/menu/update.js +1 -1
  123. package/lib/commands/notification/config-list.js +1 -1
  124. package/lib/commands/notification/index.js +1 -1
  125. package/lib/commands/page/generate-start.js +1 -1
  126. package/lib/commands/page/generate-status.js +1 -1
  127. package/lib/commands/page/index.js +1 -1
  128. package/lib/commands/page/pull.js +1 -1
  129. package/lib/commands/page/push.js +1 -1
  130. package/lib/commands/page/relation-audit.js +1 -1
  131. package/lib/commands/page/shared.js +1 -1
  132. package/lib/commands/page/standard-page-status.js +1 -1
  133. package/lib/commands/page/sync.js +1 -1
  134. package/lib/commands/permit/index.js +1 -1
  135. package/lib/commands/permit/page-get.js +1 -1
  136. package/lib/commands/permit/page-set.js +1 -1
  137. package/lib/commands/permit/role-apis-set.js +1 -1
  138. package/lib/commands/permit/role-menus-set.js +1 -1
  139. package/lib/commands/permit/role-menus.js +1 -1
  140. package/lib/commands/permit/shared.js +1 -1
  141. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  142. package/lib/commands/project/create/format-elapsed.js +1 -1
  143. package/lib/commands/project/create/main.js +1 -1
  144. package/lib/commands/project/create/non-interactive.js +1 -1
  145. package/lib/commands/project/create/project-template-path.js +1 -1
  146. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  147. package/lib/commands/project/create/use-format-code.js +1 -1
  148. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  149. package/lib/commands/project/index.js +1 -1
  150. package/lib/commands/project/init.js +1 -1
  151. package/lib/commands/project/upgrade.js +1 -1
  152. package/lib/commands/registry.js +1 -1
  153. package/lib/commands/role/create.js +1 -1
  154. package/lib/commands/role/delete.js +1 -1
  155. package/lib/commands/role/detail.js +1 -1
  156. package/lib/commands/role/index.js +1 -1
  157. package/lib/commands/role/list.js +1 -1
  158. package/lib/commands/role/shared.js +1 -1
  159. package/lib/commands/role/update.js +1 -1
  160. package/lib/commands/role/user-add.js +1 -1
  161. package/lib/commands/role/user-remove.js +1 -1
  162. package/lib/commands/role/user-resolve.js +1 -1
  163. package/lib/commands/run/index.js +1 -1
  164. package/lib/commands/schema.js +1 -1
  165. package/lib/commands/sql/create.js +1 -1
  166. package/lib/commands/sql/delete.js +1 -1
  167. package/lib/commands/sql/detail.js +1 -1
  168. package/lib/commands/sql/exec.js +1 -1
  169. package/lib/commands/sql/index.js +1 -1
  170. package/lib/commands/sql/list.js +1 -1
  171. package/lib/commands/sql/pull.js +1 -1
  172. package/lib/commands/sql/push.js +1 -1
  173. package/lib/commands/sql/save.js +1 -1
  174. package/lib/commands/sql/shared.js +1 -1
  175. package/lib/commands/sql/status.js +1 -1
  176. package/lib/commands/sql/validate.js +1 -1
  177. package/lib/commands/task/index.js +1 -1
  178. package/lib/commands/task/status.js +1 -1
  179. package/lib/commands/workspace/add.js +1 -1
  180. package/lib/commands/workspace/index.js +1 -1
  181. package/lib/commands/workspace/remove.js +1 -1
  182. package/lib/config/schema.js +1 -1
  183. package/lib/constant/cdn.js +1 -1
  184. package/lib/constant/cli.js +1 -1
  185. package/lib/constant/defaults.js +1 -1
  186. package/lib/constant/domain.js +1 -1
  187. package/lib/constant/env.js +1 -1
  188. package/lib/constant/output.js +1 -1
  189. package/lib/constant/paths.js +1 -1
  190. package/lib/constant/risk.js +1 -1
  191. package/lib/context/app-resolver.js +1 -1
  192. package/lib/context/auth-resolver.js +1 -1
  193. package/lib/context/config-loader.js +1 -1
  194. package/lib/context.js +1 -1
  195. package/lib/core/alias-resolver.js +1 -1
  196. package/lib/core/api-client.js +1 -1
  197. package/lib/core/bff/config.js +1 -1
  198. package/lib/core/bff/file-system.js +1 -1
  199. package/lib/core/bff/hash.js +1 -1
  200. package/lib/core/bff/lock.js +1 -1
  201. package/lib/core/bff/utils.js +1 -1
  202. package/lib/core/db-resolver.js +1 -1
  203. package/lib/core/page/file-system.js +1 -1
  204. package/lib/core/page/hash.js +1 -1
  205. package/lib/core/page/lock.js +1 -1
  206. package/lib/core/sql-index-auditor.js +1 -1
  207. package/lib/core/sql-sync/config.js +1 -1
  208. package/lib/core/sql-sync/file-system.js +1 -1
  209. package/lib/core/sql-sync/hash.js +1 -1
  210. package/lib/core/sql-sync/lock.js +1 -1
  211. package/lib/core/sql-sync/utils.js +1 -1
  212. package/lib/core/sql-validator.js +1 -1
  213. package/lib/errors.js +1 -1
  214. package/lib/framework/build-all-flags.js +1 -1
  215. package/lib/framework/error-output.js +1 -1
  216. package/lib/framework/explicit-yes.js +1 -1
  217. package/lib/framework/flags.js +1 -1
  218. package/lib/framework/help.js +1 -1
  219. package/lib/framework/index.js +1 -1
  220. package/lib/framework/output.js +1 -1
  221. package/lib/framework/response.js +1 -1
  222. package/lib/framework/runner-alias.js +1 -1
  223. package/lib/framework/runner.js +1 -1
  224. package/lib/framework/schema-export.js +1 -1
  225. package/lib/framework/types.js +1 -1
  226. package/lib/generated/build-info.js +1 -1
  227. package/lib/help.js +1 -1
  228. package/lib/skills/main.js +1 -1
  229. package/lib/skills/npx-skills-add.js +1 -1
  230. package/lib/telemetry/cli-command-trace.js +1 -1
  231. package/lib/telemetry/cli-help-trace.js +1 -1
  232. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  233. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  234. package/lib/telemetry/send-cli-trace-log.js +1 -1
  235. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  236. package/lib/utils/ai_config.js +1 -1
  237. package/lib/utils/apply-jq-filter.js +1 -1
  238. package/lib/utils/cdn-config.js +1 -1
  239. package/lib/utils/check-sdk-version.js +1 -1
  240. package/lib/utils/cli-version-check.js +1 -1
  241. package/lib/utils/cli-version-policy.js +1 -1
  242. package/lib/utils/config.js +1 -1
  243. package/lib/utils/copy-directory.js +1 -1
  244. package/lib/utils/entity-with-id.js +1 -1
  245. package/lib/utils/file-utils.js +1 -1
  246. package/lib/utils/guides-cdn.js +1 -1
  247. package/lib/utils/http-client.js +1 -1
  248. package/lib/utils/is-non-interactive.js +1 -1
  249. package/lib/utils/logger.js +1 -1
  250. package/lib/utils/params.js +1 -1
  251. package/lib/utils/platform.js +1 -1
  252. package/lib/utils/rules-cdn.js +1 -1
  253. package/lib/utils/sleep.js +1 -1
  254. package/lib/utils/template-replacer.js +1 -1
  255. package/lib/utils/update-notice.js +1 -1
  256. package/lib/utils/version.js +1 -1
  257. package/lib/utils/with-active-cookie.js +1 -1
  258. package/lib/utils/write-cli-side-channel.js +1 -1
  259. package/package.json +1 -1
@@ -1 +1 @@
1
- const a136_0x451278=a136_0x5876;(function(_0x360b3a,_0x377fb4){const _0xb65f74=a136_0x5876,_0x48558f=_0x360b3a();while(!![]){try{const _0x4a2614=parseInt(_0xb65f74(0xcc))/0x1+-parseInt(_0xb65f74(0xb7))/0x2+parseInt(_0xb65f74(0xb3))/0x3+parseInt(_0xb65f74(0xba))/0x4*(-parseInt(_0xb65f74(0xce))/0x5)+-parseInt(_0xb65f74(0xc6))/0x6*(parseInt(_0xb65f74(0xc4))/0x7)+parseInt(_0xb65f74(0xbe))/0x8*(-parseInt(_0xb65f74(0xd4))/0x9)+parseInt(_0xb65f74(0xbb))/0xa*(parseInt(_0xb65f74(0xc0))/0xb);if(_0x4a2614===_0x377fb4)break;else _0x48558f['push'](_0x48558f['shift']());}catch(_0x27cb17){_0x48558f['push'](_0x48558f['shift']());}}}(a136_0x3a87,0x289a3));import{getRoleApiResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a136_0x5876(_0x41bace,_0x1f3e15){_0x41bace=_0x41bace-0xb1;const _0x3a87c9=a136_0x3a87();let _0x587647=_0x3a87c9[_0x41bace];return _0x587647;}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='/smartapi/permit/role/update';function a136_0x3a87(){const _0x4d42e4=['Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.','Revoked\x20API\x20access\x20for\x20','6543zVcPXi','roleName','set','Pass\x20--datasets\x20<datasetCode,...>.','revoke','147075xTzuiQ','length','has','\x20dataset(s)\x20on\x20role\x20','223282DfYCwG','API','flagMissing','960oiEYwd','10dJIniF','role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).','bool','376SVFPbz','str','6711881LFNEsM','permit','Missing\x20--revoke.','datasetCodes','2681lftvoO','get','4584FqoOGF','Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20','appCode','datasets','join','Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','19693kcjVix','POST','1545BdtSLc','selector','filter','role-apis-set'];a136_0x3a87=function(){return _0x4d42e4;};return a136_0x3a87();}async function buildPlan(_0x11199b,_0x220b81){const _0x1bf9b4=a136_0x5876,_0x593694=await resolveRoleRef(_0x11199b['appCode'],readRoleRef(_0x11199b));assertPermConfigurable(_0x593694);if(!_0x11199b[_0x1bf9b4(0xbd)](_0x1bf9b4(0xb2)))throw CliErrors['validation'](_0x1bf9b4(0xc2),_0x1bf9b4(0xbc));const _0x16d47e=splitList(_0x11199b[_0x1bf9b4(0xbf)](_0x1bf9b4(0xc9)));if(_0x16d47e[_0x1bf9b4(0xb4)]===0x0)throw CliErrors[_0x1bf9b4(0xb9)](_0x1bf9b4(0xc9),_0x1bf9b4(0xb1));const _0x3368e2=await getRoleApiResources(_0x11199b[_0x1bf9b4(0xc8)],_0x593694['id']),{byCode:_0x5f1663,byDataset:_0x4e5162}=flattenApiResources(_0x3368e2),_0x368351=_0x16d47e[_0x1bf9b4(0xd0)](_0x377a0e=>!_0x4e5162[_0x1bf9b4(0xb5)](_0x377a0e));if(_0x368351[_0x1bf9b4(0xb4)]>0x0)throw CliErrors['validation'](_0x1bf9b4(0xc7)+_0x368351[_0x1bf9b4(0xca)](',\x20')+'.',_0x1bf9b4(0xd2));const _0x337705=new Map(),_0x439f6e=[],_0x6f08c8=[];for(const _0x1b755c of _0x16d47e){for(const _0x1352d8 of _0x4e5162[_0x1bf9b4(0xc5)](_0x1b755c)){const _0x326a98=_0x5f1663['get'](_0x1352d8);_0x337705[_0x1bf9b4(0xd6)](_0x1352d8,'0'),_0x439f6e['push']({'resourceCode':_0x1352d8,'datasetCode':_0x1b755c,'action':_0x326a98['action']}),_0x6f08c8['push']({'resourceCode':_0x1352d8,'datasetCode':_0x1b755c,'action':'0'});}}const _0x5f5046=buildPermits(_0x5f1663,_0x337705),_0x4f6fe5={'operation':'api-revoke','selector':{'appCode':_0x11199b[_0x1bf9b4(0xc8)],'roleId':_0x593694['id'],'roleName':_0x593694['roleName'],'datasetCodes':_0x16d47e},'before':_0x439f6e,'after':_0x6f08c8,'dryRun':_0x220b81,'backend':{'method':_0x1bf9b4(0xcd),'path':UPDATE_PATH,'roleType':_0x1bf9b4(0xb8)},'warnings':[]};return{'role':_0x593694,'permits':_0x5f5046,'mutation':_0x4f6fe5};}export const permitRoleApisSet={'service':a136_0x451278(0xc1),'command':a136_0x451278(0xd1),'description':a136_0x451278(0xcb),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x481b32){const _0x2e9bbe=a136_0x451278;if(!_0x481b32[_0x2e9bbe(0xbd)](_0x2e9bbe(0xb2)))throw CliErrors['validation'](_0x2e9bbe(0xc2),_0x2e9bbe(0xbc));if(splitList(_0x481b32[_0x2e9bbe(0xbf)]('datasets'))['length']===0x0)throw CliErrors[_0x2e9bbe(0xb9)](_0x2e9bbe(0xc9),_0x2e9bbe(0xb1));},async 'dryRun'(_0x3d6d82){const _0x13548a=a136_0x451278,{mutation:_0x5f0a42}=await buildPlan(_0x3d6d82,!![]);return asDryRunResult(_0x5f0a42,{'method':_0x13548a(0xcd),'url':UPDATE_PATH});},async 'execute'(_0x24bba7){const _0x92f5d6=a136_0x451278,{role:_0x3a948c,permits:_0x5e5bbe,mutation:_0x11d3e7}=await buildPlan(_0x24bba7,![]);return await updateAppRole({'id':_0x3a948c['id'],'appCode':_0x24bba7[_0x92f5d6(0xc8)],'roleType':_0x92f5d6(0xb8),'permits':_0x5e5bbe}),{'ok':!![],'data':_0x11d3e7,'message':_0x92f5d6(0xd3)+_0x11d3e7[_0x92f5d6(0xcf)][_0x92f5d6(0xc3)][_0x92f5d6(0xb4)]+_0x92f5d6(0xb6)+_0x3a948c[_0x92f5d6(0xd5)]};}};
1
+ const a137_0x59ddf2=a137_0x3178;function a137_0x3cbc(){const _0x369ca1=['revoke','appCode','814174WkWuOS','permit','selector','2817563FYDjqY','Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20','length','datasets','POST','validation','833234quvNlC','1957221dmyYnS','bool','Pass\x20--datasets\x20<datasetCode,...>.','Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.','push','19971100fUjbJY','\x20dataset(s)\x20on\x20role\x20','/smartapi/permit/role/update','filter','has','1181784zLNKAg','flagMissing','get','api-revoke','8ikgTFV','role-apis-set','str','join','roleName','Missing\x20--revoke.','role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).','high-risk-write','Revoked\x20API\x20access\x20for\x20','88CQTHMw','5feEXDg','130365JsLlGA'];a137_0x3cbc=function(){return _0x369ca1;};return a137_0x3cbc();}(function(_0x1085c0,_0x478319){const _0x170371=a137_0x3178,_0x96334d=_0x1085c0();while(!![]){try{const _0x475990=parseInt(_0x170371(0x169))/0x1+parseInt(_0x170371(0x160))/0x2+-parseInt(_0x170371(0x15d))/0x3*(-parseInt(_0x170371(0x15b))/0x4)+-parseInt(_0x170371(0x15c))/0x5*(parseInt(_0x170371(0x14e))/0x6)+parseInt(_0x170371(0x163))/0x7+-parseInt(_0x170371(0x152))/0x8*(-parseInt(_0x170371(0x16a))/0x9)+-parseInt(_0x170371(0x16f))/0xa;if(_0x475990===_0x478319)break;else _0x96334d['push'](_0x96334d['shift']());}catch(_0x9c751e){_0x96334d['push'](_0x96334d['shift']());}}}(a137_0x3cbc,0x97e9b));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';function a137_0x3178(_0x4646c9,_0x12c9a9){_0x4646c9=_0x4646c9-0x14c;const _0x3cbc2a=a137_0x3cbc();let _0x31785b=_0x3cbc2a[_0x4646c9];return _0x31785b;}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=a137_0x59ddf2(0x171);async function buildPlan(_0x499788,_0x3c331c){const _0x124297=a137_0x59ddf2,_0x4b827e=await resolveRoleRef(_0x499788[_0x124297(0x15f)],readRoleRef(_0x499788));assertPermConfigurable(_0x4b827e);if(!_0x499788[_0x124297(0x16b)](_0x124297(0x15e)))throw CliErrors[_0x124297(0x168)](_0x124297(0x157),_0x124297(0x158));const _0xe89e84=splitList(_0x499788[_0x124297(0x154)](_0x124297(0x166)));if(_0xe89e84[_0x124297(0x165)]===0x0)throw CliErrors[_0x124297(0x14f)](_0x124297(0x166),_0x124297(0x16c));const _0x3b2873=await getRoleApiResources(_0x499788[_0x124297(0x15f)],_0x4b827e['id']),{byCode:_0x7a2bb0,byDataset:_0x319526}=flattenApiResources(_0x3b2873),_0x5637e1=_0xe89e84[_0x124297(0x14c)](_0xf612a6=>!_0x319526[_0x124297(0x14d)](_0xf612a6));if(_0x5637e1['length']>0x0)throw CliErrors['validation'](_0x124297(0x164)+_0x5637e1[_0x124297(0x155)](',\x20')+'.',_0x124297(0x16d));const _0x5d5a5a=new Map(),_0x2b5265=[],_0x178245=[];for(const _0x23739b of _0xe89e84){for(const _0x319d4f of _0x319526[_0x124297(0x150)](_0x23739b)){const _0x3e78fb=_0x7a2bb0[_0x124297(0x150)](_0x319d4f);_0x5d5a5a['set'](_0x319d4f,'0'),_0x2b5265['push']({'resourceCode':_0x319d4f,'datasetCode':_0x23739b,'action':_0x3e78fb['action']}),_0x178245[_0x124297(0x16e)]({'resourceCode':_0x319d4f,'datasetCode':_0x23739b,'action':'0'});}}const _0x495426=buildPermits(_0x7a2bb0,_0x5d5a5a),_0x2491f3={'operation':_0x124297(0x151),'selector':{'appCode':_0x499788[_0x124297(0x15f)],'roleId':_0x4b827e['id'],'roleName':_0x4b827e[_0x124297(0x156)],'datasetCodes':_0xe89e84},'before':_0x2b5265,'after':_0x178245,'dryRun':_0x3c331c,'backend':{'method':_0x124297(0x167),'path':UPDATE_PATH,'roleType':'API'},'warnings':[]};return{'role':_0x4b827e,'permits':_0x495426,'mutation':_0x2491f3};}export const permitRoleApisSet={'service':a137_0x59ddf2(0x161),'command':a137_0x59ddf2(0x153),'description':'Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','risk':a137_0x59ddf2(0x159),'flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x6ea9b6){const _0x55174c=a137_0x59ddf2;if(!_0x6ea9b6[_0x55174c(0x16b)](_0x55174c(0x15e)))throw CliErrors[_0x55174c(0x168)](_0x55174c(0x157),_0x55174c(0x158));if(splitList(_0x6ea9b6[_0x55174c(0x154)](_0x55174c(0x166)))[_0x55174c(0x165)]===0x0)throw CliErrors[_0x55174c(0x14f)](_0x55174c(0x166),'Pass\x20--datasets\x20<datasetCode,...>.');},async 'dryRun'(_0x26bc1a){const {mutation:_0x275947}=await buildPlan(_0x26bc1a,!![]);return asDryRunResult(_0x275947,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x28d150){const _0x54e487=a137_0x59ddf2,{role:_0x66a413,permits:_0x2be7c3,mutation:_0x2d7baa}=await buildPlan(_0x28d150,![]);return await updateAppRole({'id':_0x66a413['id'],'appCode':_0x28d150[_0x54e487(0x15f)],'roleType':'API','permits':_0x2be7c3}),{'ok':!![],'data':_0x2d7baa,'message':_0x54e487(0x15a)+_0x2d7baa[_0x54e487(0x162)]['datasetCodes']['length']+_0x54e487(0x170)+_0x66a413[_0x54e487(0x156)]};}};
@@ -1 +1 @@
1
- const a137_0x3be3d3=a137_0x172e;(function(_0x3acb2c,_0x549877){const _0x1ac2bb=a137_0x172e,_0x437c20=_0x3acb2c();while(!![]){try{const _0x1f4dd0=-parseInt(_0x1ac2bb(0x178))/0x1+parseInt(_0x1ac2bb(0x169))/0x2*(parseInt(_0x1ac2bb(0x16a))/0x3)+parseInt(_0x1ac2bb(0x173))/0x4+parseInt(_0x1ac2bb(0x17d))/0x5*(-parseInt(_0x1ac2bb(0x183))/0x6)+parseInt(_0x1ac2bb(0x171))/0x7*(parseInt(_0x1ac2bb(0x175))/0x8)+parseInt(_0x1ac2bb(0x179))/0x9*(parseInt(_0x1ac2bb(0x172))/0xa)+-parseInt(_0x1ac2bb(0x17b))/0xb;if(_0x1f4dd0===_0x549877)break;else _0x437c20['push'](_0x437c20['shift']());}catch(_0x5cf8f6){_0x437c20['push'](_0x437c20['shift']());}}}(a137_0x4f97,0xa1bde));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';function a137_0x172e(_0x581ebc,_0x2e7831){_0x581ebc=_0x581ebc-0x168;const _0x4f979a=a137_0x4f97();let _0x172e2a=_0x4f979a[_0x581ebc];return _0x172e2a;}function a137_0x4f97(){const _0x2d8a38=['has','Updated\x20','get','appCode','2TRARtk','3934632vhVwRl','flagMissing','push','length','validation','roleName','POST','797783SMvkbu','1600DxwhMv','3515048iZewDl','action','40ozOBLB','resourceCodes','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','861797IjeZKh','27144Npekci','selector','17728194FuSWxS','set','1055xucXBZ','Pass\x20--menus\x20<resourceCode,...>.','menu-grant','PAGE','/smartapi/permit/role/update','filter','3036DDFySC','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','menu-revoke','str','Unknown\x20menu\x20resourceCode(s):\x20','menus','high-risk-write'];a137_0x4f97=function(){return _0x2d8a38;};return a137_0x4f97();}import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a137_0x3be3d3(0x181);async function buildPlan(_0x216476,_0x4e6f7f){const _0x2d3fa8=a137_0x3be3d3,_0x327327=await resolveRoleRef(_0x216476[_0x2d3fa8(0x168)],readRoleRef(_0x216476));assertPermConfigurable(_0x327327);const _0x22a840=readGrantRevoke(_0x216476),_0x37aec0=splitList(_0x216476['str'](_0x2d3fa8(0x188)));if(_0x37aec0[_0x2d3fa8(0x16d)]===0x0)throw CliErrors['flagMissing']('menus',_0x2d3fa8(0x17e));const _0x28072f=await getRoleMenuResources(_0x216476[_0x2d3fa8(0x168)],_0x327327['id']),_0x170a34=flattenMenuResources(_0x28072f),_0x3fde30=_0x37aec0[_0x2d3fa8(0x182)](_0x460de8=>!_0x170a34[_0x2d3fa8(0x18a)](_0x460de8));if(_0x3fde30[_0x2d3fa8(0x16d)]>0x0)throw CliErrors[_0x2d3fa8(0x16e)](_0x2d3fa8(0x187)+_0x3fde30['join'](',\x20')+'.',_0x2d3fa8(0x184));const _0x2883d8=new Map(),_0x1df219=[],_0x39555e=[];for(const _0x31718e of _0x37aec0){const _0x2d87be=_0x170a34[_0x2d3fa8(0x18c)](_0x31718e);_0x2883d8[_0x2d3fa8(0x17c)](_0x31718e,_0x22a840),_0x1df219[_0x2d3fa8(0x16c)]({'resourceCode':_0x31718e,'action':_0x2d87be[_0x2d3fa8(0x174)]}),_0x39555e[_0x2d3fa8(0x16c)]({'resourceCode':_0x31718e,'action':_0x22a840});}const _0x301f48=buildPermits(_0x170a34,_0x2883d8),_0x36a316={'operation':_0x22a840==='access'?_0x2d3fa8(0x17f):_0x2d3fa8(0x185),'selector':{'appCode':_0x216476[_0x2d3fa8(0x168)],'roleId':_0x327327['id'],'roleName':_0x327327['roleName'],'resourceCodes':_0x37aec0},'before':_0x1df219,'after':_0x39555e,'dryRun':_0x4e6f7f,'backend':{'method':_0x2d3fa8(0x170),'path':UPDATE_PATH,'roleType':_0x2d3fa8(0x180)},'warnings':[]};return{'role':_0x327327,'permits':_0x301f48,'mutation':_0x36a316};}export const permitRoleMenusSet={'service':'permit','command':'role-menus-set','description':a137_0x3be3d3(0x177),'risk':a137_0x3be3d3(0x189),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2fc1c9){const _0x3fcf7a=a137_0x3be3d3;readGrantRevoke(_0x2fc1c9);if(splitList(_0x2fc1c9[_0x3fcf7a(0x186)](_0x3fcf7a(0x188)))[_0x3fcf7a(0x16d)]===0x0)throw CliErrors[_0x3fcf7a(0x16b)](_0x3fcf7a(0x188),'Pass\x20--menus\x20<resourceCode,...>.');},async 'dryRun'(_0xddca32){const _0x47215c=a137_0x3be3d3,{mutation:_0x45fb6f}=await buildPlan(_0xddca32,!![]);return asDryRunResult(_0x45fb6f,{'method':_0x47215c(0x170),'url':UPDATE_PATH});},async 'execute'(_0x213f2f){const _0x43a110=a137_0x3be3d3,{role:_0x247a76,permits:_0x5dd8b0,mutation:_0x22e1b4}=await buildPlan(_0x213f2f,![]);return await updateAppRole({'id':_0x247a76['id'],'appCode':_0x213f2f[_0x43a110(0x168)],'roleType':_0x43a110(0x180),'permits':_0x5dd8b0}),{'ok':!![],'data':_0x22e1b4,'message':_0x43a110(0x18b)+_0x22e1b4[_0x43a110(0x17a)][_0x43a110(0x176)][_0x43a110(0x16d)]+'\x20menu\x20permit(s)\x20for\x20role\x20'+_0x247a76[_0x43a110(0x16f)]};}};
1
+ const a138_0x44fc09=a138_0xf3a9;(function(_0x383618,_0x1eb35b){const _0x36a8e5=a138_0xf3a9,_0x52e46e=_0x383618();while(!![]){try{const _0x125be7=parseInt(_0x36a8e5(0xe0))/0x1*(parseInt(_0x36a8e5(0xf3))/0x2)+parseInt(_0x36a8e5(0xed))/0x3+-parseInt(_0x36a8e5(0xdf))/0x4+parseInt(_0x36a8e5(0xf4))/0x5*(parseInt(_0x36a8e5(0xf1))/0x6)+-parseInt(_0x36a8e5(0xf6))/0x7*(-parseInt(_0x36a8e5(0xf2))/0x8)+-parseInt(_0x36a8e5(0xf7))/0x9+parseInt(_0x36a8e5(0xfb))/0xa;if(_0x125be7===_0x1eb35b)break;else _0x52e46e['push'](_0x52e46e['shift']());}catch(_0x40cd8c){_0x52e46e['push'](_0x52e46e['shift']());}}}(a138_0x18a0,0x41e6e));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';function a138_0xf3a9(_0x1743b3,_0x34b698){_0x1743b3=_0x1743b3-0xdf;const _0x18a093=a138_0x18a0();let _0xf3a92a=_0x18a093[_0x1743b3];return _0xf3a92a;}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';function a138_0x18a0(){const _0xbaef5c=['validation','14604ECkASX','2585720TFnetu','58COnllo','40GapPeE','length','7inDKMZ','4051989mmXmKR','str','menu-grant','POST','2142060PUhdki','1631648YaEbYG','4003bjKEKq','flagMissing','Updated\x20','roleName','Pass\x20--menus\x20<resourceCode,...>.','join','menus','permit','push','menu-revoke','appCode','PAGE','filter','1365261bPqGeF','/smartapi/permit/role/update','Unknown\x20menu\x20resourceCode(s):\x20'];a138_0x18a0=function(){return _0xbaef5c;};return a138_0x18a0();}const UPDATE_PATH=a138_0x44fc09(0xee);async function buildPlan(_0x298139,_0x593741){const _0x1c22dc=a138_0x44fc09,_0x490d66=await resolveRoleRef(_0x298139['appCode'],readRoleRef(_0x298139));assertPermConfigurable(_0x490d66);const _0x4643a6=readGrantRevoke(_0x298139),_0x56891f=splitList(_0x298139[_0x1c22dc(0xf8)](_0x1c22dc(0xe6)));if(_0x56891f[_0x1c22dc(0xf5)]===0x0)throw CliErrors[_0x1c22dc(0xe1)](_0x1c22dc(0xe6),_0x1c22dc(0xe4));const _0x39e52c=await getRoleMenuResources(_0x298139[_0x1c22dc(0xea)],_0x490d66['id']),_0x44ac7c=flattenMenuResources(_0x39e52c),_0x360f4f=_0x56891f[_0x1c22dc(0xec)](_0x4ba004=>!_0x44ac7c['has'](_0x4ba004));if(_0x360f4f['length']>0x0)throw CliErrors[_0x1c22dc(0xf0)](_0x1c22dc(0xef)+_0x360f4f[_0x1c22dc(0xe5)](',\x20')+'.','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.');const _0x4b5bab=new Map(),_0x3eb1a5=[],_0x54787d=[];for(const _0x2ce3ac of _0x56891f){const _0x2c1059=_0x44ac7c['get'](_0x2ce3ac);_0x4b5bab['set'](_0x2ce3ac,_0x4643a6),_0x3eb1a5[_0x1c22dc(0xe8)]({'resourceCode':_0x2ce3ac,'action':_0x2c1059['action']}),_0x54787d[_0x1c22dc(0xe8)]({'resourceCode':_0x2ce3ac,'action':_0x4643a6});}const _0xa5ae8b=buildPermits(_0x44ac7c,_0x4b5bab),_0x4f7af0={'operation':_0x4643a6==='access'?_0x1c22dc(0xf9):_0x1c22dc(0xe9),'selector':{'appCode':_0x298139[_0x1c22dc(0xea)],'roleId':_0x490d66['id'],'roleName':_0x490d66[_0x1c22dc(0xe3)],'resourceCodes':_0x56891f},'before':_0x3eb1a5,'after':_0x54787d,'dryRun':_0x593741,'backend':{'method':_0x1c22dc(0xfa),'path':UPDATE_PATH,'roleType':_0x1c22dc(0xeb)},'warnings':[]};return{'role':_0x490d66,'permits':_0xa5ae8b,'mutation':_0x4f7af0};}export const permitRoleMenusSet={'service':a138_0x44fc09(0xe7),'command':'role-menus-set','description':'Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3e957c){const _0x404468=a138_0x44fc09;readGrantRevoke(_0x3e957c);if(splitList(_0x3e957c[_0x404468(0xf8)](_0x404468(0xe6)))[_0x404468(0xf5)]===0x0)throw CliErrors['flagMissing'](_0x404468(0xe6),_0x404468(0xe4));},async 'dryRun'(_0x225553){const {mutation:_0x4cd626}=await buildPlan(_0x225553,!![]);return asDryRunResult(_0x4cd626,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x5a51ef){const _0x259e7c=a138_0x44fc09,{role:_0x32030e,permits:_0x3fd172,mutation:_0x214e87}=await buildPlan(_0x5a51ef,![]);return await updateAppRole({'id':_0x32030e['id'],'appCode':_0x5a51ef[_0x259e7c(0xea)],'roleType':'PAGE','permits':_0x3fd172}),{'ok':!![],'data':_0x214e87,'message':_0x259e7c(0xe2)+_0x214e87['selector']['resourceCodes'][_0x259e7c(0xf5)]+'\x20menu\x20permit(s)\x20for\x20role\x20'+_0x32030e[_0x259e7c(0xe3)]};}};
@@ -1 +1 @@
1
- const a138_0x4e9e0a=a138_0x41ee;(function(_0x52118d,_0x285860){const _0xe47214=a138_0x41ee,_0x25288f=_0x52118d();while(!![]){try{const _0x1d99a6=parseInt(_0xe47214(0xa1))/0x1+parseInt(_0xe47214(0xa2))/0x2*(parseInt(_0xe47214(0xad))/0x3)+-parseInt(_0xe47214(0xa0))/0x4+parseInt(_0xe47214(0xab))/0x5+-parseInt(_0xe47214(0x9d))/0x6+-parseInt(_0xe47214(0x9c))/0x7*(-parseInt(_0xe47214(0xa7))/0x8)+parseInt(_0xe47214(0x9a))/0x9;if(_0x1d99a6===_0x285860)break;else _0x25288f['push'](_0x25288f['shift']());}catch(_0x23f056){_0x25288f['push'](_0x25288f['shift']());}}}(a138_0x2b45,0x2f57f));function a138_0x41ee(_0x50e392,_0x21d76a){_0x50e392=_0x50e392-0x97;const _0x2b4523=a138_0x2b45();let _0x41eea6=_0x2b4523[_0x50e392];return _0x41eea6;}import{getRoleMenuResources}from'../../core/api-client.js';function a138_0x2b45(){const _0x355daf=['role-menus','map','read','roleName','8wcYXXg','\x20has\x20','allowed','length','53225kfvPAH','action','2649OYtggw','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','from','resourceName','1944414JNNJeR','resourceCode','166061PZyLIf','731352lvoQBa','Role\x20','\x20menu(s)\x20allowed','947484VvhJdU','192776SiTzKO','248xMeuub'];a138_0x2b45=function(){return _0x355daf;};return a138_0x2b45();}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':'permit','command':a138_0x4e9e0a(0xa3),'description':a138_0x4e9e0a(0x97),'risk':a138_0x4e9e0a(0xa5),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x103027){const _0xa6f36d=a138_0x4e9e0a,_0x54347f=await resolveRoleRef(_0x103027['appCode'],readRoleRef(_0x103027)),_0xe96c6b=await getRoleMenuResources(_0x103027['appCode'],_0x54347f['id']),_0x36f708=flattenMenuResources(_0xe96c6b),_0x2048d1=Array[_0xa6f36d(0x98)](_0x36f708['values']())[_0xa6f36d(0xa4)](_0x11d572=>({'resourceCode':_0x11d572[_0xa6f36d(0x9b)],'resourceName':_0x11d572[_0xa6f36d(0x99)],'allowed':_0x11d572['action']==='access','action':_0x11d572[_0xa6f36d(0xac)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x103027['appCode'],'roleId':_0x54347f['id'],'roleName':_0x54347f[_0xa6f36d(0xa6)]},'menus':_0x2048d1},'message':_0xa6f36d(0x9e)+_0x54347f['roleName']+_0xa6f36d(0xa8)+_0x2048d1['filter'](_0x51658d=>_0x51658d[_0xa6f36d(0xa9)])[_0xa6f36d(0xaa)]+'/'+_0x2048d1['length']+_0xa6f36d(0x9f)};}};
1
+ const a139_0x1e59b9=a139_0x3684;(function(_0x119628,_0x4d4240){const _0x1d620f=a139_0x3684,_0x524449=_0x119628();while(!![]){try{const _0x15c270=-parseInt(_0x1d620f(0x168))/0x1*(-parseInt(_0x1d620f(0x174))/0x2)+parseInt(_0x1d620f(0x16e))/0x3+-parseInt(_0x1d620f(0x162))/0x4+parseInt(_0x1d620f(0x173))/0x5+-parseInt(_0x1d620f(0x176))/0x6*(-parseInt(_0x1d620f(0x171))/0x7)+parseInt(_0x1d620f(0x16f))/0x8*(parseInt(_0x1d620f(0x166))/0x9)+parseInt(_0x1d620f(0x16c))/0xa*(-parseInt(_0x1d620f(0x16d))/0xb);if(_0x15c270===_0x4d4240)break;else _0x524449['push'](_0x524449['shift']());}catch(_0x3dfb69){_0x524449['push'](_0x524449['shift']());}}}(a139_0x6293,0x2bbef));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';function a139_0x6293(){const _0x9f633=['1334808QOrGON','read','7OwOOYJ','access','1180880xiVCEm','2fojTRt','action','1381746BbydgW','allowed','resourceName','values','map','permit','appCode','572188HaeIWC','filter','length','role-menus','18eKPPbe','\x20has\x20','307841NKFFxW','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','roleName','Role\x20','80UxeUxC','1213663UQdFQw','290652OcjVIZ'];a139_0x6293=function(){return _0x9f633;};return a139_0x6293();}function a139_0x3684(_0x4718aa,_0x56f658){_0x4718aa=_0x4718aa-0x162;const _0x629318=a139_0x6293();let _0x368479=_0x629318[_0x4718aa];return _0x368479;}import{resolveRoleRef}from'../../commands/role/shared.js';export const permitRoleMenus={'service':a139_0x1e59b9(0x17b),'command':a139_0x1e59b9(0x165),'description':a139_0x1e59b9(0x169),'risk':a139_0x1e59b9(0x170),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x243450){const _0x137520=a139_0x1e59b9,_0x54c857=await resolveRoleRef(_0x243450[_0x137520(0x17c)],readRoleRef(_0x243450)),_0xb79c2e=await getRoleMenuResources(_0x243450[_0x137520(0x17c)],_0x54c857['id']),_0x25731c=flattenMenuResources(_0xb79c2e),_0x3ed4ce=Array['from'](_0x25731c[_0x137520(0x179)]())[_0x137520(0x17a)](_0x296207=>({'resourceCode':_0x296207['resourceCode'],'resourceName':_0x296207[_0x137520(0x178)],'allowed':_0x296207[_0x137520(0x175)]===_0x137520(0x172),'action':_0x296207[_0x137520(0x175)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x243450['appCode'],'roleId':_0x54c857['id'],'roleName':_0x54c857['roleName']},'menus':_0x3ed4ce},'message':_0x137520(0x16b)+_0x54c857[_0x137520(0x16a)]+_0x137520(0x167)+_0x3ed4ce[_0x137520(0x163)](_0x2f91fa=>_0x2f91fa[_0x137520(0x177)])[_0x137520(0x164)]+'/'+_0x3ed4ce[_0x137520(0x164)]+'\x20menu(s)\x20allowed'};}};
@@ -1 +1 @@
1
- const a139_0x5aef3a=a139_0x2e3b;function a139_0x2e3b(_0x22316a,_0x43ba00){_0x22316a=_0x22316a-0x16e;const _0x3d43f2=a139_0x3d43();let _0x2e3b78=_0x3d43f2[_0x22316a];return _0x2e3b78;}(function(_0x4e8b79,_0x5cb0c0){const _0x255c72=a139_0x2e3b,_0x2f400f=_0x4e8b79();while(!![]){try{const _0xa2fc56=-parseInt(_0x255c72(0x1c4))/0x1*(parseInt(_0x255c72(0x1b7))/0x2)+parseInt(_0x255c72(0x19e))/0x3*(-parseInt(_0x255c72(0x1a6))/0x4)+-parseInt(_0x255c72(0x1b4))/0x5+-parseInt(_0x255c72(0x1a3))/0x6+parseInt(_0x255c72(0x1a9))/0x7*(-parseInt(_0x255c72(0x18c))/0x8)+-parseInt(_0x255c72(0x174))/0x9*(-parseInt(_0x255c72(0x179))/0xa)+parseInt(_0x255c72(0x177))/0xb*(parseInt(_0x255c72(0x196))/0xc);if(_0xa2fc56===_0x5cb0c0)break;else _0x2f400f['push'](_0x2f400f['shift']());}catch(_0x140cda){_0x2f400f['push'](_0x2f400f['shift']());}}}(a139_0x3d43,0xca789));import{listPermitRoles}from'../../core/api-client.js';function a139_0x3d43(){const _0x42da5d=['Run\x20`role\x20list`.','data\x20create','pageNodeList','menu-roles','get','data\x20detail','Role\x20id\x20or\x20role\x20name','\x20is\x20not\x20available\x20for\x20this\x20app.','2258160PKVirW','push','\x20(comma-separated\x20SELF/ALL/id/name)','toUpperCase','Role\x20id\x20','detail-roles','roleName','allowedActions','2434494KMGfLb','\x22\x20not\x20found.','datasets','\x22\x20is\x20ambiguous\x20(ids:\x20','resourceCode','2242026uczXUV','grant','action','4NBTSuJ','menu\x20visibility','data\x20export','17591fEOEKv','menu-id','dataExport','row\x20visibility','Roles\x20for\x20','menus','resourceName','key','string','validation','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','668295hKpRsO','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','SELF','14NpUlqg','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','flag','dataPermit','entries','Role\x20\x22','revoke','dataUpdate','trim','map','test','datasetCode','set','110329JWtQSP','data\x20update','Menu\x20id\x20(from\x20`menu\x20list`)','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','length','Special\x20role\x20','label','allowSelf','12249SndQgU','Grant\x20access\x20to\x20the\x20listed\x20resources','Revoke\x20access\x20to\x20the\x20listed\x20resources','209QgDHqU','access','5860BqxYpq','filter','SELF\x20is\x20not\x20allowed\x20for\x20','roleType','str','bool','rolePermit','dataDetail','boolean','create-roles','find','menuPermit','dataCreate','ALL','number','some','Disambiguate\x20with\x20an\x20id.','menuId',';\x20SELF\x20=\x20only\x20own\x20rows','4624xXbpgR','role'];a139_0x3d43=function(){return _0x42da5d;};return a139_0x3d43();}import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a139_0x5aef3a(0x1aa),'type':a139_0x5aef3a(0x187),'required':!![],'description':a139_0x5aef3a(0x16e)};export const ROLE_REF_FLAG={'name':'role','type':a139_0x5aef3a(0x1b1),'required':!![],'description':a139_0x5aef3a(0x194)};export const GRANT_FLAG={'name':a139_0x5aef3a(0x1a4),'type':a139_0x5aef3a(0x181),'required':![],'description':a139_0x5aef3a(0x175)};export const REVOKE_FLAG={'name':a139_0x5aef3a(0x1bd),'type':a139_0x5aef3a(0x181),'required':![],'description':a139_0x5aef3a(0x176)};export const MENUS_FLAG={'name':a139_0x5aef3a(0x1ae),'type':'string','required':!![],'description':'Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke'};export const DATASETS_FLAG={'name':a139_0x5aef3a(0x1a0),'type':a139_0x5aef3a(0x1b1),'required':!![],'description':a139_0x5aef3a(0x1b3)};export const PAGE_SLOT_SPECS=[{'flag':a139_0x5aef3a(0x191),'key':'menuPermit','allowSelf':![],'label':a139_0x5aef3a(0x1a7)},{'flag':a139_0x5aef3a(0x182),'key':a139_0x5aef3a(0x185),'allowSelf':![],'label':a139_0x5aef3a(0x18f)},{'flag':'update-roles','key':a139_0x5aef3a(0x1be),'allowSelf':![],'label':a139_0x5aef3a(0x1c5)},{'flag':'delete-roles','key':'dataDelete','allowSelf':![],'label':'data\x20delete'},{'flag':a139_0x5aef3a(0x19b),'key':a139_0x5aef3a(0x180),'allowSelf':![],'label':a139_0x5aef3a(0x193)},{'flag':'export-roles','key':a139_0x5aef3a(0x1ab),'allowSelf':![],'label':a139_0x5aef3a(0x1a8)},{'flag':'row-roles','key':a139_0x5aef3a(0x1ba),'allowSelf':!![],'label':a139_0x5aef3a(0x1ac)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS['map'](_0x843950=>({'name':_0x843950[a139_0x5aef3a(0x1b9)],'type':a139_0x5aef3a(0x1b1),'required':![],'description':a139_0x5aef3a(0x1ad)+_0x843950['label']+a139_0x5aef3a(0x198)+(_0x843950['allowSelf']?a139_0x5aef3a(0x18b):'')}));export function splitList(_0x13c7a9){const _0x5f1cda=a139_0x5aef3a;return _0x13c7a9['split'](',')['map'](_0x3e8e55=>_0x3e8e55[_0x5f1cda(0x1bf)]())[_0x5f1cda(0x17a)](Boolean);}export function projectRoleRef(_0x33a6e5){const _0x138f50=a139_0x5aef3a;return{'id':_0x33a6e5['id'],'roleName':_0x33a6e5[_0x138f50(0x19c)],'roleType':_0x33a6e5[_0x138f50(0x17c)]};}export async function resolvePermitRoles(_0x4555af,_0x3b2ab1,_0x3d2844){const _0x17f2b4=a139_0x5aef3a,_0x2b1325=await listPermitRoles(_0x4555af,{'needSelf':!![],'needPublic':!![]}),_0x1c7834=[];for(const _0x28c493 of _0x3b2ab1){const _0x45f3d0=resolveOnePermitRole(_0x2b1325,_0x28c493);if(!_0x3d2844[_0x17f2b4(0x173)]&&_0x45f3d0[_0x17f2b4(0x17c)]==='SELF')throw CliErrors['validation'](_0x17f2b4(0x17b)+_0x3d2844[_0x17f2b4(0x172)]+'.',_0x17f2b4(0x1b8));if(!_0x1c7834[_0x17f2b4(0x188)](_0x15702e=>_0x15702e['id']===_0x45f3d0['id']))_0x1c7834[_0x17f2b4(0x197)](_0x45f3d0);}return _0x1c7834;}function resolveOnePermitRole(_0x396627,_0x3480e6){const _0x218079=a139_0x5aef3a,_0xb617c4=_0x3480e6['trim'](),_0x27b306=_0xb617c4[_0x218079(0x199)]();if(_0x27b306===_0x218079(0x1b6)||_0x27b306===_0x218079(0x186)){const _0x25d377=_0x396627[_0x218079(0x183)](_0x3330f3=>_0x3330f3['roleType']===_0x27b306);if(!_0x25d377)throw CliErrors[_0x218079(0x1b2)](_0x218079(0x171)+_0x27b306+_0x218079(0x195));return _0x25d377;}if(/^-?\d+$/[_0x218079(0x1c1)](_0xb617c4)){const _0x34eee5=Number(_0xb617c4),_0x32cbb7=_0x396627[_0x218079(0x183)](_0x29ae15=>_0x29ae15['id']===_0x34eee5);if(!_0x32cbb7)throw CliErrors['validation'](_0x218079(0x19a)+_0x34eee5+'\x20not\x20found.',_0x218079(0x18e));return _0x32cbb7;}const _0x430eab=_0x396627[_0x218079(0x17a)](_0x352897=>_0x352897[_0x218079(0x19c)]===_0xb617c4);if(_0x430eab[_0x218079(0x170)]===0x0)throw CliErrors[_0x218079(0x1b2)](_0x218079(0x1bc)+_0xb617c4+_0x218079(0x19f),'Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.');if(_0x430eab['length']>0x1)throw CliErrors['validation'](_0x218079(0x1bc)+_0xb617c4+_0x218079(0x1a1)+_0x430eab[_0x218079(0x1c0)](_0x4dfeb4=>_0x4dfeb4['id'])['join'](',\x20')+').',_0x218079(0x189));return _0x430eab[0x0];}export function projectPageSlot(_0x3ca083){const _0xbe3475=a139_0x5aef3a;if(!_0x3ca083)return null;return{'resourceCode':_0x3ca083[_0xbe3475(0x1a2)],'roles':(_0x3ca083[_0xbe3475(0x17f)]??[])[_0xbe3475(0x1c0)](projectRoleRef)};}export function projectPagePermit(_0x5b4771){const _0x297775=a139_0x5aef3a,_0x30ae9={'menuId':_0x5b4771[_0x297775(0x18a)],'appCode':_0x5b4771['appCode'],'menuPermit':projectPageSlot(_0x5b4771[_0x297775(0x184)])};for(const _0x4c3aa8 of PAGE_SLOT_SPECS){if(_0x4c3aa8[_0x297775(0x1b0)]===_0x297775(0x184))continue;_0x30ae9[_0x4c3aa8['key']]=projectPageSlot(_0x5b4771[_0x4c3aa8[_0x297775(0x1b0)]]);}return _0x30ae9;}export function flattenMenuResources(_0x291941){const _0x3a5414=new Map(),_0x36e038=_0x4554ba=>{const _0x43e8f8=a139_0x2e3b;for(const _0x2ab5b9 of _0x4554ba??[]){_0x3a5414['set'](_0x2ab5b9[_0x43e8f8(0x1a2)],{'resourceCode':_0x2ab5b9[_0x43e8f8(0x1a2)],'resourceName':_0x2ab5b9[_0x43e8f8(0x1af)],'action':_0x2ab5b9[_0x43e8f8(0x19d)]?.[0x0]??'0'});if(_0x2ab5b9[_0x43e8f8(0x190)])_0x36e038(_0x2ab5b9[_0x43e8f8(0x190)]);}};return _0x36e038(_0x291941),_0x3a5414;}export function flattenApiResources(_0x20aba1){const _0x4ebde1=a139_0x5aef3a,_0xbcafce=new Map(),_0x5919e2=new Map();for(const _0x45231e of _0x20aba1){const _0x4073e0=_0x45231e['apiList']??{};for(const [_0x520822,_0x35f193]of Object[_0x4ebde1(0x1bb)](_0x4073e0)){_0xbcafce[_0x4ebde1(0x1c3)](_0x520822,{'resourceCode':_0x520822,'resourceName':_0x45231e['resourceName'],'datasetCode':_0x45231e['datasetCode'],'action':_0x35f193?.[0x0]??'0'});const _0x326c70=_0x5919e2['get'](_0x45231e[_0x4ebde1(0x1c2)])??[];_0x326c70['push'](_0x520822),_0x5919e2[_0x4ebde1(0x1c3)](_0x45231e['datasetCode'],_0x326c70);}}return{'byCode':_0xbcafce,'byDataset':_0x5919e2};}export function buildPermits(_0x2a2611,_0x1d736c){const _0x388699=a139_0x5aef3a,_0x435c70={};for(const [_0xfa363d,_0x43dff2]of _0x2a2611){const _0x1f66da=_0x1d736c[_0x388699(0x192)](_0xfa363d)??_0x43dff2[_0x388699(0x1a5)];_0x435c70[_0xfa363d]=[_0x1f66da];}return _0x435c70;}export function readRoleRef(_0x183430){const _0x5e4b61=a139_0x5aef3a,_0x4b435c=_0x183430[_0x5e4b61(0x17d)]('role')[_0x5e4b61(0x1bf)]();if(!_0x4b435c)throw CliErrors['flagMissing'](_0x5e4b61(0x18d),'Pass\x20--role\x20<id|name>.');return _0x4b435c;}export function readGrantRevoke(_0x2241c1){const _0x5baaad=a139_0x5aef3a,_0x31621f=_0x2241c1[_0x5baaad(0x17e)]('grant'),_0x13b64c=_0x2241c1[_0x5baaad(0x17e)](_0x5baaad(0x1bd));if(_0x31621f&&_0x13b64c)throw CliErrors[_0x5baaad(0x1b2)](_0x5baaad(0x16f));if(!_0x31621f&&!_0x13b64c)throw CliErrors[_0x5baaad(0x1b2)]('Missing\x20action.',_0x5baaad(0x1b5));return _0x31621f?_0x5baaad(0x178):'0';}
1
+ const a140_0x44dbb7=a140_0x1b88;function a140_0x2014(){const _0x5449ab=['delete-roles','menu\x20visibility','3465412PfdBvf','Role\x20id\x20or\x20role\x20name','datasets','length','bool','roleType','menu-id','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','21kumwBD','allowedActions','set','dataUpdate','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.',';\x20SELF\x20=\x20only\x20own\x20rows','data\x20create','filter','role','some','action','entries','trim','find','data\x20detail','apiList','rolePermit','5652360zzlQvC','data\x20export','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','revoke','SELF\x20is\x20not\x20allowed\x20for\x20','data\x20delete','join','create-roles','2969232BzVouZ','ALL','menu-roles','menuPermit','Role\x20id\x20','Special\x20role\x20','118734avYmIA','key','split','map','110osaZWg','test','Missing\x20action.','appCode','datasetCode','str','push','\x22\x20not\x20found.','\x20(comma-separated\x20SELF/ALL/id/name)','dataDetail','flagMissing','resourceName','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','228882iPrDgN','access','SELF','pageNodeList','roleName','resourceCode','number','grant','string','menus','Run\x20`role\x20list`.','\x22\x20is\x20ambiguous\x20(ids:\x20','boolean','allowSelf','Disambiguate\x20with\x20an\x20id.','330190JuRglC','dataCreate','dataDelete','Menu\x20id\x20(from\x20`menu\x20list`)','\x20not\x20found.','validation','detail-roles','export-roles','1326288TtXhzv','get'];a140_0x2014=function(){return _0x5449ab;};return a140_0x2014();}(function(_0x5ad67a,_0x3d251c){const _0x12a49f=a140_0x1b88,_0xc3ec89=_0x5ad67a();while(!![]){try{const _0xd6d572=-parseInt(_0x12a49f(0x198))/0x1+-parseInt(_0x12a49f(0x164))/0x2+-parseInt(_0x12a49f(0x16c))/0x3+-parseInt(_0x12a49f(0x170))/0x4+parseInt(_0x12a49f(0x19c))/0x5*(parseInt(_0x12a49f(0x155))/0x6)+-parseInt(_0x12a49f(0x178))/0x7*(-parseInt(_0x12a49f(0x192))/0x8)+parseInt(_0x12a49f(0x18a))/0x9;if(_0xd6d572===_0x3d251c)break;else _0xc3ec89['push'](_0xc3ec89['shift']());}catch(_0xcd83d7){_0xc3ec89['push'](_0xc3ec89['shift']());}}}(a140_0x2014,0xf152a));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a140_0x44dbb7(0x176),'type':a140_0x44dbb7(0x15b),'required':!![],'description':a140_0x44dbb7(0x167)};export const ROLE_REF_FLAG={'name':a140_0x44dbb7(0x181),'type':a140_0x44dbb7(0x15d),'required':!![],'description':a140_0x44dbb7(0x171)};export const GRANT_FLAG={'name':a140_0x44dbb7(0x15c),'type':a140_0x44dbb7(0x161),'required':![],'description':'Grant\x20access\x20to\x20the\x20listed\x20resources'};export const REVOKE_FLAG={'name':'revoke','type':a140_0x44dbb7(0x161),'required':![],'description':'Revoke\x20access\x20to\x20the\x20listed\x20resources'};export const MENUS_FLAG={'name':a140_0x44dbb7(0x15e),'type':'string','required':!![],'description':'Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke'};export const DATASETS_FLAG={'name':a140_0x44dbb7(0x172),'type':a140_0x44dbb7(0x15d),'required':!![],'description':a140_0x44dbb7(0x154)};export const PAGE_SLOT_SPECS=[{'flag':a140_0x44dbb7(0x194),'key':a140_0x44dbb7(0x195),'allowSelf':![],'label':a140_0x44dbb7(0x16f)},{'flag':a140_0x44dbb7(0x191),'key':a140_0x44dbb7(0x165),'allowSelf':![],'label':a140_0x44dbb7(0x17f)},{'flag':'update-roles','key':a140_0x44dbb7(0x17b),'allowSelf':![],'label':'data\x20update'},{'flag':a140_0x44dbb7(0x16e),'key':a140_0x44dbb7(0x166),'allowSelf':![],'label':a140_0x44dbb7(0x18f)},{'flag':a140_0x44dbb7(0x16a),'key':a140_0x44dbb7(0x151),'allowSelf':![],'label':a140_0x44dbb7(0x187)},{'flag':a140_0x44dbb7(0x16b),'key':'dataExport','allowSelf':![],'label':a140_0x44dbb7(0x18b)},{'flag':'row-roles','key':'dataPermit','allowSelf':!![],'label':'row\x20visibility'}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a140_0x44dbb7(0x19b)](_0x33c879=>({'name':_0x33c879['flag'],'type':a140_0x44dbb7(0x15d),'required':![],'description':'Roles\x20for\x20'+_0x33c879['label']+a140_0x44dbb7(0x150)+(_0x33c879[a140_0x44dbb7(0x162)]?a140_0x44dbb7(0x17e):'')}));export function splitList(_0x5b0522){const _0x505c30=a140_0x44dbb7;return _0x5b0522[_0x505c30(0x19a)](',')[_0x505c30(0x19b)](_0x23b847=>_0x23b847[_0x505c30(0x185)]())[_0x505c30(0x180)](Boolean);}export function projectRoleRef(_0x50827a){const _0x3c9234=a140_0x44dbb7;return{'id':_0x50827a['id'],'roleName':_0x50827a[_0x3c9234(0x159)],'roleType':_0x50827a['roleType']};}export async function resolvePermitRoles(_0x3b0061,_0x19e0c6,_0x1b512d){const _0x4329c4=a140_0x44dbb7,_0x28f37f=await listPermitRoles(_0x3b0061,{'needSelf':!![],'needPublic':!![]}),_0x45138f=[];for(const _0x5caa7a of _0x19e0c6){const _0x4a6a58=resolveOnePermitRole(_0x28f37f,_0x5caa7a);if(!_0x1b512d[_0x4329c4(0x162)]&&_0x4a6a58[_0x4329c4(0x175)]===_0x4329c4(0x157))throw CliErrors['validation'](_0x4329c4(0x18e)+_0x1b512d['label']+'.',_0x4329c4(0x17c));if(!_0x45138f[_0x4329c4(0x182)](_0x2d1e81=>_0x2d1e81['id']===_0x4a6a58['id']))_0x45138f[_0x4329c4(0x14e)](_0x4a6a58);}return _0x45138f;}function resolveOnePermitRole(_0x24701e,_0x111009){const _0x55972b=a140_0x44dbb7,_0x21199c=_0x111009[_0x55972b(0x185)](),_0x1a0203=_0x21199c['toUpperCase']();if(_0x1a0203===_0x55972b(0x157)||_0x1a0203===_0x55972b(0x193)){const _0x2c42c3=_0x24701e['find'](_0x203015=>_0x203015[_0x55972b(0x175)]===_0x1a0203);if(!_0x2c42c3)throw CliErrors[_0x55972b(0x169)](_0x55972b(0x197)+_0x1a0203+'\x20is\x20not\x20available\x20for\x20this\x20app.');return _0x2c42c3;}if(/^-?\d+$/[_0x55972b(0x19d)](_0x21199c)){const _0x4cab19=Number(_0x21199c),_0x41ad1c=_0x24701e[_0x55972b(0x186)](_0x581008=>_0x581008['id']===_0x4cab19);if(!_0x41ad1c)throw CliErrors[_0x55972b(0x169)](_0x55972b(0x196)+_0x4cab19+_0x55972b(0x168),_0x55972b(0x15f));return _0x41ad1c;}const _0x23cd5d=_0x24701e[_0x55972b(0x180)](_0x3c6bc8=>_0x3c6bc8[_0x55972b(0x159)]===_0x21199c);if(_0x23cd5d[_0x55972b(0x173)]===0x0)throw CliErrors[_0x55972b(0x169)]('Role\x20\x22'+_0x21199c+_0x55972b(0x14f),_0x55972b(0x17d));if(_0x23cd5d['length']>0x1)throw CliErrors[_0x55972b(0x169)]('Role\x20\x22'+_0x21199c+_0x55972b(0x160)+_0x23cd5d[_0x55972b(0x19b)](_0x2abd09=>_0x2abd09['id'])[_0x55972b(0x190)](',\x20')+').',_0x55972b(0x163));return _0x23cd5d[0x0];}export function projectPageSlot(_0x47676f){const _0x585d54=a140_0x44dbb7;if(!_0x47676f)return null;return{'resourceCode':_0x47676f[_0x585d54(0x15a)],'roles':(_0x47676f[_0x585d54(0x189)]??[])[_0x585d54(0x19b)](projectRoleRef)};}export function projectPagePermit(_0x519664){const _0x53de6c=a140_0x44dbb7,_0x5818fe={'menuId':_0x519664['menuId'],'appCode':_0x519664[_0x53de6c(0x14b)],'menuPermit':projectPageSlot(_0x519664[_0x53de6c(0x195)])};for(const _0x1e7f9c of PAGE_SLOT_SPECS){if(_0x1e7f9c['key']===_0x53de6c(0x195))continue;_0x5818fe[_0x1e7f9c[_0x53de6c(0x199)]]=projectPageSlot(_0x519664[_0x1e7f9c[_0x53de6c(0x199)]]);}return _0x5818fe;}export function flattenMenuResources(_0x2896d0){const _0x51e0dc=new Map(),_0x4ed3ce=_0xabb6c4=>{const _0x5a490b=a140_0x1b88;for(const _0x8be821 of _0xabb6c4??[]){_0x51e0dc[_0x5a490b(0x17a)](_0x8be821['resourceCode'],{'resourceCode':_0x8be821[_0x5a490b(0x15a)],'resourceName':_0x8be821[_0x5a490b(0x153)],'action':_0x8be821[_0x5a490b(0x179)]?.[0x0]??'0'});if(_0x8be821[_0x5a490b(0x158)])_0x4ed3ce(_0x8be821[_0x5a490b(0x158)]);}};return _0x4ed3ce(_0x2896d0),_0x51e0dc;}function a140_0x1b88(_0x203097,_0x4158e1){_0x203097=_0x203097-0x14b;const _0x201419=a140_0x2014();let _0x1b88e1=_0x201419[_0x203097];return _0x1b88e1;}export function flattenApiResources(_0x163d68){const _0x2e708d=a140_0x44dbb7,_0xf04e01=new Map(),_0x3c9e9f=new Map();for(const _0x5ed704 of _0x163d68){const _0x2f8142=_0x5ed704[_0x2e708d(0x188)]??{};for(const [_0x1fddc9,_0x3d7410]of Object[_0x2e708d(0x184)](_0x2f8142)){_0xf04e01[_0x2e708d(0x17a)](_0x1fddc9,{'resourceCode':_0x1fddc9,'resourceName':_0x5ed704[_0x2e708d(0x153)],'datasetCode':_0x5ed704[_0x2e708d(0x14c)],'action':_0x3d7410?.[0x0]??'0'});const _0x3927a5=_0x3c9e9f[_0x2e708d(0x16d)](_0x5ed704[_0x2e708d(0x14c)])??[];_0x3927a5[_0x2e708d(0x14e)](_0x1fddc9),_0x3c9e9f[_0x2e708d(0x17a)](_0x5ed704['datasetCode'],_0x3927a5);}}return{'byCode':_0xf04e01,'byDataset':_0x3c9e9f};}export function buildPermits(_0x4a349c,_0x3cd3f7){const _0x48f07d=a140_0x44dbb7,_0x3e10a4={};for(const [_0x4b1a58,_0x2b8d80]of _0x4a349c){const _0x3b468a=_0x3cd3f7[_0x48f07d(0x16d)](_0x4b1a58)??_0x2b8d80[_0x48f07d(0x183)];_0x3e10a4[_0x4b1a58]=[_0x3b468a];}return _0x3e10a4;}export function readRoleRef(_0x5a4e19){const _0x42b9b6=a140_0x44dbb7,_0xaf472b=_0x5a4e19[_0x42b9b6(0x14d)](_0x42b9b6(0x181))[_0x42b9b6(0x185)]();if(!_0xaf472b)throw CliErrors[_0x42b9b6(0x152)](_0x42b9b6(0x181),'Pass\x20--role\x20<id|name>.');return _0xaf472b;}export function readGrantRevoke(_0x1f2b8a){const _0x3a1928=a140_0x44dbb7,_0x2a099f=_0x1f2b8a[_0x3a1928(0x174)](_0x3a1928(0x15c)),_0x4d184e=_0x1f2b8a[_0x3a1928(0x174)](_0x3a1928(0x18d));if(_0x2a099f&&_0x4d184e)throw CliErrors[_0x3a1928(0x169)](_0x3a1928(0x18c));if(!_0x2a099f&&!_0x4d184e)throw CliErrors['validation'](_0x3a1928(0x19e),_0x3a1928(0x177));return _0x2a099f?_0x3a1928(0x156):'0';}
@@ -1 +1 @@
1
- (function(_0xed31bd,_0x831cce){const _0x3b8cd3=a140_0x3405,_0x572ee4=_0xed31bd();while(!![]){try{const _0x5c6524=parseInt(_0x3b8cd3(0xa9))/0x1*(parseInt(_0x3b8cd3(0xac))/0x2)+parseInt(_0x3b8cd3(0xad))/0x3*(-parseInt(_0x3b8cd3(0xc3))/0x4)+parseInt(_0x3b8cd3(0xc2))/0x5*(-parseInt(_0x3b8cd3(0xb1))/0x6)+parseInt(_0x3b8cd3(0xb0))/0x7*(parseInt(_0x3b8cd3(0xae))/0x8)+-parseInt(_0x3b8cd3(0xb6))/0x9+parseInt(_0x3b8cd3(0xb9))/0xa*(-parseInt(_0x3b8cd3(0xab))/0xb)+parseInt(_0x3b8cd3(0xbf))/0xc;if(_0x5c6524===_0x831cce)break;else _0x572ee4['push'](_0x572ee4['shift']());}catch(_0x800818){_0x572ee4['push'](_0x572ee4['shift']());}}}(a140_0x5288,0xa8ea6));import{existsSync}from'node:fs';import a140_0x24880a from'node:path';import a140_0x2e4ea3 from'chalk';import{input,confirm}from'@inquirer/prompts';function a140_0x3405(_0x58fa9d,_0x2ce0ab){_0x58fa9d=_0x58fa9d-0xa7;const _0x528827=a140_0x5288();let _0x34053e=_0x528827[_0x58fa9d];return _0x34053e;}import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a140_0x5288(){const _0x5379fa=['Not\x20set','5131eYahuN','942tBfkcI','cyan','green','√\x20Login\x20status:\x20','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','10269747BDrvsA','my-app','Login\x20failed','20fTQwhX','√\x20Project\x20Name:\x20','env','log','production','Project\x20name\x20cannot\x20exceed\x2050\x20characters','27760812iznUaV','Skipped','\x22\x20already\x20exists','25475DYfQcW','28UKhCwa','length','Project\x20name:','941653QnaGRw','resolve','5806526iJSFTr','2ueSevI','319647iZVYwX','12872TqKzHl'];a140_0x5288=function(){return _0x5379fa;};return a140_0x5288();}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(_0x268fa6,_0x56cc20,_0x330184){const _0x5167b7=a140_0x3405,_0x47bef3=_0x5167b7(0xb7),_0x2038d4=readConfig(),_0x28eb81=typeof _0x2038d4[_0x5167b7(0xbb)]==='string'?_0x2038d4[_0x5167b7(0xbb)]:undefined,_0x29d1b0=await input({'message':_0x5167b7(0xa8),'default':_0x47bef3,'validate':_0x1d89be=>{const _0x241527=_0x5167b7,_0x5c8fa0=_0x1d89be['trim']()||_0x47bef3;if(_0x5c8fa0[_0x241527(0xa7)]>0x32)return _0x241527(0xbe);const _0xf159f9=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x5c8fa0&&!_0xf159f9['test'](_0x5c8fa0))return _0x241527(0xb5);const _0x2da58d=a140_0x24880a[_0x241527(0xaa)](process['cwd'](),_0x5c8fa0);if(existsSync(_0x2da58d))return'Directory\x20\x22'+_0x5c8fa0+_0x241527(0xc1);return!![];}});console[_0x5167b7(0xbc)](a140_0x2e4ea3['green'](_0x5167b7(0xba)+a140_0x2e4ea3[_0x5167b7(0xb2)](_0x29d1b0)));const _0x2162e7=await selectSingleAppcode(_0x330184);console[_0x5167b7(0xbc)](a140_0x2e4ea3[_0x5167b7(0xb3)]('√\x20App\x20Code:\x20'+a140_0x2e4ea3['cyan'](_0x2162e7||_0x5167b7(0xaf))));if(_0x2162e7){const _0x45a4ad=await getIsSessionValid();if(!_0x45a4ad){const _0x3614e6=await confirm({'message':'No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','default':!![]});if(_0x3614e6){const _0x4c6293=await authServer({'silent':!![]});console[_0x5167b7(0xbc)](a140_0x2e4ea3[_0x5167b7(0xb3)](_0x5167b7(0xb4)+a140_0x2e4ea3[_0x5167b7(0xb2)](_0x4c6293?'Logged\x20in':_0x5167b7(0xb8))));}else console[_0x5167b7(0xbc)](a140_0x2e4ea3[_0x5167b7(0xb3)](_0x5167b7(0xb4)+a140_0x2e4ea3['cyan'](_0x5167b7(0xc0))));}await _0x268fa6({'projectName':_0x29d1b0,'appCode':_0x2162e7,'env':_0x56cc20||_0x28eb81||'production'});}else await _0x268fa6({'projectName':_0x29d1b0,'env':_0x56cc20||_0x28eb81||_0x5167b7(0xbd)});}
1
+ (function(_0x4b8c35,_0x37502b){const _0x1ec591=a141_0x2278,_0x399ee2=_0x4b8c35();while(!![]){try{const _0x5b983a=-parseInt(_0x1ec591(0x7b))/0x1*(-parseInt(_0x1ec591(0x70))/0x2)+parseInt(_0x1ec591(0x72))/0x3+parseInt(_0x1ec591(0x77))/0x4+-parseInt(_0x1ec591(0x8c))/0x5+-parseInt(_0x1ec591(0x75))/0x6*(parseInt(_0x1ec591(0x71))/0x7)+-parseInt(_0x1ec591(0x8a))/0x8+parseInt(_0x1ec591(0x86))/0x9;if(_0x5b983a===_0x37502b)break;else _0x399ee2['push'](_0x399ee2['shift']());}catch(_0x2058c4){_0x399ee2['push'](_0x399ee2['shift']());}}}(a141_0x3295,0x98475));import{existsSync}from'node:fs';function a141_0x3295(){const _0x58e91d=['1041488PohDXp','497teJoZI','174777msjyLB','trim','env','138Civkkd','length','356504ihEopr','string','cyan','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','1HPcFVN','√\x20Login\x20status:\x20','Login\x20failed','production','\x22\x20already\x20exists','Project\x20name\x20cannot\x20exceed\x2050\x20characters','cwd','√\x20Project\x20Name:\x20','Skipped','resolve','green','7566318AOYAJy','my-app','Project\x20name:','Directory\x20\x22','1362464GQvjNy','log','3565785MTHjzE','Not\x20set','test'];a141_0x3295=function(){return _0x58e91d;};return a141_0x3295();}import a141_0x3ca5d7 from'node:path';import a141_0x31919a from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a141_0x2278(_0x18d6b3,_0x45e996){_0x18d6b3=_0x18d6b3-0x6f;const _0x329571=a141_0x3295();let _0x22780b=_0x329571[_0x18d6b3];return _0x22780b;}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(_0x531fc3,_0x3360aa,_0x261801){const _0x38830d=a141_0x2278,_0x2ce3f2=_0x38830d(0x87),_0x5895fa=readConfig(),_0x12aee8=typeof _0x5895fa[_0x38830d(0x74)]===_0x38830d(0x78)?_0x5895fa[_0x38830d(0x74)]:undefined,_0x341cbc=await input({'message':_0x38830d(0x88),'default':_0x2ce3f2,'validate':_0xc4bcdb=>{const _0x154296=_0x38830d,_0x75eb36=_0xc4bcdb[_0x154296(0x73)]()||_0x2ce3f2;if(_0x75eb36[_0x154296(0x76)]>0x32)return _0x154296(0x80);const _0x10224e=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x75eb36&&!_0x10224e[_0x154296(0x6f)](_0x75eb36))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x429428=a141_0x3ca5d7[_0x154296(0x84)](process[_0x154296(0x81)](),_0x75eb36);if(existsSync(_0x429428))return _0x154296(0x89)+_0x75eb36+_0x154296(0x7f);return!![];}});console[_0x38830d(0x8b)](a141_0x31919a['green'](_0x38830d(0x82)+a141_0x31919a[_0x38830d(0x79)](_0x341cbc)));const _0x63ff8b=await selectSingleAppcode(_0x261801);console['log'](a141_0x31919a[_0x38830d(0x85)]('√\x20App\x20Code:\x20'+a141_0x31919a[_0x38830d(0x79)](_0x63ff8b||_0x38830d(0x8d))));if(_0x63ff8b){const _0x2e2a3a=await getIsSessionValid();if(!_0x2e2a3a){const _0x2bc2e3=await confirm({'message':_0x38830d(0x7a),'default':!![]});if(_0x2bc2e3){const _0x223029=await authServer({'silent':!![]});console[_0x38830d(0x8b)](a141_0x31919a[_0x38830d(0x85)](_0x38830d(0x7c)+a141_0x31919a[_0x38830d(0x79)](_0x223029?'Logged\x20in':_0x38830d(0x7d))));}else console[_0x38830d(0x8b)](a141_0x31919a[_0x38830d(0x85)](_0x38830d(0x7c)+a141_0x31919a[_0x38830d(0x79)](_0x38830d(0x83))));}await _0x531fc3({'projectName':_0x341cbc,'appCode':_0x63ff8b,'env':_0x3360aa||_0x12aee8||_0x38830d(0x7e)});}else await _0x531fc3({'projectName':_0x341cbc,'env':_0x3360aa||_0x12aee8||_0x38830d(0x7e)});}
@@ -1 +1 @@
1
- (function(_0x53cc5e,_0x365ad6){const _0x617e67=a141_0x1b7e,_0x3492d8=_0x53cc5e();while(!![]){try{const _0x1ec570=parseInt(_0x617e67(0xf4))/0x1*(-parseInt(_0x617e67(0xf7))/0x2)+parseInt(_0x617e67(0xf6))/0x3+-parseInt(_0x617e67(0xf2))/0x4+-parseInt(_0x617e67(0xef))/0x5+-parseInt(_0x617e67(0xf3))/0x6+-parseInt(_0x617e67(0xf1))/0x7*(-parseInt(_0x617e67(0xf0))/0x8)+-parseInt(_0x617e67(0xee))/0x9*(-parseInt(_0x617e67(0xf8))/0xa);if(_0x1ec570===_0x365ad6)break;else _0x3492d8['push'](_0x3492d8['shift']());}catch(_0x5394b7){_0x3492d8['push'](_0x3492d8['shift']());}}}(a141_0x553d,0x6bb8d));export function formatElapsed(_0x10174e){const _0x48cd75=a141_0x1b7e,_0x4cc847=Date[_0x48cd75(0xf5)]()-_0x10174e;if(_0x4cc847<0x3e8)return _0x4cc847+'ms';const _0x4a1c26=(_0x4cc847/0x3e8)[_0x48cd75(0xf9)](0x2),_0x1e8ae6=_0x4a1c26['replace'](/\.?0+$/u,'');return _0x1e8ae6+'s';}function a141_0x1b7e(_0xb41d0c,_0x325bdf){_0xb41d0c=_0xb41d0c-0xee;const _0x553da5=a141_0x553d();let _0x1b7eaf=_0x553da5[_0xb41d0c];return _0x1b7eaf;}function a141_0x553d(){const _0x488e99=['now','2312130QajUpL','524678UJJPlq','4977640JwvCeP','toFixed','18mDUySb','2669300kpmjax','5627672gtWwFg','7scgxqf','1445976eljFvH','5224650KrtPbH','1jJbCjd'];a141_0x553d=function(){return _0x488e99;};return a141_0x553d();}
1
+ function a142_0x2e86(_0x421647,_0x4f5c33){_0x421647=_0x421647-0x175;const _0x567b97=a142_0x567b();let _0x2e86e5=_0x567b97[_0x421647];return _0x2e86e5;}(function(_0x2b36d0,_0x2e0ac3){const _0x17af80=a142_0x2e86,_0x2a1e8c=_0x2b36d0();while(!![]){try{const _0x178d73=parseInt(_0x17af80(0x175))/0x1+parseInt(_0x17af80(0x17f))/0x2*(parseInt(_0x17af80(0x17d))/0x3)+parseInt(_0x17af80(0x17c))/0x4+parseInt(_0x17af80(0x17b))/0x5+parseInt(_0x17af80(0x179))/0x6*(parseInt(_0x17af80(0x176))/0x7)+parseInt(_0x17af80(0x181))/0x8*(-parseInt(_0x17af80(0x178))/0x9)+parseInt(_0x17af80(0x177))/0xa*(-parseInt(_0x17af80(0x17a))/0xb);if(_0x178d73===_0x2e0ac3)break;else _0x2a1e8c['push'](_0x2a1e8c['shift']());}catch(_0x2675bd){_0x2a1e8c['push'](_0x2a1e8c['shift']());}}}(a142_0x567b,0xc491c));export function formatElapsed(_0x2e385c){const _0x1e8665=a142_0x2e86,_0x596d08=Date[_0x1e8665(0x180)]()-_0x2e385c;if(_0x596d08<0x3e8)return _0x596d08+'ms';const _0x4e9522=(_0x596d08/0x3e8)['toFixed'](0x2),_0x56f2c5=_0x4e9522[_0x1e8665(0x17e)](/\.?0+$/u,'');return _0x56f2c5+'s';}function a142_0x567b(){const _0x4d8639=['replace','757994bIDFJb','now','2488oFFKej','1316747VJmBTr','7DQveLB','94570fehlaN','19593mRjTsI','2517306fekSZt','3014hnvKxU','2312240BGwAnN','4466692WryhWj','6jGSoAQ'];a142_0x567b=function(){return _0x4d8639;};return a142_0x567b();}
@@ -1 +1 @@
1
- (function(_0x33b1d5,_0x27e376){const _0x8a1521=a142_0x3a86,_0x58ff0e=_0x33b1d5();while(!![]){try{const _0x13ad65=parseInt(_0x8a1521(0xd9))/0x1*(-parseInt(_0x8a1521(0xb4))/0x2)+-parseInt(_0x8a1521(0xe1))/0x3*(parseInt(_0x8a1521(0xd8))/0x4)+-parseInt(_0x8a1521(0xce))/0x5*(-parseInt(_0x8a1521(0xcc))/0x6)+-parseInt(_0x8a1521(0xfb))/0x7*(parseInt(_0x8a1521(0xf5))/0x8)+parseInt(_0x8a1521(0xe9))/0x9+-parseInt(_0x8a1521(0xee))/0xa+-parseInt(_0x8a1521(0xba))/0xb*(-parseInt(_0x8a1521(0xae))/0xc);if(_0x13ad65===_0x27e376)break;else _0x58ff0e['push'](_0x58ff0e['shift']());}catch(_0x22f545){_0x58ff0e['push'](_0x58ff0e['shift']());}}}(a142_0x34a7,0xd01dc));import a142_0x4f3d59 from'path';import a142_0x59a27b from'fs';import a142_0x382c25 from'chalk';import a142_0xe1e590 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';function a142_0x3a86(_0x39294e,_0x33915b){_0x39294e=_0x39294e-0xa9;const _0x34a735=a142_0x34a7();let _0x3a868e=_0x34a735[_0x39294e];return _0x3a868e;}import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';function a142_0x34a7(){const _0x3be84f=['create','fail','production','Project\x20name:\x20','9219qhvMdP','info','defaultApp','minimumVersion','\x20√\x20','green','cyan','cwd','belowMinimum','projectName','stop','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','gray','resolve','2876724lbWmKN','cookie','dirname','\x20model(s)','√\x20Pulled\x20','message','166ZoJBcn','stableVersion','parse','\x20dataset(s),\x20generated\x20','modelCount','项目创建失败:\x20','44dNajGO','√\x20package.json\x20updated:\x20name=','\x20|\x20AppCode:\x20','repeat','🚀\x20Next\x20Steps:','stringify','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','Project\x20directory\x20','项目创建完成:\x20','needsUpgrade','length','env','\x20api\x20pull','accessSync','trim','Copy\x20project\x20files','readFileSync','existsSync','893202WuSrVc','log','35yBlgrJ','start','\x20\x201.\x20Start\x20project:\x20','apps','\x20|\x20Default:\x20','1.0.0','Project\x20name\x20cannot\x20be\x20empty','appCode','\x20\x202.\x20Pull\x20API\x20configuration:\x20','配置应用AppCode:\x20','1984NsKmwn','4577dCAPjG','bold','success','*\x20Pulling\x20API\x20configuration...','error','chdir','\x20already\x20exists','CLI\x20版本检查','7536wupWlx','join','test','package.json','API\x20配置拉取异常','projectCode','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','version','5923818XmgciZ','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','utf8','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','*\x20Configuring\x20AppCode\x20for\x20project\x20','360220dOkONQ','description','W_OK','清理项目目录失败:\x20','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','\x20&&\x20','warn','880AmNzrK','...'];a142_0x34a7=function(){return _0x3be84f;};return a142_0x34a7();}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(_0x275124){const _0x313c00=a142_0x3a86,_0x2659a4=await checkCliVersion();(_0x2659a4['needsUpgrade']||_0x2659a4[_0x313c00(0x103)])&&(printCliUpgradeWarning(_0x2659a4),assertCliVersionSupported(_0x2659a4),logger[_0x313c00(0xfc)](_0x313c00(0xf7),_0x313c00(0xe0),{'currentVersion':_0x2659a4['currentVersion'],'stableVersion':_0x2659a4[_0x313c00(0xb5)],'minimumVersion':_0x2659a4[_0x313c00(0xfe)],'needsUpgrade':_0x2659a4[_0x313c00(0xc3)],'belowMinimum':_0x2659a4[_0x313c00(0x103)]}));if(_0x275124[_0x313c00(0xe6)]&&_0x275124['appCode'])await runCreate({'projectName':_0x275124[_0x313c00(0xe6)],'appCode':_0x275124[_0x313c00(0xd5)],'env':_0x275124[_0x313c00(0xc5)]},_0x275124);else{if(_0x275124[_0x313c00(0xe6)]){const _0x1cfef7=await selectSingleAppcode(_0x275124[_0x313c00(0xaf)]);await runCreate({'projectName':_0x275124[_0x313c00(0xe6)],'appCode':_0x1cfef7||undefined,'env':_0x275124[_0x313c00(0xc5)]},_0x275124);}else await guidedCreateProject(_0x1aec22=>runCreate(_0x1aec22,_0x275124),_0x275124[_0x313c00(0xc5)],_0x275124[_0x313c00(0xaf)]);}}async function runCreate(_0x47f4ea,_0x595150){const _0x2b0f59=a142_0x3a86;if(!_0x47f4ea[_0x2b0f59(0xa9)]||_0x47f4ea[_0x2b0f59(0xa9)][_0x2b0f59(0xc8)]()==='')throw new Error(_0x2b0f59(0xd4));const _0x6cb405=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x6cb405[_0x2b0f59(0xe3)](_0x47f4ea[_0x2b0f59(0xa9)]))throw new Error(_0x2b0f59(0xc0));if(_0x47f4ea[_0x2b0f59(0xa9)][_0x2b0f59(0xc4)]>0x64)throw new Error(_0x2b0f59(0xec));const _0x469320=a142_0x4f3d59[_0x2b0f59(0xad)](process[_0x2b0f59(0x102)](),_0x47f4ea[_0x2b0f59(0xa9)]);if(a142_0x59a27b['existsSync'](_0x469320))throw new Error(_0x2b0f59(0xc1)+_0x47f4ea[_0x2b0f59(0xa9)]+_0x2b0f59(0xdf));try{a142_0x59a27b[_0x2b0f59(0xc7)](a142_0x4f3d59[_0x2b0f59(0xb0)](_0x469320),a142_0x59a27b['constants'][_0x2b0f59(0xf0)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger['setLogPath'](_0x469320),logger[_0x2b0f59(0xfc)](_0x2b0f59(0xf7),'开始创建项目:\x20'+_0x47f4ea[_0x2b0f59(0xa9)],{'projectDir':_0x469320,'appCode':_0x47f4ea[_0x2b0f59(0xd5)]}),console[_0x2b0f59(0xcd)](),console[_0x2b0f59(0xcd)](a142_0x382c25[_0x2b0f59(0x100)](_0x2b0f59(0xff))+_0x2b0f59(0xfa)+a142_0x382c25[_0x2b0f59(0x100)](_0x47f4ea['projectName'])+(_0x47f4ea[_0x2b0f59(0xd5)]?_0x2b0f59(0xbc)+a142_0x382c25[_0x2b0f59(0x101)](_0x47f4ea[_0x2b0f59(0xd5)]):''));try{await runTask(_0x2b0f59(0xc9),()=>copyProjectTemplate(_0x47f4ea[_0x2b0f59(0xa9)])),await updatePackageJsonName(_0x47f4ea[_0x2b0f59(0xa9)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x47f4ea[_0x2b0f59(0xa9)])),await runTask('Format\x20code',()=>formatProjectCode(_0x47f4ea[_0x2b0f59(0xa9)])),await configureAppCode(_0x47f4ea[_0x2b0f59(0xa9)],_0x47f4ea['appCode']||'',_0x47f4ea['env']);let _0xf0828a=![];if(_0x47f4ea[_0x2b0f59(0xd5)]){console['log'](_0x2b0f59(0xdc));const _0x1f473b=process[_0x2b0f59(0x102)]();try{process[_0x2b0f59(0xde)](_0x469320);const _0x342cea=_0x47f4ea[_0x2b0f59(0xc5)]||_0x2b0f59(0xf9);initEnv(_0x342cea);const {configArray:_0x167be5}=await fetchModelList(_0x47f4ea[_0x2b0f59(0xd5)],_0x595150[_0x2b0f59(0xaf)]||''),_0xf201ba=DEFAULT_API_DIR,_0x52d36b=await generateApiFile(_0x167be5,'',_0x47f4ea[_0x2b0f59(0xd5)],!![],_0x342cea,_0xf201ba);console[_0x2b0f59(0xcd)](_0x2b0f59(0xb2)+_0x167be5[_0x2b0f59(0xc4)]+_0x2b0f59(0xb7)+_0x52d36b[_0x2b0f59(0xb8)]+_0x2b0f59(0xb1)),logger['info'](_0x2b0f59(0xf7),'API\x20configuration\x20pulled:\x20'+_0x47f4ea[_0x2b0f59(0xd5)]);}catch(_0x3ff915){_0xf0828a=!![],console[_0x2b0f59(0xcd)](_0x2b0f59(0xea)),logger['warn']('create',_0x2b0f59(0xe5),{'error':_0x3ff915 instanceof Error?_0x3ff915[_0x2b0f59(0xb3)]:String(_0x3ff915)});}finally{process[_0x2b0f59(0xde)](_0x1f473b);}}logger[_0x2b0f59(0xdb)]('create',_0x2b0f59(0xc2)+_0x47f4ea['projectName']),console[_0x2b0f59(0xcd)](),console[_0x2b0f59(0xcd)](a142_0x382c25[_0x2b0f59(0x100)]('─'[_0x2b0f59(0xbd)](0x3c))),console['log'](a142_0x382c25[_0x2b0f59(0x101)][_0x2b0f59(0xda)](_0x2b0f59(0xbe))),console[_0x2b0f59(0xcd)](),console[_0x2b0f59(0xcd)](_0x2b0f59(0xd0)+a142_0x382c25['cyan'][_0x2b0f59(0xda)]('cd\x20'+_0x47f4ea[_0x2b0f59(0xa9)]+_0x2b0f59(0xf3)+CLI_BIN_NAME+'\x20run\x20start')),_0xf0828a&&console[_0x2b0f59(0xcd)](_0x2b0f59(0xd6)+a142_0x382c25[_0x2b0f59(0x101)][_0x2b0f59(0xda)](CLI_BIN_NAME+_0x2b0f59(0xc6))),console['log'](a142_0x382c25['green']('─'['repeat'](0x3c)));}catch(_0x3cde3b){logger[_0x2b0f59(0xdd)](_0x2b0f59(0xf7),_0x2b0f59(0xb9)+_0x47f4ea[_0x2b0f59(0xa9)],{'error':_0x3cde3b instanceof Error?_0x3cde3b[_0x2b0f59(0xb3)]:String(_0x3cde3b)});try{a142_0x59a27b[_0x2b0f59(0xcb)](_0x469320)&&(console[_0x2b0f59(0xcd)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x469320),a142_0x59a27b['rmSync'](_0x469320,{'recursive':!![],'force':!![]}));}catch{logger[_0x2b0f59(0xf4)](_0x2b0f59(0xf7),_0x2b0f59(0xf1)+_0x469320);}throw _0x3cde3b;}}async function runTask(_0x55666b,_0x31596a){const _0x509d09=a142_0x3a86,_0x53e699=a142_0xe1e590(_0x55666b+_0x509d09(0xf6))[_0x509d09(0xcf)]();try{const _0x89d7bb=await _0x31596a();_0x53e699[_0x509d09(0xaa)](),console[_0x509d09(0xcd)](''+a142_0x382c25['green'](_0x509d09(0xff))+_0x55666b+'\x20'+a142_0x382c25[_0x509d09(0xac)]('['+_0x89d7bb+']'));}catch(_0x33dbb5){_0x53e699[_0x509d09(0xf8)](_0x55666b);throw _0x33dbb5;}}async function updatePackageJsonName(_0x253910){const _0x25fc78=a142_0x3a86,_0x317391=a142_0x4f3d59['resolve'](process[_0x25fc78(0x102)](),_0x253910),_0x1e7b6c=a142_0x4f3d59['join'](_0x317391,'package.json');try{console[_0x25fc78(0xcd)](_0x25fc78(0xab));const _0xd8ff25=getRabetbaseCliPackageRoot(),_0x51a116=a142_0x4f3d59[_0x25fc78(0xe2)](_0xd8ff25,'package.json');let _0x23919c='1.0.0';try{const _0x94392a=JSON['parse'](a142_0x59a27b['readFileSync'](_0x51a116,_0x25fc78(0xeb)));_0x23919c=_0x94392a['version']||_0x25fc78(0xd3);}catch{}const _0x5ad599=a142_0x59a27b[_0x25fc78(0xca)](_0x1e7b6c,'utf8'),_0x52387c=JSON[_0x25fc78(0xb6)](_0x5ad599);_0x52387c['name']=_0x253910,_0x52387c[_0x25fc78(0xef)]=_0x253910+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x23919c,a142_0x59a27b['writeFileSync'](_0x1e7b6c,JSON[_0x25fc78(0xbf)](_0x52387c,null,0x2)+'\x0a','utf8'),console[_0x25fc78(0xcd)](_0x25fc78(0xbb)+_0x253910),logger[_0x25fc78(0xfc)](_0x25fc78(0xf7),'更新\x20package.json\x20name');}catch(_0x263b38){logger[_0x25fc78(0xdd)](_0x25fc78(0xf7),'更新\x20package.json\x20失败');throw _0x263b38;}}async function configureAppCode(_0x23885f,_0x57cdbe,_0x4aa0b6){const _0x5c4a42=a142_0x3a86,_0x3a7167=a142_0x4f3d59[_0x5c4a42(0xad)](process[_0x5c4a42(0x102)](),_0x23885f),_0x42dc94=a142_0x4f3d59[_0x5c4a42(0xe2)](_0x3a7167,NEW_CONFIG_NAME);try{_0x57cdbe?console['log'](_0x5c4a42(0xed)+_0x23885f+':\x20'+_0x57cdbe):console['log'](_0x5c4a42(0xf2)+_0x23885f);const _0x1be29d=getRabetbaseCliPackageRoot(),_0x48d4d1=a142_0x4f3d59[_0x5c4a42(0xe2)](_0x1be29d,_0x5c4a42(0xe4));let _0x2c0a0a=_0x5c4a42(0xd3);try{const _0x3ec852=JSON[_0x5c4a42(0xb6)](a142_0x59a27b['readFileSync'](_0x48d4d1,_0x5c4a42(0xeb)));_0x2c0a0a=_0x3ec852[_0x5c4a42(0xe8)]||_0x5c4a42(0xd3);}catch{}const _0x526e2f=readConfig(),_0x5c41e=typeof _0x526e2f[_0x5c4a42(0xc5)]==='string'?_0x526e2f[_0x5c4a42(0xc5)]:undefined,_0x147c1f={};for(const _0x53c7ef of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x526e2f[_0x53c7ef]!=null)_0x147c1f[_0x53c7ef]=_0x526e2f[_0x53c7ef];}const _0x1889f4=buildCanonicalProjectConfig(_0x147c1f,{'appCodes':_0x57cdbe?[_0x57cdbe]:[],'env':_0x4aa0b6||_0x5c41e||_0x5c4a42(0xf9),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x2c0a0a}});writeConfigFile(_0x42dc94,_0x1889f4),_0x57cdbe?console[_0x5c4a42(0xcd)]('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object['keys'](_0x1889f4[_0x5c4a42(0xd1)]||{})['join'](',\x20')+_0x5c4a42(0xd2)+_0x1889f4[_0x5c4a42(0xfd)]):console[_0x5c4a42(0xcd)](_0x5c4a42(0xe7)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x5c4a42(0xfc)](_0x5c4a42(0xf7),_0x5c4a42(0xd7)+_0x57cdbe);}catch(_0x528dd4){logger[_0x5c4a42(0xdd)](_0x5c4a42(0xf7),'配置应用AppCode失败');}}
1
+ (function(_0x3413bd,_0x117d28){const _0x1f6d30=a143_0x57ff,_0x4f08f7=_0x3413bd();while(!![]){try{const _0x5cafc3=parseInt(_0x1f6d30(0x21a))/0x1*(-parseInt(_0x1f6d30(0x217))/0x2)+-parseInt(_0x1f6d30(0x223))/0x3*(parseInt(_0x1f6d30(0x24c))/0x4)+parseInt(_0x1f6d30(0x1f2))/0x5*(-parseInt(_0x1f6d30(0x231))/0x6)+-parseInt(_0x1f6d30(0x243))/0x7*(parseInt(_0x1f6d30(0x20c))/0x8)+-parseInt(_0x1f6d30(0x1f1))/0x9*(parseInt(_0x1f6d30(0x229))/0xa)+-parseInt(_0x1f6d30(0x23c))/0xb*(-parseInt(_0x1f6d30(0x20a))/0xc)+parseInt(_0x1f6d30(0x212))/0xd*(parseInt(_0x1f6d30(0x1fa))/0xe);if(_0x5cafc3===_0x117d28)break;else _0x4f08f7['push'](_0x4f08f7['shift']());}catch(_0x1c74f3){_0x4f08f7['push'](_0x4f08f7['shift']());}}}(a143_0x49d1,0x8c3d4));import a143_0x544674 from'path';import a143_0x2b8d26 from'fs';import a143_0x520a72 from'chalk';import a143_0x15c5a9 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';function a143_0x49d1(){const _0x1f18d9=['1.0.0','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','projectCode','245102oWeabZ','writeFileSync','create','3AWKqkA','gray','W_OK','cd\x20','modelCount','log','name','Project\x20directory\x20','setLogPath','147954BGfJVT','join','√\x20package.json\x20updated:\x20name=','readFileSync','warn','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','11051470KhjRYJ','...','\x20Generated\x20by\x20rabetbase\x20cli\x20','CLI\x20版本检查','\x20√\x20','start','resolve','bold','12GXElXb','apps','\x20api\x20pull','cyan','green','*\x20Configuring\x20AppCode\x20for\x20project\x20','constants','\x20\x202.\x20Pull\x20API\x20configuration:\x20','项目创建完成:\x20','rmSync','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','11pUodpr','清理项目目录失败:\x20','description','\x20|\x20Default:\x20','配置应用AppCode失败','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','\x20config\x20set\x20appcode\x20<app-code>\x27','2544983MKIUQb','info','🚀\x20Next\x20Steps:','version','\x20\x201.\x20Start\x20project:\x20','√\x20Pulled\x20','defaultApp','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','package.json','68VqaBbN','projectName','stringify','*\x20Pulling\x20API\x20configuration...','项目创建失败:\x20','配置应用AppCode:\x20','length','9oCGkxi','1111960MqAatd','开始创建项目:\x20','API\x20配置拉取异常','production','\x20&&\x20','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','repeat','fail','896WzViKC','cookie','cwd','\x20|\x20AppCode:\x20','appCode','success','env','needsUpgrade','更新\x20package.json\x20name','existsSync','Format\x20code','currentVersion','minimumVersion','stop','parse','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','330972tUyArx','message','24PUSDqm','accessSync','chdir','Project\x20name:\x20','keys','Project\x20name\x20cannot\x20be\x20empty','892437pbuPor','utf8'];a143_0x49d1=function(){return _0x1f18d9;};return a143_0x49d1();}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';function a143_0x57ff(_0x2698ec,_0x95c510){_0x2698ec=_0x2698ec-0x1ee;const _0x49d1ab=a143_0x49d1();let _0x57ff2f=_0x49d1ab[_0x2698ec];return _0x57ff2f;}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(_0x252313){const _0x570754=a143_0x57ff,_0x1c2e21=await checkCliVersion();(_0x1c2e21[_0x570754(0x201)]||_0x1c2e21['belowMinimum'])&&(printCliUpgradeWarning(_0x1c2e21),assertCliVersionSupported(_0x1c2e21),logger[_0x570754(0x244)](_0x570754(0x219),_0x570754(0x22c),{'currentVersion':_0x1c2e21[_0x570754(0x205)],'stableVersion':_0x1c2e21['stableVersion'],'minimumVersion':_0x1c2e21[_0x570754(0x206)],'needsUpgrade':_0x1c2e21['needsUpgrade'],'belowMinimum':_0x1c2e21['belowMinimum']}));if(_0x252313[_0x570754(0x216)]&&_0x252313[_0x570754(0x1fe)])await runCreate({'projectName':_0x252313['projectCode'],'appCode':_0x252313[_0x570754(0x1fe)],'env':_0x252313[_0x570754(0x200)]},_0x252313);else{if(_0x252313[_0x570754(0x216)]){const _0x2017a7=await selectSingleAppcode(_0x252313[_0x570754(0x1fb)]);await runCreate({'projectName':_0x252313[_0x570754(0x216)],'appCode':_0x2017a7||undefined,'env':_0x252313['env']},_0x252313);}else await guidedCreateProject(_0x291b56=>runCreate(_0x291b56,_0x252313),_0x252313[_0x570754(0x200)],_0x252313[_0x570754(0x1fb)]);}}async function runCreate(_0x11283a,_0x3e8425){const _0x213e78=a143_0x57ff;if(!_0x11283a[_0x213e78(0x24d)]||_0x11283a[_0x213e78(0x24d)]['trim']()==='')throw new Error(_0x213e78(0x211));const _0x555065=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x555065['test'](_0x11283a['projectName']))throw new Error(_0x213e78(0x1f7));if(_0x11283a['projectName'][_0x213e78(0x1f0)]>0x64)throw new Error(_0x213e78(0x24a));const _0x200cd3=a143_0x544674[_0x213e78(0x22f)](process[_0x213e78(0x1fc)](),_0x11283a[_0x213e78(0x24d)]);if(a143_0x2b8d26[_0x213e78(0x203)](_0x200cd3))throw new Error(_0x213e78(0x221)+_0x11283a['projectName']+'\x20already\x20exists');try{a143_0x2b8d26[_0x213e78(0x20d)](a143_0x544674['dirname'](_0x200cd3),a143_0x2b8d26[_0x213e78(0x237)][_0x213e78(0x21c)]);}catch{throw new Error(_0x213e78(0x209));}logger[_0x213e78(0x222)](_0x200cd3),logger['info'](_0x213e78(0x219),_0x213e78(0x1f3)+_0x11283a['projectName'],{'projectDir':_0x200cd3,'appCode':_0x11283a[_0x213e78(0x1fe)]}),console[_0x213e78(0x21f)](),console['log'](a143_0x520a72[_0x213e78(0x235)](_0x213e78(0x22d))+_0x213e78(0x20f)+a143_0x520a72['green'](_0x11283a[_0x213e78(0x24d)])+(_0x11283a[_0x213e78(0x1fe)]?_0x213e78(0x1fd)+a143_0x520a72[_0x213e78(0x234)](_0x11283a[_0x213e78(0x1fe)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x11283a[_0x213e78(0x24d)])),await updatePackageJsonName(_0x11283a[_0x213e78(0x24d)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x11283a[_0x213e78(0x24d)])),await runTask(_0x213e78(0x204),()=>formatProjectCode(_0x11283a[_0x213e78(0x24d)])),await configureAppCode(_0x11283a[_0x213e78(0x24d)],_0x11283a['appCode']||'',_0x11283a[_0x213e78(0x200)]);let _0x4866be=![];if(_0x11283a['appCode']){console[_0x213e78(0x21f)](_0x213e78(0x24f));const _0xb9a489=process['cwd']();try{process[_0x213e78(0x20e)](_0x200cd3);const _0x16b917=_0x11283a[_0x213e78(0x200)]||_0x213e78(0x1f5);initEnv(_0x16b917);const {configArray:_0x3db896}=await fetchModelList(_0x11283a[_0x213e78(0x1fe)],_0x3e8425[_0x213e78(0x1fb)]||''),_0x30c5df=DEFAULT_API_DIR,_0x1df86a=await generateApiFile(_0x3db896,'',_0x11283a[_0x213e78(0x1fe)],!![],_0x16b917,_0x30c5df);console['log'](_0x213e78(0x248)+_0x3db896[_0x213e78(0x1f0)]+'\x20dataset(s),\x20generated\x20'+_0x1df86a[_0x213e78(0x21e)]+'\x20model(s)'),logger[_0x213e78(0x244)](_0x213e78(0x219),'API\x20configuration\x20pulled:\x20'+_0x11283a['appCode']);}catch(_0x6a34c3){_0x4866be=!![],console[_0x213e78(0x21f)](_0x213e78(0x23b)),logger[_0x213e78(0x227)](_0x213e78(0x219),_0x213e78(0x1f4),{'error':_0x6a34c3 instanceof Error?_0x6a34c3[_0x213e78(0x20b)]:String(_0x6a34c3)});}finally{process[_0x213e78(0x20e)](_0xb9a489);}}logger[_0x213e78(0x1ff)](_0x213e78(0x219),_0x213e78(0x239)+_0x11283a[_0x213e78(0x24d)]),console[_0x213e78(0x21f)](),console[_0x213e78(0x21f)](a143_0x520a72[_0x213e78(0x235)]('─'['repeat'](0x3c))),console[_0x213e78(0x21f)](a143_0x520a72[_0x213e78(0x234)]['bold'](_0x213e78(0x245))),console[_0x213e78(0x21f)](),console[_0x213e78(0x21f)](_0x213e78(0x247)+a143_0x520a72[_0x213e78(0x234)][_0x213e78(0x230)](_0x213e78(0x21d)+_0x11283a[_0x213e78(0x24d)]+_0x213e78(0x1f6)+CLI_BIN_NAME+'\x20run\x20start')),_0x4866be&&console[_0x213e78(0x21f)](_0x213e78(0x238)+a143_0x520a72[_0x213e78(0x234)][_0x213e78(0x230)](CLI_BIN_NAME+_0x213e78(0x233))),console[_0x213e78(0x21f)](a143_0x520a72[_0x213e78(0x235)]('─'[_0x213e78(0x1f8)](0x3c)));}catch(_0xd9362e){logger['error'](_0x213e78(0x219),_0x213e78(0x1ee)+_0x11283a[_0x213e78(0x24d)],{'error':_0xd9362e instanceof Error?_0xd9362e[_0x213e78(0x20b)]:String(_0xd9362e)});try{a143_0x2b8d26[_0x213e78(0x203)](_0x200cd3)&&(console[_0x213e78(0x21f)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x200cd3),a143_0x2b8d26[_0x213e78(0x23a)](_0x200cd3,{'recursive':!![],'force':!![]}));}catch{logger[_0x213e78(0x227)]('create',_0x213e78(0x23d)+_0x200cd3);}throw _0xd9362e;}}async function runTask(_0x556e67,_0x552eff){const _0x39a1f5=a143_0x57ff,_0x21d6f0=a143_0x15c5a9(_0x556e67+_0x39a1f5(0x22a))[_0x39a1f5(0x22e)]();try{const _0x5ac5ab=await _0x552eff();_0x21d6f0[_0x39a1f5(0x207)](),console[_0x39a1f5(0x21f)](''+a143_0x520a72[_0x39a1f5(0x235)](_0x39a1f5(0x22d))+_0x556e67+'\x20'+a143_0x520a72[_0x39a1f5(0x21b)]('['+_0x5ac5ab+']'));}catch(_0x489ef9){_0x21d6f0[_0x39a1f5(0x1f9)](_0x556e67);throw _0x489ef9;}}async function updatePackageJsonName(_0x163c61){const _0x19bc72=a143_0x57ff,_0x2dad67=a143_0x544674[_0x19bc72(0x22f)](process['cwd'](),_0x163c61),_0x1c92de=a143_0x544674[_0x19bc72(0x224)](_0x2dad67,_0x19bc72(0x24b));try{console[_0x19bc72(0x21f)](_0x19bc72(0x241));const _0x3c91d9=getRabetbaseCliPackageRoot(),_0x57f80c=a143_0x544674['join'](_0x3c91d9,'package.json');let _0x3966af=_0x19bc72(0x214);try{const _0x4444f9=JSON['parse'](a143_0x2b8d26[_0x19bc72(0x226)](_0x57f80c,_0x19bc72(0x213)));_0x3966af=_0x4444f9[_0x19bc72(0x246)]||_0x19bc72(0x214);}catch{}const _0x5e514c=a143_0x2b8d26[_0x19bc72(0x226)](_0x1c92de,_0x19bc72(0x213)),_0x1cc08a=JSON[_0x19bc72(0x208)](_0x5e514c);_0x1cc08a[_0x19bc72(0x220)]=_0x163c61,_0x1cc08a[_0x19bc72(0x23e)]=_0x163c61+_0x19bc72(0x22b)+_0x3966af,a143_0x2b8d26[_0x19bc72(0x218)](_0x1c92de,JSON[_0x19bc72(0x24e)](_0x1cc08a,null,0x2)+'\x0a','utf8'),console[_0x19bc72(0x21f)](_0x19bc72(0x225)+_0x163c61),logger['info'](_0x19bc72(0x219),_0x19bc72(0x202));}catch(_0x209131){logger['error'](_0x19bc72(0x219),'更新\x20package.json\x20失败');throw _0x209131;}}async function configureAppCode(_0x3a4bb7,_0x2b8427,_0x1512eb){const _0x423395=a143_0x57ff,_0x2aee15=a143_0x544674[_0x423395(0x22f)](process[_0x423395(0x1fc)](),_0x3a4bb7),_0x2dcc23=a143_0x544674[_0x423395(0x224)](_0x2aee15,NEW_CONFIG_NAME);try{_0x2b8427?console['log'](_0x423395(0x236)+_0x3a4bb7+':\x20'+_0x2b8427):console[_0x423395(0x21f)](_0x423395(0x215)+_0x3a4bb7);const _0x3027d3=getRabetbaseCliPackageRoot(),_0x460975=a143_0x544674[_0x423395(0x224)](_0x3027d3,_0x423395(0x24b));let _0x5dd327=_0x423395(0x214);try{const _0x1d9419=JSON[_0x423395(0x208)](a143_0x2b8d26['readFileSync'](_0x460975,'utf8'));_0x5dd327=_0x1d9419[_0x423395(0x246)]||_0x423395(0x214);}catch{}const _0x471e18=readConfig(),_0x205184=typeof _0x471e18[_0x423395(0x200)]==='string'?_0x471e18[_0x423395(0x200)]:undefined,_0x4b18a8={};for(const _0x31dca6 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x471e18[_0x31dca6]!=null)_0x4b18a8[_0x31dca6]=_0x471e18[_0x31dca6];}const _0x127db8=buildCanonicalProjectConfig(_0x4b18a8,{'appCodes':_0x2b8427?[_0x2b8427]:[],'env':_0x1512eb||_0x205184||'production','metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x5dd327}});writeConfigFile(_0x2dcc23,_0x127db8),_0x2b8427?console[_0x423395(0x21f)]('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object[_0x423395(0x210)](_0x127db8[_0x423395(0x232)]||{})[_0x423395(0x224)](',\x20')+_0x423395(0x23f)+_0x127db8[_0x423395(0x249)]):console[_0x423395(0x21f)](_0x423395(0x228)+CLI_BIN_NAME+_0x423395(0x242)),logger['info'](_0x423395(0x219),_0x423395(0x1ef)+_0x2b8427);}catch(_0x5455d7){logger['error'](_0x423395(0x219),_0x423395(0x240));}}
@@ -1 +1 @@
1
- (function(_0x53c176,_0x18b263){const _0x1a663f=a143_0x50ae,_0x1d19ad=_0x53c176();while(!![]){try{const _0x29d2ca=parseInt(_0x1a663f(0x1a3))/0x1+parseInt(_0x1a663f(0x194))/0x2*(parseInt(_0x1a663f(0x170))/0x3)+-parseInt(_0x1a663f(0x16f))/0x4+parseInt(_0x1a663f(0x19a))/0x5+parseInt(_0x1a663f(0x174))/0x6*(-parseInt(_0x1a663f(0x195))/0x7)+-parseInt(_0x1a663f(0x191))/0x8*(-parseInt(_0x1a663f(0x19f))/0x9)+-parseInt(_0x1a663f(0x18a))/0xa;if(_0x29d2ca===_0x18b263)break;else _0x1d19ad['push'](_0x1d19ad['shift']());}catch(_0x74f0f0){_0x1d19ad['push'](_0x1d19ad['shift']());}}}(a143_0x5e21,0xd8cab));import a143_0x2d453f from'path';import a143_0x483d53 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';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';function a143_0x50ae(_0x1cd3c6,_0x4dbf78){_0x1cd3c6=_0x1cd3c6-0x16c;const _0x5e21c3=a143_0x5e21();let _0x50aeeb=_0x5e21c3[_0x1cd3c6];return _0x50aeeb;}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';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(_0x2a33b4,_0x172c5f,_0x5af835,_0x1f52a6){const _0x3d1354=a143_0x50ae,_0x3e940b=await checkCliVersion();(_0x3e940b[_0x3d1354(0x182)]||_0x3e940b[_0x3d1354(0x196)])&&(printCliUpgradeWarning(_0x3e940b),assertCliVersionSupported(_0x3e940b));if(!_0x2a33b4||_0x2a33b4[_0x3d1354(0x19d)]()==='')throw CliErrors[_0x3d1354(0x186)](_0x3d1354(0x181));const _0x2ed7e8=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x2ed7e8[_0x3d1354(0x1a4)](_0x2a33b4))throw CliErrors['validation'](_0x3d1354(0x16c),'Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x2a33b4[_0x3d1354(0x1a0)]>0x64)throw CliErrors[_0x3d1354(0x186)](_0x3d1354(0x189));const _0x2224e6=a143_0x2d453f[_0x3d1354(0x18c)](process[_0x3d1354(0x16d)](),_0x2a33b4);if(existsSync(_0x2224e6))throw CliErrors[_0x3d1354(0x186)]('Project\x20directory\x20\x22'+_0x2a33b4+'\x22\x20already\x20exists.','Use\x20a\x20different\x20project\x20name.');try{const _0x396020=a143_0x2d453f[_0x3d1354(0x17c)](_0x2224e6);await a143_0x483d53[_0x3d1354(0x18b)](_0x396020,a143_0x483d53[_0x3d1354(0x188)][_0x3d1354(0x197)]);}catch{throw CliErrors[_0x3d1354(0x186)](_0x3d1354(0x171),_0x3d1354(0x192));}try{console[_0x3d1354(0x199)](_0x3d1354(0x17d)+_0x2a33b4+_0x3d1354(0x17f));const _0x2d86a5=getSubAppReactDemoTemplateDir();await copyDirectory(_0x2d86a5,_0x2224e6),console['log'](_0x3d1354(0x19b)),await updatePackageJsonName(_0x2a33b4),console['log']('\x20\x20√\x20package.json\x20updated'),console[_0x3d1354(0x199)]('\x20\x20Installing\x20dependencies...'),console[_0x3d1354(0x199)](_0x3d1354(0x18e)),await formatCode(_0x2224e6),console[_0x3d1354(0x199)]('\x20\x20√\x20Code\x20formatted'),await configureProject(_0x2a33b4,_0x5af835,_0x172c5f),console['log'](_0x3d1354(0x18f)),_0x5af835&&await pullApiConfig(_0x2224e6,_0x5af835,_0x172c5f,_0x1f52a6),console[_0x3d1354(0x199)](_0x3d1354(0x17e)+_0x2a33b4+_0x3d1354(0x187)),console[_0x3d1354(0x199)](_0x3d1354(0x177)+_0x2a33b4),console[_0x3d1354(0x199)]('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0x4db642){try{existsSync(_0x2224e6)&&await a143_0x483d53['rm'](_0x2224e6,{'recursive':!![],'force':!![]});}catch{}throw _0x4db642;}}async function updatePackageJsonName(_0x351a5f){const _0x1acf97=a143_0x50ae,_0x5ce1a9=a143_0x2d453f['resolve'](process[_0x1acf97(0x16d)](),_0x351a5f),_0x51fe19=a143_0x2d453f[_0x1acf97(0x1a2)](_0x5ce1a9,'package.json'),_0xac653d=await a143_0x483d53[_0x1acf97(0x1a1)](_0x51fe19,_0x1acf97(0x183)),_0x42dae1=JSON[_0x1acf97(0x176)](_0xac653d);_0x42dae1[_0x1acf97(0x16e)]=_0x351a5f,_0x42dae1[_0x1acf97(0x19e)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a143_0x483d53[_0x1acf97(0x172)](_0x51fe19,JSON[_0x1acf97(0x18d)](_0x42dae1,null,0x2)+'\x0a');}function detectPackageManager(){const _0x4d615b=a143_0x50ae;try{return execSync(_0x4d615b(0x179),{'stdio':_0x4d615b(0x19c)}),_0x4d615b(0x198);}catch{return _0x4d615b(0x180);}}async function formatCode(_0x23c264){try{await execAsync('bun\x20run\x20format',{'cwd':_0x23c264});}catch{}}async function configureProject(_0x499eca,_0x140191,_0x329c77){const _0x14f874=a143_0x50ae,_0x556cb2=a143_0x2d453f['resolve'](process[_0x14f874(0x16d)](),_0x499eca),_0x14704e=a143_0x2d453f[_0x14f874(0x1a2)](_0x556cb2,NEW_CONFIG_NAME),_0x21fcc6=readConfig(),_0x3b97e1=typeof _0x21fcc6['env']===_0x14f874(0x178)?_0x21fcc6[_0x14f874(0x173)]:undefined,_0xb3bfa1={};for(const _0x51aab4 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x21fcc6[_0x51aab4]!=null)_0xb3bfa1[_0x51aab4]=_0x21fcc6[_0x51aab4];}const _0x1d6680=buildCanonicalProjectConfig(_0xb3bfa1,{'appCodes':_0x140191?[_0x140191]:[],'env':_0x329c77||_0x3b97e1||'production','metadata':{'createdAt':new Date()[_0x14f874(0x17a)](),'version':getCliVersion()}});writeConfigFile(_0x14704e,_0x1d6680);}function a143_0x5e21(){const _0x19c4ec=['145292ixiPjr','belowMinimum','W_OK','bun','log','3172500FUjjpe','\x20\x20√\x20Project\x20template\x20created','ignore','trim','description','14959089OjHJTy','length','readFile','join','1503936aVxqDX','test','Project\x20name\x20contains\x20invalid\x20characters.','cwd','name','3449212eJchEK','4484721NVxNFg','Cannot\x20create\x20project\x20in\x20current\x20directory.','writeFile','env','132buuQpU','chdir','parse','\x0a\x20\x20cd\x20','string','bun\x20--version','toLocaleString','production','dirname','*\x20Creating\x20project\x20','\x0a√\x20Project\x20','...','npm','Project\x20name\x20cannot\x20be\x20empty.','needsUpgrade','utf-8','\x20api\x20pull`\x20manually\x20later.','\x20model(s)','validation','\x20created\x20successfully!','constants','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','30885500vWvZgp','access','resolve','stringify','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','\x20\x20√\x20Configuration\x20file\x20created','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','8ULSbIN','Check\x20directory\x20permissions.','\x20dataset(s),\x20generated\x20','2wnumDy'];a143_0x5e21=function(){return _0x19c4ec;};return a143_0x5e21();}async function pullApiConfig(_0x161a45,_0x114558,_0x2c67ac,_0x58ad53){const _0x197d3a=a143_0x50ae,_0x2f6f23=process[_0x197d3a(0x16d)]();try{process[_0x197d3a(0x175)](_0x161a45);const _0x2a3dc5=_0x2c67ac||_0x197d3a(0x17b);initEnv(_0x2a3dc5),console[_0x197d3a(0x199)]('\x20\x20Pulling\x20API\x20configuration...');const {configArray:_0x2a6aae}=await fetchModelList(_0x114558,_0x58ad53||''),_0x1dcfe0=await generateApiFile(_0x2a6aae,'',_0x114558,!![],_0x2a3dc5,DEFAULT_API_DIR);console[_0x197d3a(0x199)]('\x20\x20√\x20Pulled\x20'+_0x2a6aae[_0x197d3a(0x1a0)]+_0x197d3a(0x193)+_0x1dcfe0['modelCount']+_0x197d3a(0x185));}catch(_0x2a5b47){console[_0x197d3a(0x199)](_0x197d3a(0x190)+CLI_BIN_NAME+_0x197d3a(0x184));}finally{process[_0x197d3a(0x175)](_0x2f6f23);}}
1
+ (function(_0x47dc19,_0x3b22d5){const _0x516866=a144_0x4c79,_0x21c8f5=_0x47dc19();while(!![]){try{const _0x255889=-parseInt(_0x516866(0xae))/0x1*(parseInt(_0x516866(0xb7))/0x2)+-parseInt(_0x516866(0x96))/0x3*(-parseInt(_0x516866(0xa6))/0x4)+-parseInt(_0x516866(0xb6))/0x5*(parseInt(_0x516866(0xac))/0x6)+parseInt(_0x516866(0xca))/0x7*(-parseInt(_0x516866(0x9b))/0x8)+-parseInt(_0x516866(0xb2))/0x9*(-parseInt(_0x516866(0x8e))/0xa)+-parseInt(_0x516866(0xc6))/0xb*(parseInt(_0x516866(0x91))/0xc)+parseInt(_0x516866(0xc1))/0xd*(parseInt(_0x516866(0xc4))/0xe);if(_0x255889===_0x3b22d5)break;else _0x21c8f5['push'](_0x21c8f5['shift']());}catch(_0x34a0a4){_0x21c8f5['push'](_0x21c8f5['shift']());}}}(a144_0x2356,0x8dded));import a144_0x46c4cf from'path';import a144_0x6a4dca from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';function a144_0x4c79(_0x3ab7e8,_0x43f392){_0x3ab7e8=_0x3ab7e8-0x8d;const _0x2356ac=a144_0x2356();let _0x4c79e7=_0x2356ac[_0x3ab7e8];return _0x4c79e7;}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';function a144_0x2356(){const _0x4f5734=['\x20\x20√\x20Project\x20template\x20created','chdir','207335NdijrO','1951030vkfvIS','join','\x20\x20Pulling\x20API\x20configuration...','\x20\x20√\x20Code\x20formatted','description','dirname','\x20\x20√\x20package.json\x20updated','modelCount','\x20dataset(s),\x20generated\x20','access','13oLOqmd','bun\x20run\x20format','*\x20Creating\x20project\x20','44782514OkYkrj','\x20api\x20pull`\x20manually\x20later.','5855839DLZZlZ','Check\x20directory\x20permissions.','resolve','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','21qMxLdY','\x0a√\x20Project\x20','bun','string','W_OK','1130nxyvxq','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','log','24LpJLtW','validation','...','length','readFile','31470rphQXL','npm','writeFile','bun\x20--version','Project\x20directory\x20\x22','1367096TBdVDn','stringify','test','\x20created\x20successfully!','\x20\x20√\x20Configuration\x20file\x20created','\x20\x20√\x20Pulled\x20','name','cwd','utf-8','\x22\x20already\x20exists.','production','20ZSufLr','toLocaleString','constants','\x20\x20rabetbase\x20run\x20start\x0a','trim','\x0a\x20\x20cd\x20','102irIKDw','Cannot\x20create\x20project\x20in\x20current\x20directory.','1jPLFxR','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','\x20\x20Installing\x20dependencies...','46809tWvEVf','env'];a144_0x2356=function(){return _0x4f5734;};return a144_0x2356();}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';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(_0x4861b7,_0x5dca88,_0x2d24d1,_0x15334c){const _0x51d2d5=a144_0x4c79,_0x3d779d=await checkCliVersion();(_0x3d779d['needsUpgrade']||_0x3d779d['belowMinimum'])&&(printCliUpgradeWarning(_0x3d779d),assertCliVersionSupported(_0x3d779d));if(!_0x4861b7||_0x4861b7[_0x51d2d5(0xaa)]()==='')throw CliErrors[_0x51d2d5(0x92)]('Project\x20name\x20cannot\x20be\x20empty.');const _0x466afe=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x466afe[_0x51d2d5(0x9d)](_0x4861b7))throw CliErrors[_0x51d2d5(0x92)]('Project\x20name\x20contains\x20invalid\x20characters.',_0x51d2d5(0xc9));if(_0x4861b7[_0x51d2d5(0x94)]>0x64)throw CliErrors[_0x51d2d5(0x92)](_0x51d2d5(0xaf));const _0x455caa=a144_0x46c4cf[_0x51d2d5(0xc8)](process[_0x51d2d5(0xa2)](),_0x4861b7);if(existsSync(_0x455caa))throw CliErrors['validation'](_0x51d2d5(0x9a)+_0x4861b7+_0x51d2d5(0xa4),'Use\x20a\x20different\x20project\x20name.');try{const _0x289c14=a144_0x46c4cf[_0x51d2d5(0xbc)](_0x455caa);await a144_0x6a4dca[_0x51d2d5(0xc0)](_0x289c14,a144_0x6a4dca[_0x51d2d5(0xa8)][_0x51d2d5(0x8d)]);}catch{throw CliErrors['validation'](_0x51d2d5(0xad),_0x51d2d5(0xc7));}try{console[_0x51d2d5(0x90)](_0x51d2d5(0xc3)+_0x4861b7+_0x51d2d5(0x93));const _0x1a761b=getSubAppReactDemoTemplateDir();await copyDirectory(_0x1a761b,_0x455caa),console[_0x51d2d5(0x90)](_0x51d2d5(0xb4)),await updatePackageJsonName(_0x4861b7),console['log'](_0x51d2d5(0xbd)),console['log'](_0x51d2d5(0xb1)),console[_0x51d2d5(0x90)](_0x51d2d5(0xb0)),await formatCode(_0x455caa),console[_0x51d2d5(0x90)](_0x51d2d5(0xba)),await configureProject(_0x4861b7,_0x2d24d1,_0x5dca88),console[_0x51d2d5(0x90)](_0x51d2d5(0x9f)),_0x2d24d1&&await pullApiConfig(_0x455caa,_0x2d24d1,_0x5dca88,_0x15334c),console[_0x51d2d5(0x90)](_0x51d2d5(0xcb)+_0x4861b7+_0x51d2d5(0x9e)),console[_0x51d2d5(0x90)](_0x51d2d5(0xab)+_0x4861b7),console[_0x51d2d5(0x90)](_0x51d2d5(0xa9));}catch(_0x16b0be){try{existsSync(_0x455caa)&&await a144_0x6a4dca['rm'](_0x455caa,{'recursive':!![],'force':!![]});}catch{}throw _0x16b0be;}}async function updatePackageJsonName(_0x46e726){const _0x43f4b2=a144_0x4c79,_0xabbb54=a144_0x46c4cf[_0x43f4b2(0xc8)](process[_0x43f4b2(0xa2)](),_0x46e726),_0x38bf9c=a144_0x46c4cf[_0x43f4b2(0xb8)](_0xabbb54,'package.json'),_0x3ec82d=await a144_0x6a4dca[_0x43f4b2(0x95)](_0x38bf9c,_0x43f4b2(0xa3)),_0xd1a88a=JSON['parse'](_0x3ec82d);_0xd1a88a[_0x43f4b2(0xa1)]=_0x46e726,_0xd1a88a[_0x43f4b2(0xbb)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a144_0x6a4dca[_0x43f4b2(0x98)](_0x38bf9c,JSON[_0x43f4b2(0x9c)](_0xd1a88a,null,0x2)+'\x0a');}function detectPackageManager(){const _0x59c738=a144_0x4c79;try{return execSync(_0x59c738(0x99),{'stdio':'ignore'}),_0x59c738(0xcc);}catch{return _0x59c738(0x97);}}async function formatCode(_0x18738e){const _0x2d2f1d=a144_0x4c79;try{await execAsync(_0x2d2f1d(0xc2),{'cwd':_0x18738e});}catch{}}async function configureProject(_0x48631b,_0x50f1b3,_0xdce1dd){const _0x387ad5=a144_0x4c79,_0x194b39=a144_0x46c4cf[_0x387ad5(0xc8)](process['cwd'](),_0x48631b),_0x5ae3c9=a144_0x46c4cf['join'](_0x194b39,NEW_CONFIG_NAME),_0x1b6543=readConfig(),_0x5a018e=typeof _0x1b6543[_0x387ad5(0xb3)]===_0x387ad5(0xcd)?_0x1b6543[_0x387ad5(0xb3)]:undefined,_0x53767b={};for(const _0x59904a of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1b6543[_0x59904a]!=null)_0x53767b[_0x59904a]=_0x1b6543[_0x59904a];}const _0x1e3543=buildCanonicalProjectConfig(_0x53767b,{'appCodes':_0x50f1b3?[_0x50f1b3]:[],'env':_0xdce1dd||_0x5a018e||_0x387ad5(0xa5),'metadata':{'createdAt':new Date()[_0x387ad5(0xa7)](),'version':getCliVersion()}});writeConfigFile(_0x5ae3c9,_0x1e3543);}async function pullApiConfig(_0x474c84,_0x2e2a69,_0x284320,_0x1690c3){const _0x4852ad=a144_0x4c79,_0x36bdc3=process[_0x4852ad(0xa2)]();try{process[_0x4852ad(0xb5)](_0x474c84);const _0x117c6b=_0x284320||'production';initEnv(_0x117c6b),console[_0x4852ad(0x90)](_0x4852ad(0xb9));const {configArray:_0x2b41aa}=await fetchModelList(_0x2e2a69,_0x1690c3||''),_0x23b6ee=await generateApiFile(_0x2b41aa,'',_0x2e2a69,!![],_0x117c6b,DEFAULT_API_DIR);console[_0x4852ad(0x90)](_0x4852ad(0xa0)+_0x2b41aa[_0x4852ad(0x94)]+_0x4852ad(0xbf)+_0x23b6ee[_0x4852ad(0xbe)]+'\x20model(s)');}catch(_0x5b354a){console[_0x4852ad(0x90)](_0x4852ad(0x8f)+CLI_BIN_NAME+_0x4852ad(0xc5));}finally{process[_0x4852ad(0xb5)](_0x36bdc3);}}
@@ -1 +1 @@
1
- const a144_0x1df777=a144_0x377c;(function(_0x2eaebf,_0x513dfc){const _0x2326d9=a144_0x377c,_0x4513a9=_0x2eaebf();while(!![]){try{const _0x1c1f88=parseInt(_0x2326d9(0x14c))/0x1+parseInt(_0x2326d9(0x156))/0x2+parseInt(_0x2326d9(0x159))/0x3*(parseInt(_0x2326d9(0x14d))/0x4)+-parseInt(_0x2326d9(0x155))/0x5*(parseInt(_0x2326d9(0x157))/0x6)+-parseInt(_0x2326d9(0x153))/0x7+-parseInt(_0x2326d9(0x158))/0x8+-parseInt(_0x2326d9(0x150))/0x9;if(_0x1c1f88===_0x513dfc)break;else _0x4513a9['push'](_0x4513a9['shift']());}catch(_0x29d225){_0x4513a9['push'](_0x4513a9['shift']());}}}(a144_0x4c55,0xefede));import a144_0x1738a9 from'node:path';import{fileURLToPath}from'node:url';function a144_0x377c(_0x4a23ad,_0x338624){_0x4a23ad=_0x4a23ad-0x14c;const _0x4c5567=a144_0x4c55();let _0x377caa=_0x4c5567[_0x4a23ad];return _0x377caa;}const __dirname=a144_0x1738a9[a144_0x1df777(0x151)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x29a40b=a144_0x1df777;return a144_0x1738a9[_0x29a40b(0x152)](__dirname,'../../../../');}export function getSubAppReactDemoTemplateDir(){const _0x419af6=a144_0x1df777;return a144_0x1738a9[_0x419af6(0x14f)](getRabetbaseCliPackageRoot(),_0x419af6(0x154),_0x419af6(0x14e),'sub-app-react-demo');}function a144_0x4c55(){const _0x448045=['1680211xrXRvP','3870340PpCJSZ','projects','join','1483974WmGVhD','dirname','resolve','8770223ZtjGaG','templates','58345scFTwI','1834678ZGMNBj','534TPiKDa','8749232inbaja','6bSLdAc'];a144_0x4c55=function(){return _0x448045;};return a144_0x4c55();}
1
+ const a145_0x398cba=a145_0x4131;(function(_0x52848b,_0x18bf26){const _0x12112e=a145_0x4131,_0x109b21=_0x52848b();while(!![]){try{const _0x5825ac=-parseInt(_0x12112e(0xcf))/0x1*(parseInt(_0x12112e(0xc8))/0x2)+-parseInt(_0x12112e(0xcd))/0x3+-parseInt(_0x12112e(0xd3))/0x4+-parseInt(_0x12112e(0xc6))/0x5+-parseInt(_0x12112e(0xce))/0x6*(parseInt(_0x12112e(0xd5))/0x7)+-parseInt(_0x12112e(0xc9))/0x8+parseInt(_0x12112e(0xd2))/0x9*(parseInt(_0x12112e(0xd1))/0xa);if(_0x5825ac===_0x18bf26)break;else _0x109b21['push'](_0x109b21['shift']());}catch(_0x31b7ad){_0x109b21['push'](_0x109b21['shift']());}}}(a145_0x23d4,0x1fa71));import a145_0x4d91c5 from'node:path';function a145_0x23d4(){const _0x4ef382=['15012MPsGDp','17ygofld','resolve','847330zBYfTt','72eKBRjF','232304rTSScg','projects','112jUPwmu','94950KDfihT','dirname','17080WenFBt','367768Jcxztq','join','sub-app-react-demo','templates','719898ECIeJH'];a145_0x23d4=function(){return _0x4ef382;};return a145_0x23d4();}import{fileURLToPath}from'node:url';const __dirname=a145_0x4d91c5[a145_0x398cba(0xc7)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x33851f=a145_0x398cba;return a145_0x4d91c5[_0x33851f(0xd0)](__dirname,'../../../../');}function a145_0x4131(_0x3834a9,_0x6cd7b6){_0x3834a9=_0x3834a9-0xc6;const _0x23d40f=a145_0x23d4();let _0x41314c=_0x23d40f[_0x3834a9];return _0x41314c;}export function getSubAppReactDemoTemplateDir(){const _0x177446=a145_0x398cba;return a145_0x4d91c5[_0x177446(0xca)](getRabetbaseCliPackageRoot(),_0x177446(0xcc),_0x177446(0xd4),_0x177446(0xcb));}
@@ -1 +1 @@
1
- function a145_0x2e16(){const _0x2b229f=['resolve','6619628ZpAaqs','项目模板复制失败','95SVDpNM','9550541cocQVn','2976408ksVoJZ','now','299406roMPcp','3473502isfRsK','604Dxagjy','info','3610QaUAdg','项目模板复制完成','开始复制项目模板','cwd','copy','error','success','9710872TFbCgK','message'];a145_0x2e16=function(){return _0x2b229f;};return a145_0x2e16();}(function(_0x3e93f6,_0x592ed8){const _0x486214=a145_0x59b7,_0x231f15=_0x3e93f6();while(!![]){try{const _0x5d9a09=parseInt(_0x486214(0xcc))/0x1*(-parseInt(_0x486214(0xce))/0x2)+-parseInt(_0x486214(0xdf))/0x3+parseInt(_0x486214(0xd8))/0x4+-parseInt(_0x486214(0xda))/0x5*(-parseInt(_0x486214(0xde))/0x6)+parseInt(_0x486214(0xdb))/0x7+-parseInt(_0x486214(0xd5))/0x8+parseInt(_0x486214(0xdc))/0x9;if(_0x5d9a09===_0x592ed8)break;else _0x231f15['push'](_0x231f15['shift']());}catch(_0x11b71d){_0x231f15['push'](_0x231f15['shift']());}}}(a145_0x2e16,0xcc25c));function a145_0x59b7(_0xb37204,_0x146a14){_0xb37204=_0xb37204-0xcc;const _0x2e1648=a145_0x2e16();let _0x59b79e=_0x2e1648[_0xb37204];return _0x59b79e;}import a145_0xb5d6c1 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(_0x33bd7e){const _0x7c9dba=a145_0x59b7,_0x31f830=Date['now'](),_0x4424b3=a145_0xb5d6c1[_0x7c9dba(0xd7)](process[_0x7c9dba(0xd1)](),_0x33bd7e);try{logger[_0x7c9dba(0xcd)](_0x7c9dba(0xd2),_0x7c9dba(0xd0),{'projectCode':_0x33bd7e,'templateDir':templateDir}),await copyDirectory(templateDir,_0x4424b3);const _0x211bdd=Date['now']()-_0x31f830;logger[_0x7c9dba(0xd4)](_0x7c9dba(0xd2),_0x7c9dba(0xcf),_0x211bdd,{'projectCode':_0x33bd7e});}catch(_0x6ae567){const _0x4e613a=Date[_0x7c9dba(0xdd)]()-_0x31f830;logger[_0x7c9dba(0xd3)]('copy',_0x7c9dba(0xd9),{'projectCode':_0x33bd7e,'error':_0x6ae567 instanceof Error?_0x6ae567[_0x7c9dba(0xd6)]:String(_0x6ae567),'duration':_0x4e613a});throw _0x6ae567;}return formatElapsed(_0x31f830);}
1
+ (function(_0x13e05f,_0x3914de){const _0x1aa028=a146_0x3146,_0x1f61ad=_0x13e05f();while(!![]){try{const _0xd90180=parseInt(_0x1aa028(0x1e7))/0x1*(parseInt(_0x1aa028(0x1e9))/0x2)+-parseInt(_0x1aa028(0x1f6))/0x3+parseInt(_0x1aa028(0x1ee))/0x4*(parseInt(_0x1aa028(0x1f3))/0x5)+parseInt(_0x1aa028(0x1eb))/0x6+-parseInt(_0x1aa028(0x1e6))/0x7+-parseInt(_0x1aa028(0x1ec))/0x8*(parseInt(_0x1aa028(0x1e8))/0x9)+parseInt(_0x1aa028(0x1f2))/0xa;if(_0xd90180===_0x3914de)break;else _0x1f61ad['push'](_0x1f61ad['shift']());}catch(_0x55f5ed){_0x1f61ad['push'](_0x1f61ad['shift']());}}}(a146_0x1485,0xaaae6));function a146_0x3146(_0x2709fa,_0x3b976c){_0x2709fa=_0x2709fa-0x1e6;const _0x148515=a146_0x1485();let _0x314620=_0x148515[_0x2709fa];return _0x314620;}import a146_0x261206 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';function a146_0x1485(){const _0x268f85=['8SbzKGz','info','16ntVxCd','开始复制项目模板','now','项目模板复制失败','5509990pFzyRx','377830HbJzLw','error','项目模板复制完成','1439508qQsZOe','535465hghLIE','325762sPMROQ','170514QsChrc','2xlAyom','copy','572172kNxWxM'];a146_0x1485=function(){return _0x268f85;};return a146_0x1485();}const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x51c0a3){const _0x154fd8=a146_0x3146,_0x5607a8=Date[_0x154fd8(0x1f0)](),_0x351ad0=a146_0x261206['resolve'](process['cwd'](),_0x51c0a3);try{logger[_0x154fd8(0x1ed)]('copy',_0x154fd8(0x1ef),{'projectCode':_0x51c0a3,'templateDir':templateDir}),await copyDirectory(templateDir,_0x351ad0);const _0x479c5a=Date[_0x154fd8(0x1f0)]()-_0x5607a8;logger['success'](_0x154fd8(0x1ea),_0x154fd8(0x1f5),_0x479c5a,{'projectCode':_0x51c0a3});}catch(_0x5c9d2b){const _0x1f3915=Date[_0x154fd8(0x1f0)]()-_0x5607a8;logger[_0x154fd8(0x1f4)](_0x154fd8(0x1ea),_0x154fd8(0x1f1),{'projectCode':_0x51c0a3,'error':_0x5c9d2b instanceof Error?_0x5c9d2b['message']:String(_0x5c9d2b),'duration':_0x1f3915});throw _0x5c9d2b;}return formatElapsed(_0x5607a8);}
@@ -1 +1 @@
1
- (function(_0x1bc51b,_0x3092d8){const _0x10fb36=a146_0x2ef3,_0x56f1cd=_0x1bc51b();while(!![]){try{const _0x37aad4=parseInt(_0x10fb36(0x92))/0x1*(-parseInt(_0x10fb36(0x90))/0x2)+parseInt(_0x10fb36(0x9c))/0x3*(parseInt(_0x10fb36(0x9a))/0x4)+parseInt(_0x10fb36(0x89))/0x5+-parseInt(_0x10fb36(0x91))/0x6+parseInt(_0x10fb36(0x93))/0x7*(parseInt(_0x10fb36(0x8d))/0x8)+-parseInt(_0x10fb36(0x8e))/0x9+parseInt(_0x10fb36(0x96))/0xa;if(_0x37aad4===_0x3092d8)break;else _0x56f1cd['push'](_0x56f1cd['shift']());}catch(_0x2dc385){_0x56f1cd['push'](_0x56f1cd['shift']());}}}(a146_0x5dd8,0xcf76f));function a146_0x5dd8(){const _0x1d4716=['error','format','4491570sKmadX','success','cwd','prettier','820waGVUm','message','19533bJyNBS','代码格式化完成','now','5419910qSpgMG','info','代码格式化失败','npx','138752rkdeJe','5058513sGUHpH','--write','6boChcS','3916806KTExEU','290879BeoXCf','28UnPvgx'];a146_0x5dd8=function(){return _0x1d4716;};return a146_0x5dd8();}import a146_0x107688 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a146_0x2ef3(_0x4bb88f,_0x1d564b){_0x4bb88f=_0x4bb88f-0x88;const _0x5dd8cd=a146_0x5dd8();let _0x2ef39e=_0x5dd8cd[_0x4bb88f];return _0x2ef39e;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x5e45b7){const _0xd7cc14=a146_0x2ef3,_0x2631ed=Date[_0xd7cc14(0x88)](),_0x77fc36=a146_0x107688['resolve'](process[_0xd7cc14(0x98)](),_0x5e45b7);try{logger[_0xd7cc14(0x8a)](_0xd7cc14(0x95),'开始格式化代码',{'projectCode':_0x5e45b7}),await execa(resolveNpmBin(_0xd7cc14(0x8c)),[_0xd7cc14(0x99),_0xd7cc14(0x8f),'.'],{'cwd':_0x77fc36});const _0x2a163c=Date[_0xd7cc14(0x88)]()-_0x2631ed;logger[_0xd7cc14(0x97)]('format',_0xd7cc14(0x9d),_0x2a163c,{'projectCode':_0x5e45b7});}catch(_0x43fd03){const _0x5be9a8=Date[_0xd7cc14(0x88)]()-_0x2631ed;logger[_0xd7cc14(0x94)](_0xd7cc14(0x95),_0xd7cc14(0x8b),{'projectCode':_0x5e45b7,'error':_0x43fd03 instanceof Error?_0x43fd03[_0xd7cc14(0x9b)]:String(_0x43fd03),'duration':_0x5be9a8});throw _0x43fd03;}return formatElapsed(_0x2631ed);}
1
+ function a147_0x3b0b(_0x1955a1,_0x199574){_0x1955a1=_0x1955a1-0x12b;const _0x790fa4=a147_0x790f();let _0x3b0b88=_0x790fa4[_0x1955a1];return _0x3b0b88;}(function(_0x508c5e,_0x2d592c){const _0x1c6ac8=a147_0x3b0b,_0x17682e=_0x508c5e();while(!![]){try{const _0x4cee5a=parseInt(_0x1c6ac8(0x132))/0x1+-parseInt(_0x1c6ac8(0x13f))/0x2*(parseInt(_0x1c6ac8(0x13b))/0x3)+parseInt(_0x1c6ac8(0x139))/0x4+parseInt(_0x1c6ac8(0x13c))/0x5+parseInt(_0x1c6ac8(0x140))/0x6+parseInt(_0x1c6ac8(0x12d))/0x7+parseInt(_0x1c6ac8(0x137))/0x8*(-parseInt(_0x1c6ac8(0x131))/0x9);if(_0x4cee5a===_0x2d592c)break;else _0x17682e['push'](_0x17682e['shift']());}catch(_0x8a12ed){_0x17682e['push'](_0x17682e['shift']());}}}(a147_0x790f,0x54215));import a147_0x24aa27 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a147_0x790f(){const _0x33d8e4=['4658290GMHPpk','resolve','message','npx','9NHHUQn','688105VQBzdm','代码格式化完成','cwd','--write','开始格式化代码','8407408mkaZMx','now','142428YXznqd','prettier','1914882MDvsJP','2023855BVseXt','success','format','2OxUyMq','1439184suCylL','代码格式化失败','error'];a147_0x790f=function(){return _0x33d8e4;};return a147_0x790f();}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0xf6f55e){const _0x27fddc=a147_0x3b0b,_0x284fdf=Date[_0x27fddc(0x138)](),_0x20e522=a147_0x24aa27[_0x27fddc(0x12e)](process[_0x27fddc(0x134)](),_0xf6f55e);try{logger['info'](_0x27fddc(0x13e),_0x27fddc(0x136),{'projectCode':_0xf6f55e}),await execa(resolveNpmBin(_0x27fddc(0x130)),[_0x27fddc(0x13a),_0x27fddc(0x135),'.'],{'cwd':_0x20e522});const _0x5e96d3=Date[_0x27fddc(0x138)]()-_0x284fdf;logger[_0x27fddc(0x13d)](_0x27fddc(0x13e),_0x27fddc(0x133),_0x5e96d3,{'projectCode':_0xf6f55e});}catch(_0x4f20d6){const _0x59d56e=Date[_0x27fddc(0x138)]()-_0x284fdf;logger[_0x27fddc(0x12c)]('format',_0x27fddc(0x12b),{'projectCode':_0xf6f55e,'error':_0x4f20d6 instanceof Error?_0x4f20d6[_0x27fddc(0x12f)]:String(_0x4f20d6),'duration':_0x59d56e});throw _0x4f20d6;}return formatElapsed(_0x284fdf);}
@@ -1 +1 @@
1
- (function(_0x916d8,_0x7fbc0b){const _0x269ac1=a147_0x5ac9,_0x4b8f65=_0x916d8();while(!![]){try{const _0x3de5d3=parseInt(_0x269ac1(0x177))/0x1*(parseInt(_0x269ac1(0x17c))/0x2)+-parseInt(_0x269ac1(0x16b))/0x3+parseInt(_0x269ac1(0x17a))/0x4*(parseInt(_0x269ac1(0x172))/0x5)+parseInt(_0x269ac1(0x178))/0x6+parseInt(_0x269ac1(0x16e))/0x7+parseInt(_0x269ac1(0x179))/0x8+-parseInt(_0x269ac1(0x175))/0x9*(parseInt(_0x269ac1(0x176))/0xa);if(_0x3de5d3===_0x7fbc0b)break;else _0x4b8f65['push'](_0x4b8f65['shift']());}catch(_0x52e819){_0x4b8f65['push'](_0x4b8f65['shift']());}}}(a147_0x440b,0x805a6));function a147_0x5ac9(_0x26936,_0x29dfa8){_0x26936=_0x26936-0x169;const _0x440bfe=a147_0x440b();let _0x5ac9c2=_0x440bfe[_0x26936];return _0x5ac9c2;}import a147_0x214c66 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a147_0x440b(){const _0x46acfa=['934418cuzonK','success','info','error','1889346snNzvH','npm','https://registry.npmmirror.com','2206001ZQIjVT','依赖安装失败','--registry','install','5ZSCzuY','resolve','依赖安装完成','23769xpHlBN','7630dpfiCn','2mcAuoR','5790072tOBisz','7014552KGcEUQ','316828QybIdA','now'];a147_0x440b=function(){return _0x46acfa;};return a147_0x440b();}import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0xea223){const _0x5c0478=a147_0x5ac9,_0x4c9902=Date[_0x5c0478(0x17b)](),_0x3fb3bc=a147_0x214c66[_0x5c0478(0x173)](process['cwd'](),_0xea223);try{logger[_0x5c0478(0x169)]('install','开始安装依赖',{'projectCode':_0xea223,'registry':_0x5c0478(0x16d)}),await execa(resolveNpmBin(_0x5c0478(0x16c)),['install',_0x5c0478(0x170),_0x5c0478(0x16d)],{'cwd':_0x3fb3bc});const _0x3875a3=Date[_0x5c0478(0x17b)]()-_0x4c9902;logger[_0x5c0478(0x17d)](_0x5c0478(0x171),_0x5c0478(0x174),_0x3875a3,{'projectCode':_0xea223});}catch(_0xdee6c3){const _0x421f49=Date[_0x5c0478(0x17b)]()-_0x4c9902;logger[_0x5c0478(0x16a)](_0x5c0478(0x171),_0x5c0478(0x16f),{'projectCode':_0xea223,'error':_0xdee6c3 instanceof Error?_0xdee6c3['message']:String(_0xdee6c3),'duration':_0x421f49});throw _0xdee6c3;}return formatElapsed(_0x4c9902);}
1
+ (function(_0x4f4f83,_0x295aa9){const _0x1acbf2=a148_0x3c07,_0x3e022d=_0x4f4f83();while(!![]){try{const _0x668762=parseInt(_0x1acbf2(0x1f2))/0x1*(parseInt(_0x1acbf2(0x1f1))/0x2)+parseInt(_0x1acbf2(0x1ef))/0x3*(-parseInt(_0x1acbf2(0x1f9))/0x4)+-parseInt(_0x1acbf2(0x1fa))/0x5*(-parseInt(_0x1acbf2(0x206))/0x6)+parseInt(_0x1acbf2(0x1f5))/0x7*(-parseInt(_0x1acbf2(0x1fc))/0x8)+-parseInt(_0x1acbf2(0x1f6))/0x9*(parseInt(_0x1acbf2(0x201))/0xa)+parseInt(_0x1acbf2(0x204))/0xb+-parseInt(_0x1acbf2(0x200))/0xc*(-parseInt(_0x1acbf2(0x1fb))/0xd);if(_0x668762===_0x295aa9)break;else _0x3e022d['push'](_0x3e022d['shift']());}catch(_0x3ff26f){_0x3e022d['push'](_0x3e022d['shift']());}}}(a148_0x59c7,0x924de));import a148_0x3d84f8 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x45d6a3){const _0x387c50=a148_0x3c07,_0x2616ff=Date[_0x387c50(0x207)](),_0x3656d4=a148_0x3d84f8[_0x387c50(0x1f4)](process[_0x387c50(0x1ff)](),_0x45d6a3);try{logger[_0x387c50(0x1f0)](_0x387c50(0x1f8),_0x387c50(0x1f7),{'projectCode':_0x45d6a3,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin('npm'),['install',_0x387c50(0x1ee),_0x387c50(0x202)],{'cwd':_0x3656d4});const _0x2ebe7e=Date[_0x387c50(0x207)]()-_0x2616ff;logger[_0x387c50(0x205)](_0x387c50(0x1f8),_0x387c50(0x1fe),_0x2ebe7e,{'projectCode':_0x45d6a3});}catch(_0x565b93){const _0xe2dbed=Date[_0x387c50(0x207)]()-_0x2616ff;logger[_0x387c50(0x1f3)](_0x387c50(0x1f8),_0x387c50(0x203),{'projectCode':_0x45d6a3,'error':_0x565b93 instanceof Error?_0x565b93[_0x387c50(0x1fd)]:String(_0x565b93),'duration':_0xe2dbed});throw _0x565b93;}return formatElapsed(_0x2616ff);}function a148_0x3c07(_0x39cdb5,_0x4bd131){_0x39cdb5=_0x39cdb5-0x1ee;const _0x59c74b=a148_0x59c7();let _0x3c07f5=_0x59c74b[_0x39cdb5];return _0x3c07f5;}function a148_0x59c7(){const _0x48831d=['依赖安装失败','8260285pNQlru','success','6XlUEVv','now','--registry','3BiOxpk','info','322vafvGw','1383cowUzM','error','resolve','1127833AcXCYx','717993usXSKB','开始安装依赖','install','4244648VxiKjy','1088155dbsNne','691938IllKux','56YaZUow','message','依赖安装完成','cwd','432dicbaS','40OELtiZ','https://registry.npmmirror.com'];a148_0x59c7=function(){return _0x48831d;};return a148_0x59c7();}
@@ -1 +1 @@
1
- const a148_0x1b0f99=a148_0xdc09;function a148_0xdc09(_0x4cfa5e,_0x15c02c){_0x4cfa5e=_0x4cfa5e-0x1bd;const _0x41e542=a148_0x41e5();let _0xdc0987=_0x41e542[_0x4cfa5e];return _0xdc0987;}(function(_0x122336,_0x3d32cf){const _0x2592eb=a148_0xdc09,_0x1d9f18=_0x122336();while(!![]){try{const _0xced757=-parseInt(_0x2592eb(0x1d6))/0x1*(parseInt(_0x2592eb(0x1d0))/0x2)+parseInt(_0x2592eb(0x1d1))/0x3*(parseInt(_0x2592eb(0x1e7))/0x4)+-parseInt(_0x2592eb(0x1d4))/0x5*(parseInt(_0x2592eb(0x1cc))/0x6)+-parseInt(_0x2592eb(0x1c5))/0x7*(-parseInt(_0x2592eb(0x1c7))/0x8)+-parseInt(_0x2592eb(0x1bf))/0x9+-parseInt(_0x2592eb(0x1dd))/0xa*(parseInt(_0x2592eb(0x1be))/0xb)+parseInt(_0x2592eb(0x1cb))/0xc;if(_0xced757===_0x3d32cf)break;else _0x1d9f18['push'](_0x1d9f18['shift']());}catch(_0x441a62){_0x1d9f18['push'](_0x1d9f18['shift']());}}}(a148_0x41e5,0xbd2df));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a148_0x41e5(){const _0x2df81f=['Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','1MUDHph','bool','string','upgrade','Target\x20environment','\x20workspace\x20init','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','10zAAxrK','yes','name','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','boolean','Skip\x20confirmation\x20prompt','appcode','2026-07','Usage:\x20','create','73264woeNaw','nonInteractive','cookie','../../commands/project/create/non-interactive.js','9035246dzuLwP','9382131PqBPlq','Create\x20a\x20new\x20project','Auto-confirm\x20prompts','str','project','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','590534XnesIF','trim','8zoMHgT','Project\x20name','../../commands/project/create/main.js','env','40206876gOAxVX','6AouDIK','App\x20code\x20to\x20initialize','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','project-name','146386KzQIWp','6dhvGqw','args','write','3798250gprVen'];a148_0x41e5=function(){return _0x2df81f;};return a148_0x41e5();}import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a148_0x1b0f99(0x1e3),'type':a148_0x1b0f99(0x1d8),'description':a148_0x1b0f99(0x1cd)},{'name':a148_0x1b0f99(0x1ca),'type':a148_0x1b0f99(0x1d8),'description':a148_0x1b0f99(0x1da)},{'name':a148_0x1b0f99(0x1de),'type':a148_0x1b0f99(0x1e1),'description':a148_0x1b0f99(0x1c1),'default':![]}],createFlags=[{'name':a148_0x1b0f99(0x1df),'type':a148_0x1b0f99(0x1d8),'description':a148_0x1b0f99(0x1c8)},{'name':a148_0x1b0f99(0x1ca),'type':'string','description':a148_0x1b0f99(0x1da)},{'name':a148_0x1b0f99(0x1e3),'type':'string','description':a148_0x1b0f99(0x1c4)}],upgradeFlags=[{'name':a148_0x1b0f99(0x1de),'type':'boolean','description':a148_0x1b0f99(0x1e2),'default':![]}];export const projectDefinitions=[{'service':a148_0x1b0f99(0x1c3),'command':'init','description':a148_0x1b0f99(0x1e0),'risk':a148_0x1b0f99(0x1d3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a148_0x1b0f99(0x1db),'since':a148_0x1b0f99(0x1e4)},'flags':initFlags,async 'execute'(_0x5d3a86){const _0xddb8a=a148_0x1b0f99;return await initConfig({'appcode':_0x5d3a86[_0xddb8a(0x1c2)]('appcode')||undefined,'env':_0x5d3a86[_0xddb8a(0x1c2)](_0xddb8a(0x1ca))||undefined,'autoYes':_0x5d3a86[_0xddb8a(0x1d7)](_0xddb8a(0x1de))}),{'ok':!![]};}},{'service':a148_0x1b0f99(0x1c3),'command':a148_0x1b0f99(0x1e6),'description':a148_0x1b0f99(0x1c0),'risk':a148_0x1b0f99(0x1d3),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a148_0x1b0f99(0x1cf),'description':a148_0x1b0f99(0x1ce),'required':![]}],'flags':createFlags,async 'execute'(_0x29b0e9){const _0x351385=a148_0x1b0f99,{createApp:_0x219202}=await import(_0x351385(0x1c9)),{createProjectNonInteractive:_0x381b76}=await import(_0x351385(0x1bd)),_0x523119=_0x29b0e9['str']('name')[_0x351385(0x1c6)]()||_0x29b0e9[_0x351385(0x1d2)][0x0]?.['trim'](),_0x16030f=_0x29b0e9[_0x351385(0x1c2)](_0x351385(0x1ca))||undefined,_0x4fab7d=_0x29b0e9['str'](_0x351385(0x1e3))||undefined;if(_0x29b0e9[_0x351385(0x1e8)]){if(!_0x523119)throw CliErrors['validation'](_0x351385(0x1d5),_0x351385(0x1e5)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0x381b76(_0x523119,_0x16030f,_0x4fab7d,_0x29b0e9[_0x351385(0x1e9)]);}else await _0x219202({'projectCode':_0x523119,'appCode':_0x4fab7d,'env':_0x16030f,'cookie':_0x29b0e9[_0x351385(0x1e9)]});return{'ok':!![]};}},{'service':a148_0x1b0f99(0x1c3),'command':a148_0x1b0f99(0x1d9),'description':a148_0x1b0f99(0x1dc),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x57457c){const _0x577ec3=a148_0x1b0f99;return await upgradeApp(_0x57457c[_0x577ec3(0x1e8)],{'yes':_0x57457c[_0x577ec3(0x1d7)](_0x577ec3(0x1de))}),{'ok':!![]};}}];
1
+ const a149_0x4e4592=a149_0x4c9f;(function(_0x204347,_0x4f616b){const _0x2db96b=a149_0x4c9f,_0x403fd4=_0x204347();while(!![]){try{const _0x1db709=-parseInt(_0x2db96b(0x1b5))/0x1*(-parseInt(_0x2db96b(0x1ae))/0x2)+-parseInt(_0x2db96b(0x1bd))/0x3+-parseInt(_0x2db96b(0x1b4))/0x4*(-parseInt(_0x2db96b(0x198))/0x5)+parseInt(_0x2db96b(0x1ba))/0x6*(parseInt(_0x2db96b(0x1c1))/0x7)+-parseInt(_0x2db96b(0x1a6))/0x8*(-parseInt(_0x2db96b(0x1a2))/0x9)+parseInt(_0x2db96b(0x1a9))/0xa*(-parseInt(_0x2db96b(0x1a4))/0xb)+-parseInt(_0x2db96b(0x1b1))/0xc;if(_0x1db709===_0x4f616b)break;else _0x403fd4['push'](_0x403fd4['shift']());}catch(_0x218ccd){_0x403fd4['push'](_0x403fd4['shift']());}}}(a149_0xd7d2,0xb4541));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';function a149_0x4c9f(_0x1c7187,_0x31792e){_0x1c7187=_0x1c7187-0x198;const _0xd7d2fd=a149_0xd7d2();let _0x4c9f3e=_0xd7d2fd[_0x1c7187];return _0x4c9f3e;}const initFlags=[{'name':a149_0x4e4592(0x1a0),'type':a149_0x4e4592(0x1a7),'description':a149_0x4e4592(0x19f)},{'name':a149_0x4e4592(0x1a8),'type':a149_0x4e4592(0x1a7),'description':a149_0x4e4592(0x1bb)},{'name':a149_0x4e4592(0x19d),'type':a149_0x4e4592(0x1be),'description':a149_0x4e4592(0x19a),'default':![]}],createFlags=[{'name':'name','type':a149_0x4e4592(0x1a7),'description':'Project\x20name'},{'name':a149_0x4e4592(0x1a8),'type':a149_0x4e4592(0x1a7),'description':'Target\x20environment'},{'name':a149_0x4e4592(0x1a0),'type':a149_0x4e4592(0x1a7),'description':a149_0x4e4592(0x1a3)}],upgradeFlags=[{'name':a149_0x4e4592(0x19d),'type':a149_0x4e4592(0x1be),'description':'Skip\x20confirmation\x20prompt','default':![]}];function a149_0xd7d2(){const _0xeb4ec4=['yes','project-name','App\x20code\x20to\x20initialize','appcode','trim','1035mNNXOK','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','121stCGSn','Usage:\x20','6344JtQsSH','string','env','292740xIcyiE','2026-07','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','create','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','897740QyqMLl','write','upgrade','6274968TTzMUR','project','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','1667740JtkCoV','2oZLWiu','nonInteractive','str','\x20workspace\x20init','args','36GgTJdA','Target\x20environment','init','1799574EEbjcr','boolean','cookie','name','420707COHCDY','10OpjTFc','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','Auto-confirm\x20prompts','../../commands/project/create/main.js','bool'];a149_0xd7d2=function(){return _0xeb4ec4;};return a149_0xd7d2();}export const projectDefinitions=[{'service':'project','command':a149_0x4e4592(0x1bc),'description':a149_0x4e4592(0x1ad),'risk':a149_0x4e4592(0x1af),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a149_0x4e4592(0x1b8),'since':a149_0x4e4592(0x1aa)},'flags':initFlags,async 'execute'(_0x4b4c70){const _0x1e3674=a149_0x4e4592;return await initConfig({'appcode':_0x4b4c70[_0x1e3674(0x1b7)](_0x1e3674(0x1a0))||undefined,'env':_0x4b4c70[_0x1e3674(0x1b7)]('env')||undefined,'autoYes':_0x4b4c70[_0x1e3674(0x19c)](_0x1e3674(0x19d))}),{'ok':!![]};}},{'service':a149_0x4e4592(0x1b2),'command':a149_0x4e4592(0x1ac),'description':'Create\x20a\x20new\x20project','risk':a149_0x4e4592(0x1af),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a149_0x4e4592(0x19e),'description':a149_0x4e4592(0x199),'required':![]}],'flags':createFlags,async 'execute'(_0x1a8be1){const _0x1887b2=a149_0x4e4592,{createApp:_0x5c65d6}=await import(_0x1887b2(0x19b)),{createProjectNonInteractive:_0x587bd3}=await import('../../commands/project/create/non-interactive.js'),_0x429e4c=_0x1a8be1[_0x1887b2(0x1b7)](_0x1887b2(0x1c0))[_0x1887b2(0x1a1)]()||_0x1a8be1[_0x1887b2(0x1b9)][0x0]?.[_0x1887b2(0x1a1)](),_0xf7ff05=_0x1a8be1[_0x1887b2(0x1b7)](_0x1887b2(0x1a8))||undefined,_0x2777ec=_0x1a8be1[_0x1887b2(0x1b7)](_0x1887b2(0x1a0))||undefined;if(_0x1a8be1[_0x1887b2(0x1b6)]){if(!_0x429e4c)throw CliErrors['validation'](_0x1887b2(0x1b3),_0x1887b2(0x1a5)+CLI_BIN_NAME+_0x1887b2(0x1ab));await _0x587bd3(_0x429e4c,_0xf7ff05,_0x2777ec,_0x1a8be1[_0x1887b2(0x1bf)]);}else await _0x5c65d6({'projectCode':_0x429e4c,'appCode':_0x2777ec,'env':_0xf7ff05,'cookie':_0x1a8be1[_0x1887b2(0x1bf)]});return{'ok':!![]};}},{'service':a149_0x4e4592(0x1b2),'command':a149_0x4e4592(0x1b0),'description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a149_0x4e4592(0x1af),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x106c04){const _0x223ea5=a149_0x4e4592;return await upgradeApp(_0x106c04[_0x223ea5(0x1b6)],{'yes':_0x106c04[_0x223ea5(0x19c)](_0x223ea5(0x19d))}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- (function(_0x54cb88,_0x188d88){const _0x50c5ef=a149_0x47af,_0x2270b7=_0x54cb88();while(!![]){try{const _0x4aee65=parseInt(_0x50c5ef(0x19f))/0x1+parseInt(_0x50c5ef(0x18e))/0x2+-parseInt(_0x50c5ef(0x1ac))/0x3*(parseInt(_0x50c5ef(0x19d))/0x4)+parseInt(_0x50c5ef(0x197))/0x5*(parseInt(_0x50c5ef(0x18c))/0x6)+parseInt(_0x50c5ef(0x1a4))/0x7+parseInt(_0x50c5ef(0x19c))/0x8+-parseInt(_0x50c5ef(0x18b))/0x9;if(_0x4aee65===_0x188d88)break;else _0x2270b7['push'](_0x2270b7['shift']());}catch(_0x1499ca){_0x2270b7['push'](_0x2270b7['shift']());}}}(a149_0x6a65,0x8a58d));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';function a149_0x47af(_0x35ddbb,_0x51bcbd){_0x35ddbb=_0x35ddbb-0x188;const _0x6a65c1=a149_0x6a65();let _0x47af9=_0x6a65c1[_0x35ddbb];return _0x47af9;}function a149_0x6a65(){const _0x290581=['Migration\x20cancelled.\x20Run\x20`','toLocaleString','setLogPath','defaultApp','../..','5PMKWCd','env','\x20\x20Apps:\x20','package.json','cwd','3985944bIOMti','28sFWReS','1.0.0','47638XoIJBT','green','log','string','app','3880373nkqDjM','appcode','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','info','Invalid\x20App\x20Code','cyan','从旧配置文件升级成功','\x20api\x20pull\x27','36255jUdqcz','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','Please\x20enter\x20App\x20Code:','gray','bold','.rabetbase.json','初始化项目配置文件成功','\x20\x20appcode:\x20','✓\x20Upgraded\x20','parse','\x20workspace\x20init`\x20to\x20start\x20fresh.','trim','init','join','version','utf8','10680201FiAnsR','2166414qSHOmd','Upgrade\x20it\x20to\x20','753328lWgPnW','\x20\x20Default:\x20','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory'];a149_0x6a65=function(){return _0x290581;};return a149_0x6a65();}import a149_0x171950 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x3e99be){const _0x49ff83=a149_0x47af,{appcode:_0x4c7fe1,env:_0x3bd896,autoYes:_0xdcb82}=_0x3e99be,_0x5279c6=process[_0x49ff83(0x19b)]();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x3c7fdc;for(const _0x46d5b9 of LEGACY_CONFIG_NAMES){const _0x538cfa=resolve(_0x5279c6,_0x46d5b9);if(existsSync(_0x538cfa)){_0x3c7fdc=_0x538cfa;break;}}if(_0x3c7fdc){let _0x325d24={};try{_0x325d24=JSON[_0x49ff83(0x1b5)](readFileSync(_0x3c7fdc,'utf8'));}catch{}const _0xe6af92=basename(_0x3c7fdc),_0x5b52b9=_0x325d24?.[_0x49ff83(0x1a5)]||_0x325d24?.[_0x49ff83(0x1a3)];let _0x46ef3b=_0xdcb82;!_0xdcb82&&(console[_0x49ff83(0x1a1)](a149_0x171950['yellow'](_0x49ff83(0x190)+a149_0x171950[_0x49ff83(0x1b0)](_0xe6af92))),_0x5b52b9&&console['log'](a149_0x171950[_0x49ff83(0x1a9)](_0x49ff83(0x1b3)+_0x5b52b9)),_0x46ef3b=await confirm({'message':_0x49ff83(0x18d)+a149_0x171950[_0x49ff83(0x1b0)](_0x49ff83(0x1b1))+'?\x20(Old\x20file\x20→\x20*.bak)','default':!![]}));if(!_0x46ef3b){console[_0x49ff83(0x1a1)](_0x49ff83(0x192)+CLI_BIN_NAME+_0x49ff83(0x1b6));return;}const _0x46bed9=resolve(_0x5279c6,NEW_CONFIG_NAME),_0xbcd916=getCliVersionFromPkg(),_0x482abd=readRawConfig(),_0x151fd7=_0x4c7fe1||(typeof _0x325d24?.[_0x49ff83(0x1a5)]===_0x49ff83(0x1a2)?_0x325d24[_0x49ff83(0x1a5)]:undefined)||(typeof _0x325d24?.['app']===_0x49ff83(0x1a2)?_0x325d24[_0x49ff83(0x1a3)]:undefined)||await askAppcode(),_0x95877d=typeof _0x325d24?.[_0x49ff83(0x198)]===_0x49ff83(0x1a2)?_0x325d24[_0x49ff83(0x198)]:typeof _0x482abd['env']===_0x49ff83(0x1a2)?_0x482abd[_0x49ff83(0x198)]:'production',_0x31f672=buildCanonicalProjectConfig({..._0x482abd,..._0x325d24},{'appCodes':[_0x151fd7],'env':_0x95877d,'metadata':{'version':_0xbcd916,'migratedAt':new Date()[_0x49ff83(0x193)](),'migratedFrom':_0x3c7fdc}});writeConfigFile(_0x46bed9,_0x31f672);const _0x3bde98=_0x3c7fdc+'.bak';renameSync(_0x3c7fdc,_0x3bde98),logger['setLogPath'](_0x5279c6),logger[_0x49ff83(0x1a7)](_0x49ff83(0x1b8),_0x49ff83(0x1aa),{'from':_0x3c7fdc,'to':_0x46bed9,'appcode':_0x151fd7,'env':_0x31f672[_0x49ff83(0x198)]}),console[_0x49ff83(0x1a1)](a149_0x171950['green'](_0x49ff83(0x1b4)+_0xe6af92+'\x20→\x20.rabetbase.json')),console[_0x49ff83(0x1a1)](a149_0x171950[_0x49ff83(0x1a9)](_0x49ff83(0x199)+Object['keys'](_0x31f672['apps']||{})['join'](',\x20'))),console[_0x49ff83(0x1a1)](a149_0x171950['cyan'](_0x49ff83(0x18f)+_0x31f672[_0x49ff83(0x195)])),console['log'](a149_0x171950[_0x49ff83(0x1af)](_0x49ff83(0x1a6)+_0xe6af92+'.bak'));return;}const _0x41f209=_0x4c7fe1||await askAppcode(),_0x238f8a=resolve(_0x5279c6,NEW_CONFIG_NAME),_0x21d87b=getCliVersionFromPkg(),_0xabdd5c=readRawConfig(),_0xb3e802=typeof _0xabdd5c[_0x49ff83(0x198)]===_0x49ff83(0x1a2)?_0xabdd5c[_0x49ff83(0x198)]:undefined,_0x3517ea=buildCanonicalProjectConfig({},{'appCodes':[_0x41f209],'env':_0x3bd896||_0xb3e802||'production','metadata':{'version':_0x21d87b,'createdAt':new Date()[_0x49ff83(0x193)]()}});writeConfigFile(_0x238f8a,_0x3517ea),logger[_0x49ff83(0x194)](_0x5279c6),logger['info'](_0x49ff83(0x1b8),_0x49ff83(0x1b2),{'appcode':_0x41f209,'env':_0x3517ea[_0x49ff83(0x198)],'version':_0x3517ea[_0x49ff83(0x189)],'configPath':_0x238f8a}),console[_0x49ff83(0x1a1)](a149_0x171950[_0x49ff83(0x1a0)](_0x49ff83(0x191))),console[_0x49ff83(0x1a1)](a149_0x171950[_0x49ff83(0x1a9)](_0x49ff83(0x199)+Object['keys'](_0x3517ea['apps']||{})[_0x49ff83(0x188)](',\x20'))),console[_0x49ff83(0x1a1)](a149_0x171950[_0x49ff83(0x1a9)](_0x49ff83(0x18f)+_0x3517ea[_0x49ff83(0x195)])),console['log'](_0x49ff83(0x1ad)+CLI_BIN_NAME+'\x20api\x20generate\x27\x20and\x20\x27'+CLI_BIN_NAME+_0x49ff83(0x1ab));}function askAppcode(){const _0x4c74f4=a149_0x47af;return input({'message':_0x4c74f4(0x1ae),'validate':_0x1d8cf5=>{const _0x577291=_0x4c74f4;if(!_0x1d8cf5[_0x577291(0x1b7)]())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x59af11,message:_0x5c99d3}=validateAppcode(_0x1d8cf5[_0x577291(0x1b7)]());return _0x59af11||_0x5c99d3||_0x577291(0x1a8);}});}function getCliVersionFromPkg(){const _0x86e298=a149_0x47af;try{const _0x1ec53d=fileURLToPath(import.meta.url),_0x214ea3=resolve(dirname(_0x1ec53d),_0x86e298(0x196)),_0x271db6=JSON[_0x86e298(0x1b5)](readFileSync(resolve(_0x214ea3,_0x86e298(0x19a)),_0x86e298(0x18a)));return _0x271db6[_0x86e298(0x189)]||_0x86e298(0x19e);}catch{return _0x86e298(0x19e);}}
1
+ (function(_0x195806,_0x423f07){const _0x406356=a150_0x396c,_0x2ae99a=_0x195806();while(!![]){try{const _0x51b36c=-parseInt(_0x406356(0xd6))/0x1+-parseInt(_0x406356(0xc8))/0x2*(-parseInt(_0x406356(0xd1))/0x3)+-parseInt(_0x406356(0xdc))/0x4*(parseInt(_0x406356(0xd4))/0x5)+-parseInt(_0x406356(0xce))/0x6+-parseInt(_0x406356(0xc3))/0x7+-parseInt(_0x406356(0xca))/0x8*(-parseInt(_0x406356(0xeb))/0x9)+parseInt(_0x406356(0xe7))/0xa*(parseInt(_0x406356(0xba))/0xb);if(_0x51b36c===_0x423f07)break;else _0x2ae99a['push'](_0x2ae99a['shift']());}catch(_0x44b260){_0x2ae99a['push'](_0x2ae99a['shift']());}}}(a150_0x299e,0x3a8dd));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a150_0x3d970b from'chalk';function a150_0x396c(_0x137a39,_0xf33104){_0x137a39=_0x137a39-0xb8;const _0x299e8f=a150_0x299e();let _0x396c98=_0x299e8f[_0x137a39];return _0x396c98;}import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x2ee05f){const _0x15c928=a150_0x396c,{appcode:_0x827a7,env:_0x500f5c,autoYes:_0x38b4c1}=_0x2ee05f,_0x5594aa=process[_0x15c928(0xcf)]();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x145959;for(const _0x1811e3 of LEGACY_CONFIG_NAMES){const _0x38c9ee=resolve(_0x5594aa,_0x1811e3);if(existsSync(_0x38c9ee)){_0x145959=_0x38c9ee;break;}}if(_0x145959){let _0x4bc813={};try{_0x4bc813=JSON[_0x15c928(0xe4)](readFileSync(_0x145959,'utf8'));}catch{}const _0x2bd287=basename(_0x145959),_0x4c785c=_0x4bc813?.[_0x15c928(0xbb)]||_0x4bc813?.[_0x15c928(0xe0)];let _0x35b295=_0x38b4c1;!_0x38b4c1&&(console['log'](a150_0x3d970b[_0x15c928(0xbd)](_0x15c928(0xc1)+a150_0x3d970b['bold'](_0x2bd287))),_0x4c785c&&console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xdb)](_0x15c928(0xc6)+_0x4c785c)),_0x35b295=await confirm({'message':_0x15c928(0xc2)+a150_0x3d970b[_0x15c928(0xe1)](_0x15c928(0xe9))+_0x15c928(0xcc),'default':!![]}));if(!_0x35b295){console[_0x15c928(0xc4)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x15c928(0xd8));return;}const _0x496f13=resolve(_0x5594aa,NEW_CONFIG_NAME),_0x3bc2c2=getCliVersionFromPkg(),_0x4f6de6=readRawConfig(),_0x1176ea=_0x827a7||(typeof _0x4bc813?.[_0x15c928(0xbb)]===_0x15c928(0xc9)?_0x4bc813['appcode']:undefined)||(typeof _0x4bc813?.[_0x15c928(0xe0)]===_0x15c928(0xc9)?_0x4bc813['app']:undefined)||await askAppcode(),_0x18059d=typeof _0x4bc813?.[_0x15c928(0xe3)]===_0x15c928(0xc9)?_0x4bc813[_0x15c928(0xe3)]:typeof _0x4f6de6['env']===_0x15c928(0xc9)?_0x4f6de6[_0x15c928(0xe3)]:'production',_0xc90df=buildCanonicalProjectConfig({..._0x4f6de6,..._0x4bc813},{'appCodes':[_0x1176ea],'env':_0x18059d,'metadata':{'version':_0x3bc2c2,'migratedAt':new Date()[_0x15c928(0xb9)](),'migratedFrom':_0x145959}});writeConfigFile(_0x496f13,_0xc90df);const _0x400c5e=_0x145959+_0x15c928(0xdf);renameSync(_0x145959,_0x400c5e),logger['setLogPath'](_0x5594aa),logger['info'](_0x15c928(0xe8),_0x15c928(0xe5),{'from':_0x145959,'to':_0x496f13,'appcode':_0x1176ea,'env':_0xc90df[_0x15c928(0xe3)]}),console[_0x15c928(0xc4)](a150_0x3d970b['green'](_0x15c928(0xe2)+_0x2bd287+_0x15c928(0xc0))),console['log'](a150_0x3d970b['cyan']('\x20\x20Apps:\x20'+Object[_0x15c928(0xd3)](_0xc90df[_0x15c928(0xb8)]||{})[_0x15c928(0xd7)](',\x20'))),console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xdb)](_0x15c928(0xde)+_0xc90df[_0x15c928(0xec)])),console['log'](a150_0x3d970b[_0x15c928(0xc5)](_0x15c928(0xd9)+_0x2bd287+'.bak'));return;}const _0x5a6463=_0x827a7||await askAppcode(),_0x3c3afe=resolve(_0x5594aa,NEW_CONFIG_NAME),_0xe98d7=getCliVersionFromPkg(),_0x46ccbc=readRawConfig(),_0x2956ac=typeof _0x46ccbc[_0x15c928(0xe3)]===_0x15c928(0xc9)?_0x46ccbc[_0x15c928(0xe3)]:undefined,_0xf9474d=buildCanonicalProjectConfig({},{'appCodes':[_0x5a6463],'env':_0x500f5c||_0x2956ac||_0x15c928(0xd0),'metadata':{'version':_0xe98d7,'createdAt':new Date()[_0x15c928(0xb9)]()}});writeConfigFile(_0x3c3afe,_0xf9474d),logger[_0x15c928(0xcb)](_0x5594aa),logger['info']('init','初始化项目配置文件成功',{'appcode':_0x5a6463,'env':_0xf9474d[_0x15c928(0xe3)],'version':_0xf9474d['version'],'configPath':_0x3c3afe}),console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xea)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a150_0x3d970b['cyan'](_0x15c928(0xda)+Object[_0x15c928(0xd3)](_0xf9474d[_0x15c928(0xb8)]||{})[_0x15c928(0xd7)](',\x20'))),console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xdb)](_0x15c928(0xde)+_0xf9474d[_0x15c928(0xec)])),console[_0x15c928(0xc4)](_0x15c928(0xbf)+CLI_BIN_NAME+_0x15c928(0xd5)+CLI_BIN_NAME+_0x15c928(0xbc));}function a150_0x299e(){const _0x2a034b=['Please\x20enter\x20App\x20Code:','45494RCyHqI','string','712pxdHRC','setLogPath','?\x20(Old\x20file\x20→\x20*.bak)','utf8','904416rBAlEU','cwd','production','33ZfWPyH','version','keys','80peoFjB','\x20api\x20generate\x27\x20and\x20\x27','8804hbaIyy','join','\x20workspace\x20init`\x20to\x20start\x20fresh.','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','\x20\x20Apps:\x20','cyan','86116kGrijz','Invalid\x20App\x20Code','\x20\x20Default:\x20','.bak','app','bold','✓\x20Upgraded\x20','env','parse','从旧配置文件升级成功','trim','10BDVmVP','init','.rabetbase.json','green','41841NazWKH','defaultApp','apps','toLocaleString','1595957gAZOix','appcode','\x20api\x20pull\x27','yellow','1.0.0','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','\x20→\x20.rabetbase.json','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','Upgrade\x20it\x20to\x20','456568JUOEjg','log','gray','\x20\x20appcode:\x20'];a150_0x299e=function(){return _0x2a034b;};return a150_0x299e();}function askAppcode(){const _0x251b46=a150_0x396c;return input({'message':_0x251b46(0xc7),'validate':_0x2c17cf=>{const _0x545c9a=_0x251b46;if(!_0x2c17cf[_0x545c9a(0xe6)]())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x6b8480,message:_0x1f8734}=validateAppcode(_0x2c17cf[_0x545c9a(0xe6)]());return _0x6b8480||_0x1f8734||_0x545c9a(0xdd);}});}function getCliVersionFromPkg(){const _0x10bf9c=a150_0x396c;try{const _0x4b8642=fileURLToPath(import.meta.url),_0x2b24be=resolve(dirname(_0x4b8642),'../..'),_0x53a411=JSON[_0x10bf9c(0xe4)](readFileSync(resolve(_0x2b24be,'package.json'),_0x10bf9c(0xcd)));return _0x53a411[_0x10bf9c(0xd2)]||'1.0.0';}catch{return _0x10bf9c(0xbe);}}