@lovrabet/rabetbase-cli 2.3.11 → 2.3.12

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 (260) 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/add.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/db/analysis-batching.js +1 -1
  80. package/lib/commands/db/analyze-batch-plan.js +1 -1
  81. package/lib/commands/db/analyze-cancel.js +1 -1
  82. package/lib/commands/db/analyze-start.js +1 -1
  83. package/lib/commands/db/analyze-status.js +1 -1
  84. package/lib/commands/db/create.js +1 -1
  85. package/lib/commands/db/delete.js +1 -1
  86. package/lib/commands/db/detail.js +1 -1
  87. package/lib/commands/db/diff.js +1 -1
  88. package/lib/commands/db/index.js +1 -1
  89. package/lib/commands/db/list.js +1 -1
  90. package/lib/commands/db/shared.js +1 -1
  91. package/lib/commands/db/tables.js +1 -1
  92. package/lib/commands/db/test.js +1 -1
  93. package/lib/commands/db/update.js +1 -1
  94. package/lib/commands/doctor.js +1 -1
  95. package/lib/commands/file/index.js +1 -1
  96. package/lib/commands/init/index.js +1 -1
  97. package/lib/commands/issue/index.js +1 -1
  98. package/lib/commands/issue/nudge.js +1 -1
  99. package/lib/commands/issue/report.js +1 -1
  100. package/lib/commands/issue/shared.js +1 -1
  101. package/lib/commands/logs/index.js +1 -1
  102. package/lib/commands/menu/delete.js +1 -1
  103. package/lib/commands/menu/external-link-create.js +1 -1
  104. package/lib/commands/menu/group-create.js +1 -1
  105. package/lib/commands/menu/group-update.js +1 -1
  106. package/lib/commands/menu/index.js +1 -1
  107. package/lib/commands/menu/list.js +1 -1
  108. package/lib/commands/menu/move.js +1 -1
  109. package/lib/commands/menu/regroup-start.js +1 -1
  110. package/lib/commands/menu/shared/compare-table.js +1 -1
  111. package/lib/commands/menu/shared/delete-plan.js +1 -1
  112. package/lib/commands/menu/shared/facts.js +1 -1
  113. package/lib/commands/menu/shared/index.js +1 -1
  114. package/lib/commands/menu/shared/inquirer.js +1 -1
  115. package/lib/commands/menu/shared/local-pages.js +1 -1
  116. package/lib/commands/menu/shared/logic.js +1 -1
  117. package/lib/commands/menu/shared/mutations.js +1 -1
  118. package/lib/commands/menu/shared/service.js +1 -1
  119. package/lib/commands/menu/shared/sync-core.js +1 -1
  120. package/lib/commands/menu/shared/update-core.js +1 -1
  121. package/lib/commands/menu/shared/valid-url.js +1 -1
  122. package/lib/commands/menu/sync.js +1 -1
  123. package/lib/commands/menu/update.js +1 -1
  124. package/lib/commands/notification/config-list.js +1 -1
  125. package/lib/commands/notification/index.js +1 -1
  126. package/lib/commands/page/generate-start.js +1 -1
  127. package/lib/commands/page/generate-status.js +1 -1
  128. package/lib/commands/page/index.js +1 -1
  129. package/lib/commands/page/pull.js +1 -1
  130. package/lib/commands/page/push.js +1 -1
  131. package/lib/commands/page/relation-audit.js +1 -1
  132. package/lib/commands/page/shared.js +1 -1
  133. package/lib/commands/page/standard-page-status.js +1 -1
  134. package/lib/commands/page/sync.js +1 -1
  135. package/lib/commands/permit/index.js +1 -1
  136. package/lib/commands/permit/page-get.js +1 -1
  137. package/lib/commands/permit/page-set.js +1 -1
  138. package/lib/commands/permit/role-apis-set.js +1 -1
  139. package/lib/commands/permit/role-menus-set.js +1 -1
  140. package/lib/commands/permit/role-menus.js +1 -1
  141. package/lib/commands/permit/shared.js +1 -1
  142. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  143. package/lib/commands/project/create/format-elapsed.js +1 -1
  144. package/lib/commands/project/create/main.js +1 -1
  145. package/lib/commands/project/create/non-interactive.js +1 -1
  146. package/lib/commands/project/create/project-template-path.js +1 -1
  147. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  148. package/lib/commands/project/create/use-format-code.js +1 -1
  149. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  150. package/lib/commands/project/index.js +1 -1
  151. package/lib/commands/project/init.js +1 -1
  152. package/lib/commands/project/upgrade.js +1 -1
  153. package/lib/commands/registry.js +1 -1
  154. package/lib/commands/role/create.js +1 -1
  155. package/lib/commands/role/delete.js +1 -1
  156. package/lib/commands/role/detail.js +1 -1
  157. package/lib/commands/role/index.js +1 -1
  158. package/lib/commands/role/list.js +1 -1
  159. package/lib/commands/role/shared.js +1 -1
  160. package/lib/commands/role/update.js +1 -1
  161. package/lib/commands/role/user-add.js +1 -1
  162. package/lib/commands/role/user-remove.js +1 -1
  163. package/lib/commands/role/user-resolve.js +1 -1
  164. package/lib/commands/run/index.js +1 -1
  165. package/lib/commands/schema.js +1 -1
  166. package/lib/commands/sql/create.js +1 -1
  167. package/lib/commands/sql/delete.js +1 -1
  168. package/lib/commands/sql/detail.js +1 -1
  169. package/lib/commands/sql/exec.js +1 -1
  170. package/lib/commands/sql/index.js +1 -1
  171. package/lib/commands/sql/list.js +1 -1
  172. package/lib/commands/sql/pull.js +1 -1
  173. package/lib/commands/sql/push.js +1 -1
  174. package/lib/commands/sql/save.js +1 -1
  175. package/lib/commands/sql/shared.js +1 -1
  176. package/lib/commands/sql/status.js +1 -1
  177. package/lib/commands/sql/validate.js +1 -1
  178. package/lib/commands/task/index.js +1 -1
  179. package/lib/commands/task/status.js +1 -1
  180. package/lib/commands/workspace/add.js +1 -1
  181. package/lib/commands/workspace/index.js +1 -1
  182. package/lib/commands/workspace/remove.js +1 -1
  183. package/lib/config/schema.js +1 -1
  184. package/lib/constant/cdn.js +1 -1
  185. package/lib/constant/cli.js +1 -1
  186. package/lib/constant/defaults.js +1 -1
  187. package/lib/constant/domain.js +1 -1
  188. package/lib/constant/env.js +1 -1
  189. package/lib/constant/output.js +1 -1
  190. package/lib/constant/paths.js +1 -1
  191. package/lib/constant/risk.js +1 -1
  192. package/lib/context/app-resolver.js +1 -1
  193. package/lib/context/auth-resolver.js +1 -1
  194. package/lib/context/config-loader.js +1 -1
  195. package/lib/context.js +1 -1
  196. package/lib/core/alias-resolver.js +1 -1
  197. package/lib/core/api-client.js +1 -1
  198. package/lib/core/bff/config.js +1 -1
  199. package/lib/core/bff/file-system.js +1 -1
  200. package/lib/core/bff/hash.js +1 -1
  201. package/lib/core/bff/lock.js +1 -1
  202. package/lib/core/bff/utils.js +1 -1
  203. package/lib/core/db-resolver.js +1 -1
  204. package/lib/core/page/file-system.js +1 -1
  205. package/lib/core/page/hash.js +1 -1
  206. package/lib/core/page/lock.js +1 -1
  207. package/lib/core/sql-index-auditor.js +1 -1
  208. package/lib/core/sql-sync/config.js +1 -1
  209. package/lib/core/sql-sync/file-system.js +1 -1
  210. package/lib/core/sql-sync/hash.js +1 -1
  211. package/lib/core/sql-sync/lock.js +1 -1
  212. package/lib/core/sql-sync/utils.js +1 -1
  213. package/lib/core/sql-validator.js +1 -1
  214. package/lib/errors.js +1 -1
  215. package/lib/framework/build-all-flags.js +1 -1
  216. package/lib/framework/error-output.js +1 -1
  217. package/lib/framework/explicit-yes.js +1 -1
  218. package/lib/framework/flags.js +1 -1
  219. package/lib/framework/help.js +1 -1
  220. package/lib/framework/index.js +1 -1
  221. package/lib/framework/output.js +1 -1
  222. package/lib/framework/response.js +1 -1
  223. package/lib/framework/runner-alias.js +1 -1
  224. package/lib/framework/runner.js +1 -1
  225. package/lib/framework/schema-export.js +1 -1
  226. package/lib/framework/types.js +1 -1
  227. package/lib/generated/build-info.js +1 -1
  228. package/lib/help.js +1 -1
  229. package/lib/skills/main.js +1 -1
  230. package/lib/skills/npx-skills-add.js +1 -1
  231. package/lib/telemetry/cli-command-trace.js +1 -1
  232. package/lib/telemetry/cli-help-trace.js +1 -1
  233. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  234. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  235. package/lib/telemetry/send-cli-trace-log.js +1 -1
  236. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  237. package/lib/utils/ai_config.js +1 -1
  238. package/lib/utils/apply-jq-filter.js +1 -1
  239. package/lib/utils/cdn-config.js +1 -1
  240. package/lib/utils/check-sdk-version.js +1 -1
  241. package/lib/utils/cli-version-check.js +1 -1
  242. package/lib/utils/cli-version-policy.js +1 -1
  243. package/lib/utils/config.js +1 -1
  244. package/lib/utils/copy-directory.js +1 -1
  245. package/lib/utils/entity-with-id.js +1 -1
  246. package/lib/utils/file-utils.js +1 -1
  247. package/lib/utils/guides-cdn.js +1 -1
  248. package/lib/utils/http-client.js +1 -1
  249. package/lib/utils/is-non-interactive.js +1 -1
  250. package/lib/utils/logger.js +1 -1
  251. package/lib/utils/params.js +1 -1
  252. package/lib/utils/platform.js +1 -1
  253. package/lib/utils/rules-cdn.js +1 -1
  254. package/lib/utils/sleep.js +1 -1
  255. package/lib/utils/template-replacer.js +1 -1
  256. package/lib/utils/update-notice.js +1 -1
  257. package/lib/utils/version.js +1 -1
  258. package/lib/utils/with-active-cookie.js +1 -1
  259. package/lib/utils/write-cli-side-channel.js +1 -1
  260. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x437a9d,_0x11d062){const _0x38396f=a151_0x15b4,_0xf5005=_0x437a9d();while(!![]){try{const _0x14f842=parseInt(_0x38396f(0x15a))/0x1*(parseInt(_0x38396f(0x136))/0x2)+-parseInt(_0x38396f(0x13f))/0x3*(parseInt(_0x38396f(0x14c))/0x4)+parseInt(_0x38396f(0x133))/0x5*(-parseInt(_0x38396f(0x137))/0x6)+-parseInt(_0x38396f(0x13e))/0x7+-parseInt(_0x38396f(0x144))/0x8+parseInt(_0x38396f(0x146))/0x9*(parseInt(_0x38396f(0x13a))/0xa)+parseInt(_0x38396f(0x130))/0xb*(parseInt(_0x38396f(0x156))/0xc);if(_0x14f842===_0x11d062)break;else _0xf5005['push'](_0xf5005['shift']());}catch(_0x2fea6c){_0xf5005['push'](_0xf5005['shift']());}}}(a151_0x154c,0xb7940));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a151_0x4d493e from'chalk';import{input,confirm}from'@inquirer/prompts';function a151_0x15b4(_0x328c24,_0x24a7c6){_0x328c24=_0x328c24-0x12a;const _0x154ce7=a151_0x154c();let _0x15b403=_0x154ce7[_0x328c24];return _0x15b403;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x146d76){const _0x521aa9=a151_0x15b4,{appcode:_0x4f4c14,env:_0x35dd08,autoYes:_0x16493c}=_0x146d76,_0x48677c=process[_0x521aa9(0x138)]();if(getProjectConfigPath())throw new Error(_0x521aa9(0x152));let _0x3b3629;for(const _0x173cae of LEGACY_CONFIG_NAMES){const _0x173789=resolve(_0x48677c,_0x173cae);if(existsSync(_0x173789)){_0x3b3629=_0x173789;break;}}if(_0x3b3629){let _0x2cdb70={};try{_0x2cdb70=JSON[_0x521aa9(0x13c)](readFileSync(_0x3b3629,_0x521aa9(0x14d)));}catch{}const _0x544d34=basename(_0x3b3629),_0x56b93a=_0x2cdb70?.['appcode']||_0x2cdb70?.[_0x521aa9(0x12a)];let _0xff5c2a=_0x16493c;!_0x16493c&&(console[_0x521aa9(0x155)](a151_0x4d493e['yellow']('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a151_0x4d493e[_0x521aa9(0x12d)](_0x544d34))),_0x56b93a&&console[_0x521aa9(0x155)](a151_0x4d493e[_0x521aa9(0x148)]('\x20\x20appcode:\x20'+_0x56b93a)),_0xff5c2a=await confirm({'message':_0x521aa9(0x12f)+a151_0x4d493e[_0x521aa9(0x12d)](_0x521aa9(0x149))+_0x521aa9(0x135),'default':!![]}));if(!_0xff5c2a){console[_0x521aa9(0x155)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x521aa9(0x158));return;}const _0xecfc73=resolve(_0x48677c,NEW_CONFIG_NAME),_0x409195=getCliVersionFromPkg(),_0x4a97da=readRawConfig(),_0x18182f=_0x4f4c14||(typeof _0x2cdb70?.['appcode']===_0x521aa9(0x145)?_0x2cdb70[_0x521aa9(0x13d)]:undefined)||(typeof _0x2cdb70?.[_0x521aa9(0x12a)]===_0x521aa9(0x145)?_0x2cdb70[_0x521aa9(0x12a)]:undefined)||await askAppcode(),_0x26c0db=typeof _0x2cdb70?.[_0x521aa9(0x159)]===_0x521aa9(0x145)?_0x2cdb70[_0x521aa9(0x159)]:typeof _0x4a97da[_0x521aa9(0x159)]===_0x521aa9(0x145)?_0x4a97da['env']:_0x521aa9(0x132),_0xeed90e=buildCanonicalProjectConfig({..._0x4a97da,..._0x2cdb70},{'appCodes':[_0x18182f],'env':_0x26c0db,'metadata':{'version':_0x409195,'migratedAt':new Date()[_0x521aa9(0x153)](),'migratedFrom':_0x3b3629}});writeConfigFile(_0xecfc73,_0xeed90e);const _0x430d38=_0x3b3629+_0x521aa9(0x150);renameSync(_0x3b3629,_0x430d38),logger[_0x521aa9(0x13b)](_0x48677c),logger[_0x521aa9(0x15b)]('init','从旧配置文件升级成功',{'from':_0x3b3629,'to':_0xecfc73,'appcode':_0x18182f,'env':_0xeed90e['env']}),console['log'](a151_0x4d493e[_0x521aa9(0x14e)](_0x521aa9(0x143)+_0x544d34+_0x521aa9(0x139))),console[_0x521aa9(0x155)](a151_0x4d493e['cyan'](_0x521aa9(0x12b)+Object['keys'](_0xeed90e[_0x521aa9(0x14f)]||{})[_0x521aa9(0x154)](',\x20'))),console[_0x521aa9(0x155)](a151_0x4d493e[_0x521aa9(0x148)](_0x521aa9(0x14b)+_0xeed90e[_0x521aa9(0x134)])),console[_0x521aa9(0x155)](a151_0x4d493e['gray'](_0x521aa9(0x12c)+_0x544d34+'.bak'));return;}const _0x26810d=_0x4f4c14||await askAppcode(),_0x18108f=resolve(_0x48677c,NEW_CONFIG_NAME),_0x16aefb=getCliVersionFromPkg(),_0x17e303=readRawConfig(),_0x45c7d1=typeof _0x17e303[_0x521aa9(0x159)]===_0x521aa9(0x145)?_0x17e303[_0x521aa9(0x159)]:undefined,_0x28993d=buildCanonicalProjectConfig({},{'appCodes':[_0x26810d],'env':_0x35dd08||_0x45c7d1||_0x521aa9(0x132),'metadata':{'version':_0x16aefb,'createdAt':new Date()[_0x521aa9(0x153)]()}});writeConfigFile(_0x18108f,_0x28993d),logger[_0x521aa9(0x13b)](_0x48677c),logger['info'](_0x521aa9(0x140),'初始化项目配置文件成功',{'appcode':_0x26810d,'env':_0x28993d[_0x521aa9(0x159)],'version':_0x28993d[_0x521aa9(0x147)],'configPath':_0x18108f}),console[_0x521aa9(0x155)](a151_0x4d493e[_0x521aa9(0x14e)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console[_0x521aa9(0x155)](a151_0x4d493e[_0x521aa9(0x148)](_0x521aa9(0x12b)+Object[_0x521aa9(0x131)](_0x28993d[_0x521aa9(0x14f)]||{})[_0x521aa9(0x154)](',\x20'))),console[_0x521aa9(0x155)](a151_0x4d493e[_0x521aa9(0x148)](_0x521aa9(0x14b)+_0x28993d[_0x521aa9(0x134)])),console[_0x521aa9(0x155)](_0x521aa9(0x12e)+CLI_BIN_NAME+'\x20api\x20generate\x27\x20and\x20\x27'+CLI_BIN_NAME+_0x521aa9(0x142));}function askAppcode(){const _0x28f4eb=a151_0x15b4;return input({'message':_0x28f4eb(0x14a),'validate':_0x55f69a=>{const _0x2f990c=_0x28f4eb;if(!_0x55f69a[_0x2f990c(0x151)]())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x201ff9,message:_0x28d186}=validateAppcode(_0x55f69a['trim']());return _0x201ff9||_0x28d186||'Invalid\x20App\x20Code';}});}function a151_0x154c(){const _0x146734=['info','app','\x20\x20Apps:\x20','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','bold','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','Upgrade\x20it\x20to\x20','21859651dPYYSK','keys','production','2243510jBsgbW','defaultApp','?\x20(Old\x20file\x20→\x20*.bak)','1629328sgdqmw','12nyiYuZ','cwd','\x20→\x20.rabetbase.json','2095430UKdIUc','setLogPath','parse','appcode','8522283dNczCv','3qhvWtw','init','package.json','\x20api\x20pull\x27','✓\x20Upgraded\x20','5456888iHaXTB','string','9HdgFzn','version','cyan','.rabetbase.json','Please\x20enter\x20App\x20Code:','\x20\x20Default:\x20','5799076WTmlOM','utf8','green','apps','.bak','trim','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','toLocaleString','join','log','24aGjEco','1.0.0','\x20workspace\x20init`\x20to\x20start\x20fresh.','env','1CaGGFV'];a151_0x154c=function(){return _0x146734;};return a151_0x154c();}function getCliVersionFromPkg(){const _0x2d25b8=a151_0x15b4;try{const _0xdbaab=fileURLToPath(import.meta.url),_0x496f8a=resolve(dirname(_0xdbaab),'../..'),_0x1e92a7=JSON['parse'](readFileSync(resolve(_0x496f8a,_0x2d25b8(0x141)),_0x2d25b8(0x14d)));return _0x1e92a7[_0x2d25b8(0x147)]||_0x2d25b8(0x157);}catch{return _0x2d25b8(0x157);}}
1
+ (function(_0x512773,_0x2550e2){const _0x464f05=a151_0x2129,_0x2aaf8a=_0x512773();while(!![]){try{const _0x1d3975=-parseInt(_0x464f05(0xce))/0x1+-parseInt(_0x464f05(0xd5))/0x2+-parseInt(_0x464f05(0xcf))/0x3+parseInt(_0x464f05(0x100))/0x4+-parseInt(_0x464f05(0xeb))/0x5*(-parseInt(_0x464f05(0xee))/0x6)+-parseInt(_0x464f05(0xe2))/0x7+parseInt(_0x464f05(0xdc))/0x8*(parseInt(_0x464f05(0xf1))/0x9);if(_0x1d3975===_0x2550e2)break;else _0x2aaf8a['push'](_0x2aaf8a['shift']());}catch(_0x5b6277){_0x2aaf8a['push'](_0x2aaf8a['shift']());}}}(a151_0x3a7c,0xe10dd));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a151_0x3c8dea from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';function a151_0x2129(_0x1740fa,_0x58b2e9){_0x1740fa=_0x1740fa-0xcc;const _0x3a7c94=a151_0x3a7c();let _0x212929=_0x3a7c94[_0x1740fa];return _0x212929;}import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x8ff281){const _0x13a8f6=a151_0x2129,{appcode:_0x229fba,env:_0x395b86,autoYes:_0x14e1ed}=_0x8ff281,_0x58edb9=process[_0x13a8f6(0xda)]();if(getProjectConfigPath())throw new Error(_0x13a8f6(0xf5));let _0x1f71ed;for(const _0x4be56a of LEGACY_CONFIG_NAMES){const _0x5c4ba2=resolve(_0x58edb9,_0x4be56a);if(existsSync(_0x5c4ba2)){_0x1f71ed=_0x5c4ba2;break;}}if(_0x1f71ed){let _0x158fa7={};try{_0x158fa7=JSON[_0x13a8f6(0xd4)](readFileSync(_0x1f71ed,'utf8'));}catch{}const _0xce0fef=basename(_0x1f71ed),_0x1a7cd3=_0x158fa7?.[_0x13a8f6(0xf4)]||_0x158fa7?.[_0x13a8f6(0xff)];let _0x555484=_0x14e1ed;!_0x14e1ed&&(console['log'](a151_0x3c8dea[_0x13a8f6(0xe0)](_0x13a8f6(0xd8)+a151_0x3c8dea[_0x13a8f6(0xd2)](_0xce0fef))),_0x1a7cd3&&console[_0x13a8f6(0xea)](a151_0x3c8dea[_0x13a8f6(0xfe)](_0x13a8f6(0xf9)+_0x1a7cd3)),_0x555484=await confirm({'message':_0x13a8f6(0xf0)+a151_0x3c8dea['bold'](_0x13a8f6(0xec))+'?\x20(Old\x20file\x20→\x20*.bak)','default':!![]}));if(!_0x555484){console[_0x13a8f6(0xea)](_0x13a8f6(0xfd)+CLI_BIN_NAME+'\x20workspace\x20init`\x20to\x20start\x20fresh.');return;}const _0x28ea5b=resolve(_0x58edb9,NEW_CONFIG_NAME),_0x80eb4=getCliVersionFromPkg(),_0x1b745a=readRawConfig(),_0x4c7d7b=_0x229fba||(typeof _0x158fa7?.['appcode']===_0x13a8f6(0xe8)?_0x158fa7[_0x13a8f6(0xf4)]:undefined)||(typeof _0x158fa7?.['app']==='string'?_0x158fa7['app']:undefined)||await askAppcode(),_0x1243c5=typeof _0x158fa7?.['env']===_0x13a8f6(0xe8)?_0x158fa7[_0x13a8f6(0xf2)]:typeof _0x1b745a['env']===_0x13a8f6(0xe8)?_0x1b745a[_0x13a8f6(0xf2)]:_0x13a8f6(0xfc),_0x3a057f=buildCanonicalProjectConfig({..._0x1b745a,..._0x158fa7},{'appCodes':[_0x4c7d7b],'env':_0x1243c5,'metadata':{'version':_0x80eb4,'migratedAt':new Date()[_0x13a8f6(0xfb)](),'migratedFrom':_0x1f71ed}});writeConfigFile(_0x28ea5b,_0x3a057f);const _0x3875db=_0x1f71ed+_0x13a8f6(0xdb);renameSync(_0x1f71ed,_0x3875db),logger['setLogPath'](_0x58edb9),logger['info'](_0x13a8f6(0xe6),_0x13a8f6(0xd9),{'from':_0x1f71ed,'to':_0x28ea5b,'appcode':_0x4c7d7b,'env':_0x3a057f['env']}),console[_0x13a8f6(0xea)](a151_0x3c8dea[_0x13a8f6(0xcc)](_0x13a8f6(0xf8)+_0xce0fef+_0x13a8f6(0xe1))),console[_0x13a8f6(0xea)](a151_0x3c8dea[_0x13a8f6(0xfe)](_0x13a8f6(0xe7)+Object[_0x13a8f6(0xcd)](_0x3a057f[_0x13a8f6(0xe3)]||{})[_0x13a8f6(0xe5)](',\x20'))),console[_0x13a8f6(0xea)](a151_0x3c8dea['cyan']('\x20\x20Default:\x20'+_0x3a057f['defaultApp'])),console[_0x13a8f6(0xea)](a151_0x3c8dea[_0x13a8f6(0xdf)](_0x13a8f6(0xd0)+_0xce0fef+_0x13a8f6(0xdb)));return;}const _0x2cb899=_0x229fba||await askAppcode(),_0x112f03=resolve(_0x58edb9,NEW_CONFIG_NAME),_0x587c04=getCliVersionFromPkg(),_0x536aff=readRawConfig(),_0x579f72=typeof _0x536aff[_0x13a8f6(0xf2)]===_0x13a8f6(0xe8)?_0x536aff[_0x13a8f6(0xf2)]:undefined,_0x1ce0b9=buildCanonicalProjectConfig({},{'appCodes':[_0x2cb899],'env':_0x395b86||_0x579f72||_0x13a8f6(0xfc),'metadata':{'version':_0x587c04,'createdAt':new Date()['toLocaleString']()}});writeConfigFile(_0x112f03,_0x1ce0b9),logger[_0x13a8f6(0xd1)](_0x58edb9),logger['info'](_0x13a8f6(0xe6),_0x13a8f6(0xd3),{'appcode':_0x2cb899,'env':_0x1ce0b9[_0x13a8f6(0xf2)],'version':_0x1ce0b9[_0x13a8f6(0xde)],'configPath':_0x112f03}),console[_0x13a8f6(0xea)](a151_0x3c8dea[_0x13a8f6(0xcc)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console[_0x13a8f6(0xea)](a151_0x3c8dea['cyan'](_0x13a8f6(0xe7)+Object[_0x13a8f6(0xcd)](_0x1ce0b9[_0x13a8f6(0xe3)]||{})['join'](',\x20'))),console['log'](a151_0x3c8dea[_0x13a8f6(0xfe)]('\x20\x20Default:\x20'+_0x1ce0b9[_0x13a8f6(0xf7)])),console[_0x13a8f6(0xea)](_0x13a8f6(0xe9)+CLI_BIN_NAME+_0x13a8f6(0xd7)+CLI_BIN_NAME+_0x13a8f6(0xed));}function askAppcode(){const _0x20cb24=a151_0x2129;return input({'message':_0x20cb24(0xdd),'validate':_0x3f927e=>{const _0x4a4983=_0x20cb24;if(!_0x3f927e[_0x4a4983(0xf3)]())return _0x4a4983(0xe4);const {valid:_0x3c1a9b,message:_0x5557ea}=validateAppcode(_0x3f927e[_0x4a4983(0xf3)]());return _0x3c1a9b||_0x5557ea||'Invalid\x20App\x20Code';}});}function a151_0x3a7c(){const _0x3a4d41=['../..','toLocaleString','production','Migration\x20cancelled.\x20Run\x20`','cyan','app','5251860XmdgHw','green','keys','710068CkzMMl','1305402dIUKrf','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','setLogPath','bold','初始化项目配置文件成功','parse','2071200mnJcCb','package.json','\x20api\x20generate\x27\x20and\x20\x27','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','从旧配置文件升级成功','cwd','.bak','8PuXceN','Please\x20enter\x20App\x20Code:','version','gray','yellow','\x20→\x20.rabetbase.json','8325373IKPtVs','apps','App\x20Code\x20cannot\x20be\x20empty','join','init','\x20\x20Apps:\x20','string','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','log','5JJMtWR','.rabetbase.json','\x20api\x20pull\x27','4058916MRUDth','1.0.0','Upgrade\x20it\x20to\x20','20722599QkxSxa','env','trim','appcode','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','utf8','defaultApp','✓\x20Upgraded\x20','\x20\x20appcode:\x20'];a151_0x3a7c=function(){return _0x3a4d41;};return a151_0x3a7c();}function getCliVersionFromPkg(){const _0x696757=a151_0x2129;try{const _0x3141e7=fileURLToPath(import.meta.url),_0x14ce9b=resolve(dirname(_0x3141e7),_0x696757(0xfa)),_0x1c36ca=JSON[_0x696757(0xd4)](readFileSync(resolve(_0x14ce9b,_0x696757(0xd6)),_0x696757(0xf6)));return _0x1c36ca['version']||_0x696757(0xef);}catch{return _0x696757(0xef);}}
@@ -1 +1 @@
1
- const a152_0x1dde9b=a152_0xf737;(function(_0x4fb01f,_0x902457){const _0x280c96=a152_0xf737,_0x56d35c=_0x4fb01f();while(!![]){try{const _0xeed59e=-parseInt(_0x280c96(0x20a))/0x1*(parseInt(_0x280c96(0x1c8))/0x2)+-parseInt(_0x280c96(0x1f3))/0x3*(-parseInt(_0x280c96(0x1fd))/0x4)+-parseInt(_0x280c96(0x216))/0x5+-parseInt(_0x280c96(0x1e7))/0x6*(parseInt(_0x280c96(0x220))/0x7)+parseInt(_0x280c96(0x213))/0x8+-parseInt(_0x280c96(0x20b))/0x9+parseInt(_0x280c96(0x20c))/0xa*(parseInt(_0x280c96(0x1fc))/0xb);if(_0xeed59e===_0x902457)break;else _0x56d35c['push'](_0x56d35c['shift']());}catch(_0x204681){_0x56d35c['push'](_0x56d35c['shift']());}}}(a152_0x1050,0x3cdc9));import a152_0x4508f0 from'chalk';import a152_0xa7d67f 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[a152_0x1dde9b(0x1b7)](_0x198e21=>_0x198e21!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x23e052){const _0xb4e982=a152_0x1dde9b,_0x56cabc=[];for(const _0x4bb9c3 of Object[_0xb4e982(0x1fa)](CORE_IDE_CONFIGS)){if(_0x4bb9c3[_0xb4e982(0x22a)])for(const _0x1094c1 of _0x4bb9c3['files']){_0x56cabc[_0xb4e982(0x1ff)](resolve(_0x23e052,_0x1094c1[_0xb4e982(0x1cf)]));}}return _0x56cabc;}function analyse(_0x4e7ab1){const _0x3b7fd4=a152_0x1dde9b;let _0x135ce7=null;const _0x8eded0=resolve(_0x4e7ab1,NEW_CONFIG_NAME),_0x5996d2=existsSync(_0x8eded0);for(const _0x836a41 of LEGACY_CONFIG_NAMES){const _0x37765c=resolve(_0x4e7ab1,_0x836a41);if(existsSync(_0x37765c)){const _0x4f354e=readConfigFile(_0x37765c),_0x4e866e=Object[_0x3b7fd4(0x219)](_0x4f354e)['filter'](_0x523d31=>typeof _0x4f354e[_0x523d31]!==_0x3b7fd4(0x1bc));_0x135ce7={'oldPath':_0x37765c,'hasNewConfig':_0x5996d2,'fields':_0x4e866e};break;}}const _0x143b31=[],_0x13b884=resolve(_0x4e7ab1,'.lovrabet');if(existsSync(_0x13b884))_0x143b31['push'](_0x13b884);const _0x317ada=resolve(_0x4e7ab1,_0x3b7fd4(0x1ea));if(existsSync(_0x317ada))_0x143b31[_0x3b7fd4(0x1ff)](_0x317ada);const _0x41e95c=resolve(_0x4e7ab1,'.claude/skills/lovrabet');if(existsSync(_0x41e95c))_0x143b31[_0x3b7fd4(0x1ff)](_0x41e95c);for(const _0x34df76 of collectIdeSkillFiles(_0x4e7ab1)){if(existsSync(_0x34df76))_0x143b31[_0x3b7fd4(0x1ff)](_0x34df76);}let _0xd8843c=null;const _0x4c503d=resolve(_0x4e7ab1,_0x3b7fd4(0x21d));if(existsSync(_0x4c503d))try{const _0x30b021=JSON[_0x3b7fd4(0x211)](readFileSync(_0x4c503d,_0x3b7fd4(0x1c1)));if(_0x30b021?.[_0x3b7fd4(0x1e6)]&&typeof _0x30b021[_0x3b7fd4(0x1e6)]===_0x3b7fd4(0x1f8)){const _0x4a9173=[];for(const [_0xb34950,_0x379951]of Object[_0x3b7fd4(0x22d)](_0x30b021[_0x3b7fd4(0x1e6)])){const _0x206290=_0x379951;_0x206290?.[_0x3b7fd4(0x214)]&&Array[_0x3b7fd4(0x1c9)](_0x206290[_0x3b7fd4(0x214)])&&_0x206290[_0x3b7fd4(0x214)][_0x3b7fd4(0x20f)](_0x27bbaa=>typeof _0x27bbaa===_0x3b7fd4(0x1c6)&&_0x27bbaa[_0x3b7fd4(0x228)](_0x3b7fd4(0x1c2)))&&_0x4a9173[_0x3b7fd4(0x1ff)](_0xb34950);}_0x4a9173[_0x3b7fd4(0x201)]>0x0&&(_0xd8843c={'path':_0x4c503d,'keys':_0x4a9173});}}catch{}const _0x4f153c=_0x143b31[_0x3b7fd4(0x201)]>0x0||_0x135ce7!==null;let _0x5025a0=null;const _0x190853=resolve(_0x4e7ab1,'package.json');if(existsSync(_0x190853))try{const _0x23304d=JSON[_0x3b7fd4(0x211)](readFileSync(_0x190853,_0x3b7fd4(0x1c1)));for(const _0x59f841 of[_0x3b7fd4(0x1b4),_0x3b7fd4(0x1c0)]){const _0x1423d0=_0x23304d?.[_0x59f841]?.[_0x3b7fd4(0x200)];if(typeof _0x1423d0===_0x3b7fd4(0x1c6)){_0x1423d0!==_0x3b7fd4(0x229)&&(_0x5025a0={'pkgPath':_0x190853,'currentVersion':_0x1423d0,'field':_0x59f841});break;}}}catch{}return{'configMigration':_0x135ce7,'oldArtifacts':_0x143b31,'oldMcpConfig':_0xd8843c,'needsSkillSwap':_0x4f153c,'sdkUpgrade':_0x5025a0};}function printReport(_0x31b78d){const _0x451f44=a152_0x1dde9b,{configMigration:_0x3539dd,oldArtifacts:_0x4f9015,oldMcpConfig:_0x58b2b1,needsSkillSwap:_0x34285c}=_0x31b78d;console[_0x451f44(0x1e2)](''),console['log'](a152_0x4508f0[_0x451f44(0x1d6)]('===\x20Upgrade\x20Analysis\x20===')),console['log']('');_0x3539dd?(console[_0x451f44(0x1e2)](a152_0x4508f0['cyan'](_0x451f44(0x1c5))+('\x20\x20'+a152_0x4508f0['yellow'](_0x3539dd[_0x451f44(0x1f9)]))),console['log'](_0x451f44(0x1f7)+(_0x3539dd[_0x451f44(0x206)]?a152_0x4508f0[_0x451f44(0x202)]('already\x20exists\x20(will\x20merge)'):a152_0x4508f0[_0x451f44(0x1d3)](_0x451f44(0x212)))),console[_0x451f44(0x1e2)](_0x451f44(0x1e5)+_0x3539dd['fields'][_0x451f44(0x1c4)](',\x20')),console[_0x451f44(0x1e2)](_0x451f44(0x21b))):console[_0x451f44(0x1e2)](a152_0x4508f0[_0x451f44(0x1ee)](_0x451f44(0x1c5))+'\x20\x20'+a152_0x4508f0[_0x451f44(0x1d3)](_0x451f44(0x1b1)));console[_0x451f44(0x1e2)]('');if(_0x4f9015['length']>0x0){console[_0x451f44(0x1e2)](a152_0x4508f0[_0x451f44(0x1ee)](_0x451f44(0x1bd)));for(const _0x3509e4 of _0x4f9015){console['log']('\x20\x20'+a152_0x4508f0['red'](_0x451f44(0x204))+'\x20\x20'+_0x3509e4);}console[_0x451f44(0x1e2)]('\x20\x20Action:\x20delete');}else console[_0x451f44(0x1e2)](a152_0x4508f0[_0x451f44(0x1ee)](_0x451f44(0x1bd))+'\x20\x20'+a152_0x4508f0[_0x451f44(0x1d3)](_0x451f44(0x1db)));console[_0x451f44(0x1e2)]('');_0x58b2b1?(console[_0x451f44(0x1e2)](a152_0x4508f0[_0x451f44(0x1ee)](_0x451f44(0x1ec))+('\x20\x20'+a152_0x4508f0[_0x451f44(0x1e4)](_0x58b2b1[_0x451f44(0x1cf)])+_0x451f44(0x1ed)+_0x58b2b1[_0x451f44(0x219)]['join'](',\x20'))),console[_0x451f44(0x1e2)](_0x451f44(0x1ba))):console[_0x451f44(0x1e2)](a152_0x4508f0[_0x451f44(0x1ee)]('MCP\x20config:')+'\x20\x20'+a152_0x4508f0['gray'](_0x451f44(0x1fe)));console['log'](''),console[_0x451f44(0x1e2)](a152_0x4508f0[_0x451f44(0x1ee)]('Skill\x20swap:')+('\x20\x20'+(_0x34285c?a152_0x4508f0[_0x451f44(0x1e4)](_0x451f44(0x1d1)):a152_0x4508f0[_0x451f44(0x202)](_0x451f44(0x20e)))));_0x34285c&&console[_0x451f44(0x1e2)](_0x451f44(0x1d0)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x451f44(0x1e2)]('');if(_0x31b78d[_0x451f44(0x1da)]){const {currentVersion:_0x3cbdce,field:_0x7cfb1e,pkgPath:_0x4d8e8c}=_0x31b78d[_0x451f44(0x1da)];console['log'](a152_0x4508f0[_0x451f44(0x1ee)]('@lovrabet/sdk:')+('\x20\x20'+a152_0x4508f0['yellow'](_0x4d8e8c))),console['log'](_0x451f44(0x22e)+_0x7cfb1e+':\x20'+a152_0x4508f0[_0x451f44(0x1e4)](_0x3cbdce)+_0x451f44(0x1dc)+a152_0x4508f0[_0x451f44(0x202)](_0x451f44(0x229))),console[_0x451f44(0x1e2)](_0x451f44(0x22c));}else console[_0x451f44(0x1e2)](a152_0x4508f0[_0x451f44(0x1ee)](_0x451f44(0x1cd))+'\x20\x20'+a152_0x4508f0[_0x451f44(0x1d3)]('not\x20found\x20or\x20already\x20at\x20latest'));console['log']('');}function execConfigMigration(_0x228de5,_0x1c3f46){const _0x369960=a152_0x1dde9b,{configMigration:_0x1f441b}=_0x228de5;if(!_0x1f441b?.['oldPath'])return{'step':0x1,'label':_0x369960(0x217),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x24d565=readConfigFile(_0x1f441b[_0x369960(0x1f9)]),_0xe89e4f=resolve(_0x1c3f46,NEW_CONFIG_NAME),_0x48494d=_0x1f441b[_0x369960(0x206)]?readConfigFile(_0xe89e4f):{};for(const [_0x42a97d,_0x2f21e9]of Object[_0x369960(0x22d)](_0x24d565)){!(_0x42a97d in _0x48494d)&&(_0x48494d[_0x42a97d]=_0x2f21e9);}writeConfigFile(_0xe89e4f,_0x48494d);const _0x301e42=_0x1f441b['oldPath']+_0x369960(0x1d4);return renameSync(_0x1f441b[_0x369960(0x1f9)],_0x301e42),{'step':0x1,'label':_0x369960(0x217),'ok':!![],'detail':_0x1f441b[_0x369960(0x1f9)]+_0x369960(0x1dc)+_0xe89e4f+_0x369960(0x1d7)+_0x301e42+')'};}function execRemoveOldArtifacts(_0x3737d5){const _0x5220d4=a152_0x1dde9b,_0xb19e50=[];for(const _0x7bc017 of _0x3737d5){try{if(!existsSync(_0x7bc017))continue;const _0x512d2e=tryStat(_0x7bc017);_0x512d2e?.[_0x5220d4(0x224)]()?rmSync(_0x7bc017,{'recursive':!![],'force':!![]}):unlinkSync(_0x7bc017);}catch(_0x38ad31){_0xb19e50[_0x5220d4(0x1ff)](_0x7bc017+':\x20'+_0x38ad31['message']);}}return{'step':0x3,'label':_0x5220d4(0x1b2),'ok':_0xb19e50[_0x5220d4(0x201)]===0x0,'detail':_0xb19e50['length']>0x0?_0x3737d5[_0x5220d4(0x201)]-_0xb19e50['length']+'/'+_0x3737d5[_0x5220d4(0x201)]+_0x5220d4(0x1f4)+_0xb19e50[_0x5220d4(0x1c4)](';\x20')+')':_0x3737d5[_0x5220d4(0x201)]+_0x5220d4(0x223)};}function execCleanMcp(_0xde1ecd){const _0x357c93=a152_0x1dde9b;if(!_0xde1ecd[_0x357c93(0x21c)])return{'step':0x4,'label':_0x357c93(0x205),'ok':!![],'detail':_0x357c93(0x1e1)};try{const _0x88c796=readFileSync(_0xde1ecd[_0x357c93(0x21c)][_0x357c93(0x1cf)],'utf8'),_0x47dd63=JSON['parse'](_0x88c796);if(_0x47dd63?.[_0x357c93(0x1e6)]&&typeof _0x47dd63[_0x357c93(0x1e6)]===_0x357c93(0x1f8)){const _0x5b2faf=[];for(const [_0x1e6132,_0x11b78f]of Object['entries'](_0x47dd63[_0x357c93(0x1e6)])){_0x11b78f?.[_0x357c93(0x214)]&&Array[_0x357c93(0x1c9)](_0x11b78f['args'])&&_0x11b78f[_0x357c93(0x214)]['some'](_0x5cbf99=>typeof _0x5cbf99===_0x357c93(0x1c6)&&_0x5cbf99[_0x357c93(0x228)](_0x357c93(0x1c2)))&&_0x5b2faf['push'](_0x1e6132);}for(const _0x28c89c of _0x5b2faf){delete _0x47dd63['mcpServers'][_0x28c89c];}return _0x5b2faf[_0x357c93(0x201)]>0x0&&writeFileSync(_0xde1ecd[_0x357c93(0x21c)]['path'],JSON[_0x357c93(0x21f)](_0x47dd63,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x357c93(0x1b5)+_0x5b2faf[_0x357c93(0x1c4)](',\x20')+'\x20from\x20'+_0xde1ecd[_0x357c93(0x21c)][_0x357c93(0x1cf)]};}return{'step':0x4,'label':_0x357c93(0x205),'ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0x374009){return{'step':0x4,'label':_0x357c93(0x205),'ok':![],'detail':_0x374009['message']};}}function a152_0x1050(){const _0x419afc=['dependencies','removed\x20','lovrabet/rabetbase\x20installed\x20globally','filter','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','CANCEL','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','\x20\x20Step\x20','undefined','Legacy\x20artifacts:','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','devDependencies','utf8','@lovrabet/dataset-mcp-server','\x20\x20#\x20or','join','Config\x20file:','string','\x20\x20bun\x20install','10710NZfJAj','isArray','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','Step\x204/7:\x20MCP\x20config\x20—\x20','configMigration','@lovrabet/sdk:','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','path','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','needed','lovrabet/rabetbase','gray','.bak','oldArtifacts','bold','\x20(backup:\x20','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','Remove\x20old\x20skill','sdkUpgrade','none\x20found','\x20→\x20','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','error','succeed','Step\x206/7:\x20Installing\x20new\x20skill...','skipped','log','label','yellow','\x20\x20Fields\x20to\x20migrate:\x20','mcpServers','1224thwugC','fail','cwd','.cursor/rules/lovrabet_rules.mdc','Step\x204/7:\x20Cleaning\x20MCP\x20config...','MCP\x20config:','\x20→\x20keys:\x20','cyan','Step\x205/7:\x20Removing\x20old\x20skill...','status','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','Upgrade\x20@lovrabet/sdk','24MdwZwD','\x20removed\x20(','\x20→\x20latest','Proceed\x20with\x20upgrade?','\x20\x20New\x20config\x20(.rabetbase.json):\x20','object','oldPath','values','inherit','4085972JXrJoE','175080ZTkXEP','no\x20legacy\x20entry','push','@lovrabet/sdk','length','green','exit\x20','FOUND','Clean\x20MCP\x20config','hasNewConfig','failed','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','.lovrabet','70hejRcF','286785GwBlZk','20FuKXDf','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','not\x20needed','some','Remove\x20.lovrabet/','parse','not\x20found\x20(will\x20create)','1856800LsbBuu','args','lovrabet/lovrabet-skill\x20removed','871280WZbNsu','Config\x20migration','yes','keys','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','oldMcpConfig','.cursor/mcp.json','Upgrade\x20cancelled.','stringify','16982OTKurb','Step\x201/7:\x20Migrating\x20config...','done','\x20removed','isDirectory','start','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','Install\x20new\x20skill','includes','latest','files','detail','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','entries','\x20\x20Current\x20version\x20in\x20','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','no\x20legacy\x20config\x20found','Remove\x20legacy\x20artifacts','white'];a152_0x1050=function(){return _0x419afc;};return a152_0x1050();}function execSkillsRemove(_0x3e7816,_0x47ec91){const _0x43e38f=a152_0x1dde9b,_0x4394d9=runNpxSkillsRemove(_0x3e7816,{'stdio':_0x43e38f(0x1fb),'yes':_0x47ec91});return{'step':0x5,'label':_0x43e38f(0x1d9),'ok':_0x4394d9['ok'],'detail':_0x4394d9['ok']?_0x43e38f(0x215):_0x4394d9[_0x43e38f(0x1de)]??_0x43e38f(0x203)+_0x4394d9[_0x43e38f(0x1f0)]};}function a152_0xf737(_0x12f351,_0x40d775){_0x12f351=_0x12f351-0x1af;const _0x1050b0=a152_0x1050();let _0xf7379d=_0x1050b0[_0x12f351];return _0xf7379d;}function execSkillsAdd(_0x40b65c,_0x2e907c){const _0x1c907e=a152_0x1dde9b,_0x7d3bf6=runNpxSkillsAddGlobal(_0x40b65c,_0x1c907e(0x1d2),{'stdio':_0x1c907e(0x1fb),'yes':_0x2e907c});return{'step':0x6,'label':_0x1c907e(0x227),'ok':_0x7d3bf6['ok'],'detail':_0x7d3bf6['ok']?_0x1c907e(0x1b6):_0x7d3bf6['error']??_0x1c907e(0x203)+_0x7d3bf6[_0x1c907e(0x1f0)]};}function execUpgradeSdk(_0x51ab09){const _0x2f662d=a152_0x1dde9b;if(!_0x51ab09['sdkUpgrade'])return{'step':0x7,'label':_0x2f662d(0x1f2),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x888cb2,currentVersion:_0x33eeb7,field:_0x55cb39}=_0x51ab09[_0x2f662d(0x1da)];try{const _0x5ed3ad=readFileSync(_0x888cb2,'utf8'),_0x5b7893=JSON['parse'](_0x5ed3ad);return _0x5b7893[_0x55cb39][_0x2f662d(0x200)]='latest',writeFileSync(_0x888cb2,JSON['stringify'](_0x5b7893,null,0x2)+'\x0a',_0x2f662d(0x1c1)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x55cb39+'[\x22@lovrabet/sdk\x22]:\x20'+_0x33eeb7+_0x2f662d(0x1f5)};}catch(_0x131f60){return{'step':0x7,'label':_0x2f662d(0x1f2),'ok':![],'detail':_0x131f60['message']};}}function tryStat(_0x39a480){try{return statSync(_0x39a480);}catch{return undefined;}}function printSummary(_0x38185a){const _0x376322=a152_0x1dde9b;console[_0x376322(0x1e2)](''),console[_0x376322(0x1e2)](a152_0x4508f0[_0x376322(0x1d6)]('===\x20Upgrade\x20Summary\x20===')),console[_0x376322(0x1e2)]('');for(const _0x304aa6 of _0x38185a){const _0x1335ff=_0x304aa6['ok']?a152_0x4508f0[_0x376322(0x202)]('OK'):a152_0x4508f0['red']('FAIL');console[_0x376322(0x1e2)]('\x20\x20'+_0x1335ff+_0x376322(0x1bb)+_0x304aa6['step']+':\x20'+_0x304aa6[_0x376322(0x1e3)]);if(_0x304aa6[_0x376322(0x22b)])console[_0x376322(0x1e2)]('\x20\x20\x20\x20\x20\x20\x20'+a152_0x4508f0['gray'](_0x304aa6[_0x376322(0x22b)]));}console[_0x376322(0x1e2)]('');}export async function upgradeApp(_0xa919d3,_0x2e9b8c){const _0x36a09b=a152_0x1dde9b,_0xa0966d=process[_0x36a09b(0x1e9)](),_0x3421c5=analyse(_0xa0966d),_0x44df20=!_0x3421c5[_0x36a09b(0x1cc)]&&_0x3421c5[_0x36a09b(0x1d5)][_0x36a09b(0x201)]===0x0&&!_0x3421c5[_0x36a09b(0x21c)]&&!_0x3421c5['needsSkillSwap']&&!_0x3421c5[_0x36a09b(0x1da)];if(_0x44df20){console[_0x36a09b(0x1e2)](a152_0x4508f0[_0x36a09b(0x202)](_0x36a09b(0x1dd)));return;}printReport(_0x3421c5);const _0xef4a41=!!(_0x2e9b8c[_0x36a09b(0x218)]||_0x2e9b8c['Y']||_0xa919d3);if(!_0xef4a41)try{const _0x59856d=await askConfirm(_0x36a09b(0x1f6));if(!_0x59856d){console[_0x36a09b(0x1e2)](a152_0x4508f0['gray'](_0x36a09b(0x21e)));return;}}catch(_0x38e372){if(_0x38e372?.['message']===_0x36a09b(0x1b9)){console[_0x36a09b(0x1e2)](a152_0x4508f0[_0x36a09b(0x1d3)](_0x36a09b(0x21e)));return;}throw _0x38e372;}const _0x7e67cd=[],_0x1ce55c=a152_0xa7d67f({'text':_0x36a09b(0x221),'color':_0x36a09b(0x1ee)})['start'](),_0x59e353=execConfigMigration(_0x3421c5,_0xa0966d);_0x7e67cd['push'](_0x59e353),_0x1ce55c[_0x59e353['ok']?'succeed':_0x36a09b(0x1e8)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0x59e353['detail']??(_0x59e353['ok']?_0x36a09b(0x222):_0x36a09b(0x207))));const _0x47faa7=resolve(_0xa0966d,_0x36a09b(0x209)),_0x5cb98e=a152_0xa7d67f({'text':_0x36a09b(0x1b8),'color':_0x36a09b(0x1ee)})[_0x36a09b(0x225)]();if(existsSync(_0x47faa7))try{rmSync(_0x47faa7,{'recursive':!![],'force':!![]}),_0x5cb98e['succeed'](_0x36a09b(0x20d)),_0x7e67cd[_0x36a09b(0x1ff)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x396739){_0x5cb98e[_0x36a09b(0x1e8)](_0x36a09b(0x21a)+_0x396739['message']),_0x7e67cd[_0x36a09b(0x1ff)]({'step':0x2,'label':_0x36a09b(0x210),'ok':![],'detail':_0x396739['message']});}else _0x5cb98e['info'](_0x36a09b(0x1b0)),_0x7e67cd[_0x36a09b(0x1ff)]({'step':0x2,'label':_0x36a09b(0x210),'ok':!![],'detail':'skipped'});const _0x45feb7=a152_0xa7d67f({'text':_0x36a09b(0x226),'color':_0x36a09b(0x1ee)})[_0x36a09b(0x225)](),_0x233282=execRemoveOldArtifacts(_0x3421c5[_0x36a09b(0x1d5)]);_0x7e67cd['push'](_0x233282),_0x45feb7[_0x233282['ok']?_0x36a09b(0x1df):_0x36a09b(0x1e8)](_0x36a09b(0x1be)+(_0x233282[_0x36a09b(0x22b)]??(_0x233282['ok']?_0x36a09b(0x222):_0x36a09b(0x207))));const _0x4cc945=a152_0xa7d67f({'text':_0x36a09b(0x1eb),'color':_0x36a09b(0x1ee)})['start'](),_0x415ce9=execCleanMcp(_0x3421c5);_0x7e67cd[_0x36a09b(0x1ff)](_0x415ce9),_0x4cc945[_0x415ce9['ok']?_0x36a09b(0x1df):_0x36a09b(0x1e8)](_0x36a09b(0x1cb)+(_0x415ce9[_0x36a09b(0x22b)]??(_0x415ce9['ok']?'done':_0x36a09b(0x207))));const _0x27d167=a152_0xa7d67f({'text':_0x36a09b(0x1ef),'color':'cyan'})['start'](),_0x32061f=execSkillsRemove(_0xa0966d,_0xef4a41);_0x7e67cd[_0x36a09b(0x1ff)](_0x32061f),_0x27d167[_0x32061f['ok']?_0x36a09b(0x1df):_0x36a09b(0x1e8)](_0x36a09b(0x1af)+(_0x32061f['detail']??(_0x32061f['ok']?_0x36a09b(0x222):_0x36a09b(0x207))));const _0x19d578=a152_0xa7d67f({'text':_0x36a09b(0x1e0),'color':_0x36a09b(0x1ee)})['start'](),_0x19ba7a=execSkillsAdd(_0xa0966d,_0xef4a41);_0x7e67cd[_0x36a09b(0x1ff)](_0x19ba7a),_0x19d578[_0x19ba7a['ok']?'succeed':_0x36a09b(0x1e8)](_0x36a09b(0x1ce)+(_0x19ba7a['detail']??(_0x19ba7a['ok']?_0x36a09b(0x222):_0x36a09b(0x207))));const _0x415aff=a152_0xa7d67f({'text':_0x36a09b(0x1bf),'color':'cyan'})[_0x36a09b(0x225)](),_0x32a963=execUpgradeSdk(_0x3421c5);_0x7e67cd['push'](_0x32a963),_0x415aff[_0x32a963['ok']?_0x36a09b(0x1df):_0x36a09b(0x1e8)](_0x36a09b(0x1ca)+(_0x32a963[_0x36a09b(0x22b)]??(_0x32a963['ok']?_0x36a09b(0x222):'failed'))),printSummary(_0x7e67cd);const _0x2cd4c6=_0x7e67cd['some'](_0x41e99=>!_0x41e99['ok']);_0x2cd4c6?console[_0x36a09b(0x1e2)](a152_0x4508f0['yellow'](_0x36a09b(0x208))):console[_0x36a09b(0x1e2)](a152_0x4508f0['green']('Upgrade\x20completed\x20successfully!')),_0x32a963['ok']&&_0x3421c5['sdkUpgrade']&&(console[_0x36a09b(0x1e2)](''),console[_0x36a09b(0x1e2)](a152_0x4508f0[_0x36a09b(0x1d6)][_0x36a09b(0x1ee)](_0x36a09b(0x1f1))),console[_0x36a09b(0x1e2)](a152_0x4508f0[_0x36a09b(0x1ee)](_0x36a09b(0x1d8))),console[_0x36a09b(0x1e2)](''),console[_0x36a09b(0x1e2)](a152_0x4508f0[_0x36a09b(0x1b3)]('\x20\x20npm\x20install')),console[_0x36a09b(0x1e2)](a152_0x4508f0[_0x36a09b(0x1b3)](_0x36a09b(0x1c3))),console[_0x36a09b(0x1e2)](a152_0x4508f0['white'](_0x36a09b(0x1c7))),console[_0x36a09b(0x1e2)](''));}
1
+ const a152_0x173eab=a152_0x42db;(function(_0x478d47,_0x4b2b11){const _0x5439c0=a152_0x42db,_0x1bd620=_0x478d47();while(!![]){try{const _0x349c59=-parseInt(_0x5439c0(0x200))/0x1*(parseInt(_0x5439c0(0x224))/0x2)+-parseInt(_0x5439c0(0x23e))/0x3*(-parseInt(_0x5439c0(0x1e0))/0x4)+parseInt(_0x5439c0(0x214))/0x5*(-parseInt(_0x5439c0(0x1fe))/0x6)+parseInt(_0x5439c0(0x215))/0x7+parseInt(_0x5439c0(0x219))/0x8*(-parseInt(_0x5439c0(0x239))/0x9)+parseInt(_0x5439c0(0x1fb))/0xa*(-parseInt(_0x5439c0(0x21a))/0xb)+parseInt(_0x5439c0(0x1e2))/0xc*(parseInt(_0x5439c0(0x21d))/0xd);if(_0x349c59===_0x4b2b11)break;else _0x1bd620['push'](_0x1bd620['shift']());}catch(_0x2729c3){_0x1bd620['push'](_0x1bd620['shift']());}}}(a152_0x4596,0xa79da));import a152_0x55d77d from'chalk';import a152_0x1faa62 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[a152_0x173eab(0x202)](_0x1babe3=>_0x1babe3!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x446fca){const _0x1722ac=a152_0x173eab,_0x372bdf=[];for(const _0x580888 of Object['values'](CORE_IDE_CONFIGS)){if(_0x580888[_0x1722ac(0x1e4)])for(const _0x57c2d3 of _0x580888['files']){_0x372bdf[_0x1722ac(0x21e)](resolve(_0x446fca,_0x57c2d3[_0x1722ac(0x1ea)]));}}return _0x372bdf;}function analyse(_0x4858fa){const _0x42561a=a152_0x173eab;let _0x49a976=null;const _0x168a0a=resolve(_0x4858fa,NEW_CONFIG_NAME),_0xa95fac=existsSync(_0x168a0a);for(const _0x124acb of LEGACY_CONFIG_NAMES){const _0x111281=resolve(_0x4858fa,_0x124acb);if(existsSync(_0x111281)){const _0x4db9d8=readConfigFile(_0x111281),_0x64df8c=Object[_0x42561a(0x249)](_0x4db9d8)['filter'](_0x568296=>typeof _0x4db9d8[_0x568296]!=='undefined');_0x49a976={'oldPath':_0x111281,'hasNewConfig':_0xa95fac,'fields':_0x64df8c};break;}}const _0x225753=[],_0x32ccbf=resolve(_0x4858fa,_0x42561a(0x255));if(existsSync(_0x32ccbf))_0x225753['push'](_0x32ccbf);const _0x53fd12=resolve(_0x4858fa,_0x42561a(0x20f));if(existsSync(_0x53fd12))_0x225753[_0x42561a(0x21e)](_0x53fd12);const _0x4ed7ed=resolve(_0x4858fa,'.claude/skills/lovrabet');if(existsSync(_0x4ed7ed))_0x225753[_0x42561a(0x21e)](_0x4ed7ed);for(const _0x233704 of collectIdeSkillFiles(_0x4858fa)){if(existsSync(_0x233704))_0x225753[_0x42561a(0x21e)](_0x233704);}let _0x2e9f0c=null;const _0x538727=resolve(_0x4858fa,_0x42561a(0x1ec));if(existsSync(_0x538727))try{const _0x4dbb29=JSON['parse'](readFileSync(_0x538727,'utf8'));if(_0x4dbb29?.[_0x42561a(0x213)]&&typeof _0x4dbb29['mcpServers']==='object'){const _0x4d73d4=[];for(const [_0x8be0bd,_0xab523c]of Object[_0x42561a(0x22d)](_0x4dbb29[_0x42561a(0x213)])){const _0x5de981=_0xab523c;_0x5de981?.['args']&&Array[_0x42561a(0x1d5)](_0x5de981[_0x42561a(0x230)])&&_0x5de981[_0x42561a(0x230)][_0x42561a(0x216)](_0x3833af=>typeof _0x3833af===_0x42561a(0x21f)&&_0x3833af['includes'](_0x42561a(0x209)))&&_0x4d73d4['push'](_0x8be0bd);}_0x4d73d4['length']>0x0&&(_0x2e9f0c={'path':_0x538727,'keys':_0x4d73d4});}}catch{}const _0x58587e=_0x225753[_0x42561a(0x241)]>0x0||_0x49a976!==null;let _0x196ae3=null;const _0x3875f7=resolve(_0x4858fa,_0x42561a(0x23d));if(existsSync(_0x3875f7))try{const _0x30b218=JSON[_0x42561a(0x23a)](readFileSync(_0x3875f7,'utf8'));for(const _0x160ff8 of[_0x42561a(0x22f),_0x42561a(0x20d)]){const _0x4ed981=_0x30b218?.[_0x160ff8]?.[_0x42561a(0x1f6)];if(typeof _0x4ed981===_0x42561a(0x21f)){_0x4ed981!==_0x42561a(0x240)&&(_0x196ae3={'pkgPath':_0x3875f7,'currentVersion':_0x4ed981,'field':_0x160ff8});break;}}}catch{}return{'configMigration':_0x49a976,'oldArtifacts':_0x225753,'oldMcpConfig':_0x2e9f0c,'needsSkillSwap':_0x58587e,'sdkUpgrade':_0x196ae3};}function printReport(_0x1da44b){const _0x30e3e8=a152_0x173eab,{configMigration:_0x104312,oldArtifacts:_0x3ad0e7,oldMcpConfig:_0x181116,needsSkillSwap:_0x120c21}=_0x1da44b;console[_0x30e3e8(0x22c)](''),console['log'](a152_0x55d77d['bold'](_0x30e3e8(0x204))),console['log']('');_0x104312?(console[_0x30e3e8(0x22c)](a152_0x55d77d[_0x30e3e8(0x233)](_0x30e3e8(0x23c))+('\x20\x20'+a152_0x55d77d['yellow'](_0x104312['oldPath']))),console[_0x30e3e8(0x22c)](_0x30e3e8(0x218)+(_0x104312['hasNewConfig']?a152_0x55d77d[_0x30e3e8(0x212)](_0x30e3e8(0x1ef)):a152_0x55d77d[_0x30e3e8(0x1f0)](_0x30e3e8(0x24d)))),console[_0x30e3e8(0x22c)](_0x30e3e8(0x1db)+_0x104312[_0x30e3e8(0x1df)]['join'](',\x20')),console[_0x30e3e8(0x22c)](_0x30e3e8(0x211))):console['log'](a152_0x55d77d['cyan']('Config\x20file:')+'\x20\x20'+a152_0x55d77d[_0x30e3e8(0x1f0)](_0x30e3e8(0x1e9)));console['log']('');if(_0x3ad0e7[_0x30e3e8(0x241)]>0x0){console[_0x30e3e8(0x22c)](a152_0x55d77d['cyan'](_0x30e3e8(0x1e6)));for(const _0x2c3cff of _0x3ad0e7){console[_0x30e3e8(0x22c)]('\x20\x20'+a152_0x55d77d[_0x30e3e8(0x1dc)](_0x30e3e8(0x210))+'\x20\x20'+_0x2c3cff);}console[_0x30e3e8(0x22c)]('\x20\x20Action:\x20delete');}else console[_0x30e3e8(0x22c)](a152_0x55d77d[_0x30e3e8(0x233)](_0x30e3e8(0x1e6))+'\x20\x20'+a152_0x55d77d[_0x30e3e8(0x1f0)](_0x30e3e8(0x234)));console[_0x30e3e8(0x22c)]('');_0x181116?(console[_0x30e3e8(0x22c)](a152_0x55d77d['cyan'](_0x30e3e8(0x1f8))+('\x20\x20'+a152_0x55d77d[_0x30e3e8(0x1ee)](_0x181116['path'])+_0x30e3e8(0x1fd)+_0x181116[_0x30e3e8(0x249)][_0x30e3e8(0x24c)](',\x20'))),console[_0x30e3e8(0x22c)](_0x30e3e8(0x244))):console[_0x30e3e8(0x22c)](a152_0x55d77d[_0x30e3e8(0x233)]('MCP\x20config:')+'\x20\x20'+a152_0x55d77d[_0x30e3e8(0x1f0)](_0x30e3e8(0x207)));console['log'](''),console[_0x30e3e8(0x22c)](a152_0x55d77d[_0x30e3e8(0x233)](_0x30e3e8(0x238))+('\x20\x20'+(_0x120c21?a152_0x55d77d[_0x30e3e8(0x1ee)](_0x30e3e8(0x1eb)):a152_0x55d77d[_0x30e3e8(0x212)](_0x30e3e8(0x1fa)))));_0x120c21&&console['log']('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x30e3e8(0x22c)]('');if(_0x1da44b['sdkUpgrade']){const {currentVersion:_0x55f70e,field:_0x43ebf4,pkgPath:_0xa613cb}=_0x1da44b['sdkUpgrade'];console[_0x30e3e8(0x22c)](a152_0x55d77d[_0x30e3e8(0x233)](_0x30e3e8(0x1d9))+('\x20\x20'+a152_0x55d77d[_0x30e3e8(0x1ee)](_0xa613cb))),console[_0x30e3e8(0x22c)](_0x30e3e8(0x226)+_0x43ebf4+':\x20'+a152_0x55d77d['yellow'](_0x55f70e)+_0x30e3e8(0x245)+a152_0x55d77d['green'](_0x30e3e8(0x240))),console[_0x30e3e8(0x22c)](_0x30e3e8(0x1e1));}else console[_0x30e3e8(0x22c)](a152_0x55d77d[_0x30e3e8(0x233)](_0x30e3e8(0x1d9))+'\x20\x20'+a152_0x55d77d[_0x30e3e8(0x1f0)](_0x30e3e8(0x1fc)));console[_0x30e3e8(0x22c)]('');}function execConfigMigration(_0x50da2e,_0x3fb225){const _0x550e25=a152_0x173eab,{configMigration:_0x19726e}=_0x50da2e;if(!_0x19726e?.[_0x550e25(0x24f)])return{'step':0x1,'label':_0x550e25(0x201),'ok':!![],'detail':_0x550e25(0x24b)};const _0x2d48ca=readConfigFile(_0x19726e[_0x550e25(0x24f)]),_0xcdea95=resolve(_0x3fb225,NEW_CONFIG_NAME),_0xf6d951=_0x19726e['hasNewConfig']?readConfigFile(_0xcdea95):{};for(const [_0x31f742,_0xac121]of Object[_0x550e25(0x22d)](_0x2d48ca)){!(_0x31f742 in _0xf6d951)&&(_0xf6d951[_0x31f742]=_0xac121);}writeConfigFile(_0xcdea95,_0xf6d951);const _0x17c470=_0x19726e[_0x550e25(0x24f)]+_0x550e25(0x20c);return renameSync(_0x19726e[_0x550e25(0x24f)],_0x17c470),{'step':0x1,'label':_0x550e25(0x201),'ok':!![],'detail':_0x19726e[_0x550e25(0x24f)]+'\x20→\x20'+_0xcdea95+'\x20(backup:\x20'+_0x17c470+')'};}function execRemoveOldArtifacts(_0xcdcd7c){const _0x33fa7d=a152_0x173eab,_0x34b2d6=[];for(const _0x33ef5a of _0xcdcd7c){try{if(!existsSync(_0x33ef5a))continue;const _0x533a5a=tryStat(_0x33ef5a);_0x533a5a?.['isDirectory']()?rmSync(_0x33ef5a,{'recursive':!![],'force':!![]}):unlinkSync(_0x33ef5a);}catch(_0x187110){_0x34b2d6[_0x33fa7d(0x21e)](_0x33ef5a+':\x20'+_0x187110[_0x33fa7d(0x1f5)]);}}return{'step':0x3,'label':_0x33fa7d(0x1e3),'ok':_0x34b2d6[_0x33fa7d(0x241)]===0x0,'detail':_0x34b2d6[_0x33fa7d(0x241)]>0x0?_0xcdcd7c['length']-_0x34b2d6[_0x33fa7d(0x241)]+'/'+_0xcdcd7c['length']+_0x33fa7d(0x251)+_0x34b2d6[_0x33fa7d(0x24c)](';\x20')+')':_0xcdcd7c[_0x33fa7d(0x241)]+'\x20removed'};}function execCleanMcp(_0x262258){const _0x3961ea=a152_0x173eab;if(!_0x262258[_0x3961ea(0x24a)])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x3961ea(0x236)};try{const _0x3e6f27=readFileSync(_0x262258[_0x3961ea(0x24a)][_0x3961ea(0x1ea)],_0x3961ea(0x225)),_0x181d7c=JSON[_0x3961ea(0x23a)](_0x3e6f27);if(_0x181d7c?.[_0x3961ea(0x213)]&&typeof _0x181d7c[_0x3961ea(0x213)]===_0x3961ea(0x1e5)){const _0xf0a5d8=[];for(const [_0x1c9e64,_0x4a554a]of Object[_0x3961ea(0x22d)](_0x181d7c[_0x3961ea(0x213)])){_0x4a554a?.[_0x3961ea(0x230)]&&Array[_0x3961ea(0x1d5)](_0x4a554a[_0x3961ea(0x230)])&&_0x4a554a[_0x3961ea(0x230)][_0x3961ea(0x216)](_0x4c2e7c=>typeof _0x4c2e7c===_0x3961ea(0x21f)&&_0x4c2e7c[_0x3961ea(0x250)](_0x3961ea(0x209)))&&_0xf0a5d8[_0x3961ea(0x21e)](_0x1c9e64);}for(const _0x525b20 of _0xf0a5d8){delete _0x181d7c[_0x3961ea(0x213)][_0x525b20];}return _0xf0a5d8['length']>0x0&&writeFileSync(_0x262258['oldMcpConfig'][_0x3961ea(0x1ea)],JSON[_0x3961ea(0x1d8)](_0x181d7c,null,0x2)+'\x0a',_0x3961ea(0x225)),{'step':0x4,'label':_0x3961ea(0x231),'ok':!![],'detail':_0x3961ea(0x23b)+_0xf0a5d8[_0x3961ea(0x24c)](',\x20')+'\x20from\x20'+_0x262258[_0x3961ea(0x24a)][_0x3961ea(0x1ea)]};}return{'step':0x4,'label':_0x3961ea(0x231),'ok':!![],'detail':_0x3961ea(0x21c)};}catch(_0x3e8be2){return{'step':0x4,'label':_0x3961ea(0x231),'ok':![],'detail':_0x3e8be2[_0x3961ea(0x1f5)]};}}function a152_0x42db(_0x4f80dd,_0x4891ff){_0x4f80dd=_0x4f80dd-0x1d4;const _0x4596e9=a152_0x4596();let _0x42db4b=_0x4596e9[_0x4f80dd];return _0x42db4b;}function a152_0x4596(){const _0x2ab643=['detail','\x20\x20#\x20or','log','entries','Remove\x20.lovrabet/','dependencies','args','Clean\x20MCP\x20config','Install\x20new\x20skill','cyan','none\x20found','\x20\x20npm\x20install','skipped','failed','Skill\x20swap:','45SelrLh','parse','removed\x20','Config\x20file:','package.json','3CduyKE','Step\x206/7:\x20Installing\x20new\x20skill...','latest','length','needsSkillSwap','Remove\x20old\x20skill','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','\x20→\x20','\x20\x20bun\x20install','succeed','error','keys','oldMcpConfig','skipped\x20(no\x20legacy\x20config)','join','not\x20found\x20(will\x20create)','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','oldPath','includes','\x20removed\x20(','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','white','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','.lovrabet','[\x22@lovrabet/sdk\x22]:\x20','isArray','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','Upgrade\x20cancelled.','stringify','@lovrabet/sdk:','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','\x20\x20Fields\x20to\x20migrate:\x20','red','start','cwd','fields','3420168zJlgZk','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','18624SSHZHc','Remove\x20legacy\x20artifacts','files','object','Legacy\x20artifacts:','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','no\x20legacy\x20config\x20found','path','needed','.cursor/mcp.json','===\x20Upgrade\x20Summary\x20===','yellow','already\x20exists\x20(will\x20merge)','gray','\x20\x20\x20\x20\x20\x20\x20','Step\x204/7:\x20Cleaning\x20MCP\x20config...','sdkUpgrade','lovrabet/lovrabet-skill\x20removed','message','@lovrabet/sdk','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','MCP\x20config:','lovrabet/rabetbase','not\x20needed','8345780KifdnS','not\x20found\x20or\x20already\x20at\x20latest','\x20→\x20keys:\x20','12AxZizF','Upgrade\x20@lovrabet/sdk','25rvMKxE','Config\x20migration','filter','done','===\x20Upgrade\x20Analysis\x20===','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','bold','no\x20legacy\x20entry','lovrabet/rabetbase\x20installed\x20globally','@lovrabet/dataset-mcp-server','exit\x20','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','.bak','devDependencies','Step\x201/7:\x20Config\x20migration\x20—\x20','.cursor/rules/lovrabet_rules.mdc','FOUND','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','green','mcpServers','45575IpzYMX','9255211JqxUEk','some','inherit','\x20\x20New\x20config\x20(.rabetbase.json):\x20','921408BAXxJw','11qHynrJ','fail','no\x20matching\x20entry\x20found','9113aLktDu','push','string','Step\x205/7:\x20Removing\x20old\x20skill...','status','Step\x201/7:\x20Migrating\x20config...','CANCEL','91994SyHsaL','utf8','\x20\x20Current\x20version\x20in\x20','oldArtifacts','Upgrade\x20completed\x20successfully!','step'];a152_0x4596=function(){return _0x2ab643;};return a152_0x4596();}function execSkillsRemove(_0x1d157e,_0xe7eec4){const _0x1494fb=a152_0x173eab,_0x7d4f7a=runNpxSkillsRemove(_0x1d157e,{'stdio':'inherit','yes':_0xe7eec4});return{'step':0x5,'label':_0x1494fb(0x243),'ok':_0x7d4f7a['ok'],'detail':_0x7d4f7a['ok']?_0x1494fb(0x1f4):_0x7d4f7a[_0x1494fb(0x248)]??_0x1494fb(0x20a)+_0x7d4f7a[_0x1494fb(0x221)]};}function execSkillsAdd(_0x1439da,_0x3a3492){const _0x4a4caf=a152_0x173eab,_0x3d7757=runNpxSkillsAddGlobal(_0x1439da,_0x4a4caf(0x1f9),{'stdio':_0x4a4caf(0x217),'yes':_0x3a3492});return{'step':0x6,'label':_0x4a4caf(0x232),'ok':_0x3d7757['ok'],'detail':_0x3d7757['ok']?_0x4a4caf(0x208):_0x3d7757[_0x4a4caf(0x248)]??_0x4a4caf(0x20a)+_0x3d7757[_0x4a4caf(0x221)]};}function execUpgradeSdk(_0x1c071d){const _0x4b838c=a152_0x173eab;if(!_0x1c071d[_0x4b838c(0x1f3)])return{'step':0x7,'label':_0x4b838c(0x1ff),'ok':!![],'detail':_0x4b838c(0x254)};const {pkgPath:_0x52335e,currentVersion:_0x5a342e,field:_0x494f7d}=_0x1c071d[_0x4b838c(0x1f3)];try{const _0xe50862=readFileSync(_0x52335e,_0x4b838c(0x225)),_0x428e6b=JSON[_0x4b838c(0x23a)](_0xe50862);return _0x428e6b[_0x494f7d][_0x4b838c(0x1f6)]=_0x4b838c(0x240),writeFileSync(_0x52335e,JSON[_0x4b838c(0x1d8)](_0x428e6b,null,0x2)+'\x0a',_0x4b838c(0x225)),{'step':0x7,'label':_0x4b838c(0x1ff),'ok':!![],'detail':_0x494f7d+_0x4b838c(0x1d4)+_0x5a342e+'\x20→\x20latest'};}catch(_0x296cc7){return{'step':0x7,'label':_0x4b838c(0x1ff),'ok':![],'detail':_0x296cc7[_0x4b838c(0x1f5)]};}}function tryStat(_0x5ed558){try{return statSync(_0x5ed558);}catch{return undefined;}}function printSummary(_0xa7fa18){const _0xcc1bb=a152_0x173eab;console[_0xcc1bb(0x22c)](''),console[_0xcc1bb(0x22c)](a152_0x55d77d[_0xcc1bb(0x206)](_0xcc1bb(0x1ed))),console[_0xcc1bb(0x22c)]('');for(const _0x13b844 of _0xa7fa18){const _0x2cc859=_0x13b844['ok']?a152_0x55d77d[_0xcc1bb(0x212)]('OK'):a152_0x55d77d[_0xcc1bb(0x1dc)]('FAIL');console[_0xcc1bb(0x22c)]('\x20\x20'+_0x2cc859+'\x20\x20Step\x20'+_0x13b844[_0xcc1bb(0x229)]+':\x20'+_0x13b844['label']);if(_0x13b844[_0xcc1bb(0x22a)])console[_0xcc1bb(0x22c)](_0xcc1bb(0x1f1)+a152_0x55d77d[_0xcc1bb(0x1f0)](_0x13b844[_0xcc1bb(0x22a)]));}console[_0xcc1bb(0x22c)]('');}export async function upgradeApp(_0x1f081c,_0x5eb9b0){const _0x55771a=a152_0x173eab,_0x48dd20=process[_0x55771a(0x1de)](),_0x212e26=analyse(_0x48dd20),_0x4d4fb1=!_0x212e26['configMigration']&&_0x212e26['oldArtifacts'][_0x55771a(0x241)]===0x0&&!_0x212e26['oldMcpConfig']&&!_0x212e26[_0x55771a(0x242)]&&!_0x212e26[_0x55771a(0x1f3)];if(_0x4d4fb1){console[_0x55771a(0x22c)](a152_0x55d77d[_0x55771a(0x212)](_0x55771a(0x1d6)));return;}printReport(_0x212e26);const _0x95bbba=!!(_0x5eb9b0['yes']||_0x5eb9b0['Y']||_0x1f081c);if(!_0x95bbba)try{const _0x11aebe=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x11aebe){console[_0x55771a(0x22c)](a152_0x55d77d[_0x55771a(0x1f0)](_0x55771a(0x1d7)));return;}}catch(_0x42dedd){if(_0x42dedd?.[_0x55771a(0x1f5)]===_0x55771a(0x223)){console[_0x55771a(0x22c)](a152_0x55d77d['gray']('Upgrade\x20cancelled.'));return;}throw _0x42dedd;}const _0x694b8=[],_0x2cbab5=a152_0x1faa62({'text':_0x55771a(0x222),'color':_0x55771a(0x233)})[_0x55771a(0x1dd)](),_0x38f269=execConfigMigration(_0x212e26,_0x48dd20);_0x694b8[_0x55771a(0x21e)](_0x38f269),_0x2cbab5[_0x38f269['ok']?_0x55771a(0x247):_0x55771a(0x21b)](_0x55771a(0x20e)+(_0x38f269[_0x55771a(0x22a)]??(_0x38f269['ok']?_0x55771a(0x203):_0x55771a(0x237))));const _0x5e4d5a=resolve(_0x48dd20,'.lovrabet'),_0x256659=a152_0x1faa62({'text':_0x55771a(0x20b),'color':'cyan'})[_0x55771a(0x1dd)]();if(existsSync(_0x5e4d5a))try{rmSync(_0x5e4d5a,{'recursive':!![],'force':!![]}),_0x256659[_0x55771a(0x247)](_0x55771a(0x1e8)),_0x694b8[_0x55771a(0x21e)]({'step':0x2,'label':_0x55771a(0x22e),'ok':!![]});}catch(_0x56464a){_0x256659[_0x55771a(0x21b)](_0x55771a(0x1f7)+_0x56464a['message']),_0x694b8[_0x55771a(0x21e)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x56464a['message']});}else _0x256659['info'](_0x55771a(0x1e7)),_0x694b8[_0x55771a(0x21e)]({'step':0x2,'label':_0x55771a(0x22e),'ok':!![],'detail':_0x55771a(0x236)});const _0x39a4c2=a152_0x1faa62({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x55771a(0x233)})[_0x55771a(0x1dd)](),_0x469f83=execRemoveOldArtifacts(_0x212e26[_0x55771a(0x227)]);_0x694b8[_0x55771a(0x21e)](_0x469f83),_0x39a4c2[_0x469f83['ok']?_0x55771a(0x247):'fail'](_0x55771a(0x24e)+(_0x469f83[_0x55771a(0x22a)]??(_0x469f83['ok']?_0x55771a(0x203):_0x55771a(0x237))));const _0xd4117d=a152_0x1faa62({'text':_0x55771a(0x1f2),'color':'cyan'})[_0x55771a(0x1dd)](),_0x6d4195=execCleanMcp(_0x212e26);_0x694b8['push'](_0x6d4195),_0xd4117d[_0x6d4195['ok']?_0x55771a(0x247):_0x55771a(0x21b)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x6d4195['detail']??(_0x6d4195['ok']?'done':_0x55771a(0x237))));const _0x1cbe4c=a152_0x1faa62({'text':_0x55771a(0x220),'color':'cyan'})[_0x55771a(0x1dd)](),_0x9ceabc=execSkillsRemove(_0x48dd20,_0x95bbba);_0x694b8[_0x55771a(0x21e)](_0x9ceabc),_0x1cbe4c[_0x9ceabc['ok']?'succeed':_0x55771a(0x21b)](_0x55771a(0x1da)+(_0x9ceabc[_0x55771a(0x22a)]??(_0x9ceabc['ok']?_0x55771a(0x203):_0x55771a(0x237))));const _0xabdb99=a152_0x1faa62({'text':_0x55771a(0x23f),'color':_0x55771a(0x233)})['start'](),_0x58ed94=execSkillsAdd(_0x48dd20,_0x95bbba);_0x694b8[_0x55771a(0x21e)](_0x58ed94),_0xabdb99[_0x58ed94['ok']?_0x55771a(0x247):_0x55771a(0x21b)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x58ed94[_0x55771a(0x22a)]??(_0x58ed94['ok']?'done':_0x55771a(0x237))));const _0x4787a3=a152_0x1faa62({'text':_0x55771a(0x252),'color':_0x55771a(0x233)})[_0x55771a(0x1dd)](),_0xdb046d=execUpgradeSdk(_0x212e26);_0x694b8[_0x55771a(0x21e)](_0xdb046d),_0x4787a3[_0xdb046d['ok']?'succeed':_0x55771a(0x21b)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0xdb046d[_0x55771a(0x22a)]??(_0xdb046d['ok']?_0x55771a(0x203):'failed'))),printSummary(_0x694b8);const _0x413bcd=_0x694b8[_0x55771a(0x216)](_0x1443ae=>!_0x1443ae['ok']);_0x413bcd?console[_0x55771a(0x22c)](a152_0x55d77d[_0x55771a(0x1ee)](_0x55771a(0x205))):console[_0x55771a(0x22c)](a152_0x55d77d[_0x55771a(0x212)](_0x55771a(0x228))),_0xdb046d['ok']&&_0x212e26[_0x55771a(0x1f3)]&&(console[_0x55771a(0x22c)](''),console[_0x55771a(0x22c)](a152_0x55d77d[_0x55771a(0x206)][_0x55771a(0x233)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x55771a(0x22c)](a152_0x55d77d[_0x55771a(0x233)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0x55771a(0x22c)](''),console[_0x55771a(0x22c)](a152_0x55d77d[_0x55771a(0x253)](_0x55771a(0x235))),console['log'](a152_0x55d77d[_0x55771a(0x253)](_0x55771a(0x22b))),console['log'](a152_0x55d77d[_0x55771a(0x253)](_0x55771a(0x246))),console[_0x55771a(0x22c)](''));}
@@ -1 +1 @@
1
- const a153_0x453290=a153_0x393c;(function(_0x491ef7,_0x44e35f){const _0x4fb140=a153_0x393c,_0x396292=_0x491ef7();while(!![]){try{const _0x8fda13=parseInt(_0x4fb140(0x1c2))/0x1+parseInt(_0x4fb140(0x1e2))/0x2*(-parseInt(_0x4fb140(0x1d2))/0x3)+parseInt(_0x4fb140(0x1fa))/0x4+parseInt(_0x4fb140(0x1e8))/0x5+-parseInt(_0x4fb140(0x1dc))/0x6*(parseInt(_0x4fb140(0x1c5))/0x7)+parseInt(_0x4fb140(0x1f7))/0x8+-parseInt(_0x4fb140(0x1bf))/0x9;if(_0x8fda13===_0x44e35f)break;else _0x396292['push'](_0x396292['shift']());}catch(_0x119833){_0x396292['push'](_0x396292['shift']());}}}(a153_0x7057,0x4a6b8));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{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{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{cliSkillDefinitions}from'../commands/cli-skill/index.js';function a153_0x393c(_0x4f87ea,_0x360c89){_0x4f87ea=_0x4f87ea-0x1bb;const _0x7057d6=a153_0x7057();let _0x393c34=_0x7057d6[_0x4f87ea];return _0x393c34;}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=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x3c3fa3){const _0xdc8c86=a153_0x393c;for(const _0x50fd43 of _0x3c3fa3){definitions[_0xdc8c86(0x1f0)](_0x50fd43['service']+':'+_0x50fd43[_0xdc8c86(0x1df)],_0x50fd43);let _0x158c1a=serviceGroups[_0xdc8c86(0x1dd)](_0x50fd43[_0xdc8c86(0x1bb)]);!_0x158c1a&&(_0x158c1a=[],serviceGroups[_0xdc8c86(0x1f0)](_0x50fd43[_0xdc8c86(0x1bb)],_0x158c1a)),_0x158c1a[_0xdc8c86(0x1bd)](_0x50fd43);}}function a153_0x7057(){const _0x441993=['read','defaultCommand','wildcardDef','app\x20remote','values','risk','API\x20Development','skill','6WCQGkg','get','Dataset\x20&\x20Operations','command','Configuration','Authentication','14vZvnsg','`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','run','from','app','Smart\x20List\x20Pages','1559000FUvOfq','Project','has','skills','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','App\x20Management','Logs','create','set','BFF\x20Scripts','commands','app\x20use','Platform\x20Issue','isSingleCommand','filter','4074224JcgCsV','start','Workspace','2364664QXONYa','install','Database\x20Connections','Code\x20Generation','service','remote','push','Self\x20Update','205704rGqVAC','description','Runtime\x20App\x20Config\x20Management','67455IeFQbs','build','use','3935834VTskyG','\x20\x20[write]','CLI\x20Built-in\x20Skill','write','SQL\x20Queries','skill\x20','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','preview','Notification\x20Configuration','`rabetbase\x20skills`\x20has\x20been\x20removed.','Menu','Async\x20Tasks','`rabetbase\x20','252753kbdmjK','show'];a153_0x7057=function(){return _0x441993;};return a153_0x7057();}function registerDeclarativeService(_0x24d447,_0x316e1a,_0x276c88){const _0x5b404d=a153_0x393c;registerDefinitions(_0x316e1a);_0x276c88?.[_0x5b404d(0x1d6)]&&registerDefinitions([_0x276c88[_0x5b404d(0x1d6)]]);const _0x64d15f=_0x2331e4=>_0x2331e4===_0x5b404d(0x1d4)?'':_0x2331e4===_0x5b404d(0x1c8)?_0x5b404d(0x1c6):'\x20\x20[high-risk-write]',_0x12f1e8={'service':_0x316e1a[0x0][_0x5b404d(0x1bb)],'label':_0x24d447,'commands':_0x316e1a[_0x5b404d(0x1f6)](_0x4c4c40=>!_0x4c4c40['hidden'])['map'](_0x1db8cb=>({'command':_0x1db8cb[_0x5b404d(0x1df)],'description':_0x1db8cb[_0x5b404d(0x1c0)],'tag':_0x64d15f(_0x1db8cb[_0x5b404d(0x1d9)])})),'declarative':!![],'defaultCommand':_0x276c88?.[_0x5b404d(0x1d5)]??(_0x276c88?.[_0x5b404d(0x1f5)]?_0x316e1a[0x0][_0x5b404d(0x1df)]:undefined),'wildcardDef':_0x276c88?.[_0x5b404d(0x1d6)],'isSingleCommand':_0x276c88?.[_0x5b404d(0x1f5)]};serviceRegistry[_0x5b404d(0x1bd)](_0x12f1e8),serviceByName[_0x5b404d(0x1f0)](_0x12f1e8['service'],_0x12f1e8);}registerDeclarativeService('Quick\x20Start',initDefinitions,{'defaultCommand':a153_0x453290(0x1e4),'isSingleCommand':!![]}),registerDeclarativeService(a153_0x453290(0x1e9),projectDefinitions),registerDeclarativeService(a153_0x453290(0x1f9),workspaceDefinitions),registerDeclarativeService(a153_0x453290(0x1ed),appDefinitions),registerDeclarativeService(a153_0x453290(0x1e1),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a153_0x453290(0x1de),datasetDefinitions),registerDeclarativeService(a153_0x453290(0x1e7),pageDefinitions),registerDeclarativeService(a153_0x453290(0x1da),apiDefinitions),registerDeclarativeService('Instant\x20API',dataDefinitions),registerDeclarativeService(a153_0x453290(0x1f1),bffDefinitions),registerDeclarativeService(a153_0x453290(0x1cd),notificationDefinitions),registerDeclarativeService(a153_0x453290(0x1c9),sqlDefinitions),registerDeclarativeService(a153_0x453290(0x1fc),dbDefinitions),registerDeclarativeService(a153_0x453290(0x1cf),menuDefinitions),registerDeclarativeService(a153_0x453290(0x1d0),taskDefinitions),registerDeclarativeService('Roles',roleDefinitions),registerDeclarativeService('Permissions',permitDefinitions),registerDeclarativeService(a153_0x453290(0x1c1),appConfigDefinitions),registerDeclarativeService(a153_0x453290(0x1f4),issueDefinitions),registerDeclarativeService('File',fileDefinitions),registerDeclarativeService(a153_0x453290(0x1fd),codegenDefinitions),registerDeclarativeService(a153_0x453290(0x1e0),configDefinitions),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a153_0x453290(0x1be),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a153_0x453290(0x1c7),cliSkillDefinitions,{'defaultCommand':a153_0x453290(0x1fb)}),registerDeclarativeService(a153_0x453290(0x1ee),logsDefinitions,{'defaultCommand':a153_0x453290(0x1d3)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last[a153_0x453290(0x1f2)]=[{'command':'<script>','description':'Run\x20any\x20package.json\x20script','tag':''}];}export const deprecatedAliases={'create':{'service':'project','command':a153_0x453290(0x1ef)},'start':{'service':a153_0x453290(0x1e4),'command':a153_0x453290(0x1f8)},'build':{'service':'run','command':a153_0x453290(0x1c3)},'preview':{'service':'run','command':a153_0x453290(0x1cc)},'logout':{'service':'auth','command':'logout'}};const CLI_SKILL_INSTALL_REMOVED_HINT=a153_0x453290(0x1cb),APP_REMOTE_REMOVED_HINT='Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.',APP_USE_REMOVED_HINT=a153_0x453290(0x1ec);export function resolveRemovedCommand(_0xd8dd28,_0x464adc){const _0x170a51=a153_0x453290;if(_0xd8dd28===_0x170a51(0x1db)){const _0x4917cc=_0x464adc?_0x170a51(0x1ca)+_0x464adc:_0x170a51(0x1db);return{'command':_0x4917cc,'message':_0x170a51(0x1d1)+_0x4917cc+'`\x20has\x20been\x20removed.','hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0xd8dd28===_0x170a51(0x1eb))return{'command':_0x170a51(0x1eb),'message':_0x170a51(0x1ce),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0xd8dd28==='app'&&_0x464adc===_0x170a51(0x1bc))return{'command':_0x170a51(0x1d7),'message':'`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','hint':APP_REMOTE_REMOVED_HINT};if(_0xd8dd28===_0x170a51(0x1e6)&&_0x464adc===_0x170a51(0x1c4))return{'command':_0x170a51(0x1f3),'message':_0x170a51(0x1e3),'hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a153_0x453290(0x1ef)},'sql':{'new':a153_0x453290(0x1ef)}};export function resolveDeprecatedSubcommand(_0x1538fe,_0x5eafd){return deprecatedSubcommands[_0x1538fe]?.[_0x5eafd];}export function findDefinition(_0x3231a5,_0x3a119e){return definitions['get'](_0x3231a5+':'+_0x3a119e);}export function isKnownService(_0x3c9e00){return serviceByName['has'](_0x3c9e00);}export function isDeclarativeService(_0x113c73){const _0x51f8a5=a153_0x453290;return serviceGroups[_0x51f8a5(0x1ea)](_0x113c73)||serviceByName['get'](_0x113c73)?.[_0x51f8a5(0x1d6)]!==undefined;}export function getServiceEntry(_0x5e7ef7){const _0x3ab111=a153_0x453290;return serviceByName[_0x3ab111(0x1dd)](_0x5e7ef7);}export function getLegacyHandler(_0x5d2d51,_0xc03ce1){return undefined;}export function getAllDefinitions(){const _0x54b66e=a153_0x453290;return Array[_0x54b66e(0x1e5)](definitions[_0x54b66e(0x1d8)]());}
1
+ const a153_0x3301c2=a153_0x48aa;(function(_0x1af85a,_0x30fc1a){const _0x2e51cf=a153_0x48aa,_0x39f3b1=_0x1af85a();while(!![]){try{const _0x4b94a7=-parseInt(_0x2e51cf(0xd3))/0x1*(-parseInt(_0x2e51cf(0xba))/0x2)+parseInt(_0x2e51cf(0xc2))/0x3*(-parseInt(_0x2e51cf(0xce))/0x4)+-parseInt(_0x2e51cf(0xcd))/0x5+-parseInt(_0x2e51cf(0xea))/0x6*(parseInt(_0x2e51cf(0xe4))/0x7)+parseInt(_0x2e51cf(0xd8))/0x8*(parseInt(_0x2e51cf(0xd0))/0x9)+parseInt(_0x2e51cf(0xd5))/0xa+-parseInt(_0x2e51cf(0xbf))/0xb*(-parseInt(_0x2e51cf(0xe8))/0xc);if(_0x4b94a7===_0x30fc1a)break;else _0x39f3b1['push'](_0x39f3b1['shift']());}catch(_0x5531ff){_0x39f3b1['push'](_0x39f3b1['shift']());}}}(a153_0x359c,0x328a8));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';function a153_0x48aa(_0x253b88,_0x79698b){_0x253b88=_0x253b88-0xa9;const _0x359cb7=a153_0x359c();let _0x48aa56=_0x359cb7[_0x253b88];return _0x48aa56;}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{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{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{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=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0xed2f7a){const _0x153ac1=a153_0x48aa;for(const _0x5420f5 of _0xed2f7a){definitions[_0x153ac1(0xbb)](_0x5420f5['service']+':'+_0x5420f5[_0x153ac1(0xb6)],_0x5420f5);let _0x2f358a=serviceGroups[_0x153ac1(0xe5)](_0x5420f5[_0x153ac1(0xda)]);!_0x2f358a&&(_0x2f358a=[],serviceGroups[_0x153ac1(0xbb)](_0x5420f5[_0x153ac1(0xda)],_0x2f358a)),_0x2f358a[_0x153ac1(0xdc)](_0x5420f5);}}function registerDeclarativeService(_0x2532d4,_0x316331,_0x33abac){const _0x3a129d=a153_0x48aa;registerDefinitions(_0x316331);_0x33abac?.['wildcardDef']&&registerDefinitions([_0x33abac['wildcardDef']]);const _0x5af420=_0x1d04b6=>_0x1d04b6==='read'?'':_0x1d04b6===_0x3a129d(0xd6)?'\x20\x20[write]':_0x3a129d(0xe7),_0x1775b9={'service':_0x316331[0x0]['service'],'label':_0x2532d4,'commands':_0x316331['filter'](_0x1f8543=>!_0x1f8543['hidden'])[_0x3a129d(0xe6)](_0x62d72c=>({'command':_0x62d72c[_0x3a129d(0xb6)],'description':_0x62d72c[_0x3a129d(0xdf)],'tag':_0x5af420(_0x62d72c[_0x3a129d(0xde)])})),'declarative':!![],'defaultCommand':_0x33abac?.['defaultCommand']??(_0x33abac?.['isSingleCommand']?_0x316331[0x0]['command']:undefined),'wildcardDef':_0x33abac?.[_0x3a129d(0xc7)],'isSingleCommand':_0x33abac?.['isSingleCommand']};serviceRegistry['push'](_0x1775b9),serviceByName[_0x3a129d(0xbb)](_0x1775b9['service'],_0x1775b9);}registerDeclarativeService(a153_0x3301c2(0xae),initDefinitions,{'defaultCommand':a153_0x3301c2(0xd1),'isSingleCommand':!![]}),registerDeclarativeService(a153_0x3301c2(0xad),projectDefinitions),registerDeclarativeService(a153_0x3301c2(0xb4),workspaceDefinitions),registerDeclarativeService(a153_0x3301c2(0xc8),appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService('Dataset\x20&\x20Operations',datasetDefinitions),registerDeclarativeService(a153_0x3301c2(0xbe),pageDefinitions),registerDeclarativeService(a153_0x3301c2(0xe0),apiDefinitions),registerDeclarativeService('Instant\x20API',dataDefinitions),registerDeclarativeService(a153_0x3301c2(0xd2),bffDefinitions),registerDeclarativeService('Notification\x20Configuration',notificationDefinitions),registerDeclarativeService(a153_0x3301c2(0xc0),sqlDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a153_0x3301c2(0xbd),taskDefinitions),registerDeclarativeService(a153_0x3301c2(0xb3),roleDefinitions),registerDeclarativeService(a153_0x3301c2(0xc4),permitDefinitions),registerDeclarativeService(a153_0x3301c2(0xc1),appConfigDefinitions),registerDeclarativeService(a153_0x3301c2(0xa9),issueDefinitions),registerDeclarativeService(a153_0x3301c2(0xd7),fileDefinitions),registerDeclarativeService(a153_0x3301c2(0xe3),codegenDefinitions),registerDeclarativeService(a153_0x3301c2(0xd4),configDefinitions),registerDeclarativeService(a153_0x3301c2(0xb0),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a153_0x3301c2(0xb5),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a153_0x3301c2(0xcb),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a153_0x3301c2(0xeb),cliSkillDefinitions,{'defaultCommand':'install'}),registerDeclarativeService(a153_0x3301c2(0xc9),logsDefinitions,{'defaultCommand':a153_0x3301c2(0xac)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a153_0x3301c2(0xd9)]-0x1];last[a153_0x3301c2(0xb2)]=[{'command':a153_0x3301c2(0xcf),'description':a153_0x3301c2(0xe2),'tag':''}];}export const deprecatedAliases={'create':{'service':'project','command':a153_0x3301c2(0xb8)},'start':{'service':'run','command':a153_0x3301c2(0xb7)},'build':{'service':a153_0x3301c2(0xd1),'command':a153_0x3301c2(0xdb)},'preview':{'service':'run','command':'preview'},'logout':{'service':a153_0x3301c2(0xcc),'command':'logout'}};const CLI_SKILL_INSTALL_REMOVED_HINT='Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.',APP_REMOTE_REMOVED_HINT=a153_0x3301c2(0xaa),APP_USE_REMOVED_HINT=a153_0x3301c2(0xdd);export function resolveRemovedCommand(_0x3765e9,_0x26886e){const _0x31648a=a153_0x3301c2;if(_0x3765e9===_0x31648a(0xc5)){const _0x2aceaf=_0x26886e?_0x31648a(0xaf)+_0x26886e:_0x31648a(0xc5);return{'command':_0x2aceaf,'message':'`rabetbase\x20'+_0x2aceaf+_0x31648a(0xca),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x3765e9==='skills')return{'command':'skills','message':_0x31648a(0xe1),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x3765e9===_0x31648a(0xab)&&_0x26886e===_0x31648a(0xc3))return{'command':_0x31648a(0xe9),'message':'`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','hint':APP_REMOTE_REMOVED_HINT};if(_0x3765e9==='app'&&_0x26886e===_0x31648a(0xc6))return{'command':_0x31648a(0xb9),'message':'`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a153_0x3301c2(0xb8)},'sql':{'new':a153_0x3301c2(0xb8)}};export function resolveDeprecatedSubcommand(_0x6a2f40,_0x35ce21){return deprecatedSubcommands[_0x6a2f40]?.[_0x35ce21];}export function findDefinition(_0x5bd027,_0x481719){const _0x46a223=a153_0x3301c2;return definitions[_0x46a223(0xe5)](_0x5bd027+':'+_0x481719);}function a153_0x359c(){const _0x232b2d=['112eoyZuP','get','map','\x20\x20[high-risk-write]','1497756sUFdrq','app\x20remote','122790jTfRsq','CLI\x20Built-in\x20Skill','Platform\x20Issue','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','app','show','Project','Quick\x20Start','skill\x20','Diagnostics','has','commands','Roles','Workspace','Schema','command','start','create','app\x20use','2SZzFOC','set','values','Async\x20Tasks','Smart\x20List\x20Pages','22QHXfmd','SQL\x20Queries','Runtime\x20App\x20Config\x20Management','76794UaHpib','remote','Permissions','skill','use','wildcardDef','App\x20Management','Logs','`\x20has\x20been\x20removed.','Self\x20Update','auth','1466685xuExeU','36qbICqE','<script>','59679yHCQpi','run','BFF\x20Scripts','381624EIAkUZ','Configuration','1417920rplTcL','write','File','344EMyDIl','length','service','build','push','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','risk','description','API\x20Development','`rabetbase\x20skills`\x20has\x20been\x20removed.','Run\x20any\x20package.json\x20script','Code\x20Generation'];a153_0x359c=function(){return _0x232b2d;};return a153_0x359c();}export function isKnownService(_0x29b2f2){const _0xb7cd28=a153_0x3301c2;return serviceByName[_0xb7cd28(0xb1)](_0x29b2f2);}export function isDeclarativeService(_0xbc09f2){const _0x742a05=a153_0x3301c2;return serviceGroups[_0x742a05(0xb1)](_0xbc09f2)||serviceByName[_0x742a05(0xe5)](_0xbc09f2)?.[_0x742a05(0xc7)]!==undefined;}export function getServiceEntry(_0x6efa6f){return serviceByName['get'](_0x6efa6f);}export function getLegacyHandler(_0x54f76b,_0x530bba){return undefined;}export function getAllDefinitions(){const _0x2762da=a153_0x3301c2;return Array['from'](definitions[_0x2762da(0xbc)]());}
@@ -1 +1 @@
1
- const a154_0x23596a=a154_0x55af;(function(_0x57044b,_0x4d6d9f){const _0x400cba=a154_0x55af,_0x5b8dc0=_0x57044b();while(!![]){try{const _0x56f39f=-parseInt(_0x400cba(0x18a))/0x1*(parseInt(_0x400cba(0x193))/0x2)+-parseInt(_0x400cba(0x197))/0x3*(parseInt(_0x400cba(0x194))/0x4)+parseInt(_0x400cba(0x190))/0x5*(-parseInt(_0x400cba(0x185))/0x6)+parseInt(_0x400cba(0x19b))/0x7+parseInt(_0x400cba(0x199))/0x8+-parseInt(_0x400cba(0x18f))/0x9*(-parseInt(_0x400cba(0x18b))/0xa)+-parseInt(_0x400cba(0x187))/0xb;if(_0x56f39f===_0x4d6d9f)break;else _0x5b8dc0['push'](_0x5b8dc0['shift']());}catch(_0x5e2a04){_0x5b8dc0['push'](_0x5b8dc0['shift']());}}}(a154_0x5566,0xdaf47));function a154_0x55af(_0x52d9d7,_0x161b29){_0x52d9d7=_0x52d9d7-0x180;const _0x556604=a154_0x5566();let _0x55afef=_0x556604[_0x52d9d7];return _0x55afef;}import{createAppRole}from'../../core/api-client.js';function a154_0x5566(){const _0x18e322=['20vBkmiR','Created\x20role\x20','write','name','5606001DKiIft','1335MjuNbv','Pass\x20--name\x20<roleName>.','length','2614scHzwN','445172zMBUfw','trim','validation','36fcxDwu','\x20(id=','9198056zmMQvr','CUSTOM','11033036ZBHnHK','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','str','POST','appCode','flagMissing','12588PqKSPV','create','1440428ZRhRVs','remark','/smartapi/permit/role/create','802DUiyHb'];a154_0x5566=function(){return _0x18e322;};return a154_0x5566();}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=a154_0x23596a(0x189);function readName(_0x3b8526){const _0x2962a3=a154_0x23596a,_0x3877ec=_0x3b8526[_0x2962a3(0x181)](_0x2962a3(0x18e))[_0x2962a3(0x195)]();if(!_0x3877ec)throw CliErrors[_0x2962a3(0x184)](_0x2962a3(0x18e),_0x2962a3(0x191));if(_0x3877ec[_0x2962a3(0x192)]>0x40)throw CliErrors[_0x2962a3(0x196)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');return _0x3877ec;}export const roleCreate={'service':'role','command':a154_0x23596a(0x186),'description':a154_0x23596a(0x180),'risk':a154_0x23596a(0x18d),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1b5419){readName(_0x1b5419);},async 'dryRun'(_0x10a787){const _0x1cb03f=a154_0x23596a,_0x57e9de=readName(_0x10a787),_0x1b154c=_0x10a787[_0x1cb03f(0x181)](_0x1cb03f(0x188))[_0x1cb03f(0x195)]()||undefined;return asDryRunResult({'operation':_0x1cb03f(0x186),'selector':{'appCode':_0x10a787[_0x1cb03f(0x183)],'roleName':_0x57e9de},'before':null,'after':{'roleName':_0x57e9de,'roleType':_0x1cb03f(0x19a),'remark':_0x1b154c},'dryRun':!![],'backend':{'method':_0x1cb03f(0x182),'path':CREATE_PATH},'warnings':[]},{'method':_0x1cb03f(0x182),'url':CREATE_PATH});},async 'execute'(_0x203b7a){const _0x19c77d=a154_0x23596a,_0x4ef3a2=readName(_0x203b7a),_0x4c0fb9=_0x203b7a[_0x19c77d(0x181)](_0x19c77d(0x188))[_0x19c77d(0x195)]()||undefined,_0x56a6fd=await createAppRole({'appCode':_0x203b7a[_0x19c77d(0x183)],'roleName':_0x4ef3a2,..._0x4c0fb9?{'remark':_0x4c0fb9}:{}});return{'ok':!![],'data':{'operation':_0x19c77d(0x186),'selector':{'appCode':_0x203b7a[_0x19c77d(0x183)],'roleId':_0x56a6fd['id'],'roleName':_0x4ef3a2},'before':null,'after':projectRole(_0x56a6fd),'dryRun':![],'backend':{'method':_0x19c77d(0x182),'path':CREATE_PATH},'warnings':[]},'message':_0x19c77d(0x18c)+_0x56a6fd['roleName']+_0x19c77d(0x198)+_0x56a6fd['id']+')'};}};
1
+ const a154_0x502a88=a154_0x34c9;(function(_0xea5ae0,_0x3447eb){const _0x334e12=a154_0x34c9,_0x4caffb=_0xea5ae0();while(!![]){try{const _0x473e30=parseInt(_0x334e12(0xd2))/0x1+parseInt(_0x334e12(0xce))/0x2+-parseInt(_0x334e12(0xd7))/0x3+-parseInt(_0x334e12(0xdf))/0x4+-parseInt(_0x334e12(0xe2))/0x5+parseInt(_0x334e12(0xd5))/0x6+-parseInt(_0x334e12(0xde))/0x7*(parseInt(_0x334e12(0xe8))/0x8);if(_0x473e30===_0x3447eb)break;else _0x4caffb['push'](_0x4caffb['shift']());}catch(_0x7c5773){_0x4caffb['push'](_0x4caffb['shift']());}}}(a154_0x25ef,0x9edb3));function a154_0x34c9(_0x1f9dcb,_0x301439){_0x1f9dcb=_0x1f9dcb-0xce;const _0x25ef0a=a154_0x25ef();let _0x34c9c4=_0x25ef0a[_0x1f9dcb];return _0x34c9c4;}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=a154_0x502a88(0xd0);function a154_0x25ef(){const _0x315d5e=['Role\x20name\x20cannot\x20exceed\x2064\x20characters.','/smartapi/permit/role/create','\x20(id=','866475yNAsBV','remark','write','6339534wsfDjp','flagMissing','3618975PePIXY','Created\x20role\x20','validation','str','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','POST','Pass\x20--name\x20<roleName>.','1806917oEgElc','61324jCrvvh','create','trim','3145530ejBEvz','appCode','CUSTOM','role','name','roleName','8aiwTvg','1673008PQNuAU'];a154_0x25ef=function(){return _0x315d5e;};return a154_0x25ef();}function readName(_0x115ea5){const _0x547824=a154_0x502a88,_0xcdc43b=_0x115ea5[_0x547824(0xda)](_0x547824(0xe6))[_0x547824(0xe1)]();if(!_0xcdc43b)throw CliErrors[_0x547824(0xd6)]('name',_0x547824(0xdd));if(_0xcdc43b['length']>0x40)throw CliErrors[_0x547824(0xd9)](_0x547824(0xcf));return _0xcdc43b;}export const roleCreate={'service':a154_0x502a88(0xe5),'command':a154_0x502a88(0xe0),'description':a154_0x502a88(0xdb),'risk':a154_0x502a88(0xd4),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x132e16){readName(_0x132e16);},async 'dryRun'(_0x1c4749){const _0x417adf=a154_0x502a88,_0x441e2a=readName(_0x1c4749),_0x363b40=_0x1c4749[_0x417adf(0xda)](_0x417adf(0xd3))['trim']()||undefined;return asDryRunResult({'operation':'create','selector':{'appCode':_0x1c4749['appCode'],'roleName':_0x441e2a},'before':null,'after':{'roleName':_0x441e2a,'roleType':_0x417adf(0xe4),'remark':_0x363b40},'dryRun':!![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},{'method':_0x417adf(0xdc),'url':CREATE_PATH});},async 'execute'(_0x292bc8){const _0xba4df=a154_0x502a88,_0x3a0059=readName(_0x292bc8),_0x5ae339=_0x292bc8[_0xba4df(0xda)](_0xba4df(0xd3))[_0xba4df(0xe1)]()||undefined,_0x263404=await createAppRole({'appCode':_0x292bc8['appCode'],'roleName':_0x3a0059,..._0x5ae339?{'remark':_0x5ae339}:{}});return{'ok':!![],'data':{'operation':_0xba4df(0xe0),'selector':{'appCode':_0x292bc8[_0xba4df(0xe3)],'roleId':_0x263404['id'],'roleName':_0x3a0059},'before':null,'after':projectRole(_0x263404),'dryRun':![],'backend':{'method':_0xba4df(0xdc),'path':CREATE_PATH},'warnings':[]},'message':_0xba4df(0xd8)+_0x263404[_0xba4df(0xe7)]+_0xba4df(0xd1)+_0x263404['id']+')'};}};
@@ -1 +1 @@
1
- const a155_0x35779f=a155_0x31e0;(function(_0xca8cb7,_0x45be26){const _0x337519=a155_0x31e0,_0x30e3b3=_0xca8cb7();while(!![]){try{const _0x352dd7=parseInt(_0x337519(0x1c1))/0x1*(-parseInt(_0x337519(0x1b6))/0x2)+-parseInt(_0x337519(0x1b0))/0x3+-parseInt(_0x337519(0x1b4))/0x4+parseInt(_0x337519(0x1bf))/0x5*(parseInt(_0x337519(0x1b2))/0x6)+-parseInt(_0x337519(0x1b3))/0x7*(-parseInt(_0x337519(0x1bb))/0x8)+-parseInt(_0x337519(0x1c0))/0x9+parseInt(_0x337519(0x1c3))/0xa;if(_0x352dd7===_0x45be26)break;else _0x30e3b3['push'](_0x30e3b3['shift']());}catch(_0x5c21f4){_0x30e3b3['push'](_0x30e3b3['shift']());}}}(a155_0x1ea9,0xa4a34));import{deleteAppRole}from'../../core/api-client.js';function a155_0x1ea9(){const _0x4111cc=['\x20(id=','/smartapi/permit/role/delete','userCount','Deleted\x20role\x20','8gJSoSA','delete','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','role','10ndSxAh','10226583rmXiPP','61FLgIfG','roleName','39641900JqmSiX','high-risk-write','3845751hbiWNW','POST','456054VNAhgu','1882622vbmIQD','4621132UzBlMz','appCode','4502uRajiL'];a155_0x1ea9=function(){return _0x4111cc;};return a155_0x1ea9();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a155_0x31e0(_0x3dcbd3,_0x41ee09){_0x3dcbd3=_0x3dcbd3-0x1b0;const _0x1ea9bc=a155_0x1ea9();let _0x31e064=_0x1ea9bc[_0x3dcbd3];return _0x31e064;}const DELETE_PATH=a155_0x35779f(0x1b8);export const roleDelete={'service':a155_0x35779f(0x1be),'command':'delete','description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':a155_0x35779f(0x1c4),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4f7cfc){const _0x2865bf=a155_0x35779f,_0xdbbf99=_0x4f7cfc['num']('id'),_0x45d3c9=await getRoleById(_0x4f7cfc[_0x2865bf(0x1b5)],_0xdbbf99);return assertCustomRole(_0x45d3c9,_0x2865bf(0x1bc)),asDryRunResult({'operation':'delete','selector':{'appCode':_0x4f7cfc['appCode'],'roleId':_0xdbbf99,'roleName':_0x45d3c9[_0x2865bf(0x1c2)]},'before':projectRole(_0x45d3c9),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x45d3c9[_0x2865bf(0x1b9)]>0x0?['Role\x20still\x20has\x20'+_0x45d3c9[_0x2865bf(0x1b9)]+_0x2865bf(0x1bd)]:[]},{'method':_0x2865bf(0x1b1),'url':DELETE_PATH});},async 'execute'(_0x43b62b){const _0x27d998=a155_0x35779f,_0x5cc192=_0x43b62b['num']('id'),_0x4f9eb2=await getRoleById(_0x43b62b[_0x27d998(0x1b5)],_0x5cc192);return assertCustomRole(_0x4f9eb2,'delete'),await deleteAppRole(_0x5cc192),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0x43b62b[_0x27d998(0x1b5)],'roleId':_0x5cc192,'roleName':_0x4f9eb2[_0x27d998(0x1c2)]},'before':projectRole(_0x4f9eb2),'after':null,'dryRun':![],'backend':{'method':_0x27d998(0x1b1),'path':DELETE_PATH},'warnings':[]},'message':_0x27d998(0x1ba)+_0x4f9eb2[_0x27d998(0x1c2)]+_0x27d998(0x1b7)+_0x5cc192+')'};}};
1
+ const a155_0x447026=a155_0x169e;(function(_0x3ca521,_0x346b12){const _0x5d180a=a155_0x169e,_0xe2dfc0=_0x3ca521();while(!![]){try{const _0x3be6fd=-parseInt(_0x5d180a(0x1c6))/0x1*(parseInt(_0x5d180a(0x1c9))/0x2)+-parseInt(_0x5d180a(0x1c2))/0x3+-parseInt(_0x5d180a(0x1bb))/0x4*(-parseInt(_0x5d180a(0x1c5))/0x5)+parseInt(_0x5d180a(0x1b5))/0x6*(parseInt(_0x5d180a(0x1c1))/0x7)+parseInt(_0x5d180a(0x1bc))/0x8*(-parseInt(_0x5d180a(0x1b7))/0x9)+parseInt(_0x5d180a(0x1ca))/0xa+parseInt(_0x5d180a(0x1c3))/0xb;if(_0x3be6fd===_0x346b12)break;else _0xe2dfc0['push'](_0xe2dfc0['shift']());}catch(_0x8bdb78){_0xe2dfc0['push'](_0xe2dfc0['shift']());}}}(a155_0x3a43,0xa4263));function a155_0x169e(_0x330b27,_0x49b0b7){_0x330b27=_0x330b27-0x1b4;const _0x3a4332=a155_0x3a43();let _0x169e29=_0x3a4332[_0x330b27];return _0x169e29;}import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a155_0x447026(0x1bf);export const roleDelete={'service':'role','command':a155_0x447026(0x1be),'description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':a155_0x447026(0x1c0),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x46dd3e){const _0x55e1b1=a155_0x447026,_0x2f2663=_0x46dd3e['num']('id'),_0x375094=await getRoleById(_0x46dd3e[_0x55e1b1(0x1c8)],_0x2f2663);return assertCustomRole(_0x375094,_0x55e1b1(0x1be)),asDryRunResult({'operation':_0x55e1b1(0x1be),'selector':{'appCode':_0x46dd3e[_0x55e1b1(0x1c8)],'roleId':_0x2f2663,'roleName':_0x375094['roleName']},'before':projectRole(_0x375094),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x375094[_0x55e1b1(0x1b4)]>0x0?[_0x55e1b1(0x1bd)+_0x375094['userCount']+_0x55e1b1(0x1b6)]:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x5d8d8f){const _0x2a04fd=a155_0x447026,_0x33c959=_0x5d8d8f[_0x2a04fd(0x1c4)]('id'),_0x22e377=await getRoleById(_0x5d8d8f[_0x2a04fd(0x1c8)],_0x33c959);return assertCustomRole(_0x22e377,_0x2a04fd(0x1be)),await deleteAppRole(_0x33c959),{'ok':!![],'data':{'operation':_0x2a04fd(0x1be),'selector':{'appCode':_0x5d8d8f[_0x2a04fd(0x1c8)],'roleId':_0x33c959,'roleName':_0x22e377[_0x2a04fd(0x1ba)]},'before':projectRole(_0x22e377),'after':null,'dryRun':![],'backend':{'method':_0x2a04fd(0x1c7),'path':DELETE_PATH},'warnings':[]},'message':_0x2a04fd(0x1b8)+_0x22e377[_0x2a04fd(0x1ba)]+_0x2a04fd(0x1b9)+_0x33c959+')'};}};function a155_0x3a43(){const _0x213e2d=['\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','2421dXRZAy','Deleted\x20role\x20','\x20(id=','roleName','57788UsXEbb','29504xBGVyh','Role\x20still\x20has\x20','delete','/smartapi/permit/role/delete','high-risk-write','2697884cqzMab','3768765HMEjlf','26172047xwaPEa','num','15vvMegJ','129msmcjo','POST','appCode','17834MRJHxO','4921210DLbrGu','userCount','18KkcuQN'];a155_0x3a43=function(){return _0x213e2d;};return a155_0x3a43();}
@@ -1 +1 @@
1
- const a156_0x17827b=a156_0x6dc4;(function(_0x54b74b,_0x3c0bd7){const _0x2dbc3c=a156_0x6dc4,_0x218099=_0x54b74b();while(!![]){try{const _0x4ca3e8=-parseInt(_0x2dbc3c(0x8c))/0x1+-parseInt(_0x2dbc3c(0x94))/0x2+parseInt(_0x2dbc3c(0x91))/0x3+-parseInt(_0x2dbc3c(0x93))/0x4+-parseInt(_0x2dbc3c(0x8d))/0x5+-parseInt(_0x2dbc3c(0x90))/0x6+parseInt(_0x2dbc3c(0x8e))/0x7;if(_0x4ca3e8===_0x3c0bd7)break;else _0x218099['push'](_0x218099['shift']());}catch(_0x153584){_0x218099['push'](_0x218099['shift']());}}}(a156_0xaa41,0x81dc9));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a156_0x6dc4(_0x2b3e26,_0x17d53e){_0x2b3e26=_0x2b3e26-0x89;const _0xaa41b9=a156_0xaa41();let _0x6dc404=_0xaa41b9[_0x2b3e26];return _0x6dc404;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a156_0x17827b(0x8a),'command':'detail','description':a156_0x17827b(0x8b),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x2d3d72){const _0x1c188e=a156_0x17827b,_0x41af54=_0x2d3d72[_0x1c188e(0x89)]('id'),_0x35ce40=await getRoleById(_0x2d3d72[_0x1c188e(0x8f)],_0x41af54);return{'ok':!![],'data':{'role':projectRole(_0x35ce40)},'message':'Role\x20'+_0x35ce40[_0x1c188e(0x92)]+'\x20('+_0x35ce40['roleType']+')'};}};function a156_0xaa41(){const _0x420da4=['role','Show\x20a\x20single\x20role\x27s\x20detail','912788OVpiKN','876235XvDLDd','15804061aAPoFJ','appCode','4538070KwKvaJ','2088585INLKWS','roleName','332cdxWuj','1155084PhcMhP','num'];a156_0xaa41=function(){return _0x420da4;};return a156_0xaa41();}
1
+ const a156_0x5be79a=a156_0xc58b;(function(_0x5b4f2a,_0x2f31f9){const _0x13fa7b=a156_0xc58b,_0x38047f=_0x5b4f2a();while(!![]){try{const _0x17e876=parseInt(_0x13fa7b(0x8c))/0x1+-parseInt(_0x13fa7b(0x8e))/0x2+parseInt(_0x13fa7b(0x8d))/0x3+parseInt(_0x13fa7b(0x8f))/0x4+-parseInt(_0x13fa7b(0x90))/0x5*(-parseInt(_0x13fa7b(0x83))/0x6)+-parseInt(_0x13fa7b(0x86))/0x7*(-parseInt(_0x13fa7b(0x84))/0x8)+-parseInt(_0x13fa7b(0x8a))/0x9*(parseInt(_0x13fa7b(0x89))/0xa);if(_0x17e876===_0x2f31f9)break;else _0x38047f['push'](_0x38047f['shift']());}catch(_0x2c79c2){_0x38047f['push'](_0x38047f['shift']());}}}(a156_0x281e,0xd53b2));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a156_0xc58b(_0x4fe355,_0x57dd80){_0x4fe355=_0x4fe355-0x82;const _0x281ec9=a156_0x281e();let _0xc58b9c=_0x281ec9[_0x4fe355];return _0xc58b9c;}function a156_0x281e(){const _0x506145=['9cXtAOM','detail','1485563guEOtW','3083604rRlVvj','1565806lvSnhr','806332lvCNMS','50aUdLjc','read','roleName','478938bheFTZ','104Lnpzar','role','62146gvZQmP','Role\x20','Show\x20a\x20single\x20role\x27s\x20detail','19723610qIiBla'];a156_0x281e=function(){return _0x506145;};return a156_0x281e();}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a156_0x5be79a(0x85),'command':a156_0x5be79a(0x8b),'description':a156_0x5be79a(0x88),'risk':a156_0x5be79a(0x91),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x407454){const _0x296168=a156_0x5be79a,_0x4b535a=_0x407454['num']('id'),_0x279c75=await getRoleById(_0x407454['appCode'],_0x4b535a);return{'ok':!![],'data':{'role':projectRole(_0x279c75)},'message':_0x296168(0x87)+_0x279c75[_0x296168(0x82)]+'\x20('+_0x279c75['roleType']+')'};}};
@@ -1 +1 @@
1
- (function(_0x5dacdb,_0x4b2b46){const _0x28bdc6=a157_0x3434,_0x44f997=_0x5dacdb();while(!![]){try{const _0x4ca7c7=parseInt(_0x28bdc6(0x151))/0x1+-parseInt(_0x28bdc6(0x153))/0x2+-parseInt(_0x28bdc6(0x14a))/0x3*(parseInt(_0x28bdc6(0x14f))/0x4)+parseInt(_0x28bdc6(0x154))/0x5*(-parseInt(_0x28bdc6(0x14d))/0x6)+-parseInt(_0x28bdc6(0x14c))/0x7+parseInt(_0x28bdc6(0x14e))/0x8*(-parseInt(_0x28bdc6(0x14b))/0x9)+parseInt(_0x28bdc6(0x152))/0xa*(parseInt(_0x28bdc6(0x150))/0xb);if(_0x4ca7c7===_0x4b2b46)break;else _0x44f997['push'](_0x44f997['shift']());}catch(_0x459917){_0x44f997['push'](_0x44f997['shift']());}}}(a157_0x2874,0xba2a3));function a157_0x3434(_0x109555,_0xf85285){_0x109555=_0x109555-0x14a;const _0x2874b0=a157_0x2874();let _0x3434dd=_0x2874b0[_0x109555];return _0x3434dd;}function a157_0x2874(){const _0x3c8954=['29547wJrfPg','458997jsnuac','2076qovrLP','672uwzLly','240FTqEMd','11kppmSh','689121JOzSeg','36109070zKWNSw','2712164qnXEfJ','5960dUbFgk','71382PhUhMH'];a157_0x2874=function(){return _0x3c8954;};return a157_0x2874();}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';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ function a157_0x1496(){const _0x149ef6=['2788auqgxv','20qRpxhW','1245902tSfKdv','304290BziQbG','941wXQwAn','42oLMqXF','8435427lZFcrs','6441550cdpvda','31615qAsvsm','3992WeYcVe','9837wghbSO'];a157_0x1496=function(){return _0x149ef6;};return a157_0x1496();}function a157_0x30a2(_0x197ef0,_0x3212c0){_0x197ef0=_0x197ef0-0x185;const _0x149671=a157_0x1496();let _0x30a267=_0x149671[_0x197ef0];return _0x30a267;}(function(_0x23be9a,_0x2dc95c){const _0x4170e1=a157_0x30a2,_0xd73d35=_0x23be9a();while(!![]){try{const _0x33859c=-parseInt(_0x4170e1(0x18f))/0x1*(parseInt(_0x4170e1(0x18b))/0x2)+parseInt(_0x4170e1(0x18e))/0x3+-parseInt(_0x4170e1(0x18c))/0x4*(parseInt(_0x4170e1(0x188))/0x5)+-parseInt(_0x4170e1(0x185))/0x6*(-parseInt(_0x4170e1(0x18d))/0x7)+-parseInt(_0x4170e1(0x189))/0x8*(-parseInt(_0x4170e1(0x18a))/0x9)+-parseInt(_0x4170e1(0x187))/0xa+parseInt(_0x4170e1(0x186))/0xb;if(_0x33859c===_0x2dc95c)break;else _0xd73d35['push'](_0xd73d35['shift']());}catch(_0x518789){_0xd73d35['push'](_0xd73d35['shift']());}}}(a157_0x1496,0xa4148));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';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- function a158_0x4d00(){const _0x3c5bfc=['page','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','163324TnWBBO','407464xuQuMo','trim','num','Page\x20size\x20(1-100)','role','type','ADMIN','33356MDNtRv','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','string','2605230IhhjbG','roleType','USER','\x20role(s)','CUSTOM','appCode','str','Filter\x20by\x20role\x20type','filter','length','312YkjmmG','947274gMHMSo','map','list','4340413GOnHkz','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','56leOkWz','validation','number','join','pagesize','Use\x20one\x20of:\x20','4152285NkGJji','toUpperCase'];a158_0x4d00=function(){return _0x3c5bfc;};return a158_0x4d00();}const a158_0x11afdc=a158_0x3aae;(function(_0x224d25,_0x100dce){const _0x26875a=a158_0x3aae,_0x208e75=_0x224d25();while(!![]){try{const _0x5f33ff=-parseInt(_0x26875a(0xdb))/0x1+parseInt(_0x26875a(0xda))/0x2+-parseInt(_0x26875a(0xef))/0x3*(parseInt(_0x26875a(0xe2))/0x4)+-parseInt(_0x26875a(0xd6))/0x5+-parseInt(_0x26875a(0xf0))/0x6+parseInt(_0x26875a(0xf3))/0x7+-parseInt(_0x26875a(0xd0))/0x8*(-parseInt(_0x26875a(0xe5))/0x9);if(_0x5f33ff===_0x100dce)break;else _0x208e75['push'](_0x208e75['shift']());}catch(_0x15a43a){_0x208e75['push'](_0x208e75['shift']());}}}(a158_0x4d00,0x7183b));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a158_0x3aae(_0x1077fc,_0x333e4a){_0x1077fc=_0x1077fc-0xd0;const _0x4d000f=a158_0x4d00();let _0x3aaecf=_0x4d000f[_0x1077fc];return _0x3aaecf;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a158_0x11afdc(0xe1),'DEV',a158_0x11afdc(0xe7),a158_0x11afdc(0xe9)];export const roleList={'service':a158_0x11afdc(0xdf),'command':a158_0x11afdc(0xf2),'description':a158_0x11afdc(0xd9),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a158_0x11afdc(0xe0),'type':a158_0x11afdc(0xe4),'required':![],'description':a158_0x11afdc(0xec),'enum':ROLE_TYPES},{'name':a158_0x11afdc(0xd8),'type':a158_0x11afdc(0xd2),'description':'Page\x20index\x20(1-based)','default':0x1},{'name':a158_0x11afdc(0xd4),'type':'number','description':a158_0x11afdc(0xde),'default':0x64}],async 'validate'(_0x585b74){const _0x1abe48=a158_0x11afdc,_0x5242fd=_0x585b74['str'](_0x1abe48(0xe0))[_0x1abe48(0xdc)]();if(_0x5242fd&&!ROLE_TYPES['includes'](_0x5242fd[_0x1abe48(0xd7)]()))throw CliErrors[_0x1abe48(0xd1)]('Invalid\x20--type\x20\x22'+_0x5242fd+'\x22.',_0x1abe48(0xd5)+ROLE_TYPES[_0x1abe48(0xd3)](',\x20')+'.');const _0x2378b3=_0x585b74[_0x1abe48(0xdd)](_0x1abe48(0xd8),0x1),_0x373ba4=_0x585b74[_0x1abe48(0xdd)](_0x1abe48(0xd4),0x64);if(_0x2378b3<0x1)throw CliErrors[_0x1abe48(0xd1)](_0x1abe48(0xf4));if(_0x373ba4<0x1||_0x373ba4>0x64)throw CliErrors[_0x1abe48(0xd1)](_0x1abe48(0xe3));},async 'execute'(_0x38cf8d){const _0x32fd8c=a158_0x11afdc,_0x4bd28b=_0x38cf8d['num'](_0x32fd8c(0xd8),0x1)||0x1,_0x3efc3a=_0x38cf8d[_0x32fd8c(0xdd)]('pagesize',0x64)||0x64,_0x488dd2=_0x38cf8d[_0x32fd8c(0xeb)]('type')[_0x32fd8c(0xdc)]()[_0x32fd8c(0xd7)](),{items:_0x4e6155,paging:_0x2ad14a}=await listAppRoles(_0x38cf8d[_0x32fd8c(0xea)],{'currentPage':_0x4bd28b,'pageSize':_0x3efc3a}),_0x2bfae1=_0x488dd2?_0x4e6155[_0x32fd8c(0xed)](_0x10541d=>_0x10541d[_0x32fd8c(0xe6)]===_0x488dd2):_0x4e6155,_0x1f000a=_0x2bfae1[_0x32fd8c(0xf1)](projectRole);return{'ok':!![],'data':{'roles':_0x1f000a,'paging':_0x2ad14a},'message':'Found\x20'+_0x1f000a[_0x32fd8c(0xee)]+_0x32fd8c(0xe8)};}};
1
+ const a158_0xd97405=a158_0x41d0;(function(_0x5aaf32,_0x37d22e){const _0x99f687=a158_0x41d0,_0x184964=_0x5aaf32();while(!![]){try{const _0x4d5e32=parseInt(_0x99f687(0x171))/0x1*(-parseInt(_0x99f687(0x152))/0x2)+-parseInt(_0x99f687(0x167))/0x3+parseInt(_0x99f687(0x170))/0x4*(-parseInt(_0x99f687(0x156))/0x5)+-parseInt(_0x99f687(0x15a))/0x6*(parseInt(_0x99f687(0x150))/0x7)+parseInt(_0x99f687(0x155))/0x8*(-parseInt(_0x99f687(0x173))/0x9)+parseInt(_0x99f687(0x16a))/0xa+parseInt(_0x99f687(0x15b))/0xb;if(_0x4d5e32===_0x37d22e)break;else _0x184964['push'](_0x184964['shift']());}catch(_0x2eed92){_0x184964['push'](_0x184964['shift']());}}}(a158_0x19d7,0x69b46));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a158_0x19d7(){const _0x354df0=['Filter\x20by\x20role\x20type','Invalid\x20--type\x20\x22','str','includes','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','join','number','validation','2534523IrgbjX','USER','pagesize','3975470UNPGeG','trim','role','appCode','type','roleType','2154108ufudUU','2dHTWKM','list','7767NzjCoa','Found\x20','map','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','DEV','\x20role(s)','num','7ySmtLb','Page\x20size\x20(1-100)','95286PIjPlM','Page\x20index\x20(1-based)','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','2848pgPyYX','5OcTeHD','CUSTOM','ADMIN','page','5096028zvNODO','29377029MiDBKX','toUpperCase','read','filter'];a158_0x19d7=function(){return _0x354df0;};return a158_0x19d7();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a158_0xd97405(0x158),a158_0xd97405(0x177),a158_0xd97405(0x168),a158_0xd97405(0x157)];function a158_0x41d0(_0x5dfb2b,_0x2312e9){_0x5dfb2b=_0x5dfb2b-0x14e;const _0x19d7c7=a158_0x19d7();let _0x41d0ec=_0x19d7c7[_0x5dfb2b];return _0x41d0ec;}export const roleList={'service':a158_0xd97405(0x16c),'command':a158_0xd97405(0x172),'description':a158_0xd97405(0x163),'risk':a158_0xd97405(0x15d),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a158_0xd97405(0x16e),'type':'string','required':![],'description':a158_0xd97405(0x15f),'enum':ROLE_TYPES},{'name':a158_0xd97405(0x159),'type':a158_0xd97405(0x165),'description':a158_0xd97405(0x153),'default':0x1},{'name':a158_0xd97405(0x169),'type':a158_0xd97405(0x165),'description':a158_0xd97405(0x151),'default':0x64}],async 'validate'(_0x56e96f){const _0x309fc0=a158_0xd97405,_0x4492f2=_0x56e96f[_0x309fc0(0x161)](_0x309fc0(0x16e))[_0x309fc0(0x16b)]();if(_0x4492f2&&!ROLE_TYPES[_0x309fc0(0x162)](_0x4492f2[_0x309fc0(0x15c)]()))throw CliErrors['validation'](_0x309fc0(0x160)+_0x4492f2+'\x22.','Use\x20one\x20of:\x20'+ROLE_TYPES[_0x309fc0(0x164)](',\x20')+'.');const _0x3b6272=_0x56e96f['num']('page',0x1),_0x3215b4=_0x56e96f[_0x309fc0(0x14f)](_0x309fc0(0x169),0x64);if(_0x3b6272<0x1)throw CliErrors['validation'](_0x309fc0(0x176));if(_0x3215b4<0x1||_0x3215b4>0x64)throw CliErrors[_0x309fc0(0x166)](_0x309fc0(0x154));},async 'execute'(_0xab6533){const _0x1e15b1=a158_0xd97405,_0x9abe7d=_0xab6533[_0x1e15b1(0x14f)](_0x1e15b1(0x159),0x1)||0x1,_0x5f4611=_0xab6533[_0x1e15b1(0x14f)](_0x1e15b1(0x169),0x64)||0x64,_0xa05177=_0xab6533[_0x1e15b1(0x161)](_0x1e15b1(0x16e))['trim']()[_0x1e15b1(0x15c)](),{items:_0x13c06e,paging:_0x5da0ab}=await listAppRoles(_0xab6533[_0x1e15b1(0x16d)],{'currentPage':_0x9abe7d,'pageSize':_0x5f4611}),_0x1f3123=_0xa05177?_0x13c06e[_0x1e15b1(0x15e)](_0x96ee38=>_0x96ee38[_0x1e15b1(0x16f)]===_0xa05177):_0x13c06e,_0x21259a=_0x1f3123[_0x1e15b1(0x175)](projectRole);return{'ok':!![],'data':{'roles':_0x21259a,'paging':_0x5da0ab},'message':_0x1e15b1(0x174)+_0x21259a['length']+_0x1e15b1(0x14e)};}};
@@ -1 +1 @@
1
- const a159_0x368088=a159_0x1417;(function(_0xd9d646,_0x43c5cb){const _0x3c48f5=a159_0x1417,_0x134106=_0xd9d646();while(!![]){try{const _0x508a54=-parseInt(_0x3c48f5(0x239))/0x1*(parseInt(_0x3c48f5(0x1f6))/0x2)+parseInt(_0x3c48f5(0x1fa))/0x3+parseInt(_0x3c48f5(0x21c))/0x4+-parseInt(_0x3c48f5(0x20f))/0x5+-parseInt(_0x3c48f5(0x235))/0x6+parseInt(_0x3c48f5(0x22c))/0x7+parseInt(_0x3c48f5(0x22d))/0x8*(parseInt(_0x3c48f5(0x1f0))/0x9);if(_0x508a54===_0x43c5cb)break;else _0x134106['push'](_0x134106['shift']());}catch(_0x45e62f){_0x134106['push'](_0x134106['shift']());}}}(a159_0x3c05,0x818d5));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':'number','required':!![],'description':a159_0x368088(0x21f)};export const ROLE_REF_FLAG={'name':a159_0x368088(0x22a),'type':a159_0x368088(0x21e),'required':!![],'description':a159_0x368088(0x214)};function a159_0x1417(_0x4b2ef8,_0x58e2a6){_0x4b2ef8=_0x4b2ef8-0x1eb;const _0x3c053d=a159_0x3c05();let _0x1417c8=_0x3c053d[_0x4b2ef8];return _0x1417c8;}export const USER_REF_FLAG={'name':a159_0x368088(0x238),'type':a159_0x368088(0x21e),'required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':a159_0x368088(0x1f9),'type':a159_0x368088(0x21e),'required':!![],'description':a159_0x368088(0x1fc)};export const USER_NAME_FLAG={'name':a159_0x368088(0x1f9),'type':a159_0x368088(0x21e),'required':!![],'description':a159_0x368088(0x236)};export const REMARK_FLAG={'name':a159_0x368088(0x232),'type':a159_0x368088(0x21e),'required':![],'description':a159_0x368088(0x23a)};export const EXPECT_USER_COUNT_FLAG={'name':a159_0x368088(0x200),'type':a159_0x368088(0x215),'required':![],'description':a159_0x368088(0x221)};export const BUILTIN_ROLE_TYPES=[a159_0x368088(0x1ff),a159_0x368088(0x1f4),a159_0x368088(0x20d)];function a159_0x3c05(){const _0x1ce5d4=['\x22\x20not\x20found\x20in\x20app\x20','userList','8361vCBXkp','Pass\x20--role\x20<id|name>.','No\x20tenant\x20member\x20matches\x20\x22','username','DEV','\x20is\x20already\x20a\x20member\x20of\x20role\x20','1320SRvtMX','/smartapi/permit/user-role/update-user-list','nickname','name','1602201DSEDuX','Cannot\x20','Role\x20name','Role\x20name\x20\x22','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','ADMIN','expect-user-count','\x20member(s)\x20but\x20role\x20has\x20','appCode','roleType','trim','validation','POST','toLowerCase','tenant_code','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','test','\x20not\x20found\x20in\x20app\x20','USER','user-add','2475645OwyqwF','CUSTOM','Role\x20id\x20','Disambiguate\x20with\x20--role\x20<id>.','includes','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','number','tenant','filter','map','flagMissing','str','User\x20','2493956qaKASo','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','string','Role\x20id\x20(from\x20`role\x20list`)','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','dryRun','findIndex','\x22:\x20','Missing\x20user\x20reference.','\x22\x20is\x20ambiguous\x20(ids:\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','flag',';\x20no\x20change.','role','push','5041498nXrBFn','2600nWoItK','expectUserCount','\x20built-in\x20role\x20','length','roleName','remark','Anti-drift\x20check\x20failed:\x20expected\x20','authRequired','5660286iFXErJ','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','user','319pphVfG','Optional\x20role\x20remark/description','userId','Disambiguate\x20with\x20--user\x20<id>.','totalCount','splice'];a159_0x3c05=function(){return _0x1ce5d4;};return a159_0x3c05();}export function isBuiltinRole(_0x59a667){const _0x4cf0c2=a159_0x368088;return BUILTIN_ROLE_TYPES[_0x4cf0c2(0x213)](_0x59a667);}export function assertCustomRole(_0x5f0687,_0x2da087){const _0x64db26=a159_0x368088;if(_0x5f0687[_0x64db26(0x203)]!==_0x64db26(0x210))throw CliErrors['validation'](_0x64db26(0x1fb)+_0x2da087+_0x64db26(0x22f)+_0x5f0687[_0x64db26(0x231)]+'\x20('+_0x5f0687['roleType']+').',_0x64db26(0x209));}export function assertPermConfigurable(_0x395bd9){const _0x559119=a159_0x368088;if(_0x395bd9[_0x559119(0x203)]===_0x559119(0x1f4)||_0x395bd9[_0x559119(0x203)]===_0x559119(0x1ff))throw CliErrors[_0x559119(0x205)](_0x559119(0x227)+_0x395bd9[_0x559119(0x231)]+'\x20('+_0x395bd9[_0x559119(0x203)]+').',_0x559119(0x1fe));}export function projectRole(_0x14212e){const _0x34b171=a159_0x368088;return{'id':_0x14212e['id'],'roleName':_0x14212e[_0x34b171(0x231)],'roleType':_0x14212e[_0x34b171(0x203)],'remark':_0x14212e['remark'],'userCount':_0x14212e['userCount'],'permitCount':_0x14212e['permitCount'],'builtin':isBuiltinRole(_0x14212e[_0x34b171(0x203)])};}export async function resolveRoleRef(_0x151121,_0x148e70){const _0x57bc73=a159_0x368088,_0x4f6a6c=_0x148e70[_0x57bc73(0x204)]();if(!_0x4f6a6c)throw CliErrors[_0x57bc73(0x205)]('Missing\x20role\x20reference.',_0x57bc73(0x1f1));if(/^\d+$/[_0x57bc73(0x20b)](_0x4f6a6c))return getRoleById(_0x151121,Number(_0x4f6a6c));const _0x3247ea=await listAllAppRoles(_0x151121),_0x598de3=_0x3247ea[_0x57bc73(0x217)](_0x189878=>_0x189878[_0x57bc73(0x231)]===_0x4f6a6c);if(_0x598de3[_0x57bc73(0x230)]===0x0)throw CliErrors[_0x57bc73(0x205)]('Role\x20name\x20\x22'+_0x4f6a6c+_0x57bc73(0x1ee)+_0x151121+'.',_0x57bc73(0x220));if(_0x598de3[_0x57bc73(0x230)]>0x1){const _0x188e3e=_0x598de3['map'](_0x458db6=>_0x458db6['id'])['join'](',\x20');throw CliErrors[_0x57bc73(0x205)](_0x57bc73(0x1fd)+_0x4f6a6c+_0x57bc73(0x226)+_0x188e3e+').',_0x57bc73(0x212));}return _0x598de3[0x0];}export async function getRoleById(_0x46c796,_0x1a1a17){const _0x36bd98=a159_0x368088,_0x48b531=await getAppRole(_0x1a1a17);if(!_0x48b531)throw CliErrors['validation'](_0x36bd98(0x211)+_0x1a1a17+_0x36bd98(0x20c)+_0x46c796+'.',_0x36bd98(0x20a));return _0x48b531;}async function listAllAppRoles(_0x4bb37c){const _0x4b6f34=a159_0x368088,_0x101bca=0x64,_0x44e39e=[];for(let _0x5a1812=0x1;;_0x5a1812+=0x1){const {items:_0x2de48d,paging:_0x5ae265}=await listAppRoles(_0x4bb37c,{'currentPage':_0x5a1812,'pageSize':_0x101bca});_0x44e39e['push'](..._0x2de48d);if(_0x2de48d[_0x4b6f34(0x230)]<_0x101bca||_0x5ae265&&_0x44e39e[_0x4b6f34(0x230)]>=_0x5ae265[_0x4b6f34(0x1ec)])return _0x44e39e;}}export async function resolveTenantCode(){const _0xdf02ee=a159_0x368088,_0x1dc1d3=await getSessionUserInfo(),_0x3cf3e7=_0x1dc1d3?.[_0xdf02ee(0x238)]?.[_0xdf02ee(0x216)]?.[_0xdf02ee(0x208)];if(!_0x3cf3e7)throw CliErrors[_0xdf02ee(0x234)](_0xdf02ee(0x237));return _0x3cf3e7;}function matchMember(_0x717537,_0xe5409c){const _0x1d93a9=a159_0x368088,_0x21a3db=_0xe5409c[_0x1d93a9(0x204)]()[_0x1d93a9(0x207)]();return(_0x717537['nickname']??'')['toLowerCase']()===_0x21a3db||(_0x717537[_0x1d93a9(0x1f3)]??'')[_0x1d93a9(0x207)]()===_0x21a3db;}export async function resolveUserRef(_0x27a7d7){const _0x5b7211=a159_0x368088,_0xa32c70=_0x27a7d7['trim']();if(!_0xa32c70)throw CliErrors[_0x5b7211(0x205)](_0x5b7211(0x225),'Pass\x20--user\x20<id|name>.');const _0x8a26ca=await resolveTenantCode(),_0x40d978=await getTenantMembers(_0x8a26ca);if(/^\d+$/[_0x5b7211(0x20b)](_0xa32c70)){const _0x5a59b1=Number(_0xa32c70),_0x5dc9ad=_0x40d978['find'](_0x2c4445=>_0x2c4445[_0x5b7211(0x23b)]===_0x5a59b1);return{'userId':_0x5a59b1,'username':_0x5dc9ad?.[_0x5b7211(0x1f3)]??String(_0x5a59b1),'nickname':_0x5dc9ad?.[_0x5b7211(0x1f8)],'matchedBy':'id'};}const _0x271308=_0x40d978[_0x5b7211(0x217)](_0x24b922=>matchMember(_0x24b922,_0xa32c70));if(_0x271308['length']===0x0)throw CliErrors[_0x5b7211(0x205)](_0x5b7211(0x1f2)+_0xa32c70+'\x22.',_0x5b7211(0x21d));if(_0x271308[_0x5b7211(0x230)]>0x1){const _0x37f9bd=_0x271308['map'](_0x67d9ba=>(_0x67d9ba[_0x5b7211(0x1f8)]??_0x67d9ba[_0x5b7211(0x1f3)]??'?')+'('+_0x67d9ba[_0x5b7211(0x23b)]+')')['join'](',\x20');throw CliErrors[_0x5b7211(0x205)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0xa32c70+_0x5b7211(0x224)+_0x37f9bd+'.',_0x5b7211(0x1eb));}const _0x514cd0=_0x271308[0x0];return{'userId':_0x514cd0[_0x5b7211(0x23b)],'username':_0x514cd0[_0x5b7211(0x1f3)]??String(_0x514cd0['userId']),'nickname':_0x514cd0[_0x5b7211(0x1f8)],'matchedBy':_0x5b7211(0x1f9)};}export const UPDATE_USER_LIST_PATH=a159_0x368088(0x1f7);function userIdsOf(_0x2430b8){const _0x1c57e9=a159_0x368088;return(_0x2430b8?.[_0x1c57e9(0x1ef)]??[])[_0x1c57e9(0x218)](_0x1417c9=>_0x1417c9[_0x1c57e9(0x23b)]);}export function computeRoleUserMutation(_0xd878fe){const _0x2db412=a159_0x368088,{operation:_0x56914a,appCode:_0x591ba5,roleUsers:_0x2f7ad2,targetRoleId:_0x434862,user:_0x409229}=_0xd878fe,_0x284fcf=_0x2f7ad2['find'](_0x1341be=>_0x1341be['id']===_0x434862);if(!_0x284fcf)throw CliErrors[_0x2db412(0x205)](_0x2db412(0x211)+_0x434862+'\x20not\x20found\x20in\x20the\x20user-role\x20list.',_0x2db412(0x20a));const _0x1decc9=userIdsOf(_0x284fcf),_0x240989=[];if(_0xd878fe[_0x2db412(0x22e)]!==undefined&&_0xd878fe[_0x2db412(0x22e)]!==_0x1decc9[_0x2db412(0x230)])throw CliErrors[_0x2db412(0x205)](_0x2db412(0x233)+_0xd878fe[_0x2db412(0x22e)]+_0x2db412(0x201)+_0x1decc9[_0x2db412(0x230)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x3a4c4d=_0x1decc9['includes'](_0x409229[_0x2db412(0x23b)]);let _0xd385af=![];const _0x2fc8f5=[..._0x284fcf[_0x2db412(0x1ef)]];if(_0x56914a===_0x2db412(0x20e))_0x3a4c4d?_0x240989[_0x2db412(0x22b)]('User\x20'+_0x409229[_0x2db412(0x23b)]+_0x2db412(0x1f5)+_0x284fcf[_0x2db412(0x231)]+_0x2db412(0x229)):(_0x2fc8f5[_0x2db412(0x22b)]({'userId':_0x409229[_0x2db412(0x23b)],'username':_0x409229['username'],..._0x409229[_0x2db412(0x1f8)]?{'nickname':_0x409229['nickname']}:{}}),_0xd385af=!![]);else{if(!_0x3a4c4d)_0x240989[_0x2db412(0x22b)](_0x2db412(0x21b)+_0x409229[_0x2db412(0x23b)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x284fcf[_0x2db412(0x231)]+_0x2db412(0x229));else{const _0x44d0ae=_0x2fc8f5[_0x2db412(0x223)](_0x4e9bca=>_0x4e9bca['userId']===_0x409229[_0x2db412(0x23b)]);if(_0x44d0ae>=0x0)_0x2fc8f5[_0x2db412(0x1ed)](_0x44d0ae,0x1);_0xd385af=!![];}}const _0xb8321b=_0x2f7ad2[_0x2db412(0x218)](_0x2dea43=>_0x2dea43['id']===_0x434862?{..._0x2dea43,'userList':_0x2fc8f5}:_0x2dea43),_0x3f248b=_0x2fc8f5[_0x2db412(0x218)](_0x13e87d=>_0x13e87d[_0x2db412(0x23b)]),_0x1b6783={'operation':_0x56914a,'selector':{'appCode':_0x591ba5,'roleId':_0x434862,'roleName':_0x284fcf[_0x2db412(0x231)],'userId':_0x409229[_0x2db412(0x23b)]},'before':{'userIds':_0x1decc9},'after':{'userIds':_0x3f248b},'dryRun':_0xd878fe[_0x2db412(0x222)],'backend':{'method':_0x2db412(0x206),'path':UPDATE_USER_LIST_PATH},'warnings':_0x240989};return{'roleList':_0xb8321b,'mutation':_0x1b6783,'changed':_0xd385af};}export async function loadRoleUsers(_0x52dfa4){return listRoleUsers(_0x52dfa4);}export function readRoleRef(_0x385f88){const _0x388efc=a159_0x368088,_0x55709d=_0x385f88[_0x388efc(0x21a)]('role')['trim']();if(!_0x55709d)throw CliErrors[_0x388efc(0x219)](_0x388efc(0x22a),_0x388efc(0x1f1));return _0x55709d;}export async function prepareUserMutation(_0x587a44,_0x2facbb,_0xfef0b2){const _0x12b46d=a159_0x368088,_0x257501=readRoleRef(_0x587a44),_0xab5c11=_0x587a44[_0x12b46d(0x21a)](_0x12b46d(0x238))[_0x12b46d(0x204)]();if(!_0xab5c11)throw CliErrors[_0x12b46d(0x219)]('user','Pass\x20--user\x20<id|name>.');const _0x7fcf79=_0x587a44[_0x12b46d(0x228)](_0x12b46d(0x200)),_0x4e7f0d=_0x7fcf79===undefined||_0x7fcf79===null?undefined:Number(_0x7fcf79),_0x680f1a=await resolveRoleRef(_0x587a44[_0x12b46d(0x202)],_0x257501),_0x4ec160=await resolveUserRef(_0xab5c11),_0x37294d=await loadRoleUsers(_0x587a44[_0x12b46d(0x202)]);return computeRoleUserMutation({'operation':_0x2facbb,'appCode':_0x587a44[_0x12b46d(0x202)],'roleUsers':_0x37294d,'targetRoleId':_0x680f1a['id'],'user':{'userId':_0x4ec160[_0x12b46d(0x23b)],'username':_0x4ec160[_0x12b46d(0x1f3)],'nickname':_0x4ec160['nickname']},'dryRun':_0xfef0b2,..._0x4e7f0d!==undefined?{'expectUserCount':_0x4e7f0d}:{}});}
1
+ const a159_0x117748=a159_0xa3f7;(function(_0x4a79fe,_0xe6872b){const _0x28bbc4=a159_0xa3f7,_0x130f36=_0x4a79fe();while(!![]){try{const _0x5aa06c=-parseInt(_0x28bbc4(0x91))/0x1*(-parseInt(_0x28bbc4(0xa6))/0x2)+parseInt(_0x28bbc4(0x8d))/0x3*(parseInt(_0x28bbc4(0xbb))/0x4)+-parseInt(_0x28bbc4(0x90))/0x5+-parseInt(_0x28bbc4(0x80))/0x6*(-parseInt(_0x28bbc4(0xbf))/0x7)+parseInt(_0x28bbc4(0x9c))/0x8+-parseInt(_0x28bbc4(0x9b))/0x9*(-parseInt(_0x28bbc4(0x84))/0xa)+-parseInt(_0x28bbc4(0x96))/0xb;if(_0x5aa06c===_0xe6872b)break;else _0x130f36['push'](_0x130f36['shift']());}catch(_0x53e464){_0x130f36['push'](_0x130f36['shift']());}}}(a159_0xa201,0xbeb65));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':'number','required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};function a159_0xa3f7(_0x1ef433,_0x230a01){_0x1ef433=_0x1ef433-0x80;const _0xa201d2=a159_0xa201();let _0xa3f71b=_0xa201d2[_0x1ef433];return _0xa3f71b;}export const ROLE_REF_FLAG={'name':a159_0x117748(0xb5),'type':a159_0x117748(0xa5),'required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':'user','type':a159_0x117748(0xa5),'required':!![],'description':a159_0x117748(0x87)};export const NAME_FLAG={'name':a159_0x117748(0xb2),'type':'string','required':!![],'description':a159_0x117748(0x81)};export const USER_NAME_FLAG={'name':'name','type':a159_0x117748(0xa5),'required':!![],'description':a159_0x117748(0xa4)};export const REMARK_FLAG={'name':'remark','type':a159_0x117748(0xa5),'required':![],'description':a159_0x117748(0xa9)};export const EXPECT_USER_COUNT_FLAG={'name':a159_0x117748(0x9f),'type':a159_0x117748(0x9e),'required':![],'description':a159_0x117748(0xc9)};export const BUILTIN_ROLE_TYPES=[a159_0x117748(0x8a),'DEV','USER'];function a159_0xa201(){const _0x3896c2=['username','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Disambiguate\x20with\x20--role\x20<id>.','includes','push',';\x20no\x20change.','nickname','No\x20tenant\x20member\x20matches\x20\x22','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','splice','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x20member(s)\x20but\x20role\x20has\x20','Role\x20name\x20\x22','trim','userList','roleType','test','8907174myxCQu','Role\x20name','tenant','\x20not\x20found\x20in\x20app\x20','619270KlAKLy','expectUserCount','CUSTOM','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Anti-drift\x20check\x20failed:\x20expected\x20','User\x20','ADMIN','flagMissing','/smartapi/permit/user-role/update-user-list','267xlxuWL','str','Cannot\x20','3013280TLPajA','733297StPlez','Multiple\x20tenant\x20members\x20match\x20\x22','filter','dryRun','appCode','52571596CbYFap','\x20built-in\x20role\x20','user-add','flag','roleName','135PPrhMS','8071176tbCMMN','\x22:\x20','number','expect-user-count','\x22\x20is\x20ambiguous\x20(ids:\x20','map','Missing\x20role\x20reference.','DEV','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','string','4FomHBR','userId','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Optional\x20role\x20remark/description','\x20is\x20already\x20a\x20member\x20of\x20role\x20','userCount','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Pass\x20--role\x20<id|name>.','findIndex','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','toLowerCase','Pass\x20--user\x20<id|name>.','name','validation','length','role','Disambiguate\x20with\x20--user\x20<id>.','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Role\x20id\x20','Missing\x20user\x20reference.','POST','57264nGXHmU','join','user','find','7zOxlDO','authRequired'];a159_0xa201=function(){return _0x3896c2;};return a159_0xa201();}export function isBuiltinRole(_0xf4f569){return BUILTIN_ROLE_TYPES['includes'](_0xf4f569);}export function assertCustomRole(_0x438ab1,_0x255577){const _0x1a6838=a159_0x117748;if(_0x438ab1['roleType']!==_0x1a6838(0x86))throw CliErrors[_0x1a6838(0xb3)](_0x1a6838(0x8f)+_0x255577+_0x1a6838(0x97)+_0x438ab1[_0x1a6838(0x9a)]+'\x20('+_0x438ab1[_0x1a6838(0xd0)]+').',_0x1a6838(0xc2));}export function assertPermConfigurable(_0x124895){const _0x4a8d4b=a159_0x117748;if(_0x124895[_0x4a8d4b(0xd0)]===_0x4a8d4b(0xa3)||_0x124895['roleType']==='ADMIN')throw CliErrors[_0x4a8d4b(0xb3)]('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x124895[_0x4a8d4b(0x9a)]+'\x20('+_0x124895[_0x4a8d4b(0xd0)]+').','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.');}export function projectRole(_0x508ac8){const _0x5a7e86=a159_0x117748;return{'id':_0x508ac8['id'],'roleName':_0x508ac8[_0x5a7e86(0x9a)],'roleType':_0x508ac8['roleType'],'remark':_0x508ac8['remark'],'userCount':_0x508ac8[_0x5a7e86(0xab)],'permitCount':_0x508ac8['permitCount'],'builtin':isBuiltinRole(_0x508ac8[_0x5a7e86(0xd0)])};}export async function resolveRoleRef(_0x4976e8,_0x966cc2){const _0x11d436=a159_0x117748,_0x17f4c8=_0x966cc2[_0x11d436(0xce)]();if(!_0x17f4c8)throw CliErrors[_0x11d436(0xb3)](_0x11d436(0xa2),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x11d436(0xd1)](_0x17f4c8))return getRoleById(_0x4976e8,Number(_0x17f4c8));const _0x5ebe20=await listAllAppRoles(_0x4976e8),_0x223818=_0x5ebe20[_0x11d436(0x93)](_0x2411ab=>_0x2411ab[_0x11d436(0x9a)]===_0x17f4c8);if(_0x223818[_0x11d436(0xb4)]===0x0)throw CliErrors[_0x11d436(0xb3)](_0x11d436(0xcd)+_0x17f4c8+'\x22\x20not\x20found\x20in\x20app\x20'+_0x4976e8+'.',_0x11d436(0xaf));if(_0x223818[_0x11d436(0xb4)]>0x1){const _0x400249=_0x223818['map'](_0x26e64f=>_0x26e64f['id'])[_0x11d436(0xbc)](',\x20');throw CliErrors[_0x11d436(0xb3)](_0x11d436(0xcd)+_0x17f4c8+_0x11d436(0xa0)+_0x400249+').',_0x11d436(0xc3));}return _0x223818[0x0];}export async function getRoleById(_0x53da63,_0x2e4a03){const _0xc28b55=a159_0x117748,_0x215c4b=await getAppRole(_0x2e4a03);if(!_0x215c4b)throw CliErrors['validation'](_0xc28b55(0xb8)+_0x2e4a03+_0xc28b55(0x83)+_0x53da63+'.',_0xc28b55(0xa8));return _0x215c4b;}async function listAllAppRoles(_0x5b0886){const _0x3bb9d6=a159_0x117748,_0x5339ab=0x64,_0x5ca574=[];for(let _0x77319c=0x1;;_0x77319c+=0x1){const {items:_0xe0fc4f,paging:_0x416144}=await listAppRoles(_0x5b0886,{'currentPage':_0x77319c,'pageSize':_0x5339ab});_0x5ca574[_0x3bb9d6(0xc5)](..._0xe0fc4f);if(_0xe0fc4f[_0x3bb9d6(0xb4)]<_0x5339ab||_0x416144&&_0x5ca574[_0x3bb9d6(0xb4)]>=_0x416144['totalCount'])return _0x5ca574;}}export async function resolveTenantCode(){const _0x4d6762=a159_0x117748,_0x58dd37=await getSessionUserInfo(),_0x343917=_0x58dd37?.['user']?.[_0x4d6762(0x82)]?.['tenant_code'];if(!_0x343917)throw CliErrors[_0x4d6762(0xc0)](_0x4d6762(0xac));return _0x343917;}function matchMember(_0x363e97,_0x509b41){const _0x116afe=a159_0x117748,_0x94ebe1=_0x509b41['trim']()[_0x116afe(0xb0)]();return(_0x363e97['nickname']??'')[_0x116afe(0xb0)]()===_0x94ebe1||(_0x363e97[_0x116afe(0xc1)]??'')[_0x116afe(0xb0)]()===_0x94ebe1;}export async function resolveUserRef(_0x4b3563){const _0x462904=a159_0x117748,_0xdc658b=_0x4b3563[_0x462904(0xce)]();if(!_0xdc658b)throw CliErrors[_0x462904(0xb3)](_0x462904(0xb9),_0x462904(0xb1));const _0x4fb61d=await resolveTenantCode(),_0x34265a=await getTenantMembers(_0x4fb61d);if(/^\d+$/[_0x462904(0xd1)](_0xdc658b)){const _0x5c68ba=Number(_0xdc658b),_0x28f8b5=_0x34265a[_0x462904(0xbe)](_0x1f68c7=>_0x1f68c7[_0x462904(0xa7)]===_0x5c68ba);return{'userId':_0x5c68ba,'username':_0x28f8b5?.[_0x462904(0xc1)]??String(_0x5c68ba),'nickname':_0x28f8b5?.['nickname'],'matchedBy':'id'};}const _0x182bec=_0x34265a[_0x462904(0x93)](_0x25deaf=>matchMember(_0x25deaf,_0xdc658b));if(_0x182bec[_0x462904(0xb4)]===0x0)throw CliErrors[_0x462904(0xb3)](_0x462904(0xc8)+_0xdc658b+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x182bec[_0x462904(0xb4)]>0x1){const _0x146454=_0x182bec[_0x462904(0xa1)](_0x31a436=>(_0x31a436['nickname']??_0x31a436[_0x462904(0xc1)]??'?')+'('+_0x31a436['userId']+')')[_0x462904(0xbc)](',\x20');throw CliErrors[_0x462904(0xb3)](_0x462904(0x92)+_0xdc658b+_0x462904(0x9d)+_0x146454+'.',_0x462904(0xb6));}const _0x12462e=_0x182bec[0x0];return{'userId':_0x12462e[_0x462904(0xa7)],'username':_0x12462e['username']??String(_0x12462e[_0x462904(0xa7)]),'nickname':_0x12462e[_0x462904(0xc7)],'matchedBy':_0x462904(0xb2)};}export const UPDATE_USER_LIST_PATH=a159_0x117748(0x8c);function userIdsOf(_0x5e4c94){const _0x1ffa42=a159_0x117748;return(_0x5e4c94?.[_0x1ffa42(0xcf)]??[])[_0x1ffa42(0xa1)](_0x283297=>_0x283297[_0x1ffa42(0xa7)]);}export function computeRoleUserMutation(_0x3b5dac){const _0x5a9ed3=a159_0x117748,{operation:_0x5d2359,appCode:_0x1b98e7,roleUsers:_0x4cf3e8,targetRoleId:_0x2b1236,user:_0x1deed8}=_0x3b5dac,_0x287abb=_0x4cf3e8[_0x5a9ed3(0xbe)](_0x1954a6=>_0x1954a6['id']===_0x2b1236);if(!_0x287abb)throw CliErrors[_0x5a9ed3(0xb3)](_0x5a9ed3(0xb8)+_0x2b1236+_0x5a9ed3(0xb7),_0x5a9ed3(0xa8));const _0x1a0f75=userIdsOf(_0x287abb),_0x2378a5=[];if(_0x3b5dac[_0x5a9ed3(0x85)]!==undefined&&_0x3b5dac['expectUserCount']!==_0x1a0f75['length'])throw CliErrors['validation'](_0x5a9ed3(0x88)+_0x3b5dac[_0x5a9ed3(0x85)]+_0x5a9ed3(0xcc)+_0x1a0f75[_0x5a9ed3(0xb4)]+'.',_0x5a9ed3(0xcb));const _0x416d66=_0x1a0f75[_0x5a9ed3(0xc4)](_0x1deed8[_0x5a9ed3(0xa7)]);let _0x94150=![];const _0xec7841=[..._0x287abb[_0x5a9ed3(0xcf)]];if(_0x5d2359===_0x5a9ed3(0x98))_0x416d66?_0x2378a5[_0x5a9ed3(0xc5)]('User\x20'+_0x1deed8[_0x5a9ed3(0xa7)]+_0x5a9ed3(0xaa)+_0x287abb[_0x5a9ed3(0x9a)]+';\x20no\x20change.'):(_0xec7841[_0x5a9ed3(0xc5)]({'userId':_0x1deed8[_0x5a9ed3(0xa7)],'username':_0x1deed8[_0x5a9ed3(0xc1)],..._0x1deed8[_0x5a9ed3(0xc7)]?{'nickname':_0x1deed8[_0x5a9ed3(0xc7)]}:{}}),_0x94150=!![]);else{if(!_0x416d66)_0x2378a5[_0x5a9ed3(0xc5)](_0x5a9ed3(0x89)+_0x1deed8[_0x5a9ed3(0xa7)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x287abb[_0x5a9ed3(0x9a)]+_0x5a9ed3(0xc6));else{const _0x2fb23c=_0xec7841[_0x5a9ed3(0xae)](_0x44fa55=>_0x44fa55[_0x5a9ed3(0xa7)]===_0x1deed8['userId']);if(_0x2fb23c>=0x0)_0xec7841[_0x5a9ed3(0xca)](_0x2fb23c,0x1);_0x94150=!![];}}const _0x443d65=_0x4cf3e8[_0x5a9ed3(0xa1)](_0x4bd8d6=>_0x4bd8d6['id']===_0x2b1236?{..._0x4bd8d6,'userList':_0xec7841}:_0x4bd8d6),_0x2592da=_0xec7841[_0x5a9ed3(0xa1)](_0x4c27cf=>_0x4c27cf['userId']),_0xb27b4b={'operation':_0x5d2359,'selector':{'appCode':_0x1b98e7,'roleId':_0x2b1236,'roleName':_0x287abb['roleName'],'userId':_0x1deed8[_0x5a9ed3(0xa7)]},'before':{'userIds':_0x1a0f75},'after':{'userIds':_0x2592da},'dryRun':_0x3b5dac[_0x5a9ed3(0x94)],'backend':{'method':_0x5a9ed3(0xba),'path':UPDATE_USER_LIST_PATH},'warnings':_0x2378a5};return{'roleList':_0x443d65,'mutation':_0xb27b4b,'changed':_0x94150};}export async function loadRoleUsers(_0x85d9b9){return listRoleUsers(_0x85d9b9);}export function readRoleRef(_0x4d272b){const _0x5e64e4=a159_0x117748,_0x3feadb=_0x4d272b[_0x5e64e4(0x8e)](_0x5e64e4(0xb5))[_0x5e64e4(0xce)]();if(!_0x3feadb)throw CliErrors['flagMissing'](_0x5e64e4(0xb5),_0x5e64e4(0xad));return _0x3feadb;}export async function prepareUserMutation(_0xa83f04,_0x25acd8,_0x48f1f8){const _0x26f33b=a159_0x117748,_0x4c60d9=readRoleRef(_0xa83f04),_0x2ce28d=_0xa83f04[_0x26f33b(0x8e)](_0x26f33b(0xbd))[_0x26f33b(0xce)]();if(!_0x2ce28d)throw CliErrors[_0x26f33b(0x8b)](_0x26f33b(0xbd),_0x26f33b(0xb1));const _0x55fba6=_0xa83f04[_0x26f33b(0x99)](_0x26f33b(0x9f)),_0x3b6588=_0x55fba6===undefined||_0x55fba6===null?undefined:Number(_0x55fba6),_0x44ab47=await resolveRoleRef(_0xa83f04[_0x26f33b(0x95)],_0x4c60d9),_0x67c442=await resolveUserRef(_0x2ce28d),_0x39a63f=await loadRoleUsers(_0xa83f04['appCode']);return computeRoleUserMutation({'operation':_0x25acd8,'appCode':_0xa83f04[_0x26f33b(0x95)],'roleUsers':_0x39a63f,'targetRoleId':_0x44ab47['id'],'user':{'userId':_0x67c442[_0x26f33b(0xa7)],'username':_0x67c442[_0x26f33b(0xc1)],'nickname':_0x67c442[_0x26f33b(0xc7)]},'dryRun':_0x48f1f8,..._0x3b6588!==undefined?{'expectUserCount':_0x3b6588}:{}});}
@@ -1 +1 @@
1
- const a160_0x3a78ef=a160_0x2c29;function a160_0x2c29(_0x24e28c,_0x467c4f){_0x24e28c=_0x24e28c-0x1c8;const _0x5c7591=a160_0x5c75();let _0x2c29bd=_0x5c7591[_0x24e28c];return _0x2c29bd;}(function(_0x41db52,_0x399910){const _0x21ecf2=a160_0x2c29,_0x107287=_0x41db52();while(!![]){try{const _0x27cd44=parseInt(_0x21ecf2(0x1d5))/0x1*(-parseInt(_0x21ecf2(0x1d2))/0x2)+-parseInt(_0x21ecf2(0x1cb))/0x3+-parseInt(_0x21ecf2(0x1c8))/0x4+-parseInt(_0x21ecf2(0x1df))/0x5+-parseInt(_0x21ecf2(0x1d7))/0x6*(parseInt(_0x21ecf2(0x1ce))/0x7)+parseInt(_0x21ecf2(0x1ca))/0x8+parseInt(_0x21ecf2(0x1cf))/0x9;if(_0x27cd44===_0x399910)break;else _0x107287['push'](_0x107287['shift']());}catch(_0x5de101){_0x107287['push'](_0x107287['shift']());}}}(a160_0x5c75,0xa0c49));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a160_0x5c75(){const _0x36cb5e=['9103hfXybj','update','14172rTOfLD','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','POST','validation','appCode','\x20(id=','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','2977925KlPjtT','New\x20role\x20name','1121700owWdgz','roleName','306984peDIQD','2658483ryfBhD','name','num','2387BzyrsP','34506522nMTtmO','role','remark','142QOWjCX','--name\x20cannot\x20be\x20empty.','Updated\x20role\x20'];a160_0x5c75=function(){return _0x36cb5e;};return a160_0x5c75();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x3f4683){const _0x1951c6=a160_0x2c29,_0x5e06e8=_0x3f4683['flag']('name'),_0x3f1532=_0x3f4683['flag']('remark'),_0x1afb33={};if(_0x5e06e8!==undefined&&_0x5e06e8!==null){const _0x2eda80=String(_0x5e06e8)['trim']();if(!_0x2eda80)throw CliErrors[_0x1951c6(0x1da)](_0x1951c6(0x1d3));if(_0x2eda80['length']>0x40)throw CliErrors['validation'](_0x1951c6(0x1d8));_0x1afb33['roleName']=_0x2eda80;}_0x3f1532!==undefined&&_0x3f1532!==null&&(_0x1afb33[_0x1951c6(0x1d1)]=String(_0x3f1532));if(_0x1afb33[_0x1951c6(0x1c9)]===undefined&&_0x1afb33['remark']===undefined)throw CliErrors[_0x1951c6(0x1da)]('Nothing\x20to\x20update.',_0x1951c6(0x1de));return _0x1afb33;}export const roleUpdate={'service':a160_0x3a78ef(0x1d0),'command':'update','description':a160_0x3a78ef(0x1dd),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a160_0x3a78ef(0x1cc),'type':'string','required':![],'description':a160_0x3a78ef(0x1e0)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x356f38){readPatch(_0x356f38);},async 'dryRun'(_0x45c90d){const _0x2ec9a4=a160_0x3a78ef,_0x4dc072=_0x45c90d[_0x2ec9a4(0x1cd)]('id'),_0x2661ec=readPatch(_0x45c90d),_0x3ea537=await getRoleById(_0x45c90d[_0x2ec9a4(0x1db)],_0x4dc072);return assertCustomRole(_0x3ea537,'update'),asDryRunResult({'operation':_0x2ec9a4(0x1d6),'selector':{'appCode':_0x45c90d[_0x2ec9a4(0x1db)],'roleId':_0x4dc072,'roleName':_0x3ea537[_0x2ec9a4(0x1c9)]},'before':projectRole(_0x3ea537),'after':projectRole({..._0x3ea537,..._0x2661ec['roleName']!==undefined?{'roleName':_0x2661ec[_0x2ec9a4(0x1c9)]}:{},..._0x2661ec[_0x2ec9a4(0x1d1)]!==undefined?{'remark':_0x2661ec['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x2ec9a4(0x1d9),'path':UPDATE_PATH},'warnings':[]},{'method':_0x2ec9a4(0x1d9),'url':UPDATE_PATH});},async 'execute'(_0x321159){const _0x34ee8f=a160_0x3a78ef,_0x4261ce=_0x321159['num']('id'),_0x28d975=readPatch(_0x321159),_0x4cdf6a=await getRoleById(_0x321159[_0x34ee8f(0x1db)],_0x4261ce);assertCustomRole(_0x4cdf6a,_0x34ee8f(0x1d6)),await updateAppRole({'id':_0x4261ce,'appCode':_0x321159['appCode'],..._0x28d975[_0x34ee8f(0x1c9)]!==undefined?{'roleName':_0x28d975[_0x34ee8f(0x1c9)]}:{},..._0x28d975[_0x34ee8f(0x1d1)]!==undefined?{'remark':_0x28d975[_0x34ee8f(0x1d1)]}:{}});const _0x3d5b3e=await getRoleById(_0x321159['appCode'],_0x4261ce);return{'ok':!![],'data':{'operation':_0x34ee8f(0x1d6),'selector':{'appCode':_0x321159[_0x34ee8f(0x1db)],'roleId':_0x4261ce,'roleName':_0x3d5b3e[_0x34ee8f(0x1c9)]},'before':projectRole(_0x4cdf6a),'after':projectRole(_0x3d5b3e),'dryRun':![],'backend':{'method':_0x34ee8f(0x1d9),'path':UPDATE_PATH},'warnings':[]},'message':_0x34ee8f(0x1d4)+_0x3d5b3e[_0x34ee8f(0x1c9)]+_0x34ee8f(0x1dc)+_0x4261ce+')'};}};
1
+ function a160_0x2744(_0x43f307,_0x564bed){_0x43f307=_0x43f307-0x120;const _0x62f850=a160_0x62f8();let _0x27445f=_0x62f850[_0x43f307];return _0x27445f;}const a160_0x2f68de=a160_0x2744;(function(_0x164ab0,_0x4cbb3d){const _0x2e65af=a160_0x2744,_0x1c7630=_0x164ab0();while(!![]){try{const _0xadad7d=-parseInt(_0x2e65af(0x121))/0x1*(parseInt(_0x2e65af(0x138))/0x2)+-parseInt(_0x2e65af(0x12c))/0x3+-parseInt(_0x2e65af(0x139))/0x4*(-parseInt(_0x2e65af(0x137))/0x5)+parseInt(_0x2e65af(0x127))/0x6*(-parseInt(_0x2e65af(0x12f))/0x7)+parseInt(_0x2e65af(0x128))/0x8+-parseInt(_0x2e65af(0x130))/0x9+parseInt(_0x2e65af(0x136))/0xa;if(_0xadad7d===_0x4cbb3d)break;else _0x1c7630['push'](_0x1c7630['shift']());}catch(_0x23c14f){_0x1c7630['push'](_0x1c7630['shift']());}}}(a160_0x62f8,0xde759));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a160_0x62f8(){const _0x1453ef=['flag','1603EQAvXU','2148579EALPDr','roleName','Updated\x20role\x20','/smartapi/permit/role/update','remark','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','18567660DlOQZp','1797595dEinPQ','4mAlhpW','4hLPXgg','num','Nothing\x20to\x20update.','New\x20role\x20name','role','update','--name\x20cannot\x20be\x20empty.','13630EaQxVt','POST','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','appCode','validation','\x20(id=','28716qUxeME','14032056jEICKo','name','string','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','5091342VLVtNZ','length'];a160_0x62f8=function(){return _0x1453ef;};return a160_0x62f8();}const UPDATE_PATH=a160_0x2f68de(0x133);function readPatch(_0x289d32){const _0x5c3be0=a160_0x2f68de,_0x3cd3d1=_0x289d32[_0x5c3be0(0x12e)](_0x5c3be0(0x129)),_0x541e95=_0x289d32[_0x5c3be0(0x12e)](_0x5c3be0(0x134)),_0x1d3ac2={};if(_0x3cd3d1!==undefined&&_0x3cd3d1!==null){const _0x241734=String(_0x3cd3d1)['trim']();if(!_0x241734)throw CliErrors[_0x5c3be0(0x125)](_0x5c3be0(0x120));if(_0x241734[_0x5c3be0(0x12d)]>0x40)throw CliErrors[_0x5c3be0(0x125)](_0x5c3be0(0x135));_0x1d3ac2['roleName']=_0x241734;}_0x541e95!==undefined&&_0x541e95!==null&&(_0x1d3ac2[_0x5c3be0(0x134)]=String(_0x541e95));if(_0x1d3ac2[_0x5c3be0(0x131)]===undefined&&_0x1d3ac2[_0x5c3be0(0x134)]===undefined)throw CliErrors['validation'](_0x5c3be0(0x13b),_0x5c3be0(0x12b));return _0x1d3ac2;}export const roleUpdate={'service':a160_0x2f68de(0x13d),'command':'update','description':a160_0x2f68de(0x123),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a160_0x2f68de(0x129),'type':a160_0x2f68de(0x12a),'required':![],'description':a160_0x2f68de(0x13c)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x49ff98){readPatch(_0x49ff98);},async 'dryRun'(_0x58c491){const _0x5450c0=a160_0x2f68de,_0x268c20=_0x58c491[_0x5450c0(0x13a)]('id'),_0x21f37c=readPatch(_0x58c491),_0x5dc3d1=await getRoleById(_0x58c491[_0x5450c0(0x124)],_0x268c20);return assertCustomRole(_0x5dc3d1,_0x5450c0(0x13e)),asDryRunResult({'operation':_0x5450c0(0x13e),'selector':{'appCode':_0x58c491[_0x5450c0(0x124)],'roleId':_0x268c20,'roleName':_0x5dc3d1[_0x5450c0(0x131)]},'before':projectRole(_0x5dc3d1),'after':projectRole({..._0x5dc3d1,..._0x21f37c[_0x5450c0(0x131)]!==undefined?{'roleName':_0x21f37c['roleName']}:{},..._0x21f37c['remark']!==undefined?{'remark':_0x21f37c[_0x5450c0(0x134)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x5450c0(0x122),'url':UPDATE_PATH});},async 'execute'(_0x153902){const _0x278c21=a160_0x2f68de,_0x288445=_0x153902[_0x278c21(0x13a)]('id'),_0x3d28b6=readPatch(_0x153902),_0x1ee0e2=await getRoleById(_0x153902[_0x278c21(0x124)],_0x288445);assertCustomRole(_0x1ee0e2,'update'),await updateAppRole({'id':_0x288445,'appCode':_0x153902['appCode'],..._0x3d28b6[_0x278c21(0x131)]!==undefined?{'roleName':_0x3d28b6[_0x278c21(0x131)]}:{},..._0x3d28b6[_0x278c21(0x134)]!==undefined?{'remark':_0x3d28b6[_0x278c21(0x134)]}:{}});const _0x368e40=await getRoleById(_0x153902[_0x278c21(0x124)],_0x288445);return{'ok':!![],'data':{'operation':'update','selector':{'appCode':_0x153902[_0x278c21(0x124)],'roleId':_0x288445,'roleName':_0x368e40['roleName']},'before':projectRole(_0x1ee0e2),'after':projectRole(_0x368e40),'dryRun':![],'backend':{'method':_0x278c21(0x122),'path':UPDATE_PATH},'warnings':[]},'message':_0x278c21(0x132)+_0x368e40[_0x278c21(0x131)]+_0x278c21(0x126)+_0x288445+')'};}};
@@ -1 +1 @@
1
- const a161_0x4c0d0a=a161_0x1cbc;(function(_0x574a58,_0x36bde2){const _0x502220=a161_0x1cbc,_0x2d22dc=_0x574a58();while(!![]){try{const _0x24623a=-parseInt(_0x502220(0x154))/0x1*(parseInt(_0x502220(0x148))/0x2)+-parseInt(_0x502220(0x14f))/0x3*(-parseInt(_0x502220(0x142))/0x4)+-parseInt(_0x502220(0x149))/0x5*(-parseInt(_0x502220(0x144))/0x6)+-parseInt(_0x502220(0x153))/0x7*(-parseInt(_0x502220(0x151))/0x8)+-parseInt(_0x502220(0x145))/0x9+parseInt(_0x502220(0x146))/0xa*(parseInt(_0x502220(0x147))/0xb)+-parseInt(_0x502220(0x14a))/0xc;if(_0x24623a===_0x36bde2)break;else _0x2d22dc['push'](_0x2d22dc['shift']());}catch(_0x5a9382){_0x2d22dc['push'](_0x2d22dc['shift']());}}}(a161_0x2c24,0x49387));function a161_0x1cbc(_0x794599,_0x38b871){_0x794599=_0x794599-0x141;const _0x2c2425=a161_0x2c24();let _0x1cbcad=_0x2c2425[_0x794599];return _0x1cbcad;}import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':'role','command':a161_0x4c0d0a(0x152),'description':a161_0x4c0d0a(0x14c),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3d9260){const _0x1decab=a161_0x4c0d0a,{mutation:_0x911b43}=await prepareUserMutation(_0x3d9260,_0x1decab(0x152),!![]);return asDryRunResult(_0x911b43,{'method':_0x1decab(0x14d),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0xf52a0e){const _0x1d94ab=a161_0x4c0d0a,{roleList:_0x4dfbfb,mutation:_0x337b79,changed:_0x1f4b49}=await prepareUserMutation(_0xf52a0e,_0x1d94ab(0x152),![]);return _0x1f4b49&&await updateRoleUsers(_0xf52a0e[_0x1d94ab(0x150)],_0x4dfbfb),{'ok':!![],'data':_0x337b79,'message':_0x1f4b49?_0x1d94ab(0x143)+_0x337b79['selector']['userId']+_0x1d94ab(0x157)+_0x337b79[_0x1d94ab(0x14b)]['roleName']:_0x1d94ab(0x155)+_0x337b79[_0x1d94ab(0x14b)][_0x1d94ab(0x14e)]+_0x1d94ab(0x156)+_0x337b79[_0x1d94ab(0x14b)][_0x1d94ab(0x141)]};}};function a161_0x2c24(){const _0x4a6691=['57849PvyKKf','37798FerRuk','5ImalKv','1068420xHqePN','selector','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','POST','userId','9RNbsIl','appCode','88WhqSQV','user-add','98623fFYaeZ','16egufez','No\x20change:\x20user\x20','\x20already\x20in\x20role\x20','\x20to\x20role\x20','roleName','104564jNRREb','Added\x20user\x20','628014BfYFUo','843804HOjuJr','850qoXARG'];a161_0x2c24=function(){return _0x4a6691;};return a161_0x2c24();}
1
+ const a161_0xd5c4fb=a161_0x598d;(function(_0x30555d,_0x207669){const _0xd00d3d=a161_0x598d,_0x16b0f0=_0x30555d();while(!![]){try{const _0x1cea7d=-parseInt(_0xd00d3d(0x137))/0x1*(-parseInt(_0xd00d3d(0x127))/0x2)+-parseInt(_0xd00d3d(0x133))/0x3+-parseInt(_0xd00d3d(0x13c))/0x4+-parseInt(_0xd00d3d(0x136))/0x5+parseInt(_0xd00d3d(0x129))/0x6*(-parseInt(_0xd00d3d(0x13a))/0x7)+parseInt(_0xd00d3d(0x139))/0x8*(-parseInt(_0xd00d3d(0x134))/0x9)+parseInt(_0xd00d3d(0x12f))/0xa;if(_0x1cea7d===_0x207669)break;else _0x16b0f0['push'](_0x16b0f0['shift']());}catch(_0x200771){_0x16b0f0['push'](_0x16b0f0['shift']());}}}(a161_0x5e75,0x458ea));import{updateRoleUsers}from'../../core/api-client.js';function a161_0x5e75(){const _0x1d5286=['572106BHhUcj','user-add','high-risk-write','role','No\x20change:\x20user\x20','selector','18103020zJvoCs','appCode','roleName','\x20already\x20in\x20role\x20','1607139ZZbEyx','42759EpVOGb','userId','920065BcsmJb','844fLjQCG','\x20to\x20role\x20','808QDFttQ','7zkGerp','POST','1333744vziXlm','244cPYKov','Added\x20user\x20'];a161_0x5e75=function(){return _0x1d5286;};return a161_0x5e75();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a161_0x598d(_0x2a4aae,_0x181a0f){_0x2a4aae=_0x2a4aae-0x127;const _0x5e752d=a161_0x5e75();let _0x598da4=_0x5e752d[_0x2a4aae];return _0x598da4;}export const roleUserAdd={'service':a161_0xd5c4fb(0x12c),'command':a161_0xd5c4fb(0x12a),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a161_0xd5c4fb(0x12b),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3fb647){const _0x1f82ea=a161_0xd5c4fb,{mutation:_0x4a34b2}=await prepareUserMutation(_0x3fb647,_0x1f82ea(0x12a),!![]);return asDryRunResult(_0x4a34b2,{'method':_0x1f82ea(0x13b),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x32032c){const _0x55e2f3=a161_0xd5c4fb,{roleList:_0x484a0e,mutation:_0x228a68,changed:_0x5414bf}=await prepareUserMutation(_0x32032c,_0x55e2f3(0x12a),![]);return _0x5414bf&&await updateRoleUsers(_0x32032c[_0x55e2f3(0x130)],_0x484a0e),{'ok':!![],'data':_0x228a68,'message':_0x5414bf?_0x55e2f3(0x128)+_0x228a68['selector'][_0x55e2f3(0x135)]+_0x55e2f3(0x138)+_0x228a68[_0x55e2f3(0x12e)]['roleName']:_0x55e2f3(0x12d)+_0x228a68[_0x55e2f3(0x12e)][_0x55e2f3(0x135)]+_0x55e2f3(0x132)+_0x228a68[_0x55e2f3(0x12e)][_0x55e2f3(0x131)]};}};
@@ -1 +1 @@
1
- const a162_0x28af7e=a162_0x428d;(function(_0x2e0bca,_0x37f855){const _0x97ca72=a162_0x428d,_0x4ec60a=_0x2e0bca();while(!![]){try{const _0x52a0fd=-parseInt(_0x97ca72(0x15c))/0x1+-parseInt(_0x97ca72(0x15b))/0x2+parseInt(_0x97ca72(0x158))/0x3*(-parseInt(_0x97ca72(0x156))/0x4)+-parseInt(_0x97ca72(0x153))/0x5*(-parseInt(_0x97ca72(0x159))/0x6)+-parseInt(_0x97ca72(0x151))/0x7*(-parseInt(_0x97ca72(0x14a))/0x8)+-parseInt(_0x97ca72(0x157))/0x9*(-parseInt(_0x97ca72(0x154))/0xa)+parseInt(_0x97ca72(0x149))/0xb;if(_0x52a0fd===_0x37f855)break;else _0x4ec60a['push'](_0x4ec60a['shift']());}catch(_0x62b07a){_0x4ec60a['push'](_0x4ec60a['shift']());}}}(a162_0x45ac,0x9d9e9));function a162_0x428d(_0x26ccf8,_0x5a8ac5){_0x26ccf8=_0x26ccf8-0x149;const _0x45ac08=a162_0x45ac();let _0x428d4c=_0x45ac08[_0x26ccf8];return _0x428d4c;}import{updateRoleUsers}from'../../core/api-client.js';function a162_0x45ac(){const _0x37b807=['role','1623288bSJcRm','1249005vAAKPZ','appCode','user-remove','23055142HQGprV','8loWzCe','userId','roleName','\x20not\x20in\x20role\x20','\x20from\x20role\x20','No\x20change:\x20user\x20','Removed\x20user\x20','3455053Esxxow','high-risk-write','12205fnTiGk','222490iKboyS','selector','536yoLKxX','36IDjXZf','1947gzyyxq','282MCIjvv'];a162_0x45ac=function(){return _0x37b807;};return a162_0x45ac();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a162_0x28af7e(0x15a),'command':a162_0x28af7e(0x15e),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a162_0x28af7e(0x152),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2bfd4d){const _0x4bade7=a162_0x28af7e,{mutation:_0x1efd8b}=await prepareUserMutation(_0x2bfd4d,_0x4bade7(0x15e),!![]);return asDryRunResult(_0x1efd8b,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x2a8002){const _0x5cca92=a162_0x28af7e,{roleList:_0x9bde3b,mutation:_0xda91de,changed:_0x3c7c36}=await prepareUserMutation(_0x2a8002,'user-remove',![]);return _0x3c7c36&&await updateRoleUsers(_0x2a8002[_0x5cca92(0x15d)],_0x9bde3b),{'ok':!![],'data':_0xda91de,'message':_0x3c7c36?_0x5cca92(0x150)+_0xda91de[_0x5cca92(0x155)][_0x5cca92(0x14b)]+_0x5cca92(0x14e)+_0xda91de['selector'][_0x5cca92(0x14c)]:_0x5cca92(0x14f)+_0xda91de[_0x5cca92(0x155)][_0x5cca92(0x14b)]+_0x5cca92(0x14d)+_0xda91de[_0x5cca92(0x155)][_0x5cca92(0x14c)]};}};
1
+ const a162_0x21210d=a162_0x4d4b;(function(_0x7d3ad1,_0xba3bd3){const _0x1008da=a162_0x4d4b,_0x4df9ac=_0x7d3ad1();while(!![]){try{const _0x5d155f=-parseInt(_0x1008da(0x1a2))/0x1*(parseInt(_0x1008da(0x196))/0x2)+-parseInt(_0x1008da(0x199))/0x3+-parseInt(_0x1008da(0x19a))/0x4*(parseInt(_0x1008da(0x18f))/0x5)+parseInt(_0x1008da(0x194))/0x6+-parseInt(_0x1008da(0x18e))/0x7+-parseInt(_0x1008da(0x19b))/0x8+-parseInt(_0x1008da(0x19d))/0x9*(-parseInt(_0x1008da(0x191))/0xa);if(_0x5d155f===_0xba3bd3)break;else _0x4df9ac['push'](_0x4df9ac['shift']());}catch(_0x4e9e3e){_0x4df9ac['push'](_0x4df9ac['shift']());}}}(a162_0xc189,0x98f3c));function a162_0x4d4b(_0x1158a2,_0x26d179){_0x1158a2=_0x1158a2-0x18d;const _0xc189dc=a162_0xc189();let _0x4d4b34=_0xc189dc[_0x1158a2];return _0x4d4b34;}import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a162_0x21210d(0x19c),'command':a162_0x21210d(0x1a1),'description':a162_0x21210d(0x19e),'risk':a162_0x21210d(0x1a0),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x553874){const _0x2c3b04=a162_0x21210d,{mutation:_0x15b2ff}=await prepareUserMutation(_0x553874,_0x2c3b04(0x1a1),!![]);return asDryRunResult(_0x15b2ff,{'method':_0x2c3b04(0x18d),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x3e912a){const _0x3bb419=a162_0x21210d,{roleList:_0x8ccbdf,mutation:_0x42a3d6,changed:_0x1f7688}=await prepareUserMutation(_0x3e912a,_0x3bb419(0x1a1),![]);return _0x1f7688&&await updateRoleUsers(_0x3e912a[_0x3bb419(0x195)],_0x8ccbdf),{'ok':!![],'data':_0x42a3d6,'message':_0x1f7688?_0x3bb419(0x197)+_0x42a3d6[_0x3bb419(0x192)]['userId']+_0x3bb419(0x190)+_0x42a3d6[_0x3bb419(0x192)][_0x3bb419(0x19f)]:_0x3bb419(0x198)+_0x42a3d6['selector']['userId']+_0x3bb419(0x193)+_0x42a3d6['selector']['roleName']};}};function a162_0xc189(){const _0x547c79=['31143483vSozNm','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','roleName','high-risk-write','user-remove','58187YUNLXr','POST','3452407Oyxngj','125390LqaWqu','\x20from\x20role\x20','10rbDhPP','selector','\x20not\x20in\x20role\x20','1400208TWPBMa','appCode','36CwLrqX','Removed\x20user\x20','No\x20change:\x20user\x20','1137495jFpzgR','136YhKSOi','2359032RMACVU','role'];a162_0xc189=function(){return _0x547c79;};return a162_0xc189();}
@@ -1 +1 @@
1
- const a163_0x581f23=a163_0x2449;function a163_0x2449(_0x33445a,_0x4f5dd6){_0x33445a=_0x33445a-0x170;const _0x344cc6=a163_0x344c();let _0x2449c5=_0x344cc6[_0x33445a];return _0x2449c5;}(function(_0x1cc47e,_0x532d45){const _0x35e599=a163_0x2449,_0x230ade=_0x1cc47e();while(!![]){try{const _0x2dbdaa=-parseInt(_0x35e599(0x186))/0x1+-parseInt(_0x35e599(0x175))/0x2+-parseInt(_0x35e599(0x173))/0x3*(parseInt(_0x35e599(0x17f))/0x4)+-parseInt(_0x35e599(0x183))/0x5+parseInt(_0x35e599(0x181))/0x6*(-parseInt(_0x35e599(0x170))/0x7)+parseInt(_0x35e599(0x176))/0x8+-parseInt(_0x35e599(0x179))/0x9*(-parseInt(_0x35e599(0x184))/0xa);if(_0x2dbdaa===_0x532d45)break;else _0x230ade['push'](_0x230ade['shift']());}catch(_0x528c04){_0x230ade['push'](_0x230ade['shift']());}}}(a163_0x344c,0x3bc24));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a163_0x581f23(0x17b),'description':a163_0x581f23(0x178),'risk':a163_0x581f23(0x17c),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x525b5a){const _0x51440b=a163_0x581f23;if(!_0x525b5a[_0x51440b(0x174)](_0x51440b(0x17a))[_0x51440b(0x182)]())throw CliErrors[_0x51440b(0x171)]('name',_0x51440b(0x17d));},async 'execute'(_0x5a461c){const _0xb6410d=a163_0x581f23,_0x369cfe=_0x5a461c['str']('name')[_0xb6410d(0x182)](),_0x18f282=await resolveUserRef(_0x369cfe);return{'ok':!![],'data':{'user':{'userId':_0x18f282['userId'],'username':_0x18f282[_0xb6410d(0x185)],'nickname':_0x18f282['nickname'],'matchedBy':_0x18f282[_0xb6410d(0x180)]}},'message':_0xb6410d(0x172)+_0x369cfe+_0xb6410d(0x17e)+_0x18f282[_0xb6410d(0x177)]};}};function a163_0x344c(){const _0x29f0d2=['read','Pass\x20--name\x20<nickname|username>.','\x22\x20→\x20userId\x20','1730348CHVCOW','matchedBy','1149180KfSLTr','trim','1663025DBKOkx','11919410DGLlTZ','username','19802zmGgVO','7tFLIBT','flagMissing','Resolved\x20\x22','3sYjtza','str','492530KovoqV','2204960AEUcyK','userId','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','9QgRUga','name','user-resolve'];a163_0x344c=function(){return _0x29f0d2;};return a163_0x344c();}
1
+ const a163_0x34741b=a163_0x36c2;(function(_0x28140f,_0x33d51e){const _0x373f99=a163_0x36c2,_0x5569a7=_0x28140f();while(!![]){try{const _0x4c2b64=parseInt(_0x373f99(0x93))/0x1+parseInt(_0x373f99(0x7e))/0x2+parseInt(_0x373f99(0x8b))/0x3+parseInt(_0x373f99(0x90))/0x4+parseInt(_0x373f99(0x81))/0x5*(-parseInt(_0x373f99(0x8f))/0x6)+-parseInt(_0x373f99(0x7f))/0x7+parseInt(_0x373f99(0x92))/0x8*(-parseInt(_0x373f99(0x8a))/0x9);if(_0x4c2b64===_0x33d51e)break;else _0x5569a7['push'](_0x5569a7['shift']());}catch(_0x2a5fa4){_0x5569a7['push'](_0x5569a7['shift']());}}}(a163_0x4c61,0x649e3));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a163_0x36c2(_0x186714,_0x557305){_0x186714=_0x186714-0x7e;const _0x4c6130=a163_0x4c61();let _0x36c2d5=_0x4c6130[_0x186714];return _0x36c2d5;}export const roleUserResolve={'service':a163_0x34741b(0x86),'command':a163_0x34741b(0x8c),'description':a163_0x34741b(0x84),'risk':a163_0x34741b(0x8d),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1b8248){const _0x55e10a=a163_0x34741b;if(!_0x1b8248[_0x55e10a(0x80)](_0x55e10a(0x88))[_0x55e10a(0x83)]())throw CliErrors[_0x55e10a(0x87)](_0x55e10a(0x88),_0x55e10a(0x91));},async 'execute'(_0x5b297e){const _0x1e263f=a163_0x34741b,_0x3f8482=_0x5b297e['str'](_0x1e263f(0x88))['trim'](),_0x2c746c=await resolveUserRef(_0x3f8482);return{'ok':!![],'data':{'user':{'userId':_0x2c746c[_0x1e263f(0x85)],'username':_0x2c746c[_0x1e263f(0x82)],'nickname':_0x2c746c[_0x1e263f(0x8e)],'matchedBy':_0x2c746c[_0x1e263f(0x89)]}},'message':'Resolved\x20\x22'+_0x3f8482+'\x22\x20→\x20userId\x20'+_0x2c746c[_0x1e263f(0x85)]};}};function a163_0x4c61(){const _0x4f9b64=['name','matchedBy','33039UMPnoV','1843089ssCkRu','user-resolve','read','nickname','2946pnZMVH','693276txMSNF','Pass\x20--name\x20<nickname|username>.','1928ufzPKJ','593839Huyexc','1118974yVJovS','4340749GdkyOj','str','245DEmnkm','username','trim','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','userId','role','flagMissing'];a163_0x4c61=function(){return _0x4f9b64;};return a163_0x4c61();}