@lovrabet/rabetbase-cli 2.4.1-beta.1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/members-list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app-config/delete.js +1 -1
  25. package/lib/commands/app-config/get.js +1 -1
  26. package/lib/commands/app-config/index.js +1 -1
  27. package/lib/commands/app-config/list.js +1 -1
  28. package/lib/commands/app-config/set.js +1 -1
  29. package/lib/commands/app-config/shared.js +1 -1
  30. package/lib/commands/auth/index.js +1 -1
  31. package/lib/commands/bff/create.js +1 -1
  32. package/lib/commands/bff/delete.js +1 -1
  33. package/lib/commands/bff/detail.js +1 -1
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/bff/list.js +1 -1
  36. package/lib/commands/bff/pull.js +1 -1
  37. package/lib/commands/bff/push.js +1 -1
  38. package/lib/commands/bff/status.js +1 -1
  39. package/lib/commands/cli-skill/index.js +1 -1
  40. package/lib/commands/cli-update.js +1 -1
  41. package/lib/commands/codegen/index.js +1 -1
  42. package/lib/commands/codegen/sdk.js +1 -1
  43. package/lib/commands/codegen/sql.js +1 -1
  44. package/lib/commands/common/app-registry.js +1 -1
  45. package/lib/commands/common/app-selector.js +1 -1
  46. package/lib/commands/common/async-task.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -1
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/kb/create.js +1 -1
  101. package/lib/commands/kb/delete.js +1 -1
  102. package/lib/commands/kb/detail.js +1 -1
  103. package/lib/commands/kb/index.js +1 -1
  104. package/lib/commands/kb/list.js +1 -1
  105. package/lib/commands/kb/shared.js +1 -1
  106. package/lib/commands/kb/update.js +1 -1
  107. package/lib/commands/logs/index.js +1 -1
  108. package/lib/commands/menu/asset-update.js +1 -1
  109. package/lib/commands/menu/delete.js +1 -1
  110. package/lib/commands/menu/external-link-create.js +1 -1
  111. package/lib/commands/menu/external-link-update.js +1 -1
  112. package/lib/commands/menu/group-create.js +1 -1
  113. package/lib/commands/menu/group-update.js +1 -1
  114. package/lib/commands/menu/index.js +1 -1
  115. package/lib/commands/menu/list.js +1 -1
  116. package/lib/commands/menu/move.js +1 -1
  117. package/lib/commands/menu/regroup-start.js +1 -1
  118. package/lib/commands/menu/rename.js +1 -1
  119. package/lib/commands/menu/shared/compare-table.js +1 -1
  120. package/lib/commands/menu/shared/delete-plan.js +1 -1
  121. package/lib/commands/menu/shared/facts.js +1 -1
  122. package/lib/commands/menu/shared/index.js +1 -1
  123. package/lib/commands/menu/shared/inquirer.js +1 -1
  124. package/lib/commands/menu/shared/local-pages.js +1 -1
  125. package/lib/commands/menu/shared/logic.js +1 -1
  126. package/lib/commands/menu/shared/mutations.js +1 -1
  127. package/lib/commands/menu/shared/service.js +1 -1
  128. package/lib/commands/menu/shared/sync-core.js +1 -1
  129. package/lib/commands/menu/shared/update-core.js +1 -1
  130. package/lib/commands/menu/shared/valid-url.js +1 -1
  131. package/lib/commands/menu/sync.js +1 -1
  132. package/lib/commands/notification/config-list.js +1 -1
  133. package/lib/commands/notification/index.js +1 -1
  134. package/lib/commands/ocr/index.js +1 -1
  135. package/lib/commands/page/generate-start.js +1 -1
  136. package/lib/commands/page/generate-status.js +1 -1
  137. package/lib/commands/page/index.js +1 -1
  138. package/lib/commands/page/pull.js +1 -1
  139. package/lib/commands/page/push.js +1 -1
  140. package/lib/commands/page/react/create.js +1 -1
  141. package/lib/commands/page/react/detail.js +1 -1
  142. package/lib/commands/page/react/list.js +1 -1
  143. package/lib/commands/page/react/publish.js +1 -1
  144. package/lib/commands/page/react/shared.js +1 -1
  145. package/lib/commands/page/react/syntax.js +1 -1
  146. package/lib/commands/page/react/template.js +1 -1
  147. package/lib/commands/page/react/update.js +1 -1
  148. package/lib/commands/page/relation-audit.js +1 -1
  149. package/lib/commands/page/restore.js +1 -1
  150. package/lib/commands/page/shared.js +1 -1
  151. package/lib/commands/page/standard-page-status.js +1 -1
  152. package/lib/commands/page/sync.js +1 -1
  153. package/lib/commands/permit/index.js +1 -1
  154. package/lib/commands/permit/page-get.js +1 -1
  155. package/lib/commands/permit/page-set.js +1 -1
  156. package/lib/commands/permit/role-apis-set.js +1 -1
  157. package/lib/commands/permit/role-menus-set.js +1 -1
  158. package/lib/commands/permit/role-menus.js +1 -1
  159. package/lib/commands/permit/shared.js +1 -1
  160. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  161. package/lib/commands/project/create/format-elapsed.js +1 -1
  162. package/lib/commands/project/create/main.js +1 -1
  163. package/lib/commands/project/create/non-interactive.js +1 -1
  164. package/lib/commands/project/create/project-template-path.js +1 -1
  165. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  166. package/lib/commands/project/create/use-format-code.js +1 -1
  167. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  168. package/lib/commands/project/index.js +1 -1
  169. package/lib/commands/project/upgrade.js +1 -1
  170. package/lib/commands/registry.js +1 -1
  171. package/lib/commands/role/create.js +1 -1
  172. package/lib/commands/role/delete.js +1 -1
  173. package/lib/commands/role/detail.js +1 -1
  174. package/lib/commands/role/index.js +1 -1
  175. package/lib/commands/role/list.js +1 -1
  176. package/lib/commands/role/shared.js +1 -1
  177. package/lib/commands/role/update.js +1 -1
  178. package/lib/commands/role/user-add.js +1 -1
  179. package/lib/commands/role/user-remove.js +1 -1
  180. package/lib/commands/role/user-resolve.js +1 -1
  181. package/lib/commands/run/index.js +1 -1
  182. package/lib/commands/schema.js +1 -1
  183. package/lib/commands/sql/create.js +1 -1
  184. package/lib/commands/sql/delete.js +1 -1
  185. package/lib/commands/sql/detail.js +1 -1
  186. package/lib/commands/sql/exec.js +1 -1
  187. package/lib/commands/sql/index.js +1 -1
  188. package/lib/commands/sql/list.js +1 -1
  189. package/lib/commands/sql/pull.js +1 -1
  190. package/lib/commands/sql/push.js +1 -1
  191. package/lib/commands/sql/shared.js +1 -1
  192. package/lib/commands/sql/status.js +1 -1
  193. package/lib/commands/sql/validate.js +1 -1
  194. package/lib/commands/task/index.js +1 -1
  195. package/lib/commands/task/status.js +1 -1
  196. package/lib/commands/tenant/index.js +1 -1
  197. package/lib/commands/tenant/members-list.js +1 -1
  198. package/lib/commands/tenant/shared.js +1 -1
  199. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  200. package/lib/commands/user-account/index.js +1 -1
  201. package/lib/commands/workspace/add.js +1 -1
  202. package/lib/commands/workspace/index.js +1 -1
  203. package/lib/commands/workspace/remove.js +1 -1
  204. package/lib/config/schema.js +1 -1
  205. package/lib/constant/cdn.js +1 -1
  206. package/lib/constant/cli.js +1 -1
  207. package/lib/constant/defaults.js +1 -1
  208. package/lib/constant/domain.js +1 -1
  209. package/lib/constant/env.js +1 -1
  210. package/lib/constant/output.js +1 -1
  211. package/lib/constant/paths.js +1 -1
  212. package/lib/constant/risk.js +1 -1
  213. package/lib/context/app-resolver.js +1 -1
  214. package/lib/context/auth-resolver.js +1 -1
  215. package/lib/context/config-loader.js +1 -1
  216. package/lib/context.js +1 -1
  217. package/lib/core/alias-resolver.js +1 -1
  218. package/lib/core/api-client.js +1 -1
  219. package/lib/core/bff/config.js +1 -1
  220. package/lib/core/bff/file-system.js +1 -1
  221. package/lib/core/bff/hash.js +1 -1
  222. package/lib/core/bff/lock.js +1 -1
  223. package/lib/core/bff/utils.js +1 -1
  224. package/lib/core/db-resolver.js +1 -1
  225. package/lib/core/page/file-system.js +1 -1
  226. package/lib/core/page/hash.js +1 -1
  227. package/lib/core/page/lock.js +1 -1
  228. package/lib/core/sql-index-auditor.js +1 -1
  229. package/lib/core/sql-sync/config.js +1 -1
  230. package/lib/core/sql-sync/file-system.js +1 -1
  231. package/lib/core/sql-sync/hash.js +1 -1
  232. package/lib/core/sql-sync/lock.js +1 -1
  233. package/lib/core/sql-sync/utils.js +1 -1
  234. package/lib/core/sql-validator.js +1 -1
  235. package/lib/errors.js +1 -1
  236. package/lib/framework/build-all-flags.js +1 -1
  237. package/lib/framework/error-output.js +1 -1
  238. package/lib/framework/explicit-yes.js +1 -1
  239. package/lib/framework/flags.js +1 -1
  240. package/lib/framework/help.js +1 -1
  241. package/lib/framework/index.js +1 -1
  242. package/lib/framework/output.js +1 -1
  243. package/lib/framework/response.js +1 -1
  244. package/lib/framework/runner-alias.js +1 -1
  245. package/lib/framework/runner.js +1 -1
  246. package/lib/framework/schema-export.js +1 -1
  247. package/lib/framework/types.js +1 -1
  248. package/lib/generated/build-info.d.ts +4 -4
  249. package/lib/generated/build-info.js +1 -1
  250. package/lib/help.js +1 -1
  251. package/lib/postinstall.js +1 -1
  252. package/lib/runtime/confirmation.js +1 -1
  253. package/lib/runtime/event.js +1 -1
  254. package/lib/runtime/index.js +1 -1
  255. package/lib/runtime/queue.js +1 -1
  256. package/lib/runtime/resolve.js +1 -1
  257. package/lib/skills/builtin-skill.js +1 -1
  258. package/lib/skills/main.js +1 -1
  259. package/lib/skills/npx-skills-add.js +1 -1
  260. package/lib/skills/skill-presence.js +1 -1
  261. package/lib/telemetry/cli-command-trace.js +1 -1
  262. package/lib/telemetry/cli-help-trace.js +1 -1
  263. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  264. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  265. package/lib/telemetry/send-cli-trace-log.js +1 -1
  266. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  267. package/lib/utils/ai_config.js +1 -1
  268. package/lib/utils/apply-jq-filter.js +1 -1
  269. package/lib/utils/cdn-config.js +1 -1
  270. package/lib/utils/check-sdk-version.js +1 -1
  271. package/lib/utils/cli-version-check.js +1 -1
  272. package/lib/utils/cli-version-policy.js +1 -1
  273. package/lib/utils/config.js +1 -1
  274. package/lib/utils/copy-directory.js +1 -1
  275. package/lib/utils/entity-with-id.js +1 -1
  276. package/lib/utils/file-utils.js +1 -1
  277. package/lib/utils/guides-cdn.js +1 -1
  278. package/lib/utils/http-client.js +1 -1
  279. package/lib/utils/is-non-interactive.js +1 -1
  280. package/lib/utils/logger.js +1 -1
  281. package/lib/utils/params.js +1 -1
  282. package/lib/utils/platform.js +1 -1
  283. package/lib/utils/rules-cdn.js +1 -1
  284. package/lib/utils/sleep.js +1 -1
  285. package/lib/utils/template-replacer.js +1 -1
  286. package/lib/utils/update-notice.js +1 -1
  287. package/lib/utils/version.js +1 -1
  288. package/lib/utils/with-active-cookie.js +1 -1
  289. package/lib/utils/write-cli-side-channel.js +1 -1
  290. package/package.json +1 -1
  291. package/skills/rabetbase/SKILL.md +1 -1
  292. package/skills/rabetbase/references/rabetbase-page-react-detail.md +1 -1
  293. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- function a157_0x3276(_0x1de470,_0x34f29f){_0x1de470=_0x1de470-0x148;const _0x212e59=a157_0x212e();let _0x3276e8=_0x212e59[_0x1de470];return _0x3276e8;}const a157_0x5eb92c=a157_0x3276;(function(_0x348547,_0x474f10){const _0x157bb0=a157_0x3276,_0x186600=_0x348547();while(!![]){try{const _0x4a6880=parseInt(_0x157bb0(0x14e))/0x1+parseInt(_0x157bb0(0x151))/0x2+-parseInt(_0x157bb0(0x152))/0x3*(-parseInt(_0x157bb0(0x150))/0x4)+parseInt(_0x157bb0(0x15b))/0x5*(-parseInt(_0x157bb0(0x163))/0x6)+parseInt(_0x157bb0(0x14a))/0x7*(parseInt(_0x157bb0(0x15d))/0x8)+-parseInt(_0x157bb0(0x167))/0x9+-parseInt(_0x157bb0(0x14b))/0xa;if(_0x4a6880===_0x474f10)break;else _0x186600['push'](_0x186600['shift']());}catch(_0x475d58){_0x186600['push'](_0x186600['shift']());}}}(a157_0x212e,0x38f27));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';async function buildPlan(_0x2b8c0f,_0x4032fd){const _0x42086e=a157_0x3276,_0x361c57=await resolveRoleRef(_0x2b8c0f[_0x42086e(0x14d)],readRoleRef(_0x2b8c0f));assertPermConfigurable(_0x361c57);const _0x5dd800=readGrantRevoke(_0x2b8c0f),_0x4e3859=splitList(_0x2b8c0f[_0x42086e(0x156)](_0x42086e(0x158)));if(_0x4e3859[_0x42086e(0x159)]===0x0)throw CliErrors[_0x42086e(0x154)](_0x42086e(0x158),_0x42086e(0x149));const _0x376cfd=await getRoleMenuResources(_0x2b8c0f[_0x42086e(0x14d)],_0x361c57['id']),_0x1d9db2=flattenMenuResources(_0x376cfd),_0x2020ca=_0x4e3859['filter'](_0x3bfc83=>!_0x1d9db2['has'](_0x3bfc83));if(_0x2020ca[_0x42086e(0x159)]>0x0)throw CliErrors['validation']('Unknown\x20menu\x20resourceCode(s):\x20'+_0x2020ca[_0x42086e(0x161)](',\x20')+'.',_0x42086e(0x164));const _0x2f5bb2=new Map(),_0x49c719=[],_0x1d6fd9=[];for(const _0x5e892d of _0x4e3859){const _0x300f3d=_0x1d9db2[_0x42086e(0x162)](_0x5e892d);_0x2f5bb2[_0x42086e(0x153)](_0x5e892d,_0x5dd800),_0x49c719[_0x42086e(0x148)]({'resourceCode':_0x5e892d,'action':_0x300f3d[_0x42086e(0x166)]}),_0x1d6fd9[_0x42086e(0x148)]({'resourceCode':_0x5e892d,'action':_0x5dd800});}const _0x177a75=buildPermits(_0x1d9db2,_0x2f5bb2),_0x3c8d49={'operation':_0x5dd800===_0x42086e(0x157)?_0x42086e(0x155):'menu-revoke','selector':{'appCode':_0x2b8c0f[_0x42086e(0x14d)],'roleId':_0x361c57['id'],'roleName':_0x361c57['roleName'],'resourceCodes':_0x4e3859},'before':_0x49c719,'after':_0x1d6fd9,'dryRun':_0x4032fd,'backend':{'method':_0x42086e(0x15c),'path':UPDATE_PATH,'roleType':_0x42086e(0x165)},'warnings':[]};return{'role':_0x361c57,'permits':_0x177a75,'mutation':_0x3c8d49};}export const permitRoleMenusSet={'service':a157_0x5eb92c(0x160),'command':a157_0x5eb92c(0x14c),'description':a157_0x5eb92c(0x15e),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1d44d7){const _0x406f82=a157_0x5eb92c;readGrantRevoke(_0x1d44d7);if(splitList(_0x1d44d7[_0x406f82(0x156)](_0x406f82(0x158)))[_0x406f82(0x159)]===0x0)throw CliErrors[_0x406f82(0x154)]('menus',_0x406f82(0x149));},async 'dryRun'(_0x3373ff){const _0x26e607=a157_0x5eb92c,{mutation:_0x59c538}=await buildPlan(_0x3373ff,!![]);return asDryRunResult(_0x59c538,{'method':_0x26e607(0x15c),'url':UPDATE_PATH});},async 'execute'(_0x5ca0d0){const _0x53440a=a157_0x5eb92c,{role:_0x291ce1,permits:_0x5b166f,mutation:_0x408127}=await buildPlan(_0x5ca0d0,![]);return await updateAppRole({'id':_0x291ce1['id'],'appCode':_0x5ca0d0[_0x53440a(0x14d)],'roleType':_0x53440a(0x165),'permits':_0x5b166f}),{'ok':!![],'data':_0x408127,'message':'Updated\x20'+_0x408127[_0x53440a(0x15a)][_0x53440a(0x14f)][_0x53440a(0x159)]+'\x20menu\x20permit(s)\x20for\x20role\x20'+_0x291ce1[_0x53440a(0x15f)]};}};function a157_0x212e(){const _0x3cf268=['length','selector','100EBdzwE','POST','32kwEnik','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','roleName','permit','join','get','41034iYfCRR','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','PAGE','action','2639952oPzwuz','push','Pass\x20--menus\x20<resourceCode,...>.','342587DElVgG','2331940QpXnTN','role-menus-set','appCode','407725yZSaQn','resourceCodes','4dlnJnx','242826obaKoK','514965gmBipy','set','flagMissing','menu-grant','str','access','menus'];a157_0x212e=function(){return _0x3cf268;};return a157_0x212e();}
1
+ const a157_0x1fb3b1=a157_0x43e1;function a157_0x43e1(_0x3b50cd,_0x2dd493){_0x3b50cd=_0x3b50cd-0x165;const _0x19e5d4=a157_0x19e5();let _0x43e124=_0x19e5d4[_0x3b50cd];return _0x43e124;}(function(_0x1e4d54,_0x2cbbfe){const _0x467521=a157_0x43e1,_0x42d3aa=_0x1e4d54();while(!![]){try{const _0x3c55d0=-parseInt(_0x467521(0x17c))/0x1+parseInt(_0x467521(0x170))/0x2+-parseInt(_0x467521(0x17a))/0x3*(-parseInt(_0x467521(0x185))/0x4)+-parseInt(_0x467521(0x175))/0x5*(-parseInt(_0x467521(0x16b))/0x6)+parseInt(_0x467521(0x173))/0x7*(parseInt(_0x467521(0x165))/0x8)+-parseInt(_0x467521(0x17e))/0x9+-parseInt(_0x467521(0x16d))/0xa;if(_0x3c55d0===_0x2cbbfe)break;else _0x42d3aa['push'](_0x42d3aa['shift']());}catch(_0x3b6d6e){_0x42d3aa['push'](_0x42d3aa['shift']());}}}(a157_0x19e5,0xd6889));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';function a157_0x19e5(){const _0x53bd2c=['join','7168vdyeqP','PAGE','5CoWtfB','appCode','POST','/smartapi/permit/role/update','Unknown\x20menu\x20resourceCode(s):\x20','10371ggxelB','roleName','529239hXtxsL','role-menus-set','8249643LDNvae','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','Pass\x20--menus\x20<resourceCode,...>.','filter','\x20menu\x20permit(s)\x20for\x20role\x20','get','str','2020DDVmxh','1280liMvhX','has','validation','access','menus','Updated\x20','7195242kXRSlA','length','11173500qXJCLp','push','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','666226mKNpxO','selector'];a157_0x19e5=function(){return _0x53bd2c;};return a157_0x19e5();}import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a157_0x1fb3b1(0x178);async function buildPlan(_0x1bc089,_0x4d0752){const _0x3e820c=a157_0x1fb3b1,_0x410c31=await resolveRoleRef(_0x1bc089['appCode'],readRoleRef(_0x1bc089));assertPermConfigurable(_0x410c31);const _0x3a29b6=readGrantRevoke(_0x1bc089),_0x8a7ea6=splitList(_0x1bc089['str'](_0x3e820c(0x169)));if(_0x8a7ea6[_0x3e820c(0x16c)]===0x0)throw CliErrors['flagMissing'](_0x3e820c(0x169),_0x3e820c(0x180));const _0x183033=await getRoleMenuResources(_0x1bc089['appCode'],_0x410c31['id']),_0x83e1e8=flattenMenuResources(_0x183033),_0x1236b7=_0x8a7ea6[_0x3e820c(0x181)](_0x26d63c=>!_0x83e1e8[_0x3e820c(0x166)](_0x26d63c));if(_0x1236b7['length']>0x0)throw CliErrors[_0x3e820c(0x167)](_0x3e820c(0x179)+_0x1236b7[_0x3e820c(0x172)](',\x20')+'.',_0x3e820c(0x16f));const _0x269fcd=new Map(),_0x5de69b=[],_0x437fed=[];for(const _0x4c0f12 of _0x8a7ea6){const _0x1486e9=_0x83e1e8[_0x3e820c(0x183)](_0x4c0f12);_0x269fcd['set'](_0x4c0f12,_0x3a29b6),_0x5de69b['push']({'resourceCode':_0x4c0f12,'action':_0x1486e9['action']}),_0x437fed[_0x3e820c(0x16e)]({'resourceCode':_0x4c0f12,'action':_0x3a29b6});}const _0x48d1d=buildPermits(_0x83e1e8,_0x269fcd),_0x46156f={'operation':_0x3a29b6===_0x3e820c(0x168)?'menu-grant':'menu-revoke','selector':{'appCode':_0x1bc089[_0x3e820c(0x176)],'roleId':_0x410c31['id'],'roleName':_0x410c31[_0x3e820c(0x17b)],'resourceCodes':_0x8a7ea6},'before':_0x5de69b,'after':_0x437fed,'dryRun':_0x4d0752,'backend':{'method':_0x3e820c(0x177),'path':UPDATE_PATH,'roleType':_0x3e820c(0x174)},'warnings':[]};return{'role':_0x410c31,'permits':_0x48d1d,'mutation':_0x46156f};}export const permitRoleMenusSet={'service':'permit','command':a157_0x1fb3b1(0x17d),'description':a157_0x1fb3b1(0x17f),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x404de9){const _0x569b15=a157_0x1fb3b1;readGrantRevoke(_0x404de9);if(splitList(_0x404de9[_0x569b15(0x184)](_0x569b15(0x169)))['length']===0x0)throw CliErrors['flagMissing']('menus',_0x569b15(0x180));},async 'dryRun'(_0x367eca){const _0x17f4da=a157_0x1fb3b1,{mutation:_0x3174a2}=await buildPlan(_0x367eca,!![]);return asDryRunResult(_0x3174a2,{'method':_0x17f4da(0x177),'url':UPDATE_PATH});},async 'execute'(_0xf97a17){const _0x32f4d3=a157_0x1fb3b1,{role:_0x2be1d8,permits:_0x13df62,mutation:_0x412fef}=await buildPlan(_0xf97a17,![]);return await updateAppRole({'id':_0x2be1d8['id'],'appCode':_0xf97a17[_0x32f4d3(0x176)],'roleType':_0x32f4d3(0x174),'permits':_0x13df62}),{'ok':!![],'data':_0x412fef,'message':_0x32f4d3(0x16a)+_0x412fef[_0x32f4d3(0x171)]['resourceCodes'][_0x32f4d3(0x16c)]+_0x32f4d3(0x182)+_0x2be1d8['roleName']};}};
@@ -1 +1 @@
1
- const a158_0x245ea4=a158_0x8910;(function(_0xaa6b50,_0x553daa){const _0x4c5a08=a158_0x8910,_0xabfbf4=_0xaa6b50();while(!![]){try{const _0x492ed4=parseInt(_0x4c5a08(0x8f))/0x1+parseInt(_0x4c5a08(0x8d))/0x2*(-parseInt(_0x4c5a08(0x80))/0x3)+-parseInt(_0x4c5a08(0x89))/0x4+parseInt(_0x4c5a08(0x85))/0x5+parseInt(_0x4c5a08(0x87))/0x6*(-parseInt(_0x4c5a08(0x91))/0x7)+parseInt(_0x4c5a08(0x88))/0x8+-parseInt(_0x4c5a08(0x8b))/0x9*(parseInt(_0x4c5a08(0x92))/0xa);if(_0x492ed4===_0x553daa)break;else _0xabfbf4['push'](_0xabfbf4['shift']());}catch(_0x1d9a27){_0xabfbf4['push'](_0xabfbf4['shift']());}}}(a158_0x1d20,0x4ec20));function a158_0x8910(_0x191c76,_0xa17971){_0x191c76=_0x191c76-0x7c;const _0x1d20d4=a158_0x1d20();let _0x891052=_0x1d20d4[_0x191c76];return _0x891052;}import{getRoleMenuResources}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{flattenMenuResources,readRoleRef,ROLE_REF_FLAG}from'../../commands/permit/shared.js';function a158_0x1d20(){const _0x444501=['1774620ivYWPA','permit','1030581BCaYxe','roleName','254fHdlAg','\x20has\x20','579537sehwdc','access','14IYCFUJ','20mVIOov','Role\x20','appCode','length','filter','read','3849RVHcDP','allowed','action','resourceName','role-menus','1643520CMVvFM','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','96546XuErxo','2257176cNWgoz'];a158_0x1d20=function(){return _0x444501;};return a158_0x1d20();}import{resolveRoleRef}from'../../commands/role/shared.js';export const permitRoleMenus={'service':a158_0x245ea4(0x8a),'command':a158_0x245ea4(0x84),'description':a158_0x245ea4(0x86),'risk':a158_0x245ea4(0x7f),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x22126b){const _0x7101b8=a158_0x245ea4,_0x358f0b=await resolveRoleRef(_0x22126b[_0x7101b8(0x7c)],readRoleRef(_0x22126b)),_0x30b699=await getRoleMenuResources(_0x22126b[_0x7101b8(0x7c)],_0x358f0b['id']),_0x91c43b=flattenMenuResources(_0x30b699),_0x1096b1=Array['from'](_0x91c43b['values']())['map'](_0x3107c3=>({'resourceCode':_0x3107c3['resourceCode'],'resourceName':_0x3107c3[_0x7101b8(0x83)],'allowed':_0x3107c3[_0x7101b8(0x82)]===_0x7101b8(0x90),'action':_0x3107c3[_0x7101b8(0x82)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x22126b['appCode'],'roleId':_0x358f0b['id'],'roleName':_0x358f0b[_0x7101b8(0x8c)]},'menus':_0x1096b1},'message':_0x7101b8(0x93)+_0x358f0b[_0x7101b8(0x8c)]+_0x7101b8(0x8e)+_0x1096b1[_0x7101b8(0x7e)](_0x3a9f69=>_0x3a9f69[_0x7101b8(0x81)])[_0x7101b8(0x7d)]+'/'+_0x1096b1[_0x7101b8(0x7d)]+'\x20menu(s)\x20allowed'};}};
1
+ function a158_0x326d(){const _0x32fada=['allowed','467264tqtEkH','read','resourceName','1037330wMwqJt','values','Role\x20','303240WbgbNR','298026yhpGKv','from','roleName','9plJzVm','45WBHzmx','appCode','role-menus','permit','access','length','1485930uZyyBN','\x20has\x20','1505571iTJpys','action','315stbDEl','map','86736WVvNtW','\x20menu(s)\x20allowed'];a158_0x326d=function(){return _0x32fada;};return a158_0x326d();}const a158_0x18aaec=a158_0x408c;(function(_0x260f68,_0x5a8026){const _0x37fca4=a158_0x408c,_0x3e9768=_0x260f68();while(!![]){try{const _0x391db3=parseInt(_0x37fca4(0xe4))/0x1+-parseInt(_0x37fca4(0xe7))/0x2+parseInt(_0x37fca4(0xdd))/0x3+-parseInt(_0x37fca4(0xd0))/0x4+-parseInt(_0x37fca4(0xd5))/0x5*(parseInt(_0x37fca4(0xd1))/0x6)+parseInt(_0x37fca4(0xdf))/0x7*(parseInt(_0x37fca4(0xe1))/0x8)+-parseInt(_0x37fca4(0xd4))/0x9*(parseInt(_0x37fca4(0xdb))/0xa);if(_0x391db3===_0x5a8026)break;else _0x3e9768['push'](_0x3e9768['shift']());}catch(_0x2d8ffd){_0x3e9768['push'](_0x3e9768['shift']());}}}(a158_0x326d,0x41298));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 a158_0x408c(_0x298754,_0x727b1f){_0x298754=_0x298754-0xce;const _0x326d21=a158_0x326d();let _0x408cda=_0x326d21[_0x298754];return _0x408cda;}export const permitRoleMenus={'service':a158_0x18aaec(0xd8),'command':a158_0x18aaec(0xd7),'description':'Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','risk':a158_0x18aaec(0xe5),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x3280bd){const _0x43b654=a158_0x18aaec,_0x285018=await resolveRoleRef(_0x3280bd['appCode'],readRoleRef(_0x3280bd)),_0x131c38=await getRoleMenuResources(_0x3280bd[_0x43b654(0xd6)],_0x285018['id']),_0x277ad8=flattenMenuResources(_0x131c38),_0x3b42dd=Array[_0x43b654(0xd2)](_0x277ad8[_0x43b654(0xce)]())[_0x43b654(0xe0)](_0x2e4ab6=>({'resourceCode':_0x2e4ab6['resourceCode'],'resourceName':_0x2e4ab6[_0x43b654(0xe6)],'allowed':_0x2e4ab6[_0x43b654(0xde)]===_0x43b654(0xd9),'action':_0x2e4ab6[_0x43b654(0xde)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x3280bd[_0x43b654(0xd6)],'roleId':_0x285018['id'],'roleName':_0x285018[_0x43b654(0xd3)]},'menus':_0x3b42dd},'message':_0x43b654(0xcf)+_0x285018[_0x43b654(0xd3)]+_0x43b654(0xdc)+_0x3b42dd['filter'](_0x1a480b=>_0x1a480b[_0x43b654(0xe3)])[_0x43b654(0xda)]+'/'+_0x3b42dd[_0x43b654(0xda)]+_0x43b654(0xe2)};}};
@@ -1 +1 @@
1
- const a159_0x2882cc=a159_0x511c;(function(_0x5759ca,_0x52ca1b){const _0x4c2137=a159_0x511c,_0x5d7f67=_0x5759ca();while(!![]){try{const _0x4a8f0d=parseInt(_0x4c2137(0xa9))/0x1+-parseInt(_0x4c2137(0xd4))/0x2+parseInt(_0x4c2137(0xa7))/0x3+parseInt(_0x4c2137(0xa1))/0x4*(-parseInt(_0x4c2137(0xc3))/0x5)+parseInt(_0x4c2137(0xb2))/0x6+parseInt(_0x4c2137(0xbd))/0x7+-parseInt(_0x4c2137(0x99))/0x8*(-parseInt(_0x4c2137(0xad))/0x9);if(_0x4a8f0d===_0x52ca1b)break;else _0x5d7f67['push'](_0x5d7f67['shift']());}catch(_0xe9bac6){_0x5d7f67['push'](_0x5d7f67['shift']());}}}(a159_0x2e88,0x66126));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a159_0x2882cc(0xa6),'type':a159_0x2882cc(0xd3),'required':!![],'description':a159_0x2882cc(0xbc)};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':a159_0x2882cc(0xae)};export const GRANT_FLAG={'name':a159_0x2882cc(0xdf),'type':a159_0x2882cc(0xb7),'required':![],'description':a159_0x2882cc(0xb8)};export const REVOKE_FLAG={'name':'revoke','type':a159_0x2882cc(0xb7),'required':![],'description':'Revoke\x20access\x20to\x20the\x20listed\x20resources'};function a159_0x2e88(){const _0x2d1a75=['length','roleType','label','access','dataExport','dataPermit','dataDelete','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','menuPermit','Disambiguate\x20with\x20an\x20id.','row-roles','validation','join','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','find','number','637176FHoVCu','map','pageNodeList','bool','allowedActions','set','rolePermit','Pass\x20--role\x20<id|name>.','menu\x20visibility','delete-roles','get','grant','filter','str','Role\x20\x22','data\x20detail','SELF\x20is\x20not\x20allowed\x20for\x20','\x22\x20not\x20found.','263288tvKWse','\x20is\x20not\x20available\x20for\x20this\x20app.','export-roles','allowSelf','test','datasets','push','dataCreate','1619240PXNzlC','role','Roles\x20for\x20','trim','resourceName','menu-id','1375446zcwDGc','Missing\x20action.','76240brWhVo','create-roles','entries','string','36AgxLWO','Role\x20id\x20or\x20role\x20name','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','data\x20create','data\x20export','4726164ljvlQM','Role\x20id\x20','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','appCode','dataDetail','boolean','Grant\x20access\x20to\x20the\x20listed\x20resources','action','flagMissing','toUpperCase','Menu\x20id\x20(from\x20`menu\x20list`)','645638SfOsGZ','menu-roles','resourceCode','split','key',';\x20SELF\x20=\x20only\x20own\x20rows','10kkfnql'];a159_0x2e88=function(){return _0x2d1a75;};return a159_0x2e88();}export const MENUS_FLAG={'name':'menus','type':a159_0x2882cc(0xac),'required':!![],'description':a159_0x2882cc(0xaf)};export const DATASETS_FLAG={'name':a159_0x2882cc(0x9e),'type':'string','required':!![],'description':'Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for'};export const PAGE_SLOT_SPECS=[{'flag':a159_0x2882cc(0xbe),'key':a159_0x2882cc(0xcc),'allowSelf':![],'label':a159_0x2882cc(0xdc)},{'flag':a159_0x2882cc(0xaa),'key':a159_0x2882cc(0xa0),'allowSelf':![],'label':a159_0x2882cc(0xb0)},{'flag':'update-roles','key':'dataUpdate','allowSelf':![],'label':'data\x20update'},{'flag':a159_0x2882cc(0xdd),'key':a159_0x2882cc(0xca),'allowSelf':![],'label':'data\x20delete'},{'flag':'detail-roles','key':a159_0x2882cc(0xb6),'allowSelf':![],'label':a159_0x2882cc(0xe3)},{'flag':a159_0x2882cc(0x9b),'key':a159_0x2882cc(0xc8),'allowSelf':![],'label':a159_0x2882cc(0xb1)},{'flag':a159_0x2882cc(0xce),'key':a159_0x2882cc(0xc9),'allowSelf':!![],'label':'row\x20visibility'}];function a159_0x511c(_0x2b7774,_0x1a04cc){_0x2b7774=_0x2b7774-0x98;const _0x2e880d=a159_0x2e88();let _0x511c42=_0x2e880d[_0x2b7774];return _0x511c42;}export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a159_0x2882cc(0xd5)](_0x29b36d=>({'name':_0x29b36d['flag'],'type':'string','required':![],'description':a159_0x2882cc(0xa3)+_0x29b36d[a159_0x2882cc(0xc6)]+'\x20(comma-separated\x20SELF/ALL/id/name)'+(_0x29b36d[a159_0x2882cc(0x9c)]?a159_0x2882cc(0xc2):'')}));export function splitList(_0x3c9b69){const _0x8e5e09=a159_0x2882cc;return _0x3c9b69[_0x8e5e09(0xc0)](',')[_0x8e5e09(0xd5)](_0x48dec6=>_0x48dec6[_0x8e5e09(0xa4)]())['filter'](Boolean);}export function projectRoleRef(_0x1669a7){const _0x381b40=a159_0x2882cc;return{'id':_0x1669a7['id'],'roleName':_0x1669a7['roleName'],'roleType':_0x1669a7[_0x381b40(0xc5)]};}export async function resolvePermitRoles(_0x1281e1,_0x54a291,_0xefc30c){const _0x2f2325=a159_0x2882cc,_0x969072=await listPermitRoles(_0x1281e1,{'needSelf':!![],'needPublic':!![]}),_0x208b3c=[];for(const _0x76ded9 of _0x54a291){const _0x42150b=resolveOnePermitRole(_0x969072,_0x76ded9);if(!_0xefc30c[_0x2f2325(0x9c)]&&_0x42150b[_0x2f2325(0xc5)]==='SELF')throw CliErrors[_0x2f2325(0xcf)](_0x2f2325(0xe4)+_0xefc30c[_0x2f2325(0xc6)]+'.',_0x2f2325(0xd1));if(!_0x208b3c['some'](_0x14e45b=>_0x14e45b['id']===_0x42150b['id']))_0x208b3c[_0x2f2325(0x9f)](_0x42150b);}return _0x208b3c;}function resolveOnePermitRole(_0x425259,_0x4ff025){const _0x1cf5e3=a159_0x2882cc,_0x20068d=_0x4ff025['trim'](),_0x190374=_0x20068d[_0x1cf5e3(0xbb)]();if(_0x190374==='SELF'||_0x190374==='ALL'){const _0x27cf33=_0x425259[_0x1cf5e3(0xd2)](_0x1211e1=>_0x1211e1[_0x1cf5e3(0xc5)]===_0x190374);if(!_0x27cf33)throw CliErrors['validation']('Special\x20role\x20'+_0x190374+_0x1cf5e3(0x9a));return _0x27cf33;}if(/^-?\d+$/[_0x1cf5e3(0x9d)](_0x20068d)){const _0x52d495=Number(_0x20068d),_0x1d9588=_0x425259[_0x1cf5e3(0xd2)](_0x2927c7=>_0x2927c7['id']===_0x52d495);if(!_0x1d9588)throw CliErrors[_0x1cf5e3(0xcf)](_0x1cf5e3(0xb3)+_0x52d495+'\x20not\x20found.','Run\x20`role\x20list`.');return _0x1d9588;}const _0x2e6a5b=_0x425259[_0x1cf5e3(0xe0)](_0x4443c8=>_0x4443c8['roleName']===_0x20068d);if(_0x2e6a5b[_0x1cf5e3(0xc4)]===0x0)throw CliErrors[_0x1cf5e3(0xcf)](_0x1cf5e3(0xe2)+_0x20068d+_0x1cf5e3(0x98),'Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.');if(_0x2e6a5b[_0x1cf5e3(0xc4)]>0x1)throw CliErrors[_0x1cf5e3(0xcf)](_0x1cf5e3(0xe2)+_0x20068d+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x2e6a5b[_0x1cf5e3(0xd5)](_0x1629aa=>_0x1629aa['id'])[_0x1cf5e3(0xd0)](',\x20')+').',_0x1cf5e3(0xcd));return _0x2e6a5b[0x0];}export function projectPageSlot(_0x2daccf){const _0x12ac0e=a159_0x2882cc;if(!_0x2daccf)return null;return{'resourceCode':_0x2daccf[_0x12ac0e(0xbf)],'roles':(_0x2daccf[_0x12ac0e(0xda)]??[])[_0x12ac0e(0xd5)](projectRoleRef)};}export function projectPagePermit(_0x1db755){const _0x3521b6=a159_0x2882cc,_0x1be523={'menuId':_0x1db755['menuId'],'appCode':_0x1db755[_0x3521b6(0xb5)],'menuPermit':projectPageSlot(_0x1db755[_0x3521b6(0xcc)])};for(const _0xf50a71 of PAGE_SLOT_SPECS){if(_0xf50a71[_0x3521b6(0xc1)]===_0x3521b6(0xcc))continue;_0x1be523[_0xf50a71[_0x3521b6(0xc1)]]=projectPageSlot(_0x1db755[_0xf50a71[_0x3521b6(0xc1)]]);}return _0x1be523;}export function flattenMenuResources(_0x3a9bc9){const _0x295d57=new Map(),_0x191697=_0xe7d05a=>{const _0x305322=a159_0x511c;for(const _0x2f2594 of _0xe7d05a??[]){_0x295d57[_0x305322(0xd9)](_0x2f2594[_0x305322(0xbf)],{'resourceCode':_0x2f2594[_0x305322(0xbf)],'resourceName':_0x2f2594[_0x305322(0xa5)],'action':_0x2f2594[_0x305322(0xd8)]?.[0x0]??'0'});if(_0x2f2594['pageNodeList'])_0x191697(_0x2f2594[_0x305322(0xd6)]);}};return _0x191697(_0x3a9bc9),_0x295d57;}export function flattenApiResources(_0xc5d8b6){const _0x194b5e=a159_0x2882cc,_0x830f39=new Map(),_0x3d12ab=new Map();for(const _0x52e792 of _0xc5d8b6){const _0x5862a4=_0x52e792['apiList']??{};for(const [_0xe5afe,_0x50ebd1]of Object[_0x194b5e(0xab)](_0x5862a4)){_0x830f39[_0x194b5e(0xd9)](_0xe5afe,{'resourceCode':_0xe5afe,'resourceName':_0x52e792[_0x194b5e(0xa5)],'datasetCode':_0x52e792['datasetCode'],'action':_0x50ebd1?.[0x0]??'0'});const _0x4e4450=_0x3d12ab[_0x194b5e(0xde)](_0x52e792['datasetCode'])??[];_0x4e4450[_0x194b5e(0x9f)](_0xe5afe),_0x3d12ab[_0x194b5e(0xd9)](_0x52e792['datasetCode'],_0x4e4450);}}return{'byCode':_0x830f39,'byDataset':_0x3d12ab};}export function buildPermits(_0x455584,_0x4a4def){const _0x12233a=a159_0x2882cc,_0x59f196={};for(const [_0x395a11,_0x47af2f]of _0x455584){const _0x476f9c=_0x4a4def[_0x12233a(0xde)](_0x395a11)??_0x47af2f[_0x12233a(0xb9)];_0x59f196[_0x395a11]=[_0x476f9c];}return _0x59f196;}export function readRoleRef(_0x2823f3){const _0x997a88=a159_0x2882cc,_0x23ae27=_0x2823f3[_0x997a88(0xe1)](_0x997a88(0xa2))[_0x997a88(0xa4)]();if(!_0x23ae27)throw CliErrors[_0x997a88(0xba)]('role',_0x997a88(0xdb));return _0x23ae27;}export function readGrantRevoke(_0x280044){const _0x3eea50=a159_0x2882cc,_0x480eee=_0x280044[_0x3eea50(0xd7)](_0x3eea50(0xdf)),_0x22110a=_0x280044[_0x3eea50(0xd7)]('revoke');if(_0x480eee&&_0x22110a)throw CliErrors[_0x3eea50(0xcf)](_0x3eea50(0xb4));if(!_0x480eee&&!_0x22110a)throw CliErrors[_0x3eea50(0xcf)](_0x3eea50(0xa8),_0x3eea50(0xcb));return _0x480eee?_0x3eea50(0xc7):'0';}
1
+ const a159_0x2fac26=a159_0x3dd8;(function(_0x3e3401,_0x154897){const _0x433c2e=a159_0x3dd8,_0x50b0db=_0x3e3401();while(!![]){try{const _0x304765=parseInt(_0x433c2e(0xeb))/0x1+-parseInt(_0x433c2e(0xe5))/0x2*(-parseInt(_0x433c2e(0xd4))/0x3)+-parseInt(_0x433c2e(0xef))/0x4+parseInt(_0x433c2e(0xf5))/0x5*(parseInt(_0x433c2e(0xfc))/0x6)+-parseInt(_0x433c2e(0xc2))/0x7+-parseInt(_0x433c2e(0xfe))/0x8+parseInt(_0x433c2e(0xcf))/0x9;if(_0x304765===_0x154897)break;else _0x50b0db['push'](_0x50b0db['shift']());}catch(_0x3d36f4){_0x50b0db['push'](_0x50b0db['shift']());}}}(a159_0x334e,0x215ab));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a159_0x2fac26(0xf4),'type':a159_0x2fac26(0x103),'required':!![],'description':a159_0x2fac26(0xda)};export const ROLE_REF_FLAG={'name':'role','type':a159_0x2fac26(0xe4),'required':!![],'description':a159_0x2fac26(0xc6)};export const GRANT_FLAG={'name':'grant','type':a159_0x2fac26(0xbc),'required':![],'description':a159_0x2fac26(0xce)};export const REVOKE_FLAG={'name':a159_0x2fac26(0xd1),'type':'boolean','required':![],'description':a159_0x2fac26(0x102)};export const MENUS_FLAG={'name':a159_0x2fac26(0xdd),'type':a159_0x2fac26(0xe4),'required':!![],'description':a159_0x2fac26(0xcb)};export const DATASETS_FLAG={'name':a159_0x2fac26(0xf8),'type':a159_0x2fac26(0xe4),'required':!![],'description':a159_0x2fac26(0xb3)};export const PAGE_SLOT_SPECS=[{'flag':a159_0x2fac26(0xb5),'key':a159_0x2fac26(0xe8),'allowSelf':![],'label':a159_0x2fac26(0xd0)},{'flag':a159_0x2fac26(0xf2),'key':'dataCreate','allowSelf':![],'label':'data\x20create'},{'flag':a159_0x2fac26(0xba),'key':a159_0x2fac26(0xe2),'allowSelf':![],'label':'data\x20update'},{'flag':a159_0x2fac26(0xd5),'key':a159_0x2fac26(0xf1),'allowSelf':![],'label':a159_0x2fac26(0xca)},{'flag':a159_0x2fac26(0xf7),'key':a159_0x2fac26(0xd9),'allowSelf':![],'label':a159_0x2fac26(0xb4)},{'flag':a159_0x2fac26(0xe7),'key':a159_0x2fac26(0xed),'allowSelf':![],'label':'data\x20export'},{'flag':a159_0x2fac26(0xbe),'key':a159_0x2fac26(0xb0),'allowSelf':!![],'label':a159_0x2fac26(0xb8)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS['map'](_0x4e86b0=>({'name':_0x4e86b0[a159_0x2fac26(0xff)],'type':a159_0x2fac26(0xe4),'required':![],'description':a159_0x2fac26(0xbd)+_0x4e86b0[a159_0x2fac26(0xf6)]+a159_0x2fac26(0xb1)+(_0x4e86b0[a159_0x2fac26(0xf0)]?a159_0x2fac26(0xe1):'')}));export function splitList(_0x3c9da9){const _0x315aed=a159_0x2fac26;return _0x3c9da9[_0x315aed(0xac)](',')['map'](_0x55df85=>_0x55df85[_0x315aed(0xd8)]())[_0x315aed(0xc1)](Boolean);}export function projectRoleRef(_0x22a2c6){const _0x61bf9b=a159_0x2fac26;return{'id':_0x22a2c6['id'],'roleName':_0x22a2c6[_0x61bf9b(0xf9)],'roleType':_0x22a2c6[_0x61bf9b(0xb6)]};}export async function resolvePermitRoles(_0x323600,_0x4ad504,_0x45198d){const _0x2b1691=a159_0x2fac26,_0x584a74=await listPermitRoles(_0x323600,{'needSelf':!![],'needPublic':!![]}),_0x41e8ea=[];for(const _0xf642ed of _0x4ad504){const _0x45e73b=resolveOnePermitRole(_0x584a74,_0xf642ed);if(!_0x45198d[_0x2b1691(0xf0)]&&_0x45e73b[_0x2b1691(0xb6)]==='SELF')throw CliErrors['validation']('SELF\x20is\x20not\x20allowed\x20for\x20'+_0x45198d[_0x2b1691(0xf6)]+'.',_0x2b1691(0xb2));if(!_0x41e8ea[_0x2b1691(0xe9)](_0x58ceb7=>_0x58ceb7['id']===_0x45e73b['id']))_0x41e8ea['push'](_0x45e73b);}return _0x41e8ea;}function resolveOnePermitRole(_0x57879f,_0x3e4da3){const _0x7664c=a159_0x2fac26,_0x19db73=_0x3e4da3['trim'](),_0x39b943=_0x19db73[_0x7664c(0xae)]();if(_0x39b943===_0x7664c(0xbf)||_0x39b943===_0x7664c(0xc7)){const _0x26332c=_0x57879f['find'](_0xa45114=>_0xa45114['roleType']===_0x39b943);if(!_0x26332c)throw CliErrors[_0x7664c(0xcd)](_0x7664c(0xee)+_0x39b943+_0x7664c(0xfd));return _0x26332c;}if(/^-?\d+$/[_0x7664c(0xcc)](_0x19db73)){const _0x4159ea=Number(_0x19db73),_0x27838b=_0x57879f[_0x7664c(0xf3)](_0x12819d=>_0x12819d['id']===_0x4159ea);if(!_0x27838b)throw CliErrors[_0x7664c(0xcd)](_0x7664c(0xdc)+_0x4159ea+_0x7664c(0xfa),_0x7664c(0xc9));return _0x27838b;}const _0x169008=_0x57879f[_0x7664c(0xc1)](_0x2bb34f=>_0x2bb34f['roleName']===_0x19db73);if(_0x169008[_0x7664c(0xde)]===0x0)throw CliErrors['validation'](_0x7664c(0xc8)+_0x19db73+_0x7664c(0xd3),'Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.');if(_0x169008[_0x7664c(0xde)]>0x1)throw CliErrors['validation'](_0x7664c(0xc8)+_0x19db73+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x169008[_0x7664c(0xc0)](_0x3d4705=>_0x3d4705['id'])[_0x7664c(0xd7)](',\x20')+').',_0x7664c(0xfb));return _0x169008[0x0];}export function projectPageSlot(_0xcaac9c){const _0x309d83=a159_0x2fac26;if(!_0xcaac9c)return null;return{'resourceCode':_0xcaac9c['resourceCode'],'roles':(_0xcaac9c[_0x309d83(0xd6)]??[])[_0x309d83(0xc0)](projectRoleRef)};}function a159_0x334e(){const _0x10cb58=['dataPermit','\x20(comma-separated\x20SELF/ALL/id/name)','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','data\x20detail','menu-roles','roleType','key','row\x20visibility','str','update-roles','resourceCode','boolean','Roles\x20for\x20','row-roles','SELF','map','filter','868567mwCxjT','appCode','set','bool','Role\x20id\x20or\x20role\x20name','ALL','Role\x20\x22','Run\x20`role\x20list`.','data\x20delete','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','test','validation','Grant\x20access\x20to\x20the\x20listed\x20resources','1136538rttbDT','menu\x20visibility','revoke','allowedActions','\x22\x20not\x20found.','272004yAOJlj','delete-roles','rolePermit','join','trim','dataDetail','Menu\x20id\x20(from\x20`menu\x20list`)','access','Role\x20id\x20','menus','length','datasetCode','resourceName',';\x20SELF\x20=\x20only\x20own\x20rows','dataUpdate','Missing\x20action.','string','6nedZmo','flagMissing','export-roles','menuPermit','some','Pass\x20--role\x20<id|name>.','244266wOFeLk','apiList','dataExport','Special\x20role\x20','691996nRoRBl','allowSelf','dataDelete','create-roles','find','menu-id','10GIUKSy','label','detail-roles','datasets','roleName','\x20not\x20found.','Disambiguate\x20with\x20an\x20id.','120072NGLtdZ','\x20is\x20not\x20available\x20for\x20this\x20app.','1991016iJEgJb','flag','role','pageNodeList','Revoke\x20access\x20to\x20the\x20listed\x20resources','number','split','entries','toUpperCase','push'];a159_0x334e=function(){return _0x10cb58;};return a159_0x334e();}export function projectPagePermit(_0x2c6485){const _0x54f6ad=a159_0x2fac26,_0x409158={'menuId':_0x2c6485['menuId'],'appCode':_0x2c6485[_0x54f6ad(0xc3)],'menuPermit':projectPageSlot(_0x2c6485[_0x54f6ad(0xe8)])};for(const _0x6fdfd0 of PAGE_SLOT_SPECS){if(_0x6fdfd0[_0x54f6ad(0xb7)]==='menuPermit')continue;_0x409158[_0x6fdfd0['key']]=projectPageSlot(_0x2c6485[_0x6fdfd0[_0x54f6ad(0xb7)]]);}return _0x409158;}export function flattenMenuResources(_0x5329fd){const _0xe24a5d=new Map(),_0x4250b9=_0x56b277=>{const _0x2834ab=a159_0x3dd8;for(const _0x23bebb of _0x56b277??[]){_0xe24a5d['set'](_0x23bebb[_0x2834ab(0xbb)],{'resourceCode':_0x23bebb[_0x2834ab(0xbb)],'resourceName':_0x23bebb['resourceName'],'action':_0x23bebb[_0x2834ab(0xd2)]?.[0x0]??'0'});if(_0x23bebb[_0x2834ab(0x101)])_0x4250b9(_0x23bebb[_0x2834ab(0x101)]);}};return _0x4250b9(_0x5329fd),_0xe24a5d;}export function flattenApiResources(_0x2ee9c6){const _0x3728a5=a159_0x2fac26,_0x359f5a=new Map(),_0x7f46de=new Map();for(const _0x398ef2 of _0x2ee9c6){const _0x348be9=_0x398ef2[_0x3728a5(0xec)]??{};for(const [_0x43092a,_0x275e74]of Object[_0x3728a5(0xad)](_0x348be9)){_0x359f5a[_0x3728a5(0xc4)](_0x43092a,{'resourceCode':_0x43092a,'resourceName':_0x398ef2[_0x3728a5(0xe0)],'datasetCode':_0x398ef2['datasetCode'],'action':_0x275e74?.[0x0]??'0'});const _0xb797b8=_0x7f46de['get'](_0x398ef2[_0x3728a5(0xdf)])??[];_0xb797b8[_0x3728a5(0xaf)](_0x43092a),_0x7f46de[_0x3728a5(0xc4)](_0x398ef2[_0x3728a5(0xdf)],_0xb797b8);}}return{'byCode':_0x359f5a,'byDataset':_0x7f46de};}export function buildPermits(_0x490881,_0x47b907){const _0x682f2e={};for(const [_0x599b83,_0x3086b4]of _0x490881){const _0x68ab87=_0x47b907['get'](_0x599b83)??_0x3086b4['action'];_0x682f2e[_0x599b83]=[_0x68ab87];}return _0x682f2e;}export function readRoleRef(_0x4a3dc6){const _0x59ab0d=a159_0x2fac26,_0x22b26c=_0x4a3dc6[_0x59ab0d(0xb9)](_0x59ab0d(0x100))['trim']();if(!_0x22b26c)throw CliErrors[_0x59ab0d(0xe6)](_0x59ab0d(0x100),_0x59ab0d(0xea));return _0x22b26c;}function a159_0x3dd8(_0x54dbdb,_0x338996){_0x54dbdb=_0x54dbdb-0xac;const _0x334e4d=a159_0x334e();let _0x3dd8cf=_0x334e4d[_0x54dbdb];return _0x3dd8cf;}export function readGrantRevoke(_0x10101c){const _0x4f0a74=a159_0x2fac26,_0x3824e0=_0x10101c[_0x4f0a74(0xc5)]('grant'),_0x2b2d79=_0x10101c[_0x4f0a74(0xc5)](_0x4f0a74(0xd1));if(_0x3824e0&&_0x2b2d79)throw CliErrors[_0x4f0a74(0xcd)]('--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.');if(!_0x3824e0&&!_0x2b2d79)throw CliErrors[_0x4f0a74(0xcd)](_0x4f0a74(0xe3),'Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.');return _0x3824e0?_0x4f0a74(0xdb):'0';}
@@ -1 +1 @@
1
- (function(_0x4492c9,_0x3d49e1){const _0x4ed9a5=a160_0x4540,_0x6d551e=_0x4492c9();while(!![]){try{const _0x18cf3a=-parseInt(_0x4ed9a5(0x8d))/0x1+parseInt(_0x4ed9a5(0x91))/0x2*(parseInt(_0x4ed9a5(0x8e))/0x3)+-parseInt(_0x4ed9a5(0x99))/0x4+parseInt(_0x4ed9a5(0x95))/0x5+parseInt(_0x4ed9a5(0x93))/0x6+parseInt(_0x4ed9a5(0x98))/0x7+-parseInt(_0x4ed9a5(0x85))/0x8*(parseInt(_0x4ed9a5(0x9b))/0x9);if(_0x18cf3a===_0x3d49e1)break;else _0x6d551e['push'](_0x6d551e['shift']());}catch(_0x4b2724){_0x6d551e['push'](_0x6d551e['shift']());}}}(a160_0x82da,0x233ae));import{existsSync}from'node:fs';import a160_0x3aeb3b from'node:path';import a160_0x31a6d1 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a160_0x82da(){const _0x718d79=['my-app','test','2NYwgUK','Not\x20set','643608uuFAfE','Skipped','1264405HAEsYr','production','Directory\x20\x22','710717CFFRRy','191464WMNdZF','resolve','738yREjWQ','env','Project\x20name:','log','cyan','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','Logged\x20in','√\x20App\x20Code:\x20','23704mJEwzm','trim','green','Project\x20name\x20cannot\x20exceed\x2050\x20characters','√\x20Project\x20Name:\x20','√\x20Login\x20status:\x20','length','\x22\x20already\x20exists','226357sroxnj','599433uAcIzI'];a160_0x82da=function(){return _0x718d79;};return a160_0x82da();}import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';function a160_0x4540(_0x443bec,_0x5cb2a0){_0x443bec=_0x443bec-0x7e;const _0x82da43=a160_0x82da();let _0x4540d4=_0x82da43[_0x443bec];return _0x4540d4;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x54d553,_0x2b4c56,_0x4f60b1){const _0x7adcf1=a160_0x4540,_0x449a72=_0x7adcf1(0x8f),_0x2df05d=readConfig(),_0x20a1c5=typeof _0x2df05d['env']==='string'?_0x2df05d[_0x7adcf1(0x7e)]:undefined,_0x742eb5=await input({'message':_0x7adcf1(0x7f),'default':_0x449a72,'validate':_0x27af0a=>{const _0x3d62cf=_0x7adcf1,_0x373ecf=_0x27af0a[_0x3d62cf(0x86)]()||_0x449a72;if(_0x373ecf[_0x3d62cf(0x8b)]>0x32)return _0x3d62cf(0x88);const _0x26a6a8=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x373ecf&&!_0x26a6a8[_0x3d62cf(0x90)](_0x373ecf))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x180dea=a160_0x3aeb3b[_0x3d62cf(0x9a)](process['cwd'](),_0x373ecf);if(existsSync(_0x180dea))return _0x3d62cf(0x97)+_0x373ecf+_0x3d62cf(0x8c);return!![];}});console[_0x7adcf1(0x80)](a160_0x31a6d1[_0x7adcf1(0x87)](_0x7adcf1(0x89)+a160_0x31a6d1[_0x7adcf1(0x81)](_0x742eb5)));const _0x5d48a4=await selectSingleAppcode(_0x4f60b1);console['log'](a160_0x31a6d1[_0x7adcf1(0x87)](_0x7adcf1(0x84)+a160_0x31a6d1[_0x7adcf1(0x81)](_0x5d48a4||_0x7adcf1(0x92))));if(_0x5d48a4){const _0x2e58c4=await getIsSessionValid();if(!_0x2e58c4){const _0x1f5588=await confirm({'message':_0x7adcf1(0x82),'default':!![]});if(_0x1f5588){const _0x1e5f31=await authServer({'silent':!![]});console[_0x7adcf1(0x80)](a160_0x31a6d1[_0x7adcf1(0x87)](_0x7adcf1(0x8a)+a160_0x31a6d1[_0x7adcf1(0x81)](_0x1e5f31?_0x7adcf1(0x83):'Login\x20failed')));}else console[_0x7adcf1(0x80)](a160_0x31a6d1[_0x7adcf1(0x87)](_0x7adcf1(0x8a)+a160_0x31a6d1[_0x7adcf1(0x81)](_0x7adcf1(0x94))));}await _0x54d553({'projectName':_0x742eb5,'appCode':_0x5d48a4,'env':_0x2b4c56||_0x20a1c5||_0x7adcf1(0x96)});}else await _0x54d553({'projectName':_0x742eb5,'env':_0x2b4c56||_0x20a1c5||_0x7adcf1(0x96)});}
1
+ function a160_0x1915(){const _0x1e209a=['6820OvWJuW','test','env','cwd','production','length','green','2PzMceX','Skipped','log','cyan','817679OcDARg','Project\x20name:','√\x20App\x20Code:\x20','108708kUWGZr','my-app','267819hIzEpa','Not\x20set','494847PSGHDC','1919113ijBTmd','√\x20Login\x20status:\x20','\x22\x20already\x20exists','52PnFEOp','trim','√\x20Project\x20Name:\x20','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','20lecAVe','10361528dBYfxk','248065KOgQLv','150SQdgHM'];a160_0x1915=function(){return _0x1e209a;};return a160_0x1915();}(function(_0x24a6fa,_0x2b138f){const _0x1c5664=a160_0x53e5,_0x5c1889=_0x24a6fa();while(!![]){try{const _0x599d1c=parseInt(_0x1c5664(0x15c))/0x1*(-parseInt(_0x1c5664(0x158))/0x2)+parseInt(_0x1c5664(0x161))/0x3*(-parseInt(_0x1c5664(0x167))/0x4)+-parseInt(_0x1c5664(0x16d))/0x5*(parseInt(_0x1c5664(0x16e))/0x6)+-parseInt(_0x1c5664(0x164))/0x7+-parseInt(_0x1c5664(0x16c))/0x8+parseInt(_0x1c5664(0x163))/0x9*(-parseInt(_0x1c5664(0x16b))/0xa)+-parseInt(_0x1c5664(0x16f))/0xb*(-parseInt(_0x1c5664(0x15f))/0xc);if(_0x599d1c===_0x2b138f)break;else _0x5c1889['push'](_0x5c1889['shift']());}catch(_0x47be5b){_0x5c1889['push'](_0x5c1889['shift']());}}}(a160_0x1915,0xaf777));import{existsSync}from'node:fs';function a160_0x53e5(_0x57ba62,_0x183a3f){_0x57ba62=_0x57ba62-0x154;const _0x191537=a160_0x1915();let _0x53e546=_0x191537[_0x57ba62];return _0x53e546;}import a160_0x24685b from'node:path';import a160_0x742083 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x202633,_0x58093e,_0x48b37b){const _0x3d7da7=a160_0x53e5,_0x1aa9e2=_0x3d7da7(0x160),_0x19288c=readConfig(),_0x38fa11=typeof _0x19288c['env']==='string'?_0x19288c[_0x3d7da7(0x171)]:undefined,_0x508a05=await input({'message':_0x3d7da7(0x15d),'default':_0x1aa9e2,'validate':_0x288bb8=>{const _0x48b2ac=_0x3d7da7,_0x36717e=_0x288bb8[_0x48b2ac(0x168)]()||_0x1aa9e2;if(_0x36717e[_0x48b2ac(0x156)]>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x598398=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x36717e&&!_0x598398[_0x48b2ac(0x170)](_0x36717e))return _0x48b2ac(0x16a);const _0x2e8e64=a160_0x24685b['resolve'](process[_0x48b2ac(0x154)](),_0x36717e);if(existsSync(_0x2e8e64))return'Directory\x20\x22'+_0x36717e+_0x48b2ac(0x166);return!![];}});console['log'](a160_0x742083[_0x3d7da7(0x157)](_0x3d7da7(0x169)+a160_0x742083[_0x3d7da7(0x15b)](_0x508a05)));const _0x2f5791=await selectSingleAppcode(_0x48b37b);console[_0x3d7da7(0x15a)](a160_0x742083['green'](_0x3d7da7(0x15e)+a160_0x742083['cyan'](_0x2f5791||_0x3d7da7(0x162))));if(_0x2f5791){const _0x158634=await getIsSessionValid();if(!_0x158634){const _0x341c61=await confirm({'message':'No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','default':!![]});if(_0x341c61){const _0x5ec79d=await authServer({'silent':!![]});console[_0x3d7da7(0x15a)](a160_0x742083[_0x3d7da7(0x157)](_0x3d7da7(0x165)+a160_0x742083[_0x3d7da7(0x15b)](_0x5ec79d?'Logged\x20in':'Login\x20failed')));}else console[_0x3d7da7(0x15a)](a160_0x742083[_0x3d7da7(0x157)](_0x3d7da7(0x165)+a160_0x742083[_0x3d7da7(0x15b)](_0x3d7da7(0x159))));}await _0x202633({'projectName':_0x508a05,'appCode':_0x2f5791,'env':_0x58093e||_0x38fa11||_0x3d7da7(0x155)});}else await _0x202633({'projectName':_0x508a05,'env':_0x58093e||_0x38fa11||_0x3d7da7(0x155)});}
@@ -1 +1 @@
1
- function a161_0x4a69(){const _0x4e6cdf=['140tmuGtd','12701223KlrUYh','toFixed','248796orkCSv','133jBnlkc','now','11352416XjtyWu','47802sirYKs','1165010KrpSYN','3315385tlhKMI','replace','20ggDOyt','856506oUpqLK'];a161_0x4a69=function(){return _0x4e6cdf;};return a161_0x4a69();}function a161_0x224a(_0x13288b,_0x28833f){_0x13288b=_0x13288b-0x16d;const _0x4a69bb=a161_0x4a69();let _0x224a19=_0x4a69bb[_0x13288b];return _0x224a19;}(function(_0x522321,_0x3e6109){const _0x35253c=a161_0x224a,_0x4264a2=_0x522321();while(!![]){try{const _0x4d05a4=-parseInt(_0x35253c(0x175))/0x1+-parseInt(_0x35253c(0x171))/0x2+parseInt(_0x35253c(0x170))/0x3*(-parseInt(_0x35253c(0x176))/0x4)+-parseInt(_0x35253c(0x172))/0x5+-parseInt(_0x35253c(0x179))/0x6*(parseInt(_0x35253c(0x16d))/0x7)+parseInt(_0x35253c(0x16f))/0x8+-parseInt(_0x35253c(0x177))/0x9*(-parseInt(_0x35253c(0x174))/0xa);if(_0x4d05a4===_0x3e6109)break;else _0x4264a2['push'](_0x4264a2['shift']());}catch(_0x5cd9d6){_0x4264a2['push'](_0x4264a2['shift']());}}}(a161_0x4a69,0xc1d3a));export function formatElapsed(_0x1b4962){const _0xf87a44=a161_0x224a,_0x3a55fb=Date[_0xf87a44(0x16e)]()-_0x1b4962;if(_0x3a55fb<0x3e8)return _0x3a55fb+'ms';const _0x245a81=(_0x3a55fb/0x3e8)[_0xf87a44(0x178)](0x2),_0x5be0e9=_0x245a81[_0xf87a44(0x173)](/\.?0+$/u,'');return _0x5be0e9+'s';}
1
+ (function(_0x16b55a,_0x413631){const _0x20ce77=a161_0x2415,_0x4d3887=_0x16b55a();while(!![]){try{const _0xad953e=parseInt(_0x20ce77(0x175))/0x1+parseInt(_0x20ce77(0x173))/0x2*(-parseInt(_0x20ce77(0x174))/0x3)+-parseInt(_0x20ce77(0x172))/0x4*(parseInt(_0x20ce77(0x177))/0x5)+-parseInt(_0x20ce77(0x16f))/0x6+-parseInt(_0x20ce77(0x16e))/0x7*(-parseInt(_0x20ce77(0x171))/0x8)+-parseInt(_0x20ce77(0x178))/0x9+parseInt(_0x20ce77(0x176))/0xa;if(_0xad953e===_0x413631)break;else _0x4d3887['push'](_0x4d3887['shift']());}catch(_0x858d1c){_0x4d3887['push'](_0x4d3887['shift']());}}}(a161_0x2271,0x673ab));function a161_0x2415(_0x28156f,_0x49a79b){_0x28156f=_0x28156f-0x16e;const _0x2271ce=a161_0x2271();let _0x241553=_0x2271ce[_0x28156f];return _0x241553;}function a161_0x2271(){const _0x44d04a=['replace','93000ATlTeF','258708bvmmFn','2458eYzTNZ','1983vXWaGN','269826DEemaA','28461430UTSeZb','55CLjHfl','6471873ZNDajt','toFixed','now','63CYURak','3329124SGwfHR'];a161_0x2271=function(){return _0x44d04a;};return a161_0x2271();}export function formatElapsed(_0x41dda2){const _0x1b132d=a161_0x2415,_0x75379f=Date[_0x1b132d(0x17a)]()-_0x41dda2;if(_0x75379f<0x3e8)return _0x75379f+'ms';const _0x2dc89f=(_0x75379f/0x3e8)[_0x1b132d(0x179)](0x2),_0x30a30b=_0x2dc89f[_0x1b132d(0x170)](/\.?0+$/u,'');return _0x30a30b+'s';}
@@ -1 +1 @@
1
- (function(_0x3ba52f,_0x31a04a){const _0x28bedb=a162_0xa06d,_0x408121=_0x3ba52f();while(!![]){try{const _0x3d9abc=-parseInt(_0x28bedb(0x117))/0x1+parseInt(_0x28bedb(0x101))/0x2+parseInt(_0x28bedb(0xed))/0x3*(parseInt(_0x28bedb(0xe2))/0x4)+parseInt(_0x28bedb(0x12a))/0x5*(parseInt(_0x28bedb(0x126))/0x6)+-parseInt(_0x28bedb(0xe9))/0x7+parseInt(_0x28bedb(0xfd))/0x8+-parseInt(_0x28bedb(0xdb))/0x9*(-parseInt(_0x28bedb(0xf7))/0xa);if(_0x3d9abc===_0x31a04a)break;else _0x408121['push'](_0x408121['shift']());}catch(_0x21000b){_0x408121['push'](_0x408121['shift']());}}}(a162_0x288e,0xc0046));import a162_0x465dd8 from'path';import a162_0x1dea26 from'fs';import a162_0x412a71 from'chalk';import a162_0x4183f6 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';function a162_0xa06d(_0x2ecc0e,_0x511477){_0x2ecc0e=_0x2ecc0e-0xd4;const _0x288e85=a162_0x288e();let _0xa06db6=_0x288e85[_0x2ecc0e];return _0xa06db6;}import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';function a162_0x288e(){const _0x5d3f42=['defaultApp','log','rmSync','207eTxHJp','constants','\x20\x201.\x20Start\x20project:\x20','readFileSync','更新\x20package.json\x20失败','√\x20Configuration\x20file\x20created,\x20Apps:\x20','utf8','20NNMLoj','Project\x20directory\x20','Install\x20dependencies','needsUpgrade','√\x20package.json\x20updated:\x20name=','setLogPath','gray','7779352SzqiNm','projectName','\x20already\x20exists','appCode','177663vizRvb','Project\x20name:\x20','开始创建项目:\x20','join','stableVersion','projectCode','belowMinimum','accessSync','writeFileSync','currentVersion','43930sWpQyM','\x20dataset(s),\x20generated\x20','env','cyan','existsSync','CLI\x20版本检查','5026336JIzsaF','\x20\x202.\x20Pull\x20API\x20configuration:\x20','\x20model(s)','\x20run\x20start','3048926qkvkxK','...','更新\x20package.json\x20name','toLocaleString','API\x20配置拉取异常','🚀\x20Next\x20Steps:','info','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','W_OK','1.0.0','modelCount','create','配置应用AppCode失败','string','description','Format\x20code','cwd','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','apps','message','package.json','项目创建失败:\x20','824524HerDFL','fail','minimumVersion','\x20config\x20set\x20appcode\x20<app-code>\x27','length','error','version','parse','production','cd\x20','success','项目创建完成:\x20','√\x20Pulled\x20','\x20√\x20','resolve','114uZUxrf','test','cookie','*\x20Configuring\x20AppCode\x20for\x20project\x20','45385QvHKsp','name','\x20&&\x20','green','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','repeat','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','bold','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'];a162_0x288e=function(){return _0x5d3f42;};return a162_0x288e();}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(_0x29d34b){const _0x4ad853=a162_0xa06d,_0x43a351=await checkCliVersion();(_0x43a351['needsUpgrade']||_0x43a351[_0x4ad853(0xf3)])&&(printCliUpgradeWarning(_0x43a351),assertCliVersionSupported(_0x43a351),logger[_0x4ad853(0x107)](_0x4ad853(0x10c),_0x4ad853(0xfc),{'currentVersion':_0x43a351[_0x4ad853(0xf6)],'stableVersion':_0x43a351[_0x4ad853(0xf1)],'minimumVersion':_0x43a351[_0x4ad853(0x119)],'needsUpgrade':_0x43a351[_0x4ad853(0xe5)],'belowMinimum':_0x43a351[_0x4ad853(0xf3)]}));if(_0x29d34b['projectCode']&&_0x29d34b[_0x4ad853(0xec)])await runCreate({'projectName':_0x29d34b[_0x4ad853(0xf2)],'appCode':_0x29d34b[_0x4ad853(0xec)],'env':_0x29d34b[_0x4ad853(0xf9)]},_0x29d34b);else{if(_0x29d34b[_0x4ad853(0xf2)]){const _0x4dfb94=await selectSingleAppcode(_0x29d34b[_0x4ad853(0x128)]);await runCreate({'projectName':_0x29d34b[_0x4ad853(0xf2)],'appCode':_0x4dfb94||undefined,'env':_0x29d34b['env']},_0x29d34b);}else await guidedCreateProject(_0x2ef762=>runCreate(_0x2ef762,_0x29d34b),_0x29d34b['env'],_0x29d34b[_0x4ad853(0x128)]);}}async function runCreate(_0x1ea9ad,_0x1a0842){const _0x437afc=a162_0xa06d;if(!_0x1ea9ad[_0x437afc(0xea)]||_0x1ea9ad[_0x437afc(0xea)]['trim']()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');const _0x56acff=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x56acff[_0x437afc(0x127)](_0x1ea9ad[_0x437afc(0xea)]))throw new Error(_0x437afc(0x112));if(_0x1ea9ad[_0x437afc(0xea)][_0x437afc(0x11b)]>0x64)throw new Error(_0x437afc(0x12e));const _0x3434d4=a162_0x465dd8['resolve'](process['cwd'](),_0x1ea9ad[_0x437afc(0xea)]);if(a162_0x1dea26['existsSync'](_0x3434d4))throw new Error(_0x437afc(0xe3)+_0x1ea9ad[_0x437afc(0xea)]+_0x437afc(0xeb));try{a162_0x1dea26[_0x437afc(0xf4)](a162_0x465dd8['dirname'](_0x3434d4),a162_0x1dea26[_0x437afc(0xdc)][_0x437afc(0x109)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x437afc(0xe7)](_0x3434d4),logger['info'](_0x437afc(0x10c),_0x437afc(0xef)+_0x1ea9ad['projectName'],{'projectDir':_0x3434d4,'appCode':_0x1ea9ad[_0x437afc(0xec)]}),console['log'](),console[_0x437afc(0xd9)](a162_0x412a71[_0x437afc(0x12d)](_0x437afc(0x124))+_0x437afc(0xee)+a162_0x412a71[_0x437afc(0x12d)](_0x1ea9ad[_0x437afc(0xea)])+(_0x1ea9ad[_0x437afc(0xec)]?'\x20|\x20AppCode:\x20'+a162_0x412a71[_0x437afc(0xfa)](_0x1ea9ad[_0x437afc(0xec)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x1ea9ad[_0x437afc(0xea)])),await updatePackageJsonName(_0x1ea9ad['projectName']),await runTask(_0x437afc(0xe4),()=>installDependencies(_0x1ea9ad[_0x437afc(0xea)])),await runTask(_0x437afc(0x110),()=>formatProjectCode(_0x1ea9ad[_0x437afc(0xea)])),await configureAppCode(_0x1ea9ad[_0x437afc(0xea)],_0x1ea9ad[_0x437afc(0xec)]||'',_0x1ea9ad[_0x437afc(0xf9)]);let _0x5e31fb=![];if(_0x1ea9ad[_0x437afc(0xec)]){console['log']('*\x20Pulling\x20API\x20configuration...');const _0x37410b=process[_0x437afc(0x111)]();try{process['chdir'](_0x3434d4);const _0x1b297e=_0x1ea9ad[_0x437afc(0xf9)]||_0x437afc(0x11f);initEnv(_0x1b297e);const {configArray:_0x2cc81f}=await fetchModelList(_0x1ea9ad[_0x437afc(0xec)],_0x1a0842['cookie']||''),_0xde02a5=DEFAULT_API_DIR,_0x4bb1b9=await generateApiFile(_0x2cc81f,'',_0x1ea9ad[_0x437afc(0xec)],!![],_0x1b297e,_0xde02a5);console[_0x437afc(0xd9)](_0x437afc(0x123)+_0x2cc81f[_0x437afc(0x11b)]+_0x437afc(0xf8)+_0x4bb1b9[_0x437afc(0x10b)]+_0x437afc(0xff)),logger[_0x437afc(0x107)](_0x437afc(0x10c),'API\x20configuration\x20pulled:\x20'+_0x1ea9ad[_0x437afc(0xec)]);}catch(_0x3ae1a8){_0x5e31fb=!![],console[_0x437afc(0xd9)](_0x437afc(0xd5)),logger['warn'](_0x437afc(0x10c),_0x437afc(0x105),{'error':_0x3ae1a8 instanceof Error?_0x3ae1a8[_0x437afc(0x114)]:String(_0x3ae1a8)});}finally{process['chdir'](_0x37410b);}}logger[_0x437afc(0x121)]('create',_0x437afc(0x122)+_0x1ea9ad[_0x437afc(0xea)]),console['log'](),console['log'](a162_0x412a71[_0x437afc(0x12d)]('─'[_0x437afc(0xd4)](0x3c))),console[_0x437afc(0xd9)](a162_0x412a71[_0x437afc(0xfa)]['bold'](_0x437afc(0x106))),console[_0x437afc(0xd9)](),console[_0x437afc(0xd9)](_0x437afc(0xdd)+a162_0x412a71[_0x437afc(0xfa)][_0x437afc(0xd6)](_0x437afc(0x120)+_0x1ea9ad['projectName']+_0x437afc(0x12c)+CLI_BIN_NAME+_0x437afc(0x100))),_0x5e31fb&&console[_0x437afc(0xd9)](_0x437afc(0xfe)+a162_0x412a71['cyan'][_0x437afc(0xd6)](CLI_BIN_NAME+'\x20api\x20pull')),console[_0x437afc(0xd9)](a162_0x412a71[_0x437afc(0x12d)]('─'['repeat'](0x3c)));}catch(_0x39646a){logger['error']('create',_0x437afc(0x116)+_0x1ea9ad[_0x437afc(0xea)],{'error':_0x39646a instanceof Error?_0x39646a[_0x437afc(0x114)]:String(_0x39646a)});try{a162_0x1dea26[_0x437afc(0xfb)](_0x3434d4)&&(console[_0x437afc(0xd9)](_0x437afc(0xd7)+_0x3434d4),a162_0x1dea26[_0x437afc(0xda)](_0x3434d4,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x437afc(0x10c),'清理项目目录失败:\x20'+_0x3434d4);}throw _0x39646a;}}async function runTask(_0x2c213e,_0x259987){const _0x96836c=a162_0xa06d,_0x149085=a162_0x4183f6(_0x2c213e+_0x96836c(0x102))['start']();try{const _0x38bc81=await _0x259987();_0x149085['stop'](),console[_0x96836c(0xd9)](''+a162_0x412a71[_0x96836c(0x12d)](_0x96836c(0x124))+_0x2c213e+'\x20'+a162_0x412a71[_0x96836c(0xe8)]('['+_0x38bc81+']'));}catch(_0x7804a9){_0x149085[_0x96836c(0x118)](_0x2c213e);throw _0x7804a9;}}async function updatePackageJsonName(_0x46c5d8){const _0x24cda6=a162_0xa06d,_0xa717af=a162_0x465dd8[_0x24cda6(0x125)](process[_0x24cda6(0x111)](),_0x46c5d8),_0x347b47=a162_0x465dd8[_0x24cda6(0xf0)](_0xa717af,_0x24cda6(0x115));try{console[_0x24cda6(0xd9)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x3f7ffc=getRabetbaseCliPackageRoot(),_0x208f00=a162_0x465dd8[_0x24cda6(0xf0)](_0x3f7ffc,'package.json');let _0x3b81bb='1.0.0';try{const _0x1b345b=JSON['parse'](a162_0x1dea26[_0x24cda6(0xde)](_0x208f00,'utf8'));_0x3b81bb=_0x1b345b['version']||_0x24cda6(0x10a);}catch{}const _0x143671=a162_0x1dea26['readFileSync'](_0x347b47,_0x24cda6(0xe1)),_0x1497c8=JSON[_0x24cda6(0x11e)](_0x143671);_0x1497c8[_0x24cda6(0x12b)]=_0x46c5d8,_0x1497c8[_0x24cda6(0x10f)]=_0x46c5d8+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x3b81bb,a162_0x1dea26[_0x24cda6(0xf5)](_0x347b47,JSON['stringify'](_0x1497c8,null,0x2)+'\x0a','utf8'),console['log'](_0x24cda6(0xe6)+_0x46c5d8),logger[_0x24cda6(0x107)](_0x24cda6(0x10c),_0x24cda6(0x103));}catch(_0x1df4ae){logger[_0x24cda6(0x11c)](_0x24cda6(0x10c),_0x24cda6(0xdf));throw _0x1df4ae;}}async function configureAppCode(_0x333b16,_0x2eda46,_0x3dbd49){const _0x5a6040=a162_0xa06d,_0x2e9e99=a162_0x465dd8[_0x5a6040(0x125)](process['cwd'](),_0x333b16),_0x3a3b1e=a162_0x465dd8[_0x5a6040(0xf0)](_0x2e9e99,NEW_CONFIG_NAME);try{_0x2eda46?console[_0x5a6040(0xd9)](_0x5a6040(0x129)+_0x333b16+':\x20'+_0x2eda46):console[_0x5a6040(0xd9)](_0x5a6040(0x108)+_0x333b16);const _0x37c5e9=getRabetbaseCliPackageRoot(),_0x1acfc8=a162_0x465dd8['join'](_0x37c5e9,'package.json');let _0x6a5443='1.0.0';try{const _0xbfd75d=JSON[_0x5a6040(0x11e)](a162_0x1dea26['readFileSync'](_0x1acfc8,_0x5a6040(0xe1)));_0x6a5443=_0xbfd75d[_0x5a6040(0x11d)]||_0x5a6040(0x10a);}catch{}const _0x1b6025=readConfig(),_0x5c9dd1=typeof _0x1b6025['env']===_0x5a6040(0x10e)?_0x1b6025[_0x5a6040(0xf9)]:undefined,_0x13581a={};for(const _0x3e7306 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1b6025[_0x3e7306]!=null)_0x13581a[_0x3e7306]=_0x1b6025[_0x3e7306];}const _0x12e3ad=buildCanonicalProjectConfig(_0x13581a,{'appCodes':_0x2eda46?[_0x2eda46]:[],'env':_0x3dbd49||_0x5c9dd1||'production','metadata':{'createdAt':new Date()[_0x5a6040(0x104)](),'version':_0x6a5443}});writeConfigFile(_0x3a3b1e,_0x12e3ad),_0x2eda46?console[_0x5a6040(0xd9)](_0x5a6040(0xe0)+Object['keys'](_0x12e3ad[_0x5a6040(0x113)]||{})[_0x5a6040(0xf0)](',\x20')+'\x20|\x20Default:\x20'+_0x12e3ad[_0x5a6040(0xd8)]):console[_0x5a6040(0xd9)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x5a6040(0x11a)),logger[_0x5a6040(0x107)](_0x5a6040(0x10c),'配置应用AppCode:\x20'+_0x2eda46);}catch(_0x58606e){logger[_0x5a6040(0x11c)]('create',_0x5a6040(0x10d));}}
1
+ (function(_0x816696,_0x1a31f6){const _0x480b93=a162_0x171d,_0x567cf6=_0x816696();while(!![]){try{const _0xb21099=parseInt(_0x480b93(0xf3))/0x1*(-parseInt(_0x480b93(0xaa))/0x2)+-parseInt(_0x480b93(0xbf))/0x3+-parseInt(_0x480b93(0xf7))/0x4*(-parseInt(_0x480b93(0xcd))/0x5)+-parseInt(_0x480b93(0xad))/0x6+parseInt(_0x480b93(0xa4))/0x7+-parseInt(_0x480b93(0xd8))/0x8+-parseInt(_0x480b93(0xb9))/0x9*(-parseInt(_0x480b93(0xf6))/0xa);if(_0xb21099===_0x1a31f6)break;else _0x567cf6['push'](_0x567cf6['shift']());}catch(_0x387379){_0x567cf6['push'](_0x567cf6['shift']());}}}(a162_0x1f18,0xebff0));import a162_0x49dfcf from'path';import a162_0x353dac from'fs';import a162_0x13770a from'chalk';import a162_0x23c772 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';function a162_0x171d(_0x55b119,_0xa3483a){_0x55b119=_0x55b119-0xa3;const _0x1f18a5=a162_0x1f18();let _0x171db7=_0x1f18a5[_0x55b119];return _0x171db7;}import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';function a162_0x1f18(){const _0x497c58=['setLogPath','\x20model(s)','resolve','cyan','projectCode','projectName','cwd','cookie','message','W_OK','log','toLocaleString','API\x20configuration\x20pulled:\x20','Format\x20code','parse','Project\x20directory\x20','chdir','项目创建失败:\x20','清理项目目录失败:\x20','package.json','\x20Generated\x20by\x20rabetbase\x20cli\x20','428UhnBIi','apps','warn','1734680VMbAwd','5120156HdfEhP','create','*\x20Configuring\x20AppCode\x20for\x20project\x20','🚀\x20Next\x20Steps:','writeFileSync','belowMinimum','repeat','info','7664685CPoupy','accessSync','bold','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','配置应用AppCode:\x20','name','8370VBesIc','start','existsSync','7850730vXVlvD','test','length','join','env','Project\x20name:\x20','\x20already\x20exists','green','constants','\x20|\x20AppCode:\x20','更新\x20package.json\x20name','stableVersion','216QcrQdq','Project\x20name\x20cannot\x20be\x20empty','1.0.0','defaultApp','Install\x20dependencies','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','2321226vYKDnp','readFileSync','开始创建项目:\x20','string','\x20√\x20','\x20api\x20pull','dirname','\x20|\x20Default:\x20','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','utf8','项目创建完成:\x20','description','stringify','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','5WRFVCH','keys','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','error','√\x20Configuration\x20file\x20created,\x20Apps:\x20','配置应用AppCode失败','√\x20Pulled\x20','needsUpgrade','trim','version','13585672qcubTs','gray','更新\x20package.json\x20失败','appCode','stop','\x20\x201.\x20Start\x20project:\x20'];a162_0x1f18=function(){return _0x497c58;};return a162_0x1f18();}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(_0x5f30b2){const _0xeb504=a162_0x171d,_0x56a2e8=await checkCliVersion();(_0x56a2e8[_0xeb504(0xd5)]||_0x56a2e8[_0xeb504(0xfc)])&&(printCliUpgradeWarning(_0x56a2e8),assertCliVersionSupported(_0x56a2e8),logger[_0xeb504(0xa3)]('create','CLI\x20版本检查',{'currentVersion':_0x56a2e8['currentVersion'],'stableVersion':_0x56a2e8[_0xeb504(0xb8)],'minimumVersion':_0x56a2e8['minimumVersion'],'needsUpgrade':_0x56a2e8[_0xeb504(0xd5)],'belowMinimum':_0x56a2e8[_0xeb504(0xfc)]}));if(_0x5f30b2[_0xeb504(0xe2)]&&_0x5f30b2['appCode'])await runCreate({'projectName':_0x5f30b2[_0xeb504(0xe2)],'appCode':_0x5f30b2[_0xeb504(0xdb)],'env':_0x5f30b2[_0xeb504(0xb1)]},_0x5f30b2);else{if(_0x5f30b2['projectCode']){const _0x245267=await selectSingleAppcode(_0x5f30b2[_0xeb504(0xe5)]);await runCreate({'projectName':_0x5f30b2[_0xeb504(0xe2)],'appCode':_0x245267||undefined,'env':_0x5f30b2[_0xeb504(0xb1)]},_0x5f30b2);}else await guidedCreateProject(_0xc83989=>runCreate(_0xc83989,_0x5f30b2),_0x5f30b2[_0xeb504(0xb1)],_0x5f30b2['cookie']);}}async function runCreate(_0x1dacb5,_0x528ae9){const _0x33d630=a162_0x171d;if(!_0x1dacb5['projectName']||_0x1dacb5['projectName'][_0x33d630(0xd6)]()==='')throw new Error(_0x33d630(0xba));const _0x3fcb63=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x3fcb63[_0x33d630(0xae)](_0x1dacb5['projectName']))throw new Error(_0x33d630(0xd0));if(_0x1dacb5[_0x33d630(0xe3)][_0x33d630(0xaf)]>0x64)throw new Error(_0x33d630(0xc7));const _0x2b8e4d=a162_0x49dfcf[_0x33d630(0xe0)](process['cwd'](),_0x1dacb5['projectName']);if(a162_0x353dac[_0x33d630(0xac)](_0x2b8e4d))throw new Error(_0x33d630(0xed)+_0x1dacb5['projectName']+_0x33d630(0xb3));try{a162_0x353dac[_0x33d630(0xa5)](a162_0x49dfcf[_0x33d630(0xc5)](_0x2b8e4d),a162_0x353dac[_0x33d630(0xb5)][_0x33d630(0xe7)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x33d630(0xde)](_0x2b8e4d),logger['info'](_0x33d630(0xf8),_0x33d630(0xc1)+_0x1dacb5[_0x33d630(0xe3)],{'projectDir':_0x2b8e4d,'appCode':_0x1dacb5[_0x33d630(0xdb)]}),console[_0x33d630(0xe8)](),console[_0x33d630(0xe8)](a162_0x13770a[_0x33d630(0xb4)](_0x33d630(0xc3))+_0x33d630(0xb2)+a162_0x13770a[_0x33d630(0xb4)](_0x1dacb5['projectName'])+(_0x1dacb5[_0x33d630(0xdb)]?_0x33d630(0xb6)+a162_0x13770a['cyan'](_0x1dacb5[_0x33d630(0xdb)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x1dacb5[_0x33d630(0xe3)])),await updatePackageJsonName(_0x1dacb5[_0x33d630(0xe3)]),await runTask(_0x33d630(0xbd),()=>installDependencies(_0x1dacb5[_0x33d630(0xe3)])),await runTask(_0x33d630(0xeb),()=>formatProjectCode(_0x1dacb5[_0x33d630(0xe3)])),await configureAppCode(_0x1dacb5[_0x33d630(0xe3)],_0x1dacb5[_0x33d630(0xdb)]||'',_0x1dacb5[_0x33d630(0xb1)]);let _0x54b3ac=![];if(_0x1dacb5[_0x33d630(0xdb)]){console[_0x33d630(0xe8)]('*\x20Pulling\x20API\x20configuration...');const _0x3acc63=process[_0x33d630(0xe4)]();try{process[_0x33d630(0xee)](_0x2b8e4d);const _0x544872=_0x1dacb5['env']||'production';initEnv(_0x544872);const {configArray:_0x265e67}=await fetchModelList(_0x1dacb5[_0x33d630(0xdb)],_0x528ae9[_0x33d630(0xe5)]||''),_0x4035f8=DEFAULT_API_DIR,_0x3ee977=await generateApiFile(_0x265e67,'',_0x1dacb5[_0x33d630(0xdb)],!![],_0x544872,_0x4035f8);console['log'](_0x33d630(0xd4)+_0x265e67['length']+'\x20dataset(s),\x20generated\x20'+_0x3ee977['modelCount']+_0x33d630(0xdf)),logger['info'](_0x33d630(0xf8),_0x33d630(0xea)+_0x1dacb5['appCode']);}catch(_0x58f098){_0x54b3ac=!![],console[_0x33d630(0xe8)](_0x33d630(0xa7)),logger[_0x33d630(0xf5)]('create','API\x20配置拉取异常',{'error':_0x58f098 instanceof Error?_0x58f098[_0x33d630(0xe6)]:String(_0x58f098)});}finally{process[_0x33d630(0xee)](_0x3acc63);}}logger['success'](_0x33d630(0xf8),_0x33d630(0xc9)+_0x1dacb5[_0x33d630(0xe3)]),console[_0x33d630(0xe8)](),console[_0x33d630(0xe8)](a162_0x13770a[_0x33d630(0xb4)]('─'[_0x33d630(0xfd)](0x3c))),console[_0x33d630(0xe8)](a162_0x13770a[_0x33d630(0xe1)][_0x33d630(0xa6)](_0x33d630(0xfa))),console[_0x33d630(0xe8)](),console[_0x33d630(0xe8)](_0x33d630(0xdd)+a162_0x13770a['cyan'][_0x33d630(0xa6)]('cd\x20'+_0x1dacb5[_0x33d630(0xe3)]+'\x20&&\x20'+CLI_BIN_NAME+'\x20run\x20start')),_0x54b3ac&&console['log']('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a162_0x13770a[_0x33d630(0xe1)][_0x33d630(0xa6)](CLI_BIN_NAME+_0x33d630(0xc4))),console[_0x33d630(0xe8)](a162_0x13770a[_0x33d630(0xb4)]('─'[_0x33d630(0xfd)](0x3c)));}catch(_0x114c6e){logger[_0x33d630(0xd1)](_0x33d630(0xf8),_0x33d630(0xef)+_0x1dacb5['projectName'],{'error':_0x114c6e instanceof Error?_0x114c6e[_0x33d630(0xe6)]:String(_0x114c6e)});try{a162_0x353dac[_0x33d630(0xac)](_0x2b8e4d)&&(console[_0x33d630(0xe8)](_0x33d630(0xcf)+_0x2b8e4d),a162_0x353dac['rmSync'](_0x2b8e4d,{'recursive':!![],'force':!![]}));}catch{logger[_0x33d630(0xf5)](_0x33d630(0xf8),_0x33d630(0xf0)+_0x2b8e4d);}throw _0x114c6e;}}async function runTask(_0x27e955,_0x322a03){const _0x49b1a7=a162_0x171d,_0x5bab8d=a162_0x23c772(_0x27e955+'...')[_0x49b1a7(0xab)]();try{const _0xac0dca=await _0x322a03();_0x5bab8d[_0x49b1a7(0xdc)](),console[_0x49b1a7(0xe8)](''+a162_0x13770a[_0x49b1a7(0xb4)]('\x20√\x20')+_0x27e955+'\x20'+a162_0x13770a[_0x49b1a7(0xd9)]('['+_0xac0dca+']'));}catch(_0x245e9e){_0x5bab8d['fail'](_0x27e955);throw _0x245e9e;}}async function updatePackageJsonName(_0x2cc262){const _0x4d033a=a162_0x171d,_0xc91c23=a162_0x49dfcf[_0x4d033a(0xe0)](process[_0x4d033a(0xe4)](),_0x2cc262),_0x1d3ae7=a162_0x49dfcf[_0x4d033a(0xb0)](_0xc91c23,_0x4d033a(0xf1));try{console[_0x4d033a(0xe8)](_0x4d033a(0xcc));const _0x326868=getRabetbaseCliPackageRoot(),_0x697db3=a162_0x49dfcf['join'](_0x326868,_0x4d033a(0xf1));let _0x7a5053=_0x4d033a(0xbb);try{const _0xa23fb3=JSON['parse'](a162_0x353dac[_0x4d033a(0xc0)](_0x697db3,_0x4d033a(0xc8)));_0x7a5053=_0xa23fb3['version']||_0x4d033a(0xbb);}catch{}const _0xb78976=a162_0x353dac[_0x4d033a(0xc0)](_0x1d3ae7,'utf8'),_0x554eeb=JSON[_0x4d033a(0xec)](_0xb78976);_0x554eeb[_0x4d033a(0xa9)]=_0x2cc262,_0x554eeb[_0x4d033a(0xca)]=_0x2cc262+_0x4d033a(0xf2)+_0x7a5053,a162_0x353dac[_0x4d033a(0xfb)](_0x1d3ae7,JSON[_0x4d033a(0xcb)](_0x554eeb,null,0x2)+'\x0a','utf8'),console[_0x4d033a(0xe8)]('√\x20package.json\x20updated:\x20name='+_0x2cc262),logger[_0x4d033a(0xa3)](_0x4d033a(0xf8),_0x4d033a(0xb7));}catch(_0x1d715f){logger['error']('create',_0x4d033a(0xda));throw _0x1d715f;}}async function configureAppCode(_0x5cf76d,_0x1bde6,_0x25e71a){const _0x1ad105=a162_0x171d,_0x445461=a162_0x49dfcf[_0x1ad105(0xe0)](process[_0x1ad105(0xe4)](),_0x5cf76d),_0x3e82cf=a162_0x49dfcf[_0x1ad105(0xb0)](_0x445461,NEW_CONFIG_NAME);try{_0x1bde6?console[_0x1ad105(0xe8)](_0x1ad105(0xf9)+_0x5cf76d+':\x20'+_0x1bde6):console['log']('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x5cf76d);const _0xaa8069=getRabetbaseCliPackageRoot(),_0x763eee=a162_0x49dfcf[_0x1ad105(0xb0)](_0xaa8069,_0x1ad105(0xf1));let _0x605b8f=_0x1ad105(0xbb);try{const _0x212bcd=JSON['parse'](a162_0x353dac['readFileSync'](_0x763eee,_0x1ad105(0xc8)));_0x605b8f=_0x212bcd[_0x1ad105(0xd7)]||_0x1ad105(0xbb);}catch{}const _0x2b37a9=readConfig(),_0x424adf=typeof _0x2b37a9['env']===_0x1ad105(0xc2)?_0x2b37a9[_0x1ad105(0xb1)]:undefined,_0x264446={};for(const _0x39328f of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x2b37a9[_0x39328f]!=null)_0x264446[_0x39328f]=_0x2b37a9[_0x39328f];}const _0x40f0e7=buildCanonicalProjectConfig(_0x264446,{'appCodes':_0x1bde6?[_0x1bde6]:[],'env':_0x25e71a||_0x424adf||'production','metadata':{'createdAt':new Date()[_0x1ad105(0xe9)](),'version':_0x605b8f}});writeConfigFile(_0x3e82cf,_0x40f0e7),_0x1bde6?console[_0x1ad105(0xe8)](_0x1ad105(0xd2)+Object[_0x1ad105(0xce)](_0x40f0e7[_0x1ad105(0xf4)]||{})['join'](',\x20')+_0x1ad105(0xc6)+_0x40f0e7[_0x1ad105(0xbc)]):console[_0x1ad105(0xe8)](_0x1ad105(0xbe)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x1ad105(0xa3)]('create',_0x1ad105(0xa8)+_0x1bde6);}catch(_0x58d522){logger['error'](_0x1ad105(0xf8),_0x1ad105(0xd3));}}
@@ -1 +1 @@
1
- function a163_0x1e37(_0x10f88a,_0x209850){_0x10f88a=_0x10f88a-0x9f;const _0x3c1e6f=a163_0x3c1e();let _0x1e378c=_0x3c1e6f[_0x10f88a];return _0x1e378c;}(function(_0x4dc408,_0x323cee){const _0xbd419f=a163_0x1e37,_0x386ab4=_0x4dc408();while(!![]){try{const _0x4f66fd=parseInt(_0xbd419f(0xb3))/0x1+-parseInt(_0xbd419f(0xc4))/0x2*(-parseInt(_0xbd419f(0xce))/0x3)+-parseInt(_0xbd419f(0xcb))/0x4+parseInt(_0xbd419f(0xa2))/0x5*(parseInt(_0xbd419f(0xb7))/0x6)+parseInt(_0xbd419f(0xd3))/0x7+parseInt(_0xbd419f(0xd4))/0x8*(-parseInt(_0xbd419f(0xd0))/0x9)+-parseInt(_0xbd419f(0xa8))/0xa*(parseInt(_0xbd419f(0xba))/0xb);if(_0x4f66fd===_0x323cee)break;else _0x386ab4['push'](_0x386ab4['shift']());}catch(_0x2660df){_0x386ab4['push'](_0x386ab4['shift']());}}}(a163_0x3c1e,0xc10fb));import a163_0x729ebe from'path';import a163_0x5832af from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';function a163_0x3c1e(){const _0xb29d2f=['\x20\x20√\x20Pulled\x20','\x22\x20already\x20exists.','ignore','stringify','utf-8','trim','509336XzquOY','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','needsUpgrade','dirname','log','production','package.json','4021832gIByqP','*\x20Creating\x20project\x20','join','15cRzArR','\x20\x20Pulling\x20API\x20configuration...','5607SJekbF','\x0a\x20\x20cd\x20','\x20dataset(s),\x20generated\x20','8046969qHFvAe','15096KZASON','Use\x20a\x20different\x20project\x20name.','length','W_OK','1385QDZOgR','cwd','\x20\x20√\x20Code\x20formatted','Project\x20directory\x20\x22','parse','bun\x20run\x20format','50HGLLaD','npm','bun','string','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','chdir','env','bun\x20--version','\x20\x20√\x20Configuration\x20file\x20created','\x20\x20rabetbase\x20run\x20start\x0a','constants','321167JUyDuq','writeFile','\x20model(s)','\x20\x20√\x20package.json\x20updated','30342QatxPX','description','modelCount','2580655SQjExV','resolve','validation','Cannot\x20create\x20project\x20in\x20current\x20directory.'];a163_0x3c1e=function(){return _0xb29d2f;};return a163_0x3c1e();}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(_0x234bb1,_0x20baab,_0x16fb82,_0xf74c34){const _0x19c5f6=a163_0x1e37,_0x3262ba=await checkCliVersion();(_0x3262ba[_0x19c5f6(0xc6)]||_0x3262ba['belowMinimum'])&&(printCliUpgradeWarning(_0x3262ba),assertCliVersionSupported(_0x3262ba));if(!_0x234bb1||_0x234bb1[_0x19c5f6(0xc3)]()==='')throw CliErrors[_0x19c5f6(0xbc)]('Project\x20name\x20cannot\x20be\x20empty.');const _0x313785=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x313785['test'](_0x234bb1))throw CliErrors[_0x19c5f6(0xbc)]('Project\x20name\x20contains\x20invalid\x20characters.',_0x19c5f6(0xac));if(_0x234bb1[_0x19c5f6(0xa0)]>0x64)throw CliErrors[_0x19c5f6(0xbc)]('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.');const _0x41875e=a163_0x729ebe['resolve'](process[_0x19c5f6(0xa3)](),_0x234bb1);if(existsSync(_0x41875e))throw CliErrors[_0x19c5f6(0xbc)](_0x19c5f6(0xa5)+_0x234bb1+_0x19c5f6(0xbf),_0x19c5f6(0x9f));try{const _0x3b2b7d=a163_0x729ebe[_0x19c5f6(0xc7)](_0x41875e);await a163_0x5832af['access'](_0x3b2b7d,a163_0x5832af[_0x19c5f6(0xb2)][_0x19c5f6(0xa1)]);}catch{throw CliErrors['validation'](_0x19c5f6(0xbd),'Check\x20directory\x20permissions.');}try{console[_0x19c5f6(0xc8)](_0x19c5f6(0xcc)+_0x234bb1+'...');const _0x2f07bc=getSubAppReactDemoTemplateDir();await copyDirectory(_0x2f07bc,_0x41875e),console[_0x19c5f6(0xc8)]('\x20\x20√\x20Project\x20template\x20created'),await updatePackageJsonName(_0x234bb1),console['log'](_0x19c5f6(0xb6)),console[_0x19c5f6(0xc8)]('\x20\x20Installing\x20dependencies...'),console[_0x19c5f6(0xc8)]('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x41875e),console[_0x19c5f6(0xc8)](_0x19c5f6(0xa4)),await configureProject(_0x234bb1,_0x16fb82,_0x20baab),console['log'](_0x19c5f6(0xb0)),_0x16fb82&&await pullApiConfig(_0x41875e,_0x16fb82,_0x20baab,_0xf74c34),console[_0x19c5f6(0xc8)]('\x0a√\x20Project\x20'+_0x234bb1+'\x20created\x20successfully!'),console[_0x19c5f6(0xc8)](_0x19c5f6(0xd1)+_0x234bb1),console[_0x19c5f6(0xc8)](_0x19c5f6(0xb1));}catch(_0x577a45){try{existsSync(_0x41875e)&&await a163_0x5832af['rm'](_0x41875e,{'recursive':!![],'force':!![]});}catch{}throw _0x577a45;}}async function updatePackageJsonName(_0x183901){const _0x287510=a163_0x1e37,_0x457174=a163_0x729ebe['resolve'](process[_0x287510(0xa3)](),_0x183901),_0x5a6047=a163_0x729ebe[_0x287510(0xcd)](_0x457174,_0x287510(0xca)),_0x45bc5f=await a163_0x5832af['readFile'](_0x5a6047,_0x287510(0xc2)),_0x1fb94d=JSON[_0x287510(0xa6)](_0x45bc5f);_0x1fb94d['name']=_0x183901,_0x1fb94d[_0x287510(0xb8)]=_0x287510(0xc5),await a163_0x5832af[_0x287510(0xb4)](_0x5a6047,JSON[_0x287510(0xc1)](_0x1fb94d,null,0x2)+'\x0a');}function detectPackageManager(){const _0x15e96c=a163_0x1e37;try{return execSync(_0x15e96c(0xaf),{'stdio':_0x15e96c(0xc0)}),_0x15e96c(0xaa);}catch{return _0x15e96c(0xa9);}}async function formatCode(_0x4ba49c){const _0x3ec3fc=a163_0x1e37;try{await execAsync(_0x3ec3fc(0xa7),{'cwd':_0x4ba49c});}catch{}}async function configureProject(_0x40104b,_0x41e4c2,_0x26b5a8){const _0x113d6b=a163_0x1e37,_0x8bb392=a163_0x729ebe[_0x113d6b(0xbb)](process[_0x113d6b(0xa3)](),_0x40104b),_0x5c15c3=a163_0x729ebe['join'](_0x8bb392,NEW_CONFIG_NAME),_0x166711=readConfig(),_0x4b8e8a=typeof _0x166711[_0x113d6b(0xae)]===_0x113d6b(0xab)?_0x166711['env']:undefined,_0x10c894={};for(const _0x3d6851 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x166711[_0x3d6851]!=null)_0x10c894[_0x3d6851]=_0x166711[_0x3d6851];}const _0x53b67f=buildCanonicalProjectConfig(_0x10c894,{'appCodes':_0x41e4c2?[_0x41e4c2]:[],'env':_0x26b5a8||_0x4b8e8a||_0x113d6b(0xc9),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':getCliVersion()}});writeConfigFile(_0x5c15c3,_0x53b67f);}async function pullApiConfig(_0x125464,_0x20b4db,_0xd4d36e,_0x24e12d){const _0x13fe6d=a163_0x1e37,_0x389501=process['cwd']();try{process['chdir'](_0x125464);const _0x28374f=_0xd4d36e||_0x13fe6d(0xc9);initEnv(_0x28374f),console[_0x13fe6d(0xc8)](_0x13fe6d(0xcf));const {configArray:_0x324f4c}=await fetchModelList(_0x20b4db,_0x24e12d||''),_0x5419e8=await generateApiFile(_0x324f4c,'',_0x20b4db,!![],_0x28374f,DEFAULT_API_DIR);console[_0x13fe6d(0xc8)](_0x13fe6d(0xbe)+_0x324f4c[_0x13fe6d(0xa0)]+_0x13fe6d(0xd2)+_0x5419e8[_0x13fe6d(0xb9)]+_0x13fe6d(0xb5));}catch(_0x5bd464){console[_0x13fe6d(0xc8)]('\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20manually\x20later.');}finally{process[_0x13fe6d(0xad)](_0x389501);}}
1
+ (function(_0x372669,_0x215cea){const _0x4a7afc=a163_0x26b7,_0x3c045e=_0x372669();while(!![]){try{const _0x2e6d4d=parseInt(_0x4a7afc(0x156))/0x1+-parseInt(_0x4a7afc(0x135))/0x2*(-parseInt(_0x4a7afc(0x13e))/0x3)+-parseInt(_0x4a7afc(0x139))/0x4+-parseInt(_0x4a7afc(0x165))/0x5*(-parseInt(_0x4a7afc(0x13d))/0x6)+-parseInt(_0x4a7afc(0x166))/0x7*(-parseInt(_0x4a7afc(0x164))/0x8)+parseInt(_0x4a7afc(0x14d))/0x9*(parseInt(_0x4a7afc(0x149))/0xa)+-parseInt(_0x4a7afc(0x15e))/0xb;if(_0x2e6d4d===_0x215cea)break;else _0x3c045e['push'](_0x3c045e['shift']());}catch(_0x2d6ad6){_0x3c045e['push'](_0x3c045e['shift']());}}}(a163_0xd104,0xd0923));import a163_0x13972d from'path';function a163_0xd104(){const _0x3a36c1=['\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','43440SHfDXS','\x20\x20rabetbase\x20run\x20start\x0a','\x20dataset(s),\x20generated\x20','writeFile','666CTZJrL','bun\x20run\x20format','\x20\x20Pulling\x20API\x20configuration...','\x20\x20Installing\x20dependencies...','\x22\x20already\x20exists.','npm','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','\x20api\x20pull`\x20manually\x20later.','\x0a\x20\x20cd\x20','1416227EIJfWg','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','env','*\x20Creating\x20project\x20','Project\x20name\x20cannot\x20be\x20empty.','dirname','parse','\x20created\x20successfully!','43545040RtoXNK','log','Check\x20directory\x20permissions.','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','bun','\x20\x20√\x20Pulled\x20','145480ZrinUN','15jMMZpa','259vAbYOq','length','\x20\x20√\x20Code\x20formatted','constants','belowMinimum','join','\x20\x20√\x20package.json\x20updated','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','validation','access','readFile','2354812RfUZXW','production','stringify','package.json','1579900LJkRat','\x0a√\x20Project\x20','cwd','utf-8','3239976kDNOyx','3fHAUeL','bun\x20--version','Project\x20directory\x20\x22','needsUpgrade','\x20model(s)','trim','...','Project\x20name\x20contains\x20invalid\x20characters.','toLocaleString','resolve'];a163_0xd104=function(){return _0x3a36c1;};return a163_0xd104();}import a163_0x5443a9 from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';function a163_0x26b7(_0x5475b9,_0x26ccdf){_0x5475b9=_0x5475b9-0x130;const _0xd104dc=a163_0xd104();let _0x26b7fa=_0xd104dc[_0x5475b9];return _0x26b7fa;}const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x24628f,_0x1b4ae9,_0x1f9ef9,_0x53b3e3){const _0x308b85=a163_0x26b7,_0xf710c0=await checkCliVersion();(_0xf710c0[_0x308b85(0x141)]||_0xf710c0[_0x308b85(0x16a)])&&(printCliUpgradeWarning(_0xf710c0),assertCliVersionSupported(_0xf710c0));if(!_0x24628f||_0x24628f[_0x308b85(0x143)]()==='')throw CliErrors[_0x308b85(0x132)](_0x308b85(0x15a));const _0x25c1a3=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x25c1a3['test'](_0x24628f))throw CliErrors[_0x308b85(0x132)](_0x308b85(0x145),_0x308b85(0x161));if(_0x24628f[_0x308b85(0x167)]>0x64)throw CliErrors[_0x308b85(0x132)](_0x308b85(0x131));const _0x3bf46c=a163_0x13972d[_0x308b85(0x147)](process[_0x308b85(0x13b)](),_0x24628f);if(existsSync(_0x3bf46c))throw CliErrors[_0x308b85(0x132)](_0x308b85(0x140)+_0x24628f+_0x308b85(0x151),'Use\x20a\x20different\x20project\x20name.');try{const _0x1d7924=a163_0x13972d[_0x308b85(0x15b)](_0x3bf46c);await a163_0x5443a9[_0x308b85(0x133)](_0x1d7924,a163_0x5443a9[_0x308b85(0x169)]['W_OK']);}catch{throw CliErrors[_0x308b85(0x132)]('Cannot\x20create\x20project\x20in\x20current\x20directory.',_0x308b85(0x160));}try{console[_0x308b85(0x15f)](_0x308b85(0x159)+_0x24628f+_0x308b85(0x144));const _0x3d6748=getSubAppReactDemoTemplateDir();await copyDirectory(_0x3d6748,_0x3bf46c),console[_0x308b85(0x15f)]('\x20\x20√\x20Project\x20template\x20created'),await updatePackageJsonName(_0x24628f),console['log'](_0x308b85(0x130)),console[_0x308b85(0x15f)](_0x308b85(0x150)),console[_0x308b85(0x15f)](_0x308b85(0x157)),await formatCode(_0x3bf46c),console[_0x308b85(0x15f)](_0x308b85(0x168)),await configureProject(_0x24628f,_0x1f9ef9,_0x1b4ae9),console[_0x308b85(0x15f)]('\x20\x20√\x20Configuration\x20file\x20created'),_0x1f9ef9&&await pullApiConfig(_0x3bf46c,_0x1f9ef9,_0x1b4ae9,_0x53b3e3),console[_0x308b85(0x15f)](_0x308b85(0x13a)+_0x24628f+_0x308b85(0x15d)),console[_0x308b85(0x15f)](_0x308b85(0x155)+_0x24628f),console[_0x308b85(0x15f)](_0x308b85(0x14a));}catch(_0x2e1767){try{existsSync(_0x3bf46c)&&await a163_0x5443a9['rm'](_0x3bf46c,{'recursive':!![],'force':!![]});}catch{}throw _0x2e1767;}}async function updatePackageJsonName(_0xdd3a46){const _0x23436e=a163_0x26b7,_0xa29b62=a163_0x13972d[_0x23436e(0x147)](process[_0x23436e(0x13b)](),_0xdd3a46),_0xb5ec7=a163_0x13972d[_0x23436e(0x16b)](_0xa29b62,_0x23436e(0x138)),_0x4666e5=await a163_0x5443a9[_0x23436e(0x134)](_0xb5ec7,_0x23436e(0x13c)),_0x49f060=JSON[_0x23436e(0x15c)](_0x4666e5);_0x49f060['name']=_0xdd3a46,_0x49f060['description']=_0x23436e(0x153),await a163_0x5443a9[_0x23436e(0x14c)](_0xb5ec7,JSON[_0x23436e(0x137)](_0x49f060,null,0x2)+'\x0a');}function detectPackageManager(){const _0xea8873=a163_0x26b7;try{return execSync(_0xea8873(0x13f),{'stdio':'ignore'}),_0xea8873(0x162);}catch{return _0xea8873(0x152);}}async function formatCode(_0x1af35e){const _0xcc87a2=a163_0x26b7;try{await execAsync(_0xcc87a2(0x14e),{'cwd':_0x1af35e});}catch{}}async function configureProject(_0x259440,_0x29af4f,_0x52816e){const _0x55f31f=a163_0x26b7,_0x3837f0=a163_0x13972d['resolve'](process[_0x55f31f(0x13b)](),_0x259440),_0x31bd54=a163_0x13972d[_0x55f31f(0x16b)](_0x3837f0,NEW_CONFIG_NAME),_0x3bd5b4=readConfig(),_0x14b9c9=typeof _0x3bd5b4[_0x55f31f(0x158)]==='string'?_0x3bd5b4[_0x55f31f(0x158)]:undefined,_0x3df54b={};for(const _0x421155 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x3bd5b4[_0x421155]!=null)_0x3df54b[_0x421155]=_0x3bd5b4[_0x421155];}const _0x120213=buildCanonicalProjectConfig(_0x3df54b,{'appCodes':_0x29af4f?[_0x29af4f]:[],'env':_0x52816e||_0x14b9c9||'production','metadata':{'createdAt':new Date()[_0x55f31f(0x146)](),'version':getCliVersion()}});writeConfigFile(_0x31bd54,_0x120213);}async function pullApiConfig(_0x5eb321,_0x2dfdfc,_0x3fe2d8,_0x32f5df){const _0x403d42=a163_0x26b7,_0x500d87=process['cwd']();try{process['chdir'](_0x5eb321);const _0x1ea648=_0x3fe2d8||_0x403d42(0x136);initEnv(_0x1ea648),console[_0x403d42(0x15f)](_0x403d42(0x14f));const {configArray:_0x25ebc4}=await fetchModelList(_0x2dfdfc,_0x32f5df||''),_0x3503c0=await generateApiFile(_0x25ebc4,'',_0x2dfdfc,!![],_0x1ea648,DEFAULT_API_DIR);console[_0x403d42(0x15f)](_0x403d42(0x163)+_0x25ebc4['length']+_0x403d42(0x14b)+_0x3503c0['modelCount']+_0x403d42(0x142));}catch(_0x196849){console[_0x403d42(0x15f)](_0x403d42(0x148)+CLI_BIN_NAME+_0x403d42(0x154));}finally{process['chdir'](_0x500d87);}}
@@ -1 +1 @@
1
- function a164_0x2298(){const _0x264fd9=['14iyKAQX','4nuirOH','9vTEwYH','11067048WGyotd','55bdFgqV','join','resolve','1194650TwLJmg','8215576VTLCIn','2973873DYGXSP','4GZVYPw','432001wAANCm','sub-app-react-demo','691422NvwTqI','projects','../../../../','dirname','1230490WmyXZm','templates'];a164_0x2298=function(){return _0x264fd9;};return a164_0x2298();}const a164_0xd489f9=a164_0x3614;(function(_0x272ab3,_0x3d081c){const _0x5a0967=a164_0x3614,_0x166f3d=_0x272ab3();while(!![]){try{const _0x1a5c62=-parseInt(_0x5a0967(0x1b2))/0x1*(-parseInt(_0x5a0967(0x1a8))/0x2)+parseInt(_0x5a0967(0x1b0))/0x3*(-parseInt(_0x5a0967(0x1b1))/0x4)+parseInt(_0x5a0967(0x1a5))/0x5+-parseInt(_0x5a0967(0x1a1))/0x6*(parseInt(_0x5a0967(0x1a7))/0x7)+parseInt(_0x5a0967(0x1af))/0x8*(parseInt(_0x5a0967(0x1a9))/0x9)+parseInt(_0x5a0967(0x1ae))/0xa*(parseInt(_0x5a0967(0x1ab))/0xb)+-parseInt(_0x5a0967(0x1aa))/0xc;if(_0x1a5c62===_0x3d081c)break;else _0x166f3d['push'](_0x166f3d['shift']());}catch(_0x5f72fe){_0x166f3d['push'](_0x166f3d['shift']());}}}(a164_0x2298,0x90211));import a164_0x6ed5b6 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a164_0x6ed5b6[a164_0xd489f9(0x1a4)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x19028a=a164_0xd489f9;return a164_0x6ed5b6[_0x19028a(0x1ad)](__dirname,_0x19028a(0x1a3));}function a164_0x3614(_0x377c58,_0x3a6335){_0x377c58=_0x377c58-0x1a1;const _0x22989a=a164_0x2298();let _0x3614b1=_0x22989a[_0x377c58];return _0x3614b1;}export function getSubAppReactDemoTemplateDir(){const _0x27bc9c=a164_0xd489f9;return a164_0x6ed5b6[_0x27bc9c(0x1ac)](getRabetbaseCliPackageRoot(),_0x27bc9c(0x1a6),_0x27bc9c(0x1a2),_0x27bc9c(0x1b3));}
1
+ const a164_0x5297d2=a164_0x3cdf;(function(_0x2373db,_0x3509fb){const _0x1126b7=a164_0x3cdf,_0x5ce08b=_0x2373db();while(!![]){try{const _0x329a84=parseInt(_0x1126b7(0x1b7))/0x1+parseInt(_0x1126b7(0x1c1))/0x2+-parseInt(_0x1126b7(0x1bf))/0x3+-parseInt(_0x1126b7(0x1b9))/0x4*(-parseInt(_0x1126b7(0x1bc))/0x5)+-parseInt(_0x1126b7(0x1c2))/0x6*(-parseInt(_0x1126b7(0x1be))/0x7)+-parseInt(_0x1126b7(0x1bd))/0x8+parseInt(_0x1126b7(0x1b6))/0x9*(-parseInt(_0x1126b7(0x1bb))/0xa);if(_0x329a84===_0x3509fb)break;else _0x5ce08b['push'](_0x5ce08b['shift']());}catch(_0x2b704c){_0x5ce08b['push'](_0x5ce08b['shift']());}}}(a164_0xcbe0,0x9201d));import a164_0x4d8162 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a164_0x4d8162[a164_0x5297d2(0x1b5)](fileURLToPath(import.meta.url));function a164_0x3cdf(_0x2a62f6,_0x2c1ddb){_0x2a62f6=_0x2a62f6-0x1b4;const _0xcbe035=a164_0xcbe0();let _0x3cdf4d=_0xcbe035[_0x2a62f6];return _0x3cdf4d;}export function getRabetbaseCliPackageRoot(){const _0x50cb7f=a164_0x5297d2;return a164_0x4d8162['resolve'](__dirname,_0x50cb7f(0x1c0));}function a164_0xcbe0(){const _0x51eada=['3492966RaEAqF','../../../../','806466oGkhRF','1273710BrWQRZ','projects','dirname','36dgfxiD','910952jbTwcF','sub-app-react-demo','4tEIvSp','templates','1917040tVzPEo','3702890DIWLJW','2997760wxqXaZ','28nYOftm'];a164_0xcbe0=function(){return _0x51eada;};return a164_0xcbe0();}export function getSubAppReactDemoTemplateDir(){const _0x56ae28=a164_0x5297d2;return a164_0x4d8162['join'](getRabetbaseCliPackageRoot(),_0x56ae28(0x1ba),_0x56ae28(0x1b4),_0x56ae28(0x1b8));}
@@ -1 +1 @@
1
- (function(_0x1f4686,_0x51cf6e){const _0x582142=a165_0x4b2f,_0x3266e4=_0x1f4686();while(!![]){try{const _0x592fa8=parseInt(_0x582142(0x169))/0x1*(-parseInt(_0x582142(0x179))/0x2)+parseInt(_0x582142(0x170))/0x3*(-parseInt(_0x582142(0x178))/0x4)+parseInt(_0x582142(0x168))/0x5*(-parseInt(_0x582142(0x175))/0x6)+parseInt(_0x582142(0x177))/0x7+-parseInt(_0x582142(0x171))/0x8*(parseInt(_0x582142(0x176))/0x9)+parseInt(_0x582142(0x172))/0xa*(parseInt(_0x582142(0x173))/0xb)+-parseInt(_0x582142(0x17a))/0xc*(-parseInt(_0x582142(0x166))/0xd);if(_0x592fa8===_0x51cf6e)break;else _0x3266e4['push'](_0x3266e4['shift']());}catch(_0x9791b1){_0x3266e4['push'](_0x3266e4['shift']());}}}(a165_0x2fa1,0x3ac3e));import a165_0x40fdf0 from'node:path';function a165_0x4b2f(_0x224143,_0x4e3245){_0x224143=_0x224143-0x166;const _0x2fa1b3=a165_0x2fa1();let _0x4b2f78=_0x2fa1b3[_0x224143];return _0x4b2f78;}import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';function a165_0x2fa1(){const _0x2fbf53=['cwd','copy','项目模板复制完成','error','now','success','489vaXNoT','58376mMDTuE','605090NEPsUr','55hykwIp','resolve','1662894dMCTeZ','513YlkAtD','2313822TbldGx','10324IHSAHS','22Pkpdig','996VTEDvd','149461srQKqc','message','5pQwEmn','21169IdRavg'];a165_0x2fa1=function(){return _0x2fbf53;};return a165_0x2fa1();}const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x3c2690){const _0x424639=a165_0x4b2f,_0x3645b3=Date[_0x424639(0x16e)](),_0x261013=a165_0x40fdf0[_0x424639(0x174)](process[_0x424639(0x16a)](),_0x3c2690);try{logger['info']('copy','开始复制项目模板',{'projectCode':_0x3c2690,'templateDir':templateDir}),await copyDirectory(templateDir,_0x261013);const _0x48414e=Date[_0x424639(0x16e)]()-_0x3645b3;logger[_0x424639(0x16f)](_0x424639(0x16b),_0x424639(0x16c),_0x48414e,{'projectCode':_0x3c2690});}catch(_0x582d77){const _0x5306f3=Date[_0x424639(0x16e)]()-_0x3645b3;logger[_0x424639(0x16d)](_0x424639(0x16b),'项目模板复制失败',{'projectCode':_0x3c2690,'error':_0x582d77 instanceof Error?_0x582d77[_0x424639(0x167)]:String(_0x582d77),'duration':_0x5306f3});throw _0x582d77;}return formatElapsed(_0x3645b3);}
1
+ (function(_0x524e17,_0x46a67a){const _0x11044c=a165_0x28b1,_0x2ef11f=_0x524e17();while(!![]){try{const _0xacb01f=parseInt(_0x11044c(0x115))/0x1*(-parseInt(_0x11044c(0x106))/0x2)+-parseInt(_0x11044c(0x111))/0x3*(-parseInt(_0x11044c(0x116))/0x4)+-parseInt(_0x11044c(0x108))/0x5+parseInt(_0x11044c(0x11c))/0x6*(parseInt(_0x11044c(0x113))/0x7)+parseInt(_0x11044c(0x109))/0x8*(parseInt(_0x11044c(0x11a))/0x9)+-parseInt(_0x11044c(0x10e))/0xa*(-parseInt(_0x11044c(0x10d))/0xb)+parseInt(_0x11044c(0x10b))/0xc*(-parseInt(_0x11044c(0x10f))/0xd);if(_0xacb01f===_0x46a67a)break;else _0x2ef11f['push'](_0x2ef11f['shift']());}catch(_0x28921d){_0x2ef11f['push'](_0x2ef11f['shift']());}}}(a165_0x44b3,0x5dcb0));import a165_0x2dbe4f from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a165_0x28b1(_0x2a6710,_0x311dc3){_0x2a6710=_0x2a6710-0x106;const _0x44b37f=a165_0x44b3();let _0x28b18f=_0x44b37f[_0x2a6710];return _0x28b18f;}import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x2dba4c){const _0x4f15f9=a165_0x28b1,_0x1b50c9=Date[_0x4f15f9(0x107)](),_0x4def30=a165_0x2dbe4f[_0x4f15f9(0x10a)](process[_0x4f15f9(0x112)](),_0x2dba4c);try{logger[_0x4f15f9(0x119)](_0x4f15f9(0x110),_0x4f15f9(0x118),{'projectCode':_0x2dba4c,'templateDir':templateDir}),await copyDirectory(templateDir,_0x4def30);const _0x3457df=Date[_0x4f15f9(0x107)]()-_0x1b50c9;logger[_0x4f15f9(0x114)]('copy',_0x4f15f9(0x10c),_0x3457df,{'projectCode':_0x2dba4c});}catch(_0x3e4d5f){const _0x4ca748=Date['now']()-_0x1b50c9;logger['error'](_0x4f15f9(0x110),_0x4f15f9(0x117),{'projectCode':_0x2dba4c,'error':_0x3e4d5f instanceof Error?_0x3e4d5f[_0x4f15f9(0x11b)]:String(_0x3e4d5f),'duration':_0x4ca748});throw _0x3e4d5f;}return formatElapsed(_0x1b50c9);}function a165_0x44b3(){const _0x1dfa4b=['info','18kDcVbq','message','1236csDxVj','73518NSyXuJ','now','1597630ZRNWSu','1076784NZCXCV','resolve','4188fHEXjl','项目模板复制完成','858QQgXiR','14510ToiwJd','15223RetcKp','copy','430179nkSdRY','cwd','16310fuOlTN','success','1KsLFHS','8IzZnHn','项目模板复制失败','开始复制项目模板'];a165_0x44b3=function(){return _0x1dfa4b;};return a165_0x44b3();}
@@ -1 +1 @@
1
- (function(_0x53719d,_0x4b5702){const _0x1cfdd3=a166_0x15de,_0x882717=_0x53719d();while(!![]){try{const _0x3dd82f=-parseInt(_0x1cfdd3(0x1e5))/0x1*(parseInt(_0x1cfdd3(0x1d3))/0x2)+-parseInt(_0x1cfdd3(0x1d9))/0x3*(-parseInt(_0x1cfdd3(0x1d7))/0x4)+parseInt(_0x1cfdd3(0x1db))/0x5+-parseInt(_0x1cfdd3(0x1d5))/0x6+parseInt(_0x1cfdd3(0x1d2))/0x7*(parseInt(_0x1cfdd3(0x1e2))/0x8)+-parseInt(_0x1cfdd3(0x1da))/0x9+parseInt(_0x1cfdd3(0x1d4))/0xa*(-parseInt(_0x1cfdd3(0x1e1))/0xb);if(_0x3dd82f===_0x4b5702)break;else _0x882717['push'](_0x882717['shift']());}catch(_0x542a1b){_0x882717['push'](_0x882717['shift']());}}}(a166_0x4ba4,0xaa48e));function a166_0x15de(_0x241886,_0x422579){_0x241886=_0x241886-0x1d2;const _0x4ba49e=a166_0x4ba4();let _0x15dec3=_0x4ba49e[_0x241886];return _0x15dec3;}import a166_0x36b054 from'node:path';function a166_0x4ba4(){const _0x2024b0=['8QUUqms','resolve','message','353011TQpECB','3318154mhvOnG','2tUIKbl','20RstzpW','2698554BBgEMh','format','4ZBNqBY','now','3668106ezAqVL','9449217TLcsWL','5716635TCkRFW','npx','prettier','--write','success','代码格式化完成','1594351ZLGEKV'];a166_0x4ba4=function(){return _0x2024b0;};return a166_0x4ba4();}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(_0x18f604){const _0x30fbcc=a166_0x15de,_0x1d36ad=Date[_0x30fbcc(0x1d8)](),_0x15d0a4=a166_0x36b054[_0x30fbcc(0x1e3)](process['cwd'](),_0x18f604);try{logger['info']('format','开始格式化代码',{'projectCode':_0x18f604}),await execa(resolveNpmBin(_0x30fbcc(0x1dc)),[_0x30fbcc(0x1dd),_0x30fbcc(0x1de),'.'],{'cwd':_0x15d0a4});const _0x48724b=Date[_0x30fbcc(0x1d8)]()-_0x1d36ad;logger[_0x30fbcc(0x1df)]('format',_0x30fbcc(0x1e0),_0x48724b,{'projectCode':_0x18f604});}catch(_0x555661){const _0x1c1802=Date[_0x30fbcc(0x1d8)]()-_0x1d36ad;logger['error'](_0x30fbcc(0x1d6),'代码格式化失败',{'projectCode':_0x18f604,'error':_0x555661 instanceof Error?_0x555661[_0x30fbcc(0x1e4)]:String(_0x555661),'duration':_0x1c1802});throw _0x555661;}return formatElapsed(_0x1d36ad);}
1
+ (function(_0x454ab4,_0x16fe90){const _0x247ee4=a166_0xab24,_0xb8e65c=_0x454ab4();while(!![]){try{const _0x496da0=-parseInt(_0x247ee4(0x13a))/0x1*(-parseInt(_0x247ee4(0x131))/0x2)+parseInt(_0x247ee4(0x137))/0x3+-parseInt(_0x247ee4(0x13c))/0x4*(-parseInt(_0x247ee4(0x12b))/0x5)+parseInt(_0x247ee4(0x132))/0x6*(parseInt(_0x247ee4(0x13f))/0x7)+-parseInt(_0x247ee4(0x12d))/0x8*(-parseInt(_0x247ee4(0x139))/0x9)+parseInt(_0x247ee4(0x12c))/0xa+-parseInt(_0x247ee4(0x12f))/0xb;if(_0x496da0===_0x16fe90)break;else _0xb8e65c['push'](_0xb8e65c['shift']());}catch(_0xe6879a){_0xb8e65c['push'](_0xb8e65c['shift']());}}}(a166_0x5b4d,0x96f36));import a166_0x5b6e96 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a166_0x5b4d(){const _0x389d25=['1592jdQrjE','--write','31908503wjlGLu','success','1661742Ibgvvf','72xjPtoA','format','now','message','开始格式化代码','2301537xovFDq','npx','17541loVFjb','1qmXAAK','resolve','4852508uXSqTm','代码格式化完成','prettier','185052FxxIaq','info','5nMQNeK','28070qyePHH'];a166_0x5b4d=function(){return _0x389d25;};return a166_0x5b4d();}import{resolveNpmBin}from'../../../utils/platform.js';function a166_0xab24(_0x1c88c7,_0x17b533){_0x1c88c7=_0x1c88c7-0x12a;const _0x5b4d1a=a166_0x5b4d();let _0xab24a1=_0x5b4d1a[_0x1c88c7];return _0xab24a1;}export async function formatProjectCode(_0x50c03a){const _0xa5d501=a166_0xab24,_0x104489=Date[_0xa5d501(0x134)](),_0x3e8454=a166_0x5b6e96[_0xa5d501(0x13b)](process['cwd'](),_0x50c03a);try{logger[_0xa5d501(0x12a)](_0xa5d501(0x133),_0xa5d501(0x136),{'projectCode':_0x50c03a}),await execa(resolveNpmBin(_0xa5d501(0x138)),[_0xa5d501(0x13e),_0xa5d501(0x12e),'.'],{'cwd':_0x3e8454});const _0xa8630e=Date['now']()-_0x104489;logger[_0xa5d501(0x130)](_0xa5d501(0x133),_0xa5d501(0x13d),_0xa8630e,{'projectCode':_0x50c03a});}catch(_0x33809b){const _0x1455cb=Date[_0xa5d501(0x134)]()-_0x104489;logger['error'](_0xa5d501(0x133),'代码格式化失败',{'projectCode':_0x50c03a,'error':_0x33809b instanceof Error?_0x33809b[_0xa5d501(0x135)]:String(_0x33809b),'duration':_0x1455cb});throw _0x33809b;}return formatElapsed(_0x104489);}
@@ -1 +1 @@
1
- (function(_0x427760,_0x4a11d7){const _0x2cebcf=a167_0xbd5e,_0x5758c2=_0x427760();while(!![]){try{const _0x35e940=parseInt(_0x2cebcf(0x1e8))/0x1*(parseInt(_0x2cebcf(0x1dc))/0x2)+parseInt(_0x2cebcf(0x1d4))/0x3+-parseInt(_0x2cebcf(0x1da))/0x4*(-parseInt(_0x2cebcf(0x1de))/0x5)+-parseInt(_0x2cebcf(0x1e5))/0x6*(-parseInt(_0x2cebcf(0x1e9))/0x7)+parseInt(_0x2cebcf(0x1d3))/0x8*(parseInt(_0x2cebcf(0x1df))/0x9)+parseInt(_0x2cebcf(0x1d9))/0xa+-parseInt(_0x2cebcf(0x1d8))/0xb*(parseInt(_0x2cebcf(0x1e2))/0xc);if(_0x35e940===_0x4a11d7)break;else _0x5758c2['push'](_0x5758c2['shift']());}catch(_0x20ef4e){_0x5758c2['push'](_0x5758c2['shift']());}}}(a167_0xaf6d,0xda47c));import a167_0x1c5799 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';function a167_0xbd5e(_0xaed843,_0x8fcd7b){_0xaed843=_0xaed843-0x1d0;const _0xaf6de8=a167_0xaf6d();let _0xbd5e64=_0xaf6de8[_0xaed843];return _0xbd5e64;}export async function installDependencies(_0x2a52a5){const _0x14e49c=a167_0xbd5e,_0x1d899e=Date['now'](),_0x37c4c2=a167_0x1c5799[_0x14e49c(0x1d0)](process[_0x14e49c(0x1e0)](),_0x2a52a5);try{logger[_0x14e49c(0x1d5)](_0x14e49c(0x1d7),_0x14e49c(0x1d2),{'projectCode':_0x2a52a5,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin(_0x14e49c(0x1e1)),['install',_0x14e49c(0x1d6),_0x14e49c(0x1dd)],{'cwd':_0x37c4c2});const _0x411bdd=Date[_0x14e49c(0x1e7)]()-_0x1d899e;logger[_0x14e49c(0x1db)](_0x14e49c(0x1d7),_0x14e49c(0x1e3),_0x411bdd,{'projectCode':_0x2a52a5});}catch(_0x40014b){const _0x560643=Date[_0x14e49c(0x1e7)]()-_0x1d899e;logger[_0x14e49c(0x1e4)]('install',_0x14e49c(0x1d1),{'projectCode':_0x2a52a5,'error':_0x40014b instanceof Error?_0x40014b[_0x14e49c(0x1e6)]:String(_0x40014b),'duration':_0x560643});throw _0x40014b;}return formatElapsed(_0x1d899e);}function a167_0xaf6d(){const _0x2bf25d=['2464lYyYqg','8010740ePnxqh','2008GExOXN','success','120138AtKUDo','https://registry.npmmirror.com','9140nLkgmS','92781JvRraU','cwd','npm','271092zPRGZu','依赖安装完成','error','8657238TduixE','message','now','16aLpSGk','7RxgMHh','resolve','依赖安装失败','开始安装依赖','1336TNIwqo','330450qILMCM','info','--registry','install'];a167_0xaf6d=function(){return _0x2bf25d;};return a167_0xaf6d();}
1
+ function a167_0xcaeb(_0x43be0a,_0x3e395b){_0x43be0a=_0x43be0a-0x1f3;const _0x571335=a167_0x5713();let _0xcaebc1=_0x571335[_0x43be0a];return _0xcaebc1;}(function(_0x4177bc,_0x12b514){const _0x27ab35=a167_0xcaeb,_0x5ac226=_0x4177bc();while(!![]){try{const _0x33b759=-parseInt(_0x27ab35(0x202))/0x1*(-parseInt(_0x27ab35(0x1f5))/0x2)+-parseInt(_0x27ab35(0x1f8))/0x3+parseInt(_0x27ab35(0x1fa))/0x4+-parseInt(_0x27ab35(0x1ff))/0x5+parseInt(_0x27ab35(0x204))/0x6+parseInt(_0x27ab35(0x1f4))/0x7+parseInt(_0x27ab35(0x205))/0x8*(-parseInt(_0x27ab35(0x1fe))/0x9);if(_0x33b759===_0x12b514)break;else _0x5ac226['push'](_0x5ac226['shift']());}catch(_0x46dd0b){_0x5ac226['push'](_0x5ac226['shift']());}}}(a167_0x5713,0xf1a5f));import a167_0x3b4e5f from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x4098a7){const _0x593800=a167_0xcaeb,_0x5da557=Date[_0x593800(0x1f3)](),_0x208988=a167_0x3b4e5f[_0x593800(0x1f9)](process['cwd'](),_0x4098a7);try{logger[_0x593800(0x200)]('install',_0x593800(0x1fc),{'projectCode':_0x4098a7,'registry':_0x593800(0x1f6)}),await execa(resolveNpmBin(_0x593800(0x1fd)),[_0x593800(0x201),_0x593800(0x207),_0x593800(0x1f6)],{'cwd':_0x208988});const _0x2ed702=Date[_0x593800(0x1f3)]()-_0x5da557;logger[_0x593800(0x206)](_0x593800(0x201),'依赖安装完成',_0x2ed702,{'projectCode':_0x4098a7});}catch(_0x45c58d){const _0x1f69e5=Date['now']()-_0x5da557;logger[_0x593800(0x1fb)](_0x593800(0x201),_0x593800(0x203),{'projectCode':_0x4098a7,'error':_0x45c58d instanceof Error?_0x45c58d[_0x593800(0x1f7)]:String(_0x45c58d),'duration':_0x1f69e5});throw _0x45c58d;}return formatElapsed(_0x5da557);}function a167_0x5713(){const _0x11eb78=['33134eMgirA','https://registry.npmmirror.com','message','463134NycpST','resolve','2063204Gvnfaf','error','开始安装依赖','npm','2086947WqlQrr','990880bVkHlj','info','install','119CmMhkl','依赖安装失败','9544788yIUlLI','112dZAcrW','success','--registry','now','3574445LWXbZx'];a167_0x5713=function(){return _0x11eb78;};return a167_0x5713();}
@@ -1 +1 @@
1
- const a168_0x592da4=a168_0x511e;(function(_0x1d7c61,_0x4cf22c){const _0x2e801c=a168_0x511e,_0x3dfb5f=_0x1d7c61();while(!![]){try{const _0x40cdf4=parseInt(_0x2e801c(0x1d0))/0x1*(parseInt(_0x2e801c(0x1bb))/0x2)+parseInt(_0x2e801c(0x1b5))/0x3+parseInt(_0x2e801c(0x1cd))/0x4*(parseInt(_0x2e801c(0x1c6))/0x5)+parseInt(_0x2e801c(0x1c3))/0x6*(parseInt(_0x2e801c(0x1cf))/0x7)+-parseInt(_0x2e801c(0x1c1))/0x8+parseInt(_0x2e801c(0x1d4))/0x9*(parseInt(_0x2e801c(0x1ba))/0xa)+-parseInt(_0x2e801c(0x1c7))/0xb;if(_0x40cdf4===_0x4cf22c)break;else _0x3dfb5f['push'](_0x3dfb5f['shift']());}catch(_0x4254ab){_0x3dfb5f['push'](_0x3dfb5f['shift']());}}}(a168_0x4c9b,0x43561));import{CliErrors}from'../../errors.js';function a168_0x511e(_0x52000c,_0x3c70d3){_0x52000c=_0x52000c-0x1b4;const _0x4c9b82=a168_0x4c9b();let _0x511e38=_0x4c9b82[_0x52000c];return _0x511e38;}function a168_0x4c9b(){const _0x57c515=['7868036nEYbwt','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','bool','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','boolean','Target\x20environment','827608gkNALt','upgrade','1895341PKYJaB','465637sMUDKY','Skip\x20confirmation\x20prompt','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','str','9TzRdTH','trim','env','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','string','452298vBnJIW','Create\x20a\x20new\x20project','create','name','../../commands/project/create/main.js','791950ybLhrm','2XmCIJu','Project\x20name','write','project','nonInteractive','appcode','3623528bWLQmZ','yes','12OViXcU','Usage:\x20','../../commands/project/create/non-interactive.js','5KgkAiz'];a168_0x4c9b=function(){return _0x57c515;};return a168_0x4c9b();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';const createFlags=[{'name':'name','type':a168_0x592da4(0x1b4),'description':a168_0x592da4(0x1bc)},{'name':a168_0x592da4(0x1d6),'type':'string','description':a168_0x592da4(0x1cc)},{'name':a168_0x592da4(0x1c0),'type':a168_0x592da4(0x1b4),'description':a168_0x592da4(0x1d7)}],upgradeFlags=[{'name':a168_0x592da4(0x1c2),'type':a168_0x592da4(0x1cb),'description':a168_0x592da4(0x1d1),'default':![]}];export const projectDefinitions=[{'service':'project','command':a168_0x592da4(0x1b7),'description':a168_0x592da4(0x1b6),'risk':a168_0x592da4(0x1bd),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'project-name','description':a168_0x592da4(0x1c8),'required':![]}],'flags':createFlags,async 'execute'(_0x1c3ed7){const _0x26ccf8=a168_0x592da4,{createApp:_0x4dbe9f}=await import(_0x26ccf8(0x1b9)),{createProjectNonInteractive:_0x32ed04}=await import(_0x26ccf8(0x1c5)),_0x2220a8=_0x1c3ed7[_0x26ccf8(0x1d3)](_0x26ccf8(0x1b8))[_0x26ccf8(0x1d5)]()||_0x1c3ed7['args'][0x0]?.[_0x26ccf8(0x1d5)](),_0x406af0=_0x1c3ed7[_0x26ccf8(0x1d3)]('env')||undefined,_0x5d2057=_0x1c3ed7[_0x26ccf8(0x1d3)](_0x26ccf8(0x1c0))||undefined;if(_0x1c3ed7[_0x26ccf8(0x1bf)]){if(!_0x2220a8)throw CliErrors['validation'](_0x26ccf8(0x1d2),_0x26ccf8(0x1c4)+CLI_BIN_NAME+_0x26ccf8(0x1d8));await _0x32ed04(_0x2220a8,_0x406af0,_0x5d2057,_0x1c3ed7['cookie']);}else await _0x4dbe9f({'projectCode':_0x2220a8,'appCode':_0x5d2057,'env':_0x406af0,'cookie':_0x1c3ed7['cookie']});return{'ok':!![]};}},{'service':a168_0x592da4(0x1be),'command':a168_0x592da4(0x1ce),'description':a168_0x592da4(0x1ca),'risk':a168_0x592da4(0x1bd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x27292d){const _0x313b2c=a168_0x592da4;return await upgradeApp(_0x27292d['nonInteractive'],{'yes':_0x27292d[_0x313b2c(0x1c9)](_0x313b2c(0x1c2))}),{'ok':!![]};}}];
1
+ const a168_0x200555=a168_0x1990;(function(_0x55c799,_0x116510){const _0x35e836=a168_0x1990,_0x313d91=_0x55c799();while(!![]){try{const _0x1a089c=parseInt(_0x35e836(0x18b))/0x1+-parseInt(_0x35e836(0x17d))/0x2*(-parseInt(_0x35e836(0x177))/0x3)+parseInt(_0x35e836(0x189))/0x4+-parseInt(_0x35e836(0x18c))/0x5+parseInt(_0x35e836(0x192))/0x6+parseInt(_0x35e836(0x175))/0x7+-parseInt(_0x35e836(0x183))/0x8;if(_0x1a089c===_0x116510)break;else _0x313d91['push'](_0x313d91['shift']());}catch(_0x3d56b5){_0x313d91['push'](_0x313d91['shift']());}}}(a168_0x44b6,0x63f71));import{CliErrors}from'../../errors.js';function a168_0x1990(_0x3c6136,_0x202b42){_0x3c6136=_0x3c6136-0x174;const _0x44b6c9=a168_0x44b6();let _0x1990ca=_0x44b6c9[_0x3c6136];return _0x1990ca;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';const createFlags=[{'name':a168_0x200555(0x17f),'type':a168_0x200555(0x185),'description':'Project\x20name'},{'name':'env','type':'string','description':a168_0x200555(0x18d)},{'name':a168_0x200555(0x17c),'type':a168_0x200555(0x185),'description':a168_0x200555(0x193)}],upgradeFlags=[{'name':a168_0x200555(0x181),'type':a168_0x200555(0x174),'description':a168_0x200555(0x190),'default':![]}];function a168_0x44b6(){const _0x3c4118=['Target\x20environment','project','Create\x20a\x20new\x20project','Skip\x20confirmation\x20prompt','args','4563978fvlNdP','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','boolean','1219057PeBUVm','cookie','255CeOSRw','str','trim','validation','nonInteractive','appcode','8548CUpzjz','../../commands/project/create/main.js','name','write','yes','create','7779056yAONOV','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','string','bool','project-name','../../commands/project/create/non-interactive.js','105036DkcFoA','Usage:\x20','269342inGTov','1059330aHztyg'];a168_0x44b6=function(){return _0x3c4118;};return a168_0x44b6();}export const projectDefinitions=[{'service':a168_0x200555(0x18e),'command':a168_0x200555(0x182),'description':a168_0x200555(0x18f),'risk':a168_0x200555(0x180),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a168_0x200555(0x187),'description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x81da7d){const _0x1989c8=a168_0x200555,{createApp:_0x1455c3}=await import(_0x1989c8(0x17e)),{createProjectNonInteractive:_0x128623}=await import(_0x1989c8(0x188)),_0x301d21=_0x81da7d[_0x1989c8(0x178)](_0x1989c8(0x17f))['trim']()||_0x81da7d[_0x1989c8(0x191)][0x0]?.[_0x1989c8(0x179)](),_0x282e3c=_0x81da7d[_0x1989c8(0x178)]('env')||undefined,_0x1c9661=_0x81da7d['str'](_0x1989c8(0x17c))||undefined;if(_0x81da7d[_0x1989c8(0x17b)]){if(!_0x301d21)throw CliErrors[_0x1989c8(0x17a)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x1989c8(0x18a)+CLI_BIN_NAME+_0x1989c8(0x184));await _0x128623(_0x301d21,_0x282e3c,_0x1c9661,_0x81da7d[_0x1989c8(0x176)]);}else await _0x1455c3({'projectCode':_0x301d21,'appCode':_0x1c9661,'env':_0x282e3c,'cookie':_0x81da7d['cookie']});return{'ok':!![]};}},{'service':a168_0x200555(0x18e),'command':'upgrade','description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a168_0x200555(0x180),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x48abfd){const _0xe12567=a168_0x200555;return await upgradeApp(_0x48abfd[_0xe12567(0x17b)],{'yes':_0x48abfd[_0xe12567(0x186)](_0xe12567(0x181))}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a169_0x398952=a169_0x80d2;(function(_0x46a45f,_0x8b99ce){const _0x11c804=a169_0x80d2,_0xdc7f9f=_0x46a45f();while(!![]){try{const _0x4d2df9=-parseInt(_0x11c804(0xc9))/0x1+-parseInt(_0x11c804(0x87))/0x2*(-parseInt(_0x11c804(0x9f))/0x3)+parseInt(_0x11c804(0x8a))/0x4+parseInt(_0x11c804(0x8d))/0x5+-parseInt(_0x11c804(0x66))/0x6*(parseInt(_0x11c804(0x8e))/0x7)+-parseInt(_0x11c804(0x85))/0x8*(-parseInt(_0x11c804(0x7c))/0x9)+-parseInt(_0x11c804(0xc7))/0xa;if(_0x4d2df9===_0x8b99ce)break;else _0xdc7f9f['push'](_0xdc7f9f['shift']());}catch(_0x224d0a){_0xdc7f9f['push'](_0xdc7f9f['shift']());}}}(a169_0x1b53,0xceeab));import a169_0x20efdb from'chalk';import a169_0x2ab5a5 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a169_0x398952(0x9d)](_0x261ca0=>_0x261ca0!==NEW_CONFIG_NAME);function a169_0x80d2(_0x378fd3,_0x3127ec){_0x378fd3=_0x378fd3-0x64;const _0x1b5379=a169_0x1b53();let _0x80d283=_0x1b5379[_0x378fd3];return _0x80d283;}function collectIdeSkillFiles(_0x3b70e8){const _0x48f094=a169_0x398952,_0x46bd2c=[];for(const _0x4a4938 of Object[_0x48f094(0x6b)](CORE_IDE_CONFIGS)){if(_0x4a4938[_0x48f094(0xd7)])for(const _0x5a24b8 of _0x4a4938['files']){_0x46bd2c['push'](resolve(_0x3b70e8,_0x5a24b8[_0x48f094(0xb7)]));}}return _0x46bd2c;}function analyse(_0xa0bfe5){const _0x1e0313=a169_0x398952;let _0x29c1da=null;const _0x114d3c=resolve(_0xa0bfe5,NEW_CONFIG_NAME),_0x49633f=existsSync(_0x114d3c);for(const _0x5ce595 of LEGACY_CONFIG_NAMES){const _0x39ab37=resolve(_0xa0bfe5,_0x5ce595);if(existsSync(_0x39ab37)){const _0x71cf51=readConfigFile(_0x39ab37),_0xf00720=Object['keys'](_0x71cf51)[_0x1e0313(0x9d)](_0x1f6f9e=>typeof _0x71cf51[_0x1f6f9e]!=='undefined');_0x29c1da={'oldPath':_0x39ab37,'hasNewConfig':_0x49633f,'fields':_0xf00720};break;}}const _0x34630e=[],_0x102dcf=resolve(_0xa0bfe5,_0x1e0313(0xc0));if(existsSync(_0x102dcf))_0x34630e[_0x1e0313(0xd8)](_0x102dcf);const _0x141a2b=resolve(_0xa0bfe5,_0x1e0313(0x6e));if(existsSync(_0x141a2b))_0x34630e[_0x1e0313(0xd8)](_0x141a2b);const _0x3648ea=resolve(_0xa0bfe5,_0x1e0313(0x99));if(existsSync(_0x3648ea))_0x34630e[_0x1e0313(0xd8)](_0x3648ea);for(const _0x45a73b of collectIdeSkillFiles(_0xa0bfe5)){if(existsSync(_0x45a73b))_0x34630e[_0x1e0313(0xd8)](_0x45a73b);}let _0x9a783d=null;const _0x5eb243=resolve(_0xa0bfe5,_0x1e0313(0x7d));if(existsSync(_0x5eb243))try{const _0x385f81=JSON[_0x1e0313(0xe0)](readFileSync(_0x5eb243,_0x1e0313(0x79)));if(_0x385f81?.[_0x1e0313(0xce)]&&typeof _0x385f81['mcpServers']===_0x1e0313(0xcb)){const _0x123ac5=[];for(const [_0x3bb510,_0x274f46]of Object['entries'](_0x385f81['mcpServers'])){const _0x4535fe=_0x274f46;_0x4535fe?.[_0x1e0313(0xa5)]&&Array[_0x1e0313(0x75)](_0x4535fe[_0x1e0313(0xa5)])&&_0x4535fe['args'][_0x1e0313(0xa6)](_0x4e0d61=>typeof _0x4e0d61===_0x1e0313(0xdb)&&_0x4e0d61[_0x1e0313(0xa2)](_0x1e0313(0xcc)))&&_0x123ac5['push'](_0x3bb510);}_0x123ac5[_0x1e0313(0xa1)]>0x0&&(_0x9a783d={'path':_0x5eb243,'keys':_0x123ac5});}}catch{}const _0x11b00d=_0x34630e[_0x1e0313(0xa1)]>0x0||_0x29c1da!==null;let _0x125780=null;const _0x280781=resolve(_0xa0bfe5,_0x1e0313(0x9c));if(existsSync(_0x280781))try{const _0x3a30af=JSON[_0x1e0313(0xe0)](readFileSync(_0x280781,_0x1e0313(0x79)));for(const _0x226d3e of[_0x1e0313(0x6f),_0x1e0313(0x90)]){const _0x38edef=_0x3a30af?.[_0x226d3e]?.[_0x1e0313(0x81)];if(typeof _0x38edef===_0x1e0313(0xdb)){_0x38edef!==_0x1e0313(0xca)&&(_0x125780={'pkgPath':_0x280781,'currentVersion':_0x38edef,'field':_0x226d3e});break;}}}catch{}return{'configMigration':_0x29c1da,'oldArtifacts':_0x34630e,'oldMcpConfig':_0x9a783d,'needsSkillSwap':_0x11b00d,'sdkUpgrade':_0x125780};}function printReport(_0x529941){const _0x57a9c5=a169_0x398952,{configMigration:_0x206566,oldArtifacts:_0x454d17,oldMcpConfig:_0x561104,needsSkillSwap:_0x12464d}=_0x529941;console[_0x57a9c5(0xaa)](''),console[_0x57a9c5(0xaa)](a169_0x20efdb[_0x57a9c5(0xd5)](_0x57a9c5(0xd6))),console[_0x57a9c5(0xaa)]('');_0x206566?(console[_0x57a9c5(0xaa)](a169_0x20efdb[_0x57a9c5(0xb6)](_0x57a9c5(0x7f))+('\x20\x20'+a169_0x20efdb[_0x57a9c5(0xb5)](_0x206566[_0x57a9c5(0xbd)]))),console[_0x57a9c5(0xaa)](_0x57a9c5(0xa8)+(_0x206566[_0x57a9c5(0x97)]?a169_0x20efdb[_0x57a9c5(0x67)]('already\x20exists\x20(will\x20merge)'):a169_0x20efdb[_0x57a9c5(0x95)](_0x57a9c5(0xa9)))),console[_0x57a9c5(0xaa)](_0x57a9c5(0x77)+_0x206566[_0x57a9c5(0xc4)][_0x57a9c5(0x76)](',\x20')),console[_0x57a9c5(0xaa)](_0x57a9c5(0xd3))):console[_0x57a9c5(0xaa)](a169_0x20efdb['cyan'](_0x57a9c5(0x7f))+'\x20\x20'+a169_0x20efdb[_0x57a9c5(0x95)](_0x57a9c5(0x70)));console[_0x57a9c5(0xaa)]('');if(_0x454d17['length']>0x0){console[_0x57a9c5(0xaa)](a169_0x20efdb['cyan'](_0x57a9c5(0x83)));for(const _0xe940a9 of _0x454d17){console[_0x57a9c5(0xaa)]('\x20\x20'+a169_0x20efdb[_0x57a9c5(0x9e)]('FOUND')+'\x20\x20'+_0xe940a9);}console[_0x57a9c5(0xaa)](_0x57a9c5(0x65));}else console[_0x57a9c5(0xaa)](a169_0x20efdb[_0x57a9c5(0xb6)]('Legacy\x20artifacts:')+'\x20\x20'+a169_0x20efdb[_0x57a9c5(0x95)]('none\x20found'));console[_0x57a9c5(0xaa)]('');_0x561104?(console['log'](a169_0x20efdb[_0x57a9c5(0xb6)](_0x57a9c5(0xb8))+('\x20\x20'+a169_0x20efdb[_0x57a9c5(0xb5)](_0x561104[_0x57a9c5(0xb7)])+_0x57a9c5(0xba)+_0x561104[_0x57a9c5(0xd9)][_0x57a9c5(0x76)](',\x20'))),console[_0x57a9c5(0xaa)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x57a9c5(0xaa)](a169_0x20efdb[_0x57a9c5(0xb6)](_0x57a9c5(0xb8))+'\x20\x20'+a169_0x20efdb[_0x57a9c5(0x95)](_0x57a9c5(0x64)));console[_0x57a9c5(0xaa)](''),console[_0x57a9c5(0xaa)](a169_0x20efdb['cyan']('Skill\x20swap:')+('\x20\x20'+(_0x12464d?a169_0x20efdb[_0x57a9c5(0xb5)](_0x57a9c5(0x80)):a169_0x20efdb[_0x57a9c5(0x67)](_0x57a9c5(0xab)))));_0x12464d&&console[_0x57a9c5(0xaa)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x57a9c5(0xaa)]('');if(_0x529941[_0x57a9c5(0x91)]){const {currentVersion:_0x5e7e6d,field:_0x13a7ad,pkgPath:_0xbdf5e8}=_0x529941['sdkUpgrade'];console['log'](a169_0x20efdb[_0x57a9c5(0xb6)](_0x57a9c5(0xad))+('\x20\x20'+a169_0x20efdb['yellow'](_0xbdf5e8))),console[_0x57a9c5(0xaa)](_0x57a9c5(0x96)+_0x13a7ad+':\x20'+a169_0x20efdb[_0x57a9c5(0xb5)](_0x5e7e6d)+_0x57a9c5(0xcf)+a169_0x20efdb[_0x57a9c5(0x67)]('latest')),console[_0x57a9c5(0xaa)](_0x57a9c5(0xa0));}else console[_0x57a9c5(0xaa)](a169_0x20efdb[_0x57a9c5(0xb6)](_0x57a9c5(0xad))+'\x20\x20'+a169_0x20efdb[_0x57a9c5(0x95)](_0x57a9c5(0x7b)));console['log']('');}function execConfigMigration(_0x5a91f0,_0x1aa302){const _0x313140=a169_0x398952,{configMigration:_0x1846b5}=_0x5a91f0;if(!_0x1846b5?.[_0x313140(0xbd)])return{'step':0x1,'label':_0x313140(0xde),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x53f719=readConfigFile(_0x1846b5[_0x313140(0xbd)]),_0x25f184=resolve(_0x1aa302,NEW_CONFIG_NAME),_0x270815=_0x1846b5[_0x313140(0x97)]?readConfigFile(_0x25f184):{};for(const [_0xbae0e8,_0x2dea27]of Object[_0x313140(0x86)](_0x53f719)){!(_0xbae0e8 in _0x270815)&&(_0x270815[_0xbae0e8]=_0x2dea27);}writeConfigFile(_0x25f184,_0x270815);const _0x49b125=_0x1846b5[_0x313140(0xbd)]+_0x313140(0x92);return renameSync(_0x1846b5[_0x313140(0xbd)],_0x49b125),{'step':0x1,'label':_0x313140(0xde),'ok':!![],'detail':_0x1846b5['oldPath']+_0x313140(0xcf)+_0x25f184+'\x20(backup:\x20'+_0x49b125+')'};}function a169_0x1b53(){const _0x4161e0=['Step\x201/7:\x20Migrating\x20config...','26999270xRpcWR','[\x22@lovrabet/sdk\x22]:\x20','79397MNfYvx','latest','object','@lovrabet/dataset-mcp-server','exit\x20','mcpServers','\x20→\x20','Step\x206/7:\x20Installing\x20new\x20skill...','Step\x205/7:\x20Removing\x20old\x20skill...','oldMcpConfig','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','stringify','bold','===\x20Upgrade\x20Analysis\x20===','files','push','keys','fail','string','error','needsSkillSwap','Config\x20migration','label','parse','no\x20legacy\x20entry','\x20\x20Action:\x20delete','18kSvKyp','green','failed','Remove\x20old\x20skill','Remove\x20legacy\x20artifacts','values','\x20removed\x20(','CANCEL','.cursor/rules/lovrabet_rules.mdc','dependencies','no\x20legacy\x20config\x20found','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','start','\x20from\x20','removed\x20','isArray','join','\x20\x20Fields\x20to\x20migrate:\x20','lovrabet/rabetbase','utf8','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','not\x20found\x20or\x20already\x20at\x20latest','59337KQLsZC','.cursor/mcp.json','\x20\x20npm\x20install','Config\x20file:','needed','@lovrabet/sdk','Step\x201/7:\x20Config\x20migration\x20—\x20','Legacy\x20artifacts:','no\x20matching\x20entry\x20found','1768aRdWsL','entries','4448aYLAhN','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','2838248LGKdCl','yes','Upgrade\x20@lovrabet/sdk','8298855XqIbZq','2110591cXICWG','Upgrade\x20cancelled.','devDependencies','sdkUpgrade','.bak','Clean\x20MCP\x20config','succeed','gray','\x20\x20Current\x20version\x20in\x20','hasNewConfig','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','.claude/skills/lovrabet','message','Step\x204/7:\x20MCP\x20config\x20—\x20','package.json','filter','red','951AfZSjz','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','length','includes','Remove\x20.lovrabet/','info','args','some','white','\x20\x20New\x20config\x20(.rabetbase.json):\x20','not\x20found\x20(will\x20create)','log','not\x20needed','status','@lovrabet/sdk:','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','lovrabet/rabetbase\x20installed\x20globally','detail','Upgrade\x20completed\x20successfully!','skipped','isDirectory','inherit','yellow','cyan','path','MCP\x20config:','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','\x20→\x20keys:\x20','\x20\x20#\x20or','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','oldPath','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','.lovrabet','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','\x20\x20\x20\x20\x20\x20\x20','done','fields','Step\x207/7:\x20@lovrabet/sdk\x20—\x20'];a169_0x1b53=function(){return _0x4161e0;};return a169_0x1b53();}function execRemoveOldArtifacts(_0x5c3dd1){const _0xa0ac2e=a169_0x398952,_0x32fb33=[];for(const _0x415945 of _0x5c3dd1){try{if(!existsSync(_0x415945))continue;const _0x56ec9a=tryStat(_0x415945);_0x56ec9a?.[_0xa0ac2e(0xb3)]()?rmSync(_0x415945,{'recursive':!![],'force':!![]}):unlinkSync(_0x415945);}catch(_0x3467db){_0x32fb33[_0xa0ac2e(0xd8)](_0x415945+':\x20'+_0x3467db[_0xa0ac2e(0x9a)]);}}return{'step':0x3,'label':_0xa0ac2e(0x6a),'ok':_0x32fb33[_0xa0ac2e(0xa1)]===0x0,'detail':_0x32fb33[_0xa0ac2e(0xa1)]>0x0?_0x5c3dd1['length']-_0x32fb33[_0xa0ac2e(0xa1)]+'/'+_0x5c3dd1[_0xa0ac2e(0xa1)]+_0xa0ac2e(0x6c)+_0x32fb33[_0xa0ac2e(0x76)](';\x20')+')':_0x5c3dd1[_0xa0ac2e(0xa1)]+'\x20removed'};}function execCleanMcp(_0x5a7eff){const _0x1bdbd4=a169_0x398952;if(!_0x5a7eff[_0x1bdbd4(0xd2)])return{'step':0x4,'label':_0x1bdbd4(0x93),'ok':!![],'detail':'skipped'};try{const _0x2b8ab4=readFileSync(_0x5a7eff[_0x1bdbd4(0xd2)][_0x1bdbd4(0xb7)],_0x1bdbd4(0x79)),_0x39f8e1=JSON[_0x1bdbd4(0xe0)](_0x2b8ab4);if(_0x39f8e1?.[_0x1bdbd4(0xce)]&&typeof _0x39f8e1[_0x1bdbd4(0xce)]===_0x1bdbd4(0xcb)){const _0x2d07c6=[];for(const [_0x4987eb,_0x56ea8d]of Object['entries'](_0x39f8e1[_0x1bdbd4(0xce)])){_0x56ea8d?.[_0x1bdbd4(0xa5)]&&Array[_0x1bdbd4(0x75)](_0x56ea8d['args'])&&_0x56ea8d['args']['some'](_0x40f115=>typeof _0x40f115===_0x1bdbd4(0xdb)&&_0x40f115['includes'](_0x1bdbd4(0xcc)))&&_0x2d07c6[_0x1bdbd4(0xd8)](_0x4987eb);}for(const _0x54b315 of _0x2d07c6){delete _0x39f8e1['mcpServers'][_0x54b315];}return _0x2d07c6[_0x1bdbd4(0xa1)]>0x0&&writeFileSync(_0x5a7eff[_0x1bdbd4(0xd2)][_0x1bdbd4(0xb7)],JSON[_0x1bdbd4(0xd4)](_0x39f8e1,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0x1bdbd4(0x93),'ok':!![],'detail':_0x1bdbd4(0x74)+_0x2d07c6[_0x1bdbd4(0x76)](',\x20')+_0x1bdbd4(0x73)+_0x5a7eff[_0x1bdbd4(0xd2)][_0x1bdbd4(0xb7)]};}return{'step':0x4,'label':_0x1bdbd4(0x93),'ok':!![],'detail':_0x1bdbd4(0x84)};}catch(_0x219494){return{'step':0x4,'label':_0x1bdbd4(0x93),'ok':![],'detail':_0x219494[_0x1bdbd4(0x9a)]};}}function execSkillsRemove(_0x1fc7cc,_0x46d9c2){const _0x529232=a169_0x398952,_0xb468aa=runNpxSkillsRemove(_0x1fc7cc,{'stdio':_0x529232(0xb4),'yes':_0x46d9c2});return{'step':0x5,'label':_0x529232(0x69),'ok':_0xb468aa['ok'],'detail':_0xb468aa['ok']?'lovrabet/lovrabet-skill\x20removed':_0xb468aa[_0x529232(0xdc)]??'exit\x20'+_0xb468aa[_0x529232(0xac)]};}function execSkillsAdd(_0x6f8a9e,_0x2d42c1){const _0x1b622d=a169_0x398952,_0x293d3a=runNpxSkillsAddGlobal(_0x6f8a9e,_0x1b622d(0x78),{'stdio':_0x1b622d(0xb4),'yes':_0x2d42c1});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0x293d3a['ok'],'detail':_0x293d3a['ok']?_0x1b622d(0xaf):_0x293d3a[_0x1b622d(0xdc)]??_0x1b622d(0xcd)+_0x293d3a[_0x1b622d(0xac)]};}function execUpgradeSdk(_0x3425ee){const _0x37d603=a169_0x398952;if(!_0x3425ee[_0x37d603(0x91)])return{'step':0x7,'label':_0x37d603(0x8c),'ok':!![],'detail':_0x37d603(0xb9)};const {pkgPath:_0x35d8fc,currentVersion:_0x33060b,field:_0x410457}=_0x3425ee[_0x37d603(0x91)];try{const _0x5c0460=readFileSync(_0x35d8fc,_0x37d603(0x79)),_0x11be56=JSON[_0x37d603(0xe0)](_0x5c0460);return _0x11be56[_0x410457][_0x37d603(0x81)]='latest',writeFileSync(_0x35d8fc,JSON[_0x37d603(0xd4)](_0x11be56,null,0x2)+'\x0a',_0x37d603(0x79)),{'step':0x7,'label':_0x37d603(0x8c),'ok':!![],'detail':_0x410457+_0x37d603(0xc8)+_0x33060b+'\x20→\x20latest'};}catch(_0x3f636f){return{'step':0x7,'label':_0x37d603(0x8c),'ok':![],'detail':_0x3f636f['message']};}}function tryStat(_0x4f7820){try{return statSync(_0x4f7820);}catch{return undefined;}}function printSummary(_0x35c3df){const _0x4dcc6d=a169_0x398952;console[_0x4dcc6d(0xaa)](''),console[_0x4dcc6d(0xaa)](a169_0x20efdb[_0x4dcc6d(0xd5)]('===\x20Upgrade\x20Summary\x20===')),console[_0x4dcc6d(0xaa)]('');for(const _0x36c4ba of _0x35c3df){const _0x37afa2=_0x36c4ba['ok']?a169_0x20efdb[_0x4dcc6d(0x67)]('OK'):a169_0x20efdb[_0x4dcc6d(0x9e)]('FAIL');console[_0x4dcc6d(0xaa)]('\x20\x20'+_0x37afa2+'\x20\x20Step\x20'+_0x36c4ba['step']+':\x20'+_0x36c4ba[_0x4dcc6d(0xdf)]);if(_0x36c4ba[_0x4dcc6d(0xb0)])console[_0x4dcc6d(0xaa)](_0x4dcc6d(0xc2)+a169_0x20efdb[_0x4dcc6d(0x95)](_0x36c4ba[_0x4dcc6d(0xb0)]));}console[_0x4dcc6d(0xaa)]('');}export async function upgradeApp(_0x21c011,_0x4d8a51){const _0xb26ede=a169_0x398952,_0x32e87c=process['cwd'](),_0x5d35f7=analyse(_0x32e87c),_0x34011e=!_0x5d35f7['configMigration']&&_0x5d35f7['oldArtifacts']['length']===0x0&&!_0x5d35f7[_0xb26ede(0xd2)]&&!_0x5d35f7[_0xb26ede(0xdd)]&&!_0x5d35f7[_0xb26ede(0x91)];if(_0x34011e){console['log'](a169_0x20efdb[_0xb26ede(0x67)](_0xb26ede(0xbc)));return;}printReport(_0x5d35f7);const _0x369e62=!!(_0x4d8a51[_0xb26ede(0x8b)]||_0x4d8a51['Y']||_0x21c011);if(!_0x369e62)try{const _0x52d277=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x52d277){console[_0xb26ede(0xaa)](a169_0x20efdb[_0xb26ede(0x95)](_0xb26ede(0x8f)));return;}}catch(_0x587482){if(_0x587482?.[_0xb26ede(0x9a)]===_0xb26ede(0x6d)){console['log'](a169_0x20efdb[_0xb26ede(0x95)]('Upgrade\x20cancelled.'));return;}throw _0x587482;}const _0x1c8595=[],_0x3de1b0=a169_0x2ab5a5({'text':_0xb26ede(0xc6),'color':_0xb26ede(0xb6)})['start'](),_0x4d3b4d=execConfigMigration(_0x5d35f7,_0x32e87c);_0x1c8595['push'](_0x4d3b4d),_0x3de1b0[_0x4d3b4d['ok']?_0xb26ede(0x94):_0xb26ede(0xda)](_0xb26ede(0x82)+(_0x4d3b4d[_0xb26ede(0xb0)]??(_0x4d3b4d['ok']?_0xb26ede(0xc3):'failed')));const _0x10308d=resolve(_0x32e87c,'.lovrabet'),_0x1ebdee=a169_0x2ab5a5({'text':'Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','color':_0xb26ede(0xb6)})['start']();if(existsSync(_0x10308d))try{rmSync(_0x10308d,{'recursive':!![],'force':!![]}),_0x1ebdee['succeed'](_0xb26ede(0x7a)),_0x1c8595[_0xb26ede(0xd8)]({'step':0x2,'label':_0xb26ede(0xa3),'ok':!![]});}catch(_0x14dcdc){_0x1ebdee[_0xb26ede(0xda)](_0xb26ede(0xbe)+_0x14dcdc[_0xb26ede(0x9a)]),_0x1c8595[_0xb26ede(0xd8)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x14dcdc[_0xb26ede(0x9a)]});}else _0x1ebdee[_0xb26ede(0xa4)]('Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0x1c8595[_0xb26ede(0xd8)]({'step':0x2,'label':_0xb26ede(0xa3),'ok':!![],'detail':_0xb26ede(0xb2)});const _0x1f2e2c=a169_0x2ab5a5({'text':_0xb26ede(0xbf),'color':_0xb26ede(0xb6)})['start'](),_0x300dcd=execRemoveOldArtifacts(_0x5d35f7['oldArtifacts']);_0x1c8595[_0xb26ede(0xd8)](_0x300dcd),_0x1f2e2c[_0x300dcd['ok']?_0xb26ede(0x94):'fail']('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x300dcd[_0xb26ede(0xb0)]??(_0x300dcd['ok']?_0xb26ede(0xc3):_0xb26ede(0x68))));const _0x1ed386=a169_0x2ab5a5({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':_0xb26ede(0xb6)})[_0xb26ede(0x72)](),_0x3f8120=execCleanMcp(_0x5d35f7);_0x1c8595[_0xb26ede(0xd8)](_0x3f8120),_0x1ed386[_0x3f8120['ok']?_0xb26ede(0x94):_0xb26ede(0xda)](_0xb26ede(0x9b)+(_0x3f8120[_0xb26ede(0xb0)]??(_0x3f8120['ok']?_0xb26ede(0xc3):_0xb26ede(0x68))));const _0x38bfbc=a169_0x2ab5a5({'text':_0xb26ede(0xd1),'color':_0xb26ede(0xb6)})[_0xb26ede(0x72)](),_0x2c7be2=execSkillsRemove(_0x32e87c,_0x369e62);_0x1c8595[_0xb26ede(0xd8)](_0x2c7be2),_0x38bfbc[_0x2c7be2['ok']?_0xb26ede(0x94):_0xb26ede(0xda)](_0xb26ede(0x98)+(_0x2c7be2[_0xb26ede(0xb0)]??(_0x2c7be2['ok']?_0xb26ede(0xc3):_0xb26ede(0x68))));const _0xa7b954=a169_0x2ab5a5({'text':_0xb26ede(0xd0),'color':_0xb26ede(0xb6)})[_0xb26ede(0x72)](),_0x32013c=execSkillsAdd(_0x32e87c,_0x369e62);_0x1c8595[_0xb26ede(0xd8)](_0x32013c),_0xa7b954[_0x32013c['ok']?_0xb26ede(0x94):_0xb26ede(0xda)](_0xb26ede(0x89)+(_0x32013c[_0xb26ede(0xb0)]??(_0x32013c['ok']?'done':_0xb26ede(0x68))));const _0x30f4ff=a169_0x2ab5a5({'text':_0xb26ede(0x71),'color':_0xb26ede(0xb6)})[_0xb26ede(0x72)](),_0x3ae785=execUpgradeSdk(_0x5d35f7);_0x1c8595['push'](_0x3ae785),_0x30f4ff[_0x3ae785['ok']?_0xb26ede(0x94):_0xb26ede(0xda)](_0xb26ede(0xc5)+(_0x3ae785['detail']??(_0x3ae785['ok']?_0xb26ede(0xc3):_0xb26ede(0x68)))),printSummary(_0x1c8595);const _0x254f55=_0x1c8595[_0xb26ede(0xa6)](_0x5aeb49=>!_0x5aeb49['ok']);_0x254f55?console[_0xb26ede(0xaa)](a169_0x20efdb[_0xb26ede(0xb5)](_0xb26ede(0x88))):console[_0xb26ede(0xaa)](a169_0x20efdb['green'](_0xb26ede(0xb1))),_0x3ae785['ok']&&_0x5d35f7[_0xb26ede(0x91)]&&(console['log'](''),console['log'](a169_0x20efdb['bold'][_0xb26ede(0xb6)](_0xb26ede(0xc1))),console[_0xb26ede(0xaa)](a169_0x20efdb[_0xb26ede(0xb6)](_0xb26ede(0xae))),console[_0xb26ede(0xaa)](''),console['log'](a169_0x20efdb[_0xb26ede(0xa7)](_0xb26ede(0x7e))),console[_0xb26ede(0xaa)](a169_0x20efdb[_0xb26ede(0xa7)](_0xb26ede(0xbb))),console['log'](a169_0x20efdb['white']('\x20\x20bun\x20install')),console[_0xb26ede(0xaa)](''));}
1
+ const a169_0x2d3c50=a169_0x2d0c;(function(_0x1cf8cb,_0x3cccb5){const _0x4f720e=a169_0x2d0c,_0xa5d4a0=_0x1cf8cb();while(!![]){try{const _0x193ab9=parseInt(_0x4f720e(0xaa))/0x1+-parseInt(_0x4f720e(0xd9))/0x2+parseInt(_0x4f720e(0xd6))/0x3*(parseInt(_0x4f720e(0x114))/0x4)+parseInt(_0x4f720e(0xb6))/0x5+-parseInt(_0x4f720e(0xab))/0x6+parseInt(_0x4f720e(0xf2))/0x7*(parseInt(_0x4f720e(0xf0))/0x8)+-parseInt(_0x4f720e(0xa2))/0x9*(parseInt(_0x4f720e(0xe6))/0xa);if(_0x193ab9===_0x3cccb5)break;else _0xa5d4a0['push'](_0xa5d4a0['shift']());}catch(_0x261837){_0xa5d4a0['push'](_0xa5d4a0['shift']());}}}(a169_0x1ed6,0x716b2));import a169_0xda8879 from'chalk';function a169_0x1ed6(){const _0x299f92=['@lovrabet/sdk','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','step','oldArtifacts','===\x20Upgrade\x20Analysis\x20===','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','lovrabet/rabetbase\x20installed\x20globally','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','isDirectory','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','\x20\x20\x20\x20\x20\x20\x20','bold','190mkfTLm','.bak','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','red','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','not\x20found\x20or\x20already\x20at\x20latest','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','oldPath','\x20→\x20latest','1497416WdDPSv','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','28msXrjU','start','skipped\x20(no\x20legacy\x20config)','keys','no\x20legacy\x20config\x20found','yes','error','detail','Remove\x20legacy\x20artifacts','Remove\x20old\x20skill','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','succeed','Remove\x20.lovrabet/','green','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','not\x20found\x20(will\x20create)','failed','values','@lovrabet/dataset-mcp-server','lovrabet/lovrabet-skill\x20removed','FOUND','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Proceed\x20with\x20upgrade?','needed','object','stringify','Clean\x20MCP\x20config','done','hasNewConfig','gray','includes','Config\x20migration','\x20→\x20','fail','39892skzYpk','Install\x20new\x20skill','files','Step\x201/7:\x20Migrating\x20config...','latest','some','removed\x20','isArray','cyan','cwd','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','utf8','mcpServers','MCP\x20config:','entries','args','oldMcpConfig','Upgrade\x20@lovrabet/sdk','yellow','\x20\x20#\x20or','407529odQSdx','configMigration','Step\x204/7:\x20MCP\x20config\x20—\x20','Step\x201/7:\x20Config\x20migration\x20—\x20','Step\x206/7:\x20Installing\x20new\x20skill...','label','exit\x20','none\x20found','909800xQJjUW','5096562AkPwyD','log','Legacy\x20artifacts:','\x20from\x20','status','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','dependencies','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','\x20removed','not\x20needed','Step\x204/7:\x20Cleaning\x20MCP\x20config...','2451105bjDGje','undefined','package.json','string','info','parse','no\x20matching\x20entry\x20found','skipped','length','.cursor/rules/lovrabet_rules.mdc','already\x20exists\x20(will\x20merge)','Config\x20file:','\x20\x20Action:\x20delete','filter','Upgrade\x20cancelled.','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','white','@lovrabet/sdk:','\x20\x20Fields\x20to\x20migrate:\x20','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','Skill\x20swap:','path','join','push','.lovrabet','\x20removed\x20(','message','Upgrade\x20completed\x20successfully!','\x20→\x20keys:\x20','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','\x20(backup:\x20','.cursor/mcp.json','9VrpvkS','sdkUpgrade','\x20\x20Current\x20version\x20in\x20','8640SZXCJP'];a169_0x1ed6=function(){return _0x299f92;};return a169_0x1ed6();}import a169_0x4d3d07 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a169_0x2d3c50(0xc3)](_0x890f1a=>_0x890f1a!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x2b74cd){const _0x20e407=a169_0x2d3c50,_0x40de9e=[];for(const _0x2db570 of Object[_0x20e407(0x103)](CORE_IDE_CONFIGS)){if(_0x2db570[_0x20e407(0x116)])for(const _0x1e8930 of _0x2db570[_0x20e407(0x116)]){_0x40de9e[_0x20e407(0xcd)](resolve(_0x2b74cd,_0x1e8930[_0x20e407(0xcb)]));}}return _0x40de9e;}function a169_0x2d0c(_0x265fb8,_0x23eab6){_0x265fb8=_0x265fb8-0x98;const _0x1ed65e=a169_0x1ed6();let _0x2d0c70=_0x1ed65e[_0x265fb8];return _0x2d0c70;}function analyse(_0x388070){const _0x3abc9f=a169_0x2d3c50;let _0x5c1bb0=null;const _0x2dafb2=resolve(_0x388070,NEW_CONFIG_NAME),_0x4515fe=existsSync(_0x2dafb2);for(const _0x346fb3 of LEGACY_CONFIG_NAMES){const _0x4accb3=resolve(_0x388070,_0x346fb3);if(existsSync(_0x4accb3)){const _0x31eb7a=readConfigFile(_0x4accb3),_0x9cf20e=Object[_0x3abc9f(0xf5)](_0x31eb7a)[_0x3abc9f(0xc3)](_0x15d3a2=>typeof _0x31eb7a[_0x15d3a2]!==_0x3abc9f(0xb7));_0x5c1bb0={'oldPath':_0x4accb3,'hasNewConfig':_0x4515fe,'fields':_0x9cf20e};break;}}const _0x2584bc=[],_0x6d9a63=resolve(_0x388070,_0x3abc9f(0xce));if(existsSync(_0x6d9a63))_0x2584bc[_0x3abc9f(0xcd)](_0x6d9a63);const _0x23a1c3=resolve(_0x388070,_0x3abc9f(0xbf));if(existsSync(_0x23a1c3))_0x2584bc['push'](_0x23a1c3);const _0x1f65d7=resolve(_0x388070,'.claude/skills/lovrabet');if(existsSync(_0x1f65d7))_0x2584bc[_0x3abc9f(0xcd)](_0x1f65d7);for(const _0xd22b3d of collectIdeSkillFiles(_0x388070)){if(existsSync(_0xd22b3d))_0x2584bc[_0x3abc9f(0xcd)](_0xd22b3d);}let _0x379b75=null;const _0x2406be=resolve(_0x388070,_0x3abc9f(0xd5));if(existsSync(_0x2406be))try{const _0x11ca41=JSON[_0x3abc9f(0xbb)](readFileSync(_0x2406be,'utf8'));if(_0x11ca41?.[_0x3abc9f(0x9a)]&&typeof _0x11ca41[_0x3abc9f(0x9a)]==='object'){const _0x174271=[];for(const [_0x45b278,_0x2b2a24]of Object[_0x3abc9f(0x9c)](_0x11ca41[_0x3abc9f(0x9a)])){const _0x19f421=_0x2b2a24;_0x19f421?.[_0x3abc9f(0x9d)]&&Array[_0x3abc9f(0x11b)](_0x19f421[_0x3abc9f(0x9d)])&&_0x19f421[_0x3abc9f(0x9d)][_0x3abc9f(0x119)](_0x3ff515=>typeof _0x3ff515===_0x3abc9f(0xb9)&&_0x3ff515[_0x3abc9f(0x110)](_0x3abc9f(0x104)))&&_0x174271[_0x3abc9f(0xcd)](_0x45b278);}_0x174271[_0x3abc9f(0xbe)]>0x0&&(_0x379b75={'path':_0x2406be,'keys':_0x174271});}}catch{}const _0x395fe2=_0x2584bc[_0x3abc9f(0xbe)]>0x0||_0x5c1bb0!==null;let _0x51a648=null;const _0x1c35c1=resolve(_0x388070,_0x3abc9f(0xb8));if(existsSync(_0x1c35c1))try{const _0x2c985d=JSON[_0x3abc9f(0xbb)](readFileSync(_0x1c35c1,'utf8'));for(const _0x16b077 of[_0x3abc9f(0xb1),'devDependencies']){const _0x5cf413=_0x2c985d?.[_0x16b077]?.[_0x3abc9f(0xda)];if(typeof _0x5cf413==='string'){_0x5cf413!==_0x3abc9f(0x118)&&(_0x51a648={'pkgPath':_0x1c35c1,'currentVersion':_0x5cf413,'field':_0x16b077});break;}}}catch{}return{'configMigration':_0x5c1bb0,'oldArtifacts':_0x2584bc,'oldMcpConfig':_0x379b75,'needsSkillSwap':_0x395fe2,'sdkUpgrade':_0x51a648};}function printReport(_0xd5f8c){const _0x1504f2=a169_0x2d3c50,{configMigration:_0x3fb8d9,oldArtifacts:_0x5f2b4a,oldMcpConfig:_0x64ea47,needsSkillSwap:_0x3a61e7}=_0xd5f8c;console[_0x1504f2(0xac)](''),console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0xe5)](_0x1504f2(0xde))),console[_0x1504f2(0xac)]('');_0x3fb8d9?(console[_0x1504f2(0xac)](a169_0xda8879['cyan']('Config\x20file:')+('\x20\x20'+a169_0xda8879[_0x1504f2(0xa0)](_0x3fb8d9['oldPath']))),console[_0x1504f2(0xac)](_0x1504f2(0x107)+(_0x3fb8d9[_0x1504f2(0x10e)]?a169_0xda8879[_0x1504f2(0xff)](_0x1504f2(0xc0)):a169_0xda8879[_0x1504f2(0x10f)](_0x1504f2(0x101)))),console[_0x1504f2(0xac)](_0x1504f2(0xc8)+_0x3fb8d9['fields'][_0x1504f2(0xcc)](',\x20')),console[_0x1504f2(0xac)](_0x1504f2(0xe1))):console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xc1))+'\x20\x20'+a169_0xda8879[_0x1504f2(0x10f)](_0x1504f2(0xf6)));console['log']('');if(_0x5f2b4a['length']>0x0){console['log'](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xad)));for(const _0x397465 of _0x5f2b4a){console[_0x1504f2(0xac)]('\x20\x20'+a169_0xda8879['red'](_0x1504f2(0x106))+'\x20\x20'+_0x397465);}console[_0x1504f2(0xac)](_0x1504f2(0xc2));}else console[_0x1504f2(0xac)](a169_0xda8879['cyan'](_0x1504f2(0xad))+'\x20\x20'+a169_0xda8879['gray'](_0x1504f2(0xa9)));console[_0x1504f2(0xac)]('');_0x64ea47?(console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0x9b))+('\x20\x20'+a169_0xda8879[_0x1504f2(0xa0)](_0x64ea47[_0x1504f2(0xcb)])+_0x1504f2(0xd2)+_0x64ea47[_0x1504f2(0xf5)][_0x1504f2(0xcc)](',\x20'))),console[_0x1504f2(0xac)](_0x1504f2(0xc9))):console[_0x1504f2(0xac)](a169_0xda8879['cyan'](_0x1504f2(0x9b))+'\x20\x20'+a169_0xda8879['gray']('no\x20legacy\x20entry'));console[_0x1504f2(0xac)](''),console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xca))+('\x20\x20'+(_0x3a61e7?a169_0xda8879['yellow'](_0x1504f2(0x109)):a169_0xda8879[_0x1504f2(0xff)](_0x1504f2(0xb4)))));_0x3a61e7&&console[_0x1504f2(0xac)](_0x1504f2(0xf1)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0xd5f8c[_0x1504f2(0xd7)]){const {currentVersion:_0x55566b,field:_0x510ea5,pkgPath:_0x34b185}=_0xd5f8c[_0x1504f2(0xd7)];console[_0x1504f2(0xac)](a169_0xda8879['cyan'](_0x1504f2(0xc7))+('\x20\x20'+a169_0xda8879[_0x1504f2(0xa0)](_0x34b185))),console['log'](_0x1504f2(0xd8)+_0x510ea5+':\x20'+a169_0xda8879['yellow'](_0x55566b)+_0x1504f2(0x112)+a169_0xda8879[_0x1504f2(0xff)](_0x1504f2(0x118))),console[_0x1504f2(0xac)](_0x1504f2(0xfc));}else console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xc7))+'\x20\x20'+a169_0xda8879[_0x1504f2(0x10f)](_0x1504f2(0xec)));console[_0x1504f2(0xac)]('');}function execConfigMigration(_0xdb7e7d,_0x5acd7a){const _0x260df6=a169_0x2d3c50,{configMigration:_0x416b76}=_0xdb7e7d;if(!_0x416b76?.[_0x260df6(0xee)])return{'step':0x1,'label':_0x260df6(0x111),'ok':!![],'detail':_0x260df6(0xf4)};const _0x207af5=readConfigFile(_0x416b76[_0x260df6(0xee)]),_0x5b0a60=resolve(_0x5acd7a,NEW_CONFIG_NAME),_0x45b054=_0x416b76[_0x260df6(0x10e)]?readConfigFile(_0x5b0a60):{};for(const [_0x20d26b,_0xd0efb6]of Object[_0x260df6(0x9c)](_0x207af5)){!(_0x20d26b in _0x45b054)&&(_0x45b054[_0x20d26b]=_0xd0efb6);}writeConfigFile(_0x5b0a60,_0x45b054);const _0x4aca99=_0x416b76[_0x260df6(0xee)]+_0x260df6(0xe7);return renameSync(_0x416b76[_0x260df6(0xee)],_0x4aca99),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x416b76[_0x260df6(0xee)]+_0x260df6(0x112)+_0x5b0a60+_0x260df6(0xd4)+_0x4aca99+')'};}function execRemoveOldArtifacts(_0x577636){const _0x291061=a169_0x2d3c50,_0x530760=[];for(const _0xc9cd3d of _0x577636){try{if(!existsSync(_0xc9cd3d))continue;const _0x1d25ae=tryStat(_0xc9cd3d);_0x1d25ae?.[_0x291061(0xe2)]()?rmSync(_0xc9cd3d,{'recursive':!![],'force':!![]}):unlinkSync(_0xc9cd3d);}catch(_0x52face){_0x530760[_0x291061(0xcd)](_0xc9cd3d+':\x20'+_0x52face[_0x291061(0xd0)]);}}return{'step':0x3,'label':_0x291061(0xfa),'ok':_0x530760[_0x291061(0xbe)]===0x0,'detail':_0x530760[_0x291061(0xbe)]>0x0?_0x577636[_0x291061(0xbe)]-_0x530760['length']+'/'+_0x577636[_0x291061(0xbe)]+_0x291061(0xcf)+_0x530760['join'](';\x20')+')':_0x577636[_0x291061(0xbe)]+_0x291061(0xb3)};}function execCleanMcp(_0x2a7ce3){const _0x33de67=a169_0x2d3c50;if(!_0x2a7ce3['oldMcpConfig'])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'skipped'};try{const _0x403374=readFileSync(_0x2a7ce3['oldMcpConfig']['path'],_0x33de67(0x99)),_0x210414=JSON[_0x33de67(0xbb)](_0x403374);if(_0x210414?.[_0x33de67(0x9a)]&&typeof _0x210414[_0x33de67(0x9a)]===_0x33de67(0x10a)){const _0x53e787=[];for(const [_0x285311,_0x53f00c]of Object[_0x33de67(0x9c)](_0x210414['mcpServers'])){_0x53f00c?.[_0x33de67(0x9d)]&&Array[_0x33de67(0x11b)](_0x53f00c[_0x33de67(0x9d)])&&_0x53f00c['args'][_0x33de67(0x119)](_0x3ad408=>typeof _0x3ad408===_0x33de67(0xb9)&&_0x3ad408[_0x33de67(0x110)](_0x33de67(0x104)))&&_0x53e787[_0x33de67(0xcd)](_0x285311);}for(const _0x2dc817 of _0x53e787){delete _0x210414[_0x33de67(0x9a)][_0x2dc817];}return _0x53e787['length']>0x0&&writeFileSync(_0x2a7ce3['oldMcpConfig'][_0x33de67(0xcb)],JSON[_0x33de67(0x10b)](_0x210414,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0x33de67(0x10c),'ok':!![],'detail':_0x33de67(0x11a)+_0x53e787[_0x33de67(0xcc)](',\x20')+_0x33de67(0xae)+_0x2a7ce3['oldMcpConfig'][_0x33de67(0xcb)]};}return{'step':0x4,'label':_0x33de67(0x10c),'ok':!![],'detail':_0x33de67(0xbc)};}catch(_0xa7db19){return{'step':0x4,'label':_0x33de67(0x10c),'ok':![],'detail':_0xa7db19[_0x33de67(0xd0)]};}}function execSkillsRemove(_0x596b82,_0x36a16c){const _0xed5900=a169_0x2d3c50,_0x548224=runNpxSkillsRemove(_0x596b82,{'stdio':'inherit','yes':_0x36a16c});return{'step':0x5,'label':_0xed5900(0xfb),'ok':_0x548224['ok'],'detail':_0x548224['ok']?_0xed5900(0x105):_0x548224[_0xed5900(0xf8)]??'exit\x20'+_0x548224[_0xed5900(0xaf)]};}function execSkillsAdd(_0x3f35ed,_0x33f058){const _0x255f64=a169_0x2d3c50,_0xbda368=runNpxSkillsAddGlobal(_0x3f35ed,'lovrabet/rabetbase',{'stdio':'inherit','yes':_0x33f058});return{'step':0x6,'label':_0x255f64(0x115),'ok':_0xbda368['ok'],'detail':_0xbda368['ok']?_0x255f64(0xe0):_0xbda368[_0x255f64(0xf8)]??_0x255f64(0xa8)+_0xbda368[_0x255f64(0xaf)]};}function execUpgradeSdk(_0x4a765f){const _0x515ae4=a169_0x2d3c50;if(!_0x4a765f[_0x515ae4(0xd7)])return{'step':0x7,'label':_0x515ae4(0x9f),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x4adb64,currentVersion:_0x1b47b2,field:_0x3341a7}=_0x4a765f['sdkUpgrade'];try{const _0x49bdc5=readFileSync(_0x4adb64,_0x515ae4(0x99)),_0xc884fe=JSON[_0x515ae4(0xbb)](_0x49bdc5);return _0xc884fe[_0x3341a7]['@lovrabet/sdk']=_0x515ae4(0x118),writeFileSync(_0x4adb64,JSON[_0x515ae4(0x10b)](_0xc884fe,null,0x2)+'\x0a',_0x515ae4(0x99)),{'step':0x7,'label':_0x515ae4(0x9f),'ok':!![],'detail':_0x3341a7+'[\x22@lovrabet/sdk\x22]:\x20'+_0x1b47b2+_0x515ae4(0xef)};}catch(_0x4a45f1){return{'step':0x7,'label':_0x515ae4(0x9f),'ok':![],'detail':_0x4a45f1[_0x515ae4(0xd0)]};}}function tryStat(_0x51028b){try{return statSync(_0x51028b);}catch{return undefined;}}function printSummary(_0x239a30){const _0x4bb890=a169_0x2d3c50;console[_0x4bb890(0xac)](''),console['log'](a169_0xda8879['bold']('===\x20Upgrade\x20Summary\x20===')),console[_0x4bb890(0xac)]('');for(const _0x55989f of _0x239a30){const _0x579a6f=_0x55989f['ok']?a169_0xda8879[_0x4bb890(0xff)]('OK'):a169_0xda8879[_0x4bb890(0xea)]('FAIL');console[_0x4bb890(0xac)]('\x20\x20'+_0x579a6f+'\x20\x20Step\x20'+_0x55989f[_0x4bb890(0xdc)]+':\x20'+_0x55989f[_0x4bb890(0xa7)]);if(_0x55989f[_0x4bb890(0xf9)])console['log'](_0x4bb890(0xe4)+a169_0xda8879[_0x4bb890(0x10f)](_0x55989f['detail']));}console['log']('');}export async function upgradeApp(_0x39d260,_0x57df36){const _0x583c19=a169_0x2d3c50,_0x1f3fd8=process[_0x583c19(0x11d)](),_0x12e43a=analyse(_0x1f3fd8),_0x2d60e5=!_0x12e43a[_0x583c19(0xa3)]&&_0x12e43a[_0x583c19(0xdd)][_0x583c19(0xbe)]===0x0&&!_0x12e43a[_0x583c19(0x9e)]&&!_0x12e43a['needsSkillSwap']&&!_0x12e43a[_0x583c19(0xd7)];if(_0x2d60e5){console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0xff)](_0x583c19(0xdf)));return;}printReport(_0x12e43a);const _0x3e39b9=!!(_0x57df36[_0x583c19(0xf7)]||_0x57df36['Y']||_0x39d260);if(!_0x3e39b9)try{const _0x5cf903=await askConfirm(_0x583c19(0x108));if(!_0x5cf903){console['log'](a169_0xda8879[_0x583c19(0x10f)](_0x583c19(0xc4)));return;}}catch(_0x1efbe8){if(_0x1efbe8?.['message']==='CANCEL'){console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0x10f)](_0x583c19(0xc4)));return;}throw _0x1efbe8;}const _0xa15eb2=[],_0x30ab81=a169_0x4d3d07({'text':_0x583c19(0x117),'color':_0x583c19(0x11c)})['start'](),_0x2d9ce0=execConfigMigration(_0x12e43a,_0x1f3fd8);_0xa15eb2[_0x583c19(0xcd)](_0x2d9ce0),_0x30ab81[_0x2d9ce0['ok']?_0x583c19(0xfd):'fail'](_0x583c19(0xa5)+(_0x2d9ce0[_0x583c19(0xf9)]??(_0x2d9ce0['ok']?'done':_0x583c19(0x102))));const _0x3691c6=resolve(_0x1f3fd8,'.lovrabet'),_0x486e22=a169_0x4d3d07({'text':_0x583c19(0xb0),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)]();if(existsSync(_0x3691c6))try{rmSync(_0x3691c6,{'recursive':!![],'force':!![]}),_0x486e22[_0x583c19(0xfd)](_0x583c19(0xe3)),_0xa15eb2['push']({'step':0x2,'label':_0x583c19(0xfe),'ok':!![]});}catch(_0x19c430){_0x486e22[_0x583c19(0x113)](_0x583c19(0x100)+_0x19c430[_0x583c19(0xd0)]),_0xa15eb2[_0x583c19(0xcd)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x19c430['message']});}else _0x486e22[_0x583c19(0xba)](_0x583c19(0xe9)),_0xa15eb2[_0x583c19(0xcd)]({'step':0x2,'label':_0x583c19(0xfe),'ok':!![],'detail':_0x583c19(0xbd)});const _0x83059d=a169_0x4d3d07({'text':_0x583c19(0xb2),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)](),_0x4f1947=execRemoveOldArtifacts(_0x12e43a[_0x583c19(0xdd)]);_0xa15eb2[_0x583c19(0xcd)](_0x4f1947),_0x83059d[_0x4f1947['ok']?'succeed':'fail'](_0x583c19(0xd3)+(_0x4f1947['detail']??(_0x4f1947['ok']?_0x583c19(0x10d):_0x583c19(0x102))));const _0x2a4661=a169_0x4d3d07({'text':_0x583c19(0xb5),'color':_0x583c19(0x11c)})['start'](),_0x1ce3bb=execCleanMcp(_0x12e43a);_0xa15eb2[_0x583c19(0xcd)](_0x1ce3bb),_0x2a4661[_0x1ce3bb['ok']?_0x583c19(0xfd):'fail'](_0x583c19(0xa4)+(_0x1ce3bb[_0x583c19(0xf9)]??(_0x1ce3bb['ok']?'done':'failed')));const _0x29e034=a169_0x4d3d07({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x583c19(0x11c)})['start'](),_0x4e8c94=execSkillsRemove(_0x1f3fd8,_0x3e39b9);_0xa15eb2[_0x583c19(0xcd)](_0x4e8c94),_0x29e034[_0x4e8c94['ok']?_0x583c19(0xfd):_0x583c19(0x113)](_0x583c19(0xc5)+(_0x4e8c94[_0x583c19(0xf9)]??(_0x4e8c94['ok']?_0x583c19(0x10d):_0x583c19(0x102))));const _0xc9dab=a169_0x4d3d07({'text':_0x583c19(0xa6),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)](),_0x4f57c1=execSkillsAdd(_0x1f3fd8,_0x3e39b9);_0xa15eb2['push'](_0x4f57c1),_0xc9dab[_0x4f57c1['ok']?_0x583c19(0xfd):'fail'](_0x583c19(0x98)+(_0x4f57c1[_0x583c19(0xf9)]??(_0x4f57c1['ok']?_0x583c19(0x10d):_0x583c19(0x102))));const _0x4e97ec=a169_0x4d3d07({'text':_0x583c19(0xeb),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)](),_0x3bbd93=execUpgradeSdk(_0x12e43a);_0xa15eb2[_0x583c19(0xcd)](_0x3bbd93),_0x4e97ec[_0x3bbd93['ok']?_0x583c19(0xfd):_0x583c19(0x113)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x3bbd93[_0x583c19(0xf9)]??(_0x3bbd93['ok']?_0x583c19(0x10d):_0x583c19(0x102)))),printSummary(_0xa15eb2);const _0x5d4f5c=_0xa15eb2['some'](_0x3cd3ea=>!_0x3cd3ea['ok']);_0x5d4f5c?console['log'](a169_0xda8879[_0x583c19(0xa0)](_0x583c19(0xdb))):console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0xff)](_0x583c19(0xd1))),_0x3bbd93['ok']&&_0x12e43a[_0x583c19(0xd7)]&&(console[_0x583c19(0xac)](''),console[_0x583c19(0xac)](a169_0xda8879['bold']['cyan'](_0x583c19(0xe8))),console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0x11c)](_0x583c19(0xed))),console[_0x583c19(0xac)](''),console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0xc6)]('\x20\x20npm\x20install')),console['log'](a169_0xda8879[_0x583c19(0xc6)](_0x583c19(0xa1))),console[_0x583c19(0xac)](a169_0xda8879['white']('\x20\x20bun\x20install')),console[_0x583c19(0xac)](''));}