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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +8 -4
  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_0x51cb95=a157_0x5362;(function(_0x18707e,_0x5b8411){const _0x1243ac=a157_0x5362,_0x11f075=_0x18707e();while(!![]){try{const _0x3b40d7=parseInt(_0x1243ac(0x181))/0x1*(parseInt(_0x1243ac(0x17c))/0x2)+-parseInt(_0x1243ac(0x175))/0x3*(-parseInt(_0x1243ac(0x182))/0x4)+-parseInt(_0x1243ac(0x191))/0x5*(parseInt(_0x1243ac(0x18b))/0x6)+parseInt(_0x1243ac(0x188))/0x7+parseInt(_0x1243ac(0x187))/0x8*(parseInt(_0x1243ac(0x196))/0x9)+parseInt(_0x1243ac(0x192))/0xa+-parseInt(_0x1243ac(0x17a))/0xb;if(_0x3b40d7===_0x5b8411)break;else _0x11f075['push'](_0x11f075['shift']());}catch(_0x25452a){_0x11f075['push'](_0x11f075['shift']());}}}(a157_0x3c04,0x57743));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a157_0x5362(_0xac31ed,_0x642382){_0xac31ed=_0xac31ed-0x16d;const _0x3c048b=a157_0x3c04();let _0x53621b=_0x3c048b[_0xac31ed];return _0x53621b;}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_0x51cb95(0x16f);async function buildPlan(_0xa3cf05,_0x4c1844){const _0x5ef804=a157_0x51cb95,_0x162d07=await resolveRoleRef(_0xa3cf05['appCode'],readRoleRef(_0xa3cf05));assertPermConfigurable(_0x162d07);const _0x95a274=readGrantRevoke(_0xa3cf05),_0xfb726a=splitList(_0xa3cf05[_0x5ef804(0x178)]('menus'));if(_0xfb726a[_0x5ef804(0x18c)]===0x0)throw CliErrors['flagMissing'](_0x5ef804(0x193),'Pass\x20--menus\x20<resourceCode,...>.');const _0x9193da=await getRoleMenuResources(_0xa3cf05[_0x5ef804(0x16e)],_0x162d07['id']),_0x4c014b=flattenMenuResources(_0x9193da),_0x3801ea=_0xfb726a[_0x5ef804(0x180)](_0x539576=>!_0x4c014b[_0x5ef804(0x171)](_0x539576));if(_0x3801ea[_0x5ef804(0x18c)]>0x0)throw CliErrors[_0x5ef804(0x190)](_0x5ef804(0x17d)+_0x3801ea[_0x5ef804(0x177)](',\x20')+'.',_0x5ef804(0x17b));const _0x34e463=new Map(),_0x5cf519=[],_0x302c3b=[];for(const _0x28680e of _0xfb726a){const _0x3511f0=_0x4c014b[_0x5ef804(0x18f)](_0x28680e);_0x34e463[_0x5ef804(0x17e)](_0x28680e,_0x95a274),_0x5cf519[_0x5ef804(0x18d)]({'resourceCode':_0x28680e,'action':_0x3511f0[_0x5ef804(0x18e)]}),_0x302c3b[_0x5ef804(0x18d)]({'resourceCode':_0x28680e,'action':_0x95a274});}const _0x1b990d=buildPermits(_0x4c014b,_0x34e463),_0x17faef={'operation':_0x95a274===_0x5ef804(0x170)?_0x5ef804(0x183):_0x5ef804(0x195),'selector':{'appCode':_0xa3cf05[_0x5ef804(0x16e)],'roleId':_0x162d07['id'],'roleName':_0x162d07['roleName'],'resourceCodes':_0xfb726a},'before':_0x5cf519,'after':_0x302c3b,'dryRun':_0x4c1844,'backend':{'method':_0x5ef804(0x189),'path':UPDATE_PATH,'roleType':_0x5ef804(0x172)},'warnings':[]};return{'role':_0x162d07,'permits':_0x1b990d,'mutation':_0x17faef};}function a157_0x3c04(){const _0x210c65=['Pass\x20--menus\x20<resourceCode,...>.','\x20menu\x20permit(s)\x20for\x20role\x20','297435bwrYAk','role-menus-set','join','str','resourceCodes','6016241odvceo','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','5042EqpbOI','Unknown\x20menu\x20resourceCode(s):\x20','set','Updated\x20','filter','5GSEwcC','12VQTdLP','menu-grant','high-risk-write','roleName','flagMissing','56RfnwdB','51296WpGMdr','POST','selector','75534XziPPA','length','push','action','get','validation','25reaNaG','6432500NdpRqM','menus','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','menu-revoke','9603FObFJn','permit','appCode','/smartapi/permit/role/update','access','has','PAGE'];a157_0x3c04=function(){return _0x210c65;};return a157_0x3c04();}export const permitRoleMenusSet={'service':a157_0x51cb95(0x16d),'command':a157_0x51cb95(0x176),'description':a157_0x51cb95(0x194),'risk':a157_0x51cb95(0x184),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x55dfb6){const _0x2c3795=a157_0x51cb95;readGrantRevoke(_0x55dfb6);if(splitList(_0x55dfb6[_0x2c3795(0x178)](_0x2c3795(0x193)))[_0x2c3795(0x18c)]===0x0)throw CliErrors[_0x2c3795(0x186)]('menus',_0x2c3795(0x173));},async 'dryRun'(_0x194130){const _0x431723=a157_0x51cb95,{mutation:_0x588d67}=await buildPlan(_0x194130,!![]);return asDryRunResult(_0x588d67,{'method':_0x431723(0x189),'url':UPDATE_PATH});},async 'execute'(_0x24ec07){const _0xf2b5f6=a157_0x51cb95,{role:_0x1435c6,permits:_0x2011c0,mutation:_0x4696b0}=await buildPlan(_0x24ec07,![]);return await updateAppRole({'id':_0x1435c6['id'],'appCode':_0x24ec07[_0xf2b5f6(0x16e)],'roleType':_0xf2b5f6(0x172),'permits':_0x2011c0}),{'ok':!![],'data':_0x4696b0,'message':_0xf2b5f6(0x17f)+_0x4696b0[_0xf2b5f6(0x18a)][_0xf2b5f6(0x179)][_0xf2b5f6(0x18c)]+_0xf2b5f6(0x174)+_0x1435c6[_0xf2b5f6(0x185)]};}};
@@ -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
+ const a158_0x494872=a158_0x1e37;(function(_0x3ac7da,_0x45152d){const _0x15cf5a=a158_0x1e37,_0x15244c=_0x3ac7da();while(!![]){try{const _0x40a61b=parseInt(_0x15cf5a(0x10b))/0x1*(-parseInt(_0x15cf5a(0x107))/0x2)+parseInt(_0x15cf5a(0x119))/0x3+parseInt(_0x15cf5a(0x111))/0x4+-parseInt(_0x15cf5a(0x10e))/0x5*(parseInt(_0x15cf5a(0x11f))/0x6)+parseInt(_0x15cf5a(0x115))/0x7*(-parseInt(_0x15cf5a(0x116))/0x8)+parseInt(_0x15cf5a(0x11a))/0x9+-parseInt(_0x15cf5a(0x113))/0xa*(parseInt(_0x15cf5a(0x11e))/0xb);if(_0x40a61b===_0x45152d)break;else _0x15244c['push'](_0x15244c['shift']());}catch(_0x238e51){_0x15244c['push'](_0x15244c['shift']());}}}(a158_0x46c9,0xc4865));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_0x1e37(_0x18a08b,_0x24330e){_0x18a08b=_0x18a08b-0x107;const _0x46c927=a158_0x46c9();let _0x1e3727=_0x46c927[_0x18a08b];return _0x1e3727;}export const permitRoleMenus={'service':'permit','command':'role-menus','description':a158_0x494872(0x114),'risk':'read','flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x1f7109){const _0x32db7b=a158_0x494872,_0x5fd7d6=await resolveRoleRef(_0x1f7109[_0x32db7b(0x109)],readRoleRef(_0x1f7109)),_0x2effaf=await getRoleMenuResources(_0x1f7109[_0x32db7b(0x109)],_0x5fd7d6['id']),_0x46b297=flattenMenuResources(_0x2effaf),_0x3794d4=Array[_0x32db7b(0x112)](_0x46b297[_0x32db7b(0x110)]())[_0x32db7b(0x10a)](_0x3e52e2=>({'resourceCode':_0x3e52e2[_0x32db7b(0x108)],'resourceName':_0x3e52e2['resourceName'],'allowed':_0x3e52e2[_0x32db7b(0x11b)]===_0x32db7b(0x118),'action':_0x3e52e2[_0x32db7b(0x11b)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x1f7109[_0x32db7b(0x109)],'roleId':_0x5fd7d6['id'],'roleName':_0x5fd7d6['roleName']},'menus':_0x3794d4},'message':_0x32db7b(0x11d)+_0x5fd7d6[_0x32db7b(0x10d)]+_0x32db7b(0x10f)+_0x3794d4[_0x32db7b(0x10c)](_0x1eced5=>_0x1eced5[_0x32db7b(0x11c)])[_0x32db7b(0x117)]+'/'+_0x3794d4['length']+_0x32db7b(0x120)};}};function a158_0x46c9(){const _0x1d870e=['14071734ItqRuj','action','allowed','Role\x20','2926rriQGP','19518mFIDUJ','\x20menu(s)\x20allowed','4dRzGCU','resourceCode','appCode','map','204521puTZxp','filter','roleName','270pinKmr','\x20has\x20','values','1605124HNNGMV','from','18220taEiHG','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','6154729RcGLdY','8Zeypop','length','access','2366283IhXAeM'];a158_0x46c9=function(){return _0x1d870e;};return a158_0x46c9();}
@@ -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_0x2f831e=a159_0x1b0c;(function(_0x3b7050,_0x4b271b){const _0x3592f8=a159_0x1b0c,_0x2be82d=_0x3b7050();while(!![]){try{const _0x445217=-parseInt(_0x3592f8(0x170))/0x1+-parseInt(_0x3592f8(0x192))/0x2*(-parseInt(_0x3592f8(0x16b))/0x3)+parseInt(_0x3592f8(0x179))/0x4*(-parseInt(_0x3592f8(0x188))/0x5)+-parseInt(_0x3592f8(0x17d))/0x6+-parseInt(_0x3592f8(0x17e))/0x7+-parseInt(_0x3592f8(0x16d))/0x8*(-parseInt(_0x3592f8(0x1af))/0x9)+parseInt(_0x3592f8(0x176))/0xa*(parseInt(_0x3592f8(0x189))/0xb);if(_0x445217===_0x4b271b)break;else _0x2be82d['push'](_0x2be82d['shift']());}catch(_0x39b43c){_0x2be82d['push'](_0x2be82d['shift']());}}}(a159_0x35f1,0x4b7fd));import{listPermitRoles}from'../../core/api-client.js';function a159_0x1b0c(_0x11a13e,_0x20a7a2){_0x11a13e=_0x11a13e-0x167;const _0x35f1f6=a159_0x35f1();let _0x1b0c25=_0x35f1f6[_0x11a13e];return _0x1b0c25;}import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a159_0x2f831e(0x16a),'type':a159_0x2f831e(0x1ba),'required':!![],'description':'Menu\x20id\x20(from\x20`menu\x20list`)'};export const ROLE_REF_FLAG={'name':a159_0x2f831e(0x187),'type':'string','required':!![],'description':a159_0x2f831e(0x18c)};export const GRANT_FLAG={'name':a159_0x2f831e(0x1b1),'type':'boolean','required':![],'description':a159_0x2f831e(0x1a1)};export const REVOKE_FLAG={'name':a159_0x2f831e(0x19f),'type':a159_0x2f831e(0x199),'required':![],'description':a159_0x2f831e(0x167)};export const MENUS_FLAG={'name':a159_0x2f831e(0x1b2),'type':a159_0x2f831e(0x197),'required':!![],'description':a159_0x2f831e(0x184)};export const DATASETS_FLAG={'name':a159_0x2f831e(0x1ad),'type':'string','required':!![],'description':'Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for'};export const PAGE_SLOT_SPECS=[{'flag':a159_0x2f831e(0x182),'key':'menuPermit','allowSelf':![],'label':a159_0x2f831e(0x183)},{'flag':a159_0x2f831e(0x1aa),'key':a159_0x2f831e(0x18a),'allowSelf':![],'label':'data\x20create'},{'flag':a159_0x2f831e(0x18f),'key':'dataUpdate','allowSelf':![],'label':a159_0x2f831e(0x19a)},{'flag':a159_0x2f831e(0x177),'key':a159_0x2f831e(0x169),'allowSelf':![],'label':'data\x20delete'},{'flag':a159_0x2f831e(0x17b),'key':a159_0x2f831e(0x1a6),'allowSelf':![],'label':a159_0x2f831e(0x1b0)},{'flag':'export-roles','key':'dataExport','allowSelf':![],'label':'data\x20export'},{'flag':a159_0x2f831e(0x1b3),'key':'dataPermit','allowSelf':!![],'label':'row\x20visibility'}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a159_0x2f831e(0x191)](_0x2bf93c=>({'name':_0x2bf93c[a159_0x2f831e(0x1a2)],'type':a159_0x2f831e(0x197),'required':![],'description':a159_0x2f831e(0x19e)+_0x2bf93c[a159_0x2f831e(0x19d)]+a159_0x2f831e(0x1b7)+(_0x2bf93c['allowSelf']?a159_0x2f831e(0x18b):'')}));export function splitList(_0x47d334){const _0x5c4fb1=a159_0x2f831e;return _0x47d334[_0x5c4fb1(0x19b)](',')['map'](_0x1805fb=>_0x1805fb['trim']())[_0x5c4fb1(0x19c)](Boolean);}export function projectRoleRef(_0x53f90e){const _0x3c4b0d=a159_0x2f831e;return{'id':_0x53f90e['id'],'roleName':_0x53f90e[_0x3c4b0d(0x1b8)],'roleType':_0x53f90e['roleType']};}export async function resolvePermitRoles(_0x455209,_0x47c8be,_0x404ec1){const _0x1df7b1=a159_0x2f831e,_0x53524c=await listPermitRoles(_0x455209,{'needSelf':!![],'needPublic':!![]}),_0x166564=[];for(const _0x16b8a5 of _0x47c8be){const _0x927953=resolveOnePermitRole(_0x53524c,_0x16b8a5);if(!_0x404ec1['allowSelf']&&_0x927953[_0x1df7b1(0x1a3)]===_0x1df7b1(0x1a5))throw CliErrors['validation'](_0x1df7b1(0x178)+_0x404ec1[_0x1df7b1(0x19d)]+'.',_0x1df7b1(0x168));if(!_0x166564[_0x1df7b1(0x1b9)](_0x26f2c5=>_0x26f2c5['id']===_0x927953['id']))_0x166564[_0x1df7b1(0x17a)](_0x927953);}return _0x166564;}function resolveOnePermitRole(_0x2af301,_0x2ed1c7){const _0x6bfe=a159_0x2f831e,_0x4a1ee8=_0x2ed1c7['trim'](),_0x329305=_0x4a1ee8[_0x6bfe(0x172)]();if(_0x329305===_0x6bfe(0x1a5)||_0x329305==='ALL'){const _0x687455=_0x2af301[_0x6bfe(0x16f)](_0x4e5bdc=>_0x4e5bdc[_0x6bfe(0x1a3)]===_0x329305);if(!_0x687455)throw CliErrors[_0x6bfe(0x1b5)]('Special\x20role\x20'+_0x329305+'\x20is\x20not\x20available\x20for\x20this\x20app.');return _0x687455;}if(/^-?\d+$/[_0x6bfe(0x1a8)](_0x4a1ee8)){const _0x3b9b30=Number(_0x4a1ee8),_0x3505c3=_0x2af301[_0x6bfe(0x16f)](_0x58ada8=>_0x58ada8['id']===_0x3b9b30);if(!_0x3505c3)throw CliErrors['validation'](_0x6bfe(0x16e)+_0x3b9b30+_0x6bfe(0x196),_0x6bfe(0x180));return _0x3505c3;}const _0x1cc53c=_0x2af301[_0x6bfe(0x19c)](_0x241e64=>_0x241e64[_0x6bfe(0x1b8)]===_0x4a1ee8);if(_0x1cc53c[_0x6bfe(0x18d)]===0x0)throw CliErrors[_0x6bfe(0x1b5)](_0x6bfe(0x175)+_0x4a1ee8+_0x6bfe(0x181),_0x6bfe(0x1a9));if(_0x1cc53c[_0x6bfe(0x18d)]>0x1)throw CliErrors['validation'](_0x6bfe(0x175)+_0x4a1ee8+_0x6bfe(0x174)+_0x1cc53c[_0x6bfe(0x191)](_0x6abdca=>_0x6abdca['id'])['join'](',\x20')+').','Disambiguate\x20with\x20an\x20id.');return _0x1cc53c[0x0];}export function projectPageSlot(_0x4d8da9){const _0x38139c=a159_0x2f831e;if(!_0x4d8da9)return null;return{'resourceCode':_0x4d8da9[_0x38139c(0x1a7)],'roles':(_0x4d8da9[_0x38139c(0x1b4)]??[])[_0x38139c(0x191)](projectRoleRef)};}export function projectPagePermit(_0x309d3f){const _0x75ce7e=a159_0x2f831e,_0x28c6c2={'menuId':_0x309d3f[_0x75ce7e(0x17f)],'appCode':_0x309d3f[_0x75ce7e(0x194)],'menuPermit':projectPageSlot(_0x309d3f[_0x75ce7e(0x185)])};for(const _0x1a4453 of PAGE_SLOT_SPECS){if(_0x1a4453[_0x75ce7e(0x1ac)]===_0x75ce7e(0x185))continue;_0x28c6c2[_0x1a4453['key']]=projectPageSlot(_0x309d3f[_0x1a4453[_0x75ce7e(0x1ac)]]);}return _0x28c6c2;}function a159_0x35f1(){const _0x59278f=['set','toUpperCase','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','\x22\x20is\x20ambiguous\x20(ids:\x20','Role\x20\x22','1130iOYRSp','delete-roles','SELF\x20is\x20not\x20allowed\x20for\x20','219280YmYLOh','push','detail-roles','pageNodeList','3181404VurKvm','1530347uDoGKX','menuId','Run\x20`role\x20list`.','\x22\x20not\x20found.','menu-roles','menu\x20visibility','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','menuPermit','allowedActions','role','5oFFnUC','39743cvrXso','dataCreate',';\x20SELF\x20=\x20only\x20own\x20rows','Role\x20id\x20or\x20role\x20name','length','Pass\x20--role\x20<id|name>.','update-roles','access','map','292CxHbqK','apiList','appCode','bool','\x20not\x20found.','string','get','boolean','data\x20update','split','filter','label','Roles\x20for\x20','revoke','str','Grant\x20access\x20to\x20the\x20listed\x20resources','flag','roleType','resourceName','SELF','dataDetail','resourceCode','test','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','create-roles','Missing\x20action.','key','datasets','action','927XZTDUY','data\x20detail','grant','menus','row-roles','rolePermit','validation','datasetCode','\x20(comma-separated\x20SELF/ALL/id/name)','roleName','some','number','Revoke\x20access\x20to\x20the\x20listed\x20resources','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','dataDelete','menu-id','9510itOUZZ','trim','41744tDMjqT','Role\x20id\x20','find','295623ykoWFq'];a159_0x35f1=function(){return _0x59278f;};return a159_0x35f1();}export function flattenMenuResources(_0x19bd4a){const _0x186eeb=new Map(),_0x2fb18d=_0x230427=>{const _0x4f404b=a159_0x1b0c;for(const _0x347364 of _0x230427??[]){_0x186eeb[_0x4f404b(0x171)](_0x347364[_0x4f404b(0x1a7)],{'resourceCode':_0x347364['resourceCode'],'resourceName':_0x347364[_0x4f404b(0x1a4)],'action':_0x347364[_0x4f404b(0x186)]?.[0x0]??'0'});if(_0x347364[_0x4f404b(0x17c)])_0x2fb18d(_0x347364['pageNodeList']);}};return _0x2fb18d(_0x19bd4a),_0x186eeb;}export function flattenApiResources(_0x9ec99b){const _0x59c6cf=a159_0x2f831e,_0x31b960=new Map(),_0x30df6a=new Map();for(const _0x554858 of _0x9ec99b){const _0x473425=_0x554858[_0x59c6cf(0x193)]??{};for(const [_0x35a3c8,_0x329918]of Object['entries'](_0x473425)){_0x31b960[_0x59c6cf(0x171)](_0x35a3c8,{'resourceCode':_0x35a3c8,'resourceName':_0x554858[_0x59c6cf(0x1a4)],'datasetCode':_0x554858[_0x59c6cf(0x1b6)],'action':_0x329918?.[0x0]??'0'});const _0x50a327=_0x30df6a[_0x59c6cf(0x198)](_0x554858[_0x59c6cf(0x1b6)])??[];_0x50a327[_0x59c6cf(0x17a)](_0x35a3c8),_0x30df6a[_0x59c6cf(0x171)](_0x554858[_0x59c6cf(0x1b6)],_0x50a327);}}return{'byCode':_0x31b960,'byDataset':_0x30df6a};}export function buildPermits(_0x43089d,_0x448dc3){const _0x40d52c=a159_0x2f831e,_0x3b67c3={};for(const [_0x1bd287,_0x2cb1e5]of _0x43089d){const _0x1d98a1=_0x448dc3[_0x40d52c(0x198)](_0x1bd287)??_0x2cb1e5[_0x40d52c(0x1ae)];_0x3b67c3[_0x1bd287]=[_0x1d98a1];}return _0x3b67c3;}export function readRoleRef(_0x3c85f8){const _0xb15664=a159_0x2f831e,_0x152aea=_0x3c85f8[_0xb15664(0x1a0)]('role')[_0xb15664(0x16c)]();if(!_0x152aea)throw CliErrors['flagMissing'](_0xb15664(0x187),_0xb15664(0x18e));return _0x152aea;}export function readGrantRevoke(_0x1b183a){const _0x17eea6=a159_0x2f831e,_0x432c51=_0x1b183a[_0x17eea6(0x195)](_0x17eea6(0x1b1)),_0xb86f08=_0x1b183a['bool'](_0x17eea6(0x19f));if(_0x432c51&&_0xb86f08)throw CliErrors[_0x17eea6(0x1b5)]('--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.');if(!_0x432c51&&!_0xb86f08)throw CliErrors['validation'](_0x17eea6(0x1ab),_0x17eea6(0x173));return _0x432c51?_0x17eea6(0x190):'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(_0x55ccac,_0x1e3c36){const _0x2ce62a=a160_0x2396,_0x576281=_0x55ccac();while(!![]){try{const _0x4de729=-parseInt(_0x2ce62a(0xa6))/0x1+-parseInt(_0x2ce62a(0xb8))/0x2+parseInt(_0x2ce62a(0xc1))/0x3*(parseInt(_0x2ce62a(0xb9))/0x4)+-parseInt(_0x2ce62a(0xbd))/0x5+parseInt(_0x2ce62a(0xc0))/0x6+-parseInt(_0x2ce62a(0xa7))/0x7+parseInt(_0x2ce62a(0xb3))/0x8;if(_0x4de729===_0x1e3c36)break;else _0x576281['push'](_0x576281['shift']());}catch(_0x53add6){_0x576281['push'](_0x576281['shift']());}}}(a160_0x1f1f,0x20ecc));import{existsSync}from'node:fs';import a160_0x1a1b0e from'node:path';import a160_0x574de8 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a160_0x1f1f(){const _0x5b81a4=['1140295PvKwEQ','string','Skipped','1036812aGkrVc','6oevGUG','140982LkolWk','1208529fLxHFV','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','length','cwd','production','Project\x20name:','cyan','Directory\x20\x22','env','green','\x22\x20already\x20exists','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','5227440GDZsYX','Logged\x20in','Project\x20name\x20cannot\x20exceed\x2050\x20characters','Not\x20set','Login\x20failed','484244JNnhaX','184876scVqrk','test','log','trim'];a160_0x1f1f=function(){return _0x5b81a4;};return a160_0x1f1f();}function a160_0x2396(_0x5804fe,_0x508b63){_0x5804fe=_0x5804fe-0xa6;const _0x1f1fdb=a160_0x1f1f();let _0x2396f9=_0x1f1fdb[_0x5804fe];return _0x2396f9;}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(_0x5acf61,_0x248a03,_0xf21893){const _0x3f8e9b=a160_0x2396,_0x32b628='my-app',_0xcebacc=readConfig(),_0x4a2e2b=typeof _0xcebacc[_0x3f8e9b(0xaf)]===_0x3f8e9b(0xbe)?_0xcebacc[_0x3f8e9b(0xaf)]:undefined,_0x2022bb=await input({'message':_0x3f8e9b(0xac),'default':_0x32b628,'validate':_0x4dfa42=>{const _0x57e7dd=_0x3f8e9b,_0x400761=_0x4dfa42[_0x57e7dd(0xbc)]()||_0x32b628;if(_0x400761[_0x57e7dd(0xa9)]>0x32)return _0x57e7dd(0xb5);const _0x54b43d=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x400761&&!_0x54b43d[_0x57e7dd(0xba)](_0x400761))return _0x57e7dd(0xb2);const _0x4cc736=a160_0x1a1b0e['resolve'](process[_0x57e7dd(0xaa)](),_0x400761);if(existsSync(_0x4cc736))return _0x57e7dd(0xae)+_0x400761+_0x57e7dd(0xb1);return!![];}});console['log'](a160_0x574de8[_0x3f8e9b(0xb0)]('√\x20Project\x20Name:\x20'+a160_0x574de8['cyan'](_0x2022bb)));const _0x2dd0ef=await selectSingleAppcode(_0xf21893);console[_0x3f8e9b(0xbb)](a160_0x574de8[_0x3f8e9b(0xb0)]('√\x20App\x20Code:\x20'+a160_0x574de8['cyan'](_0x2dd0ef||_0x3f8e9b(0xb6))));if(_0x2dd0ef){const _0x43b17a=await getIsSessionValid();if(!_0x43b17a){const _0x107b88=await confirm({'message':_0x3f8e9b(0xa8),'default':!![]});if(_0x107b88){const _0x30d4df=await authServer({'silent':!![]});console[_0x3f8e9b(0xbb)](a160_0x574de8[_0x3f8e9b(0xb0)]('√\x20Login\x20status:\x20'+a160_0x574de8[_0x3f8e9b(0xad)](_0x30d4df?_0x3f8e9b(0xb4):_0x3f8e9b(0xb7))));}else console[_0x3f8e9b(0xbb)](a160_0x574de8[_0x3f8e9b(0xb0)]('√\x20Login\x20status:\x20'+a160_0x574de8['cyan'](_0x3f8e9b(0xbf))));}await _0x5acf61({'projectName':_0x2022bb,'appCode':_0x2dd0ef,'env':_0x248a03||_0x4a2e2b||_0x3f8e9b(0xab)});}else await _0x5acf61({'projectName':_0x2022bb,'env':_0x248a03||_0x4a2e2b||_0x3f8e9b(0xab)});}
@@ -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(_0x16fd5c,_0x2201ef){const _0x4e874e=a161_0x1774,_0x316b84=_0x16fd5c();while(!![]){try{const _0x131000=-parseInt(_0x4e874e(0x17d))/0x1+parseInt(_0x4e874e(0x185))/0x2*(parseInt(_0x4e874e(0x186))/0x3)+-parseInt(_0x4e874e(0x183))/0x4+parseInt(_0x4e874e(0x180))/0x5*(parseInt(_0x4e874e(0x187))/0x6)+parseInt(_0x4e874e(0x184))/0x7*(parseInt(_0x4e874e(0x17e))/0x8)+-parseInt(_0x4e874e(0x17c))/0x9*(-parseInt(_0x4e874e(0x181))/0xa)+-parseInt(_0x4e874e(0x17b))/0xb*(parseInt(_0x4e874e(0x17f))/0xc);if(_0x131000===_0x2201ef)break;else _0x316b84['push'](_0x316b84['shift']());}catch(_0x51ed01){_0x316b84['push'](_0x316b84['shift']());}}}(a161_0x4bae,0x77cad));function a161_0x4bae(){const _0xf23a36=['4590rxvHsD','579716lrrhIJ','1560ukdQzf','12KNjVNz','525SVjqnU','2480VYPLYJ','now','2221856WwfcbT','14889RvrmWX','79714UZljnO','60jeqtaD','52404Gbzlez','6925666lKAYMi'];a161_0x4bae=function(){return _0xf23a36;};return a161_0x4bae();}function a161_0x1774(_0x21ef58,_0x53e164){_0x21ef58=_0x21ef58-0x17b;const _0x4bae07=a161_0x4bae();let _0x17742a=_0x4bae07[_0x21ef58];return _0x17742a;}export function formatElapsed(_0x46bcfe){const _0x49f90f=a161_0x1774,_0x3c17dc=Date[_0x49f90f(0x182)]()-_0x46bcfe;if(_0x3c17dc<0x3e8)return _0x3c17dc+'ms';const _0x313321=(_0x3c17dc/0x3e8)['toFixed'](0x2),_0x1cd9db=_0x313321['replace'](/\.?0+$/u,'');return _0x1cd9db+'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(_0x226e70,_0x478c99){const _0x35341f=a162_0xa2c6,_0x36e9b2=_0x226e70();while(!![]){try{const _0x8c270e=-parseInt(_0x35341f(0xc9))/0x1+-parseInt(_0x35341f(0x82))/0x2+-parseInt(_0x35341f(0x88))/0x3*(parseInt(_0x35341f(0x9b))/0x4)+-parseInt(_0x35341f(0xc1))/0x5+parseInt(_0x35341f(0x9f))/0x6*(-parseInt(_0x35341f(0xac))/0x7)+parseInt(_0x35341f(0xb0))/0x8*(-parseInt(_0x35341f(0xc0))/0x9)+parseInt(_0x35341f(0xc4))/0xa*(parseInt(_0x35341f(0x8d))/0xb);if(_0x8c270e===_0x478c99)break;else _0x36e9b2['push'](_0x36e9b2['shift']());}catch(_0x24be0e){_0x36e9b2['push'](_0x36e9b2['shift']());}}}(a162_0x4dd2,0xaf1b2));import a162_0x55d428 from'path';import a162_0x35706e from'fs';function a162_0xa2c6(_0x1b6adc,_0x571588){_0x1b6adc=_0x1b6adc-0x78;const _0x4dd290=a162_0x4dd2();let _0xa2c6f9=_0x4dd290[_0x1b6adc];return _0xa2c6f9;}import a162_0x5ed980 from'chalk';import a162_0x324d6d 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';function a162_0x4dd2(){const _0x7e819a=['error','rmSync','cookie','fail','\x20run\x20start','257509zUvLfA','dirname','Project\x20directory\x20','更新\x20package.json\x20name','11240rOxSbQ','resolve','Install\x20dependencies','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','CLI\x20版本检查','projectCode','modelCount','Format\x20code','keys','stop','gray','*\x20Configuring\x20AppCode\x20for\x20project\x20','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','cwd','name','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','6597NAeXic','393605ZvEuNk','W_OK','length','180VPTPYl','log','string','√\x20Pulled\x20','\x20\x202.\x20Pull\x20API\x20configuration:\x20','859044HdHkZP','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','\x20|\x20AppCode:\x20','\x20√\x20','toLocaleString','info','更新\x20package.json\x20失败','...','cyan','repeat','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','stringify','production','配置应用AppCode失败','Project\x20name:\x20','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','\x20\x201.\x20Start\x20project:\x20','join','start','message','constants','readFileSync','green','version','🚀\x20Next\x20Steps:','description','writeFileSync','1017730sMhFIk','*\x20Pulling\x20API\x20configuration...','1.0.0','env','trim','projectName','888ZPlfaZ','parse','√\x20package.json\x20updated:\x20name=','项目创建失败:\x20','accessSync','2424807CuuLaj','\x20api\x20pull','utf8','apps','appCode','success','package.json','\x20&&\x20','API\x20configuration\x20pulled:\x20','cd\x20','belowMinimum','Project\x20name\x20cannot\x20be\x20empty','currentVersion','开始创建项目:\x20','1016eHVarD','minimumVersion','create','warn','114TVUrOm','\x20|\x20Default:\x20','chdir','\x20already\x20exists','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','\x20model(s)','√\x20Configuration\x20file\x20created,\x20Apps:\x20','\x20dataset(s),\x20generated\x20'];a162_0x4dd2=function(){return _0x7e819a;};return a162_0x4dd2();}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x5612a4){const _0x3514d0=a162_0xa2c6,_0x7302e4=await checkCliVersion();(_0x7302e4['needsUpgrade']||_0x7302e4['belowMinimum'])&&(printCliUpgradeWarning(_0x7302e4),assertCliVersionSupported(_0x7302e4),logger[_0x3514d0(0xce)](_0x3514d0(0x9d),_0x3514d0(0xb4),{'currentVersion':_0x7302e4[_0x3514d0(0x99)],'stableVersion':_0x7302e4['stableVersion'],'minimumVersion':_0x7302e4[_0x3514d0(0x9c)],'needsUpgrade':_0x7302e4['needsUpgrade'],'belowMinimum':_0x7302e4[_0x3514d0(0x97)]}));if(_0x5612a4[_0x3514d0(0xb5)]&&_0x5612a4[_0x3514d0(0x91)])await runCreate({'projectName':_0x5612a4[_0x3514d0(0xb5)],'appCode':_0x5612a4[_0x3514d0(0x91)],'env':_0x5612a4[_0x3514d0(0x85)]},_0x5612a4);else{if(_0x5612a4[_0x3514d0(0xb5)]){const _0x3795a5=await selectSingleAppcode(_0x5612a4[_0x3514d0(0xa9)]);await runCreate({'projectName':_0x5612a4[_0x3514d0(0xb5)],'appCode':_0x3795a5||undefined,'env':_0x5612a4[_0x3514d0(0x85)]},_0x5612a4);}else await guidedCreateProject(_0x985772=>runCreate(_0x985772,_0x5612a4),_0x5612a4[_0x3514d0(0x85)],_0x5612a4['cookie']);}}async function runCreate(_0x3f745f,_0x54aed4){const _0xab6e26=a162_0xa2c6;if(!_0x3f745f[_0xab6e26(0x87)]||_0x3f745f['projectName'][_0xab6e26(0x86)]()==='')throw new Error(_0xab6e26(0x98));const _0x8d1abc=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x8d1abc['test'](_0x3f745f[_0xab6e26(0x87)]))throw new Error(_0xab6e26(0xd3));if(_0x3f745f[_0xab6e26(0x87)][_0xab6e26(0xc3)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x3858f3=a162_0x55d428[_0xab6e26(0xb1)](process[_0xab6e26(0xbd)](),_0x3f745f[_0xab6e26(0x87)]);if(a162_0x35706e['existsSync'](_0x3858f3))throw new Error(_0xab6e26(0xae)+_0x3f745f[_0xab6e26(0x87)]+_0xab6e26(0xa2));try{a162_0x35706e[_0xab6e26(0x8c)](a162_0x55d428[_0xab6e26(0xad)](_0x3858f3),a162_0x35706e[_0xab6e26(0x7b)][_0xab6e26(0xc2)]);}catch{throw new Error(_0xab6e26(0xca));}logger['setLogPath'](_0x3858f3),logger[_0xab6e26(0xce)](_0xab6e26(0x9d),_0xab6e26(0x9a)+_0x3f745f[_0xab6e26(0x87)],{'projectDir':_0x3858f3,'appCode':_0x3f745f[_0xab6e26(0x91)]}),console[_0xab6e26(0xc5)](),console[_0xab6e26(0xc5)](a162_0x5ed980['green'](_0xab6e26(0xcc))+_0xab6e26(0xd7)+a162_0x5ed980['green'](_0x3f745f['projectName'])+(_0x3f745f[_0xab6e26(0x91)]?_0xab6e26(0xcb)+a162_0x5ed980[_0xab6e26(0xd1)](_0x3f745f['appCode']):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x3f745f['projectName'])),await updatePackageJsonName(_0x3f745f[_0xab6e26(0x87)]),await runTask(_0xab6e26(0xb2),()=>installDependencies(_0x3f745f[_0xab6e26(0x87)])),await runTask(_0xab6e26(0xb7),()=>formatProjectCode(_0x3f745f[_0xab6e26(0x87)])),await configureAppCode(_0x3f745f['projectName'],_0x3f745f[_0xab6e26(0x91)]||'',_0x3f745f[_0xab6e26(0x85)]);let _0xf0ac35=![];if(_0x3f745f[_0xab6e26(0x91)]){console[_0xab6e26(0xc5)](_0xab6e26(0x83));const _0x5ec1f4=process[_0xab6e26(0xbd)]();try{process[_0xab6e26(0xa1)](_0x3858f3);const _0x4ab305=_0x3f745f['env']||_0xab6e26(0xd5);initEnv(_0x4ab305);const {configArray:_0x2c3d66}=await fetchModelList(_0x3f745f[_0xab6e26(0x91)],_0x54aed4['cookie']||''),_0x413290=DEFAULT_API_DIR,_0x1943b7=await generateApiFile(_0x2c3d66,'',_0x3f745f[_0xab6e26(0x91)],!![],_0x4ab305,_0x413290);console[_0xab6e26(0xc5)](_0xab6e26(0xc7)+_0x2c3d66[_0xab6e26(0xc3)]+_0xab6e26(0xa6)+_0x1943b7[_0xab6e26(0xb6)]+_0xab6e26(0xa4)),logger[_0xab6e26(0xce)]('create',_0xab6e26(0x95)+_0x3f745f[_0xab6e26(0x91)]);}catch(_0x3aae11){_0xf0ac35=!![],console[_0xab6e26(0xc5)](_0xab6e26(0xbc)),logger[_0xab6e26(0x9e)]('create','API\x20配置拉取异常',{'error':_0x3aae11 instanceof Error?_0x3aae11[_0xab6e26(0x7a)]:String(_0x3aae11)});}finally{process['chdir'](_0x5ec1f4);}}logger[_0xab6e26(0x92)](_0xab6e26(0x9d),'项目创建完成:\x20'+_0x3f745f[_0xab6e26(0x87)]),console[_0xab6e26(0xc5)](),console[_0xab6e26(0xc5)](a162_0x5ed980['green']('─'[_0xab6e26(0xd2)](0x3c))),console['log'](a162_0x5ed980[_0xab6e26(0xd1)]['bold'](_0xab6e26(0x7f))),console['log'](),console['log'](_0xab6e26(0xd9)+a162_0x5ed980[_0xab6e26(0xd1)]['bold'](_0xab6e26(0x96)+_0x3f745f[_0xab6e26(0x87)]+_0xab6e26(0x94)+CLI_BIN_NAME+_0xab6e26(0xab))),_0xf0ac35&&console[_0xab6e26(0xc5)](_0xab6e26(0xc8)+a162_0x5ed980[_0xab6e26(0xd1)]['bold'](CLI_BIN_NAME+_0xab6e26(0x8e))),console[_0xab6e26(0xc5)](a162_0x5ed980[_0xab6e26(0x7d)]('─'[_0xab6e26(0xd2)](0x3c)));}catch(_0x3e402c){logger[_0xab6e26(0xa7)]('create',_0xab6e26(0x8b)+_0x3f745f[_0xab6e26(0x87)],{'error':_0x3e402c instanceof Error?_0x3e402c[_0xab6e26(0x7a)]:String(_0x3e402c)});try{a162_0x35706e['existsSync'](_0x3858f3)&&(console[_0xab6e26(0xc5)](_0xab6e26(0xb3)+_0x3858f3),a162_0x35706e[_0xab6e26(0xa8)](_0x3858f3,{'recursive':!![],'force':!![]}));}catch{logger[_0xab6e26(0x9e)]('create','清理项目目录失败:\x20'+_0x3858f3);}throw _0x3e402c;}}async function runTask(_0x185d3f,_0x2757dc){const _0x1a55f0=a162_0xa2c6,_0x7bfc95=a162_0x324d6d(_0x185d3f+_0x1a55f0(0xd0))[_0x1a55f0(0x79)]();try{const _0x156cc7=await _0x2757dc();_0x7bfc95[_0x1a55f0(0xb9)](),console['log'](''+a162_0x5ed980[_0x1a55f0(0x7d)](_0x1a55f0(0xcc))+_0x185d3f+'\x20'+a162_0x5ed980[_0x1a55f0(0xba)]('['+_0x156cc7+']'));}catch(_0x43fa9f){_0x7bfc95[_0x1a55f0(0xaa)](_0x185d3f);throw _0x43fa9f;}}async function updatePackageJsonName(_0x14a4bb){const _0x1d617e=a162_0xa2c6,_0xc4f4dc=a162_0x55d428[_0x1d617e(0xb1)](process['cwd'](),_0x14a4bb),_0x23bd44=a162_0x55d428[_0x1d617e(0x78)](_0xc4f4dc,_0x1d617e(0x93));try{console['log'](_0x1d617e(0xbf));const _0xee4ecd=getRabetbaseCliPackageRoot(),_0x4c000d=a162_0x55d428['join'](_0xee4ecd,_0x1d617e(0x93));let _0x5367da=_0x1d617e(0x84);try{const _0x3aa9be=JSON[_0x1d617e(0x89)](a162_0x35706e['readFileSync'](_0x4c000d,_0x1d617e(0x8f)));_0x5367da=_0x3aa9be['version']||'1.0.0';}catch{}const _0x3cb779=a162_0x35706e[_0x1d617e(0x7c)](_0x23bd44,_0x1d617e(0x8f)),_0x36e1f2=JSON[_0x1d617e(0x89)](_0x3cb779);_0x36e1f2[_0x1d617e(0xbe)]=_0x14a4bb,_0x36e1f2[_0x1d617e(0x80)]=_0x14a4bb+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x5367da,a162_0x35706e[_0x1d617e(0x81)](_0x23bd44,JSON[_0x1d617e(0xd4)](_0x36e1f2,null,0x2)+'\x0a','utf8'),console[_0x1d617e(0xc5)](_0x1d617e(0x8a)+_0x14a4bb),logger[_0x1d617e(0xce)]('create',_0x1d617e(0xaf));}catch(_0x11cfbf){logger[_0x1d617e(0xa7)](_0x1d617e(0x9d),_0x1d617e(0xcf));throw _0x11cfbf;}}async function configureAppCode(_0x3dd529,_0x8856b9,_0xb511ea){const _0x423c1e=a162_0xa2c6,_0x410fe2=a162_0x55d428[_0x423c1e(0xb1)](process[_0x423c1e(0xbd)](),_0x3dd529),_0x1d9037=a162_0x55d428[_0x423c1e(0x78)](_0x410fe2,NEW_CONFIG_NAME);try{_0x8856b9?console[_0x423c1e(0xc5)](_0x423c1e(0xbb)+_0x3dd529+':\x20'+_0x8856b9):console[_0x423c1e(0xc5)](_0x423c1e(0xa3)+_0x3dd529);const _0x53241d=getRabetbaseCliPackageRoot(),_0x285d0e=a162_0x55d428[_0x423c1e(0x78)](_0x53241d,_0x423c1e(0x93));let _0x1cf540=_0x423c1e(0x84);try{const _0x1cbd26=JSON['parse'](a162_0x35706e['readFileSync'](_0x285d0e,'utf8'));_0x1cf540=_0x1cbd26[_0x423c1e(0x7e)]||'1.0.0';}catch{}const _0x901540=readConfig(),_0x22e320=typeof _0x901540['env']===_0x423c1e(0xc6)?_0x901540[_0x423c1e(0x85)]:undefined,_0x50d6a1={};for(const _0x748996 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x901540[_0x748996]!=null)_0x50d6a1[_0x748996]=_0x901540[_0x748996];}const _0x48807b=buildCanonicalProjectConfig(_0x50d6a1,{'appCodes':_0x8856b9?[_0x8856b9]:[],'env':_0xb511ea||_0x22e320||_0x423c1e(0xd5),'metadata':{'createdAt':new Date()[_0x423c1e(0xcd)](),'version':_0x1cf540}});writeConfigFile(_0x1d9037,_0x48807b),_0x8856b9?console[_0x423c1e(0xc5)](_0x423c1e(0xa5)+Object[_0x423c1e(0xb8)](_0x48807b[_0x423c1e(0x90)]||{})[_0x423c1e(0x78)](',\x20')+_0x423c1e(0xa0)+_0x48807b['defaultApp']):console['log'](_0x423c1e(0xd8)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x423c1e(0xce)](_0x423c1e(0x9d),'配置应用AppCode:\x20'+_0x8856b9);}catch(_0x143401){logger[_0x423c1e(0xa7)]('create',_0x423c1e(0xd6));}}
@@ -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(_0x3f7c52,_0x493fda){const _0x43e60e=a163_0x20aa,_0x57f4c0=_0x3f7c52();while(!![]){try{const _0x155cab=-parseInt(_0x43e60e(0x1eb))/0x1+-parseInt(_0x43e60e(0x1f7))/0x2+parseInt(_0x43e60e(0x1f0))/0x3*(-parseInt(_0x43e60e(0x209))/0x4)+parseInt(_0x43e60e(0x204))/0x5+-parseInt(_0x43e60e(0x1f9))/0x6*(parseInt(_0x43e60e(0x20b))/0x7)+-parseInt(_0x43e60e(0x210))/0x8*(parseInt(_0x43e60e(0x203))/0x9)+parseInt(_0x43e60e(0x1ec))/0xa;if(_0x155cab===_0x493fda)break;else _0x57f4c0['push'](_0x57f4c0['shift']());}catch(_0x1ee2e3){_0x57f4c0['push'](_0x57f4c0['shift']());}}}(a163_0x199d,0x9cd3a));import a163_0x5a6aad from'path';import a163_0x475b38 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';function a163_0x20aa(_0x6fbbf,_0x4bb98d){_0x6fbbf=_0x6fbbf-0x1e1;const _0x199d82=a163_0x199d();let _0x20aa4a=_0x199d82[_0x6fbbf];return _0x20aa4a;}import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x2498af,_0x631198,_0x2745aa,_0x4c5c9d){const _0x11c6af=a163_0x20aa,_0x17526b=await checkCliVersion();(_0x17526b[_0x11c6af(0x206)]||_0x17526b['belowMinimum'])&&(printCliUpgradeWarning(_0x17526b),assertCliVersionSupported(_0x17526b));if(!_0x2498af||_0x2498af[_0x11c6af(0x1e2)]()==='')throw CliErrors['validation'](_0x11c6af(0x205));const _0x7eddaf=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x7eddaf[_0x11c6af(0x21b)](_0x2498af))throw CliErrors[_0x11c6af(0x1e9)](_0x11c6af(0x20c),_0x11c6af(0x1fd));if(_0x2498af['length']>0x64)throw CliErrors[_0x11c6af(0x1e9)](_0x11c6af(0x1ee));const _0x1f97ef=a163_0x5a6aad[_0x11c6af(0x218)](process[_0x11c6af(0x207)](),_0x2498af);if(existsSync(_0x1f97ef))throw CliErrors[_0x11c6af(0x1e9)](_0x11c6af(0x20f)+_0x2498af+_0x11c6af(0x1f2),_0x11c6af(0x21a));try{const _0x3b7bc1=a163_0x5a6aad['dirname'](_0x1f97ef);await a163_0x475b38['access'](_0x3b7bc1,a163_0x475b38['constants'][_0x11c6af(0x1f4)]);}catch{throw CliErrors[_0x11c6af(0x1e9)](_0x11c6af(0x219),_0x11c6af(0x1fe));}try{console[_0x11c6af(0x200)](_0x11c6af(0x1ef)+_0x2498af+'...');const _0x24f015=getSubAppReactDemoTemplateDir();await copyDirectory(_0x24f015,_0x1f97ef),console[_0x11c6af(0x200)](_0x11c6af(0x1e6)),await updatePackageJsonName(_0x2498af),console[_0x11c6af(0x200)](_0x11c6af(0x20a)),console['log'](_0x11c6af(0x1fa)),console['log'](_0x11c6af(0x1ff)),await formatCode(_0x1f97ef),console[_0x11c6af(0x200)](_0x11c6af(0x1e4)),await configureProject(_0x2498af,_0x2745aa,_0x631198),console[_0x11c6af(0x200)](_0x11c6af(0x212)),_0x2745aa&&await pullApiConfig(_0x1f97ef,_0x2745aa,_0x631198,_0x4c5c9d),console[_0x11c6af(0x200)](_0x11c6af(0x202)+_0x2498af+_0x11c6af(0x1f3)),console[_0x11c6af(0x200)]('\x0a\x20\x20cd\x20'+_0x2498af),console[_0x11c6af(0x200)](_0x11c6af(0x1e5));}catch(_0x4aa41a){try{existsSync(_0x1f97ef)&&await a163_0x475b38['rm'](_0x1f97ef,{'recursive':!![],'force':!![]});}catch{}throw _0x4aa41a;}}async function updatePackageJsonName(_0x4bc149){const _0x3c4e85=a163_0x20aa,_0x487df0=a163_0x5a6aad[_0x3c4e85(0x218)](process['cwd'](),_0x4bc149),_0x5b621f=a163_0x5a6aad[_0x3c4e85(0x1e7)](_0x487df0,_0x3c4e85(0x20e)),_0xa1ce46=await a163_0x475b38[_0x3c4e85(0x1f1)](_0x5b621f,_0x3c4e85(0x1ea)),_0x5b1f0e=JSON[_0x3c4e85(0x1f5)](_0xa1ce46);_0x5b1f0e[_0x3c4e85(0x211)]=_0x4bc149,_0x5b1f0e[_0x3c4e85(0x1e8)]=_0x3c4e85(0x1f6),await a163_0x475b38[_0x3c4e85(0x215)](_0x5b621f,JSON['stringify'](_0x5b1f0e,null,0x2)+'\x0a');}function detectPackageManager(){const _0x3cfc21=a163_0x20aa;try{return execSync(_0x3cfc21(0x21c),{'stdio':'ignore'}),'bun';}catch{return _0x3cfc21(0x1e1);}}async function formatCode(_0x4ce4df){const _0x512fe6=a163_0x20aa;try{await execAsync(_0x512fe6(0x216),{'cwd':_0x4ce4df});}catch{}}function a163_0x199d(){const _0x4d6a4a=['description','validation','utf-8','1117103zsigrb','42663330flYiFN','\x20\x20√\x20Pulled\x20','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','*\x20Creating\x20project\x20','877407oHKiAK','readFile','\x22\x20already\x20exists.','\x20created\x20successfully!','W_OK','parse','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','2455866AwDkhb','chdir','4475358NjvHtb','\x20\x20Installing\x20dependencies...','toLocaleString','\x20dataset(s),\x20generated\x20','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','Check\x20directory\x20permissions.','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','log','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','\x0a√\x20Project\x20','1359jCQpVz','1156510rcwwKH','Project\x20name\x20cannot\x20be\x20empty.','needsUpgrade','cwd','env','4helaEz','\x20\x20√\x20package.json\x20updated','7uhWeTh','Project\x20name\x20contains\x20invalid\x20characters.','length','package.json','Project\x20directory\x20\x22','25000yYPQnJ','name','\x20\x20√\x20Configuration\x20file\x20created','\x20model(s)','\x20\x20Pulling\x20API\x20configuration...','writeFile','bun\x20run\x20format','production','resolve','Cannot\x20create\x20project\x20in\x20current\x20directory.','Use\x20a\x20different\x20project\x20name.','test','bun\x20--version','npm','trim','string','\x20\x20√\x20Code\x20formatted','\x20\x20rabetbase\x20run\x20start\x0a','\x20\x20√\x20Project\x20template\x20created','join'];a163_0x199d=function(){return _0x4d6a4a;};return a163_0x199d();}async function configureProject(_0x32d805,_0x439782,_0x4e2236){const _0x4a1ab4=a163_0x20aa,_0x5730e3=a163_0x5a6aad['resolve'](process[_0x4a1ab4(0x207)](),_0x32d805),_0x91a148=a163_0x5a6aad['join'](_0x5730e3,NEW_CONFIG_NAME),_0x356f33=readConfig(),_0xe82ac=typeof _0x356f33[_0x4a1ab4(0x208)]===_0x4a1ab4(0x1e3)?_0x356f33['env']:undefined,_0x5aa5b1={};for(const _0x34051a of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x356f33[_0x34051a]!=null)_0x5aa5b1[_0x34051a]=_0x356f33[_0x34051a];}const _0x5d531e=buildCanonicalProjectConfig(_0x5aa5b1,{'appCodes':_0x439782?[_0x439782]:[],'env':_0x4e2236||_0xe82ac||'production','metadata':{'createdAt':new Date()[_0x4a1ab4(0x1fb)](),'version':getCliVersion()}});writeConfigFile(_0x91a148,_0x5d531e);}async function pullApiConfig(_0xa8faf,_0x57a58b,_0x1318d2,_0x3cf271){const _0x2efdc=a163_0x20aa,_0x22d15c=process['cwd']();try{process[_0x2efdc(0x1f8)](_0xa8faf);const _0x891139=_0x1318d2||_0x2efdc(0x217);initEnv(_0x891139),console['log'](_0x2efdc(0x214));const {configArray:_0x515f70}=await fetchModelList(_0x57a58b,_0x3cf271||''),_0x51e770=await generateApiFile(_0x515f70,'',_0x57a58b,!![],_0x891139,DEFAULT_API_DIR);console['log'](_0x2efdc(0x1ed)+_0x515f70[_0x2efdc(0x20d)]+_0x2efdc(0x1fc)+_0x51e770['modelCount']+_0x2efdc(0x213));}catch(_0x4e594d){console[_0x2efdc(0x200)](_0x2efdc(0x201)+CLI_BIN_NAME+'\x20api\x20pull`\x20manually\x20later.');}finally{process[_0x2efdc(0x1f8)](_0x22d15c);}}
@@ -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_0x33d3f7=a164_0x15fc;(function(_0x2b413c,_0x2fb0c3){const _0x4c7fec=a164_0x15fc,_0x13d7bc=_0x2b413c();while(!![]){try{const _0x20e80f=-parseInt(_0x4c7fec(0x14f))/0x1+-parseInt(_0x4c7fec(0x155))/0x2*(-parseInt(_0x4c7fec(0x152))/0x3)+parseInt(_0x4c7fec(0x153))/0x4+parseInt(_0x4c7fec(0x150))/0x5*(parseInt(_0x4c7fec(0x14b))/0x6)+-parseInt(_0x4c7fec(0x149))/0x7*(parseInt(_0x4c7fec(0x151))/0x8)+parseInt(_0x4c7fec(0x14a))/0x9+parseInt(_0x4c7fec(0x14d))/0xa*(-parseInt(_0x4c7fec(0x154))/0xb);if(_0x20e80f===_0x2fb0c3)break;else _0x13d7bc['push'](_0x13d7bc['shift']());}catch(_0x493b89){_0x13d7bc['push'](_0x13d7bc['shift']());}}}(a164_0x4e41,0xa625d));function a164_0x15fc(_0x336c6b,_0x5198f2){_0x336c6b=_0x336c6b-0x148;const _0x4e4116=a164_0x4e41();let _0x15fc7d=_0x4e4116[_0x336c6b];return _0x15fc7d;}import a164_0x2bd756 from'node:path';function a164_0x4e41(){const _0x292518=['670jXKXxW','400OgyLFu','3pJqnhz','1128284cZGIuK','22IBraaj','514594adBNOT','templates','join','dirname','sub-app-react-demo','9611VfuBCt','386361dqNfAa','48234pWRXOx','projects','759950FdevEL','../../../../','758342osYHpN'];a164_0x4e41=function(){return _0x292518;};return a164_0x4e41();}import{fileURLToPath}from'node:url';const __dirname=a164_0x2bd756[a164_0x33d3f7(0x158)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x3ffca0=a164_0x33d3f7;return a164_0x2bd756['resolve'](__dirname,_0x3ffca0(0x14e));}export function getSubAppReactDemoTemplateDir(){const _0x36778b=a164_0x33d3f7;return a164_0x2bd756[_0x36778b(0x157)](getRabetbaseCliPackageRoot(),_0x36778b(0x156),_0x36778b(0x14c),_0x36778b(0x148));}
@@ -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(_0x467999,_0x2de979){const _0x183c75=a165_0x5c27,_0x42c2ce=_0x467999();while(!![]){try{const _0x34f57c=-parseInt(_0x183c75(0x75))/0x1*(-parseInt(_0x183c75(0x85))/0x2)+parseInt(_0x183c75(0x78))/0x3+-parseInt(_0x183c75(0x87))/0x4*(-parseInt(_0x183c75(0x86))/0x5)+-parseInt(_0x183c75(0x83))/0x6*(parseInt(_0x183c75(0x7b))/0x7)+parseInt(_0x183c75(0x89))/0x8*(parseInt(_0x183c75(0x84))/0x9)+-parseInt(_0x183c75(0x88))/0xa+-parseInt(_0x183c75(0x7a))/0xb*(parseInt(_0x183c75(0x7e))/0xc);if(_0x34f57c===_0x2de979)break;else _0x42c2ce['push'](_0x42c2ce['shift']());}catch(_0x5454ad){_0x42c2ce['push'](_0x42c2ce['shift']());}}}(a165_0x3e81,0x6fe46));import a165_0x25b9ca from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';function a165_0x3e81(){const _0x2da4c3=['1032060SjcstA','4563064CUuCvL','735698aCDuSi','message','开始复制项目模板','1965558TdYcRS','cwd','8974141AjfqKP','5780733WGkbpv','now','success','12dqLWax','copy','项目模板复制完成','resolve','项目模板复制失败','6Igrnkm','9ySwHbS','2BgUyqG','105hjTtQl','46076kTmGvH'];a165_0x3e81=function(){return _0x2da4c3;};return a165_0x3e81();}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a165_0x5c27(_0x21b6d9,_0x466f5d){_0x21b6d9=_0x21b6d9-0x75;const _0x3e81be=a165_0x3e81();let _0x5c276d=_0x3e81be[_0x21b6d9];return _0x5c276d;}import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x223bc8){const _0x28dd05=a165_0x5c27,_0x22fdf4=Date[_0x28dd05(0x7c)](),_0x4ff241=a165_0x25b9ca[_0x28dd05(0x81)](process[_0x28dd05(0x79)](),_0x223bc8);try{logger['info'](_0x28dd05(0x7f),_0x28dd05(0x77),{'projectCode':_0x223bc8,'templateDir':templateDir}),await copyDirectory(templateDir,_0x4ff241);const _0x41584d=Date['now']()-_0x22fdf4;logger[_0x28dd05(0x7d)](_0x28dd05(0x7f),_0x28dd05(0x80),_0x41584d,{'projectCode':_0x223bc8});}catch(_0x1a0a62){const _0x4ffde9=Date['now']()-_0x22fdf4;logger['error'](_0x28dd05(0x7f),_0x28dd05(0x82),{'projectCode':_0x223bc8,'error':_0x1a0a62 instanceof Error?_0x1a0a62[_0x28dd05(0x76)]:String(_0x1a0a62),'duration':_0x4ffde9});throw _0x1a0a62;}return formatElapsed(_0x22fdf4);}
@@ -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(_0x4254cd,_0x499a92){const _0x456e8f=a166_0xb2dd,_0x4ddbc3=_0x4254cd();while(!![]){try{const _0x110a1e=parseInt(_0x456e8f(0xef))/0x1+-parseInt(_0x456e8f(0xf5))/0x2*(-parseInt(_0x456e8f(0xed))/0x3)+-parseInt(_0x456e8f(0xe8))/0x4+-parseInt(_0x456e8f(0xea))/0x5*(parseInt(_0x456e8f(0xec))/0x6)+-parseInt(_0x456e8f(0xf7))/0x7+parseInt(_0x456e8f(0xf3))/0x8*(parseInt(_0x456e8f(0xe5))/0x9)+-parseInt(_0x456e8f(0xf9))/0xa*(-parseInt(_0x456e8f(0xf4))/0xb);if(_0x110a1e===_0x499a92)break;else _0x4ddbc3['push'](_0x4ddbc3['shift']());}catch(_0x4d8332){_0x4ddbc3['push'](_0x4ddbc3['shift']());}}}(a166_0x2ed9,0x18c6a));import a166_0x45f498 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a166_0x2ed9(){const _0x2ed38a=['now','prettier','513891TPydqE','message','format','645364eWKlII','--write','115hnJkYw','success','19086eElKnH','84192sSckaW','resolve','67346MjmJFu','开始格式化代码','info','代码格式化完成','16WImwxJ','61765KhVcPg','4sBzIWN','error','294427SEzwhx','代码格式化失败','250utqtlb'];a166_0x2ed9=function(){return _0x2ed38a;};return a166_0x2ed9();}import{resolveNpmBin}from'../../../utils/platform.js';function a166_0xb2dd(_0xfa34c2,_0x5b84d8){_0xfa34c2=_0xfa34c2-0xe3;const _0x2ed9a4=a166_0x2ed9();let _0xb2dde2=_0x2ed9a4[_0xfa34c2];return _0xb2dde2;}export async function formatProjectCode(_0x6d08cd){const _0xbcc42c=a166_0xb2dd,_0x341061=Date[_0xbcc42c(0xe3)](),_0x477a87=a166_0x45f498[_0xbcc42c(0xee)](process['cwd'](),_0x6d08cd);try{logger[_0xbcc42c(0xf1)]('format',_0xbcc42c(0xf0),{'projectCode':_0x6d08cd}),await execa(resolveNpmBin('npx'),[_0xbcc42c(0xe4),_0xbcc42c(0xe9),'.'],{'cwd':_0x477a87});const _0x1bf199=Date[_0xbcc42c(0xe3)]()-_0x341061;logger[_0xbcc42c(0xeb)](_0xbcc42c(0xe7),_0xbcc42c(0xf2),_0x1bf199,{'projectCode':_0x6d08cd});}catch(_0x19d819){const _0x5c1b84=Date[_0xbcc42c(0xe3)]()-_0x341061;logger[_0xbcc42c(0xf6)]('format',_0xbcc42c(0xf8),{'projectCode':_0x6d08cd,'error':_0x19d819 instanceof Error?_0x19d819[_0xbcc42c(0xe6)]:String(_0x19d819),'duration':_0x5c1b84});throw _0x19d819;}return formatElapsed(_0x341061);}
@@ -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_0x3d1c(){const _0x2152e9=['install','52LiwPen','6lrLMuE','error','依赖安装失败','success','1005170SjcKDU','1uFuilr','resolve','11AknJXU','info','899320KvCKoK','npm','264TtEmAD','103789PPcMvz','997990xurQPj','48utPssb','2216664RjwPdW','https://registry.npmmirror.com','依赖安装完成','230340RIUdNy','now','cwd','6nwAoLN'];a167_0x3d1c=function(){return _0x2152e9;};return a167_0x3d1c();}(function(_0x28b73d,_0x481c53){const _0x277990=a167_0x3c96,_0x122ff=_0x28b73d();while(!![]){try{const _0xded039=parseInt(_0x277990(0x1a0))/0x1*(-parseInt(_0x277990(0x19f))/0x2)+parseInt(_0x277990(0x1b3))/0x3*(parseInt(_0x277990(0x1ad))/0x4)+-parseInt(_0x277990(0x1a4))/0x5*(parseInt(_0x277990(0x1b0))/0x6)+parseInt(_0x277990(0x1a7))/0x7*(parseInt(_0x277990(0x1a6))/0x8)+parseInt(_0x277990(0x1aa))/0x9+-parseInt(_0x277990(0x1a8))/0xa*(-parseInt(_0x277990(0x1a2))/0xb)+-parseInt(_0x277990(0x1a9))/0xc*(-parseInt(_0x277990(0x1b2))/0xd);if(_0xded039===_0x481c53)break;else _0x122ff['push'](_0x122ff['shift']());}catch(_0x3f7a1b){_0x122ff['push'](_0x122ff['shift']());}}}(a167_0x3d1c,0x4175b));import a167_0xad9b41 from'node:path';function a167_0x3c96(_0x1d1d52,_0x1c974b){_0x1d1d52=_0x1d1d52-0x19d;const _0x3d1c46=a167_0x3d1c();let _0x3c96f7=_0x3d1c46[_0x1d1d52];return _0x3c96f7;}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(_0xa0ed9d){const _0x7e7d63=a167_0x3c96,_0x68bf39=Date[_0x7e7d63(0x1ae)](),_0x204fd6=a167_0xad9b41[_0x7e7d63(0x1a1)](process[_0x7e7d63(0x1af)](),_0xa0ed9d);try{logger[_0x7e7d63(0x1a3)](_0x7e7d63(0x1b1),'开始安装依赖',{'projectCode':_0xa0ed9d,'registry':_0x7e7d63(0x1ab)}),await execa(resolveNpmBin(_0x7e7d63(0x1a5)),[_0x7e7d63(0x1b1),'--registry',_0x7e7d63(0x1ab)],{'cwd':_0x204fd6});const _0x3f91f5=Date[_0x7e7d63(0x1ae)]()-_0x68bf39;logger[_0x7e7d63(0x19e)](_0x7e7d63(0x1b1),_0x7e7d63(0x1ac),_0x3f91f5,{'projectCode':_0xa0ed9d});}catch(_0x4ef3e9){const _0x4f532e=Date[_0x7e7d63(0x1ae)]()-_0x68bf39;logger[_0x7e7d63(0x1b4)](_0x7e7d63(0x1b1),_0x7e7d63(0x19d),{'projectCode':_0xa0ed9d,'error':_0x4ef3e9 instanceof Error?_0x4ef3e9['message']:String(_0x4ef3e9),'duration':_0x4f532e});throw _0x4ef3e9;}return formatElapsed(_0x68bf39);}
@@ -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_0xbed396=a168_0x3558;(function(_0x16c38f,_0x5a5a60){const _0x21514b=a168_0x3558,_0x47d1e6=_0x16c38f();while(!![]){try{const _0x138ac2=-parseInt(_0x21514b(0x118))/0x1+parseInt(_0x21514b(0x10c))/0x2*(-parseInt(_0x21514b(0x10a))/0x3)+-parseInt(_0x21514b(0x111))/0x4+-parseInt(_0x21514b(0x115))/0x5+-parseInt(_0x21514b(0x113))/0x6+-parseInt(_0x21514b(0x125))/0x7+parseInt(_0x21514b(0x11e))/0x8;if(_0x138ac2===_0x5a5a60)break;else _0x47d1e6['push'](_0x47d1e6['shift']());}catch(_0x46f96c){_0x47d1e6['push'](_0x47d1e6['shift']());}}}(a168_0x3c75,0xe208e));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';function a168_0x3558(_0xf23609,_0x227bca){_0xf23609=_0xf23609-0x107;const _0x3c75f6=a168_0x3c75();let _0x355888=_0x3c75f6[_0xf23609];return _0x355888;}const createFlags=[{'name':a168_0xbed396(0x114),'type':'string','description':a168_0xbed396(0x10b)},{'name':a168_0xbed396(0x108),'type':a168_0xbed396(0x11d),'description':a168_0xbed396(0x119)},{'name':a168_0xbed396(0x107),'type':'string','description':a168_0xbed396(0x121)}],upgradeFlags=[{'name':a168_0xbed396(0x11c),'type':a168_0xbed396(0x120),'description':a168_0xbed396(0x10d),'default':![]}];function a168_0x3c75(){const _0x338461=['Target\x20environment','bool','write','yes','string','60849576VQShbR','str','boolean','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','cookie','trim','args','12860883zpmCtJ','appcode','env','nonInteractive','3XxnPPj','Project\x20name','2865342HDXdVA','Skip\x20confirmation\x20prompt','project-name','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','5942696AIGrfz','../../commands/project/create/main.js','865344pvcqUb','name','1513000MKRgNz','create','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','1477921QfzHJK'];a168_0x3c75=function(){return _0x338461;};return a168_0x3c75();}export const projectDefinitions=[{'service':'project','command':a168_0xbed396(0x116),'description':'Create\x20a\x20new\x20project','risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a168_0xbed396(0x10e),'description':a168_0xbed396(0x110),'required':![]}],'flags':createFlags,async 'execute'(_0x438cb8){const _0x112944=a168_0xbed396,{createApp:_0x5abc68}=await import(_0x112944(0x112)),{createProjectNonInteractive:_0x46db8b}=await import('../../commands/project/create/non-interactive.js'),_0x12dda7=_0x438cb8['str'](_0x112944(0x114))[_0x112944(0x123)]()||_0x438cb8[_0x112944(0x124)][0x0]?.['trim'](),_0x1bb4af=_0x438cb8[_0x112944(0x11f)]('env')||undefined,_0x30f63d=_0x438cb8['str'](_0x112944(0x107))||undefined;if(_0x438cb8[_0x112944(0x109)]){if(!_0x12dda7)throw CliErrors['validation'](_0x112944(0x10f),'Usage:\x20'+CLI_BIN_NAME+_0x112944(0x117));await _0x46db8b(_0x12dda7,_0x1bb4af,_0x30f63d,_0x438cb8[_0x112944(0x122)]);}else await _0x5abc68({'projectCode':_0x12dda7,'appCode':_0x30f63d,'env':_0x1bb4af,'cookie':_0x438cb8[_0x112944(0x122)]});return{'ok':!![]};}},{'service':'project','command':'upgrade','description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a168_0xbed396(0x11b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x399dc9){const _0x17add7=a168_0xbed396;return await upgradeApp(_0x399dc9[_0x17add7(0x109)],{'yes':_0x399dc9[_0x17add7(0x11a)](_0x17add7(0x11c))}),{'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_0x3ffaef=a169_0x5e4c;(function(_0x136d7d,_0xce1064){const _0x105b26=a169_0x5e4c,_0x2b0b69=_0x136d7d();while(!![]){try{const _0x20a476=parseInt(_0x105b26(0xf4))/0x1*(-parseInt(_0x105b26(0xfc))/0x2)+-parseInt(_0x105b26(0xc7))/0x3*(-parseInt(_0x105b26(0xae))/0x4)+-parseInt(_0x105b26(0xca))/0x5*(parseInt(_0x105b26(0xd1))/0x6)+-parseInt(_0x105b26(0xb6))/0x7*(parseInt(_0x105b26(0xee))/0x8)+-parseInt(_0x105b26(0x100))/0x9*(parseInt(_0x105b26(0xf3))/0xa)+parseInt(_0x105b26(0xc1))/0xb*(parseInt(_0x105b26(0xb7))/0xc)+parseInt(_0x105b26(0xbe))/0xd;if(_0x20a476===_0xce1064)break;else _0x2b0b69['push'](_0x2b0b69['shift']());}catch(_0x396b7b){_0x2b0b69['push'](_0x2b0b69['shift']());}}}(a169_0x26ba,0xe5443));import a169_0x2b3bf2 from'chalk';import a169_0x131d9b 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_0x3ffaef(0xe9)](_0x2ead05=>_0x2ead05!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x38b78e){const _0x23504d=a169_0x3ffaef,_0x5da521=[];for(const _0x11cf96 of Object[_0x23504d(0xaa)](CORE_IDE_CONFIGS)){if(_0x11cf96[_0x23504d(0xa6)])for(const _0x41ee09 of _0x11cf96[_0x23504d(0xa6)]){_0x5da521['push'](resolve(_0x38b78e,_0x41ee09[_0x23504d(0x10a)]));}}return _0x5da521;}function analyse(_0x331986){const _0xb1ee1=a169_0x3ffaef;let _0x14f6c2=null;const _0x58c926=resolve(_0x331986,NEW_CONFIG_NAME),_0x3c13a7=existsSync(_0x58c926);for(const _0x14308c of LEGACY_CONFIG_NAMES){const _0x560de2=resolve(_0x331986,_0x14308c);if(existsSync(_0x560de2)){const _0x2a5b3b=readConfigFile(_0x560de2),_0x45fdf4=Object[_0xb1ee1(0xe7)](_0x2a5b3b)[_0xb1ee1(0xe9)](_0x2191b9=>typeof _0x2a5b3b[_0x2191b9]!=='undefined');_0x14f6c2={'oldPath':_0x560de2,'hasNewConfig':_0x3c13a7,'fields':_0x45fdf4};break;}}const _0x2fafe9=[],_0x5f099f=resolve(_0x331986,_0xb1ee1(0xb0));if(existsSync(_0x5f099f))_0x2fafe9['push'](_0x5f099f);const _0x34c847=resolve(_0x331986,_0xb1ee1(0xef));if(existsSync(_0x34c847))_0x2fafe9[_0xb1ee1(0x11a)](_0x34c847);const _0x32e5c8=resolve(_0x331986,_0xb1ee1(0xff));if(existsSync(_0x32e5c8))_0x2fafe9[_0xb1ee1(0x11a)](_0x32e5c8);for(const _0x96f930 of collectIdeSkillFiles(_0x331986)){if(existsSync(_0x96f930))_0x2fafe9[_0xb1ee1(0x11a)](_0x96f930);}let _0x1d62ad=null;const _0x2da2d0=resolve(_0x331986,_0xb1ee1(0xeb));if(existsSync(_0x2da2d0))try{const _0x12cd86=JSON['parse'](readFileSync(_0x2da2d0,_0xb1ee1(0xfa)));if(_0x12cd86?.[_0xb1ee1(0xc8)]&&typeof _0x12cd86[_0xb1ee1(0xc8)]===_0xb1ee1(0x11c)){const _0x262782=[];for(const [_0x37cdea,_0x35a2a1]of Object['entries'](_0x12cd86[_0xb1ee1(0xc8)])){const _0x1be9c7=_0x35a2a1;_0x1be9c7?.[_0xb1ee1(0xf5)]&&Array[_0xb1ee1(0xcf)](_0x1be9c7['args'])&&_0x1be9c7[_0xb1ee1(0xf5)][_0xb1ee1(0xbc)](_0xd150ff=>typeof _0xd150ff===_0xb1ee1(0x114)&&_0xd150ff[_0xb1ee1(0x104)](_0xb1ee1(0xf1)))&&_0x262782['push'](_0x37cdea);}_0x262782[_0xb1ee1(0xe4)]>0x0&&(_0x1d62ad={'path':_0x2da2d0,'keys':_0x262782});}}catch{}const _0x55ac45=_0x2fafe9[_0xb1ee1(0xe4)]>0x0||_0x14f6c2!==null;let _0x1bd0ff=null;const _0x31c466=resolve(_0x331986,_0xb1ee1(0xdd));if(existsSync(_0x31c466))try{const _0x56840e=JSON[_0xb1ee1(0x11b)](readFileSync(_0x31c466,_0xb1ee1(0xfa)));for(const _0x58c59d of[_0xb1ee1(0xd6),_0xb1ee1(0xe2)]){const _0x59eeab=_0x56840e?.[_0x58c59d]?.['@lovrabet/sdk'];if(typeof _0x59eeab===_0xb1ee1(0x114)){_0x59eeab!==_0xb1ee1(0x103)&&(_0x1bd0ff={'pkgPath':_0x31c466,'currentVersion':_0x59eeab,'field':_0x58c59d});break;}}}catch{}return{'configMigration':_0x14f6c2,'oldArtifacts':_0x2fafe9,'oldMcpConfig':_0x1d62ad,'needsSkillSwap':_0x55ac45,'sdkUpgrade':_0x1bd0ff};}function printReport(_0x677647){const _0x161686=a169_0x3ffaef,{configMigration:_0x3c620c,oldArtifacts:_0x5da21e,oldMcpConfig:_0x1d526b,needsSkillSwap:_0x57b10a}=_0x677647;console[_0x161686(0x118)](''),console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0x11d)](_0x161686(0xec))),console[_0x161686(0x118)]('');_0x3c620c?(console[_0x161686(0x118)](a169_0x2b3bf2['cyan']('Config\x20file:')+('\x20\x20'+a169_0x2b3bf2['yellow'](_0x3c620c[_0x161686(0xab)]))),console[_0x161686(0x118)](_0x161686(0xf9)+(_0x3c620c[_0x161686(0xbf)]?a169_0x2b3bf2[_0x161686(0x122)](_0x161686(0x102)):a169_0x2b3bf2[_0x161686(0xcc)](_0x161686(0xb2)))),console[_0x161686(0x118)]('\x20\x20Fields\x20to\x20migrate:\x20'+_0x3c620c[_0x161686(0x120)][_0x161686(0x115)](',\x20')),console[_0x161686(0x118)](_0x161686(0xda))):console[_0x161686(0x118)](a169_0x2b3bf2['cyan']('Config\x20file:')+'\x20\x20'+a169_0x2b3bf2[_0x161686(0xcc)](_0x161686(0x109)));console['log']('');if(_0x5da21e[_0x161686(0xe4)]>0x0){console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0xb8)](_0x161686(0x123)));for(const _0x5676f of _0x5da21e){console['log']('\x20\x20'+a169_0x2b3bf2[_0x161686(0x10e)]('FOUND')+'\x20\x20'+_0x5676f);}console[_0x161686(0x118)](_0x161686(0xc6));}else console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0xb8)]('Legacy\x20artifacts:')+'\x20\x20'+a169_0x2b3bf2[_0x161686(0xcc)](_0x161686(0xdc)));console['log']('');_0x1d526b?(console['log'](a169_0x2b3bf2[_0x161686(0xb8)](_0x161686(0x11f))+('\x20\x20'+a169_0x2b3bf2['yellow'](_0x1d526b[_0x161686(0x10a)])+_0x161686(0xe3)+_0x1d526b['keys']['join'](',\x20'))),console['log']('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console['log'](a169_0x2b3bf2['cyan'](_0x161686(0x11f))+'\x20\x20'+a169_0x2b3bf2[_0x161686(0xcc)]('no\x20legacy\x20entry'));console[_0x161686(0x118)](''),console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0xb8)](_0x161686(0x10b))+('\x20\x20'+(_0x57b10a?a169_0x2b3bf2[_0x161686(0x119)]('needed'):a169_0x2b3bf2[_0x161686(0x122)](_0x161686(0x121)))));_0x57b10a&&console['log'](_0x161686(0xa2)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x161686(0x118)]('');if(_0x677647[_0x161686(0xcb)]){const {currentVersion:_0x2d06d9,field:_0x1f2e9b,pkgPath:_0x570a6f}=_0x677647['sdkUpgrade'];console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0xb8)](_0x161686(0xf6))+('\x20\x20'+a169_0x2b3bf2['yellow'](_0x570a6f))),console[_0x161686(0x118)]('\x20\x20Current\x20version\x20in\x20'+_0x1f2e9b+':\x20'+a169_0x2b3bf2[_0x161686(0x119)](_0x2d06d9)+_0x161686(0xd9)+a169_0x2b3bf2[_0x161686(0x122)](_0x161686(0x103))),console['log']('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console[_0x161686(0x118)](a169_0x2b3bf2[_0x161686(0xb8)](_0x161686(0xf6))+'\x20\x20'+a169_0x2b3bf2[_0x161686(0xcc)](_0x161686(0xb1)));console[_0x161686(0x118)]('');}function execConfigMigration(_0x25c6d9,_0x760b97){const _0x1173ef=a169_0x3ffaef,{configMigration:_0x260367}=_0x25c6d9;if(!_0x260367?.[_0x1173ef(0xab)])return{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x1173ef(0x101)};const _0xb11899=readConfigFile(_0x260367['oldPath']),_0x4329ba=resolve(_0x760b97,NEW_CONFIG_NAME),_0x4d88e1=_0x260367[_0x1173ef(0xbf)]?readConfigFile(_0x4329ba):{};for(const [_0x5492ed,_0x9fd231]of Object['entries'](_0xb11899)){!(_0x5492ed in _0x4d88e1)&&(_0x4d88e1[_0x5492ed]=_0x9fd231);}writeConfigFile(_0x4329ba,_0x4d88e1);const _0x147502=_0x260367[_0x1173ef(0xab)]+'.bak';return renameSync(_0x260367['oldPath'],_0x147502),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x260367['oldPath']+_0x1173ef(0xd9)+_0x4329ba+_0x1173ef(0x10c)+_0x147502+')'};}function a169_0x26ba(){const _0x2e524d=['error','start','keys','step','filter','oldArtifacts','.cursor/mcp.json','===\x20Upgrade\x20Analysis\x20===','lovrabet/lovrabet-skill\x20removed','52328pRruZM','.cursor/rules/lovrabet_rules.mdc','FAIL','@lovrabet/dataset-mcp-server','oldMcpConfig','110dsBPQx','72031YCgZSR','args','@lovrabet/sdk:','removed\x20','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','\x20\x20New\x20config\x20(.rabetbase.json):\x20','utf8','Clean\x20MCP\x20config','6VjoRWc','Remove\x20.lovrabet/','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','.claude/skills/lovrabet','817479Jkmipe','skipped\x20(no\x20legacy\x20config)','already\x20exists\x20(will\x20merge)','latest','includes','exit\x20','succeed','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','Remove\x20old\x20skill','no\x20legacy\x20config\x20found','path','Skill\x20swap:','\x20(backup:\x20','\x20\x20npm\x20install','red','Upgrade\x20completed\x20successfully!','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','lovrabet/rabetbase\x20installed\x20globally','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','\x20\x20Step\x20','string','join','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','\x20\x20\x20\x20\x20\x20\x20','log','yellow','push','parse','object','bold','entries','MCP\x20config:','fields','not\x20needed','green','Legacy\x20artifacts:','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','\x20from\x20','message','@lovrabet/sdk','files','detail','Upgrade\x20@lovrabet/sdk','Install\x20new\x20skill','values','oldPath','Step\x206/7:\x20Installing\x20new\x20skill...','no\x20matching\x20entry\x20found','90112eHKjsd','white','.lovrabet','not\x20found\x20or\x20already\x20at\x20latest','not\x20found\x20(will\x20create)','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','skipped','stringify','1925VpMTIi','23508IpQywq','cyan','\x20removed\x20(','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','some','\x20\x20#\x20or','41740114hTXoWU','hasNewConfig','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','3652MKYYnx','info','Proceed\x20with\x20upgrade?','[\x22@lovrabet/sdk\x22]:\x20','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','\x20\x20Action:\x20delete','192axoNXg','mcpServers','fail','90pJnZBg','sdkUpgrade','gray','failed','Step\x205/7:\x20Removing\x20old\x20skill...','isArray','done','449958atHcPF','needsSkillSwap','Step\x201/7:\x20Config\x20migration\x20—\x20','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','isDirectory','dependencies','cwd','status','\x20→\x20','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','lovrabet/rabetbase','none\x20found','package.json','configMigration','Step\x201/7:\x20Migrating\x20config...','\x20\x20bun\x20install','===\x20Upgrade\x20Summary\x20===','devDependencies','\x20→\x20keys:\x20','length'];a169_0x26ba=function(){return _0x2e524d;};return a169_0x26ba();}function execRemoveOldArtifacts(_0x43da46){const _0x193640=a169_0x3ffaef,_0x4bec4d=[];for(const _0x2d66df of _0x43da46){try{if(!existsSync(_0x2d66df))continue;const _0x5e62b0=tryStat(_0x2d66df);_0x5e62b0?.[_0x193640(0xd5)]()?rmSync(_0x2d66df,{'recursive':!![],'force':!![]}):unlinkSync(_0x2d66df);}catch(_0x14dfa8){_0x4bec4d['push'](_0x2d66df+':\x20'+_0x14dfa8['message']);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x4bec4d[_0x193640(0xe4)]===0x0,'detail':_0x4bec4d[_0x193640(0xe4)]>0x0?_0x43da46[_0x193640(0xe4)]-_0x4bec4d['length']+'/'+_0x43da46[_0x193640(0xe4)]+_0x193640(0xb9)+_0x4bec4d[_0x193640(0x115)](';\x20')+')':_0x43da46[_0x193640(0xe4)]+'\x20removed'};}function execCleanMcp(_0x8397c8){const _0xab1d4b=a169_0x3ffaef;if(!_0x8397c8[_0xab1d4b(0xf2)])return{'step':0x4,'label':_0xab1d4b(0xfb),'ok':!![],'detail':'skipped'};try{const _0x221540=readFileSync(_0x8397c8[_0xab1d4b(0xf2)][_0xab1d4b(0x10a)],_0xab1d4b(0xfa)),_0x14af5e=JSON['parse'](_0x221540);if(_0x14af5e?.[_0xab1d4b(0xc8)]&&typeof _0x14af5e[_0xab1d4b(0xc8)]===_0xab1d4b(0x11c)){const _0x342ae3=[];for(const [_0x5cb192,_0x167e1d]of Object[_0xab1d4b(0x11e)](_0x14af5e[_0xab1d4b(0xc8)])){_0x167e1d?.['args']&&Array[_0xab1d4b(0xcf)](_0x167e1d['args'])&&_0x167e1d[_0xab1d4b(0xf5)][_0xab1d4b(0xbc)](_0x54b31e=>typeof _0x54b31e===_0xab1d4b(0x114)&&_0x54b31e['includes']('@lovrabet/dataset-mcp-server'))&&_0x342ae3[_0xab1d4b(0x11a)](_0x5cb192);}for(const _0x5e91c5 of _0x342ae3){delete _0x14af5e[_0xab1d4b(0xc8)][_0x5e91c5];}return _0x342ae3[_0xab1d4b(0xe4)]>0x0&&writeFileSync(_0x8397c8['oldMcpConfig'][_0xab1d4b(0x10a)],JSON['stringify'](_0x14af5e,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0xab1d4b(0xfb),'ok':!![],'detail':_0xab1d4b(0xf7)+_0x342ae3[_0xab1d4b(0x115)](',\x20')+_0xab1d4b(0xa3)+_0x8397c8[_0xab1d4b(0xf2)]['path']};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0xab1d4b(0xad)};}catch(_0xa3b1e4){return{'step':0x4,'label':_0xab1d4b(0xfb),'ok':![],'detail':_0xa3b1e4[_0xab1d4b(0xa4)]};}}function execSkillsRemove(_0x5eb5e5,_0x4f9286){const _0x3f2491=a169_0x3ffaef,_0x5eab88=runNpxSkillsRemove(_0x5eb5e5,{'stdio':'inherit','yes':_0x4f9286});return{'step':0x5,'label':_0x3f2491(0x108),'ok':_0x5eab88['ok'],'detail':_0x5eab88['ok']?_0x3f2491(0xed):_0x5eab88[_0x3f2491(0xe5)]??'exit\x20'+_0x5eab88[_0x3f2491(0xd8)]};}function execSkillsAdd(_0x7f37bb,_0x4739a5){const _0x22f30c=a169_0x3ffaef,_0x387a74=runNpxSkillsAddGlobal(_0x7f37bb,_0x22f30c(0xdb),{'stdio':'inherit','yes':_0x4739a5});return{'step':0x6,'label':_0x22f30c(0xa9),'ok':_0x387a74['ok'],'detail':_0x387a74['ok']?_0x22f30c(0x111):_0x387a74[_0x22f30c(0xe5)]??_0x22f30c(0x105)+_0x387a74[_0x22f30c(0xd8)]};}function execUpgradeSdk(_0x857fdf){const _0x59b7e3=a169_0x3ffaef;if(!_0x857fdf['sdkUpgrade'])return{'step':0x7,'label':_0x59b7e3(0xa8),'ok':!![],'detail':_0x59b7e3(0xb3)};const {pkgPath:_0x277bca,currentVersion:_0x3f4720,field:_0x164535}=_0x857fdf['sdkUpgrade'];try{const _0x13afe6=readFileSync(_0x277bca,'utf8'),_0x3c941c=JSON[_0x59b7e3(0x11b)](_0x13afe6);return _0x3c941c[_0x164535][_0x59b7e3(0xa5)]=_0x59b7e3(0x103),writeFileSync(_0x277bca,JSON[_0x59b7e3(0xb5)](_0x3c941c,null,0x2)+'\x0a',_0x59b7e3(0xfa)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x164535+_0x59b7e3(0xc4)+_0x3f4720+'\x20→\x20latest'};}catch(_0x26c7d3){return{'step':0x7,'label':_0x59b7e3(0xa8),'ok':![],'detail':_0x26c7d3['message']};}}function tryStat(_0x5d7efc){try{return statSync(_0x5d7efc);}catch{return undefined;}}function printSummary(_0x159ff9){const _0x3bc95f=a169_0x3ffaef;console[_0x3bc95f(0x118)](''),console['log'](a169_0x2b3bf2[_0x3bc95f(0x11d)](_0x3bc95f(0xe1))),console[_0x3bc95f(0x118)]('');for(const _0x8099c2 of _0x159ff9){const _0x453c3c=_0x8099c2['ok']?a169_0x2b3bf2['green']('OK'):a169_0x2b3bf2[_0x3bc95f(0x10e)](_0x3bc95f(0xf0));console[_0x3bc95f(0x118)]('\x20\x20'+_0x453c3c+_0x3bc95f(0x113)+_0x8099c2[_0x3bc95f(0xe8)]+':\x20'+_0x8099c2['label']);if(_0x8099c2['detail'])console[_0x3bc95f(0x118)](_0x3bc95f(0x117)+a169_0x2b3bf2[_0x3bc95f(0xcc)](_0x8099c2[_0x3bc95f(0xa7)]));}console['log']('');}function a169_0x5e4c(_0x594488,_0x1707c9){_0x594488=_0x594488-0xa2;const _0x26ba7c=a169_0x26ba();let _0x5e4c77=_0x26ba7c[_0x594488];return _0x5e4c77;}export async function upgradeApp(_0x10813e,_0x5969ae){const _0x4e20fc=a169_0x3ffaef,_0x475149=process[_0x4e20fc(0xd7)](),_0x551ccd=analyse(_0x475149),_0x460165=!_0x551ccd[_0x4e20fc(0xde)]&&_0x551ccd[_0x4e20fc(0xea)][_0x4e20fc(0xe4)]===0x0&&!_0x551ccd['oldMcpConfig']&&!_0x551ccd[_0x4e20fc(0xd2)]&&!_0x551ccd[_0x4e20fc(0xcb)];if(_0x460165){console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0x122)](_0x4e20fc(0xbb)));return;}printReport(_0x551ccd);const _0x1c12cf=!!(_0x5969ae['yes']||_0x5969ae['Y']||_0x10813e);if(!_0x1c12cf)try{const _0x1e1e74=await askConfirm(_0x4e20fc(0xc3));if(!_0x1e1e74){console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0xcc)]('Upgrade\x20cancelled.'));return;}}catch(_0x382bfb){if(_0x382bfb?.[_0x4e20fc(0xa4)]==='CANCEL'){console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0xcc)]('Upgrade\x20cancelled.'));return;}throw _0x382bfb;}const _0x28e3ef=[],_0x55e32c=a169_0x131d9b({'text':_0x4e20fc(0xdf),'color':_0x4e20fc(0xb8)})[_0x4e20fc(0xe6)](),_0x2483b1=execConfigMigration(_0x551ccd,_0x475149);_0x28e3ef[_0x4e20fc(0x11a)](_0x2483b1),_0x55e32c[_0x2483b1['ok']?_0x4e20fc(0x106):_0x4e20fc(0xc9)](_0x4e20fc(0xd3)+(_0x2483b1[_0x4e20fc(0xa7)]??(_0x2483b1['ok']?_0x4e20fc(0xd0):_0x4e20fc(0xcd))));const _0x8d3a63=resolve(_0x475149,'.lovrabet'),_0x577da0=a169_0x131d9b({'text':_0x4e20fc(0x116),'color':'cyan'})[_0x4e20fc(0xe6)]();if(existsSync(_0x8d3a63))try{rmSync(_0x8d3a63,{'recursive':!![],'force':!![]}),_0x577da0[_0x4e20fc(0x106)](_0x4e20fc(0x112)),_0x28e3ef[_0x4e20fc(0x11a)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x153ef7){_0x577da0['fail'](_0x4e20fc(0xd4)+_0x153ef7[_0x4e20fc(0xa4)]),_0x28e3ef[_0x4e20fc(0x11a)]({'step':0x2,'label':_0x4e20fc(0xfd),'ok':![],'detail':_0x153ef7[_0x4e20fc(0xa4)]});}else _0x577da0[_0x4e20fc(0xc2)](_0x4e20fc(0x110)),_0x28e3ef[_0x4e20fc(0x11a)]({'step':0x2,'label':_0x4e20fc(0xfd),'ok':!![],'detail':_0x4e20fc(0xb4)});const _0x49e50b=a169_0x131d9b({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x4e20fc(0xb8)})[_0x4e20fc(0xe6)](),_0x2c2e41=execRemoveOldArtifacts(_0x551ccd[_0x4e20fc(0xea)]);_0x28e3ef['push'](_0x2c2e41),_0x49e50b[_0x2c2e41['ok']?'succeed':_0x4e20fc(0xc9)]('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x2c2e41[_0x4e20fc(0xa7)]??(_0x2c2e41['ok']?_0x4e20fc(0xd0):'failed')));const _0x5f4ecb=a169_0x131d9b({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':_0x4e20fc(0xb8)})[_0x4e20fc(0xe6)](),_0x216b9c=execCleanMcp(_0x551ccd);_0x28e3ef[_0x4e20fc(0x11a)](_0x216b9c),_0x5f4ecb[_0x216b9c['ok']?_0x4e20fc(0x106):_0x4e20fc(0xc9)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x216b9c[_0x4e20fc(0xa7)]??(_0x216b9c['ok']?_0x4e20fc(0xd0):_0x4e20fc(0xcd))));const _0x563302=a169_0x131d9b({'text':_0x4e20fc(0xce),'color':'cyan'})[_0x4e20fc(0xe6)](),_0x3799c5=execSkillsRemove(_0x475149,_0x1c12cf);_0x28e3ef[_0x4e20fc(0x11a)](_0x3799c5),_0x563302[_0x3799c5['ok']?_0x4e20fc(0x106):_0x4e20fc(0xc9)]('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x3799c5[_0x4e20fc(0xa7)]??(_0x3799c5['ok']?_0x4e20fc(0xd0):'failed')));const _0x1945cd=a169_0x131d9b({'text':_0x4e20fc(0xac),'color':'cyan'})['start'](),_0x164ef6=execSkillsAdd(_0x475149,_0x1c12cf);_0x28e3ef[_0x4e20fc(0x11a)](_0x164ef6),_0x1945cd[_0x164ef6['ok']?_0x4e20fc(0x106):_0x4e20fc(0xc9)](_0x4e20fc(0xf8)+(_0x164ef6[_0x4e20fc(0xa7)]??(_0x164ef6['ok']?_0x4e20fc(0xd0):_0x4e20fc(0xcd))));const _0xfea5c2=a169_0x131d9b({'text':_0x4e20fc(0xba),'color':'cyan'})[_0x4e20fc(0xe6)](),_0x2bc2ee=execUpgradeSdk(_0x551ccd);_0x28e3ef[_0x4e20fc(0x11a)](_0x2bc2ee),_0xfea5c2[_0x2bc2ee['ok']?_0x4e20fc(0x106):_0x4e20fc(0xc9)](_0x4e20fc(0xc0)+(_0x2bc2ee[_0x4e20fc(0xa7)]??(_0x2bc2ee['ok']?'done':_0x4e20fc(0xcd)))),printSummary(_0x28e3ef);const _0x3c1a73=_0x28e3ef[_0x4e20fc(0xbc)](_0x359358=>!_0x359358['ok']);_0x3c1a73?console['log'](a169_0x2b3bf2[_0x4e20fc(0x119)](_0x4e20fc(0xfe))):console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0x122)](_0x4e20fc(0x10f))),_0x2bc2ee['ok']&&_0x551ccd[_0x4e20fc(0xcb)]&&(console['log'](''),console['log'](a169_0x2b3bf2[_0x4e20fc(0x11d)][_0x4e20fc(0xb8)](_0x4e20fc(0xc5))),console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0xb8)](_0x4e20fc(0x107))),console[_0x4e20fc(0x118)](''),console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0xaf)](_0x4e20fc(0x10d))),console[_0x4e20fc(0x118)](a169_0x2b3bf2['white'](_0x4e20fc(0xbd))),console[_0x4e20fc(0x118)](a169_0x2b3bf2[_0x4e20fc(0xaf)](_0x4e20fc(0xe0))),console['log'](''));}