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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) 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.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_0x3983c5=a157_0xce7b;(function(_0x45e11e,_0x4b31ad){const _0x1dc9bc=a157_0xce7b,_0x19fd5a=_0x45e11e();while(!![]){try{const _0x13a571=parseInt(_0x1dc9bc(0x1fc))/0x1*(parseInt(_0x1dc9bc(0x1e5))/0x2)+parseInt(_0x1dc9bc(0x1fb))/0x3*(parseInt(_0x1dc9bc(0x1e4))/0x4)+parseInt(_0x1dc9bc(0x1e6))/0x5*(-parseInt(_0x1dc9bc(0x1f9))/0x6)+parseInt(_0x1dc9bc(0x203))/0x7*(parseInt(_0x1dc9bc(0x1f7))/0x8)+-parseInt(_0x1dc9bc(0x1f8))/0x9+-parseInt(_0x1dc9bc(0x1ec))/0xa*(parseInt(_0x1dc9bc(0x1fd))/0xb)+parseInt(_0x1dc9bc(0x1e9))/0xc*(parseInt(_0x1dc9bc(0x207))/0xd);if(_0x13a571===_0x4b31ad)break;else _0x19fd5a['push'](_0x19fd5a['shift']());}catch(_0x498100){_0x19fd5a['push'](_0x19fd5a['shift']());}}}(a157_0x67e0,0xbe7a9));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';function a157_0x67e0(){const _0xebcd10=['11818710YzzZwN','31068LWOzak','selector','39fbdzcN','3mkapIk','11418vEXNAK','join','PAGE','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','push','flagMissing','7CLSiET','str','menus','get','2678pnpDcG','access','Updated\x20','193924yctLfj','56054EhGArN','1410ThDauw','length','validation','208068zNrKTh','POST','role-menus-set','8830mRuPSm','menu-grant','roleName','permit','menu-revoke','has','/smartapi/permit/role/update','set','Pass\x20--menus\x20<resourceCode,...>.','appCode','action','1471784SdtAFx'];a157_0x67e0=function(){return _0xebcd10;};return a157_0x67e0();}import{CliErrors}from'../../errors.js';function a157_0xce7b(_0x24ce42,_0x2e093a){_0x24ce42=_0x24ce42-0x1e3;const _0x67e052=a157_0x67e0();let _0xce7bf6=_0x67e052[_0x24ce42];return _0xce7bf6;}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=a157_0x3983c5(0x1f2);async function buildPlan(_0x4fec9f,_0x53d429){const _0x21ee76=a157_0x3983c5,_0x343403=await resolveRoleRef(_0x4fec9f[_0x21ee76(0x1f5)],readRoleRef(_0x4fec9f));assertPermConfigurable(_0x343403);const _0xd8c311=readGrantRevoke(_0x4fec9f),_0x177170=splitList(_0x4fec9f[_0x21ee76(0x204)](_0x21ee76(0x205)));if(_0x177170[_0x21ee76(0x1e7)]===0x0)throw CliErrors[_0x21ee76(0x202)](_0x21ee76(0x205),'Pass\x20--menus\x20<resourceCode,...>.');const _0x493740=await getRoleMenuResources(_0x4fec9f['appCode'],_0x343403['id']),_0x2d5834=flattenMenuResources(_0x493740),_0x325873=_0x177170['filter'](_0x240e39=>!_0x2d5834[_0x21ee76(0x1f1)](_0x240e39));if(_0x325873[_0x21ee76(0x1e7)]>0x0)throw CliErrors[_0x21ee76(0x1e8)]('Unknown\x20menu\x20resourceCode(s):\x20'+_0x325873[_0x21ee76(0x1fe)](',\x20')+'.',_0x21ee76(0x200));const _0x266582=new Map(),_0x544807=[],_0x435423=[];for(const _0x593b44 of _0x177170){const _0x15d2cf=_0x2d5834[_0x21ee76(0x206)](_0x593b44);_0x266582[_0x21ee76(0x1f3)](_0x593b44,_0xd8c311),_0x544807[_0x21ee76(0x201)]({'resourceCode':_0x593b44,'action':_0x15d2cf[_0x21ee76(0x1f6)]}),_0x435423[_0x21ee76(0x201)]({'resourceCode':_0x593b44,'action':_0xd8c311});}const _0x43a1cc=buildPermits(_0x2d5834,_0x266582),_0x277dae={'operation':_0xd8c311===_0x21ee76(0x208)?_0x21ee76(0x1ed):_0x21ee76(0x1f0),'selector':{'appCode':_0x4fec9f[_0x21ee76(0x1f5)],'roleId':_0x343403['id'],'roleName':_0x343403[_0x21ee76(0x1ee)],'resourceCodes':_0x177170},'before':_0x544807,'after':_0x435423,'dryRun':_0x53d429,'backend':{'method':'POST','path':UPDATE_PATH,'roleType':_0x21ee76(0x1ff)},'warnings':[]};return{'role':_0x343403,'permits':_0x43a1cc,'mutation':_0x277dae};}export const permitRoleMenusSet={'service':a157_0x3983c5(0x1ef),'command':a157_0x3983c5(0x1eb),'description':'Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3cc122){const _0x369f13=a157_0x3983c5;readGrantRevoke(_0x3cc122);if(splitList(_0x3cc122[_0x369f13(0x204)](_0x369f13(0x205)))[_0x369f13(0x1e7)]===0x0)throw CliErrors[_0x369f13(0x202)](_0x369f13(0x205),_0x369f13(0x1f4));},async 'dryRun'(_0x403d03){const _0x1ca287=a157_0x3983c5,{mutation:_0x490a34}=await buildPlan(_0x403d03,!![]);return asDryRunResult(_0x490a34,{'method':_0x1ca287(0x1ea),'url':UPDATE_PATH});},async 'execute'(_0x24c101){const _0x4e005c=a157_0x3983c5,{role:_0x53c21b,permits:_0x3d1f46,mutation:_0x4e8244}=await buildPlan(_0x24c101,![]);return await updateAppRole({'id':_0x53c21b['id'],'appCode':_0x24c101['appCode'],'roleType':_0x4e005c(0x1ff),'permits':_0x3d1f46}),{'ok':!![],'data':_0x4e8244,'message':_0x4e005c(0x1e3)+_0x4e8244[_0x4e005c(0x1fa)]['resourceCodes']['length']+'\x20menu\x20permit(s)\x20for\x20role\x20'+_0x53c21b[_0x4e005c(0x1ee)]};}};
@@ -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_0x4b25(_0x1f6e15,_0x2240fa){_0x1f6e15=_0x1f6e15-0xa9;const _0x2fd689=a158_0x2fd6();let _0x4b2510=_0x2fd689[_0x1f6e15];return _0x4b2510;}const a158_0x30a925=a158_0x4b25;(function(_0x3ffb11,_0x57577c){const _0x3f8e74=a158_0x4b25,_0xd84c79=_0x3ffb11();while(!![]){try{const _0x24f9a2=-parseInt(_0x3f8e74(0xbc))/0x1*(-parseInt(_0x3f8e74(0xbd))/0x2)+-parseInt(_0x3f8e74(0xb5))/0x3+-parseInt(_0x3f8e74(0xb7))/0x4+parseInt(_0x3f8e74(0xa9))/0x5*(parseInt(_0x3f8e74(0xbb))/0x6)+parseInt(_0x3f8e74(0xbf))/0x7*(parseInt(_0x3f8e74(0xb9))/0x8)+-parseInt(_0x3f8e74(0xba))/0x9+-parseInt(_0x3f8e74(0xb8))/0xa;if(_0x24f9a2===_0x57577c)break;else _0xd84c79['push'](_0xd84c79['shift']());}catch(_0x42c54c){_0xd84c79['push'](_0xd84c79['shift']());}}}(a158_0x2fd6,0xd031a));function a158_0x2fd6(){const _0x278f23=['12077870uRKVrK','8wCPGFF','6071553TMEccL','120qFKYLn','1690597bdhHDJ','2fNJJjv','Role\x20','6501719piXWSP','from','resourceCode','397475MqVeLA','allowed','permit','roleName','action','filter','role-menus','map','values','appCode','access','length','544008WWTIrw','\x20has\x20','5171248CNLhwO'];a158_0x2fd6=function(){return _0x278f23;};return a158_0x2fd6();}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';export const permitRoleMenus={'service':a158_0x30a925(0xab),'command':a158_0x30a925(0xaf),'description':'Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','risk':'read','flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x2facb5){const _0x32da9a=a158_0x30a925,_0x8f9145=await resolveRoleRef(_0x2facb5[_0x32da9a(0xb2)],readRoleRef(_0x2facb5)),_0x5948ac=await getRoleMenuResources(_0x2facb5[_0x32da9a(0xb2)],_0x8f9145['id']),_0x29af48=flattenMenuResources(_0x5948ac),_0x2d7c1b=Array[_0x32da9a(0xc0)](_0x29af48[_0x32da9a(0xb1)]())[_0x32da9a(0xb0)](_0x258157=>({'resourceCode':_0x258157[_0x32da9a(0xc1)],'resourceName':_0x258157['resourceName'],'allowed':_0x258157[_0x32da9a(0xad)]===_0x32da9a(0xb3),'action':_0x258157[_0x32da9a(0xad)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x2facb5[_0x32da9a(0xb2)],'roleId':_0x8f9145['id'],'roleName':_0x8f9145[_0x32da9a(0xac)]},'menus':_0x2d7c1b},'message':_0x32da9a(0xbe)+_0x8f9145[_0x32da9a(0xac)]+_0x32da9a(0xb6)+_0x2d7c1b[_0x32da9a(0xae)](_0x1272df=>_0x1272df[_0x32da9a(0xaa)])[_0x32da9a(0xb4)]+'/'+_0x2d7c1b[_0x32da9a(0xb4)]+'\x20menu(s)\x20allowed'};}};
@@ -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_0x5465b9=a159_0x5844;(function(_0x54b1a,_0xb167d0){const _0xe43956=a159_0x5844,_0x4cda84=_0x54b1a();while(!![]){try{const _0x451db4=parseInt(_0xe43956(0xf6))/0x1+-parseInt(_0xe43956(0xcc))/0x2+parseInt(_0xe43956(0xeb))/0x3*(-parseInt(_0xe43956(0xf8))/0x4)+-parseInt(_0xe43956(0xd5))/0x5*(-parseInt(_0xe43956(0xe4))/0x6)+-parseInt(_0xe43956(0xfc))/0x7*(parseInt(_0xe43956(0xe2))/0x8)+parseInt(_0xe43956(0xcd))/0x9+-parseInt(_0xe43956(0xdc))/0xa*(-parseInt(_0xe43956(0xf7))/0xb);if(_0x451db4===_0xb167d0)break;else _0x4cda84['push'](_0x4cda84['shift']());}catch(_0x262f4e){_0x4cda84['push'](_0x4cda84['shift']());}}}(a159_0x5464,0xa3fe6));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a159_0x5465b9(0xd2),'type':'number','required':!![],'description':'Menu\x20id\x20(from\x20`menu\x20list`)'};export const ROLE_REF_FLAG={'name':a159_0x5465b9(0xbf),'type':'string','required':!![],'description':'Role\x20id\x20or\x20role\x20name'};export const GRANT_FLAG={'name':a159_0x5465b9(0xe7),'type':'boolean','required':![],'description':a159_0x5465b9(0xe6)};export const REVOKE_FLAG={'name':a159_0x5465b9(0xf3),'type':'boolean','required':![],'description':a159_0x5465b9(0xee)};export const MENUS_FLAG={'name':a159_0x5465b9(0xe1),'type':a159_0x5465b9(0xbc),'required':!![],'description':a159_0x5465b9(0x105)};export const DATASETS_FLAG={'name':'datasets','type':a159_0x5465b9(0xbc),'required':!![],'description':a159_0x5465b9(0xcf)};export const PAGE_SLOT_SPECS=[{'flag':a159_0x5465b9(0xc5),'key':a159_0x5465b9(0x109),'allowSelf':![],'label':'menu\x20visibility'},{'flag':a159_0x5465b9(0x104),'key':a159_0x5465b9(0xe3),'allowSelf':![],'label':a159_0x5465b9(0xc1)},{'flag':a159_0x5465b9(0xd1),'key':a159_0x5465b9(0xd4),'allowSelf':![],'label':a159_0x5465b9(0xda)},{'flag':'delete-roles','key':a159_0x5465b9(0xbd),'allowSelf':![],'label':a159_0x5465b9(0xf4)},{'flag':'detail-roles','key':'dataDetail','allowSelf':![],'label':a159_0x5465b9(0xe8)},{'flag':'export-roles','key':a159_0x5465b9(0xe0),'allowSelf':![],'label':a159_0x5465b9(0xc6)},{'flag':'row-roles','key':'dataPermit','allowSelf':!![],'label':'row\x20visibility'}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a159_0x5465b9(0xec)](_0x5ba909=>({'name':_0x5ba909[a159_0x5465b9(0xd8)],'type':a159_0x5465b9(0xbc),'required':![],'description':'Roles\x20for\x20'+_0x5ba909[a159_0x5465b9(0x108)]+a159_0x5465b9(0xc2)+(_0x5ba909[a159_0x5465b9(0xc3)]?a159_0x5465b9(0xba):'')}));export function splitList(_0x25b0c2){const _0x5bf26a=a159_0x5465b9;return _0x25b0c2[_0x5bf26a(0xcb)](',')[_0x5bf26a(0xec)](_0x13bbb6=>_0x13bbb6[_0x5bf26a(0xce)]())[_0x5bf26a(0xd7)](Boolean);}export function projectRoleRef(_0x4edec0){const _0x26def8=a159_0x5465b9;return{'id':_0x4edec0['id'],'roleName':_0x4edec0[_0x26def8(0xe9)],'roleType':_0x4edec0[_0x26def8(0xfa)]};}export async function resolvePermitRoles(_0x269a12,_0x382a61,_0x56b0ad){const _0x4a9ca2=a159_0x5465b9,_0x4073fd=await listPermitRoles(_0x269a12,{'needSelf':!![],'needPublic':!![]}),_0x3b961=[];for(const _0x2f5684 of _0x382a61){const _0x195511=resolveOnePermitRole(_0x4073fd,_0x2f5684);if(!_0x56b0ad[_0x4a9ca2(0xc3)]&&_0x195511[_0x4a9ca2(0xfa)]===_0x4a9ca2(0xf1))throw CliErrors[_0x4a9ca2(0xbe)](_0x4a9ca2(0xbb)+_0x56b0ad[_0x4a9ca2(0x108)]+'.','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.');if(!_0x3b961['some'](_0x137f54=>_0x137f54['id']===_0x195511['id']))_0x3b961[_0x4a9ca2(0xea)](_0x195511);}return _0x3b961;}function resolveOnePermitRole(_0x253b23,_0x3fe634){const _0x42f2b0=a159_0x5465b9,_0x281c50=_0x3fe634[_0x42f2b0(0xce)](),_0x45bc2b=_0x281c50[_0x42f2b0(0xf0)]();if(_0x45bc2b===_0x42f2b0(0xf1)||_0x45bc2b===_0x42f2b0(0xd3)){const _0x555c1a=_0x253b23['find'](_0x587b12=>_0x587b12[_0x42f2b0(0xfa)]===_0x45bc2b);if(!_0x555c1a)throw CliErrors[_0x42f2b0(0xbe)](_0x42f2b0(0xd0)+_0x45bc2b+'\x20is\x20not\x20available\x20for\x20this\x20app.');return _0x555c1a;}if(/^-?\d+$/[_0x42f2b0(0xd9)](_0x281c50)){const _0x3a4f80=Number(_0x281c50),_0x12f8bb=_0x253b23[_0x42f2b0(0xfe)](_0x69103b=>_0x69103b['id']===_0x3a4f80);if(!_0x12f8bb)throw CliErrors[_0x42f2b0(0xbe)](_0x42f2b0(0xc8)+_0x3a4f80+_0x42f2b0(0x101),_0x42f2b0(0x106));return _0x12f8bb;}const _0x34b026=_0x253b23[_0x42f2b0(0xd7)](_0x177f4c=>_0x177f4c[_0x42f2b0(0xe9)]===_0x281c50);if(_0x34b026[_0x42f2b0(0xdf)]===0x0)throw CliErrors['validation'](_0x42f2b0(0x103)+_0x281c50+_0x42f2b0(0xff),_0x42f2b0(0xef));if(_0x34b026['length']>0x1)throw CliErrors[_0x42f2b0(0xbe)]('Role\x20\x22'+_0x281c50+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x34b026['map'](_0x24e2e1=>_0x24e2e1['id'])['join'](',\x20')+').',_0x42f2b0(0xca));return _0x34b026[0x0];}export function projectPageSlot(_0xe33120){const _0xb0132f=a159_0x5465b9;if(!_0xe33120)return null;return{'resourceCode':_0xe33120['resourceCode'],'roles':(_0xe33120[_0xb0132f(0xc7)]??[])[_0xb0132f(0xec)](projectRoleRef)};}export function projectPagePermit(_0x359bc3){const _0x582e8d=a159_0x5465b9,_0x2d3309={'menuId':_0x359bc3[_0x582e8d(0xe5)],'appCode':_0x359bc3[_0x582e8d(0xc4)],'menuPermit':projectPageSlot(_0x359bc3['menuPermit'])};for(const _0x55fa74 of PAGE_SLOT_SPECS){if(_0x55fa74['key']===_0x582e8d(0x109))continue;_0x2d3309[_0x55fa74[_0x582e8d(0xf2)]]=projectPageSlot(_0x359bc3[_0x55fa74[_0x582e8d(0xf2)]]);}return _0x2d3309;}function a159_0x5464(){const _0x1d5ddc=['push','3orNAfK','map','set','Revoke\x20access\x20to\x20the\x20listed\x20resources','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','toUpperCase','SELF','key','revoke','data\x20delete','str','317444uoCzPE','22cRXcPS','4895224HCrNTZ','flagMissing','roleType','get','378546YtPAyv','bool','find','\x22\x20not\x20found.','pageNodeList','\x20not\x20found.','resourceCode','Role\x20\x22','create-roles','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','Run\x20`role\x20list`.','datasetCode','label','menuPermit',';\x20SELF\x20=\x20only\x20own\x20rows','SELF\x20is\x20not\x20allowed\x20for\x20','string','dataDelete','validation','role','apiList','data\x20create','\x20(comma-separated\x20SELF/ALL/id/name)','allowSelf','appCode','menu-roles','data\x20export','rolePermit','Role\x20id\x20','entries','Disambiguate\x20with\x20an\x20id.','split','2684904yASUin','8260929IXmiLu','trim','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','Special\x20role\x20','update-roles','menu-id','ALL','dataUpdate','85whHgzh','allowedActions','filter','flag','test','data\x20update','access','6585690RKOepk','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','resourceName','length','dataExport','menus','96lNlnrr','dataCreate','470982kYqBlw','menuId','Grant\x20access\x20to\x20the\x20listed\x20resources','grant','data\x20detail','roleName'];a159_0x5464=function(){return _0x1d5ddc;};return a159_0x5464();}function a159_0x5844(_0x2e3fc3,_0x402f51){_0x2e3fc3=_0x2e3fc3-0xba;const _0x5464e3=a159_0x5464();let _0x5844d8=_0x5464e3[_0x2e3fc3];return _0x5844d8;}export function flattenMenuResources(_0x3855f7){const _0x37649d=new Map(),_0x295c16=_0x4a6d6b=>{const _0x462895=a159_0x5844;for(const _0x3e6f9f of _0x4a6d6b??[]){_0x37649d[_0x462895(0xed)](_0x3e6f9f[_0x462895(0x102)],{'resourceCode':_0x3e6f9f['resourceCode'],'resourceName':_0x3e6f9f[_0x462895(0xde)],'action':_0x3e6f9f[_0x462895(0xd6)]?.[0x0]??'0'});if(_0x3e6f9f['pageNodeList'])_0x295c16(_0x3e6f9f[_0x462895(0x100)]);}};return _0x295c16(_0x3855f7),_0x37649d;}export function flattenApiResources(_0x27e249){const _0x1199a2=a159_0x5465b9,_0x1bebef=new Map(),_0x59dff6=new Map();for(const _0x1a1019 of _0x27e249){const _0x1aa8c9=_0x1a1019[_0x1199a2(0xc0)]??{};for(const [_0x43ef49,_0x5b2bcd]of Object[_0x1199a2(0xc9)](_0x1aa8c9)){_0x1bebef[_0x1199a2(0xed)](_0x43ef49,{'resourceCode':_0x43ef49,'resourceName':_0x1a1019[_0x1199a2(0xde)],'datasetCode':_0x1a1019[_0x1199a2(0x107)],'action':_0x5b2bcd?.[0x0]??'0'});const _0x4f6ee8=_0x59dff6['get'](_0x1a1019[_0x1199a2(0x107)])??[];_0x4f6ee8['push'](_0x43ef49),_0x59dff6[_0x1199a2(0xed)](_0x1a1019['datasetCode'],_0x4f6ee8);}}return{'byCode':_0x1bebef,'byDataset':_0x59dff6};}export function buildPermits(_0x355a92,_0x5e4725){const _0x284fd7=a159_0x5465b9,_0x2efd07={};for(const [_0x308132,_0x96951d]of _0x355a92){const _0x30f445=_0x5e4725[_0x284fd7(0xfb)](_0x308132)??_0x96951d['action'];_0x2efd07[_0x308132]=[_0x30f445];}return _0x2efd07;}export function readRoleRef(_0x3bf693){const _0x246f45=a159_0x5465b9,_0x4e1e74=_0x3bf693[_0x246f45(0xf5)](_0x246f45(0xbf))[_0x246f45(0xce)]();if(!_0x4e1e74)throw CliErrors[_0x246f45(0xf9)](_0x246f45(0xbf),'Pass\x20--role\x20<id|name>.');return _0x4e1e74;}export function readGrantRevoke(_0x4f9b79){const _0x1355dd=a159_0x5465b9,_0x55ba00=_0x4f9b79[_0x1355dd(0xfd)](_0x1355dd(0xe7)),_0x414970=_0x4f9b79[_0x1355dd(0xfd)](_0x1355dd(0xf3));if(_0x55ba00&&_0x414970)throw CliErrors[_0x1355dd(0xbe)](_0x1355dd(0xdd));if(!_0x55ba00&&!_0x414970)throw CliErrors[_0x1355dd(0xbe)]('Missing\x20action.','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.');return _0x55ba00?_0x1355dd(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(_0x36ab73,_0x113be4){const _0x251165=a160_0x28b2,_0x117898=_0x36ab73();while(!![]){try{const _0x5d7da8=parseInt(_0x251165(0xfa))/0x1*(parseInt(_0x251165(0xee))/0x2)+parseInt(_0x251165(0xf2))/0x3*(parseInt(_0x251165(0xf0))/0x4)+parseInt(_0x251165(0xf5))/0x5+parseInt(_0x251165(0x100))/0x6+-parseInt(_0x251165(0xfd))/0x7*(parseInt(_0x251165(0xed))/0x8)+parseInt(_0x251165(0xf6))/0x9+-parseInt(_0x251165(0xef))/0xa;if(_0x5d7da8===_0x113be4)break;else _0x117898['push'](_0x117898['shift']());}catch(_0x30bb4b){_0x117898['push'](_0x117898['shift']());}}}(a160_0x4809,0x205d9));import{existsSync}from'node:fs';import a160_0x3ec2b2 from'node:path';import a160_0x5eb40a from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';function a160_0x4809(){const _0x486661=['96pbxJPv','3236450rmSvSP','4FogEKN','my-app','464175ddBpMn','log','√\x20App\x20Code:\x20','1273245lvKvYa','892314icnmqs','Not\x20set','length','Project\x20name:','2983alhKXT','test','cyan','742945xaVCLv','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','√\x20Login\x20status:\x20','100680FKrbnP','Directory\x20\x22','env','trim','green','string','cwd','Skipped','√\x20Project\x20Name:\x20','Logged\x20in','Login\x20failed','production','16KdabnU'];a160_0x4809=function(){return _0x486661;};return a160_0x4809();}import{readConfig}from'../../../utils/config.js';function a160_0x28b2(_0x9d9dd9,_0xbc0818){_0x9d9dd9=_0x9d9dd9-0xe2;const _0x480922=a160_0x4809();let _0x28b20d=_0x480922[_0x9d9dd9];return _0x28b20d;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x614520,_0x2b2471,_0x44016a){const _0x71cd9c=a160_0x28b2,_0x289539=_0x71cd9c(0xf1),_0x3d66be=readConfig(),_0x37a2b2=typeof _0x3d66be[_0x71cd9c(0xe3)]===_0x71cd9c(0xe6)?_0x3d66be[_0x71cd9c(0xe3)]:undefined,_0x4dfa41=await input({'message':_0x71cd9c(0xf9),'default':_0x289539,'validate':_0x4e2bb7=>{const _0x362b00=_0x71cd9c,_0x3de11c=_0x4e2bb7[_0x362b00(0xe4)]()||_0x289539;if(_0x3de11c[_0x362b00(0xf8)]>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x464009=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x3de11c&&!_0x464009[_0x362b00(0xfb)](_0x3de11c))return _0x362b00(0xfe);const _0x584363=a160_0x3ec2b2['resolve'](process[_0x362b00(0xe7)](),_0x3de11c);if(existsSync(_0x584363))return _0x362b00(0xe2)+_0x3de11c+'\x22\x20already\x20exists';return!![];}});console[_0x71cd9c(0xf3)](a160_0x5eb40a['green'](_0x71cd9c(0xe9)+a160_0x5eb40a[_0x71cd9c(0xfc)](_0x4dfa41)));const _0x17487f=await selectSingleAppcode(_0x44016a);console[_0x71cd9c(0xf3)](a160_0x5eb40a[_0x71cd9c(0xe5)](_0x71cd9c(0xf4)+a160_0x5eb40a[_0x71cd9c(0xfc)](_0x17487f||_0x71cd9c(0xf7))));if(_0x17487f){const _0x50fc5e=await getIsSessionValid();if(!_0x50fc5e){const _0x5a50cf=await confirm({'message':'No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','default':!![]});if(_0x5a50cf){const _0x355e95=await authServer({'silent':!![]});console[_0x71cd9c(0xf3)](a160_0x5eb40a[_0x71cd9c(0xe5)](_0x71cd9c(0xff)+a160_0x5eb40a['cyan'](_0x355e95?_0x71cd9c(0xea):_0x71cd9c(0xeb))));}else console[_0x71cd9c(0xf3)](a160_0x5eb40a['green'](_0x71cd9c(0xff)+a160_0x5eb40a[_0x71cd9c(0xfc)](_0x71cd9c(0xe8))));}await _0x614520({'projectName':_0x4dfa41,'appCode':_0x17487f,'env':_0x2b2471||_0x37a2b2||'production'});}else await _0x614520({'projectName':_0x4dfa41,'env':_0x2b2471||_0x37a2b2||_0x71cd9c(0xec)});}
@@ -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 a161_0x3adc(_0x169468,_0x5a0cd0){_0x169468=_0x169468-0x141;const _0x2354b2=a161_0x2354();let _0x3adc30=_0x2354b2[_0x169468];return _0x3adc30;}function a161_0x2354(){const _0x2baa59=['2211728TiZfdh','12035BqzvOP','3324272RSCPuN','1226jfohGE','180EQRZkz','toFixed','1486723qZBSRA','12207141xYNfTZ','replace','435770xZrWOY','now','1326OGbPXx'];a161_0x2354=function(){return _0x2baa59;};return a161_0x2354();}(function(_0x39283a,_0x4bd17a){const _0x5ec1c0=a161_0x3adc,_0x248839=_0x39283a();while(!![]){try{const _0x3206cf=parseInt(_0x5ec1c0(0x146))/0x1+-parseInt(_0x5ec1c0(0x14c))/0x2*(parseInt(_0x5ec1c0(0x141))/0x3)+-parseInt(_0x5ec1c0(0x14b))/0x4+-parseInt(_0x5ec1c0(0x14a))/0x5*(parseInt(_0x5ec1c0(0x148))/0x6)+-parseInt(_0x5ec1c0(0x143))/0x7+parseInt(_0x5ec1c0(0x149))/0x8+parseInt(_0x5ec1c0(0x144))/0x9;if(_0x3206cf===_0x4bd17a)break;else _0x248839['push'](_0x248839['shift']());}catch(_0x1132ce){_0x248839['push'](_0x248839['shift']());}}}(a161_0x2354,0x6f6d1));export function formatElapsed(_0x5a9bb6){const _0x17873d=a161_0x3adc,_0x5451c3=Date[_0x17873d(0x147)]()-_0x5a9bb6;if(_0x5451c3<0x3e8)return _0x5451c3+'ms';const _0x492ae5=(_0x5451c3/0x3e8)[_0x17873d(0x142)](0x2),_0x2846a0=_0x492ae5[_0x17873d(0x145)](/\.?0+$/u,'');return _0x2846a0+'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(_0x4dc3d4,_0x602a74){const _0x387c78=a162_0x4c3f,_0x49f4cd=_0x4dc3d4();while(!![]){try{const _0x136925=parseInt(_0x387c78(0x149))/0x1*(-parseInt(_0x387c78(0x161))/0x2)+parseInt(_0x387c78(0x168))/0x3*(parseInt(_0x387c78(0x136))/0x4)+-parseInt(_0x387c78(0x128))/0x5*(-parseInt(_0x387c78(0x10f))/0x6)+parseInt(_0x387c78(0x12e))/0x7+parseInt(_0x387c78(0x16c))/0x8*(parseInt(_0x387c78(0x131))/0x9)+parseInt(_0x387c78(0x127))/0xa*(-parseInt(_0x387c78(0x143))/0xb)+-parseInt(_0x387c78(0x12b))/0xc;if(_0x136925===_0x602a74)break;else _0x49f4cd['push'](_0x49f4cd['shift']());}catch(_0x59ebae){_0x49f4cd['push'](_0x49f4cd['shift']());}}}(a162_0x5dde,0x463f1));import a162_0x28399a from'path';import a162_0x32c14e from'fs';import a162_0x9fc1ae from'chalk';import a162_0x4afa81 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';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(_0x33f296){const _0x242bd4=a162_0x4c3f,_0x5bd6c5=await checkCliVersion();(_0x5bd6c5[_0x242bd4(0x122)]||_0x5bd6c5[_0x242bd4(0x114)])&&(printCliUpgradeWarning(_0x5bd6c5),assertCliVersionSupported(_0x5bd6c5),logger['info']('create','CLI\x20版本检查',{'currentVersion':_0x5bd6c5[_0x242bd4(0x135)],'stableVersion':_0x5bd6c5[_0x242bd4(0x158)],'minimumVersion':_0x5bd6c5[_0x242bd4(0x123)],'needsUpgrade':_0x5bd6c5['needsUpgrade'],'belowMinimum':_0x5bd6c5[_0x242bd4(0x114)]}));if(_0x33f296[_0x242bd4(0x153)]&&_0x33f296[_0x242bd4(0x148)])await runCreate({'projectName':_0x33f296['projectCode'],'appCode':_0x33f296[_0x242bd4(0x148)],'env':_0x33f296[_0x242bd4(0x142)]},_0x33f296);else{if(_0x33f296[_0x242bd4(0x153)]){const _0x480948=await selectSingleAppcode(_0x33f296[_0x242bd4(0x150)]);await runCreate({'projectName':_0x33f296['projectCode'],'appCode':_0x480948||undefined,'env':_0x33f296[_0x242bd4(0x142)]},_0x33f296);}else await guidedCreateProject(_0x55d609=>runCreate(_0x55d609,_0x33f296),_0x33f296['env'],_0x33f296[_0x242bd4(0x150)]);}}function a162_0x4c3f(_0x1d2338,_0x14dbed){_0x1d2338=_0x1d2338-0x10c;const _0x5dde53=a162_0x5dde();let _0x4c3f78=_0x5dde53[_0x1d2338];return _0x4c3f78;}async function runCreate(_0x5b00fd,_0x497d5a){const _0x29aae2=a162_0x4c3f;if(!_0x5b00fd[_0x29aae2(0x163)]||_0x5b00fd['projectName'][_0x29aae2(0x133)]()==='')throw new Error(_0x29aae2(0x11a));const _0x54cb02=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x54cb02[_0x29aae2(0x160)](_0x5b00fd[_0x29aae2(0x163)]))throw new Error(_0x29aae2(0x110));if(_0x5b00fd[_0x29aae2(0x163)][_0x29aae2(0x16a)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x4827fb=a162_0x28399a[_0x29aae2(0x119)](process[_0x29aae2(0x13b)](),_0x5b00fd[_0x29aae2(0x163)]);if(a162_0x32c14e['existsSync'](_0x4827fb))throw new Error(_0x29aae2(0x116)+_0x5b00fd['projectName']+_0x29aae2(0x15b));try{a162_0x32c14e[_0x29aae2(0x13e)](a162_0x28399a[_0x29aae2(0x11c)](_0x4827fb),a162_0x32c14e[_0x29aae2(0x12a)][_0x29aae2(0x12c)]);}catch{throw new Error(_0x29aae2(0x144));}logger['setLogPath'](_0x4827fb),logger[_0x29aae2(0x156)](_0x29aae2(0x14c),_0x29aae2(0x13a)+_0x5b00fd[_0x29aae2(0x163)],{'projectDir':_0x4827fb,'appCode':_0x5b00fd['appCode']}),console[_0x29aae2(0x146)](),console[_0x29aae2(0x146)](a162_0x9fc1ae[_0x29aae2(0x11d)](_0x29aae2(0x120))+_0x29aae2(0x14a)+a162_0x9fc1ae[_0x29aae2(0x11d)](_0x5b00fd['projectName'])+(_0x5b00fd[_0x29aae2(0x148)]?_0x29aae2(0x15d)+a162_0x9fc1ae[_0x29aae2(0x124)](_0x5b00fd[_0x29aae2(0x148)]):''));try{await runTask(_0x29aae2(0x138),()=>copyProjectTemplate(_0x5b00fd[_0x29aae2(0x163)])),await updatePackageJsonName(_0x5b00fd[_0x29aae2(0x163)]),await runTask(_0x29aae2(0x118),()=>installDependencies(_0x5b00fd[_0x29aae2(0x163)])),await runTask(_0x29aae2(0x152),()=>formatProjectCode(_0x5b00fd['projectName'])),await configureAppCode(_0x5b00fd['projectName'],_0x5b00fd[_0x29aae2(0x148)]||'',_0x5b00fd[_0x29aae2(0x142)]);let _0x3edb0d=![];if(_0x5b00fd[_0x29aae2(0x148)]){console[_0x29aae2(0x146)](_0x29aae2(0x145));const _0x4ac9a7=process['cwd']();try{process[_0x29aae2(0x10c)](_0x4827fb);const _0x2d82a1=_0x5b00fd[_0x29aae2(0x142)]||_0x29aae2(0x11f);initEnv(_0x2d82a1);const {configArray:_0x245b00}=await fetchModelList(_0x5b00fd['appCode'],_0x497d5a[_0x29aae2(0x150)]||''),_0x1baa68=DEFAULT_API_DIR,_0xb549eb=await generateApiFile(_0x245b00,'',_0x5b00fd[_0x29aae2(0x148)],!![],_0x2d82a1,_0x1baa68);console[_0x29aae2(0x146)](_0x29aae2(0x14d)+_0x245b00[_0x29aae2(0x16a)]+_0x29aae2(0x155)+_0xb549eb[_0x29aae2(0x14e)]+_0x29aae2(0x121)),logger[_0x29aae2(0x156)]('create',_0x29aae2(0x13f)+_0x5b00fd[_0x29aae2(0x148)]);}catch(_0x4fa56f){_0x3edb0d=!![],console['log'](_0x29aae2(0x125)),logger[_0x29aae2(0x16b)]('create','API\x20配置拉取异常',{'error':_0x4fa56f instanceof Error?_0x4fa56f[_0x29aae2(0x13d)]:String(_0x4fa56f)});}finally{process[_0x29aae2(0x10c)](_0x4ac9a7);}}logger['success']('create','项目创建完成:\x20'+_0x5b00fd[_0x29aae2(0x163)]),console[_0x29aae2(0x146)](),console[_0x29aae2(0x146)](a162_0x9fc1ae[_0x29aae2(0x11d)]('─'[_0x29aae2(0x10e)](0x3c))),console[_0x29aae2(0x146)](a162_0x9fc1ae[_0x29aae2(0x124)][_0x29aae2(0x162)](_0x29aae2(0x157))),console[_0x29aae2(0x146)](),console[_0x29aae2(0x146)](_0x29aae2(0x126)+a162_0x9fc1ae[_0x29aae2(0x124)][_0x29aae2(0x162)](_0x29aae2(0x140)+_0x5b00fd['projectName']+_0x29aae2(0x11b)+CLI_BIN_NAME+'\x20run\x20start')),_0x3edb0d&&console['log'](_0x29aae2(0x132)+a162_0x9fc1ae[_0x29aae2(0x124)]['bold'](CLI_BIN_NAME+'\x20api\x20pull')),console['log'](a162_0x9fc1ae[_0x29aae2(0x11d)]('─'[_0x29aae2(0x10e)](0x3c)));}catch(_0x111a0b){logger[_0x29aae2(0x13c)](_0x29aae2(0x14c),_0x29aae2(0x14b)+_0x5b00fd['projectName'],{'error':_0x111a0b instanceof Error?_0x111a0b[_0x29aae2(0x13d)]:String(_0x111a0b)});try{a162_0x32c14e['existsSync'](_0x4827fb)&&(console[_0x29aae2(0x146)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x4827fb),a162_0x32c14e['rmSync'](_0x4827fb,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x29aae2(0x14c),_0x29aae2(0x147)+_0x4827fb);}throw _0x111a0b;}}async function runTask(_0x22a1cc,_0x112fcc){const _0xf22d54=a162_0x4c3f,_0x128b79=a162_0x4afa81(_0x22a1cc+_0xf22d54(0x14f))['start']();try{const _0x3af75e=await _0x112fcc();_0x128b79[_0xf22d54(0x12d)](),console['log'](''+a162_0x9fc1ae[_0xf22d54(0x11d)](_0xf22d54(0x120))+_0x22a1cc+'\x20'+a162_0x9fc1ae[_0xf22d54(0x15e)]('['+_0x3af75e+']'));}catch(_0x4b05b6){_0x128b79[_0xf22d54(0x111)](_0x22a1cc);throw _0x4b05b6;}}async function updatePackageJsonName(_0x22cea6){const _0x11b234=a162_0x4c3f,_0x46bbb1=a162_0x28399a[_0x11b234(0x119)](process[_0x11b234(0x13b)](),_0x22cea6),_0x25035d=a162_0x28399a[_0x11b234(0x15f)](_0x46bbb1,_0x11b234(0x134));try{console[_0x11b234(0x146)](_0x11b234(0x15a));const _0x4c18c5=getRabetbaseCliPackageRoot(),_0x4f1ba0=a162_0x28399a[_0x11b234(0x15f)](_0x4c18c5,_0x11b234(0x134));let _0x260603=_0x11b234(0x11e);try{const _0x2e04f6=JSON[_0x11b234(0x167)](a162_0x32c14e[_0x11b234(0x115)](_0x4f1ba0,_0x11b234(0x139)));_0x260603=_0x2e04f6[_0x11b234(0x117)]||_0x11b234(0x11e);}catch{}const _0x42614=a162_0x32c14e[_0x11b234(0x115)](_0x25035d,_0x11b234(0x139)),_0x35e987=JSON[_0x11b234(0x167)](_0x42614);_0x35e987[_0x11b234(0x129)]=_0x22cea6,_0x35e987[_0x11b234(0x113)]=_0x22cea6+_0x11b234(0x151)+_0x260603,a162_0x32c14e['writeFileSync'](_0x25035d,JSON[_0x11b234(0x15c)](_0x35e987,null,0x2)+'\x0a',_0x11b234(0x139)),console[_0x11b234(0x146)](_0x11b234(0x166)+_0x22cea6),logger[_0x11b234(0x156)](_0x11b234(0x14c),_0x11b234(0x141));}catch(_0x16e1d2){logger['error'](_0x11b234(0x14c),'更新\x20package.json\x20失败');throw _0x16e1d2;}}function a162_0x5dde(){const _0x156b07=['constants','5771088OuUCBx','W_OK','stop','512715mtkMfG','defaultApp','apps','63DcKhvs','\x20\x202.\x20Pull\x20API\x20configuration:\x20','trim','package.json','currentVersion','14580OrmMzN','\x20config\x20set\x20appcode\x20<app-code>\x27','Copy\x20project\x20files','utf8','开始创建项目:\x20','cwd','error','message','accessSync','API\x20configuration\x20pulled:\x20','cd\x20','更新\x20package.json\x20name','env','27841mXAOBa','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','*\x20Pulling\x20API\x20configuration...','log','清理项目目录失败:\x20','appCode','59513zJyhem','Project\x20name:\x20','项目创建失败:\x20','create','√\x20Pulled\x20','modelCount','...','cookie','\x20Generated\x20by\x20rabetbase\x20cli\x20','Format\x20code','projectCode','toLocaleString','\x20dataset(s),\x20generated\x20','info','🚀\x20Next\x20Steps:','stableVersion','√\x20Configuration\x20file\x20created,\x20Apps:\x20','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','\x20already\x20exists','stringify','\x20|\x20AppCode:\x20','gray','join','test','2dQhFZT','bold','projectName','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','string','√\x20package.json\x20updated:\x20name=','parse','60QTDolm','*\x20Configuring\x20AppCode\x20for\x20project\x20','length','warn','570432Poogcx','chdir','配置应用AppCode:\x20','repeat','1248GUgMDu','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','fail','keys','description','belowMinimum','readFileSync','Project\x20directory\x20','version','Install\x20dependencies','resolve','Project\x20name\x20cannot\x20be\x20empty','\x20&&\x20','dirname','green','1.0.0','production','\x20√\x20','\x20model(s)','needsUpgrade','minimumVersion','cyan','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','\x20\x201.\x20Start\x20project:\x20','1290PhSUev','12245EhVcSi','name'];a162_0x5dde=function(){return _0x156b07;};return a162_0x5dde();}async function configureAppCode(_0x5d62bc,_0x1c204e,_0x30d36e){const _0x40b06a=a162_0x4c3f,_0x40a6d7=a162_0x28399a[_0x40b06a(0x119)](process[_0x40b06a(0x13b)](),_0x5d62bc),_0x430eeb=a162_0x28399a[_0x40b06a(0x15f)](_0x40a6d7,NEW_CONFIG_NAME);try{_0x1c204e?console['log'](_0x40b06a(0x169)+_0x5d62bc+':\x20'+_0x1c204e):console[_0x40b06a(0x146)](_0x40b06a(0x164)+_0x5d62bc);const _0x2e5773=getRabetbaseCliPackageRoot(),_0x2b7e48=a162_0x28399a[_0x40b06a(0x15f)](_0x2e5773,_0x40b06a(0x134));let _0x15ade1=_0x40b06a(0x11e);try{const _0x66706a=JSON[_0x40b06a(0x167)](a162_0x32c14e[_0x40b06a(0x115)](_0x2b7e48,_0x40b06a(0x139)));_0x15ade1=_0x66706a[_0x40b06a(0x117)]||_0x40b06a(0x11e);}catch{}const _0x41b39b=readConfig(),_0x1fa9e8=typeof _0x41b39b['env']===_0x40b06a(0x165)?_0x41b39b['env']:undefined,_0x120a60={};for(const _0x1bdac5 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x41b39b[_0x1bdac5]!=null)_0x120a60[_0x1bdac5]=_0x41b39b[_0x1bdac5];}const _0x276eb5=buildCanonicalProjectConfig(_0x120a60,{'appCodes':_0x1c204e?[_0x1c204e]:[],'env':_0x30d36e||_0x1fa9e8||'production','metadata':{'createdAt':new Date()[_0x40b06a(0x154)](),'version':_0x15ade1}});writeConfigFile(_0x430eeb,_0x276eb5),_0x1c204e?console[_0x40b06a(0x146)](_0x40b06a(0x159)+Object[_0x40b06a(0x112)](_0x276eb5[_0x40b06a(0x130)]||{})[_0x40b06a(0x15f)](',\x20')+'\x20|\x20Default:\x20'+_0x276eb5[_0x40b06a(0x12f)]):console[_0x40b06a(0x146)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x40b06a(0x137)),logger['info'](_0x40b06a(0x14c),_0x40b06a(0x10d)+_0x1c204e);}catch(_0x1bd33d){logger[_0x40b06a(0x13c)]('create','配置应用AppCode失败');}}
@@ -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 a163_0x1660(){const _0x199698=['validation','2996890jniDcP','760311TdqZQW','5369lAjEpi','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','2ESbChS','chdir','description','cwd','toLocaleString','\x20model(s)','\x20\x20√\x20Pulled\x20','bun\x20--version','modelCount','package.json','41197IFynmP','\x20dataset(s),\x20generated\x20','log','belowMinimum','\x20\x20Pulling\x20API\x20configuration...','...','767403ypAqtO','W_OK','npm','\x20created\x20successfully!','trim','dirname','6gBUPEC','29508QofWzh','*\x20Creating\x20project\x20','env','name','bun\x20run\x20format','Use\x20a\x20different\x20project\x20name.','4jGnToY','readFile','test','168570YCQtau','\x0a√\x20Project\x20','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','\x20\x20Installing\x20dependencies...','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','\x22\x20already\x20exists.','production','11qnwSBl','16IcPwSu','ignore','length','join','access','Project\x20name\x20cannot\x20be\x20empty.','stringify','Check\x20directory\x20permissions.','parse','\x20\x20rabetbase\x20run\x20start\x0a','writeFile','resolve','utf-8','300937baYlCp','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'];a163_0x1660=function(){return _0x199698;};return a163_0x1660();}(function(_0x240099,_0x342824){const _0x2b2f84=a163_0x57e9,_0x48368a=_0x240099();while(!![]){try{const _0x32ddd1=-parseInt(_0x2b2f84(0xd2))/0x1+parseInt(_0x2b2f84(0x105))/0x2*(-parseInt(_0x2b2f84(0xd8))/0x3)+parseInt(_0x2b2f84(0xe5))/0x4*(-parseInt(_0x2b2f84(0xe8))/0x5)+parseInt(_0x2b2f84(0xde))/0x6*(-parseInt(_0x2b2f84(0xfe))/0x7)+parseInt(_0x2b2f84(0xf1))/0x8*(-parseInt(_0x2b2f84(0x102))/0x9)+-parseInt(_0x2b2f84(0x101))/0xa*(parseInt(_0x2b2f84(0xf0))/0xb)+-parseInt(_0x2b2f84(0xdf))/0xc*(-parseInt(_0x2b2f84(0x103))/0xd);if(_0x32ddd1===_0x342824)break;else _0x48368a['push'](_0x48368a['shift']());}catch(_0x2f4480){_0x48368a['push'](_0x48368a['shift']());}}}(a163_0x1660,0x2a4a1));import a163_0xe2e705 from'path';import a163_0x49354c 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';function a163_0x57e9(_0x381623,_0x27bdfc){_0x381623=_0x381623-0xcb;const _0x16606e=a163_0x1660();let _0x57e95a=_0x16606e[_0x381623];return _0x57e95a;}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(_0x17fe40,_0x47d2dd,_0x41bcdc,_0x4d1506){const _0x257c22=a163_0x57e9,_0x2fa563=await checkCliVersion();(_0x2fa563['needsUpgrade']||_0x2fa563[_0x257c22(0xd5)])&&(printCliUpgradeWarning(_0x2fa563),assertCliVersionSupported(_0x2fa563));if(!_0x17fe40||_0x17fe40[_0x257c22(0xdc)]()==='')throw CliErrors[_0x257c22(0x100)](_0x257c22(0xf6));const _0x401a1f=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x401a1f[_0x257c22(0xe7)](_0x17fe40))throw CliErrors[_0x257c22(0x100)]('Project\x20name\x20contains\x20invalid\x20characters.',_0x257c22(0xea));if(_0x17fe40[_0x257c22(0xf3)]>0x64)throw CliErrors[_0x257c22(0x100)](_0x257c22(0x104));const _0x58702f=a163_0xe2e705['resolve'](process[_0x257c22(0xcb)](),_0x17fe40);if(existsSync(_0x58702f))throw CliErrors[_0x257c22(0x100)]('Project\x20directory\x20\x22'+_0x17fe40+_0x257c22(0xee),_0x257c22(0xe4));try{const _0x5a0aa3=a163_0xe2e705[_0x257c22(0xdd)](_0x58702f);await a163_0x49354c[_0x257c22(0xf5)](_0x5a0aa3,a163_0x49354c['constants'][_0x257c22(0xd9)]);}catch{throw CliErrors[_0x257c22(0x100)]('Cannot\x20create\x20project\x20in\x20current\x20directory.',_0x257c22(0xf8));}try{console[_0x257c22(0xd4)](_0x257c22(0xe0)+_0x17fe40+_0x257c22(0xd7));const _0x261033=getSubAppReactDemoTemplateDir();await copyDirectory(_0x261033,_0x58702f),console[_0x257c22(0xd4)]('\x20\x20√\x20Project\x20template\x20created'),await updatePackageJsonName(_0x17fe40),console[_0x257c22(0xd4)]('\x20\x20√\x20package.json\x20updated'),console['log'](_0x257c22(0xec)),console[_0x257c22(0xd4)](_0x257c22(0xff)),await formatCode(_0x58702f),console[_0x257c22(0xd4)]('\x20\x20√\x20Code\x20formatted'),await configureProject(_0x17fe40,_0x41bcdc,_0x47d2dd),console[_0x257c22(0xd4)]('\x20\x20√\x20Configuration\x20file\x20created'),_0x41bcdc&&await pullApiConfig(_0x58702f,_0x41bcdc,_0x47d2dd,_0x4d1506),console[_0x257c22(0xd4)](_0x257c22(0xe9)+_0x17fe40+_0x257c22(0xdb)),console['log']('\x0a\x20\x20cd\x20'+_0x17fe40),console[_0x257c22(0xd4)](_0x257c22(0xfa));}catch(_0x10e698){try{existsSync(_0x58702f)&&await a163_0x49354c['rm'](_0x58702f,{'recursive':!![],'force':!![]});}catch{}throw _0x10e698;}}async function updatePackageJsonName(_0x41b331){const _0x59a12c=a163_0x57e9,_0x14bdaf=a163_0xe2e705[_0x59a12c(0xfc)](process[_0x59a12c(0xcb)](),_0x41b331),_0x3f4c96=a163_0xe2e705[_0x59a12c(0xf4)](_0x14bdaf,_0x59a12c(0xd1)),_0x438389=await a163_0x49354c[_0x59a12c(0xe6)](_0x3f4c96,_0x59a12c(0xfd)),_0x178eab=JSON[_0x59a12c(0xf9)](_0x438389);_0x178eab[_0x59a12c(0xe2)]=_0x41b331,_0x178eab[_0x59a12c(0x107)]=_0x59a12c(0xeb),await a163_0x49354c[_0x59a12c(0xfb)](_0x3f4c96,JSON[_0x59a12c(0xf7)](_0x178eab,null,0x2)+'\x0a');}function detectPackageManager(){const _0x20f8f1=a163_0x57e9;try{return execSync(_0x20f8f1(0xcf),{'stdio':_0x20f8f1(0xf2)}),'bun';}catch{return _0x20f8f1(0xda);}}async function formatCode(_0x55b3a2){const _0x5f3870=a163_0x57e9;try{await execAsync(_0x5f3870(0xe3),{'cwd':_0x55b3a2});}catch{}}async function configureProject(_0x573146,_0x2e1827,_0x19cde5){const _0x3bf2ba=a163_0x57e9,_0x2c0e8b=a163_0xe2e705[_0x3bf2ba(0xfc)](process['cwd'](),_0x573146),_0x23b2ac=a163_0xe2e705[_0x3bf2ba(0xf4)](_0x2c0e8b,NEW_CONFIG_NAME),_0x2b3624=readConfig(),_0x26b4b8=typeof _0x2b3624[_0x3bf2ba(0xe1)]==='string'?_0x2b3624[_0x3bf2ba(0xe1)]:undefined,_0x2be765={};for(const _0x4aa321 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x2b3624[_0x4aa321]!=null)_0x2be765[_0x4aa321]=_0x2b3624[_0x4aa321];}const _0x3be92f=buildCanonicalProjectConfig(_0x2be765,{'appCodes':_0x2e1827?[_0x2e1827]:[],'env':_0x19cde5||_0x26b4b8||'production','metadata':{'createdAt':new Date()[_0x3bf2ba(0xcc)](),'version':getCliVersion()}});writeConfigFile(_0x23b2ac,_0x3be92f);}async function pullApiConfig(_0x37c077,_0x44aa32,_0x1dcdaf,_0x352dad){const _0x4897b4=a163_0x57e9,_0x2de971=process['cwd']();try{process['chdir'](_0x37c077);const _0x5ce1a2=_0x1dcdaf||_0x4897b4(0xef);initEnv(_0x5ce1a2),console[_0x4897b4(0xd4)](_0x4897b4(0xd6));const {configArray:_0x51e2fd}=await fetchModelList(_0x44aa32,_0x352dad||''),_0x5c0c59=await generateApiFile(_0x51e2fd,'',_0x44aa32,!![],_0x5ce1a2,DEFAULT_API_DIR);console[_0x4897b4(0xd4)](_0x4897b4(0xce)+_0x51e2fd[_0x4897b4(0xf3)]+_0x4897b4(0xd3)+_0x5c0c59[_0x4897b4(0xd0)]+_0x4897b4(0xcd));}catch(_0x1d662e){console['log'](_0x4897b4(0xed)+CLI_BIN_NAME+'\x20api\x20pull`\x20manually\x20later.');}finally{process[_0x4897b4(0x106)](_0x2de971);}}
@@ -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_0x40708e=a164_0x2639;(function(_0x4d6d85,_0x2a0939){const _0x50ff5f=a164_0x2639,_0x444475=_0x4d6d85();while(!![]){try{const _0x3fd990=-parseInt(_0x50ff5f(0x106))/0x1*(parseInt(_0x50ff5f(0x10c))/0x2)+parseInt(_0x50ff5f(0x10e))/0x3*(parseInt(_0x50ff5f(0x100))/0x4)+-parseInt(_0x50ff5f(0x105))/0x5+parseInt(_0x50ff5f(0x108))/0x6*(parseInt(_0x50ff5f(0x10a))/0x7)+-parseInt(_0x50ff5f(0x107))/0x8*(-parseInt(_0x50ff5f(0x103))/0x9)+parseInt(_0x50ff5f(0x101))/0xa+-parseInt(_0x50ff5f(0x102))/0xb;if(_0x3fd990===_0x2a0939)break;else _0x444475['push'](_0x444475['shift']());}catch(_0x5729d2){_0x444475['push'](_0x444475['shift']());}}}(a164_0xd5a8,0xb5763));import a164_0xaff788 from'node:path';import{fileURLToPath}from'node:url';function a164_0xd5a8(){const _0x4655c5=['../../../../','4194921FidpuB','projects','dirname','4TwTLfG','13342480sVFIGT','35465320fRIYMW','9HGWscq','sub-app-react-demo','1016830wMcMPR','218857FVsYbW','10938568upVAmB','4364688XNAQqc','templates','7DgLZgl','resolve','6AQcNUH'];a164_0xd5a8=function(){return _0x4655c5;};return a164_0xd5a8();}const __dirname=a164_0xaff788[a164_0x40708e(0xff)](fileURLToPath(import.meta.url));function a164_0x2639(_0x40a39a,_0x4bcf1a){_0x40a39a=_0x40a39a-0xff;const _0xd5a8d=a164_0xd5a8();let _0x2639b0=_0xd5a8d[_0x40a39a];return _0x2639b0;}export function getRabetbaseCliPackageRoot(){const _0x37768e=a164_0x40708e;return a164_0xaff788[_0x37768e(0x10b)](__dirname,_0x37768e(0x10d));}export function getSubAppReactDemoTemplateDir(){const _0x4c0ad7=a164_0x40708e;return a164_0xaff788['join'](getRabetbaseCliPackageRoot(),_0x4c0ad7(0x109),_0x4c0ad7(0x10f),_0x4c0ad7(0x104));}
@@ -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(_0x49946b,_0x80e2bf){const _0x249803=a165_0x31b3,_0x386350=_0x49946b();while(!![]){try{const _0x407fc4=-parseInt(_0x249803(0x194))/0x1*(-parseInt(_0x249803(0x18d))/0x2)+-parseInt(_0x249803(0x197))/0x3+-parseInt(_0x249803(0x19f))/0x4*(-parseInt(_0x249803(0x18f))/0x5)+-parseInt(_0x249803(0x193))/0x6+-parseInt(_0x249803(0x196))/0x7*(parseInt(_0x249803(0x190))/0x8)+-parseInt(_0x249803(0x191))/0x9+parseInt(_0x249803(0x195))/0xa*(parseInt(_0x249803(0x199))/0xb);if(_0x407fc4===_0x80e2bf)break;else _0x386350['push'](_0x386350['shift']());}catch(_0x4cad16){_0x386350['push'](_0x386350['shift']());}}}(a165_0x2494,0x2e78a));import a165_0x513ce2 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';function a165_0x2494(){const _0x3d3d4b=['197528oiwXpO','1477062WguWqy','开始复制项目模板','582840AJUXWv','147293NZehjf','1504070YxTNyr','63RtveoD','254646eDNqlV','copy','22PJlBhs','info','now','项目模板复制失败','success','message','1242392KgiwFZ','项目模板复制完成','2NPzPtp','resolve','5UcdjRW'];a165_0x2494=function(){return _0x3d3d4b;};return a165_0x2494();}const templateDir=getSubAppReactDemoTemplateDir();function a165_0x31b3(_0x14c6ba,_0x139bbe){_0x14c6ba=_0x14c6ba-0x18d;const _0x249467=a165_0x2494();let _0x31b351=_0x249467[_0x14c6ba];return _0x31b351;}export async function copyProjectTemplate(_0x3bb4c0){const _0xa77dff=a165_0x31b3,_0xf67f27=Date[_0xa77dff(0x19b)](),_0x271afb=a165_0x513ce2[_0xa77dff(0x18e)](process['cwd'](),_0x3bb4c0);try{logger[_0xa77dff(0x19a)](_0xa77dff(0x198),_0xa77dff(0x192),{'projectCode':_0x3bb4c0,'templateDir':templateDir}),await copyDirectory(templateDir,_0x271afb);const _0x2e99c2=Date[_0xa77dff(0x19b)]()-_0xf67f27;logger[_0xa77dff(0x19d)](_0xa77dff(0x198),_0xa77dff(0x1a0),_0x2e99c2,{'projectCode':_0x3bb4c0});}catch(_0x1985e3){const _0x6fa3e4=Date[_0xa77dff(0x19b)]()-_0xf67f27;logger['error']('copy',_0xa77dff(0x19c),{'projectCode':_0x3bb4c0,'error':_0x1985e3 instanceof Error?_0x1985e3[_0xa77dff(0x19e)]:String(_0x1985e3),'duration':_0x6fa3e4});throw _0x1985e3;}return formatElapsed(_0xf67f27);}
@@ -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(_0x240404,_0x13bffc){const _0x54c72f=a166_0x6090,_0x9678a9=_0x240404();while(!![]){try{const _0x52f4d6=-parseInt(_0x54c72f(0x16f))/0x1*(-parseInt(_0x54c72f(0x176))/0x2)+-parseInt(_0x54c72f(0x16a))/0x3*(-parseInt(_0x54c72f(0x16e))/0x4)+parseInt(_0x54c72f(0x172))/0x5+-parseInt(_0x54c72f(0x174))/0x6+parseInt(_0x54c72f(0x177))/0x7*(-parseInt(_0x54c72f(0x16b))/0x8)+-parseInt(_0x54c72f(0x171))/0x9*(-parseInt(_0x54c72f(0x169))/0xa)+parseInt(_0x54c72f(0x175))/0xb*(parseInt(_0x54c72f(0x168))/0xc);if(_0x52f4d6===_0x13bffc)break;else _0x9678a9['push'](_0x9678a9['shift']());}catch(_0x285735){_0x9678a9['push'](_0x9678a9['shift']());}}}(a166_0x2f53,0xd438b));import a166_0x15b546 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a166_0x6090(_0xc5f07e,_0x185b55){_0xc5f07e=_0xc5f07e-0x161;const _0x2f530a=a166_0x2f53();let _0x609022=_0x2f530a[_0xc5f07e];return _0x609022;}import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x17d261){const _0x2858b3=a166_0x6090,_0x33a87a=Date[_0x2858b3(0x166)](),_0x3ec19c=a166_0x15b546[_0x2858b3(0x170)](process[_0x2858b3(0x16c)](),_0x17d261);try{logger[_0x2858b3(0x165)](_0x2858b3(0x16d),_0x2858b3(0x164),{'projectCode':_0x17d261}),await execa(resolveNpmBin(_0x2858b3(0x167)),[_0x2858b3(0x162),'--write','.'],{'cwd':_0x3ec19c});const _0x36f7a3=Date['now']()-_0x33a87a;logger[_0x2858b3(0x173)](_0x2858b3(0x16d),_0x2858b3(0x161),_0x36f7a3,{'projectCode':_0x17d261});}catch(_0x581308){const _0x28edfc=Date[_0x2858b3(0x166)]()-_0x33a87a;logger[_0x2858b3(0x163)](_0x2858b3(0x16d),'代码格式化失败',{'projectCode':_0x17d261,'error':_0x581308 instanceof Error?_0x581308['message']:String(_0x581308),'duration':_0x28edfc});throw _0x581308;}return formatElapsed(_0x33a87a);}function a166_0x2f53(){const _0x4f8d10=['cwd','format','20HHQGki','8cPhwkr','resolve','1512855spGumd','1201785YfOCso','success','10071654rauBdH','22RiWvhf','259632fWHqmw','7PCDQZE','代码格式化完成','prettier','error','开始格式化代码','info','now','npx','2794632hXEseD','10XpoZYb','428919EwbfUu','637992jMoSuT'];a166_0x2f53=function(){return _0x4f8d10;};return a166_0x2f53();}
@@ -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(_0x1604e7,_0x3a6d08){const _0x52cdf7=a167_0x291c,_0x507d91=_0x1604e7();while(!![]){try{const _0x3d3d7a=-parseInt(_0x52cdf7(0x7b))/0x1*(-parseInt(_0x52cdf7(0x73))/0x2)+-parseInt(_0x52cdf7(0x79))/0x3+parseInt(_0x52cdf7(0x82))/0x4+-parseInt(_0x52cdf7(0x76))/0x5*(-parseInt(_0x52cdf7(0x75))/0x6)+parseInt(_0x52cdf7(0x74))/0x7*(-parseInt(_0x52cdf7(0x72))/0x8)+parseInt(_0x52cdf7(0x78))/0x9*(parseInt(_0x52cdf7(0x81))/0xa)+-parseInt(_0x52cdf7(0x6f))/0xb*(parseInt(_0x52cdf7(0x71))/0xc);if(_0x3d3d7a===_0x3a6d08)break;else _0x507d91['push'](_0x507d91['shift']());}catch(_0x250f11){_0x507d91['push'](_0x507d91['shift']());}}}(a167_0x2870,0xf192a));import a167_0x3190af from'node:path';function a167_0x291c(_0x37577f,_0xe1286e){_0x37577f=_0x37577f-0x6e;const _0x2870fd=a167_0x2870();let _0x291c34=_0x2870fd[_0x37577f];return _0x291c34;}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a167_0x2870(){const _0xa9dfa8=['9VrBAHd','950079JMpiuz','依赖安装完成','153887uqnLAc','开始安装依赖','npm','install','now','success','10572910XrcLJu','1191880CFKsvM','resolve','143mCxBXk','error','1196844jbvGfC','3851216JhZSdK','8CsYOKK','14cUZizX','416022xTufYU','115oHNDHv','https://registry.npmmirror.com'];a167_0x2870=function(){return _0xa9dfa8;};return a167_0x2870();}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x5730ed){const _0x33865c=a167_0x291c,_0x5c93fe=Date['now'](),_0x1ce296=a167_0x3190af[_0x33865c(0x6e)](process['cwd'](),_0x5730ed);try{logger['info'](_0x33865c(0x7e),_0x33865c(0x7c),{'projectCode':_0x5730ed,'registry':_0x33865c(0x77)}),await execa(resolveNpmBin(_0x33865c(0x7d)),[_0x33865c(0x7e),'--registry',_0x33865c(0x77)],{'cwd':_0x1ce296});const _0x39703f=Date[_0x33865c(0x7f)]()-_0x5c93fe;logger[_0x33865c(0x80)](_0x33865c(0x7e),_0x33865c(0x7a),_0x39703f,{'projectCode':_0x5730ed});}catch(_0x4fa644){const _0x24ead0=Date[_0x33865c(0x7f)]()-_0x5c93fe;logger[_0x33865c(0x70)](_0x33865c(0x7e),'依赖安装失败',{'projectCode':_0x5730ed,'error':_0x4fa644 instanceof Error?_0x4fa644['message']:String(_0x4fa644),'duration':_0x24ead0});throw _0x4fa644;}return formatElapsed(_0x5c93fe);}
@@ -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_0x58d02e=a168_0x3f8c;function a168_0x237e(){const _0x69d74e=['116WLHJRN','1072555GnFiRY','bool','trim','project-name','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','args','Create\x20a\x20new\x20project','480583hWDojQ','nonInteractive','str','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','write','string','Project\x20name','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','yes','15091400cDXWVe','create','env','5986290zXQcwV','Skip\x20confirmation\x20prompt','48666VCFFxJ','1865912Egyhht','project','upgrade','validation','1035202SqHcbj','name','Usage:\x20','appcode','boolean','Target\x20environment'];a168_0x237e=function(){return _0x69d74e;};return a168_0x237e();}(function(_0x5ecaf3,_0x4e1b2c){const _0x455436=a168_0x3f8c,_0x1de8d1=_0x5ecaf3();while(!![]){try{const _0x4cad65=parseInt(_0x455436(0x1d1))/0x1+-parseInt(_0x455436(0x1bf))/0x2+-parseInt(_0x455436(0x1be))/0x3*(-parseInt(_0x455436(0x1c9))/0x4)+-parseInt(_0x455436(0x1ca))/0x5+-parseInt(_0x455436(0x1dd))/0x6+-parseInt(_0x455436(0x1c3))/0x7+parseInt(_0x455436(0x1da))/0x8;if(_0x4cad65===_0x4e1b2c)break;else _0x1de8d1['push'](_0x1de8d1['shift']());}catch(_0x49db1a){_0x1de8d1['push'](_0x1de8d1['shift']());}}}(a168_0x237e,0x84e7a));function a168_0x3f8c(_0xb6ab5,_0x2d7cff){_0xb6ab5=_0xb6ab5-0x1be;const _0x237e3a=a168_0x237e();let _0x3f8c7b=_0x237e3a[_0xb6ab5];return _0x3f8c7b;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';const createFlags=[{'name':a168_0x58d02e(0x1c4),'type':'string','description':a168_0x58d02e(0x1d7)},{'name':a168_0x58d02e(0x1dc),'type':a168_0x58d02e(0x1d6),'description':a168_0x58d02e(0x1c8)},{'name':a168_0x58d02e(0x1c6),'type':'string','description':a168_0x58d02e(0x1ce)}],upgradeFlags=[{'name':a168_0x58d02e(0x1d9),'type':a168_0x58d02e(0x1c7),'description':a168_0x58d02e(0x1de),'default':![]}];export const projectDefinitions=[{'service':'project','command':a168_0x58d02e(0x1db),'description':a168_0x58d02e(0x1d0),'risk':a168_0x58d02e(0x1d5),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a168_0x58d02e(0x1cd),'description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x2f692a){const _0x2b3174=a168_0x58d02e,{createApp:_0x2c2b98}=await import('../../commands/project/create/main.js'),{createProjectNonInteractive:_0x457689}=await import('../../commands/project/create/non-interactive.js'),_0x1fb21e=_0x2f692a[_0x2b3174(0x1d3)]('name')[_0x2b3174(0x1cc)]()||_0x2f692a[_0x2b3174(0x1cf)][0x0]?.[_0x2b3174(0x1cc)](),_0x903b10=_0x2f692a['str']('env')||undefined,_0x283ab7=_0x2f692a[_0x2b3174(0x1d3)]('appcode')||undefined;if(_0x2f692a[_0x2b3174(0x1d2)]){if(!_0x1fb21e)throw CliErrors[_0x2b3174(0x1c2)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x2b3174(0x1c5)+CLI_BIN_NAME+_0x2b3174(0x1d8));await _0x457689(_0x1fb21e,_0x903b10,_0x283ab7,_0x2f692a['cookie']);}else await _0x2c2b98({'projectCode':_0x1fb21e,'appCode':_0x283ab7,'env':_0x903b10,'cookie':_0x2f692a['cookie']});return{'ok':!![]};}},{'service':a168_0x58d02e(0x1c0),'command':a168_0x58d02e(0x1c1),'description':a168_0x58d02e(0x1d4),'risk':a168_0x58d02e(0x1d5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x1f0bf7){const _0x358e87=a168_0x58d02e;return await upgradeApp(_0x1f0bf7['nonInteractive'],{'yes':_0x1f0bf7[_0x358e87(0x1cb)](_0x358e87(0x1d9))}),{'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_0x12f620=a169_0x960f;(function(_0x1c9bb2,_0x25d0c3){const _0x4b8624=a169_0x960f,_0x47e28d=_0x1c9bb2();while(!![]){try{const _0x337e69=parseInt(_0x4b8624(0x244))/0x1*(-parseInt(_0x4b8624(0x269))/0x2)+parseInt(_0x4b8624(0x22c))/0x3+-parseInt(_0x4b8624(0x235))/0x4+-parseInt(_0x4b8624(0x259))/0x5*(parseInt(_0x4b8624(0x264))/0x6)+-parseInt(_0x4b8624(0x257))/0x7*(parseInt(_0x4b8624(0x25c))/0x8)+parseInt(_0x4b8624(0x1f9))/0x9*(-parseInt(_0x4b8624(0x208))/0xa)+-parseInt(_0x4b8624(0x252))/0xb*(-parseInt(_0x4b8624(0x1f1))/0xc);if(_0x337e69===_0x25d0c3)break;else _0x47e28d['push'](_0x47e28d['shift']());}catch(_0x22a87d){_0x47e28d['push'](_0x47e28d['shift']());}}}(a169_0x49f0,0x82b4a));import a169_0x1e0e4f from'chalk';import a169_0x29510e from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';function a169_0x49f0(){const _0x78e24=['Step\x202/7:\x20.lovrabet/\x20directory\x20removed','Step\x206/7:\x20Installing\x20new\x20skill...','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','object','\x20\x20bun\x20install','label','cwd','Legacy\x20artifacts:','package.json','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','dependencies','2101221rYROav','stringify','succeed','removed\x20','\x20\x20Fields\x20to\x20migrate:\x20','fail','step','no\x20matching\x20entry\x20found','lovrabet/lovrabet-skill\x20removed','3693840sPWEyx','parse','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','isDirectory','\x20\x20#\x20or','fields','needed','FOUND','MCP\x20config:','failed','message','yes','Clean\x20MCP\x20config','sdkUpgrade','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','6776RelCHq','some','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','no\x20legacy\x20entry','CANCEL','Step\x204/7:\x20Cleaning\x20MCP\x20config...','lovrabet/rabetbase','bold','includes','\x20→\x20','white','FAIL','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','Step\x201/7:\x20Migrating\x20config...','39889641cTqzSn','already\x20exists\x20(will\x20merge)','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','\x20\x20Current\x20version\x20in\x20','isArray','322vjuoXi','@lovrabet/sdk:','5295190DdBmZE','undefined','Step\x204/7:\x20MCP\x20config\x20—\x20','183152advLmo','filter','Proceed\x20with\x20upgrade?','\x20(backup:\x20','hasNewConfig','Config\x20migration','green','error','6sLvxkq','gray','cyan','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','\x20\x20Action:\x20delete','72IbUHsW','Remove\x20.lovrabet/','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','start','\x20removed','Upgrade\x20completed\x20successfully!','exit\x20','mcpServers','\x20\x20Step\x20','oldPath','detail','yellow','not\x20needed','Step\x201/7:\x20Config\x20migration\x20—\x20','Skill\x20swap:','12DfWfEw','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','.cursor/mcp.json','done','not\x20found\x20(will\x20create)','length','log','1395kfDkIs','oldMcpConfig','join','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','string','\x20removed\x20(','latest','entries','oldArtifacts','\x20\x20New\x20config\x20(.rabetbase.json):\x20','status','configMigration','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','\x20→\x20latest','lovrabet/rabetbase\x20installed\x20globally','33020cshlzp','values','Upgrade\x20cancelled.','Remove\x20legacy\x20artifacts','@lovrabet/sdk','inherit','\x20→\x20keys:\x20','skipped','push','red','info','.claude/skills/lovrabet','@lovrabet/dataset-mcp-server','files','Install\x20new\x20skill','Config\x20file:','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','Upgrade\x20@lovrabet/sdk','args','keys','path','utf8','[\x22@lovrabet/sdk\x22]:\x20','===\x20Upgrade\x20Summary\x20==='];a169_0x49f0=function(){return _0x78e24;};return a169_0x49f0();}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_0x12f620(0x25d)](_0x245a99=>_0x245a99!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x32871c){const _0x5789e0=a169_0x12f620,_0x4caf16=[];for(const _0x406e05 of Object[_0x5789e0(0x209)](CORE_IDE_CONFIGS)){if(_0x406e05[_0x5789e0(0x215)])for(const _0x2b74da of _0x406e05[_0x5789e0(0x215)]){_0x4caf16['push'](resolve(_0x32871c,_0x2b74da['path']));}}return _0x4caf16;}function analyse(_0x1af116){const _0x8b3677=a169_0x12f620;let _0x2ebd08=null;const _0x1c52f2=resolve(_0x1af116,NEW_CONFIG_NAME),_0x2f04c1=existsSync(_0x1c52f2);for(const _0x191da0 of LEGACY_CONFIG_NAMES){const _0x56e96f=resolve(_0x1af116,_0x191da0);if(existsSync(_0x56e96f)){const _0x3b0cd1=readConfigFile(_0x56e96f),_0x1797f2=Object[_0x8b3677(0x21b)](_0x3b0cd1)[_0x8b3677(0x25d)](_0x898131=>typeof _0x3b0cd1[_0x898131]!==_0x8b3677(0x25a));_0x2ebd08={'oldPath':_0x56e96f,'hasNewConfig':_0x2f04c1,'fields':_0x1797f2};break;}}const _0x2dd1cb=[],_0x4b35ac=resolve(_0x1af116,'.lovrabet');if(existsSync(_0x4b35ac))_0x2dd1cb[_0x8b3677(0x210)](_0x4b35ac);const _0x3199b4=resolve(_0x1af116,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x3199b4))_0x2dd1cb[_0x8b3677(0x210)](_0x3199b4);const _0x6b9362=resolve(_0x1af116,_0x8b3677(0x213));if(existsSync(_0x6b9362))_0x2dd1cb['push'](_0x6b9362);for(const _0xf0816a of collectIdeSkillFiles(_0x1af116)){if(existsSync(_0xf0816a))_0x2dd1cb[_0x8b3677(0x210)](_0xf0816a);}let _0x24dfaf=null;const _0x311487=resolve(_0x1af116,_0x8b3677(0x1f4));if(existsSync(_0x311487))try{const _0x1e52a6=JSON[_0x8b3677(0x236)](readFileSync(_0x311487,_0x8b3677(0x21d)));if(_0x1e52a6?.[_0x8b3677(0x270)]&&typeof _0x1e52a6[_0x8b3677(0x270)]===_0x8b3677(0x224)){const _0x3f6513=[];for(const [_0x33ea68,_0x2784b1]of Object[_0x8b3677(0x200)](_0x1e52a6[_0x8b3677(0x270)])){const _0x2a97d8=_0x2784b1;_0x2a97d8?.['args']&&Array[_0x8b3677(0x256)](_0x2a97d8[_0x8b3677(0x21a)])&&_0x2a97d8[_0x8b3677(0x21a)][_0x8b3677(0x245)](_0x414390=>typeof _0x414390===_0x8b3677(0x1fd)&&_0x414390[_0x8b3677(0x24c)](_0x8b3677(0x214)))&&_0x3f6513[_0x8b3677(0x210)](_0x33ea68);}_0x3f6513[_0x8b3677(0x1f7)]>0x0&&(_0x24dfaf={'path':_0x311487,'keys':_0x3f6513});}}catch{}const _0x3a0f38=_0x2dd1cb[_0x8b3677(0x1f7)]>0x0||_0x2ebd08!==null;let _0x390b90=null;const _0x12e498=resolve(_0x1af116,_0x8b3677(0x229));if(existsSync(_0x12e498))try{const _0x3c730e=JSON['parse'](readFileSync(_0x12e498,'utf8'));for(const _0x38db7d of[_0x8b3677(0x22b),'devDependencies']){const _0x20ec8d=_0x3c730e?.[_0x38db7d]?.[_0x8b3677(0x20c)];if(typeof _0x20ec8d===_0x8b3677(0x1fd)){_0x20ec8d!==_0x8b3677(0x1ff)&&(_0x390b90={'pkgPath':_0x12e498,'currentVersion':_0x20ec8d,'field':_0x38db7d});break;}}}catch{}return{'configMigration':_0x2ebd08,'oldArtifacts':_0x2dd1cb,'oldMcpConfig':_0x24dfaf,'needsSkillSwap':_0x3a0f38,'sdkUpgrade':_0x390b90};}function printReport(_0xa799f9){const _0x197a94=a169_0x12f620,{configMigration:_0x3b0d02,oldArtifacts:_0x54e384,oldMcpConfig:_0x483a14,needsSkillSwap:_0xbb4cd4}=_0xa799f9;console['log'](''),console[_0x197a94(0x1f8)](a169_0x1e0e4f[_0x197a94(0x24b)]('===\x20Upgrade\x20Analysis\x20===')),console[_0x197a94(0x1f8)]('');_0x3b0d02?(console[_0x197a94(0x1f8)](a169_0x1e0e4f[_0x197a94(0x266)](_0x197a94(0x217))+('\x20\x20'+a169_0x1e0e4f['yellow'](_0x3b0d02[_0x197a94(0x272)]))),console['log'](_0x197a94(0x202)+(_0x3b0d02[_0x197a94(0x260)]?a169_0x1e0e4f[_0x197a94(0x262)](_0x197a94(0x253)):a169_0x1e0e4f['gray'](_0x197a94(0x1f6)))),console[_0x197a94(0x1f8)](_0x197a94(0x230)+_0x3b0d02[_0x197a94(0x23a)]['join'](',\x20')),console[_0x197a94(0x1f8)](_0x197a94(0x1f3))):console['log'](a169_0x1e0e4f[_0x197a94(0x266)](_0x197a94(0x217))+'\x20\x20'+a169_0x1e0e4f[_0x197a94(0x265)]('no\x20legacy\x20config\x20found'));console['log']('');if(_0x54e384[_0x197a94(0x1f7)]>0x0){console[_0x197a94(0x1f8)](a169_0x1e0e4f['cyan'](_0x197a94(0x228)));for(const _0x3b126f of _0x54e384){console[_0x197a94(0x1f8)]('\x20\x20'+a169_0x1e0e4f['red'](_0x197a94(0x23c))+'\x20\x20'+_0x3b126f);}console[_0x197a94(0x1f8)](_0x197a94(0x268));}else console['log'](a169_0x1e0e4f['cyan']('Legacy\x20artifacts:')+'\x20\x20'+a169_0x1e0e4f[_0x197a94(0x265)]('none\x20found'));console['log']('');_0x483a14?(console['log'](a169_0x1e0e4f[_0x197a94(0x266)]('MCP\x20config:')+('\x20\x20'+a169_0x1e0e4f[_0x197a94(0x1ed)](_0x483a14[_0x197a94(0x21c)])+_0x197a94(0x20e)+_0x483a14[_0x197a94(0x21b)][_0x197a94(0x1fb)](',\x20'))),console[_0x197a94(0x1f8)](_0x197a94(0x237))):console[_0x197a94(0x1f8)](a169_0x1e0e4f[_0x197a94(0x266)](_0x197a94(0x23d))+'\x20\x20'+a169_0x1e0e4f[_0x197a94(0x265)](_0x197a94(0x247)));console[_0x197a94(0x1f8)](''),console[_0x197a94(0x1f8)](a169_0x1e0e4f[_0x197a94(0x266)](_0x197a94(0x1f0))+('\x20\x20'+(_0xbb4cd4?a169_0x1e0e4f[_0x197a94(0x1ed)](_0x197a94(0x23b)):a169_0x1e0e4f[_0x197a94(0x262)](_0x197a94(0x1ee)))));_0xbb4cd4&&console[_0x197a94(0x1f8)](_0x197a94(0x205)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x197a94(0x1f8)]('');if(_0xa799f9[_0x197a94(0x242)]){const {currentVersion:_0x496fac,field:_0x714ed4,pkgPath:_0x3ea492}=_0xa799f9['sdkUpgrade'];console[_0x197a94(0x1f8)](a169_0x1e0e4f[_0x197a94(0x266)]('@lovrabet/sdk:')+('\x20\x20'+a169_0x1e0e4f[_0x197a94(0x1ed)](_0x3ea492))),console[_0x197a94(0x1f8)](_0x197a94(0x255)+_0x714ed4+':\x20'+a169_0x1e0e4f[_0x197a94(0x1ed)](_0x496fac)+_0x197a94(0x24d)+a169_0x1e0e4f[_0x197a94(0x262)](_0x197a94(0x1ff))),console[_0x197a94(0x1f8)](_0x197a94(0x218));}else console[_0x197a94(0x1f8)](a169_0x1e0e4f[_0x197a94(0x266)](_0x197a94(0x258))+'\x20\x20'+a169_0x1e0e4f[_0x197a94(0x265)]('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x197a94(0x1f8)]('');}function execConfigMigration(_0x8e0859,_0x3673b0){const _0x3c0535=a169_0x12f620,{configMigration:_0x1b121e}=_0x8e0859;if(!_0x1b121e?.[_0x3c0535(0x272)])return{'step':0x1,'label':_0x3c0535(0x261),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x36d231=readConfigFile(_0x1b121e[_0x3c0535(0x272)]),_0x3286e3=resolve(_0x3673b0,NEW_CONFIG_NAME),_0x585065=_0x1b121e[_0x3c0535(0x260)]?readConfigFile(_0x3286e3):{};for(const [_0x42b229,_0x5a8073]of Object[_0x3c0535(0x200)](_0x36d231)){!(_0x42b229 in _0x585065)&&(_0x585065[_0x42b229]=_0x5a8073);}writeConfigFile(_0x3286e3,_0x585065);const _0x4e8754=_0x1b121e['oldPath']+'.bak';return renameSync(_0x1b121e[_0x3c0535(0x272)],_0x4e8754),{'step':0x1,'label':_0x3c0535(0x261),'ok':!![],'detail':_0x1b121e['oldPath']+_0x3c0535(0x24d)+_0x3286e3+_0x3c0535(0x25f)+_0x4e8754+')'};}function a169_0x960f(_0x2552a5,_0x4bd8e6){_0x2552a5=_0x2552a5-0x1ec;const _0x49f009=a169_0x49f0();let _0x960f62=_0x49f009[_0x2552a5];return _0x960f62;}function execRemoveOldArtifacts(_0x1e6468){const _0x5b613c=a169_0x12f620,_0x4988fc=[];for(const _0x48070d of _0x1e6468){try{if(!existsSync(_0x48070d))continue;const _0x31ddd1=tryStat(_0x48070d);_0x31ddd1?.[_0x5b613c(0x238)]()?rmSync(_0x48070d,{'recursive':!![],'force':!![]}):unlinkSync(_0x48070d);}catch(_0x53d852){_0x4988fc['push'](_0x48070d+':\x20'+_0x53d852[_0x5b613c(0x23f)]);}}return{'step':0x3,'label':_0x5b613c(0x20b),'ok':_0x4988fc[_0x5b613c(0x1f7)]===0x0,'detail':_0x4988fc[_0x5b613c(0x1f7)]>0x0?_0x1e6468[_0x5b613c(0x1f7)]-_0x4988fc[_0x5b613c(0x1f7)]+'/'+_0x1e6468[_0x5b613c(0x1f7)]+_0x5b613c(0x1fe)+_0x4988fc[_0x5b613c(0x1fb)](';\x20')+')':_0x1e6468[_0x5b613c(0x1f7)]+_0x5b613c(0x26d)};}function execCleanMcp(_0xb217ac){const _0x2b1cff=a169_0x12f620;if(!_0xb217ac[_0x2b1cff(0x1fa)])return{'step':0x4,'label':_0x2b1cff(0x241),'ok':!![],'detail':_0x2b1cff(0x20f)};try{const _0x39ccd6=readFileSync(_0xb217ac[_0x2b1cff(0x1fa)][_0x2b1cff(0x21c)],'utf8'),_0x5da3ec=JSON[_0x2b1cff(0x236)](_0x39ccd6);if(_0x5da3ec?.[_0x2b1cff(0x270)]&&typeof _0x5da3ec['mcpServers']===_0x2b1cff(0x224)){const _0x39ae4f=[];for(const [_0x198711,_0x472764]of Object[_0x2b1cff(0x200)](_0x5da3ec[_0x2b1cff(0x270)])){_0x472764?.['args']&&Array['isArray'](_0x472764[_0x2b1cff(0x21a)])&&_0x472764[_0x2b1cff(0x21a)][_0x2b1cff(0x245)](_0x5a4037=>typeof _0x5a4037===_0x2b1cff(0x1fd)&&_0x5a4037[_0x2b1cff(0x24c)](_0x2b1cff(0x214)))&&_0x39ae4f['push'](_0x198711);}for(const _0x263d08 of _0x39ae4f){delete _0x5da3ec['mcpServers'][_0x263d08];}return _0x39ae4f[_0x2b1cff(0x1f7)]>0x0&&writeFileSync(_0xb217ac['oldMcpConfig'][_0x2b1cff(0x21c)],JSON[_0x2b1cff(0x22d)](_0x5da3ec,null,0x2)+'\x0a',_0x2b1cff(0x21d)),{'step':0x4,'label':_0x2b1cff(0x241),'ok':!![],'detail':_0x2b1cff(0x22f)+_0x39ae4f[_0x2b1cff(0x1fb)](',\x20')+'\x20from\x20'+_0xb217ac[_0x2b1cff(0x1fa)][_0x2b1cff(0x21c)]};}return{'step':0x4,'label':_0x2b1cff(0x241),'ok':!![],'detail':_0x2b1cff(0x233)};}catch(_0xb271a9){return{'step':0x4,'label':_0x2b1cff(0x241),'ok':![],'detail':_0xb271a9[_0x2b1cff(0x23f)]};}}function execSkillsRemove(_0x56cdbd,_0x257d7e){const _0x451aff=a169_0x12f620,_0x253ef4=runNpxSkillsRemove(_0x56cdbd,{'stdio':_0x451aff(0x20d),'yes':_0x257d7e});return{'step':0x5,'label':'Remove\x20old\x20skill','ok':_0x253ef4['ok'],'detail':_0x253ef4['ok']?_0x451aff(0x234):_0x253ef4[_0x451aff(0x263)]??'exit\x20'+_0x253ef4[_0x451aff(0x203)]};}function execSkillsAdd(_0x11f331,_0x274cb4){const _0xcdd998=a169_0x12f620,_0x4c6d3d=runNpxSkillsAddGlobal(_0x11f331,_0xcdd998(0x24a),{'stdio':_0xcdd998(0x20d),'yes':_0x274cb4});return{'step':0x6,'label':_0xcdd998(0x216),'ok':_0x4c6d3d['ok'],'detail':_0x4c6d3d['ok']?_0xcdd998(0x207):_0x4c6d3d['error']??_0xcdd998(0x26f)+_0x4c6d3d[_0xcdd998(0x203)]};}function execUpgradeSdk(_0x4a1668){const _0x363345=a169_0x12f620;if(!_0x4a1668[_0x363345(0x242)])return{'step':0x7,'label':_0x363345(0x219),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x5e5fe8,currentVersion:_0x28b1e3,field:_0x3ee405}=_0x4a1668[_0x363345(0x242)];try{const _0x125fa2=readFileSync(_0x5e5fe8,_0x363345(0x21d)),_0x115a13=JSON['parse'](_0x125fa2);return _0x115a13[_0x3ee405][_0x363345(0x20c)]='latest',writeFileSync(_0x5e5fe8,JSON[_0x363345(0x22d)](_0x115a13,null,0x2)+'\x0a','utf8'),{'step':0x7,'label':_0x363345(0x219),'ok':!![],'detail':_0x3ee405+_0x363345(0x21e)+_0x28b1e3+_0x363345(0x206)};}catch(_0x559078){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x559078[_0x363345(0x23f)]};}}function tryStat(_0x571119){try{return statSync(_0x571119);}catch{return undefined;}}function printSummary(_0x541d67){const _0x5854ad=a169_0x12f620;console[_0x5854ad(0x1f8)](''),console['log'](a169_0x1e0e4f[_0x5854ad(0x24b)](_0x5854ad(0x21f))),console['log']('');for(const _0xe25cb4 of _0x541d67){const _0x3ebb79=_0xe25cb4['ok']?a169_0x1e0e4f[_0x5854ad(0x262)]('OK'):a169_0x1e0e4f[_0x5854ad(0x211)](_0x5854ad(0x24f));console[_0x5854ad(0x1f8)]('\x20\x20'+_0x3ebb79+_0x5854ad(0x271)+_0xe25cb4[_0x5854ad(0x232)]+':\x20'+_0xe25cb4[_0x5854ad(0x226)]);if(_0xe25cb4['detail'])console[_0x5854ad(0x1f8)]('\x20\x20\x20\x20\x20\x20\x20'+a169_0x1e0e4f[_0x5854ad(0x265)](_0xe25cb4[_0x5854ad(0x1ec)]));}console[_0x5854ad(0x1f8)]('');}export async function upgradeApp(_0x1d11f3,_0x30d892){const _0x1bfe0c=a169_0x12f620,_0x3d36bb=process[_0x1bfe0c(0x227)](),_0x511f91=analyse(_0x3d36bb),_0x489bfc=!_0x511f91[_0x1bfe0c(0x204)]&&_0x511f91[_0x1bfe0c(0x201)]['length']===0x0&&!_0x511f91['oldMcpConfig']&&!_0x511f91['needsSkillSwap']&&!_0x511f91[_0x1bfe0c(0x242)];if(_0x489bfc){console[_0x1bfe0c(0x1f8)](a169_0x1e0e4f[_0x1bfe0c(0x262)](_0x1bfe0c(0x243)));return;}printReport(_0x511f91);const _0x358461=!!(_0x30d892[_0x1bfe0c(0x240)]||_0x30d892['Y']||_0x1d11f3);if(!_0x358461)try{const _0x5c1d46=await askConfirm(_0x1bfe0c(0x25e));if(!_0x5c1d46){console[_0x1bfe0c(0x1f8)](a169_0x1e0e4f['gray'](_0x1bfe0c(0x20a)));return;}}catch(_0x3db419){if(_0x3db419?.[_0x1bfe0c(0x23f)]===_0x1bfe0c(0x248)){console['log'](a169_0x1e0e4f[_0x1bfe0c(0x265)]('Upgrade\x20cancelled.'));return;}throw _0x3db419;}const _0x5afcb2=[],_0x15dbe1=a169_0x29510e({'text':_0x1bfe0c(0x251),'color':_0x1bfe0c(0x266)})['start'](),_0x138146=execConfigMigration(_0x511f91,_0x3d36bb);_0x5afcb2[_0x1bfe0c(0x210)](_0x138146),_0x15dbe1[_0x138146['ok']?'succeed':_0x1bfe0c(0x231)](_0x1bfe0c(0x1ef)+(_0x138146['detail']??(_0x138146['ok']?_0x1bfe0c(0x1f5):_0x1bfe0c(0x23e))));const _0x41f9ba=resolve(_0x3d36bb,'.lovrabet'),_0x23c14f=a169_0x29510e({'text':_0x1bfe0c(0x223),'color':_0x1bfe0c(0x266)})['start']();if(existsSync(_0x41f9ba))try{rmSync(_0x41f9ba,{'recursive':!![],'force':!![]}),_0x23c14f[_0x1bfe0c(0x22e)](_0x1bfe0c(0x220)),_0x5afcb2[_0x1bfe0c(0x210)]({'step':0x2,'label':_0x1bfe0c(0x26a),'ok':!![]});}catch(_0x4852e4){_0x23c14f[_0x1bfe0c(0x231)](_0x1bfe0c(0x254)+_0x4852e4[_0x1bfe0c(0x23f)]),_0x5afcb2['push']({'step':0x2,'label':_0x1bfe0c(0x26a),'ok':![],'detail':_0x4852e4['message']});}else _0x23c14f[_0x1bfe0c(0x212)](_0x1bfe0c(0x246)),_0x5afcb2['push']({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0x1bfe0c(0x20f)});const _0x54aa25=a169_0x29510e({'text':_0x1bfe0c(0x1fc),'color':_0x1bfe0c(0x266)})[_0x1bfe0c(0x26c)](),_0x4ecd91=execRemoveOldArtifacts(_0x511f91[_0x1bfe0c(0x201)]);_0x5afcb2[_0x1bfe0c(0x210)](_0x4ecd91),_0x54aa25[_0x4ecd91['ok']?_0x1bfe0c(0x22e):'fail']('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x4ecd91[_0x1bfe0c(0x1ec)]??(_0x4ecd91['ok']?_0x1bfe0c(0x1f5):'failed')));const _0x11f1ad=a169_0x29510e({'text':_0x1bfe0c(0x249),'color':_0x1bfe0c(0x266)})[_0x1bfe0c(0x26c)](),_0x3d4a4c=execCleanMcp(_0x511f91);_0x5afcb2['push'](_0x3d4a4c),_0x11f1ad[_0x3d4a4c['ok']?_0x1bfe0c(0x22e):'fail'](_0x1bfe0c(0x25b)+(_0x3d4a4c['detail']??(_0x3d4a4c['ok']?'done':_0x1bfe0c(0x23e))));const _0x270fe5=a169_0x29510e({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x1bfe0c(0x266)})[_0x1bfe0c(0x26c)](),_0x377e09=execSkillsRemove(_0x3d36bb,_0x358461);_0x5afcb2['push'](_0x377e09),_0x270fe5[_0x377e09['ok']?_0x1bfe0c(0x22e):_0x1bfe0c(0x231)](_0x1bfe0c(0x22a)+(_0x377e09[_0x1bfe0c(0x1ec)]??(_0x377e09['ok']?_0x1bfe0c(0x1f5):_0x1bfe0c(0x23e))));const _0x5d8ca6=a169_0x29510e({'text':_0x1bfe0c(0x221),'color':_0x1bfe0c(0x266)})[_0x1bfe0c(0x26c)](),_0x1c1958=execSkillsAdd(_0x3d36bb,_0x358461);_0x5afcb2[_0x1bfe0c(0x210)](_0x1c1958),_0x5d8ca6[_0x1c1958['ok']?_0x1bfe0c(0x22e):'fail'](_0x1bfe0c(0x1f2)+(_0x1c1958['detail']??(_0x1c1958['ok']?_0x1bfe0c(0x1f5):_0x1bfe0c(0x23e))));const _0x58459a=a169_0x29510e({'text':'Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','color':_0x1bfe0c(0x266)})[_0x1bfe0c(0x26c)](),_0x39cc86=execUpgradeSdk(_0x511f91);_0x5afcb2['push'](_0x39cc86),_0x58459a[_0x39cc86['ok']?_0x1bfe0c(0x22e):_0x1bfe0c(0x231)](_0x1bfe0c(0x267)+(_0x39cc86[_0x1bfe0c(0x1ec)]??(_0x39cc86['ok']?'done':_0x1bfe0c(0x23e)))),printSummary(_0x5afcb2);const _0x464df7=_0x5afcb2[_0x1bfe0c(0x245)](_0x233b83=>!_0x233b83['ok']);_0x464df7?console[_0x1bfe0c(0x1f8)](a169_0x1e0e4f[_0x1bfe0c(0x1ed)](_0x1bfe0c(0x26b))):console[_0x1bfe0c(0x1f8)](a169_0x1e0e4f[_0x1bfe0c(0x262)](_0x1bfe0c(0x26e))),_0x39cc86['ok']&&_0x511f91[_0x1bfe0c(0x242)]&&(console[_0x1bfe0c(0x1f8)](''),console[_0x1bfe0c(0x1f8)](a169_0x1e0e4f[_0x1bfe0c(0x24b)][_0x1bfe0c(0x266)](_0x1bfe0c(0x222))),console[_0x1bfe0c(0x1f8)](a169_0x1e0e4f[_0x1bfe0c(0x266)](_0x1bfe0c(0x250))),console[_0x1bfe0c(0x1f8)](''),console[_0x1bfe0c(0x1f8)](a169_0x1e0e4f[_0x1bfe0c(0x24e)]('\x20\x20npm\x20install')),console[_0x1bfe0c(0x1f8)](a169_0x1e0e4f[_0x1bfe0c(0x24e)](_0x1bfe0c(0x239))),console['log'](a169_0x1e0e4f[_0x1bfe0c(0x24e)](_0x1bfe0c(0x225))),console[_0x1bfe0c(0x1f8)](''));}