@lovrabet/rabetbase-cli 2.3.15-beta.2 → 2.3.16-beta.1

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 (273) hide show
  1. package/README.md +7 -2
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/add.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/remove.js +1 -1
  25. package/lib/commands/app/shared.js +1 -1
  26. package/lib/commands/app-config/delete.js +1 -1
  27. package/lib/commands/app-config/get.js +1 -1
  28. package/lib/commands/app-config/index.js +1 -1
  29. package/lib/commands/app-config/list.js +1 -1
  30. package/lib/commands/app-config/set.js +1 -1
  31. package/lib/commands/app-config/shared.js +1 -1
  32. package/lib/commands/auth/index.js +1 -1
  33. package/lib/commands/bff/create.js +1 -1
  34. package/lib/commands/bff/delete.js +1 -1
  35. package/lib/commands/bff/detail.js +1 -1
  36. package/lib/commands/bff/index.js +1 -1
  37. package/lib/commands/bff/list.js +1 -1
  38. package/lib/commands/bff/pull.js +1 -1
  39. package/lib/commands/bff/push.js +1 -1
  40. package/lib/commands/bff/status.js +1 -1
  41. package/lib/commands/cli-skill/index.js +1 -1
  42. package/lib/commands/cli-update.js +1 -1
  43. package/lib/commands/codegen/index.js +1 -1
  44. package/lib/commands/codegen/sdk.js +1 -1
  45. package/lib/commands/codegen/sql.js +1 -1
  46. package/lib/commands/common/app-registry.js +1 -1
  47. package/lib/commands/common/app-selector.js +1 -1
  48. package/lib/commands/common/async-task.js +1 -1
  49. package/lib/commands/common/dry-run.js +1 -1
  50. package/lib/commands/common/flags.js +1 -1
  51. package/lib/commands/common/local-file.js +1 -1
  52. package/lib/commands/common/validate.js +1 -1
  53. package/lib/commands/config/get.js +1 -1
  54. package/lib/commands/config/index.js +1 -1
  55. package/lib/commands/config/list.js +1 -1
  56. package/lib/commands/config/set.js +1 -1
  57. package/lib/commands/config/shared.js +1 -1
  58. package/lib/commands/data/filter.js +1 -1
  59. package/lib/commands/data/getOne.js +1 -1
  60. package/lib/commands/data/index.js +1 -1
  61. package/lib/commands/data/shared.js +1 -1
  62. package/lib/commands/dataset/business-group-update.js +1 -1
  63. package/lib/commands/dataset/capability.js +1 -1
  64. package/lib/commands/dataset/delete.js +1 -1
  65. package/lib/commands/dataset/detail.js +1 -1
  66. package/lib/commands/dataset/extend-update.js +1 -1
  67. package/lib/commands/dataset/field-update.js +1 -1
  68. package/lib/commands/dataset/generate.js +1 -1
  69. package/lib/commands/dataset/index.js +1 -1
  70. package/lib/commands/dataset/list.js +1 -1
  71. package/lib/commands/dataset/operations.js +1 -1
  72. package/lib/commands/dataset/relation-audit.js +1 -1
  73. package/lib/commands/dataset/relation-create.js +1 -1
  74. package/lib/commands/dataset/relation-delete.js +1 -1
  75. package/lib/commands/dataset/relation-shared.js +1 -1
  76. package/lib/commands/dataset/relation-update.js +1 -1
  77. package/lib/commands/dataset/relations.js +1 -1
  78. package/lib/commands/dataset/rename.js +1 -1
  79. package/lib/commands/dataset/restore.js +1 -1
  80. package/lib/commands/db/analysis-batching.js +1 -1
  81. package/lib/commands/db/analyze-batch-plan.js +1 -1
  82. package/lib/commands/db/analyze-cancel.js +1 -1
  83. package/lib/commands/db/analyze-start.js +1 -1
  84. package/lib/commands/db/analyze-status.js +1 -1
  85. package/lib/commands/db/create.js +1 -1
  86. package/lib/commands/db/delete.js +1 -1
  87. package/lib/commands/db/detail.js +1 -1
  88. package/lib/commands/db/diff.js +1 -1
  89. package/lib/commands/db/index.js +1 -1
  90. package/lib/commands/db/list.js +1 -1
  91. package/lib/commands/db/shared.js +1 -1
  92. package/lib/commands/db/tables.js +1 -1
  93. package/lib/commands/db/test.js +1 -1
  94. package/lib/commands/db/update.js +1 -1
  95. package/lib/commands/doctor.js +1 -1
  96. package/lib/commands/file/index.js +1 -1
  97. package/lib/commands/init/index.js +1 -1
  98. package/lib/commands/issue/index.js +1 -1
  99. package/lib/commands/issue/nudge.js +1 -1
  100. package/lib/commands/issue/report.js +1 -1
  101. package/lib/commands/issue/shared.js +1 -1
  102. package/lib/commands/kb/create.js +1 -0
  103. package/lib/commands/kb/delete.js +1 -0
  104. package/lib/commands/kb/detail.js +1 -0
  105. package/lib/commands/kb/index.js +1 -0
  106. package/lib/commands/kb/list.js +1 -0
  107. package/lib/commands/kb/shared.js +1 -0
  108. package/lib/commands/kb/update.js +1 -0
  109. package/lib/commands/logs/index.js +1 -1
  110. package/lib/commands/menu/asset-update.js +1 -1
  111. package/lib/commands/menu/delete.js +1 -1
  112. package/lib/commands/menu/external-link-create.js +1 -1
  113. package/lib/commands/menu/external-link-update.js +1 -1
  114. package/lib/commands/menu/group-create.js +1 -1
  115. package/lib/commands/menu/group-update.js +1 -1
  116. package/lib/commands/menu/index.js +1 -1
  117. package/lib/commands/menu/list.js +1 -1
  118. package/lib/commands/menu/move.js +1 -1
  119. package/lib/commands/menu/regroup-start.js +1 -1
  120. package/lib/commands/menu/rename.js +1 -1
  121. package/lib/commands/menu/shared/compare-table.js +1 -1
  122. package/lib/commands/menu/shared/delete-plan.js +1 -1
  123. package/lib/commands/menu/shared/facts.js +1 -1
  124. package/lib/commands/menu/shared/index.js +1 -1
  125. package/lib/commands/menu/shared/inquirer.js +1 -1
  126. package/lib/commands/menu/shared/local-pages.js +1 -1
  127. package/lib/commands/menu/shared/logic.js +1 -1
  128. package/lib/commands/menu/shared/mutations.js +1 -1
  129. package/lib/commands/menu/shared/service.js +1 -1
  130. package/lib/commands/menu/shared/sync-core.js +1 -1
  131. package/lib/commands/menu/shared/update-core.js +1 -1
  132. package/lib/commands/menu/shared/valid-url.js +1 -1
  133. package/lib/commands/menu/sync.js +1 -1
  134. package/lib/commands/notification/config-list.js +1 -1
  135. package/lib/commands/notification/index.js +1 -1
  136. package/lib/commands/ocr/index.js +1 -1
  137. package/lib/commands/page/generate-start.js +1 -1
  138. package/lib/commands/page/generate-status.js +1 -1
  139. package/lib/commands/page/index.js +1 -1
  140. package/lib/commands/page/pull.js +1 -1
  141. package/lib/commands/page/push.js +1 -1
  142. package/lib/commands/page/relation-audit.js +1 -1
  143. package/lib/commands/page/restore.js +1 -1
  144. package/lib/commands/page/shared.js +1 -1
  145. package/lib/commands/page/standard-page-status.js +1 -1
  146. package/lib/commands/page/sync.js +1 -1
  147. package/lib/commands/permit/index.js +1 -1
  148. package/lib/commands/permit/page-get.js +1 -1
  149. package/lib/commands/permit/page-set.js +1 -1
  150. package/lib/commands/permit/role-apis-set.js +1 -1
  151. package/lib/commands/permit/role-menus-set.js +1 -1
  152. package/lib/commands/permit/role-menus.js +1 -1
  153. package/lib/commands/permit/shared.js +1 -1
  154. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  155. package/lib/commands/project/create/format-elapsed.js +1 -1
  156. package/lib/commands/project/create/main.js +1 -1
  157. package/lib/commands/project/create/non-interactive.js +1 -1
  158. package/lib/commands/project/create/project-template-path.js +1 -1
  159. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  160. package/lib/commands/project/create/use-format-code.js +1 -1
  161. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  162. package/lib/commands/project/index.js +1 -1
  163. package/lib/commands/project/init.js +1 -1
  164. package/lib/commands/project/upgrade.js +1 -1
  165. package/lib/commands/registry.js +1 -1
  166. package/lib/commands/role/create.js +1 -1
  167. package/lib/commands/role/delete.js +1 -1
  168. package/lib/commands/role/detail.js +1 -1
  169. package/lib/commands/role/index.js +1 -1
  170. package/lib/commands/role/list.js +1 -1
  171. package/lib/commands/role/shared.js +1 -1
  172. package/lib/commands/role/update.js +1 -1
  173. package/lib/commands/role/user-add.js +1 -1
  174. package/lib/commands/role/user-remove.js +1 -1
  175. package/lib/commands/role/user-resolve.js +1 -1
  176. package/lib/commands/run/index.js +1 -1
  177. package/lib/commands/schema.js +1 -1
  178. package/lib/commands/sql/create.js +1 -1
  179. package/lib/commands/sql/delete.js +1 -1
  180. package/lib/commands/sql/detail.js +1 -1
  181. package/lib/commands/sql/exec.js +1 -1
  182. package/lib/commands/sql/index.js +1 -1
  183. package/lib/commands/sql/list.js +1 -1
  184. package/lib/commands/sql/pull.js +1 -1
  185. package/lib/commands/sql/push.js +1 -1
  186. package/lib/commands/sql/save.js +1 -1
  187. package/lib/commands/sql/shared.js +1 -1
  188. package/lib/commands/sql/status.js +1 -1
  189. package/lib/commands/sql/validate.js +1 -1
  190. package/lib/commands/task/index.js +1 -1
  191. package/lib/commands/task/status.js +1 -1
  192. package/lib/commands/workspace/add.js +1 -1
  193. package/lib/commands/workspace/index.js +1 -1
  194. package/lib/commands/workspace/remove.js +1 -1
  195. package/lib/config/schema.js +1 -1
  196. package/lib/constant/cdn.js +1 -1
  197. package/lib/constant/cli.js +1 -1
  198. package/lib/constant/defaults.js +1 -1
  199. package/lib/constant/domain.js +1 -1
  200. package/lib/constant/env.js +1 -1
  201. package/lib/constant/output.js +1 -1
  202. package/lib/constant/paths.js +1 -1
  203. package/lib/constant/risk.js +1 -1
  204. package/lib/context/app-resolver.js +1 -1
  205. package/lib/context/auth-resolver.js +1 -1
  206. package/lib/context/config-loader.js +1 -1
  207. package/lib/context.js +1 -1
  208. package/lib/core/alias-resolver.js +1 -1
  209. package/lib/core/api-client.js +1 -1
  210. package/lib/core/bff/config.js +1 -1
  211. package/lib/core/bff/file-system.js +1 -1
  212. package/lib/core/bff/hash.js +1 -1
  213. package/lib/core/bff/lock.js +1 -1
  214. package/lib/core/bff/utils.js +1 -1
  215. package/lib/core/db-resolver.js +1 -1
  216. package/lib/core/page/file-system.js +1 -1
  217. package/lib/core/page/hash.js +1 -1
  218. package/lib/core/page/lock.js +1 -1
  219. package/lib/core/sql-index-auditor.js +1 -1
  220. package/lib/core/sql-sync/config.js +1 -1
  221. package/lib/core/sql-sync/file-system.js +1 -1
  222. package/lib/core/sql-sync/hash.js +1 -1
  223. package/lib/core/sql-sync/lock.js +1 -1
  224. package/lib/core/sql-sync/utils.js +1 -1
  225. package/lib/core/sql-validator.js +1 -1
  226. package/lib/errors.js +1 -1
  227. package/lib/framework/build-all-flags.js +1 -1
  228. package/lib/framework/error-output.js +1 -1
  229. package/lib/framework/explicit-yes.js +1 -1
  230. package/lib/framework/flags.js +1 -1
  231. package/lib/framework/help.js +1 -1
  232. package/lib/framework/index.js +1 -1
  233. package/lib/framework/output.js +1 -1
  234. package/lib/framework/response.js +1 -1
  235. package/lib/framework/runner-alias.js +1 -1
  236. package/lib/framework/runner.js +1 -1
  237. package/lib/framework/schema-export.js +1 -1
  238. package/lib/framework/types.js +1 -1
  239. package/lib/generated/build-info.js +1 -1
  240. package/lib/help.js +1 -1
  241. package/lib/skills/main.js +1 -1
  242. package/lib/skills/npx-skills-add.js +1 -1
  243. package/lib/skills/skill-presence.js +1 -0
  244. package/lib/telemetry/cli-command-trace.js +1 -1
  245. package/lib/telemetry/cli-help-trace.js +1 -1
  246. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  247. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  248. package/lib/telemetry/send-cli-trace-log.js +1 -1
  249. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  250. package/lib/utils/ai_config.js +1 -1
  251. package/lib/utils/apply-jq-filter.js +1 -1
  252. package/lib/utils/cdn-config.js +1 -1
  253. package/lib/utils/check-sdk-version.js +1 -1
  254. package/lib/utils/cli-version-check.js +1 -1
  255. package/lib/utils/cli-version-policy.js +1 -1
  256. package/lib/utils/config.js +1 -1
  257. package/lib/utils/copy-directory.js +1 -1
  258. package/lib/utils/entity-with-id.js +1 -1
  259. package/lib/utils/file-utils.js +1 -1
  260. package/lib/utils/guides-cdn.js +1 -1
  261. package/lib/utils/http-client.js +1 -1
  262. package/lib/utils/is-non-interactive.js +1 -1
  263. package/lib/utils/logger.js +1 -1
  264. package/lib/utils/params.js +1 -1
  265. package/lib/utils/platform.js +1 -1
  266. package/lib/utils/rules-cdn.js +1 -1
  267. package/lib/utils/sleep.js +1 -1
  268. package/lib/utils/template-replacer.js +1 -1
  269. package/lib/utils/update-notice.js +1 -1
  270. package/lib/utils/version.js +1 -1
  271. package/lib/utils/with-active-cookie.js +1 -1
  272. package/lib/utils/write-cli-side-channel.js +1 -1
  273. package/package.json +1 -1
@@ -1 +1 @@
1
- const a141_0x3a917d=a141_0x37a7;(function(_0x82c24b,_0x9fe86f){const _0x29b270=a141_0x37a7,_0x38eb58=_0x82c24b();while(!![]){try{const _0x116fc9=parseInt(_0x29b270(0x81))/0x1+parseInt(_0x29b270(0x69))/0x2+parseInt(_0x29b270(0x7f))/0x3+parseInt(_0x29b270(0x7e))/0x4*(parseInt(_0x29b270(0x6c))/0x5)+parseInt(_0x29b270(0x88))/0x6*(parseInt(_0x29b270(0x7b))/0x7)+parseInt(_0x29b270(0x78))/0x8*(parseInt(_0x29b270(0x73))/0x9)+-parseInt(_0x29b270(0x6f))/0xa;if(_0x116fc9===_0x9fe86f)break;else _0x38eb58['push'](_0x38eb58['shift']());}catch(_0x37a18b){_0x38eb58['push'](_0x38eb58['shift']());}}}(a141_0x5828,0x19a97));import{getPagePermit,savePagePermit}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{MENU_ID_FLAG,PAGE_SET_ROLE_FLAGS,PAGE_SLOT_SPECS,projectPageSlot,resolvePermitRoles,splitList}from'../../commands/permit/shared.js';const SAVE_PATH=a141_0x3a917d(0x75);function a141_0x37a7(_0x49486c,_0x4280cc){_0x49486c=_0x49486c-0x68;const _0x5828b9=a141_0x5828();let _0x37a7d9=_0x5828b9[_0x49486c];return _0x37a7d9;}function collectRequestedSlots(_0x1ce57e){const _0x4ae479=a141_0x3a917d,_0x1c8d4f=[];for(const _0x4c601c of PAGE_SLOT_SPECS){const _0x5375d7=_0x1ce57e[_0x4ae479(0x86)](_0x4c601c[_0x4ae479(0x86)]);if(_0x5375d7===undefined||_0x5375d7===null)continue;const _0x1f7957=splitList(String(_0x5375d7));if(_0x1f7957[_0x4ae479(0x6b)]===0x0)throw CliErrors['validation']('--'+_0x4c601c[_0x4ae479(0x86)]+_0x4ae479(0x85),'Pass\x20at\x20least\x20one\x20role,\x20or\x20omit\x20the\x20flag.\x20Clearing\x20permissions\x20is\x20not\x20supported\x20by\x20this\x20command.');_0x1c8d4f[_0x4ae479(0x7c)]({'spec':_0x4c601c,'refs':_0x1f7957});}return _0x1c8d4f;}async function buildPlan(_0x48dd0f,_0x53b6bf){const _0x4abb08=a141_0x3a917d,_0x1e5d96=_0x48dd0f[_0x4abb08(0x76)]('menu-id'),_0x2e1734=collectRequestedSlots(_0x48dd0f);if(_0x2e1734[_0x4abb08(0x6b)]===0x0)throw CliErrors['validation']('Nothing\x20to\x20set.',_0x4abb08(0x79)+PAGE_SLOT_SPECS[_0x4abb08(0x7d)](_0x33ecc5=>'--'+_0x33ecc5[_0x4abb08(0x86)])[_0x4abb08(0x6a)](',\x20')+'.');const _0x23e342=await getPagePermit(_0x1e5d96),_0x1d847f={},_0xffe9c6={},_0x5217f3=[];for(const {spec:_0x141b95,refs:_0x2a2e80}of _0x2e1734){const _0x2a81df=_0x23e342[_0x141b95[_0x4abb08(0x7a)]];if(!_0x2a81df)throw CliErrors['validation'](_0x4abb08(0x70)+_0x141b95[_0x4abb08(0x83)]+_0x4abb08(0x77)+_0x141b95[_0x4abb08(0x7a)]+').',_0x4abb08(0x8a));_0x1d847f[_0x141b95['key']]=projectPageSlot(_0x2a81df);const _0x181851=await resolvePermitRoles(_0x48dd0f[_0x4abb08(0x72)],_0x2a2e80,{'allowSelf':_0x141b95[_0x4abb08(0x84)],'label':_0x141b95['label']});_0x2a81df[_0x4abb08(0x71)]=_0x181851,_0xffe9c6[_0x141b95[_0x4abb08(0x7a)]]=projectPageSlot(_0x2a81df);}const _0x1e0a0c={'operation':'page-set','selector':{'appCode':_0x48dd0f[_0x4abb08(0x72)],'menuId':_0x1e5d96,'slots':_0x2e1734[_0x4abb08(0x7d)](_0x1790c1=>_0x1790c1[_0x4abb08(0x74)][_0x4abb08(0x7a)])},'before':_0x1d847f,'after':_0xffe9c6,'dryRun':_0x53b6bf,'backend':{'method':_0x4abb08(0x68),'path':SAVE_PATH},'warnings':_0x5217f3};return{'page':_0x23e342,'mutation':_0x1e0a0c};}export const permitPageSet={'service':a141_0x3a917d(0x87),'command':a141_0x3a917d(0x6d),'description':'Set\x20page\x20permissions\x20for\x20a\x20menu\x20(menu/create/update/delete/detail/export/row\x20roles);\x20requires\x20--yes','risk':a141_0x3a917d(0x89),'flags':[MENU_ID_FLAG,...PAGE_SET_ROLE_FLAGS,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2b4fbf){const _0x531744=a141_0x3a917d,_0xcb04f5=collectRequestedSlots(_0x2b4fbf);if(_0xcb04f5[_0x531744(0x6b)]===0x0)throw CliErrors['validation'](_0x531744(0x80),_0x531744(0x79)+PAGE_SLOT_SPECS[_0x531744(0x7d)](_0x4eede3=>'--'+_0x4eede3[_0x531744(0x86)])[_0x531744(0x6a)](',\x20')+'.');},async 'dryRun'(_0x366cf8){const _0x46e30f=a141_0x3a917d,{mutation:_0x29fa30}=await buildPlan(_0x366cf8,!![]);return asDryRunResult(_0x29fa30,{'method':_0x46e30f(0x68),'url':SAVE_PATH});},async 'execute'(_0x546f4c){const _0x7af54b=a141_0x3a917d,{page:_0x57e269,mutation:_0x2a8ced}=await buildPlan(_0x546f4c,![]);return await savePagePermit(_0x57e269),{'ok':!![],'data':_0x2a8ced,'message':_0x7af54b(0x82)+_0x2a8ced['selector'][_0x7af54b(0x6e)]};}};function a141_0x5828(){const _0x2d6bb8=['map','5392zccupn','614325lOFlPU','Nothing\x20to\x20set.','7343YqzdXS','Updated\x20page\x20permit\x20for\x20menu\x20','label','allowSelf','\x20cannot\x20be\x20empty.','flag','permit','66hKLIzU','high-risk-write','Only\x20slots\x20present\x20in\x20`permit\x20page-get`\x20can\x20be\x20set.','POST','190644yzqOiw','join','length','140MjBDUq','page-set','menuId','3422390UhYSIt','This\x20page\x20has\x20no\x20\x22','rolePermit','appCode','3771KcICDE','spec','/smartapi/permit/page/save','num','\x22\x20permission\x20slot\x20(','1656UbQkvl','Pass\x20at\x20least\x20one\x20of:\x20','key','9821WQegDh','push'];a141_0x5828=function(){return _0x2d6bb8;};return a141_0x5828();}
1
+ const a148_0x410b08=a148_0x196c;(function(_0x37da3c,_0xbeb940){const _0x17a92a=a148_0x196c,_0x5d6576=_0x37da3c();while(!![]){try{const _0x36eb56=parseInt(_0x17a92a(0xbb))/0x1*(parseInt(_0x17a92a(0xb6))/0x2)+parseInt(_0x17a92a(0xa2))/0x3*(parseInt(_0x17a92a(0xa6))/0x4)+-parseInt(_0x17a92a(0xa7))/0x5+parseInt(_0x17a92a(0xa0))/0x6+parseInt(_0x17a92a(0xb9))/0x7+-parseInt(_0x17a92a(0xb8))/0x8*(parseInt(_0x17a92a(0xbc))/0x9)+parseInt(_0x17a92a(0xad))/0xa;if(_0x36eb56===_0xbeb940)break;else _0x5d6576['push'](_0x5d6576['shift']());}catch(_0x336fc9){_0x5d6576['push'](_0x5d6576['shift']());}}}(a148_0x35e6,0x33d8a));import{getPagePermit,savePagePermit}from'../../core/api-client.js';function a148_0x35e6(){const _0x4f4bfe=['menuId','18KmFXoF','Set\x20page\x20permissions\x20for\x20a\x20menu\x20(menu/create/update/delete/detail/export/row\x20roles);\x20requires\x20--yes','selector','map','152092SOtqxf','1031815FXIins','allowSelf','Only\x20slots\x20present\x20in\x20`permit\x20page-get`\x20can\x20be\x20set.','Nothing\x20to\x20set.','/smartapi/permit/page/save','menu-id','1638300xAeaHE','\x20cannot\x20be\x20empty.','This\x20page\x20has\x20no\x20\x22','num','validation','Pass\x20at\x20least\x20one\x20of:\x20','rolePermit','spec','join','2uvyDoN','\x22\x20permission\x20slot\x20(','10896LazKjo','1466563ZqGoXh','length','120113FOKfXl','2601fJfNTd','label','flag','POST','appCode','permit','high-risk-write','key','page-set','544518EARlpJ'];a148_0x35e6=function(){return _0x4f4bfe;};return a148_0x35e6();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{MENU_ID_FLAG,PAGE_SET_ROLE_FLAGS,PAGE_SLOT_SPECS,projectPageSlot,resolvePermitRoles,splitList}from'../../commands/permit/shared.js';const SAVE_PATH=a148_0x410b08(0xab);function collectRequestedSlots(_0x286a0b){const _0x334b98=a148_0x410b08,_0xac10e3=[];for(const _0x22805c of PAGE_SLOT_SPECS){const _0x4defe8=_0x286a0b[_0x334b98(0xbe)](_0x22805c[_0x334b98(0xbe)]);if(_0x4defe8===undefined||_0x4defe8===null)continue;const _0x22a58a=splitList(String(_0x4defe8));if(_0x22a58a[_0x334b98(0xba)]===0x0)throw CliErrors[_0x334b98(0xb1)]('--'+_0x22805c[_0x334b98(0xbe)]+_0x334b98(0xae),'Pass\x20at\x20least\x20one\x20role,\x20or\x20omit\x20the\x20flag.\x20Clearing\x20permissions\x20is\x20not\x20supported\x20by\x20this\x20command.');_0xac10e3['push']({'spec':_0x22805c,'refs':_0x22a58a});}return _0xac10e3;}async function buildPlan(_0x23a75d,_0x522082){const _0x5b74b6=a148_0x410b08,_0x384daf=_0x23a75d[_0x5b74b6(0xb0)](_0x5b74b6(0xac)),_0x10c833=collectRequestedSlots(_0x23a75d);if(_0x10c833['length']===0x0)throw CliErrors[_0x5b74b6(0xb1)](_0x5b74b6(0xaa),_0x5b74b6(0xb2)+PAGE_SLOT_SPECS[_0x5b74b6(0xa5)](_0xfa6a87=>'--'+_0xfa6a87[_0x5b74b6(0xbe)])[_0x5b74b6(0xb5)](',\x20')+'.');const _0x2f8343=await getPagePermit(_0x384daf),_0x29ed43={},_0x230db0={},_0x59f100=[];for(const {spec:_0x2958dd,refs:_0xed4643}of _0x10c833){const _0x4bd2df=_0x2f8343[_0x2958dd[_0x5b74b6(0x9e)]];if(!_0x4bd2df)throw CliErrors['validation'](_0x5b74b6(0xaf)+_0x2958dd[_0x5b74b6(0xbd)]+_0x5b74b6(0xb7)+_0x2958dd[_0x5b74b6(0x9e)]+').',_0x5b74b6(0xa9));_0x29ed43[_0x2958dd['key']]=projectPageSlot(_0x4bd2df);const _0x360c60=await resolvePermitRoles(_0x23a75d[_0x5b74b6(0xc0)],_0xed4643,{'allowSelf':_0x2958dd[_0x5b74b6(0xa8)],'label':_0x2958dd[_0x5b74b6(0xbd)]});_0x4bd2df[_0x5b74b6(0xb3)]=_0x360c60,_0x230db0[_0x2958dd['key']]=projectPageSlot(_0x4bd2df);}const _0x5cc67e={'operation':_0x5b74b6(0x9f),'selector':{'appCode':_0x23a75d[_0x5b74b6(0xc0)],'menuId':_0x384daf,'slots':_0x10c833[_0x5b74b6(0xa5)](_0x4e6c65=>_0x4e6c65[_0x5b74b6(0xb4)][_0x5b74b6(0x9e)])},'before':_0x29ed43,'after':_0x230db0,'dryRun':_0x522082,'backend':{'method':_0x5b74b6(0xbf),'path':SAVE_PATH},'warnings':_0x59f100};return{'page':_0x2f8343,'mutation':_0x5cc67e};}function a148_0x196c(_0x33274e,_0x4ea143){_0x33274e=_0x33274e-0x9d;const _0x35e626=a148_0x35e6();let _0x196cd0=_0x35e626[_0x33274e];return _0x196cd0;}export const permitPageSet={'service':a148_0x410b08(0xc1),'command':a148_0x410b08(0x9f),'description':a148_0x410b08(0xa3),'risk':a148_0x410b08(0x9d),'flags':[MENU_ID_FLAG,...PAGE_SET_ROLE_FLAGS,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2f53a0){const _0x2df83c=a148_0x410b08,_0x3372f8=collectRequestedSlots(_0x2f53a0);if(_0x3372f8[_0x2df83c(0xba)]===0x0)throw CliErrors[_0x2df83c(0xb1)](_0x2df83c(0xaa),_0x2df83c(0xb2)+PAGE_SLOT_SPECS[_0x2df83c(0xa5)](_0x5d2494=>'--'+_0x5d2494[_0x2df83c(0xbe)])['join'](',\x20')+'.');},async 'dryRun'(_0x278d72){const _0x16373c=a148_0x410b08,{mutation:_0x22f732}=await buildPlan(_0x278d72,!![]);return asDryRunResult(_0x22f732,{'method':_0x16373c(0xbf),'url':SAVE_PATH});},async 'execute'(_0x4adbfe){const _0x393f1d=a148_0x410b08,{page:_0x5332c4,mutation:_0x2f9f45}=await buildPlan(_0x4adbfe,![]);return await savePagePermit(_0x5332c4),{'ok':!![],'data':_0x2f9f45,'message':'Updated\x20page\x20permit\x20for\x20menu\x20'+_0x2f9f45[_0x393f1d(0xa4)][_0x393f1d(0xa1)]};}};
@@ -1 +1 @@
1
- const a142_0x52547e=a142_0x1c22;function a142_0x1c22(_0x47e39a,_0x1b1b42){_0x47e39a=_0x47e39a-0x1a2;const _0x238b08=a142_0x238b();let _0x1c223f=_0x238b08[_0x47e39a];return _0x1c223f;}(function(_0x43beff,_0x24aa8b){const _0x4ffad0=a142_0x1c22,_0x18f69d=_0x43beff();while(!![]){try{const _0x5ad36a=parseInt(_0x4ffad0(0x1b2))/0x1*(-parseInt(_0x4ffad0(0x1b9))/0x2)+-parseInt(_0x4ffad0(0x1a9))/0x3*(-parseInt(_0x4ffad0(0x1a2))/0x4)+parseInt(_0x4ffad0(0x1b7))/0x5*(parseInt(_0x4ffad0(0x1c0))/0x6)+-parseInt(_0x4ffad0(0x1c5))/0x7*(-parseInt(_0x4ffad0(0x1aa))/0x8)+parseInt(_0x4ffad0(0x1b4))/0x9*(-parseInt(_0x4ffad0(0x1af))/0xa)+parseInt(_0x4ffad0(0x1b6))/0xb+parseInt(_0x4ffad0(0x1ac))/0xc*(-parseInt(_0x4ffad0(0x1bf))/0xd);if(_0x5ad36a===_0x24aa8b)break;else _0x18f69d['push'](_0x18f69d['shift']());}catch(_0x4ecdd0){_0x18f69d['push'](_0x18f69d['shift']());}}}(a142_0x238b,0x6d9f5));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 a142_0x238b(){const _0x4bf658=['42PlpzfC','3152VBZWFS','\x20dataset(s)\x20on\x20role\x20','datasets','POST','flagMissing','high-risk-write','has','2991dENhen','1150472ZSebdq','push','12YVSvwz','role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).','revoke','290IaTMLO','length','validation','10XjJTeW','Pass\x20--datasets\x20<datasetCode,...>.','25443lDAwlD','action','7418642HpEDVt','394755nFEBDD','appCode','82830DhTNVv','str','set','Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20','Revoked\x20API\x20access\x20for\x20','Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.','22016410ntrvhr','24ZWAdlM','API','bool','Missing\x20--revoke.','/smartapi/permit/role/update'];a142_0x238b=function(){return _0x4bf658;};return a142_0x238b();}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=a142_0x52547e(0x1c4);async function buildPlan(_0x56769f,_0x2e1bea){const _0x5889cf=a142_0x52547e,_0x4df815=await resolveRoleRef(_0x56769f[_0x5889cf(0x1b8)],readRoleRef(_0x56769f));assertPermConfigurable(_0x4df815);if(!_0x56769f['bool'](_0x5889cf(0x1ae)))throw CliErrors[_0x5889cf(0x1b1)](_0x5889cf(0x1c3),_0x5889cf(0x1ad));const _0x555d15=splitList(_0x56769f[_0x5889cf(0x1ba)](_0x5889cf(0x1a4)));if(_0x555d15[_0x5889cf(0x1b0)]===0x0)throw CliErrors[_0x5889cf(0x1a6)]('datasets',_0x5889cf(0x1b3));const _0x1c3244=await getRoleApiResources(_0x56769f['appCode'],_0x4df815['id']),{byCode:_0x230991,byDataset:_0xa6839a}=flattenApiResources(_0x1c3244),_0x22cbfc=_0x555d15['filter'](_0x4811ec=>!_0xa6839a[_0x5889cf(0x1a8)](_0x4811ec));if(_0x22cbfc[_0x5889cf(0x1b0)]>0x0)throw CliErrors['validation'](_0x5889cf(0x1bc)+_0x22cbfc['join'](',\x20')+'.',_0x5889cf(0x1be));const _0x2d15cb=new Map(),_0x1dff3e=[],_0x3050f0=[];for(const _0x36e411 of _0x555d15){for(const _0x1ec66e of _0xa6839a['get'](_0x36e411)){const _0x2823b6=_0x230991['get'](_0x1ec66e);_0x2d15cb[_0x5889cf(0x1bb)](_0x1ec66e,'0'),_0x1dff3e[_0x5889cf(0x1ab)]({'resourceCode':_0x1ec66e,'datasetCode':_0x36e411,'action':_0x2823b6[_0x5889cf(0x1b5)]}),_0x3050f0[_0x5889cf(0x1ab)]({'resourceCode':_0x1ec66e,'datasetCode':_0x36e411,'action':'0'});}}const _0x3fee03=buildPermits(_0x230991,_0x2d15cb),_0x267499={'operation':'api-revoke','selector':{'appCode':_0x56769f[_0x5889cf(0x1b8)],'roleId':_0x4df815['id'],'roleName':_0x4df815['roleName'],'datasetCodes':_0x555d15},'before':_0x1dff3e,'after':_0x3050f0,'dryRun':_0x2e1bea,'backend':{'method':_0x5889cf(0x1a5),'path':UPDATE_PATH,'roleType':'API'},'warnings':[]};return{'role':_0x4df815,'permits':_0x3fee03,'mutation':_0x267499};}export const permitRoleApisSet={'service':'permit','command':'role-apis-set','description':'Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','risk':a142_0x52547e(0x1a7),'flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4ad45f){const _0xaf3fe8=a142_0x52547e;if(!_0x4ad45f[_0xaf3fe8(0x1c2)]('revoke'))throw CliErrors[_0xaf3fe8(0x1b1)](_0xaf3fe8(0x1c3),'role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).');if(splitList(_0x4ad45f[_0xaf3fe8(0x1ba)](_0xaf3fe8(0x1a4)))[_0xaf3fe8(0x1b0)]===0x0)throw CliErrors[_0xaf3fe8(0x1a6)](_0xaf3fe8(0x1a4),_0xaf3fe8(0x1b3));},async 'dryRun'(_0x4e85c6){const _0x428865=a142_0x52547e,{mutation:_0x53c31c}=await buildPlan(_0x4e85c6,!![]);return asDryRunResult(_0x53c31c,{'method':_0x428865(0x1a5),'url':UPDATE_PATH});},async 'execute'(_0x14ca0a){const _0xcef4=a142_0x52547e,{role:_0x36744c,permits:_0x37b87c,mutation:_0x22adec}=await buildPlan(_0x14ca0a,![]);return await updateAppRole({'id':_0x36744c['id'],'appCode':_0x14ca0a['appCode'],'roleType':_0xcef4(0x1c1),'permits':_0x37b87c}),{'ok':!![],'data':_0x22adec,'message':_0xcef4(0x1bd)+_0x22adec['selector']['datasetCodes'][_0xcef4(0x1b0)]+_0xcef4(0x1a3)+_0x36744c['roleName']};}};
1
+ const a149_0x5828aa=a149_0x2f42;(function(_0x464210,_0x2b0c84){const _0x44d262=a149_0x2f42,_0xa6fef=_0x464210();while(!![]){try{const _0x282ac7=-parseInt(_0x44d262(0xa4))/0x1*(-parseInt(_0x44d262(0xb7))/0x2)+parseInt(_0x44d262(0xaf))/0x3+-parseInt(_0x44d262(0xad))/0x4+-parseInt(_0x44d262(0xa7))/0x5+-parseInt(_0x44d262(0xb0))/0x6*(parseInt(_0x44d262(0xb8))/0x7)+-parseInt(_0x44d262(0xaa))/0x8+parseInt(_0x44d262(0xae))/0x9;if(_0x282ac7===_0x2b0c84)break;else _0xa6fef['push'](_0xa6fef['shift']());}catch(_0x2fd702){_0xa6fef['push'](_0xa6fef['shift']());}}}(a149_0x438a,0x9cc71));import{getRoleApiResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a149_0x2f42(_0x12e1b8,_0x1ae3c8){_0x12e1b8=_0x12e1b8-0x98;const _0x438a1b=a149_0x438a();let _0x2f4239=_0x438a1b[_0x12e1b8];return _0x2f4239;}import{asDryRunResult}from'../../commands/common/dry-run.js';function a149_0x438a(){const _0x21d8d8=['role-apis-set','API','\x20dataset(s)\x20on\x20role\x20','Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20','str','join','high-risk-write','652cIZqEH','POST','get','5151000Gpvxvo','Revoked\x20API\x20access\x20for\x20','has','4126672XZOqyG','bool','filter','77020RwKchm','9720783zAaLfh','3317124VWqmzO','354vStjkx','flagMissing','Pass\x20--datasets\x20<datasetCode,...>.','datasets','Missing\x20--revoke.','roleName','set','1850yESyib','68985GOSYQY','appCode','push','revoke','validation','role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).','/smartapi/permit/role/update','length'];a149_0x438a=function(){return _0x21d8d8;};return a149_0x438a();}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=a149_0x5828aa(0x9b);async function buildPlan(_0x5db8be,_0x28c9e6){const _0x1bca32=a149_0x5828aa,_0x346254=await resolveRoleRef(_0x5db8be[_0x1bca32(0xb9)],readRoleRef(_0x5db8be));assertPermConfigurable(_0x346254);if(!_0x5db8be['bool']('revoke'))throw CliErrors[_0x1bca32(0x99)](_0x1bca32(0xb4),_0x1bca32(0x9a));const _0x2f2bcb=splitList(_0x5db8be['str'](_0x1bca32(0xb3)));if(_0x2f2bcb[_0x1bca32(0x9c)]===0x0)throw CliErrors[_0x1bca32(0xb1)](_0x1bca32(0xb3),_0x1bca32(0xb2));const _0x35f391=await getRoleApiResources(_0x5db8be['appCode'],_0x346254['id']),{byCode:_0x312dd0,byDataset:_0x6fb3d5}=flattenApiResources(_0x35f391),_0x355ff6=_0x2f2bcb[_0x1bca32(0xac)](_0x2f6a7b=>!_0x6fb3d5[_0x1bca32(0xa9)](_0x2f6a7b));if(_0x355ff6[_0x1bca32(0x9c)]>0x0)throw CliErrors[_0x1bca32(0x99)](_0x1bca32(0xa0)+_0x355ff6[_0x1bca32(0xa2)](',\x20')+'.','Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.');const _0x1a186e=new Map(),_0x2ddd81=[],_0x27e0a7=[];for(const _0x96f022 of _0x2f2bcb){for(const _0x190c91 of _0x6fb3d5[_0x1bca32(0xa6)](_0x96f022)){const _0x3854f4=_0x312dd0[_0x1bca32(0xa6)](_0x190c91);_0x1a186e[_0x1bca32(0xb6)](_0x190c91,'0'),_0x2ddd81[_0x1bca32(0xba)]({'resourceCode':_0x190c91,'datasetCode':_0x96f022,'action':_0x3854f4['action']}),_0x27e0a7[_0x1bca32(0xba)]({'resourceCode':_0x190c91,'datasetCode':_0x96f022,'action':'0'});}}const _0xad64f4=buildPermits(_0x312dd0,_0x1a186e),_0x10c2ba={'operation':'api-revoke','selector':{'appCode':_0x5db8be['appCode'],'roleId':_0x346254['id'],'roleName':_0x346254['roleName'],'datasetCodes':_0x2f2bcb},'before':_0x2ddd81,'after':_0x27e0a7,'dryRun':_0x28c9e6,'backend':{'method':'POST','path':UPDATE_PATH,'roleType':_0x1bca32(0x9e)},'warnings':[]};return{'role':_0x346254,'permits':_0xad64f4,'mutation':_0x10c2ba};}export const permitRoleApisSet={'service':'permit','command':a149_0x5828aa(0x9d),'description':'Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','risk':a149_0x5828aa(0xa3),'flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5a0932){const _0x2ffd4a=a149_0x5828aa;if(!_0x5a0932[_0x2ffd4a(0xab)](_0x2ffd4a(0x98)))throw CliErrors['validation']('Missing\x20--revoke.','role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).');if(splitList(_0x5a0932[_0x2ffd4a(0xa1)](_0x2ffd4a(0xb3)))['length']===0x0)throw CliErrors[_0x2ffd4a(0xb1)](_0x2ffd4a(0xb3),'Pass\x20--datasets\x20<datasetCode,...>.');},async 'dryRun'(_0x2435ca){const _0x245b13=a149_0x5828aa,{mutation:_0x2c9caa}=await buildPlan(_0x2435ca,!![]);return asDryRunResult(_0x2c9caa,{'method':_0x245b13(0xa5),'url':UPDATE_PATH});},async 'execute'(_0x42b28d){const _0xf66d24=a149_0x5828aa,{role:_0x3a4998,permits:_0x74c28,mutation:_0x45da0f}=await buildPlan(_0x42b28d,![]);return await updateAppRole({'id':_0x3a4998['id'],'appCode':_0x42b28d[_0xf66d24(0xb9)],'roleType':_0xf66d24(0x9e),'permits':_0x74c28}),{'ok':!![],'data':_0x45da0f,'message':_0xf66d24(0xa8)+_0x45da0f['selector']['datasetCodes'][_0xf66d24(0x9c)]+_0xf66d24(0x9f)+_0x3a4998[_0xf66d24(0xb5)]};}};
@@ -1 +1 @@
1
- const a143_0x4cfeb0=a143_0x34d5;(function(_0x1d9316,_0x335f95){const _0x3cfd15=a143_0x34d5,_0x4bde17=_0x1d9316();while(!![]){try{const _0x3caf26=parseInt(_0x3cfd15(0xeb))/0x1+-parseInt(_0x3cfd15(0xfa))/0x2+-parseInt(_0x3cfd15(0xef))/0x3+parseInt(_0x3cfd15(0xf2))/0x4+-parseInt(_0x3cfd15(0xe7))/0x5*(-parseInt(_0x3cfd15(0xf7))/0x6)+parseInt(_0x3cfd15(0xf0))/0x7+-parseInt(_0x3cfd15(0xee))/0x8;if(_0x3caf26===_0x335f95)break;else _0x4bde17['push'](_0x4bde17['shift']());}catch(_0x4c471c){_0x4bde17['push'](_0x4bde17['shift']());}}}(a143_0x4737,0x5bb44));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';function a143_0x4737(){const _0x3d02f5=['str','menus','629514TDGyHr','permit','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','872672zRaLGY','role-menus-set','length','get','Updated\x20','push','access','menu-grant','appCode','has','selector','menu-revoke','POST','roleName','10GPkmeu','resourceCodes','PAGE','validation','552308nofXyQ','Pass\x20--menus\x20<resourceCode,...>.','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','4632112WCUaDv','433536CrTHby','2734396oRNJHG','flagMissing','1530832wzkhKZ','/smartapi/permit/role/update','action'];a143_0x4737=function(){return _0x3d02f5;};return a143_0x4737();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';function a143_0x34d5(_0x55df0d,_0x43669a){_0x55df0d=_0x55df0d-0xe6;const _0x4737fb=a143_0x4737();let _0x34d5ba=_0x4737fb[_0x55df0d];return _0x34d5ba;}import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a143_0x4cfeb0(0xf3);async function buildPlan(_0x14f0a1,_0x2fc36b){const _0x3bff5a=a143_0x4cfeb0,_0x37bb08=await resolveRoleRef(_0x14f0a1[_0x3bff5a(0x102)],readRoleRef(_0x14f0a1));assertPermConfigurable(_0x37bb08);const _0x195ec7=readGrantRevoke(_0x14f0a1),_0x2eeaa7=splitList(_0x14f0a1[_0x3bff5a(0xf5)](_0x3bff5a(0xf6)));if(_0x2eeaa7[_0x3bff5a(0xfc)]===0x0)throw CliErrors[_0x3bff5a(0xf1)](_0x3bff5a(0xf6),_0x3bff5a(0xec));const _0x5b38a1=await getRoleMenuResources(_0x14f0a1[_0x3bff5a(0x102)],_0x37bb08['id']),_0xe5a28a=flattenMenuResources(_0x5b38a1),_0x55fa23=_0x2eeaa7['filter'](_0x2f0737=>!_0xe5a28a[_0x3bff5a(0x103)](_0x2f0737));if(_0x55fa23[_0x3bff5a(0xfc)]>0x0)throw CliErrors[_0x3bff5a(0xea)]('Unknown\x20menu\x20resourceCode(s):\x20'+_0x55fa23['join'](',\x20')+'.',_0x3bff5a(0xf9));const _0x46870=new Map(),_0x4f29c0=[],_0x207d19=[];for(const _0x410258 of _0x2eeaa7){const _0x291ffd=_0xe5a28a[_0x3bff5a(0xfd)](_0x410258);_0x46870['set'](_0x410258,_0x195ec7),_0x4f29c0['push']({'resourceCode':_0x410258,'action':_0x291ffd[_0x3bff5a(0xf4)]}),_0x207d19[_0x3bff5a(0xff)]({'resourceCode':_0x410258,'action':_0x195ec7});}const _0x5d29ba=buildPermits(_0xe5a28a,_0x46870),_0x1830af={'operation':_0x195ec7===_0x3bff5a(0x100)?_0x3bff5a(0x101):_0x3bff5a(0x105),'selector':{'appCode':_0x14f0a1[_0x3bff5a(0x102)],'roleId':_0x37bb08['id'],'roleName':_0x37bb08[_0x3bff5a(0xe6)],'resourceCodes':_0x2eeaa7},'before':_0x4f29c0,'after':_0x207d19,'dryRun':_0x2fc36b,'backend':{'method':_0x3bff5a(0x106),'path':UPDATE_PATH,'roleType':'PAGE'},'warnings':[]};return{'role':_0x37bb08,'permits':_0x5d29ba,'mutation':_0x1830af};}export const permitRoleMenusSet={'service':a143_0x4cfeb0(0xf8),'command':a143_0x4cfeb0(0xfb),'description':a143_0x4cfeb0(0xed),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xadcb3){const _0x28b5c2=a143_0x4cfeb0;readGrantRevoke(_0xadcb3);if(splitList(_0xadcb3['str'](_0x28b5c2(0xf6)))[_0x28b5c2(0xfc)]===0x0)throw CliErrors['flagMissing'](_0x28b5c2(0xf6),'Pass\x20--menus\x20<resourceCode,...>.');},async 'dryRun'(_0x37e8fd){const _0x1ca7cb=a143_0x4cfeb0,{mutation:_0x3ce684}=await buildPlan(_0x37e8fd,!![]);return asDryRunResult(_0x3ce684,{'method':_0x1ca7cb(0x106),'url':UPDATE_PATH});},async 'execute'(_0x52bf22){const _0x1e26da=a143_0x4cfeb0,{role:_0x490f16,permits:_0x3b5729,mutation:_0x4aba49}=await buildPlan(_0x52bf22,![]);return await updateAppRole({'id':_0x490f16['id'],'appCode':_0x52bf22['appCode'],'roleType':_0x1e26da(0xe9),'permits':_0x3b5729}),{'ok':!![],'data':_0x4aba49,'message':_0x1e26da(0xfe)+_0x4aba49[_0x1e26da(0x104)][_0x1e26da(0xe8)][_0x1e26da(0xfc)]+'\x20menu\x20permit(s)\x20for\x20role\x20'+_0x490f16[_0x1e26da(0xe6)]};}};
1
+ const a150_0x13979d=a150_0x5e7f;(function(_0xa6e0c6,_0x14e841){const _0xfd0a95=a150_0x5e7f,_0x2fb9db=_0xa6e0c6();while(!![]){try{const _0x3f4fa7=-parseInt(_0xfd0a95(0xa1))/0x1+parseInt(_0xfd0a95(0xaa))/0x2+parseInt(_0xfd0a95(0xb8))/0x3*(parseInt(_0xfd0a95(0x9f))/0x4)+-parseInt(_0xfd0a95(0x9d))/0x5*(-parseInt(_0xfd0a95(0xac))/0x6)+parseInt(_0xfd0a95(0xc0))/0x7+parseInt(_0xfd0a95(0xa6))/0x8+parseInt(_0xfd0a95(0xa7))/0x9*(-parseInt(_0xfd0a95(0xa8))/0xa);if(_0x3f4fa7===_0x14e841)break;else _0x2fb9db['push'](_0x2fb9db['shift']());}catch(_0x439583){_0x2fb9db['push'](_0x2fb9db['shift']());}}}(a150_0x409f,0xc8f2f));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';function a150_0x5e7f(_0x33b426,_0x4f14bd){_0x33b426=_0x33b426-0x9c;const _0x409f51=a150_0x409f();let _0x5e7f71=_0x409f51[_0x33b426];return _0x5e7f71;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';function a150_0x409f(){const _0x4dbd78=['5193HSpRpi','49060yViJip','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','337678CtUoqS','action','529068XnxUBR','Pass\x20--menus\x20<resourceCode,...>.','str','role-menus-set','PAGE','length','Unknown\x20menu\x20resourceCode(s):\x20','push','Updated\x20','/smartapi/permit/role/update','get','POST','114wWAPtE','validation','appCode','filter','join','\x20menu\x20permit(s)\x20for\x20role\x20','roleName','flagMissing','1887340CukRsj','has','30orrGlK','set','169884etMQWp','selector','545636vtnWny','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','resourceCodes','menus','menu-revoke','12944480VxlRcr'];a150_0x409f=function(){return _0x4dbd78;};return a150_0x409f();}import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a150_0x13979d(0xb5);async function buildPlan(_0x5c2fa9,_0x4ffa64){const _0x56b3f1=a150_0x13979d,_0x5ba800=await resolveRoleRef(_0x5c2fa9[_0x56b3f1(0xba)],readRoleRef(_0x5c2fa9));assertPermConfigurable(_0x5ba800);const _0x5c4ba6=readGrantRevoke(_0x5c2fa9),_0x260f74=splitList(_0x5c2fa9[_0x56b3f1(0xae)](_0x56b3f1(0xa4)));if(_0x260f74['length']===0x0)throw CliErrors['flagMissing']('menus','Pass\x20--menus\x20<resourceCode,...>.');const _0xcbffea=await getRoleMenuResources(_0x5c2fa9[_0x56b3f1(0xba)],_0x5ba800['id']),_0x325963=flattenMenuResources(_0xcbffea),_0x2b0e97=_0x260f74[_0x56b3f1(0xbb)](_0x39ac6=>!_0x325963[_0x56b3f1(0x9c)](_0x39ac6));if(_0x2b0e97[_0x56b3f1(0xb1)]>0x0)throw CliErrors[_0x56b3f1(0xb9)](_0x56b3f1(0xb2)+_0x2b0e97[_0x56b3f1(0xbc)](',\x20')+'.',_0x56b3f1(0xa9));const _0x4b10ed=new Map(),_0x1e0a79=[],_0x310866=[];for(const _0x284c24 of _0x260f74){const _0x195348=_0x325963[_0x56b3f1(0xb6)](_0x284c24);_0x4b10ed[_0x56b3f1(0x9e)](_0x284c24,_0x5c4ba6),_0x1e0a79[_0x56b3f1(0xb3)]({'resourceCode':_0x284c24,'action':_0x195348[_0x56b3f1(0xab)]}),_0x310866[_0x56b3f1(0xb3)]({'resourceCode':_0x284c24,'action':_0x5c4ba6});}const _0x3a6cec=buildPermits(_0x325963,_0x4b10ed),_0x2e4bd1={'operation':_0x5c4ba6==='access'?'menu-grant':_0x56b3f1(0xa5),'selector':{'appCode':_0x5c2fa9[_0x56b3f1(0xba)],'roleId':_0x5ba800['id'],'roleName':_0x5ba800[_0x56b3f1(0xbe)],'resourceCodes':_0x260f74},'before':_0x1e0a79,'after':_0x310866,'dryRun':_0x4ffa64,'backend':{'method':_0x56b3f1(0xb7),'path':UPDATE_PATH,'roleType':_0x56b3f1(0xb0)},'warnings':[]};return{'role':_0x5ba800,'permits':_0x3a6cec,'mutation':_0x2e4bd1};}export const permitRoleMenusSet={'service':'permit','command':a150_0x13979d(0xaf),'description':a150_0x13979d(0xa2),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x95cb1a){const _0x1470d3=a150_0x13979d;readGrantRevoke(_0x95cb1a);if(splitList(_0x95cb1a[_0x1470d3(0xae)]('menus'))['length']===0x0)throw CliErrors[_0x1470d3(0xbf)](_0x1470d3(0xa4),_0x1470d3(0xad));},async 'dryRun'(_0x2ccd79){const _0x31dca6=a150_0x13979d,{mutation:_0x12239b}=await buildPlan(_0x2ccd79,!![]);return asDryRunResult(_0x12239b,{'method':_0x31dca6(0xb7),'url':UPDATE_PATH});},async 'execute'(_0x14c203){const _0x2bd954=a150_0x13979d,{role:_0x1672d5,permits:_0x310ab1,mutation:_0x253eb2}=await buildPlan(_0x14c203,![]);return await updateAppRole({'id':_0x1672d5['id'],'appCode':_0x14c203[_0x2bd954(0xba)],'roleType':_0x2bd954(0xb0),'permits':_0x310ab1}),{'ok':!![],'data':_0x253eb2,'message':_0x2bd954(0xb4)+_0x253eb2[_0x2bd954(0xa0)][_0x2bd954(0xa3)][_0x2bd954(0xb1)]+_0x2bd954(0xbd)+_0x1672d5[_0x2bd954(0xbe)]};}};
@@ -1 +1 @@
1
- const a144_0x4deca8=a144_0x101d;(function(_0x5d90e7,_0x391fb9){const _0x266748=a144_0x101d,_0x5f133f=_0x5d90e7();while(!![]){try{const _0x18cfe5=parseInt(_0x266748(0x1cc))/0x1+parseInt(_0x266748(0x1c8))/0x2+-parseInt(_0x266748(0x1d3))/0x3*(parseInt(_0x266748(0x1da))/0x4)+-parseInt(_0x266748(0x1d4))/0x5*(parseInt(_0x266748(0x1d1))/0x6)+parseInt(_0x266748(0x1d2))/0x7*(-parseInt(_0x266748(0x1dc))/0x8)+-parseInt(_0x266748(0x1cb))/0x9+parseInt(_0x266748(0x1db))/0xa;if(_0x18cfe5===_0x391fb9)break;else _0x5f133f['push'](_0x5f133f['shift']());}catch(_0x1afcf6){_0x5f133f['push'](_0x5f133f['shift']());}}}(a144_0x5aee,0xe3b8b));import{getRoleMenuResources}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{flattenMenuResources,readRoleRef,ROLE_REF_FLAG}from'../../commands/permit/shared.js';import{resolveRoleRef}from'../../commands/role/shared.js';function a144_0x101d(_0x5203db,_0x6e4159){_0x5203db=_0x5203db-0x1c6;const _0x5aeebc=a144_0x5aee();let _0x101dab=_0x5aeebc[_0x5203db];return _0x101dab;}export const permitRoleMenus={'service':'permit','command':a144_0x4deca8(0x1d0),'description':a144_0x4deca8(0x1c9),'risk':a144_0x4deca8(0x1d9),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x288fc6){const _0x15da05=a144_0x4deca8,_0x5ab3f5=await resolveRoleRef(_0x288fc6['appCode'],readRoleRef(_0x288fc6)),_0x9a7f02=await getRoleMenuResources(_0x288fc6[_0x15da05(0x1cd)],_0x5ab3f5['id']),_0x911288=flattenMenuResources(_0x9a7f02),_0x34d2f8=Array[_0x15da05(0x1cf)](_0x911288['values']())[_0x15da05(0x1d8)](_0x22a987=>({'resourceCode':_0x22a987[_0x15da05(0x1c6)],'resourceName':_0x22a987[_0x15da05(0x1de)],'allowed':_0x22a987[_0x15da05(0x1d6)]===_0x15da05(0x1d5),'action':_0x22a987[_0x15da05(0x1d6)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x288fc6[_0x15da05(0x1cd)],'roleId':_0x5ab3f5['id'],'roleName':_0x5ab3f5[_0x15da05(0x1c7)]},'menus':_0x34d2f8},'message':'Role\x20'+_0x5ab3f5[_0x15da05(0x1c7)]+_0x15da05(0x1dd)+_0x34d2f8[_0x15da05(0x1ce)](_0x1c32ed=>_0x1c32ed['allowed'])[_0x15da05(0x1d7)]+'/'+_0x34d2f8['length']+_0x15da05(0x1ca)};}};function a144_0x5aee(){const _0x4a19fb=['access','action','length','map','read','40TgtxOq','13159430DOkvYc','16nLatJB','\x20has\x20','resourceName','resourceCode','roleName','2610230uWEeWy','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','\x20menu(s)\x20allowed','5508270jejuHz','1485442kGnrNx','appCode','filter','from','role-menus','6hkMeLy','6167567zNYtml','154932lZNSdq','1415605ZvLliK'];a144_0x5aee=function(){return _0x4a19fb;};return a144_0x5aee();}
1
+ const a151_0x261261=a151_0x5c52;(function(_0x136ded,_0x1c4783){const _0x365851=a151_0x5c52,_0x2afcfa=_0x136ded();while(!![]){try{const _0x3ba519=parseInt(_0x365851(0x154))/0x1*(-parseInt(_0x365851(0x155))/0x2)+parseInt(_0x365851(0x14d))/0x3*(-parseInt(_0x365851(0x146))/0x4)+-parseInt(_0x365851(0x149))/0x5*(parseInt(_0x365851(0x14c))/0x6)+parseInt(_0x365851(0x14e))/0x7+parseInt(_0x365851(0x150))/0x8*(-parseInt(_0x365851(0x148))/0x9)+-parseInt(_0x365851(0x13f))/0xa*(parseInt(_0x365851(0x143))/0xb)+parseInt(_0x365851(0x14b))/0xc;if(_0x3ba519===_0x1c4783)break;else _0x2afcfa['push'](_0x2afcfa['shift']());}catch(_0x116540){_0x2afcfa['push'](_0x2afcfa['shift']());}}}(a151_0x2677,0xcb739));function a151_0x2677(){const _0x54c7ef=['roleName','32035392lSeMsl','666aitKEv','45ICWpTX','9965522Qddwfy','resourceName','116176hacqcZ','access','allowed','resourceCode','2DagFII','547918SHpIWT','from','map','2550YrIlFv','role-menus','action','length','28831KdggUQ','filter','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','44052Reyxaj','\x20menu(s)\x20allowed','261ZmFIxy','65645lAmkIQ'];a151_0x2677=function(){return _0x54c7ef;};return a151_0x2677();}import{getRoleMenuResources}from'../../core/api-client.js';function a151_0x5c52(_0x8d0b78,_0x383279){_0x8d0b78=_0x8d0b78-0x13d;const _0x267709=a151_0x2677();let _0x5c52bc=_0x267709[_0x8d0b78];return _0x5c52bc;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{flattenMenuResources,readRoleRef,ROLE_REF_FLAG}from'../../commands/permit/shared.js';import{resolveRoleRef}from'../../commands/role/shared.js';export const permitRoleMenus={'service':'permit','command':a151_0x261261(0x140),'description':a151_0x261261(0x145),'risk':'read','flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x1ecc57){const _0x35ca58=a151_0x261261,_0x59f882=await resolveRoleRef(_0x1ecc57['appCode'],readRoleRef(_0x1ecc57)),_0x2dfa55=await getRoleMenuResources(_0x1ecc57['appCode'],_0x59f882['id']),_0x4d5da=flattenMenuResources(_0x2dfa55),_0x26f476=Array[_0x35ca58(0x13d)](_0x4d5da['values']())[_0x35ca58(0x13e)](_0x8ae244=>({'resourceCode':_0x8ae244[_0x35ca58(0x153)],'resourceName':_0x8ae244[_0x35ca58(0x14f)],'allowed':_0x8ae244[_0x35ca58(0x141)]===_0x35ca58(0x151),'action':_0x8ae244[_0x35ca58(0x141)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x1ecc57['appCode'],'roleId':_0x59f882['id'],'roleName':_0x59f882[_0x35ca58(0x14a)]},'menus':_0x26f476},'message':'Role\x20'+_0x59f882[_0x35ca58(0x14a)]+'\x20has\x20'+_0x26f476[_0x35ca58(0x144)](_0x10f404=>_0x10f404[_0x35ca58(0x152)])[_0x35ca58(0x142)]+'/'+_0x26f476[_0x35ca58(0x142)]+_0x35ca58(0x147)};}};
@@ -1 +1 @@
1
- const a145_0x5e8731=a145_0x4155;(function(_0x214dda,_0x15f529){const _0x30c8df=a145_0x4155,_0x2f4595=_0x214dda();while(!![]){try{const _0x43ed96=-parseInt(_0x30c8df(0x18c))/0x1*(-parseInt(_0x30c8df(0x13f))/0x2)+parseInt(_0x30c8df(0x165))/0x3+-parseInt(_0x30c8df(0x16b))/0x4+-parseInt(_0x30c8df(0x163))/0x5*(parseInt(_0x30c8df(0x166))/0x6)+parseInt(_0x30c8df(0x151))/0x7*(parseInt(_0x30c8df(0x168))/0x8)+parseInt(_0x30c8df(0x131))/0x9*(parseInt(_0x30c8df(0x18a))/0xa)+parseInt(_0x30c8df(0x181))/0xb*(-parseInt(_0x30c8df(0x13e))/0xc);if(_0x43ed96===_0x15f529)break;else _0x2f4595['push'](_0x2f4595['shift']());}catch(_0x388bd6){_0x2f4595['push'](_0x2f4595['shift']());}}}(a145_0x2f3a,0x35fea));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a145_0x5e8731(0x157),'type':a145_0x5e8731(0x180),'required':!![],'description':a145_0x5e8731(0x145)};function a145_0x2f3a(){const _0x3edb5e=['Role\x20\x22',';\x20SELF\x20=\x20only\x20own\x20rows','dataUpdate','validation','role','apiList','revoke','\x20(comma-separated\x20SELF/ALL/id/name)','resourceCode','flagMissing','str','roleType','number','140745qJpCvQ','trim','allowSelf','export-roles','grant','label','detail-roles','map','data\x20create','550LxKxZD','data\x20detail','85464TnNkHb','push','Disambiguate\x20with\x20an\x20id.','63234xCiCwx','datasets','dataDetail','\x20not\x20found.','\x22\x20is\x20ambiguous\x20(ids:\x20','appCode','dataExport','resourceName','Grant\x20access\x20to\x20the\x20listed\x20resources','find','menuId','entries','\x20is\x20not\x20available\x20for\x20this\x20app.','12dHBmGE','2SiTsSU','ALL','data\x20delete','get','set','access','Menu\x20id\x20(from\x20`menu\x20list`)','SELF','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','Roles\x20for\x20','menuPermit','data\x20update','data\x20export','roleName','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','menu-roles','menu\x20visibility','allowedActions','594097KtRjDT','key','rolePermit','datasetCode','filter','pageNodeList','menu-id','join','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','string','bool','Role\x20id\x20','create-roles','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','row\x20visibility','Run\x20`role\x20list`.','delete-roles','dataCreate','65AQZVpR','length','263412gYEZYa','122142xMaTHZ','menus','8sdYveK','row-roles','update-roles','583884HHSzHw','Pass\x20--role\x20<id|name>.','Special\x20role\x20','dataPermit','dataDelete','boolean','test','action','SELF\x20is\x20not\x20allowed\x20for\x20'];a145_0x2f3a=function(){return _0x3edb5e;};return a145_0x2f3a();}export const ROLE_REF_FLAG={'name':a145_0x5e8731(0x178),'type':a145_0x5e8731(0x15a),'required':!![],'description':'Role\x20id\x20or\x20role\x20name'};export const GRANT_FLAG={'name':a145_0x5e8731(0x185),'type':'boolean','required':![],'description':a145_0x5e8731(0x139)};export const REVOKE_FLAG={'name':a145_0x5e8731(0x17a),'type':a145_0x5e8731(0x170),'required':![],'description':'Revoke\x20access\x20to\x20the\x20listed\x20resources'};export const MENUS_FLAG={'name':a145_0x5e8731(0x167),'type':a145_0x5e8731(0x15a),'required':!![],'description':'Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke'};function a145_0x4155(_0x339d1b,_0x4e050f){_0x339d1b=_0x339d1b-0x130;const _0x2f3a6e=a145_0x2f3a();let _0x415576=_0x2f3a6e[_0x339d1b];return _0x415576;}export const DATASETS_FLAG={'name':a145_0x5e8731(0x132),'type':a145_0x5e8731(0x15a),'required':!![],'description':a145_0x5e8731(0x147)};export const PAGE_SLOT_SPECS=[{'flag':a145_0x5e8731(0x14e),'key':'menuPermit','allowSelf':![],'label':a145_0x5e8731(0x14f)},{'flag':a145_0x5e8731(0x15d),'key':a145_0x5e8731(0x162),'allowSelf':![],'label':a145_0x5e8731(0x189)},{'flag':a145_0x5e8731(0x16a),'key':a145_0x5e8731(0x176),'allowSelf':![],'label':a145_0x5e8731(0x14a)},{'flag':a145_0x5e8731(0x161),'key':a145_0x5e8731(0x16f),'allowSelf':![],'label':a145_0x5e8731(0x141)},{'flag':a145_0x5e8731(0x187),'key':a145_0x5e8731(0x133),'allowSelf':![],'label':a145_0x5e8731(0x18b)},{'flag':a145_0x5e8731(0x184),'key':a145_0x5e8731(0x137),'allowSelf':![],'label':a145_0x5e8731(0x14b)},{'flag':a145_0x5e8731(0x169),'key':a145_0x5e8731(0x16e),'allowSelf':!![],'label':a145_0x5e8731(0x15f)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a145_0x5e8731(0x188)](_0x1ed78e=>({'name':_0x1ed78e['flag'],'type':a145_0x5e8731(0x15a),'required':![],'description':a145_0x5e8731(0x148)+_0x1ed78e[a145_0x5e8731(0x186)]+a145_0x5e8731(0x17b)+(_0x1ed78e[a145_0x5e8731(0x183)]?a145_0x5e8731(0x175):'')}));export function splitList(_0x383073){const _0x3a19d9=a145_0x5e8731;return _0x383073['split'](',')[_0x3a19d9(0x188)](_0x196bed=>_0x196bed[_0x3a19d9(0x182)]())[_0x3a19d9(0x155)](Boolean);}export function projectRoleRef(_0x3642ef){const _0x1ebba9=a145_0x5e8731;return{'id':_0x3642ef['id'],'roleName':_0x3642ef[_0x1ebba9(0x14c)],'roleType':_0x3642ef['roleType']};}export async function resolvePermitRoles(_0x4caef1,_0x977e73,_0x47426f){const _0x2dac79=a145_0x5e8731,_0x1e0ab5=await listPermitRoles(_0x4caef1,{'needSelf':!![],'needPublic':!![]}),_0x243a27=[];for(const _0x3ba977 of _0x977e73){const _0x30e5fc=resolveOnePermitRole(_0x1e0ab5,_0x3ba977);if(!_0x47426f[_0x2dac79(0x183)]&&_0x30e5fc['roleType']===_0x2dac79(0x146))throw CliErrors[_0x2dac79(0x177)](_0x2dac79(0x173)+_0x47426f[_0x2dac79(0x186)]+'.',_0x2dac79(0x15e));if(!_0x243a27['some'](_0x598cdf=>_0x598cdf['id']===_0x30e5fc['id']))_0x243a27[_0x2dac79(0x18d)](_0x30e5fc);}return _0x243a27;}function resolveOnePermitRole(_0x169ff0,_0x1103fb){const _0x19ebe3=a145_0x5e8731,_0x341ebd=_0x1103fb[_0x19ebe3(0x182)](),_0x5ba032=_0x341ebd['toUpperCase']();if(_0x5ba032===_0x19ebe3(0x146)||_0x5ba032===_0x19ebe3(0x140)){const _0x4cbc78=_0x169ff0[_0x19ebe3(0x13a)](_0x2447c4=>_0x2447c4[_0x19ebe3(0x17f)]===_0x5ba032);if(!_0x4cbc78)throw CliErrors[_0x19ebe3(0x177)](_0x19ebe3(0x16d)+_0x5ba032+_0x19ebe3(0x13d));return _0x4cbc78;}if(/^-?\d+$/[_0x19ebe3(0x171)](_0x341ebd)){const _0x3e420c=Number(_0x341ebd),_0x28388a=_0x169ff0[_0x19ebe3(0x13a)](_0x49a411=>_0x49a411['id']===_0x3e420c);if(!_0x28388a)throw CliErrors[_0x19ebe3(0x177)](_0x19ebe3(0x15c)+_0x3e420c+_0x19ebe3(0x134),_0x19ebe3(0x160));return _0x28388a;}const _0x457549=_0x169ff0[_0x19ebe3(0x155)](_0x52788d=>_0x52788d['roleName']===_0x341ebd);if(_0x457549[_0x19ebe3(0x164)]===0x0)throw CliErrors[_0x19ebe3(0x177)]('Role\x20\x22'+_0x341ebd+'\x22\x20not\x20found.',_0x19ebe3(0x159));if(_0x457549[_0x19ebe3(0x164)]>0x1)throw CliErrors[_0x19ebe3(0x177)](_0x19ebe3(0x174)+_0x341ebd+_0x19ebe3(0x135)+_0x457549[_0x19ebe3(0x188)](_0x4de26b=>_0x4de26b['id'])[_0x19ebe3(0x158)](',\x20')+').',_0x19ebe3(0x130));return _0x457549[0x0];}export function projectPageSlot(_0xdfb6ef){const _0x55278c=a145_0x5e8731;if(!_0xdfb6ef)return null;return{'resourceCode':_0xdfb6ef[_0x55278c(0x17c)],'roles':(_0xdfb6ef[_0x55278c(0x153)]??[])[_0x55278c(0x188)](projectRoleRef)};}export function projectPagePermit(_0x40a7a8){const _0x5feee0=a145_0x5e8731,_0x3d8a39={'menuId':_0x40a7a8[_0x5feee0(0x13b)],'appCode':_0x40a7a8[_0x5feee0(0x136)],'menuPermit':projectPageSlot(_0x40a7a8[_0x5feee0(0x149)])};for(const _0x2124ef of PAGE_SLOT_SPECS){if(_0x2124ef[_0x5feee0(0x152)]===_0x5feee0(0x149))continue;_0x3d8a39[_0x2124ef[_0x5feee0(0x152)]]=projectPageSlot(_0x40a7a8[_0x2124ef[_0x5feee0(0x152)]]);}return _0x3d8a39;}export function flattenMenuResources(_0x452c5f){const _0x359b96=new Map(),_0x5ef4da=_0x183ed7=>{const _0x1f7104=a145_0x4155;for(const _0x613bd9 of _0x183ed7??[]){_0x359b96['set'](_0x613bd9[_0x1f7104(0x17c)],{'resourceCode':_0x613bd9['resourceCode'],'resourceName':_0x613bd9[_0x1f7104(0x138)],'action':_0x613bd9[_0x1f7104(0x150)]?.[0x0]??'0'});if(_0x613bd9[_0x1f7104(0x156)])_0x5ef4da(_0x613bd9['pageNodeList']);}};return _0x5ef4da(_0x452c5f),_0x359b96;}export function flattenApiResources(_0x20ea61){const _0x44fbe7=a145_0x5e8731,_0x3b01d0=new Map(),_0x5792e4=new Map();for(const _0x3c08cd of _0x20ea61){const _0x1df58b=_0x3c08cd[_0x44fbe7(0x179)]??{};for(const [_0x5f474f,_0x10f87f]of Object[_0x44fbe7(0x13c)](_0x1df58b)){_0x3b01d0[_0x44fbe7(0x143)](_0x5f474f,{'resourceCode':_0x5f474f,'resourceName':_0x3c08cd[_0x44fbe7(0x138)],'datasetCode':_0x3c08cd['datasetCode'],'action':_0x10f87f?.[0x0]??'0'});const _0x2a8042=_0x5792e4[_0x44fbe7(0x142)](_0x3c08cd['datasetCode'])??[];_0x2a8042[_0x44fbe7(0x18d)](_0x5f474f),_0x5792e4[_0x44fbe7(0x143)](_0x3c08cd[_0x44fbe7(0x154)],_0x2a8042);}}return{'byCode':_0x3b01d0,'byDataset':_0x5792e4};}export function buildPermits(_0x3578e5,_0x351f96){const _0x1ae288=a145_0x5e8731,_0x3554fb={};for(const [_0x3280e4,_0x8712bf]of _0x3578e5){const _0x1566bb=_0x351f96[_0x1ae288(0x142)](_0x3280e4)??_0x8712bf[_0x1ae288(0x172)];_0x3554fb[_0x3280e4]=[_0x1566bb];}return _0x3554fb;}export function readRoleRef(_0x5582a0){const _0xeb4a90=a145_0x5e8731,_0x163141=_0x5582a0[_0xeb4a90(0x17e)](_0xeb4a90(0x178))['trim']();if(!_0x163141)throw CliErrors[_0xeb4a90(0x17d)](_0xeb4a90(0x178),_0xeb4a90(0x16c));return _0x163141;}export function readGrantRevoke(_0x112eab){const _0x4f41ef=a145_0x5e8731,_0x37181e=_0x112eab[_0x4f41ef(0x15b)](_0x4f41ef(0x185)),_0x1dbe8d=_0x112eab[_0x4f41ef(0x15b)](_0x4f41ef(0x17a));if(_0x37181e&&_0x1dbe8d)throw CliErrors[_0x4f41ef(0x177)](_0x4f41ef(0x14d));if(!_0x37181e&&!_0x1dbe8d)throw CliErrors[_0x4f41ef(0x177)]('Missing\x20action.','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.');return _0x37181e?_0x4f41ef(0x144):'0';}
1
+ const a152_0x87259=a152_0x4c9a;(function(_0x2fb2bf,_0x22425e){const _0x12af18=a152_0x4c9a,_0x44105b=_0x2fb2bf();while(!![]){try{const _0xabc701=parseInt(_0x12af18(0x11b))/0x1*(-parseInt(_0x12af18(0x101))/0x2)+parseInt(_0x12af18(0xf4))/0x3+-parseInt(_0x12af18(0x10b))/0x4*(parseInt(_0x12af18(0xee))/0x5)+parseInt(_0x12af18(0x123))/0x6+parseInt(_0x12af18(0xef))/0x7+parseInt(_0x12af18(0xf5))/0x8+parseInt(_0x12af18(0x10f))/0x9;if(_0xabc701===_0x22425e)break;else _0x44105b['push'](_0x44105b['shift']());}catch(_0x2d4422){_0x44105b['push'](_0x44105b['shift']());}}}(a152_0xe305,0x8ac11));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':'menu-id','type':a152_0x87259(0x130),'required':!![],'description':a152_0x87259(0x109)};export const ROLE_REF_FLAG={'name':a152_0x87259(0xf0),'type':a152_0x87259(0xf6),'required':!![],'description':a152_0x87259(0x13b)};export const GRANT_FLAG={'name':'grant','type':'boolean','required':![],'description':a152_0x87259(0xea)};export const REVOKE_FLAG={'name':'revoke','type':a152_0x87259(0x129),'required':![],'description':a152_0x87259(0x135)};export const MENUS_FLAG={'name':'menus','type':a152_0x87259(0xf6),'required':!![],'description':a152_0x87259(0x120)};function a152_0xe305(){const _0x109e67=['push','entries','export-roles','Role\x20\x22','menuPermit','number','bool','appCode','dataCreate','delete-roles','Revoke\x20access\x20to\x20the\x20listed\x20resources','dataDelete','data\x20delete','SELF\x20is\x20not\x20allowed\x20for\x20','\x20not\x20found.','Roles\x20for\x20','Role\x20id\x20or\x20role\x20name',';\x20SELF\x20=\x20only\x20own\x20rows','resourceCode','datasets','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','access','roleType','Grant\x20access\x20to\x20the\x20listed\x20resources','menuId','trim','apiList','25uhKhgw','362803lGwZeN','role','ALL','dataExport','map','1261515YVaOaS','8161856qOtmcB','string','some','rolePermit','data\x20export','menu-roles','str','Special\x20role\x20','update-roles','pageNodeList','data\x20update','get','1528qgAfDz','SELF','data\x20detail','filter','row\x20visibility','grant','Missing\x20action.','create-roles','Menu\x20id\x20(from\x20`menu\x20list`)','find','707156qMFLeV','Role\x20id\x20','validation','row-roles','302373zdwGcP','dataDetail','length','\x20(comma-separated\x20SELF/ALL/id/name)','detail-roles','menu\x20visibility','\x22\x20is\x20ambiguous\x20(ids:\x20','test','toUpperCase','Pass\x20--role\x20<id|name>.','revoke','roleName','434TMbtLA','Run\x20`role\x20list`.','set','join','datasetCode','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','1546170HqwqqY','\x20is\x20not\x20available\x20for\x20this\x20app.','allowSelf','resourceName','dataUpdate','label','boolean','key'];a152_0xe305=function(){return _0x109e67;};return a152_0xe305();}export const DATASETS_FLAG={'name':a152_0x87259(0xe6),'type':a152_0x87259(0xf6),'required':!![],'description':'Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for'};export const PAGE_SLOT_SPECS=[{'flag':a152_0x87259(0xfa),'key':a152_0x87259(0x12f),'allowSelf':![],'label':a152_0x87259(0x114)},{'flag':a152_0x87259(0x108),'key':a152_0x87259(0x133),'allowSelf':![],'label':'data\x20create'},{'flag':a152_0x87259(0xfd),'key':a152_0x87259(0x127),'allowSelf':![],'label':a152_0x87259(0xff)},{'flag':a152_0x87259(0x134),'key':a152_0x87259(0x136),'allowSelf':![],'label':a152_0x87259(0x137)},{'flag':a152_0x87259(0x113),'key':a152_0x87259(0x110),'allowSelf':![],'label':a152_0x87259(0x103)},{'flag':a152_0x87259(0x12d),'key':a152_0x87259(0xf2),'allowSelf':![],'label':a152_0x87259(0xf9)},{'flag':a152_0x87259(0x10e),'key':'dataPermit','allowSelf':!![],'label':a152_0x87259(0x105)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS['map'](_0x366f57=>({'name':_0x366f57['flag'],'type':a152_0x87259(0xf6),'required':![],'description':a152_0x87259(0x13a)+_0x366f57[a152_0x87259(0x128)]+a152_0x87259(0x112)+(_0x366f57[a152_0x87259(0x125)]?a152_0x87259(0x13c):'')}));export function splitList(_0x10cf86){const _0x3d06d9=a152_0x87259;return _0x10cf86['split'](',')[_0x3d06d9(0xf3)](_0x2a1e5d=>_0x2a1e5d['trim']())[_0x3d06d9(0x104)](Boolean);}export function projectRoleRef(_0x262735){const _0x3bfae3=a152_0x87259;return{'id':_0x262735['id'],'roleName':_0x262735[_0x3bfae3(0x11a)],'roleType':_0x262735[_0x3bfae3(0xe9)]};}export async function resolvePermitRoles(_0x3ef76d,_0x2fa666,_0x4ce6d5){const _0x39cc82=a152_0x87259,_0x219641=await listPermitRoles(_0x3ef76d,{'needSelf':!![],'needPublic':!![]}),_0x55a29b=[];for(const _0x450bb5 of _0x2fa666){const _0x559aad=resolveOnePermitRole(_0x219641,_0x450bb5);if(!_0x4ce6d5[_0x39cc82(0x125)]&&_0x559aad[_0x39cc82(0xe9)]===_0x39cc82(0x102))throw CliErrors[_0x39cc82(0x10d)](_0x39cc82(0x138)+_0x4ce6d5[_0x39cc82(0x128)]+'.',_0x39cc82(0xe7));if(!_0x55a29b[_0x39cc82(0xf7)](_0x2e4a78=>_0x2e4a78['id']===_0x559aad['id']))_0x55a29b[_0x39cc82(0x12b)](_0x559aad);}return _0x55a29b;}function resolveOnePermitRole(_0x551497,_0x16b6bd){const _0x42ad3c=a152_0x87259,_0x4074ba=_0x16b6bd[_0x42ad3c(0xec)](),_0x38cb40=_0x4074ba[_0x42ad3c(0x117)]();if(_0x38cb40==='SELF'||_0x38cb40===_0x42ad3c(0xf1)){const _0x1b0049=_0x551497[_0x42ad3c(0x10a)](_0x1c9c06=>_0x1c9c06['roleType']===_0x38cb40);if(!_0x1b0049)throw CliErrors[_0x42ad3c(0x10d)](_0x42ad3c(0xfc)+_0x38cb40+_0x42ad3c(0x124));return _0x1b0049;}if(/^-?\d+$/[_0x42ad3c(0x116)](_0x4074ba)){const _0x3fa679=Number(_0x4074ba),_0xf3c39f=_0x551497[_0x42ad3c(0x10a)](_0x21f724=>_0x21f724['id']===_0x3fa679);if(!_0xf3c39f)throw CliErrors[_0x42ad3c(0x10d)](_0x42ad3c(0x10c)+_0x3fa679+_0x42ad3c(0x139),_0x42ad3c(0x11c));return _0xf3c39f;}const _0x3b021d=_0x551497[_0x42ad3c(0x104)](_0x1fbe80=>_0x1fbe80[_0x42ad3c(0x11a)]===_0x4074ba);if(_0x3b021d['length']===0x0)throw CliErrors[_0x42ad3c(0x10d)](_0x42ad3c(0x12e)+_0x4074ba+'\x22\x20not\x20found.',_0x42ad3c(0x121));if(_0x3b021d[_0x42ad3c(0x111)]>0x1)throw CliErrors['validation'](_0x42ad3c(0x12e)+_0x4074ba+_0x42ad3c(0x115)+_0x3b021d[_0x42ad3c(0xf3)](_0xcbb693=>_0xcbb693['id'])[_0x42ad3c(0x11e)](',\x20')+').','Disambiguate\x20with\x20an\x20id.');return _0x3b021d[0x0];}export function projectPageSlot(_0x41ef13){const _0x495b21=a152_0x87259;if(!_0x41ef13)return null;return{'resourceCode':_0x41ef13[_0x495b21(0x13d)],'roles':(_0x41ef13[_0x495b21(0xf8)]??[])['map'](projectRoleRef)};}export function projectPagePermit(_0xa82533){const _0x373cf8=a152_0x87259,_0x4103d9={'menuId':_0xa82533[_0x373cf8(0xeb)],'appCode':_0xa82533[_0x373cf8(0x132)],'menuPermit':projectPageSlot(_0xa82533['menuPermit'])};for(const _0x1b69ad of PAGE_SLOT_SPECS){if(_0x1b69ad[_0x373cf8(0x12a)]===_0x373cf8(0x12f))continue;_0x4103d9[_0x1b69ad[_0x373cf8(0x12a)]]=projectPageSlot(_0xa82533[_0x1b69ad[_0x373cf8(0x12a)]]);}return _0x4103d9;}function a152_0x4c9a(_0x3c9d39,_0x47314b){_0x3c9d39=_0x3c9d39-0xe6;const _0xe30562=a152_0xe305();let _0x4c9a82=_0xe30562[_0x3c9d39];return _0x4c9a82;}export function flattenMenuResources(_0x3c9af4){const _0x921957=new Map(),_0x2da4ac=_0x16b14c=>{const _0x12d550=a152_0x4c9a;for(const _0xa0dfd8 of _0x16b14c??[]){_0x921957[_0x12d550(0x11d)](_0xa0dfd8[_0x12d550(0x13d)],{'resourceCode':_0xa0dfd8[_0x12d550(0x13d)],'resourceName':_0xa0dfd8[_0x12d550(0x126)],'action':_0xa0dfd8['allowedActions']?.[0x0]??'0'});if(_0xa0dfd8[_0x12d550(0xfe)])_0x2da4ac(_0xa0dfd8[_0x12d550(0xfe)]);}};return _0x2da4ac(_0x3c9af4),_0x921957;}export function flattenApiResources(_0x3bfff2){const _0x5d5aaa=a152_0x87259,_0x1f7d16=new Map(),_0x175a9f=new Map();for(const _0x1cb228 of _0x3bfff2){const _0xd2a255=_0x1cb228[_0x5d5aaa(0xed)]??{};for(const [_0x2a7d27,_0x399d0f]of Object[_0x5d5aaa(0x12c)](_0xd2a255)){_0x1f7d16[_0x5d5aaa(0x11d)](_0x2a7d27,{'resourceCode':_0x2a7d27,'resourceName':_0x1cb228[_0x5d5aaa(0x126)],'datasetCode':_0x1cb228[_0x5d5aaa(0x11f)],'action':_0x399d0f?.[0x0]??'0'});const _0xd707b3=_0x175a9f[_0x5d5aaa(0x100)](_0x1cb228['datasetCode'])??[];_0xd707b3[_0x5d5aaa(0x12b)](_0x2a7d27),_0x175a9f[_0x5d5aaa(0x11d)](_0x1cb228[_0x5d5aaa(0x11f)],_0xd707b3);}}return{'byCode':_0x1f7d16,'byDataset':_0x175a9f};}export function buildPermits(_0x381e1a,_0x52070a){const _0x40349e=a152_0x87259,_0x57bb93={};for(const [_0x4af26a,_0x3e7d51]of _0x381e1a){const _0x3ddc39=_0x52070a[_0x40349e(0x100)](_0x4af26a)??_0x3e7d51['action'];_0x57bb93[_0x4af26a]=[_0x3ddc39];}return _0x57bb93;}export function readRoleRef(_0x440672){const _0x1f712c=a152_0x87259,_0x8df01d=_0x440672[_0x1f712c(0xfb)](_0x1f712c(0xf0))[_0x1f712c(0xec)]();if(!_0x8df01d)throw CliErrors['flagMissing'](_0x1f712c(0xf0),_0x1f712c(0x118));return _0x8df01d;}export function readGrantRevoke(_0x4f2d20){const _0x10b129=a152_0x87259,_0x35629b=_0x4f2d20[_0x10b129(0x131)](_0x10b129(0x106)),_0x2ec757=_0x4f2d20['bool'](_0x10b129(0x119));if(_0x35629b&&_0x2ec757)throw CliErrors[_0x10b129(0x10d)](_0x10b129(0x122));if(!_0x35629b&&!_0x2ec757)throw CliErrors[_0x10b129(0x10d)](_0x10b129(0x107),'Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.');return _0x35629b?_0x10b129(0xe8):'0';}
@@ -1 +1 @@
1
- (function(_0x15e5eb,_0x3f9a96){const _0x19c7ad=a146_0x5a20,_0x27e522=_0x15e5eb();while(!![]){try{const _0x4c34dc=-parseInt(_0x19c7ad(0xc5))/0x1*(-parseInt(_0x19c7ad(0xd9))/0x2)+parseInt(_0x19c7ad(0xde))/0x3*(parseInt(_0x19c7ad(0xc6))/0x4)+parseInt(_0x19c7ad(0xc4))/0x5*(parseInt(_0x19c7ad(0xca))/0x6)+parseInt(_0x19c7ad(0xc2))/0x7+-parseInt(_0x19c7ad(0xd0))/0x8*(parseInt(_0x19c7ad(0xe0))/0x9)+parseInt(_0x19c7ad(0xcb))/0xa*(-parseInt(_0x19c7ad(0xdf))/0xb)+-parseInt(_0x19c7ad(0xdb))/0xc;if(_0x4c34dc===_0x3f9a96)break;else _0x27e522['push'](_0x27e522['shift']());}catch(_0x78973c){_0x27e522['push'](_0x27e522['shift']());}}}(a146_0x272d,0x56fb6));import{existsSync}from'node:fs';import a146_0x3bb3a5 from'node:path';function a146_0x272d(){const _0x3a80fd=['green','1041840kCWjyv','√\x20Project\x20Name:\x20','test','3XBwRIM','11wirNPP','5786253oBzLOU','Logged\x20in','Skipped','Login\x20failed','3253467JXzurM','√\x20Login\x20status:\x20','120AnEmqs','31GOrjyK','646748iKcOSg','\x22\x20already\x20exists','Not\x20set','cwd','91860qcDBDv','2338270dIvgVm','resolve','env','cyan','log','8alkoBd','Directory\x20\x22','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','string','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','√\x20App\x20Code:\x20','length','Project\x20name\x20cannot\x20exceed\x2050\x20characters','production','21028MsxZbT'];a146_0x272d=function(){return _0x3a80fd;};return a146_0x272d();}import a146_0x524d73 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';function a146_0x5a20(_0x326e3e,_0x1ac4fe){_0x326e3e=_0x326e3e-0xbf;const _0x272d71=a146_0x272d();let _0x5a203e=_0x272d71[_0x326e3e];return _0x5a203e;}export async function guidedCreateProject(_0x4b38f9,_0x31967b,_0x3f45af){const _0x432344=a146_0x5a20,_0x526312='my-app',_0x5746a8=readConfig(),_0x10494c=typeof _0x5746a8[_0x432344(0xcd)]===_0x432344(0xd3)?_0x5746a8[_0x432344(0xcd)]:undefined,_0x123bc7=await input({'message':'Project\x20name:','default':_0x526312,'validate':_0xd53229=>{const _0x586cfc=_0x432344,_0x4138bd=_0xd53229['trim']()||_0x526312;if(_0x4138bd[_0x586cfc(0xd6)]>0x32)return _0x586cfc(0xd7);const _0x2c11cc=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x4138bd&&!_0x2c11cc[_0x586cfc(0xdd)](_0x4138bd))return _0x586cfc(0xd2);const _0x3ada75=a146_0x3bb3a5[_0x586cfc(0xcc)](process[_0x586cfc(0xc9)](),_0x4138bd);if(existsSync(_0x3ada75))return _0x586cfc(0xd1)+_0x4138bd+_0x586cfc(0xc7);return!![];}});console[_0x432344(0xcf)](a146_0x524d73[_0x432344(0xda)](_0x432344(0xdc)+a146_0x524d73[_0x432344(0xce)](_0x123bc7)));const _0xf2e6bd=await selectSingleAppcode(_0x3f45af);console[_0x432344(0xcf)](a146_0x524d73[_0x432344(0xda)](_0x432344(0xd5)+a146_0x524d73[_0x432344(0xce)](_0xf2e6bd||_0x432344(0xc8))));if(_0xf2e6bd){const _0x15ab2c=await getIsSessionValid();if(!_0x15ab2c){const _0x5e085b=await confirm({'message':_0x432344(0xd4),'default':!![]});if(_0x5e085b){const _0x2aa4cf=await authServer({'silent':!![]});console[_0x432344(0xcf)](a146_0x524d73[_0x432344(0xda)](_0x432344(0xc3)+a146_0x524d73['cyan'](_0x2aa4cf?_0x432344(0xbf):_0x432344(0xc1))));}else console[_0x432344(0xcf)](a146_0x524d73[_0x432344(0xda)](_0x432344(0xc3)+a146_0x524d73[_0x432344(0xce)](_0x432344(0xc0))));}await _0x4b38f9({'projectName':_0x123bc7,'appCode':_0xf2e6bd,'env':_0x31967b||_0x10494c||_0x432344(0xd8)});}else await _0x4b38f9({'projectName':_0x123bc7,'env':_0x31967b||_0x10494c||'production'});}
1
+ (function(_0xfa91ce,_0x1186ea){const _0x59adab=a153_0x5b51,_0x380a9d=_0xfa91ce();while(!![]){try{const _0x10f63c=parseInt(_0x59adab(0x1de))/0x1+-parseInt(_0x59adab(0x1db))/0x2+-parseInt(_0x59adab(0x1d3))/0x3+parseInt(_0x59adab(0x1cf))/0x4+parseInt(_0x59adab(0x1c4))/0x5*(-parseInt(_0x59adab(0x1d8))/0x6)+-parseInt(_0x59adab(0x1d6))/0x7+-parseInt(_0x59adab(0x1cc))/0x8*(-parseInt(_0x59adab(0x1d5))/0x9);if(_0x10f63c===_0x1186ea)break;else _0x380a9d['push'](_0x380a9d['shift']());}catch(_0x362075){_0x380a9d['push'](_0x380a9d['shift']());}}}(a153_0x3426,0x1a0b8));function a153_0x3426(){const _0x34ff61=['resolve','383196oNFAGx','env','607509WZaGgy','749637fJpxrc','trim','66gussMV','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','cwd','380418JybKau','Skipped','production','49431gjiSRx','my-app','√\x20Login\x20status:\x20','green','21235pKmNQt','Logged\x20in','Directory\x20\x22','string','cyan','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','√\x20Project\x20Name:\x20','\x22\x20already\x20exists','56ZbaNOK','Login\x20failed','test','225964AdqrLb','log','√\x20App\x20Code:\x20'];a153_0x3426=function(){return _0x34ff61;};return a153_0x3426();}import{existsSync}from'node:fs';import a153_0x6c88d6 from'node:path';import a153_0x258566 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';function a153_0x5b51(_0x5be3cf,_0x372cca){_0x5be3cf=_0x5be3cf-0x1c3;const _0x34268b=a153_0x3426();let _0x5b51a0=_0x34268b[_0x5be3cf];return _0x5b51a0;}export async function guidedCreateProject(_0x225b36,_0xd31f8,_0x10df93){const _0x2f01e3=a153_0x5b51,_0x55bc83=_0x2f01e3(0x1df),_0x532b15=readConfig(),_0x344cca=typeof _0x532b15[_0x2f01e3(0x1d4)]===_0x2f01e3(0x1c7)?_0x532b15[_0x2f01e3(0x1d4)]:undefined,_0x203b3c=await input({'message':'Project\x20name:','default':_0x55bc83,'validate':_0xa6ed07=>{const _0x4a5d76=_0x2f01e3,_0x2a7de6=_0xa6ed07[_0x4a5d76(0x1d7)]()||_0x55bc83;if(_0x2a7de6['length']>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x26959c=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x2a7de6&&!_0x26959c[_0x4a5d76(0x1ce)](_0x2a7de6))return _0x4a5d76(0x1d9);const _0x1b7d30=a153_0x6c88d6[_0x4a5d76(0x1d2)](process[_0x4a5d76(0x1da)](),_0x2a7de6);if(existsSync(_0x1b7d30))return _0x4a5d76(0x1c6)+_0x2a7de6+_0x4a5d76(0x1cb);return!![];}});console[_0x2f01e3(0x1d0)](a153_0x258566[_0x2f01e3(0x1c3)](_0x2f01e3(0x1ca)+a153_0x258566[_0x2f01e3(0x1c8)](_0x203b3c)));const _0x10ccc0=await selectSingleAppcode(_0x10df93);console['log'](a153_0x258566[_0x2f01e3(0x1c3)](_0x2f01e3(0x1d1)+a153_0x258566[_0x2f01e3(0x1c8)](_0x10ccc0||'Not\x20set')));if(_0x10ccc0){const _0x4c7f5f=await getIsSessionValid();if(!_0x4c7f5f){const _0x43c226=await confirm({'message':_0x2f01e3(0x1c9),'default':!![]});if(_0x43c226){const _0x4188d5=await authServer({'silent':!![]});console[_0x2f01e3(0x1d0)](a153_0x258566[_0x2f01e3(0x1c3)](_0x2f01e3(0x1e0)+a153_0x258566[_0x2f01e3(0x1c8)](_0x4188d5?_0x2f01e3(0x1c5):_0x2f01e3(0x1cd))));}else console['log'](a153_0x258566[_0x2f01e3(0x1c3)](_0x2f01e3(0x1e0)+a153_0x258566[_0x2f01e3(0x1c8)](_0x2f01e3(0x1dc))));}await _0x225b36({'projectName':_0x203b3c,'appCode':_0x10ccc0,'env':_0xd31f8||_0x344cca||_0x2f01e3(0x1dd)});}else await _0x225b36({'projectName':_0x203b3c,'env':_0xd31f8||_0x344cca||_0x2f01e3(0x1dd)});}
@@ -1 +1 @@
1
- function a147_0x39d5(){const _0x4eec8e=['42gdgrda','3347952WLgLcX','replace','1655695polwpN','5948OiaIjN','94nebiDK','705430VMIeUX','809397HIPPMj','82728UZYNel','7GprSvh','2673246UMeIuQ'];a147_0x39d5=function(){return _0x4eec8e;};return a147_0x39d5();}function a147_0x11f9(_0x1f1f95,_0x38bc84){_0x1f1f95=_0x1f1f95-0x7d;const _0x39d5c4=a147_0x39d5();let _0x11f9a1=_0x39d5c4[_0x1f1f95];return _0x11f9a1;}(function(_0x3fbd41,_0x1d1ebb){const _0x91f668=a147_0x11f9,_0x3bf383=_0x3fbd41();while(!![]){try{const _0x1516b9=parseInt(_0x91f668(0x82))/0x1*(parseInt(_0x91f668(0x81))/0x2)+-parseInt(_0x91f668(0x7d))/0x3*(-parseInt(_0x91f668(0x85))/0x4)+-parseInt(_0x91f668(0x80))/0x5+parseInt(_0x91f668(0x87))/0x6*(parseInt(_0x91f668(0x86))/0x7)+-parseInt(_0x91f668(0x7e))/0x8+-parseInt(_0x91f668(0x84))/0x9+parseInt(_0x91f668(0x83))/0xa;if(_0x1516b9===_0x1d1ebb)break;else _0x3bf383['push'](_0x3bf383['shift']());}catch(_0xc934b5){_0x3bf383['push'](_0x3bf383['shift']());}}}(a147_0x39d5,0x3bf76));export function formatElapsed(_0x265322){const _0x390800=a147_0x11f9,_0x53072b=Date['now']()-_0x265322;if(_0x53072b<0x3e8)return _0x53072b+'ms';const _0x17c858=(_0x53072b/0x3e8)['toFixed'](0x2),_0x3082bb=_0x17c858[_0x390800(0x7f)](/\.?0+$/u,'');return _0x3082bb+'s';}
1
+ function a154_0x379e(){const _0x26202b=['4593846WfXGZo','17302480dBWPFd','3039350OiYpOZ','298566AVZBhY','32uujXqu','14OhXJWD','4915503ZxCHRY','12591016vvkFPc','toFixed','replace','2RjhCLS','472047dJmOQl','now'];a154_0x379e=function(){return _0x26202b;};return a154_0x379e();}function a154_0x1e87(_0x207d08,_0x342cf8){_0x207d08=_0x207d08-0x127;const _0x379e37=a154_0x379e();let _0x1e871a=_0x379e37[_0x207d08];return _0x1e871a;}(function(_0x1eb6bb,_0x186b96){const _0x469a2e=a154_0x1e87,_0x38ff0a=_0x1eb6bb();while(!![]){try{const _0xff89cc=parseInt(_0x469a2e(0x12d))/0x1*(parseInt(_0x469a2e(0x127))/0x2)+parseInt(_0x469a2e(0x128))/0x3*(-parseInt(_0x469a2e(0x12e))/0x4)+parseInt(_0x469a2e(0x12c))/0x5+parseInt(_0x469a2e(0x12a))/0x6*(-parseInt(_0x469a2e(0x12f))/0x7)+parseInt(_0x469a2e(0x131))/0x8+-parseInt(_0x469a2e(0x130))/0x9+parseInt(_0x469a2e(0x12b))/0xa;if(_0xff89cc===_0x186b96)break;else _0x38ff0a['push'](_0x38ff0a['shift']());}catch(_0x584f17){_0x38ff0a['push'](_0x38ff0a['shift']());}}}(a154_0x379e,0xd5750));export function formatElapsed(_0x3efac7){const _0x4fec88=a154_0x1e87,_0x7dfc9a=Date[_0x4fec88(0x129)]()-_0x3efac7;if(_0x7dfc9a<0x3e8)return _0x7dfc9a+'ms';const _0x3aee92=(_0x7dfc9a/0x3e8)[_0x4fec88(0x132)](0x2),_0x4a3f49=_0x3aee92[_0x4fec88(0x133)](/\.?0+$/u,'');return _0x4a3f49+'s';}
@@ -1 +1 @@
1
- function a148_0x1f35(){const _0x41e3f7=['264214kFAaQv','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','string','keys','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','CLI\x20版本检查','success','\x20api\x20pull','配置应用AppCode:\x20','126IjvNmZ','3638621LxXqQh','\x20|\x20Default:\x20','start','\x20√\x20','√\x20Configuration\x20file\x20created,\x20Apps:\x20','setLogPath','Copy\x20project\x20files','\x20|\x20AppCode:\x20','length','API\x20配置拉取异常','🚀\x20Next\x20Steps:','cd\x20','16030NySzGo','Format\x20code','\x20already\x20exists','rmSync','610015FlCwtd','Project\x20name:\x20','√\x20package.json\x20updated:\x20name=','description','bold','package.json','error','appCode','\x20config\x20set\x20appcode\x20<app-code>\x27','配置应用AppCode失败','更新\x20package.json\x20name','\x20&&\x20','\x20\x201.\x20Start\x20project:\x20','create','dirname','join','cyan','readFileSync','version','belowMinimum','repeat','production','projectName','Project\x20name\x20cannot\x20be\x20empty','清理项目目录失败:\x20','trim','projectCode','env','resolve','accessSync','1667724gWcuVy','info','fail','开始创建项目:\x20','stableVersion','Install\x20dependencies','*\x20Pulling\x20API\x20configuration...','API\x20configuration\x20pulled:\x20','name','更新\x20package.json\x20失败','2968364gunrNA','needsUpgrade','apps','201808PHLksK','utf8','1.0.0','parse','项目创建完成:\x20','cookie','cwd','log','项目创建失败:\x20','5pQXuzX','\x20model(s)','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','stringify','warn','6YatzKa','green','\x20\x202.\x20Pull\x20API\x20configuration:\x20','message'];a148_0x1f35=function(){return _0x41e3f7;};return a148_0x1f35();}(function(_0x481ed1,_0x304dbf){const _0x4adfd8=a148_0x4e2e,_0x134506=_0x481ed1();while(!![]){try{const _0xb1dc41=-parseInt(_0x4adfd8(0x1c4))/0x1+parseInt(_0x4adfd8(0x1aa))/0x2+-parseInt(_0x4adfd8(0x18a))/0x3+parseInt(_0x4adfd8(0x194))/0x4*(parseInt(_0x4adfd8(0x1a0))/0x5)+parseInt(_0x4adfd8(0x1a6))/0x6*(parseInt(_0x4adfd8(0x1b4))/0x7)+-parseInt(_0x4adfd8(0x197))/0x8*(-parseInt(_0x4adfd8(0x1b3))/0x9)+parseInt(_0x4adfd8(0x1c0))/0xa;if(_0xb1dc41===_0x304dbf)break;else _0x134506['push'](_0x134506['shift']());}catch(_0x56aaf0){_0x134506['push'](_0x134506['shift']());}}}(a148_0x1f35,0x8e4bd));import a148_0x1d4712 from'path';import a148_0x54808b from'fs';import a148_0x5b36b0 from'chalk';import a148_0x32af9e from'ora';function a148_0x4e2e(_0x171421,_0x19fb0f){_0x171421=_0x171421-0x17a;const _0x1f3586=a148_0x1f35();let _0x4e2e09=_0x1f3586[_0x171421];return _0x4e2e09;}import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x1675c4){const _0x53c166=a148_0x4e2e,_0x3fdd77=await checkCliVersion();(_0x3fdd77['needsUpgrade']||_0x3fdd77[_0x53c166(0x17f)])&&(printCliUpgradeWarning(_0x3fdd77),assertCliVersionSupported(_0x3fdd77),logger[_0x53c166(0x18b)](_0x53c166(0x1d1),_0x53c166(0x1af),{'currentVersion':_0x3fdd77['currentVersion'],'stableVersion':_0x3fdd77[_0x53c166(0x18e)],'minimumVersion':_0x3fdd77['minimumVersion'],'needsUpgrade':_0x3fdd77[_0x53c166(0x195)],'belowMinimum':_0x3fdd77['belowMinimum']}));if(_0x1675c4[_0x53c166(0x186)]&&_0x1675c4[_0x53c166(0x1cb)])await runCreate({'projectName':_0x1675c4[_0x53c166(0x186)],'appCode':_0x1675c4[_0x53c166(0x1cb)],'env':_0x1675c4[_0x53c166(0x187)]},_0x1675c4);else{if(_0x1675c4[_0x53c166(0x186)]){const _0x2769a6=await selectSingleAppcode(_0x1675c4[_0x53c166(0x19c)]);await runCreate({'projectName':_0x1675c4[_0x53c166(0x186)],'appCode':_0x2769a6||undefined,'env':_0x1675c4[_0x53c166(0x187)]},_0x1675c4);}else await guidedCreateProject(_0x1de364=>runCreate(_0x1de364,_0x1675c4),_0x1675c4[_0x53c166(0x187)],_0x1675c4[_0x53c166(0x19c)]);}}async function runCreate(_0x5a56a3,_0x3fc327){const _0x39828a=a148_0x4e2e;if(!_0x5a56a3[_0x39828a(0x182)]||_0x5a56a3['projectName'][_0x39828a(0x185)]()==='')throw new Error(_0x39828a(0x183));const _0x157d50=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x157d50['test'](_0x5a56a3['projectName']))throw new Error('Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x5a56a3[_0x39828a(0x182)][_0x39828a(0x1bc)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x289b7b=a148_0x1d4712[_0x39828a(0x188)](process[_0x39828a(0x19d)](),_0x5a56a3[_0x39828a(0x182)]);if(a148_0x54808b['existsSync'](_0x289b7b))throw new Error('Project\x20directory\x20'+_0x5a56a3[_0x39828a(0x182)]+_0x39828a(0x1c2));try{a148_0x54808b[_0x39828a(0x189)](a148_0x1d4712[_0x39828a(0x17a)](_0x289b7b),a148_0x54808b['constants']['W_OK']);}catch{throw new Error(_0x39828a(0x1a2));}logger[_0x39828a(0x1b9)](_0x289b7b),logger['info'](_0x39828a(0x1d1),_0x39828a(0x18d)+_0x5a56a3[_0x39828a(0x182)],{'projectDir':_0x289b7b,'appCode':_0x5a56a3[_0x39828a(0x1cb)]}),console[_0x39828a(0x19e)](),console[_0x39828a(0x19e)](a148_0x5b36b0[_0x39828a(0x1a7)](_0x39828a(0x1b7))+_0x39828a(0x1c5)+a148_0x5b36b0[_0x39828a(0x1a7)](_0x5a56a3[_0x39828a(0x182)])+(_0x5a56a3[_0x39828a(0x1cb)]?_0x39828a(0x1bb)+a148_0x5b36b0['cyan'](_0x5a56a3[_0x39828a(0x1cb)]):''));try{await runTask(_0x39828a(0x1ba),()=>copyProjectTemplate(_0x5a56a3['projectName'])),await updatePackageJsonName(_0x5a56a3[_0x39828a(0x182)]),await runTask(_0x39828a(0x18f),()=>installDependencies(_0x5a56a3[_0x39828a(0x182)])),await runTask(_0x39828a(0x1c1),()=>formatProjectCode(_0x5a56a3[_0x39828a(0x182)])),await configureAppCode(_0x5a56a3[_0x39828a(0x182)],_0x5a56a3[_0x39828a(0x1cb)]||'',_0x5a56a3[_0x39828a(0x187)]);let _0x2d545f=![];if(_0x5a56a3[_0x39828a(0x1cb)]){console[_0x39828a(0x19e)](_0x39828a(0x190));const _0x2fe6d3=process[_0x39828a(0x19d)]();try{process['chdir'](_0x289b7b);const _0x57f2c1=_0x5a56a3[_0x39828a(0x187)]||_0x39828a(0x181);initEnv(_0x57f2c1);const {configArray:_0x3b1f76}=await fetchModelList(_0x5a56a3[_0x39828a(0x1cb)],_0x3fc327[_0x39828a(0x19c)]||''),_0xac0830=DEFAULT_API_DIR,_0x255a25=await generateApiFile(_0x3b1f76,'',_0x5a56a3[_0x39828a(0x1cb)],!![],_0x57f2c1,_0xac0830);console['log']('√\x20Pulled\x20'+_0x3b1f76[_0x39828a(0x1bc)]+'\x20dataset(s),\x20generated\x20'+_0x255a25['modelCount']+_0x39828a(0x1a1)),logger['info'](_0x39828a(0x1d1),_0x39828a(0x191)+_0x5a56a3[_0x39828a(0x1cb)]);}catch(_0xec0e63){_0x2d545f=!![],console[_0x39828a(0x19e)](_0x39828a(0x1ab)),logger['warn'](_0x39828a(0x1d1),_0x39828a(0x1bd),{'error':_0xec0e63 instanceof Error?_0xec0e63[_0x39828a(0x1a9)]:String(_0xec0e63)});}finally{process['chdir'](_0x2fe6d3);}}logger[_0x39828a(0x1b0)](_0x39828a(0x1d1),_0x39828a(0x19b)+_0x5a56a3['projectName']),console[_0x39828a(0x19e)](),console[_0x39828a(0x19e)](a148_0x5b36b0[_0x39828a(0x1a7)]('─'[_0x39828a(0x180)](0x3c))),console[_0x39828a(0x19e)](a148_0x5b36b0['cyan'][_0x39828a(0x1c8)](_0x39828a(0x1be))),console[_0x39828a(0x19e)](),console[_0x39828a(0x19e)](_0x39828a(0x1d0)+a148_0x5b36b0[_0x39828a(0x17c)][_0x39828a(0x1c8)](_0x39828a(0x1bf)+_0x5a56a3[_0x39828a(0x182)]+_0x39828a(0x1cf)+CLI_BIN_NAME+'\x20run\x20start')),_0x2d545f&&console[_0x39828a(0x19e)](_0x39828a(0x1a8)+a148_0x5b36b0[_0x39828a(0x17c)]['bold'](CLI_BIN_NAME+_0x39828a(0x1b1))),console[_0x39828a(0x19e)](a148_0x5b36b0[_0x39828a(0x1a7)]('─'[_0x39828a(0x180)](0x3c)));}catch(_0x49372e){logger[_0x39828a(0x1ca)](_0x39828a(0x1d1),_0x39828a(0x19f)+_0x5a56a3[_0x39828a(0x182)],{'error':_0x49372e instanceof Error?_0x49372e[_0x39828a(0x1a9)]:String(_0x49372e)});try{a148_0x54808b['existsSync'](_0x289b7b)&&(console[_0x39828a(0x19e)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x289b7b),a148_0x54808b[_0x39828a(0x1c3)](_0x289b7b,{'recursive':!![],'force':!![]}));}catch{logger[_0x39828a(0x1a5)](_0x39828a(0x1d1),_0x39828a(0x184)+_0x289b7b);}throw _0x49372e;}}async function runTask(_0x2fc4d9,_0xbd86f){const _0x301ca9=a148_0x4e2e,_0x4a6d3d=a148_0x32af9e(_0x2fc4d9+'...')[_0x301ca9(0x1b6)]();try{const _0x5ea562=await _0xbd86f();_0x4a6d3d['stop'](),console[_0x301ca9(0x19e)](''+a148_0x5b36b0['green'](_0x301ca9(0x1b7))+_0x2fc4d9+'\x20'+a148_0x5b36b0['gray']('['+_0x5ea562+']'));}catch(_0x2cac8b){_0x4a6d3d[_0x301ca9(0x18c)](_0x2fc4d9);throw _0x2cac8b;}}async function updatePackageJsonName(_0x31f67c){const _0x553ab9=a148_0x4e2e,_0x1e84ce=a148_0x1d4712[_0x553ab9(0x188)](process['cwd'](),_0x31f67c),_0x19e25b=a148_0x1d4712[_0x553ab9(0x17b)](_0x1e84ce,_0x553ab9(0x1c9));try{console[_0x553ab9(0x19e)](_0x553ab9(0x1ae));const _0x2d0cce=getRabetbaseCliPackageRoot(),_0x2bf7bb=a148_0x1d4712[_0x553ab9(0x17b)](_0x2d0cce,_0x553ab9(0x1c9));let _0x592f9d=_0x553ab9(0x199);try{const _0x491837=JSON[_0x553ab9(0x19a)](a148_0x54808b[_0x553ab9(0x17d)](_0x2bf7bb,_0x553ab9(0x198)));_0x592f9d=_0x491837['version']||_0x553ab9(0x199);}catch{}const _0xe897ce=a148_0x54808b[_0x553ab9(0x17d)](_0x19e25b,_0x553ab9(0x198)),_0x1043df=JSON[_0x553ab9(0x19a)](_0xe897ce);_0x1043df[_0x553ab9(0x192)]=_0x31f67c,_0x1043df[_0x553ab9(0x1c7)]=_0x31f67c+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x592f9d,a148_0x54808b['writeFileSync'](_0x19e25b,JSON[_0x553ab9(0x1a4)](_0x1043df,null,0x2)+'\x0a','utf8'),console[_0x553ab9(0x19e)](_0x553ab9(0x1c6)+_0x31f67c),logger[_0x553ab9(0x18b)](_0x553ab9(0x1d1),_0x553ab9(0x1ce));}catch(_0x50a4d3){logger[_0x553ab9(0x1ca)](_0x553ab9(0x1d1),_0x553ab9(0x193));throw _0x50a4d3;}}async function configureAppCode(_0x13fd7e,_0x3a5cba,_0x2eaaa9){const _0x564a95=a148_0x4e2e,_0x140edd=a148_0x1d4712[_0x564a95(0x188)](process[_0x564a95(0x19d)](),_0x13fd7e),_0x4b3c4e=a148_0x1d4712[_0x564a95(0x17b)](_0x140edd,NEW_CONFIG_NAME);try{_0x3a5cba?console[_0x564a95(0x19e)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x13fd7e+':\x20'+_0x3a5cba):console[_0x564a95(0x19e)]('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x13fd7e);const _0x3e0e24=getRabetbaseCliPackageRoot(),_0x41dab8=a148_0x1d4712[_0x564a95(0x17b)](_0x3e0e24,'package.json');let _0x34132a=_0x564a95(0x199);try{const _0x1429f3=JSON['parse'](a148_0x54808b['readFileSync'](_0x41dab8,'utf8'));_0x34132a=_0x1429f3[_0x564a95(0x17e)]||'1.0.0';}catch{}const _0x2170ec=readConfig(),_0x47f60a=typeof _0x2170ec[_0x564a95(0x187)]===_0x564a95(0x1ac)?_0x2170ec[_0x564a95(0x187)]:undefined,_0x30830b={};for(const _0x59226f of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x2170ec[_0x59226f]!=null)_0x30830b[_0x59226f]=_0x2170ec[_0x59226f];}const _0x237109=buildCanonicalProjectConfig(_0x30830b,{'appCodes':_0x3a5cba?[_0x3a5cba]:[],'env':_0x2eaaa9||_0x47f60a||'production','metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x34132a}});writeConfigFile(_0x4b3c4e,_0x237109),_0x3a5cba?console[_0x564a95(0x19e)](_0x564a95(0x1b8)+Object[_0x564a95(0x1ad)](_0x237109[_0x564a95(0x196)]||{})[_0x564a95(0x17b)](',\x20')+_0x564a95(0x1b5)+_0x237109['defaultApp']):console[_0x564a95(0x19e)](_0x564a95(0x1a3)+CLI_BIN_NAME+_0x564a95(0x1cc)),logger[_0x564a95(0x18b)](_0x564a95(0x1d1),_0x564a95(0x1b2)+_0x3a5cba);}catch(_0x18e766){logger[_0x564a95(0x1ca)](_0x564a95(0x1d1),_0x564a95(0x1cd));}}
1
+ (function(_0x5b0e6b,_0x383660){const _0x4c1d21=a155_0x4c98,_0x9e946b=_0x5b0e6b();while(!![]){try{const _0x4a721e=parseInt(_0x4c1d21(0xe9))/0x1*(parseInt(_0x4c1d21(0xe4))/0x2)+-parseInt(_0x4c1d21(0xe0))/0x3*(parseInt(_0x4c1d21(0x115))/0x4)+-parseInt(_0x4c1d21(0x132))/0x5*(parseInt(_0x4c1d21(0x114))/0x6)+parseInt(_0x4c1d21(0xdd))/0x7*(-parseInt(_0x4c1d21(0x126))/0x8)+-parseInt(_0x4c1d21(0xdc))/0x9+parseInt(_0x4c1d21(0x10e))/0xa+parseInt(_0x4c1d21(0x107))/0xb;if(_0x4a721e===_0x383660)break;else _0x9e946b['push'](_0x9e946b['shift']());}catch(_0x29501d){_0x9e946b['push'](_0x9e946b['shift']());}}}(a155_0x35ee,0x4eda7));import a155_0x29b31c from'path';import a155_0x293d7f from'fs';import a155_0x258607 from'chalk';import a155_0x286bec from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';function a155_0x4c98(_0x5ce2df,_0x400b64){_0x5ce2df=_0x5ce2df-0xd8;const _0x35ee66=a155_0x35ee();let _0x4c98bb=_0x35ee66[_0x5ce2df];return _0x4c98bb;}import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';function a155_0x35ee(){const _0x26b214=['!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','🚀\x20Next\x20Steps:','\x20\x201.\x20Start\x20project:\x20','Project\x20directory\x20','repeat','appCode','Copy\x20project\x20files','readFileSync','start','更新\x20package.json\x20name','项目创建失败:\x20','belowMinimum','message','配置应用AppCode:\x20','parse','name','warn','√\x20Configuration\x20file\x20created,\x20Apps:\x20','description','CLI\x20版本检查','\x20already\x20exists','4904207oewIjP','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','constants','package.json','...','modelCount','API\x20配置拉取异常','5739370JYHBXH','string','info','utf8','√\x20package.json\x20updated:\x20name=','log','1722oaAEWB','90676ZgGeEs','\x20Generated\x20by\x20rabetbase\x20cli\x20','√\x20Pulled\x20','join','existsSync','配置应用AppCode失败','currentVersion','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','stringify','test','\x20\x202.\x20Pull\x20API\x20configuration:\x20','needsUpgrade','cwd','defaultApp','W_OK','green','\x20config\x20set\x20appcode\x20<app-code>\x27','78736YidVKg','\x20model(s)','\x20run\x20start','gray','stableVersion','error','projectCode','resolve','cyan','stop','cookie','Project\x20name\x20cannot\x20be\x20empty','415BYeIFz','cd\x20','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','trim','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','\x20√\x20','success','fail','env','bold','create','2848635KBrKut','224aImcvJ','\x20|\x20Default:\x20','setLogPath','57BrYtMp','Install\x20dependencies','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','production','1400UUSLwp','writeFileSync','更新\x20package.json\x20失败','minimumVersion','1.0.0','556fBrkzr','length','toLocaleString','清理项目目录失败:\x20','projectName','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','\x20api\x20pull','开始创建项目:\x20','version'];a155_0x35ee=function(){return _0x26b214;};return a155_0x35ee();}import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x242745){const _0x4c4930=a155_0x4c98,_0x43286e=await checkCliVersion();(_0x43286e['needsUpgrade']||_0x43286e[_0x4c4930(0xfd)])&&(printCliUpgradeWarning(_0x43286e),assertCliVersionSupported(_0x43286e),logger[_0x4c4930(0x110)](_0x4c4930(0xdb),_0x4c4930(0x105),{'currentVersion':_0x43286e[_0x4c4930(0x11b)],'stableVersion':_0x43286e[_0x4c4930(0x12a)],'minimumVersion':_0x43286e[_0x4c4930(0xe7)],'needsUpgrade':_0x43286e[_0x4c4930(0x120)],'belowMinimum':_0x43286e[_0x4c4930(0xfd)]}));if(_0x242745[_0x4c4930(0x12c)]&&_0x242745[_0x4c4930(0xf7)])await runCreate({'projectName':_0x242745[_0x4c4930(0x12c)],'appCode':_0x242745[_0x4c4930(0xf7)],'env':_0x242745[_0x4c4930(0xd9)]},_0x242745);else{if(_0x242745['projectCode']){const _0x366c40=await selectSingleAppcode(_0x242745[_0x4c4930(0x130)]);await runCreate({'projectName':_0x242745[_0x4c4930(0x12c)],'appCode':_0x366c40||undefined,'env':_0x242745[_0x4c4930(0xd9)]},_0x242745);}else await guidedCreateProject(_0x109709=>runCreate(_0x109709,_0x242745),_0x242745[_0x4c4930(0xd9)],_0x242745['cookie']);}}async function runCreate(_0x31d2e9,_0x4bdc52){const _0x250a51=a155_0x4c98;if(!_0x31d2e9[_0x250a51(0xed)]||_0x31d2e9[_0x250a51(0xed)][_0x250a51(0x135)]()==='')throw new Error(_0x250a51(0x131));const _0x325242=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x325242[_0x250a51(0x11e)](_0x31d2e9[_0x250a51(0xed)]))throw new Error(_0x250a51(0x108));if(_0x31d2e9[_0x250a51(0xed)][_0x250a51(0xea)]>0x64)throw new Error(_0x250a51(0xe2));const _0x25714b=a155_0x29b31c[_0x250a51(0x12d)](process[_0x250a51(0x121)](),_0x31d2e9[_0x250a51(0xed)]);if(a155_0x293d7f[_0x250a51(0x119)](_0x25714b))throw new Error(_0x250a51(0xf5)+_0x31d2e9[_0x250a51(0xed)]+_0x250a51(0x106));try{a155_0x293d7f['accessSync'](a155_0x29b31c['dirname'](_0x25714b),a155_0x293d7f[_0x250a51(0x109)][_0x250a51(0x123)]);}catch{throw new Error(_0x250a51(0x134));}logger[_0x250a51(0xdf)](_0x25714b),logger[_0x250a51(0x110)](_0x250a51(0xdb),_0x250a51(0xf0)+_0x31d2e9[_0x250a51(0xed)],{'projectDir':_0x25714b,'appCode':_0x31d2e9[_0x250a51(0xf7)]}),console[_0x250a51(0x113)](),console['log'](a155_0x258607[_0x250a51(0x124)](_0x250a51(0x137))+'Project\x20name:\x20'+a155_0x258607[_0x250a51(0x124)](_0x31d2e9['projectName'])+(_0x31d2e9[_0x250a51(0xf7)]?'\x20|\x20AppCode:\x20'+a155_0x258607[_0x250a51(0x12e)](_0x31d2e9[_0x250a51(0xf7)]):''));try{await runTask(_0x250a51(0xf8),()=>copyProjectTemplate(_0x31d2e9[_0x250a51(0xed)])),await updatePackageJsonName(_0x31d2e9['projectName']),await runTask(_0x250a51(0xe1),()=>installDependencies(_0x31d2e9[_0x250a51(0xed)])),await runTask('Format\x20code',()=>formatProjectCode(_0x31d2e9[_0x250a51(0xed)])),await configureAppCode(_0x31d2e9[_0x250a51(0xed)],_0x31d2e9[_0x250a51(0xf7)]||'',_0x31d2e9['env']);let _0x23db61=![];if(_0x31d2e9[_0x250a51(0xf7)]){console[_0x250a51(0x113)]('*\x20Pulling\x20API\x20configuration...');const _0x198e3c=process[_0x250a51(0x121)]();try{process['chdir'](_0x25714b);const _0xa50323=_0x31d2e9[_0x250a51(0xd9)]||'production';initEnv(_0xa50323);const {configArray:_0x4a1236}=await fetchModelList(_0x31d2e9[_0x250a51(0xf7)],_0x4bdc52[_0x250a51(0x130)]||''),_0x40a253=DEFAULT_API_DIR,_0x26f161=await generateApiFile(_0x4a1236,'',_0x31d2e9['appCode'],!![],_0xa50323,_0x40a253);console[_0x250a51(0x113)](_0x250a51(0x117)+_0x4a1236['length']+'\x20dataset(s),\x20generated\x20'+_0x26f161[_0x250a51(0x10c)]+_0x250a51(0x127)),logger['info'](_0x250a51(0xdb),'API\x20configuration\x20pulled:\x20'+_0x31d2e9[_0x250a51(0xf7)]);}catch(_0x22ea97){_0x23db61=!![],console[_0x250a51(0x113)](_0x250a51(0xf2)),logger['warn'](_0x250a51(0xdb),_0x250a51(0x10d),{'error':_0x22ea97 instanceof Error?_0x22ea97['message']:String(_0x22ea97)});}finally{process['chdir'](_0x198e3c);}}logger[_0x250a51(0x138)](_0x250a51(0xdb),'项目创建完成:\x20'+_0x31d2e9[_0x250a51(0xed)]),console[_0x250a51(0x113)](),console[_0x250a51(0x113)](a155_0x258607[_0x250a51(0x124)]('─'[_0x250a51(0xf6)](0x3c))),console[_0x250a51(0x113)](a155_0x258607['cyan'][_0x250a51(0xda)](_0x250a51(0xf3))),console[_0x250a51(0x113)](),console[_0x250a51(0x113)](_0x250a51(0xf4)+a155_0x258607[_0x250a51(0x12e)][_0x250a51(0xda)](_0x250a51(0x133)+_0x31d2e9[_0x250a51(0xed)]+'\x20&&\x20'+CLI_BIN_NAME+_0x250a51(0x128))),_0x23db61&&console['log'](_0x250a51(0x11f)+a155_0x258607[_0x250a51(0x12e)]['bold'](CLI_BIN_NAME+_0x250a51(0xef))),console['log'](a155_0x258607['green']('─'[_0x250a51(0xf6)](0x3c)));}catch(_0x42fa1f){logger[_0x250a51(0x12b)](_0x250a51(0xdb),_0x250a51(0xfc)+_0x31d2e9[_0x250a51(0xed)],{'error':_0x42fa1f instanceof Error?_0x42fa1f[_0x250a51(0xfe)]:String(_0x42fa1f)});try{a155_0x293d7f[_0x250a51(0x119)](_0x25714b)&&(console['log'](_0x250a51(0x136)+_0x25714b),a155_0x293d7f['rmSync'](_0x25714b,{'recursive':!![],'force':!![]}));}catch{logger[_0x250a51(0x102)](_0x250a51(0xdb),_0x250a51(0xec)+_0x25714b);}throw _0x42fa1f;}}async function runTask(_0x268e78,_0x317f16){const _0x1aaa4d=a155_0x4c98,_0xbbb18e=a155_0x286bec(_0x268e78+_0x1aaa4d(0x10b))[_0x1aaa4d(0xfa)]();try{const _0x235ba2=await _0x317f16();_0xbbb18e[_0x1aaa4d(0x12f)](),console[_0x1aaa4d(0x113)](''+a155_0x258607[_0x1aaa4d(0x124)]('\x20√\x20')+_0x268e78+'\x20'+a155_0x258607[_0x1aaa4d(0x129)]('['+_0x235ba2+']'));}catch(_0x3a6806){_0xbbb18e[_0x1aaa4d(0xd8)](_0x268e78);throw _0x3a6806;}}async function updatePackageJsonName(_0x5aac2f){const _0x1698b3=a155_0x4c98,_0x119f31=a155_0x29b31c['resolve'](process[_0x1698b3(0x121)](),_0x5aac2f),_0x29600c=a155_0x29b31c[_0x1698b3(0x118)](_0x119f31,_0x1698b3(0x10a));try{console[_0x1698b3(0x113)](_0x1698b3(0x11c));const _0x1c36d2=getRabetbaseCliPackageRoot(),_0x520447=a155_0x29b31c[_0x1698b3(0x118)](_0x1c36d2,'package.json');let _0xe27cf0=_0x1698b3(0xe8);try{const _0x13032f=JSON[_0x1698b3(0x100)](a155_0x293d7f[_0x1698b3(0xf9)](_0x520447,_0x1698b3(0x111)));_0xe27cf0=_0x13032f[_0x1698b3(0xf1)]||_0x1698b3(0xe8);}catch{}const _0x21c439=a155_0x293d7f[_0x1698b3(0xf9)](_0x29600c,_0x1698b3(0x111)),_0x4c3aba=JSON[_0x1698b3(0x100)](_0x21c439);_0x4c3aba[_0x1698b3(0x101)]=_0x5aac2f,_0x4c3aba[_0x1698b3(0x104)]=_0x5aac2f+_0x1698b3(0x116)+_0xe27cf0,a155_0x293d7f[_0x1698b3(0xe5)](_0x29600c,JSON[_0x1698b3(0x11d)](_0x4c3aba,null,0x2)+'\x0a',_0x1698b3(0x111)),console[_0x1698b3(0x113)](_0x1698b3(0x112)+_0x5aac2f),logger[_0x1698b3(0x110)]('create',_0x1698b3(0xfb));}catch(_0x202fa4){logger[_0x1698b3(0x12b)](_0x1698b3(0xdb),_0x1698b3(0xe6));throw _0x202fa4;}}async function configureAppCode(_0x1020bc,_0x408544,_0x59c8d8){const _0x166dbb=a155_0x4c98,_0xcef7e5=a155_0x29b31c[_0x166dbb(0x12d)](process[_0x166dbb(0x121)](),_0x1020bc),_0x4bf0c1=a155_0x29b31c[_0x166dbb(0x118)](_0xcef7e5,NEW_CONFIG_NAME);try{_0x408544?console[_0x166dbb(0x113)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x1020bc+':\x20'+_0x408544):console[_0x166dbb(0x113)](_0x166dbb(0xee)+_0x1020bc);const _0x1a5a69=getRabetbaseCliPackageRoot(),_0x1f5cd3=a155_0x29b31c[_0x166dbb(0x118)](_0x1a5a69,_0x166dbb(0x10a));let _0x178330=_0x166dbb(0xe8);try{const _0x5adee8=JSON['parse'](a155_0x293d7f[_0x166dbb(0xf9)](_0x1f5cd3,'utf8'));_0x178330=_0x5adee8[_0x166dbb(0xf1)]||_0x166dbb(0xe8);}catch{}const _0x1a6d88=readConfig(),_0x4f4158=typeof _0x1a6d88[_0x166dbb(0xd9)]===_0x166dbb(0x10f)?_0x1a6d88['env']:undefined,_0x4f5bad={};for(const _0x423584 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1a6d88[_0x423584]!=null)_0x4f5bad[_0x423584]=_0x1a6d88[_0x423584];}const _0x29264b=buildCanonicalProjectConfig(_0x4f5bad,{'appCodes':_0x408544?[_0x408544]:[],'env':_0x59c8d8||_0x4f4158||_0x166dbb(0xe3),'metadata':{'createdAt':new Date()[_0x166dbb(0xeb)](),'version':_0x178330}});writeConfigFile(_0x4bf0c1,_0x29264b),_0x408544?console[_0x166dbb(0x113)](_0x166dbb(0x103)+Object['keys'](_0x29264b['apps']||{})[_0x166dbb(0x118)](',\x20')+_0x166dbb(0xde)+_0x29264b[_0x166dbb(0x122)]):console[_0x166dbb(0x113)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x166dbb(0x125)),logger['info']('create',_0x166dbb(0xff)+_0x408544);}catch(_0x5b890f){logger[_0x166dbb(0x12b)]('create',_0x166dbb(0x11a));}}
@@ -1 +1 @@
1
- (function(_0x1da9fa,_0x55e459){const _0x365ff4=a149_0x24da,_0x3835ec=_0x1da9fa();while(!![]){try{const _0x4550ae=-parseInt(_0x365ff4(0x13f))/0x1*(parseInt(_0x365ff4(0x167))/0x2)+-parseInt(_0x365ff4(0x12f))/0x3*(parseInt(_0x365ff4(0x14b))/0x4)+parseInt(_0x365ff4(0x160))/0x5+parseInt(_0x365ff4(0x152))/0x6*(parseInt(_0x365ff4(0x13d))/0x7)+-parseInt(_0x365ff4(0x15a))/0x8*(parseInt(_0x365ff4(0x161))/0x9)+-parseInt(_0x365ff4(0x13e))/0xa+-parseInt(_0x365ff4(0x16b))/0xb*(-parseInt(_0x365ff4(0x169))/0xc);if(_0x4550ae===_0x55e459)break;else _0x3835ec['push'](_0x3835ec['shift']());}catch(_0x3a1b3d){_0x3835ec['push'](_0x3835ec['shift']());}}}(a149_0x24b1,0x75303));import a149_0x5c7a87 from'path';import a149_0xca6f39 from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';function a149_0x24da(_0x45fe6b,_0xca6b92){_0x45fe6b=_0x45fe6b-0x12c;const _0x24b1fa=a149_0x24b1();let _0x24daf5=_0x24b1fa[_0x45fe6b];return _0x24daf5;}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(_0xe293e7,_0x2e91d1,_0x55dc75,_0x499b76){const _0x17abdd=a149_0x24da,_0x1fd3e6=await checkCliVersion();(_0x1fd3e6[_0x17abdd(0x13a)]||_0x1fd3e6[_0x17abdd(0x139)])&&(printCliUpgradeWarning(_0x1fd3e6),assertCliVersionSupported(_0x1fd3e6));if(!_0xe293e7||_0xe293e7[_0x17abdd(0x16a)]()==='')throw CliErrors['validation'](_0x17abdd(0x151));const _0x4d5b92=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x4d5b92['test'](_0xe293e7))throw CliErrors[_0x17abdd(0x154)](_0x17abdd(0x163),_0x17abdd(0x147));if(_0xe293e7[_0x17abdd(0x130)]>0x64)throw CliErrors[_0x17abdd(0x154)](_0x17abdd(0x162));const _0x3a56f3=a149_0x5c7a87[_0x17abdd(0x131)](process[_0x17abdd(0x15d)](),_0xe293e7);if(existsSync(_0x3a56f3))throw CliErrors[_0x17abdd(0x154)](_0x17abdd(0x141)+_0xe293e7+_0x17abdd(0x142),'Use\x20a\x20different\x20project\x20name.');try{const _0x3fa121=a149_0x5c7a87[_0x17abdd(0x144)](_0x3a56f3);await a149_0xca6f39[_0x17abdd(0x132)](_0x3fa121,a149_0xca6f39[_0x17abdd(0x15b)][_0x17abdd(0x138)]);}catch{throw CliErrors['validation'](_0x17abdd(0x12e),_0x17abdd(0x13b));}try{console[_0x17abdd(0x159)]('*\x20Creating\x20project\x20'+_0xe293e7+_0x17abdd(0x168));const _0x49d63f=getSubAppReactDemoTemplateDir();await copyDirectory(_0x49d63f,_0x3a56f3),console[_0x17abdd(0x159)]('\x20\x20√\x20Project\x20template\x20created'),await updatePackageJsonName(_0xe293e7),console[_0x17abdd(0x159)](_0x17abdd(0x149)),console[_0x17abdd(0x159)](_0x17abdd(0x148)),console[_0x17abdd(0x159)](_0x17abdd(0x12c)),await formatCode(_0x3a56f3),console[_0x17abdd(0x159)](_0x17abdd(0x13c)),await configureProject(_0xe293e7,_0x55dc75,_0x2e91d1),console[_0x17abdd(0x159)](_0x17abdd(0x12d)),_0x55dc75&&await pullApiConfig(_0x3a56f3,_0x55dc75,_0x2e91d1,_0x499b76),console[_0x17abdd(0x159)](_0x17abdd(0x158)+_0xe293e7+_0x17abdd(0x14c)),console[_0x17abdd(0x159)](_0x17abdd(0x134)+_0xe293e7),console[_0x17abdd(0x159)](_0x17abdd(0x150));}catch(_0x28b2f5){try{existsSync(_0x3a56f3)&&await a149_0xca6f39['rm'](_0x3a56f3,{'recursive':!![],'force':!![]});}catch{}throw _0x28b2f5;}}async function updatePackageJsonName(_0x393d40){const _0x135703=a149_0x24da,_0x197134=a149_0x5c7a87[_0x135703(0x131)](process[_0x135703(0x15d)](),_0x393d40),_0x432a4f=a149_0x5c7a87['join'](_0x197134,_0x135703(0x14a)),_0x195ea9=await a149_0xca6f39[_0x135703(0x146)](_0x432a4f,_0x135703(0x143)),_0x3ea590=JSON[_0x135703(0x14d)](_0x195ea9);_0x3ea590[_0x135703(0x155)]=_0x393d40,_0x3ea590[_0x135703(0x137)]=_0x135703(0x164),await a149_0xca6f39[_0x135703(0x157)](_0x432a4f,JSON[_0x135703(0x14e)](_0x3ea590,null,0x2)+'\x0a');}function detectPackageManager(){const _0x28cc85=a149_0x24da;try{return execSync('bun\x20--version',{'stdio':'ignore'}),_0x28cc85(0x15e);}catch{return _0x28cc85(0x166);}}async function formatCode(_0x28e73d){try{await execAsync('bun\x20run\x20format',{'cwd':_0x28e73d});}catch{}}async function configureProject(_0xd5f026,_0x53975f,_0x30b05e){const _0x19c970=a149_0x24da,_0x1c039d=a149_0x5c7a87[_0x19c970(0x131)](process[_0x19c970(0x15d)](),_0xd5f026),_0x1cb873=a149_0x5c7a87[_0x19c970(0x153)](_0x1c039d,NEW_CONFIG_NAME),_0x540369=readConfig(),_0x17b65d=typeof _0x540369[_0x19c970(0x135)]===_0x19c970(0x165)?_0x540369[_0x19c970(0x135)]:undefined,_0xd5181b={};for(const _0xdc5864 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x540369[_0xdc5864]!=null)_0xd5181b[_0xdc5864]=_0x540369[_0xdc5864];}const _0x2db092=buildCanonicalProjectConfig(_0xd5181b,{'appCodes':_0x53975f?[_0x53975f]:[],'env':_0x30b05e||_0x17b65d||_0x19c970(0x136),'metadata':{'createdAt':new Date()[_0x19c970(0x14f)](),'version':getCliVersion()}});writeConfigFile(_0x1cb873,_0x2db092);}function a149_0x24b1(){const _0x3b01cf=['Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','Project\x20name\x20contains\x20invalid\x20characters.','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','string','npm','8yZRFIB','...','4376784sJMdfO','trim','88AjirAo','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','\x20\x20√\x20Configuration\x20file\x20created','Cannot\x20create\x20project\x20in\x20current\x20directory.','10014liczmy','length','resolve','access','\x20\x20Pulling\x20API\x20configuration...','\x0a\x20\x20cd\x20','env','production','description','W_OK','belowMinimum','needsUpgrade','Check\x20directory\x20permissions.','\x20\x20√\x20Code\x20formatted','182546fDcrgJ','5767910jVEFyJ','225598gmcguf','chdir','Project\x20directory\x20\x22','\x22\x20already\x20exists.','utf-8','dirname','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','readFile','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','\x20\x20Installing\x20dependencies...','\x20\x20√\x20package.json\x20updated','package.json','876MaiJXb','\x20created\x20successfully!','parse','stringify','toLocaleString','\x20\x20rabetbase\x20run\x20start\x0a','Project\x20name\x20cannot\x20be\x20empty.','48ozDkOb','join','validation','name','modelCount','writeFile','\x0a√\x20Project\x20','log','104WZvCRQ','constants','\x20dataset(s),\x20generated\x20','cwd','bun','\x20model(s)','998635ocdjFa','440307evrzaI'];a149_0x24b1=function(){return _0x3b01cf;};return a149_0x24b1();}async function pullApiConfig(_0x68a57b,_0x1b3ca1,_0x2f2c9b,_0x3fdd72){const _0x88df1=a149_0x24da,_0x36f512=process['cwd']();try{process[_0x88df1(0x140)](_0x68a57b);const _0x4c1167=_0x2f2c9b||_0x88df1(0x136);initEnv(_0x4c1167),console[_0x88df1(0x159)](_0x88df1(0x133));const {configArray:_0x5ecd2d}=await fetchModelList(_0x1b3ca1,_0x3fdd72||''),_0x1a431f=await generateApiFile(_0x5ecd2d,'',_0x1b3ca1,!![],_0x4c1167,DEFAULT_API_DIR);console[_0x88df1(0x159)]('\x20\x20√\x20Pulled\x20'+_0x5ecd2d[_0x88df1(0x130)]+_0x88df1(0x15c)+_0x1a431f[_0x88df1(0x156)]+_0x88df1(0x15f));}catch(_0x97bd6d){console[_0x88df1(0x159)](_0x88df1(0x145)+CLI_BIN_NAME+'\x20api\x20pull`\x20manually\x20later.');}finally{process[_0x88df1(0x140)](_0x36f512);}}
1
+ (function(_0x1f264c,_0x7a244){const _0x3dbcf5=a156_0x3a6f,_0x194adf=_0x1f264c();while(!![]){try{const _0x28ec30=parseInt(_0x3dbcf5(0x214))/0x1*(parseInt(_0x3dbcf5(0x201))/0x2)+-parseInt(_0x3dbcf5(0x1e4))/0x3+-parseInt(_0x3dbcf5(0x1f1))/0x4+parseInt(_0x3dbcf5(0x1ed))/0x5*(-parseInt(_0x3dbcf5(0x1e2))/0x6)+-parseInt(_0x3dbcf5(0x1e6))/0x7+parseInt(_0x3dbcf5(0x1e9))/0x8*(-parseInt(_0x3dbcf5(0x1e0))/0x9)+parseInt(_0x3dbcf5(0x1e1))/0xa*(parseInt(_0x3dbcf5(0x1fb))/0xb);if(_0x28ec30===_0x7a244)break;else _0x194adf['push'](_0x194adf['shift']());}catch(_0x1b8e4f){_0x194adf['push'](_0x194adf['shift']());}}}(a156_0x2909,0x5083d));import a156_0x14620d from'path';import a156_0x14574a from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';function a156_0x3a6f(_0x498500,_0x5b6d3f){_0x498500=_0x498500-0x1e0;const _0x290949=a156_0x2909();let _0x3a6f06=_0x290949[_0x498500];return _0x3a6f06;}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(_0x59c800,_0x3d264f,_0x19335c,_0x15f942){const _0x256c6c=a156_0x3a6f,_0xb4fcdc=await checkCliVersion();(_0xb4fcdc[_0x256c6c(0x1ec)]||_0xb4fcdc[_0x256c6c(0x1eb)])&&(printCliUpgradeWarning(_0xb4fcdc),assertCliVersionSupported(_0xb4fcdc));if(!_0x59c800||_0x59c800[_0x256c6c(0x1ee)]()==='')throw CliErrors[_0x256c6c(0x21d)](_0x256c6c(0x213));const _0x1d889b=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1d889b[_0x256c6c(0x205)](_0x59c800))throw CliErrors[_0x256c6c(0x21d)](_0x256c6c(0x217),_0x256c6c(0x203));if(_0x59c800[_0x256c6c(0x1e5)]>0x64)throw CliErrors[_0x256c6c(0x21d)]('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.');const _0x512942=a156_0x14620d[_0x256c6c(0x20a)](process['cwd'](),_0x59c800);if(existsSync(_0x512942))throw CliErrors['validation'](_0x256c6c(0x216)+_0x59c800+'\x22\x20already\x20exists.',_0x256c6c(0x212));try{const _0x59d0d7=a156_0x14620d[_0x256c6c(0x20e)](_0x512942);await a156_0x14574a[_0x256c6c(0x215)](_0x59d0d7,a156_0x14574a[_0x256c6c(0x207)][_0x256c6c(0x21f)]);}catch{throw CliErrors[_0x256c6c(0x21d)](_0x256c6c(0x1ef),'Check\x20directory\x20permissions.');}try{console[_0x256c6c(0x210)](_0x256c6c(0x20c)+_0x59c800+_0x256c6c(0x20f));const _0x38615e=getSubAppReactDemoTemplateDir();await copyDirectory(_0x38615e,_0x512942),console['log'](_0x256c6c(0x1ff)),await updatePackageJsonName(_0x59c800),console[_0x256c6c(0x210)](_0x256c6c(0x1ea)),console['log'](_0x256c6c(0x1f8)),console['log']('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x512942),console['log'](_0x256c6c(0x21e)),await configureProject(_0x59c800,_0x19335c,_0x3d264f),console[_0x256c6c(0x210)]('\x20\x20√\x20Configuration\x20file\x20created'),_0x19335c&&await pullApiConfig(_0x512942,_0x19335c,_0x3d264f,_0x15f942),console[_0x256c6c(0x210)](_0x256c6c(0x21c)+_0x59c800+_0x256c6c(0x20b)),console[_0x256c6c(0x210)](_0x256c6c(0x1fc)+_0x59c800),console[_0x256c6c(0x210)]('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0x3f0efb){try{existsSync(_0x512942)&&await a156_0x14574a['rm'](_0x512942,{'recursive':!![],'force':!![]});}catch{}throw _0x3f0efb;}}async function updatePackageJsonName(_0x206b67){const _0x56a4f7=a156_0x3a6f,_0x10a368=a156_0x14620d['resolve'](process[_0x56a4f7(0x206)](),_0x206b67),_0x2e6fef=a156_0x14620d[_0x56a4f7(0x1f7)](_0x10a368,_0x56a4f7(0x219)),_0x2fcb86=await a156_0x14574a[_0x56a4f7(0x1f4)](_0x2e6fef,_0x56a4f7(0x200)),_0x559943=JSON[_0x56a4f7(0x204)](_0x2fcb86);_0x559943[_0x56a4f7(0x21b)]=_0x206b67,_0x559943[_0x56a4f7(0x1f3)]=_0x56a4f7(0x1fd),await a156_0x14574a[_0x56a4f7(0x1fe)](_0x2e6fef,JSON[_0x56a4f7(0x202)](_0x559943,null,0x2)+'\x0a');}function detectPackageManager(){const _0x4899e2=a156_0x3a6f;try{return execSync(_0x4899e2(0x218),{'stdio':_0x4899e2(0x1e7)}),_0x4899e2(0x211);}catch{return'npm';}}async function formatCode(_0x37e684){const _0x4ffb58=a156_0x3a6f;try{await execAsync(_0x4ffb58(0x1f9),{'cwd':_0x37e684});}catch{}}function a156_0x2909(){const _0x5700f6=['modelCount','\x20\x20Pulling\x20API\x20configuration...','resolve','\x20created\x20successfully!','*\x20Creating\x20project\x20','\x20model(s)','dirname','...','log','bun','Use\x20a\x20different\x20project\x20name.','Project\x20name\x20cannot\x20be\x20empty.','98428bRGywR','access','Project\x20directory\x20\x22','Project\x20name\x20contains\x20invalid\x20characters.','bun\x20--version','package.json','string','name','\x0a√\x20Project\x20','validation','\x20\x20√\x20Code\x20formatted','W_OK','5097555EeoPiK','6998630uYJTpx','2946YDMQUC','production','1487295TVXaqO','length','2592842SeefcU','ignore','\x20dataset(s),\x20generated\x20','8RRObMR','\x20\x20√\x20package.json\x20updated','belowMinimum','needsUpgrade','4405LhCzWW','trim','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x20\x20√\x20Pulled\x20','12364PVYwWJ','toLocaleString','description','readFile','\x20api\x20pull`\x20manually\x20later.','env','join','\x20\x20Installing\x20dependencies...','bun\x20run\x20format','chdir','33xdazmJ','\x0a\x20\x20cd\x20','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','writeFile','\x20\x20√\x20Project\x20template\x20created','utf-8','2CnRUVG','stringify','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','parse','test','cwd','constants'];a156_0x2909=function(){return _0x5700f6;};return a156_0x2909();}async function configureProject(_0x205282,_0x184491,_0x1be0d5){const _0x1c4164=a156_0x3a6f,_0x3f6376=a156_0x14620d[_0x1c4164(0x20a)](process[_0x1c4164(0x206)](),_0x205282),_0x4008dd=a156_0x14620d[_0x1c4164(0x1f7)](_0x3f6376,NEW_CONFIG_NAME),_0x1eb96c=readConfig(),_0x319dc2=typeof _0x1eb96c['env']===_0x1c4164(0x21a)?_0x1eb96c[_0x1c4164(0x1f6)]:undefined,_0x572a2e={};for(const _0x48b86c of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1eb96c[_0x48b86c]!=null)_0x572a2e[_0x48b86c]=_0x1eb96c[_0x48b86c];}const _0x426b00=buildCanonicalProjectConfig(_0x572a2e,{'appCodes':_0x184491?[_0x184491]:[],'env':_0x1be0d5||_0x319dc2||_0x1c4164(0x1e3),'metadata':{'createdAt':new Date()[_0x1c4164(0x1f2)](),'version':getCliVersion()}});writeConfigFile(_0x4008dd,_0x426b00);}async function pullApiConfig(_0x2d4f1b,_0x4ce086,_0x379a87,_0x437e5d){const _0x57d0b0=a156_0x3a6f,_0x37744e=process[_0x57d0b0(0x206)]();try{process[_0x57d0b0(0x1fa)](_0x2d4f1b);const _0x938838=_0x379a87||_0x57d0b0(0x1e3);initEnv(_0x938838),console[_0x57d0b0(0x210)](_0x57d0b0(0x209));const {configArray:_0x2e047d}=await fetchModelList(_0x4ce086,_0x437e5d||''),_0x103ad5=await generateApiFile(_0x2e047d,'',_0x4ce086,!![],_0x938838,DEFAULT_API_DIR);console[_0x57d0b0(0x210)](_0x57d0b0(0x1f0)+_0x2e047d[_0x57d0b0(0x1e5)]+_0x57d0b0(0x1e8)+_0x103ad5[_0x57d0b0(0x208)]+_0x57d0b0(0x20d));}catch(_0xb6e1e1){console['log']('\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`'+CLI_BIN_NAME+_0x57d0b0(0x1f5));}finally{process[_0x57d0b0(0x1fa)](_0x37744e);}}
@@ -1 +1 @@
1
- const a150_0x54837e=a150_0x36b0;(function(_0x12991e,_0x11be72){const _0x21f80a=a150_0x36b0,_0x1ca141=_0x12991e();while(!![]){try{const _0x4d6b8b=parseInt(_0x21f80a(0x1dd))/0x1+-parseInt(_0x21f80a(0x1e1))/0x2*(parseInt(_0x21f80a(0x1de))/0x3)+parseInt(_0x21f80a(0x1eb))/0x4+-parseInt(_0x21f80a(0x1e2))/0x5*(-parseInt(_0x21f80a(0x1e9))/0x6)+-parseInt(_0x21f80a(0x1df))/0x7+parseInt(_0x21f80a(0x1e0))/0x8+-parseInt(_0x21f80a(0x1ea))/0x9*(parseInt(_0x21f80a(0x1e8))/0xa);if(_0x4d6b8b===_0x11be72)break;else _0x1ca141['push'](_0x1ca141['shift']());}catch(_0x155d3c){_0x1ca141['push'](_0x1ca141['shift']());}}}(a150_0x4774,0x490c5));import a150_0x52bcca from'node:path';import{fileURLToPath}from'node:url';function a150_0x36b0(_0x4daa1b,_0x75306c){_0x4daa1b=_0x4daa1b-0x1dc;const _0x477449=a150_0x4774();let _0x36b000=_0x477449[_0x4daa1b];return _0x36b000;}function a150_0x4774(){const _0xca6a9a=['3244605chdWyH','4786576nHKXfW','14886ghXZrY','60IqcVhT','../../../../','dirname','templates','projects','sub-app-react-demo','210230qjBiff','152094LvSKQB','234pLhkXd','1934748NuMJeI','join','64538uBVjkC','57bkFfyU'];a150_0x4774=function(){return _0xca6a9a;};return a150_0x4774();}const __dirname=a150_0x52bcca[a150_0x54837e(0x1e4)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x550bdf=a150_0x54837e;return a150_0x52bcca['resolve'](__dirname,_0x550bdf(0x1e3));}export function getSubAppReactDemoTemplateDir(){const _0x52875d=a150_0x54837e;return a150_0x52bcca[_0x52875d(0x1dc)](getRabetbaseCliPackageRoot(),_0x52875d(0x1e5),_0x52875d(0x1e6),_0x52875d(0x1e7));}
1
+ (function(_0x5cd6cd,_0x16b2d2){const _0x2dc26b=a157_0x5835,_0x2c3455=_0x5cd6cd();while(!![]){try{const _0x385a28=-parseInt(_0x2dc26b(0xbf))/0x1+-parseInt(_0x2dc26b(0xc4))/0x2*(parseInt(_0x2dc26b(0xbe))/0x3)+-parseInt(_0x2dc26b(0xc6))/0x4+-parseInt(_0x2dc26b(0xc7))/0x5*(parseInt(_0x2dc26b(0xc1))/0x6)+parseInt(_0x2dc26b(0xbd))/0x7*(parseInt(_0x2dc26b(0xc2))/0x8)+parseInt(_0x2dc26b(0xc8))/0x9*(parseInt(_0x2dc26b(0xc0))/0xa)+parseInt(_0x2dc26b(0xc3))/0xb;if(_0x385a28===_0x16b2d2)break;else _0x2c3455['push'](_0x2c3455['shift']());}catch(_0x57c19b){_0x2c3455['push'](_0x2c3455['shift']());}}}(a157_0x5905,0x35ce2));import a157_0x39caf8 from'node:path';import{fileURLToPath}from'node:url';function a157_0x5835(_0x183a6d,_0x17f403){_0x183a6d=_0x183a6d-0xbc;const _0x5905a1=a157_0x5905();let _0x58358a=_0x5905a1[_0x183a6d];return _0x58358a;}function a157_0x5905(){const _0x3570f1=['246722QasrVJ','255120jmtUdQ','203219jzbwlg','150kcvUbc','19734TgAYQQ','16dUlovW','4676265rPgyUC','2KlfItI','sub-app-react-demo','117704TqwBqr','545FTcXbz','240579CejgSz','projects'];a157_0x5905=function(){return _0x3570f1;};return a157_0x5905();}const __dirname=a157_0x39caf8['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){return a157_0x39caf8['resolve'](__dirname,'../../../../');}export function getSubAppReactDemoTemplateDir(){const _0x588539=a157_0x5835;return a157_0x39caf8['join'](getRabetbaseCliPackageRoot(),'templates',_0x588539(0xbc),_0x588539(0xc5));}
@@ -1 +1 @@
1
- (function(_0xc704dc,_0x137a6e){const _0x17e744=a151_0x1529,_0x57c7b6=_0xc704dc();while(!![]){try{const _0x5b1ebb=parseInt(_0x17e744(0x143))/0x1*(-parseInt(_0x17e744(0x13c))/0x2)+parseInt(_0x17e744(0x141))/0x3+-parseInt(_0x17e744(0x13e))/0x4*(-parseInt(_0x17e744(0x135))/0x5)+parseInt(_0x17e744(0x13b))/0x6+-parseInt(_0x17e744(0x13d))/0x7+-parseInt(_0x17e744(0x140))/0x8+parseInt(_0x17e744(0x132))/0x9*(parseInt(_0x17e744(0x131))/0xa);if(_0x5b1ebb===_0x137a6e)break;else _0x57c7b6['push'](_0x57c7b6['shift']());}catch(_0x27e4b2){_0x57c7b6['push'](_0x57c7b6['shift']());}}}(a151_0x3606,0xb84be));import a151_0x1f0721 from'node:path';function a151_0x3606(){const _0x574941=['179649AUOwes','377860GcuXzR','522tsVRam','now','success','27485adcGiE','项目模板复制失败','info','项目模板复制完成','cwd','copy','1158384sVlKmR','12cMgiOs','8122779mHmviy','744bOitcQ','message','10110320xGriEK','2549595wwQNqY','error'];a151_0x3606=function(){return _0x574941;};return a151_0x3606();}import{copyDirectory}from'../../../utils/copy-directory.js';function a151_0x1529(_0x66bffc,_0x43eb99){_0x66bffc=_0x66bffc-0x131;const _0x36064a=a151_0x3606();let _0x1529d3=_0x36064a[_0x66bffc];return _0x1529d3;}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x5161ad){const _0x13bf4e=a151_0x1529,_0x5d7f94=Date[_0x13bf4e(0x133)](),_0x25cf88=a151_0x1f0721['resolve'](process[_0x13bf4e(0x139)](),_0x5161ad);try{logger[_0x13bf4e(0x137)](_0x13bf4e(0x13a),'开始复制项目模板',{'projectCode':_0x5161ad,'templateDir':templateDir}),await copyDirectory(templateDir,_0x25cf88);const _0x174f5b=Date[_0x13bf4e(0x133)]()-_0x5d7f94;logger[_0x13bf4e(0x134)](_0x13bf4e(0x13a),_0x13bf4e(0x138),_0x174f5b,{'projectCode':_0x5161ad});}catch(_0x5617de){const _0x10bcbb=Date['now']()-_0x5d7f94;logger[_0x13bf4e(0x142)]('copy',_0x13bf4e(0x136),{'projectCode':_0x5161ad,'error':_0x5617de instanceof Error?_0x5617de[_0x13bf4e(0x13f)]:String(_0x5617de),'duration':_0x10bcbb});throw _0x5617de;}return formatElapsed(_0x5d7f94);}
1
+ (function(_0x36c647,_0x5250c4){const _0x26d4ad=a158_0xf499,_0x2007aa=_0x36c647();while(!![]){try{const _0x324837=-parseInt(_0x26d4ad(0x69))/0x1*(parseInt(_0x26d4ad(0x64))/0x2)+parseInt(_0x26d4ad(0x6d))/0x3+-parseInt(_0x26d4ad(0x71))/0x4+-parseInt(_0x26d4ad(0x6a))/0x5+parseInt(_0x26d4ad(0x6f))/0x6+-parseInt(_0x26d4ad(0x70))/0x7*(parseInt(_0x26d4ad(0x6b))/0x8)+parseInt(_0x26d4ad(0x66))/0x9;if(_0x324837===_0x5250c4)break;else _0x2007aa['push'](_0x2007aa['shift']());}catch(_0x44979b){_0x2007aa['push'](_0x2007aa['shift']());}}}(a158_0x4882,0x1dd8e));import a158_0x571364 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';function a158_0xf499(_0x758241,_0x2c3c0f){_0x758241=_0x758241-0x64;const _0x48825f=a158_0x4882();let _0xf4990=_0x48825f[_0x758241];return _0xf4990;}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 a158_0x4882(){const _0x33ea6e=['resolve','138058WWqoZI','项目模板复制失败','4375458SGboZm','error','项目模板复制完成','1Srblpx','1198265fktnDs','104jwUzGS','copy','156909aZgcwO','info','678360xssgxb','59269RtDwbb','442072xIuStL','now','success'];a158_0x4882=function(){return _0x33ea6e;};return a158_0x4882();}const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x871f45){const _0x41f639=a158_0xf499,_0x43372d=Date['now'](),_0xf507db=a158_0x571364[_0x41f639(0x74)](process['cwd'](),_0x871f45);try{logger[_0x41f639(0x6e)]('copy','开始复制项目模板',{'projectCode':_0x871f45,'templateDir':templateDir}),await copyDirectory(templateDir,_0xf507db);const _0x153c48=Date[_0x41f639(0x72)]()-_0x43372d;logger[_0x41f639(0x73)](_0x41f639(0x6c),_0x41f639(0x68),_0x153c48,{'projectCode':_0x871f45});}catch(_0x2deed6){const _0x46cf40=Date[_0x41f639(0x72)]()-_0x43372d;logger[_0x41f639(0x67)](_0x41f639(0x6c),_0x41f639(0x65),{'projectCode':_0x871f45,'error':_0x2deed6 instanceof Error?_0x2deed6['message']:String(_0x2deed6),'duration':_0x46cf40});throw _0x2deed6;}return formatElapsed(_0x43372d);}
@@ -1 +1 @@
1
- (function(_0x2959d9,_0x30439b){const _0x2ba859=a152_0xcca9,_0x4bf97f=_0x2959d9();while(!![]){try{const _0x5d5d8c=-parseInt(_0x2ba859(0x9e))/0x1+parseInt(_0x2ba859(0xa1))/0x2*(-parseInt(_0x2ba859(0x9a))/0x3)+parseInt(_0x2ba859(0x9b))/0x4+parseInt(_0x2ba859(0x98))/0x5+-parseInt(_0x2ba859(0x9c))/0x6*(parseInt(_0x2ba859(0xa2))/0x7)+parseInt(_0x2ba859(0xa4))/0x8*(-parseInt(_0x2ba859(0x9f))/0x9)+parseInt(_0x2ba859(0xa7))/0xa*(parseInt(_0x2ba859(0xa3))/0xb);if(_0x5d5d8c===_0x30439b)break;else _0x4bf97f['push'](_0x4bf97f['shift']());}catch(_0x5ef08d){_0x4bf97f['push'](_0x4bf97f['shift']());}}}(a152_0x1256,0xcd4fb));import a152_0x17ebc9 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a152_0x1256(){const _0x5ceb58=['message','1604582gixagl','5132596uwfkTk','22nQMDZL','12505144YBsHGk','now','success','17708370zDOign','format','npx','info','cwd','5208045GqfNiM','代码格式化失败','6hDvxfG','2669752wQNvZv','6wHiXgU','prettier','508813ZLlCJG','9uRPeYo'];a152_0x1256=function(){return _0x5ceb58;};return a152_0x1256();}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a152_0xcca9(_0x5e5efe,_0x552922){_0x5e5efe=_0x5e5efe-0x97;const _0x125600=a152_0x1256();let _0xcca986=_0x125600[_0x5e5efe];return _0xcca986;}export async function formatProjectCode(_0x1c99fe){const _0x286b5f=a152_0xcca9,_0x339861=Date[_0x286b5f(0xa5)](),_0x528c6a=a152_0x17ebc9['resolve'](process[_0x286b5f(0x97)](),_0x1c99fe);try{logger[_0x286b5f(0xaa)](_0x286b5f(0xa8),'开始格式化代码',{'projectCode':_0x1c99fe}),await execa(resolveNpmBin(_0x286b5f(0xa9)),[_0x286b5f(0x9d),'--write','.'],{'cwd':_0x528c6a});const _0x51fb0c=Date['now']()-_0x339861;logger[_0x286b5f(0xa6)](_0x286b5f(0xa8),'代码格式化完成',_0x51fb0c,{'projectCode':_0x1c99fe});}catch(_0x417176){const _0x516240=Date['now']()-_0x339861;logger['error'](_0x286b5f(0xa8),_0x286b5f(0x99),{'projectCode':_0x1c99fe,'error':_0x417176 instanceof Error?_0x417176[_0x286b5f(0xa0)]:String(_0x417176),'duration':_0x516240});throw _0x417176;}return formatElapsed(_0x339861);}
1
+ (function(_0x2a926b,_0x6a254b){const _0x3c3e84=a159_0x3c2a,_0x2e46df=_0x2a926b();while(!![]){try{const _0x2eab29=-parseInt(_0x3c3e84(0x1f3))/0x1*(parseInt(_0x3c3e84(0x1f2))/0x2)+parseInt(_0x3c3e84(0x1eb))/0x3+parseInt(_0x3c3e84(0x1ee))/0x4*(parseInt(_0x3c3e84(0x1ed))/0x5)+parseInt(_0x3c3e84(0x1e7))/0x6+-parseInt(_0x3c3e84(0x1ea))/0x7+parseInt(_0x3c3e84(0x1f6))/0x8*(-parseInt(_0x3c3e84(0x1f4))/0x9)+parseInt(_0x3c3e84(0x1ef))/0xa;if(_0x2eab29===_0x6a254b)break;else _0x2e46df['push'](_0x2e46df['shift']());}catch(_0x1fbcb0){_0x2e46df['push'](_0x2e46df['shift']());}}}(a159_0x18e1,0x6f39f));function a159_0x18e1(){const _0x6ad7cb=['error','2620744FOFUUH','519498ZSXoSL','format','1029065IRhTci','8IhuFim','9159630HuBkPF','prettier','cwd','3566zQRzIn','340JgwrDF','6436026fgzHqo','message','8SCqKBu','3903324OQLGyo','now'];a159_0x18e1=function(){return _0x6ad7cb;};return a159_0x18e1();}function a159_0x3c2a(_0x4e2153,_0x3ecbe9){_0x4e2153=_0x4e2153-0x1e7;const _0x18e1e0=a159_0x18e1();let _0x3c2aa3=_0x18e1e0[_0x4e2153];return _0x3c2aa3;}import a159_0xa61d8e 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 formatProjectCode(_0x86478d){const _0x112d23=a159_0x3c2a,_0x5a5cba=Date[_0x112d23(0x1e8)](),_0x1953b5=a159_0xa61d8e['resolve'](process[_0x112d23(0x1f1)](),_0x86478d);try{logger['info'](_0x112d23(0x1ec),'开始格式化代码',{'projectCode':_0x86478d}),await execa(resolveNpmBin('npx'),[_0x112d23(0x1f0),'--write','.'],{'cwd':_0x1953b5});const _0x3f1061=Date[_0x112d23(0x1e8)]()-_0x5a5cba;logger['success']('format','代码格式化完成',_0x3f1061,{'projectCode':_0x86478d});}catch(_0x5c2174){const _0x3aa3ee=Date[_0x112d23(0x1e8)]()-_0x5a5cba;logger[_0x112d23(0x1e9)](_0x112d23(0x1ec),'代码格式化失败',{'projectCode':_0x86478d,'error':_0x5c2174 instanceof Error?_0x5c2174[_0x112d23(0x1f5)]:String(_0x5c2174),'duration':_0x3aa3ee});throw _0x5c2174;}return formatElapsed(_0x5a5cba);}
@@ -1 +1 @@
1
- (function(_0x32a0b9,_0x2ca282){const _0x3087d1=a153_0x4b53,_0x3f2585=_0x32a0b9();while(!![]){try{const _0x317f22=parseInt(_0x3087d1(0x1e3))/0x1*(parseInt(_0x3087d1(0x1e1))/0x2)+-parseInt(_0x3087d1(0x1e4))/0x3+-parseInt(_0x3087d1(0x1df))/0x4*(-parseInt(_0x3087d1(0x1ea))/0x5)+-parseInt(_0x3087d1(0x1e8))/0x6*(-parseInt(_0x3087d1(0x1f1))/0x7)+parseInt(_0x3087d1(0x1f3))/0x8+parseInt(_0x3087d1(0x1e5))/0x9*(parseInt(_0x3087d1(0x1e2))/0xa)+parseInt(_0x3087d1(0x1eb))/0xb*(-parseInt(_0x3087d1(0x1ec))/0xc);if(_0x317f22===_0x2ca282)break;else _0x3f2585['push'](_0x3f2585['shift']());}catch(_0x12683e){_0x3f2585['push'](_0x3f2585['shift']());}}}(a153_0x9172,0xf0694));import a153_0x1adbd6 from'node:path';import{execa}from'execa';function a153_0x9172(){const _0x288a77=['now','105PTLYkU','https://registry.npmmirror.com','12013392NNXQfY','info','依赖安装失败','resolve','4unjKkX','error','2ryyFMB','909710zfZakj','916127FQycYv','4935126kWpheS','117WEgnZx','success','--registry','190770rsaQUo','依赖安装完成','8167090LetWPZ','33891011FiqVej','12hGpLJK','开始安装依赖','message','install'];a153_0x9172=function(){return _0x288a77;};return a153_0x9172();}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a153_0x4b53(_0x5129b6,_0x1f8957){_0x5129b6=_0x5129b6-0x1dd;const _0x9172c2=a153_0x9172();let _0x4b53ff=_0x9172c2[_0x5129b6];return _0x4b53ff;}import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x449449){const _0x1c655f=a153_0x4b53,_0x3348d4=Date[_0x1c655f(0x1f0)](),_0x2addc1=a153_0x1adbd6[_0x1c655f(0x1de)](process['cwd'](),_0x449449);try{logger[_0x1c655f(0x1f4)](_0x1c655f(0x1ef),_0x1c655f(0x1ed),{'projectCode':_0x449449,'registry':_0x1c655f(0x1f2)}),await execa(resolveNpmBin('npm'),['install',_0x1c655f(0x1e7),_0x1c655f(0x1f2)],{'cwd':_0x2addc1});const _0x45f011=Date['now']()-_0x3348d4;logger[_0x1c655f(0x1e6)](_0x1c655f(0x1ef),_0x1c655f(0x1e9),_0x45f011,{'projectCode':_0x449449});}catch(_0x5d9216){const _0x32cab6=Date[_0x1c655f(0x1f0)]()-_0x3348d4;logger[_0x1c655f(0x1e0)]('install',_0x1c655f(0x1dd),{'projectCode':_0x449449,'error':_0x5d9216 instanceof Error?_0x5d9216[_0x1c655f(0x1ee)]:String(_0x5d9216),'duration':_0x32cab6});throw _0x5d9216;}return formatElapsed(_0x3348d4);}
1
+ (function(_0x2abb69,_0x1b71d5){const _0x209a0c=a160_0x3708,_0x5bade7=_0x2abb69();while(!![]){try{const _0x5c9f01=parseInt(_0x209a0c(0xa8))/0x1*(parseInt(_0x209a0c(0xac))/0x2)+parseInt(_0x209a0c(0xa2))/0x3*(parseInt(_0x209a0c(0x9d))/0x4)+parseInt(_0x209a0c(0x98))/0x5+parseInt(_0x209a0c(0xa6))/0x6+-parseInt(_0x209a0c(0x9f))/0x7*(parseInt(_0x209a0c(0x9c))/0x8)+parseInt(_0x209a0c(0xa1))/0x9*(parseInt(_0x209a0c(0x9b))/0xa)+parseInt(_0x209a0c(0x97))/0xb*(-parseInt(_0x209a0c(0xa7))/0xc);if(_0x5c9f01===_0x1b71d5)break;else _0x5bade7['push'](_0x5bade7['shift']());}catch(_0x3d1a56){_0x5bade7['push'](_0x5bade7['shift']());}}}(a160_0x1238,0xb408d));import a160_0x130a3e from'node:path';function a160_0x1238(){const _0x3d85fa=['2255hFNDEt','2786730yBbjGJ','https://registry.npmmirror.com','开始安装依赖','230rJuaXo','9478984csdYjc','4mWyMSh','依赖安装失败','7yYlAMK','cwd','302661sPTdeZ','1516113UbOAwK','install','resolve','success','7284462cOlmop','140304IMwGDk','1Wwtkpi','now','error','message','2537786TXbDYU','依赖安装完成'];a160_0x1238=function(){return _0x3d85fa;};return a160_0x1238();}import{execa}from'execa';function a160_0x3708(_0x3d03da,_0x828278){_0x3d03da=_0x3d03da-0x97;const _0x123867=a160_0x1238();let _0x37084a=_0x123867[_0x3d03da];return _0x37084a;}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(_0x3ff478){const _0x2d02cf=a160_0x3708,_0x1a8bf7=Date[_0x2d02cf(0xa9)](),_0x3e9d18=a160_0x130a3e[_0x2d02cf(0xa4)](process[_0x2d02cf(0xa0)](),_0x3ff478);try{logger['info']('install',_0x2d02cf(0x9a),{'projectCode':_0x3ff478,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin('npm'),[_0x2d02cf(0xa3),'--registry',_0x2d02cf(0x99)],{'cwd':_0x3e9d18});const _0x14b0ba=Date[_0x2d02cf(0xa9)]()-_0x1a8bf7;logger[_0x2d02cf(0xa5)](_0x2d02cf(0xa3),_0x2d02cf(0xad),_0x14b0ba,{'projectCode':_0x3ff478});}catch(_0x5174b9){const _0x24edb6=Date['now']()-_0x1a8bf7;logger[_0x2d02cf(0xaa)]('install',_0x2d02cf(0x9e),{'projectCode':_0x3ff478,'error':_0x5174b9 instanceof Error?_0x5174b9[_0x2d02cf(0xab)]:String(_0x5174b9),'duration':_0x24edb6});throw _0x5174b9;}return formatElapsed(_0x1a8bf7);}
@@ -1 +1 @@
1
- const a154_0x12b974=a154_0x1f20;(function(_0x5e07c0,_0x530072){const _0x42724c=a154_0x1f20,_0x2e8891=_0x5e07c0();while(!![]){try{const _0x109235=parseInt(_0x42724c(0xce))/0x1+-parseInt(_0x42724c(0xdf))/0x2*(parseInt(_0x42724c(0xd6))/0x3)+parseInt(_0x42724c(0xd1))/0x4*(-parseInt(_0x42724c(0xc2))/0x5)+-parseInt(_0x42724c(0xc8))/0x6+-parseInt(_0x42724c(0xbf))/0x7+parseInt(_0x42724c(0xe0))/0x8+parseInt(_0x42724c(0xc1))/0x9*(parseInt(_0x42724c(0xc4))/0xa);if(_0x109235===_0x530072)break;else _0x2e8891['push'](_0x2e8891['shift']());}catch(_0x379f0c){_0x2e8891['push'](_0x2e8891['shift']());}}}(a154_0x4b7f,0x58430));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 a154_0x4b7f(){const _0x7915e5=['upgrade','appcode','535608DzgZJQ','str','2026-07','344636afsXsq','\x20workspace\x20init','create','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','cookie','2150046zxarfJ','yes','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','boolean','bool','../../commands/project/create/main.js','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','../../commands/project/create/non-interactive.js','nonInteractive','2PDuXLV','2643968KCMyBL','string','Usage:\x20','validation','trim','Create\x20a\x20new\x20project','Project\x20name','env','3949393JaIiTC','name','9sJpZlr','5nVjyWC','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','11618410zLNsDN','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Target\x20environment','write','1796310AOZmyv','init','project','Skip\x20confirmation\x20prompt'];a154_0x4b7f=function(){return _0x7915e5;};return a154_0x4b7f();}function a154_0x1f20(_0x2a00be,_0x347a3c){_0x2a00be=_0x2a00be-0xbe;const _0x4b7f58=a154_0x4b7f();let _0x1f2000=_0x4b7f58[_0x2a00be];return _0x1f2000;}const initFlags=[{'name':a154_0x12b974(0xcd),'type':a154_0x12b974(0xe1),'description':'App\x20code\x20to\x20initialize'},{'name':a154_0x12b974(0xbe),'type':a154_0x12b974(0xe1),'description':a154_0x12b974(0xc6)},{'name':a154_0x12b974(0xd7),'type':a154_0x12b974(0xd9),'description':'Auto-confirm\x20prompts','default':![]}],createFlags=[{'name':'name','type':a154_0x12b974(0xe1),'description':a154_0x12b974(0xe6)},{'name':a154_0x12b974(0xbe),'type':a154_0x12b974(0xe1),'description':a154_0x12b974(0xc6)},{'name':a154_0x12b974(0xcd),'type':'string','description':a154_0x12b974(0xd8)}],upgradeFlags=[{'name':a154_0x12b974(0xd7),'type':a154_0x12b974(0xd9),'description':a154_0x12b974(0xcb),'default':![]}];export const projectDefinitions=[{'service':'project','command':a154_0x12b974(0xc9),'description':a154_0x12b974(0xc3),'risk':a154_0x12b974(0xc7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a154_0x12b974(0xd2),'since':a154_0x12b974(0xd0)},'flags':initFlags,async 'execute'(_0x27fd21){const _0x1d40c3=a154_0x12b974;return await initConfig({'appcode':_0x27fd21[_0x1d40c3(0xcf)]('appcode')||undefined,'env':_0x27fd21[_0x1d40c3(0xcf)]('env')||undefined,'autoYes':_0x27fd21[_0x1d40c3(0xda)](_0x1d40c3(0xd7))}),{'ok':!![]};}},{'service':a154_0x12b974(0xca),'command':a154_0x12b974(0xd3),'description':a154_0x12b974(0xe5),'risk':a154_0x12b974(0xc7),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'project-name','description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x1b8403){const _0x11f18d=a154_0x12b974,{createApp:_0x2c58a8}=await import(_0x11f18d(0xdb)),{createProjectNonInteractive:_0x22d33a}=await import(_0x11f18d(0xdd)),_0x58f11c=_0x1b8403[_0x11f18d(0xcf)](_0x11f18d(0xc0))[_0x11f18d(0xe4)]()||_0x1b8403['args'][0x0]?.[_0x11f18d(0xe4)](),_0x3caba7=_0x1b8403['str'](_0x11f18d(0xbe))||undefined,_0x4f1460=_0x1b8403[_0x11f18d(0xcf)](_0x11f18d(0xcd))||undefined;if(_0x1b8403['nonInteractive']){if(!_0x58f11c)throw CliErrors[_0x11f18d(0xe3)](_0x11f18d(0xc5),_0x11f18d(0xe2)+CLI_BIN_NAME+_0x11f18d(0xd4));await _0x22d33a(_0x58f11c,_0x3caba7,_0x4f1460,_0x1b8403[_0x11f18d(0xd5)]);}else await _0x2c58a8({'projectCode':_0x58f11c,'appCode':_0x4f1460,'env':_0x3caba7,'cookie':_0x1b8403[_0x11f18d(0xd5)]});return{'ok':!![]};}},{'service':a154_0x12b974(0xca),'command':a154_0x12b974(0xcc),'description':a154_0x12b974(0xdc),'risk':a154_0x12b974(0xc7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x2b13b3){const _0x59d9f2=a154_0x12b974;return await upgradeApp(_0x2b13b3[_0x59d9f2(0xde)],{'yes':_0x2b13b3[_0x59d9f2(0xda)](_0x59d9f2(0xd7))}),{'ok':!![]};}}];
1
+ const a161_0x4819c7=a161_0x5138;(function(_0x43a2de,_0xbb75f1){const _0x4569c4=a161_0x5138,_0x1f552f=_0x43a2de();while(!![]){try{const _0x2c5aec=-parseInt(_0x4569c4(0x10d))/0x1+parseInt(_0x4569c4(0xfb))/0x2+-parseInt(_0x4569c4(0x11f))/0x3+parseInt(_0x4569c4(0xff))/0x4+-parseInt(_0x4569c4(0x105))/0x5+-parseInt(_0x4569c4(0x106))/0x6*(-parseInt(_0x4569c4(0x11e))/0x7)+parseInt(_0x4569c4(0x103))/0x8*(parseInt(_0x4569c4(0xfa))/0x9);if(_0x2c5aec===_0xbb75f1)break;else _0x1f552f['push'](_0x1f552f['shift']());}catch(_0x192faa){_0x1f552f['push'](_0x1f552f['shift']());}}}(a161_0x46eb,0x68438));import{CliErrors}from'../../errors.js';function a161_0x5138(_0xef885e,_0x51cad6){_0xef885e=_0xef885e-0xf9;const _0x46ebbc=a161_0x46eb();let _0x513818=_0x46ebbc[_0xef885e];return _0x513818;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';function a161_0x46eb(){const _0x8b739b=['Create\x20a\x20new\x20project','154808OVEGGC','create','string','init','yes','../../commands/project/create/non-interactive.js','args','upgrade','Skip\x20confirmation\x20prompt','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','App\x20code\x20to\x20initialize','env','nonInteractive','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','661822VPycwT','305886lmAXlS','../../commands/project/create/main.js','Target\x20environment','name','3821859TvunVK','285536HZSpoz','validation','cookie','Auto-confirm\x20prompts','2379288UlRxcX','boolean','trim','write','8mJwQBL','\x20workspace\x20init','2864765CpmtlY','6pySalL','Usage:\x20','project','appcode','2026-07','str'];a161_0x46eb=function(){return _0x8b739b;};return a161_0x46eb();}import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a161_0x4819c7(0x109),'type':a161_0x4819c7(0x10f),'description':a161_0x4819c7(0x118)},{'name':a161_0x4819c7(0x119),'type':a161_0x4819c7(0x10f),'description':a161_0x4819c7(0x121)},{'name':a161_0x4819c7(0x111),'type':a161_0x4819c7(0x100),'description':a161_0x4819c7(0xfe),'default':![]}],createFlags=[{'name':a161_0x4819c7(0xf9),'type':'string','description':'Project\x20name'},{'name':'env','type':a161_0x4819c7(0x10f),'description':a161_0x4819c7(0x121)},{'name':a161_0x4819c7(0x109),'type':a161_0x4819c7(0x10f),'description':a161_0x4819c7(0x117)}],upgradeFlags=[{'name':a161_0x4819c7(0x111),'type':a161_0x4819c7(0x100),'description':a161_0x4819c7(0x115),'default':![]}];export const projectDefinitions=[{'service':a161_0x4819c7(0x108),'command':a161_0x4819c7(0x110),'description':a161_0x4819c7(0x116),'risk':a161_0x4819c7(0x102),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a161_0x4819c7(0x104),'since':a161_0x4819c7(0x10a)},'flags':initFlags,async 'execute'(_0x574e63){const _0x55a9af=a161_0x4819c7;return await initConfig({'appcode':_0x574e63[_0x55a9af(0x10b)](_0x55a9af(0x109))||undefined,'env':_0x574e63[_0x55a9af(0x10b)](_0x55a9af(0x119))||undefined,'autoYes':_0x574e63['bool']('yes')}),{'ok':!![]};}},{'service':a161_0x4819c7(0x108),'command':a161_0x4819c7(0x10e),'description':a161_0x4819c7(0x10c),'risk':a161_0x4819c7(0x102),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'project-name','description':a161_0x4819c7(0x11c),'required':![]}],'flags':createFlags,async 'execute'(_0x5b2852){const _0x11514d=a161_0x4819c7,{createApp:_0x1c9a03}=await import(_0x11514d(0x120)),{createProjectNonInteractive:_0x648930}=await import(_0x11514d(0x112)),_0x5decb8=_0x5b2852[_0x11514d(0x10b)](_0x11514d(0xf9))[_0x11514d(0x101)]()||_0x5b2852[_0x11514d(0x113)][0x0]?.[_0x11514d(0x101)](),_0x30cc8f=_0x5b2852['str'](_0x11514d(0x119))||undefined,_0x6f9ae9=_0x5b2852[_0x11514d(0x10b)](_0x11514d(0x109))||undefined;if(_0x5b2852[_0x11514d(0x11a)]){if(!_0x5decb8)throw CliErrors[_0x11514d(0xfc)](_0x11514d(0x11d),_0x11514d(0x107)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0x648930(_0x5decb8,_0x30cc8f,_0x6f9ae9,_0x5b2852[_0x11514d(0xfd)]);}else await _0x1c9a03({'projectCode':_0x5decb8,'appCode':_0x6f9ae9,'env':_0x30cc8f,'cookie':_0x5b2852[_0x11514d(0xfd)]});return{'ok':!![]};}},{'service':a161_0x4819c7(0x108),'command':a161_0x4819c7(0x114),'description':a161_0x4819c7(0x11b),'risk':a161_0x4819c7(0x102),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x132b89){return await upgradeApp(_0x132b89['nonInteractive'],{'yes':_0x132b89['bool']('yes')}),{'ok':!![]};}}];