@lovrabet/rabetbase-cli 2.3.16-beta.3 → 2.3.16-beta.4

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 (280) 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/relation-audit.js +1 -1
  141. package/lib/commands/page/restore.js +1 -1
  142. package/lib/commands/page/shared.js +1 -1
  143. package/lib/commands/page/standard-page-status.js +1 -1
  144. package/lib/commands/page/sync.js +1 -1
  145. package/lib/commands/permit/index.js +1 -1
  146. package/lib/commands/permit/page-get.js +1 -1
  147. package/lib/commands/permit/page-set.js +1 -1
  148. package/lib/commands/permit/role-apis-set.js +1 -1
  149. package/lib/commands/permit/role-menus-set.js +1 -1
  150. package/lib/commands/permit/role-menus.js +1 -1
  151. package/lib/commands/permit/shared.js +1 -1
  152. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  153. package/lib/commands/project/create/format-elapsed.js +1 -1
  154. package/lib/commands/project/create/main.js +1 -1
  155. package/lib/commands/project/create/non-interactive.js +1 -1
  156. package/lib/commands/project/create/project-template-path.js +1 -1
  157. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  158. package/lib/commands/project/create/use-format-code.js +1 -1
  159. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  160. package/lib/commands/project/index.js +1 -1
  161. package/lib/commands/project/upgrade.js +1 -1
  162. package/lib/commands/registry.js +1 -1
  163. package/lib/commands/role/create.js +1 -1
  164. package/lib/commands/role/delete.js +1 -1
  165. package/lib/commands/role/detail.js +1 -1
  166. package/lib/commands/role/index.js +1 -1
  167. package/lib/commands/role/list.js +1 -1
  168. package/lib/commands/role/shared.js +1 -1
  169. package/lib/commands/role/update.js +1 -1
  170. package/lib/commands/role/user-add.js +1 -1
  171. package/lib/commands/role/user-remove.js +1 -1
  172. package/lib/commands/role/user-resolve.js +1 -1
  173. package/lib/commands/run/index.js +1 -1
  174. package/lib/commands/schema.js +1 -1
  175. package/lib/commands/sql/create.js +1 -1
  176. package/lib/commands/sql/delete.js +1 -1
  177. package/lib/commands/sql/detail.js +1 -1
  178. package/lib/commands/sql/exec.js +1 -1
  179. package/lib/commands/sql/index.js +1 -1
  180. package/lib/commands/sql/list.js +1 -1
  181. package/lib/commands/sql/pull.js +1 -1
  182. package/lib/commands/sql/push.js +1 -1
  183. package/lib/commands/sql/shared.js +1 -1
  184. package/lib/commands/sql/status.js +1 -1
  185. package/lib/commands/sql/validate.js +1 -1
  186. package/lib/commands/task/index.js +1 -1
  187. package/lib/commands/task/status.js +1 -1
  188. package/lib/commands/tenant/index.js +1 -1
  189. package/lib/commands/tenant/members-list.js +1 -1
  190. package/lib/commands/tenant/shared.js +1 -1
  191. package/lib/commands/workspace/add.js +1 -1
  192. package/lib/commands/workspace/index.js +1 -1
  193. package/lib/commands/workspace/remove.js +1 -1
  194. package/lib/config/schema.js +1 -1
  195. package/lib/constant/cdn.js +1 -1
  196. package/lib/constant/cli.js +1 -1
  197. package/lib/constant/defaults.js +1 -1
  198. package/lib/constant/domain.js +1 -1
  199. package/lib/constant/env.js +1 -1
  200. package/lib/constant/output.js +1 -1
  201. package/lib/constant/paths.js +1 -1
  202. package/lib/constant/risk.js +1 -1
  203. package/lib/context/app-resolver.js +1 -1
  204. package/lib/context/auth-resolver.js +1 -1
  205. package/lib/context/config-loader.js +1 -1
  206. package/lib/context.js +1 -1
  207. package/lib/core/alias-resolver.js +1 -1
  208. package/lib/core/api-client.js +1 -1
  209. package/lib/core/bff/config.js +1 -1
  210. package/lib/core/bff/file-system.js +1 -1
  211. package/lib/core/bff/hash.js +1 -1
  212. package/lib/core/bff/lock.js +1 -1
  213. package/lib/core/bff/utils.js +1 -1
  214. package/lib/core/db-resolver.js +1 -1
  215. package/lib/core/page/file-system.js +1 -1
  216. package/lib/core/page/hash.js +1 -1
  217. package/lib/core/page/lock.js +1 -1
  218. package/lib/core/sql-index-auditor.js +1 -1
  219. package/lib/core/sql-sync/config.js +1 -1
  220. package/lib/core/sql-sync/file-system.js +1 -1
  221. package/lib/core/sql-sync/hash.js +1 -1
  222. package/lib/core/sql-sync/lock.js +1 -1
  223. package/lib/core/sql-sync/utils.js +1 -1
  224. package/lib/core/sql-validator.js +1 -1
  225. package/lib/errors.js +1 -1
  226. package/lib/framework/build-all-flags.js +1 -1
  227. package/lib/framework/error-output.js +1 -1
  228. package/lib/framework/explicit-yes.js +1 -1
  229. package/lib/framework/flags.js +1 -1
  230. package/lib/framework/help.js +1 -1
  231. package/lib/framework/index.js +1 -1
  232. package/lib/framework/output.js +1 -1
  233. package/lib/framework/response.js +1 -1
  234. package/lib/framework/runner-alias.js +1 -1
  235. package/lib/framework/runner.js +1 -1
  236. package/lib/framework/schema-export.js +1 -1
  237. package/lib/framework/types.js +1 -1
  238. package/lib/generated/build-info.js +1 -1
  239. package/lib/help.js +1 -1
  240. package/lib/skills/main.js +1 -1
  241. package/lib/skills/npx-skills-add.js +1 -1
  242. package/lib/skills/skill-presence.js +1 -1
  243. package/lib/telemetry/cli-command-trace.js +1 -1
  244. package/lib/telemetry/cli-help-trace.js +1 -1
  245. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  246. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  247. package/lib/telemetry/send-cli-trace-log.js +1 -1
  248. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  249. package/lib/utils/ai_config.js +1 -1
  250. package/lib/utils/apply-jq-filter.js +1 -1
  251. package/lib/utils/cdn-config.js +1 -1
  252. package/lib/utils/check-sdk-version.js +1 -1
  253. package/lib/utils/cli-version-check.js +1 -1
  254. package/lib/utils/cli-version-policy.js +1 -1
  255. package/lib/utils/config.js +1 -1
  256. package/lib/utils/copy-directory.js +1 -1
  257. package/lib/utils/entity-with-id.js +1 -1
  258. package/lib/utils/file-utils.js +1 -1
  259. package/lib/utils/guides-cdn.js +1 -1
  260. package/lib/utils/http-client.js +1 -1
  261. package/lib/utils/is-non-interactive.js +1 -1
  262. package/lib/utils/logger.js +1 -1
  263. package/lib/utils/params.js +1 -1
  264. package/lib/utils/platform.js +1 -1
  265. package/lib/utils/rules-cdn.js +1 -1
  266. package/lib/utils/sleep.js +1 -1
  267. package/lib/utils/template-replacer.js +1 -1
  268. package/lib/utils/update-notice.js +1 -1
  269. package/lib/utils/version.js +1 -1
  270. package/lib/utils/with-active-cookie.js +1 -1
  271. package/lib/utils/write-cli-side-channel.js +1 -1
  272. package/package.json +1 -1
  273. package/lib/commands/page/react/create.js +0 -1
  274. package/lib/commands/page/react/detail.js +0 -1
  275. package/lib/commands/page/react/list.js +0 -1
  276. package/lib/commands/page/react/publish.js +0 -1
  277. package/lib/commands/page/react/shared.js +0 -1
  278. package/lib/commands/page/react/syntax.js +0 -1
  279. package/lib/commands/page/react/template.js +0 -1
  280. package/lib/commands/page/react/update.js +0 -1
@@ -1 +1 @@
1
- (function(_0x3575c4,_0x4b8536){const _0x2f28b4=a163_0xc052,_0x226604=_0x3575c4();while(!![]){try{const _0x40a9d4=parseInt(_0x2f28b4(0xe0))/0x1*(-parseInt(_0x2f28b4(0xe3))/0x2)+-parseInt(_0x2f28b4(0xff))/0x3*(-parseInt(_0x2f28b4(0xf7))/0x4)+parseInt(_0x2f28b4(0xed))/0x5*(parseInt(_0x2f28b4(0xdc))/0x6)+parseInt(_0x2f28b4(0xea))/0x7+-parseInt(_0x2f28b4(0xcb))/0x8*(-parseInt(_0x2f28b4(0xc9))/0x9)+-parseInt(_0x2f28b4(0xfd))/0xa*(parseInt(_0x2f28b4(0xd6))/0xb)+-parseInt(_0x2f28b4(0xd1))/0xc*(parseInt(_0x2f28b4(0xe6))/0xd);if(_0x40a9d4===_0x4b8536)break;else _0x226604['push'](_0x226604['shift']());}catch(_0x37e9ab){_0x226604['push'](_0x226604['shift']());}}}(a163_0x51f8,0x30c54));import a163_0x249245 from'path';import a163_0x581b36 from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x5bdf39,_0x3b8abb,_0x2f848d,_0x515005){const _0x5f3de1=a163_0xc052,_0x104b18=await checkCliVersion();(_0x104b18[_0x5f3de1(0xc8)]||_0x104b18['belowMinimum'])&&(printCliUpgradeWarning(_0x104b18),assertCliVersionSupported(_0x104b18));if(!_0x5bdf39||_0x5bdf39['trim']()==='')throw CliErrors[_0x5f3de1(0xcc)](_0x5f3de1(0xce));const _0x4dd9e5=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x4dd9e5[_0x5f3de1(0xe8)](_0x5bdf39))throw CliErrors['validation']('Project\x20name\x20contains\x20invalid\x20characters.',_0x5f3de1(0xf3));if(_0x5bdf39[_0x5f3de1(0xcd)]>0x64)throw CliErrors[_0x5f3de1(0xcc)](_0x5f3de1(0xe2));const _0x2f8c32=a163_0x249245[_0x5f3de1(0xd5)](process[_0x5f3de1(0xfa)](),_0x5bdf39);if(existsSync(_0x2f8c32))throw CliErrors['validation']('Project\x20directory\x20\x22'+_0x5bdf39+'\x22\x20already\x20exists.',_0x5f3de1(0xe9));try{const _0x48f0ec=a163_0x249245[_0x5f3de1(0xf8)](_0x2f8c32);await a163_0x581b36[_0x5f3de1(0xfe)](_0x48f0ec,a163_0x581b36['constants']['W_OK']);}catch{throw CliErrors[_0x5f3de1(0xcc)]('Cannot\x20create\x20project\x20in\x20current\x20directory.',_0x5f3de1(0xe7));}try{console['log'](_0x5f3de1(0xee)+_0x5bdf39+_0x5f3de1(0xdf));const _0x6f0915=getSubAppReactDemoTemplateDir();await copyDirectory(_0x6f0915,_0x2f8c32),console[_0x5f3de1(0xf2)](_0x5f3de1(0xca)),await updatePackageJsonName(_0x5bdf39),console['log'](_0x5f3de1(0xd3)),console[_0x5f3de1(0xf2)]('\x20\x20Installing\x20dependencies...'),console['log'](_0x5f3de1(0xe5)),await formatCode(_0x2f8c32),console[_0x5f3de1(0xf2)](_0x5f3de1(0xf6)),await configureProject(_0x5bdf39,_0x2f848d,_0x3b8abb),console[_0x5f3de1(0xf2)](_0x5f3de1(0xc7)),_0x2f848d&&await pullApiConfig(_0x2f8c32,_0x2f848d,_0x3b8abb,_0x515005),console[_0x5f3de1(0xf2)](_0x5f3de1(0x100)+_0x5bdf39+_0x5f3de1(0xf9)),console[_0x5f3de1(0xf2)](_0x5f3de1(0xec)+_0x5bdf39),console['log'](_0x5f3de1(0xeb));}catch(_0x3196c3){try{existsSync(_0x2f8c32)&&await a163_0x581b36['rm'](_0x2f8c32,{'recursive':!![],'force':!![]});}catch{}throw _0x3196c3;}}function a163_0xc052(_0x1ccf54,_0x1b8745){_0x1ccf54=_0x1ccf54-0xc6;const _0x51f841=a163_0x51f8();let _0xc052fc=_0x51f841[_0x1ccf54];return _0xc052fc;}async function updatePackageJsonName(_0x9fc8ca){const _0x14d967=a163_0xc052,_0x3c0067=a163_0x249245[_0x14d967(0xd5)](process[_0x14d967(0xfa)](),_0x9fc8ca),_0x4a883f=a163_0x249245['join'](_0x3c0067,_0x14d967(0xda)),_0xbf9afc=await a163_0x581b36[_0x14d967(0xdd)](_0x4a883f,_0x14d967(0xd4)),_0x531a71=JSON[_0x14d967(0xe4)](_0xbf9afc);_0x531a71[_0x14d967(0xfb)]=_0x9fc8ca,_0x531a71['description']='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a163_0x581b36[_0x14d967(0xf0)](_0x4a883f,JSON['stringify'](_0x531a71,null,0x2)+'\x0a');}function detectPackageManager(){const _0x5eea30=a163_0xc052;try{return execSync(_0x5eea30(0xcf),{'stdio':_0x5eea30(0xde)}),_0x5eea30(0xd7);}catch{return'npm';}}async function formatCode(_0x5b32a3){const _0x4f94ad=a163_0xc052;try{await execAsync(_0x4f94ad(0xe1),{'cwd':_0x5b32a3});}catch{}}async function configureProject(_0x2669fb,_0xb9869f,_0x126d19){const _0x3d10a6=a163_0xc052,_0x26756a=a163_0x249245[_0x3d10a6(0xd5)](process[_0x3d10a6(0xfa)](),_0x2669fb),_0x28b4ed=a163_0x249245[_0x3d10a6(0xd9)](_0x26756a,NEW_CONFIG_NAME),_0x2a40ac=readConfig(),_0x5931d8=typeof _0x2a40ac[_0x3d10a6(0xf4)]===_0x3d10a6(0xd0)?_0x2a40ac[_0x3d10a6(0xf4)]:undefined,_0x3f803a={};for(const _0x45828c of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x2a40ac[_0x45828c]!=null)_0x3f803a[_0x45828c]=_0x2a40ac[_0x45828c];}const _0xc4435b=buildCanonicalProjectConfig(_0x3f803a,{'appCodes':_0xb9869f?[_0xb9869f]:[],'env':_0x126d19||_0x5931d8||_0x3d10a6(0xfc),'metadata':{'createdAt':new Date()[_0x3d10a6(0xf1)](),'version':getCliVersion()}});writeConfigFile(_0x28b4ed,_0xc4435b);}async function pullApiConfig(_0x493da3,_0x4652b0,_0x4e53bb,_0x57b9e7){const _0x5c2147=a163_0xc052,_0x514c03=process[_0x5c2147(0xfa)]();try{process[_0x5c2147(0xf5)](_0x493da3);const _0x19bac4=_0x4e53bb||_0x5c2147(0xfc);initEnv(_0x19bac4),console['log'](_0x5c2147(0xef));const {configArray:_0x1f39a7}=await fetchModelList(_0x4652b0,_0x57b9e7||''),_0x1f0022=await generateApiFile(_0x1f39a7,'',_0x4652b0,!![],_0x19bac4,DEFAULT_API_DIR);console[_0x5c2147(0xf2)](_0x5c2147(0xdb)+_0x1f39a7['length']+_0x5c2147(0xd2)+_0x1f0022[_0x5c2147(0xc6)]+'\x20model(s)');}catch(_0x1de56a){console[_0x5c2147(0xf2)]('\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`'+CLI_BIN_NAME+_0x5c2147(0xd8));}finally{process['chdir'](_0x514c03);}}function a163_0x51f8(){const _0x16e3de=['1616425sAtAcP','*\x20Creating\x20project\x20','\x20\x20Pulling\x20API\x20configuration...','writeFile','toLocaleString','log','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','env','chdir','\x20\x20√\x20Code\x20formatted','24fxUGgP','dirname','\x20created\x20successfully!','cwd','name','production','10ljbqMl','access','173058phSuHO','\x0a√\x20Project\x20','modelCount','\x20\x20√\x20Configuration\x20file\x20created','needsUpgrade','9QpRUox','\x20\x20√\x20Project\x20template\x20created','569824VsSXRk','validation','length','Project\x20name\x20cannot\x20be\x20empty.','bun\x20--version','string','4617624eeylPN','\x20dataset(s),\x20generated\x20','\x20\x20√\x20package.json\x20updated','utf-8','resolve','3161818myDPtd','bun','\x20api\x20pull`\x20manually\x20later.','join','package.json','\x20\x20√\x20Pulled\x20','6jHNegn','readFile','ignore','...','19fkoMJI','bun\x20run\x20format','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','9298ToSmNI','parse','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','13JCTEBA','Check\x20directory\x20permissions.','test','Use\x20a\x20different\x20project\x20name.','1537942YSYiHI','\x20\x20rabetbase\x20run\x20start\x0a','\x0a\x20\x20cd\x20'];a163_0x51f8=function(){return _0x16e3de;};return a163_0x51f8();}
1
+ (function(_0x5bd049,_0x5afc59){const _0x200de7=a155_0x2af8,_0x45ba78=_0x5bd049();while(!![]){try{const _0x4ce4cf=-parseInt(_0x200de7(0x11f))/0x1*(-parseInt(_0x200de7(0x13b))/0x2)+parseInt(_0x200de7(0x12b))/0x3+parseInt(_0x200de7(0x149))/0x4*(parseInt(_0x200de7(0x142))/0x5)+-parseInt(_0x200de7(0x143))/0x6*(-parseInt(_0x200de7(0x12a))/0x7)+parseInt(_0x200de7(0x13c))/0x8+-parseInt(_0x200de7(0x120))/0x9*(-parseInt(_0x200de7(0x116))/0xa)+-parseInt(_0x200de7(0x13a))/0xb;if(_0x4ce4cf===_0x5afc59)break;else _0x45ba78['push'](_0x45ba78['shift']());}catch(_0x2c04e2){_0x45ba78['push'](_0x45ba78['shift']());}}}(a155_0x26a1,0x199c4));import a155_0x3d2eca from'path';import a155_0x108a0a from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';function a155_0x26a1(){const _0x5cb937=['writeFile','\x0a\x20\x20cd\x20','readFile','string','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','trim','5006122DlYZYB','198HdUczW','817792DQePvr','belowMinimum','*\x20Creating\x20project\x20','W_OK','description','length','290aHzHLz','6PQeZVL','...','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x20\x20Pulling\x20API\x20configuration...','\x0a√\x20Project\x20','Project\x20directory\x20\x22','4220lxemTR','\x22\x20already\x20exists.','\x20api\x20pull`\x20manually\x20later.','ignore','test','needsUpgrade','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','\x20\x20√\x20Pulled\x20','join','Check\x20directory\x20permissions.','\x20\x20rabetbase\x20run\x20start\x0a','10NGUIGa','parse','log','npm','\x20\x20√\x20Project\x20template\x20created','bun','\x20\x20Installing\x20dependencies...','modelCount','bun\x20run\x20format','13GHYZwl','554157HOQOUP','production','access','\x20\x20√\x20package.json\x20updated','resolve','\x20created\x20successfully!','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','\x20\x20√\x20Configuration\x20file\x20created','bun\x20--version','Project\x20name\x20contains\x20invalid\x20characters.','1329846yakgIS','431250boureS','\x20dataset(s),\x20generated\x20','validation','package.json','chdir','dirname','Use\x20a\x20different\x20project\x20name.','cwd','toLocaleString'];a155_0x26a1=function(){return _0x5cb937;};return a155_0x26a1();}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';function a155_0x2af8(_0x119073,_0x3e9813){_0x119073=_0x119073-0x10c;const _0x26a1ce=a155_0x26a1();let _0x2af821=_0x26a1ce[_0x119073];return _0x2af821;}import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x3618e9,_0x86e5f1,_0x4567a3,_0x5e7783){const _0x44ca26=a155_0x2af8,_0x2f9ca9=await checkCliVersion();(_0x2f9ca9[_0x44ca26(0x110)]||_0x2f9ca9[_0x44ca26(0x13d)])&&(printCliUpgradeWarning(_0x2f9ca9),assertCliVersionSupported(_0x2f9ca9));if(!_0x3618e9||_0x3618e9[_0x44ca26(0x139)]()==='')throw CliErrors['validation']('Project\x20name\x20cannot\x20be\x20empty.');const _0x513e8e=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x513e8e[_0x44ca26(0x10f)](_0x3618e9))throw CliErrors[_0x44ca26(0x12d)](_0x44ca26(0x129),_0x44ca26(0x138));if(_0x3618e9[_0x44ca26(0x141)]>0x64)throw CliErrors[_0x44ca26(0x12d)](_0x44ca26(0x126));const _0x5f4b24=a155_0x3d2eca['resolve'](process[_0x44ca26(0x132)](),_0x3618e9);if(existsSync(_0x5f4b24))throw CliErrors['validation'](_0x44ca26(0x148)+_0x3618e9+_0x44ca26(0x10c),_0x44ca26(0x131));try{const _0x40a41f=a155_0x3d2eca[_0x44ca26(0x130)](_0x5f4b24);await a155_0x108a0a[_0x44ca26(0x122)](_0x40a41f,a155_0x108a0a['constants'][_0x44ca26(0x13f)]);}catch{throw CliErrors[_0x44ca26(0x12d)](_0x44ca26(0x145),_0x44ca26(0x114));}try{console['log'](_0x44ca26(0x13e)+_0x3618e9+_0x44ca26(0x144));const _0x46835d=getSubAppReactDemoTemplateDir();await copyDirectory(_0x46835d,_0x5f4b24),console[_0x44ca26(0x118)](_0x44ca26(0x11a)),await updatePackageJsonName(_0x3618e9),console[_0x44ca26(0x118)](_0x44ca26(0x123)),console[_0x44ca26(0x118)](_0x44ca26(0x11c)),console['log']('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x5f4b24),console[_0x44ca26(0x118)]('\x20\x20√\x20Code\x20formatted'),await configureProject(_0x3618e9,_0x4567a3,_0x86e5f1),console[_0x44ca26(0x118)](_0x44ca26(0x127)),_0x4567a3&&await pullApiConfig(_0x5f4b24,_0x4567a3,_0x86e5f1,_0x5e7783),console[_0x44ca26(0x118)](_0x44ca26(0x147)+_0x3618e9+_0x44ca26(0x125)),console[_0x44ca26(0x118)](_0x44ca26(0x135)+_0x3618e9),console[_0x44ca26(0x118)](_0x44ca26(0x115));}catch(_0x45c7ef){try{existsSync(_0x5f4b24)&&await a155_0x108a0a['rm'](_0x5f4b24,{'recursive':!![],'force':!![]});}catch{}throw _0x45c7ef;}}async function updatePackageJsonName(_0x4f0241){const _0x3aa607=a155_0x2af8,_0x4b80b4=a155_0x3d2eca['resolve'](process[_0x3aa607(0x132)](),_0x4f0241),_0x3a29d9=a155_0x3d2eca['join'](_0x4b80b4,_0x3aa607(0x12e)),_0x43fdc7=await a155_0x108a0a[_0x3aa607(0x136)](_0x3a29d9,'utf-8'),_0x57e86d=JSON[_0x3aa607(0x117)](_0x43fdc7);_0x57e86d['name']=_0x4f0241,_0x57e86d[_0x3aa607(0x140)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a155_0x108a0a[_0x3aa607(0x134)](_0x3a29d9,JSON['stringify'](_0x57e86d,null,0x2)+'\x0a');}function detectPackageManager(){const _0x38a9a0=a155_0x2af8;try{return execSync(_0x38a9a0(0x128),{'stdio':_0x38a9a0(0x10e)}),_0x38a9a0(0x11b);}catch{return _0x38a9a0(0x119);}}async function formatCode(_0xb6c172){const _0x6630a1=a155_0x2af8;try{await execAsync(_0x6630a1(0x11e),{'cwd':_0xb6c172});}catch{}}async function configureProject(_0x4c852c,_0x51d9e0,_0x286fff){const _0x32564c=a155_0x2af8,_0x46d256=a155_0x3d2eca[_0x32564c(0x124)](process[_0x32564c(0x132)](),_0x4c852c),_0xd00453=a155_0x3d2eca[_0x32564c(0x113)](_0x46d256,NEW_CONFIG_NAME),_0x176d10=readConfig(),_0x5c8d53=typeof _0x176d10['env']===_0x32564c(0x137)?_0x176d10['env']:undefined,_0x516e8d={};for(const _0x1b2d67 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x176d10[_0x1b2d67]!=null)_0x516e8d[_0x1b2d67]=_0x176d10[_0x1b2d67];}const _0x2fed5c=buildCanonicalProjectConfig(_0x516e8d,{'appCodes':_0x51d9e0?[_0x51d9e0]:[],'env':_0x286fff||_0x5c8d53||_0x32564c(0x121),'metadata':{'createdAt':new Date()[_0x32564c(0x133)](),'version':getCliVersion()}});writeConfigFile(_0xd00453,_0x2fed5c);}async function pullApiConfig(_0x7969c0,_0x58e817,_0x4bc345,_0x5309a8){const _0x3af761=a155_0x2af8,_0x330047=process[_0x3af761(0x132)]();try{process[_0x3af761(0x12f)](_0x7969c0);const _0x6018ec=_0x4bc345||_0x3af761(0x121);initEnv(_0x6018ec),console[_0x3af761(0x118)](_0x3af761(0x146));const {configArray:_0x2fb828}=await fetchModelList(_0x58e817,_0x5309a8||''),_0x3ecc18=await generateApiFile(_0x2fb828,'',_0x58e817,!![],_0x6018ec,DEFAULT_API_DIR);console['log'](_0x3af761(0x112)+_0x2fb828[_0x3af761(0x141)]+_0x3af761(0x12c)+_0x3ecc18[_0x3af761(0x11d)]+'\x20model(s)');}catch(_0xa17fa3){console[_0x3af761(0x118)](_0x3af761(0x111)+CLI_BIN_NAME+_0x3af761(0x10d));}finally{process[_0x3af761(0x12f)](_0x330047);}}
@@ -1 +1 @@
1
- (function(_0x4b98dd,_0x4c6893){const _0x14effa=a164_0x2980,_0x1f43d7=_0x4b98dd();while(!![]){try{const _0x127284=parseInt(_0x14effa(0x168))/0x1*(-parseInt(_0x14effa(0x16c))/0x2)+-parseInt(_0x14effa(0x169))/0x3+-parseInt(_0x14effa(0x166))/0x4+parseInt(_0x14effa(0x16d))/0x5*(-parseInt(_0x14effa(0x172))/0x6)+parseInt(_0x14effa(0x167))/0x7*(parseInt(_0x14effa(0x16f))/0x8)+-parseInt(_0x14effa(0x16a))/0x9+parseInt(_0x14effa(0x170))/0xa;if(_0x127284===_0x4c6893)break;else _0x1f43d7['push'](_0x1f43d7['shift']());}catch(_0x320b42){_0x1f43d7['push'](_0x1f43d7['shift']());}}}(a164_0x4957,0x65769));import a164_0x489386 from'node:path';function a164_0x2980(_0x55f5f7,_0x355eff){_0x55f5f7=_0x55f5f7-0x166;const _0x4957dd=a164_0x4957();let _0x2980af=_0x4957dd[_0x55f5f7];return _0x2980af;}import{fileURLToPath}from'node:url';function a164_0x4957(){const _0x2bb864=['8WQDdYU','7483320orBIHD','projects','6EAQrwZ','12784Kxjotw','4240012yylDwv','5EJdqGZ','1001418TbtvtX','1255365IlziDq','templates','137118yXZLed','595865sYeGlg','../../../../'];a164_0x4957=function(){return _0x2bb864;};return a164_0x4957();}const __dirname=a164_0x489386['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x2d2748=a164_0x2980;return a164_0x489386['resolve'](__dirname,_0x2d2748(0x16e));}export function getSubAppReactDemoTemplateDir(){const _0x304099=a164_0x2980;return a164_0x489386['join'](getRabetbaseCliPackageRoot(),_0x304099(0x16b),_0x304099(0x171),'sub-app-react-demo');}
1
+ function a156_0xd36d(_0x3422c8,_0x86cb99){_0x3422c8=_0x3422c8-0xb8;const _0x103f0f=a156_0x103f();let _0xd36d92=_0x103f0f[_0x3422c8];return _0xd36d92;}(function(_0x263c37,_0x34765a){const _0x5e8761=a156_0xd36d,_0xdf5134=_0x263c37();while(!![]){try{const _0x59f3e9=-parseInt(_0x5e8761(0xbf))/0x1*(parseInt(_0x5e8761(0xc1))/0x2)+parseInt(_0x5e8761(0xc3))/0x3+parseInt(_0x5e8761(0xbc))/0x4+-parseInt(_0x5e8761(0xbd))/0x5*(parseInt(_0x5e8761(0xbe))/0x6)+-parseInt(_0x5e8761(0xc4))/0x7*(parseInt(_0x5e8761(0xc2))/0x8)+-parseInt(_0x5e8761(0xc7))/0x9*(parseInt(_0x5e8761(0xc0))/0xa)+-parseInt(_0x5e8761(0xc6))/0xb*(-parseInt(_0x5e8761(0xbb))/0xc);if(_0x59f3e9===_0x34765a)break;else _0xdf5134['push'](_0xdf5134['shift']());}catch(_0x458561){_0xdf5134['push'](_0xdf5134['shift']());}}}(a156_0x103f,0xd487d));import a156_0x504195 from'node:path';function a156_0x103f(){const _0x42d640=['30983412JBVAHv','68856LHxBCh','14095vbcgxW','1578PnzYWn','37585luIBrO','2823910Bjowyf','18lGcnpz','72oMUsPo','3191877ueoBrz','673372KBWjLQ','resolve','11WheqzY','27znluXZ','sub-app-react-demo','../../../../','join','projects'];a156_0x103f=function(){return _0x42d640;};return a156_0x103f();}import{fileURLToPath}from'node:url';const __dirname=a156_0x504195['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x3a2b2e=a156_0xd36d;return a156_0x504195[_0x3a2b2e(0xc5)](__dirname,_0x3a2b2e(0xb8));}export function getSubAppReactDemoTemplateDir(){const _0x475613=a156_0xd36d;return a156_0x504195[_0x475613(0xb9)](getRabetbaseCliPackageRoot(),'templates',_0x475613(0xba),_0x475613(0xc8));}
@@ -1 +1 @@
1
- (function(_0x4e89f2,_0x24b9a2){const _0x2b0129=a165_0x3ce1,_0x14ed4c=_0x4e89f2();while(!![]){try{const _0x53575f=parseInt(_0x2b0129(0xea))/0x1+parseInt(_0x2b0129(0xec))/0x2+parseInt(_0x2b0129(0xe7))/0x3*(-parseInt(_0x2b0129(0xe2))/0x4)+-parseInt(_0x2b0129(0xef))/0x5*(-parseInt(_0x2b0129(0xf0))/0x6)+parseInt(_0x2b0129(0xe9))/0x7*(parseInt(_0x2b0129(0xe3))/0x8)+-parseInt(_0x2b0129(0xe0))/0x9+-parseInt(_0x2b0129(0xe6))/0xa;if(_0x53575f===_0x24b9a2)break;else _0x14ed4c['push'](_0x14ed4c['shift']());}catch(_0x325d8e){_0x14ed4c['push'](_0x14ed4c['shift']());}}}(a165_0x55f6,0xac380));import a165_0x417471 from'node:path';function a165_0x3ce1(_0x16e249,_0x1db505){_0x16e249=_0x16e249-0xe0;const _0x55f614=a165_0x55f6();let _0x3ce13a=_0x55f614[_0x16e249];return _0x3ce13a;}import{copyDirectory}from'../../../utils/copy-directory.js';function a165_0x55f6(){const _0x4cb22f=['3973491TTYrag','cwd','1169624SJaMIO','8IzUZik','copy','info','8156270TlKNdT','3mcwUvO','开始复制项目模板','6959365VFcrbl','503920cqQfGH','now','26230FkpvSW','success','resolve','50UlYfnv','446226kLQKXk','message','项目模板复制失败','error'];a165_0x55f6=function(){return _0x4cb22f;};return a165_0x55f6();}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x21a1f2){const _0x1f40c6=a165_0x3ce1,_0x1bf7de=Date['now'](),_0x35587c=a165_0x417471[_0x1f40c6(0xee)](process[_0x1f40c6(0xe1)](),_0x21a1f2);try{logger[_0x1f40c6(0xe5)](_0x1f40c6(0xe4),_0x1f40c6(0xe8),{'projectCode':_0x21a1f2,'templateDir':templateDir}),await copyDirectory(templateDir,_0x35587c);const _0x22dc6c=Date[_0x1f40c6(0xeb)]()-_0x1bf7de;logger[_0x1f40c6(0xed)](_0x1f40c6(0xe4),'项目模板复制完成',_0x22dc6c,{'projectCode':_0x21a1f2});}catch(_0x3f05f5){const _0x85cd0a=Date[_0x1f40c6(0xeb)]()-_0x1bf7de;logger[_0x1f40c6(0xf3)]('copy',_0x1f40c6(0xf2),{'projectCode':_0x21a1f2,'error':_0x3f05f5 instanceof Error?_0x3f05f5[_0x1f40c6(0xf1)]:String(_0x3f05f5),'duration':_0x85cd0a});throw _0x3f05f5;}return formatElapsed(_0x1bf7de);}
1
+ function a157_0x3d56(_0x597835,_0x14b193){_0x597835=_0x597835-0x198;const _0x2f8eae=a157_0x2f8e();let _0x3d56ab=_0x2f8eae[_0x597835];return _0x3d56ab;}(function(_0x23cde5,_0xcd815a){const _0x252db3=a157_0x3d56,_0x2eff79=_0x23cde5();while(!![]){try{const _0x16cea7=-parseInt(_0x252db3(0x19f))/0x1+-parseInt(_0x252db3(0x19b))/0x2+-parseInt(_0x252db3(0x1a7))/0x3+parseInt(_0x252db3(0x198))/0x4*(-parseInt(_0x252db3(0x19a))/0x5)+-parseInt(_0x252db3(0x1a0))/0x6+-parseInt(_0x252db3(0x1a3))/0x7*(-parseInt(_0x252db3(0x1a8))/0x8)+parseInt(_0x252db3(0x19e))/0x9;if(_0x16cea7===_0xcd815a)break;else _0x2eff79['push'](_0x2eff79['shift']());}catch(_0x512965){_0x2eff79['push'](_0x2eff79['shift']());}}}(a157_0x2f8e,0x80efb));function a157_0x2f8e(){const _0x4d7839=['3699480gjoMVV','success','cwd','2513vinaFc','开始复制项目模板','项目模板复制完成','message','233862DiFwqW','14256DXEbcy','8XXSFKL','now','2564975SJpgNx','698730OGdqIV','error','copy','24016365SzGOTl','710211jeEVKw'];a157_0x2f8e=function(){return _0x4d7839;};return a157_0x2f8e();}import a157_0x3e9092 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';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x5a1e6f){const _0x58d681=a157_0x3d56,_0x2b56b6=Date[_0x58d681(0x199)](),_0x47254e=a157_0x3e9092['resolve'](process[_0x58d681(0x1a2)](),_0x5a1e6f);try{logger['info']('copy',_0x58d681(0x1a4),{'projectCode':_0x5a1e6f,'templateDir':templateDir}),await copyDirectory(templateDir,_0x47254e);const _0x9fb3df=Date['now']()-_0x2b56b6;logger[_0x58d681(0x1a1)](_0x58d681(0x19d),_0x58d681(0x1a5),_0x9fb3df,{'projectCode':_0x5a1e6f});}catch(_0x56a435){const _0x224d2b=Date['now']()-_0x2b56b6;logger[_0x58d681(0x19c)](_0x58d681(0x19d),'项目模板复制失败',{'projectCode':_0x5a1e6f,'error':_0x56a435 instanceof Error?_0x56a435[_0x58d681(0x1a6)]:String(_0x56a435),'duration':_0x224d2b});throw _0x56a435;}return formatElapsed(_0x2b56b6);}
@@ -1 +1 @@
1
- function a166_0x26a5(){const _0x5daf48=['now','代码格式化失败','3402890KgUEAc','info','789930ZBCjOd','564735KXUdgN','196xVSyFP','error','10662cpxPxO','prettier','npx','69966BUZCyC','27868HpDsoE','152HKDQBn','success','12HtgINm','168728LBExQS','--write','resolve','format'];a166_0x26a5=function(){return _0x5daf48;};return a166_0x26a5();}(function(_0x1ad93b,_0x80cea7){const _0xbfd786=a166_0x1668,_0x1e9456=_0x1ad93b();while(!![]){try{const _0x296765=parseInt(_0xbfd786(0x1d7))/0x1+parseInt(_0xbfd786(0x1ea))/0x2+-parseInt(_0xbfd786(0x1e7))/0x3*(parseInt(_0xbfd786(0x1e5))/0x4)+parseInt(_0xbfd786(0x1e4))/0x5*(-parseInt(_0xbfd786(0x1da))/0x6)+parseInt(_0xbfd786(0x1db))/0x7*(parseInt(_0xbfd786(0x1d8))/0x8)+-parseInt(_0xbfd786(0x1e3))/0x9+parseInt(_0xbfd786(0x1e1))/0xa;if(_0x296765===_0x80cea7)break;else _0x1e9456['push'](_0x1e9456['shift']());}catch(_0x4593c6){_0x1e9456['push'](_0x1e9456['shift']());}}}(a166_0x26a5,0x5b23a));import a166_0x4ec89b from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a166_0x1668(_0xa9b2b6,_0x30dd3f){_0xa9b2b6=_0xa9b2b6-0x1d7;const _0x26a515=a166_0x26a5();let _0x1668a8=_0x26a515[_0xa9b2b6];return _0x1668a8;}import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x4c1987){const _0x1661c3=a166_0x1668,_0x13f55c=Date[_0x1661c3(0x1df)](),_0x1c4b9a=a166_0x4ec89b[_0x1661c3(0x1dd)](process['cwd'](),_0x4c1987);try{logger[_0x1661c3(0x1e2)](_0x1661c3(0x1de),'开始格式化代码',{'projectCode':_0x4c1987}),await execa(resolveNpmBin(_0x1661c3(0x1e9)),[_0x1661c3(0x1e8),_0x1661c3(0x1dc),'.'],{'cwd':_0x1c4b9a});const _0x1ef9d0=Date[_0x1661c3(0x1df)]()-_0x13f55c;logger[_0x1661c3(0x1d9)](_0x1661c3(0x1de),'代码格式化完成',_0x1ef9d0,{'projectCode':_0x4c1987});}catch(_0x154956){const _0xe61598=Date[_0x1661c3(0x1df)]()-_0x13f55c;logger[_0x1661c3(0x1e6)](_0x1661c3(0x1de),_0x1661c3(0x1e0),{'projectCode':_0x4c1987,'error':_0x154956 instanceof Error?_0x154956['message']:String(_0x154956),'duration':_0xe61598});throw _0x154956;}return formatElapsed(_0x13f55c);}
1
+ (function(_0x1edfec,_0x23baf1){const _0x3de3da=a158_0x5e47,_0x17f9ae=_0x1edfec();while(!![]){try{const _0x408096=parseInt(_0x3de3da(0x108))/0x1*(parseInt(_0x3de3da(0x106))/0x2)+-parseInt(_0x3de3da(0x10a))/0x3*(-parseInt(_0x3de3da(0xfb))/0x4)+-parseInt(_0x3de3da(0xfc))/0x5+parseInt(_0x3de3da(0x105))/0x6*(parseInt(_0x3de3da(0x104))/0x7)+parseInt(_0x3de3da(0x107))/0x8*(parseInt(_0x3de3da(0xff))/0x9)+-parseInt(_0x3de3da(0xfd))/0xa+parseInt(_0x3de3da(0x102))/0xb*(-parseInt(_0x3de3da(0xfe))/0xc);if(_0x408096===_0x23baf1)break;else _0x17f9ae['push'](_0x17f9ae['shift']());}catch(_0x522172){_0x17f9ae['push'](_0x17f9ae['shift']());}}}(a158_0x3d73,0x46527));import a158_0x3ffc49 from'node:path';function a158_0x5e47(_0x388dee,_0x5519c4){_0x388dee=_0x388dee-0xf9;const _0x3d7348=a158_0x3d73();let _0x5e4797=_0x3d7348[_0x388dee];return _0x5e4797;}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x140476){const _0x123b5c=a158_0x5e47,_0x270521=Date[_0x123b5c(0xfa)](),_0x36288c=a158_0x3ffc49['resolve'](process['cwd'](),_0x140476);try{logger[_0x123b5c(0x10c)](_0x123b5c(0x10b),'开始格式化代码',{'projectCode':_0x140476}),await execa(resolveNpmBin('npx'),[_0x123b5c(0xf9),_0x123b5c(0x101),'.'],{'cwd':_0x36288c});const _0x2127c4=Date[_0x123b5c(0xfa)]()-_0x270521;logger['success'](_0x123b5c(0x10b),_0x123b5c(0x109),_0x2127c4,{'projectCode':_0x140476});}catch(_0x4cc535){const _0x4a87a9=Date[_0x123b5c(0xfa)]()-_0x270521;logger[_0x123b5c(0x103)](_0x123b5c(0x10b),_0x123b5c(0x100),{'projectCode':_0x140476,'error':_0x4cc535 instanceof Error?_0x4cc535[_0x123b5c(0x10d)]:String(_0x4cc535),'duration':_0x4a87a9});throw _0x4cc535;}return formatElapsed(_0x270521);}function a158_0x3d73(){const _0x44315b=['3VHKCBR','format','info','message','prettier','now','2293336gxBZWx','1219065fZyZWz','1214450uPPcvu','60uAvbis','9xPeosL','代码格式化失败','--write','2095819wFyldF','error','590723HGALuF','30wXdDhX','26WzldiQ','1254040hYFrCu','34916XxxCEK','代码格式化完成'];a158_0x3d73=function(){return _0x44315b;};return a158_0x3d73();}
@@ -1 +1 @@
1
- function a167_0x7b8e(){const _0x106236=['https://registry.npmmirror.com','依赖安装失败','npm','35NkBIJp','1351461PgzuTb','510272fJPGNO','cwd','install','success','4LzzqHh','依赖安装完成','message','866658FOZLeS','6947535MtRmAC','1567552zYyVnR','now','111537rgJQGx','error','info','285613OFdkXi','开始安装依赖'];a167_0x7b8e=function(){return _0x106236;};return a167_0x7b8e();}(function(_0x187e60,_0x4e2424){const _0x4ef67e=a167_0x1b1c,_0x26e4c3=_0x187e60();while(!![]){try{const _0x3f79e3=-parseInt(_0x4ef67e(0xd1))/0x1+-parseInt(_0x4ef67e(0xc7))/0x2*(-parseInt(_0x4ef67e(0xc2))/0x3)+parseInt(_0x4ef67e(0xc3))/0x4+-parseInt(_0x4ef67e(0xc1))/0x5*(parseInt(_0x4ef67e(0xca))/0x6)+parseInt(_0x4ef67e(0xcb))/0x7+-parseInt(_0x4ef67e(0xcc))/0x8+-parseInt(_0x4ef67e(0xce))/0x9;if(_0x3f79e3===_0x4e2424)break;else _0x26e4c3['push'](_0x26e4c3['shift']());}catch(_0x50cca6){_0x26e4c3['push'](_0x26e4c3['shift']());}}}(a167_0x7b8e,0x7df9c));import a167_0x2828be from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a167_0x1b1c(_0x143447,_0x5380a9){_0x143447=_0x143447-0xbf;const _0x7b8e0d=a167_0x7b8e();let _0x1b1cf2=_0x7b8e0d[_0x143447];return _0x1b1cf2;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x4d95de){const _0x1475f7=a167_0x1b1c,_0x2df2b0=Date[_0x1475f7(0xcd)](),_0x1b60d6=a167_0x2828be['resolve'](process[_0x1475f7(0xc4)](),_0x4d95de);try{logger[_0x1475f7(0xd0)](_0x1475f7(0xc5),_0x1475f7(0xd2),{'projectCode':_0x4d95de,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin(_0x1475f7(0xc0)),[_0x1475f7(0xc5),'--registry',_0x1475f7(0xd3)],{'cwd':_0x1b60d6});const _0x31743b=Date[_0x1475f7(0xcd)]()-_0x2df2b0;logger[_0x1475f7(0xc6)](_0x1475f7(0xc5),_0x1475f7(0xc8),_0x31743b,{'projectCode':_0x4d95de});}catch(_0x58ab6d){const _0x483c24=Date['now']()-_0x2df2b0;logger[_0x1475f7(0xcf)](_0x1475f7(0xc5),_0x1475f7(0xbf),{'projectCode':_0x4d95de,'error':_0x58ab6d instanceof Error?_0x58ab6d[_0x1475f7(0xc9)]:String(_0x58ab6d),'duration':_0x483c24});throw _0x58ab6d;}return formatElapsed(_0x2df2b0);}
1
+ function a159_0x4a2c(_0x120b97,_0x264bbf){_0x120b97=_0x120b97-0x14e;const _0x158ea1=a159_0x158e();let _0x4a2cd1=_0x158ea1[_0x120b97];return _0x4a2cd1;}(function(_0x502ce7,_0x3fa33c){const _0x46c640=a159_0x4a2c,_0x5b05c8=_0x502ce7();while(!![]){try{const _0x2e728e=parseInt(_0x46c640(0x155))/0x1+-parseInt(_0x46c640(0x14f))/0x2*(parseInt(_0x46c640(0x162))/0x3)+parseInt(_0x46c640(0x159))/0x4+parseInt(_0x46c640(0x156))/0x5*(-parseInt(_0x46c640(0x15b))/0x6)+-parseInt(_0x46c640(0x157))/0x7*(-parseInt(_0x46c640(0x15d))/0x8)+parseInt(_0x46c640(0x152))/0x9+parseInt(_0x46c640(0x153))/0xa;if(_0x2e728e===_0x3fa33c)break;else _0x5b05c8['push'](_0x5b05c8['shift']());}catch(_0x347d43){_0x5b05c8['push'](_0x5b05c8['shift']());}}}(a159_0x158e,0xa4073));import a159_0x19d611 from'node:path';function a159_0x158e(){const _0x3c1a42=['install','message','resolve','info','297lzNwHp','success','5488cIRLrC','--registry','error','6220638vVktgQ','7275520uDJAAC','https://registry.npmmirror.com','555339ZTyDpU','3244695DzCqwk','581KLKnyS','依赖安装完成','776788CnSuFc','now','12HVNoaM','依赖安装失败','7048HOtLBD'];a159_0x158e=function(){return _0x3c1a42;};return a159_0x158e();}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(_0x1d8177){const _0x4f04dc=a159_0x4a2c,_0x200d22=Date[_0x4f04dc(0x15a)](),_0x12cc3f=a159_0x19d611[_0x4f04dc(0x160)](process['cwd'](),_0x1d8177);try{logger[_0x4f04dc(0x161)](_0x4f04dc(0x15e),'开始安装依赖',{'projectCode':_0x1d8177,'registry':_0x4f04dc(0x154)}),await execa(resolveNpmBin('npm'),[_0x4f04dc(0x15e),_0x4f04dc(0x150),'https://registry.npmmirror.com'],{'cwd':_0x12cc3f});const _0x3b481f=Date[_0x4f04dc(0x15a)]()-_0x200d22;logger[_0x4f04dc(0x14e)](_0x4f04dc(0x15e),_0x4f04dc(0x158),_0x3b481f,{'projectCode':_0x1d8177});}catch(_0x41ceb5){const _0x3963a3=Date[_0x4f04dc(0x15a)]()-_0x200d22;logger[_0x4f04dc(0x151)](_0x4f04dc(0x15e),_0x4f04dc(0x15c),{'projectCode':_0x1d8177,'error':_0x41ceb5 instanceof Error?_0x41ceb5[_0x4f04dc(0x15f)]:String(_0x41ceb5),'duration':_0x3963a3});throw _0x41ceb5;}return formatElapsed(_0x200d22);}
@@ -1 +1 @@
1
- function a168_0x5794(){const _0x2204c4=['trim','boolean','54MPDUqC','appcode','create','291895TMnClS','str','870266cDogFo','nonInteractive','project-name','Project\x20name','2387184SVmyYN','write','env','yes','512944lzavJl','65736fDFIVM','bool','Usage:\x20','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','../../commands/project/create/non-interactive.js','project','63jOvWAA','1024428zgQLUH','validation','19511181CGVndE','Target\x20environment','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','../../commands/project/create/main.js','cookie','string','name','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)'];a168_0x5794=function(){return _0x2204c4;};return a168_0x5794();}const a168_0x780458=a168_0xe3f3;(function(_0x3f2e7f,_0x21e209){const _0x33b6da=a168_0xe3f3,_0x5ebb7b=_0x3f2e7f();while(!![]){try{const _0x6aced5=parseInt(_0x33b6da(0x1b7))/0x1+parseInt(_0x33b6da(0x19a))/0x2+parseInt(_0x33b6da(0x1a6))/0x3+-parseInt(_0x33b6da(0x19e))/0x4+-parseInt(_0x33b6da(0x1b5))/0x5*(-parseInt(_0x33b6da(0x1b2))/0x6)+parseInt(_0x33b6da(0x1a5))/0x7*(parseInt(_0x33b6da(0x19f))/0x8)+-parseInt(_0x33b6da(0x1a8))/0x9;if(_0x6aced5===_0x21e209)break;else _0x5ebb7b['push'](_0x5ebb7b['shift']());}catch(_0x5c660d){_0x5ebb7b['push'](_0x5ebb7b['shift']());}}}(a168_0x5794,0xacfc9));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';function a168_0xe3f3(_0x4a46fd,_0xd8aaf4){_0x4a46fd=_0x4a46fd-0x199;const _0x579442=a168_0x5794();let _0xe3f385=_0x579442[_0x4a46fd];return _0xe3f385;}const createFlags=[{'name':a168_0x780458(0x1ae),'type':a168_0x780458(0x1ad),'description':a168_0x780458(0x199)},{'name':a168_0x780458(0x19c),'type':'string','description':a168_0x780458(0x1a9)},{'name':a168_0x780458(0x1b3),'type':'string','description':a168_0x780458(0x1a2)}],upgradeFlags=[{'name':a168_0x780458(0x19d),'type':a168_0x780458(0x1b1),'description':'Skip\x20confirmation\x20prompt','default':![]}];export const projectDefinitions=[{'service':a168_0x780458(0x1a4),'command':a168_0x780458(0x1b4),'description':'Create\x20a\x20new\x20project','risk':a168_0x780458(0x19b),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a168_0x780458(0x1b9),'description':a168_0x780458(0x1af),'required':![]}],'flags':createFlags,async 'execute'(_0xff3b9d){const _0x1a6f2f=a168_0x780458,{createApp:_0x2e8625}=await import(_0x1a6f2f(0x1ab)),{createProjectNonInteractive:_0xe4485e}=await import(_0x1a6f2f(0x1a3)),_0x20be97=_0xff3b9d['str'](_0x1a6f2f(0x1ae))[_0x1a6f2f(0x1b0)]()||_0xff3b9d['args'][0x0]?.[_0x1a6f2f(0x1b0)](),_0x44f283=_0xff3b9d['str'](_0x1a6f2f(0x19c))||undefined,_0x84e735=_0xff3b9d[_0x1a6f2f(0x1b6)](_0x1a6f2f(0x1b3))||undefined;if(_0xff3b9d[_0x1a6f2f(0x1b8)]){if(!_0x20be97)throw CliErrors[_0x1a6f2f(0x1a7)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x1a6f2f(0x1a1)+CLI_BIN_NAME+_0x1a6f2f(0x1aa));await _0xe4485e(_0x20be97,_0x44f283,_0x84e735,_0xff3b9d['cookie']);}else await _0x2e8625({'projectCode':_0x20be97,'appCode':_0x84e735,'env':_0x44f283,'cookie':_0xff3b9d[_0x1a6f2f(0x1ac)]});return{'ok':!![]};}},{'service':a168_0x780458(0x1a4),'command':'upgrade','description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a168_0x780458(0x19b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x1c3d88){const _0x8e058f=a168_0x780458;return await upgradeApp(_0x1c3d88[_0x8e058f(0x1b8)],{'yes':_0x1c3d88[_0x8e058f(0x1a0)](_0x8e058f(0x19d))}),{'ok':!![]};}}];
1
+ function a160_0x5ba4(_0x25a9ba,_0x4f941d){_0x25a9ba=_0x25a9ba-0x1a2;const _0x57d12e=a160_0x57d1();let _0x5ba415=_0x57d12e[_0x25a9ba];return _0x5ba415;}function a160_0x57d1(){const _0x3856a9=['3438hKMmph','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','trim','upgrade','Project\x20name','Target\x20environment','1794kESCKk','create','yes','cookie','16HMTqHR','Create\x20a\x20new\x20project','2220655fCWMkv','7377560rhivwN','../../commands/project/create/main.js','args','env','bool','string','21809183JfThtD','name','54850Gzprdx','str','project','12BjfpVD','Usage:\x20','Skip\x20confirmation\x20prompt','1435gXBJla','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','1591297TPpHhH','appcode','2007EkqbnQ','project-name','2721AOWHUS'];a160_0x57d1=function(){return _0x3856a9;};return a160_0x57d1();}const a160_0x59e7c1=a160_0x5ba4;(function(_0x386f31,_0x1fd620){const _0x2187ac=a160_0x5ba4,_0x3dc2bd=_0x386f31();while(!![]){try{const _0xaad1c0=-parseInt(_0x2187ac(0x1b8))/0x1+parseInt(_0x2187ac(0x1bd))/0x2*(-parseInt(_0x2187ac(0x1bc))/0x3)+-parseInt(_0x2187ac(0x1a4))/0x4*(-parseInt(_0x2187ac(0x1a6))/0x5)+parseInt(_0x2187ac(0x1c3))/0x6*(parseInt(_0x2187ac(0x1b5))/0x7)+-parseInt(_0x2187ac(0x1a7))/0x8+-parseInt(_0x2187ac(0x1ba))/0x9*(-parseInt(_0x2187ac(0x1af))/0xa)+parseInt(_0x2187ac(0x1ad))/0xb*(parseInt(_0x2187ac(0x1b2))/0xc);if(_0xaad1c0===_0x1fd620)break;else _0x3dc2bd['push'](_0x3dc2bd['shift']());}catch(_0x344b86){_0x3dc2bd['push'](_0x3dc2bd['shift']());}}}(a160_0x57d1,0xed0fa));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';const createFlags=[{'name':a160_0x59e7c1(0x1ae),'type':a160_0x59e7c1(0x1ac),'description':a160_0x59e7c1(0x1c1)},{'name':a160_0x59e7c1(0x1aa),'type':'string','description':a160_0x59e7c1(0x1c2)},{'name':a160_0x59e7c1(0x1b9),'type':'string','description':a160_0x59e7c1(0x1be)}],upgradeFlags=[{'name':a160_0x59e7c1(0x1a2),'type':'boolean','description':a160_0x59e7c1(0x1b4),'default':![]}];export const projectDefinitions=[{'service':a160_0x59e7c1(0x1b1),'command':a160_0x59e7c1(0x1c4),'description':a160_0x59e7c1(0x1a5),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a160_0x59e7c1(0x1bb),'description':a160_0x59e7c1(0x1b7),'required':![]}],'flags':createFlags,async 'execute'(_0xa689f6){const _0x1a956d=a160_0x59e7c1,{createApp:_0x226bfc}=await import(_0x1a956d(0x1a8)),{createProjectNonInteractive:_0x3f6993}=await import('../../commands/project/create/non-interactive.js'),_0x16a002=_0xa689f6[_0x1a956d(0x1b0)](_0x1a956d(0x1ae))[_0x1a956d(0x1bf)]()||_0xa689f6[_0x1a956d(0x1a9)][0x0]?.[_0x1a956d(0x1bf)](),_0x1c06a7=_0xa689f6[_0x1a956d(0x1b0)]('env')||undefined,_0x22ad9c=_0xa689f6[_0x1a956d(0x1b0)]('appcode')||undefined;if(_0xa689f6['nonInteractive']){if(!_0x16a002)throw CliErrors['validation']('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x1a956d(0x1b3)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0x3f6993(_0x16a002,_0x1c06a7,_0x22ad9c,_0xa689f6[_0x1a956d(0x1a3)]);}else await _0x226bfc({'projectCode':_0x16a002,'appCode':_0x22ad9c,'env':_0x1c06a7,'cookie':_0xa689f6[_0x1a956d(0x1a3)]});return{'ok':!![]};}},{'service':'project','command':a160_0x59e7c1(0x1c0),'description':a160_0x59e7c1(0x1b6),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x3d2947){const _0x397858=a160_0x59e7c1;return await upgradeApp(_0x3d2947['nonInteractive'],{'yes':_0x3d2947[_0x397858(0x1ab)](_0x397858(0x1a2))}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a169_0x3ad34d=a169_0x40c0;(function(_0x5a4709,_0x24a4f2){const _0x2fd8ce=a169_0x40c0,_0x32a8d4=_0x5a4709();while(!![]){try{const _0x3e0add=parseInt(_0x2fd8ce(0xd3))/0x1*(parseInt(_0x2fd8ce(0xed))/0x2)+-parseInt(_0x2fd8ce(0x111))/0x3+-parseInt(_0x2fd8ce(0x12f))/0x4+-parseInt(_0x2fd8ce(0x10a))/0x5*(parseInt(_0x2fd8ce(0xfc))/0x6)+-parseInt(_0x2fd8ce(0x129))/0x7*(parseInt(_0x2fd8ce(0x13a))/0x8)+parseInt(_0x2fd8ce(0xf7))/0x9*(-parseInt(_0x2fd8ce(0xcb))/0xa)+parseInt(_0x2fd8ce(0xc6))/0xb;if(_0x3e0add===_0x24a4f2)break;else _0x32a8d4['push'](_0x32a8d4['shift']());}catch(_0x5e8fab){_0x32a8d4['push'](_0x32a8d4['shift']());}}}(a169_0x311a,0x29173));import a169_0x5ea9a7 from'chalk';import a169_0x5f128a 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_0x3ad34d(0x126)](_0x3940df=>_0x3940df!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x46c863){const _0xb1e108=a169_0x3ad34d,_0x39d9f6=[];for(const _0x1330d1 of Object['values'](CORE_IDE_CONFIGS)){if(_0x1330d1[_0xb1e108(0x10b)])for(const _0x27433c of _0x1330d1[_0xb1e108(0x10b)]){_0x39d9f6[_0xb1e108(0xfa)](resolve(_0x46c863,_0x27433c[_0xb1e108(0xf1)]));}}return _0x39d9f6;}function analyse(_0x1f8077){const _0xe7667=a169_0x3ad34d;let _0x35dff4=null;const _0x5dd41b=resolve(_0x1f8077,NEW_CONFIG_NAME),_0x1184c7=existsSync(_0x5dd41b);for(const _0x5aa12c of LEGACY_CONFIG_NAMES){const _0x2c6df9=resolve(_0x1f8077,_0x5aa12c);if(existsSync(_0x2c6df9)){const _0xdbd6e6=readConfigFile(_0x2c6df9),_0x3790da=Object[_0xe7667(0x12c)](_0xdbd6e6)[_0xe7667(0x126)](_0x1f17eb=>typeof _0xdbd6e6[_0x1f17eb]!=='undefined');_0x35dff4={'oldPath':_0x2c6df9,'hasNewConfig':_0x1184c7,'fields':_0x3790da};break;}}const _0x40c812=[],_0x12fcc7=resolve(_0x1f8077,_0xe7667(0xf9));if(existsSync(_0x12fcc7))_0x40c812[_0xe7667(0xfa)](_0x12fcc7);const _0x30a688=resolve(_0x1f8077,_0xe7667(0x138));if(existsSync(_0x30a688))_0x40c812['push'](_0x30a688);const _0x23bbf4=resolve(_0x1f8077,_0xe7667(0xcc));if(existsSync(_0x23bbf4))_0x40c812['push'](_0x23bbf4);for(const _0x10d43d of collectIdeSkillFiles(_0x1f8077)){if(existsSync(_0x10d43d))_0x40c812['push'](_0x10d43d);}let _0x5dbbdc=null;const _0x3bd58c=resolve(_0x1f8077,_0xe7667(0x100));if(existsSync(_0x3bd58c))try{const _0x905a56=JSON[_0xe7667(0x137)](readFileSync(_0x3bd58c,'utf8'));if(_0x905a56?.[_0xe7667(0xd2)]&&typeof _0x905a56['mcpServers']===_0xe7667(0x11b)){const _0xeb4bf8=[];for(const [_0x578c96,_0x46b534]of Object[_0xe7667(0x12e)](_0x905a56[_0xe7667(0xd2)])){const _0x4dc6dd=_0x46b534;_0x4dc6dd?.[_0xe7667(0x118)]&&Array['isArray'](_0x4dc6dd[_0xe7667(0x118)])&&_0x4dc6dd[_0xe7667(0x118)][_0xe7667(0x104)](_0x6133a3=>typeof _0x6133a3==='string'&&_0x6133a3[_0xe7667(0x117)](_0xe7667(0x110)))&&_0xeb4bf8[_0xe7667(0xfa)](_0x578c96);}_0xeb4bf8[_0xe7667(0x11f)]>0x0&&(_0x5dbbdc={'path':_0x3bd58c,'keys':_0xeb4bf8});}}catch{}const _0x145e4d=_0x40c812[_0xe7667(0x11f)]>0x0||_0x35dff4!==null;let _0x306ff3=null;const _0x8ec355=resolve(_0x1f8077,'package.json');if(existsSync(_0x8ec355))try{const _0x3d5c5a=JSON[_0xe7667(0x137)](readFileSync(_0x8ec355,'utf8'));for(const _0x3fd350 of[_0xe7667(0xe6),_0xe7667(0x11a)]){const _0x211916=_0x3d5c5a?.[_0x3fd350]?.[_0xe7667(0x122)];if(typeof _0x211916===_0xe7667(0x114)){_0x211916!==_0xe7667(0x131)&&(_0x306ff3={'pkgPath':_0x8ec355,'currentVersion':_0x211916,'field':_0x3fd350});break;}}}catch{}return{'configMigration':_0x35dff4,'oldArtifacts':_0x40c812,'oldMcpConfig':_0x5dbbdc,'needsSkillSwap':_0x145e4d,'sdkUpgrade':_0x306ff3};}function printReport(_0x3129af){const _0x3943ee=a169_0x3ad34d,{configMigration:_0x1d30e1,oldArtifacts:_0xc08b34,oldMcpConfig:_0x5b74b4,needsSkillSwap:_0x2df657}=_0x3129af;console[_0x3943ee(0xe7)](''),console[_0x3943ee(0xe7)](a169_0x5ea9a7[_0x3943ee(0xf0)]('===\x20Upgrade\x20Analysis\x20===')),console[_0x3943ee(0xe7)]('');_0x1d30e1?(console['log'](a169_0x5ea9a7['cyan'](_0x3943ee(0xf3))+('\x20\x20'+a169_0x5ea9a7['yellow'](_0x1d30e1['oldPath']))),console[_0x3943ee(0xe7)](_0x3943ee(0x134)+(_0x1d30e1[_0x3943ee(0x107)]?a169_0x5ea9a7[_0x3943ee(0xd6)](_0x3943ee(0xdf)):a169_0x5ea9a7[_0x3943ee(0xc4)](_0x3943ee(0xc5)))),console[_0x3943ee(0xe7)](_0x3943ee(0xbf)+_0x1d30e1[_0x3943ee(0xe9)]['join'](',\x20')),console[_0x3943ee(0xe7)](_0x3943ee(0xd0))):console[_0x3943ee(0xe7)](a169_0x5ea9a7[_0x3943ee(0x108)](_0x3943ee(0xf3))+'\x20\x20'+a169_0x5ea9a7[_0x3943ee(0xc4)](_0x3943ee(0x130)));console['log']('');if(_0xc08b34[_0x3943ee(0x11f)]>0x0){console[_0x3943ee(0xe7)](a169_0x5ea9a7['cyan'](_0x3943ee(0xf6)));for(const _0x5a2dd6 of _0xc08b34){console['log']('\x20\x20'+a169_0x5ea9a7['red'](_0x3943ee(0x139))+'\x20\x20'+_0x5a2dd6);}console[_0x3943ee(0xe7)](_0x3943ee(0x128));}else console['log'](a169_0x5ea9a7[_0x3943ee(0x108)](_0x3943ee(0xf6))+'\x20\x20'+a169_0x5ea9a7[_0x3943ee(0xc4)](_0x3943ee(0xef)));console[_0x3943ee(0xe7)]('');_0x5b74b4?(console[_0x3943ee(0xe7)](a169_0x5ea9a7['cyan'](_0x3943ee(0xd7))+('\x20\x20'+a169_0x5ea9a7['yellow'](_0x5b74b4[_0x3943ee(0xf1)])+'\x20→\x20keys:\x20'+_0x5b74b4[_0x3943ee(0x12c)]['join'](',\x20'))),console['log'](_0x3943ee(0x132))):console[_0x3943ee(0xe7)](a169_0x5ea9a7['cyan']('MCP\x20config:')+'\x20\x20'+a169_0x5ea9a7[_0x3943ee(0xc4)](_0x3943ee(0xe5)));console[_0x3943ee(0xe7)](''),console[_0x3943ee(0xe7)](a169_0x5ea9a7[_0x3943ee(0x108)](_0x3943ee(0xce))+('\x20\x20'+(_0x2df657?a169_0x5ea9a7[_0x3943ee(0x112)](_0x3943ee(0xe3)):a169_0x5ea9a7[_0x3943ee(0xd6)]('not\x20needed'))));_0x2df657&&console[_0x3943ee(0xe7)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x3943ee(0xe7)]('');if(_0x3129af[_0x3943ee(0xde)]){const {currentVersion:_0x58c613,field:_0x52a6c0,pkgPath:_0x1aa92c}=_0x3129af[_0x3943ee(0xde)];console[_0x3943ee(0xe7)](a169_0x5ea9a7[_0x3943ee(0x108)](_0x3943ee(0x133))+('\x20\x20'+a169_0x5ea9a7['yellow'](_0x1aa92c))),console[_0x3943ee(0xe7)](_0x3943ee(0x125)+_0x52a6c0+':\x20'+a169_0x5ea9a7['yellow'](_0x58c613)+_0x3943ee(0xea)+a169_0x5ea9a7[_0x3943ee(0xd6)]('latest')),console[_0x3943ee(0xe7)]('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console[_0x3943ee(0xe7)](a169_0x5ea9a7[_0x3943ee(0x108)](_0x3943ee(0x133))+'\x20\x20'+a169_0x5ea9a7[_0x3943ee(0xc4)](_0x3943ee(0xe4)));console['log']('');}function execConfigMigration(_0xf0775a,_0x4fc354){const _0x270cec=a169_0x3ad34d,{configMigration:_0x542bcf}=_0xf0775a;if(!_0x542bcf?.[_0x270cec(0x121)])return{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x270cec(0xc1)};const _0xf084c3=readConfigFile(_0x542bcf[_0x270cec(0x121)]),_0x1d5d69=resolve(_0x4fc354,NEW_CONFIG_NAME),_0x3fbf64=_0x542bcf[_0x270cec(0x107)]?readConfigFile(_0x1d5d69):{};for(const [_0x5b2f41,_0x28ba05]of Object['entries'](_0xf084c3)){!(_0x5b2f41 in _0x3fbf64)&&(_0x3fbf64[_0x5b2f41]=_0x28ba05);}writeConfigFile(_0x1d5d69,_0x3fbf64);const _0x22939e=_0x542bcf[_0x270cec(0x121)]+_0x270cec(0xc7);return renameSync(_0x542bcf[_0x270cec(0x121)],_0x22939e),{'step':0x1,'label':_0x270cec(0xfb),'ok':!![],'detail':_0x542bcf[_0x270cec(0x121)]+_0x270cec(0xea)+_0x1d5d69+_0x270cec(0xbb)+_0x22939e+')'};}function execRemoveOldArtifacts(_0x52d9e8){const _0x5f1976=a169_0x3ad34d,_0x441cbf=[];for(const _0x39721e of _0x52d9e8){try{if(!existsSync(_0x39721e))continue;const _0x54be9f=tryStat(_0x39721e);_0x54be9f?.['isDirectory']()?rmSync(_0x39721e,{'recursive':!![],'force':!![]}):unlinkSync(_0x39721e);}catch(_0x282b0f){_0x441cbf[_0x5f1976(0xfa)](_0x39721e+':\x20'+_0x282b0f['message']);}}return{'step':0x3,'label':_0x5f1976(0xe8),'ok':_0x441cbf['length']===0x0,'detail':_0x441cbf[_0x5f1976(0x11f)]>0x0?_0x52d9e8[_0x5f1976(0x11f)]-_0x441cbf[_0x5f1976(0x11f)]+'/'+_0x52d9e8[_0x5f1976(0x11f)]+_0x5f1976(0xda)+_0x441cbf[_0x5f1976(0xd9)](';\x20')+')':_0x52d9e8[_0x5f1976(0x11f)]+'\x20removed'};}function a169_0x40c0(_0x1ae9c7,_0x16e694){_0x1ae9c7=_0x1ae9c7-0xbb;const _0x311ad7=a169_0x311a();let _0x40c01e=_0x311ad7[_0x1ae9c7];return _0x40c01e;}function execCleanMcp(_0x3c813d){const _0xf0890=a169_0x3ad34d;if(!_0x3c813d[_0xf0890(0x115)])return{'step':0x4,'label':_0xf0890(0x113),'ok':!![],'detail':_0xf0890(0xc9)};try{const _0x5af279=readFileSync(_0x3c813d['oldMcpConfig'][_0xf0890(0xf1)],_0xf0890(0xdb)),_0x44538d=JSON[_0xf0890(0x137)](_0x5af279);if(_0x44538d?.['mcpServers']&&typeof _0x44538d['mcpServers']===_0xf0890(0x11b)){const _0x58bca2=[];for(const [_0x411ba8,_0x443ca4]of Object[_0xf0890(0x12e)](_0x44538d[_0xf0890(0xd2)])){_0x443ca4?.[_0xf0890(0x118)]&&Array['isArray'](_0x443ca4[_0xf0890(0x118)])&&_0x443ca4[_0xf0890(0x118)][_0xf0890(0x104)](_0x19bb0d=>typeof _0x19bb0d===_0xf0890(0x114)&&_0x19bb0d[_0xf0890(0x117)](_0xf0890(0x110)))&&_0x58bca2[_0xf0890(0xfa)](_0x411ba8);}for(const _0x2b3609 of _0x58bca2){delete _0x44538d['mcpServers'][_0x2b3609];}return _0x58bca2[_0xf0890(0x11f)]>0x0&&writeFileSync(_0x3c813d[_0xf0890(0x115)][_0xf0890(0xf1)],JSON[_0xf0890(0xff)](_0x44538d,null,0x2)+'\x0a',_0xf0890(0xdb)),{'step':0x4,'label':_0xf0890(0x113),'ok':!![],'detail':'removed\x20'+_0x58bca2['join'](',\x20')+'\x20from\x20'+_0x3c813d[_0xf0890(0x115)]['path']};}return{'step':0x4,'label':_0xf0890(0x113),'ok':!![],'detail':_0xf0890(0x136)};}catch(_0x4f0e00){return{'step':0x4,'label':_0xf0890(0x113),'ok':![],'detail':_0x4f0e00[_0xf0890(0xca)]};}}function execSkillsRemove(_0x1ebdb7,_0x15985b){const _0x229186=a169_0x3ad34d,_0x669871=runNpxSkillsRemove(_0x1ebdb7,{'stdio':'inherit','yes':_0x15985b});return{'step':0x5,'label':_0x229186(0x127),'ok':_0x669871['ok'],'detail':_0x669871['ok']?'lovrabet/lovrabet-skill\x20removed':_0x669871[_0x229186(0x11d)]??_0x229186(0xeb)+_0x669871['status']};}function execSkillsAdd(_0x5c8649,_0x4dcc56){const _0x3b494c=a169_0x3ad34d,_0x36b37d=runNpxSkillsAddGlobal(_0x5c8649,_0x3b494c(0xfd),{'stdio':_0x3b494c(0x103),'yes':_0x4dcc56});return{'step':0x6,'label':_0x3b494c(0x12a),'ok':_0x36b37d['ok'],'detail':_0x36b37d['ok']?_0x3b494c(0x12b):_0x36b37d[_0x3b494c(0x11d)]??'exit\x20'+_0x36b37d[_0x3b494c(0xfe)]};}function execUpgradeSdk(_0x1df9e9){const _0x504d9c=a169_0x3ad34d;if(!_0x1df9e9[_0x504d9c(0xde)])return{'step':0x7,'label':_0x504d9c(0xbc),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x246ca9,currentVersion:_0x5ca9d8,field:_0x6f9929}=_0x1df9e9['sdkUpgrade'];try{const _0x21361f=readFileSync(_0x246ca9,_0x504d9c(0xdb)),_0x44c052=JSON[_0x504d9c(0x137)](_0x21361f);return _0x44c052[_0x6f9929][_0x504d9c(0x122)]=_0x504d9c(0x131),writeFileSync(_0x246ca9,JSON[_0x504d9c(0xff)](_0x44c052,null,0x2)+'\x0a',_0x504d9c(0xdb)),{'step':0x7,'label':_0x504d9c(0xbc),'ok':!![],'detail':_0x6f9929+_0x504d9c(0x106)+_0x5ca9d8+_0x504d9c(0xcf)};}catch(_0x389e01){return{'step':0x7,'label':_0x504d9c(0xbc),'ok':![],'detail':_0x389e01[_0x504d9c(0xca)]};}}function tryStat(_0x2c4751){try{return statSync(_0x2c4751);}catch{return undefined;}}function printSummary(_0x157631){const _0x539a99=a169_0x3ad34d;console[_0x539a99(0xe7)](''),console[_0x539a99(0xe7)](a169_0x5ea9a7[_0x539a99(0xf0)]('===\x20Upgrade\x20Summary\x20===')),console['log']('');for(const _0x291b69 of _0x157631){const _0x4e2989=_0x291b69['ok']?a169_0x5ea9a7[_0x539a99(0xd6)]('OK'):a169_0x5ea9a7['red'](_0x539a99(0xd5));console[_0x539a99(0xe7)]('\x20\x20'+_0x4e2989+_0x539a99(0xc0)+_0x291b69[_0x539a99(0xe1)]+':\x20'+_0x291b69[_0x539a99(0xec)]);if(_0x291b69['detail'])console[_0x539a99(0xe7)](_0x539a99(0xdd)+a169_0x5ea9a7['gray'](_0x291b69[_0x539a99(0x12d)]));}console[_0x539a99(0xe7)]('');}function a169_0x311a(){const _0x23e722=['hasNewConfig','cyan','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','37130BBpyFe','files','start','Step\x201/7:\x20Migrating\x20config...','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','Step\x204/7:\x20Cleaning\x20MCP\x20config...','@lovrabet/dataset-mcp-server','605955MmnDiH','yellow','Clean\x20MCP\x20config','string','oldMcpConfig','Remove\x20.lovrabet/','includes','args','fail','devDependencies','object','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','error','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','length','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','oldPath','@lovrabet/sdk','\x20\x20bun\x20install','Proceed\x20with\x20upgrade?','\x20\x20Current\x20version\x20in\x20','filter','Remove\x20old\x20skill','\x20\x20Action:\x20delete','14fGSvxC','Install\x20new\x20skill','lovrabet/rabetbase\x20installed\x20globally','keys','detail','entries','684980cBuQWX','no\x20legacy\x20config\x20found','latest','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','@lovrabet/sdk:','\x20\x20New\x20config\x20(.rabetbase.json):\x20','failed','no\x20matching\x20entry\x20found','parse','.cursor/rules/lovrabet_rules.mdc','FOUND','32288gdiSLZ','\x20(backup:\x20','Upgrade\x20@lovrabet/sdk','white','needsSkillSwap','\x20\x20Fields\x20to\x20migrate:\x20','\x20\x20Step\x20','skipped\x20(no\x20legacy\x20config)','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','gray','not\x20found\x20(will\x20create)','7724860UYpdkj','.bak','Step\x205/7:\x20Removing\x20old\x20skill...','skipped','message','40UvQbJY','.claude/skills/lovrabet','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','Skill\x20swap:','\x20→\x20latest','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','mcpServers','643oHEuyn','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','FAIL','green','MCP\x20config:','done','join','\x20removed\x20(','utf8','\x20\x20#\x20or','\x20\x20\x20\x20\x20\x20\x20','sdkUpgrade','already\x20exists\x20(will\x20merge)','Upgrade\x20completed\x20successfully!','step','info','needed','not\x20found\x20or\x20already\x20at\x20latest','no\x20legacy\x20entry','dependencies','log','Remove\x20legacy\x20artifacts','fields','\x20→\x20','exit\x20','label','542NjWYuV','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','none\x20found','bold','path','succeed','Config\x20file:','Step\x201/7:\x20Config\x20migration\x20—\x20','oldArtifacts','Legacy\x20artifacts:','200862vtjqcR','Step\x206/7:\x20Installing\x20new\x20skill...','.lovrabet','push','Config\x20migration','192WCHYoJ','lovrabet/rabetbase','status','stringify','.cursor/mcp.json','\x20\x20npm\x20install','Upgrade\x20cancelled.','inherit','some','yes','[\x22@lovrabet/sdk\x22]:\x20'];a169_0x311a=function(){return _0x23e722;};return a169_0x311a();}export async function upgradeApp(_0x3f189f,_0x694ec0){const _0x59258e=a169_0x3ad34d,_0x346d58=process['cwd'](),_0x302414=analyse(_0x346d58),_0x306650=!_0x302414['configMigration']&&_0x302414[_0x59258e(0xf5)]['length']===0x0&&!_0x302414[_0x59258e(0x115)]&&!_0x302414[_0x59258e(0xbe)]&&!_0x302414[_0x59258e(0xde)];if(_0x306650){console[_0x59258e(0xe7)](a169_0x5ea9a7[_0x59258e(0xd6)](_0x59258e(0x120)));return;}printReport(_0x302414);const _0x46ac43=!!(_0x694ec0[_0x59258e(0x105)]||_0x694ec0['Y']||_0x3f189f);if(!_0x46ac43)try{const _0x124725=await askConfirm(_0x59258e(0x124));if(!_0x124725){console[_0x59258e(0xe7)](a169_0x5ea9a7[_0x59258e(0xc4)](_0x59258e(0x102)));return;}}catch(_0x440630){if(_0x440630?.[_0x59258e(0xca)]==='CANCEL'){console['log'](a169_0x5ea9a7[_0x59258e(0xc4)](_0x59258e(0x102)));return;}throw _0x440630;}const _0x1197f0=[],_0x1b154f=a169_0x5f128a({'text':_0x59258e(0x10d),'color':_0x59258e(0x108)})['start'](),_0xfe1f08=execConfigMigration(_0x302414,_0x346d58);_0x1197f0[_0x59258e(0xfa)](_0xfe1f08),_0x1b154f[_0xfe1f08['ok']?_0x59258e(0xf2):_0x59258e(0x119)](_0x59258e(0xf4)+(_0xfe1f08[_0x59258e(0x12d)]??(_0xfe1f08['ok']?_0x59258e(0xd8):_0x59258e(0x135))));const _0x4441a8=resolve(_0x346d58,_0x59258e(0xf9)),_0x4e1b29=a169_0x5f128a({'text':'Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','color':'cyan'})[_0x59258e(0x10c)]();if(existsSync(_0x4441a8))try{rmSync(_0x4441a8,{'recursive':!![],'force':!![]}),_0x4e1b29[_0x59258e(0xf2)](_0x59258e(0xc3)),_0x1197f0[_0x59258e(0xfa)]({'step':0x2,'label':_0x59258e(0x116),'ok':!![]});}catch(_0x17fc96){_0x4e1b29[_0x59258e(0x119)]('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x17fc96['message']),_0x1197f0[_0x59258e(0xfa)]({'step':0x2,'label':_0x59258e(0x116),'ok':![],'detail':_0x17fc96[_0x59258e(0xca)]});}else _0x4e1b29[_0x59258e(0xe2)](_0x59258e(0xc2)),_0x1197f0[_0x59258e(0xfa)]({'step':0x2,'label':_0x59258e(0x116),'ok':!![],'detail':_0x59258e(0xc9)});const _0x20bb81=a169_0x5f128a({'text':_0x59258e(0x11e),'color':_0x59258e(0x108)})[_0x59258e(0x10c)](),_0x281de8=execRemoveOldArtifacts(_0x302414[_0x59258e(0xf5)]);_0x1197f0[_0x59258e(0xfa)](_0x281de8),_0x20bb81[_0x281de8['ok']?_0x59258e(0xf2):_0x59258e(0x119)](_0x59258e(0xd4)+(_0x281de8[_0x59258e(0x12d)]??(_0x281de8['ok']?'done':_0x59258e(0x135))));const _0x10c5d8=a169_0x5f128a({'text':_0x59258e(0x10f),'color':_0x59258e(0x108)})[_0x59258e(0x10c)](),_0x6aad80=execCleanMcp(_0x302414);_0x1197f0[_0x59258e(0xfa)](_0x6aad80),_0x10c5d8[_0x6aad80['ok']?_0x59258e(0xf2):'fail']('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x6aad80[_0x59258e(0x12d)]??(_0x6aad80['ok']?_0x59258e(0xd8):_0x59258e(0x135))));const _0x1c6fc8=a169_0x5f128a({'text':_0x59258e(0xc8),'color':_0x59258e(0x108)})[_0x59258e(0x10c)](),_0x3cf296=execSkillsRemove(_0x346d58,_0x46ac43);_0x1197f0[_0x59258e(0xfa)](_0x3cf296),_0x1c6fc8[_0x3cf296['ok']?_0x59258e(0xf2):_0x59258e(0x119)](_0x59258e(0xcd)+(_0x3cf296['detail']??(_0x3cf296['ok']?'done':_0x59258e(0x135))));const _0x1a3ea0=a169_0x5f128a({'text':_0x59258e(0xf8),'color':_0x59258e(0x108)})['start'](),_0x108ae9=execSkillsAdd(_0x346d58,_0x46ac43);_0x1197f0['push'](_0x108ae9),_0x1a3ea0[_0x108ae9['ok']?'succeed':'fail'](_0x59258e(0x10e)+(_0x108ae9['detail']??(_0x108ae9['ok']?'done':'failed')));const _0x3ef299=a169_0x5f128a({'text':_0x59258e(0xd1),'color':_0x59258e(0x108)})[_0x59258e(0x10c)](),_0x327c38=execUpgradeSdk(_0x302414);_0x1197f0[_0x59258e(0xfa)](_0x327c38),_0x3ef299[_0x327c38['ok']?_0x59258e(0xf2):_0x59258e(0x119)](_0x59258e(0xee)+(_0x327c38[_0x59258e(0x12d)]??(_0x327c38['ok']?_0x59258e(0xd8):_0x59258e(0x135)))),printSummary(_0x1197f0);const _0x4950ba=_0x1197f0[_0x59258e(0x104)](_0x4f2aa8=>!_0x4f2aa8['ok']);_0x4950ba?console[_0x59258e(0xe7)](a169_0x5ea9a7[_0x59258e(0x112)](_0x59258e(0x109))):console[_0x59258e(0xe7)](a169_0x5ea9a7['green'](_0x59258e(0xe0))),_0x327c38['ok']&&_0x302414[_0x59258e(0xde)]&&(console[_0x59258e(0xe7)](''),console[_0x59258e(0xe7)](a169_0x5ea9a7[_0x59258e(0xf0)]['cyan'](_0x59258e(0x11c))),console[_0x59258e(0xe7)](a169_0x5ea9a7[_0x59258e(0x108)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0x59258e(0xe7)](''),console['log'](a169_0x5ea9a7['white'](_0x59258e(0x101))),console['log'](a169_0x5ea9a7[_0x59258e(0xbd)](_0x59258e(0xdc))),console[_0x59258e(0xe7)](a169_0x5ea9a7['white'](_0x59258e(0x123))),console[_0x59258e(0xe7)](''));}
1
+ (function(_0x327969,_0x348e92){const _0x37ed14=a161_0x6f84,_0x4f41ba=_0x327969();while(!![]){try{const _0x3901c4=parseInt(_0x37ed14(0x1fc))/0x1*(-parseInt(_0x37ed14(0x1a2))/0x2)+parseInt(_0x37ed14(0x1ac))/0x3*(parseInt(_0x37ed14(0x1d8))/0x4)+parseInt(_0x37ed14(0x19f))/0x5+parseInt(_0x37ed14(0x1f4))/0x6+parseInt(_0x37ed14(0x213))/0x7+parseInt(_0x37ed14(0x1a1))/0x8*(parseInt(_0x37ed14(0x1f3))/0x9)+parseInt(_0x37ed14(0x1cc))/0xa*(-parseInt(_0x37ed14(0x214))/0xb);if(_0x3901c4===_0x348e92)break;else _0x4f41ba['push'](_0x4f41ba['shift']());}catch(_0x2a1d55){_0x4f41ba['push'](_0x4f41ba['shift']());}}}(a161_0x63d9,0x62ec4));import a161_0xac24f8 from'chalk';import a161_0x4414e5 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';function a161_0x63d9(){const _0x2bdac7=['Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','error','Skill\x20swap:','no\x20legacy\x20config\x20found','\x20\x20Fields\x20to\x20migrate:\x20','fail','message','[\x22@lovrabet/sdk\x22]:\x20','\x20\x20npm\x20install','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','object','\x20\x20Step\x20','oldMcpConfig','\x20→\x20latest','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','inherit','none\x20found','\x20→\x20','stringify','undefined','skipped','files','1067101EGRswu','99hdFKsD','Config\x20migration','\x20\x20\x20\x20\x20\x20\x20','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','3073180GkaKzI','succeed','904ZWjeQp','182sdYnQO','Legacy\x20artifacts:','done','FAIL','white','.bak','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Remove\x20.lovrabet/','Step\x204/7:\x20MCP\x20config\x20—\x20','string','57927HYUSnO','latest','Step\x205/7:\x20Removing\x20old\x20skill...','sdkUpgrade','Upgrade\x20cancelled.','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','Step\x201/7:\x20Migrating\x20config...','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','oldPath','Clean\x20MCP\x20config','devDependencies','isArray','start','path','length','log','Remove\x20old\x20skill','no\x20legacy\x20entry','keys','\x20\x20#\x20or','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','failed','no\x20matching\x20entry\x20found','bold','dependencies','needed','\x20\x20New\x20config\x20(.rabetbase.json):\x20','\x20removed','Upgrade\x20@lovrabet/sdk','cwd','.cursor/mcp.json','info','432750HceoqJ','utf8','mcpServers','@lovrabet/sdk','\x20removed\x20(','MCP\x20config:','FOUND','detail','already\x20exists\x20(will\x20merge)','args','needsSkillSwap','gray','4iBTxzH','entries','fields','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','CANCEL','label','not\x20needed','cyan','Step\x206/7:\x20Installing\x20new\x20skill...','Config\x20file:','\x20→\x20keys:\x20','join','parse','oldArtifacts','\x20\x20bun\x20install','red','@lovrabet/dataset-mcp-server','.lovrabet','push','step','\x20\x20Current\x20version\x20in\x20','exit\x20','yellow','green','hasNewConfig','includes','@lovrabet/sdk:','15885GIeCkw','3510906dvUiTr','isDirectory','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','Install\x20new\x20skill','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','Upgrade\x20completed\x20successfully!','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','.claude/skills/lovrabet','8531moyqcw'];a161_0x63d9=function(){return _0x2bdac7;};return a161_0x63d9();}import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x399470=>_0x399470!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x6fd3d){const _0x11977d=a161_0x6f84,_0x3a0e7d=[];for(const _0x49d0b6 of Object['values'](CORE_IDE_CONFIGS)){if(_0x49d0b6[_0x11977d(0x212)])for(const _0x53049a of _0x49d0b6[_0x11977d(0x212)]){_0x3a0e7d['push'](resolve(_0x6fd3d,_0x53049a[_0x11977d(0x1b9)]));}}return _0x3a0e7d;}function analyse(_0x2f659b){const _0x2616f0=a161_0x6f84;let _0x14dae3=null;const _0x2b0a96=resolve(_0x2f659b,NEW_CONFIG_NAME),_0x4072ab=existsSync(_0x2b0a96);for(const _0x492f4a of LEGACY_CONFIG_NAMES){const _0x591c19=resolve(_0x2f659b,_0x492f4a);if(existsSync(_0x591c19)){const _0x566155=readConfigFile(_0x591c19),_0x53b97e=Object[_0x2616f0(0x1be)](_0x566155)['filter'](_0x4b5bb0=>typeof _0x566155[_0x4b5bb0]!==_0x2616f0(0x210));_0x14dae3={'oldPath':_0x591c19,'hasNewConfig':_0x4072ab,'fields':_0x53b97e};break;}}const _0x54b026=[],_0x2f397c=resolve(_0x2f659b,_0x2616f0(0x1e9));if(existsSync(_0x2f397c))_0x54b026[_0x2616f0(0x1ea)](_0x2f397c);const _0x4b368f=resolve(_0x2f659b,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x4b368f))_0x54b026['push'](_0x4b368f);const _0x16cdac=resolve(_0x2f659b,_0x2616f0(0x1fb));if(existsSync(_0x16cdac))_0x54b026[_0x2616f0(0x1ea)](_0x16cdac);for(const _0x434fbb of collectIdeSkillFiles(_0x2f659b)){if(existsSync(_0x434fbb))_0x54b026['push'](_0x434fbb);}let _0x29fba9=null;const _0x369cb8=resolve(_0x2f659b,_0x2616f0(0x1ca));if(existsSync(_0x369cb8))try{const _0x8cd2a5=JSON[_0x2616f0(0x1e4)](readFileSync(_0x369cb8,'utf8'));if(_0x8cd2a5?.[_0x2616f0(0x1ce)]&&typeof _0x8cd2a5[_0x2616f0(0x1ce)]===_0x2616f0(0x207)){const _0x12d27b=[];for(const [_0x5702a2,_0x20c003]of Object[_0x2616f0(0x1d9)](_0x8cd2a5[_0x2616f0(0x1ce)])){const _0x29fde1=_0x20c003;_0x29fde1?.[_0x2616f0(0x1d5)]&&Array[_0x2616f0(0x1b7)](_0x29fde1[_0x2616f0(0x1d5)])&&_0x29fde1[_0x2616f0(0x1d5)]['some'](_0x266f26=>typeof _0x266f26===_0x2616f0(0x1ab)&&_0x266f26[_0x2616f0(0x1f1)](_0x2616f0(0x1e8)))&&_0x12d27b[_0x2616f0(0x1ea)](_0x5702a2);}_0x12d27b['length']>0x0&&(_0x29fba9={'path':_0x369cb8,'keys':_0x12d27b});}}catch{}const _0x72d114=_0x54b026[_0x2616f0(0x1ba)]>0x0||_0x14dae3!==null;let _0x1373a8=null;const _0x40cbd9=resolve(_0x2f659b,'package.json');if(existsSync(_0x40cbd9))try{const _0x4c0111=JSON[_0x2616f0(0x1e4)](readFileSync(_0x40cbd9,_0x2616f0(0x1cd)));for(const _0x200c3c of[_0x2616f0(0x1c4),_0x2616f0(0x1b6)]){const _0x3940b0=_0x4c0111?.[_0x200c3c]?.[_0x2616f0(0x1cf)];if(typeof _0x3940b0===_0x2616f0(0x1ab)){_0x3940b0!==_0x2616f0(0x1ad)&&(_0x1373a8={'pkgPath':_0x40cbd9,'currentVersion':_0x3940b0,'field':_0x200c3c});break;}}}catch{}return{'configMigration':_0x14dae3,'oldArtifacts':_0x54b026,'oldMcpConfig':_0x29fba9,'needsSkillSwap':_0x72d114,'sdkUpgrade':_0x1373a8};}function printReport(_0x3a1294){const _0x268fed=a161_0x6f84,{configMigration:_0x5489ee,oldArtifacts:_0x548d0b,oldMcpConfig:_0x205023,needsSkillSwap:_0x245ed5}=_0x3a1294;console[_0x268fed(0x1bb)](''),console['log'](a161_0xac24f8[_0x268fed(0x1c3)]('===\x20Upgrade\x20Analysis\x20===')),console[_0x268fed(0x1bb)]('');_0x5489ee?(console[_0x268fed(0x1bb)](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1e1))+('\x20\x20'+a161_0xac24f8[_0x268fed(0x1ee)](_0x5489ee['oldPath']))),console['log'](_0x268fed(0x1c6)+(_0x5489ee['hasNewConfig']?a161_0xac24f8[_0x268fed(0x1ef)](_0x268fed(0x1d4)):a161_0xac24f8[_0x268fed(0x1d7)]('not\x20found\x20(will\x20create)'))),console[_0x268fed(0x1bb)](_0x268fed(0x201)+_0x5489ee[_0x268fed(0x1da)][_0x268fed(0x1e3)](',\x20')),console[_0x268fed(0x1bb)](_0x268fed(0x1f8))):console['log'](a161_0xac24f8[_0x268fed(0x1df)]('Config\x20file:')+'\x20\x20'+a161_0xac24f8[_0x268fed(0x1d7)](_0x268fed(0x200)));console[_0x268fed(0x1bb)]('');if(_0x548d0b[_0x268fed(0x1ba)]>0x0){console[_0x268fed(0x1bb)](a161_0xac24f8[_0x268fed(0x1df)]('Legacy\x20artifacts:'));for(const _0x1060a7 of _0x548d0b){console['log']('\x20\x20'+a161_0xac24f8['red'](_0x268fed(0x1d2))+'\x20\x20'+_0x1060a7);}console[_0x268fed(0x1bb)]('\x20\x20Action:\x20delete');}else console['log'](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1a3))+'\x20\x20'+a161_0xac24f8['gray'](_0x268fed(0x20d)));console['log']('');_0x205023?(console['log'](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1d1))+('\x20\x20'+a161_0xac24f8[_0x268fed(0x1ee)](_0x205023[_0x268fed(0x1b9)])+_0x268fed(0x1e2)+_0x205023[_0x268fed(0x1be)][_0x268fed(0x1e3)](',\x20'))),console['log']('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x268fed(0x1bb)](a161_0xac24f8['cyan'](_0x268fed(0x1d1))+'\x20\x20'+a161_0xac24f8[_0x268fed(0x1d7)](_0x268fed(0x1bd)));console[_0x268fed(0x1bb)](''),console[_0x268fed(0x1bb)](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1ff))+('\x20\x20'+(_0x245ed5?a161_0xac24f8['yellow'](_0x268fed(0x1c5)):a161_0xac24f8[_0x268fed(0x1ef)](_0x268fed(0x1de)))));_0x245ed5&&console['log'](_0x268fed(0x1f6)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x268fed(0x1bb)]('');if(_0x3a1294[_0x268fed(0x1af)]){const {currentVersion:_0x20fabc,field:_0x48fa5f,pkgPath:_0x166cea}=_0x3a1294[_0x268fed(0x1af)];console[_0x268fed(0x1bb)](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1f2))+('\x20\x20'+a161_0xac24f8[_0x268fed(0x1ee)](_0x166cea))),console['log'](_0x268fed(0x1ec)+_0x48fa5f+':\x20'+a161_0xac24f8['yellow'](_0x20fabc)+_0x268fed(0x20e)+a161_0xac24f8[_0x268fed(0x1ef)](_0x268fed(0x1ad))),console[_0x268fed(0x1bb)](_0x268fed(0x1b1));}else console[_0x268fed(0x1bb)](a161_0xac24f8[_0x268fed(0x1df)](_0x268fed(0x1f2))+'\x20\x20'+a161_0xac24f8['gray']('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x268fed(0x1bb)]('');}function execConfigMigration(_0x57f886,_0x441c2d){const _0x5418d2=a161_0x6f84,{configMigration:_0x121b7d}=_0x57f886;if(!_0x121b7d?.[_0x5418d2(0x1b4)])return{'step':0x1,'label':_0x5418d2(0x215),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0xbdf590=readConfigFile(_0x121b7d['oldPath']),_0x19d9b9=resolve(_0x441c2d,NEW_CONFIG_NAME),_0x87be9b=_0x121b7d[_0x5418d2(0x1f0)]?readConfigFile(_0x19d9b9):{};for(const [_0x453681,_0x218fd4]of Object[_0x5418d2(0x1d9)](_0xbdf590)){!(_0x453681 in _0x87be9b)&&(_0x87be9b[_0x453681]=_0x218fd4);}writeConfigFile(_0x19d9b9,_0x87be9b);const _0x1830b7=_0x121b7d[_0x5418d2(0x1b4)]+_0x5418d2(0x1a7);return renameSync(_0x121b7d[_0x5418d2(0x1b4)],_0x1830b7),{'step':0x1,'label':_0x5418d2(0x215),'ok':!![],'detail':_0x121b7d[_0x5418d2(0x1b4)]+_0x5418d2(0x20e)+_0x19d9b9+'\x20(backup:\x20'+_0x1830b7+')'};}function execRemoveOldArtifacts(_0x3cf023){const _0x2aa4e2=a161_0x6f84,_0x4ae6ca=[];for(const _0x2e2a37 of _0x3cf023){try{if(!existsSync(_0x2e2a37))continue;const _0x341541=tryStat(_0x2e2a37);_0x341541?.[_0x2aa4e2(0x1f5)]()?rmSync(_0x2e2a37,{'recursive':!![],'force':!![]}):unlinkSync(_0x2e2a37);}catch(_0xb31ca){_0x4ae6ca[_0x2aa4e2(0x1ea)](_0x2e2a37+':\x20'+_0xb31ca[_0x2aa4e2(0x203)]);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x4ae6ca['length']===0x0,'detail':_0x4ae6ca['length']>0x0?_0x3cf023[_0x2aa4e2(0x1ba)]-_0x4ae6ca[_0x2aa4e2(0x1ba)]+'/'+_0x3cf023[_0x2aa4e2(0x1ba)]+_0x2aa4e2(0x1d0)+_0x4ae6ca[_0x2aa4e2(0x1e3)](';\x20')+')':_0x3cf023[_0x2aa4e2(0x1ba)]+_0x2aa4e2(0x1c7)};}function execCleanMcp(_0xa2bc24){const _0x5b61df=a161_0x6f84;if(!_0xa2bc24[_0x5b61df(0x209)])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x5b61df(0x211)};try{const _0x55a701=readFileSync(_0xa2bc24['oldMcpConfig'][_0x5b61df(0x1b9)],_0x5b61df(0x1cd)),_0x165786=JSON['parse'](_0x55a701);if(_0x165786?.[_0x5b61df(0x1ce)]&&typeof _0x165786['mcpServers']==='object'){const _0x10df5d=[];for(const [_0x480036,_0x4af82e]of Object[_0x5b61df(0x1d9)](_0x165786['mcpServers'])){_0x4af82e?.['args']&&Array[_0x5b61df(0x1b7)](_0x4af82e[_0x5b61df(0x1d5)])&&_0x4af82e['args']['some'](_0x55608c=>typeof _0x55608c===_0x5b61df(0x1ab)&&_0x55608c[_0x5b61df(0x1f1)](_0x5b61df(0x1e8)))&&_0x10df5d[_0x5b61df(0x1ea)](_0x480036);}for(const _0x37f5da of _0x10df5d){delete _0x165786[_0x5b61df(0x1ce)][_0x37f5da];}return _0x10df5d[_0x5b61df(0x1ba)]>0x0&&writeFileSync(_0xa2bc24[_0x5b61df(0x209)]['path'],JSON[_0x5b61df(0x20f)](_0x165786,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'removed\x20'+_0x10df5d[_0x5b61df(0x1e3)](',\x20')+'\x20from\x20'+_0xa2bc24[_0x5b61df(0x209)][_0x5b61df(0x1b9)]};}return{'step':0x4,'label':_0x5b61df(0x1b5),'ok':!![],'detail':_0x5b61df(0x1c2)};}catch(_0x3239f6){return{'step':0x4,'label':_0x5b61df(0x1b5),'ok':![],'detail':_0x3239f6['message']};}}function execSkillsRemove(_0x45698a,_0x2aff06){const _0xe0e751=a161_0x6f84,_0x4c719a=runNpxSkillsRemove(_0x45698a,{'stdio':_0xe0e751(0x20c),'yes':_0x2aff06});return{'step':0x5,'label':_0xe0e751(0x1bc),'ok':_0x4c719a['ok'],'detail':_0x4c719a['ok']?'lovrabet/lovrabet-skill\x20removed':_0x4c719a[_0xe0e751(0x1fe)]??'exit\x20'+_0x4c719a['status']};}function execSkillsAdd(_0x6ecbb0,_0xb247c9){const _0x5c6f14=a161_0x6f84,_0x15eb84=runNpxSkillsAddGlobal(_0x6ecbb0,'lovrabet/rabetbase',{'stdio':'inherit','yes':_0xb247c9});return{'step':0x6,'label':_0x5c6f14(0x1f7),'ok':_0x15eb84['ok'],'detail':_0x15eb84['ok']?'lovrabet/rabetbase\x20installed\x20globally':_0x15eb84[_0x5c6f14(0x1fe)]??_0x5c6f14(0x1ed)+_0x15eb84['status']};}function execUpgradeSdk(_0x201085){const _0x40ab95=a161_0x6f84;if(!_0x201085['sdkUpgrade'])return{'step':0x7,'label':_0x40ab95(0x1c8),'ok':!![],'detail':_0x40ab95(0x1a8)};const {pkgPath:_0x9302fd,currentVersion:_0x137124,field:_0x2c76a5}=_0x201085[_0x40ab95(0x1af)];try{const _0x5758f8=readFileSync(_0x9302fd,_0x40ab95(0x1cd)),_0x362d3b=JSON['parse'](_0x5758f8);return _0x362d3b[_0x2c76a5][_0x40ab95(0x1cf)]=_0x40ab95(0x1ad),writeFileSync(_0x9302fd,JSON[_0x40ab95(0x20f)](_0x362d3b,null,0x2)+'\x0a',_0x40ab95(0x1cd)),{'step':0x7,'label':_0x40ab95(0x1c8),'ok':!![],'detail':_0x2c76a5+_0x40ab95(0x204)+_0x137124+_0x40ab95(0x20a)};}catch(_0x462642){return{'step':0x7,'label':_0x40ab95(0x1c8),'ok':![],'detail':_0x462642[_0x40ab95(0x203)]};}}function tryStat(_0x17d977){try{return statSync(_0x17d977);}catch{return undefined;}}function printSummary(_0x383683){const _0x1ad0db=a161_0x6f84;console[_0x1ad0db(0x1bb)](''),console[_0x1ad0db(0x1bb)](a161_0xac24f8[_0x1ad0db(0x1c3)]('===\x20Upgrade\x20Summary\x20===')),console[_0x1ad0db(0x1bb)]('');for(const _0x5c0c88 of _0x383683){const _0x3aa382=_0x5c0c88['ok']?a161_0xac24f8[_0x1ad0db(0x1ef)]('OK'):a161_0xac24f8[_0x1ad0db(0x1e7)](_0x1ad0db(0x1a5));console[_0x1ad0db(0x1bb)]('\x20\x20'+_0x3aa382+_0x1ad0db(0x208)+_0x5c0c88[_0x1ad0db(0x1eb)]+':\x20'+_0x5c0c88[_0x1ad0db(0x1dd)]);if(_0x5c0c88[_0x1ad0db(0x1d3)])console[_0x1ad0db(0x1bb)](_0x1ad0db(0x216)+a161_0xac24f8[_0x1ad0db(0x1d7)](_0x5c0c88[_0x1ad0db(0x1d3)]));}console[_0x1ad0db(0x1bb)]('');}function a161_0x6f84(_0x2cc931,_0x50da2b){_0x2cc931=_0x2cc931-0x19e;const _0x63d9b3=a161_0x63d9();let _0x6f84c6=_0x63d9b3[_0x2cc931];return _0x6f84c6;}export async function upgradeApp(_0x1b5e7b,_0x429971){const _0x191de4=a161_0x6f84,_0x31d328=process[_0x191de4(0x1c9)](),_0x3d9aad=analyse(_0x31d328),_0xd6fa22=!_0x3d9aad['configMigration']&&_0x3d9aad['oldArtifacts']['length']===0x0&&!_0x3d9aad['oldMcpConfig']&&!_0x3d9aad[_0x191de4(0x1d6)]&&!_0x3d9aad[_0x191de4(0x1af)];if(_0xd6fa22){console[_0x191de4(0x1bb)](a161_0xac24f8[_0x191de4(0x1ef)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x3d9aad);const _0xde892=!!(_0x429971['yes']||_0x429971['Y']||_0x1b5e7b);if(!_0xde892)try{const _0xcf552a=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0xcf552a){console[_0x191de4(0x1bb)](a161_0xac24f8[_0x191de4(0x1d7)]('Upgrade\x20cancelled.'));return;}}catch(_0x55f1ab){if(_0x55f1ab?.['message']===_0x191de4(0x1dc)){console['log'](a161_0xac24f8[_0x191de4(0x1d7)](_0x191de4(0x1b0)));return;}throw _0x55f1ab;}const _0xdce02=[],_0x13d885=a161_0x4414e5({'text':_0x191de4(0x1b2),'color':_0x191de4(0x1df)})[_0x191de4(0x1b8)](),_0x5b4c79=execConfigMigration(_0x3d9aad,_0x31d328);_0xdce02['push'](_0x5b4c79),_0x13d885[_0x5b4c79['ok']?_0x191de4(0x1a0):_0x191de4(0x202)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0x5b4c79[_0x191de4(0x1d3)]??(_0x5b4c79['ok']?_0x191de4(0x1a4):_0x191de4(0x1c1))));const _0x50af96=resolve(_0x31d328,_0x191de4(0x1e9)),_0x1fd1fc=a161_0x4414e5({'text':_0x191de4(0x206),'color':_0x191de4(0x1df)})[_0x191de4(0x1b8)]();if(existsSync(_0x50af96))try{rmSync(_0x50af96,{'recursive':!![],'force':!![]}),_0x1fd1fc[_0x191de4(0x1a0)](_0x191de4(0x217)),_0xdce02[_0x191de4(0x1ea)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x2ea41b){_0x1fd1fc['fail']('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x2ea41b[_0x191de4(0x203)]),_0xdce02[_0x191de4(0x1ea)]({'step':0x2,'label':_0x191de4(0x1a9),'ok':![],'detail':_0x2ea41b[_0x191de4(0x203)]});}else _0x1fd1fc[_0x191de4(0x1cb)](_0x191de4(0x1c0)),_0xdce02[_0x191de4(0x1ea)]({'step':0x2,'label':_0x191de4(0x1a9),'ok':!![],'detail':_0x191de4(0x211)});const _0x240ef7=a161_0x4414e5({'text':_0x191de4(0x1fa),'color':'cyan'})['start'](),_0x3ed434=execRemoveOldArtifacts(_0x3d9aad[_0x191de4(0x1e5)]);_0xdce02[_0x191de4(0x1ea)](_0x3ed434),_0x240ef7[_0x3ed434['ok']?_0x191de4(0x1a0):'fail'](_0x191de4(0x1fd)+(_0x3ed434['detail']??(_0x3ed434['ok']?_0x191de4(0x1a4):'failed')));const _0x5ccefd=a161_0x4414e5({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':'cyan'})[_0x191de4(0x1b8)](),_0x416ce2=execCleanMcp(_0x3d9aad);_0xdce02[_0x191de4(0x1ea)](_0x416ce2),_0x5ccefd[_0x416ce2['ok']?_0x191de4(0x1a0):_0x191de4(0x202)](_0x191de4(0x1aa)+(_0x416ce2[_0x191de4(0x1d3)]??(_0x416ce2['ok']?'done':_0x191de4(0x1c1))));const _0x8239d=a161_0x4414e5({'text':_0x191de4(0x1ae),'color':_0x191de4(0x1df)})[_0x191de4(0x1b8)](),_0x3b7391=execSkillsRemove(_0x31d328,_0xde892);_0xdce02[_0x191de4(0x1ea)](_0x3b7391),_0x8239d[_0x3b7391['ok']?_0x191de4(0x1a0):'fail']('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x3b7391[_0x191de4(0x1d3)]??(_0x3b7391['ok']?_0x191de4(0x1a4):'failed')));const _0xcce3f9=a161_0x4414e5({'text':_0x191de4(0x1e0),'color':'cyan'})[_0x191de4(0x1b8)](),_0x4efae1=execSkillsAdd(_0x31d328,_0xde892);_0xdce02[_0x191de4(0x1ea)](_0x4efae1),_0xcce3f9[_0x4efae1['ok']?_0x191de4(0x1a0):_0x191de4(0x202)](_0x191de4(0x1b3)+(_0x4efae1[_0x191de4(0x1d3)]??(_0x4efae1['ok']?_0x191de4(0x1a4):_0x191de4(0x1c1))));const _0x10dc48=a161_0x4414e5({'text':_0x191de4(0x20b),'color':_0x191de4(0x1df)})[_0x191de4(0x1b8)](),_0x3431d6=execUpgradeSdk(_0x3d9aad);_0xdce02['push'](_0x3431d6),_0x10dc48[_0x3431d6['ok']?_0x191de4(0x1a0):_0x191de4(0x202)](_0x191de4(0x1db)+(_0x3431d6['detail']??(_0x3431d6['ok']?'done':_0x191de4(0x1c1)))),printSummary(_0xdce02);const _0x57e72d=_0xdce02['some'](_0x3736cc=>!_0x3736cc['ok']);_0x57e72d?console[_0x191de4(0x1bb)](a161_0xac24f8[_0x191de4(0x1ee)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console['log'](a161_0xac24f8[_0x191de4(0x1ef)](_0x191de4(0x1f9))),_0x3431d6['ok']&&_0x3d9aad[_0x191de4(0x1af)]&&(console[_0x191de4(0x1bb)](''),console[_0x191de4(0x1bb)](a161_0xac24f8['bold'][_0x191de4(0x1df)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x191de4(0x1bb)](a161_0xac24f8['cyan'](_0x191de4(0x19e))),console[_0x191de4(0x1bb)](''),console[_0x191de4(0x1bb)](a161_0xac24f8['white'](_0x191de4(0x205))),console['log'](a161_0xac24f8['white'](_0x191de4(0x1bf))),console['log'](a161_0xac24f8[_0x191de4(0x1a6)](_0x191de4(0x1e6))),console[_0x191de4(0x1bb)](''));}
@@ -1 +1 @@
1
- const a170_0x976ef7=a170_0x31b4;(function(_0x56ab8f,_0x500488){const _0x3249bd=a170_0x31b4,_0x3bd9d5=_0x56ab8f();while(!![]){try{const _0xaa257b=-parseInt(_0x3249bd(0x1dd))/0x1*(-parseInt(_0x3249bd(0x21a))/0x2)+-parseInt(_0x3249bd(0x216))/0x3*(parseInt(_0x3249bd(0x204))/0x4)+-parseInt(_0x3249bd(0x205))/0x5+-parseInt(_0x3249bd(0x1ea))/0x6+-parseInt(_0x3249bd(0x1cf))/0x7+-parseInt(_0x3249bd(0x1cb))/0x8+-parseInt(_0x3249bd(0x211))/0x9*(-parseInt(_0x3249bd(0x1cd))/0xa);if(_0xaa257b===_0x500488)break;else _0x3bd9d5['push'](_0x3bd9d5['shift']());}catch(_0x1bf4b7){_0x3bd9d5['push'](_0x3bd9d5['shift']());}}}(a170_0x25d5,0x3623b));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{taskDefinitions}from'../commands/task/index.js';import{tenantDefinitions}from'../commands/tenant/index.js';import{roleDefinitions}from'../commands/role/index.js';function a170_0x31b4(_0x2cce38,_0x29334b){_0x2cce38=_0x2cce38-0x1c1;const _0x25d503=a170_0x25d5();let _0x31b42f=_0x25d503[_0x2cce38];return _0x31b42f;}import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';function a170_0x25d5(){const _0x27b5a5=['210268gDSmqB','1964325VcUTAN','menu:update','filter','Notification\x20Configuration','project:init','create','rabetbase\x20kb\x20delete','OCR','wildcardDef','values','knowledge-base:delete','App\x20Management','18NYDdfx','service','Self\x20Update','description','rabetbase\x20workspace\x20init\x20--appcode\x20<code>','24wzwKso','app:use','rabetbase\x20auth\x20logout','read','9274JolkBe','write','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml','skills:install','Tenant\x20Members','knowledge-base:list','Code\x20Generation','Async\x20Tasks','knowledge-base:create','`\x20instead.','SQL\x20Queries','build','app:remove','2521840axdSIi','rabetbase\x20run\x20preview','9469920dRmhRT','Dataset\x20&\x20Operations','2488367SUuLQj','commands','rabetbase\x20workspace\x20use\x20--app\x20<name>','sql:save','\x20\x20[write]','rabetbase\x20run\x20start','rabetbase\x20kb\x20update','login','Schema','skill:install','CLI\x20Built-in\x20Skill','\x20\x20[high-risk-write]','rabetbase\x20bff\x20create','rabetbase\x20run\x20build','29JRcLzj','rabetbase\x20kb\x20list','File','command','set','length','start','skill:','Company\x20Knowledge\x20Base','isSingleCommand','Menu','knowledge-base:detail','Diagnostics','1935540KQskUF','Authentication','install','`\x20has\x20been\x20removed.','rabetbase\x20sql\x20create','rabetbase\x20cli-skill\x20install','Runtime\x20App\x20Config\x20Management','Platform\x20Issue','Roles','Logs','Configuration','Quick\x20Start','app:remote','rabetbase\x20app\x20list\x20--remote','from','app:add','run','skills:','BFF\x20Scripts','rabetbase\x20workspace\x20remove\x20<name>','risk','show','get','map','<script>','Instant\x20API'];a170_0x25d5=function(){return _0x27b5a5;};return a170_0x25d5();}import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x248138){const _0x3b3359=a170_0x31b4;for(const _0x24c24c of _0x248138){definitions['set'](_0x24c24c[_0x3b3359(0x212)]+':'+_0x24c24c[_0x3b3359(0x1e0)],_0x24c24c);let _0x336b4b=serviceGroups[_0x3b3359(0x200)](_0x24c24c[_0x3b3359(0x212)]);!_0x336b4b&&(_0x336b4b=[],serviceGroups['set'](_0x24c24c[_0x3b3359(0x212)],_0x336b4b)),_0x336b4b['push'](_0x24c24c);}}function registerDeclarativeService(_0x469009,_0x1ea2af,_0x2b0509){const _0x285b2a=a170_0x31b4;registerDefinitions(_0x1ea2af);_0x2b0509?.['wildcardDef']&&registerDefinitions([_0x2b0509[_0x285b2a(0x20d)]]);const _0x5092f3=_0x2c968a=>_0x2c968a===_0x285b2a(0x219)?'':_0x2c968a===_0x285b2a(0x21b)?_0x285b2a(0x1d3):_0x285b2a(0x1da),_0x50fab4={'service':_0x1ea2af[0x0][_0x285b2a(0x212)],'label':_0x469009,'commands':_0x1ea2af[_0x285b2a(0x207)](_0x578aae=>!_0x578aae['hidden'])[_0x285b2a(0x201)](_0x4b92aa=>({'command':_0x4b92aa[_0x285b2a(0x1e0)],'description':_0x4b92aa[_0x285b2a(0x214)],'tag':_0x5092f3(_0x4b92aa[_0x285b2a(0x1fe)])})),'declarative':!![],'defaultCommand':_0x2b0509?.['defaultCommand']??(_0x2b0509?.['isSingleCommand']?_0x1ea2af[0x0]['command']:undefined),'wildcardDef':_0x2b0509?.[_0x285b2a(0x20d)],'isSingleCommand':_0x2b0509?.[_0x285b2a(0x1e6)]};serviceRegistry['push'](_0x50fab4),serviceByName[_0x285b2a(0x1e1)](_0x50fab4[_0x285b2a(0x212)],_0x50fab4);}registerDeclarativeService(a170_0x976ef7(0x1f5),initDefinitions,{'defaultCommand':a170_0x976ef7(0x1fa),'isSingleCommand':!![]}),registerDeclarativeService('Project',projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService(a170_0x976ef7(0x210),appDefinitions),registerDeclarativeService(a170_0x976ef7(0x1eb),authDefinitions,{'defaultCommand':a170_0x976ef7(0x1d6)}),registerDeclarativeService(a170_0x976ef7(0x1c2),tenantDefinitions),registerDeclarativeService(a170_0x976ef7(0x1ce),datasetDefinitions),registerDeclarativeService('Smart\x20List\x20Pages',pageDefinitions),registerDeclarativeService('API\x20Development',apiDefinitions),registerDeclarativeService(a170_0x976ef7(0x203),dataDefinitions),registerDeclarativeService(a170_0x976ef7(0x1fc),bffDefinitions),registerDeclarativeService(a170_0x976ef7(0x208),notificationDefinitions),registerDeclarativeService(a170_0x976ef7(0x1c8),sqlDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService(a170_0x976ef7(0x1e7),menuDefinitions),registerDeclarativeService(a170_0x976ef7(0x1c5),taskDefinitions),registerDeclarativeService(a170_0x976ef7(0x1f2),roleDefinitions),registerDeclarativeService('Permissions',permitDefinitions),registerDeclarativeService(a170_0x976ef7(0x1f0),appConfigDefinitions),registerDeclarativeService(a170_0x976ef7(0x1e5),kbDefinitions),registerDeclarativeService(a170_0x976ef7(0x1f1),issueDefinitions),registerDeclarativeService(a170_0x976ef7(0x1df),fileDefinitions),registerDeclarativeService(a170_0x976ef7(0x20c),ocrDefinitions),registerDeclarativeService(a170_0x976ef7(0x1c4),codegenDefinitions),registerDeclarativeService(a170_0x976ef7(0x1f4),configDefinitions),registerDeclarativeService(a170_0x976ef7(0x1e9),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0x976ef7(0x1d7),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0x976ef7(0x213),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0x976ef7(0x1d9),cliSkillDefinitions,{'defaultCommand':a170_0x976ef7(0x1ec)}),registerDeclarativeService(a170_0x976ef7(0x1f3),logsDefinitions,{'defaultCommand':a170_0x976ef7(0x1ff)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a170_0x976ef7(0x1e2)]-0x1];last[a170_0x976ef7(0x1d0)]=[{'command':a170_0x976ef7(0x202),'description':'Run\x20any\x20package.json\x20script','tag':''}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([[a170_0x976ef7(0x1d2),a170_0x976ef7(0x21c)],['bff:new',a170_0x976ef7(0x1db)],['sql:new',a170_0x976ef7(0x1ee)],[a170_0x976ef7(0x206),'rabetbase\x20menu\x20asset-update'],[a170_0x976ef7(0x209),a170_0x976ef7(0x215)],[a170_0x976ef7(0x1e4),'rabetbase\x20cli-skill\x20install'],[a170_0x976ef7(0x1d8),a170_0x976ef7(0x1ef)],[a170_0x976ef7(0x1fb),a170_0x976ef7(0x1ef)],[a170_0x976ef7(0x1c1),'rabetbase\x20cli-skill\x20install'],[a170_0x976ef7(0x1f6),a170_0x976ef7(0x1f7)],[a170_0x976ef7(0x217),a170_0x976ef7(0x1d1)],[a170_0x976ef7(0x1f9),'rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>'],[a170_0x976ef7(0x1ca),a170_0x976ef7(0x1fd)],[a170_0x976ef7(0x1c3),a170_0x976ef7(0x1de)],[a170_0x976ef7(0x1e8),'rabetbase\x20kb\x20detail'],[a170_0x976ef7(0x1c6),'rabetbase\x20kb\x20create'],['knowledge-base:update',a170_0x976ef7(0x1d5)],[a170_0x976ef7(0x20f),a170_0x976ef7(0x20b)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a170_0x976ef7(0x20a),'rabetbase\x20project\x20create\x20<project-name>'],[a170_0x976ef7(0x1e3),a170_0x976ef7(0x1d4)],[a170_0x976ef7(0x1c9),a170_0x976ef7(0x1dc)],['preview',a170_0x976ef7(0x1cc)],['logout',a170_0x976ef7(0x218)]]);export function resolveRemovedCommand(_0x3a695d,_0x4293a8){const _0x4c6e23=a170_0x976ef7;if(!_0x3a695d)return undefined;const _0x4f9c54=REMOVED_COMMAND_REPLACEMENTS[_0x4c6e23(0x200)](_0x3a695d+':'+(_0x4293a8??'')),_0x3bfb9a=REMOVED_FLAT_COMMAND_REPLACEMENTS[_0x4c6e23(0x200)](_0x3a695d),_0x14aee3=_0x4f9c54??_0x3bfb9a;if(!_0x14aee3)return undefined;const _0x501066=_0x3bfb9a?_0x3a695d:_0x4293a8?_0x3a695d+'\x20'+_0x4293a8:_0x3a695d;return{'command':_0x501066,'message':'`rabetbase\x20'+_0x501066+_0x4c6e23(0x1ed),'hint':'Use\x20`'+_0x14aee3+_0x4c6e23(0x1c7)};}export function findDefinition(_0xefc823,_0x203f7f){const _0x3c1f91=a170_0x976ef7;return definitions[_0x3c1f91(0x200)](_0xefc823+':'+_0x203f7f);}export function isKnownService(_0x851069){return serviceByName['has'](_0x851069);}export function isDeclarativeService(_0x1fd569){const _0x344464=a170_0x976ef7;return serviceGroups['has'](_0x1fd569)||serviceByName[_0x344464(0x200)](_0x1fd569)?.[_0x344464(0x20d)]!==undefined;}export function getServiceEntry(_0x56215e){const _0x116811=a170_0x976ef7;return serviceByName[_0x116811(0x200)](_0x56215e);}export function getLegacyHandler(_0x228408,_0x22212c){return undefined;}export function getAllDefinitions(){const _0x31bd85=a170_0x976ef7;return Array[_0x31bd85(0x1f8)](definitions[_0x31bd85(0x20e)]());}
1
+ const a162_0x375c96=a162_0x3aff;(function(_0x2a12dd,_0x4cdd43){const _0x4e2701=a162_0x3aff,_0x1b1760=_0x2a12dd();while(!![]){try{const _0x2e603c=-parseInt(_0x4e2701(0x144))/0x1+parseInt(_0x4e2701(0x182))/0x2*(parseInt(_0x4e2701(0x160))/0x3)+-parseInt(_0x4e2701(0x151))/0x4+-parseInt(_0x4e2701(0x171))/0x5*(parseInt(_0x4e2701(0x162))/0x6)+-parseInt(_0x4e2701(0x15f))/0x7+parseInt(_0x4e2701(0x149))/0x8*(parseInt(_0x4e2701(0x16a))/0x9)+parseInt(_0x4e2701(0x14e))/0xa;if(_0x2e603c===_0x4cdd43)break;else _0x1b1760['push'](_0x1b1760['shift']());}catch(_0x266afb){_0x1b1760['push'](_0x1b1760['shift']());}}}(a162_0x3583,0xb374b));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';function a162_0x3aff(_0x4af2c3,_0x236e8b){_0x4af2c3=_0x4af2c3-0x12b;const _0x358370=a162_0x3583();let _0x3aff9f=_0x358370[_0x4af2c3];return _0x3aff9f;}import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{taskDefinitions}from'../commands/task/index.js';import{tenantDefinitions}from'../commands/tenant/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];function a162_0x3583(){const _0x9bafbb=['Database\x20Connections','Run\x20any\x20package.json\x20script','app:remote','1054FFqCWa','rabetbase\x20run\x20preview','Use\x20`','menu:update','knowledge-base:update','wildcardDef','Platform\x20Issue','Runtime\x20App\x20Config\x20Management','sql:save','rabetbase\x20kb\x20detail','Smart\x20List\x20Pages','commands','Roles','knowledge-base:list','rabetbase\x20cli-skill\x20install','values','knowledge-base:create','logout','skill:install','install','length','<script>','run','File','CLI\x20Built-in\x20Skill','Diagnostics','app:add','set','command','create','Run\x20Scripts','description','rabetbase\x20run\x20start','Authentication','734221lPaBlk','login','rabetbase\x20menu\x20asset-update','build','skills:','1800LWUrvy','`\x20instead.','rabetbase\x20kb\x20create','hidden','rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>','19987000yDLWZp','rabetbase\x20auth\x20logout','Permissions','4693712olYgcu','\x20\x20[write]','\x20\x20[high-risk-write]','API\x20Development','defaultCommand','has','app:use','rabetbase\x20bff\x20create','get','project:init','app:remove','Notification\x20Configuration','Tenant\x20Members','`\x20has\x20been\x20removed.','5784408YkBlTB','4218VyfhHX','map','444558MJmLCk','rabetbase\x20kb\x20update','show','App\x20Management','Quick\x20Start','Project','bff:new','service','32139NPVbsv','Instant\x20API','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml','Configuration','rabetbase\x20sql\x20create','rabetbase\x20workspace\x20use\x20--app\x20<name>','read','5BXNTSr','isSingleCommand','rabetbase\x20run\x20build','Workspace','knowledge-base:detail','BFF\x20Scripts','Logs','rabetbase\x20kb\x20delete','skill:','Company\x20Knowledge\x20Base','start','sql:new','Schema','push'];a162_0x3583=function(){return _0x9bafbb;};return a162_0x3583();}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x14b854){const _0x916b1a=a162_0x3aff;for(const _0x321338 of _0x14b854){definitions[_0x916b1a(0x13d)](_0x321338['service']+':'+_0x321338[_0x916b1a(0x13e)],_0x321338);let _0x7c9ab0=serviceGroups[_0x916b1a(0x159)](_0x321338[_0x916b1a(0x169)]);!_0x7c9ab0&&(_0x7c9ab0=[],serviceGroups['set'](_0x321338['service'],_0x7c9ab0)),_0x7c9ab0[_0x916b1a(0x17e)](_0x321338);}}function registerDeclarativeService(_0x3d1749,_0x3c772b,_0x119355){const _0xbc8762=a162_0x3aff;registerDefinitions(_0x3c772b);_0x119355?.['wildcardDef']&&registerDefinitions([_0x119355['wildcardDef']]);const _0x5765ba=_0x2e89f7=>_0x2e89f7===_0xbc8762(0x170)?'':_0x2e89f7==='write'?_0xbc8762(0x152):_0xbc8762(0x153),_0x15dad6={'service':_0x3c772b[0x0][_0xbc8762(0x169)],'label':_0x3d1749,'commands':_0x3c772b['filter'](_0x4c2d76=>!_0x4c2d76[_0xbc8762(0x14c)])[_0xbc8762(0x161)](_0x5a2258=>({'command':_0x5a2258[_0xbc8762(0x13e)],'description':_0x5a2258[_0xbc8762(0x141)],'tag':_0x5765ba(_0x5a2258['risk'])})),'declarative':!![],'defaultCommand':_0x119355?.[_0xbc8762(0x155)]??(_0x119355?.[_0xbc8762(0x172)]?_0x3c772b[0x0][_0xbc8762(0x13e)]:undefined),'wildcardDef':_0x119355?.[_0xbc8762(0x187)],'isSingleCommand':_0x119355?.[_0xbc8762(0x172)]};serviceRegistry[_0xbc8762(0x17e)](_0x15dad6),serviceByName['set'](_0x15dad6['service'],_0x15dad6);}registerDeclarativeService(a162_0x375c96(0x166),initDefinitions,{'defaultCommand':a162_0x375c96(0x138),'isSingleCommand':!![]}),registerDeclarativeService(a162_0x375c96(0x167),projectDefinitions),registerDeclarativeService(a162_0x375c96(0x174),workspaceDefinitions),registerDeclarativeService(a162_0x375c96(0x165),appDefinitions),registerDeclarativeService(a162_0x375c96(0x143),authDefinitions,{'defaultCommand':a162_0x375c96(0x145)}),registerDeclarativeService(a162_0x375c96(0x15d),tenantDefinitions),registerDeclarativeService('Dataset\x20&\x20Operations',datasetDefinitions),registerDeclarativeService(a162_0x375c96(0x12c),pageDefinitions),registerDeclarativeService(a162_0x375c96(0x154),apiDefinitions),registerDeclarativeService(a162_0x375c96(0x16b),dataDefinitions),registerDeclarativeService(a162_0x375c96(0x176),bffDefinitions),registerDeclarativeService(a162_0x375c96(0x15c),notificationDefinitions),registerDeclarativeService('SQL\x20Queries',sqlDefinitions),registerDeclarativeService(a162_0x375c96(0x17f),dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService('Async\x20Tasks',taskDefinitions),registerDeclarativeService(a162_0x375c96(0x12e),roleDefinitions),registerDeclarativeService(a162_0x375c96(0x150),permitDefinitions),registerDeclarativeService(a162_0x375c96(0x189),appConfigDefinitions),registerDeclarativeService(a162_0x375c96(0x17a),kbDefinitions),registerDeclarativeService(a162_0x375c96(0x188),issueDefinitions),registerDeclarativeService(a162_0x375c96(0x139),fileDefinitions),registerDeclarativeService('OCR',ocrDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a162_0x375c96(0x16d),configDefinitions),registerDeclarativeService(a162_0x375c96(0x13b),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x375c96(0x17d),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x375c96(0x13a),cliSkillDefinitions,{'defaultCommand':a162_0x375c96(0x135)}),registerDeclarativeService(a162_0x375c96(0x177),logsDefinitions,{'defaultCommand':a162_0x375c96(0x164)}),registerDeclarativeService(a162_0x375c96(0x140),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a162_0x375c96(0x136)]-0x1];last[a162_0x375c96(0x12d)]=[{'command':a162_0x375c96(0x137),'description':a162_0x375c96(0x180),'tag':''}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([[a162_0x375c96(0x18a),a162_0x375c96(0x16c)],[a162_0x375c96(0x168),a162_0x375c96(0x158)],[a162_0x375c96(0x17c),a162_0x375c96(0x16e)],[a162_0x375c96(0x185),a162_0x375c96(0x146)],[a162_0x375c96(0x15a),'rabetbase\x20workspace\x20init\x20--appcode\x20<code>'],[a162_0x375c96(0x179),a162_0x375c96(0x130)],[a162_0x375c96(0x134),a162_0x375c96(0x130)],[a162_0x375c96(0x148),'rabetbase\x20cli-skill\x20install'],['skills:install',a162_0x375c96(0x130)],[a162_0x375c96(0x181),'rabetbase\x20app\x20list\x20--remote'],[a162_0x375c96(0x157),a162_0x375c96(0x16f)],[a162_0x375c96(0x13c),a162_0x375c96(0x14d)],[a162_0x375c96(0x15b),'rabetbase\x20workspace\x20remove\x20<name>'],[a162_0x375c96(0x12f),'rabetbase\x20kb\x20list'],[a162_0x375c96(0x175),a162_0x375c96(0x12b)],[a162_0x375c96(0x132),a162_0x375c96(0x14b)],[a162_0x375c96(0x186),a162_0x375c96(0x163)],['knowledge-base:delete',a162_0x375c96(0x178)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a162_0x375c96(0x13f),'rabetbase\x20project\x20create\x20<project-name>'],[a162_0x375c96(0x17b),a162_0x375c96(0x142)],[a162_0x375c96(0x147),a162_0x375c96(0x173)],['preview',a162_0x375c96(0x183)],[a162_0x375c96(0x133),a162_0x375c96(0x14f)]]);export function resolveRemovedCommand(_0x34d28f,_0x3c39ab){const _0x103667=a162_0x375c96;if(!_0x34d28f)return undefined;const _0x13d75d=REMOVED_COMMAND_REPLACEMENTS[_0x103667(0x159)](_0x34d28f+':'+(_0x3c39ab??'')),_0x4b5df5=REMOVED_FLAT_COMMAND_REPLACEMENTS[_0x103667(0x159)](_0x34d28f),_0x1d36d5=_0x13d75d??_0x4b5df5;if(!_0x1d36d5)return undefined;const _0x25b46c=_0x4b5df5?_0x34d28f:_0x3c39ab?_0x34d28f+'\x20'+_0x3c39ab:_0x34d28f;return{'command':_0x25b46c,'message':'`rabetbase\x20'+_0x25b46c+_0x103667(0x15e),'hint':_0x103667(0x184)+_0x1d36d5+_0x103667(0x14a)};}export function findDefinition(_0x5b85dc,_0x55ae5d){const _0x27bdcb=a162_0x375c96;return definitions[_0x27bdcb(0x159)](_0x5b85dc+':'+_0x55ae5d);}export function isKnownService(_0x505391){return serviceByName['has'](_0x505391);}export function isDeclarativeService(_0x54b6b5){const _0x21509e=a162_0x375c96;return serviceGroups[_0x21509e(0x156)](_0x54b6b5)||serviceByName[_0x21509e(0x159)](_0x54b6b5)?.[_0x21509e(0x187)]!==undefined;}export function getServiceEntry(_0x1628ce){const _0x1134c8=a162_0x375c96;return serviceByName[_0x1134c8(0x159)](_0x1628ce);}export function getLegacyHandler(_0x1cca8a,_0x238da4){return undefined;}export function getAllDefinitions(){const _0x2388ae=a162_0x375c96;return Array['from'](definitions[_0x2388ae(0x131)]());}
@@ -1 +1 @@
1
- const a171_0x2a08c8=a171_0x4d4b;(function(_0x15affb,_0x28e34b){const _0x286871=a171_0x4d4b,_0x5a5b47=_0x15affb();while(!![]){try{const _0x1d75e6=-parseInt(_0x286871(0x91))/0x1+-parseInt(_0x286871(0x93))/0x2+-parseInt(_0x286871(0x9a))/0x3+parseInt(_0x286871(0x8f))/0x4*(-parseInt(_0x286871(0x98))/0x5)+-parseInt(_0x286871(0x97))/0x6*(-parseInt(_0x286871(0x8d))/0x7)+parseInt(_0x286871(0x9e))/0x8*(-parseInt(_0x286871(0x9d))/0x9)+-parseInt(_0x286871(0x99))/0xa*(-parseInt(_0x286871(0x94))/0xb);if(_0x1d75e6===_0x28e34b)break;else _0x5a5b47['push'](_0x5a5b47['shift']());}catch(_0x5cb27e){_0x5a5b47['push'](_0x5a5b47['shift']());}}}(a171_0x1a5b,0x57d2c));import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a171_0x1a5b(){const _0x383df3=['Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','360764jnpheV','55ITyHbX','flagMissing','appCode','3108318FwCHzM','955LbjSMo','3361970QcMRrz','1818831TUpGkM','name','remark','138456rzSjGk','304ZGBCWK','roleName','POST','validation','length','create','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','trim','7XGljps','str','232yrVJUk','Created\x20role\x20','456985BWgcKW'];a171_0x1a5b=function(){return _0x383df3;};return a171_0x1a5b();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';function a171_0x4d4b(_0x2e0e3f,_0x47dd90){_0x2e0e3f=_0x2e0e3f-0x86;const _0x1a5b50=a171_0x1a5b();let _0x4d4ba8=_0x1a5b50[_0x2e0e3f];return _0x4d4ba8;}const CREATE_PATH='/smartapi/permit/role/create';function readName(_0x4f6370){const _0x1ddd03=a171_0x4d4b,_0x195d50=_0x4f6370[_0x1ddd03(0x8e)](_0x1ddd03(0x9b))['trim']();if(!_0x195d50)throw CliErrors[_0x1ddd03(0x95)]('name','Pass\x20--name\x20<roleName>.');if(_0x195d50[_0x1ddd03(0x89)]>0x40)throw CliErrors[_0x1ddd03(0x88)](_0x1ddd03(0x8b));return _0x195d50;}export const roleCreate={'service':'role','command':a171_0x2a08c8(0x8a),'description':a171_0x2a08c8(0x92),'risk':'write','flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5d532c){readName(_0x5d532c);},async 'dryRun'(_0x131cfd){const _0x37d530=a171_0x2a08c8,_0x55fe2f=readName(_0x131cfd),_0xba9b28=_0x131cfd[_0x37d530(0x8e)](_0x37d530(0x9c))[_0x37d530(0x8c)]()||undefined;return asDryRunResult({'operation':'create','selector':{'appCode':_0x131cfd[_0x37d530(0x96)],'roleName':_0x55fe2f},'before':null,'after':{'roleName':_0x55fe2f,'roleType':'CUSTOM','remark':_0xba9b28},'dryRun':!![],'backend':{'method':_0x37d530(0x87),'path':CREATE_PATH},'warnings':[]},{'method':_0x37d530(0x87),'url':CREATE_PATH});},async 'execute'(_0x27d161){const _0x381dd4=a171_0x2a08c8,_0x20fdb5=readName(_0x27d161),_0x20bbae=_0x27d161['str'](_0x381dd4(0x9c))[_0x381dd4(0x8c)]()||undefined,_0x25892f=await createAppRole({'appCode':_0x27d161[_0x381dd4(0x96)],'roleName':_0x20fdb5,..._0x20bbae?{'remark':_0x20bbae}:{}});return{'ok':!![],'data':{'operation':_0x381dd4(0x8a),'selector':{'appCode':_0x27d161[_0x381dd4(0x96)],'roleId':_0x25892f['id'],'roleName':_0x20fdb5},'before':null,'after':projectRole(_0x25892f),'dryRun':![],'backend':{'method':_0x381dd4(0x87),'path':CREATE_PATH},'warnings':[]},'message':_0x381dd4(0x90)+_0x25892f[_0x381dd4(0x86)]+'\x20(id='+_0x25892f['id']+')'};}};
1
+ const a163_0x8d0713=a163_0x5dff;(function(_0x389bbd,_0x17ea73){const _0x57eb00=a163_0x5dff,_0x58c20a=_0x389bbd();while(!![]){try{const _0x77869b=-parseInt(_0x57eb00(0x161))/0x1+parseInt(_0x57eb00(0x173))/0x2*(parseInt(_0x57eb00(0x165))/0x3)+parseInt(_0x57eb00(0x15e))/0x4+parseInt(_0x57eb00(0x167))/0x5*(-parseInt(_0x57eb00(0x15b))/0x6)+-parseInt(_0x57eb00(0x16e))/0x7*(-parseInt(_0x57eb00(0x16c))/0x8)+parseInt(_0x57eb00(0x169))/0x9+parseInt(_0x57eb00(0x15f))/0xa*(-parseInt(_0x57eb00(0x168))/0xb);if(_0x77869b===_0x17ea73)break;else _0x58c20a['push'](_0x58c20a['shift']());}catch(_0x5a8621){_0x58c20a['push'](_0x58c20a['shift']());}}}(a163_0x578f,0xb5100));function a163_0x5dff(_0x3e0bc3,_0x493c83){_0x3e0bc3=_0x3e0bc3-0x15a;const _0x578ff9=a163_0x578f();let _0x5dffe1=_0x578ff9[_0x3e0bc3];return _0x5dffe1;}import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH='/smartapi/permit/role/create';function readName(_0x5aa9e6){const _0x3d5506=a163_0x5dff,_0x54ed21=_0x5aa9e6[_0x3d5506(0x16f)](_0x3d5506(0x15d))[_0x3d5506(0x160)]();if(!_0x54ed21)throw CliErrors[_0x3d5506(0x174)](_0x3d5506(0x15d),_0x3d5506(0x15a));if(_0x54ed21[_0x3d5506(0x16a)]>0x40)throw CliErrors[_0x3d5506(0x16d)](_0x3d5506(0x170));return _0x54ed21;}function a163_0x578f(){const _0x275a71=['appCode','Pass\x20--name\x20<roleName>.','2082kmilui','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','name','3351244bQGPnX','20517610dqQnUF','trim','738312NojVKp','write','role','roleName','3110274bqMYAe','\x20(id=','4985Wdcstp','11JMmwYL','9721566QDrJLn','length','CUSTOM','184KeSnUX','validation','280889ZMMuJr','str','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','POST','create','2jhwiBU','flagMissing'];a163_0x578f=function(){return _0x275a71;};return a163_0x578f();}export const roleCreate={'service':a163_0x8d0713(0x163),'command':'create','description':a163_0x8d0713(0x15c),'risk':a163_0x8d0713(0x162),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x58169c){readName(_0x58169c);},async 'dryRun'(_0x1bcba6){const _0x1b35a9=a163_0x8d0713,_0x373f8e=readName(_0x1bcba6),_0x4380fb=_0x1bcba6['str']('remark')['trim']()||undefined;return asDryRunResult({'operation':_0x1b35a9(0x172),'selector':{'appCode':_0x1bcba6[_0x1b35a9(0x175)],'roleName':_0x373f8e},'before':null,'after':{'roleName':_0x373f8e,'roleType':_0x1b35a9(0x16b),'remark':_0x4380fb},'dryRun':!![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},{'method':_0x1b35a9(0x171),'url':CREATE_PATH});},async 'execute'(_0x584bbb){const _0x5ef988=a163_0x8d0713,_0x5b677f=readName(_0x584bbb),_0x59cce8=_0x584bbb[_0x5ef988(0x16f)]('remark')[_0x5ef988(0x160)]()||undefined,_0x4244b5=await createAppRole({'appCode':_0x584bbb[_0x5ef988(0x175)],'roleName':_0x5b677f,..._0x59cce8?{'remark':_0x59cce8}:{}});return{'ok':!![],'data':{'operation':_0x5ef988(0x172),'selector':{'appCode':_0x584bbb[_0x5ef988(0x175)],'roleId':_0x4244b5['id'],'roleName':_0x5b677f},'before':null,'after':projectRole(_0x4244b5),'dryRun':![],'backend':{'method':_0x5ef988(0x171),'path':CREATE_PATH},'warnings':[]},'message':'Created\x20role\x20'+_0x4244b5[_0x5ef988(0x164)]+_0x5ef988(0x166)+_0x4244b5['id']+')'};}};
@@ -1 +1 @@
1
- const a172_0x43eda7=a172_0x32f5;(function(_0x42494c,_0x1205e9){const _0x55a9fc=a172_0x32f5,_0x8d058=_0x42494c();while(!![]){try{const _0x2b2e28=-parseInt(_0x55a9fc(0x113))/0x1+-parseInt(_0x55a9fc(0xff))/0x2*(parseInt(_0x55a9fc(0x114))/0x3)+parseInt(_0x55a9fc(0x107))/0x4+-parseInt(_0x55a9fc(0x101))/0x5*(parseInt(_0x55a9fc(0x103))/0x6)+parseInt(_0x55a9fc(0x10e))/0x7+-parseInt(_0x55a9fc(0x108))/0x8+parseInt(_0x55a9fc(0x10b))/0x9;if(_0x2b2e28===_0x1205e9)break;else _0x8d058['push'](_0x8d058['shift']());}catch(_0x1274db){_0x8d058['push'](_0x8d058['shift']());}}}(a172_0x5345,0xc7d87));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a172_0x32f5(_0x34421b,_0x6f555){_0x34421b=_0x34421b-0xff;const _0x5345a4=a172_0x5345();let _0x32f575=_0x5345a4[_0x34421b];return _0x32f575;}function a172_0x5345(){const _0x204594=['\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','/smartapi/permit/role/delete','24452802TdswIB','Deleted\x20role\x20','num','7931770KrMFLh','role','roleName','\x20(id=','userCount','512411LuFYzg','112224oWrsEj','40uhrjqj','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','10RuZaKX','Role\x20still\x20has\x20','4601328lsyNoR','delete','POST','appCode','3708192UxiPPh','9313776MDWIxV'];a172_0x5345=function(){return _0x204594;};return a172_0x5345();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a172_0x43eda7(0x10a);export const roleDelete={'service':a172_0x43eda7(0x10f),'command':a172_0x43eda7(0x104),'description':a172_0x43eda7(0x100),'risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x153f1a){const _0x5aaa6f=a172_0x43eda7,_0x3c871f=_0x153f1a[_0x5aaa6f(0x10d)]('id'),_0x275789=await getRoleById(_0x153f1a['appCode'],_0x3c871f);return assertCustomRole(_0x275789,'delete'),asDryRunResult({'operation':_0x5aaa6f(0x104),'selector':{'appCode':_0x153f1a[_0x5aaa6f(0x106)],'roleId':_0x3c871f,'roleName':_0x275789[_0x5aaa6f(0x110)]},'before':projectRole(_0x275789),'after':null,'dryRun':!![],'backend':{'method':_0x5aaa6f(0x105),'path':DELETE_PATH},'warnings':_0x275789['userCount']>0x0?[_0x5aaa6f(0x102)+_0x275789[_0x5aaa6f(0x112)]+_0x5aaa6f(0x109)]:[]},{'method':_0x5aaa6f(0x105),'url':DELETE_PATH});},async 'execute'(_0x4a8629){const _0x15676b=a172_0x43eda7,_0x142202=_0x4a8629[_0x15676b(0x10d)]('id'),_0x563139=await getRoleById(_0x4a8629['appCode'],_0x142202);return assertCustomRole(_0x563139,'delete'),await deleteAppRole(_0x142202),{'ok':!![],'data':{'operation':_0x15676b(0x104),'selector':{'appCode':_0x4a8629[_0x15676b(0x106)],'roleId':_0x142202,'roleName':_0x563139['roleName']},'before':projectRole(_0x563139),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x15676b(0x10c)+_0x563139[_0x15676b(0x110)]+_0x15676b(0x111)+_0x142202+')'};}};
1
+ const a164_0x5a4c74=a164_0xe573;function a164_0xe573(_0x174e01,_0x767c90){_0x174e01=_0x174e01-0x93;const _0x18a6b0=a164_0x18a6();let _0xe573cf=_0x18a6b0[_0x174e01];return _0xe573cf;}(function(_0x578552,_0x364578){const _0x2478b7=a164_0xe573,_0xe8d2f2=_0x578552();while(!![]){try{const _0x3bda8f=parseInt(_0x2478b7(0xa7))/0x1+parseInt(_0x2478b7(0x9f))/0x2*(parseInt(_0x2478b7(0x99))/0x3)+-parseInt(_0x2478b7(0x97))/0x4+-parseInt(_0x2478b7(0x9e))/0x5*(parseInt(_0x2478b7(0xa8))/0x6)+parseInt(_0x2478b7(0x9c))/0x7+-parseInt(_0x2478b7(0xa1))/0x8*(-parseInt(_0x2478b7(0xa2))/0x9)+-parseInt(_0x2478b7(0xa9))/0xa;if(_0x3bda8f===_0x364578)break;else _0xe8d2f2['push'](_0xe8d2f2['shift']());}catch(_0x258d55){_0xe8d2f2['push'](_0xe8d2f2['shift']());}}}(a164_0x18a6,0x1aefb));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a164_0x18a6(){const _0x22a313=['Deleted\x20role\x20','delete','num','206646NRCpoE','12lEYsWJ','1807150ZczWMn','\x20(id=','/smartapi/permit/role/delete','role','userCount','632052MDHDNV','Role\x20still\x20has\x20','97968wYJUbd','POST','roleName','944230TsIgQq','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','431275WhKoyJ','10kCuhwa','high-risk-write','133432RgYENX','63InOWeb','appCode'];a164_0x18a6=function(){return _0x22a313;};return a164_0x18a6();}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a164_0x5a4c74(0x94);export const roleDelete={'service':a164_0x5a4c74(0x95),'command':a164_0x5a4c74(0xa5),'description':a164_0x5a4c74(0x9d),'risk':a164_0x5a4c74(0xa0),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1b191d){const _0x4496aa=a164_0x5a4c74,_0x3b7841=_0x1b191d['num']('id'),_0x3deac6=await getRoleById(_0x1b191d['appCode'],_0x3b7841);return assertCustomRole(_0x3deac6,_0x4496aa(0xa5)),asDryRunResult({'operation':_0x4496aa(0xa5),'selector':{'appCode':_0x1b191d[_0x4496aa(0xa3)],'roleId':_0x3b7841,'roleName':_0x3deac6[_0x4496aa(0x9b)]},'before':projectRole(_0x3deac6),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x3deac6[_0x4496aa(0x96)]>0x0?[_0x4496aa(0x98)+_0x3deac6[_0x4496aa(0x96)]+'\x20member(s);\x20they\x20will\x20lose\x20this\x20group.']:[]},{'method':_0x4496aa(0x9a),'url':DELETE_PATH});},async 'execute'(_0x356d85){const _0xf5beff=a164_0x5a4c74,_0x1c747d=_0x356d85[_0xf5beff(0xa6)]('id'),_0x18bb74=await getRoleById(_0x356d85[_0xf5beff(0xa3)],_0x1c747d);return assertCustomRole(_0x18bb74,'delete'),await deleteAppRole(_0x1c747d),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0x356d85[_0xf5beff(0xa3)],'roleId':_0x1c747d,'roleName':_0x18bb74['roleName']},'before':projectRole(_0x18bb74),'after':null,'dryRun':![],'backend':{'method':_0xf5beff(0x9a),'path':DELETE_PATH},'warnings':[]},'message':_0xf5beff(0xa4)+_0x18bb74[_0xf5beff(0x9b)]+_0xf5beff(0x93)+_0x1c747d+')'};}};
@@ -1 +1 @@
1
- const a173_0x57e9b5=a173_0x35d2;(function(_0x1b0132,_0x8422c2){const _0x215d86=a173_0x35d2,_0x1ff8c1=_0x1b0132();while(!![]){try{const _0x46c1c9=parseInt(_0x215d86(0x150))/0x1*(-parseInt(_0x215d86(0x158))/0x2)+parseInt(_0x215d86(0x157))/0x3*(-parseInt(_0x215d86(0x152))/0x4)+parseInt(_0x215d86(0x155))/0x5*(parseInt(_0x215d86(0x151))/0x6)+parseInt(_0x215d86(0x153))/0x7+-parseInt(_0x215d86(0x14b))/0x8*(-parseInt(_0x215d86(0x14d))/0x9)+-parseInt(_0x215d86(0x15a))/0xa*(parseInt(_0x215d86(0x14e))/0xb)+-parseInt(_0x215d86(0x154))/0xc*(-parseInt(_0x215d86(0x156))/0xd);if(_0x46c1c9===_0x8422c2)break;else _0x1ff8c1['push'](_0x1ff8c1['shift']());}catch(_0x467eca){_0x1ff8c1['push'](_0x1ff8c1['shift']());}}}(a173_0x283f,0xf3dd2));function a173_0x35d2(_0x582d43,_0x51850e){_0x582d43=_0x582d43-0x14a;const _0x283fbe=a173_0x283f();let _0x35d23d=_0x283fbe[_0x582d43];return _0x35d23d;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a173_0x283f(){const _0x5eae1f=['768460rpYEqd','60lBWoaK','20RCQrue','5859529ABVXWx','3UXPDRG','2pDAScc','roleType','84010GLlvRe','Show\x20a\x20single\x20role\x27s\x20detail','8JQwSVI','roleName','12187386pDTPsq','1914wJJvys','role','1531078wIuJUr','1863942kpalFq','3874036ozwsWt'];a173_0x283f=function(){return _0x5eae1f;};return a173_0x283f();}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a173_0x57e9b5(0x14f),'command':'detail','description':a173_0x57e9b5(0x14a),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x1a80ca){const _0x548a9a=a173_0x57e9b5,_0x45b8ab=_0x1a80ca['num']('id'),_0x3ebf06=await getRoleById(_0x1a80ca['appCode'],_0x45b8ab);return{'ok':!![],'data':{'role':projectRole(_0x3ebf06)},'message':'Role\x20'+_0x3ebf06[_0x548a9a(0x14c)]+'\x20('+_0x3ebf06[_0x548a9a(0x159)]+')'};}};
1
+ function a165_0x5358(){const _0x5bda50=['roleType','Role\x20','9607130pLxQKZ','roleName','Show\x20a\x20single\x20role\x27s\x20detail','7931ESHPjq','1214964yuDPwy','785YkUajj','547359OzZrbp','detail','role','2974356DEkXRT','1282VdGCKA','num','read','9510EVqsGP','2504JdUdbP','10oBpRRI'];a165_0x5358=function(){return _0x5bda50;};return a165_0x5358();}const a165_0x186778=a165_0x4882;function a165_0x4882(_0x134592,_0x8849c2){_0x134592=_0x134592-0xca;const _0x5358d1=a165_0x5358();let _0x488215=_0x5358d1[_0x134592];return _0x488215;}(function(_0x4cdde4,_0x4f64db){const _0x1f02ee=a165_0x4882,_0x347173=_0x4cdde4();while(!![]){try{const _0x2dc65a=-parseInt(_0x1f02ee(0xd8))/0x1*(-parseInt(_0x1f02ee(0xcb))/0x2)+-parseInt(_0x1f02ee(0xd4))/0x3+-parseInt(_0x1f02ee(0xd2))/0x4+-parseInt(_0x1f02ee(0xd3))/0x5*(parseInt(_0x1f02ee(0xdb))/0x6)+parseInt(_0x1f02ee(0xd1))/0x7*(-parseInt(_0x1f02ee(0xca))/0x8)+parseInt(_0x1f02ee(0xd7))/0x9+parseInt(_0x1f02ee(0xce))/0xa;if(_0x2dc65a===_0x4f64db)break;else _0x347173['push'](_0x347173['shift']());}catch(_0x69bb3a){_0x347173['push'](_0x347173['shift']());}}}(a165_0x5358,0x32c43));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a165_0x186778(0xd6),'command':a165_0x186778(0xd5),'description':a165_0x186778(0xd0),'risk':a165_0x186778(0xda),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x3cc80e){const _0x35b53c=a165_0x186778,_0x31f06d=_0x3cc80e[_0x35b53c(0xd9)]('id'),_0x2e5830=await getRoleById(_0x3cc80e['appCode'],_0x31f06d);return{'ok':!![],'data':{'role':projectRole(_0x2e5830)},'message':_0x35b53c(0xcd)+_0x2e5830[_0x35b53c(0xcf)]+'\x20('+_0x2e5830[_0x35b53c(0xcc)]+')'};}};
@@ -1 +1 @@
1
- function a174_0x4829(){const _0x2bd90d=['39KBWENy','729952FbQWFu','21764urNzhU','9uZySus','832210oiDSHF','10396UHVijY','35UKJlET','1948765MMFwZA','1332294FaxORq','39513arLStl','55CWNZGk'];a174_0x4829=function(){return _0x2bd90d;};return a174_0x4829();}(function(_0x374654,_0x3f1fcc){const _0x27aa95=a174_0xe0e9,_0x1f4a4f=_0x374654();while(!![]){try{const _0x2442c1=parseInt(_0x27aa95(0x1bf))/0x1+parseInt(_0x27aa95(0x1c3))/0x2*(parseInt(_0x27aa95(0x1c1))/0x3)+-parseInt(_0x27aa95(0x1c6))/0x4*(-parseInt(_0x27aa95(0x1bc))/0x5)+parseInt(_0x27aa95(0x1be))/0x6+parseInt(_0x27aa95(0x1bd))/0x7+parseInt(_0x27aa95(0x1c2))/0x8*(-parseInt(_0x27aa95(0x1c4))/0x9)+-parseInt(_0x27aa95(0x1c5))/0xa*(parseInt(_0x27aa95(0x1c0))/0xb);if(_0x2442c1===_0x3f1fcc)break;else _0x1f4a4f['push'](_0x1f4a4f['shift']());}catch(_0xf51779){_0x1f4a4f['push'](_0x1f4a4f['shift']());}}}(a174_0x4829,0x2ef0b));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';function a174_0xe0e9(_0x25699c,_0x1481bb){_0x25699c=_0x25699c-0x1bc;const _0x482984=a174_0x4829();let _0xe0e986=_0x482984[_0x25699c];return _0xe0e986;}import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0xdb472c,_0x4b41f7){const _0xa5ebbf=a166_0x4b92,_0x523113=_0xdb472c();while(!![]){try{const _0x647b78=parseInt(_0xa5ebbf(0xb1))/0x1+-parseInt(_0xa5ebbf(0xaf))/0x2*(parseInt(_0xa5ebbf(0xb3))/0x3)+-parseInt(_0xa5ebbf(0xb6))/0x4+parseInt(_0xa5ebbf(0xb5))/0x5*(-parseInt(_0xa5ebbf(0xb0))/0x6)+-parseInt(_0xa5ebbf(0xb7))/0x7*(parseInt(_0xa5ebbf(0xb2))/0x8)+-parseInt(_0xa5ebbf(0xb8))/0x9+parseInt(_0xa5ebbf(0xb4))/0xa;if(_0x647b78===_0x4b41f7)break;else _0x523113['push'](_0x523113['shift']());}catch(_0x52c9b6){_0x523113['push'](_0x523113['shift']());}}}(a166_0x18cb,0x7be03));function a166_0x4b92(_0xc5d2fb,_0x1b8257){_0xc5d2fb=_0xc5d2fb-0xaf;const _0x18cbef=a166_0x18cb();let _0x4b9204=_0x18cbef[_0xc5d2fb];return _0x4b9204;}import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';function a166_0x18cb(){const _0xa0cd33=['212LMJyxn','222774dqcVzs','844276TGapwn','152kwRiIc','21633ZVoQCd','17342150PPdpSE','10DkySST','61636BmdggW','287672xolouj','3926151BZSdXs'];a166_0x18cb=function(){return _0xa0cd33;};return a166_0x18cb();}export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- const a175_0x1edd84=a175_0xab32;(function(_0x500d82,_0x4b6fbd){const _0xeb1bde=a175_0xab32,_0x42d0d9=_0x500d82();while(!![]){try{const _0xc2b1bb=parseInt(_0xeb1bde(0xd9))/0x1*(-parseInt(_0xeb1bde(0xc7))/0x2)+-parseInt(_0xeb1bde(0xcc))/0x3*(parseInt(_0xeb1bde(0xe5))/0x4)+-parseInt(_0xeb1bde(0xcd))/0x5*(parseInt(_0xeb1bde(0xdf))/0x6)+parseInt(_0xeb1bde(0xe2))/0x7+-parseInt(_0xeb1bde(0xcb))/0x8*(parseInt(_0xeb1bde(0xc5))/0x9)+-parseInt(_0xeb1bde(0xcf))/0xa+parseInt(_0xeb1bde(0xda))/0xb;if(_0xc2b1bb===_0x4b6fbd)break;else _0x42d0d9['push'](_0x42d0d9['shift']());}catch(_0x197a97){_0x42d0d9['push'](_0x42d0d9['shift']());}}}(a175_0x1a69,0x68742));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a175_0x1a69(){const _0x59da15=['num','read','validation','2033032YwodBR','530259PkSVbY','2900nRAdeY','roleType','4917000ewnQmq','Invalid\x20--type\x20\x22','trim','includes','number','Found\x20','CUSTOM','DEV','type','str','3toRYFl','28357857LZPcFg','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','appCode','map','toUpperCase','6702ivljTI','Page\x20index\x20(1-based)','pagesize','5278966dzMrsU','Filter\x20by\x20role\x20type','role','16wKvCJg','length','\x20role(s)','page','string','18kMQCfa','Use\x20one\x20of:\x20','366302Hgieqw'];a175_0x1a69=function(){return _0x59da15;};return a175_0x1a69();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a175_0xab32(_0x124768,_0x2da06c){_0x124768=_0x124768-0xc2;const _0x1a69df=a175_0x1a69();let _0xab323=_0x1a69df[_0x124768];return _0xab323;}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=['ADMIN',a175_0x1edd84(0xd6),'USER',a175_0x1edd84(0xd5)];export const roleList={'service':a175_0x1edd84(0xe4),'command':'list','description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a175_0x1edd84(0xc9),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a175_0x1edd84(0xd7),'type':a175_0x1edd84(0xc4),'required':![],'description':a175_0x1edd84(0xe3),'enum':ROLE_TYPES},{'name':a175_0x1edd84(0xc3),'type':'number','description':a175_0x1edd84(0xe0),'default':0x1},{'name':a175_0x1edd84(0xe1),'type':a175_0x1edd84(0xd3),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x9f2127){const _0x592200=a175_0x1edd84,_0x4aabb2=_0x9f2127[_0x592200(0xd8)]('type')[_0x592200(0xd1)]();if(_0x4aabb2&&!ROLE_TYPES[_0x592200(0xd2)](_0x4aabb2['toUpperCase']()))throw CliErrors[_0x592200(0xca)](_0x592200(0xd0)+_0x4aabb2+'\x22.',_0x592200(0xc6)+ROLE_TYPES['join'](',\x20')+'.');const _0x2f7b47=_0x9f2127['num'](_0x592200(0xc3),0x1),_0x5a48e6=_0x9f2127[_0x592200(0xc8)]('pagesize',0x64);if(_0x2f7b47<0x1)throw CliErrors[_0x592200(0xca)]('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x5a48e6<0x1||_0x5a48e6>0x64)throw CliErrors[_0x592200(0xca)](_0x592200(0xdb));},async 'execute'(_0x1ead74){const _0x244c22=a175_0x1edd84,_0x4d08e8=_0x1ead74[_0x244c22(0xc8)]('page',0x1)||0x1,_0x5b8869=_0x1ead74[_0x244c22(0xc8)](_0x244c22(0xe1),0x64)||0x64,_0x560294=_0x1ead74[_0x244c22(0xd8)](_0x244c22(0xd7))[_0x244c22(0xd1)]()[_0x244c22(0xde)](),{items:_0x4b8486,paging:_0x2701d3}=await listAppRoles(_0x1ead74[_0x244c22(0xdc)],{'currentPage':_0x4d08e8,'pageSize':_0x5b8869}),_0x577793=_0x560294?_0x4b8486['filter'](_0x10fb28=>_0x10fb28[_0x244c22(0xce)]===_0x560294):_0x4b8486,_0x3d8068=_0x577793[_0x244c22(0xdd)](projectRole);return{'ok':!![],'data':{'roles':_0x3d8068,'paging':_0x2701d3},'message':_0x244c22(0xd4)+_0x3d8068[_0x244c22(0xe6)]+_0x244c22(0xc2)};}};
1
+ const a167_0x17ac67=a167_0x178e;(function(_0x27cd63,_0x13b894){const _0x561064=a167_0x178e,_0x26b64d=_0x27cd63();while(!![]){try{const _0x4608cf=-parseInt(_0x561064(0x155))/0x1*(parseInt(_0x561064(0x14e))/0x2)+-parseInt(_0x561064(0x151))/0x3*(-parseInt(_0x561064(0x145))/0x4)+parseInt(_0x561064(0x15f))/0x5*(parseInt(_0x561064(0x144))/0x6)+-parseInt(_0x561064(0x14c))/0x7*(parseInt(_0x561064(0x162))/0x8)+parseInt(_0x561064(0x148))/0x9*(parseInt(_0x561064(0x146))/0xa)+parseInt(_0x561064(0x149))/0xb*(parseInt(_0x561064(0x165))/0xc)+-parseInt(_0x561064(0x15e))/0xd*(parseInt(_0x561064(0x150))/0xe);if(_0x4608cf===_0x13b894)break;else _0x26b64d['push'](_0x26b64d['shift']());}catch(_0x244a43){_0x26b64d['push'](_0x26b64d['shift']());}}}(a167_0x3ea0,0x896d3));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a167_0x178e(_0x27ef19,_0x1ef3c0){_0x27ef19=_0x27ef19-0x143;const _0x3ea051=a167_0x3ea0();let _0x178e11=_0x3ea051[_0x27ef19];return _0x178e11;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';function a167_0x3ea0(){const _0x5532a1=['join','ADMIN','78PdkseI','4NdHiAf','10yQOQxg','number','10068372FuEdES','11DTjFEI','filter','includes','49gKSLOU','appCode','15760liBaLJ','Page\x20index\x20(1-based)','126TfObyy','2517615IOMvfO','Invalid\x20--type\x20\x22','Page\x20size\x20(1-100)','Found\x20','2adugsa','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','list','validation','Use\x20one\x20of:\x20','trim','type','toUpperCase','roleType','2501915AhHlkr','159665OakrSu','pagesize','role','380136XJdCVW','num','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','3243972BIbpcM','str','string','USER','page'];a167_0x3ea0=function(){return _0x5532a1;};return a167_0x3ea0();}const ROLE_TYPES=[a167_0x17ac67(0x143),'DEV',a167_0x17ac67(0x168),'CUSTOM'];export const roleList={'service':a167_0x17ac67(0x161),'command':a167_0x17ac67(0x157),'description':a167_0x17ac67(0x156),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a167_0x17ac67(0x15b),'type':a167_0x17ac67(0x167),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':a167_0x17ac67(0x169),'type':a167_0x17ac67(0x147),'description':a167_0x17ac67(0x14f),'default':0x1},{'name':a167_0x17ac67(0x160),'type':'number','description':a167_0x17ac67(0x153),'default':0x64}],async 'validate'(_0x45c961){const _0x5ab86c=a167_0x17ac67,_0x3d9dc2=_0x45c961['str'](_0x5ab86c(0x15b))[_0x5ab86c(0x15a)]();if(_0x3d9dc2&&!ROLE_TYPES[_0x5ab86c(0x14b)](_0x3d9dc2[_0x5ab86c(0x15c)]()))throw CliErrors[_0x5ab86c(0x158)](_0x5ab86c(0x152)+_0x3d9dc2+'\x22.',_0x5ab86c(0x159)+ROLE_TYPES[_0x5ab86c(0x16a)](',\x20')+'.');const _0x359fd5=_0x45c961[_0x5ab86c(0x163)]('page',0x1),_0x1eb0a2=_0x45c961['num'](_0x5ab86c(0x160),0x64);if(_0x359fd5<0x1)throw CliErrors[_0x5ab86c(0x158)]('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x1eb0a2<0x1||_0x1eb0a2>0x64)throw CliErrors[_0x5ab86c(0x158)](_0x5ab86c(0x164));},async 'execute'(_0x1516ee){const _0x1ded09=a167_0x17ac67,_0x252751=_0x1516ee[_0x1ded09(0x163)](_0x1ded09(0x169),0x1)||0x1,_0x11acdf=_0x1516ee[_0x1ded09(0x163)](_0x1ded09(0x160),0x64)||0x64,_0x258797=_0x1516ee[_0x1ded09(0x166)]('type')['trim']()[_0x1ded09(0x15c)](),{items:_0x196741,paging:_0x1d43af}=await listAppRoles(_0x1516ee[_0x1ded09(0x14d)],{'currentPage':_0x252751,'pageSize':_0x11acdf}),_0x1698e9=_0x258797?_0x196741[_0x1ded09(0x14a)](_0x19010d=>_0x19010d[_0x1ded09(0x15d)]===_0x258797):_0x196741,_0x2627c5=_0x1698e9['map'](projectRole);return{'ok':!![],'data':{'roles':_0x2627c5,'paging':_0x1d43af},'message':_0x1ded09(0x154)+_0x2627c5['length']+'\x20role(s)'};}};
@@ -1 +1 @@
1
- const a176_0x28f530=a176_0xbb3d;(function(_0x1e6096,_0x10cb0b){const _0x501083=a176_0xbb3d,_0x4a7bfd=_0x1e6096();while(!![]){try{const _0x16b8ea=-parseInt(_0x501083(0xcb))/0x1+parseInt(_0x501083(0xa4))/0x2+-parseInt(_0x501083(0xaa))/0x3+parseInt(_0x501083(0xc0))/0x4+parseInt(_0x501083(0xa6))/0x5*(-parseInt(_0x501083(0xa2))/0x6)+parseInt(_0x501083(0xb7))/0x7*(-parseInt(_0x501083(0xb9))/0x8)+-parseInt(_0x501083(0x87))/0x9*(parseInt(_0x501083(0xc1))/0xa);if(_0x16b8ea===_0x10cb0b)break;else _0x4a7bfd['push'](_0x4a7bfd['shift']());}catch(_0x5e47f9){_0x4a7bfd['push'](_0x4a7bfd['shift']());}}}(a176_0x3910,0x41f2d));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a176_0x28f530(0xba),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};function a176_0x3910(){const _0x4f9423=['push','tenant_code','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','authRequired','roleName','userCount','POST','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','154aZgJbw','expect-user-count','96792fudyDW','number','userId','filter','Missing\x20user\x20reference.','CUSTOM','/smartapi/permit/user-role/update-user-list','2104488QLZFzG','110300rUPAnh','name','tenant','totalCount','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','dryRun','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','user-add','Disambiguate\x20with\x20--role\x20<id>.','Anti-drift\x20check\x20failed:\x20expected\x20','13763ZehOfC','user','appCode','\x22:\x20','str','splice','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','map','DEV','Cannot\x20','toLowerCase','Optional\x20role\x20remark/description','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','string','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','Disambiguate\x20with\x20--user\x20<id>.','Pass\x20--role\x20<id|name>.','No\x20tenant\x20member\x20matches\x20\x22','135tbPxwM','includes','trim','Role\x20name\x20\x22','remark','test','userList','role','permitCount','\x22\x20is\x20ambiguous\x20(ids:\x20','\x20member(s)\x20but\x20role\x20has\x20','\x20not\x20found\x20in\x20app\x20','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs',';\x20no\x20change.','Role\x20id\x20','\x22\x20not\x20found\x20in\x20app\x20','\x20is\x20not\x20a\x20member\x20of\x20role\x20','\x20built-in\x20role\x20','expectUserCount','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','nickname','validation','length','flagMissing','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','\x20not\x20found\x20in\x20the\x20user-role\x20list.','username','8334WaYgkB','roleType','876802UNtiLY','Role\x20name','715OqFLKm','join','User\x20','ADMIN','151140SgzEbq','find','Multiple\x20tenant\x20members\x20match\x20\x22'];a176_0x3910=function(){return _0x4f9423;};return a176_0x3910();}export const ROLE_REF_FLAG={'name':a176_0x28f530(0x8e),'type':a176_0x28f530(0xd8),'required':!![],'description':a176_0x28f530(0xd7)};export const USER_REF_FLAG={'name':a176_0x28f530(0xcc),'type':a176_0x28f530(0xd8),'required':!![],'description':a176_0x28f530(0xaf)};export const NAME_FLAG={'name':a176_0x28f530(0xc2),'type':'string','required':!![],'description':a176_0x28f530(0xa5)};export const USER_NAME_FLAG={'name':'name','type':a176_0x28f530(0xd8),'required':!![],'description':a176_0x28f530(0x9f)};export const REMARK_FLAG={'name':a176_0x28f530(0x8b),'type':a176_0x28f530(0xd8),'required':![],'description':a176_0x28f530(0xd6)};export const EXPECT_USER_COUNT_FLAG={'name':a176_0x28f530(0xb8),'type':'number','required':![],'description':a176_0x28f530(0x93)};export const BUILTIN_ROLE_TYPES=['ADMIN',a176_0x28f530(0xd3),'USER'];export function isBuiltinRole(_0x448c1b){const _0x2a0199=a176_0x28f530;return BUILTIN_ROLE_TYPES[_0x2a0199(0x88)](_0x448c1b);}export function assertCustomRole(_0x5c7e82,_0x44dbe3){const _0x9eada6=a176_0x28f530;if(_0x5c7e82[_0x9eada6(0xa3)]!==_0x9eada6(0xbe))throw CliErrors[_0x9eada6(0x9c)](_0x9eada6(0xd4)+_0x44dbe3+_0x9eada6(0x98)+_0x5c7e82[_0x9eada6(0xb2)]+'\x20('+_0x5c7e82['roleType']+').',_0x9eada6(0xc7));}export function assertPermConfigurable(_0x5cfa9f){const _0x3961e5=a176_0x28f530;if(_0x5cfa9f['roleType']===_0x3961e5(0xd3)||_0x5cfa9f[_0x3961e5(0xa3)]===_0x3961e5(0xa9))throw CliErrors[_0x3961e5(0x9c)](_0x3961e5(0xb6)+_0x5cfa9f[_0x3961e5(0xb2)]+'\x20('+_0x5cfa9f[_0x3961e5(0xa3)]+').',_0x3961e5(0xd9));}export function projectRole(_0x44d7ad){const _0x1b93f8=a176_0x28f530;return{'id':_0x44d7ad['id'],'roleName':_0x44d7ad['roleName'],'roleType':_0x44d7ad[_0x1b93f8(0xa3)],'remark':_0x44d7ad[_0x1b93f8(0x8b)],'userCount':_0x44d7ad[_0x1b93f8(0xb3)],'permitCount':_0x44d7ad[_0x1b93f8(0x8f)],'builtin':isBuiltinRole(_0x44d7ad[_0x1b93f8(0xa3)])};}export async function resolveRoleRef(_0x11f145,_0x2fa639){const _0x393d16=a176_0x28f530,_0x1995e9=_0x2fa639[_0x393d16(0x89)]();if(!_0x1995e9)throw CliErrors[_0x393d16(0x9c)]('Missing\x20role\x20reference.',_0x393d16(0xdb));if(/^\d+$/[_0x393d16(0x8c)](_0x1995e9))return getRoleById(_0x11f145,Number(_0x1995e9));const _0x20f6b3=await listAllAppRoles(_0x11f145),_0x2d7bbc=_0x20f6b3['filter'](_0x451a14=>_0x451a14[_0x393d16(0xb2)]===_0x1995e9);if(_0x2d7bbc[_0x393d16(0x9d)]===0x0)throw CliErrors[_0x393d16(0x9c)](_0x393d16(0x8a)+_0x1995e9+_0x393d16(0x96)+_0x11f145+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x2d7bbc['length']>0x1){const _0x53f96d=_0x2d7bbc[_0x393d16(0xd2)](_0x3e92ce=>_0x3e92ce['id'])[_0x393d16(0xa7)](',\x20');throw CliErrors[_0x393d16(0x9c)]('Role\x20name\x20\x22'+_0x1995e9+_0x393d16(0x90)+_0x53f96d+').',_0x393d16(0xc9));}return _0x2d7bbc[0x0];}export async function getRoleById(_0x335c0c,_0x2dbc4c){const _0x22992d=a176_0x28f530,_0x84f0a8=await getAppRole(_0x2dbc4c);if(!_0x84f0a8)throw CliErrors[_0x22992d(0x9c)](_0x22992d(0x95)+_0x2dbc4c+_0x22992d(0x92)+_0x335c0c+'.',_0x22992d(0xb0));return _0x84f0a8;}async function listAllAppRoles(_0x4b90c2){const _0x59f748=a176_0x28f530,_0x150820=0x64,_0x3c04fa=[];for(let _0x478b54=0x1;;_0x478b54+=0x1){const {items:_0x5b508c,paging:_0x26e43f}=await listAppRoles(_0x4b90c2,{'currentPage':_0x478b54,'pageSize':_0x150820});_0x3c04fa[_0x59f748(0xad)](..._0x5b508c);if(_0x5b508c[_0x59f748(0x9d)]<_0x150820||_0x26e43f&&_0x3c04fa[_0x59f748(0x9d)]>=_0x26e43f[_0x59f748(0xc4)])return _0x3c04fa;}}export async function resolveTenantCode(){const _0x583dde=a176_0x28f530,_0x12aaa5=await getSessionUserInfo(),_0x589fe3=_0x12aaa5?.[_0x583dde(0xcc)]?.[_0x583dde(0xc3)]?.[_0x583dde(0xae)];if(!_0x589fe3)throw CliErrors[_0x583dde(0xb1)](_0x583dde(0xd1));return _0x589fe3;}function matchMember(_0x1e3da8,_0x2200bf){const _0x216cfd=a176_0x28f530,_0x1f4f05=_0x2200bf[_0x216cfd(0x89)]()[_0x216cfd(0xd5)]();return(_0x1e3da8['nickname']??'')[_0x216cfd(0xd5)]()===_0x1f4f05||(_0x1e3da8[_0x216cfd(0xa1)]??'')[_0x216cfd(0xd5)]()===_0x1f4f05;}export async function resolveUserRef(_0x39b57c){const _0x3393bc=a176_0x28f530,_0x2159e4=_0x39b57c[_0x3393bc(0x89)]();if(!_0x2159e4)throw CliErrors[_0x3393bc(0x9c)](_0x3393bc(0xbd),'Pass\x20--user\x20<id|name>.');const _0x1ff08e=await resolveTenantCode(),_0x428d80=await getTenantMembers(_0x1ff08e);if(/^\d+$/[_0x3393bc(0x8c)](_0x2159e4)){const _0x126b26=Number(_0x2159e4),_0x179be1=_0x428d80['find'](_0x4a1f8e=>_0x4a1f8e['userId']===_0x126b26);return{'userId':_0x126b26,'username':_0x179be1?.['username']??String(_0x126b26),'nickname':_0x179be1?.[_0x3393bc(0x9b)],'matchedBy':'id'};}const _0x36fd20=_0x428d80[_0x3393bc(0xbc)](_0x366318=>matchMember(_0x366318,_0x2159e4));if(_0x36fd20[_0x3393bc(0x9d)]===0x0)throw CliErrors[_0x3393bc(0x9c)](_0x3393bc(0x86)+_0x2159e4+'\x22.',_0x3393bc(0x9a));if(_0x36fd20[_0x3393bc(0x9d)]>0x1){const _0x32d261=_0x36fd20[_0x3393bc(0xd2)](_0x33a722=>(_0x33a722[_0x3393bc(0x9b)]??_0x33a722[_0x3393bc(0xa1)]??'?')+'('+_0x33a722['userId']+')')['join'](',\x20');throw CliErrors[_0x3393bc(0x9c)](_0x3393bc(0xac)+_0x2159e4+_0x3393bc(0xce)+_0x32d261+'.',_0x3393bc(0xda));}const _0x459a75=_0x36fd20[0x0];return{'userId':_0x459a75[_0x3393bc(0xbb)],'username':_0x459a75[_0x3393bc(0xa1)]??String(_0x459a75['userId']),'nickname':_0x459a75[_0x3393bc(0x9b)],'matchedBy':'name'};}export const UPDATE_USER_LIST_PATH=a176_0x28f530(0xbf);function userIdsOf(_0x3a70e3){const _0x2c25b7=a176_0x28f530;return(_0x3a70e3?.['userList']??[])[_0x2c25b7(0xd2)](_0x4ff66c=>_0x4ff66c[_0x2c25b7(0xbb)]);}export function computeRoleUserMutation(_0x34340a){const _0x48a93c=a176_0x28f530,{operation:_0x3f1570,appCode:_0x205b21,roleUsers:_0x9e9521,targetRoleId:_0xf98ac8,user:_0x367a33}=_0x34340a,_0x2e9c3f=_0x9e9521[_0x48a93c(0xab)](_0x1d10d4=>_0x1d10d4['id']===_0xf98ac8);if(!_0x2e9c3f)throw CliErrors['validation'](_0x48a93c(0x95)+_0xf98ac8+_0x48a93c(0xa0),_0x48a93c(0xb0));const _0x4a3a9f=userIdsOf(_0x2e9c3f),_0x36050a=[];if(_0x34340a[_0x48a93c(0x99)]!==undefined&&_0x34340a[_0x48a93c(0x99)]!==_0x4a3a9f['length'])throw CliErrors[_0x48a93c(0x9c)](_0x48a93c(0xca)+_0x34340a[_0x48a93c(0x99)]+_0x48a93c(0x91)+_0x4a3a9f[_0x48a93c(0x9d)]+'.',_0x48a93c(0xc5));const _0x1314a8=_0x4a3a9f[_0x48a93c(0x88)](_0x367a33[_0x48a93c(0xbb)]);let _0x1de91a=![];const _0x214c51=[..._0x2e9c3f[_0x48a93c(0x8d)]];if(_0x3f1570===_0x48a93c(0xc8))_0x1314a8?_0x36050a[_0x48a93c(0xad)](_0x48a93c(0xa8)+_0x367a33[_0x48a93c(0xbb)]+_0x48a93c(0xb5)+_0x2e9c3f[_0x48a93c(0xb2)]+_0x48a93c(0x94)):(_0x214c51[_0x48a93c(0xad)]({'userId':_0x367a33['userId'],'username':_0x367a33[_0x48a93c(0xa1)],..._0x367a33[_0x48a93c(0x9b)]?{'nickname':_0x367a33['nickname']}:{}}),_0x1de91a=!![]);else{if(!_0x1314a8)_0x36050a[_0x48a93c(0xad)](_0x48a93c(0xa8)+_0x367a33['userId']+_0x48a93c(0x97)+_0x2e9c3f[_0x48a93c(0xb2)]+_0x48a93c(0x94));else{const _0x36fb19=_0x214c51['findIndex'](_0x5c240b=>_0x5c240b[_0x48a93c(0xbb)]===_0x367a33['userId']);if(_0x36fb19>=0x0)_0x214c51[_0x48a93c(0xd0)](_0x36fb19,0x1);_0x1de91a=!![];}}const _0x574e91=_0x9e9521[_0x48a93c(0xd2)](_0x474882=>_0x474882['id']===_0xf98ac8?{..._0x474882,'userList':_0x214c51}:_0x474882),_0x590281=_0x214c51[_0x48a93c(0xd2)](_0xcf32af=>_0xcf32af[_0x48a93c(0xbb)]),_0x540c6b={'operation':_0x3f1570,'selector':{'appCode':_0x205b21,'roleId':_0xf98ac8,'roleName':_0x2e9c3f[_0x48a93c(0xb2)],'userId':_0x367a33[_0x48a93c(0xbb)]},'before':{'userIds':_0x4a3a9f},'after':{'userIds':_0x590281},'dryRun':_0x34340a[_0x48a93c(0xc6)],'backend':{'method':_0x48a93c(0xb4),'path':UPDATE_USER_LIST_PATH},'warnings':_0x36050a};return{'roleList':_0x574e91,'mutation':_0x540c6b,'changed':_0x1de91a};}export async function loadRoleUsers(_0x409df3){return listRoleUsers(_0x409df3);}function a176_0xbb3d(_0x5da565,_0x39ef96){_0x5da565=_0x5da565-0x86;const _0x391069=a176_0x3910();let _0xbb3dc8=_0x391069[_0x5da565];return _0xbb3dc8;}export function readRoleRef(_0xa202b7){const _0x490fa2=a176_0x28f530,_0x357096=_0xa202b7[_0x490fa2(0xcf)](_0x490fa2(0x8e))[_0x490fa2(0x89)]();if(!_0x357096)throw CliErrors[_0x490fa2(0x9e)](_0x490fa2(0x8e),_0x490fa2(0xdb));return _0x357096;}export async function prepareUserMutation(_0x150124,_0x26d96b,_0x59d488){const _0x423173=a176_0x28f530,_0x30f5a4=readRoleRef(_0x150124),_0x292b9e=_0x150124[_0x423173(0xcf)]('user')[_0x423173(0x89)]();if(!_0x292b9e)throw CliErrors[_0x423173(0x9e)](_0x423173(0xcc),'Pass\x20--user\x20<id|name>.');const _0x55a13b=_0x150124['flag']('expect-user-count'),_0x4bea67=_0x55a13b===undefined||_0x55a13b===null?undefined:Number(_0x55a13b),_0x565e0d=await resolveRoleRef(_0x150124[_0x423173(0xcd)],_0x30f5a4),_0x2b944f=await resolveUserRef(_0x292b9e),_0x271aea=await loadRoleUsers(_0x150124['appCode']);return computeRoleUserMutation({'operation':_0x26d96b,'appCode':_0x150124[_0x423173(0xcd)],'roleUsers':_0x271aea,'targetRoleId':_0x565e0d['id'],'user':{'userId':_0x2b944f[_0x423173(0xbb)],'username':_0x2b944f['username'],'nickname':_0x2b944f[_0x423173(0x9b)]},'dryRun':_0x59d488,..._0x4bea67!==undefined?{'expectUserCount':_0x4bea67}:{}});}
1
+ const a168_0x46bcac=a168_0x3664;(function(_0x8fb62,_0x169fcf){const _0x148715=a168_0x3664,_0x32745b=_0x8fb62();while(!![]){try{const _0x3be6ba=-parseInt(_0x148715(0x131))/0x1*(parseInt(_0x148715(0x13c))/0x2)+-parseInt(_0x148715(0x139))/0x3+parseInt(_0x148715(0x119))/0x4*(parseInt(_0x148715(0x109))/0x5)+parseInt(_0x148715(0x12e))/0x6+-parseInt(_0x148715(0x125))/0x7+-parseInt(_0x148715(0x12d))/0x8+parseInt(_0x148715(0x102))/0x9;if(_0x3be6ba===_0x169fcf)break;else _0x32745b['push'](_0x32745b['shift']());}catch(_0x57a356){_0x32745b['push'](_0x32745b['shift']());}}}(a168_0x2ea0,0x8de57));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a168_0x46bcac(0xf3),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a168_0x46bcac(0x136),'type':a168_0x46bcac(0x12c),'required':!![],'description':a168_0x46bcac(0x11d)};export const USER_REF_FLAG={'name':a168_0x46bcac(0x10e),'type':a168_0x46bcac(0x12c),'required':!![],'description':a168_0x46bcac(0x13b)};export const NAME_FLAG={'name':'name','type':a168_0x46bcac(0x12c),'required':!![],'description':a168_0x46bcac(0x135)};export const USER_NAME_FLAG={'name':a168_0x46bcac(0x105),'type':a168_0x46bcac(0x12c),'required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a168_0x46bcac(0x12a),'type':a168_0x46bcac(0x12c),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a168_0x46bcac(0xf4),'type':'number','required':![],'description':a168_0x46bcac(0x13a)};export const BUILTIN_ROLE_TYPES=['ADMIN',a168_0x46bcac(0x124),a168_0x46bcac(0xf2)];export function isBuiltinRole(_0x476e10){const _0x598a96=a168_0x46bcac;return BUILTIN_ROLE_TYPES[_0x598a96(0x128)](_0x476e10);}export function assertCustomRole(_0x3a07c2,_0x3f1f1d){const _0x11b1e0=a168_0x46bcac;if(_0x3a07c2[_0x11b1e0(0xf5)]!==_0x11b1e0(0x11b))throw CliErrors[_0x11b1e0(0x12b)](_0x11b1e0(0xff)+_0x3f1f1d+_0x11b1e0(0xef)+_0x3a07c2[_0x11b1e0(0x104)]+'\x20('+_0x3a07c2[_0x11b1e0(0xf5)]+').',_0x11b1e0(0x115));}function a168_0x3664(_0x4b5e0a,_0x5a3c61){_0x4b5e0a=_0x4b5e0a-0xef;const _0x2ea075=a168_0x2ea0();let _0x366442=_0x2ea075[_0x4b5e0a];return _0x366442;}export function assertPermConfigurable(_0x12541f){const _0x22a4dd=a168_0x46bcac;if(_0x12541f['roleType']===_0x22a4dd(0x124)||_0x12541f[_0x22a4dd(0xf5)]===_0x22a4dd(0xfe))throw CliErrors['validation']('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x12541f['roleName']+'\x20('+_0x12541f[_0x22a4dd(0xf5)]+').',_0x22a4dd(0x10b));}export function projectRole(_0x5ca300){const _0x5df4b5=a168_0x46bcac;return{'id':_0x5ca300['id'],'roleName':_0x5ca300['roleName'],'roleType':_0x5ca300['roleType'],'remark':_0x5ca300[_0x5df4b5(0x12a)],'userCount':_0x5ca300[_0x5df4b5(0x113)],'permitCount':_0x5ca300['permitCount'],'builtin':isBuiltinRole(_0x5ca300[_0x5df4b5(0xf5)])};}export async function resolveRoleRef(_0xa09a3d,_0x42e09d){const _0x1529c2=a168_0x46bcac,_0x277c17=_0x42e09d[_0x1529c2(0x107)]();if(!_0x277c17)throw CliErrors[_0x1529c2(0x12b)]('Missing\x20role\x20reference.',_0x1529c2(0x11c));if(/^\d+$/[_0x1529c2(0x101)](_0x277c17))return getRoleById(_0xa09a3d,Number(_0x277c17));const _0x12e114=await listAllAppRoles(_0xa09a3d),_0x3e3b2d=_0x12e114['filter'](_0x115f79=>_0x115f79[_0x1529c2(0x104)]===_0x277c17);if(_0x3e3b2d[_0x1529c2(0x10c)]===0x0)throw CliErrors[_0x1529c2(0x12b)]('Role\x20name\x20\x22'+_0x277c17+_0x1529c2(0x10a)+_0xa09a3d+'.',_0x1529c2(0xf9));if(_0x3e3b2d[_0x1529c2(0x10c)]>0x1){const _0x1d53d8=_0x3e3b2d['map'](_0x14ce4c=>_0x14ce4c['id'])[_0x1529c2(0xf6)](',\x20');throw CliErrors[_0x1529c2(0x12b)](_0x1529c2(0xf8)+_0x277c17+_0x1529c2(0xfa)+_0x1d53d8+').',_0x1529c2(0xf0));}return _0x3e3b2d[0x0];}export async function getRoleById(_0x3a820f,_0x7b92f9){const _0x5300ba=a168_0x46bcac,_0x5ae609=await getAppRole(_0x7b92f9);if(!_0x5ae609)throw CliErrors[_0x5300ba(0x12b)]('Role\x20id\x20'+_0x7b92f9+_0x5300ba(0x138)+_0x3a820f+'.',_0x5300ba(0xf1));return _0x5ae609;}async function listAllAppRoles(_0xbbd1c2){const _0x27bf60=a168_0x46bcac,_0x2ebe43=0x64,_0x5bedbd=[];for(let _0x3c3315=0x1;;_0x3c3315+=0x1){const {items:_0x4a4925,paging:_0x5b7b36}=await listAppRoles(_0xbbd1c2,{'currentPage':_0x3c3315,'pageSize':_0x2ebe43});_0x5bedbd[_0x27bf60(0x108)](..._0x4a4925);if(_0x4a4925[_0x27bf60(0x10c)]<_0x2ebe43||_0x5b7b36&&_0x5bedbd[_0x27bf60(0x10c)]>=_0x5b7b36[_0x27bf60(0x112)])return _0x5bedbd;}}export async function resolveTenantCode(){const _0x3bc5f0=a168_0x46bcac,_0x4f97d3=await getSessionUserInfo(),_0x135391=_0x4f97d3?.[_0x3bc5f0(0x10e)]?.[_0x3bc5f0(0xfd)]?.['tenant_code'];if(!_0x135391)throw CliErrors['authRequired'](_0x3bc5f0(0x120));return _0x135391;}function matchMember(_0x21e501,_0x1efe1d){const _0x1929a2=a168_0x46bcac,_0x24ae06=_0x1efe1d['trim']()[_0x1929a2(0x10d)]();return(_0x21e501[_0x1929a2(0x114)]??'')['toLowerCase']()===_0x24ae06||(_0x21e501['username']??'')[_0x1929a2(0x10d)]()===_0x24ae06;}export async function resolveUserRef(_0x18a764){const _0x4dfdb0=a168_0x46bcac,_0x2d3d33=_0x18a764[_0x4dfdb0(0x107)]();if(!_0x2d3d33)throw CliErrors['validation'](_0x4dfdb0(0x11a),_0x4dfdb0(0x11f));const _0x2d7b92=await resolveTenantCode(),_0x394511=await getTenantMembers(_0x2d7b92);if(/^\d+$/['test'](_0x2d3d33)){const _0x5dc85e=Number(_0x2d3d33),_0x5a24bc=_0x394511[_0x4dfdb0(0x126)](_0x29376e=>_0x29376e[_0x4dfdb0(0x130)]===_0x5dc85e);return{'userId':_0x5dc85e,'username':_0x5a24bc?.['username']??String(_0x5dc85e),'nickname':_0x5a24bc?.[_0x4dfdb0(0x114)],'matchedBy':'id'};}const _0x21c9b9=_0x394511[_0x4dfdb0(0x134)](_0x35b6b7=>matchMember(_0x35b6b7,_0x2d3d33));if(_0x21c9b9[_0x4dfdb0(0x10c)]===0x0)throw CliErrors[_0x4dfdb0(0x12b)](_0x4dfdb0(0x127)+_0x2d3d33+'\x22.',_0x4dfdb0(0xfc));if(_0x21c9b9['length']>0x1){const _0x4b2339=_0x21c9b9[_0x4dfdb0(0x106)](_0xb2bd33=>(_0xb2bd33[_0x4dfdb0(0x114)]??_0xb2bd33[_0x4dfdb0(0x121)]??'?')+'('+_0xb2bd33[_0x4dfdb0(0x130)]+')')['join'](',\x20');throw CliErrors[_0x4dfdb0(0x12b)](_0x4dfdb0(0x122)+_0x2d3d33+_0x4dfdb0(0xfb)+_0x4b2339+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x5579cb=_0x21c9b9[0x0];return{'userId':_0x5579cb[_0x4dfdb0(0x130)],'username':_0x5579cb['username']??String(_0x5579cb['userId']),'nickname':_0x5579cb[_0x4dfdb0(0x114)],'matchedBy':_0x4dfdb0(0x105)};}function a168_0x2ea0(){const _0x1d007d=['Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','tenant','ADMIN','Cannot\x20','User\x20','test','10698417oWuLzk',';\x20no\x20change.','roleName','name','map','trim','push','505hAqpNU','\x22\x20not\x20found\x20in\x20app\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','length','toLowerCase','user','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','str','findIndex','totalCount','userCount','nickname','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','flagMissing','Role\x20id\x20','\x20is\x20not\x20a\x20member\x20of\x20role\x20','23704honbgg','Missing\x20user\x20reference.','CUSTOM','Pass\x20--role\x20<id|name>.','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Pass\x20--user\x20<id|name>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','username','Multiple\x20tenant\x20members\x20match\x20\x22','splice','DEV','355355MNfjpA','find','No\x20tenant\x20member\x20matches\x20\x22','includes','expectUserCount','remark','validation','string','998528tQeGod','3005130poMnSC','\x20not\x20found\x20in\x20the\x20user-role\x20list.','userId','1RFPaWx','dryRun','appCode','filter','Role\x20name','role','userList','\x20not\x20found\x20in\x20app\x20','2549205vXGJSe','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','1363142rQBBtV','\x20built-in\x20role\x20','Disambiguate\x20with\x20--role\x20<id>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','USER','number','expect-user-count','roleType','join','POST','Role\x20name\x20\x22','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','\x22\x20is\x20ambiguous\x20(ids:\x20','\x22:\x20'];a168_0x2ea0=function(){return _0x1d007d;};return a168_0x2ea0();}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x34f72b){const _0x2a1c44=a168_0x46bcac;return(_0x34f72b?.[_0x2a1c44(0x137)]??[])[_0x2a1c44(0x106)](_0x22cc5c=>_0x22cc5c[_0x2a1c44(0x130)]);}export function computeRoleUserMutation(_0xe7d0cc){const _0x57fb39=a168_0x46bcac,{operation:_0x14817b,appCode:_0x5af3d7,roleUsers:_0x361742,targetRoleId:_0x246b75,user:_0x5e5467}=_0xe7d0cc,_0x5f7f82=_0x361742[_0x57fb39(0x126)](_0x59d9f6=>_0x59d9f6['id']===_0x246b75);if(!_0x5f7f82)throw CliErrors[_0x57fb39(0x12b)](_0x57fb39(0x117)+_0x246b75+_0x57fb39(0x12f),_0x57fb39(0xf1));const _0x19c299=userIdsOf(_0x5f7f82),_0x3bf8ea=[];if(_0xe7d0cc[_0x57fb39(0x129)]!==undefined&&_0xe7d0cc[_0x57fb39(0x129)]!==_0x19c299[_0x57fb39(0x10c)])throw CliErrors[_0x57fb39(0x12b)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0xe7d0cc[_0x57fb39(0x129)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x19c299['length']+'.',_0x57fb39(0x10f));const _0x5c3517=_0x19c299[_0x57fb39(0x128)](_0x5e5467[_0x57fb39(0x130)]);let _0x55d9cb=![];const _0x47d65d=[..._0x5f7f82['userList']];if(_0x14817b==='user-add')_0x5c3517?_0x3bf8ea[_0x57fb39(0x108)]('User\x20'+_0x5e5467[_0x57fb39(0x130)]+_0x57fb39(0x11e)+_0x5f7f82[_0x57fb39(0x104)]+_0x57fb39(0x103)):(_0x47d65d[_0x57fb39(0x108)]({'userId':_0x5e5467[_0x57fb39(0x130)],'username':_0x5e5467[_0x57fb39(0x121)],..._0x5e5467['nickname']?{'nickname':_0x5e5467['nickname']}:{}}),_0x55d9cb=!![]);else{if(!_0x5c3517)_0x3bf8ea[_0x57fb39(0x108)](_0x57fb39(0x100)+_0x5e5467['userId']+_0x57fb39(0x118)+_0x5f7f82[_0x57fb39(0x104)]+_0x57fb39(0x103));else{const _0x3d8eb7=_0x47d65d[_0x57fb39(0x111)](_0x9e1988=>_0x9e1988[_0x57fb39(0x130)]===_0x5e5467['userId']);if(_0x3d8eb7>=0x0)_0x47d65d[_0x57fb39(0x123)](_0x3d8eb7,0x1);_0x55d9cb=!![];}}const _0x2264b2=_0x361742[_0x57fb39(0x106)](_0x4ae3d1=>_0x4ae3d1['id']===_0x246b75?{..._0x4ae3d1,'userList':_0x47d65d}:_0x4ae3d1),_0x3405a8=_0x47d65d[_0x57fb39(0x106)](_0xf2f527=>_0xf2f527['userId']),_0xa8381={'operation':_0x14817b,'selector':{'appCode':_0x5af3d7,'roleId':_0x246b75,'roleName':_0x5f7f82[_0x57fb39(0x104)],'userId':_0x5e5467['userId']},'before':{'userIds':_0x19c299},'after':{'userIds':_0x3405a8},'dryRun':_0xe7d0cc[_0x57fb39(0x132)],'backend':{'method':_0x57fb39(0xf7),'path':UPDATE_USER_LIST_PATH},'warnings':_0x3bf8ea};return{'roleList':_0x2264b2,'mutation':_0xa8381,'changed':_0x55d9cb};}export async function loadRoleUsers(_0x3d3168){return listRoleUsers(_0x3d3168);}export function readRoleRef(_0x40be03){const _0x17f119=a168_0x46bcac,_0x3238eb=_0x40be03[_0x17f119(0x110)]('role')['trim']();if(!_0x3238eb)throw CliErrors['flagMissing'](_0x17f119(0x136),_0x17f119(0x11c));return _0x3238eb;}export async function prepareUserMutation(_0x4d8dda,_0x52a468,_0x4ac1ae){const _0x468248=a168_0x46bcac,_0x1a2bf4=readRoleRef(_0x4d8dda),_0x225215=_0x4d8dda[_0x468248(0x110)]('user')[_0x468248(0x107)]();if(!_0x225215)throw CliErrors[_0x468248(0x116)](_0x468248(0x10e),_0x468248(0x11f));const _0x3fab0e=_0x4d8dda['flag'](_0x468248(0xf4)),_0x3aee2b=_0x3fab0e===undefined||_0x3fab0e===null?undefined:Number(_0x3fab0e),_0xfcc64e=await resolveRoleRef(_0x4d8dda[_0x468248(0x133)],_0x1a2bf4),_0x3b3b01=await resolveUserRef(_0x225215),_0x641cc6=await loadRoleUsers(_0x4d8dda[_0x468248(0x133)]);return computeRoleUserMutation({'operation':_0x52a468,'appCode':_0x4d8dda[_0x468248(0x133)],'roleUsers':_0x641cc6,'targetRoleId':_0xfcc64e['id'],'user':{'userId':_0x3b3b01[_0x468248(0x130)],'username':_0x3b3b01[_0x468248(0x121)],'nickname':_0x3b3b01[_0x468248(0x114)]},'dryRun':_0x4ac1ae,..._0x3aee2b!==undefined?{'expectUserCount':_0x3aee2b}:{}});}