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

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_0x101fa9=a137_0x5cb7;(function(_0x132b5b,_0x38d666){const _0x20869d=a137_0x5cb7,_0x52f62e=_0x132b5b();while(!![]){try{const _0x4020b6=parseInt(_0x20869d(0x1a0))/0x1+-parseInt(_0x20869d(0x1bf))/0x2+-parseInt(_0x20869d(0x1a4))/0x3*(-parseInt(_0x20869d(0x1b6))/0x4)+parseInt(_0x20869d(0x1c1))/0x5*(parseInt(_0x20869d(0x19b))/0x6)+parseInt(_0x20869d(0x1b8))/0x7+-parseInt(_0x20869d(0x1c2))/0x8*(parseInt(_0x20869d(0x19e))/0x9)+parseInt(_0x20869d(0x1be))/0xa*(-parseInt(_0x20869d(0x19a))/0xb);if(_0x4020b6===_0x38d666)break;else _0x52f62e['push'](_0x52f62e['shift']());}catch(_0x26a4ab){_0x52f62e['push'](_0x52f62e['shift']());}}}(a137_0x13c6,0x80cf6));import{getRoleApiResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,DATASETS_FLAG,flattenApiResources,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';function a137_0x13c6(){const _0x4187ef=['filter','Pass\x20--datasets\x20<datasetCode,...>.','datasets','39QUsEAj','push','role-apis-set','set','length','bool','api-revoke','permit','appCode','join','role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).','roleName','validation','Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.','high-risk-write','API','str','/smartapi/permit/role/update','247556BAWtWm','selector','5316430dFJXzT','Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20','datasetCodes','has','get','Missing\x20--revoke.','10NgfmWg','795016VtScpd','action','485JazoIq','8011664OQGMQq','flagMissing','8201721FmIple','42006kapRMo','Revoked\x20API\x20access\x20for\x20','revoke','9ugosNV','POST','429039SoHkWx'];a137_0x13c6=function(){return _0x4187ef;};return a137_0x13c6();}function a137_0x5cb7(_0x30ccae,_0x3697cb){_0x30ccae=_0x30ccae-0x199;const _0x13c610=a137_0x13c6();let _0x5cb76c=_0x13c610[_0x30ccae];return _0x5cb76c;}const UPDATE_PATH=a137_0x101fa9(0x1b5);async function buildPlan(_0x13ec23,_0x576983){const _0x4564e5=a137_0x101fa9,_0x532905=await resolveRoleRef(_0x13ec23[_0x4564e5(0x1ac)],readRoleRef(_0x13ec23));assertPermConfigurable(_0x532905);if(!_0x13ec23['bool']('revoke'))throw CliErrors[_0x4564e5(0x1b0)](_0x4564e5(0x1bd),'role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).');const _0x3af2f1=splitList(_0x13ec23['str'](_0x4564e5(0x1a3)));if(_0x3af2f1[_0x4564e5(0x1a8)]===0x0)throw CliErrors[_0x4564e5(0x199)]('datasets',_0x4564e5(0x1a2));const _0x166e57=await getRoleApiResources(_0x13ec23[_0x4564e5(0x1ac)],_0x532905['id']),{byCode:_0x313948,byDataset:_0x221a2d}=flattenApiResources(_0x166e57),_0x14a568=_0x3af2f1[_0x4564e5(0x1a1)](_0x1632a7=>!_0x221a2d[_0x4564e5(0x1bb)](_0x1632a7));if(_0x14a568[_0x4564e5(0x1a8)]>0x0)throw CliErrors['validation'](_0x4564e5(0x1b9)+_0x14a568[_0x4564e5(0x1ad)](',\x20')+'.',_0x4564e5(0x1b1));const _0x4ca78f=new Map(),_0x3cfba3=[],_0xafff2c=[];for(const _0x6c3b6d of _0x3af2f1){for(const _0x37b0b3 of _0x221a2d[_0x4564e5(0x1bc)](_0x6c3b6d)){const _0x4d4801=_0x313948['get'](_0x37b0b3);_0x4ca78f[_0x4564e5(0x1a7)](_0x37b0b3,'0'),_0x3cfba3[_0x4564e5(0x1a5)]({'resourceCode':_0x37b0b3,'datasetCode':_0x6c3b6d,'action':_0x4d4801[_0x4564e5(0x1c0)]}),_0xafff2c[_0x4564e5(0x1a5)]({'resourceCode':_0x37b0b3,'datasetCode':_0x6c3b6d,'action':'0'});}}const _0x20322a=buildPermits(_0x313948,_0x4ca78f),_0x2bc64f={'operation':_0x4564e5(0x1aa),'selector':{'appCode':_0x13ec23['appCode'],'roleId':_0x532905['id'],'roleName':_0x532905[_0x4564e5(0x1af)],'datasetCodes':_0x3af2f1},'before':_0x3cfba3,'after':_0xafff2c,'dryRun':_0x576983,'backend':{'method':_0x4564e5(0x19f),'path':UPDATE_PATH,'roleType':_0x4564e5(0x1b3)},'warnings':[]};return{'role':_0x532905,'permits':_0x20322a,'mutation':_0x2bc64f};}export const permitRoleApisSet={'service':a137_0x101fa9(0x1ab),'command':a137_0x101fa9(0x1a6),'description':'Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','risk':a137_0x101fa9(0x1b2),'flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xd9bdf8){const _0x1ee59d=a137_0x101fa9;if(!_0xd9bdf8[_0x1ee59d(0x1a9)](_0x1ee59d(0x19d)))throw CliErrors[_0x1ee59d(0x1b0)]('Missing\x20--revoke.',_0x1ee59d(0x1ae));if(splitList(_0xd9bdf8[_0x1ee59d(0x1b4)](_0x1ee59d(0x1a3)))[_0x1ee59d(0x1a8)]===0x0)throw CliErrors[_0x1ee59d(0x199)](_0x1ee59d(0x1a3),_0x1ee59d(0x1a2));},async 'dryRun'(_0x44ac3a){const _0x2a38a2=a137_0x101fa9,{mutation:_0x3f240a}=await buildPlan(_0x44ac3a,!![]);return asDryRunResult(_0x3f240a,{'method':_0x2a38a2(0x19f),'url':UPDATE_PATH});},async 'execute'(_0x15684e){const _0x38f08e=a137_0x101fa9,{role:_0x18572a,permits:_0x29bb56,mutation:_0x2a1555}=await buildPlan(_0x15684e,![]);return await updateAppRole({'id':_0x18572a['id'],'appCode':_0x15684e[_0x38f08e(0x1ac)],'roleType':'API','permits':_0x29bb56}),{'ok':!![],'data':_0x2a1555,'message':_0x38f08e(0x19c)+_0x2a1555[_0x38f08e(0x1b7)][_0x38f08e(0x1ba)][_0x38f08e(0x1a8)]+'\x20dataset(s)\x20on\x20role\x20'+_0x18572a[_0x38f08e(0x1af)]};}};
@@ -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_0x1c4727=a138_0x22a5;(function(_0x24c786,_0xb6c805){const _0x3e551b=a138_0x22a5,_0x38b101=_0x24c786();while(!![]){try{const _0x485b3f=-parseInt(_0x3e551b(0x1d1))/0x1+parseInt(_0x3e551b(0x1d5))/0x2+-parseInt(_0x3e551b(0x1cb))/0x3+-parseInt(_0x3e551b(0x1cd))/0x4*(-parseInt(_0x3e551b(0x1cc))/0x5)+-parseInt(_0x3e551b(0x1c9))/0x6*(parseInt(_0x3e551b(0x1c5))/0x7)+parseInt(_0x3e551b(0x1ca))/0x8+parseInt(_0x3e551b(0x1ba))/0x9;if(_0x485b3f===_0xb6c805)break;else _0x38b101['push'](_0x38b101['shift']());}catch(_0x18cd01){_0x38b101['push'](_0x38b101['shift']());}}}(a138_0x2c7f,0x30117));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a138_0x22a5(_0x582426,_0x26d775){_0x582426=_0x582426-0x1b8;const _0x2c7fe5=a138_0x2c7f();let _0x22a5e3=_0x2c7fe5[_0x582426];return _0x22a5e3;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a138_0x1c4727(0x1c4);function a138_0x2c7f(){const _0x4121b7=['Pass\x20--menus\x20<resourceCode,...>.','POST','length','set','/smartapi/permit/role/update','180943SrteRu','filter','roleName','flagMissing','30llOPjw','3888qUYHre','899307pCvRnP','19655zEUSLP','20CCkQbS','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','high-risk-write','appCode','148770FrveUv','\x20menu\x20permit(s)\x20for\x20role\x20','role-menus-set','Unknown\x20menu\x20resourceCode(s):\x20','653116JePMum','menu-grant','has','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','PAGE','menu-revoke','menus','selector','3851748TlUSJG','validation','permit','action','join','str'];a138_0x2c7f=function(){return _0x4121b7;};return a138_0x2c7f();}async function buildPlan(_0x14ff21,_0x2b1a9a){const _0x57ab09=a138_0x1c4727,_0x382437=await resolveRoleRef(_0x14ff21['appCode'],readRoleRef(_0x14ff21));assertPermConfigurable(_0x382437);const _0x10b85e=readGrantRevoke(_0x14ff21),_0x54874b=splitList(_0x14ff21['str'](_0x57ab09(0x1b8)));if(_0x54874b[_0x57ab09(0x1c2)]===0x0)throw CliErrors[_0x57ab09(0x1c8)](_0x57ab09(0x1b8),'Pass\x20--menus\x20<resourceCode,...>.');const _0x4fc816=await getRoleMenuResources(_0x14ff21[_0x57ab09(0x1d0)],_0x382437['id']),_0x57ab7e=flattenMenuResources(_0x4fc816),_0x3316f0=_0x54874b[_0x57ab09(0x1c6)](_0x2491d4=>!_0x57ab7e[_0x57ab09(0x1d7)](_0x2491d4));if(_0x3316f0[_0x57ab09(0x1c2)]>0x0)throw CliErrors[_0x57ab09(0x1bb)](_0x57ab09(0x1d4)+_0x3316f0[_0x57ab09(0x1be)](',\x20')+'.',_0x57ab09(0x1ce));const _0x107870=new Map(),_0x54d11a=[],_0x55ffed=[];for(const _0x498359 of _0x54874b){const _0x4be096=_0x57ab7e['get'](_0x498359);_0x107870[_0x57ab09(0x1c3)](_0x498359,_0x10b85e),_0x54d11a['push']({'resourceCode':_0x498359,'action':_0x4be096[_0x57ab09(0x1bd)]}),_0x55ffed['push']({'resourceCode':_0x498359,'action':_0x10b85e});}const _0x12c542=buildPermits(_0x57ab7e,_0x107870),_0x443c07={'operation':_0x10b85e==='access'?_0x57ab09(0x1d6):_0x57ab09(0x1da),'selector':{'appCode':_0x14ff21[_0x57ab09(0x1d0)],'roleId':_0x382437['id'],'roleName':_0x382437[_0x57ab09(0x1c7)],'resourceCodes':_0x54874b},'before':_0x54d11a,'after':_0x55ffed,'dryRun':_0x2b1a9a,'backend':{'method':_0x57ab09(0x1c1),'path':UPDATE_PATH,'roleType':_0x57ab09(0x1d9)},'warnings':[]};return{'role':_0x382437,'permits':_0x12c542,'mutation':_0x443c07};}export const permitRoleMenusSet={'service':a138_0x1c4727(0x1bc),'command':a138_0x1c4727(0x1d3),'description':a138_0x1c4727(0x1d8),'risk':a138_0x1c4727(0x1cf),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x19e99d){const _0x3ba7e6=a138_0x1c4727;readGrantRevoke(_0x19e99d);if(splitList(_0x19e99d[_0x3ba7e6(0x1bf)](_0x3ba7e6(0x1b8)))[_0x3ba7e6(0x1c2)]===0x0)throw CliErrors[_0x3ba7e6(0x1c8)](_0x3ba7e6(0x1b8),_0x3ba7e6(0x1c0));},async 'dryRun'(_0x11575d){const {mutation:_0x2dc9e8}=await buildPlan(_0x11575d,!![]);return asDryRunResult(_0x2dc9e8,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x2ce875){const _0x31c6e3=a138_0x1c4727,{role:_0x88d40a,permits:_0x405100,mutation:_0x33da85}=await buildPlan(_0x2ce875,![]);return await updateAppRole({'id':_0x88d40a['id'],'appCode':_0x2ce875[_0x31c6e3(0x1d0)],'roleType':_0x31c6e3(0x1d9),'permits':_0x405100}),{'ok':!![],'data':_0x33da85,'message':'Updated\x20'+_0x33da85[_0x31c6e3(0x1b9)]['resourceCodes'][_0x31c6e3(0x1c2)]+_0x31c6e3(0x1d2)+_0x88d40a['roleName']};}};
@@ -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_0x3e7a42=a139_0x3bdf;(function(_0x4c6c9e,_0x1c2f92){const _0x5c5d35=a139_0x3bdf,_0x236293=_0x4c6c9e();while(!![]){try{const _0x5f10ce=parseInt(_0x5c5d35(0x105))/0x1*(-parseInt(_0x5c5d35(0xfc))/0x2)+parseInt(_0x5c5d35(0x108))/0x3*(-parseInt(_0x5c5d35(0xf8))/0x4)+parseInt(_0x5c5d35(0xf1))/0x5*(parseInt(_0x5c5d35(0x102))/0x6)+parseInt(_0x5c5d35(0xfb))/0x7+-parseInt(_0x5c5d35(0xf4))/0x8*(parseInt(_0x5c5d35(0x103))/0x9)+-parseInt(_0x5c5d35(0xf6))/0xa*(parseInt(_0x5c5d35(0xfe))/0xb)+parseInt(_0x5c5d35(0xee))/0xc;if(_0x5f10ce===_0x1c2f92)break;else _0x236293['push'](_0x236293['shift']());}catch(_0x2a422d){_0x236293['push'](_0x236293['shift']());}}}(a139_0x1754,0x3c01c));import{getRoleMenuResources}from'../../core/api-client.js';function a139_0x1754(){const _0x2b38cc=['access','allowed','2480742hUtgTM','319581UEQOQo','roleName','30CKXstp','appCode','length','93qOzVYE','action','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','3461760WKsDAF','map','filter','5lQhuZw','read','from','56fIzRVg','role-menus','10jamjOq','values','52340WxhJca','permit','\x20has\x20','2533797vQdHQA','8276rtBTQJ','Role\x20','437602ARBioJ','resourceCode'];a139_0x1754=function(){return _0x2b38cc;};return a139_0x1754();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{flattenMenuResources,readRoleRef,ROLE_REF_FLAG}from'../../commands/permit/shared.js';function a139_0x3bdf(_0x4a650a,_0x2856b1){_0x4a650a=_0x4a650a-0xed;const _0x175442=a139_0x1754();let _0x3bdf13=_0x175442[_0x4a650a];return _0x3bdf13;}import{resolveRoleRef}from'../../commands/role/shared.js';export const permitRoleMenus={'service':a139_0x3e7a42(0xf9),'command':a139_0x3e7a42(0xf5),'description':a139_0x3e7a42(0xed),'risk':a139_0x3e7a42(0xf2),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x5efce8){const _0x7d682a=a139_0x3e7a42,_0x436360=await resolveRoleRef(_0x5efce8[_0x7d682a(0x106)],readRoleRef(_0x5efce8)),_0x21df39=await getRoleMenuResources(_0x5efce8[_0x7d682a(0x106)],_0x436360['id']),_0x4d00e8=flattenMenuResources(_0x21df39),_0x11c0e2=Array[_0x7d682a(0xf3)](_0x4d00e8[_0x7d682a(0xf7)]())[_0x7d682a(0xef)](_0x15cab5=>({'resourceCode':_0x15cab5[_0x7d682a(0xff)],'resourceName':_0x15cab5['resourceName'],'allowed':_0x15cab5['action']===_0x7d682a(0x100),'action':_0x15cab5[_0x7d682a(0x109)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x5efce8[_0x7d682a(0x106)],'roleId':_0x436360['id'],'roleName':_0x436360[_0x7d682a(0x104)]},'menus':_0x11c0e2},'message':_0x7d682a(0xfd)+_0x436360[_0x7d682a(0x104)]+_0x7d682a(0xfa)+_0x11c0e2[_0x7d682a(0xf0)](_0x3f393a=>_0x3f393a[_0x7d682a(0x101)])[_0x7d682a(0x107)]+'/'+_0x11c0e2[_0x7d682a(0x107)]+'\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_0x312c4e=a140_0x2d71;(function(_0x1ab214,_0x42dc41){const _0x49688c=a140_0x2d71,_0x8cf363=_0x1ab214();while(!![]){try{const _0x54ae9a=-parseInt(_0x49688c(0x121))/0x1+-parseInt(_0x49688c(0x15b))/0x2+parseInt(_0x49688c(0x133))/0x3*(parseInt(_0x49688c(0x14d))/0x4)+-parseInt(_0x49688c(0x142))/0x5+parseInt(_0x49688c(0x132))/0x6+-parseInt(_0x49688c(0x13d))/0x7+parseInt(_0x49688c(0x160))/0x8;if(_0x54ae9a===_0x42dc41)break;else _0x8cf363['push'](_0x8cf363['shift']());}catch(_0x2c5ae2){_0x8cf363['push'](_0x8cf363['shift']());}}}(a140_0x5b59,0xca28f));import{listPermitRoles}from'../../core/api-client.js';function a140_0x5b59(){const _0x6ba313=['split','menu\x20visibility','Missing\x20action.','grant','7827536wdEeza','revoke','Run\x20`role\x20list`.','role','datasetCode','set','filter','ALL','menu-roles','trim','validation','action','roleType','rolePermit','apiList','some','entries','207373mbXhCR','join','test','\x20(comma-separated\x20SELF/ALL/id/name)','label','find','key','resourceCode','data\x20detail','push','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','boolean','allowedActions','row-roles','Role\x20id\x20or\x20role\x20name','Role\x20id\x20','menu-id','8435112WgoXZp','12clfawJ','pageNodeList','menuId','resourceName','dataExport','roleName','length','\x22\x20is\x20ambiguous\x20(ids:\x20','flagMissing','menuPermit','10695454idYcEx','\x22\x20not\x20found.','SELF\x20is\x20not\x20allowed\x20for\x20','export-roles','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','3969465HhupUJ','get','bool','data\x20update',';\x20SELF\x20=\x20only\x20own\x20rows','access','data\x20delete','allowSelf','flag','dataDelete','update-roles','1167224mvgSKJ','create-roles','map','Role\x20\x22','string','Disambiguate\x20with\x20an\x20id.','menus','data\x20export','row\x20visibility','Grant\x20access\x20to\x20the\x20listed\x20resources','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','Menu\x20id\x20(from\x20`menu\x20list`)','SELF','data\x20create','388566unCFNk'];a140_0x5b59=function(){return _0x6ba313;};return a140_0x5b59();}import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a140_0x312c4e(0x131),'type':'number','required':!![],'description':a140_0x312c4e(0x158)};export const ROLE_REF_FLAG={'name':a140_0x312c4e(0x163),'type':a140_0x312c4e(0x151),'required':!![],'description':a140_0x312c4e(0x12f)};export const GRANT_FLAG={'name':'grant','type':a140_0x312c4e(0x12c),'required':![],'description':a140_0x312c4e(0x156)};export const REVOKE_FLAG={'name':a140_0x312c4e(0x161),'type':a140_0x312c4e(0x12c),'required':![],'description':'Revoke\x20access\x20to\x20the\x20listed\x20resources'};export const MENUS_FLAG={'name':a140_0x312c4e(0x153),'type':a140_0x312c4e(0x151),'required':!![],'description':a140_0x312c4e(0x157)};export const DATASETS_FLAG={'name':'datasets','type':a140_0x312c4e(0x151),'required':!![],'description':'Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for'};export const PAGE_SLOT_SPECS=[{'flag':a140_0x312c4e(0x168),'key':'menuPermit','allowSelf':![],'label':a140_0x312c4e(0x15d)},{'flag':a140_0x312c4e(0x14e),'key':'dataCreate','allowSelf':![],'label':a140_0x312c4e(0x15a)},{'flag':a140_0x312c4e(0x14c),'key':'dataUpdate','allowSelf':![],'label':a140_0x312c4e(0x145)},{'flag':'delete-roles','key':a140_0x312c4e(0x14b),'allowSelf':![],'label':a140_0x312c4e(0x148)},{'flag':'detail-roles','key':'dataDetail','allowSelf':![],'label':a140_0x312c4e(0x129)},{'flag':a140_0x312c4e(0x140),'key':a140_0x312c4e(0x137),'allowSelf':![],'label':a140_0x312c4e(0x154)},{'flag':a140_0x312c4e(0x12e),'key':'dataPermit','allowSelf':!![],'label':a140_0x312c4e(0x155)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a140_0x312c4e(0x14f)](_0xc579c2=>({'name':_0xc579c2[a140_0x312c4e(0x14a)],'type':a140_0x312c4e(0x151),'required':![],'description':'Roles\x20for\x20'+_0xc579c2['label']+a140_0x312c4e(0x124)+(_0xc579c2['allowSelf']?a140_0x312c4e(0x146):'')}));export function splitList(_0x336b60){const _0x501113=a140_0x312c4e;return _0x336b60[_0x501113(0x15c)](',')[_0x501113(0x14f)](_0x3b07bb=>_0x3b07bb[_0x501113(0x169)]())[_0x501113(0x166)](Boolean);}export function projectRoleRef(_0x193f14){const _0x1d5a87=a140_0x312c4e;return{'id':_0x193f14['id'],'roleName':_0x193f14['roleName'],'roleType':_0x193f14[_0x1d5a87(0x16c)]};}function a140_0x2d71(_0x1a13f4,_0x57bb57){_0x1a13f4=_0x1a13f4-0x120;const _0x5b59be=a140_0x5b59();let _0x2d71c6=_0x5b59be[_0x1a13f4];return _0x2d71c6;}export async function resolvePermitRoles(_0x21c96d,_0x1985c3,_0x3302e0){const _0x4214fc=a140_0x312c4e,_0x4abd94=await listPermitRoles(_0x21c96d,{'needSelf':!![],'needPublic':!![]}),_0x15c34a=[];for(const _0x2e3c04 of _0x1985c3){const _0x18bdf2=resolveOnePermitRole(_0x4abd94,_0x2e3c04);if(!_0x3302e0[_0x4214fc(0x149)]&&_0x18bdf2[_0x4214fc(0x16c)]===_0x4214fc(0x159))throw CliErrors[_0x4214fc(0x16a)](_0x4214fc(0x13f)+_0x3302e0[_0x4214fc(0x125)]+'.','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.');if(!_0x15c34a[_0x4214fc(0x16f)](_0x54f370=>_0x54f370['id']===_0x18bdf2['id']))_0x15c34a[_0x4214fc(0x12a)](_0x18bdf2);}return _0x15c34a;}function resolveOnePermitRole(_0x4038fa,_0xac58d1){const _0x460dca=a140_0x312c4e,_0xcce10d=_0xac58d1[_0x460dca(0x169)](),_0x4ef415=_0xcce10d['toUpperCase']();if(_0x4ef415===_0x460dca(0x159)||_0x4ef415===_0x460dca(0x167)){const _0x14aeaf=_0x4038fa[_0x460dca(0x126)](_0x4f9624=>_0x4f9624[_0x460dca(0x16c)]===_0x4ef415);if(!_0x14aeaf)throw CliErrors[_0x460dca(0x16a)]('Special\x20role\x20'+_0x4ef415+'\x20is\x20not\x20available\x20for\x20this\x20app.');return _0x14aeaf;}if(/^-?\d+$/[_0x460dca(0x123)](_0xcce10d)){const _0x3ecbea=Number(_0xcce10d),_0x3099a3=_0x4038fa['find'](_0xbcdcf8=>_0xbcdcf8['id']===_0x3ecbea);if(!_0x3099a3)throw CliErrors[_0x460dca(0x16a)](_0x460dca(0x130)+_0x3ecbea+'\x20not\x20found.',_0x460dca(0x162));return _0x3099a3;}const _0x51df4d=_0x4038fa[_0x460dca(0x166)](_0x228e6c=>_0x228e6c[_0x460dca(0x138)]===_0xcce10d);if(_0x51df4d['length']===0x0)throw CliErrors['validation'](_0x460dca(0x150)+_0xcce10d+_0x460dca(0x13e),_0x460dca(0x12b));if(_0x51df4d[_0x460dca(0x139)]>0x1)throw CliErrors['validation'](_0x460dca(0x150)+_0xcce10d+_0x460dca(0x13a)+_0x51df4d['map'](_0x52bf84=>_0x52bf84['id'])[_0x460dca(0x122)](',\x20')+').',_0x460dca(0x152));return _0x51df4d[0x0];}export function projectPageSlot(_0x581a67){const _0x2920eb=a140_0x312c4e;if(!_0x581a67)return null;return{'resourceCode':_0x581a67['resourceCode'],'roles':(_0x581a67[_0x2920eb(0x16d)]??[])['map'](projectRoleRef)};}export function projectPagePermit(_0xf5798c){const _0x180b18=a140_0x312c4e,_0x3e8a45={'menuId':_0xf5798c[_0x180b18(0x135)],'appCode':_0xf5798c['appCode'],'menuPermit':projectPageSlot(_0xf5798c['menuPermit'])};for(const _0x26020b of PAGE_SLOT_SPECS){if(_0x26020b[_0x180b18(0x127)]===_0x180b18(0x13c))continue;_0x3e8a45[_0x26020b['key']]=projectPageSlot(_0xf5798c[_0x26020b['key']]);}return _0x3e8a45;}export function flattenMenuResources(_0x292c96){const _0x5ee07b=new Map(),_0x2c3dd7=_0x2dcbd3=>{const _0x5e99eb=a140_0x2d71;for(const _0x48c764 of _0x2dcbd3??[]){_0x5ee07b['set'](_0x48c764[_0x5e99eb(0x128)],{'resourceCode':_0x48c764['resourceCode'],'resourceName':_0x48c764[_0x5e99eb(0x136)],'action':_0x48c764[_0x5e99eb(0x12d)]?.[0x0]??'0'});if(_0x48c764[_0x5e99eb(0x134)])_0x2c3dd7(_0x48c764[_0x5e99eb(0x134)]);}};return _0x2c3dd7(_0x292c96),_0x5ee07b;}export function flattenApiResources(_0x9c3be4){const _0x2c266a=a140_0x312c4e,_0x531a9c=new Map(),_0x4a4e52=new Map();for(const _0x5767d5 of _0x9c3be4){const _0x2289d2=_0x5767d5[_0x2c266a(0x16e)]??{};for(const [_0x42136d,_0x4e4786]of Object[_0x2c266a(0x120)](_0x2289d2)){_0x531a9c[_0x2c266a(0x165)](_0x42136d,{'resourceCode':_0x42136d,'resourceName':_0x5767d5[_0x2c266a(0x136)],'datasetCode':_0x5767d5[_0x2c266a(0x164)],'action':_0x4e4786?.[0x0]??'0'});const _0x5330ec=_0x4a4e52[_0x2c266a(0x143)](_0x5767d5['datasetCode'])??[];_0x5330ec[_0x2c266a(0x12a)](_0x42136d),_0x4a4e52[_0x2c266a(0x165)](_0x5767d5['datasetCode'],_0x5330ec);}}return{'byCode':_0x531a9c,'byDataset':_0x4a4e52};}export function buildPermits(_0x5ac56c,_0x51f8ac){const _0x425b9c=a140_0x312c4e,_0x9f0bfa={};for(const [_0x302b22,_0x14eb10]of _0x5ac56c){const _0x12338d=_0x51f8ac['get'](_0x302b22)??_0x14eb10[_0x425b9c(0x16b)];_0x9f0bfa[_0x302b22]=[_0x12338d];}return _0x9f0bfa;}export function readRoleRef(_0x5be420){const _0x43b380=a140_0x312c4e,_0x2306de=_0x5be420['str'](_0x43b380(0x163))['trim']();if(!_0x2306de)throw CliErrors[_0x43b380(0x13b)]('role','Pass\x20--role\x20<id|name>.');return _0x2306de;}export function readGrantRevoke(_0x19e61c){const _0x1ee630=a140_0x312c4e,_0x54d10f=_0x19e61c[_0x1ee630(0x144)](_0x1ee630(0x15f)),_0x3b61d9=_0x19e61c[_0x1ee630(0x144)]('revoke');if(_0x54d10f&&_0x3b61d9)throw CliErrors[_0x1ee630(0x16a)](_0x1ee630(0x141));if(!_0x54d10f&&!_0x3b61d9)throw CliErrors['validation'](_0x1ee630(0x15e),'Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.');return _0x54d10f?_0x1ee630(0x147):'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(_0x20c40b,_0x3018b6){const _0x2521cb=a141_0x4eff,_0x4995e4=_0x20c40b();while(!![]){try{const _0x2446c5=parseInt(_0x2521cb(0x93))/0x1+-parseInt(_0x2521cb(0x95))/0x2+parseInt(_0x2521cb(0xa7))/0x3*(parseInt(_0x2521cb(0xad))/0x4)+parseInt(_0x2521cb(0x98))/0x5+-parseInt(_0x2521cb(0x9a))/0x6*(parseInt(_0x2521cb(0xb0))/0x7)+parseInt(_0x2521cb(0x9f))/0x8+-parseInt(_0x2521cb(0xa6))/0x9;if(_0x2446c5===_0x3018b6)break;else _0x4995e4['push'](_0x4995e4['shift']());}catch(_0x8021e5){_0x4995e4['push'](_0x4995e4['shift']());}}}(a141_0x4bc3,0x5656f));import{existsSync}from'node:fs';import a141_0x203200 from'node:path';import a141_0x561154 from'chalk';function a141_0x4eff(_0x200643,_0x4883ef){_0x200643=_0x200643-0x93;const _0x4bc3d3=a141_0x4bc3();let _0x4eff05=_0x4bc3d3[_0x200643];return _0x4eff05;}import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';function a141_0x4bc3(){const _0x367c8d=['62153PTuFFL','366870VaaYmP','Not\x20set','345274xIUrgE','Logged\x20in','green','2012330RhztEl','Project\x20name\x20cannot\x20exceed\x2050\x20characters','36SRKptw','production','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','Skipped','cyan','1939224edqbmy','√\x20Login\x20status:\x20','√\x20Project\x20Name:\x20','Login\x20failed','length','test','env','5980122wbNbRv','30297ShsGaI','\x22\x20already\x20exists','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','string','my-app','log','92uuyQwB','√\x20App\x20Code:\x20','Project\x20name:'];a141_0x4bc3=function(){return _0x367c8d;};return a141_0x4bc3();}import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x4b5d6d,_0x36441b,_0x1cb607){const _0x5ce518=a141_0x4eff,_0x588eee=_0x5ce518(0xab),_0x372611=readConfig(),_0x584371=typeof _0x372611[_0x5ce518(0xa5)]===_0x5ce518(0xaa)?_0x372611[_0x5ce518(0xa5)]:undefined,_0x10d58d=await input({'message':_0x5ce518(0xaf),'default':_0x588eee,'validate':_0x3da27d=>{const _0x50c0bb=_0x5ce518,_0x5e7944=_0x3da27d['trim']()||_0x588eee;if(_0x5e7944[_0x50c0bb(0xa3)]>0x32)return _0x50c0bb(0x99);const _0x267e5f=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x5e7944&&!_0x267e5f[_0x50c0bb(0xa4)](_0x5e7944))return _0x50c0bb(0x9c);const _0x4a7ee2=a141_0x203200['resolve'](process['cwd'](),_0x5e7944);if(existsSync(_0x4a7ee2))return'Directory\x20\x22'+_0x5e7944+_0x50c0bb(0xa8);return!![];}});console['log'](a141_0x561154[_0x5ce518(0x97)](_0x5ce518(0xa1)+a141_0x561154[_0x5ce518(0x9e)](_0x10d58d)));const _0x9ea8ba=await selectSingleAppcode(_0x1cb607);console['log'](a141_0x561154[_0x5ce518(0x97)](_0x5ce518(0xae)+a141_0x561154['cyan'](_0x9ea8ba||_0x5ce518(0x94))));if(_0x9ea8ba){const _0x195fc9=await getIsSessionValid();if(!_0x195fc9){const _0x10bee2=await confirm({'message':_0x5ce518(0xa9),'default':!![]});if(_0x10bee2){const _0x309a91=await authServer({'silent':!![]});console[_0x5ce518(0xac)](a141_0x561154['green'](_0x5ce518(0xa0)+a141_0x561154[_0x5ce518(0x9e)](_0x309a91?_0x5ce518(0x96):_0x5ce518(0xa2))));}else console['log'](a141_0x561154[_0x5ce518(0x97)](_0x5ce518(0xa0)+a141_0x561154['cyan'](_0x5ce518(0x9d))));}await _0x4b5d6d({'projectName':_0x10d58d,'appCode':_0x9ea8ba,'env':_0x36441b||_0x584371||_0x5ce518(0x9b)});}else await _0x4b5d6d({'projectName':_0x10d58d,'env':_0x36441b||_0x584371||_0x5ce518(0x9b)});}
@@ -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_0x3c46(){const _0x328c93=['toFixed','378emwXDH','now','288020WHZKNu','23860tVFprJ','48haSwzt','970430KONTbF','977884cqxWRz','7610647GRDrZN','7rdiuYX','846bCrqeQ','9pUghFJ','152160LlsbIX','1135472EOhQER','replace'];a142_0x3c46=function(){return _0x328c93;};return a142_0x3c46();}function a142_0x2d6b(_0x50d48f,_0x14ede3){_0x50d48f=_0x50d48f-0x107;const _0x3c4612=a142_0x3c46();let _0x2d6b26=_0x3c4612[_0x50d48f];return _0x2d6b26;}(function(_0x271393,_0x4731d9){const _0x167cde=a142_0x2d6b,_0x5dd0d9=_0x271393();while(!![]){try{const _0x126b12=parseInt(_0x167cde(0x113))/0x1+parseInt(_0x167cde(0x10d))/0x2+parseInt(_0x167cde(0x112))/0x3*(parseInt(_0x167cde(0x10e))/0x4)+-parseInt(_0x167cde(0x10b))/0x5*(-parseInt(_0x167cde(0x111))/0x6)+parseInt(_0x167cde(0x110))/0x7*(parseInt(_0x167cde(0x114))/0x8)+-parseInt(_0x167cde(0x108))/0x9*(-parseInt(_0x167cde(0x10a))/0xa)+-parseInt(_0x167cde(0x10f))/0xb*(parseInt(_0x167cde(0x10c))/0xc);if(_0x126b12===_0x4731d9)break;else _0x5dd0d9['push'](_0x5dd0d9['shift']());}catch(_0x599049){_0x5dd0d9['push'](_0x5dd0d9['shift']());}}}(a142_0x3c46,0x99426));export function formatElapsed(_0x95b44a){const _0x1975a4=a142_0x2d6b,_0x523ec5=Date[_0x1975a4(0x109)]()-_0x95b44a;if(_0x523ec5<0x3e8)return _0x523ec5+'ms';const _0x3ede84=(_0x523ec5/0x3e8)[_0x1975a4(0x107)](0x2),_0x1d3193=_0x3ede84[_0x1975a4(0x115)](/\.?0+$/u,'');return _0x1d3193+'s';}
@@ -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(_0x537790,_0x2742ed){const _0x128ae8=a143_0x43ab,_0x12b449=_0x537790();while(!![]){try{const _0x5d56e0=-parseInt(_0x128ae8(0x98))/0x1+parseInt(_0x128ae8(0x92))/0x2+-parseInt(_0x128ae8(0x86))/0x3+parseInt(_0x128ae8(0xae))/0x4+parseInt(_0x128ae8(0xb7))/0x5*(-parseInt(_0x128ae8(0xbf))/0x6)+-parseInt(_0x128ae8(0xc6))/0x7+-parseInt(_0x128ae8(0xa8))/0x8*(-parseInt(_0x128ae8(0xbd))/0x9);if(_0x5d56e0===_0x2742ed)break;else _0x12b449['push'](_0x12b449['shift']());}catch(_0x15ec80){_0x12b449['push'](_0x12b449['shift']());}}}(a143_0x1dfd,0x52efa));import a143_0x4b6ca7 from'path';import a143_0x572361 from'fs';import a143_0x38e4e9 from'chalk';import a143_0x39b440 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';function a143_0x1dfd(){const _0x553070=['20184LguUBZ','modelCount','\x20config\x20set\x20appcode\x20<app-code>\x27','chdir','bold','\x20dataset(s),\x20generated\x20','fail','4476906owLuJN','项目创建完成:\x20','Project\x20directory\x20','error','\x20Generated\x20by\x20rabetbase\x20cli\x20','stringify','projectCode','warn','√\x20package.json\x20updated:\x20name=','apps','toLocaleString','resolve','production','清理项目目录失败:\x20','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','\x20|\x20AppCode:\x20','appCode','cd\x20','length','W_OK','rmSync','success','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','cyan','setLogPath','\x20already\x20exists','798822NOAmbn','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','log','gray','needsUpgrade','currentVersion','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','\x20|\x20Default:\x20','Copy\x20project\x20files','version','parse','minimumVersion','386138OirAvB','Format\x20code','1.0.0','项目创建失败:\x20','配置应用AppCode:\x20','\x20√\x20','432616tkRhXT','start','description','projectName','package.json','更新\x20package.json\x20失败','info','env','test','\x20api\x20pull','string','配置应用AppCode失败','*\x20Configuring\x20AppCode\x20for\x20project\x20','utf8','\x20&&\x20','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','23200jwZCCZ','cookie','readFileSync','\x20\x201.\x20Start\x20project:\x20','CLI\x20版本检查','repeat','474420tAEsnb','create','name','keys','cwd','existsSync','green','API\x20配置拉取异常','\x20\x202.\x20Pull\x20API\x20configuration:\x20','275GsLNln','Project\x20name:\x20','√\x20Configuration\x20file\x20created,\x20Apps:\x20','accessSync','join','defaultApp','4815GKOBrO','message'];a143_0x1dfd=function(){return _0x553070;};return a143_0x1dfd();}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(_0x59db8f){const _0xd278f3=a143_0x43ab,_0x4485b5=await checkCliVersion();(_0x4485b5[_0xd278f3(0x8a)]||_0x4485b5['belowMinimum'])&&(printCliUpgradeWarning(_0x4485b5),assertCliVersionSupported(_0x4485b5),logger[_0xd278f3(0x9e)](_0xd278f3(0xaf),_0xd278f3(0xac),{'currentVersion':_0x4485b5[_0xd278f3(0x8b)],'stableVersion':_0x4485b5['stableVersion'],'minimumVersion':_0x4485b5[_0xd278f3(0x91)],'needsUpgrade':_0x4485b5['needsUpgrade'],'belowMinimum':_0x4485b5['belowMinimum']}));if(_0x59db8f[_0xd278f3(0x71)]&&_0x59db8f[_0xd278f3(0x7c)])await runCreate({'projectName':_0x59db8f[_0xd278f3(0x71)],'appCode':_0x59db8f[_0xd278f3(0x7c)],'env':_0x59db8f[_0xd278f3(0x9f)]},_0x59db8f);else{if(_0x59db8f[_0xd278f3(0x71)]){const _0x5280c6=await selectSingleAppcode(_0x59db8f[_0xd278f3(0xa9)]);await runCreate({'projectName':_0x59db8f[_0xd278f3(0x71)],'appCode':_0x5280c6||undefined,'env':_0x59db8f[_0xd278f3(0x9f)]},_0x59db8f);}else await guidedCreateProject(_0x49d0a6=>runCreate(_0x49d0a6,_0x59db8f),_0x59db8f['env'],_0x59db8f['cookie']);}}function a143_0x43ab(_0x4f3921,_0x49a5ed){_0x4f3921=_0x4f3921-0x70;const _0x1dfddb=a143_0x1dfd();let _0x43ab49=_0x1dfddb[_0x4f3921];return _0x43ab49;}async function runCreate(_0x1e8815,_0x5d20d6){const _0x473295=a143_0x43ab;if(!_0x1e8815[_0x473295(0x9b)]||_0x1e8815[_0x473295(0x9b)]['trim']()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');const _0x1acb4f=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1acb4f[_0x473295(0xa0)](_0x1e8815['projectName']))throw new Error(_0x473295(0x82));if(_0x1e8815[_0x473295(0x9b)]['length']>0x64)throw new Error(_0x473295(0x87));const _0x358a9d=a143_0x4b6ca7['resolve'](process['cwd'](),_0x1e8815[_0x473295(0x9b)]);if(a143_0x572361[_0x473295(0xb3)](_0x358a9d))throw new Error(_0x473295(0xc8)+_0x1e8815[_0x473295(0x9b)]+_0x473295(0x85));try{a143_0x572361[_0x473295(0xba)](a143_0x4b6ca7['dirname'](_0x358a9d),a143_0x572361['constants'][_0x473295(0x7f)]);}catch{throw new Error(_0x473295(0xa7));}logger[_0x473295(0x84)](_0x358a9d),logger[_0x473295(0x9e)]('create','开始创建项目:\x20'+_0x1e8815[_0x473295(0x9b)],{'projectDir':_0x358a9d,'appCode':_0x1e8815[_0x473295(0x7c)]}),console['log'](),console[_0x473295(0x88)](a143_0x38e4e9['green']('\x20√\x20')+_0x473295(0xb8)+a143_0x38e4e9[_0x473295(0xb4)](_0x1e8815[_0x473295(0x9b)])+(_0x1e8815['appCode']?_0x473295(0x7b)+a143_0x38e4e9[_0x473295(0x83)](_0x1e8815['appCode']):''));try{await runTask(_0x473295(0x8e),()=>copyProjectTemplate(_0x1e8815[_0x473295(0x9b)])),await updatePackageJsonName(_0x1e8815['projectName']),await runTask('Install\x20dependencies',()=>installDependencies(_0x1e8815[_0x473295(0x9b)])),await runTask(_0x473295(0x93),()=>formatProjectCode(_0x1e8815['projectName'])),await configureAppCode(_0x1e8815[_0x473295(0x9b)],_0x1e8815[_0x473295(0x7c)]||'',_0x1e8815[_0x473295(0x9f)]);let _0x58cc2b=![];if(_0x1e8815[_0x473295(0x7c)]){console['log']('*\x20Pulling\x20API\x20configuration...');const _0x1e0343=process[_0x473295(0xb2)]();try{process[_0x473295(0xc2)](_0x358a9d);const _0xe8ca06=_0x1e8815[_0x473295(0x9f)]||_0x473295(0x77);initEnv(_0xe8ca06);const {configArray:_0x4ca50a}=await fetchModelList(_0x1e8815[_0x473295(0x7c)],_0x5d20d6[_0x473295(0xa9)]||''),_0x1d61b1=DEFAULT_API_DIR,_0x2ad7f1=await generateApiFile(_0x4ca50a,'',_0x1e8815[_0x473295(0x7c)],!![],_0xe8ca06,_0x1d61b1);console[_0x473295(0x88)]('√\x20Pulled\x20'+_0x4ca50a[_0x473295(0x7e)]+_0x473295(0xc4)+_0x2ad7f1[_0x473295(0xc0)]+'\x20model(s)'),logger['info'](_0x473295(0xaf),'API\x20configuration\x20pulled:\x20'+_0x1e8815[_0x473295(0x7c)]);}catch(_0x4a17c5){_0x58cc2b=!![],console[_0x473295(0x88)](_0x473295(0x8c)),logger[_0x473295(0x72)](_0x473295(0xaf),_0x473295(0xb5),{'error':_0x4a17c5 instanceof Error?_0x4a17c5[_0x473295(0xbe)]:String(_0x4a17c5)});}finally{process[_0x473295(0xc2)](_0x1e0343);}}logger[_0x473295(0x81)](_0x473295(0xaf),_0x473295(0xc7)+_0x1e8815[_0x473295(0x9b)]),console['log'](),console[_0x473295(0x88)](a143_0x38e4e9[_0x473295(0xb4)]('─'[_0x473295(0xad)](0x3c))),console['log'](a143_0x38e4e9[_0x473295(0x83)][_0x473295(0xc3)]('🚀\x20Next\x20Steps:')),console['log'](),console['log'](_0x473295(0xab)+a143_0x38e4e9['cyan']['bold'](_0x473295(0x7d)+_0x1e8815['projectName']+_0x473295(0xa6)+CLI_BIN_NAME+'\x20run\x20start')),_0x58cc2b&&console[_0x473295(0x88)](_0x473295(0xb6)+a143_0x38e4e9[_0x473295(0x83)][_0x473295(0xc3)](CLI_BIN_NAME+_0x473295(0xa1))),console['log'](a143_0x38e4e9['green']('─'[_0x473295(0xad)](0x3c)));}catch(_0xbeaae1){logger[_0x473295(0xc9)](_0x473295(0xaf),_0x473295(0x95)+_0x1e8815['projectName'],{'error':_0xbeaae1 instanceof Error?_0xbeaae1[_0x473295(0xbe)]:String(_0xbeaae1)});try{a143_0x572361['existsSync'](_0x358a9d)&&(console[_0x473295(0x88)](_0x473295(0x79)+_0x358a9d),a143_0x572361[_0x473295(0x80)](_0x358a9d,{'recursive':!![],'force':!![]}));}catch{logger[_0x473295(0x72)](_0x473295(0xaf),_0x473295(0x78)+_0x358a9d);}throw _0xbeaae1;}}async function runTask(_0x231930,_0x573044){const _0x4dc665=a143_0x43ab,_0x279b83=a143_0x39b440(_0x231930+'...')[_0x4dc665(0x99)]();try{const _0x2d04dc=await _0x573044();_0x279b83['stop'](),console[_0x4dc665(0x88)](''+a143_0x38e4e9[_0x4dc665(0xb4)](_0x4dc665(0x97))+_0x231930+'\x20'+a143_0x38e4e9[_0x4dc665(0x89)]('['+_0x2d04dc+']'));}catch(_0xa6503e){_0x279b83[_0x4dc665(0xc5)](_0x231930);throw _0xa6503e;}}async function updatePackageJsonName(_0x37e886){const _0x198dd7=a143_0x43ab,_0x49c91c=a143_0x4b6ca7[_0x198dd7(0x76)](process[_0x198dd7(0xb2)](),_0x37e886),_0x15951a=a143_0x4b6ca7['join'](_0x49c91c,'package.json');try{console[_0x198dd7(0x88)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x190389=getRabetbaseCliPackageRoot(),_0x231d57=a143_0x4b6ca7[_0x198dd7(0xbb)](_0x190389,'package.json');let _0x3c5d81=_0x198dd7(0x94);try{const _0x335f48=JSON[_0x198dd7(0x90)](a143_0x572361[_0x198dd7(0xaa)](_0x231d57,_0x198dd7(0xa5)));_0x3c5d81=_0x335f48['version']||_0x198dd7(0x94);}catch{}const _0x3a96de=a143_0x572361[_0x198dd7(0xaa)](_0x15951a,_0x198dd7(0xa5)),_0x32eea2=JSON[_0x198dd7(0x90)](_0x3a96de);_0x32eea2[_0x198dd7(0xb0)]=_0x37e886,_0x32eea2[_0x198dd7(0x9a)]=_0x37e886+_0x198dd7(0xca)+_0x3c5d81,a143_0x572361['writeFileSync'](_0x15951a,JSON[_0x198dd7(0x70)](_0x32eea2,null,0x2)+'\x0a',_0x198dd7(0xa5)),console[_0x198dd7(0x88)](_0x198dd7(0x73)+_0x37e886),logger['info']('create','更新\x20package.json\x20name');}catch(_0x1fbd97){logger[_0x198dd7(0xc9)](_0x198dd7(0xaf),_0x198dd7(0x9d));throw _0x1fbd97;}}async function configureAppCode(_0x2d1dd8,_0x1db150,_0x305b2d){const _0x5166a2=a143_0x43ab,_0x51e3fa=a143_0x4b6ca7[_0x5166a2(0x76)](process[_0x5166a2(0xb2)](),_0x2d1dd8),_0x514b3d=a143_0x4b6ca7[_0x5166a2(0xbb)](_0x51e3fa,NEW_CONFIG_NAME);try{_0x1db150?console['log'](_0x5166a2(0xa4)+_0x2d1dd8+':\x20'+_0x1db150):console['log']('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x2d1dd8);const _0xa24240=getRabetbaseCliPackageRoot(),_0x48921c=a143_0x4b6ca7[_0x5166a2(0xbb)](_0xa24240,_0x5166a2(0x9c));let _0x452baa=_0x5166a2(0x94);try{const _0x51dbfc=JSON['parse'](a143_0x572361[_0x5166a2(0xaa)](_0x48921c,_0x5166a2(0xa5)));_0x452baa=_0x51dbfc[_0x5166a2(0x8f)]||_0x5166a2(0x94);}catch{}const _0x36526b=readConfig(),_0x5d135c=typeof _0x36526b[_0x5166a2(0x9f)]===_0x5166a2(0xa2)?_0x36526b[_0x5166a2(0x9f)]:undefined,_0x4c6408={};for(const _0x4a9212 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x36526b[_0x4a9212]!=null)_0x4c6408[_0x4a9212]=_0x36526b[_0x4a9212];}const _0x2f1f50=buildCanonicalProjectConfig(_0x4c6408,{'appCodes':_0x1db150?[_0x1db150]:[],'env':_0x305b2d||_0x5d135c||_0x5166a2(0x77),'metadata':{'createdAt':new Date()[_0x5166a2(0x75)](),'version':_0x452baa}});writeConfigFile(_0x514b3d,_0x2f1f50),_0x1db150?console[_0x5166a2(0x88)](_0x5166a2(0xb9)+Object[_0x5166a2(0xb1)](_0x2f1f50[_0x5166a2(0x74)]||{})[_0x5166a2(0xbb)](',\x20')+_0x5166a2(0x8d)+_0x2f1f50[_0x5166a2(0xbc)]):console[_0x5166a2(0x88)](_0x5166a2(0x7a)+CLI_BIN_NAME+_0x5166a2(0xc1)),logger['info'](_0x5166a2(0xaf),_0x5166a2(0x96)+_0x1db150);}catch(_0x14de25){logger[_0x5166a2(0xc9)](_0x5166a2(0xaf),_0x5166a2(0xa3));}}
@@ -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(_0x2a34a6,_0x2e645c){const _0x24379f=a144_0x187f,_0x59de8c=_0x2a34a6();while(!![]){try{const _0x2ed008=-parseInt(_0x24379f(0x1d3))/0x1+parseInt(_0x24379f(0x1f9))/0x2*(parseInt(_0x24379f(0x1dd))/0x3)+-parseInt(_0x24379f(0x1fc))/0x4*(-parseInt(_0x24379f(0x1d0))/0x5)+parseInt(_0x24379f(0x1ee))/0x6+-parseInt(_0x24379f(0x1e3))/0x7*(-parseInt(_0x24379f(0x1f4))/0x8)+parseInt(_0x24379f(0x1e2))/0x9*(parseInt(_0x24379f(0x1e1))/0xa)+-parseInt(_0x24379f(0x1f0))/0xb;if(_0x2ed008===_0x2e645c)break;else _0x59de8c['push'](_0x59de8c['shift']());}catch(_0xb52cc5){_0x59de8c['push'](_0x59de8c['shift']());}}}(a144_0x59fd,0xa56b9));import a144_0x4efe7d from'path';function a144_0x187f(_0x452925,_0x5a89af){_0x452925=_0x452925-0x1c6;const _0x59fdc1=a144_0x59fd();let _0x187fbe=_0x59fdc1[_0x452925];return _0x187fbe;}import a144_0x192339 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';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(_0x3810a4,_0xaed062,_0x4903bd,_0x2c63ac){const _0x5372a9=a144_0x187f,_0x2511e3=await checkCliVersion();(_0x2511e3[_0x5372a9(0x1eb)]||_0x2511e3[_0x5372a9(0x1da)])&&(printCliUpgradeWarning(_0x2511e3),assertCliVersionSupported(_0x2511e3));if(!_0x3810a4||_0x3810a4[_0x5372a9(0x1e0)]()==='')throw CliErrors[_0x5372a9(0x1ec)](_0x5372a9(0x1e5));const _0x2075d3=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x2075d3['test'](_0x3810a4))throw CliErrors[_0x5372a9(0x1ec)](_0x5372a9(0x201),_0x5372a9(0x1d4));if(_0x3810a4[_0x5372a9(0x1fe)]>0x64)throw CliErrors['validation'](_0x5372a9(0x1dc));const _0x266bad=a144_0x4efe7d[_0x5372a9(0x1ea)](process[_0x5372a9(0x1c6)](),_0x3810a4);if(existsSync(_0x266bad))throw CliErrors['validation'](_0x5372a9(0x1cc)+_0x3810a4+_0x5372a9(0x1f5),_0x5372a9(0x1c7));try{const _0x288c6b=a144_0x4efe7d[_0x5372a9(0x1f2)](_0x266bad);await a144_0x192339['access'](_0x288c6b,a144_0x192339['constants']['W_OK']);}catch{throw CliErrors[_0x5372a9(0x1ec)](_0x5372a9(0x1ef),_0x5372a9(0x1ff));}try{console['log'](_0x5372a9(0x1cd)+_0x3810a4+'...');const _0xbcd455=getSubAppReactDemoTemplateDir();await copyDirectory(_0xbcd455,_0x266bad),console[_0x5372a9(0x1e4)]('\x20\x20√\x20Project\x20template\x20created'),await updatePackageJsonName(_0x3810a4),console[_0x5372a9(0x1e4)](_0x5372a9(0x1d6)),console[_0x5372a9(0x1e4)]('\x20\x20Installing\x20dependencies...'),console[_0x5372a9(0x1e4)](_0x5372a9(0x1d8)),await formatCode(_0x266bad),console[_0x5372a9(0x1e4)](_0x5372a9(0x1d9)),await configureProject(_0x3810a4,_0x4903bd,_0xaed062),console['log'](_0x5372a9(0x1fd)),_0x4903bd&&await pullApiConfig(_0x266bad,_0x4903bd,_0xaed062,_0x2c63ac),console['log'](_0x5372a9(0x200)+_0x3810a4+_0x5372a9(0x1e9)),console[_0x5372a9(0x1e4)](_0x5372a9(0x1d1)+_0x3810a4),console['log'](_0x5372a9(0x1f3));}catch(_0x373e6a){try{existsSync(_0x266bad)&&await a144_0x192339['rm'](_0x266bad,{'recursive':!![],'force':!![]});}catch{}throw _0x373e6a;}}async function updatePackageJsonName(_0x2cb4d5){const _0x407b35=a144_0x187f,_0x413de3=a144_0x4efe7d['resolve'](process[_0x407b35(0x1c6)](),_0x2cb4d5),_0x2ddafa=a144_0x4efe7d['join'](_0x413de3,_0x407b35(0x1d5)),_0x74696c=await a144_0x192339[_0x407b35(0x1f7)](_0x2ddafa,_0x407b35(0x1d7)),_0x3dcb10=JSON[_0x407b35(0x1f8)](_0x74696c);_0x3dcb10[_0x407b35(0x1fb)]=_0x2cb4d5,_0x3dcb10[_0x407b35(0x1d2)]=_0x407b35(0x1de),await a144_0x192339[_0x407b35(0x1f6)](_0x2ddafa,JSON['stringify'](_0x3dcb10,null,0x2)+'\x0a');}function detectPackageManager(){const _0x8db00d=a144_0x187f;try{return execSync(_0x8db00d(0x1cb),{'stdio':_0x8db00d(0x1df)}),'bun';}catch{return _0x8db00d(0x1db);}}function a144_0x59fd(){const _0x87e760=['\x20created\x20successfully!','resolve','needsUpgrade','validation','\x20dataset(s),\x20generated\x20','1215828rHjShv','Cannot\x20create\x20project\x20in\x20current\x20directory.','21119527EjfKzm','\x20\x20√\x20Pulled\x20','dirname','\x20\x20rabetbase\x20run\x20start\x0a','392jrUnvJ','\x22\x20already\x20exists.','writeFile','readFile','parse','386558fIFuSw','env','name','558712OZaMIG','\x20\x20√\x20Configuration\x20file\x20created','length','Check\x20directory\x20permissions.','\x0a√\x20Project\x20','Project\x20name\x20contains\x20invalid\x20characters.','cwd','Use\x20a\x20different\x20project\x20name.','bun\x20run\x20format','join','production','bun\x20--version','Project\x20directory\x20\x22','*\x20Creating\x20project\x20','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','\x20\x20Pulling\x20API\x20configuration...','20bLUAkh','\x0a\x20\x20cd\x20','description','1221563yPNEqb','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','package.json','\x20\x20√\x20package.json\x20updated','utf-8','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','\x20\x20√\x20Code\x20formatted','belowMinimum','npm','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','21wYbrAn','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','ignore','trim','50SEYige','1638261yXHePl','113519dYfSgU','log','Project\x20name\x20cannot\x20be\x20empty.','\x20model(s)','toLocaleString','modelCount'];a144_0x59fd=function(){return _0x87e760;};return a144_0x59fd();}async function formatCode(_0x5b7de8){const _0x1ff5bd=a144_0x187f;try{await execAsync(_0x1ff5bd(0x1c8),{'cwd':_0x5b7de8});}catch{}}async function configureProject(_0x376e9b,_0x25c3f6,_0x314f8e){const _0x22abca=a144_0x187f,_0x3f493e=a144_0x4efe7d[_0x22abca(0x1ea)](process[_0x22abca(0x1c6)](),_0x376e9b),_0x362f45=a144_0x4efe7d[_0x22abca(0x1c9)](_0x3f493e,NEW_CONFIG_NAME),_0x38ff80=readConfig(),_0x4804e0=typeof _0x38ff80['env']==='string'?_0x38ff80[_0x22abca(0x1fa)]:undefined,_0x56bc0e={};for(const _0x24ddb1 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x38ff80[_0x24ddb1]!=null)_0x56bc0e[_0x24ddb1]=_0x38ff80[_0x24ddb1];}const _0x33dcd3=buildCanonicalProjectConfig(_0x56bc0e,{'appCodes':_0x25c3f6?[_0x25c3f6]:[],'env':_0x314f8e||_0x4804e0||_0x22abca(0x1ca),'metadata':{'createdAt':new Date()[_0x22abca(0x1e7)](),'version':getCliVersion()}});writeConfigFile(_0x362f45,_0x33dcd3);}async function pullApiConfig(_0x1942b1,_0x1b47df,_0x3614ea,_0x1bc023){const _0x3f8247=a144_0x187f,_0x50bf05=process['cwd']();try{process['chdir'](_0x1942b1);const _0x46f515=_0x3614ea||_0x3f8247(0x1ca);initEnv(_0x46f515),console[_0x3f8247(0x1e4)](_0x3f8247(0x1cf));const {configArray:_0x5f194d}=await fetchModelList(_0x1b47df,_0x1bc023||''),_0x381124=await generateApiFile(_0x5f194d,'',_0x1b47df,!![],_0x46f515,DEFAULT_API_DIR);console[_0x3f8247(0x1e4)](_0x3f8247(0x1f1)+_0x5f194d['length']+_0x3f8247(0x1ed)+_0x381124[_0x3f8247(0x1e8)]+_0x3f8247(0x1e6));}catch(_0xb76cf1){console[_0x3f8247(0x1e4)](_0x3f8247(0x1ce)+CLI_BIN_NAME+'\x20api\x20pull`\x20manually\x20later.');}finally{process['chdir'](_0x50bf05);}}
@@ -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_0x4b6e4d=a145_0x40e2;(function(_0x4c63bf,_0x3d61ec){const _0x1869d8=a145_0x40e2,_0x9507a9=_0x4c63bf();while(!![]){try{const _0xa97d3b=-parseInt(_0x1869d8(0x186))/0x1+-parseInt(_0x1869d8(0x17a))/0x2+-parseInt(_0x1869d8(0x17d))/0x3+-parseInt(_0x1869d8(0x184))/0x4+parseInt(_0x1869d8(0x17f))/0x5+-parseInt(_0x1869d8(0x183))/0x6*(-parseInt(_0x1869d8(0x17e))/0x7)+parseInt(_0x1869d8(0x185))/0x8;if(_0xa97d3b===_0x3d61ec)break;else _0x9507a9['push'](_0x9507a9['shift']());}catch(_0x2beef1){_0x9507a9['push'](_0x9507a9['shift']());}}}(a145_0x7220,0xc9417));function a145_0x40e2(_0x37f2e8,_0x3e4d08){_0x37f2e8=_0x37f2e8-0x17a;const _0x72202b=a145_0x7220();let _0x40e2a5=_0x72202b[_0x37f2e8];return _0x40e2a5;}import a145_0x4f9152 from'node:path';import{fileURLToPath}from'node:url';function a145_0x7220(){const _0x5396af=['10812382AlNIWS','292845sGyHNN','../../../../','dirname','templates','6RpOudt','4326704NsFzrg','25112080fzBVyX','1569357QJYlXm','join','903732wYNHdb','projects','resolve','2444889ksufmq'];a145_0x7220=function(){return _0x5396af;};return a145_0x7220();}const __dirname=a145_0x4f9152[a145_0x4b6e4d(0x181)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x1c526d=a145_0x4b6e4d;return a145_0x4f9152[_0x1c526d(0x17c)](__dirname,_0x1c526d(0x180));}export function getSubAppReactDemoTemplateDir(){const _0xca0b26=a145_0x4b6e4d;return a145_0x4f9152[_0xca0b26(0x187)](getRabetbaseCliPackageRoot(),_0xca0b26(0x182),_0xca0b26(0x17b),'sub-app-react-demo');}
@@ -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 a146_0x4cf7(_0x3a0f7f,_0x187432){_0x3a0f7f=_0x3a0f7f-0x93;const _0xfd0d8=a146_0xfd0d();let _0x4cf777=_0xfd0d8[_0x3a0f7f];return _0x4cf777;}(function(_0x41f027,_0x29bc83){const _0x9d8de2=a146_0x4cf7,_0x2a5687=_0x41f027();while(!![]){try{const _0x3db2bc=-parseInt(_0x9d8de2(0xa5))/0x1*(-parseInt(_0x9d8de2(0x9e))/0x2)+parseInt(_0x9d8de2(0xa2))/0x3+-parseInt(_0x9d8de2(0xa0))/0x4*(-parseInt(_0x9d8de2(0x93))/0x5)+parseInt(_0x9d8de2(0xa3))/0x6+parseInt(_0x9d8de2(0x98))/0x7*(parseInt(_0x9d8de2(0x94))/0x8)+parseInt(_0x9d8de2(0x9a))/0x9+-parseInt(_0x9d8de2(0x97))/0xa*(parseInt(_0x9d8de2(0x96))/0xb);if(_0x3db2bc===_0x29bc83)break;else _0x2a5687['push'](_0x2a5687['shift']());}catch(_0x22380e){_0x2a5687['push'](_0x2a5687['shift']());}}}(a146_0xfd0d,0xdb8f4));import a146_0x13f884 from'node:path';function a146_0xfd0d(){const _0x53fdff=['52990663eRYCxV','10afTBxq','22309leIXAa','error','10565928dPsGhu','cwd','copy','开始复制项目模板','3201242IJcfmQ','resolve','4952540nTjWtD','now','230931fQzgPb','1022790klEgUU','info','1ptsagw','5GzvMno','3656QXhGnr','项目模板复制失败'];a146_0xfd0d=function(){return _0x53fdff;};return a146_0xfd0d();}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(_0x1470e2){const _0x4eb78b=a146_0x4cf7,_0x5d741a=Date[_0x4eb78b(0xa1)](),_0x5724fc=a146_0x13f884[_0x4eb78b(0x9f)](process[_0x4eb78b(0x9b)](),_0x1470e2);try{logger[_0x4eb78b(0xa4)](_0x4eb78b(0x9c),_0x4eb78b(0x9d),{'projectCode':_0x1470e2,'templateDir':templateDir}),await copyDirectory(templateDir,_0x5724fc);const _0x4e9bd4=Date['now']()-_0x5d741a;logger['success'](_0x4eb78b(0x9c),'项目模板复制完成',_0x4e9bd4,{'projectCode':_0x1470e2});}catch(_0x487d16){const _0x37aa3d=Date[_0x4eb78b(0xa1)]()-_0x5d741a;logger[_0x4eb78b(0x99)]('copy',_0x4eb78b(0x95),{'projectCode':_0x1470e2,'error':_0x487d16 instanceof Error?_0x487d16['message']:String(_0x487d16),'duration':_0x37aa3d});throw _0x487d16;}return formatElapsed(_0x5d741a);}
@@ -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(_0x5c52ae,_0x49c7b3){const _0x3951a=a147_0x7c2b,_0x3c272b=_0x5c52ae();while(!![]){try{const _0x6e858d=parseInt(_0x3951a(0x1c2))/0x1*(-parseInt(_0x3951a(0x1c9))/0x2)+parseInt(_0x3951a(0x1d6))/0x3*(parseInt(_0x3951a(0x1c8))/0x4)+-parseInt(_0x3951a(0x1d2))/0x5+parseInt(_0x3951a(0x1d4))/0x6*(-parseInt(_0x3951a(0x1be))/0x7)+-parseInt(_0x3951a(0x1d3))/0x8*(parseInt(_0x3951a(0x1bf))/0x9)+parseInt(_0x3951a(0x1ca))/0xa+parseInt(_0x3951a(0x1cb))/0xb*(parseInt(_0x3951a(0x1c7))/0xc);if(_0x6e858d===_0x49c7b3)break;else _0x3c272b['push'](_0x3c272b['shift']());}catch(_0x2f5e10){_0x3c272b['push'](_0x3c272b['shift']());}}}(a147_0x5afc,0xb54a1));import a147_0x1fd9f4 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a147_0x7c2b(_0x4a935a,_0x4feac0){_0x4a935a=_0x4a935a-0x1be;const _0x5afc83=a147_0x5afc();let _0x7c2b9=_0x5afc83[_0x4a935a];return _0x7c2b9;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a147_0x5afc(){const _0x1d0839=['开始格式化代码','format','204icAJWO','1234264qwlMFN','135492VuEAAn','596250reIuRo','3006223PckkGy','message','now','--write','resolve','npx','cwd','6979465XRiFFP','8jqcMAa','38382mvKDjT','代码格式化完成','3ePygqP','1225CoNnEV','10318761kWeYau','error','代码格式化失败','9JHDIPA','success','info'];a147_0x5afc=function(){return _0x1d0839;};return a147_0x5afc();}export async function formatProjectCode(_0xd84bbc){const _0x4099ab=a147_0x7c2b,_0x198f4e=Date[_0x4099ab(0x1cd)](),_0x1b1d87=a147_0x1fd9f4[_0x4099ab(0x1cf)](process[_0x4099ab(0x1d1)](),_0xd84bbc);try{logger[_0x4099ab(0x1c4)]('format',_0x4099ab(0x1c5),{'projectCode':_0xd84bbc}),await execa(resolveNpmBin(_0x4099ab(0x1d0)),['prettier',_0x4099ab(0x1ce),'.'],{'cwd':_0x1b1d87});const _0x107ad0=Date[_0x4099ab(0x1cd)]()-_0x198f4e;logger[_0x4099ab(0x1c3)](_0x4099ab(0x1c6),_0x4099ab(0x1d5),_0x107ad0,{'projectCode':_0xd84bbc});}catch(_0x1a2554){const _0x1e889a=Date[_0x4099ab(0x1cd)]()-_0x198f4e;logger[_0x4099ab(0x1c0)](_0x4099ab(0x1c6),_0x4099ab(0x1c1),{'projectCode':_0xd84bbc,'error':_0x1a2554 instanceof Error?_0x1a2554[_0x4099ab(0x1cc)]:String(_0x1a2554),'duration':_0x1e889a});throw _0x1a2554;}return formatElapsed(_0x198f4e);}
@@ -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(_0x83ff1f,_0x1ccf44){const _0x16faa3=a148_0x14a7,_0xaee5d9=_0x83ff1f();while(!![]){try{const _0x37dab5=-parseInt(_0x16faa3(0xf7))/0x1+-parseInt(_0x16faa3(0xf9))/0x2*(parseInt(_0x16faa3(0x104))/0x3)+-parseInt(_0x16faa3(0x103))/0x4+-parseInt(_0x16faa3(0xfb))/0x5*(-parseInt(_0x16faa3(0xf8))/0x6)+-parseInt(_0x16faa3(0xfa))/0x7*(-parseInt(_0x16faa3(0xf3))/0x8)+parseInt(_0x16faa3(0xff))/0x9*(parseInt(_0x16faa3(0x105))/0xa)+parseInt(_0x16faa3(0xf4))/0xb;if(_0x37dab5===_0x1ccf44)break;else _0xaee5d9['push'](_0xaee5d9['shift']());}catch(_0x1e401e){_0xaee5d9['push'](_0xaee5d9['shift']());}}}(a148_0x538b,0xa2617));function a148_0x538b(){const _0x135413=['--registry','664136hcXDne','18579561YUiypQ','resolve','now','1239814tlMkNP','150owbydC','278792GcdePI','56eKgviN','95535ZMrKXH','message','cwd','success','288VaWNzK','npm','install','https://registry.npmmirror.com','4431908TIQBmZ','6bTkagN','144010KtfqOt','依赖安装失败'];a148_0x538b=function(){return _0x135413;};return a148_0x538b();}function a148_0x14a7(_0x39472d,_0x41ba3e){_0x39472d=_0x39472d-0xf1;const _0x538b1c=a148_0x538b();let _0x14a7f=_0x538b1c[_0x39472d];return _0x14a7f;}import a148_0x35cdbb 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(_0x5d6a34){const _0x35bd8a=a148_0x14a7,_0x3ff6e5=Date[_0x35bd8a(0xf6)](),_0x3e0e22=a148_0x35cdbb[_0x35bd8a(0xf5)](process[_0x35bd8a(0xfd)](),_0x5d6a34);try{logger['info']('install','开始安装依赖',{'projectCode':_0x5d6a34,'registry':_0x35bd8a(0x102)}),await execa(resolveNpmBin(_0x35bd8a(0x100)),[_0x35bd8a(0x101),_0x35bd8a(0xf2),_0x35bd8a(0x102)],{'cwd':_0x3e0e22});const _0x2a8c0c=Date[_0x35bd8a(0xf6)]()-_0x3ff6e5;logger[_0x35bd8a(0xfe)](_0x35bd8a(0x101),'依赖安装完成',_0x2a8c0c,{'projectCode':_0x5d6a34});}catch(_0x10fccf){const _0x14397f=Date[_0x35bd8a(0xf6)]()-_0x3ff6e5;logger['error']('install',_0x35bd8a(0xf1),{'projectCode':_0x5d6a34,'error':_0x10fccf instanceof Error?_0x10fccf[_0x35bd8a(0xfc)]:String(_0x10fccf),'duration':_0x14397f});throw _0x10fccf;}return formatElapsed(_0x3ff6e5);}
@@ -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_0x8cf087=a149_0x4945;(function(_0x4f6818,_0x27f0df){const _0x301c9c=a149_0x4945,_0x2cbe72=_0x4f6818();while(!![]){try{const _0x20abc4=parseInt(_0x301c9c(0x10f))/0x1*(parseInt(_0x301c9c(0x103))/0x2)+parseInt(_0x301c9c(0x114))/0x3+-parseInt(_0x301c9c(0x10e))/0x4*(parseInt(_0x301c9c(0x115))/0x5)+-parseInt(_0x301c9c(0x113))/0x6*(-parseInt(_0x301c9c(0x104))/0x7)+parseInt(_0x301c9c(0x108))/0x8*(-parseInt(_0x301c9c(0x129))/0x9)+-parseInt(_0x301c9c(0x12b))/0xa*(parseInt(_0x301c9c(0x10b))/0xb)+-parseInt(_0x301c9c(0x101))/0xc*(-parseInt(_0x301c9c(0x107))/0xd);if(_0x20abc4===_0x27f0df)break;else _0x2cbe72['push'](_0x2cbe72['shift']());}catch(_0x411f27){_0x2cbe72['push'](_0x2cbe72['shift']());}}}(a149_0x4163,0x93627));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_0x4945(_0x56d3a9,_0x229967){_0x56d3a9=_0x56d3a9-0x101;const _0x416387=a149_0x4163();let _0x494556=_0x416387[_0x56d3a9];return _0x494556;}const initFlags=[{'name':'appcode','type':'string','description':'App\x20code\x20to\x20initialize'},{'name':a149_0x8cf087(0x12d),'type':a149_0x8cf087(0x120),'description':a149_0x8cf087(0x126)},{'name':a149_0x8cf087(0x10a),'type':a149_0x8cf087(0x125),'description':a149_0x8cf087(0x102),'default':![]}],createFlags=[{'name':a149_0x8cf087(0x10d),'type':a149_0x8cf087(0x120),'description':a149_0x8cf087(0x117)},{'name':a149_0x8cf087(0x12d),'type':a149_0x8cf087(0x120),'description':a149_0x8cf087(0x126)},{'name':'appcode','type':'string','description':a149_0x8cf087(0x11e)}],upgradeFlags=[{'name':a149_0x8cf087(0x10a),'type':'boolean','description':a149_0x8cf087(0x106),'default':![]}];function a149_0x4163(){const _0x3f4746=['Skip\x20confirmation\x20prompt','52OaHfWc','24NLWvVc','trim','yes','22NvaGOM','appcode','name','145876hEvtfh','106nkLuve','\x20workspace\x20init','../../commands/project/create/main.js','str','18gyEiVh','1913352VEJHvk','55DSusNa','2026-07','Project\x20name','write','validation','bool','cookie','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','create','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','upgrade','string','args','Usage:\x20','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','Create\x20a\x20new\x20project','boolean','Target\x20environment','nonInteractive','../../commands/project/create/non-interactive.js','1853469gDNHqV','project','2907820qFTjHz','init','env','574836VTyrwk','Auto-confirm\x20prompts','10422JbKDMv','1919099jswEDl','project-name'];a149_0x4163=function(){return _0x3f4746;};return a149_0x4163();}export const projectDefinitions=[{'service':'project','command':a149_0x8cf087(0x12c),'description':a149_0x8cf087(0x123),'risk':a149_0x8cf087(0x118),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a149_0x8cf087(0x110),'since':a149_0x8cf087(0x116)},'flags':initFlags,async 'execute'(_0x331cbe){const _0x289da3=a149_0x8cf087;return await initConfig({'appcode':_0x331cbe[_0x289da3(0x112)]('appcode')||undefined,'env':_0x331cbe[_0x289da3(0x112)](_0x289da3(0x12d))||undefined,'autoYes':_0x331cbe[_0x289da3(0x11a)](_0x289da3(0x10a))}),{'ok':!![]};}},{'service':'project','command':a149_0x8cf087(0x11d),'description':a149_0x8cf087(0x124),'risk':a149_0x8cf087(0x118),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a149_0x8cf087(0x105),'description':a149_0x8cf087(0x11c),'required':![]}],'flags':createFlags,async 'execute'(_0x14a155){const _0x557096=a149_0x8cf087,{createApp:_0x2f94a6}=await import(_0x557096(0x111)),{createProjectNonInteractive:_0x16f7b8}=await import(_0x557096(0x128)),_0x5a8d65=_0x14a155[_0x557096(0x112)](_0x557096(0x10d))[_0x557096(0x109)]()||_0x14a155[_0x557096(0x121)][0x0]?.[_0x557096(0x109)](),_0xf2df15=_0x14a155[_0x557096(0x112)](_0x557096(0x12d))||undefined,_0x1d55e8=_0x14a155['str'](_0x557096(0x10c))||undefined;if(_0x14a155[_0x557096(0x127)]){if(!_0x5a8d65)throw CliErrors[_0x557096(0x119)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x557096(0x122)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0x16f7b8(_0x5a8d65,_0xf2df15,_0x1d55e8,_0x14a155[_0x557096(0x11b)]);}else await _0x2f94a6({'projectCode':_0x5a8d65,'appCode':_0x1d55e8,'env':_0xf2df15,'cookie':_0x14a155['cookie']});return{'ok':!![]};}},{'service':a149_0x8cf087(0x12a),'command':a149_0x8cf087(0x11f),'description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a149_0x8cf087(0x118),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x86b488){const _0x48e700=a149_0x8cf087;return await upgradeApp(_0x86b488[_0x48e700(0x127)],{'yes':_0x86b488[_0x48e700(0x11a)](_0x48e700(0x10a))}),{'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(_0x2b71a7,_0x406eb3){const _0x559eac=a150_0x329e,_0x2ea1b9=_0x2b71a7();while(!![]){try{const _0x3facff=-parseInt(_0x559eac(0x18d))/0x1+parseInt(_0x559eac(0x18c))/0x2+-parseInt(_0x559eac(0x179))/0x3+parseInt(_0x559eac(0x19f))/0x4*(-parseInt(_0x559eac(0x196))/0x5)+parseInt(_0x559eac(0x178))/0x6+parseInt(_0x559eac(0x199))/0x7*(parseInt(_0x559eac(0x180))/0x8)+parseInt(_0x559eac(0x171))/0x9;if(_0x3facff===_0x406eb3)break;else _0x2ea1b9['push'](_0x2ea1b9['shift']());}catch(_0x34d6d0){_0x2ea1b9['push'](_0x2ea1b9['shift']());}}}(a150_0x1bcb,0xa957f));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a150_0x1e9896 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(_0x4e78bd){const _0x3789dd=a150_0x329e,{appcode:_0x5767f7,env:_0x41a95f,autoYes:_0x3c75e0}=_0x4e78bd,_0x2f76a5=process['cwd']();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x1d86f7;for(const _0x28acb of LEGACY_CONFIG_NAMES){const _0x5d8e2f=resolve(_0x2f76a5,_0x28acb);if(existsSync(_0x5d8e2f)){_0x1d86f7=_0x5d8e2f;break;}}if(_0x1d86f7){let _0x65a2fc={};try{_0x65a2fc=JSON['parse'](readFileSync(_0x1d86f7,_0x3789dd(0x19b)));}catch{}const _0x45b288=basename(_0x1d86f7),_0x4f195e=_0x65a2fc?.[_0x3789dd(0x19c)]||_0x65a2fc?.[_0x3789dd(0x189)];let _0x46ee07=_0x3c75e0;!_0x3c75e0&&(console[_0x3789dd(0x17a)](a150_0x1e9896['yellow']('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a150_0x1e9896[_0x3789dd(0x18f)](_0x45b288))),_0x4f195e&&console[_0x3789dd(0x17a)](a150_0x1e9896[_0x3789dd(0x17c)](_0x3789dd(0x181)+_0x4f195e)),_0x46ee07=await confirm({'message':_0x3789dd(0x174)+a150_0x1e9896[_0x3789dd(0x18f)]('.rabetbase.json')+_0x3789dd(0x173),'default':!![]}));if(!_0x46ee07){console[_0x3789dd(0x17a)](_0x3789dd(0x192)+CLI_BIN_NAME+_0x3789dd(0x177));return;}const _0x2793a0=resolve(_0x2f76a5,NEW_CONFIG_NAME),_0x4d44ea=getCliVersionFromPkg(),_0x4b2291=readRawConfig(),_0x57a6ef=_0x5767f7||(typeof _0x65a2fc?.[_0x3789dd(0x19c)]===_0x3789dd(0x197)?_0x65a2fc[_0x3789dd(0x19c)]:undefined)||(typeof _0x65a2fc?.[_0x3789dd(0x189)]===_0x3789dd(0x197)?_0x65a2fc[_0x3789dd(0x189)]:undefined)||await askAppcode(),_0x4e7919=typeof _0x65a2fc?.['env']==='string'?_0x65a2fc[_0x3789dd(0x183)]:typeof _0x4b2291[_0x3789dd(0x183)]==='string'?_0x4b2291[_0x3789dd(0x183)]:_0x3789dd(0x185),_0x5b31e8=buildCanonicalProjectConfig({..._0x4b2291,..._0x65a2fc},{'appCodes':[_0x57a6ef],'env':_0x4e7919,'metadata':{'version':_0x4d44ea,'migratedAt':new Date()[_0x3789dd(0x19d)](),'migratedFrom':_0x1d86f7}});writeConfigFile(_0x2793a0,_0x5b31e8);const _0x10d5be=_0x1d86f7+_0x3789dd(0x186);renameSync(_0x1d86f7,_0x10d5be),logger[_0x3789dd(0x175)](_0x2f76a5),logger[_0x3789dd(0x187)]('init',_0x3789dd(0x19a),{'from':_0x1d86f7,'to':_0x2793a0,'appcode':_0x57a6ef,'env':_0x5b31e8[_0x3789dd(0x183)]}),console[_0x3789dd(0x17a)](a150_0x1e9896[_0x3789dd(0x182)](_0x3789dd(0x193)+_0x45b288+_0x3789dd(0x18e))),console['log'](a150_0x1e9896[_0x3789dd(0x17c)](_0x3789dd(0x176)+Object[_0x3789dd(0x198)](_0x5b31e8[_0x3789dd(0x184)]||{})[_0x3789dd(0x188)](',\x20'))),console['log'](a150_0x1e9896[_0x3789dd(0x17c)](_0x3789dd(0x172)+_0x5b31e8[_0x3789dd(0x190)])),console['log'](a150_0x1e9896[_0x3789dd(0x195)]('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0x45b288+'.bak'));return;}const _0x28175e=_0x5767f7||await askAppcode(),_0x57a605=resolve(_0x2f76a5,NEW_CONFIG_NAME),_0x5d5b69=getCliVersionFromPkg(),_0xa0b702=readRawConfig(),_0x5e2723=typeof _0xa0b702[_0x3789dd(0x183)]===_0x3789dd(0x197)?_0xa0b702['env']:undefined,_0x31f1ce=buildCanonicalProjectConfig({},{'appCodes':[_0x28175e],'env':_0x41a95f||_0x5e2723||_0x3789dd(0x185),'metadata':{'version':_0x5d5b69,'createdAt':new Date()[_0x3789dd(0x19d)]()}});writeConfigFile(_0x57a605,_0x31f1ce),logger[_0x3789dd(0x175)](_0x2f76a5),logger[_0x3789dd(0x187)](_0x3789dd(0x194),_0x3789dd(0x17e),{'appcode':_0x28175e,'env':_0x31f1ce[_0x3789dd(0x183)],'version':_0x31f1ce['version'],'configPath':_0x57a605}),console[_0x3789dd(0x17a)](a150_0x1e9896[_0x3789dd(0x182)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a150_0x1e9896['cyan'](_0x3789dd(0x176)+Object[_0x3789dd(0x198)](_0x31f1ce[_0x3789dd(0x184)]||{})['join'](',\x20'))),console[_0x3789dd(0x17a)](a150_0x1e9896[_0x3789dd(0x17c)](_0x3789dd(0x172)+_0x31f1ce[_0x3789dd(0x190)])),console['log']('\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27'+CLI_BIN_NAME+_0x3789dd(0x18b)+CLI_BIN_NAME+'\x20api\x20pull\x27');}function a150_0x329e(_0x251dab,_0x3bc738){_0x251dab=_0x251dab-0x170;const _0x1bcb4e=a150_0x1bcb();let _0x329e22=_0x1bcb4e[_0x251dab];return _0x329e22;}function askAppcode(){return input({'message':'Please\x20enter\x20App\x20Code:','validate':_0x54b6ef=>{const _0x11ba63=a150_0x329e;if(!_0x54b6ef[_0x11ba63(0x18a)]())return _0x11ba63(0x17f);const {valid:_0x2aa5b4,message:_0x122043}=validateAppcode(_0x54b6ef[_0x11ba63(0x18a)]());return _0x2aa5b4||_0x122043||_0x11ba63(0x17b);}});}function getCliVersionFromPkg(){const _0x30749b=a150_0x329e;try{const _0x227e7a=fileURLToPath(import.meta.url),_0x1244c0=resolve(dirname(_0x227e7a),_0x30749b(0x170)),_0x465115=JSON[_0x30749b(0x191)](readFileSync(resolve(_0x1244c0,_0x30749b(0x19e)),_0x30749b(0x19b)));return _0x465115['version']||_0x30749b(0x17d);}catch{return _0x30749b(0x17d);}}function a150_0x1bcb(){const _0x4e2f9c=['setLogPath','\x20\x20Apps:\x20','\x20workspace\x20init`\x20to\x20start\x20fresh.','1095588FWYBrV','1389558qCcihZ','log','Invalid\x20App\x20Code','cyan','1.0.0','初始化项目配置文件成功','App\x20Code\x20cannot\x20be\x20empty','3800liEbJW','\x20\x20appcode:\x20','green','env','apps','production','.bak','info','join','app','trim','\x20api\x20generate\x27\x20and\x20\x27','1186846bHIwEk','361080GnhnOl','\x20→\x20.rabetbase.json','bold','defaultApp','parse','Migration\x20cancelled.\x20Run\x20`','✓\x20Upgraded\x20','init','gray','7430igssDl','string','keys','16954adYiCZ','从旧配置文件升级成功','utf8','appcode','toLocaleString','package.json','1708SlnnPK','../..','2033532Fyvcar','\x20\x20Default:\x20','?\x20(Old\x20file\x20→\x20*.bak)','Upgrade\x20it\x20to\x20'];a150_0x1bcb=function(){return _0x4e2f9c;};return a150_0x1bcb();}