@lovrabet/rabetbase-cli 2.4.1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/members-list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app-config/delete.js +1 -1
  25. package/lib/commands/app-config/get.js +1 -1
  26. package/lib/commands/app-config/index.js +1 -1
  27. package/lib/commands/app-config/list.js +1 -1
  28. package/lib/commands/app-config/set.js +1 -1
  29. package/lib/commands/app-config/shared.js +1 -1
  30. package/lib/commands/auth/index.js +1 -1
  31. package/lib/commands/bff/create.js +1 -1
  32. package/lib/commands/bff/delete.js +1 -1
  33. package/lib/commands/bff/detail.js +1 -1
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/bff/list.js +1 -1
  36. package/lib/commands/bff/pull.js +1 -1
  37. package/lib/commands/bff/push.js +1 -1
  38. package/lib/commands/bff/status.js +1 -1
  39. package/lib/commands/cli-skill/index.js +1 -1
  40. package/lib/commands/cli-update.js +1 -1
  41. package/lib/commands/codegen/index.js +1 -1
  42. package/lib/commands/codegen/sdk.js +1 -1
  43. package/lib/commands/codegen/sql.js +1 -1
  44. package/lib/commands/common/app-registry.js +1 -1
  45. package/lib/commands/common/app-selector.js +1 -1
  46. package/lib/commands/common/async-task.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -1
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/kb/create.js +1 -1
  101. package/lib/commands/kb/delete.js +1 -1
  102. package/lib/commands/kb/detail.js +1 -1
  103. package/lib/commands/kb/index.js +1 -1
  104. package/lib/commands/kb/list.js +1 -1
  105. package/lib/commands/kb/shared.js +1 -1
  106. package/lib/commands/kb/update.js +1 -1
  107. package/lib/commands/logs/index.js +1 -1
  108. package/lib/commands/menu/asset-update.js +1 -1
  109. package/lib/commands/menu/delete.js +1 -1
  110. package/lib/commands/menu/external-link-create.js +1 -1
  111. package/lib/commands/menu/external-link-update.js +1 -1
  112. package/lib/commands/menu/group-create.js +1 -1
  113. package/lib/commands/menu/group-update.js +1 -1
  114. package/lib/commands/menu/index.js +1 -1
  115. package/lib/commands/menu/list.js +1 -1
  116. package/lib/commands/menu/move.js +1 -1
  117. package/lib/commands/menu/regroup-start.js +1 -1
  118. package/lib/commands/menu/rename.js +1 -1
  119. package/lib/commands/menu/shared/compare-table.js +1 -1
  120. package/lib/commands/menu/shared/delete-plan.js +1 -1
  121. package/lib/commands/menu/shared/facts.js +1 -1
  122. package/lib/commands/menu/shared/index.js +1 -1
  123. package/lib/commands/menu/shared/inquirer.js +1 -1
  124. package/lib/commands/menu/shared/local-pages.js +1 -1
  125. package/lib/commands/menu/shared/logic.js +1 -1
  126. package/lib/commands/menu/shared/mutations.js +1 -1
  127. package/lib/commands/menu/shared/service.js +1 -1
  128. package/lib/commands/menu/shared/sync-core.js +1 -1
  129. package/lib/commands/menu/shared/update-core.js +1 -1
  130. package/lib/commands/menu/shared/valid-url.js +1 -1
  131. package/lib/commands/menu/sync.js +1 -1
  132. package/lib/commands/notification/config-list.js +1 -1
  133. package/lib/commands/notification/index.js +1 -1
  134. package/lib/commands/ocr/index.js +1 -1
  135. package/lib/commands/page/generate-start.js +1 -1
  136. package/lib/commands/page/generate-status.js +1 -1
  137. package/lib/commands/page/index.js +1 -1
  138. package/lib/commands/page/pull.js +1 -1
  139. package/lib/commands/page/push.js +1 -1
  140. package/lib/commands/page/react/create.js +1 -1
  141. package/lib/commands/page/react/detail.js +1 -1
  142. package/lib/commands/page/react/list.js +1 -1
  143. package/lib/commands/page/react/publish.js +1 -1
  144. package/lib/commands/page/react/shared.js +1 -1
  145. package/lib/commands/page/react/syntax.js +1 -1
  146. package/lib/commands/page/react/template.js +1 -1
  147. package/lib/commands/page/react/update.js +1 -1
  148. package/lib/commands/page/relation-audit.js +1 -1
  149. package/lib/commands/page/restore.js +1 -1
  150. package/lib/commands/page/shared.js +1 -1
  151. package/lib/commands/page/standard-page-status.js +1 -1
  152. package/lib/commands/page/sync.js +1 -1
  153. package/lib/commands/permit/index.js +1 -1
  154. package/lib/commands/permit/page-get.js +1 -1
  155. package/lib/commands/permit/page-set.js +1 -1
  156. package/lib/commands/permit/role-apis-set.js +1 -1
  157. package/lib/commands/permit/role-menus-set.js +1 -1
  158. package/lib/commands/permit/role-menus.js +1 -1
  159. package/lib/commands/permit/shared.js +1 -1
  160. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  161. package/lib/commands/project/create/format-elapsed.js +1 -1
  162. package/lib/commands/project/create/main.js +1 -1
  163. package/lib/commands/project/create/non-interactive.js +1 -1
  164. package/lib/commands/project/create/project-template-path.js +1 -1
  165. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  166. package/lib/commands/project/create/use-format-code.js +1 -1
  167. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  168. package/lib/commands/project/index.js +1 -1
  169. package/lib/commands/project/upgrade.js +1 -1
  170. package/lib/commands/registry.js +1 -1
  171. package/lib/commands/role/create.js +1 -1
  172. package/lib/commands/role/delete.js +1 -1
  173. package/lib/commands/role/detail.js +1 -1
  174. package/lib/commands/role/index.js +1 -1
  175. package/lib/commands/role/list.js +1 -1
  176. package/lib/commands/role/shared.js +1 -1
  177. package/lib/commands/role/update.js +1 -1
  178. package/lib/commands/role/user-add.js +1 -1
  179. package/lib/commands/role/user-remove.js +1 -1
  180. package/lib/commands/role/user-resolve.js +1 -1
  181. package/lib/commands/run/index.js +1 -1
  182. package/lib/commands/schema.js +1 -1
  183. package/lib/commands/sql/create.js +1 -1
  184. package/lib/commands/sql/delete.js +1 -1
  185. package/lib/commands/sql/detail.js +1 -1
  186. package/lib/commands/sql/exec.js +1 -1
  187. package/lib/commands/sql/index.js +1 -1
  188. package/lib/commands/sql/list.js +1 -1
  189. package/lib/commands/sql/pull.js +1 -1
  190. package/lib/commands/sql/push.js +1 -1
  191. package/lib/commands/sql/shared.js +1 -1
  192. package/lib/commands/sql/status.js +1 -1
  193. package/lib/commands/sql/validate.js +1 -1
  194. package/lib/commands/task/index.js +1 -1
  195. package/lib/commands/task/status.js +1 -1
  196. package/lib/commands/tenant/index.js +1 -1
  197. package/lib/commands/tenant/members-list.js +1 -1
  198. package/lib/commands/tenant/shared.js +1 -1
  199. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  200. package/lib/commands/user-account/index.js +1 -1
  201. package/lib/commands/workspace/add.js +1 -1
  202. package/lib/commands/workspace/index.js +1 -1
  203. package/lib/commands/workspace/remove.js +1 -1
  204. package/lib/config/schema.js +1 -1
  205. package/lib/constant/cdn.js +1 -1
  206. package/lib/constant/cli.js +1 -1
  207. package/lib/constant/defaults.js +1 -1
  208. package/lib/constant/domain.js +1 -1
  209. package/lib/constant/env.js +1 -1
  210. package/lib/constant/output.js +1 -1
  211. package/lib/constant/paths.js +1 -1
  212. package/lib/constant/risk.js +1 -1
  213. package/lib/context/app-resolver.js +1 -1
  214. package/lib/context/auth-resolver.js +1 -1
  215. package/lib/context/config-loader.js +1 -1
  216. package/lib/context.js +1 -1
  217. package/lib/core/alias-resolver.js +1 -1
  218. package/lib/core/api-client.js +1 -1
  219. package/lib/core/bff/config.js +1 -1
  220. package/lib/core/bff/file-system.js +1 -1
  221. package/lib/core/bff/hash.js +1 -1
  222. package/lib/core/bff/lock.js +1 -1
  223. package/lib/core/bff/utils.js +1 -1
  224. package/lib/core/db-resolver.js +1 -1
  225. package/lib/core/page/file-system.js +1 -1
  226. package/lib/core/page/hash.js +1 -1
  227. package/lib/core/page/lock.js +1 -1
  228. package/lib/core/sql-index-auditor.js +1 -1
  229. package/lib/core/sql-sync/config.js +1 -1
  230. package/lib/core/sql-sync/file-system.js +1 -1
  231. package/lib/core/sql-sync/hash.js +1 -1
  232. package/lib/core/sql-sync/lock.js +1 -1
  233. package/lib/core/sql-sync/utils.js +1 -1
  234. package/lib/core/sql-validator.js +1 -1
  235. package/lib/errors.js +1 -1
  236. package/lib/framework/build-all-flags.js +1 -1
  237. package/lib/framework/error-output.js +1 -1
  238. package/lib/framework/explicit-yes.js +1 -1
  239. package/lib/framework/flags.js +1 -1
  240. package/lib/framework/help.js +1 -1
  241. package/lib/framework/index.js +1 -1
  242. package/lib/framework/output.js +1 -1
  243. package/lib/framework/response.js +1 -1
  244. package/lib/framework/runner-alias.js +1 -1
  245. package/lib/framework/runner.js +1 -1
  246. package/lib/framework/schema-export.js +1 -1
  247. package/lib/framework/types.js +1 -1
  248. package/lib/generated/build-info.d.ts +4 -4
  249. package/lib/generated/build-info.js +1 -1
  250. package/lib/help.js +1 -1
  251. package/lib/postinstall.js +1 -1
  252. package/lib/runtime/confirmation.js +1 -1
  253. package/lib/runtime/event.js +1 -1
  254. package/lib/runtime/index.js +1 -1
  255. package/lib/runtime/queue.js +1 -1
  256. package/lib/runtime/resolve.js +1 -1
  257. package/lib/skills/builtin-skill.js +1 -1
  258. package/lib/skills/main.js +1 -1
  259. package/lib/skills/npx-skills-add.js +1 -1
  260. package/lib/skills/skill-presence.js +1 -1
  261. package/lib/telemetry/cli-command-trace.js +1 -1
  262. package/lib/telemetry/cli-help-trace.js +1 -1
  263. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  264. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  265. package/lib/telemetry/send-cli-trace-log.js +1 -1
  266. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  267. package/lib/utils/ai_config.js +1 -1
  268. package/lib/utils/apply-jq-filter.js +1 -1
  269. package/lib/utils/cdn-config.js +1 -1
  270. package/lib/utils/check-sdk-version.js +1 -1
  271. package/lib/utils/cli-version-check.js +1 -1
  272. package/lib/utils/cli-version-policy.js +1 -1
  273. package/lib/utils/config.js +1 -1
  274. package/lib/utils/copy-directory.js +1 -1
  275. package/lib/utils/entity-with-id.js +1 -1
  276. package/lib/utils/file-utils.js +1 -1
  277. package/lib/utils/guides-cdn.js +1 -1
  278. package/lib/utils/http-client.js +1 -1
  279. package/lib/utils/is-non-interactive.js +1 -1
  280. package/lib/utils/logger.js +1 -1
  281. package/lib/utils/params.js +1 -1
  282. package/lib/utils/platform.js +1 -1
  283. package/lib/utils/rules-cdn.js +1 -1
  284. package/lib/utils/sleep.js +1 -1
  285. package/lib/utils/template-replacer.js +1 -1
  286. package/lib/utils/update-notice.js +1 -1
  287. package/lib/utils/version.js +1 -1
  288. package/lib/utils/with-active-cookie.js +1 -1
  289. package/lib/utils/write-cli-side-channel.js +1 -1
  290. package/package.json +1 -1
  291. package/skills/rabetbase/SKILL.md +1 -1
  292. package/skills/rabetbase/references/rabetbase-page-react-detail.md +1 -1
  293. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- 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
+ const a157_0x1fb3b1=a157_0x43e1;function a157_0x43e1(_0x3b50cd,_0x2dd493){_0x3b50cd=_0x3b50cd-0x165;const _0x19e5d4=a157_0x19e5();let _0x43e124=_0x19e5d4[_0x3b50cd];return _0x43e124;}(function(_0x1e4d54,_0x2cbbfe){const _0x467521=a157_0x43e1,_0x42d3aa=_0x1e4d54();while(!![]){try{const _0x3c55d0=-parseInt(_0x467521(0x17c))/0x1+parseInt(_0x467521(0x170))/0x2+-parseInt(_0x467521(0x17a))/0x3*(-parseInt(_0x467521(0x185))/0x4)+-parseInt(_0x467521(0x175))/0x5*(-parseInt(_0x467521(0x16b))/0x6)+parseInt(_0x467521(0x173))/0x7*(parseInt(_0x467521(0x165))/0x8)+-parseInt(_0x467521(0x17e))/0x9+-parseInt(_0x467521(0x16d))/0xa;if(_0x3c55d0===_0x2cbbfe)break;else _0x42d3aa['push'](_0x42d3aa['shift']());}catch(_0x3b6d6e){_0x42d3aa['push'](_0x42d3aa['shift']());}}}(a157_0x19e5,0xd6889));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';function a157_0x19e5(){const _0x53bd2c=['join','7168vdyeqP','PAGE','5CoWtfB','appCode','POST','/smartapi/permit/role/update','Unknown\x20menu\x20resourceCode(s):\x20','10371ggxelB','roleName','529239hXtxsL','role-menus-set','8249643LDNvae','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','Pass\x20--menus\x20<resourceCode,...>.','filter','\x20menu\x20permit(s)\x20for\x20role\x20','get','str','2020DDVmxh','1280liMvhX','has','validation','access','menus','Updated\x20','7195242kXRSlA','length','11173500qXJCLp','push','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','666226mKNpxO','selector'];a157_0x19e5=function(){return _0x53bd2c;};return a157_0x19e5();}import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a157_0x1fb3b1(0x178);async function buildPlan(_0x1bc089,_0x4d0752){const _0x3e820c=a157_0x1fb3b1,_0x410c31=await resolveRoleRef(_0x1bc089['appCode'],readRoleRef(_0x1bc089));assertPermConfigurable(_0x410c31);const _0x3a29b6=readGrantRevoke(_0x1bc089),_0x8a7ea6=splitList(_0x1bc089['str'](_0x3e820c(0x169)));if(_0x8a7ea6[_0x3e820c(0x16c)]===0x0)throw CliErrors['flagMissing'](_0x3e820c(0x169),_0x3e820c(0x180));const _0x183033=await getRoleMenuResources(_0x1bc089['appCode'],_0x410c31['id']),_0x83e1e8=flattenMenuResources(_0x183033),_0x1236b7=_0x8a7ea6[_0x3e820c(0x181)](_0x26d63c=>!_0x83e1e8[_0x3e820c(0x166)](_0x26d63c));if(_0x1236b7['length']>0x0)throw CliErrors[_0x3e820c(0x167)](_0x3e820c(0x179)+_0x1236b7[_0x3e820c(0x172)](',\x20')+'.',_0x3e820c(0x16f));const _0x269fcd=new Map(),_0x5de69b=[],_0x437fed=[];for(const _0x4c0f12 of _0x8a7ea6){const _0x1486e9=_0x83e1e8[_0x3e820c(0x183)](_0x4c0f12);_0x269fcd['set'](_0x4c0f12,_0x3a29b6),_0x5de69b['push']({'resourceCode':_0x4c0f12,'action':_0x1486e9['action']}),_0x437fed[_0x3e820c(0x16e)]({'resourceCode':_0x4c0f12,'action':_0x3a29b6});}const _0x48d1d=buildPermits(_0x83e1e8,_0x269fcd),_0x46156f={'operation':_0x3a29b6===_0x3e820c(0x168)?'menu-grant':'menu-revoke','selector':{'appCode':_0x1bc089[_0x3e820c(0x176)],'roleId':_0x410c31['id'],'roleName':_0x410c31[_0x3e820c(0x17b)],'resourceCodes':_0x8a7ea6},'before':_0x5de69b,'after':_0x437fed,'dryRun':_0x4d0752,'backend':{'method':_0x3e820c(0x177),'path':UPDATE_PATH,'roleType':_0x3e820c(0x174)},'warnings':[]};return{'role':_0x410c31,'permits':_0x48d1d,'mutation':_0x46156f};}export const permitRoleMenusSet={'service':'permit','command':a157_0x1fb3b1(0x17d),'description':a157_0x1fb3b1(0x17f),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x404de9){const _0x569b15=a157_0x1fb3b1;readGrantRevoke(_0x404de9);if(splitList(_0x404de9[_0x569b15(0x184)](_0x569b15(0x169)))['length']===0x0)throw CliErrors['flagMissing']('menus',_0x569b15(0x180));},async 'dryRun'(_0x367eca){const _0x17f4da=a157_0x1fb3b1,{mutation:_0x3174a2}=await buildPlan(_0x367eca,!![]);return asDryRunResult(_0x3174a2,{'method':_0x17f4da(0x177),'url':UPDATE_PATH});},async 'execute'(_0xf97a17){const _0x32f4d3=a157_0x1fb3b1,{role:_0x2be1d8,permits:_0x13df62,mutation:_0x412fef}=await buildPlan(_0xf97a17,![]);return await updateAppRole({'id':_0x2be1d8['id'],'appCode':_0xf97a17[_0x32f4d3(0x176)],'roleType':_0x32f4d3(0x174),'permits':_0x13df62}),{'ok':!![],'data':_0x412fef,'message':_0x32f4d3(0x16a)+_0x412fef[_0x32f4d3(0x171)]['resourceCodes'][_0x32f4d3(0x16c)]+_0x32f4d3(0x182)+_0x2be1d8['roleName']};}};
@@ -1 +1 @@
1
- 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
+ function a158_0x326d(){const _0x32fada=['allowed','467264tqtEkH','read','resourceName','1037330wMwqJt','values','Role\x20','303240WbgbNR','298026yhpGKv','from','roleName','9plJzVm','45WBHzmx','appCode','role-menus','permit','access','length','1485930uZyyBN','\x20has\x20','1505571iTJpys','action','315stbDEl','map','86736WVvNtW','\x20menu(s)\x20allowed'];a158_0x326d=function(){return _0x32fada;};return a158_0x326d();}const a158_0x18aaec=a158_0x408c;(function(_0x260f68,_0x5a8026){const _0x37fca4=a158_0x408c,_0x3e9768=_0x260f68();while(!![]){try{const _0x391db3=parseInt(_0x37fca4(0xe4))/0x1+-parseInt(_0x37fca4(0xe7))/0x2+parseInt(_0x37fca4(0xdd))/0x3+-parseInt(_0x37fca4(0xd0))/0x4+-parseInt(_0x37fca4(0xd5))/0x5*(parseInt(_0x37fca4(0xd1))/0x6)+parseInt(_0x37fca4(0xdf))/0x7*(parseInt(_0x37fca4(0xe1))/0x8)+-parseInt(_0x37fca4(0xd4))/0x9*(parseInt(_0x37fca4(0xdb))/0xa);if(_0x391db3===_0x5a8026)break;else _0x3e9768['push'](_0x3e9768['shift']());}catch(_0x2d8ffd){_0x3e9768['push'](_0x3e9768['shift']());}}}(a158_0x326d,0x41298));import{getRoleMenuResources}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{flattenMenuResources,readRoleRef,ROLE_REF_FLAG}from'../../commands/permit/shared.js';import{resolveRoleRef}from'../../commands/role/shared.js';function a158_0x408c(_0x298754,_0x727b1f){_0x298754=_0x298754-0xce;const _0x326d21=a158_0x326d();let _0x408cda=_0x326d21[_0x298754];return _0x408cda;}export const permitRoleMenus={'service':a158_0x18aaec(0xd8),'command':a158_0x18aaec(0xd7),'description':'Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','risk':a158_0x18aaec(0xe5),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x3280bd){const _0x43b654=a158_0x18aaec,_0x285018=await resolveRoleRef(_0x3280bd['appCode'],readRoleRef(_0x3280bd)),_0x131c38=await getRoleMenuResources(_0x3280bd[_0x43b654(0xd6)],_0x285018['id']),_0x277ad8=flattenMenuResources(_0x131c38),_0x3b42dd=Array[_0x43b654(0xd2)](_0x277ad8[_0x43b654(0xce)]())[_0x43b654(0xe0)](_0x2e4ab6=>({'resourceCode':_0x2e4ab6['resourceCode'],'resourceName':_0x2e4ab6[_0x43b654(0xe6)],'allowed':_0x2e4ab6[_0x43b654(0xde)]===_0x43b654(0xd9),'action':_0x2e4ab6[_0x43b654(0xde)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x3280bd[_0x43b654(0xd6)],'roleId':_0x285018['id'],'roleName':_0x285018[_0x43b654(0xd3)]},'menus':_0x3b42dd},'message':_0x43b654(0xcf)+_0x285018[_0x43b654(0xd3)]+_0x43b654(0xdc)+_0x3b42dd['filter'](_0x1a480b=>_0x1a480b[_0x43b654(0xe3)])[_0x43b654(0xda)]+'/'+_0x3b42dd[_0x43b654(0xda)]+_0x43b654(0xe2)};}};
@@ -1 +1 @@
1
- const a159_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
+ const a159_0x2fac26=a159_0x3dd8;(function(_0x3e3401,_0x154897){const _0x433c2e=a159_0x3dd8,_0x50b0db=_0x3e3401();while(!![]){try{const _0x304765=parseInt(_0x433c2e(0xeb))/0x1+-parseInt(_0x433c2e(0xe5))/0x2*(-parseInt(_0x433c2e(0xd4))/0x3)+-parseInt(_0x433c2e(0xef))/0x4+parseInt(_0x433c2e(0xf5))/0x5*(parseInt(_0x433c2e(0xfc))/0x6)+-parseInt(_0x433c2e(0xc2))/0x7+-parseInt(_0x433c2e(0xfe))/0x8+parseInt(_0x433c2e(0xcf))/0x9;if(_0x304765===_0x154897)break;else _0x50b0db['push'](_0x50b0db['shift']());}catch(_0x3d36f4){_0x50b0db['push'](_0x50b0db['shift']());}}}(a159_0x334e,0x215ab));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a159_0x2fac26(0xf4),'type':a159_0x2fac26(0x103),'required':!![],'description':a159_0x2fac26(0xda)};export const ROLE_REF_FLAG={'name':'role','type':a159_0x2fac26(0xe4),'required':!![],'description':a159_0x2fac26(0xc6)};export const GRANT_FLAG={'name':'grant','type':a159_0x2fac26(0xbc),'required':![],'description':a159_0x2fac26(0xce)};export const REVOKE_FLAG={'name':a159_0x2fac26(0xd1),'type':'boolean','required':![],'description':a159_0x2fac26(0x102)};export const MENUS_FLAG={'name':a159_0x2fac26(0xdd),'type':a159_0x2fac26(0xe4),'required':!![],'description':a159_0x2fac26(0xcb)};export const DATASETS_FLAG={'name':a159_0x2fac26(0xf8),'type':a159_0x2fac26(0xe4),'required':!![],'description':a159_0x2fac26(0xb3)};export const PAGE_SLOT_SPECS=[{'flag':a159_0x2fac26(0xb5),'key':a159_0x2fac26(0xe8),'allowSelf':![],'label':a159_0x2fac26(0xd0)},{'flag':a159_0x2fac26(0xf2),'key':'dataCreate','allowSelf':![],'label':'data\x20create'},{'flag':a159_0x2fac26(0xba),'key':a159_0x2fac26(0xe2),'allowSelf':![],'label':'data\x20update'},{'flag':a159_0x2fac26(0xd5),'key':a159_0x2fac26(0xf1),'allowSelf':![],'label':a159_0x2fac26(0xca)},{'flag':a159_0x2fac26(0xf7),'key':a159_0x2fac26(0xd9),'allowSelf':![],'label':a159_0x2fac26(0xb4)},{'flag':a159_0x2fac26(0xe7),'key':a159_0x2fac26(0xed),'allowSelf':![],'label':'data\x20export'},{'flag':a159_0x2fac26(0xbe),'key':a159_0x2fac26(0xb0),'allowSelf':!![],'label':a159_0x2fac26(0xb8)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS['map'](_0x4e86b0=>({'name':_0x4e86b0[a159_0x2fac26(0xff)],'type':a159_0x2fac26(0xe4),'required':![],'description':a159_0x2fac26(0xbd)+_0x4e86b0[a159_0x2fac26(0xf6)]+a159_0x2fac26(0xb1)+(_0x4e86b0[a159_0x2fac26(0xf0)]?a159_0x2fac26(0xe1):'')}));export function splitList(_0x3c9da9){const _0x315aed=a159_0x2fac26;return _0x3c9da9[_0x315aed(0xac)](',')['map'](_0x55df85=>_0x55df85[_0x315aed(0xd8)]())[_0x315aed(0xc1)](Boolean);}export function projectRoleRef(_0x22a2c6){const _0x61bf9b=a159_0x2fac26;return{'id':_0x22a2c6['id'],'roleName':_0x22a2c6[_0x61bf9b(0xf9)],'roleType':_0x22a2c6[_0x61bf9b(0xb6)]};}export async function resolvePermitRoles(_0x323600,_0x4ad504,_0x45198d){const _0x2b1691=a159_0x2fac26,_0x584a74=await listPermitRoles(_0x323600,{'needSelf':!![],'needPublic':!![]}),_0x41e8ea=[];for(const _0xf642ed of _0x4ad504){const _0x45e73b=resolveOnePermitRole(_0x584a74,_0xf642ed);if(!_0x45198d[_0x2b1691(0xf0)]&&_0x45e73b[_0x2b1691(0xb6)]==='SELF')throw CliErrors['validation']('SELF\x20is\x20not\x20allowed\x20for\x20'+_0x45198d[_0x2b1691(0xf6)]+'.',_0x2b1691(0xb2));if(!_0x41e8ea[_0x2b1691(0xe9)](_0x58ceb7=>_0x58ceb7['id']===_0x45e73b['id']))_0x41e8ea['push'](_0x45e73b);}return _0x41e8ea;}function resolveOnePermitRole(_0x57879f,_0x3e4da3){const _0x7664c=a159_0x2fac26,_0x19db73=_0x3e4da3['trim'](),_0x39b943=_0x19db73[_0x7664c(0xae)]();if(_0x39b943===_0x7664c(0xbf)||_0x39b943===_0x7664c(0xc7)){const _0x26332c=_0x57879f['find'](_0xa45114=>_0xa45114['roleType']===_0x39b943);if(!_0x26332c)throw CliErrors[_0x7664c(0xcd)](_0x7664c(0xee)+_0x39b943+_0x7664c(0xfd));return _0x26332c;}if(/^-?\d+$/[_0x7664c(0xcc)](_0x19db73)){const _0x4159ea=Number(_0x19db73),_0x27838b=_0x57879f[_0x7664c(0xf3)](_0x12819d=>_0x12819d['id']===_0x4159ea);if(!_0x27838b)throw CliErrors[_0x7664c(0xcd)](_0x7664c(0xdc)+_0x4159ea+_0x7664c(0xfa),_0x7664c(0xc9));return _0x27838b;}const _0x169008=_0x57879f[_0x7664c(0xc1)](_0x2bb34f=>_0x2bb34f['roleName']===_0x19db73);if(_0x169008[_0x7664c(0xde)]===0x0)throw CliErrors['validation'](_0x7664c(0xc8)+_0x19db73+_0x7664c(0xd3),'Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.');if(_0x169008[_0x7664c(0xde)]>0x1)throw CliErrors['validation'](_0x7664c(0xc8)+_0x19db73+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x169008[_0x7664c(0xc0)](_0x3d4705=>_0x3d4705['id'])[_0x7664c(0xd7)](',\x20')+').',_0x7664c(0xfb));return _0x169008[0x0];}export function projectPageSlot(_0xcaac9c){const _0x309d83=a159_0x2fac26;if(!_0xcaac9c)return null;return{'resourceCode':_0xcaac9c['resourceCode'],'roles':(_0xcaac9c[_0x309d83(0xd6)]??[])[_0x309d83(0xc0)](projectRoleRef)};}function a159_0x334e(){const _0x10cb58=['dataPermit','\x20(comma-separated\x20SELF/ALL/id/name)','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','data\x20detail','menu-roles','roleType','key','row\x20visibility','str','update-roles','resourceCode','boolean','Roles\x20for\x20','row-roles','SELF','map','filter','868567mwCxjT','appCode','set','bool','Role\x20id\x20or\x20role\x20name','ALL','Role\x20\x22','Run\x20`role\x20list`.','data\x20delete','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','test','validation','Grant\x20access\x20to\x20the\x20listed\x20resources','1136538rttbDT','menu\x20visibility','revoke','allowedActions','\x22\x20not\x20found.','272004yAOJlj','delete-roles','rolePermit','join','trim','dataDetail','Menu\x20id\x20(from\x20`menu\x20list`)','access','Role\x20id\x20','menus','length','datasetCode','resourceName',';\x20SELF\x20=\x20only\x20own\x20rows','dataUpdate','Missing\x20action.','string','6nedZmo','flagMissing','export-roles','menuPermit','some','Pass\x20--role\x20<id|name>.','244266wOFeLk','apiList','dataExport','Special\x20role\x20','691996nRoRBl','allowSelf','dataDelete','create-roles','find','menu-id','10GIUKSy','label','detail-roles','datasets','roleName','\x20not\x20found.','Disambiguate\x20with\x20an\x20id.','120072NGLtdZ','\x20is\x20not\x20available\x20for\x20this\x20app.','1991016iJEgJb','flag','role','pageNodeList','Revoke\x20access\x20to\x20the\x20listed\x20resources','number','split','entries','toUpperCase','push'];a159_0x334e=function(){return _0x10cb58;};return a159_0x334e();}export function projectPagePermit(_0x2c6485){const _0x54f6ad=a159_0x2fac26,_0x409158={'menuId':_0x2c6485['menuId'],'appCode':_0x2c6485[_0x54f6ad(0xc3)],'menuPermit':projectPageSlot(_0x2c6485[_0x54f6ad(0xe8)])};for(const _0x6fdfd0 of PAGE_SLOT_SPECS){if(_0x6fdfd0[_0x54f6ad(0xb7)]==='menuPermit')continue;_0x409158[_0x6fdfd0['key']]=projectPageSlot(_0x2c6485[_0x6fdfd0[_0x54f6ad(0xb7)]]);}return _0x409158;}export function flattenMenuResources(_0x5329fd){const _0xe24a5d=new Map(),_0x4250b9=_0x56b277=>{const _0x2834ab=a159_0x3dd8;for(const _0x23bebb of _0x56b277??[]){_0xe24a5d['set'](_0x23bebb[_0x2834ab(0xbb)],{'resourceCode':_0x23bebb[_0x2834ab(0xbb)],'resourceName':_0x23bebb['resourceName'],'action':_0x23bebb[_0x2834ab(0xd2)]?.[0x0]??'0'});if(_0x23bebb[_0x2834ab(0x101)])_0x4250b9(_0x23bebb[_0x2834ab(0x101)]);}};return _0x4250b9(_0x5329fd),_0xe24a5d;}export function flattenApiResources(_0x2ee9c6){const _0x3728a5=a159_0x2fac26,_0x359f5a=new Map(),_0x7f46de=new Map();for(const _0x398ef2 of _0x2ee9c6){const _0x348be9=_0x398ef2[_0x3728a5(0xec)]??{};for(const [_0x43092a,_0x275e74]of Object[_0x3728a5(0xad)](_0x348be9)){_0x359f5a[_0x3728a5(0xc4)](_0x43092a,{'resourceCode':_0x43092a,'resourceName':_0x398ef2[_0x3728a5(0xe0)],'datasetCode':_0x398ef2['datasetCode'],'action':_0x275e74?.[0x0]??'0'});const _0xb797b8=_0x7f46de['get'](_0x398ef2[_0x3728a5(0xdf)])??[];_0xb797b8[_0x3728a5(0xaf)](_0x43092a),_0x7f46de[_0x3728a5(0xc4)](_0x398ef2[_0x3728a5(0xdf)],_0xb797b8);}}return{'byCode':_0x359f5a,'byDataset':_0x7f46de};}export function buildPermits(_0x490881,_0x47b907){const _0x682f2e={};for(const [_0x599b83,_0x3086b4]of _0x490881){const _0x68ab87=_0x47b907['get'](_0x599b83)??_0x3086b4['action'];_0x682f2e[_0x599b83]=[_0x68ab87];}return _0x682f2e;}export function readRoleRef(_0x4a3dc6){const _0x59ab0d=a159_0x2fac26,_0x22b26c=_0x4a3dc6[_0x59ab0d(0xb9)](_0x59ab0d(0x100))['trim']();if(!_0x22b26c)throw CliErrors[_0x59ab0d(0xe6)](_0x59ab0d(0x100),_0x59ab0d(0xea));return _0x22b26c;}function a159_0x3dd8(_0x54dbdb,_0x338996){_0x54dbdb=_0x54dbdb-0xac;const _0x334e4d=a159_0x334e();let _0x3dd8cf=_0x334e4d[_0x54dbdb];return _0x3dd8cf;}export function readGrantRevoke(_0x10101c){const _0x4f0a74=a159_0x2fac26,_0x3824e0=_0x10101c[_0x4f0a74(0xc5)]('grant'),_0x2b2d79=_0x10101c[_0x4f0a74(0xc5)](_0x4f0a74(0xd1));if(_0x3824e0&&_0x2b2d79)throw CliErrors[_0x4f0a74(0xcd)]('--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.');if(!_0x3824e0&&!_0x2b2d79)throw CliErrors[_0x4f0a74(0xcd)](_0x4f0a74(0xe3),'Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.');return _0x3824e0?_0x4f0a74(0xdb):'0';}
@@ -1 +1 @@
1
- (function(_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
+ function a160_0x1915(){const _0x1e209a=['6820OvWJuW','test','env','cwd','production','length','green','2PzMceX','Skipped','log','cyan','817679OcDARg','Project\x20name:','√\x20App\x20Code:\x20','108708kUWGZr','my-app','267819hIzEpa','Not\x20set','494847PSGHDC','1919113ijBTmd','√\x20Login\x20status:\x20','\x22\x20already\x20exists','52PnFEOp','trim','√\x20Project\x20Name:\x20','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','20lecAVe','10361528dBYfxk','248065KOgQLv','150SQdgHM'];a160_0x1915=function(){return _0x1e209a;};return a160_0x1915();}(function(_0x24a6fa,_0x2b138f){const _0x1c5664=a160_0x53e5,_0x5c1889=_0x24a6fa();while(!![]){try{const _0x599d1c=parseInt(_0x1c5664(0x15c))/0x1*(-parseInt(_0x1c5664(0x158))/0x2)+parseInt(_0x1c5664(0x161))/0x3*(-parseInt(_0x1c5664(0x167))/0x4)+-parseInt(_0x1c5664(0x16d))/0x5*(parseInt(_0x1c5664(0x16e))/0x6)+-parseInt(_0x1c5664(0x164))/0x7+-parseInt(_0x1c5664(0x16c))/0x8+parseInt(_0x1c5664(0x163))/0x9*(-parseInt(_0x1c5664(0x16b))/0xa)+-parseInt(_0x1c5664(0x16f))/0xb*(-parseInt(_0x1c5664(0x15f))/0xc);if(_0x599d1c===_0x2b138f)break;else _0x5c1889['push'](_0x5c1889['shift']());}catch(_0x47be5b){_0x5c1889['push'](_0x5c1889['shift']());}}}(a160_0x1915,0xaf777));import{existsSync}from'node:fs';function a160_0x53e5(_0x57ba62,_0x183a3f){_0x57ba62=_0x57ba62-0x154;const _0x191537=a160_0x1915();let _0x53e546=_0x191537[_0x57ba62];return _0x53e546;}import a160_0x24685b from'node:path';import a160_0x742083 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x202633,_0x58093e,_0x48b37b){const _0x3d7da7=a160_0x53e5,_0x1aa9e2=_0x3d7da7(0x160),_0x19288c=readConfig(),_0x38fa11=typeof _0x19288c['env']==='string'?_0x19288c[_0x3d7da7(0x171)]:undefined,_0x508a05=await input({'message':_0x3d7da7(0x15d),'default':_0x1aa9e2,'validate':_0x288bb8=>{const _0x48b2ac=_0x3d7da7,_0x36717e=_0x288bb8[_0x48b2ac(0x168)]()||_0x1aa9e2;if(_0x36717e[_0x48b2ac(0x156)]>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x598398=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x36717e&&!_0x598398[_0x48b2ac(0x170)](_0x36717e))return _0x48b2ac(0x16a);const _0x2e8e64=a160_0x24685b['resolve'](process[_0x48b2ac(0x154)](),_0x36717e);if(existsSync(_0x2e8e64))return'Directory\x20\x22'+_0x36717e+_0x48b2ac(0x166);return!![];}});console['log'](a160_0x742083[_0x3d7da7(0x157)](_0x3d7da7(0x169)+a160_0x742083[_0x3d7da7(0x15b)](_0x508a05)));const _0x2f5791=await selectSingleAppcode(_0x48b37b);console[_0x3d7da7(0x15a)](a160_0x742083['green'](_0x3d7da7(0x15e)+a160_0x742083['cyan'](_0x2f5791||_0x3d7da7(0x162))));if(_0x2f5791){const _0x158634=await getIsSessionValid();if(!_0x158634){const _0x341c61=await confirm({'message':'No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','default':!![]});if(_0x341c61){const _0x5ec79d=await authServer({'silent':!![]});console[_0x3d7da7(0x15a)](a160_0x742083[_0x3d7da7(0x157)](_0x3d7da7(0x165)+a160_0x742083[_0x3d7da7(0x15b)](_0x5ec79d?'Logged\x20in':'Login\x20failed')));}else console[_0x3d7da7(0x15a)](a160_0x742083[_0x3d7da7(0x157)](_0x3d7da7(0x165)+a160_0x742083[_0x3d7da7(0x15b)](_0x3d7da7(0x159))));}await _0x202633({'projectName':_0x508a05,'appCode':_0x2f5791,'env':_0x58093e||_0x38fa11||_0x3d7da7(0x155)});}else await _0x202633({'projectName':_0x508a05,'env':_0x58093e||_0x38fa11||_0x3d7da7(0x155)});}
@@ -1 +1 @@
1
- function a161_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
+ (function(_0x16b55a,_0x413631){const _0x20ce77=a161_0x2415,_0x4d3887=_0x16b55a();while(!![]){try{const _0xad953e=parseInt(_0x20ce77(0x175))/0x1+parseInt(_0x20ce77(0x173))/0x2*(-parseInt(_0x20ce77(0x174))/0x3)+-parseInt(_0x20ce77(0x172))/0x4*(parseInt(_0x20ce77(0x177))/0x5)+-parseInt(_0x20ce77(0x16f))/0x6+-parseInt(_0x20ce77(0x16e))/0x7*(-parseInt(_0x20ce77(0x171))/0x8)+-parseInt(_0x20ce77(0x178))/0x9+parseInt(_0x20ce77(0x176))/0xa;if(_0xad953e===_0x413631)break;else _0x4d3887['push'](_0x4d3887['shift']());}catch(_0x858d1c){_0x4d3887['push'](_0x4d3887['shift']());}}}(a161_0x2271,0x673ab));function a161_0x2415(_0x28156f,_0x49a79b){_0x28156f=_0x28156f-0x16e;const _0x2271ce=a161_0x2271();let _0x241553=_0x2271ce[_0x28156f];return _0x241553;}function a161_0x2271(){const _0x44d04a=['replace','93000ATlTeF','258708bvmmFn','2458eYzTNZ','1983vXWaGN','269826DEemaA','28461430UTSeZb','55CLjHfl','6471873ZNDajt','toFixed','now','63CYURak','3329124SGwfHR'];a161_0x2271=function(){return _0x44d04a;};return a161_0x2271();}export function formatElapsed(_0x41dda2){const _0x1b132d=a161_0x2415,_0x75379f=Date[_0x1b132d(0x17a)]()-_0x41dda2;if(_0x75379f<0x3e8)return _0x75379f+'ms';const _0x2dc89f=(_0x75379f/0x3e8)[_0x1b132d(0x179)](0x2),_0x30a30b=_0x2dc89f[_0x1b132d(0x170)](/\.?0+$/u,'');return _0x30a30b+'s';}
@@ -1 +1 @@
1
- (function(_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
+ (function(_0x816696,_0x1a31f6){const _0x480b93=a162_0x171d,_0x567cf6=_0x816696();while(!![]){try{const _0xb21099=parseInt(_0x480b93(0xf3))/0x1*(-parseInt(_0x480b93(0xaa))/0x2)+-parseInt(_0x480b93(0xbf))/0x3+-parseInt(_0x480b93(0xf7))/0x4*(-parseInt(_0x480b93(0xcd))/0x5)+-parseInt(_0x480b93(0xad))/0x6+parseInt(_0x480b93(0xa4))/0x7+-parseInt(_0x480b93(0xd8))/0x8+-parseInt(_0x480b93(0xb9))/0x9*(-parseInt(_0x480b93(0xf6))/0xa);if(_0xb21099===_0x1a31f6)break;else _0x567cf6['push'](_0x567cf6['shift']());}catch(_0x387379){_0x567cf6['push'](_0x567cf6['shift']());}}}(a162_0x1f18,0xebff0));import a162_0x49dfcf from'path';import a162_0x353dac from'fs';import a162_0x13770a from'chalk';import a162_0x23c772 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';function a162_0x171d(_0x55b119,_0xa3483a){_0x55b119=_0x55b119-0xa3;const _0x1f18a5=a162_0x1f18();let _0x171db7=_0x1f18a5[_0x55b119];return _0x171db7;}import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';function a162_0x1f18(){const _0x497c58=['setLogPath','\x20model(s)','resolve','cyan','projectCode','projectName','cwd','cookie','message','W_OK','log','toLocaleString','API\x20configuration\x20pulled:\x20','Format\x20code','parse','Project\x20directory\x20','chdir','项目创建失败:\x20','清理项目目录失败:\x20','package.json','\x20Generated\x20by\x20rabetbase\x20cli\x20','428UhnBIi','apps','warn','1734680VMbAwd','5120156HdfEhP','create','*\x20Configuring\x20AppCode\x20for\x20project\x20','🚀\x20Next\x20Steps:','writeFileSync','belowMinimum','repeat','info','7664685CPoupy','accessSync','bold','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','配置应用AppCode:\x20','name','8370VBesIc','start','existsSync','7850730vXVlvD','test','length','join','env','Project\x20name:\x20','\x20already\x20exists','green','constants','\x20|\x20AppCode:\x20','更新\x20package.json\x20name','stableVersion','216QcrQdq','Project\x20name\x20cannot\x20be\x20empty','1.0.0','defaultApp','Install\x20dependencies','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','2321226vYKDnp','readFileSync','开始创建项目:\x20','string','\x20√\x20','\x20api\x20pull','dirname','\x20|\x20Default:\x20','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','utf8','项目创建完成:\x20','description','stringify','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','5WRFVCH','keys','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','error','√\x20Configuration\x20file\x20created,\x20Apps:\x20','配置应用AppCode失败','√\x20Pulled\x20','needsUpgrade','trim','version','13585672qcubTs','gray','更新\x20package.json\x20失败','appCode','stop','\x20\x201.\x20Start\x20project:\x20'];a162_0x1f18=function(){return _0x497c58;};return a162_0x1f18();}import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x5f30b2){const _0xeb504=a162_0x171d,_0x56a2e8=await checkCliVersion();(_0x56a2e8[_0xeb504(0xd5)]||_0x56a2e8[_0xeb504(0xfc)])&&(printCliUpgradeWarning(_0x56a2e8),assertCliVersionSupported(_0x56a2e8),logger[_0xeb504(0xa3)]('create','CLI\x20版本检查',{'currentVersion':_0x56a2e8['currentVersion'],'stableVersion':_0x56a2e8[_0xeb504(0xb8)],'minimumVersion':_0x56a2e8['minimumVersion'],'needsUpgrade':_0x56a2e8[_0xeb504(0xd5)],'belowMinimum':_0x56a2e8[_0xeb504(0xfc)]}));if(_0x5f30b2[_0xeb504(0xe2)]&&_0x5f30b2['appCode'])await runCreate({'projectName':_0x5f30b2[_0xeb504(0xe2)],'appCode':_0x5f30b2[_0xeb504(0xdb)],'env':_0x5f30b2[_0xeb504(0xb1)]},_0x5f30b2);else{if(_0x5f30b2['projectCode']){const _0x245267=await selectSingleAppcode(_0x5f30b2[_0xeb504(0xe5)]);await runCreate({'projectName':_0x5f30b2[_0xeb504(0xe2)],'appCode':_0x245267||undefined,'env':_0x5f30b2[_0xeb504(0xb1)]},_0x5f30b2);}else await guidedCreateProject(_0xc83989=>runCreate(_0xc83989,_0x5f30b2),_0x5f30b2[_0xeb504(0xb1)],_0x5f30b2['cookie']);}}async function runCreate(_0x1dacb5,_0x528ae9){const _0x33d630=a162_0x171d;if(!_0x1dacb5['projectName']||_0x1dacb5['projectName'][_0x33d630(0xd6)]()==='')throw new Error(_0x33d630(0xba));const _0x3fcb63=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x3fcb63[_0x33d630(0xae)](_0x1dacb5['projectName']))throw new Error(_0x33d630(0xd0));if(_0x1dacb5[_0x33d630(0xe3)][_0x33d630(0xaf)]>0x64)throw new Error(_0x33d630(0xc7));const _0x2b8e4d=a162_0x49dfcf[_0x33d630(0xe0)](process['cwd'](),_0x1dacb5['projectName']);if(a162_0x353dac[_0x33d630(0xac)](_0x2b8e4d))throw new Error(_0x33d630(0xed)+_0x1dacb5['projectName']+_0x33d630(0xb3));try{a162_0x353dac[_0x33d630(0xa5)](a162_0x49dfcf[_0x33d630(0xc5)](_0x2b8e4d),a162_0x353dac[_0x33d630(0xb5)][_0x33d630(0xe7)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x33d630(0xde)](_0x2b8e4d),logger['info'](_0x33d630(0xf8),_0x33d630(0xc1)+_0x1dacb5[_0x33d630(0xe3)],{'projectDir':_0x2b8e4d,'appCode':_0x1dacb5[_0x33d630(0xdb)]}),console[_0x33d630(0xe8)](),console[_0x33d630(0xe8)](a162_0x13770a[_0x33d630(0xb4)](_0x33d630(0xc3))+_0x33d630(0xb2)+a162_0x13770a[_0x33d630(0xb4)](_0x1dacb5['projectName'])+(_0x1dacb5[_0x33d630(0xdb)]?_0x33d630(0xb6)+a162_0x13770a['cyan'](_0x1dacb5[_0x33d630(0xdb)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x1dacb5[_0x33d630(0xe3)])),await updatePackageJsonName(_0x1dacb5[_0x33d630(0xe3)]),await runTask(_0x33d630(0xbd),()=>installDependencies(_0x1dacb5[_0x33d630(0xe3)])),await runTask(_0x33d630(0xeb),()=>formatProjectCode(_0x1dacb5[_0x33d630(0xe3)])),await configureAppCode(_0x1dacb5[_0x33d630(0xe3)],_0x1dacb5[_0x33d630(0xdb)]||'',_0x1dacb5[_0x33d630(0xb1)]);let _0x54b3ac=![];if(_0x1dacb5[_0x33d630(0xdb)]){console[_0x33d630(0xe8)]('*\x20Pulling\x20API\x20configuration...');const _0x3acc63=process[_0x33d630(0xe4)]();try{process[_0x33d630(0xee)](_0x2b8e4d);const _0x544872=_0x1dacb5['env']||'production';initEnv(_0x544872);const {configArray:_0x265e67}=await fetchModelList(_0x1dacb5[_0x33d630(0xdb)],_0x528ae9[_0x33d630(0xe5)]||''),_0x4035f8=DEFAULT_API_DIR,_0x3ee977=await generateApiFile(_0x265e67,'',_0x1dacb5[_0x33d630(0xdb)],!![],_0x544872,_0x4035f8);console['log'](_0x33d630(0xd4)+_0x265e67['length']+'\x20dataset(s),\x20generated\x20'+_0x3ee977['modelCount']+_0x33d630(0xdf)),logger['info'](_0x33d630(0xf8),_0x33d630(0xea)+_0x1dacb5['appCode']);}catch(_0x58f098){_0x54b3ac=!![],console[_0x33d630(0xe8)](_0x33d630(0xa7)),logger[_0x33d630(0xf5)]('create','API\x20配置拉取异常',{'error':_0x58f098 instanceof Error?_0x58f098[_0x33d630(0xe6)]:String(_0x58f098)});}finally{process[_0x33d630(0xee)](_0x3acc63);}}logger['success'](_0x33d630(0xf8),_0x33d630(0xc9)+_0x1dacb5[_0x33d630(0xe3)]),console[_0x33d630(0xe8)](),console[_0x33d630(0xe8)](a162_0x13770a[_0x33d630(0xb4)]('─'[_0x33d630(0xfd)](0x3c))),console[_0x33d630(0xe8)](a162_0x13770a[_0x33d630(0xe1)][_0x33d630(0xa6)](_0x33d630(0xfa))),console[_0x33d630(0xe8)](),console[_0x33d630(0xe8)](_0x33d630(0xdd)+a162_0x13770a['cyan'][_0x33d630(0xa6)]('cd\x20'+_0x1dacb5[_0x33d630(0xe3)]+'\x20&&\x20'+CLI_BIN_NAME+'\x20run\x20start')),_0x54b3ac&&console['log']('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a162_0x13770a[_0x33d630(0xe1)][_0x33d630(0xa6)](CLI_BIN_NAME+_0x33d630(0xc4))),console[_0x33d630(0xe8)](a162_0x13770a[_0x33d630(0xb4)]('─'[_0x33d630(0xfd)](0x3c)));}catch(_0x114c6e){logger[_0x33d630(0xd1)](_0x33d630(0xf8),_0x33d630(0xef)+_0x1dacb5['projectName'],{'error':_0x114c6e instanceof Error?_0x114c6e[_0x33d630(0xe6)]:String(_0x114c6e)});try{a162_0x353dac[_0x33d630(0xac)](_0x2b8e4d)&&(console[_0x33d630(0xe8)](_0x33d630(0xcf)+_0x2b8e4d),a162_0x353dac['rmSync'](_0x2b8e4d,{'recursive':!![],'force':!![]}));}catch{logger[_0x33d630(0xf5)](_0x33d630(0xf8),_0x33d630(0xf0)+_0x2b8e4d);}throw _0x114c6e;}}async function runTask(_0x27e955,_0x322a03){const _0x49b1a7=a162_0x171d,_0x5bab8d=a162_0x23c772(_0x27e955+'...')[_0x49b1a7(0xab)]();try{const _0xac0dca=await _0x322a03();_0x5bab8d[_0x49b1a7(0xdc)](),console[_0x49b1a7(0xe8)](''+a162_0x13770a[_0x49b1a7(0xb4)]('\x20√\x20')+_0x27e955+'\x20'+a162_0x13770a[_0x49b1a7(0xd9)]('['+_0xac0dca+']'));}catch(_0x245e9e){_0x5bab8d['fail'](_0x27e955);throw _0x245e9e;}}async function updatePackageJsonName(_0x2cc262){const _0x4d033a=a162_0x171d,_0xc91c23=a162_0x49dfcf[_0x4d033a(0xe0)](process[_0x4d033a(0xe4)](),_0x2cc262),_0x1d3ae7=a162_0x49dfcf[_0x4d033a(0xb0)](_0xc91c23,_0x4d033a(0xf1));try{console[_0x4d033a(0xe8)](_0x4d033a(0xcc));const _0x326868=getRabetbaseCliPackageRoot(),_0x697db3=a162_0x49dfcf['join'](_0x326868,_0x4d033a(0xf1));let _0x7a5053=_0x4d033a(0xbb);try{const _0xa23fb3=JSON['parse'](a162_0x353dac[_0x4d033a(0xc0)](_0x697db3,_0x4d033a(0xc8)));_0x7a5053=_0xa23fb3['version']||_0x4d033a(0xbb);}catch{}const _0xb78976=a162_0x353dac[_0x4d033a(0xc0)](_0x1d3ae7,'utf8'),_0x554eeb=JSON[_0x4d033a(0xec)](_0xb78976);_0x554eeb[_0x4d033a(0xa9)]=_0x2cc262,_0x554eeb[_0x4d033a(0xca)]=_0x2cc262+_0x4d033a(0xf2)+_0x7a5053,a162_0x353dac[_0x4d033a(0xfb)](_0x1d3ae7,JSON[_0x4d033a(0xcb)](_0x554eeb,null,0x2)+'\x0a','utf8'),console[_0x4d033a(0xe8)]('√\x20package.json\x20updated:\x20name='+_0x2cc262),logger[_0x4d033a(0xa3)](_0x4d033a(0xf8),_0x4d033a(0xb7));}catch(_0x1d715f){logger['error']('create',_0x4d033a(0xda));throw _0x1d715f;}}async function configureAppCode(_0x5cf76d,_0x1bde6,_0x25e71a){const _0x1ad105=a162_0x171d,_0x445461=a162_0x49dfcf[_0x1ad105(0xe0)](process[_0x1ad105(0xe4)](),_0x5cf76d),_0x3e82cf=a162_0x49dfcf[_0x1ad105(0xb0)](_0x445461,NEW_CONFIG_NAME);try{_0x1bde6?console[_0x1ad105(0xe8)](_0x1ad105(0xf9)+_0x5cf76d+':\x20'+_0x1bde6):console['log']('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x5cf76d);const _0xaa8069=getRabetbaseCliPackageRoot(),_0x763eee=a162_0x49dfcf[_0x1ad105(0xb0)](_0xaa8069,_0x1ad105(0xf1));let _0x605b8f=_0x1ad105(0xbb);try{const _0x212bcd=JSON['parse'](a162_0x353dac['readFileSync'](_0x763eee,_0x1ad105(0xc8)));_0x605b8f=_0x212bcd[_0x1ad105(0xd7)]||_0x1ad105(0xbb);}catch{}const _0x2b37a9=readConfig(),_0x424adf=typeof _0x2b37a9['env']===_0x1ad105(0xc2)?_0x2b37a9[_0x1ad105(0xb1)]:undefined,_0x264446={};for(const _0x39328f of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x2b37a9[_0x39328f]!=null)_0x264446[_0x39328f]=_0x2b37a9[_0x39328f];}const _0x40f0e7=buildCanonicalProjectConfig(_0x264446,{'appCodes':_0x1bde6?[_0x1bde6]:[],'env':_0x25e71a||_0x424adf||'production','metadata':{'createdAt':new Date()[_0x1ad105(0xe9)](),'version':_0x605b8f}});writeConfigFile(_0x3e82cf,_0x40f0e7),_0x1bde6?console[_0x1ad105(0xe8)](_0x1ad105(0xd2)+Object[_0x1ad105(0xce)](_0x40f0e7[_0x1ad105(0xf4)]||{})['join'](',\x20')+_0x1ad105(0xc6)+_0x40f0e7[_0x1ad105(0xbc)]):console[_0x1ad105(0xe8)](_0x1ad105(0xbe)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x1ad105(0xa3)]('create',_0x1ad105(0xa8)+_0x1bde6);}catch(_0x58d522){logger['error'](_0x1ad105(0xf8),_0x1ad105(0xd3));}}
@@ -1 +1 @@
1
- function a163_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
+ (function(_0x372669,_0x215cea){const _0x4a7afc=a163_0x26b7,_0x3c045e=_0x372669();while(!![]){try{const _0x2e6d4d=parseInt(_0x4a7afc(0x156))/0x1+-parseInt(_0x4a7afc(0x135))/0x2*(-parseInt(_0x4a7afc(0x13e))/0x3)+-parseInt(_0x4a7afc(0x139))/0x4+-parseInt(_0x4a7afc(0x165))/0x5*(-parseInt(_0x4a7afc(0x13d))/0x6)+-parseInt(_0x4a7afc(0x166))/0x7*(-parseInt(_0x4a7afc(0x164))/0x8)+parseInt(_0x4a7afc(0x14d))/0x9*(parseInt(_0x4a7afc(0x149))/0xa)+-parseInt(_0x4a7afc(0x15e))/0xb;if(_0x2e6d4d===_0x215cea)break;else _0x3c045e['push'](_0x3c045e['shift']());}catch(_0x2d6ad6){_0x3c045e['push'](_0x3c045e['shift']());}}}(a163_0xd104,0xd0923));import a163_0x13972d from'path';function a163_0xd104(){const _0x3a36c1=['\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','43440SHfDXS','\x20\x20rabetbase\x20run\x20start\x0a','\x20dataset(s),\x20generated\x20','writeFile','666CTZJrL','bun\x20run\x20format','\x20\x20Pulling\x20API\x20configuration...','\x20\x20Installing\x20dependencies...','\x22\x20already\x20exists.','npm','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','\x20api\x20pull`\x20manually\x20later.','\x0a\x20\x20cd\x20','1416227EIJfWg','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','env','*\x20Creating\x20project\x20','Project\x20name\x20cannot\x20be\x20empty.','dirname','parse','\x20created\x20successfully!','43545040RtoXNK','log','Check\x20directory\x20permissions.','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','bun','\x20\x20√\x20Pulled\x20','145480ZrinUN','15jMMZpa','259vAbYOq','length','\x20\x20√\x20Code\x20formatted','constants','belowMinimum','join','\x20\x20√\x20package.json\x20updated','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','validation','access','readFile','2354812RfUZXW','production','stringify','package.json','1579900LJkRat','\x0a√\x20Project\x20','cwd','utf-8','3239976kDNOyx','3fHAUeL','bun\x20--version','Project\x20directory\x20\x22','needsUpgrade','\x20model(s)','trim','...','Project\x20name\x20contains\x20invalid\x20characters.','toLocaleString','resolve'];a163_0xd104=function(){return _0x3a36c1;};return a163_0xd104();}import a163_0x5443a9 from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';function a163_0x26b7(_0x5475b9,_0x26ccdf){_0x5475b9=_0x5475b9-0x130;const _0xd104dc=a163_0xd104();let _0x26b7fa=_0xd104dc[_0x5475b9];return _0x26b7fa;}const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x24628f,_0x1b4ae9,_0x1f9ef9,_0x53b3e3){const _0x308b85=a163_0x26b7,_0xf710c0=await checkCliVersion();(_0xf710c0[_0x308b85(0x141)]||_0xf710c0[_0x308b85(0x16a)])&&(printCliUpgradeWarning(_0xf710c0),assertCliVersionSupported(_0xf710c0));if(!_0x24628f||_0x24628f[_0x308b85(0x143)]()==='')throw CliErrors[_0x308b85(0x132)](_0x308b85(0x15a));const _0x25c1a3=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x25c1a3['test'](_0x24628f))throw CliErrors[_0x308b85(0x132)](_0x308b85(0x145),_0x308b85(0x161));if(_0x24628f[_0x308b85(0x167)]>0x64)throw CliErrors[_0x308b85(0x132)](_0x308b85(0x131));const _0x3bf46c=a163_0x13972d[_0x308b85(0x147)](process[_0x308b85(0x13b)](),_0x24628f);if(existsSync(_0x3bf46c))throw CliErrors[_0x308b85(0x132)](_0x308b85(0x140)+_0x24628f+_0x308b85(0x151),'Use\x20a\x20different\x20project\x20name.');try{const _0x1d7924=a163_0x13972d[_0x308b85(0x15b)](_0x3bf46c);await a163_0x5443a9[_0x308b85(0x133)](_0x1d7924,a163_0x5443a9[_0x308b85(0x169)]['W_OK']);}catch{throw CliErrors[_0x308b85(0x132)]('Cannot\x20create\x20project\x20in\x20current\x20directory.',_0x308b85(0x160));}try{console[_0x308b85(0x15f)](_0x308b85(0x159)+_0x24628f+_0x308b85(0x144));const _0x3d6748=getSubAppReactDemoTemplateDir();await copyDirectory(_0x3d6748,_0x3bf46c),console[_0x308b85(0x15f)]('\x20\x20√\x20Project\x20template\x20created'),await updatePackageJsonName(_0x24628f),console['log'](_0x308b85(0x130)),console[_0x308b85(0x15f)](_0x308b85(0x150)),console[_0x308b85(0x15f)](_0x308b85(0x157)),await formatCode(_0x3bf46c),console[_0x308b85(0x15f)](_0x308b85(0x168)),await configureProject(_0x24628f,_0x1f9ef9,_0x1b4ae9),console[_0x308b85(0x15f)]('\x20\x20√\x20Configuration\x20file\x20created'),_0x1f9ef9&&await pullApiConfig(_0x3bf46c,_0x1f9ef9,_0x1b4ae9,_0x53b3e3),console[_0x308b85(0x15f)](_0x308b85(0x13a)+_0x24628f+_0x308b85(0x15d)),console[_0x308b85(0x15f)](_0x308b85(0x155)+_0x24628f),console[_0x308b85(0x15f)](_0x308b85(0x14a));}catch(_0x2e1767){try{existsSync(_0x3bf46c)&&await a163_0x5443a9['rm'](_0x3bf46c,{'recursive':!![],'force':!![]});}catch{}throw _0x2e1767;}}async function updatePackageJsonName(_0xdd3a46){const _0x23436e=a163_0x26b7,_0xa29b62=a163_0x13972d[_0x23436e(0x147)](process[_0x23436e(0x13b)](),_0xdd3a46),_0xb5ec7=a163_0x13972d[_0x23436e(0x16b)](_0xa29b62,_0x23436e(0x138)),_0x4666e5=await a163_0x5443a9[_0x23436e(0x134)](_0xb5ec7,_0x23436e(0x13c)),_0x49f060=JSON[_0x23436e(0x15c)](_0x4666e5);_0x49f060['name']=_0xdd3a46,_0x49f060['description']=_0x23436e(0x153),await a163_0x5443a9[_0x23436e(0x14c)](_0xb5ec7,JSON[_0x23436e(0x137)](_0x49f060,null,0x2)+'\x0a');}function detectPackageManager(){const _0xea8873=a163_0x26b7;try{return execSync(_0xea8873(0x13f),{'stdio':'ignore'}),_0xea8873(0x162);}catch{return _0xea8873(0x152);}}async function formatCode(_0x1af35e){const _0xcc87a2=a163_0x26b7;try{await execAsync(_0xcc87a2(0x14e),{'cwd':_0x1af35e});}catch{}}async function configureProject(_0x259440,_0x29af4f,_0x52816e){const _0x55f31f=a163_0x26b7,_0x3837f0=a163_0x13972d['resolve'](process[_0x55f31f(0x13b)](),_0x259440),_0x31bd54=a163_0x13972d[_0x55f31f(0x16b)](_0x3837f0,NEW_CONFIG_NAME),_0x3bd5b4=readConfig(),_0x14b9c9=typeof _0x3bd5b4[_0x55f31f(0x158)]==='string'?_0x3bd5b4[_0x55f31f(0x158)]:undefined,_0x3df54b={};for(const _0x421155 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x3bd5b4[_0x421155]!=null)_0x3df54b[_0x421155]=_0x3bd5b4[_0x421155];}const _0x120213=buildCanonicalProjectConfig(_0x3df54b,{'appCodes':_0x29af4f?[_0x29af4f]:[],'env':_0x52816e||_0x14b9c9||'production','metadata':{'createdAt':new Date()[_0x55f31f(0x146)](),'version':getCliVersion()}});writeConfigFile(_0x31bd54,_0x120213);}async function pullApiConfig(_0x5eb321,_0x2dfdfc,_0x3fe2d8,_0x32f5df){const _0x403d42=a163_0x26b7,_0x500d87=process['cwd']();try{process['chdir'](_0x5eb321);const _0x1ea648=_0x3fe2d8||_0x403d42(0x136);initEnv(_0x1ea648),console[_0x403d42(0x15f)](_0x403d42(0x14f));const {configArray:_0x25ebc4}=await fetchModelList(_0x2dfdfc,_0x32f5df||''),_0x3503c0=await generateApiFile(_0x25ebc4,'',_0x2dfdfc,!![],_0x1ea648,DEFAULT_API_DIR);console[_0x403d42(0x15f)](_0x403d42(0x163)+_0x25ebc4['length']+_0x403d42(0x14b)+_0x3503c0['modelCount']+_0x403d42(0x142));}catch(_0x196849){console[_0x403d42(0x15f)](_0x403d42(0x148)+CLI_BIN_NAME+_0x403d42(0x154));}finally{process['chdir'](_0x500d87);}}
@@ -1 +1 @@
1
- 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
+ const a164_0x5297d2=a164_0x3cdf;(function(_0x2373db,_0x3509fb){const _0x1126b7=a164_0x3cdf,_0x5ce08b=_0x2373db();while(!![]){try{const _0x329a84=parseInt(_0x1126b7(0x1b7))/0x1+parseInt(_0x1126b7(0x1c1))/0x2+-parseInt(_0x1126b7(0x1bf))/0x3+-parseInt(_0x1126b7(0x1b9))/0x4*(-parseInt(_0x1126b7(0x1bc))/0x5)+-parseInt(_0x1126b7(0x1c2))/0x6*(-parseInt(_0x1126b7(0x1be))/0x7)+-parseInt(_0x1126b7(0x1bd))/0x8+parseInt(_0x1126b7(0x1b6))/0x9*(-parseInt(_0x1126b7(0x1bb))/0xa);if(_0x329a84===_0x3509fb)break;else _0x5ce08b['push'](_0x5ce08b['shift']());}catch(_0x2b704c){_0x5ce08b['push'](_0x5ce08b['shift']());}}}(a164_0xcbe0,0x9201d));import a164_0x4d8162 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a164_0x4d8162[a164_0x5297d2(0x1b5)](fileURLToPath(import.meta.url));function a164_0x3cdf(_0x2a62f6,_0x2c1ddb){_0x2a62f6=_0x2a62f6-0x1b4;const _0xcbe035=a164_0xcbe0();let _0x3cdf4d=_0xcbe035[_0x2a62f6];return _0x3cdf4d;}export function getRabetbaseCliPackageRoot(){const _0x50cb7f=a164_0x5297d2;return a164_0x4d8162['resolve'](__dirname,_0x50cb7f(0x1c0));}function a164_0xcbe0(){const _0x51eada=['3492966RaEAqF','../../../../','806466oGkhRF','1273710BrWQRZ','projects','dirname','36dgfxiD','910952jbTwcF','sub-app-react-demo','4tEIvSp','templates','1917040tVzPEo','3702890DIWLJW','2997760wxqXaZ','28nYOftm'];a164_0xcbe0=function(){return _0x51eada;};return a164_0xcbe0();}export function getSubAppReactDemoTemplateDir(){const _0x56ae28=a164_0x5297d2;return a164_0x4d8162['join'](getRabetbaseCliPackageRoot(),_0x56ae28(0x1ba),_0x56ae28(0x1b4),_0x56ae28(0x1b8));}
@@ -1 +1 @@
1
- (function(_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
+ (function(_0x524e17,_0x46a67a){const _0x11044c=a165_0x28b1,_0x2ef11f=_0x524e17();while(!![]){try{const _0xacb01f=parseInt(_0x11044c(0x115))/0x1*(-parseInt(_0x11044c(0x106))/0x2)+-parseInt(_0x11044c(0x111))/0x3*(-parseInt(_0x11044c(0x116))/0x4)+-parseInt(_0x11044c(0x108))/0x5+parseInt(_0x11044c(0x11c))/0x6*(parseInt(_0x11044c(0x113))/0x7)+parseInt(_0x11044c(0x109))/0x8*(parseInt(_0x11044c(0x11a))/0x9)+-parseInt(_0x11044c(0x10e))/0xa*(-parseInt(_0x11044c(0x10d))/0xb)+parseInt(_0x11044c(0x10b))/0xc*(-parseInt(_0x11044c(0x10f))/0xd);if(_0xacb01f===_0x46a67a)break;else _0x2ef11f['push'](_0x2ef11f['shift']());}catch(_0x28921d){_0x2ef11f['push'](_0x2ef11f['shift']());}}}(a165_0x44b3,0x5dcb0));import a165_0x2dbe4f from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a165_0x28b1(_0x2a6710,_0x311dc3){_0x2a6710=_0x2a6710-0x106;const _0x44b37f=a165_0x44b3();let _0x28b18f=_0x44b37f[_0x2a6710];return _0x28b18f;}import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x2dba4c){const _0x4f15f9=a165_0x28b1,_0x1b50c9=Date[_0x4f15f9(0x107)](),_0x4def30=a165_0x2dbe4f[_0x4f15f9(0x10a)](process[_0x4f15f9(0x112)](),_0x2dba4c);try{logger[_0x4f15f9(0x119)](_0x4f15f9(0x110),_0x4f15f9(0x118),{'projectCode':_0x2dba4c,'templateDir':templateDir}),await copyDirectory(templateDir,_0x4def30);const _0x3457df=Date[_0x4f15f9(0x107)]()-_0x1b50c9;logger[_0x4f15f9(0x114)]('copy',_0x4f15f9(0x10c),_0x3457df,{'projectCode':_0x2dba4c});}catch(_0x3e4d5f){const _0x4ca748=Date['now']()-_0x1b50c9;logger['error'](_0x4f15f9(0x110),_0x4f15f9(0x117),{'projectCode':_0x2dba4c,'error':_0x3e4d5f instanceof Error?_0x3e4d5f[_0x4f15f9(0x11b)]:String(_0x3e4d5f),'duration':_0x4ca748});throw _0x3e4d5f;}return formatElapsed(_0x1b50c9);}function a165_0x44b3(){const _0x1dfa4b=['info','18kDcVbq','message','1236csDxVj','73518NSyXuJ','now','1597630ZRNWSu','1076784NZCXCV','resolve','4188fHEXjl','项目模板复制完成','858QQgXiR','14510ToiwJd','15223RetcKp','copy','430179nkSdRY','cwd','16310fuOlTN','success','1KsLFHS','8IzZnHn','项目模板复制失败','开始复制项目模板'];a165_0x44b3=function(){return _0x1dfa4b;};return a165_0x44b3();}
@@ -1 +1 @@
1
- (function(_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
+ (function(_0x454ab4,_0x16fe90){const _0x247ee4=a166_0xab24,_0xb8e65c=_0x454ab4();while(!![]){try{const _0x496da0=-parseInt(_0x247ee4(0x13a))/0x1*(-parseInt(_0x247ee4(0x131))/0x2)+parseInt(_0x247ee4(0x137))/0x3+-parseInt(_0x247ee4(0x13c))/0x4*(-parseInt(_0x247ee4(0x12b))/0x5)+parseInt(_0x247ee4(0x132))/0x6*(parseInt(_0x247ee4(0x13f))/0x7)+-parseInt(_0x247ee4(0x12d))/0x8*(-parseInt(_0x247ee4(0x139))/0x9)+parseInt(_0x247ee4(0x12c))/0xa+-parseInt(_0x247ee4(0x12f))/0xb;if(_0x496da0===_0x16fe90)break;else _0xb8e65c['push'](_0xb8e65c['shift']());}catch(_0xe6879a){_0xb8e65c['push'](_0xb8e65c['shift']());}}}(a166_0x5b4d,0x96f36));import a166_0x5b6e96 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a166_0x5b4d(){const _0x389d25=['1592jdQrjE','--write','31908503wjlGLu','success','1661742Ibgvvf','72xjPtoA','format','now','message','开始格式化代码','2301537xovFDq','npx','17541loVFjb','1qmXAAK','resolve','4852508uXSqTm','代码格式化完成','prettier','185052FxxIaq','info','5nMQNeK','28070qyePHH'];a166_0x5b4d=function(){return _0x389d25;};return a166_0x5b4d();}import{resolveNpmBin}from'../../../utils/platform.js';function a166_0xab24(_0x1c88c7,_0x17b533){_0x1c88c7=_0x1c88c7-0x12a;const _0x5b4d1a=a166_0x5b4d();let _0xab24a1=_0x5b4d1a[_0x1c88c7];return _0xab24a1;}export async function formatProjectCode(_0x50c03a){const _0xa5d501=a166_0xab24,_0x104489=Date[_0xa5d501(0x134)](),_0x3e8454=a166_0x5b6e96[_0xa5d501(0x13b)](process['cwd'](),_0x50c03a);try{logger[_0xa5d501(0x12a)](_0xa5d501(0x133),_0xa5d501(0x136),{'projectCode':_0x50c03a}),await execa(resolveNpmBin(_0xa5d501(0x138)),[_0xa5d501(0x13e),_0xa5d501(0x12e),'.'],{'cwd':_0x3e8454});const _0xa8630e=Date['now']()-_0x104489;logger[_0xa5d501(0x130)](_0xa5d501(0x133),_0xa5d501(0x13d),_0xa8630e,{'projectCode':_0x50c03a});}catch(_0x33809b){const _0x1455cb=Date[_0xa5d501(0x134)]()-_0x104489;logger['error'](_0xa5d501(0x133),'代码格式化失败',{'projectCode':_0x50c03a,'error':_0x33809b instanceof Error?_0x33809b[_0xa5d501(0x135)]:String(_0x33809b),'duration':_0x1455cb});throw _0x33809b;}return formatElapsed(_0x104489);}
@@ -1 +1 @@
1
- (function(_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
+ function a167_0xcaeb(_0x43be0a,_0x3e395b){_0x43be0a=_0x43be0a-0x1f3;const _0x571335=a167_0x5713();let _0xcaebc1=_0x571335[_0x43be0a];return _0xcaebc1;}(function(_0x4177bc,_0x12b514){const _0x27ab35=a167_0xcaeb,_0x5ac226=_0x4177bc();while(!![]){try{const _0x33b759=-parseInt(_0x27ab35(0x202))/0x1*(-parseInt(_0x27ab35(0x1f5))/0x2)+-parseInt(_0x27ab35(0x1f8))/0x3+parseInt(_0x27ab35(0x1fa))/0x4+-parseInt(_0x27ab35(0x1ff))/0x5+parseInt(_0x27ab35(0x204))/0x6+parseInt(_0x27ab35(0x1f4))/0x7+parseInt(_0x27ab35(0x205))/0x8*(-parseInt(_0x27ab35(0x1fe))/0x9);if(_0x33b759===_0x12b514)break;else _0x5ac226['push'](_0x5ac226['shift']());}catch(_0x46dd0b){_0x5ac226['push'](_0x5ac226['shift']());}}}(a167_0x5713,0xf1a5f));import a167_0x3b4e5f from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x4098a7){const _0x593800=a167_0xcaeb,_0x5da557=Date[_0x593800(0x1f3)](),_0x208988=a167_0x3b4e5f[_0x593800(0x1f9)](process['cwd'](),_0x4098a7);try{logger[_0x593800(0x200)]('install',_0x593800(0x1fc),{'projectCode':_0x4098a7,'registry':_0x593800(0x1f6)}),await execa(resolveNpmBin(_0x593800(0x1fd)),[_0x593800(0x201),_0x593800(0x207),_0x593800(0x1f6)],{'cwd':_0x208988});const _0x2ed702=Date[_0x593800(0x1f3)]()-_0x5da557;logger[_0x593800(0x206)](_0x593800(0x201),'依赖安装完成',_0x2ed702,{'projectCode':_0x4098a7});}catch(_0x45c58d){const _0x1f69e5=Date['now']()-_0x5da557;logger[_0x593800(0x1fb)](_0x593800(0x201),_0x593800(0x203),{'projectCode':_0x4098a7,'error':_0x45c58d instanceof Error?_0x45c58d[_0x593800(0x1f7)]:String(_0x45c58d),'duration':_0x1f69e5});throw _0x45c58d;}return formatElapsed(_0x5da557);}function a167_0x5713(){const _0x11eb78=['33134eMgirA','https://registry.npmmirror.com','message','463134NycpST','resolve','2063204Gvnfaf','error','开始安装依赖','npm','2086947WqlQrr','990880bVkHlj','info','install','119CmMhkl','依赖安装失败','9544788yIUlLI','112dZAcrW','success','--registry','now','3574445LWXbZx'];a167_0x5713=function(){return _0x11eb78;};return a167_0x5713();}
@@ -1 +1 @@
1
- const a168_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
+ const a168_0x200555=a168_0x1990;(function(_0x55c799,_0x116510){const _0x35e836=a168_0x1990,_0x313d91=_0x55c799();while(!![]){try{const _0x1a089c=parseInt(_0x35e836(0x18b))/0x1+-parseInt(_0x35e836(0x17d))/0x2*(-parseInt(_0x35e836(0x177))/0x3)+parseInt(_0x35e836(0x189))/0x4+-parseInt(_0x35e836(0x18c))/0x5+parseInt(_0x35e836(0x192))/0x6+parseInt(_0x35e836(0x175))/0x7+-parseInt(_0x35e836(0x183))/0x8;if(_0x1a089c===_0x116510)break;else _0x313d91['push'](_0x313d91['shift']());}catch(_0x3d56b5){_0x313d91['push'](_0x313d91['shift']());}}}(a168_0x44b6,0x63f71));import{CliErrors}from'../../errors.js';function a168_0x1990(_0x3c6136,_0x202b42){_0x3c6136=_0x3c6136-0x174;const _0x44b6c9=a168_0x44b6();let _0x1990ca=_0x44b6c9[_0x3c6136];return _0x1990ca;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';const createFlags=[{'name':a168_0x200555(0x17f),'type':a168_0x200555(0x185),'description':'Project\x20name'},{'name':'env','type':'string','description':a168_0x200555(0x18d)},{'name':a168_0x200555(0x17c),'type':a168_0x200555(0x185),'description':a168_0x200555(0x193)}],upgradeFlags=[{'name':a168_0x200555(0x181),'type':a168_0x200555(0x174),'description':a168_0x200555(0x190),'default':![]}];function a168_0x44b6(){const _0x3c4118=['Target\x20environment','project','Create\x20a\x20new\x20project','Skip\x20confirmation\x20prompt','args','4563978fvlNdP','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','boolean','1219057PeBUVm','cookie','255CeOSRw','str','trim','validation','nonInteractive','appcode','8548CUpzjz','../../commands/project/create/main.js','name','write','yes','create','7779056yAONOV','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','string','bool','project-name','../../commands/project/create/non-interactive.js','105036DkcFoA','Usage:\x20','269342inGTov','1059330aHztyg'];a168_0x44b6=function(){return _0x3c4118;};return a168_0x44b6();}export const projectDefinitions=[{'service':a168_0x200555(0x18e),'command':a168_0x200555(0x182),'description':a168_0x200555(0x18f),'risk':a168_0x200555(0x180),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a168_0x200555(0x187),'description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x81da7d){const _0x1989c8=a168_0x200555,{createApp:_0x1455c3}=await import(_0x1989c8(0x17e)),{createProjectNonInteractive:_0x128623}=await import(_0x1989c8(0x188)),_0x301d21=_0x81da7d[_0x1989c8(0x178)](_0x1989c8(0x17f))['trim']()||_0x81da7d[_0x1989c8(0x191)][0x0]?.[_0x1989c8(0x179)](),_0x282e3c=_0x81da7d[_0x1989c8(0x178)]('env')||undefined,_0x1c9661=_0x81da7d['str'](_0x1989c8(0x17c))||undefined;if(_0x81da7d[_0x1989c8(0x17b)]){if(!_0x301d21)throw CliErrors[_0x1989c8(0x17a)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x1989c8(0x18a)+CLI_BIN_NAME+_0x1989c8(0x184));await _0x128623(_0x301d21,_0x282e3c,_0x1c9661,_0x81da7d[_0x1989c8(0x176)]);}else await _0x1455c3({'projectCode':_0x301d21,'appCode':_0x1c9661,'env':_0x282e3c,'cookie':_0x81da7d['cookie']});return{'ok':!![]};}},{'service':a168_0x200555(0x18e),'command':'upgrade','description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a168_0x200555(0x180),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x48abfd){const _0xe12567=a168_0x200555;return await upgradeApp(_0x48abfd[_0xe12567(0x17b)],{'yes':_0x48abfd[_0xe12567(0x186)](_0xe12567(0x181))}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a169_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)](''));}
1
+ const a169_0x2d3c50=a169_0x2d0c;(function(_0x1cf8cb,_0x3cccb5){const _0x4f720e=a169_0x2d0c,_0xa5d4a0=_0x1cf8cb();while(!![]){try{const _0x193ab9=parseInt(_0x4f720e(0xaa))/0x1+-parseInt(_0x4f720e(0xd9))/0x2+parseInt(_0x4f720e(0xd6))/0x3*(parseInt(_0x4f720e(0x114))/0x4)+parseInt(_0x4f720e(0xb6))/0x5+-parseInt(_0x4f720e(0xab))/0x6+parseInt(_0x4f720e(0xf2))/0x7*(parseInt(_0x4f720e(0xf0))/0x8)+-parseInt(_0x4f720e(0xa2))/0x9*(parseInt(_0x4f720e(0xe6))/0xa);if(_0x193ab9===_0x3cccb5)break;else _0xa5d4a0['push'](_0xa5d4a0['shift']());}catch(_0x261837){_0xa5d4a0['push'](_0xa5d4a0['shift']());}}}(a169_0x1ed6,0x716b2));import a169_0xda8879 from'chalk';function a169_0x1ed6(){const _0x299f92=['@lovrabet/sdk','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','step','oldArtifacts','===\x20Upgrade\x20Analysis\x20===','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','lovrabet/rabetbase\x20installed\x20globally','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','isDirectory','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','\x20\x20\x20\x20\x20\x20\x20','bold','190mkfTLm','.bak','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','red','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','not\x20found\x20or\x20already\x20at\x20latest','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','oldPath','\x20→\x20latest','1497416WdDPSv','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','28msXrjU','start','skipped\x20(no\x20legacy\x20config)','keys','no\x20legacy\x20config\x20found','yes','error','detail','Remove\x20legacy\x20artifacts','Remove\x20old\x20skill','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','succeed','Remove\x20.lovrabet/','green','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','not\x20found\x20(will\x20create)','failed','values','@lovrabet/dataset-mcp-server','lovrabet/lovrabet-skill\x20removed','FOUND','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Proceed\x20with\x20upgrade?','needed','object','stringify','Clean\x20MCP\x20config','done','hasNewConfig','gray','includes','Config\x20migration','\x20→\x20','fail','39892skzYpk','Install\x20new\x20skill','files','Step\x201/7:\x20Migrating\x20config...','latest','some','removed\x20','isArray','cyan','cwd','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','utf8','mcpServers','MCP\x20config:','entries','args','oldMcpConfig','Upgrade\x20@lovrabet/sdk','yellow','\x20\x20#\x20or','407529odQSdx','configMigration','Step\x204/7:\x20MCP\x20config\x20—\x20','Step\x201/7:\x20Config\x20migration\x20—\x20','Step\x206/7:\x20Installing\x20new\x20skill...','label','exit\x20','none\x20found','909800xQJjUW','5096562AkPwyD','log','Legacy\x20artifacts:','\x20from\x20','status','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','dependencies','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','\x20removed','not\x20needed','Step\x204/7:\x20Cleaning\x20MCP\x20config...','2451105bjDGje','undefined','package.json','string','info','parse','no\x20matching\x20entry\x20found','skipped','length','.cursor/rules/lovrabet_rules.mdc','already\x20exists\x20(will\x20merge)','Config\x20file:','\x20\x20Action:\x20delete','filter','Upgrade\x20cancelled.','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','white','@lovrabet/sdk:','\x20\x20Fields\x20to\x20migrate:\x20','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','Skill\x20swap:','path','join','push','.lovrabet','\x20removed\x20(','message','Upgrade\x20completed\x20successfully!','\x20→\x20keys:\x20','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','\x20(backup:\x20','.cursor/mcp.json','9VrpvkS','sdkUpgrade','\x20\x20Current\x20version\x20in\x20','8640SZXCJP'];a169_0x1ed6=function(){return _0x299f92;};return a169_0x1ed6();}import a169_0x4d3d07 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a169_0x2d3c50(0xc3)](_0x890f1a=>_0x890f1a!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x2b74cd){const _0x20e407=a169_0x2d3c50,_0x40de9e=[];for(const _0x2db570 of Object[_0x20e407(0x103)](CORE_IDE_CONFIGS)){if(_0x2db570[_0x20e407(0x116)])for(const _0x1e8930 of _0x2db570[_0x20e407(0x116)]){_0x40de9e[_0x20e407(0xcd)](resolve(_0x2b74cd,_0x1e8930[_0x20e407(0xcb)]));}}return _0x40de9e;}function a169_0x2d0c(_0x265fb8,_0x23eab6){_0x265fb8=_0x265fb8-0x98;const _0x1ed65e=a169_0x1ed6();let _0x2d0c70=_0x1ed65e[_0x265fb8];return _0x2d0c70;}function analyse(_0x388070){const _0x3abc9f=a169_0x2d3c50;let _0x5c1bb0=null;const _0x2dafb2=resolve(_0x388070,NEW_CONFIG_NAME),_0x4515fe=existsSync(_0x2dafb2);for(const _0x346fb3 of LEGACY_CONFIG_NAMES){const _0x4accb3=resolve(_0x388070,_0x346fb3);if(existsSync(_0x4accb3)){const _0x31eb7a=readConfigFile(_0x4accb3),_0x9cf20e=Object[_0x3abc9f(0xf5)](_0x31eb7a)[_0x3abc9f(0xc3)](_0x15d3a2=>typeof _0x31eb7a[_0x15d3a2]!==_0x3abc9f(0xb7));_0x5c1bb0={'oldPath':_0x4accb3,'hasNewConfig':_0x4515fe,'fields':_0x9cf20e};break;}}const _0x2584bc=[],_0x6d9a63=resolve(_0x388070,_0x3abc9f(0xce));if(existsSync(_0x6d9a63))_0x2584bc[_0x3abc9f(0xcd)](_0x6d9a63);const _0x23a1c3=resolve(_0x388070,_0x3abc9f(0xbf));if(existsSync(_0x23a1c3))_0x2584bc['push'](_0x23a1c3);const _0x1f65d7=resolve(_0x388070,'.claude/skills/lovrabet');if(existsSync(_0x1f65d7))_0x2584bc[_0x3abc9f(0xcd)](_0x1f65d7);for(const _0xd22b3d of collectIdeSkillFiles(_0x388070)){if(existsSync(_0xd22b3d))_0x2584bc[_0x3abc9f(0xcd)](_0xd22b3d);}let _0x379b75=null;const _0x2406be=resolve(_0x388070,_0x3abc9f(0xd5));if(existsSync(_0x2406be))try{const _0x11ca41=JSON[_0x3abc9f(0xbb)](readFileSync(_0x2406be,'utf8'));if(_0x11ca41?.[_0x3abc9f(0x9a)]&&typeof _0x11ca41[_0x3abc9f(0x9a)]==='object'){const _0x174271=[];for(const [_0x45b278,_0x2b2a24]of Object[_0x3abc9f(0x9c)](_0x11ca41[_0x3abc9f(0x9a)])){const _0x19f421=_0x2b2a24;_0x19f421?.[_0x3abc9f(0x9d)]&&Array[_0x3abc9f(0x11b)](_0x19f421[_0x3abc9f(0x9d)])&&_0x19f421[_0x3abc9f(0x9d)][_0x3abc9f(0x119)](_0x3ff515=>typeof _0x3ff515===_0x3abc9f(0xb9)&&_0x3ff515[_0x3abc9f(0x110)](_0x3abc9f(0x104)))&&_0x174271[_0x3abc9f(0xcd)](_0x45b278);}_0x174271[_0x3abc9f(0xbe)]>0x0&&(_0x379b75={'path':_0x2406be,'keys':_0x174271});}}catch{}const _0x395fe2=_0x2584bc[_0x3abc9f(0xbe)]>0x0||_0x5c1bb0!==null;let _0x51a648=null;const _0x1c35c1=resolve(_0x388070,_0x3abc9f(0xb8));if(existsSync(_0x1c35c1))try{const _0x2c985d=JSON[_0x3abc9f(0xbb)](readFileSync(_0x1c35c1,'utf8'));for(const _0x16b077 of[_0x3abc9f(0xb1),'devDependencies']){const _0x5cf413=_0x2c985d?.[_0x16b077]?.[_0x3abc9f(0xda)];if(typeof _0x5cf413==='string'){_0x5cf413!==_0x3abc9f(0x118)&&(_0x51a648={'pkgPath':_0x1c35c1,'currentVersion':_0x5cf413,'field':_0x16b077});break;}}}catch{}return{'configMigration':_0x5c1bb0,'oldArtifacts':_0x2584bc,'oldMcpConfig':_0x379b75,'needsSkillSwap':_0x395fe2,'sdkUpgrade':_0x51a648};}function printReport(_0xd5f8c){const _0x1504f2=a169_0x2d3c50,{configMigration:_0x3fb8d9,oldArtifacts:_0x5f2b4a,oldMcpConfig:_0x64ea47,needsSkillSwap:_0x3a61e7}=_0xd5f8c;console[_0x1504f2(0xac)](''),console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0xe5)](_0x1504f2(0xde))),console[_0x1504f2(0xac)]('');_0x3fb8d9?(console[_0x1504f2(0xac)](a169_0xda8879['cyan']('Config\x20file:')+('\x20\x20'+a169_0xda8879[_0x1504f2(0xa0)](_0x3fb8d9['oldPath']))),console[_0x1504f2(0xac)](_0x1504f2(0x107)+(_0x3fb8d9[_0x1504f2(0x10e)]?a169_0xda8879[_0x1504f2(0xff)](_0x1504f2(0xc0)):a169_0xda8879[_0x1504f2(0x10f)](_0x1504f2(0x101)))),console[_0x1504f2(0xac)](_0x1504f2(0xc8)+_0x3fb8d9['fields'][_0x1504f2(0xcc)](',\x20')),console[_0x1504f2(0xac)](_0x1504f2(0xe1))):console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xc1))+'\x20\x20'+a169_0xda8879[_0x1504f2(0x10f)](_0x1504f2(0xf6)));console['log']('');if(_0x5f2b4a['length']>0x0){console['log'](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xad)));for(const _0x397465 of _0x5f2b4a){console[_0x1504f2(0xac)]('\x20\x20'+a169_0xda8879['red'](_0x1504f2(0x106))+'\x20\x20'+_0x397465);}console[_0x1504f2(0xac)](_0x1504f2(0xc2));}else console[_0x1504f2(0xac)](a169_0xda8879['cyan'](_0x1504f2(0xad))+'\x20\x20'+a169_0xda8879['gray'](_0x1504f2(0xa9)));console[_0x1504f2(0xac)]('');_0x64ea47?(console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0x9b))+('\x20\x20'+a169_0xda8879[_0x1504f2(0xa0)](_0x64ea47[_0x1504f2(0xcb)])+_0x1504f2(0xd2)+_0x64ea47[_0x1504f2(0xf5)][_0x1504f2(0xcc)](',\x20'))),console[_0x1504f2(0xac)](_0x1504f2(0xc9))):console[_0x1504f2(0xac)](a169_0xda8879['cyan'](_0x1504f2(0x9b))+'\x20\x20'+a169_0xda8879['gray']('no\x20legacy\x20entry'));console[_0x1504f2(0xac)](''),console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xca))+('\x20\x20'+(_0x3a61e7?a169_0xda8879['yellow'](_0x1504f2(0x109)):a169_0xda8879[_0x1504f2(0xff)](_0x1504f2(0xb4)))));_0x3a61e7&&console[_0x1504f2(0xac)](_0x1504f2(0xf1)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0xd5f8c[_0x1504f2(0xd7)]){const {currentVersion:_0x55566b,field:_0x510ea5,pkgPath:_0x34b185}=_0xd5f8c[_0x1504f2(0xd7)];console[_0x1504f2(0xac)](a169_0xda8879['cyan'](_0x1504f2(0xc7))+('\x20\x20'+a169_0xda8879[_0x1504f2(0xa0)](_0x34b185))),console['log'](_0x1504f2(0xd8)+_0x510ea5+':\x20'+a169_0xda8879['yellow'](_0x55566b)+_0x1504f2(0x112)+a169_0xda8879[_0x1504f2(0xff)](_0x1504f2(0x118))),console[_0x1504f2(0xac)](_0x1504f2(0xfc));}else console[_0x1504f2(0xac)](a169_0xda8879[_0x1504f2(0x11c)](_0x1504f2(0xc7))+'\x20\x20'+a169_0xda8879[_0x1504f2(0x10f)](_0x1504f2(0xec)));console[_0x1504f2(0xac)]('');}function execConfigMigration(_0xdb7e7d,_0x5acd7a){const _0x260df6=a169_0x2d3c50,{configMigration:_0x416b76}=_0xdb7e7d;if(!_0x416b76?.[_0x260df6(0xee)])return{'step':0x1,'label':_0x260df6(0x111),'ok':!![],'detail':_0x260df6(0xf4)};const _0x207af5=readConfigFile(_0x416b76[_0x260df6(0xee)]),_0x5b0a60=resolve(_0x5acd7a,NEW_CONFIG_NAME),_0x45b054=_0x416b76[_0x260df6(0x10e)]?readConfigFile(_0x5b0a60):{};for(const [_0x20d26b,_0xd0efb6]of Object[_0x260df6(0x9c)](_0x207af5)){!(_0x20d26b in _0x45b054)&&(_0x45b054[_0x20d26b]=_0xd0efb6);}writeConfigFile(_0x5b0a60,_0x45b054);const _0x4aca99=_0x416b76[_0x260df6(0xee)]+_0x260df6(0xe7);return renameSync(_0x416b76[_0x260df6(0xee)],_0x4aca99),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x416b76[_0x260df6(0xee)]+_0x260df6(0x112)+_0x5b0a60+_0x260df6(0xd4)+_0x4aca99+')'};}function execRemoveOldArtifacts(_0x577636){const _0x291061=a169_0x2d3c50,_0x530760=[];for(const _0xc9cd3d of _0x577636){try{if(!existsSync(_0xc9cd3d))continue;const _0x1d25ae=tryStat(_0xc9cd3d);_0x1d25ae?.[_0x291061(0xe2)]()?rmSync(_0xc9cd3d,{'recursive':!![],'force':!![]}):unlinkSync(_0xc9cd3d);}catch(_0x52face){_0x530760[_0x291061(0xcd)](_0xc9cd3d+':\x20'+_0x52face[_0x291061(0xd0)]);}}return{'step':0x3,'label':_0x291061(0xfa),'ok':_0x530760[_0x291061(0xbe)]===0x0,'detail':_0x530760[_0x291061(0xbe)]>0x0?_0x577636[_0x291061(0xbe)]-_0x530760['length']+'/'+_0x577636[_0x291061(0xbe)]+_0x291061(0xcf)+_0x530760['join'](';\x20')+')':_0x577636[_0x291061(0xbe)]+_0x291061(0xb3)};}function execCleanMcp(_0x2a7ce3){const _0x33de67=a169_0x2d3c50;if(!_0x2a7ce3['oldMcpConfig'])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'skipped'};try{const _0x403374=readFileSync(_0x2a7ce3['oldMcpConfig']['path'],_0x33de67(0x99)),_0x210414=JSON[_0x33de67(0xbb)](_0x403374);if(_0x210414?.[_0x33de67(0x9a)]&&typeof _0x210414[_0x33de67(0x9a)]===_0x33de67(0x10a)){const _0x53e787=[];for(const [_0x285311,_0x53f00c]of Object[_0x33de67(0x9c)](_0x210414['mcpServers'])){_0x53f00c?.[_0x33de67(0x9d)]&&Array[_0x33de67(0x11b)](_0x53f00c[_0x33de67(0x9d)])&&_0x53f00c['args'][_0x33de67(0x119)](_0x3ad408=>typeof _0x3ad408===_0x33de67(0xb9)&&_0x3ad408[_0x33de67(0x110)](_0x33de67(0x104)))&&_0x53e787[_0x33de67(0xcd)](_0x285311);}for(const _0x2dc817 of _0x53e787){delete _0x210414[_0x33de67(0x9a)][_0x2dc817];}return _0x53e787['length']>0x0&&writeFileSync(_0x2a7ce3['oldMcpConfig'][_0x33de67(0xcb)],JSON[_0x33de67(0x10b)](_0x210414,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0x33de67(0x10c),'ok':!![],'detail':_0x33de67(0x11a)+_0x53e787[_0x33de67(0xcc)](',\x20')+_0x33de67(0xae)+_0x2a7ce3['oldMcpConfig'][_0x33de67(0xcb)]};}return{'step':0x4,'label':_0x33de67(0x10c),'ok':!![],'detail':_0x33de67(0xbc)};}catch(_0xa7db19){return{'step':0x4,'label':_0x33de67(0x10c),'ok':![],'detail':_0xa7db19[_0x33de67(0xd0)]};}}function execSkillsRemove(_0x596b82,_0x36a16c){const _0xed5900=a169_0x2d3c50,_0x548224=runNpxSkillsRemove(_0x596b82,{'stdio':'inherit','yes':_0x36a16c});return{'step':0x5,'label':_0xed5900(0xfb),'ok':_0x548224['ok'],'detail':_0x548224['ok']?_0xed5900(0x105):_0x548224[_0xed5900(0xf8)]??'exit\x20'+_0x548224[_0xed5900(0xaf)]};}function execSkillsAdd(_0x3f35ed,_0x33f058){const _0x255f64=a169_0x2d3c50,_0xbda368=runNpxSkillsAddGlobal(_0x3f35ed,'lovrabet/rabetbase',{'stdio':'inherit','yes':_0x33f058});return{'step':0x6,'label':_0x255f64(0x115),'ok':_0xbda368['ok'],'detail':_0xbda368['ok']?_0x255f64(0xe0):_0xbda368[_0x255f64(0xf8)]??_0x255f64(0xa8)+_0xbda368[_0x255f64(0xaf)]};}function execUpgradeSdk(_0x4a765f){const _0x515ae4=a169_0x2d3c50;if(!_0x4a765f[_0x515ae4(0xd7)])return{'step':0x7,'label':_0x515ae4(0x9f),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x4adb64,currentVersion:_0x1b47b2,field:_0x3341a7}=_0x4a765f['sdkUpgrade'];try{const _0x49bdc5=readFileSync(_0x4adb64,_0x515ae4(0x99)),_0xc884fe=JSON[_0x515ae4(0xbb)](_0x49bdc5);return _0xc884fe[_0x3341a7]['@lovrabet/sdk']=_0x515ae4(0x118),writeFileSync(_0x4adb64,JSON[_0x515ae4(0x10b)](_0xc884fe,null,0x2)+'\x0a',_0x515ae4(0x99)),{'step':0x7,'label':_0x515ae4(0x9f),'ok':!![],'detail':_0x3341a7+'[\x22@lovrabet/sdk\x22]:\x20'+_0x1b47b2+_0x515ae4(0xef)};}catch(_0x4a45f1){return{'step':0x7,'label':_0x515ae4(0x9f),'ok':![],'detail':_0x4a45f1[_0x515ae4(0xd0)]};}}function tryStat(_0x51028b){try{return statSync(_0x51028b);}catch{return undefined;}}function printSummary(_0x239a30){const _0x4bb890=a169_0x2d3c50;console[_0x4bb890(0xac)](''),console['log'](a169_0xda8879['bold']('===\x20Upgrade\x20Summary\x20===')),console[_0x4bb890(0xac)]('');for(const _0x55989f of _0x239a30){const _0x579a6f=_0x55989f['ok']?a169_0xda8879[_0x4bb890(0xff)]('OK'):a169_0xda8879[_0x4bb890(0xea)]('FAIL');console[_0x4bb890(0xac)]('\x20\x20'+_0x579a6f+'\x20\x20Step\x20'+_0x55989f[_0x4bb890(0xdc)]+':\x20'+_0x55989f[_0x4bb890(0xa7)]);if(_0x55989f[_0x4bb890(0xf9)])console['log'](_0x4bb890(0xe4)+a169_0xda8879[_0x4bb890(0x10f)](_0x55989f['detail']));}console['log']('');}export async function upgradeApp(_0x39d260,_0x57df36){const _0x583c19=a169_0x2d3c50,_0x1f3fd8=process[_0x583c19(0x11d)](),_0x12e43a=analyse(_0x1f3fd8),_0x2d60e5=!_0x12e43a[_0x583c19(0xa3)]&&_0x12e43a[_0x583c19(0xdd)][_0x583c19(0xbe)]===0x0&&!_0x12e43a[_0x583c19(0x9e)]&&!_0x12e43a['needsSkillSwap']&&!_0x12e43a[_0x583c19(0xd7)];if(_0x2d60e5){console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0xff)](_0x583c19(0xdf)));return;}printReport(_0x12e43a);const _0x3e39b9=!!(_0x57df36[_0x583c19(0xf7)]||_0x57df36['Y']||_0x39d260);if(!_0x3e39b9)try{const _0x5cf903=await askConfirm(_0x583c19(0x108));if(!_0x5cf903){console['log'](a169_0xda8879[_0x583c19(0x10f)](_0x583c19(0xc4)));return;}}catch(_0x1efbe8){if(_0x1efbe8?.['message']==='CANCEL'){console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0x10f)](_0x583c19(0xc4)));return;}throw _0x1efbe8;}const _0xa15eb2=[],_0x30ab81=a169_0x4d3d07({'text':_0x583c19(0x117),'color':_0x583c19(0x11c)})['start'](),_0x2d9ce0=execConfigMigration(_0x12e43a,_0x1f3fd8);_0xa15eb2[_0x583c19(0xcd)](_0x2d9ce0),_0x30ab81[_0x2d9ce0['ok']?_0x583c19(0xfd):'fail'](_0x583c19(0xa5)+(_0x2d9ce0[_0x583c19(0xf9)]??(_0x2d9ce0['ok']?'done':_0x583c19(0x102))));const _0x3691c6=resolve(_0x1f3fd8,'.lovrabet'),_0x486e22=a169_0x4d3d07({'text':_0x583c19(0xb0),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)]();if(existsSync(_0x3691c6))try{rmSync(_0x3691c6,{'recursive':!![],'force':!![]}),_0x486e22[_0x583c19(0xfd)](_0x583c19(0xe3)),_0xa15eb2['push']({'step':0x2,'label':_0x583c19(0xfe),'ok':!![]});}catch(_0x19c430){_0x486e22[_0x583c19(0x113)](_0x583c19(0x100)+_0x19c430[_0x583c19(0xd0)]),_0xa15eb2[_0x583c19(0xcd)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x19c430['message']});}else _0x486e22[_0x583c19(0xba)](_0x583c19(0xe9)),_0xa15eb2[_0x583c19(0xcd)]({'step':0x2,'label':_0x583c19(0xfe),'ok':!![],'detail':_0x583c19(0xbd)});const _0x83059d=a169_0x4d3d07({'text':_0x583c19(0xb2),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)](),_0x4f1947=execRemoveOldArtifacts(_0x12e43a[_0x583c19(0xdd)]);_0xa15eb2[_0x583c19(0xcd)](_0x4f1947),_0x83059d[_0x4f1947['ok']?'succeed':'fail'](_0x583c19(0xd3)+(_0x4f1947['detail']??(_0x4f1947['ok']?_0x583c19(0x10d):_0x583c19(0x102))));const _0x2a4661=a169_0x4d3d07({'text':_0x583c19(0xb5),'color':_0x583c19(0x11c)})['start'](),_0x1ce3bb=execCleanMcp(_0x12e43a);_0xa15eb2[_0x583c19(0xcd)](_0x1ce3bb),_0x2a4661[_0x1ce3bb['ok']?_0x583c19(0xfd):'fail'](_0x583c19(0xa4)+(_0x1ce3bb[_0x583c19(0xf9)]??(_0x1ce3bb['ok']?'done':'failed')));const _0x29e034=a169_0x4d3d07({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x583c19(0x11c)})['start'](),_0x4e8c94=execSkillsRemove(_0x1f3fd8,_0x3e39b9);_0xa15eb2[_0x583c19(0xcd)](_0x4e8c94),_0x29e034[_0x4e8c94['ok']?_0x583c19(0xfd):_0x583c19(0x113)](_0x583c19(0xc5)+(_0x4e8c94[_0x583c19(0xf9)]??(_0x4e8c94['ok']?_0x583c19(0x10d):_0x583c19(0x102))));const _0xc9dab=a169_0x4d3d07({'text':_0x583c19(0xa6),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)](),_0x4f57c1=execSkillsAdd(_0x1f3fd8,_0x3e39b9);_0xa15eb2['push'](_0x4f57c1),_0xc9dab[_0x4f57c1['ok']?_0x583c19(0xfd):'fail'](_0x583c19(0x98)+(_0x4f57c1[_0x583c19(0xf9)]??(_0x4f57c1['ok']?_0x583c19(0x10d):_0x583c19(0x102))));const _0x4e97ec=a169_0x4d3d07({'text':_0x583c19(0xeb),'color':_0x583c19(0x11c)})[_0x583c19(0xf3)](),_0x3bbd93=execUpgradeSdk(_0x12e43a);_0xa15eb2[_0x583c19(0xcd)](_0x3bbd93),_0x4e97ec[_0x3bbd93['ok']?_0x583c19(0xfd):_0x583c19(0x113)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x3bbd93[_0x583c19(0xf9)]??(_0x3bbd93['ok']?_0x583c19(0x10d):_0x583c19(0x102)))),printSummary(_0xa15eb2);const _0x5d4f5c=_0xa15eb2['some'](_0x3cd3ea=>!_0x3cd3ea['ok']);_0x5d4f5c?console['log'](a169_0xda8879[_0x583c19(0xa0)](_0x583c19(0xdb))):console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0xff)](_0x583c19(0xd1))),_0x3bbd93['ok']&&_0x12e43a[_0x583c19(0xd7)]&&(console[_0x583c19(0xac)](''),console[_0x583c19(0xac)](a169_0xda8879['bold']['cyan'](_0x583c19(0xe8))),console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0x11c)](_0x583c19(0xed))),console[_0x583c19(0xac)](''),console[_0x583c19(0xac)](a169_0xda8879[_0x583c19(0xc6)]('\x20\x20npm\x20install')),console['log'](a169_0xda8879[_0x583c19(0xc6)](_0x583c19(0xa1))),console[_0x583c19(0xac)](a169_0xda8879['white']('\x20\x20bun\x20install')),console[_0x583c19(0xac)](''));}