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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/db/analysis-batching.js +1 -1
  80. package/lib/commands/db/analyze-batch-plan.js +1 -1
  81. package/lib/commands/db/analyze-cancel.js +1 -1
  82. package/lib/commands/db/analyze-start.js +1 -1
  83. package/lib/commands/db/analyze-status.js +1 -1
  84. package/lib/commands/db/create.js +1 -1
  85. package/lib/commands/db/delete.js +1 -1
  86. package/lib/commands/db/detail.js +1 -1
  87. package/lib/commands/db/diff.js +1 -1
  88. package/lib/commands/db/index.js +1 -1
  89. package/lib/commands/db/list.js +1 -1
  90. package/lib/commands/db/shared.js +1 -1
  91. package/lib/commands/db/tables.js +1 -1
  92. package/lib/commands/db/test.js +1 -1
  93. package/lib/commands/db/update.js +1 -1
  94. package/lib/commands/doctor.js +1 -1
  95. package/lib/commands/file/index.js +1 -1
  96. package/lib/commands/init/index.js +1 -1
  97. package/lib/commands/issue/index.js +1 -1
  98. package/lib/commands/issue/nudge.js +1 -1
  99. package/lib/commands/issue/report.js +1 -1
  100. package/lib/commands/issue/shared.js +1 -1
  101. package/lib/commands/logs/index.js +1 -1
  102. package/lib/commands/menu/delete.js +1 -1
  103. package/lib/commands/menu/external-link-create.js +1 -0
  104. package/lib/commands/menu/group-create.js +1 -1
  105. package/lib/commands/menu/group-update.js +1 -1
  106. package/lib/commands/menu/index.js +1 -1
  107. package/lib/commands/menu/list.js +1 -1
  108. package/lib/commands/menu/regroup-start.js +1 -1
  109. package/lib/commands/menu/shared/compare-table.js +1 -1
  110. package/lib/commands/menu/shared/delete-plan.js +1 -1
  111. package/lib/commands/menu/shared/facts.js +1 -1
  112. package/lib/commands/menu/shared/index.js +1 -1
  113. package/lib/commands/menu/shared/inquirer.js +1 -1
  114. package/lib/commands/menu/shared/local-pages.js +1 -1
  115. package/lib/commands/menu/shared/logic.js +1 -1
  116. package/lib/commands/menu/shared/mutations.js +1 -1
  117. package/lib/commands/menu/shared/service.js +1 -1
  118. package/lib/commands/menu/shared/sync-core.js +1 -1
  119. package/lib/commands/menu/shared/update-core.js +1 -1
  120. package/lib/commands/menu/shared/valid-url.js +1 -1
  121. package/lib/commands/menu/sync.js +1 -1
  122. package/lib/commands/menu/update.js +1 -1
  123. package/lib/commands/notification/config-list.js +1 -1
  124. package/lib/commands/notification/index.js +1 -1
  125. package/lib/commands/page/generate-start.js +1 -1
  126. package/lib/commands/page/generate-status.js +1 -1
  127. package/lib/commands/page/index.js +1 -1
  128. package/lib/commands/page/pull.js +1 -1
  129. package/lib/commands/page/push.js +1 -1
  130. package/lib/commands/page/relation-audit.js +1 -1
  131. package/lib/commands/page/shared.js +1 -1
  132. package/lib/commands/page/standard-page-status.js +1 -1
  133. package/lib/commands/page/sync.js +1 -1
  134. package/lib/commands/permit/index.js +1 -1
  135. package/lib/commands/permit/page-get.js +1 -1
  136. package/lib/commands/permit/page-set.js +1 -1
  137. package/lib/commands/permit/role-apis-set.js +1 -1
  138. package/lib/commands/permit/role-menus-set.js +1 -1
  139. package/lib/commands/permit/role-menus.js +1 -1
  140. package/lib/commands/permit/shared.js +1 -1
  141. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  142. package/lib/commands/project/create/format-elapsed.js +1 -1
  143. package/lib/commands/project/create/main.js +1 -1
  144. package/lib/commands/project/create/non-interactive.js +1 -1
  145. package/lib/commands/project/create/project-template-path.js +1 -1
  146. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  147. package/lib/commands/project/create/use-format-code.js +1 -1
  148. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  149. package/lib/commands/project/index.js +1 -1
  150. package/lib/commands/project/init.js +1 -1
  151. package/lib/commands/project/upgrade.js +1 -1
  152. package/lib/commands/registry.js +1 -1
  153. package/lib/commands/role/create.js +1 -1
  154. package/lib/commands/role/delete.js +1 -1
  155. package/lib/commands/role/detail.js +1 -1
  156. package/lib/commands/role/index.js +1 -1
  157. package/lib/commands/role/list.js +1 -1
  158. package/lib/commands/role/shared.js +1 -1
  159. package/lib/commands/role/update.js +1 -1
  160. package/lib/commands/role/user-add.js +1 -1
  161. package/lib/commands/role/user-remove.js +1 -1
  162. package/lib/commands/role/user-resolve.js +1 -1
  163. package/lib/commands/run/index.js +1 -1
  164. package/lib/commands/schema.js +1 -1
  165. package/lib/commands/sql/create.js +1 -1
  166. package/lib/commands/sql/delete.js +1 -1
  167. package/lib/commands/sql/detail.js +1 -1
  168. package/lib/commands/sql/exec.js +1 -1
  169. package/lib/commands/sql/index.js +1 -1
  170. package/lib/commands/sql/list.js +1 -1
  171. package/lib/commands/sql/pull.js +1 -1
  172. package/lib/commands/sql/push.js +1 -1
  173. package/lib/commands/sql/save.js +1 -1
  174. package/lib/commands/sql/shared.js +1 -1
  175. package/lib/commands/sql/status.js +1 -1
  176. package/lib/commands/sql/validate.js +1 -1
  177. package/lib/commands/task/index.js +1 -1
  178. package/lib/commands/task/status.js +1 -1
  179. package/lib/commands/workspace/add.js +1 -1
  180. package/lib/commands/workspace/index.js +1 -1
  181. package/lib/commands/workspace/remove.js +1 -1
  182. package/lib/config/schema.js +1 -1
  183. package/lib/constant/cdn.js +1 -1
  184. package/lib/constant/cli.js +1 -1
  185. package/lib/constant/defaults.js +1 -1
  186. package/lib/constant/domain.js +1 -1
  187. package/lib/constant/env.js +1 -1
  188. package/lib/constant/output.js +1 -1
  189. package/lib/constant/paths.js +1 -1
  190. package/lib/constant/risk.js +1 -1
  191. package/lib/context/app-resolver.js +1 -1
  192. package/lib/context/auth-resolver.js +1 -1
  193. package/lib/context/config-loader.js +1 -1
  194. package/lib/context.js +1 -1
  195. package/lib/core/alias-resolver.js +1 -1
  196. package/lib/core/api-client.js +1 -1
  197. package/lib/core/bff/config.js +1 -1
  198. package/lib/core/bff/file-system.js +1 -1
  199. package/lib/core/bff/hash.js +1 -1
  200. package/lib/core/bff/lock.js +1 -1
  201. package/lib/core/bff/utils.js +1 -1
  202. package/lib/core/db-resolver.js +1 -1
  203. package/lib/core/page/file-system.js +1 -1
  204. package/lib/core/page/hash.js +1 -1
  205. package/lib/core/page/lock.js +1 -1
  206. package/lib/core/sql-index-auditor.js +1 -1
  207. package/lib/core/sql-sync/config.js +1 -1
  208. package/lib/core/sql-sync/file-system.js +1 -1
  209. package/lib/core/sql-sync/hash.js +1 -1
  210. package/lib/core/sql-sync/lock.js +1 -1
  211. package/lib/core/sql-sync/utils.js +1 -1
  212. package/lib/core/sql-validator.js +1 -1
  213. package/lib/errors.js +1 -1
  214. package/lib/framework/build-all-flags.js +1 -1
  215. package/lib/framework/error-output.js +1 -1
  216. package/lib/framework/explicit-yes.js +1 -1
  217. package/lib/framework/flags.js +1 -1
  218. package/lib/framework/help.js +1 -1
  219. package/lib/framework/index.js +1 -1
  220. package/lib/framework/output.js +1 -1
  221. package/lib/framework/response.js +1 -1
  222. package/lib/framework/runner-alias.js +1 -1
  223. package/lib/framework/runner.js +1 -1
  224. package/lib/framework/schema-export.js +1 -1
  225. package/lib/framework/types.js +1 -1
  226. package/lib/generated/build-info.js +1 -1
  227. package/lib/help.js +1 -1
  228. package/lib/skills/main.js +1 -1
  229. package/lib/skills/npx-skills-add.js +1 -1
  230. package/lib/telemetry/cli-command-trace.js +1 -1
  231. package/lib/telemetry/cli-help-trace.js +1 -1
  232. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  233. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  234. package/lib/telemetry/send-cli-trace-log.js +1 -1
  235. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  236. package/lib/utils/ai_config.js +1 -1
  237. package/lib/utils/apply-jq-filter.js +1 -1
  238. package/lib/utils/cdn-config.js +1 -1
  239. package/lib/utils/check-sdk-version.js +1 -1
  240. package/lib/utils/cli-version-check.js +1 -1
  241. package/lib/utils/cli-version-policy.js +1 -1
  242. package/lib/utils/config.js +1 -1
  243. package/lib/utils/copy-directory.js +1 -1
  244. package/lib/utils/entity-with-id.js +1 -1
  245. package/lib/utils/file-utils.js +1 -1
  246. package/lib/utils/guides-cdn.js +1 -1
  247. package/lib/utils/http-client.js +1 -1
  248. package/lib/utils/is-non-interactive.js +1 -1
  249. package/lib/utils/logger.js +1 -1
  250. package/lib/utils/params.js +1 -1
  251. package/lib/utils/platform.js +1 -1
  252. package/lib/utils/rules-cdn.js +1 -1
  253. package/lib/utils/sleep.js +1 -1
  254. package/lib/utils/template-replacer.js +1 -1
  255. package/lib/utils/update-notice.js +1 -1
  256. package/lib/utils/version.js +1 -1
  257. package/lib/utils/with-active-cookie.js +1 -1
  258. package/lib/utils/write-cli-side-channel.js +1 -1
  259. package/package.json +1 -1
@@ -1 +1 @@
1
- const a136_0x961d7=a136_0x4f28;(function(_0x3ab034,_0x1c91ac){const _0x299162=a136_0x4f28,_0x3ae69d=_0x3ab034();while(!![]){try{const _0x27d99e=parseInt(_0x299162(0xee))/0x1+-parseInt(_0x299162(0xec))/0x2+parseInt(_0x299162(0xfa))/0x3*(parseInt(_0x299162(0xe0))/0x4)+parseInt(_0x299162(0xdc))/0x5+parseInt(_0x299162(0xf2))/0x6*(-parseInt(_0x299162(0xdd))/0x7)+-parseInt(_0x299162(0xdb))/0x8+parseInt(_0x299162(0xf6))/0x9;if(_0x27d99e===_0x1c91ac)break;else _0x3ae69d['push'](_0x3ae69d['shift']());}catch(_0x5db6e8){_0x3ae69d['push'](_0x3ae69d['shift']());}}}(a136_0xe1b2,0xb2388));import{getRoleApiResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a136_0xe1b2(){const _0x2b6f2b=['role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).','Missing\x20--revoke.','get','high-risk-write','permit','Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','POST','length','str','1273478QzisFS','roleName','1219747jjNetY','action','Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.','API','180jcxgKj','Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20','has','set','16578009lwkxho','\x20dataset(s)\x20on\x20role\x20','filter','validation','93018vslnCd','appCode','flagMissing','Revoked\x20API\x20access\x20for\x20','datasets','selector','join','7587008wxUtyd','2508505DUhEwx','312984WymWHp','bool','revoke','12doLwVR','role-apis-set','push'];a136_0xe1b2=function(){return _0x2b6f2b;};return a136_0xe1b2();}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';async function buildPlan(_0x13b74a,_0xc0ae6e){const _0x6bbddf=a136_0x4f28,_0x5135cc=await resolveRoleRef(_0x13b74a['appCode'],readRoleRef(_0x13b74a));assertPermConfigurable(_0x5135cc);if(!_0x13b74a[_0x6bbddf(0xde)](_0x6bbddf(0xdf)))throw CliErrors[_0x6bbddf(0xf9)](_0x6bbddf(0xe4),_0x6bbddf(0xe3));const _0x3f475d=splitList(_0x13b74a[_0x6bbddf(0xeb)](_0x6bbddf(0xfe)));if(_0x3f475d[_0x6bbddf(0xea)]===0x0)throw CliErrors['flagMissing']('datasets','Pass\x20--datasets\x20<datasetCode,...>.');const _0x43d246=await getRoleApiResources(_0x13b74a[_0x6bbddf(0xfb)],_0x5135cc['id']),{byCode:_0xb104a6,byDataset:_0x102338}=flattenApiResources(_0x43d246),_0x4f04ed=_0x3f475d[_0x6bbddf(0xf8)](_0x26590b=>!_0x102338[_0x6bbddf(0xf4)](_0x26590b));if(_0x4f04ed[_0x6bbddf(0xea)]>0x0)throw CliErrors[_0x6bbddf(0xf9)](_0x6bbddf(0xf3)+_0x4f04ed[_0x6bbddf(0xda)](',\x20')+'.',_0x6bbddf(0xf0));const _0x44576d=new Map(),_0x12b9ef=[],_0x42cb48=[];for(const _0x521e80 of _0x3f475d){for(const _0x11592a of _0x102338[_0x6bbddf(0xe5)](_0x521e80)){const _0x4b091a=_0xb104a6[_0x6bbddf(0xe5)](_0x11592a);_0x44576d[_0x6bbddf(0xf5)](_0x11592a,'0'),_0x12b9ef['push']({'resourceCode':_0x11592a,'datasetCode':_0x521e80,'action':_0x4b091a[_0x6bbddf(0xef)]}),_0x42cb48[_0x6bbddf(0xe2)]({'resourceCode':_0x11592a,'datasetCode':_0x521e80,'action':'0'});}}const _0x4f910f=buildPermits(_0xb104a6,_0x44576d),_0x2d4e8f={'operation':'api-revoke','selector':{'appCode':_0x13b74a[_0x6bbddf(0xfb)],'roleId':_0x5135cc['id'],'roleName':_0x5135cc[_0x6bbddf(0xed)],'datasetCodes':_0x3f475d},'before':_0x12b9ef,'after':_0x42cb48,'dryRun':_0xc0ae6e,'backend':{'method':_0x6bbddf(0xe9),'path':UPDATE_PATH,'roleType':_0x6bbddf(0xf1)},'warnings':[]};return{'role':_0x5135cc,'permits':_0x4f910f,'mutation':_0x2d4e8f};}function a136_0x4f28(_0x4caad7,_0x223821){_0x4caad7=_0x4caad7-0xda;const _0xe1b24a=a136_0xe1b2();let _0x4f2893=_0xe1b24a[_0x4caad7];return _0x4f2893;}export const permitRoleApisSet={'service':a136_0x961d7(0xe7),'command':a136_0x961d7(0xe1),'description':a136_0x961d7(0xe8),'risk':a136_0x961d7(0xe6),'flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x999606){const _0x730fdb=a136_0x961d7;if(!_0x999606[_0x730fdb(0xde)](_0x730fdb(0xdf)))throw CliErrors[_0x730fdb(0xf9)](_0x730fdb(0xe4),_0x730fdb(0xe3));if(splitList(_0x999606[_0x730fdb(0xeb)](_0x730fdb(0xfe)))['length']===0x0)throw CliErrors[_0x730fdb(0xfc)]('datasets','Pass\x20--datasets\x20<datasetCode,...>.');},async 'dryRun'(_0x6866e4){const {mutation:_0x19f602}=await buildPlan(_0x6866e4,!![]);return asDryRunResult(_0x19f602,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x3d5fed){const _0x5c98a3=a136_0x961d7,{role:_0x4be395,permits:_0xa30a10,mutation:_0x5b7e46}=await buildPlan(_0x3d5fed,![]);return await updateAppRole({'id':_0x4be395['id'],'appCode':_0x3d5fed[_0x5c98a3(0xfb)],'roleType':_0x5c98a3(0xf1),'permits':_0xa30a10}),{'ok':!![],'data':_0x5b7e46,'message':_0x5c98a3(0xfd)+_0x5b7e46[_0x5c98a3(0xff)]['datasetCodes'][_0x5c98a3(0xea)]+_0x5c98a3(0xf7)+_0x4be395[_0x5c98a3(0xed)]};}};
1
+ const a137_0x59ddf2=a137_0x3178;function a137_0x3cbc(){const _0x369ca1=['revoke','appCode','814174WkWuOS','permit','selector','2817563FYDjqY','Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20','length','datasets','POST','validation','833234quvNlC','1957221dmyYnS','bool','Pass\x20--datasets\x20<datasetCode,...>.','Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.','push','19971100fUjbJY','\x20dataset(s)\x20on\x20role\x20','/smartapi/permit/role/update','filter','has','1181784zLNKAg','flagMissing','get','api-revoke','8ikgTFV','role-apis-set','str','join','roleName','Missing\x20--revoke.','role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).','high-risk-write','Revoked\x20API\x20access\x20for\x20','88CQTHMw','5feEXDg','130365JsLlGA'];a137_0x3cbc=function(){return _0x369ca1;};return a137_0x3cbc();}(function(_0x1085c0,_0x478319){const _0x170371=a137_0x3178,_0x96334d=_0x1085c0();while(!![]){try{const _0x475990=parseInt(_0x170371(0x169))/0x1+parseInt(_0x170371(0x160))/0x2+-parseInt(_0x170371(0x15d))/0x3*(-parseInt(_0x170371(0x15b))/0x4)+-parseInt(_0x170371(0x15c))/0x5*(parseInt(_0x170371(0x14e))/0x6)+parseInt(_0x170371(0x163))/0x7+-parseInt(_0x170371(0x152))/0x8*(-parseInt(_0x170371(0x16a))/0x9)+-parseInt(_0x170371(0x16f))/0xa;if(_0x475990===_0x478319)break;else _0x96334d['push'](_0x96334d['shift']());}catch(_0x9c751e){_0x96334d['push'](_0x96334d['shift']());}}}(a137_0x3cbc,0x97e9b));import{getRoleApiResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a137_0x3178(_0x4646c9,_0x12c9a9){_0x4646c9=_0x4646c9-0x14c;const _0x3cbc2a=a137_0x3cbc();let _0x31785b=_0x3cbc2a[_0x4646c9];return _0x31785b;}import{buildPermits,DATASETS_FLAG,flattenApiResources,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a137_0x59ddf2(0x171);async function buildPlan(_0x499788,_0x3c331c){const _0x124297=a137_0x59ddf2,_0x4b827e=await resolveRoleRef(_0x499788[_0x124297(0x15f)],readRoleRef(_0x499788));assertPermConfigurable(_0x4b827e);if(!_0x499788[_0x124297(0x16b)](_0x124297(0x15e)))throw CliErrors[_0x124297(0x168)](_0x124297(0x157),_0x124297(0x158));const _0xe89e84=splitList(_0x499788[_0x124297(0x154)](_0x124297(0x166)));if(_0xe89e84[_0x124297(0x165)]===0x0)throw CliErrors[_0x124297(0x14f)](_0x124297(0x166),_0x124297(0x16c));const _0x3b2873=await getRoleApiResources(_0x499788[_0x124297(0x15f)],_0x4b827e['id']),{byCode:_0x7a2bb0,byDataset:_0x319526}=flattenApiResources(_0x3b2873),_0x5637e1=_0xe89e84[_0x124297(0x14c)](_0xf612a6=>!_0x319526[_0x124297(0x14d)](_0xf612a6));if(_0x5637e1['length']>0x0)throw CliErrors['validation'](_0x124297(0x164)+_0x5637e1[_0x124297(0x155)](',\x20')+'.',_0x124297(0x16d));const _0x5d5a5a=new Map(),_0x2b5265=[],_0x178245=[];for(const _0x23739b of _0xe89e84){for(const _0x319d4f of _0x319526[_0x124297(0x150)](_0x23739b)){const _0x3e78fb=_0x7a2bb0[_0x124297(0x150)](_0x319d4f);_0x5d5a5a['set'](_0x319d4f,'0'),_0x2b5265['push']({'resourceCode':_0x319d4f,'datasetCode':_0x23739b,'action':_0x3e78fb['action']}),_0x178245[_0x124297(0x16e)]({'resourceCode':_0x319d4f,'datasetCode':_0x23739b,'action':'0'});}}const _0x495426=buildPermits(_0x7a2bb0,_0x5d5a5a),_0x2491f3={'operation':_0x124297(0x151),'selector':{'appCode':_0x499788[_0x124297(0x15f)],'roleId':_0x4b827e['id'],'roleName':_0x4b827e[_0x124297(0x156)],'datasetCodes':_0xe89e84},'before':_0x2b5265,'after':_0x178245,'dryRun':_0x3c331c,'backend':{'method':_0x124297(0x167),'path':UPDATE_PATH,'roleType':'API'},'warnings':[]};return{'role':_0x4b827e,'permits':_0x495426,'mutation':_0x2491f3};}export const permitRoleApisSet={'service':a137_0x59ddf2(0x161),'command':a137_0x59ddf2(0x153),'description':'Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','risk':a137_0x59ddf2(0x159),'flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x6ea9b6){const _0x55174c=a137_0x59ddf2;if(!_0x6ea9b6[_0x55174c(0x16b)](_0x55174c(0x15e)))throw CliErrors[_0x55174c(0x168)](_0x55174c(0x157),_0x55174c(0x158));if(splitList(_0x6ea9b6[_0x55174c(0x154)](_0x55174c(0x166)))[_0x55174c(0x165)]===0x0)throw CliErrors[_0x55174c(0x14f)](_0x55174c(0x166),'Pass\x20--datasets\x20<datasetCode,...>.');},async 'dryRun'(_0x26bc1a){const {mutation:_0x275947}=await buildPlan(_0x26bc1a,!![]);return asDryRunResult(_0x275947,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x28d150){const _0x54e487=a137_0x59ddf2,{role:_0x66a413,permits:_0x2be7c3,mutation:_0x2d7baa}=await buildPlan(_0x28d150,![]);return await updateAppRole({'id':_0x66a413['id'],'appCode':_0x28d150[_0x54e487(0x15f)],'roleType':'API','permits':_0x2be7c3}),{'ok':!![],'data':_0x2d7baa,'message':_0x54e487(0x15a)+_0x2d7baa[_0x54e487(0x162)]['datasetCodes']['length']+_0x54e487(0x170)+_0x66a413[_0x54e487(0x156)]};}};
@@ -1 +1 @@
1
- const a137_0x40f8e9=a137_0x5287;(function(_0x596fc9,_0xdc4706){const _0x372115=a137_0x5287,_0x2cf57c=_0x596fc9();while(!![]){try{const _0x220dbd=parseInt(_0x372115(0x19c))/0x1+-parseInt(_0x372115(0x19e))/0x2*(parseInt(_0x372115(0x17e))/0x3)+parseInt(_0x372115(0x189))/0x4+-parseInt(_0x372115(0x19b))/0x5*(-parseInt(_0x372115(0x17b))/0x6)+-parseInt(_0x372115(0x188))/0x7*(-parseInt(_0x372115(0x18a))/0x8)+-parseInt(_0x372115(0x180))/0x9*(-parseInt(_0x372115(0x192))/0xa)+-parseInt(_0x372115(0x190))/0xb;if(_0x220dbd===_0xdc4706)break;else _0x2cf57c['push'](_0x2cf57c['shift']());}catch(_0x5258ac){_0x2cf57c['push'](_0x2cf57c['shift']());}}}(a137_0x3bd9,0x19cec));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a137_0x5287(_0x4ed761,_0x3ac8ce){_0x4ed761=_0x4ed761-0x17b;const _0x3bd9c0=a137_0x3bd9();let _0x5287b3=_0x3bd9c0[_0x4ed761];return _0x5287b3;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a137_0x40f8e9(0x17f);async function buildPlan(_0x1f0a7a,_0x5e7e8){const _0x28db47=a137_0x40f8e9,_0x4d946c=await resolveRoleRef(_0x1f0a7a[_0x28db47(0x193)],readRoleRef(_0x1f0a7a));assertPermConfigurable(_0x4d946c);const _0x34688b=readGrantRevoke(_0x1f0a7a),_0x4314ff=splitList(_0x1f0a7a['str']('menus'));if(_0x4314ff['length']===0x0)throw CliErrors[_0x28db47(0x18c)](_0x28db47(0x17d),'Pass\x20--menus\x20<resourceCode,...>.');const _0x17e65c=await getRoleMenuResources(_0x1f0a7a[_0x28db47(0x193)],_0x4d946c['id']),_0x5992e2=flattenMenuResources(_0x17e65c),_0x584d0e=_0x4314ff[_0x28db47(0x17c)](_0x2cda6f=>!_0x5992e2[_0x28db47(0x195)](_0x2cda6f));if(_0x584d0e['length']>0x0)throw CliErrors[_0x28db47(0x181)](_0x28db47(0x19f)+_0x584d0e['join'](',\x20')+'.',_0x28db47(0x18e));const _0x26261b=new Map(),_0x29cc82=[],_0x2692fe=[];for(const _0x561830 of _0x4314ff){const _0x2e686c=_0x5992e2[_0x28db47(0x18d)](_0x561830);_0x26261b['set'](_0x561830,_0x34688b),_0x29cc82[_0x28db47(0x182)]({'resourceCode':_0x561830,'action':_0x2e686c[_0x28db47(0x19a)]}),_0x2692fe[_0x28db47(0x182)]({'resourceCode':_0x561830,'action':_0x34688b});}const _0x2b368f=buildPermits(_0x5992e2,_0x26261b),_0x153a64={'operation':_0x34688b===_0x28db47(0x184)?_0x28db47(0x186):_0x28db47(0x18f),'selector':{'appCode':_0x1f0a7a[_0x28db47(0x193)],'roleId':_0x4d946c['id'],'roleName':_0x4d946c[_0x28db47(0x191)],'resourceCodes':_0x4314ff},'before':_0x29cc82,'after':_0x2692fe,'dryRun':_0x5e7e8,'backend':{'method':_0x28db47(0x185),'path':UPDATE_PATH,'roleType':_0x28db47(0x187)},'warnings':[]};return{'role':_0x4d946c,'permits':_0x2b368f,'mutation':_0x153a64};}export const permitRoleMenusSet={'service':a137_0x40f8e9(0x19d),'command':a137_0x40f8e9(0x18b),'description':a137_0x40f8e9(0x198),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x59dbf7){const _0x5379dc=a137_0x40f8e9;readGrantRevoke(_0x59dbf7);if(splitList(_0x59dbf7['str'](_0x5379dc(0x17d)))[_0x5379dc(0x199)]===0x0)throw CliErrors[_0x5379dc(0x18c)](_0x5379dc(0x17d),_0x5379dc(0x196));},async 'dryRun'(_0x265427){const _0x330156=a137_0x40f8e9,{mutation:_0x17f5b4}=await buildPlan(_0x265427,!![]);return asDryRunResult(_0x17f5b4,{'method':_0x330156(0x185),'url':UPDATE_PATH});},async 'execute'(_0x33f4df){const _0x66b34a=a137_0x40f8e9,{role:_0x3cc572,permits:_0x2cee14,mutation:_0xb9e97}=await buildPlan(_0x33f4df,![]);return await updateAppRole({'id':_0x3cc572['id'],'appCode':_0x33f4df[_0x66b34a(0x193)],'roleType':_0x66b34a(0x187),'permits':_0x2cee14}),{'ok':!![],'data':_0xb9e97,'message':_0x66b34a(0x197)+_0xb9e97['selector'][_0x66b34a(0x183)][_0x66b34a(0x199)]+_0x66b34a(0x194)+_0x3cc572[_0x66b34a(0x191)]};}};function a137_0x3bd9(){const _0x231d46=['validation','push','resourceCodes','access','POST','menu-grant','PAGE','7OkgNzt','189992WAiHRw','135176zdYmzD','role-menus-set','flagMissing','get','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','menu-revoke','4214430DFKaDM','roleName','50uZaLCS','appCode','\x20menu\x20permit(s)\x20for\x20role\x20','has','Pass\x20--menus\x20<resourceCode,...>.','Updated\x20','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','length','action','5jKkhHm','118357IaaOxv','permit','978BgOgeA','Unknown\x20menu\x20resourceCode(s):\x20','1062162pqVQHI','filter','menus','117csWhYx','/smartapi/permit/role/update','266634boszEt'];a137_0x3bd9=function(){return _0x231d46;};return a137_0x3bd9();}
1
+ const a138_0x44fc09=a138_0xf3a9;(function(_0x383618,_0x1eb35b){const _0x36a8e5=a138_0xf3a9,_0x52e46e=_0x383618();while(!![]){try{const _0x125be7=parseInt(_0x36a8e5(0xe0))/0x1*(parseInt(_0x36a8e5(0xf3))/0x2)+parseInt(_0x36a8e5(0xed))/0x3+-parseInt(_0x36a8e5(0xdf))/0x4+parseInt(_0x36a8e5(0xf4))/0x5*(parseInt(_0x36a8e5(0xf1))/0x6)+-parseInt(_0x36a8e5(0xf6))/0x7*(-parseInt(_0x36a8e5(0xf2))/0x8)+-parseInt(_0x36a8e5(0xf7))/0x9+parseInt(_0x36a8e5(0xfb))/0xa;if(_0x125be7===_0x1eb35b)break;else _0x52e46e['push'](_0x52e46e['shift']());}catch(_0x40cd8c){_0x52e46e['push'](_0x52e46e['shift']());}}}(a138_0x18a0,0x41e6e));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a138_0xf3a9(_0x1743b3,_0x34b698){_0x1743b3=_0x1743b3-0xdf;const _0x18a093=a138_0x18a0();let _0xf3a92a=_0x18a093[_0x1743b3];return _0xf3a92a;}import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';function a138_0x18a0(){const _0xbaef5c=['validation','14604ECkASX','2585720TFnetu','58COnllo','40GapPeE','length','7inDKMZ','4051989mmXmKR','str','menu-grant','POST','2142060PUhdki','1631648YaEbYG','4003bjKEKq','flagMissing','Updated\x20','roleName','Pass\x20--menus\x20<resourceCode,...>.','join','menus','permit','push','menu-revoke','appCode','PAGE','filter','1365261bPqGeF','/smartapi/permit/role/update','Unknown\x20menu\x20resourceCode(s):\x20'];a138_0x18a0=function(){return _0xbaef5c;};return a138_0x18a0();}const UPDATE_PATH=a138_0x44fc09(0xee);async function buildPlan(_0x298139,_0x593741){const _0x1c22dc=a138_0x44fc09,_0x490d66=await resolveRoleRef(_0x298139['appCode'],readRoleRef(_0x298139));assertPermConfigurable(_0x490d66);const _0x4643a6=readGrantRevoke(_0x298139),_0x56891f=splitList(_0x298139[_0x1c22dc(0xf8)](_0x1c22dc(0xe6)));if(_0x56891f[_0x1c22dc(0xf5)]===0x0)throw CliErrors[_0x1c22dc(0xe1)](_0x1c22dc(0xe6),_0x1c22dc(0xe4));const _0x39e52c=await getRoleMenuResources(_0x298139[_0x1c22dc(0xea)],_0x490d66['id']),_0x44ac7c=flattenMenuResources(_0x39e52c),_0x360f4f=_0x56891f[_0x1c22dc(0xec)](_0x4ba004=>!_0x44ac7c['has'](_0x4ba004));if(_0x360f4f['length']>0x0)throw CliErrors[_0x1c22dc(0xf0)](_0x1c22dc(0xef)+_0x360f4f[_0x1c22dc(0xe5)](',\x20')+'.','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.');const _0x4b5bab=new Map(),_0x3eb1a5=[],_0x54787d=[];for(const _0x2ce3ac of _0x56891f){const _0x2c1059=_0x44ac7c['get'](_0x2ce3ac);_0x4b5bab['set'](_0x2ce3ac,_0x4643a6),_0x3eb1a5[_0x1c22dc(0xe8)]({'resourceCode':_0x2ce3ac,'action':_0x2c1059['action']}),_0x54787d[_0x1c22dc(0xe8)]({'resourceCode':_0x2ce3ac,'action':_0x4643a6});}const _0xa5ae8b=buildPermits(_0x44ac7c,_0x4b5bab),_0x4f7af0={'operation':_0x4643a6==='access'?_0x1c22dc(0xf9):_0x1c22dc(0xe9),'selector':{'appCode':_0x298139[_0x1c22dc(0xea)],'roleId':_0x490d66['id'],'roleName':_0x490d66[_0x1c22dc(0xe3)],'resourceCodes':_0x56891f},'before':_0x3eb1a5,'after':_0x54787d,'dryRun':_0x593741,'backend':{'method':_0x1c22dc(0xfa),'path':UPDATE_PATH,'roleType':_0x1c22dc(0xeb)},'warnings':[]};return{'role':_0x490d66,'permits':_0xa5ae8b,'mutation':_0x4f7af0};}export const permitRoleMenusSet={'service':a138_0x44fc09(0xe7),'command':'role-menus-set','description':'Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3e957c){const _0x404468=a138_0x44fc09;readGrantRevoke(_0x3e957c);if(splitList(_0x3e957c[_0x404468(0xf8)](_0x404468(0xe6)))[_0x404468(0xf5)]===0x0)throw CliErrors['flagMissing'](_0x404468(0xe6),_0x404468(0xe4));},async 'dryRun'(_0x225553){const {mutation:_0x4cd626}=await buildPlan(_0x225553,!![]);return asDryRunResult(_0x4cd626,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x5a51ef){const _0x259e7c=a138_0x44fc09,{role:_0x32030e,permits:_0x3fd172,mutation:_0x214e87}=await buildPlan(_0x5a51ef,![]);return await updateAppRole({'id':_0x32030e['id'],'appCode':_0x5a51ef[_0x259e7c(0xea)],'roleType':'PAGE','permits':_0x3fd172}),{'ok':!![],'data':_0x214e87,'message':_0x259e7c(0xe2)+_0x214e87['selector']['resourceCodes'][_0x259e7c(0xf5)]+'\x20menu\x20permit(s)\x20for\x20role\x20'+_0x32030e[_0x259e7c(0xe3)]};}};
@@ -1 +1 @@
1
- const a138_0x4fa62c=a138_0x3b99;(function(_0x70432e,_0x53393a){const _0x459552=a138_0x3b99,_0x18d3b6=_0x70432e();while(!![]){try{const _0x2ce3bf=parseInt(_0x459552(0xa3))/0x1*(-parseInt(_0x459552(0xa4))/0x2)+-parseInt(_0x459552(0x9d))/0x3+parseInt(_0x459552(0xa9))/0x4+parseInt(_0x459552(0xa8))/0x5+parseInt(_0x459552(0x96))/0x6*(parseInt(_0x459552(0xaa))/0x7)+parseInt(_0x459552(0xa5))/0x8+-parseInt(_0x459552(0x93))/0x9;if(_0x2ce3bf===_0x53393a)break;else _0x18d3b6['push'](_0x18d3b6['shift']());}catch(_0x95f670){_0x18d3b6['push'](_0x18d3b6['shift']());}}}(a138_0x3732,0x4b98d));import{getRoleMenuResources}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{flattenMenuResources,readRoleRef,ROLE_REF_FLAG}from'../../commands/permit/shared.js';function a138_0x3b99(_0x296f7e,_0x5f41bd){_0x296f7e=_0x296f7e-0x93;const _0x3732d2=a138_0x3732();let _0x3b994f=_0x3732d2[_0x296f7e];return _0x3b994f;}import{resolveRoleRef}from'../../commands/role/shared.js';function a138_0x3732(){const _0x3f73f8=['resourceCode','2255005aEohvh','1208784nfbSAh','1585647vaqKxo','4290480dPBWDA','filter','from','12zircSK','length','access','\x20has\x20','roleName','action','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','922329iqPPRJ','Role\x20','appCode','read','\x20menu(s)\x20allowed','map','54596UhBBcu','6IOhmQc','410856DEFYAu','allowed'];a138_0x3732=function(){return _0x3f73f8;};return a138_0x3732();}export const permitRoleMenus={'service':'permit','command':'role-menus','description':a138_0x4fa62c(0x9c),'risk':a138_0x4fa62c(0xa0),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x15ff4a){const _0x4b1729=a138_0x4fa62c,_0x74d2ad=await resolveRoleRef(_0x15ff4a[_0x4b1729(0x9f)],readRoleRef(_0x15ff4a)),_0x1f7661=await getRoleMenuResources(_0x15ff4a[_0x4b1729(0x9f)],_0x74d2ad['id']),_0x583ac0=flattenMenuResources(_0x1f7661),_0x199b78=Array[_0x4b1729(0x95)](_0x583ac0['values']())[_0x4b1729(0xa2)](_0x186e90=>({'resourceCode':_0x186e90[_0x4b1729(0xa7)],'resourceName':_0x186e90['resourceName'],'allowed':_0x186e90[_0x4b1729(0x9b)]===_0x4b1729(0x98),'action':_0x186e90[_0x4b1729(0x9b)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x15ff4a['appCode'],'roleId':_0x74d2ad['id'],'roleName':_0x74d2ad[_0x4b1729(0x9a)]},'menus':_0x199b78},'message':_0x4b1729(0x9e)+_0x74d2ad[_0x4b1729(0x9a)]+_0x4b1729(0x99)+_0x199b78[_0x4b1729(0x94)](_0x34cc59=>_0x34cc59[_0x4b1729(0xa6)])['length']+'/'+_0x199b78[_0x4b1729(0x97)]+_0x4b1729(0xa1)};}};
1
+ const a139_0x1e59b9=a139_0x3684;(function(_0x119628,_0x4d4240){const _0x1d620f=a139_0x3684,_0x524449=_0x119628();while(!![]){try{const _0x15c270=-parseInt(_0x1d620f(0x168))/0x1*(-parseInt(_0x1d620f(0x174))/0x2)+parseInt(_0x1d620f(0x16e))/0x3+-parseInt(_0x1d620f(0x162))/0x4+parseInt(_0x1d620f(0x173))/0x5+-parseInt(_0x1d620f(0x176))/0x6*(-parseInt(_0x1d620f(0x171))/0x7)+parseInt(_0x1d620f(0x16f))/0x8*(parseInt(_0x1d620f(0x166))/0x9)+parseInt(_0x1d620f(0x16c))/0xa*(-parseInt(_0x1d620f(0x16d))/0xb);if(_0x15c270===_0x4d4240)break;else _0x524449['push'](_0x524449['shift']());}catch(_0x3dfb69){_0x524449['push'](_0x524449['shift']());}}}(a139_0x6293,0x2bbef));import{getRoleMenuResources}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{flattenMenuResources,readRoleRef,ROLE_REF_FLAG}from'../../commands/permit/shared.js';function a139_0x6293(){const _0x9f633=['1334808QOrGON','read','7OwOOYJ','access','1180880xiVCEm','2fojTRt','action','1381746BbydgW','allowed','resourceName','values','map','permit','appCode','572188HaeIWC','filter','length','role-menus','18eKPPbe','\x20has\x20','307841NKFFxW','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','roleName','Role\x20','80UxeUxC','1213663UQdFQw','290652OcjVIZ'];a139_0x6293=function(){return _0x9f633;};return a139_0x6293();}function a139_0x3684(_0x4718aa,_0x56f658){_0x4718aa=_0x4718aa-0x162;const _0x629318=a139_0x6293();let _0x368479=_0x629318[_0x4718aa];return _0x368479;}import{resolveRoleRef}from'../../commands/role/shared.js';export const permitRoleMenus={'service':a139_0x1e59b9(0x17b),'command':a139_0x1e59b9(0x165),'description':a139_0x1e59b9(0x169),'risk':a139_0x1e59b9(0x170),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x243450){const _0x137520=a139_0x1e59b9,_0x54c857=await resolveRoleRef(_0x243450[_0x137520(0x17c)],readRoleRef(_0x243450)),_0xb79c2e=await getRoleMenuResources(_0x243450[_0x137520(0x17c)],_0x54c857['id']),_0x25731c=flattenMenuResources(_0xb79c2e),_0x3ed4ce=Array['from'](_0x25731c[_0x137520(0x179)]())[_0x137520(0x17a)](_0x296207=>({'resourceCode':_0x296207['resourceCode'],'resourceName':_0x296207[_0x137520(0x178)],'allowed':_0x296207[_0x137520(0x175)]===_0x137520(0x172),'action':_0x296207[_0x137520(0x175)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x243450['appCode'],'roleId':_0x54c857['id'],'roleName':_0x54c857['roleName']},'menus':_0x3ed4ce},'message':_0x137520(0x16b)+_0x54c857[_0x137520(0x16a)]+_0x137520(0x167)+_0x3ed4ce[_0x137520(0x163)](_0x2f91fa=>_0x2f91fa[_0x137520(0x177)])[_0x137520(0x164)]+'/'+_0x3ed4ce[_0x137520(0x164)]+'\x20menu(s)\x20allowed'};}};
@@ -1 +1 @@
1
- const a139_0x132a8c=a139_0x9be5;(function(_0x212423,_0x1dd80e){const _0x10d460=a139_0x9be5,_0x119592=_0x212423();while(!![]){try{const _0x4e5bc9=-parseInt(_0x10d460(0x186))/0x1+parseInt(_0x10d460(0x162))/0x2*(-parseInt(_0x10d460(0x16d))/0x3)+-parseInt(_0x10d460(0x1a2))/0x4+parseInt(_0x10d460(0x1a6))/0x5+parseInt(_0x10d460(0x17b))/0x6+parseInt(_0x10d460(0x16e))/0x7*(parseInt(_0x10d460(0x15f))/0x8)+-parseInt(_0x10d460(0x173))/0x9*(-parseInt(_0x10d460(0x18d))/0xa);if(_0x4e5bc9===_0x1dd80e)break;else _0x119592['push'](_0x119592['shift']());}catch(_0x185979){_0x119592['push'](_0x119592['shift']());}}}(a139_0x288a,0x29931));import{listPermitRoles}from'../../core/api-client.js';function a139_0x9be5(_0x1e5d07,_0x36baa1){_0x1e5d07=_0x1e5d07-0x15d;const _0x288af8=a139_0x288a();let _0x9be578=_0x288af8[_0x1e5d07];return _0x9be578;}import{CliErrors}from'../../errors.js';function a139_0x288a(){const _0x3e5835=['apiList','306388gdyPTO','ALL','menu-id','find','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','str','Run\x20`role\x20list`.','10pXJGsg','validation','data\x20update','detail-roles','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','bool','trim','dataCreate','rolePermit','Role\x20\x22',';\x20SELF\x20=\x20only\x20own\x20rows','data\x20delete','\x22\x20not\x20found.','pageNodeList','Pass\x20--role\x20<id|name>.','test','Grant\x20access\x20to\x20the\x20listed\x20resources','dataUpdate','split','flag','key','817696yqZNNx','map','row-roles','length','1368835AifqPF','role','menuPermit','roleType','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','menu\x20visibility','Menu\x20id\x20(from\x20`menu\x20list`)','access','SELF','menu-roles','number','resourceCode','dataPermit','Special\x20role\x20','8DCqhwp','datasets','create-roles','36454NcOdex','revoke','datasetCode','set','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','\x20not\x20found.','Role\x20id\x20','label','Disambiguate\x20with\x20an\x20id.','action','toUpperCase','51jnUdgX','437983oGMScj','resourceName','boolean','string','delete-roles','5075208xsBkHL','SELF\x20is\x20not\x20allowed\x20for\x20','update-roles','grant','allowedActions','appCode','export-roles','filter','544272izKHcU','menuId','Missing\x20action.','Role\x20id\x20or\x20role\x20name','entries','roleName','data\x20create','dataExport','dataDetail','get'];a139_0x288a=function(){return _0x3e5835;};return a139_0x288a();}export const MENU_ID_FLAG={'name':a139_0x132a8c(0x188),'type':a139_0x132a8c(0x1b0),'required':!![],'description':a139_0x132a8c(0x1ac)};export const ROLE_REF_FLAG={'name':'role','type':a139_0x132a8c(0x171),'required':!![],'description':a139_0x132a8c(0x17e)};export const GRANT_FLAG={'name':a139_0x132a8c(0x176),'type':'boolean','required':![],'description':a139_0x132a8c(0x19d)};export const REVOKE_FLAG={'name':'revoke','type':a139_0x132a8c(0x170),'required':![],'description':'Revoke\x20access\x20to\x20the\x20listed\x20resources'};export const MENUS_FLAG={'name':'menus','type':a139_0x132a8c(0x171),'required':!![],'description':a139_0x132a8c(0x166)};export const DATASETS_FLAG={'name':a139_0x132a8c(0x160),'type':a139_0x132a8c(0x171),'required':!![],'description':a139_0x132a8c(0x1aa)};export const PAGE_SLOT_SPECS=[{'flag':a139_0x132a8c(0x1af),'key':a139_0x132a8c(0x1a8),'allowSelf':![],'label':a139_0x132a8c(0x1ab)},{'flag':a139_0x132a8c(0x161),'key':a139_0x132a8c(0x194),'allowSelf':![],'label':a139_0x132a8c(0x181)},{'flag':a139_0x132a8c(0x175),'key':a139_0x132a8c(0x19e),'allowSelf':![],'label':a139_0x132a8c(0x18f)},{'flag':a139_0x132a8c(0x172),'key':'dataDelete','allowSelf':![],'label':a139_0x132a8c(0x198)},{'flag':a139_0x132a8c(0x190),'key':a139_0x132a8c(0x183),'allowSelf':![],'label':'data\x20detail'},{'flag':a139_0x132a8c(0x179),'key':a139_0x132a8c(0x182),'allowSelf':![],'label':'data\x20export'},{'flag':a139_0x132a8c(0x1a4),'key':a139_0x132a8c(0x15d),'allowSelf':!![],'label':'row\x20visibility'}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a139_0x132a8c(0x1a3)](_0x15dfcc=>({'name':_0x15dfcc[a139_0x132a8c(0x1a0)],'type':a139_0x132a8c(0x171),'required':![],'description':'Roles\x20for\x20'+_0x15dfcc[a139_0x132a8c(0x169)]+'\x20(comma-separated\x20SELF/ALL/id/name)'+(_0x15dfcc['allowSelf']?a139_0x132a8c(0x197):'')}));export function splitList(_0x5c049d){const _0x38fc2d=a139_0x132a8c;return _0x5c049d[_0x38fc2d(0x19f)](',')[_0x38fc2d(0x1a3)](_0x443646=>_0x443646['trim']())[_0x38fc2d(0x17a)](Boolean);}export function projectRoleRef(_0xbec2d1){const _0x5bc6d7=a139_0x132a8c;return{'id':_0xbec2d1['id'],'roleName':_0xbec2d1[_0x5bc6d7(0x180)],'roleType':_0xbec2d1['roleType']};}export async function resolvePermitRoles(_0x321e4c,_0x3a8b1a,_0x4c0f1c){const _0x44616f=a139_0x132a8c,_0x562f40=await listPermitRoles(_0x321e4c,{'needSelf':!![],'needPublic':!![]}),_0x4d3d59=[];for(const _0x5e6aed of _0x3a8b1a){const _0x1b37e5=resolveOnePermitRole(_0x562f40,_0x5e6aed);if(!_0x4c0f1c['allowSelf']&&_0x1b37e5['roleType']===_0x44616f(0x1ae))throw CliErrors[_0x44616f(0x18e)](_0x44616f(0x174)+_0x4c0f1c['label']+'.',_0x44616f(0x191));if(!_0x4d3d59['some'](_0x3baac7=>_0x3baac7['id']===_0x1b37e5['id']))_0x4d3d59['push'](_0x1b37e5);}return _0x4d3d59;}function resolveOnePermitRole(_0x20c12d,_0x1dd911){const _0x83aa8d=a139_0x132a8c,_0x42eb4a=_0x1dd911[_0x83aa8d(0x193)](),_0x1736e5=_0x42eb4a[_0x83aa8d(0x16c)]();if(_0x1736e5===_0x83aa8d(0x1ae)||_0x1736e5===_0x83aa8d(0x187)){const _0x2d3f1e=_0x20c12d[_0x83aa8d(0x189)](_0x5450de=>_0x5450de[_0x83aa8d(0x1a9)]===_0x1736e5);if(!_0x2d3f1e)throw CliErrors['validation'](_0x83aa8d(0x15e)+_0x1736e5+'\x20is\x20not\x20available\x20for\x20this\x20app.');return _0x2d3f1e;}if(/^-?\d+$/[_0x83aa8d(0x19c)](_0x42eb4a)){const _0x4c0c69=Number(_0x42eb4a),_0x29d8a0=_0x20c12d['find'](_0x3fc1ff=>_0x3fc1ff['id']===_0x4c0c69);if(!_0x29d8a0)throw CliErrors[_0x83aa8d(0x18e)](_0x83aa8d(0x168)+_0x4c0c69+_0x83aa8d(0x167),_0x83aa8d(0x18c));return _0x29d8a0;}const _0x3e054a=_0x20c12d['filter'](_0x345a77=>_0x345a77[_0x83aa8d(0x180)]===_0x42eb4a);if(_0x3e054a[_0x83aa8d(0x1a5)]===0x0)throw CliErrors[_0x83aa8d(0x18e)](_0x83aa8d(0x196)+_0x42eb4a+_0x83aa8d(0x199),'Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.');if(_0x3e054a[_0x83aa8d(0x1a5)]>0x1)throw CliErrors[_0x83aa8d(0x18e)]('Role\x20\x22'+_0x42eb4a+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x3e054a[_0x83aa8d(0x1a3)](_0x128c92=>_0x128c92['id'])['join'](',\x20')+').',_0x83aa8d(0x16a));return _0x3e054a[0x0];}export function projectPageSlot(_0x471481){const _0x3ca6dd=a139_0x132a8c;if(!_0x471481)return null;return{'resourceCode':_0x471481[_0x3ca6dd(0x1b1)],'roles':(_0x471481[_0x3ca6dd(0x195)]??[])[_0x3ca6dd(0x1a3)](projectRoleRef)};}export function projectPagePermit(_0x47f66e){const _0xd1f568=a139_0x132a8c,_0x4a807e={'menuId':_0x47f66e[_0xd1f568(0x17c)],'appCode':_0x47f66e[_0xd1f568(0x178)],'menuPermit':projectPageSlot(_0x47f66e['menuPermit'])};for(const _0x1bab09 of PAGE_SLOT_SPECS){if(_0x1bab09[_0xd1f568(0x1a1)]==='menuPermit')continue;_0x4a807e[_0x1bab09[_0xd1f568(0x1a1)]]=projectPageSlot(_0x47f66e[_0x1bab09[_0xd1f568(0x1a1)]]);}return _0x4a807e;}export function flattenMenuResources(_0x4b8655){const _0x3c6d52=new Map(),_0x73145d=_0x1001aa=>{const _0x4a07e1=a139_0x9be5;for(const _0x15b996 of _0x1001aa??[]){_0x3c6d52[_0x4a07e1(0x165)](_0x15b996[_0x4a07e1(0x1b1)],{'resourceCode':_0x15b996[_0x4a07e1(0x1b1)],'resourceName':_0x15b996[_0x4a07e1(0x16f)],'action':_0x15b996[_0x4a07e1(0x177)]?.[0x0]??'0'});if(_0x15b996['pageNodeList'])_0x73145d(_0x15b996[_0x4a07e1(0x19a)]);}};return _0x73145d(_0x4b8655),_0x3c6d52;}export function flattenApiResources(_0x5da6ae){const _0x393306=a139_0x132a8c,_0x1cbe11=new Map(),_0x358adf=new Map();for(const _0x23800a of _0x5da6ae){const _0x452b94=_0x23800a[_0x393306(0x185)]??{};for(const [_0x417827,_0x2b6301]of Object[_0x393306(0x17f)](_0x452b94)){_0x1cbe11[_0x393306(0x165)](_0x417827,{'resourceCode':_0x417827,'resourceName':_0x23800a[_0x393306(0x16f)],'datasetCode':_0x23800a['datasetCode'],'action':_0x2b6301?.[0x0]??'0'});const _0x570b34=_0x358adf[_0x393306(0x184)](_0x23800a[_0x393306(0x164)])??[];_0x570b34['push'](_0x417827),_0x358adf['set'](_0x23800a[_0x393306(0x164)],_0x570b34);}}return{'byCode':_0x1cbe11,'byDataset':_0x358adf};}export function buildPermits(_0xbef186,_0x28cc41){const _0x5ba8a6=a139_0x132a8c,_0x258d60={};for(const [_0x12bdc2,_0x5a8658]of _0xbef186){const _0x24c57a=_0x28cc41[_0x5ba8a6(0x184)](_0x12bdc2)??_0x5a8658[_0x5ba8a6(0x16b)];_0x258d60[_0x12bdc2]=[_0x24c57a];}return _0x258d60;}export function readRoleRef(_0x3c8a98){const _0x32ac66=a139_0x132a8c,_0x47e389=_0x3c8a98[_0x32ac66(0x18b)](_0x32ac66(0x1a7))[_0x32ac66(0x193)]();if(!_0x47e389)throw CliErrors['flagMissing']('role',_0x32ac66(0x19b));return _0x47e389;}export function readGrantRevoke(_0x58d5ec){const _0x143891=a139_0x132a8c,_0x5be499=_0x58d5ec[_0x143891(0x192)]('grant'),_0x247760=_0x58d5ec[_0x143891(0x192)](_0x143891(0x163));if(_0x5be499&&_0x247760)throw CliErrors['validation'](_0x143891(0x18a));if(!_0x5be499&&!_0x247760)throw CliErrors[_0x143891(0x18e)](_0x143891(0x17d),'Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.');return _0x5be499?_0x143891(0x1ad):'0';}
1
+ const a140_0x44dbb7=a140_0x1b88;function a140_0x2014(){const _0x5449ab=['delete-roles','menu\x20visibility','3465412PfdBvf','Role\x20id\x20or\x20role\x20name','datasets','length','bool','roleType','menu-id','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','21kumwBD','allowedActions','set','dataUpdate','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.',';\x20SELF\x20=\x20only\x20own\x20rows','data\x20create','filter','role','some','action','entries','trim','find','data\x20detail','apiList','rolePermit','5652360zzlQvC','data\x20export','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','revoke','SELF\x20is\x20not\x20allowed\x20for\x20','data\x20delete','join','create-roles','2969232BzVouZ','ALL','menu-roles','menuPermit','Role\x20id\x20','Special\x20role\x20','118734avYmIA','key','split','map','110osaZWg','test','Missing\x20action.','appCode','datasetCode','str','push','\x22\x20not\x20found.','\x20(comma-separated\x20SELF/ALL/id/name)','dataDetail','flagMissing','resourceName','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','228882iPrDgN','access','SELF','pageNodeList','roleName','resourceCode','number','grant','string','menus','Run\x20`role\x20list`.','\x22\x20is\x20ambiguous\x20(ids:\x20','boolean','allowSelf','Disambiguate\x20with\x20an\x20id.','330190JuRglC','dataCreate','dataDelete','Menu\x20id\x20(from\x20`menu\x20list`)','\x20not\x20found.','validation','detail-roles','export-roles','1326288TtXhzv','get'];a140_0x2014=function(){return _0x5449ab;};return a140_0x2014();}(function(_0x5ad67a,_0x3d251c){const _0x12a49f=a140_0x1b88,_0xc3ec89=_0x5ad67a();while(!![]){try{const _0xd6d572=-parseInt(_0x12a49f(0x198))/0x1+-parseInt(_0x12a49f(0x164))/0x2+-parseInt(_0x12a49f(0x16c))/0x3+-parseInt(_0x12a49f(0x170))/0x4+parseInt(_0x12a49f(0x19c))/0x5*(parseInt(_0x12a49f(0x155))/0x6)+-parseInt(_0x12a49f(0x178))/0x7*(-parseInt(_0x12a49f(0x192))/0x8)+parseInt(_0x12a49f(0x18a))/0x9;if(_0xd6d572===_0x3d251c)break;else _0xc3ec89['push'](_0xc3ec89['shift']());}catch(_0xcd83d7){_0xc3ec89['push'](_0xc3ec89['shift']());}}}(a140_0x2014,0xf152a));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a140_0x44dbb7(0x176),'type':a140_0x44dbb7(0x15b),'required':!![],'description':a140_0x44dbb7(0x167)};export const ROLE_REF_FLAG={'name':a140_0x44dbb7(0x181),'type':a140_0x44dbb7(0x15d),'required':!![],'description':a140_0x44dbb7(0x171)};export const GRANT_FLAG={'name':a140_0x44dbb7(0x15c),'type':a140_0x44dbb7(0x161),'required':![],'description':'Grant\x20access\x20to\x20the\x20listed\x20resources'};export const REVOKE_FLAG={'name':'revoke','type':a140_0x44dbb7(0x161),'required':![],'description':'Revoke\x20access\x20to\x20the\x20listed\x20resources'};export const MENUS_FLAG={'name':a140_0x44dbb7(0x15e),'type':'string','required':!![],'description':'Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke'};export const DATASETS_FLAG={'name':a140_0x44dbb7(0x172),'type':a140_0x44dbb7(0x15d),'required':!![],'description':a140_0x44dbb7(0x154)};export const PAGE_SLOT_SPECS=[{'flag':a140_0x44dbb7(0x194),'key':a140_0x44dbb7(0x195),'allowSelf':![],'label':a140_0x44dbb7(0x16f)},{'flag':a140_0x44dbb7(0x191),'key':a140_0x44dbb7(0x165),'allowSelf':![],'label':a140_0x44dbb7(0x17f)},{'flag':'update-roles','key':a140_0x44dbb7(0x17b),'allowSelf':![],'label':'data\x20update'},{'flag':a140_0x44dbb7(0x16e),'key':a140_0x44dbb7(0x166),'allowSelf':![],'label':a140_0x44dbb7(0x18f)},{'flag':a140_0x44dbb7(0x16a),'key':a140_0x44dbb7(0x151),'allowSelf':![],'label':a140_0x44dbb7(0x187)},{'flag':a140_0x44dbb7(0x16b),'key':'dataExport','allowSelf':![],'label':a140_0x44dbb7(0x18b)},{'flag':'row-roles','key':'dataPermit','allowSelf':!![],'label':'row\x20visibility'}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a140_0x44dbb7(0x19b)](_0x33c879=>({'name':_0x33c879['flag'],'type':a140_0x44dbb7(0x15d),'required':![],'description':'Roles\x20for\x20'+_0x33c879['label']+a140_0x44dbb7(0x150)+(_0x33c879[a140_0x44dbb7(0x162)]?a140_0x44dbb7(0x17e):'')}));export function splitList(_0x5b0522){const _0x505c30=a140_0x44dbb7;return _0x5b0522[_0x505c30(0x19a)](',')[_0x505c30(0x19b)](_0x23b847=>_0x23b847[_0x505c30(0x185)]())[_0x505c30(0x180)](Boolean);}export function projectRoleRef(_0x50827a){const _0x3c9234=a140_0x44dbb7;return{'id':_0x50827a['id'],'roleName':_0x50827a[_0x3c9234(0x159)],'roleType':_0x50827a['roleType']};}export async function resolvePermitRoles(_0x3b0061,_0x19e0c6,_0x1b512d){const _0x4329c4=a140_0x44dbb7,_0x28f37f=await listPermitRoles(_0x3b0061,{'needSelf':!![],'needPublic':!![]}),_0x45138f=[];for(const _0x5caa7a of _0x19e0c6){const _0x4a6a58=resolveOnePermitRole(_0x28f37f,_0x5caa7a);if(!_0x1b512d[_0x4329c4(0x162)]&&_0x4a6a58[_0x4329c4(0x175)]===_0x4329c4(0x157))throw CliErrors['validation'](_0x4329c4(0x18e)+_0x1b512d['label']+'.',_0x4329c4(0x17c));if(!_0x45138f[_0x4329c4(0x182)](_0x2d1e81=>_0x2d1e81['id']===_0x4a6a58['id']))_0x45138f[_0x4329c4(0x14e)](_0x4a6a58);}return _0x45138f;}function resolveOnePermitRole(_0x24701e,_0x111009){const _0x55972b=a140_0x44dbb7,_0x21199c=_0x111009[_0x55972b(0x185)](),_0x1a0203=_0x21199c['toUpperCase']();if(_0x1a0203===_0x55972b(0x157)||_0x1a0203===_0x55972b(0x193)){const _0x2c42c3=_0x24701e['find'](_0x203015=>_0x203015[_0x55972b(0x175)]===_0x1a0203);if(!_0x2c42c3)throw CliErrors[_0x55972b(0x169)](_0x55972b(0x197)+_0x1a0203+'\x20is\x20not\x20available\x20for\x20this\x20app.');return _0x2c42c3;}if(/^-?\d+$/[_0x55972b(0x19d)](_0x21199c)){const _0x4cab19=Number(_0x21199c),_0x41ad1c=_0x24701e[_0x55972b(0x186)](_0x581008=>_0x581008['id']===_0x4cab19);if(!_0x41ad1c)throw CliErrors[_0x55972b(0x169)](_0x55972b(0x196)+_0x4cab19+_0x55972b(0x168),_0x55972b(0x15f));return _0x41ad1c;}const _0x23cd5d=_0x24701e[_0x55972b(0x180)](_0x3c6bc8=>_0x3c6bc8[_0x55972b(0x159)]===_0x21199c);if(_0x23cd5d[_0x55972b(0x173)]===0x0)throw CliErrors[_0x55972b(0x169)]('Role\x20\x22'+_0x21199c+_0x55972b(0x14f),_0x55972b(0x17d));if(_0x23cd5d['length']>0x1)throw CliErrors[_0x55972b(0x169)]('Role\x20\x22'+_0x21199c+_0x55972b(0x160)+_0x23cd5d[_0x55972b(0x19b)](_0x2abd09=>_0x2abd09['id'])[_0x55972b(0x190)](',\x20')+').',_0x55972b(0x163));return _0x23cd5d[0x0];}export function projectPageSlot(_0x47676f){const _0x585d54=a140_0x44dbb7;if(!_0x47676f)return null;return{'resourceCode':_0x47676f[_0x585d54(0x15a)],'roles':(_0x47676f[_0x585d54(0x189)]??[])[_0x585d54(0x19b)](projectRoleRef)};}export function projectPagePermit(_0x519664){const _0x53de6c=a140_0x44dbb7,_0x5818fe={'menuId':_0x519664['menuId'],'appCode':_0x519664[_0x53de6c(0x14b)],'menuPermit':projectPageSlot(_0x519664[_0x53de6c(0x195)])};for(const _0x1e7f9c of PAGE_SLOT_SPECS){if(_0x1e7f9c['key']===_0x53de6c(0x195))continue;_0x5818fe[_0x1e7f9c[_0x53de6c(0x199)]]=projectPageSlot(_0x519664[_0x1e7f9c[_0x53de6c(0x199)]]);}return _0x5818fe;}export function flattenMenuResources(_0x2896d0){const _0x51e0dc=new Map(),_0x4ed3ce=_0xabb6c4=>{const _0x5a490b=a140_0x1b88;for(const _0x8be821 of _0xabb6c4??[]){_0x51e0dc[_0x5a490b(0x17a)](_0x8be821['resourceCode'],{'resourceCode':_0x8be821[_0x5a490b(0x15a)],'resourceName':_0x8be821[_0x5a490b(0x153)],'action':_0x8be821[_0x5a490b(0x179)]?.[0x0]??'0'});if(_0x8be821[_0x5a490b(0x158)])_0x4ed3ce(_0x8be821[_0x5a490b(0x158)]);}};return _0x4ed3ce(_0x2896d0),_0x51e0dc;}function a140_0x1b88(_0x203097,_0x4158e1){_0x203097=_0x203097-0x14b;const _0x201419=a140_0x2014();let _0x1b88e1=_0x201419[_0x203097];return _0x1b88e1;}export function flattenApiResources(_0x163d68){const _0x2e708d=a140_0x44dbb7,_0xf04e01=new Map(),_0x3c9e9f=new Map();for(const _0x5ed704 of _0x163d68){const _0x2f8142=_0x5ed704[_0x2e708d(0x188)]??{};for(const [_0x1fddc9,_0x3d7410]of Object[_0x2e708d(0x184)](_0x2f8142)){_0xf04e01[_0x2e708d(0x17a)](_0x1fddc9,{'resourceCode':_0x1fddc9,'resourceName':_0x5ed704[_0x2e708d(0x153)],'datasetCode':_0x5ed704[_0x2e708d(0x14c)],'action':_0x3d7410?.[0x0]??'0'});const _0x3927a5=_0x3c9e9f[_0x2e708d(0x16d)](_0x5ed704[_0x2e708d(0x14c)])??[];_0x3927a5[_0x2e708d(0x14e)](_0x1fddc9),_0x3c9e9f[_0x2e708d(0x17a)](_0x5ed704['datasetCode'],_0x3927a5);}}return{'byCode':_0xf04e01,'byDataset':_0x3c9e9f};}export function buildPermits(_0x4a349c,_0x3cd3f7){const _0x48f07d=a140_0x44dbb7,_0x3e10a4={};for(const [_0x4b1a58,_0x2b8d80]of _0x4a349c){const _0x3b468a=_0x3cd3f7[_0x48f07d(0x16d)](_0x4b1a58)??_0x2b8d80[_0x48f07d(0x183)];_0x3e10a4[_0x4b1a58]=[_0x3b468a];}return _0x3e10a4;}export function readRoleRef(_0x5a4e19){const _0x42b9b6=a140_0x44dbb7,_0xaf472b=_0x5a4e19[_0x42b9b6(0x14d)](_0x42b9b6(0x181))[_0x42b9b6(0x185)]();if(!_0xaf472b)throw CliErrors[_0x42b9b6(0x152)](_0x42b9b6(0x181),'Pass\x20--role\x20<id|name>.');return _0xaf472b;}export function readGrantRevoke(_0x1f2b8a){const _0x3a1928=a140_0x44dbb7,_0x2a099f=_0x1f2b8a[_0x3a1928(0x174)](_0x3a1928(0x15c)),_0x4d184e=_0x1f2b8a[_0x3a1928(0x174)](_0x3a1928(0x18d));if(_0x2a099f&&_0x4d184e)throw CliErrors[_0x3a1928(0x169)](_0x3a1928(0x18c));if(!_0x2a099f&&!_0x4d184e)throw CliErrors['validation'](_0x3a1928(0x19e),_0x3a1928(0x177));return _0x2a099f?_0x3a1928(0x156):'0';}
@@ -1 +1 @@
1
- (function(_0x4b7d77,_0x394867){const _0x4fbf39=a140_0x26fb,_0x15231f=_0x4b7d77();while(!![]){try{const _0x4950b2=-parseInt(_0x4fbf39(0x181))/0x1+-parseInt(_0x4fbf39(0x17f))/0x2+-parseInt(_0x4fbf39(0x188))/0x3*(-parseInt(_0x4fbf39(0x18b))/0x4)+-parseInt(_0x4fbf39(0x17e))/0x5+-parseInt(_0x4fbf39(0x183))/0x6*(-parseInt(_0x4fbf39(0x18a))/0x7)+-parseInt(_0x4fbf39(0x185))/0x8+parseInt(_0x4fbf39(0x179))/0x9*(parseInt(_0x4fbf39(0x171))/0xa);if(_0x4950b2===_0x394867)break;else _0x15231f['push'](_0x15231f['shift']());}catch(_0x86c77c){_0x15231f['push'](_0x15231f['shift']());}}}(a140_0x19a5,0x5206b));import{existsSync}from'node:fs';import a140_0x33a9b8 from'node:path';import a140_0x23802b from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a140_0x19a5(){const _0x3fdc3c=['No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','1586564MVxUuC','37048bEvbWi','test','resolve','Project\x20name:','Directory\x20\x22','√\x20Project\x20Name:\x20','10bGSgyt','trim','length','√\x20App\x20Code:\x20','Project\x20name\x20cannot\x20exceed\x2050\x20characters','my-app','Login\x20failed','cyan','9465174IQnSLZ','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','production','Skipped','Not\x20set','2660930HXFgyf','63676VVjgUh','√\x20Login\x20status:\x20','448880ARmnOS','log','12qGMsOs','env','1693432SCwTva','cwd','green','18NNbeGB'];a140_0x19a5=function(){return _0x3fdc3c;};return a140_0x19a5();}import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';function a140_0x26fb(_0x2a6a4f,_0x178a41){_0x2a6a4f=_0x2a6a4f-0x171;const _0x19a5f3=a140_0x19a5();let _0x26fbec=_0x19a5f3[_0x2a6a4f];return _0x26fbec;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x418164,_0x165665,_0x6f7a1){const _0x1790f5=a140_0x26fb,_0x3521d5=_0x1790f5(0x176),_0x3ec7e8=readConfig(),_0x72d472=typeof _0x3ec7e8[_0x1790f5(0x184)]==='string'?_0x3ec7e8[_0x1790f5(0x184)]:undefined,_0x70c89d=await input({'message':_0x1790f5(0x18e),'default':_0x3521d5,'validate':_0x4c92ef=>{const _0x46b7cc=_0x1790f5,_0x5cd811=_0x4c92ef[_0x46b7cc(0x172)]()||_0x3521d5;if(_0x5cd811[_0x46b7cc(0x173)]>0x32)return _0x46b7cc(0x175);const _0x640c4a=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x5cd811&&!_0x640c4a[_0x46b7cc(0x18c)](_0x5cd811))return _0x46b7cc(0x17a);const _0x5b3b64=a140_0x33a9b8[_0x46b7cc(0x18d)](process[_0x46b7cc(0x186)](),_0x5cd811);if(existsSync(_0x5b3b64))return _0x46b7cc(0x18f)+_0x5cd811+'\x22\x20already\x20exists';return!![];}});console[_0x1790f5(0x182)](a140_0x23802b['green'](_0x1790f5(0x190)+a140_0x23802b[_0x1790f5(0x178)](_0x70c89d)));const _0xd84084=await selectSingleAppcode(_0x6f7a1);console[_0x1790f5(0x182)](a140_0x23802b[_0x1790f5(0x187)](_0x1790f5(0x174)+a140_0x23802b[_0x1790f5(0x178)](_0xd84084||_0x1790f5(0x17d))));if(_0xd84084){const _0x1994a4=await getIsSessionValid();if(!_0x1994a4){const _0x2f7e78=await confirm({'message':_0x1790f5(0x189),'default':!![]});if(_0x2f7e78){const _0x4fab87=await authServer({'silent':!![]});console['log'](a140_0x23802b[_0x1790f5(0x187)]('√\x20Login\x20status:\x20'+a140_0x23802b[_0x1790f5(0x178)](_0x4fab87?'Logged\x20in':_0x1790f5(0x177))));}else console['log'](a140_0x23802b[_0x1790f5(0x187)](_0x1790f5(0x180)+a140_0x23802b[_0x1790f5(0x178)](_0x1790f5(0x17c))));}await _0x418164({'projectName':_0x70c89d,'appCode':_0xd84084,'env':_0x165665||_0x72d472||'production'});}else await _0x418164({'projectName':_0x70c89d,'env':_0x165665||_0x72d472||_0x1790f5(0x17b)});}
1
+ (function(_0x4b8c35,_0x37502b){const _0x1ec591=a141_0x2278,_0x399ee2=_0x4b8c35();while(!![]){try{const _0x5b983a=-parseInt(_0x1ec591(0x7b))/0x1*(-parseInt(_0x1ec591(0x70))/0x2)+parseInt(_0x1ec591(0x72))/0x3+parseInt(_0x1ec591(0x77))/0x4+-parseInt(_0x1ec591(0x8c))/0x5+-parseInt(_0x1ec591(0x75))/0x6*(parseInt(_0x1ec591(0x71))/0x7)+-parseInt(_0x1ec591(0x8a))/0x8+parseInt(_0x1ec591(0x86))/0x9;if(_0x5b983a===_0x37502b)break;else _0x399ee2['push'](_0x399ee2['shift']());}catch(_0x2058c4){_0x399ee2['push'](_0x399ee2['shift']());}}}(a141_0x3295,0x98475));import{existsSync}from'node:fs';function a141_0x3295(){const _0x58e91d=['1041488PohDXp','497teJoZI','174777msjyLB','trim','env','138Civkkd','length','356504ihEopr','string','cyan','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','1HPcFVN','√\x20Login\x20status:\x20','Login\x20failed','production','\x22\x20already\x20exists','Project\x20name\x20cannot\x20exceed\x2050\x20characters','cwd','√\x20Project\x20Name:\x20','Skipped','resolve','green','7566318AOYAJy','my-app','Project\x20name:','Directory\x20\x22','1362464GQvjNy','log','3565785MTHjzE','Not\x20set','test'];a141_0x3295=function(){return _0x58e91d;};return a141_0x3295();}import a141_0x3ca5d7 from'node:path';import a141_0x31919a from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a141_0x2278(_0x18d6b3,_0x45e996){_0x18d6b3=_0x18d6b3-0x6f;const _0x329571=a141_0x3295();let _0x22780b=_0x329571[_0x18d6b3];return _0x22780b;}import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x531fc3,_0x3360aa,_0x261801){const _0x38830d=a141_0x2278,_0x2ce3f2=_0x38830d(0x87),_0x5895fa=readConfig(),_0x12aee8=typeof _0x5895fa[_0x38830d(0x74)]===_0x38830d(0x78)?_0x5895fa[_0x38830d(0x74)]:undefined,_0x341cbc=await input({'message':_0x38830d(0x88),'default':_0x2ce3f2,'validate':_0xc4bcdb=>{const _0x154296=_0x38830d,_0x75eb36=_0xc4bcdb[_0x154296(0x73)]()||_0x2ce3f2;if(_0x75eb36[_0x154296(0x76)]>0x32)return _0x154296(0x80);const _0x10224e=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x75eb36&&!_0x10224e[_0x154296(0x6f)](_0x75eb36))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x429428=a141_0x3ca5d7[_0x154296(0x84)](process[_0x154296(0x81)](),_0x75eb36);if(existsSync(_0x429428))return _0x154296(0x89)+_0x75eb36+_0x154296(0x7f);return!![];}});console[_0x38830d(0x8b)](a141_0x31919a['green'](_0x38830d(0x82)+a141_0x31919a[_0x38830d(0x79)](_0x341cbc)));const _0x63ff8b=await selectSingleAppcode(_0x261801);console['log'](a141_0x31919a[_0x38830d(0x85)]('√\x20App\x20Code:\x20'+a141_0x31919a[_0x38830d(0x79)](_0x63ff8b||_0x38830d(0x8d))));if(_0x63ff8b){const _0x2e2a3a=await getIsSessionValid();if(!_0x2e2a3a){const _0x2bc2e3=await confirm({'message':_0x38830d(0x7a),'default':!![]});if(_0x2bc2e3){const _0x223029=await authServer({'silent':!![]});console[_0x38830d(0x8b)](a141_0x31919a[_0x38830d(0x85)](_0x38830d(0x7c)+a141_0x31919a[_0x38830d(0x79)](_0x223029?'Logged\x20in':_0x38830d(0x7d))));}else console[_0x38830d(0x8b)](a141_0x31919a[_0x38830d(0x85)](_0x38830d(0x7c)+a141_0x31919a[_0x38830d(0x79)](_0x38830d(0x83))));}await _0x531fc3({'projectName':_0x341cbc,'appCode':_0x63ff8b,'env':_0x3360aa||_0x12aee8||_0x38830d(0x7e)});}else await _0x531fc3({'projectName':_0x341cbc,'env':_0x3360aa||_0x12aee8||_0x38830d(0x7e)});}
@@ -1 +1 @@
1
- (function(_0x5793cf,_0x12b57f){const _0x39eb1c=a141_0x34f4,_0x173c74=_0x5793cf();while(!![]){try{const _0x1c4f09=parseInt(_0x39eb1c(0x92))/0x1+-parseInt(_0x39eb1c(0x8c))/0x2*(parseInt(_0x39eb1c(0x8b))/0x3)+-parseInt(_0x39eb1c(0x89))/0x4*(-parseInt(_0x39eb1c(0x88))/0x5)+parseInt(_0x39eb1c(0x8a))/0x6+-parseInt(_0x39eb1c(0x93))/0x7*(-parseInt(_0x39eb1c(0x95))/0x8)+-parseInt(_0x39eb1c(0x90))/0x9*(parseInt(_0x39eb1c(0x8e))/0xa)+-parseInt(_0x39eb1c(0x91))/0xb*(parseInt(_0x39eb1c(0x8f))/0xc);if(_0x1c4f09===_0x12b57f)break;else _0x173c74['push'](_0x173c74['shift']());}catch(_0x25b599){_0x173c74['push'](_0x173c74['shift']());}}}(a141_0x3446,0xd0676));export function formatElapsed(_0x22919f){const _0x1c8ba6=a141_0x34f4,_0x2b2278=Date[_0x1c8ba6(0x8d)]()-_0x22919f;if(_0x2b2278<0x3e8)return _0x2b2278+'ms';const _0x373c98=(_0x2b2278/0x3e8)[_0x1c8ba6(0x94)](0x2),_0x25a317=_0x373c98['replace'](/\.?0+$/u,'');return _0x25a317+'s';}function a141_0x34f4(_0x227cab,_0x2f2d6b){_0x227cab=_0x227cab-0x88;const _0x34463a=a141_0x3446();let _0x34f4fa=_0x34463a[_0x227cab];return _0x34f4fa;}function a141_0x3446(){const _0x232a03=['25wroYJn','906532tEnpBA','9738174IAwFcl','28494MmMIia','130VMnnHM','now','20SVlmsw','12aJjhqp','4235571YpAoUI','32883004xaIYBC','1635941NYVtue','3941pJuolI','toFixed','14344pkjfYe'];a141_0x3446=function(){return _0x232a03;};return a141_0x3446();}
1
+ function a142_0x2e86(_0x421647,_0x4f5c33){_0x421647=_0x421647-0x175;const _0x567b97=a142_0x567b();let _0x2e86e5=_0x567b97[_0x421647];return _0x2e86e5;}(function(_0x2b36d0,_0x2e0ac3){const _0x17af80=a142_0x2e86,_0x2a1e8c=_0x2b36d0();while(!![]){try{const _0x178d73=parseInt(_0x17af80(0x175))/0x1+parseInt(_0x17af80(0x17f))/0x2*(parseInt(_0x17af80(0x17d))/0x3)+parseInt(_0x17af80(0x17c))/0x4+parseInt(_0x17af80(0x17b))/0x5+parseInt(_0x17af80(0x179))/0x6*(parseInt(_0x17af80(0x176))/0x7)+parseInt(_0x17af80(0x181))/0x8*(-parseInt(_0x17af80(0x178))/0x9)+parseInt(_0x17af80(0x177))/0xa*(-parseInt(_0x17af80(0x17a))/0xb);if(_0x178d73===_0x2e0ac3)break;else _0x2a1e8c['push'](_0x2a1e8c['shift']());}catch(_0x2675bd){_0x2a1e8c['push'](_0x2a1e8c['shift']());}}}(a142_0x567b,0xc491c));export function formatElapsed(_0x2e385c){const _0x1e8665=a142_0x2e86,_0x596d08=Date[_0x1e8665(0x180)]()-_0x2e385c;if(_0x596d08<0x3e8)return _0x596d08+'ms';const _0x4e9522=(_0x596d08/0x3e8)['toFixed'](0x2),_0x56f2c5=_0x4e9522[_0x1e8665(0x17e)](/\.?0+$/u,'');return _0x56f2c5+'s';}function a142_0x567b(){const _0x4d8639=['replace','757994bIDFJb','now','2488oFFKej','1316747VJmBTr','7DQveLB','94570fehlaN','19593mRjTsI','2517306fekSZt','3014hnvKxU','2312240BGwAnN','4466692WryhWj','6jGSoAQ'];a142_0x567b=function(){return _0x4d8639;};return a142_0x567b();}
@@ -1 +1 @@
1
- (function(_0xd1962b,_0x2c7899){const _0x4bb57c=a142_0x1ca8,_0x110fe8=_0xd1962b();while(!![]){try{const _0x588eea=parseInt(_0x4bb57c(0x1fc))/0x1+parseInt(_0x4bb57c(0x1c9))/0x2+parseInt(_0x4bb57c(0x1cd))/0x3*(-parseInt(_0x4bb57c(0x202))/0x4)+-parseInt(_0x4bb57c(0x1b8))/0x5*(-parseInt(_0x4bb57c(0x1e3))/0x6)+parseInt(_0x4bb57c(0x1b4))/0x7*(parseInt(_0x4bb57c(0x1e2))/0x8)+parseInt(_0x4bb57c(0x206))/0x9*(parseInt(_0x4bb57c(0x1fd))/0xa)+parseInt(_0x4bb57c(0x1d9))/0xb*(-parseInt(_0x4bb57c(0x1f6))/0xc);if(_0x588eea===_0x2c7899)break;else _0x110fe8['push'](_0x110fe8['shift']());}catch(_0x2b13d8){_0x110fe8['push'](_0x110fe8['shift']());}}}(a142_0x2913,0x1cc43));import a142_0x346fd5 from'path';import a142_0x1b7ea0 from'fs';import a142_0x5394ff from'chalk';import a142_0x1349c9 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';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';function a142_0x2913(){const _0x50a6c9=['\x20|\x20AppCode:\x20','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','name','projectCode','version','length','warn','join','description','utf8','readFileSync','string','Copy\x20project\x20files','1.0.0','resolve','27276zgPnKB','projectName','appCode','\x20model(s)','log','√\x20package.json\x20updated:\x20name=','45080rwWhPP','20MVcRIC','√\x20Configuration\x20file\x20created,\x20Apps:\x20','dirname','cwd','message','4vqmmCc','配置应用AppCode失败','existsSync','repeat','1038051mXvKMt','trim','cookie','🚀\x20Next\x20Steps:','\x20config\x20set\x20appcode\x20<app-code>\x27','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','start','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','更新\x20package.json\x20name','326732UDkuod','cd\x20','\x20dataset(s),\x20generated\x20','\x20already\x20exists','1555aPQegj','\x20api\x20pull','更新\x20package.json\x20失败','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','needsUpgrade','apps','error','Project\x20name\x20cannot\x20be\x20empty','green','\x20run\x20start','cyan','belowMinimum','production','info','stringify','\x20\x201.\x20Start\x20project:\x20','env','1072gEFdoY','package.json','bold','API\x20配置拉取异常','3777WTtiXI','...','API\x20configuration\x20pulled:\x20','minimumVersion','\x20|\x20Default:\x20','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','*\x20Pulling\x20API\x20configuration...','modelCount','parse','chdir','Format\x20code','currentVersion','2123ZkiBAm','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','stop','Project\x20directory\x20','create','项目创建完成:\x20','defaultApp','gray','开始创建项目:\x20','8OszqFZ','4530nXyDLy','\x20Generated\x20by\x20rabetbase\x20cli\x20','*\x20Configuring\x20AppCode\x20for\x20project\x20','keys'];a142_0x2913=function(){return _0x50a6c9;};return a142_0x2913();}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';function a142_0x1ca8(_0x3d2639,_0x15ec65){_0x3d2639=_0x3d2639-0x1ae;const _0x29139f=a142_0x2913();let _0x1ca867=_0x29139f[_0x3d2639];return _0x1ca867;}import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x1af98c){const _0x40403c=a142_0x1ca8,_0x1b5b3e=await checkCliVersion();(_0x1b5b3e[_0x40403c(0x1bc)]||_0x1b5b3e[_0x40403c(0x1c3)])&&(printCliUpgradeWarning(_0x1b5b3e),assertCliVersionSupported(_0x1b5b3e),logger[_0x40403c(0x1c5)](_0x40403c(0x1dd),'CLI\x20版本检查',{'currentVersion':_0x1b5b3e[_0x40403c(0x1d8)],'stableVersion':_0x1b5b3e['stableVersion'],'minimumVersion':_0x1b5b3e[_0x40403c(0x1d0)],'needsUpgrade':_0x1b5b3e[_0x40403c(0x1bc)],'belowMinimum':_0x1b5b3e[_0x40403c(0x1c3)]}));if(_0x1af98c[_0x40403c(0x1ea)]&&_0x1af98c[_0x40403c(0x1f8)])await runCreate({'projectName':_0x1af98c[_0x40403c(0x1ea)],'appCode':_0x1af98c[_0x40403c(0x1f8)],'env':_0x1af98c[_0x40403c(0x1c8)]},_0x1af98c);else{if(_0x1af98c[_0x40403c(0x1ea)]){const _0x187e87=await selectSingleAppcode(_0x1af98c['cookie']);await runCreate({'projectName':_0x1af98c[_0x40403c(0x1ea)],'appCode':_0x187e87||undefined,'env':_0x1af98c[_0x40403c(0x1c8)]},_0x1af98c);}else await guidedCreateProject(_0x324760=>runCreate(_0x324760,_0x1af98c),_0x1af98c[_0x40403c(0x1c8)],_0x1af98c[_0x40403c(0x208)]);}}async function runCreate(_0x51d397,_0x2c9cb6){const _0x432ca1=a142_0x1ca8;if(!_0x51d397[_0x432ca1(0x1f7)]||_0x51d397[_0x432ca1(0x1f7)][_0x432ca1(0x207)]()==='')throw new Error(_0x432ca1(0x1bf));const _0x588ae3=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x588ae3['test'](_0x51d397['projectName']))throw new Error(_0x432ca1(0x1b0));if(_0x51d397['projectName'][_0x432ca1(0x1ec)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x155a5e=a142_0x346fd5['resolve'](process[_0x432ca1(0x200)](),_0x51d397[_0x432ca1(0x1f7)]);if(a142_0x1b7ea0[_0x432ca1(0x204)](_0x155a5e))throw new Error(_0x432ca1(0x1dc)+_0x51d397[_0x432ca1(0x1f7)]+_0x432ca1(0x1b7));try{a142_0x1b7ea0['accessSync'](a142_0x346fd5[_0x432ca1(0x1ff)](_0x155a5e),a142_0x1b7ea0['constants']['W_OK']);}catch{throw new Error(_0x432ca1(0x1b2));}logger['setLogPath'](_0x155a5e),logger[_0x432ca1(0x1c5)](_0x432ca1(0x1dd),_0x432ca1(0x1e1)+_0x51d397[_0x432ca1(0x1f7)],{'projectDir':_0x155a5e,'appCode':_0x51d397[_0x432ca1(0x1f8)]}),console[_0x432ca1(0x1fa)](),console[_0x432ca1(0x1fa)](a142_0x5394ff['green']('\x20√\x20')+'Project\x20name:\x20'+a142_0x5394ff['green'](_0x51d397['projectName'])+(_0x51d397[_0x432ca1(0x1f8)]?_0x432ca1(0x1e7)+a142_0x5394ff[_0x432ca1(0x1c2)](_0x51d397[_0x432ca1(0x1f8)]):''));try{await runTask(_0x432ca1(0x1f3),()=>copyProjectTemplate(_0x51d397[_0x432ca1(0x1f7)])),await updatePackageJsonName(_0x51d397[_0x432ca1(0x1f7)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x51d397[_0x432ca1(0x1f7)])),await runTask(_0x432ca1(0x1d7),()=>formatProjectCode(_0x51d397[_0x432ca1(0x1f7)])),await configureAppCode(_0x51d397[_0x432ca1(0x1f7)],_0x51d397[_0x432ca1(0x1f8)]||'',_0x51d397[_0x432ca1(0x1c8)]);let _0x3c5f73=![];if(_0x51d397[_0x432ca1(0x1f8)]){console['log'](_0x432ca1(0x1d3));const _0xf8b985=process[_0x432ca1(0x200)]();try{process[_0x432ca1(0x1d6)](_0x155a5e);const _0x321a69=_0x51d397['env']||_0x432ca1(0x1c4);initEnv(_0x321a69);const {configArray:_0x514a49}=await fetchModelList(_0x51d397[_0x432ca1(0x1f8)],_0x2c9cb6[_0x432ca1(0x208)]||''),_0x98e66b=DEFAULT_API_DIR,_0x2ef20d=await generateApiFile(_0x514a49,'',_0x51d397[_0x432ca1(0x1f8)],!![],_0x321a69,_0x98e66b);console[_0x432ca1(0x1fa)]('√\x20Pulled\x20'+_0x514a49[_0x432ca1(0x1ec)]+_0x432ca1(0x1b6)+_0x2ef20d[_0x432ca1(0x1d4)]+_0x432ca1(0x1f9)),logger[_0x432ca1(0x1c5)](_0x432ca1(0x1dd),_0x432ca1(0x1cf)+_0x51d397['appCode']);}catch(_0x4789f2){_0x3c5f73=!![],console[_0x432ca1(0x1fa)](_0x432ca1(0x1d2)),logger[_0x432ca1(0x1ed)](_0x432ca1(0x1dd),_0x432ca1(0x1cc),{'error':_0x4789f2 instanceof Error?_0x4789f2[_0x432ca1(0x201)]:String(_0x4789f2)});}finally{process[_0x432ca1(0x1d6)](_0xf8b985);}}logger['success'](_0x432ca1(0x1dd),_0x432ca1(0x1de)+_0x51d397[_0x432ca1(0x1f7)]),console[_0x432ca1(0x1fa)](),console[_0x432ca1(0x1fa)](a142_0x5394ff['green']('─'[_0x432ca1(0x205)](0x3c))),console[_0x432ca1(0x1fa)](a142_0x5394ff['cyan']['bold'](_0x432ca1(0x1ae))),console[_0x432ca1(0x1fa)](),console[_0x432ca1(0x1fa)](_0x432ca1(0x1c7)+a142_0x5394ff['cyan'][_0x432ca1(0x1cb)](_0x432ca1(0x1b5)+_0x51d397['projectName']+'\x20&&\x20'+CLI_BIN_NAME+_0x432ca1(0x1c1))),_0x3c5f73&&console[_0x432ca1(0x1fa)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a142_0x5394ff[_0x432ca1(0x1c2)][_0x432ca1(0x1cb)](CLI_BIN_NAME+_0x432ca1(0x1b9))),console[_0x432ca1(0x1fa)](a142_0x5394ff[_0x432ca1(0x1c0)]('─'['repeat'](0x3c)));}catch(_0x40d423){logger[_0x432ca1(0x1be)](_0x432ca1(0x1dd),'项目创建失败:\x20'+_0x51d397[_0x432ca1(0x1f7)],{'error':_0x40d423 instanceof Error?_0x40d423[_0x432ca1(0x201)]:String(_0x40d423)});try{a142_0x1b7ea0[_0x432ca1(0x204)](_0x155a5e)&&(console[_0x432ca1(0x1fa)](_0x432ca1(0x1e8)+_0x155a5e),a142_0x1b7ea0['rmSync'](_0x155a5e,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x432ca1(0x1dd),'清理项目目录失败:\x20'+_0x155a5e);}throw _0x40d423;}}async function runTask(_0x265281,_0x891ac9){const _0x23fe38=a142_0x1ca8,_0x124290=a142_0x1349c9(_0x265281+_0x23fe38(0x1ce))[_0x23fe38(0x1b1)]();try{const _0x29c0cb=await _0x891ac9();_0x124290[_0x23fe38(0x1db)](),console['log'](''+a142_0x5394ff['green']('\x20√\x20')+_0x265281+'\x20'+a142_0x5394ff[_0x23fe38(0x1e0)]('['+_0x29c0cb+']'));}catch(_0x435c9b){_0x124290['fail'](_0x265281);throw _0x435c9b;}}async function updatePackageJsonName(_0x430dfc){const _0x2daecd=a142_0x1ca8,_0x28cef9=a142_0x346fd5[_0x2daecd(0x1f5)](process[_0x2daecd(0x200)](),_0x430dfc),_0x5b9f30=a142_0x346fd5['join'](_0x28cef9,_0x2daecd(0x1ca));try{console['log'](_0x2daecd(0x1bb));const _0x21f84f=getRabetbaseCliPackageRoot(),_0x1cb93a=a142_0x346fd5['join'](_0x21f84f,_0x2daecd(0x1ca));let _0x4d207c=_0x2daecd(0x1f4);try{const _0x2d02a2=JSON[_0x2daecd(0x1d5)](a142_0x1b7ea0[_0x2daecd(0x1f1)](_0x1cb93a,_0x2daecd(0x1f0)));_0x4d207c=_0x2d02a2['version']||_0x2daecd(0x1f4);}catch{}const _0x5dacb4=a142_0x1b7ea0['readFileSync'](_0x5b9f30,_0x2daecd(0x1f0)),_0x25a156=JSON['parse'](_0x5dacb4);_0x25a156[_0x2daecd(0x1e9)]=_0x430dfc,_0x25a156[_0x2daecd(0x1ef)]=_0x430dfc+_0x2daecd(0x1e4)+_0x4d207c,a142_0x1b7ea0['writeFileSync'](_0x5b9f30,JSON[_0x2daecd(0x1c6)](_0x25a156,null,0x2)+'\x0a',_0x2daecd(0x1f0)),console[_0x2daecd(0x1fa)](_0x2daecd(0x1fb)+_0x430dfc),logger[_0x2daecd(0x1c5)](_0x2daecd(0x1dd),_0x2daecd(0x1b3));}catch(_0x5438fd){logger['error'](_0x2daecd(0x1dd),_0x2daecd(0x1ba));throw _0x5438fd;}}async function configureAppCode(_0x37a9c5,_0x2d9864,_0x2f5ed5){const _0x5c4957=a142_0x1ca8,_0x246b82=a142_0x346fd5[_0x5c4957(0x1f5)](process['cwd'](),_0x37a9c5),_0x2885ea=a142_0x346fd5[_0x5c4957(0x1ee)](_0x246b82,NEW_CONFIG_NAME);try{_0x2d9864?console['log'](_0x5c4957(0x1e5)+_0x37a9c5+':\x20'+_0x2d9864):console['log']('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x37a9c5);const _0x124366=getRabetbaseCliPackageRoot(),_0x4c7edb=a142_0x346fd5[_0x5c4957(0x1ee)](_0x124366,'package.json');let _0x15f350=_0x5c4957(0x1f4);try{const _0x1d4d67=JSON['parse'](a142_0x1b7ea0[_0x5c4957(0x1f1)](_0x4c7edb,_0x5c4957(0x1f0)));_0x15f350=_0x1d4d67[_0x5c4957(0x1eb)]||_0x5c4957(0x1f4);}catch{}const _0x523148=readConfig(),_0x353ad1=typeof _0x523148[_0x5c4957(0x1c8)]===_0x5c4957(0x1f2)?_0x523148[_0x5c4957(0x1c8)]:undefined,_0x4157e0={};for(const _0x37bf58 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x523148[_0x37bf58]!=null)_0x4157e0[_0x37bf58]=_0x523148[_0x37bf58];}const _0x3d811f=buildCanonicalProjectConfig(_0x4157e0,{'appCodes':_0x2d9864?[_0x2d9864]:[],'env':_0x2f5ed5||_0x353ad1||_0x5c4957(0x1c4),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x15f350}});writeConfigFile(_0x2885ea,_0x3d811f),_0x2d9864?console['log'](_0x5c4957(0x1fe)+Object[_0x5c4957(0x1e6)](_0x3d811f[_0x5c4957(0x1bd)]||{})[_0x5c4957(0x1ee)](',\x20')+_0x5c4957(0x1d1)+_0x3d811f[_0x5c4957(0x1df)]):console[_0x5c4957(0x1fa)](_0x5c4957(0x1da)+CLI_BIN_NAME+_0x5c4957(0x1af)),logger[_0x5c4957(0x1c5)](_0x5c4957(0x1dd),'配置应用AppCode:\x20'+_0x2d9864);}catch(_0x16ef18){logger['error']('create',_0x5c4957(0x203));}}
1
+ (function(_0x3413bd,_0x117d28){const _0x1f6d30=a143_0x57ff,_0x4f08f7=_0x3413bd();while(!![]){try{const _0x5cafc3=parseInt(_0x1f6d30(0x21a))/0x1*(-parseInt(_0x1f6d30(0x217))/0x2)+-parseInt(_0x1f6d30(0x223))/0x3*(parseInt(_0x1f6d30(0x24c))/0x4)+parseInt(_0x1f6d30(0x1f2))/0x5*(-parseInt(_0x1f6d30(0x231))/0x6)+-parseInt(_0x1f6d30(0x243))/0x7*(parseInt(_0x1f6d30(0x20c))/0x8)+-parseInt(_0x1f6d30(0x1f1))/0x9*(parseInt(_0x1f6d30(0x229))/0xa)+-parseInt(_0x1f6d30(0x23c))/0xb*(-parseInt(_0x1f6d30(0x20a))/0xc)+parseInt(_0x1f6d30(0x212))/0xd*(parseInt(_0x1f6d30(0x1fa))/0xe);if(_0x5cafc3===_0x117d28)break;else _0x4f08f7['push'](_0x4f08f7['shift']());}catch(_0x1c74f3){_0x4f08f7['push'](_0x4f08f7['shift']());}}}(a143_0x49d1,0x8c3d4));import a143_0x544674 from'path';import a143_0x2b8d26 from'fs';import a143_0x520a72 from'chalk';import a143_0x15c5a9 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';function a143_0x49d1(){const _0x1f18d9=['1.0.0','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','projectCode','245102oWeabZ','writeFileSync','create','3AWKqkA','gray','W_OK','cd\x20','modelCount','log','name','Project\x20directory\x20','setLogPath','147954BGfJVT','join','√\x20package.json\x20updated:\x20name=','readFileSync','warn','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','11051470KhjRYJ','...','\x20Generated\x20by\x20rabetbase\x20cli\x20','CLI\x20版本检查','\x20√\x20','start','resolve','bold','12GXElXb','apps','\x20api\x20pull','cyan','green','*\x20Configuring\x20AppCode\x20for\x20project\x20','constants','\x20\x202.\x20Pull\x20API\x20configuration:\x20','项目创建完成:\x20','rmSync','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','11pUodpr','清理项目目录失败:\x20','description','\x20|\x20Default:\x20','配置应用AppCode失败','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','\x20config\x20set\x20appcode\x20<app-code>\x27','2544983MKIUQb','info','🚀\x20Next\x20Steps:','version','\x20\x201.\x20Start\x20project:\x20','√\x20Pulled\x20','defaultApp','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','package.json','68VqaBbN','projectName','stringify','*\x20Pulling\x20API\x20configuration...','项目创建失败:\x20','配置应用AppCode:\x20','length','9oCGkxi','1111960MqAatd','开始创建项目:\x20','API\x20配置拉取异常','production','\x20&&\x20','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','repeat','fail','896WzViKC','cookie','cwd','\x20|\x20AppCode:\x20','appCode','success','env','needsUpgrade','更新\x20package.json\x20name','existsSync','Format\x20code','currentVersion','minimumVersion','stop','parse','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','330972tUyArx','message','24PUSDqm','accessSync','chdir','Project\x20name:\x20','keys','Project\x20name\x20cannot\x20be\x20empty','892437pbuPor','utf8'];a143_0x49d1=function(){return _0x1f18d9;};return a143_0x49d1();}import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';function a143_0x57ff(_0x2698ec,_0x95c510){_0x2698ec=_0x2698ec-0x1ee;const _0x49d1ab=a143_0x49d1();let _0x57ff2f=_0x49d1ab[_0x2698ec];return _0x57ff2f;}import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x252313){const _0x570754=a143_0x57ff,_0x1c2e21=await checkCliVersion();(_0x1c2e21[_0x570754(0x201)]||_0x1c2e21['belowMinimum'])&&(printCliUpgradeWarning(_0x1c2e21),assertCliVersionSupported(_0x1c2e21),logger[_0x570754(0x244)](_0x570754(0x219),_0x570754(0x22c),{'currentVersion':_0x1c2e21[_0x570754(0x205)],'stableVersion':_0x1c2e21['stableVersion'],'minimumVersion':_0x1c2e21[_0x570754(0x206)],'needsUpgrade':_0x1c2e21['needsUpgrade'],'belowMinimum':_0x1c2e21['belowMinimum']}));if(_0x252313[_0x570754(0x216)]&&_0x252313[_0x570754(0x1fe)])await runCreate({'projectName':_0x252313['projectCode'],'appCode':_0x252313[_0x570754(0x1fe)],'env':_0x252313[_0x570754(0x200)]},_0x252313);else{if(_0x252313[_0x570754(0x216)]){const _0x2017a7=await selectSingleAppcode(_0x252313[_0x570754(0x1fb)]);await runCreate({'projectName':_0x252313[_0x570754(0x216)],'appCode':_0x2017a7||undefined,'env':_0x252313['env']},_0x252313);}else await guidedCreateProject(_0x291b56=>runCreate(_0x291b56,_0x252313),_0x252313[_0x570754(0x200)],_0x252313[_0x570754(0x1fb)]);}}async function runCreate(_0x11283a,_0x3e8425){const _0x213e78=a143_0x57ff;if(!_0x11283a[_0x213e78(0x24d)]||_0x11283a[_0x213e78(0x24d)]['trim']()==='')throw new Error(_0x213e78(0x211));const _0x555065=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x555065['test'](_0x11283a['projectName']))throw new Error(_0x213e78(0x1f7));if(_0x11283a['projectName'][_0x213e78(0x1f0)]>0x64)throw new Error(_0x213e78(0x24a));const _0x200cd3=a143_0x544674[_0x213e78(0x22f)](process[_0x213e78(0x1fc)](),_0x11283a[_0x213e78(0x24d)]);if(a143_0x2b8d26[_0x213e78(0x203)](_0x200cd3))throw new Error(_0x213e78(0x221)+_0x11283a['projectName']+'\x20already\x20exists');try{a143_0x2b8d26[_0x213e78(0x20d)](a143_0x544674['dirname'](_0x200cd3),a143_0x2b8d26[_0x213e78(0x237)][_0x213e78(0x21c)]);}catch{throw new Error(_0x213e78(0x209));}logger[_0x213e78(0x222)](_0x200cd3),logger['info'](_0x213e78(0x219),_0x213e78(0x1f3)+_0x11283a['projectName'],{'projectDir':_0x200cd3,'appCode':_0x11283a[_0x213e78(0x1fe)]}),console[_0x213e78(0x21f)](),console['log'](a143_0x520a72[_0x213e78(0x235)](_0x213e78(0x22d))+_0x213e78(0x20f)+a143_0x520a72['green'](_0x11283a[_0x213e78(0x24d)])+(_0x11283a[_0x213e78(0x1fe)]?_0x213e78(0x1fd)+a143_0x520a72[_0x213e78(0x234)](_0x11283a[_0x213e78(0x1fe)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x11283a[_0x213e78(0x24d)])),await updatePackageJsonName(_0x11283a[_0x213e78(0x24d)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x11283a[_0x213e78(0x24d)])),await runTask(_0x213e78(0x204),()=>formatProjectCode(_0x11283a[_0x213e78(0x24d)])),await configureAppCode(_0x11283a[_0x213e78(0x24d)],_0x11283a['appCode']||'',_0x11283a[_0x213e78(0x200)]);let _0x4866be=![];if(_0x11283a['appCode']){console[_0x213e78(0x21f)](_0x213e78(0x24f));const _0xb9a489=process['cwd']();try{process[_0x213e78(0x20e)](_0x200cd3);const _0x16b917=_0x11283a[_0x213e78(0x200)]||_0x213e78(0x1f5);initEnv(_0x16b917);const {configArray:_0x3db896}=await fetchModelList(_0x11283a[_0x213e78(0x1fe)],_0x3e8425[_0x213e78(0x1fb)]||''),_0x30c5df=DEFAULT_API_DIR,_0x1df86a=await generateApiFile(_0x3db896,'',_0x11283a[_0x213e78(0x1fe)],!![],_0x16b917,_0x30c5df);console['log'](_0x213e78(0x248)+_0x3db896[_0x213e78(0x1f0)]+'\x20dataset(s),\x20generated\x20'+_0x1df86a[_0x213e78(0x21e)]+'\x20model(s)'),logger[_0x213e78(0x244)](_0x213e78(0x219),'API\x20configuration\x20pulled:\x20'+_0x11283a['appCode']);}catch(_0x6a34c3){_0x4866be=!![],console[_0x213e78(0x21f)](_0x213e78(0x23b)),logger[_0x213e78(0x227)](_0x213e78(0x219),_0x213e78(0x1f4),{'error':_0x6a34c3 instanceof Error?_0x6a34c3[_0x213e78(0x20b)]:String(_0x6a34c3)});}finally{process[_0x213e78(0x20e)](_0xb9a489);}}logger[_0x213e78(0x1ff)](_0x213e78(0x219),_0x213e78(0x239)+_0x11283a[_0x213e78(0x24d)]),console[_0x213e78(0x21f)](),console[_0x213e78(0x21f)](a143_0x520a72[_0x213e78(0x235)]('─'['repeat'](0x3c))),console[_0x213e78(0x21f)](a143_0x520a72[_0x213e78(0x234)]['bold'](_0x213e78(0x245))),console[_0x213e78(0x21f)](),console[_0x213e78(0x21f)](_0x213e78(0x247)+a143_0x520a72[_0x213e78(0x234)][_0x213e78(0x230)](_0x213e78(0x21d)+_0x11283a[_0x213e78(0x24d)]+_0x213e78(0x1f6)+CLI_BIN_NAME+'\x20run\x20start')),_0x4866be&&console[_0x213e78(0x21f)](_0x213e78(0x238)+a143_0x520a72[_0x213e78(0x234)][_0x213e78(0x230)](CLI_BIN_NAME+_0x213e78(0x233))),console[_0x213e78(0x21f)](a143_0x520a72[_0x213e78(0x235)]('─'[_0x213e78(0x1f8)](0x3c)));}catch(_0xd9362e){logger['error'](_0x213e78(0x219),_0x213e78(0x1ee)+_0x11283a[_0x213e78(0x24d)],{'error':_0xd9362e instanceof Error?_0xd9362e[_0x213e78(0x20b)]:String(_0xd9362e)});try{a143_0x2b8d26[_0x213e78(0x203)](_0x200cd3)&&(console[_0x213e78(0x21f)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x200cd3),a143_0x2b8d26[_0x213e78(0x23a)](_0x200cd3,{'recursive':!![],'force':!![]}));}catch{logger[_0x213e78(0x227)]('create',_0x213e78(0x23d)+_0x200cd3);}throw _0xd9362e;}}async function runTask(_0x556e67,_0x552eff){const _0x39a1f5=a143_0x57ff,_0x21d6f0=a143_0x15c5a9(_0x556e67+_0x39a1f5(0x22a))[_0x39a1f5(0x22e)]();try{const _0x5ac5ab=await _0x552eff();_0x21d6f0[_0x39a1f5(0x207)](),console[_0x39a1f5(0x21f)](''+a143_0x520a72[_0x39a1f5(0x235)](_0x39a1f5(0x22d))+_0x556e67+'\x20'+a143_0x520a72[_0x39a1f5(0x21b)]('['+_0x5ac5ab+']'));}catch(_0x489ef9){_0x21d6f0[_0x39a1f5(0x1f9)](_0x556e67);throw _0x489ef9;}}async function updatePackageJsonName(_0x163c61){const _0x19bc72=a143_0x57ff,_0x2dad67=a143_0x544674[_0x19bc72(0x22f)](process['cwd'](),_0x163c61),_0x1c92de=a143_0x544674[_0x19bc72(0x224)](_0x2dad67,_0x19bc72(0x24b));try{console[_0x19bc72(0x21f)](_0x19bc72(0x241));const _0x3c91d9=getRabetbaseCliPackageRoot(),_0x57f80c=a143_0x544674['join'](_0x3c91d9,'package.json');let _0x3966af=_0x19bc72(0x214);try{const _0x4444f9=JSON['parse'](a143_0x2b8d26[_0x19bc72(0x226)](_0x57f80c,_0x19bc72(0x213)));_0x3966af=_0x4444f9[_0x19bc72(0x246)]||_0x19bc72(0x214);}catch{}const _0x5e514c=a143_0x2b8d26[_0x19bc72(0x226)](_0x1c92de,_0x19bc72(0x213)),_0x1cc08a=JSON[_0x19bc72(0x208)](_0x5e514c);_0x1cc08a[_0x19bc72(0x220)]=_0x163c61,_0x1cc08a[_0x19bc72(0x23e)]=_0x163c61+_0x19bc72(0x22b)+_0x3966af,a143_0x2b8d26[_0x19bc72(0x218)](_0x1c92de,JSON[_0x19bc72(0x24e)](_0x1cc08a,null,0x2)+'\x0a','utf8'),console[_0x19bc72(0x21f)](_0x19bc72(0x225)+_0x163c61),logger['info'](_0x19bc72(0x219),_0x19bc72(0x202));}catch(_0x209131){logger['error'](_0x19bc72(0x219),'更新\x20package.json\x20失败');throw _0x209131;}}async function configureAppCode(_0x3a4bb7,_0x2b8427,_0x1512eb){const _0x423395=a143_0x57ff,_0x2aee15=a143_0x544674[_0x423395(0x22f)](process[_0x423395(0x1fc)](),_0x3a4bb7),_0x2dcc23=a143_0x544674[_0x423395(0x224)](_0x2aee15,NEW_CONFIG_NAME);try{_0x2b8427?console['log'](_0x423395(0x236)+_0x3a4bb7+':\x20'+_0x2b8427):console[_0x423395(0x21f)](_0x423395(0x215)+_0x3a4bb7);const _0x3027d3=getRabetbaseCliPackageRoot(),_0x460975=a143_0x544674[_0x423395(0x224)](_0x3027d3,_0x423395(0x24b));let _0x5dd327=_0x423395(0x214);try{const _0x1d9419=JSON[_0x423395(0x208)](a143_0x2b8d26['readFileSync'](_0x460975,'utf8'));_0x5dd327=_0x1d9419[_0x423395(0x246)]||_0x423395(0x214);}catch{}const _0x471e18=readConfig(),_0x205184=typeof _0x471e18[_0x423395(0x200)]==='string'?_0x471e18[_0x423395(0x200)]:undefined,_0x4b18a8={};for(const _0x31dca6 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x471e18[_0x31dca6]!=null)_0x4b18a8[_0x31dca6]=_0x471e18[_0x31dca6];}const _0x127db8=buildCanonicalProjectConfig(_0x4b18a8,{'appCodes':_0x2b8427?[_0x2b8427]:[],'env':_0x1512eb||_0x205184||'production','metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x5dd327}});writeConfigFile(_0x2dcc23,_0x127db8),_0x2b8427?console[_0x423395(0x21f)]('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object[_0x423395(0x210)](_0x127db8[_0x423395(0x232)]||{})[_0x423395(0x224)](',\x20')+_0x423395(0x23f)+_0x127db8[_0x423395(0x249)]):console[_0x423395(0x21f)](_0x423395(0x228)+CLI_BIN_NAME+_0x423395(0x242)),logger['info'](_0x423395(0x219),_0x423395(0x1ef)+_0x2b8427);}catch(_0x5455d7){logger['error'](_0x423395(0x219),_0x423395(0x240));}}
@@ -1 +1 @@
1
- (function(_0x5bf916,_0x2dabe6){const _0x1300cb=a143_0x25f5,_0x30b303=_0x5bf916();while(!![]){try{const _0x48ff32=parseInt(_0x1300cb(0x186))/0x1*(-parseInt(_0x1300cb(0x18b))/0x2)+parseInt(_0x1300cb(0x15e))/0x3+-parseInt(_0x1300cb(0x177))/0x4*(parseInt(_0x1300cb(0x188))/0x5)+parseInt(_0x1300cb(0x175))/0x6+parseInt(_0x1300cb(0x195))/0x7*(-parseInt(_0x1300cb(0x168))/0x8)+parseInt(_0x1300cb(0x178))/0x9+-parseInt(_0x1300cb(0x17e))/0xa*(parseInt(_0x1300cb(0x16d))/0xb);if(_0x48ff32===_0x2dabe6)break;else _0x30b303['push'](_0x30b303['shift']());}catch(_0x1892a1){_0x30b303['push'](_0x30b303['shift']());}}}(a143_0x46e7,0xbea9b));import a143_0x55d6b3 from'path';import a143_0x30eaf7 from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';function a143_0x25f5(_0x3a687c,_0x4cb6bc){_0x3a687c=_0x3a687c-0x15e;const _0x46e751=a143_0x46e7();let _0x25f55f=_0x46e751[_0x3a687c];return _0x25f55f;}function a143_0x46e7(){const _0x549013=['\x20api\x20pull`\x20manually\x20later.','production','chdir','modelCount','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','7VozTcJ','Use\x20a\x20different\x20project\x20name.','npm','string','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','dirname','3588684EdHkjh','env','name','description','\x0a\x20\x20cd\x20','join','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','\x20created\x20successfully!','length','\x20\x20√\x20Pulled\x20','3792720MqpZfI','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','bun\x20run\x20format','package.json','readFile','4153501tZwnGP','Project\x20name\x20cannot\x20be\x20empty.','cwd','\x20dataset(s),\x20generated\x20','ignore','*\x20Creating\x20project\x20','belowMinimum','validation','4078392QVZNbz','bun\x20--version','894328YXvtsd','8894556ASOCJu','...','\x20\x20Installing\x20dependencies...','resolve','\x0a√\x20Project\x20','W_OK','10kHtRGB','\x20\x20√\x20Code\x20formatted','Project\x20directory\x20\x22','writeFile','\x20\x20√\x20package.json\x20updated','Cannot\x20create\x20project\x20in\x20current\x20directory.','stringify','\x20model(s)','53054rknyWX','\x22\x20already\x20exists.','5dqirZW','test','needsUpgrade','38sfgAIp','log','toLocaleString','\x20\x20√\x20Project\x20template\x20created','bun'];a143_0x46e7=function(){return _0x549013;};return a143_0x46e7();}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(_0x5ecc6e,_0x4c438b,_0x32c8ce,_0x383fa2){const _0x456e0b=a143_0x25f5,_0x37813c=await checkCliVersion();(_0x37813c[_0x456e0b(0x18a)]||_0x37813c[_0x456e0b(0x173)])&&(printCliUpgradeWarning(_0x37813c),assertCliVersionSupported(_0x37813c));if(!_0x5ecc6e||_0x5ecc6e['trim']()==='')throw CliErrors[_0x456e0b(0x174)](_0x456e0b(0x16e));const _0x3c862c=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x3c862c[_0x456e0b(0x189)](_0x5ecc6e))throw CliErrors['validation']('Project\x20name\x20contains\x20invalid\x20characters.',_0x456e0b(0x164));if(_0x5ecc6e[_0x456e0b(0x166)]>0x64)throw CliErrors[_0x456e0b(0x174)](_0x456e0b(0x199));const _0x1c560e=a143_0x55d6b3[_0x456e0b(0x17b)](process[_0x456e0b(0x16f)](),_0x5ecc6e);if(existsSync(_0x1c560e))throw CliErrors[_0x456e0b(0x174)](_0x456e0b(0x180)+_0x5ecc6e+_0x456e0b(0x187),_0x456e0b(0x196));try{const _0x14b84a=a143_0x55d6b3[_0x456e0b(0x19a)](_0x1c560e);await a143_0x30eaf7['access'](_0x14b84a,a143_0x30eaf7['constants'][_0x456e0b(0x17d)]);}catch{throw CliErrors[_0x456e0b(0x174)](_0x456e0b(0x183),'Check\x20directory\x20permissions.');}try{console['log'](_0x456e0b(0x172)+_0x5ecc6e+_0x456e0b(0x179));const _0x4f4999=getSubAppReactDemoTemplateDir();await copyDirectory(_0x4f4999,_0x1c560e),console[_0x456e0b(0x18c)](_0x456e0b(0x18e)),await updatePackageJsonName(_0x5ecc6e),console[_0x456e0b(0x18c)](_0x456e0b(0x182)),console[_0x456e0b(0x18c)](_0x456e0b(0x17a)),console[_0x456e0b(0x18c)](_0x456e0b(0x194)),await formatCode(_0x1c560e),console[_0x456e0b(0x18c)](_0x456e0b(0x17f)),await configureProject(_0x5ecc6e,_0x32c8ce,_0x4c438b),console[_0x456e0b(0x18c)]('\x20\x20√\x20Configuration\x20file\x20created'),_0x32c8ce&&await pullApiConfig(_0x1c560e,_0x32c8ce,_0x4c438b,_0x383fa2),console[_0x456e0b(0x18c)](_0x456e0b(0x17c)+_0x5ecc6e+_0x456e0b(0x165)),console[_0x456e0b(0x18c)](_0x456e0b(0x162)+_0x5ecc6e),console['log']('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0x3b04d6){try{existsSync(_0x1c560e)&&await a143_0x30eaf7['rm'](_0x1c560e,{'recursive':!![],'force':!![]});}catch{}throw _0x3b04d6;}}async function updatePackageJsonName(_0x1d301f){const _0x3a0b1d=a143_0x25f5,_0x5d757f=a143_0x55d6b3['resolve'](process[_0x3a0b1d(0x16f)](),_0x1d301f),_0x25a1db=a143_0x55d6b3[_0x3a0b1d(0x163)](_0x5d757f,_0x3a0b1d(0x16b)),_0x5002fb=await a143_0x30eaf7[_0x3a0b1d(0x16c)](_0x25a1db,'utf-8'),_0x2d819b=JSON['parse'](_0x5002fb);_0x2d819b[_0x3a0b1d(0x160)]=_0x1d301f,_0x2d819b[_0x3a0b1d(0x161)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a143_0x30eaf7[_0x3a0b1d(0x181)](_0x25a1db,JSON[_0x3a0b1d(0x184)](_0x2d819b,null,0x2)+'\x0a');}function detectPackageManager(){const _0x14e71e=a143_0x25f5;try{return execSync(_0x14e71e(0x176),{'stdio':_0x14e71e(0x171)}),_0x14e71e(0x18f);}catch{return _0x14e71e(0x197);}}async function formatCode(_0x2b7a8d){const _0x52eb1b=a143_0x25f5;try{await execAsync(_0x52eb1b(0x16a),{'cwd':_0x2b7a8d});}catch{}}async function configureProject(_0x29efc2,_0x500319,_0x45beff){const _0x5950fb=a143_0x25f5,_0x5861c6=a143_0x55d6b3[_0x5950fb(0x17b)](process[_0x5950fb(0x16f)](),_0x29efc2),_0x38da8f=a143_0x55d6b3['join'](_0x5861c6,NEW_CONFIG_NAME),_0x478c55=readConfig(),_0x21d56e=typeof _0x478c55[_0x5950fb(0x15f)]===_0x5950fb(0x198)?_0x478c55[_0x5950fb(0x15f)]:undefined,_0x20313a={};for(const _0x251054 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x478c55[_0x251054]!=null)_0x20313a[_0x251054]=_0x478c55[_0x251054];}const _0x2ced85=buildCanonicalProjectConfig(_0x20313a,{'appCodes':_0x500319?[_0x500319]:[],'env':_0x45beff||_0x21d56e||_0x5950fb(0x191),'metadata':{'createdAt':new Date()[_0x5950fb(0x18d)](),'version':getCliVersion()}});writeConfigFile(_0x38da8f,_0x2ced85);}async function pullApiConfig(_0xc5e44e,_0x4ce5c0,_0x2378fc,_0x539b9e){const _0x1ad725=a143_0x25f5,_0x16d2fd=process[_0x1ad725(0x16f)]();try{process['chdir'](_0xc5e44e);const _0x373ea2=_0x2378fc||_0x1ad725(0x191);initEnv(_0x373ea2),console[_0x1ad725(0x18c)]('\x20\x20Pulling\x20API\x20configuration...');const {configArray:_0x189fc8}=await fetchModelList(_0x4ce5c0,_0x539b9e||''),_0x14a870=await generateApiFile(_0x189fc8,'',_0x4ce5c0,!![],_0x373ea2,DEFAULT_API_DIR);console[_0x1ad725(0x18c)](_0x1ad725(0x167)+_0x189fc8[_0x1ad725(0x166)]+_0x1ad725(0x170)+_0x14a870[_0x1ad725(0x193)]+_0x1ad725(0x185));}catch(_0x241864){console[_0x1ad725(0x18c)](_0x1ad725(0x169)+CLI_BIN_NAME+_0x1ad725(0x190));}finally{process[_0x1ad725(0x192)](_0x16d2fd);}}
1
+ (function(_0x47dc19,_0x3b22d5){const _0x516866=a144_0x4c79,_0x21c8f5=_0x47dc19();while(!![]){try{const _0x255889=-parseInt(_0x516866(0xae))/0x1*(parseInt(_0x516866(0xb7))/0x2)+-parseInt(_0x516866(0x96))/0x3*(-parseInt(_0x516866(0xa6))/0x4)+-parseInt(_0x516866(0xb6))/0x5*(parseInt(_0x516866(0xac))/0x6)+parseInt(_0x516866(0xca))/0x7*(-parseInt(_0x516866(0x9b))/0x8)+-parseInt(_0x516866(0xb2))/0x9*(-parseInt(_0x516866(0x8e))/0xa)+-parseInt(_0x516866(0xc6))/0xb*(parseInt(_0x516866(0x91))/0xc)+parseInt(_0x516866(0xc1))/0xd*(parseInt(_0x516866(0xc4))/0xe);if(_0x255889===_0x3b22d5)break;else _0x21c8f5['push'](_0x21c8f5['shift']());}catch(_0x34a0a4){_0x21c8f5['push'](_0x21c8f5['shift']());}}}(a144_0x2356,0x8dded));import a144_0x46c4cf from'path';import a144_0x6a4dca from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';function a144_0x4c79(_0x3ab7e8,_0x43f392){_0x3ab7e8=_0x3ab7e8-0x8d;const _0x2356ac=a144_0x2356();let _0x4c79e7=_0x2356ac[_0x3ab7e8];return _0x4c79e7;}import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';function a144_0x2356(){const _0x4f5734=['\x20\x20√\x20Project\x20template\x20created','chdir','207335NdijrO','1951030vkfvIS','join','\x20\x20Pulling\x20API\x20configuration...','\x20\x20√\x20Code\x20formatted','description','dirname','\x20\x20√\x20package.json\x20updated','modelCount','\x20dataset(s),\x20generated\x20','access','13oLOqmd','bun\x20run\x20format','*\x20Creating\x20project\x20','44782514OkYkrj','\x20api\x20pull`\x20manually\x20later.','5855839DLZZlZ','Check\x20directory\x20permissions.','resolve','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','21qMxLdY','\x0a√\x20Project\x20','bun','string','W_OK','1130nxyvxq','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','log','24LpJLtW','validation','...','length','readFile','31470rphQXL','npm','writeFile','bun\x20--version','Project\x20directory\x20\x22','1367096TBdVDn','stringify','test','\x20created\x20successfully!','\x20\x20√\x20Configuration\x20file\x20created','\x20\x20√\x20Pulled\x20','name','cwd','utf-8','\x22\x20already\x20exists.','production','20ZSufLr','toLocaleString','constants','\x20\x20rabetbase\x20run\x20start\x0a','trim','\x0a\x20\x20cd\x20','102irIKDw','Cannot\x20create\x20project\x20in\x20current\x20directory.','1jPLFxR','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','\x20\x20Installing\x20dependencies...','46809tWvEVf','env'];a144_0x2356=function(){return _0x4f5734;};return a144_0x2356();}import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x4861b7,_0x5dca88,_0x2d24d1,_0x15334c){const _0x51d2d5=a144_0x4c79,_0x3d779d=await checkCliVersion();(_0x3d779d['needsUpgrade']||_0x3d779d['belowMinimum'])&&(printCliUpgradeWarning(_0x3d779d),assertCliVersionSupported(_0x3d779d));if(!_0x4861b7||_0x4861b7[_0x51d2d5(0xaa)]()==='')throw CliErrors[_0x51d2d5(0x92)]('Project\x20name\x20cannot\x20be\x20empty.');const _0x466afe=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x466afe[_0x51d2d5(0x9d)](_0x4861b7))throw CliErrors[_0x51d2d5(0x92)]('Project\x20name\x20contains\x20invalid\x20characters.',_0x51d2d5(0xc9));if(_0x4861b7[_0x51d2d5(0x94)]>0x64)throw CliErrors[_0x51d2d5(0x92)](_0x51d2d5(0xaf));const _0x455caa=a144_0x46c4cf[_0x51d2d5(0xc8)](process[_0x51d2d5(0xa2)](),_0x4861b7);if(existsSync(_0x455caa))throw CliErrors['validation'](_0x51d2d5(0x9a)+_0x4861b7+_0x51d2d5(0xa4),'Use\x20a\x20different\x20project\x20name.');try{const _0x289c14=a144_0x46c4cf[_0x51d2d5(0xbc)](_0x455caa);await a144_0x6a4dca[_0x51d2d5(0xc0)](_0x289c14,a144_0x6a4dca[_0x51d2d5(0xa8)][_0x51d2d5(0x8d)]);}catch{throw CliErrors['validation'](_0x51d2d5(0xad),_0x51d2d5(0xc7));}try{console[_0x51d2d5(0x90)](_0x51d2d5(0xc3)+_0x4861b7+_0x51d2d5(0x93));const _0x1a761b=getSubAppReactDemoTemplateDir();await copyDirectory(_0x1a761b,_0x455caa),console[_0x51d2d5(0x90)](_0x51d2d5(0xb4)),await updatePackageJsonName(_0x4861b7),console['log'](_0x51d2d5(0xbd)),console['log'](_0x51d2d5(0xb1)),console[_0x51d2d5(0x90)](_0x51d2d5(0xb0)),await formatCode(_0x455caa),console[_0x51d2d5(0x90)](_0x51d2d5(0xba)),await configureProject(_0x4861b7,_0x2d24d1,_0x5dca88),console[_0x51d2d5(0x90)](_0x51d2d5(0x9f)),_0x2d24d1&&await pullApiConfig(_0x455caa,_0x2d24d1,_0x5dca88,_0x15334c),console[_0x51d2d5(0x90)](_0x51d2d5(0xcb)+_0x4861b7+_0x51d2d5(0x9e)),console[_0x51d2d5(0x90)](_0x51d2d5(0xab)+_0x4861b7),console[_0x51d2d5(0x90)](_0x51d2d5(0xa9));}catch(_0x16b0be){try{existsSync(_0x455caa)&&await a144_0x6a4dca['rm'](_0x455caa,{'recursive':!![],'force':!![]});}catch{}throw _0x16b0be;}}async function updatePackageJsonName(_0x46e726){const _0x43f4b2=a144_0x4c79,_0xabbb54=a144_0x46c4cf[_0x43f4b2(0xc8)](process[_0x43f4b2(0xa2)](),_0x46e726),_0x38bf9c=a144_0x46c4cf[_0x43f4b2(0xb8)](_0xabbb54,'package.json'),_0x3ec82d=await a144_0x6a4dca[_0x43f4b2(0x95)](_0x38bf9c,_0x43f4b2(0xa3)),_0xd1a88a=JSON['parse'](_0x3ec82d);_0xd1a88a[_0x43f4b2(0xa1)]=_0x46e726,_0xd1a88a[_0x43f4b2(0xbb)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a144_0x6a4dca[_0x43f4b2(0x98)](_0x38bf9c,JSON[_0x43f4b2(0x9c)](_0xd1a88a,null,0x2)+'\x0a');}function detectPackageManager(){const _0x59c738=a144_0x4c79;try{return execSync(_0x59c738(0x99),{'stdio':'ignore'}),_0x59c738(0xcc);}catch{return _0x59c738(0x97);}}async function formatCode(_0x18738e){const _0x2d2f1d=a144_0x4c79;try{await execAsync(_0x2d2f1d(0xc2),{'cwd':_0x18738e});}catch{}}async function configureProject(_0x48631b,_0x50f1b3,_0xdce1dd){const _0x387ad5=a144_0x4c79,_0x194b39=a144_0x46c4cf[_0x387ad5(0xc8)](process['cwd'](),_0x48631b),_0x5ae3c9=a144_0x46c4cf['join'](_0x194b39,NEW_CONFIG_NAME),_0x1b6543=readConfig(),_0x5a018e=typeof _0x1b6543[_0x387ad5(0xb3)]===_0x387ad5(0xcd)?_0x1b6543[_0x387ad5(0xb3)]:undefined,_0x53767b={};for(const _0x59904a of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1b6543[_0x59904a]!=null)_0x53767b[_0x59904a]=_0x1b6543[_0x59904a];}const _0x1e3543=buildCanonicalProjectConfig(_0x53767b,{'appCodes':_0x50f1b3?[_0x50f1b3]:[],'env':_0xdce1dd||_0x5a018e||_0x387ad5(0xa5),'metadata':{'createdAt':new Date()[_0x387ad5(0xa7)](),'version':getCliVersion()}});writeConfigFile(_0x5ae3c9,_0x1e3543);}async function pullApiConfig(_0x474c84,_0x2e2a69,_0x284320,_0x1690c3){const _0x4852ad=a144_0x4c79,_0x36bdc3=process[_0x4852ad(0xa2)]();try{process[_0x4852ad(0xb5)](_0x474c84);const _0x117c6b=_0x284320||'production';initEnv(_0x117c6b),console[_0x4852ad(0x90)](_0x4852ad(0xb9));const {configArray:_0x2b41aa}=await fetchModelList(_0x2e2a69,_0x1690c3||''),_0x23b6ee=await generateApiFile(_0x2b41aa,'',_0x2e2a69,!![],_0x117c6b,DEFAULT_API_DIR);console[_0x4852ad(0x90)](_0x4852ad(0xa0)+_0x2b41aa[_0x4852ad(0x94)]+_0x4852ad(0xbf)+_0x23b6ee[_0x4852ad(0xbe)]+'\x20model(s)');}catch(_0x5b354a){console[_0x4852ad(0x90)](_0x4852ad(0x8f)+CLI_BIN_NAME+_0x4852ad(0xc5));}finally{process[_0x4852ad(0xb5)](_0x36bdc3);}}
@@ -1 +1 @@
1
- const a144_0x56a98f=a144_0x3633;(function(_0x2ea429,_0x5736b7){const _0x52d2c5=a144_0x3633,_0x22af3d=_0x2ea429();while(!![]){try{const _0x2efa84=-parseInt(_0x52d2c5(0x1c8))/0x1+-parseInt(_0x52d2c5(0x1c9))/0x2*(-parseInt(_0x52d2c5(0x1cd))/0x3)+parseInt(_0x52d2c5(0x1d0))/0x4*(-parseInt(_0x52d2c5(0x1c6))/0x5)+-parseInt(_0x52d2c5(0x1cc))/0x6*(-parseInt(_0x52d2c5(0x1d3))/0x7)+-parseInt(_0x52d2c5(0x1ca))/0x8*(-parseInt(_0x52d2c5(0x1d2))/0x9)+-parseInt(_0x52d2c5(0x1cf))/0xa+parseInt(_0x52d2c5(0x1d4))/0xb;if(_0x2efa84===_0x5736b7)break;else _0x22af3d['push'](_0x22af3d['shift']());}catch(_0x116a20){_0x22af3d['push'](_0x22af3d['shift']());}}}(a144_0x50b0,0xe0ee8));function a144_0x3633(_0x1fbd9c,_0x236e3e){_0x1fbd9c=_0x1fbd9c-0x1c6;const _0x50b038=a144_0x50b0();let _0x3633a0=_0x50b038[_0x1fbd9c];return _0x3633a0;}import a144_0x388cdf from'node:path';import{fileURLToPath}from'node:url';const __dirname=a144_0x388cdf[a144_0x56a98f(0x1c7)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x4faea5=a144_0x56a98f;return a144_0x388cdf[_0x4faea5(0x1d1)](__dirname,_0x4faea5(0x1ce));}export function getSubAppReactDemoTemplateDir(){const _0x42affc=a144_0x56a98f;return a144_0x388cdf['join'](getRabetbaseCliPackageRoot(),'templates',_0x42affc(0x1cb),'sub-app-react-demo');}function a144_0x50b0(){const _0x5465ae=['27378439DYKyDo','71125aXghwX','dirname','165617sYoXTY','46fXzttq','351280VmuznZ','projects','12oZIWiS','32217ceWuVU','../../../../','13549980rXCFcL','140JEWrcI','resolve','27rmrSHe','252469XGMlJN'];a144_0x50b0=function(){return _0x5465ae;};return a144_0x50b0();}
1
+ const a145_0x398cba=a145_0x4131;(function(_0x52848b,_0x18bf26){const _0x12112e=a145_0x4131,_0x109b21=_0x52848b();while(!![]){try{const _0x5825ac=-parseInt(_0x12112e(0xcf))/0x1*(parseInt(_0x12112e(0xc8))/0x2)+-parseInt(_0x12112e(0xcd))/0x3+-parseInt(_0x12112e(0xd3))/0x4+-parseInt(_0x12112e(0xc6))/0x5+-parseInt(_0x12112e(0xce))/0x6*(parseInt(_0x12112e(0xd5))/0x7)+-parseInt(_0x12112e(0xc9))/0x8+parseInt(_0x12112e(0xd2))/0x9*(parseInt(_0x12112e(0xd1))/0xa);if(_0x5825ac===_0x18bf26)break;else _0x109b21['push'](_0x109b21['shift']());}catch(_0x31b7ad){_0x109b21['push'](_0x109b21['shift']());}}}(a145_0x23d4,0x1fa71));import a145_0x4d91c5 from'node:path';function a145_0x23d4(){const _0x4ef382=['15012MPsGDp','17ygofld','resolve','847330zBYfTt','72eKBRjF','232304rTSScg','projects','112jUPwmu','94950KDfihT','dirname','17080WenFBt','367768Jcxztq','join','sub-app-react-demo','templates','719898ECIeJH'];a145_0x23d4=function(){return _0x4ef382;};return a145_0x23d4();}import{fileURLToPath}from'node:url';const __dirname=a145_0x4d91c5[a145_0x398cba(0xc7)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x33851f=a145_0x398cba;return a145_0x4d91c5[_0x33851f(0xd0)](__dirname,'../../../../');}function a145_0x4131(_0x3834a9,_0x6cd7b6){_0x3834a9=_0x3834a9-0xc6;const _0x23d40f=a145_0x23d4();let _0x41314c=_0x23d40f[_0x3834a9];return _0x41314c;}export function getSubAppReactDemoTemplateDir(){const _0x177446=a145_0x398cba;return a145_0x4d91c5[_0x177446(0xca)](getRabetbaseCliPackageRoot(),_0x177446(0xcc),_0x177446(0xd4),_0x177446(0xcb));}
@@ -1 +1 @@
1
- (function(_0x12d969,_0x42a2b8){const _0x5b2d6a=a145_0x1d27,_0x2ab504=_0x12d969();while(!![]){try{const _0x4f4710=parseInt(_0x5b2d6a(0x12f))/0x1*(parseInt(_0x5b2d6a(0x12e))/0x2)+-parseInt(_0x5b2d6a(0x130))/0x3+-parseInt(_0x5b2d6a(0x12d))/0x4*(-parseInt(_0x5b2d6a(0x124))/0x5)+-parseInt(_0x5b2d6a(0x135))/0x6+-parseInt(_0x5b2d6a(0x129))/0x7*(-parseInt(_0x5b2d6a(0x12b))/0x8)+parseInt(_0x5b2d6a(0x132))/0x9+parseInt(_0x5b2d6a(0x128))/0xa*(-parseInt(_0x5b2d6a(0x125))/0xb);if(_0x4f4710===_0x42a2b8)break;else _0x2ab504['push'](_0x2ab504['shift']());}catch(_0x1f67ca){_0x2ab504['push'](_0x2ab504['shift']());}}}(a145_0x5d7e,0xae744));import a145_0x553525 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';function a145_0x1d27(_0x1be448,_0x3f17e0){_0x1be448=_0x1be448-0x123;const _0x5d7ed9=a145_0x5d7e();let _0x1d271e=_0x5d7ed9[_0x1be448];return _0x1d271e;}function a145_0x5d7e(){const _0x3c8977=['6587BuEQnP','项目模板复制完成','11224vVmgcq','copy','3276332zWcQja','754NlHKqJ','2811KOZwDP','2599155cikLEg','success','7727121BOwHkz','开始复制项目模板','info','6473634zwZftH','resolve','cwd','5KhUjkF','22lQWWLv','now','error','6988670XtMZAu'];a145_0x5d7e=function(){return _0x3c8977;};return a145_0x5d7e();}import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x4ca49b){const _0x18179b=a145_0x1d27,_0x3daef9=Date['now'](),_0x1d632e=a145_0x553525[_0x18179b(0x136)](process[_0x18179b(0x123)](),_0x4ca49b);try{logger[_0x18179b(0x134)](_0x18179b(0x12c),_0x18179b(0x133),{'projectCode':_0x4ca49b,'templateDir':templateDir}),await copyDirectory(templateDir,_0x1d632e);const _0x5de33d=Date[_0x18179b(0x126)]()-_0x3daef9;logger[_0x18179b(0x131)](_0x18179b(0x12c),_0x18179b(0x12a),_0x5de33d,{'projectCode':_0x4ca49b});}catch(_0x405a36){const _0x329da9=Date[_0x18179b(0x126)]()-_0x3daef9;logger[_0x18179b(0x127)]('copy','项目模板复制失败',{'projectCode':_0x4ca49b,'error':_0x405a36 instanceof Error?_0x405a36['message']:String(_0x405a36),'duration':_0x329da9});throw _0x405a36;}return formatElapsed(_0x3daef9);}
1
+ (function(_0x13e05f,_0x3914de){const _0x1aa028=a146_0x3146,_0x1f61ad=_0x13e05f();while(!![]){try{const _0xd90180=parseInt(_0x1aa028(0x1e7))/0x1*(parseInt(_0x1aa028(0x1e9))/0x2)+-parseInt(_0x1aa028(0x1f6))/0x3+parseInt(_0x1aa028(0x1ee))/0x4*(parseInt(_0x1aa028(0x1f3))/0x5)+parseInt(_0x1aa028(0x1eb))/0x6+-parseInt(_0x1aa028(0x1e6))/0x7+-parseInt(_0x1aa028(0x1ec))/0x8*(parseInt(_0x1aa028(0x1e8))/0x9)+parseInt(_0x1aa028(0x1f2))/0xa;if(_0xd90180===_0x3914de)break;else _0x1f61ad['push'](_0x1f61ad['shift']());}catch(_0x55f5ed){_0x1f61ad['push'](_0x1f61ad['shift']());}}}(a146_0x1485,0xaaae6));function a146_0x3146(_0x2709fa,_0x3b976c){_0x2709fa=_0x2709fa-0x1e6;const _0x148515=a146_0x1485();let _0x314620=_0x148515[_0x2709fa];return _0x314620;}import a146_0x261206 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';function a146_0x1485(){const _0x268f85=['8SbzKGz','info','16ntVxCd','开始复制项目模板','now','项目模板复制失败','5509990pFzyRx','377830HbJzLw','error','项目模板复制完成','1439508qQsZOe','535465hghLIE','325762sPMROQ','170514QsChrc','2xlAyom','copy','572172kNxWxM'];a146_0x1485=function(){return _0x268f85;};return a146_0x1485();}const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x51c0a3){const _0x154fd8=a146_0x3146,_0x5607a8=Date[_0x154fd8(0x1f0)](),_0x351ad0=a146_0x261206['resolve'](process['cwd'](),_0x51c0a3);try{logger[_0x154fd8(0x1ed)]('copy',_0x154fd8(0x1ef),{'projectCode':_0x51c0a3,'templateDir':templateDir}),await copyDirectory(templateDir,_0x351ad0);const _0x479c5a=Date[_0x154fd8(0x1f0)]()-_0x5607a8;logger['success'](_0x154fd8(0x1ea),_0x154fd8(0x1f5),_0x479c5a,{'projectCode':_0x51c0a3});}catch(_0x5c9d2b){const _0x1f3915=Date[_0x154fd8(0x1f0)]()-_0x5607a8;logger[_0x154fd8(0x1f4)](_0x154fd8(0x1ea),_0x154fd8(0x1f1),{'projectCode':_0x51c0a3,'error':_0x5c9d2b instanceof Error?_0x5c9d2b['message']:String(_0x5c9d2b),'duration':_0x1f3915});throw _0x5c9d2b;}return formatElapsed(_0x5607a8);}
@@ -1 +1 @@
1
- function a146_0x540c(_0x5817bf,_0x68d865){_0x5817bf=_0x5817bf-0xc6;const _0x5c20c6=a146_0x5c20();let _0x540c90=_0x5c20c6[_0x5817bf];return _0x540c90;}(function(_0x552ecd,_0x1aec39){const _0x93248d=a146_0x540c,_0x43f160=_0x552ecd();while(!![]){try{const _0x292608=-parseInt(_0x93248d(0xc8))/0x1*(parseInt(_0x93248d(0xcc))/0x2)+-parseInt(_0x93248d(0xc6))/0x3+-parseInt(_0x93248d(0xca))/0x4*(parseInt(_0x93248d(0xd7))/0x5)+parseInt(_0x93248d(0xcb))/0x6+parseInt(_0x93248d(0xd2))/0x7*(parseInt(_0x93248d(0xd5))/0x8)+-parseInt(_0x93248d(0xc9))/0x9*(-parseInt(_0x93248d(0xda))/0xa)+parseInt(_0x93248d(0xd1))/0xb;if(_0x292608===_0x1aec39)break;else _0x43f160['push'](_0x43f160['shift']());}catch(_0x6dab3){_0x43f160['push'](_0x43f160['shift']());}}}(a146_0x5c20,0xa14fd));import a146_0x4ec831 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a146_0x5c20(){const _0x5acb79=['success','代码格式化失败','now','9641357QAusAv','54299ubeTwJ','npx','error','104HVTsta','开始格式化代码','5xZWRuP','cwd','message','30uFIhfF','代码格式化完成','3100581tMONgO','format','31107GWUnJa','3640122OsCwAs','2365148jWXZAx','1128996gBRaRq','6oymHDv','resolve'];a146_0x5c20=function(){return _0x5acb79;};return a146_0x5c20();}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x2b17da){const _0x5b886d=a146_0x540c,_0x5d9c6b=Date[_0x5b886d(0xd0)](),_0x2d47e7=a146_0x4ec831[_0x5b886d(0xcd)](process[_0x5b886d(0xd8)](),_0x2b17da);try{logger['info']('format',_0x5b886d(0xd6),{'projectCode':_0x2b17da}),await execa(resolveNpmBin(_0x5b886d(0xd3)),['prettier','--write','.'],{'cwd':_0x2d47e7});const _0x58ddbf=Date[_0x5b886d(0xd0)]()-_0x5d9c6b;logger[_0x5b886d(0xce)](_0x5b886d(0xc7),_0x5b886d(0xdb),_0x58ddbf,{'projectCode':_0x2b17da});}catch(_0x1dcced){const _0x38d43c=Date[_0x5b886d(0xd0)]()-_0x5d9c6b;logger[_0x5b886d(0xd4)](_0x5b886d(0xc7),_0x5b886d(0xcf),{'projectCode':_0x2b17da,'error':_0x1dcced instanceof Error?_0x1dcced[_0x5b886d(0xd9)]:String(_0x1dcced),'duration':_0x38d43c});throw _0x1dcced;}return formatElapsed(_0x5d9c6b);}
1
+ function a147_0x3b0b(_0x1955a1,_0x199574){_0x1955a1=_0x1955a1-0x12b;const _0x790fa4=a147_0x790f();let _0x3b0b88=_0x790fa4[_0x1955a1];return _0x3b0b88;}(function(_0x508c5e,_0x2d592c){const _0x1c6ac8=a147_0x3b0b,_0x17682e=_0x508c5e();while(!![]){try{const _0x4cee5a=parseInt(_0x1c6ac8(0x132))/0x1+-parseInt(_0x1c6ac8(0x13f))/0x2*(parseInt(_0x1c6ac8(0x13b))/0x3)+parseInt(_0x1c6ac8(0x139))/0x4+parseInt(_0x1c6ac8(0x13c))/0x5+parseInt(_0x1c6ac8(0x140))/0x6+parseInt(_0x1c6ac8(0x12d))/0x7+parseInt(_0x1c6ac8(0x137))/0x8*(-parseInt(_0x1c6ac8(0x131))/0x9);if(_0x4cee5a===_0x2d592c)break;else _0x17682e['push'](_0x17682e['shift']());}catch(_0x8a12ed){_0x17682e['push'](_0x17682e['shift']());}}}(a147_0x790f,0x54215));import a147_0x24aa27 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a147_0x790f(){const _0x33d8e4=['4658290GMHPpk','resolve','message','npx','9NHHUQn','688105VQBzdm','代码格式化完成','cwd','--write','开始格式化代码','8407408mkaZMx','now','142428YXznqd','prettier','1914882MDvsJP','2023855BVseXt','success','format','2OxUyMq','1439184suCylL','代码格式化失败','error'];a147_0x790f=function(){return _0x33d8e4;};return a147_0x790f();}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0xf6f55e){const _0x27fddc=a147_0x3b0b,_0x284fdf=Date[_0x27fddc(0x138)](),_0x20e522=a147_0x24aa27[_0x27fddc(0x12e)](process[_0x27fddc(0x134)](),_0xf6f55e);try{logger['info'](_0x27fddc(0x13e),_0x27fddc(0x136),{'projectCode':_0xf6f55e}),await execa(resolveNpmBin(_0x27fddc(0x130)),[_0x27fddc(0x13a),_0x27fddc(0x135),'.'],{'cwd':_0x20e522});const _0x5e96d3=Date[_0x27fddc(0x138)]()-_0x284fdf;logger[_0x27fddc(0x13d)](_0x27fddc(0x13e),_0x27fddc(0x133),_0x5e96d3,{'projectCode':_0xf6f55e});}catch(_0x4f20d6){const _0x59d56e=Date[_0x27fddc(0x138)]()-_0x284fdf;logger[_0x27fddc(0x12c)]('format',_0x27fddc(0x12b),{'projectCode':_0xf6f55e,'error':_0x4f20d6 instanceof Error?_0x4f20d6[_0x27fddc(0x12f)]:String(_0x4f20d6),'duration':_0x59d56e});throw _0x4f20d6;}return formatElapsed(_0x284fdf);}
@@ -1 +1 @@
1
- (function(_0x570e54,_0x2fd474){const _0x5db526=a147_0x255e,_0x122b72=_0x570e54();while(!![]){try{const _0x56805c=-parseInt(_0x5db526(0x9b))/0x1+parseInt(_0x5db526(0x9e))/0x2+parseInt(_0x5db526(0x95))/0x3*(parseInt(_0x5db526(0xa2))/0x4)+parseInt(_0x5db526(0x93))/0x5+-parseInt(_0x5db526(0x9d))/0x6*(parseInt(_0x5db526(0x9c))/0x7)+parseInt(_0x5db526(0x92))/0x8+parseInt(_0x5db526(0x8f))/0x9*(-parseInt(_0x5db526(0x90))/0xa);if(_0x56805c===_0x2fd474)break;else _0x122b72['push'](_0x122b72['shift']());}catch(_0x3af18e){_0x122b72['push'](_0x122b72['shift']());}}}(a147_0x282a,0x510ad));import a147_0x5a618d from'node:path';import{execa}from'execa';function a147_0x255e(_0x51fd2d,_0x1a71a8){_0x51fd2d=_0x51fd2d-0x8f;const _0x282a22=a147_0x282a();let _0x255e5d=_0x282a22[_0x51fd2d];return _0x255e5d;}function a147_0x282a(){const _0x570285=['error','success','664NcTELF','6336KWdlPf','2200INjFZE','npm','3084368GDGoAj','1973090gxIkmz','install','1839WEKxSU','info','依赖安装失败','--registry','依赖安装完成','now','82123enoQLs','1862ykgsqB','8862anPtdC','159824WFzvIU','https://registry.npmmirror.com'];a147_0x282a=function(){return _0x570285;};return a147_0x282a();}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(_0x455c9f){const _0x153b23=a147_0x255e,_0x40fc2f=Date[_0x153b23(0x9a)](),_0x20aac8=a147_0x5a618d['resolve'](process['cwd'](),_0x455c9f);try{logger[_0x153b23(0x96)](_0x153b23(0x94),'开始安装依赖',{'projectCode':_0x455c9f,'registry':_0x153b23(0x9f)}),await execa(resolveNpmBin(_0x153b23(0x91)),[_0x153b23(0x94),_0x153b23(0x98),_0x153b23(0x9f)],{'cwd':_0x20aac8});const _0x466dff=Date['now']()-_0x40fc2f;logger[_0x153b23(0xa1)]('install',_0x153b23(0x99),_0x466dff,{'projectCode':_0x455c9f});}catch(_0x2dc795){const _0x16181b=Date[_0x153b23(0x9a)]()-_0x40fc2f;logger[_0x153b23(0xa0)](_0x153b23(0x94),_0x153b23(0x97),{'projectCode':_0x455c9f,'error':_0x2dc795 instanceof Error?_0x2dc795['message']:String(_0x2dc795),'duration':_0x16181b});throw _0x2dc795;}return formatElapsed(_0x40fc2f);}
1
+ (function(_0x4f4f83,_0x295aa9){const _0x1acbf2=a148_0x3c07,_0x3e022d=_0x4f4f83();while(!![]){try{const _0x668762=parseInt(_0x1acbf2(0x1f2))/0x1*(parseInt(_0x1acbf2(0x1f1))/0x2)+parseInt(_0x1acbf2(0x1ef))/0x3*(-parseInt(_0x1acbf2(0x1f9))/0x4)+-parseInt(_0x1acbf2(0x1fa))/0x5*(-parseInt(_0x1acbf2(0x206))/0x6)+parseInt(_0x1acbf2(0x1f5))/0x7*(-parseInt(_0x1acbf2(0x1fc))/0x8)+-parseInt(_0x1acbf2(0x1f6))/0x9*(parseInt(_0x1acbf2(0x201))/0xa)+parseInt(_0x1acbf2(0x204))/0xb+-parseInt(_0x1acbf2(0x200))/0xc*(-parseInt(_0x1acbf2(0x1fb))/0xd);if(_0x668762===_0x295aa9)break;else _0x3e022d['push'](_0x3e022d['shift']());}catch(_0x3ff26f){_0x3e022d['push'](_0x3e022d['shift']());}}}(a148_0x59c7,0x924de));import a148_0x3d84f8 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x45d6a3){const _0x387c50=a148_0x3c07,_0x2616ff=Date[_0x387c50(0x207)](),_0x3656d4=a148_0x3d84f8[_0x387c50(0x1f4)](process[_0x387c50(0x1ff)](),_0x45d6a3);try{logger[_0x387c50(0x1f0)](_0x387c50(0x1f8),_0x387c50(0x1f7),{'projectCode':_0x45d6a3,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin('npm'),['install',_0x387c50(0x1ee),_0x387c50(0x202)],{'cwd':_0x3656d4});const _0x2ebe7e=Date[_0x387c50(0x207)]()-_0x2616ff;logger[_0x387c50(0x205)](_0x387c50(0x1f8),_0x387c50(0x1fe),_0x2ebe7e,{'projectCode':_0x45d6a3});}catch(_0x565b93){const _0xe2dbed=Date[_0x387c50(0x207)]()-_0x2616ff;logger[_0x387c50(0x1f3)](_0x387c50(0x1f8),_0x387c50(0x203),{'projectCode':_0x45d6a3,'error':_0x565b93 instanceof Error?_0x565b93[_0x387c50(0x1fd)]:String(_0x565b93),'duration':_0xe2dbed});throw _0x565b93;}return formatElapsed(_0x2616ff);}function a148_0x3c07(_0x39cdb5,_0x4bd131){_0x39cdb5=_0x39cdb5-0x1ee;const _0x59c74b=a148_0x59c7();let _0x3c07f5=_0x59c74b[_0x39cdb5];return _0x3c07f5;}function a148_0x59c7(){const _0x48831d=['依赖安装失败','8260285pNQlru','success','6XlUEVv','now','--registry','3BiOxpk','info','322vafvGw','1383cowUzM','error','resolve','1127833AcXCYx','717993usXSKB','开始安装依赖','install','4244648VxiKjy','1088155dbsNne','691938IllKux','56YaZUow','message','依赖安装完成','cwd','432dicbaS','40OELtiZ','https://registry.npmmirror.com'];a148_0x59c7=function(){return _0x48831d;};return a148_0x59c7();}
@@ -1 +1 @@
1
- function a148_0x49d1(_0x51d3db,_0x531be3){_0x51d3db=_0x51d3db-0x114;const _0x21b040=a148_0x21b0();let _0x49d1ed=_0x21b040[_0x51d3db];return _0x49d1ed;}const a148_0x2c693d=a148_0x49d1;(function(_0x49a415,_0x5872b5){const _0x1d9f03=a148_0x49d1,_0x39f5ea=_0x49a415();while(!![]){try{const _0x41ac1e=-parseInt(_0x1d9f03(0x116))/0x1*(parseInt(_0x1d9f03(0x13b))/0x2)+-parseInt(_0x1d9f03(0x129))/0x3+parseInt(_0x1d9f03(0x12a))/0x4*(parseInt(_0x1d9f03(0x11e))/0x5)+parseInt(_0x1d9f03(0x125))/0x6*(parseInt(_0x1d9f03(0x123))/0x7)+parseInt(_0x1d9f03(0x127))/0x8+-parseInt(_0x1d9f03(0x136))/0x9+parseInt(_0x1d9f03(0x138))/0xa*(parseInt(_0x1d9f03(0x135))/0xb);if(_0x41ac1e===_0x5872b5)break;else _0x39f5ea['push'](_0x39f5ea['shift']());}catch(_0x16433e){_0x39f5ea['push'](_0x39f5ea['shift']());}}}(a148_0x21b0,0xbba1e));import{CliErrors}from'../../errors.js';function a148_0x21b0(){const _0x3c6d7a=['string','Target\x20environment','Usage:\x20','bool','write','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','str','boolean','App\x20code\x20to\x20initialize','name','22sauSJd','4760883SviAbi','Skip\x20confirmation\x20prompt','2661690EVDqYk','\x20workspace\x20init','create','194Gtfnne','../../commands/project/create/main.js','Auto-confirm\x20prompts','nonInteractive','yes','11098nyUyVM','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','validation','../../commands/project/create/non-interactive.js','Create\x20a\x20new\x20project','cookie','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','2026-07','45rhcHIl','trim','env','init','appcode','10066wUSLwO','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','5046JCpVBf','project','468112GzpsMx','upgrade','2363112mMcHyi','605124DngBPU'];a148_0x21b0=function(){return _0x3c6d7a;};return a148_0x21b0();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':'appcode','type':a148_0x2c693d(0x12b),'description':a148_0x2c693d(0x133)},{'name':a148_0x2c693d(0x120),'type':a148_0x2c693d(0x12b),'description':'Target\x20environment'},{'name':a148_0x2c693d(0x115),'type':a148_0x2c693d(0x132),'description':a148_0x2c693d(0x13d),'default':![]}],createFlags=[{'name':a148_0x2c693d(0x134),'type':'string','description':'Project\x20name'},{'name':a148_0x2c693d(0x120),'type':a148_0x2c693d(0x12b),'description':a148_0x2c693d(0x12c)},{'name':a148_0x2c693d(0x122),'type':a148_0x2c693d(0x12b),'description':a148_0x2c693d(0x11c)}],upgradeFlags=[{'name':a148_0x2c693d(0x115),'type':a148_0x2c693d(0x132),'description':a148_0x2c693d(0x137),'default':![]}];export const projectDefinitions=[{'service':a148_0x2c693d(0x126),'command':a148_0x2c693d(0x121),'description':a148_0x2c693d(0x117),'risk':a148_0x2c693d(0x12f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a148_0x2c693d(0x139),'since':a148_0x2c693d(0x11d)},'flags':initFlags,async 'execute'(_0x1fe6fe){const _0x3efbdb=a148_0x2c693d;return await initConfig({'appcode':_0x1fe6fe['str'](_0x3efbdb(0x122))||undefined,'env':_0x1fe6fe[_0x3efbdb(0x131)](_0x3efbdb(0x120))||undefined,'autoYes':_0x1fe6fe['bool']('yes')}),{'ok':!![]};}},{'service':a148_0x2c693d(0x126),'command':a148_0x2c693d(0x13a),'description':a148_0x2c693d(0x11a),'risk':a148_0x2c693d(0x12f),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'project-name','description':a148_0x2c693d(0x124),'required':![]}],'flags':createFlags,async 'execute'(_0x11b6b4){const _0x599533=a148_0x2c693d,{createApp:_0x8c7605}=await import(_0x599533(0x13c)),{createProjectNonInteractive:_0xac330b}=await import(_0x599533(0x119)),_0x562ef6=_0x11b6b4[_0x599533(0x131)](_0x599533(0x134))[_0x599533(0x11f)]()||_0x11b6b4['args'][0x0]?.['trim'](),_0x5480b2=_0x11b6b4[_0x599533(0x131)](_0x599533(0x120))||undefined,_0x519da7=_0x11b6b4[_0x599533(0x131)](_0x599533(0x122))||undefined;if(_0x11b6b4[_0x599533(0x114)]){if(!_0x562ef6)throw CliErrors[_0x599533(0x118)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x599533(0x12d)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0xac330b(_0x562ef6,_0x5480b2,_0x519da7,_0x11b6b4[_0x599533(0x11b)]);}else await _0x8c7605({'projectCode':_0x562ef6,'appCode':_0x519da7,'env':_0x5480b2,'cookie':_0x11b6b4[_0x599533(0x11b)]});return{'ok':!![]};}},{'service':a148_0x2c693d(0x126),'command':a148_0x2c693d(0x128),'description':a148_0x2c693d(0x130),'risk':a148_0x2c693d(0x12f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x2b005f){const _0x296788=a148_0x2c693d;return await upgradeApp(_0x2b005f[_0x296788(0x114)],{'yes':_0x2b005f[_0x296788(0x12e)](_0x296788(0x115))}),{'ok':!![]};}}];
1
+ const a149_0x4e4592=a149_0x4c9f;(function(_0x204347,_0x4f616b){const _0x2db96b=a149_0x4c9f,_0x403fd4=_0x204347();while(!![]){try{const _0x1db709=-parseInt(_0x2db96b(0x1b5))/0x1*(-parseInt(_0x2db96b(0x1ae))/0x2)+-parseInt(_0x2db96b(0x1bd))/0x3+-parseInt(_0x2db96b(0x1b4))/0x4*(-parseInt(_0x2db96b(0x198))/0x5)+parseInt(_0x2db96b(0x1ba))/0x6*(parseInt(_0x2db96b(0x1c1))/0x7)+-parseInt(_0x2db96b(0x1a6))/0x8*(-parseInt(_0x2db96b(0x1a2))/0x9)+parseInt(_0x2db96b(0x1a9))/0xa*(-parseInt(_0x2db96b(0x1a4))/0xb)+-parseInt(_0x2db96b(0x1b1))/0xc;if(_0x1db709===_0x4f616b)break;else _0x403fd4['push'](_0x403fd4['shift']());}catch(_0x218ccd){_0x403fd4['push'](_0x403fd4['shift']());}}}(a149_0xd7d2,0xb4541));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';function a149_0x4c9f(_0x1c7187,_0x31792e){_0x1c7187=_0x1c7187-0x198;const _0xd7d2fd=a149_0xd7d2();let _0x4c9f3e=_0xd7d2fd[_0x1c7187];return _0x4c9f3e;}const initFlags=[{'name':a149_0x4e4592(0x1a0),'type':a149_0x4e4592(0x1a7),'description':a149_0x4e4592(0x19f)},{'name':a149_0x4e4592(0x1a8),'type':a149_0x4e4592(0x1a7),'description':a149_0x4e4592(0x1bb)},{'name':a149_0x4e4592(0x19d),'type':a149_0x4e4592(0x1be),'description':a149_0x4e4592(0x19a),'default':![]}],createFlags=[{'name':'name','type':a149_0x4e4592(0x1a7),'description':'Project\x20name'},{'name':a149_0x4e4592(0x1a8),'type':a149_0x4e4592(0x1a7),'description':'Target\x20environment'},{'name':a149_0x4e4592(0x1a0),'type':a149_0x4e4592(0x1a7),'description':a149_0x4e4592(0x1a3)}],upgradeFlags=[{'name':a149_0x4e4592(0x19d),'type':a149_0x4e4592(0x1be),'description':'Skip\x20confirmation\x20prompt','default':![]}];function a149_0xd7d2(){const _0xeb4ec4=['yes','project-name','App\x20code\x20to\x20initialize','appcode','trim','1035mNNXOK','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','121stCGSn','Usage:\x20','6344JtQsSH','string','env','292740xIcyiE','2026-07','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','create','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','897740QyqMLl','write','upgrade','6274968TTzMUR','project','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','1667740JtkCoV','2oZLWiu','nonInteractive','str','\x20workspace\x20init','args','36GgTJdA','Target\x20environment','init','1799574EEbjcr','boolean','cookie','name','420707COHCDY','10OpjTFc','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','Auto-confirm\x20prompts','../../commands/project/create/main.js','bool'];a149_0xd7d2=function(){return _0xeb4ec4;};return a149_0xd7d2();}export const projectDefinitions=[{'service':'project','command':a149_0x4e4592(0x1bc),'description':a149_0x4e4592(0x1ad),'risk':a149_0x4e4592(0x1af),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a149_0x4e4592(0x1b8),'since':a149_0x4e4592(0x1aa)},'flags':initFlags,async 'execute'(_0x4b4c70){const _0x1e3674=a149_0x4e4592;return await initConfig({'appcode':_0x4b4c70[_0x1e3674(0x1b7)](_0x1e3674(0x1a0))||undefined,'env':_0x4b4c70[_0x1e3674(0x1b7)]('env')||undefined,'autoYes':_0x4b4c70[_0x1e3674(0x19c)](_0x1e3674(0x19d))}),{'ok':!![]};}},{'service':a149_0x4e4592(0x1b2),'command':a149_0x4e4592(0x1ac),'description':'Create\x20a\x20new\x20project','risk':a149_0x4e4592(0x1af),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a149_0x4e4592(0x19e),'description':a149_0x4e4592(0x199),'required':![]}],'flags':createFlags,async 'execute'(_0x1a8be1){const _0x1887b2=a149_0x4e4592,{createApp:_0x5c65d6}=await import(_0x1887b2(0x19b)),{createProjectNonInteractive:_0x587bd3}=await import('../../commands/project/create/non-interactive.js'),_0x429e4c=_0x1a8be1[_0x1887b2(0x1b7)](_0x1887b2(0x1c0))[_0x1887b2(0x1a1)]()||_0x1a8be1[_0x1887b2(0x1b9)][0x0]?.[_0x1887b2(0x1a1)](),_0xf7ff05=_0x1a8be1[_0x1887b2(0x1b7)](_0x1887b2(0x1a8))||undefined,_0x2777ec=_0x1a8be1[_0x1887b2(0x1b7)](_0x1887b2(0x1a0))||undefined;if(_0x1a8be1[_0x1887b2(0x1b6)]){if(!_0x429e4c)throw CliErrors['validation'](_0x1887b2(0x1b3),_0x1887b2(0x1a5)+CLI_BIN_NAME+_0x1887b2(0x1ab));await _0x587bd3(_0x429e4c,_0xf7ff05,_0x2777ec,_0x1a8be1[_0x1887b2(0x1bf)]);}else await _0x5c65d6({'projectCode':_0x429e4c,'appCode':_0x2777ec,'env':_0xf7ff05,'cookie':_0x1a8be1[_0x1887b2(0x1bf)]});return{'ok':!![]};}},{'service':a149_0x4e4592(0x1b2),'command':a149_0x4e4592(0x1b0),'description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a149_0x4e4592(0x1af),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x106c04){const _0x223ea5=a149_0x4e4592;return await upgradeApp(_0x106c04[_0x223ea5(0x1b6)],{'yes':_0x106c04[_0x223ea5(0x19c)](_0x223ea5(0x19d))}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- (function(_0x174edb,_0x37f19e){const _0x1caac3=a149_0x40ad,_0x5e4822=_0x174edb();while(!![]){try{const _0x4b0137=-parseInt(_0x1caac3(0x1e6))/0x1+parseInt(_0x1caac3(0x1fb))/0x2*(parseInt(_0x1caac3(0x1e5))/0x3)+-parseInt(_0x1caac3(0x1e4))/0x4+-parseInt(_0x1caac3(0x1d0))/0x5+-parseInt(_0x1caac3(0x1ff))/0x6+-parseInt(_0x1caac3(0x1f8))/0x7+parseInt(_0x1caac3(0x1eb))/0x8;if(_0x4b0137===_0x37f19e)break;else _0x5e4822['push'](_0x5e4822['shift']());}catch(_0x1c23fb){_0x5e4822['push'](_0x5e4822['shift']());}}}(a149_0x139e,0x669ce));import{readFileSync,existsSync,renameSync}from'node:fs';function a149_0x40ad(_0x45c412,_0x3e5fc2){_0x45c412=_0x45c412-0x1cc;const _0x139e5a=a149_0x139e();let _0x40ada5=_0x139e5a[_0x45c412];return _0x40ada5;}import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a149_0x3221ad 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(_0x29fa93){const _0x38fab0=a149_0x40ad,{appcode:_0x14e2fd,env:_0x3ca848,autoYes:_0x5902c7}=_0x29fa93,_0x374102=process[_0x38fab0(0x1ea)]();if(getProjectConfigPath())throw new Error(_0x38fab0(0x1e2));let _0x23330d;for(const _0x4686db of LEGACY_CONFIG_NAMES){const _0x33f44e=resolve(_0x374102,_0x4686db);if(existsSync(_0x33f44e)){_0x23330d=_0x33f44e;break;}}if(_0x23330d){let _0x56a6a0={};try{_0x56a6a0=JSON[_0x38fab0(0x1f0)](readFileSync(_0x23330d,_0x38fab0(0x1dc)));}catch{}const _0x332f35=basename(_0x23330d),_0x50124f=_0x56a6a0?.[_0x38fab0(0x1d2)]||_0x56a6a0?.['app'];let _0x5966f7=_0x5902c7;!_0x5902c7&&(console[_0x38fab0(0x1d6)](a149_0x3221ad[_0x38fab0(0x1cc)](_0x38fab0(0x1f2)+a149_0x3221ad[_0x38fab0(0x1e3)](_0x332f35))),_0x50124f&&console[_0x38fab0(0x1d6)](a149_0x3221ad['cyan'](_0x38fab0(0x1da)+_0x50124f)),_0x5966f7=await confirm({'message':_0x38fab0(0x1e1)+a149_0x3221ad['bold'](_0x38fab0(0x1d9))+_0x38fab0(0x1e0),'default':!![]}));if(!_0x5966f7){console[_0x38fab0(0x1d6)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x38fab0(0x1ed));return;}const _0xbc3c41=resolve(_0x374102,NEW_CONFIG_NAME),_0x114ee5=getCliVersionFromPkg(),_0x48fcba=readRawConfig(),_0xe3a535=_0x14e2fd||(typeof _0x56a6a0?.[_0x38fab0(0x1d2)]==='string'?_0x56a6a0[_0x38fab0(0x1d2)]:undefined)||(typeof _0x56a6a0?.[_0x38fab0(0x1f3)]===_0x38fab0(0x1f5)?_0x56a6a0[_0x38fab0(0x1f3)]:undefined)||await askAppcode(),_0x515125=typeof _0x56a6a0?.[_0x38fab0(0x1d1)]===_0x38fab0(0x1f5)?_0x56a6a0[_0x38fab0(0x1d1)]:typeof _0x48fcba[_0x38fab0(0x1d1)]==='string'?_0x48fcba[_0x38fab0(0x1d1)]:_0x38fab0(0x1f7),_0x425eb9=buildCanonicalProjectConfig({..._0x48fcba,..._0x56a6a0},{'appCodes':[_0xe3a535],'env':_0x515125,'metadata':{'version':_0x114ee5,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0x23330d}});writeConfigFile(_0xbc3c41,_0x425eb9);const _0x3a8c39=_0x23330d+_0x38fab0(0x1ef);renameSync(_0x23330d,_0x3a8c39),logger[_0x38fab0(0x1f6)](_0x374102),logger[_0x38fab0(0x1db)](_0x38fab0(0x1f4),_0x38fab0(0x1d3),{'from':_0x23330d,'to':_0xbc3c41,'appcode':_0xe3a535,'env':_0x425eb9[_0x38fab0(0x1d1)]}),console[_0x38fab0(0x1d6)](a149_0x3221ad['green'](_0x38fab0(0x1fe)+_0x332f35+_0x38fab0(0x1ee))),console[_0x38fab0(0x1d6)](a149_0x3221ad[_0x38fab0(0x1e7)](_0x38fab0(0x1de)+Object[_0x38fab0(0x1fa)](_0x425eb9[_0x38fab0(0x1ce)]||{})[_0x38fab0(0x1df)](',\x20'))),console[_0x38fab0(0x1d6)](a149_0x3221ad[_0x38fab0(0x1e7)](_0x38fab0(0x1e8)+_0x425eb9[_0x38fab0(0x1d4)])),console[_0x38fab0(0x1d6)](a149_0x3221ad[_0x38fab0(0x1e9)]('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0x332f35+_0x38fab0(0x1ef)));return;}const _0x2feec6=_0x14e2fd||await askAppcode(),_0x282206=resolve(_0x374102,NEW_CONFIG_NAME),_0xaf5429=getCliVersionFromPkg(),_0x228156=readRawConfig(),_0x1ad646=typeof _0x228156[_0x38fab0(0x1d1)]===_0x38fab0(0x1f5)?_0x228156[_0x38fab0(0x1d1)]:undefined,_0x10c37e=buildCanonicalProjectConfig({},{'appCodes':[_0x2feec6],'env':_0x3ca848||_0x1ad646||'production','metadata':{'version':_0xaf5429,'createdAt':new Date()[_0x38fab0(0x1fc)]()}});writeConfigFile(_0x282206,_0x10c37e),logger[_0x38fab0(0x1f6)](_0x374102),logger[_0x38fab0(0x1db)](_0x38fab0(0x1f4),_0x38fab0(0x1d5),{'appcode':_0x2feec6,'env':_0x10c37e[_0x38fab0(0x1d1)],'version':_0x10c37e[_0x38fab0(0x201)],'configPath':_0x282206}),console[_0x38fab0(0x1d6)](a149_0x3221ad[_0x38fab0(0x1f1)](_0x38fab0(0x200))),console['log'](a149_0x3221ad[_0x38fab0(0x1e7)](_0x38fab0(0x1de)+Object[_0x38fab0(0x1fa)](_0x10c37e[_0x38fab0(0x1ce)]||{})[_0x38fab0(0x1df)](',\x20'))),console['log'](a149_0x3221ad[_0x38fab0(0x1e7)](_0x38fab0(0x1e8)+_0x10c37e[_0x38fab0(0x1d4)])),console[_0x38fab0(0x1d6)](_0x38fab0(0x1d7)+CLI_BIN_NAME+_0x38fab0(0x1d8)+CLI_BIN_NAME+_0x38fab0(0x1ec));}function askAppcode(){return input({'message':'Please\x20enter\x20App\x20Code:','validate':_0xc69355=>{const _0x3dff9d=a149_0x40ad;if(!_0xc69355['trim']())return _0x3dff9d(0x1cf);const {valid:_0x19e2e7,message:_0x439057}=validateAppcode(_0xc69355['trim']());return _0x19e2e7||_0x439057||_0x3dff9d(0x1f9);}});}function a149_0x139e(){const _0x2d0bc8=['⚠\x20Found\x20legacy\x20configuration\x20file:\x20','app','init','string','setLogPath','production','514199KcRUMX','Invalid\x20App\x20Code','keys','82eioDzr','toLocaleString','package.json','✓\x20Upgraded\x20','3423144UrOTuW','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','version','yellow','../..','apps','App\x20Code\x20cannot\x20be\x20empty','1238200cujRFP','env','appcode','从旧配置文件升级成功','defaultApp','初始化项目配置文件成功','log','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','\x20api\x20generate\x27\x20and\x20\x27','.rabetbase.json','\x20\x20appcode:\x20','info','utf8','1.0.0','\x20\x20Apps:\x20','join','?\x20(Old\x20file\x20→\x20*.bak)','Upgrade\x20it\x20to\x20','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','bold','850936KLhCTF','47238ZYhcDK','433284pNhaTT','cyan','\x20\x20Default:\x20','gray','cwd','10498840SkaBFe','\x20api\x20pull\x27','\x20workspace\x20init`\x20to\x20start\x20fresh.','\x20→\x20.rabetbase.json','.bak','parse','green'];a149_0x139e=function(){return _0x2d0bc8;};return a149_0x139e();}function getCliVersionFromPkg(){const _0x3f6ef4=a149_0x40ad;try{const _0x17cf6d=fileURLToPath(import.meta.url),_0x55a567=resolve(dirname(_0x17cf6d),_0x3f6ef4(0x1cd)),_0x1a41b6=JSON[_0x3f6ef4(0x1f0)](readFileSync(resolve(_0x55a567,_0x3f6ef4(0x1fd)),_0x3f6ef4(0x1dc)));return _0x1a41b6[_0x3f6ef4(0x201)]||_0x3f6ef4(0x1dd);}catch{return _0x3f6ef4(0x1dd);}}
1
+ (function(_0x195806,_0x423f07){const _0x406356=a150_0x396c,_0x2ae99a=_0x195806();while(!![]){try{const _0x51b36c=-parseInt(_0x406356(0xd6))/0x1+-parseInt(_0x406356(0xc8))/0x2*(-parseInt(_0x406356(0xd1))/0x3)+-parseInt(_0x406356(0xdc))/0x4*(parseInt(_0x406356(0xd4))/0x5)+-parseInt(_0x406356(0xce))/0x6+-parseInt(_0x406356(0xc3))/0x7+-parseInt(_0x406356(0xca))/0x8*(-parseInt(_0x406356(0xeb))/0x9)+parseInt(_0x406356(0xe7))/0xa*(parseInt(_0x406356(0xba))/0xb);if(_0x51b36c===_0x423f07)break;else _0x2ae99a['push'](_0x2ae99a['shift']());}catch(_0x44b260){_0x2ae99a['push'](_0x2ae99a['shift']());}}}(a150_0x299e,0x3a8dd));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a150_0x3d970b from'chalk';function a150_0x396c(_0x137a39,_0xf33104){_0x137a39=_0x137a39-0xb8;const _0x299e8f=a150_0x299e();let _0x396c98=_0x299e8f[_0x137a39];return _0x396c98;}import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x2ee05f){const _0x15c928=a150_0x396c,{appcode:_0x827a7,env:_0x500f5c,autoYes:_0x38b4c1}=_0x2ee05f,_0x5594aa=process[_0x15c928(0xcf)]();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x145959;for(const _0x1811e3 of LEGACY_CONFIG_NAMES){const _0x38c9ee=resolve(_0x5594aa,_0x1811e3);if(existsSync(_0x38c9ee)){_0x145959=_0x38c9ee;break;}}if(_0x145959){let _0x4bc813={};try{_0x4bc813=JSON[_0x15c928(0xe4)](readFileSync(_0x145959,'utf8'));}catch{}const _0x2bd287=basename(_0x145959),_0x4c785c=_0x4bc813?.[_0x15c928(0xbb)]||_0x4bc813?.[_0x15c928(0xe0)];let _0x35b295=_0x38b4c1;!_0x38b4c1&&(console['log'](a150_0x3d970b[_0x15c928(0xbd)](_0x15c928(0xc1)+a150_0x3d970b['bold'](_0x2bd287))),_0x4c785c&&console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xdb)](_0x15c928(0xc6)+_0x4c785c)),_0x35b295=await confirm({'message':_0x15c928(0xc2)+a150_0x3d970b[_0x15c928(0xe1)](_0x15c928(0xe9))+_0x15c928(0xcc),'default':!![]}));if(!_0x35b295){console[_0x15c928(0xc4)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x15c928(0xd8));return;}const _0x496f13=resolve(_0x5594aa,NEW_CONFIG_NAME),_0x3bc2c2=getCliVersionFromPkg(),_0x4f6de6=readRawConfig(),_0x1176ea=_0x827a7||(typeof _0x4bc813?.[_0x15c928(0xbb)]===_0x15c928(0xc9)?_0x4bc813['appcode']:undefined)||(typeof _0x4bc813?.[_0x15c928(0xe0)]===_0x15c928(0xc9)?_0x4bc813['app']:undefined)||await askAppcode(),_0x18059d=typeof _0x4bc813?.[_0x15c928(0xe3)]===_0x15c928(0xc9)?_0x4bc813[_0x15c928(0xe3)]:typeof _0x4f6de6['env']===_0x15c928(0xc9)?_0x4f6de6[_0x15c928(0xe3)]:'production',_0xc90df=buildCanonicalProjectConfig({..._0x4f6de6,..._0x4bc813},{'appCodes':[_0x1176ea],'env':_0x18059d,'metadata':{'version':_0x3bc2c2,'migratedAt':new Date()[_0x15c928(0xb9)](),'migratedFrom':_0x145959}});writeConfigFile(_0x496f13,_0xc90df);const _0x400c5e=_0x145959+_0x15c928(0xdf);renameSync(_0x145959,_0x400c5e),logger['setLogPath'](_0x5594aa),logger['info'](_0x15c928(0xe8),_0x15c928(0xe5),{'from':_0x145959,'to':_0x496f13,'appcode':_0x1176ea,'env':_0xc90df[_0x15c928(0xe3)]}),console[_0x15c928(0xc4)](a150_0x3d970b['green'](_0x15c928(0xe2)+_0x2bd287+_0x15c928(0xc0))),console['log'](a150_0x3d970b['cyan']('\x20\x20Apps:\x20'+Object[_0x15c928(0xd3)](_0xc90df[_0x15c928(0xb8)]||{})[_0x15c928(0xd7)](',\x20'))),console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xdb)](_0x15c928(0xde)+_0xc90df[_0x15c928(0xec)])),console['log'](a150_0x3d970b[_0x15c928(0xc5)](_0x15c928(0xd9)+_0x2bd287+'.bak'));return;}const _0x5a6463=_0x827a7||await askAppcode(),_0x3c3afe=resolve(_0x5594aa,NEW_CONFIG_NAME),_0xe98d7=getCliVersionFromPkg(),_0x46ccbc=readRawConfig(),_0x2956ac=typeof _0x46ccbc[_0x15c928(0xe3)]===_0x15c928(0xc9)?_0x46ccbc[_0x15c928(0xe3)]:undefined,_0xf9474d=buildCanonicalProjectConfig({},{'appCodes':[_0x5a6463],'env':_0x500f5c||_0x2956ac||_0x15c928(0xd0),'metadata':{'version':_0xe98d7,'createdAt':new Date()[_0x15c928(0xb9)]()}});writeConfigFile(_0x3c3afe,_0xf9474d),logger[_0x15c928(0xcb)](_0x5594aa),logger['info']('init','初始化项目配置文件成功',{'appcode':_0x5a6463,'env':_0xf9474d[_0x15c928(0xe3)],'version':_0xf9474d['version'],'configPath':_0x3c3afe}),console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xea)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a150_0x3d970b['cyan'](_0x15c928(0xda)+Object[_0x15c928(0xd3)](_0xf9474d[_0x15c928(0xb8)]||{})[_0x15c928(0xd7)](',\x20'))),console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xdb)](_0x15c928(0xde)+_0xf9474d[_0x15c928(0xec)])),console[_0x15c928(0xc4)](_0x15c928(0xbf)+CLI_BIN_NAME+_0x15c928(0xd5)+CLI_BIN_NAME+_0x15c928(0xbc));}function a150_0x299e(){const _0x2a034b=['Please\x20enter\x20App\x20Code:','45494RCyHqI','string','712pxdHRC','setLogPath','?\x20(Old\x20file\x20→\x20*.bak)','utf8','904416rBAlEU','cwd','production','33ZfWPyH','version','keys','80peoFjB','\x20api\x20generate\x27\x20and\x20\x27','8804hbaIyy','join','\x20workspace\x20init`\x20to\x20start\x20fresh.','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','\x20\x20Apps:\x20','cyan','86116kGrijz','Invalid\x20App\x20Code','\x20\x20Default:\x20','.bak','app','bold','✓\x20Upgraded\x20','env','parse','从旧配置文件升级成功','trim','10BDVmVP','init','.rabetbase.json','green','41841NazWKH','defaultApp','apps','toLocaleString','1595957gAZOix','appcode','\x20api\x20pull\x27','yellow','1.0.0','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','\x20→\x20.rabetbase.json','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','Upgrade\x20it\x20to\x20','456568JUOEjg','log','gray','\x20\x20appcode:\x20'];a150_0x299e=function(){return _0x2a034b;};return a150_0x299e();}function askAppcode(){const _0x251b46=a150_0x396c;return input({'message':_0x251b46(0xc7),'validate':_0x2c17cf=>{const _0x545c9a=_0x251b46;if(!_0x2c17cf[_0x545c9a(0xe6)]())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x6b8480,message:_0x1f8734}=validateAppcode(_0x2c17cf[_0x545c9a(0xe6)]());return _0x6b8480||_0x1f8734||_0x545c9a(0xdd);}});}function getCliVersionFromPkg(){const _0x10bf9c=a150_0x396c;try{const _0x4b8642=fileURLToPath(import.meta.url),_0x2b24be=resolve(dirname(_0x4b8642),'../..'),_0x53a411=JSON[_0x10bf9c(0xe4)](readFileSync(resolve(_0x2b24be,'package.json'),_0x10bf9c(0xcd)));return _0x53a411[_0x10bf9c(0xd2)]||'1.0.0';}catch{return _0x10bf9c(0xbe);}}