@lovrabet/rabetbase-cli 2.3.13-beta.1 → 2.3.13-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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(_0x81b30b,_0x47411e){const _0x5f0f76=a151_0x1c6b,_0x523589=_0x81b30b();while(!![]){try{const _0xf95d3c=parseInt(_0x5f0f76(0x8e))/0x1+parseInt(_0x5f0f76(0x9a))/0x2*(parseInt(_0x5f0f76(0x95))/0x3)+-parseInt(_0x5f0f76(0x93))/0x4*(-parseInt(_0x5f0f76(0x96))/0x5)+parseInt(_0x5f0f76(0x76))/0x6+parseInt(_0x5f0f76(0x90))/0x7*(-parseInt(_0x5f0f76(0x77))/0x8)+parseInt(_0x5f0f76(0x6d))/0x9+-parseInt(_0x5f0f76(0x9d))/0xa*(parseInt(_0x5f0f76(0x78))/0xb);if(_0xf95d3c===_0x47411e)break;else _0x523589['push'](_0x523589['shift']());}catch(_0x331b5a){_0x523589['push'](_0x523589['shift']());}}}(a151_0x7ddf,0x74805));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a151_0x34e171 from'chalk';function a151_0x7ddf(){const _0xf9a2da=['\x20\x20appcode:\x20','Please\x20enter\x20App\x20Code:','160tHJRCU','✓\x20Upgraded\x20','init','package.json','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','1238661SFHrox','.rabetbase.json','\x20\x20Apps:\x20','bold','env','utf8','Invalid\x20App\x20Code','log','cwd','777282XVRGJv','818744nblGVz','499664gyvpjs','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','gray','app','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','cyan','parse','从旧配置文件升级成功','string','1.0.0','production','\x20workspace\x20init`\x20to\x20start\x20fresh.','yellow','appcode','version','\x20→\x20.rabetbase.json','初始化项目配置文件成功','\x20\x20Default:\x20','join','keys','../..','.bak','954359dhhTfy','info','42dDYErj','App\x20Code\x20cannot\x20be\x20empty','trim','615164InlFnE','green','433371cgzuzH','10nzkLSP','setLogPath','apps','toLocaleString','4GDuaOQ'];a151_0x7ddf=function(){return _0xf9a2da;};return a151_0x7ddf();}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';function a151_0x1c6b(_0xbd4948,_0x42a55b){_0xbd4948=_0xbd4948-0x6a;const _0x7ddf74=a151_0x7ddf();let _0x1c6b3a=_0x7ddf74[_0xbd4948];return _0x1c6b3a;}import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x463907){const _0x48c51c=a151_0x1c6b,{appcode:_0x39938c,env:_0x5408ac,autoYes:_0x38e041}=_0x463907,_0x5d646c=process[_0x48c51c(0x75)]();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x1973c6;for(const _0x3f5afc of LEGACY_CONFIG_NAMES){const _0x3324d7=resolve(_0x5d646c,_0x3f5afc);if(existsSync(_0x3324d7)){_0x1973c6=_0x3324d7;break;}}if(_0x1973c6){let _0x2033c8={};try{_0x2033c8=JSON[_0x48c51c(0x7e)](readFileSync(_0x1973c6,_0x48c51c(0x72)));}catch{}const _0x572857=basename(_0x1973c6),_0x2adb1d=_0x2033c8?.[_0x48c51c(0x85)]||_0x2033c8?.[_0x48c51c(0x7b)];let _0x1f54ec=_0x38e041;!_0x38e041&&(console[_0x48c51c(0x74)](a151_0x34e171[_0x48c51c(0x84)](_0x48c51c(0x7c)+a151_0x34e171[_0x48c51c(0x70)](_0x572857))),_0x2adb1d&&console['log'](a151_0x34e171[_0x48c51c(0x7d)](_0x48c51c(0x9b)+_0x2adb1d)),_0x1f54ec=await confirm({'message':'Upgrade\x20it\x20to\x20'+a151_0x34e171[_0x48c51c(0x70)](_0x48c51c(0x6e))+'?\x20(Old\x20file\x20→\x20*.bak)','default':!![]}));if(!_0x1f54ec){console[_0x48c51c(0x74)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x48c51c(0x83));return;}const _0xf91e78=resolve(_0x5d646c,NEW_CONFIG_NAME),_0x45c950=getCliVersionFromPkg(),_0x4896d8=readRawConfig(),_0x544e6d=_0x39938c||(typeof _0x2033c8?.[_0x48c51c(0x85)]===_0x48c51c(0x80)?_0x2033c8['appcode']:undefined)||(typeof _0x2033c8?.[_0x48c51c(0x7b)]===_0x48c51c(0x80)?_0x2033c8[_0x48c51c(0x7b)]:undefined)||await askAppcode(),_0xd4415b=typeof _0x2033c8?.[_0x48c51c(0x71)]===_0x48c51c(0x80)?_0x2033c8['env']:typeof _0x4896d8[_0x48c51c(0x71)]===_0x48c51c(0x80)?_0x4896d8['env']:_0x48c51c(0x82),_0x1ec51f=buildCanonicalProjectConfig({..._0x4896d8,..._0x2033c8},{'appCodes':[_0x544e6d],'env':_0xd4415b,'metadata':{'version':_0x45c950,'migratedAt':new Date()[_0x48c51c(0x99)](),'migratedFrom':_0x1973c6}});writeConfigFile(_0xf91e78,_0x1ec51f);const _0x2c0d4b=_0x1973c6+_0x48c51c(0x8d);renameSync(_0x1973c6,_0x2c0d4b),logger[_0x48c51c(0x97)](_0x5d646c),logger['info'](_0x48c51c(0x9f),_0x48c51c(0x7f),{'from':_0x1973c6,'to':_0xf91e78,'appcode':_0x544e6d,'env':_0x1ec51f[_0x48c51c(0x71)]}),console[_0x48c51c(0x74)](a151_0x34e171[_0x48c51c(0x94)](_0x48c51c(0x9e)+_0x572857+_0x48c51c(0x87))),console[_0x48c51c(0x74)](a151_0x34e171['cyan'](_0x48c51c(0x6f)+Object['keys'](_0x1ec51f[_0x48c51c(0x98)]||{})[_0x48c51c(0x8a)](',\x20'))),console[_0x48c51c(0x74)](a151_0x34e171[_0x48c51c(0x7d)](_0x48c51c(0x89)+_0x1ec51f['defaultApp'])),console['log'](a151_0x34e171[_0x48c51c(0x7a)](_0x48c51c(0x79)+_0x572857+'.bak'));return;}const _0x189c68=_0x39938c||await askAppcode(),_0x37dc2b=resolve(_0x5d646c,NEW_CONFIG_NAME),_0x3371ef=getCliVersionFromPkg(),_0x557bd4=readRawConfig(),_0x504ba5=typeof _0x557bd4[_0x48c51c(0x71)]===_0x48c51c(0x80)?_0x557bd4[_0x48c51c(0x71)]:undefined,_0x34075e=buildCanonicalProjectConfig({},{'appCodes':[_0x189c68],'env':_0x5408ac||_0x504ba5||_0x48c51c(0x82),'metadata':{'version':_0x3371ef,'createdAt':new Date()['toLocaleString']()}});writeConfigFile(_0x37dc2b,_0x34075e),logger[_0x48c51c(0x97)](_0x5d646c),logger[_0x48c51c(0x8f)]('init',_0x48c51c(0x88),{'appcode':_0x189c68,'env':_0x34075e[_0x48c51c(0x71)],'version':_0x34075e['version'],'configPath':_0x37dc2b}),console[_0x48c51c(0x74)](a151_0x34e171[_0x48c51c(0x94)](_0x48c51c(0x6c))),console[_0x48c51c(0x74)](a151_0x34e171['cyan'](_0x48c51c(0x6f)+Object[_0x48c51c(0x8b)](_0x34075e['apps']||{})['join'](',\x20'))),console['log'](a151_0x34e171['cyan'](_0x48c51c(0x89)+_0x34075e['defaultApp'])),console[_0x48c51c(0x74)](_0x48c51c(0x6b)+CLI_BIN_NAME+'\x20api\x20generate\x27\x20and\x20\x27'+CLI_BIN_NAME+'\x20api\x20pull\x27');}function askAppcode(){const _0x515fa1=a151_0x1c6b;return input({'message':_0x515fa1(0x9c),'validate':_0x2ad74a=>{const _0x62d85a=_0x515fa1;if(!_0x2ad74a[_0x62d85a(0x92)]())return _0x62d85a(0x91);const {valid:_0x358056,message:_0x4fe9c1}=validateAppcode(_0x2ad74a['trim']());return _0x358056||_0x4fe9c1||_0x62d85a(0x73);}});}function getCliVersionFromPkg(){const _0x5d9f03=a151_0x1c6b;try{const _0x5e4afd=fileURLToPath(import.meta.url),_0x2917f5=resolve(dirname(_0x5e4afd),_0x5d9f03(0x8c)),_0x47c8be=JSON[_0x5d9f03(0x7e)](readFileSync(resolve(_0x2917f5,_0x5d9f03(0x6a)),_0x5d9f03(0x72)));return _0x47c8be[_0x5d9f03(0x86)]||_0x5d9f03(0x81);}catch{return'1.0.0';}}
1
+ (function(_0x3da65a,_0x46c9d4){const _0x48c13d=a151_0x2e2b,_0x4b7caf=_0x3da65a();while(!![]){try{const _0x184c52=parseInt(_0x48c13d(0xbd))/0x1+parseInt(_0x48c13d(0xba))/0x2*(-parseInt(_0x48c13d(0xa8))/0x3)+-parseInt(_0x48c13d(0xbc))/0x4+-parseInt(_0x48c13d(0xbe))/0x5+parseInt(_0x48c13d(0xb6))/0x6*(parseInt(_0x48c13d(0x9f))/0x7)+-parseInt(_0x48c13d(0x99))/0x8*(parseInt(_0x48c13d(0xa2))/0x9)+-parseInt(_0x48c13d(0xca))/0xa*(-parseInt(_0x48c13d(0x98))/0xb);if(_0x184c52===_0x46c9d4)break;else _0x4b7caf['push'](_0x4b7caf['shift']());}catch(_0x1fb717){_0x4b7caf['push'](_0x4b7caf['shift']());}}}(a151_0x3646,0xc7cc8));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a151_0x34f7fc from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';function a151_0x2e2b(_0x50a2c0,_0x4012d0){_0x50a2c0=_0x50a2c0-0x98;const _0x364694=a151_0x3646();let _0x2e2b80=_0x364694[_0x50a2c0];return _0x2e2b80;}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';function a151_0x3646(){const _0x4b6fbe=['string','cyan','.bak','147282Qermiu','.rabetbase.json','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','join','2ihYUui','appcode','6418780BYHOrp','267158CAjVwH','6946060lxToMK','Migration\x20cancelled.\x20Run\x20`','utf8','trim','\x20\x20appcode:\x20','env','Please\x20enter\x20App\x20Code:','?\x20(Old\x20file\x20→\x20*.bak)','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','\x20workspace\x20init`\x20to\x20start\x20fresh.','init','App\x20Code\x20cannot\x20be\x20empty','10560510qCzYll','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','55sksMKS','8179064uLeiOb','1.0.0','log','green','keys','Invalid\x20App\x20Code','259hcKRPI','info','Upgrade\x20it\x20to\x20','9rkJJmH','yellow','version','setLogPath','\x20\x20Apps:\x20','parse','4862958wIOdTh','\x20→\x20.rabetbase.json','apps','✓\x20Upgraded\x20','package.json','gray','\x20\x20Default:\x20','toLocaleString','app','cwd','production'];a151_0x3646=function(){return _0x4b6fbe;};return a151_0x3646();}export async function initConfig(_0x570849){const _0x55c44b=a151_0x2e2b,{appcode:_0x153fef,env:_0x1b8cf6,autoYes:_0x1e319d}=_0x570849,_0x2108c8=process[_0x55c44b(0xb1)]();if(getProjectConfigPath())throw new Error(_0x55c44b(0xb8));let _0x1b3708;for(const _0x3aab01 of LEGACY_CONFIG_NAMES){const _0x2f1e5b=resolve(_0x2108c8,_0x3aab01);if(existsSync(_0x2f1e5b)){_0x1b3708=_0x2f1e5b;break;}}if(_0x1b3708){let _0x2aa5b1={};try{_0x2aa5b1=JSON[_0x55c44b(0xa7)](readFileSync(_0x1b3708,_0x55c44b(0xc0)));}catch{}const _0x904083=basename(_0x1b3708),_0x28c81e=_0x2aa5b1?.[_0x55c44b(0xbb)]||_0x2aa5b1?.['app'];let _0x324bed=_0x1e319d;!_0x1e319d&&(console[_0x55c44b(0x9b)](a151_0x34f7fc[_0x55c44b(0xa3)](_0x55c44b(0xcb)+a151_0x34f7fc['bold'](_0x904083))),_0x28c81e&&console[_0x55c44b(0x9b)](a151_0x34f7fc[_0x55c44b(0xb4)](_0x55c44b(0xc2)+_0x28c81e)),_0x324bed=await confirm({'message':_0x55c44b(0xa1)+a151_0x34f7fc['bold'](_0x55c44b(0xb7))+_0x55c44b(0xc5),'default':!![]}));if(!_0x324bed){console['log'](_0x55c44b(0xbf)+CLI_BIN_NAME+_0x55c44b(0xc7));return;}const _0x17bed5=resolve(_0x2108c8,NEW_CONFIG_NAME),_0x474ca8=getCliVersionFromPkg(),_0x23b43e=readRawConfig(),_0x20a4b8=_0x153fef||(typeof _0x2aa5b1?.[_0x55c44b(0xbb)]===_0x55c44b(0xb3)?_0x2aa5b1[_0x55c44b(0xbb)]:undefined)||(typeof _0x2aa5b1?.[_0x55c44b(0xb0)]==='string'?_0x2aa5b1[_0x55c44b(0xb0)]:undefined)||await askAppcode(),_0xb8f4eb=typeof _0x2aa5b1?.[_0x55c44b(0xc3)]===_0x55c44b(0xb3)?_0x2aa5b1[_0x55c44b(0xc3)]:typeof _0x23b43e[_0x55c44b(0xc3)]===_0x55c44b(0xb3)?_0x23b43e[_0x55c44b(0xc3)]:'production',_0x227202=buildCanonicalProjectConfig({..._0x23b43e,..._0x2aa5b1},{'appCodes':[_0x20a4b8],'env':_0xb8f4eb,'metadata':{'version':_0x474ca8,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0x1b3708}});writeConfigFile(_0x17bed5,_0x227202);const _0xe05498=_0x1b3708+_0x55c44b(0xb5);renameSync(_0x1b3708,_0xe05498),logger[_0x55c44b(0xa5)](_0x2108c8),logger[_0x55c44b(0xa0)]('init','从旧配置文件升级成功',{'from':_0x1b3708,'to':_0x17bed5,'appcode':_0x20a4b8,'env':_0x227202[_0x55c44b(0xc3)]}),console[_0x55c44b(0x9b)](a151_0x34f7fc[_0x55c44b(0x9c)](_0x55c44b(0xab)+_0x904083+_0x55c44b(0xa9))),console[_0x55c44b(0x9b)](a151_0x34f7fc[_0x55c44b(0xb4)]('\x20\x20Apps:\x20'+Object[_0x55c44b(0x9d)](_0x227202[_0x55c44b(0xaa)]||{})[_0x55c44b(0xb9)](',\x20'))),console[_0x55c44b(0x9b)](a151_0x34f7fc[_0x55c44b(0xb4)](_0x55c44b(0xae)+_0x227202['defaultApp'])),console[_0x55c44b(0x9b)](a151_0x34f7fc[_0x55c44b(0xad)]('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0x904083+_0x55c44b(0xb5)));return;}const _0x5e443b=_0x153fef||await askAppcode(),_0x4b15ca=resolve(_0x2108c8,NEW_CONFIG_NAME),_0x5bca1b=getCliVersionFromPkg(),_0x53b699=readRawConfig(),_0x55f16e=typeof _0x53b699[_0x55c44b(0xc3)]===_0x55c44b(0xb3)?_0x53b699[_0x55c44b(0xc3)]:undefined,_0x137169=buildCanonicalProjectConfig({},{'appCodes':[_0x5e443b],'env':_0x1b8cf6||_0x55f16e||_0x55c44b(0xb2),'metadata':{'version':_0x5bca1b,'createdAt':new Date()[_0x55c44b(0xaf)]()}});writeConfigFile(_0x4b15ca,_0x137169),logger[_0x55c44b(0xa5)](_0x2108c8),logger[_0x55c44b(0xa0)](_0x55c44b(0xc8),'初始化项目配置文件成功',{'appcode':_0x5e443b,'env':_0x137169['env'],'version':_0x137169[_0x55c44b(0xa4)],'configPath':_0x4b15ca}),console['log'](a151_0x34f7fc[_0x55c44b(0x9c)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console[_0x55c44b(0x9b)](a151_0x34f7fc[_0x55c44b(0xb4)](_0x55c44b(0xa6)+Object[_0x55c44b(0x9d)](_0x137169[_0x55c44b(0xaa)]||{})[_0x55c44b(0xb9)](',\x20'))),console[_0x55c44b(0x9b)](a151_0x34f7fc[_0x55c44b(0xb4)](_0x55c44b(0xae)+_0x137169['defaultApp'])),console[_0x55c44b(0x9b)](_0x55c44b(0xc6)+CLI_BIN_NAME+'\x20api\x20generate\x27\x20and\x20\x27'+CLI_BIN_NAME+'\x20api\x20pull\x27');}function askAppcode(){const _0x4587e1=a151_0x2e2b;return input({'message':_0x4587e1(0xc4),'validate':_0x243d5c=>{const _0xb123ab=_0x4587e1;if(!_0x243d5c[_0xb123ab(0xc1)]())return _0xb123ab(0xc9);const {valid:_0xfac906,message:_0x156616}=validateAppcode(_0x243d5c[_0xb123ab(0xc1)]());return _0xfac906||_0x156616||_0xb123ab(0x9e);}});}function getCliVersionFromPkg(){const _0x41491f=a151_0x2e2b;try{const _0x535290=fileURLToPath(import.meta.url),_0x1371ed=resolve(dirname(_0x535290),'../..'),_0x3f5f00=JSON[_0x41491f(0xa7)](readFileSync(resolve(_0x1371ed,_0x41491f(0xac)),'utf8'));return _0x3f5f00['version']||_0x41491f(0x9a);}catch{return _0x41491f(0x9a);}}
@@ -1 +1 @@
1
- const a152_0x3299d8=a152_0x26b3;(function(_0x19c70d,_0x3f81ea){const _0x25ac30=a152_0x26b3,_0x48d72c=_0x19c70d();while(!![]){try{const _0x4c699d=-parseInt(_0x25ac30(0x178))/0x1*(parseInt(_0x25ac30(0x174))/0x2)+-parseInt(_0x25ac30(0x138))/0x3*(parseInt(_0x25ac30(0x154))/0x4)+-parseInt(_0x25ac30(0x145))/0x5+parseInt(_0x25ac30(0x162))/0x6+parseInt(_0x25ac30(0x18b))/0x7+-parseInt(_0x25ac30(0x13f))/0x8+parseInt(_0x25ac30(0x133))/0x9;if(_0x4c699d===_0x3f81ea)break;else _0x48d72c['push'](_0x48d72c['shift']());}catch(_0x4e1454){_0x48d72c['push'](_0x48d72c['shift']());}}}(a152_0x39ff,0xaa51d));import a152_0x252ba0 from'chalk';function a152_0x26b3(_0xb7a06b,_0x1ece20){_0xb7a06b=_0xb7a06b-0x133;const _0x39ff2c=a152_0x39ff();let _0x26b3ba=_0x39ff2c[_0xb7a06b];return _0x26b3ba;}function a152_0x39ff(){const _0x40d934=['fail','status','path','latest','skipped','@lovrabet/sdk','7320488ZBoJIV','succeed','configMigration','devDependencies','keys','undefined','3972515OIbuJZ','\x20→\x20','log','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','bold','detail','error','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','.lovrabet','stringify','Upgrade\x20@lovrabet/sdk','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','sdkUpgrade','===\x20Upgrade\x20Analysis\x20===','join','236iKrvJw','done','yellow','needsSkillSwap','fields','gray','.claude/skills/lovrabet','info','no\x20legacy\x20entry','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','\x20\x20New\x20config\x20(.rabetbase.json):\x20','args','Install\x20new\x20skill','Upgrade\x20completed\x20successfully!','7280538ouJGNg','red','message','failed','utf8','Step\x201/7:\x20Migrating\x20config...','length','not\x20found\x20(will\x20create)','MCP\x20config:','\x20\x20#\x20or','.cursor/rules/lovrabet_rules.mdc','package.json','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','oldMcpConfig','\x20\x20Fields\x20to\x20migrate:\x20','string','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','Remove\x20old\x20skill','1726958gXKYMl','hasNewConfig','parse','entries','1UrkTer','cyan','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','Remove\x20legacy\x20artifacts','oldArtifacts','[\x22@lovrabet/sdk\x22]:\x20','white','.cursor/mcp.json','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','FOUND','\x20→\x20keys:\x20','filter','Config\x20migration','CANCEL','@lovrabet/sdk:','mcpServers','includes','removed\x20','isDirectory','9126551nLiIbY','some','no\x20matching\x20entry\x20found','Legacy\x20artifacts:','\x20\x20\x20\x20\x20\x20\x20','\x20from\x20','exit\x20','start','values','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','\x20\x20bun\x20install','oldPath','inherit','push','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','dependencies','Clean\x20MCP\x20config','\x20removed','Step\x206/7:\x20Installing\x20new\x20skill...','\x20\x20npm\x20install','files','yes','Remove\x20.lovrabet/','Step\x204/7:\x20Cleaning\x20MCP\x20config...','green','skipped\x20(no\x20legacy\x20config)','needed','Step\x204/7:\x20MCP\x20config\x20—\x20','\x20\x20Step\x20','object','Proceed\x20with\x20upgrade?','\x20(backup:\x20','@lovrabet/dataset-mcp-server','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','label','15562782GDcLfD','\x20\x20Current\x20version\x20in\x20','already\x20exists\x20(will\x20merge)','Step\x201/7:\x20Config\x20migration\x20—\x20','isArray','49614OJxguh'];a152_0x39ff=function(){return _0x40d934;};return a152_0x39ff();}import a152_0xf3a2d9 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_0x3299d8(0x183)](_0x5ee006=>_0x5ee006!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x1b0320){const _0x2b21de=a152_0x3299d8,_0x53258d=[];for(const _0x3a7f2c of Object[_0x2b21de(0x193)](CORE_IDE_CONFIGS)){if(_0x3a7f2c[_0x2b21de(0x19f)])for(const _0x38ec1a of _0x3a7f2c[_0x2b21de(0x19f)]){_0x53258d['push'](resolve(_0x1b0320,_0x38ec1a[_0x2b21de(0x13b)]));}}return _0x53258d;}function analyse(_0x290886){const _0x2e16df=a152_0x3299d8;let _0x4da4dc=null;const _0x3c6b23=resolve(_0x290886,NEW_CONFIG_NAME),_0x56565f=existsSync(_0x3c6b23);for(const _0x1fd528 of LEGACY_CONFIG_NAMES){const _0x2de2d4=resolve(_0x290886,_0x1fd528);if(existsSync(_0x2de2d4)){const _0x243da4=readConfigFile(_0x2de2d4),_0x3c9a4c=Object[_0x2e16df(0x143)](_0x243da4)['filter'](_0x20a20a=>typeof _0x243da4[_0x20a20a]!==_0x2e16df(0x144));_0x4da4dc={'oldPath':_0x2de2d4,'hasNewConfig':_0x56565f,'fields':_0x3c9a4c};break;}}const _0x4cd57f=[],_0x3b1de2=resolve(_0x290886,'.lovrabet');if(existsSync(_0x3b1de2))_0x4cd57f['push'](_0x3b1de2);const _0x93a97d=resolve(_0x290886,_0x2e16df(0x16c));if(existsSync(_0x93a97d))_0x4cd57f[_0x2e16df(0x198)](_0x93a97d);const _0x3170e0=resolve(_0x290886,_0x2e16df(0x15a));if(existsSync(_0x3170e0))_0x4cd57f[_0x2e16df(0x198)](_0x3170e0);for(const _0x16d23a of collectIdeSkillFiles(_0x290886)){if(existsSync(_0x16d23a))_0x4cd57f[_0x2e16df(0x198)](_0x16d23a);}let _0x42f1dd=null;const _0xab7900=resolve(_0x290886,_0x2e16df(0x17f));if(existsSync(_0xab7900))try{const _0x21eb21=JSON[_0x2e16df(0x176)](readFileSync(_0xab7900,'utf8'));if(_0x21eb21?.[_0x2e16df(0x187)]&&typeof _0x21eb21[_0x2e16df(0x187)]==='object'){const _0x27904e=[];for(const [_0x540483,_0x4438f6]of Object[_0x2e16df(0x177)](_0x21eb21[_0x2e16df(0x187)])){const _0x4aedc7=_0x4438f6;_0x4aedc7?.['args']&&Array['isArray'](_0x4aedc7[_0x2e16df(0x15f)])&&_0x4aedc7[_0x2e16df(0x15f)][_0x2e16df(0x18c)](_0x491be8=>typeof _0x491be8===_0x2e16df(0x171)&&_0x491be8[_0x2e16df(0x188)](_0x2e16df(0x1ab)))&&_0x27904e[_0x2e16df(0x198)](_0x540483);}_0x27904e[_0x2e16df(0x168)]>0x0&&(_0x42f1dd={'path':_0xab7900,'keys':_0x27904e});}}catch{}const _0x445eac=_0x4cd57f[_0x2e16df(0x168)]>0x0||_0x4da4dc!==null;let _0x504e58=null;const _0x56787e=resolve(_0x290886,_0x2e16df(0x16d));if(existsSync(_0x56787e))try{const _0xd06727=JSON[_0x2e16df(0x176)](readFileSync(_0x56787e,_0x2e16df(0x166)));for(const _0x4d1921 of[_0x2e16df(0x19a),_0x2e16df(0x142)]){const _0x1b8b83=_0xd06727?.[_0x4d1921]?.[_0x2e16df(0x13e)];if(typeof _0x1b8b83===_0x2e16df(0x171)){_0x1b8b83!==_0x2e16df(0x13c)&&(_0x504e58={'pkgPath':_0x56787e,'currentVersion':_0x1b8b83,'field':_0x4d1921});break;}}}catch{}return{'configMigration':_0x4da4dc,'oldArtifacts':_0x4cd57f,'oldMcpConfig':_0x42f1dd,'needsSkillSwap':_0x445eac,'sdkUpgrade':_0x504e58};}function printReport(_0x474388){const _0x1c57c6=a152_0x3299d8,{configMigration:_0x45a76c,oldArtifacts:_0x592eb8,oldMcpConfig:_0x2c74f1,needsSkillSwap:_0x35c0eb}=_0x474388;console[_0x1c57c6(0x147)](''),console['log'](a152_0x252ba0['bold'](_0x1c57c6(0x152))),console[_0x1c57c6(0x147)]('');_0x45a76c?(console['log'](a152_0x252ba0[_0x1c57c6(0x179)]('Config\x20file:')+('\x20\x20'+a152_0x252ba0[_0x1c57c6(0x156)](_0x45a76c[_0x1c57c6(0x196)]))),console['log'](_0x1c57c6(0x15e)+(_0x45a76c[_0x1c57c6(0x175)]?a152_0x252ba0['green'](_0x1c57c6(0x135)):a152_0x252ba0[_0x1c57c6(0x159)](_0x1c57c6(0x169)))),console[_0x1c57c6(0x147)](_0x1c57c6(0x170)+_0x45a76c[_0x1c57c6(0x158)]['join'](',\x20')),console[_0x1c57c6(0x147)](_0x1c57c6(0x1ac))):console['log'](a152_0x252ba0[_0x1c57c6(0x179)]('Config\x20file:')+'\x20\x20'+a152_0x252ba0[_0x1c57c6(0x159)]('no\x20legacy\x20config\x20found'));console[_0x1c57c6(0x147)]('');if(_0x592eb8['length']>0x0){console[_0x1c57c6(0x147)](a152_0x252ba0[_0x1c57c6(0x179)](_0x1c57c6(0x18e)));for(const _0x219bf9 of _0x592eb8){console[_0x1c57c6(0x147)]('\x20\x20'+a152_0x252ba0[_0x1c57c6(0x163)](_0x1c57c6(0x181))+'\x20\x20'+_0x219bf9);}console[_0x1c57c6(0x147)]('\x20\x20Action:\x20delete');}else console['log'](a152_0x252ba0['cyan']('Legacy\x20artifacts:')+'\x20\x20'+a152_0x252ba0[_0x1c57c6(0x159)]('none\x20found'));console[_0x1c57c6(0x147)]('');_0x2c74f1?(console[_0x1c57c6(0x147)](a152_0x252ba0[_0x1c57c6(0x179)](_0x1c57c6(0x16a))+('\x20\x20'+a152_0x252ba0['yellow'](_0x2c74f1['path'])+_0x1c57c6(0x182)+_0x2c74f1[_0x1c57c6(0x143)][_0x1c57c6(0x153)](',\x20'))),console[_0x1c57c6(0x147)](_0x1c57c6(0x14c))):console[_0x1c57c6(0x147)](a152_0x252ba0[_0x1c57c6(0x179)](_0x1c57c6(0x16a))+'\x20\x20'+a152_0x252ba0['gray'](_0x1c57c6(0x15c)));console[_0x1c57c6(0x147)](''),console['log'](a152_0x252ba0[_0x1c57c6(0x179)]('Skill\x20swap:')+('\x20\x20'+(_0x35c0eb?a152_0x252ba0['yellow'](_0x1c57c6(0x1a5)):a152_0x252ba0[_0x1c57c6(0x1a3)]('not\x20needed'))));_0x35c0eb&&console[_0x1c57c6(0x147)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x1c57c6(0x147)]('');if(_0x474388[_0x1c57c6(0x151)]){const {currentVersion:_0x552415,field:_0x4020c8,pkgPath:_0x185cb2}=_0x474388[_0x1c57c6(0x151)];console['log'](a152_0x252ba0[_0x1c57c6(0x179)](_0x1c57c6(0x186))+('\x20\x20'+a152_0x252ba0[_0x1c57c6(0x156)](_0x185cb2))),console[_0x1c57c6(0x147)](_0x1c57c6(0x134)+_0x4020c8+':\x20'+a152_0x252ba0[_0x1c57c6(0x156)](_0x552415)+_0x1c57c6(0x146)+a152_0x252ba0[_0x1c57c6(0x1a3)](_0x1c57c6(0x13c))),console[_0x1c57c6(0x147)](_0x1c57c6(0x1ad));}else console[_0x1c57c6(0x147)](a152_0x252ba0[_0x1c57c6(0x179)](_0x1c57c6(0x186))+'\x20\x20'+a152_0x252ba0['gray']('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x1c57c6(0x147)]('');}function execConfigMigration(_0x4d9126,_0x380a9b){const _0x3d5bc6=a152_0x3299d8,{configMigration:_0x56391f}=_0x4d9126;if(!_0x56391f?.[_0x3d5bc6(0x196)])return{'step':0x1,'label':_0x3d5bc6(0x184),'ok':!![],'detail':_0x3d5bc6(0x1a4)};const _0x36936a=readConfigFile(_0x56391f[_0x3d5bc6(0x196)]),_0x1095b9=resolve(_0x380a9b,NEW_CONFIG_NAME),_0x234cfb=_0x56391f[_0x3d5bc6(0x175)]?readConfigFile(_0x1095b9):{};for(const [_0x1232b8,_0x28c857]of Object[_0x3d5bc6(0x177)](_0x36936a)){!(_0x1232b8 in _0x234cfb)&&(_0x234cfb[_0x1232b8]=_0x28c857);}writeConfigFile(_0x1095b9,_0x234cfb);const _0x508d95=_0x56391f[_0x3d5bc6(0x196)]+'.bak';return renameSync(_0x56391f[_0x3d5bc6(0x196)],_0x508d95),{'step':0x1,'label':_0x3d5bc6(0x184),'ok':!![],'detail':_0x56391f[_0x3d5bc6(0x196)]+_0x3d5bc6(0x146)+_0x1095b9+_0x3d5bc6(0x1aa)+_0x508d95+')'};}function execRemoveOldArtifacts(_0x32fa24){const _0x58061f=a152_0x3299d8,_0x4169d3=[];for(const _0x4ae31c of _0x32fa24){try{if(!existsSync(_0x4ae31c))continue;const _0x272510=tryStat(_0x4ae31c);_0x272510?.[_0x58061f(0x18a)]()?rmSync(_0x4ae31c,{'recursive':!![],'force':!![]}):unlinkSync(_0x4ae31c);}catch(_0x54b688){_0x4169d3[_0x58061f(0x198)](_0x4ae31c+':\x20'+_0x54b688[_0x58061f(0x164)]);}}return{'step':0x3,'label':_0x58061f(0x17b),'ok':_0x4169d3[_0x58061f(0x168)]===0x0,'detail':_0x4169d3[_0x58061f(0x168)]>0x0?_0x32fa24['length']-_0x4169d3[_0x58061f(0x168)]+'/'+_0x32fa24[_0x58061f(0x168)]+'\x20removed\x20('+_0x4169d3['join'](';\x20')+')':_0x32fa24['length']+_0x58061f(0x19c)};}function execCleanMcp(_0x3715ae){const _0x243351=a152_0x3299d8;if(!_0x3715ae[_0x243351(0x16f)])return{'step':0x4,'label':_0x243351(0x19b),'ok':!![],'detail':_0x243351(0x13d)};try{const _0x5bef97=readFileSync(_0x3715ae[_0x243351(0x16f)][_0x243351(0x13b)],'utf8'),_0x271281=JSON['parse'](_0x5bef97);if(_0x271281?.[_0x243351(0x187)]&&typeof _0x271281['mcpServers']===_0x243351(0x1a8)){const _0x43df64=[];for(const [_0x2fcfe8,_0x114d1d]of Object['entries'](_0x271281[_0x243351(0x187)])){_0x114d1d?.[_0x243351(0x15f)]&&Array[_0x243351(0x137)](_0x114d1d[_0x243351(0x15f)])&&_0x114d1d[_0x243351(0x15f)]['some'](_0x431aa8=>typeof _0x431aa8===_0x243351(0x171)&&_0x431aa8[_0x243351(0x188)](_0x243351(0x1ab)))&&_0x43df64[_0x243351(0x198)](_0x2fcfe8);}for(const _0x2e7851 of _0x43df64){delete _0x271281[_0x243351(0x187)][_0x2e7851];}return _0x43df64[_0x243351(0x168)]>0x0&&writeFileSync(_0x3715ae['oldMcpConfig'][_0x243351(0x13b)],JSON[_0x243351(0x14e)](_0x271281,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0x243351(0x19b),'ok':!![],'detail':_0x243351(0x189)+_0x43df64[_0x243351(0x153)](',\x20')+_0x243351(0x190)+_0x3715ae['oldMcpConfig'][_0x243351(0x13b)]};}return{'step':0x4,'label':_0x243351(0x19b),'ok':!![],'detail':_0x243351(0x18d)};}catch(_0xf833c){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0xf833c['message']};}}function execSkillsRemove(_0x34140b,_0x4e7391){const _0x4d24b7=a152_0x3299d8,_0x556029=runNpxSkillsRemove(_0x34140b,{'stdio':_0x4d24b7(0x197),'yes':_0x4e7391});return{'step':0x5,'label':_0x4d24b7(0x173),'ok':_0x556029['ok'],'detail':_0x556029['ok']?'lovrabet/lovrabet-skill\x20removed':_0x556029[_0x4d24b7(0x14b)]??_0x4d24b7(0x191)+_0x556029[_0x4d24b7(0x13a)]};}function execSkillsAdd(_0x4c9c29,_0x4243dc){const _0x44d0c9=a152_0x3299d8,_0x1ce1f0=runNpxSkillsAddGlobal(_0x4c9c29,'lovrabet/rabetbase',{'stdio':_0x44d0c9(0x197),'yes':_0x4243dc});return{'step':0x6,'label':_0x44d0c9(0x160),'ok':_0x1ce1f0['ok'],'detail':_0x1ce1f0['ok']?'lovrabet/rabetbase\x20installed\x20globally':_0x1ce1f0[_0x44d0c9(0x14b)]??_0x44d0c9(0x191)+_0x1ce1f0[_0x44d0c9(0x13a)]};}function execUpgradeSdk(_0x3976f8){const _0x4bf1f3=a152_0x3299d8;if(!_0x3976f8['sdkUpgrade'])return{'step':0x7,'label':_0x4bf1f3(0x14f),'ok':!![],'detail':_0x4bf1f3(0x150)};const {pkgPath:_0x340243,currentVersion:_0x36f834,field:_0x35e956}=_0x3976f8[_0x4bf1f3(0x151)];try{const _0x22c429=readFileSync(_0x340243,_0x4bf1f3(0x166)),_0x367f15=JSON[_0x4bf1f3(0x176)](_0x22c429);return _0x367f15[_0x35e956][_0x4bf1f3(0x13e)]=_0x4bf1f3(0x13c),writeFileSync(_0x340243,JSON[_0x4bf1f3(0x14e)](_0x367f15,null,0x2)+'\x0a','utf8'),{'step':0x7,'label':_0x4bf1f3(0x14f),'ok':!![],'detail':_0x35e956+_0x4bf1f3(0x17d)+_0x36f834+'\x20→\x20latest'};}catch(_0x3801be){return{'step':0x7,'label':_0x4bf1f3(0x14f),'ok':![],'detail':_0x3801be[_0x4bf1f3(0x164)]};}}function tryStat(_0x280902){try{return statSync(_0x280902);}catch{return undefined;}}function printSummary(_0x5b9bf6){const _0x420920=a152_0x3299d8;console[_0x420920(0x147)](''),console[_0x420920(0x147)](a152_0x252ba0[_0x420920(0x149)]('===\x20Upgrade\x20Summary\x20===')),console[_0x420920(0x147)]('');for(const _0x369418 of _0x5b9bf6){const _0x8eb70b=_0x369418['ok']?a152_0x252ba0[_0x420920(0x1a3)]('OK'):a152_0x252ba0[_0x420920(0x163)]('FAIL');console['log']('\x20\x20'+_0x8eb70b+_0x420920(0x1a7)+_0x369418['step']+':\x20'+_0x369418[_0x420920(0x1ae)]);if(_0x369418[_0x420920(0x14a)])console[_0x420920(0x147)](_0x420920(0x18f)+a152_0x252ba0[_0x420920(0x159)](_0x369418[_0x420920(0x14a)]));}console[_0x420920(0x147)]('');}export async function upgradeApp(_0xbf4a7e,_0x56c18f){const _0x4436c7=a152_0x3299d8,_0x1194a4=process['cwd'](),_0x485497=analyse(_0x1194a4),_0x124f6d=!_0x485497[_0x4436c7(0x141)]&&_0x485497[_0x4436c7(0x17c)]['length']===0x0&&!_0x485497[_0x4436c7(0x16f)]&&!_0x485497[_0x4436c7(0x157)]&&!_0x485497[_0x4436c7(0x151)];if(_0x124f6d){console[_0x4436c7(0x147)](a152_0x252ba0[_0x4436c7(0x1a3)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x485497);const _0x11ba5a=!!(_0x56c18f[_0x4436c7(0x1a0)]||_0x56c18f['Y']||_0xbf4a7e);if(!_0x11ba5a)try{const _0x5e5a11=await askConfirm(_0x4436c7(0x1a9));if(!_0x5e5a11){console[_0x4436c7(0x147)](a152_0x252ba0[_0x4436c7(0x159)]('Upgrade\x20cancelled.'));return;}}catch(_0x35d505){if(_0x35d505?.[_0x4436c7(0x164)]===_0x4436c7(0x185)){console[_0x4436c7(0x147)](a152_0x252ba0[_0x4436c7(0x159)]('Upgrade\x20cancelled.'));return;}throw _0x35d505;}const _0x38d8a1=[],_0xf8d1dc=a152_0xf3a2d9({'text':_0x4436c7(0x167),'color':'cyan'})[_0x4436c7(0x192)](),_0x28be13=execConfigMigration(_0x485497,_0x1194a4);_0x38d8a1[_0x4436c7(0x198)](_0x28be13),_0xf8d1dc[_0x28be13['ok']?_0x4436c7(0x140):_0x4436c7(0x139)](_0x4436c7(0x136)+(_0x28be13[_0x4436c7(0x14a)]??(_0x28be13['ok']?_0x4436c7(0x155):'failed')));const _0x5cae55=resolve(_0x1194a4,_0x4436c7(0x14d)),_0x63e82c=a152_0xf3a2d9({'text':_0x4436c7(0x148),'color':_0x4436c7(0x179)})[_0x4436c7(0x192)]();if(existsSync(_0x5cae55))try{rmSync(_0x5cae55,{'recursive':!![],'force':!![]}),_0x63e82c[_0x4436c7(0x140)](_0x4436c7(0x172)),_0x38d8a1[_0x4436c7(0x198)]({'step':0x2,'label':_0x4436c7(0x1a1),'ok':!![]});}catch(_0x2ef9f3){_0x63e82c[_0x4436c7(0x139)]('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x2ef9f3['message']),_0x38d8a1[_0x4436c7(0x198)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x2ef9f3[_0x4436c7(0x164)]});}else _0x63e82c[_0x4436c7(0x15b)](_0x4436c7(0x15d)),_0x38d8a1['push']({'step':0x2,'label':_0x4436c7(0x1a1),'ok':!![],'detail':_0x4436c7(0x13d)});const _0x20224e=a152_0xf3a2d9({'text':_0x4436c7(0x194),'color':_0x4436c7(0x179)})['start'](),_0x37ab11=execRemoveOldArtifacts(_0x485497[_0x4436c7(0x17c)]);_0x38d8a1[_0x4436c7(0x198)](_0x37ab11),_0x20224e[_0x37ab11['ok']?_0x4436c7(0x140):_0x4436c7(0x139)](_0x4436c7(0x199)+(_0x37ab11[_0x4436c7(0x14a)]??(_0x37ab11['ok']?'done':_0x4436c7(0x165))));const _0x323522=a152_0xf3a2d9({'text':_0x4436c7(0x1a2),'color':_0x4436c7(0x179)})['start'](),_0x26b729=execCleanMcp(_0x485497);_0x38d8a1[_0x4436c7(0x198)](_0x26b729),_0x323522[_0x26b729['ok']?_0x4436c7(0x140):_0x4436c7(0x139)](_0x4436c7(0x1a6)+(_0x26b729[_0x4436c7(0x14a)]??(_0x26b729['ok']?'done':_0x4436c7(0x165))));const _0x4e87c3=a152_0xf3a2d9({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x4436c7(0x179)})[_0x4436c7(0x192)](),_0x561d65=execSkillsRemove(_0x1194a4,_0x11ba5a);_0x38d8a1[_0x4436c7(0x198)](_0x561d65),_0x4e87c3[_0x561d65['ok']?_0x4436c7(0x140):_0x4436c7(0x139)]('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x561d65[_0x4436c7(0x14a)]??(_0x561d65['ok']?'done':'failed')));const _0x19de06=a152_0xf3a2d9({'text':_0x4436c7(0x19d),'color':'cyan'})['start'](),_0x176b94=execSkillsAdd(_0x1194a4,_0x11ba5a);_0x38d8a1[_0x4436c7(0x198)](_0x176b94),_0x19de06[_0x176b94['ok']?'succeed':_0x4436c7(0x139)](_0x4436c7(0x16e)+(_0x176b94[_0x4436c7(0x14a)]??(_0x176b94['ok']?_0x4436c7(0x155):_0x4436c7(0x165))));const _0x3c8b51=a152_0xf3a2d9({'text':_0x4436c7(0x180),'color':_0x4436c7(0x179)})['start'](),_0x49ae2e=execUpgradeSdk(_0x485497);_0x38d8a1[_0x4436c7(0x198)](_0x49ae2e),_0x3c8b51[_0x49ae2e['ok']?_0x4436c7(0x140):_0x4436c7(0x139)](_0x4436c7(0x17a)+(_0x49ae2e[_0x4436c7(0x14a)]??(_0x49ae2e['ok']?_0x4436c7(0x155):_0x4436c7(0x165)))),printSummary(_0x38d8a1);const _0x529c37=_0x38d8a1['some'](_0xa1a936=>!_0xa1a936['ok']);_0x529c37?console[_0x4436c7(0x147)](a152_0x252ba0[_0x4436c7(0x156)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console[_0x4436c7(0x147)](a152_0x252ba0[_0x4436c7(0x1a3)](_0x4436c7(0x161))),_0x49ae2e['ok']&&_0x485497[_0x4436c7(0x151)]&&(console[_0x4436c7(0x147)](''),console[_0x4436c7(0x147)](a152_0x252ba0[_0x4436c7(0x149)][_0x4436c7(0x179)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x4436c7(0x147)](a152_0x252ba0[_0x4436c7(0x179)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console['log'](''),console['log'](a152_0x252ba0['white'](_0x4436c7(0x19e))),console[_0x4436c7(0x147)](a152_0x252ba0['white'](_0x4436c7(0x16b))),console[_0x4436c7(0x147)](a152_0x252ba0[_0x4436c7(0x17e)](_0x4436c7(0x195))),console['log'](''));}
1
+ (function(_0x46e4a3,_0x3eaeb1){const _0x5138b0=a152_0x372a,_0x3e365c=_0x46e4a3();while(!![]){try{const _0x211288=-parseInt(_0x5138b0(0xc3))/0x1*(-parseInt(_0x5138b0(0xbf))/0x2)+parseInt(_0x5138b0(0x9f))/0x3*(parseInt(_0x5138b0(0xe5))/0x4)+-parseInt(_0x5138b0(0xdd))/0x5*(parseInt(_0x5138b0(0x7c))/0x6)+parseInt(_0x5138b0(0x93))/0x7*(-parseInt(_0x5138b0(0xb4))/0x8)+-parseInt(_0x5138b0(0x96))/0x9*(-parseInt(_0x5138b0(0xe3))/0xa)+parseInt(_0x5138b0(0xbc))/0xb*(-parseInt(_0x5138b0(0x9c))/0xc)+parseInt(_0x5138b0(0xc1))/0xd*(parseInt(_0x5138b0(0xa1))/0xe);if(_0x211288===_0x3eaeb1)break;else _0x3e365c['push'](_0x3e365c['shift']());}catch(_0x183a6b){_0x3e365c['push'](_0x3e365c['shift']());}}}(a152_0xf7d8,0x70fad));import a152_0x409791 from'chalk';import a152_0x529bab from'ora';function a152_0x372a(_0x508130,_0x3c9e5e){_0x508130=_0x508130-0x70;const _0xf7d8e4=a152_0xf7d8();let _0x372aa4=_0xf7d8e4[_0x508130];return _0x372aa4;}function a152_0xf7d8(){const _0x2306b2=['latest','not\x20found\x20(will\x20create)','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','===\x20Upgrade\x20Analysis\x20===','detail','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','args','lovrabet/rabetbase\x20installed\x20globally','failed','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','yes','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','\x20→\x20keys:\x20','48sgoWpY','mcpServers','none\x20found','undefined','stringify','Skill\x20swap:','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','bold','error','\x20removed\x20(','status','keys','\x20\x20npm\x20install','Config\x20migration','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','white','@lovrabet/sdk:','inherit','filter','Config\x20file:','\x20\x20Step\x20','gray','7whgHuc','FOUND','Step\x204/7:\x20MCP\x20config\x20—\x20','414myoEPz','entries','FAIL','\x20from\x20','\x20\x20New\x20config\x20(.rabetbase.json):\x20','push','9744HWZeLo','Step\x204/7:\x20Cleaning\x20MCP\x20config...','.cursor/rules/lovrabet_rules.mdc','3IeKMwm','lovrabet/rabetbase','28jiTCIG','utf8','needed','hasNewConfig','\x20\x20\x20\x20\x20\x20\x20','oldMcpConfig','red','some','skipped\x20(no\x20legacy\x20config)','needsSkillSwap','isArray','oldArtifacts','skipped','already\x20exists\x20(will\x20merge)','object','join','package.json','@lovrabet/sdk','Upgrade\x20@lovrabet/sdk','3156688GqCkbf','.claude/skills/lovrabet','step','\x20\x20#\x20or','values','path','info','Clean\x20MCP\x20config','5203fFZZdK','done','not\x20found\x20or\x20already\x20at\x20latest','32EooehF','[\x22@lovrabet/sdk\x22]:\x20','182767exGWGn','fail','40427WbwAnD','message','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','string','no\x20legacy\x20entry','log','Remove\x20.lovrabet/','start','succeed','yellow','.lovrabet','green','configMigration','cyan','Step\x206/7:\x20Installing\x20new\x20skill...','===\x20Upgrade\x20Summary\x20===','\x20\x20Action:\x20delete','parse','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','oldPath','MCP\x20config:','cwd','Legacy\x20artifacts:','\x20→\x20latest','.bak','176080Cbufkc','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','\x20(backup:\x20','Remove\x20old\x20skill','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','69670fFdbae','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','2110892weDANL','files','label','\x20\x20Fields\x20to\x20migrate:\x20','Upgrade\x20cancelled.','removed\x20','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','Step\x201/7:\x20Migrating\x20config...','isDirectory','@lovrabet/dataset-mcp-server','length','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','no\x20legacy\x20config\x20found','no\x20matching\x20entry\x20found','\x20\x20Current\x20version\x20in\x20','CANCEL','Remove\x20legacy\x20artifacts','Step\x205/7:\x20Removing\x20old\x20skill...','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','Upgrade\x20completed\x20successfully!','\x20removed','sdkUpgrade'];a152_0xf7d8=function(){return _0x2306b2;};return a152_0xf7d8();}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['filter'](_0x3e1847=>_0x3e1847!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0xe7d6be){const _0x2bba22=a152_0x372a,_0x487cb7=[];for(const _0x561a4b of Object[_0x2bba22(0xb8)](CORE_IDE_CONFIGS)){if(_0x561a4b[_0x2bba22(0xe6)])for(const _0x4ecca8 of _0x561a4b[_0x2bba22(0xe6)]){_0x487cb7[_0x2bba22(0x9b)](resolve(_0xe7d6be,_0x4ecca8['path']));}}return _0x487cb7;}function analyse(_0x6a6278){const _0x3c459c=a152_0x372a;let _0x57971d=null;const _0x2f51a7=resolve(_0x6a6278,NEW_CONFIG_NAME),_0x4aab94=existsSync(_0x2f51a7);for(const _0x4a04f2 of LEGACY_CONFIG_NAMES){const _0x6a65ba=resolve(_0x6a6278,_0x4a04f2);if(existsSync(_0x6a65ba)){const _0x22d670=readConfigFile(_0x6a65ba),_0x131c86=Object[_0x3c459c(0x87)](_0x22d670)[_0x3c459c(0x8f)](_0x557b2d=>typeof _0x22d670[_0x557b2d]!==_0x3c459c(0x7f));_0x57971d={'oldPath':_0x6a65ba,'hasNewConfig':_0x4aab94,'fields':_0x131c86};break;}}const _0x1f8fcd=[],_0x3716ad=resolve(_0x6a6278,_0x3c459c(0xcd));if(existsSync(_0x3716ad))_0x1f8fcd[_0x3c459c(0x9b)](_0x3716ad);const _0x184d61=resolve(_0x6a6278,_0x3c459c(0x9e));if(existsSync(_0x184d61))_0x1f8fcd[_0x3c459c(0x9b)](_0x184d61);const _0x220073=resolve(_0x6a6278,_0x3c459c(0xb5));if(existsSync(_0x220073))_0x1f8fcd[_0x3c459c(0x9b)](_0x220073);for(const _0x1a6068 of collectIdeSkillFiles(_0x6a6278)){if(existsSync(_0x1a6068))_0x1f8fcd[_0x3c459c(0x9b)](_0x1a6068);}let _0x10b3d8=null;const _0x487ee1=resolve(_0x6a6278,'.cursor/mcp.json');if(existsSync(_0x487ee1))try{const _0x7a5707=JSON[_0x3c459c(0xd4)](readFileSync(_0x487ee1,_0x3c459c(0xa2)));if(_0x7a5707?.[_0x3c459c(0x7d)]&&typeof _0x7a5707[_0x3c459c(0x7d)]==='object'){const _0x36c219=[];for(const [_0x446661,_0x3893fd]of Object[_0x3c459c(0x97)](_0x7a5707[_0x3c459c(0x7d)])){const _0x1bc0bb=_0x3893fd;_0x1bc0bb?.[_0x3c459c(0x75)]&&Array[_0x3c459c(0xab)](_0x1bc0bb[_0x3c459c(0x75)])&&_0x1bc0bb[_0x3c459c(0x75)]['some'](_0x186e2e=>typeof _0x186e2e===_0x3c459c(0xc6)&&_0x186e2e['includes'](_0x3c459c(0xee)))&&_0x36c219[_0x3c459c(0x9b)](_0x446661);}_0x36c219[_0x3c459c(0xef)]>0x0&&(_0x10b3d8={'path':_0x487ee1,'keys':_0x36c219});}}catch{}const _0x58b31e=_0x1f8fcd[_0x3c459c(0xef)]>0x0||_0x57971d!==null;let _0x59c869=null;const _0x120934=resolve(_0x6a6278,_0x3c459c(0xb1));if(existsSync(_0x120934))try{const _0x3e0659=JSON[_0x3c459c(0xd4)](readFileSync(_0x120934,_0x3c459c(0xa2)));for(const _0x41acf5 of['dependencies','devDependencies']){const _0x20bb91=_0x3e0659?.[_0x41acf5]?.['@lovrabet/sdk'];if(typeof _0x20bb91===_0x3c459c(0xc6)){_0x20bb91!==_0x3c459c(0xfb)&&(_0x59c869={'pkgPath':_0x120934,'currentVersion':_0x20bb91,'field':_0x41acf5});break;}}}catch{}return{'configMigration':_0x57971d,'oldArtifacts':_0x1f8fcd,'oldMcpConfig':_0x10b3d8,'needsSkillSwap':_0x58b31e,'sdkUpgrade':_0x59c869};}function printReport(_0x879684){const _0x4ce5bb=a152_0x372a,{configMigration:_0x2eb345,oldArtifacts:_0x114cdc,oldMcpConfig:_0x2c23f4,needsSkillSwap:_0x2df0d}=_0x879684;console['log'](''),console[_0x4ce5bb(0xc8)](a152_0x409791[_0x4ce5bb(0x83)](_0x4ce5bb(0x72))),console[_0x4ce5bb(0xc8)]('');_0x2eb345?(console[_0x4ce5bb(0xc8)](a152_0x409791[_0x4ce5bb(0xd0)](_0x4ce5bb(0x90))+('\x20\x20'+a152_0x409791[_0x4ce5bb(0xcc)](_0x2eb345[_0x4ce5bb(0xd7)]))),console[_0x4ce5bb(0xc8)](_0x4ce5bb(0x9a)+(_0x2eb345['hasNewConfig']?a152_0x409791['green'](_0x4ce5bb(0xae)):a152_0x409791['gray'](_0x4ce5bb(0x70)))),console['log'](_0x4ce5bb(0xe8)+_0x2eb345['fields'][_0x4ce5bb(0xb0)](',\x20')),console[_0x4ce5bb(0xc8)](_0x4ce5bb(0x78))):console[_0x4ce5bb(0xc8)](a152_0x409791['cyan'](_0x4ce5bb(0x90))+'\x20\x20'+a152_0x409791[_0x4ce5bb(0x92)](_0x4ce5bb(0xf1)));console['log']('');if(_0x114cdc[_0x4ce5bb(0xef)]>0x0){console[_0x4ce5bb(0xc8)](a152_0x409791['cyan'](_0x4ce5bb(0xda)));for(const _0x4e8e79 of _0x114cdc){console[_0x4ce5bb(0xc8)]('\x20\x20'+a152_0x409791[_0x4ce5bb(0xa7)](_0x4ce5bb(0x94))+'\x20\x20'+_0x4e8e79);}console[_0x4ce5bb(0xc8)](_0x4ce5bb(0xd3));}else console[_0x4ce5bb(0xc8)](a152_0x409791[_0x4ce5bb(0xd0)](_0x4ce5bb(0xda))+'\x20\x20'+a152_0x409791[_0x4ce5bb(0x92)](_0x4ce5bb(0x7e)));console[_0x4ce5bb(0xc8)]('');_0x2c23f4?(console[_0x4ce5bb(0xc8)](a152_0x409791[_0x4ce5bb(0xd0)](_0x4ce5bb(0xd8))+('\x20\x20'+a152_0x409791[_0x4ce5bb(0xcc)](_0x2c23f4['path'])+_0x4ce5bb(0x7b)+_0x2c23f4['keys']['join'](',\x20'))),console['log'](_0x4ce5bb(0xc5))):console[_0x4ce5bb(0xc8)](a152_0x409791[_0x4ce5bb(0xd0)]('MCP\x20config:')+'\x20\x20'+a152_0x409791['gray'](_0x4ce5bb(0xc7)));console[_0x4ce5bb(0xc8)](''),console['log'](a152_0x409791[_0x4ce5bb(0xd0)](_0x4ce5bb(0x81))+('\x20\x20'+(_0x2df0d?a152_0x409791[_0x4ce5bb(0xcc)](_0x4ce5bb(0xa3)):a152_0x409791[_0x4ce5bb(0xce)]('not\x20needed'))));_0x2df0d&&console[_0x4ce5bb(0xc8)](_0x4ce5bb(0xd5)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x4ce5bb(0xc8)]('');if(_0x879684[_0x4ce5bb(0xfa)]){const {currentVersion:_0x1c25c2,field:_0x4c0bdc,pkgPath:_0x21ae05}=_0x879684[_0x4ce5bb(0xfa)];console[_0x4ce5bb(0xc8)](a152_0x409791['cyan'](_0x4ce5bb(0x8d))+('\x20\x20'+a152_0x409791[_0x4ce5bb(0xcc)](_0x21ae05))),console[_0x4ce5bb(0xc8)](_0x4ce5bb(0xf3)+_0x4c0bdc+':\x20'+a152_0x409791[_0x4ce5bb(0xcc)](_0x1c25c2)+'\x20→\x20'+a152_0x409791['green'](_0x4ce5bb(0xfb))),console[_0x4ce5bb(0xc8)](_0x4ce5bb(0xd6));}else console[_0x4ce5bb(0xc8)](a152_0x409791['cyan'](_0x4ce5bb(0x8d))+'\x20\x20'+a152_0x409791[_0x4ce5bb(0x92)](_0x4ce5bb(0xbe)));console[_0x4ce5bb(0xc8)]('');}function execConfigMigration(_0x5d0e16,_0x6f995){const _0x7cb939=a152_0x372a,{configMigration:_0x550778}=_0x5d0e16;if(!_0x550778?.[_0x7cb939(0xd7)])return{'step':0x1,'label':_0x7cb939(0x89),'ok':!![],'detail':_0x7cb939(0xa9)};const _0x2bf5ef=readConfigFile(_0x550778[_0x7cb939(0xd7)]),_0x216819=resolve(_0x6f995,NEW_CONFIG_NAME),_0xf73fdb=_0x550778[_0x7cb939(0xa4)]?readConfigFile(_0x216819):{};for(const [_0x857c6b,_0x590f7f]of Object['entries'](_0x2bf5ef)){!(_0x857c6b in _0xf73fdb)&&(_0xf73fdb[_0x857c6b]=_0x590f7f);}writeConfigFile(_0x216819,_0xf73fdb);const _0x2f636f=_0x550778['oldPath']+_0x7cb939(0xdc);return renameSync(_0x550778['oldPath'],_0x2f636f),{'step':0x1,'label':_0x7cb939(0x89),'ok':!![],'detail':_0x550778[_0x7cb939(0xd7)]+'\x20→\x20'+_0x216819+_0x7cb939(0xe0)+_0x2f636f+')'};}function execRemoveOldArtifacts(_0x1a87d5){const _0x25f35f=a152_0x372a,_0x188185=[];for(const _0x2c8710 of _0x1a87d5){try{if(!existsSync(_0x2c8710))continue;const _0x5c24d2=tryStat(_0x2c8710);_0x5c24d2?.[_0x25f35f(0xed)]()?rmSync(_0x2c8710,{'recursive':!![],'force':!![]}):unlinkSync(_0x2c8710);}catch(_0x193700){_0x188185['push'](_0x2c8710+':\x20'+_0x193700[_0x25f35f(0xc4)]);}}return{'step':0x3,'label':_0x25f35f(0xf5),'ok':_0x188185[_0x25f35f(0xef)]===0x0,'detail':_0x188185[_0x25f35f(0xef)]>0x0?_0x1a87d5[_0x25f35f(0xef)]-_0x188185['length']+'/'+_0x1a87d5['length']+_0x25f35f(0x85)+_0x188185[_0x25f35f(0xb0)](';\x20')+')':_0x1a87d5[_0x25f35f(0xef)]+_0x25f35f(0xf9)};}function execCleanMcp(_0x2b41b4){const _0x2fc2a7=a152_0x372a;if(!_0x2b41b4[_0x2fc2a7(0xa6)])return{'step':0x4,'label':_0x2fc2a7(0xbb),'ok':!![],'detail':_0x2fc2a7(0xad)};try{const _0x228f53=readFileSync(_0x2b41b4[_0x2fc2a7(0xa6)][_0x2fc2a7(0xb9)],_0x2fc2a7(0xa2)),_0x12d184=JSON[_0x2fc2a7(0xd4)](_0x228f53);if(_0x12d184?.[_0x2fc2a7(0x7d)]&&typeof _0x12d184[_0x2fc2a7(0x7d)]===_0x2fc2a7(0xaf)){const _0x43f3f2=[];for(const [_0x302f71,_0x263cb0]of Object[_0x2fc2a7(0x97)](_0x12d184[_0x2fc2a7(0x7d)])){_0x263cb0?.[_0x2fc2a7(0x75)]&&Array['isArray'](_0x263cb0[_0x2fc2a7(0x75)])&&_0x263cb0[_0x2fc2a7(0x75)]['some'](_0xda61da=>typeof _0xda61da===_0x2fc2a7(0xc6)&&_0xda61da['includes'](_0x2fc2a7(0xee)))&&_0x43f3f2[_0x2fc2a7(0x9b)](_0x302f71);}for(const _0x1f18ff of _0x43f3f2){delete _0x12d184['mcpServers'][_0x1f18ff];}return _0x43f3f2[_0x2fc2a7(0xef)]>0x0&&writeFileSync(_0x2b41b4[_0x2fc2a7(0xa6)][_0x2fc2a7(0xb9)],JSON[_0x2fc2a7(0x80)](_0x12d184,null,0x2)+'\x0a',_0x2fc2a7(0xa2)),{'step':0x4,'label':_0x2fc2a7(0xbb),'ok':!![],'detail':_0x2fc2a7(0xea)+_0x43f3f2[_0x2fc2a7(0xb0)](',\x20')+_0x2fc2a7(0x99)+_0x2b41b4['oldMcpConfig'][_0x2fc2a7(0xb9)]};}return{'step':0x4,'label':_0x2fc2a7(0xbb),'ok':!![],'detail':_0x2fc2a7(0xf2)};}catch(_0x55c507){return{'step':0x4,'label':_0x2fc2a7(0xbb),'ok':![],'detail':_0x55c507[_0x2fc2a7(0xc4)]};}}function execSkillsRemove(_0x53d0fc,_0x2cb861){const _0x3c0f62=a152_0x372a,_0x26aeb7=runNpxSkillsRemove(_0x53d0fc,{'stdio':_0x3c0f62(0x8e),'yes':_0x2cb861});return{'step':0x5,'label':_0x3c0f62(0xe1),'ok':_0x26aeb7['ok'],'detail':_0x26aeb7['ok']?'lovrabet/lovrabet-skill\x20removed':_0x26aeb7[_0x3c0f62(0x84)]??'exit\x20'+_0x26aeb7['status']};}function execSkillsAdd(_0x48644d,_0x1632e4){const _0x5a67f5=a152_0x372a,_0x38ba53=runNpxSkillsAddGlobal(_0x48644d,_0x5a67f5(0xa0),{'stdio':_0x5a67f5(0x8e),'yes':_0x1632e4});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0x38ba53['ok'],'detail':_0x38ba53['ok']?_0x5a67f5(0x76):_0x38ba53[_0x5a67f5(0x84)]??'exit\x20'+_0x38ba53[_0x5a67f5(0x86)]};}function execUpgradeSdk(_0x144b69){const _0x5edbeb=a152_0x372a;if(!_0x144b69['sdkUpgrade'])return{'step':0x7,'label':_0x5edbeb(0xb3),'ok':!![],'detail':_0x5edbeb(0xe4)};const {pkgPath:_0xcf0c61,currentVersion:_0x463aff,field:_0x1a899a}=_0x144b69[_0x5edbeb(0xfa)];try{const _0x1b8817=readFileSync(_0xcf0c61,_0x5edbeb(0xa2)),_0x4a5042=JSON[_0x5edbeb(0xd4)](_0x1b8817);return _0x4a5042[_0x1a899a][_0x5edbeb(0xb2)]='latest',writeFileSync(_0xcf0c61,JSON[_0x5edbeb(0x80)](_0x4a5042,null,0x2)+'\x0a',_0x5edbeb(0xa2)),{'step':0x7,'label':_0x5edbeb(0xb3),'ok':!![],'detail':_0x1a899a+_0x5edbeb(0xc0)+_0x463aff+_0x5edbeb(0xdb)};}catch(_0xff0316){return{'step':0x7,'label':_0x5edbeb(0xb3),'ok':![],'detail':_0xff0316['message']};}}function tryStat(_0x248ebf){try{return statSync(_0x248ebf);}catch{return undefined;}}function printSummary(_0x471d1f){const _0x3d9cf2=a152_0x372a;console[_0x3d9cf2(0xc8)](''),console[_0x3d9cf2(0xc8)](a152_0x409791[_0x3d9cf2(0x83)](_0x3d9cf2(0xd2))),console[_0x3d9cf2(0xc8)]('');for(const _0x38810c of _0x471d1f){const _0xe6fbe=_0x38810c['ok']?a152_0x409791['green']('OK'):a152_0x409791['red'](_0x3d9cf2(0x98));console[_0x3d9cf2(0xc8)]('\x20\x20'+_0xe6fbe+_0x3d9cf2(0x91)+_0x38810c[_0x3d9cf2(0xb6)]+':\x20'+_0x38810c[_0x3d9cf2(0xe7)]);if(_0x38810c['detail'])console[_0x3d9cf2(0xc8)](_0x3d9cf2(0xa5)+a152_0x409791[_0x3d9cf2(0x92)](_0x38810c[_0x3d9cf2(0x73)]));}console[_0x3d9cf2(0xc8)]('');}export async function upgradeApp(_0x4a7a63,_0x152404){const _0x52325b=a152_0x372a,_0x43f379=process[_0x52325b(0xd9)](),_0x5806ae=analyse(_0x43f379),_0x30c753=!_0x5806ae[_0x52325b(0xcf)]&&_0x5806ae['oldArtifacts'][_0x52325b(0xef)]===0x0&&!_0x5806ae[_0x52325b(0xa6)]&&!_0x5806ae[_0x52325b(0xaa)]&&!_0x5806ae[_0x52325b(0xfa)];if(_0x30c753){console[_0x52325b(0xc8)](a152_0x409791[_0x52325b(0xce)](_0x52325b(0xf0)));return;}printReport(_0x5806ae);const _0x512d76=!!(_0x152404[_0x52325b(0x79)]||_0x152404['Y']||_0x4a7a63);if(!_0x512d76)try{const _0x32b174=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x32b174){console['log'](a152_0x409791['gray'](_0x52325b(0xe9)));return;}}catch(_0x2dad9d){if(_0x2dad9d?.['message']===_0x52325b(0xf4)){console[_0x52325b(0xc8)](a152_0x409791[_0x52325b(0x92)](_0x52325b(0xe9)));return;}throw _0x2dad9d;}const _0x56cad5=[],_0x337ce5=a152_0x529bab({'text':_0x52325b(0xec),'color':_0x52325b(0xd0)})[_0x52325b(0xca)](),_0x5b7487=execConfigMigration(_0x5806ae,_0x43f379);_0x56cad5[_0x52325b(0x9b)](_0x5b7487),_0x337ce5[_0x5b7487['ok']?_0x52325b(0xcb):_0x52325b(0xc2)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0x5b7487[_0x52325b(0x73)]??(_0x5b7487['ok']?_0x52325b(0xbd):'failed')));const _0x1e6367=resolve(_0x43f379,_0x52325b(0xcd)),_0x1b766e=a152_0x529bab({'text':_0x52325b(0x74),'color':'cyan'})['start']();if(existsSync(_0x1e6367))try{rmSync(_0x1e6367,{'recursive':!![],'force':!![]}),_0x1b766e[_0x52325b(0xcb)](_0x52325b(0x8a)),_0x56cad5[_0x52325b(0x9b)]({'step':0x2,'label':_0x52325b(0xc9),'ok':!![]});}catch(_0x1a35aa){_0x1b766e[_0x52325b(0xc2)](_0x52325b(0xeb)+_0x1a35aa[_0x52325b(0xc4)]),_0x56cad5[_0x52325b(0x9b)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x1a35aa[_0x52325b(0xc4)]});}else _0x1b766e[_0x52325b(0xba)](_0x52325b(0x8b)),_0x56cad5[_0x52325b(0x9b)]({'step':0x2,'label':_0x52325b(0xc9),'ok':!![],'detail':'skipped'});const _0xe74b25=a152_0x529bab({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':'cyan'})[_0x52325b(0xca)](),_0x14021b=execRemoveOldArtifacts(_0x5806ae[_0x52325b(0xac)]);_0x56cad5[_0x52325b(0x9b)](_0x14021b),_0xe74b25[_0x14021b['ok']?'succeed':'fail'](_0x52325b(0x7a)+(_0x14021b[_0x52325b(0x73)]??(_0x14021b['ok']?_0x52325b(0xbd):'failed')));const _0x47fabf=a152_0x529bab({'text':_0x52325b(0x9d),'color':_0x52325b(0xd0)})[_0x52325b(0xca)](),_0x44e417=execCleanMcp(_0x5806ae);_0x56cad5['push'](_0x44e417),_0x47fabf[_0x44e417['ok']?'succeed':_0x52325b(0xc2)](_0x52325b(0x95)+(_0x44e417[_0x52325b(0x73)]??(_0x44e417['ok']?_0x52325b(0xbd):_0x52325b(0x77))));const _0x54961a=a152_0x529bab({'text':_0x52325b(0xf6),'color':_0x52325b(0xd0)})[_0x52325b(0xca)](),_0x23651f=execSkillsRemove(_0x43f379,_0x512d76);_0x56cad5[_0x52325b(0x9b)](_0x23651f),_0x54961a[_0x23651f['ok']?_0x52325b(0xcb):_0x52325b(0xc2)](_0x52325b(0xdf)+(_0x23651f[_0x52325b(0x73)]??(_0x23651f['ok']?'done':'failed')));const _0x153c59=a152_0x529bab({'text':_0x52325b(0xd1),'color':_0x52325b(0xd0)})[_0x52325b(0xca)](),_0x45986a=execSkillsAdd(_0x43f379,_0x512d76);_0x56cad5[_0x52325b(0x9b)](_0x45986a),_0x153c59[_0x45986a['ok']?_0x52325b(0xcb):_0x52325b(0xc2)](_0x52325b(0xf7)+(_0x45986a['detail']??(_0x45986a['ok']?_0x52325b(0xbd):'failed')));const _0x3be9c2=a152_0x529bab({'text':_0x52325b(0x71),'color':'cyan'})[_0x52325b(0xca)](),_0x662423=execUpgradeSdk(_0x5806ae);_0x56cad5['push'](_0x662423),_0x3be9c2[_0x662423['ok']?_0x52325b(0xcb):_0x52325b(0xc2)](_0x52325b(0xde)+(_0x662423[_0x52325b(0x73)]??(_0x662423['ok']?'done':'failed'))),printSummary(_0x56cad5);const _0x161905=_0x56cad5[_0x52325b(0xa8)](_0x29a6ad=>!_0x29a6ad['ok']);_0x161905?console[_0x52325b(0xc8)](a152_0x409791[_0x52325b(0xcc)](_0x52325b(0xe2))):console['log'](a152_0x409791[_0x52325b(0xce)](_0x52325b(0xf8))),_0x662423['ok']&&_0x5806ae[_0x52325b(0xfa)]&&(console[_0x52325b(0xc8)](''),console[_0x52325b(0xc8)](a152_0x409791[_0x52325b(0x83)][_0x52325b(0xd0)](_0x52325b(0x82))),console[_0x52325b(0xc8)](a152_0x409791[_0x52325b(0xd0)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0x52325b(0xc8)](''),console['log'](a152_0x409791[_0x52325b(0x8c)](_0x52325b(0x88))),console[_0x52325b(0xc8)](a152_0x409791[_0x52325b(0x8c)](_0x52325b(0xb7))),console[_0x52325b(0xc8)](a152_0x409791[_0x52325b(0x8c)]('\x20\x20bun\x20install')),console['log'](''));}
@@ -1 +1 @@
1
- const a153_0x3ab4d6=a153_0xd86c;(function(_0x516b08,_0x5c5692){const _0x9d7ca5=a153_0xd86c,_0xd5561=_0x516b08();while(!![]){try{const _0x5d7332=parseInt(_0x9d7ca5(0x157))/0x1+-parseInt(_0x9d7ca5(0x16d))/0x2*(parseInt(_0x9d7ca5(0x140))/0x3)+-parseInt(_0x9d7ca5(0x165))/0x4*(parseInt(_0x9d7ca5(0x163))/0x5)+-parseInt(_0x9d7ca5(0x187))/0x6*(parseInt(_0x9d7ca5(0x166))/0x7)+parseInt(_0x9d7ca5(0x14a))/0x8+parseInt(_0x9d7ca5(0x184))/0x9*(parseInt(_0x9d7ca5(0x155))/0xa)+parseInt(_0x9d7ca5(0x182))/0xb;if(_0x5d7332===_0x5c5692)break;else _0xd5561['push'](_0xd5561['shift']());}catch(_0x3055d8){_0xd5561['push'](_0xd5561['shift']());}}}(a153_0x51a5,0x48565));import{apiDefinitions}from'../commands/api/index.js';function a153_0xd86c(_0x2f3aac,_0x337af5){_0x2f3aac=_0x2f3aac-0x13c;const _0x51a54a=a153_0x51a5();let _0xd86c1c=_0x51a54a[_0x2f3aac];return _0xd86c1c;}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';function a153_0x51a5(){const _0x56ca3d=['description','auth','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','filter','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','skills','Project','4088770JERZyK','Self\x20Update','286969LEtRoB','skill\x20','build','show','Code\x20Generation','Instant\x20API','run','Schema','Menu','Dataset\x20&\x20Operations','get','from','824185iwpGJr','start','4TWndMs','406833dtihnm','values','API\x20Development','Authentication','SQL\x20Queries','set','create','854018EKvSKI','app\x20use','risk','Async\x20Tasks','remote','\x20\x20[high-risk-write]','logout','use','Diagnostics','has','Database\x20Connections','map','hidden','BFF\x20Scripts','`rabetbase\x20skills`\x20has\x20been\x20removed.','Logs','Roles','Quick\x20Start','CLI\x20Built-in\x20Skill','preview','isSingleCommand','1560207fDgDMm','<script>','9kIECdx','Platform\x20Issue','command','48fqzrBv','`\x20has\x20been\x20removed.','install','defaultCommand','Runtime\x20App\x20Config\x20Management','File','commands','length','3SYQrYI','`rabetbase\x20','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','project','Notification\x20Configuration','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','service','wildcardDef','app\x20remote','Smart\x20List\x20Pages','4123264PAUpFz','app','push','Workspace'];a153_0x51a5=function(){return _0x56ca3d;};return a153_0x51a5();}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(_0xde5eda){const _0x59dd5c=a153_0xd86c;for(const _0x4c06aa of _0xde5eda){definitions['set'](_0x4c06aa[_0x59dd5c(0x146)]+':'+_0x4c06aa[_0x59dd5c(0x186)],_0x4c06aa);let _0x1b103d=serviceGroups[_0x59dd5c(0x161)](_0x4c06aa['service']);!_0x1b103d&&(_0x1b103d=[],serviceGroups[_0x59dd5c(0x16b)](_0x4c06aa[_0x59dd5c(0x146)],_0x1b103d)),_0x1b103d[_0x59dd5c(0x14c)](_0x4c06aa);}}function registerDeclarativeService(_0x1479b0,_0xdc3bb7,_0x351bc3){const _0xf7b37a=a153_0xd86c;registerDefinitions(_0xdc3bb7);_0x351bc3?.[_0xf7b37a(0x147)]&&registerDefinitions([_0x351bc3[_0xf7b37a(0x147)]]);const _0x15f384=_0x1be544=>_0x1be544==='read'?'':_0x1be544==='write'?'\x20\x20[write]':_0xf7b37a(0x172),_0x2a17a4={'service':_0xdc3bb7[0x0][_0xf7b37a(0x146)],'label':_0x1479b0,'commands':_0xdc3bb7[_0xf7b37a(0x151)](_0x402825=>!_0x402825[_0xf7b37a(0x179)])[_0xf7b37a(0x178)](_0x265bcd=>({'command':_0x265bcd['command'],'description':_0x265bcd[_0xf7b37a(0x14e)],'tag':_0x15f384(_0x265bcd[_0xf7b37a(0x16f)])})),'declarative':!![],'defaultCommand':_0x351bc3?.[_0xf7b37a(0x18a)]??(_0x351bc3?.[_0xf7b37a(0x181)]?_0xdc3bb7[0x0][_0xf7b37a(0x186)]:undefined),'wildcardDef':_0x351bc3?.['wildcardDef'],'isSingleCommand':_0x351bc3?.[_0xf7b37a(0x181)]};serviceRegistry[_0xf7b37a(0x14c)](_0x2a17a4),serviceByName[_0xf7b37a(0x16b)](_0x2a17a4[_0xf7b37a(0x146)],_0x2a17a4);}registerDeclarativeService(a153_0x3ab4d6(0x17e),initDefinitions,{'defaultCommand':a153_0x3ab4d6(0x15d),'isSingleCommand':!![]}),registerDeclarativeService(a153_0x3ab4d6(0x154),projectDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x14d),workspaceDefinitions),registerDeclarativeService('App\x20Management',appDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x169),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a153_0x3ab4d6(0x160),datasetDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x149),pageDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x168),apiDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x15c),dataDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x17a),bffDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x144),notificationDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x16a),sqlDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x177),dbDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x15f),menuDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x170),taskDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x17d),roleDefinitions),registerDeclarativeService('Permissions',permitDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x13c),appConfigDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x185),issueDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x13d),fileDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x15b),codegenDefinitions),registerDeclarativeService('Configuration',configDefinitions),registerDeclarativeService(a153_0x3ab4d6(0x175),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a153_0x3ab4d6(0x15e),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a153_0x3ab4d6(0x156),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a153_0x3ab4d6(0x17f),cliSkillDefinitions,{'defaultCommand':a153_0x3ab4d6(0x189)}),registerDeclarativeService(a153_0x3ab4d6(0x17c),logsDefinitions,{'defaultCommand':a153_0x3ab4d6(0x15a)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a153_0x3ab4d6(0x13f)]-0x1];last[a153_0x3ab4d6(0x13e)]=[{'command':a153_0x3ab4d6(0x183),'description':'Run\x20any\x20package.json\x20script','tag':''}];}export const deprecatedAliases={'create':{'service':a153_0x3ab4d6(0x143),'command':a153_0x3ab4d6(0x16c)},'start':{'service':a153_0x3ab4d6(0x15d),'command':a153_0x3ab4d6(0x164)},'build':{'service':a153_0x3ab4d6(0x15d),'command':a153_0x3ab4d6(0x159)},'preview':{'service':'run','command':a153_0x3ab4d6(0x180)},'logout':{'service':a153_0x3ab4d6(0x14f),'command':a153_0x3ab4d6(0x173)}};const CLI_SKILL_INSTALL_REMOVED_HINT=a153_0x3ab4d6(0x145),APP_REMOTE_REMOVED_HINT=a153_0x3ab4d6(0x152),APP_USE_REMOVED_HINT=a153_0x3ab4d6(0x142);export function resolveRemovedCommand(_0x4e9cde,_0x375e5b){const _0xb8d6c3=a153_0x3ab4d6;if(_0x4e9cde==='skill'){const _0x39aea9=_0x375e5b?_0xb8d6c3(0x158)+_0x375e5b:'skill';return{'command':_0x39aea9,'message':_0xb8d6c3(0x141)+_0x39aea9+_0xb8d6c3(0x188),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x4e9cde===_0xb8d6c3(0x153))return{'command':_0xb8d6c3(0x153),'message':_0xb8d6c3(0x17b),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x4e9cde===_0xb8d6c3(0x14b)&&_0x375e5b===_0xb8d6c3(0x171))return{'command':_0xb8d6c3(0x148),'message':_0xb8d6c3(0x150),'hint':APP_REMOTE_REMOVED_HINT};if(_0x4e9cde==='app'&&_0x375e5b===_0xb8d6c3(0x174))return{'command':_0xb8d6c3(0x16e),'message':'`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':'create'},'sql':{'new':a153_0x3ab4d6(0x16c)}};export function resolveDeprecatedSubcommand(_0x1ece8e,_0xdeaf88){return deprecatedSubcommands[_0x1ece8e]?.[_0xdeaf88];}export function findDefinition(_0x39eee6,_0x2129cb){const _0x34cf6b=a153_0x3ab4d6;return definitions[_0x34cf6b(0x161)](_0x39eee6+':'+_0x2129cb);}export function isKnownService(_0x5cef1b){return serviceByName['has'](_0x5cef1b);}export function isDeclarativeService(_0x1f7654){const _0x499c8a=a153_0x3ab4d6;return serviceGroups[_0x499c8a(0x176)](_0x1f7654)||serviceByName[_0x499c8a(0x161)](_0x1f7654)?.[_0x499c8a(0x147)]!==undefined;}export function getServiceEntry(_0x1b2122){const _0x53436b=a153_0x3ab4d6;return serviceByName[_0x53436b(0x161)](_0x1b2122);}export function getLegacyHandler(_0x35fd70,_0x53af47){return undefined;}export function getAllDefinitions(){const _0xb7bb57=a153_0x3ab4d6;return Array[_0xb7bb57(0x162)](definitions[_0xb7bb57(0x167)]());}
1
+ const a153_0x45799f=a153_0x2017;(function(_0x3a9688,_0x185c4f){const _0xcc3c47=a153_0x2017,_0x462470=_0x3a9688();while(!![]){try{const _0x55fc39=-parseInt(_0xcc3c47(0x11e))/0x1+-parseInt(_0xcc3c47(0x11f))/0x2+-parseInt(_0xcc3c47(0x117))/0x3+-parseInt(_0xcc3c47(0x109))/0x4+-parseInt(_0xcc3c47(0x10f))/0x5*(parseInt(_0xcc3c47(0x110))/0x6)+parseInt(_0xcc3c47(0x116))/0x7+parseInt(_0xcc3c47(0x10b))/0x8;if(_0x55fc39===_0x185c4f)break;else _0x462470['push'](_0x462470['shift']());}catch(_0x3cdb35){_0x462470['push'](_0x462470['shift']());}}}(a153_0x7c05,0x68fa6));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';function a153_0x7c05(){const _0x4b5e7a=['skills','Notification\x20Configuration','push','Dataset\x20&\x20Operations','skill\x20','Menu','Runtime\x20App\x20Config\x20Management','run','app\x20use','CLI\x20Built-in\x20Skill','build','Run\x20any\x20package.json\x20script','Schema','map','Async\x20Tasks','API\x20Development','description','project','<script>','Smart\x20List\x20Pages','preview','App\x20Management','Database\x20Connections','use','has','risk','skill','auth','\x20\x20[write]','\x20\x20[high-risk-write]','install','get','Code\x20Generation','set','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','SQL\x20Queries','1243876nAtPmN','length','18386280VkvlqM','Run\x20Scripts','show','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','20555XjmAmW','348fMnMfm','create','Roles','Quick\x20Start','read','hidden','932652EFpwaO','1962537rplYMk','Diagnostics','filter','isSingleCommand','command','Platform\x20Issue','Project','538120TgnNDC','519650bFaEhm','BFF\x20Scripts','app','Permissions','defaultCommand','login','service','remote','commands','Authentication','wildcardDef','`rabetbase\x20'];a153_0x7c05=function(){return _0x4b5e7a;};return a153_0x7c05();}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(_0x4e55d5){const _0xbea04c=a153_0x2017;for(const _0x3b3899 of _0x4e55d5){definitions[_0xbea04c(0x106)](_0x3b3899[_0xbea04c(0x125)]+':'+_0x3b3899['command'],_0x3b3899);let _0x590169=serviceGroups[_0xbea04c(0x104)](_0x3b3899[_0xbea04c(0x125)]);!_0x590169&&(_0x590169=[],serviceGroups[_0xbea04c(0x106)](_0x3b3899[_0xbea04c(0x125)],_0x590169)),_0x590169[_0xbea04c(0x12d)](_0x3b3899);}}function registerDeclarativeService(_0x1525eb,_0x25af59,_0x3aebfe){const _0x117486=a153_0x2017;registerDefinitions(_0x25af59);_0x3aebfe?.[_0x117486(0x129)]&&registerDefinitions([_0x3aebfe[_0x117486(0x129)]]);const _0x5699d4=_0x434530=>_0x434530===_0x117486(0x114)?'':_0x434530==='write'?_0x117486(0x101):_0x117486(0x102),_0x4d1e49={'service':_0x25af59[0x0]['service'],'label':_0x1525eb,'commands':_0x25af59[_0x117486(0x119)](_0x863abe=>!_0x863abe[_0x117486(0x115)])[_0x117486(0xf2)](_0x418dbd=>({'command':_0x418dbd[_0x117486(0x11b)],'description':_0x418dbd[_0x117486(0xf5)],'tag':_0x5699d4(_0x418dbd[_0x117486(0xfe)])})),'declarative':!![],'defaultCommand':_0x3aebfe?.[_0x117486(0x123)]??(_0x3aebfe?.[_0x117486(0x11a)]?_0x25af59[0x0][_0x117486(0x11b)]:undefined),'wildcardDef':_0x3aebfe?.[_0x117486(0x129)],'isSingleCommand':_0x3aebfe?.['isSingleCommand']};serviceRegistry[_0x117486(0x12d)](_0x4d1e49),serviceByName[_0x117486(0x106)](_0x4d1e49['service'],_0x4d1e49);}registerDeclarativeService(a153_0x45799f(0x113),initDefinitions,{'defaultCommand':'run','isSingleCommand':!![]}),registerDeclarativeService(a153_0x45799f(0x11d),projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService(a153_0x45799f(0xfa),appDefinitions),registerDeclarativeService(a153_0x45799f(0x128),authDefinitions,{'defaultCommand':a153_0x45799f(0x124)}),registerDeclarativeService(a153_0x45799f(0x12e),datasetDefinitions),registerDeclarativeService(a153_0x45799f(0xf8),pageDefinitions),registerDeclarativeService(a153_0x45799f(0xf4),apiDefinitions),registerDeclarativeService('Instant\x20API',dataDefinitions),registerDeclarativeService(a153_0x45799f(0x120),bffDefinitions),registerDeclarativeService(a153_0x45799f(0x12c),notificationDefinitions),registerDeclarativeService(a153_0x45799f(0x108),sqlDefinitions),registerDeclarativeService(a153_0x45799f(0xfb),dbDefinitions),registerDeclarativeService(a153_0x45799f(0xea),menuDefinitions),registerDeclarativeService(a153_0x45799f(0xf3),taskDefinitions),registerDeclarativeService(a153_0x45799f(0x112),roleDefinitions),registerDeclarativeService(a153_0x45799f(0x122),permitDefinitions),registerDeclarativeService(a153_0x45799f(0xeb),appConfigDefinitions),registerDeclarativeService(a153_0x45799f(0x11c),issueDefinitions),registerDeclarativeService('File',fileDefinitions),registerDeclarativeService(a153_0x45799f(0x105),codegenDefinitions),registerDeclarativeService('Configuration',configDefinitions),registerDeclarativeService(a153_0x45799f(0x118),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a153_0x45799f(0xf1),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a153_0x45799f(0xee),cliSkillDefinitions,{'defaultCommand':a153_0x45799f(0x103)}),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':a153_0x45799f(0x10d)}),registerDeclarativeService(a153_0x45799f(0x10c),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a153_0x45799f(0x10a)]-0x1];last[a153_0x45799f(0x127)]=[{'command':a153_0x45799f(0xf7),'description':a153_0x45799f(0xf0),'tag':''}];}function a153_0x2017(_0x202b4e,_0x171763){_0x202b4e=_0x202b4e-0xe9;const _0x7c05fd=a153_0x7c05();let _0x2017df=_0x7c05fd[_0x202b4e];return _0x2017df;}export const deprecatedAliases={'create':{'service':a153_0x45799f(0xf6),'command':a153_0x45799f(0x111)},'start':{'service':'run','command':'start'},'build':{'service':a153_0x45799f(0xec),'command':a153_0x45799f(0xef)},'preview':{'service':a153_0x45799f(0xec),'command':a153_0x45799f(0xf9)},'logout':{'service':a153_0x45799f(0x100),'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='Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.',APP_USE_REMOVED_HINT=a153_0x45799f(0x107);export function resolveRemovedCommand(_0x2cf024,_0x3456c2){const _0xabb4c0=a153_0x45799f;if(_0x2cf024===_0xabb4c0(0xff)){const _0x6268c1=_0x3456c2?_0xabb4c0(0xe9)+_0x3456c2:_0xabb4c0(0xff);return{'command':_0x6268c1,'message':_0xabb4c0(0x12a)+_0x6268c1+'`\x20has\x20been\x20removed.','hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x2cf024===_0xabb4c0(0x12b))return{'command':_0xabb4c0(0x12b),'message':'`rabetbase\x20skills`\x20has\x20been\x20removed.','hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x2cf024==='app'&&_0x3456c2===_0xabb4c0(0x126))return{'command':'app\x20remote','message':_0xabb4c0(0x10e),'hint':APP_REMOTE_REMOVED_HINT};if(_0x2cf024===_0xabb4c0(0x121)&&_0x3456c2===_0xabb4c0(0xfc))return{'command':_0xabb4c0(0xed),'message':'`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a153_0x45799f(0x111)},'sql':{'new':'create'}};export function resolveDeprecatedSubcommand(_0x2c8f80,_0x527b7e){return deprecatedSubcommands[_0x2c8f80]?.[_0x527b7e];}export function findDefinition(_0x53e2a1,_0x2b9bf2){const _0x19950f=a153_0x45799f;return definitions[_0x19950f(0x104)](_0x53e2a1+':'+_0x2b9bf2);}export function isKnownService(_0x1c64fc){return serviceByName['has'](_0x1c64fc);}export function isDeclarativeService(_0xb9ec0c){const _0x416406=a153_0x45799f;return serviceGroups[_0x416406(0xfd)](_0xb9ec0c)||serviceByName[_0x416406(0x104)](_0xb9ec0c)?.['wildcardDef']!==undefined;}export function getServiceEntry(_0x2a0880){const _0x245284=a153_0x45799f;return serviceByName[_0x245284(0x104)](_0x2a0880);}export function getLegacyHandler(_0x36f8a6,_0x464f5f){return undefined;}export function getAllDefinitions(){return Array['from'](definitions['values']());}
@@ -1 +1 @@
1
- function a154_0xc83b(_0x24eb03,_0x35b3c5){_0x24eb03=_0x24eb03-0xc0;const _0x3c20fc=a154_0x3c20();let _0xc83b7b=_0x3c20fc[_0x24eb03];return _0xc83b7b;}const a154_0x297ef8=a154_0xc83b;(function(_0x37ca4f,_0xe83995){const _0x7c755e=a154_0xc83b,_0x510fd7=_0x37ca4f();while(!![]){try{const _0x1a8c83=-parseInt(_0x7c755e(0xdb))/0x1+-parseInt(_0x7c755e(0xc7))/0x2*(-parseInt(_0x7c755e(0xc3))/0x3)+parseInt(_0x7c755e(0xcf))/0x4*(-parseInt(_0x7c755e(0xc1))/0x5)+-parseInt(_0x7c755e(0xc0))/0x6*(parseInt(_0x7c755e(0xc4))/0x7)+parseInt(_0x7c755e(0xd0))/0x8*(parseInt(_0x7c755e(0xcb))/0x9)+-parseInt(_0x7c755e(0xd9))/0xa+parseInt(_0x7c755e(0xca))/0xb;if(_0x1a8c83===_0xe83995)break;else _0x510fd7['push'](_0x510fd7['shift']());}catch(_0x490fc7){_0x510fd7['push'](_0x510fd7['shift']());}}}(a154_0x3c20,0x54817));import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a154_0x3c20(){const _0x18d017=['validation','24nkoDQh','5RvAfqt','remark','889257BlrwqT','460229BQLeYe','flagMissing','CUSTOM','2hLqTiq','write','create','13848285pUSJSX','90TSswQV','str','/smartapi/permit/role/create','Created\x20role\x20','1605684rTsgZO','242336twxIsF','length','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','appCode','roleName','name','trim','POST','Pass\x20--name\x20<roleName>.','1607050BTfdWG','role','687025SFQLpr','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)'];a154_0x3c20=function(){return _0x18d017;};return a154_0x3c20();}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_0x297ef8(0xcd);function readName(_0x24b0b1){const _0x56d279=a154_0x297ef8,_0x4fdd9e=_0x24b0b1['str'](_0x56d279(0xd5))[_0x56d279(0xd6)]();if(!_0x4fdd9e)throw CliErrors[_0x56d279(0xc5)](_0x56d279(0xd5),_0x56d279(0xd8));if(_0x4fdd9e[_0x56d279(0xd1)]>0x40)throw CliErrors[_0x56d279(0xdd)](_0x56d279(0xd2));return _0x4fdd9e;}export const roleCreate={'service':a154_0x297ef8(0xda),'command':'create','description':a154_0x297ef8(0xdc),'risk':a154_0x297ef8(0xc8),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5a5fae){readName(_0x5a5fae);},async 'dryRun'(_0x2433ab){const _0x2cdae3=a154_0x297ef8,_0x5e8bca=readName(_0x2433ab),_0x3089ac=_0x2433ab[_0x2cdae3(0xcc)](_0x2cdae3(0xc2))[_0x2cdae3(0xd6)]()||undefined;return asDryRunResult({'operation':_0x2cdae3(0xc9),'selector':{'appCode':_0x2433ab[_0x2cdae3(0xd3)],'roleName':_0x5e8bca},'before':null,'after':{'roleName':_0x5e8bca,'roleType':_0x2cdae3(0xc6),'remark':_0x3089ac},'dryRun':!![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},{'method':_0x2cdae3(0xd7),'url':CREATE_PATH});},async 'execute'(_0x4c0879){const _0x21d5a1=a154_0x297ef8,_0x12dd8f=readName(_0x4c0879),_0x45ab65=_0x4c0879['str'](_0x21d5a1(0xc2))[_0x21d5a1(0xd6)]()||undefined,_0x5b25e6=await createAppRole({'appCode':_0x4c0879[_0x21d5a1(0xd3)],'roleName':_0x12dd8f,..._0x45ab65?{'remark':_0x45ab65}:{}});return{'ok':!![],'data':{'operation':'create','selector':{'appCode':_0x4c0879[_0x21d5a1(0xd3)],'roleId':_0x5b25e6['id'],'roleName':_0x12dd8f},'before':null,'after':projectRole(_0x5b25e6),'dryRun':![],'backend':{'method':_0x21d5a1(0xd7),'path':CREATE_PATH},'warnings':[]},'message':_0x21d5a1(0xce)+_0x5b25e6[_0x21d5a1(0xd4)]+'\x20(id='+_0x5b25e6['id']+')'};}};
1
+ const a154_0x154467=a154_0x3411;(function(_0x46ae9e,_0x163aea){const _0x1cfc02=a154_0x3411,_0x49e347=_0x46ae9e();while(!![]){try{const _0x2e263b=parseInt(_0x1cfc02(0xc7))/0x1*(-parseInt(_0x1cfc02(0xc6))/0x2)+parseInt(_0x1cfc02(0xcd))/0x3+parseInt(_0x1cfc02(0xcc))/0x4*(-parseInt(_0x1cfc02(0xc5))/0x5)+parseInt(_0x1cfc02(0xc2))/0x6+parseInt(_0x1cfc02(0xd2))/0x7+parseInt(_0x1cfc02(0xbd))/0x8+parseInt(_0x1cfc02(0xbe))/0x9;if(_0x2e263b===_0x163aea)break;else _0x49e347['push'](_0x49e347['shift']());}catch(_0x22918d){_0x49e347['push'](_0x49e347['shift']());}}}(a154_0x3dcf,0xa46d9));import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a154_0x3dcf(){const _0x503c7b=['name','2822561NkMPqs','write','create','POST','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','215264LWDRwE','9989496IApqcz','Created\x20role\x20','trim','roleName','831942ipXdlE','length','flagMissing','87005MOdHWg','2056398IIjsYe','1NSJYUa','/smartapi/permit/role/create','appCode','role','validation','92dzSzlc','1269561tHbzPG','CUSTOM','str','Pass\x20--name\x20<roleName>.'];a154_0x3dcf=function(){return _0x503c7b;};return a154_0x3dcf();}import{asDryRunResult}from'../../commands/common/dry-run.js';function a154_0x3411(_0x5babe1,_0x114b48){_0x5babe1=_0x5babe1-0xb9;const _0x3dcf4d=a154_0x3dcf();let _0x3411e3=_0x3dcf4d[_0x5babe1];return _0x3411e3;}import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a154_0x154467(0xc8);function readName(_0x28cb16){const _0x2c28f4=a154_0x154467,_0x5b9576=_0x28cb16[_0x2c28f4(0xcf)](_0x2c28f4(0xd1))[_0x2c28f4(0xc0)]();if(!_0x5b9576)throw CliErrors[_0x2c28f4(0xc4)](_0x2c28f4(0xd1),_0x2c28f4(0xd0));if(_0x5b9576[_0x2c28f4(0xc3)]>0x40)throw CliErrors[_0x2c28f4(0xcb)](_0x2c28f4(0xbc));return _0x5b9576;}export const roleCreate={'service':a154_0x154467(0xca),'command':'create','description':'Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','risk':a154_0x154467(0xb9),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4daddb){readName(_0x4daddb);},async 'dryRun'(_0x4ab168){const _0x563a42=a154_0x154467,_0x35ec4a=readName(_0x4ab168),_0x573626=_0x4ab168[_0x563a42(0xcf)]('remark')[_0x563a42(0xc0)]()||undefined;return asDryRunResult({'operation':'create','selector':{'appCode':_0x4ab168[_0x563a42(0xc9)],'roleName':_0x35ec4a},'before':null,'after':{'roleName':_0x35ec4a,'roleType':_0x563a42(0xce),'remark':_0x573626},'dryRun':!![],'backend':{'method':_0x563a42(0xbb),'path':CREATE_PATH},'warnings':[]},{'method':_0x563a42(0xbb),'url':CREATE_PATH});},async 'execute'(_0x21a9fa){const _0x5e5a3e=a154_0x154467,_0x1355d9=readName(_0x21a9fa),_0x2bcb9b=_0x21a9fa['str']('remark')['trim']()||undefined,_0x5cd9ab=await createAppRole({'appCode':_0x21a9fa[_0x5e5a3e(0xc9)],'roleName':_0x1355d9,..._0x2bcb9b?{'remark':_0x2bcb9b}:{}});return{'ok':!![],'data':{'operation':_0x5e5a3e(0xba),'selector':{'appCode':_0x21a9fa[_0x5e5a3e(0xc9)],'roleId':_0x5cd9ab['id'],'roleName':_0x1355d9},'before':null,'after':projectRole(_0x5cd9ab),'dryRun':![],'backend':{'method':_0x5e5a3e(0xbb),'path':CREATE_PATH},'warnings':[]},'message':_0x5e5a3e(0xbf)+_0x5cd9ab[_0x5e5a3e(0xc1)]+'\x20(id='+_0x5cd9ab['id']+')'};}};
@@ -1 +1 @@
1
- const a155_0x309357=a155_0x5d6e;(function(_0x49e5a6,_0x1b8eae){const _0x473210=a155_0x5d6e,_0x1079e2=_0x49e5a6();while(!![]){try{const _0x3fb1fe=-parseInt(_0x473210(0x191))/0x1*(parseInt(_0x473210(0x181))/0x2)+parseInt(_0x473210(0x195))/0x3+-parseInt(_0x473210(0x190))/0x4+parseInt(_0x473210(0x18e))/0x5*(-parseInt(_0x473210(0x18b))/0x6)+parseInt(_0x473210(0x182))/0x7+-parseInt(_0x473210(0x185))/0x8+parseInt(_0x473210(0x184))/0x9*(parseInt(_0x473210(0x197))/0xa);if(_0x3fb1fe===_0x1b8eae)break;else _0x1079e2['push'](_0x1079e2['shift']());}catch(_0x2e54be){_0x1079e2['push'](_0x1079e2['shift']());}}}(a155_0x526d,0x706ec));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a155_0x526d(){const _0x43911c=['Role\x20still\x20has\x20','userCount','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','3680550Tinoxw','POST','roleName','5JVgQTA','num','401272QBVEEy','3buglJN','delete','\x20(id=','Deleted\x20role\x20','357378nHrYpb','appCode','2420QvSVZt','250894JncJya','3510304mlkkhE','high-risk-write','44127tWPfUb','2052128HLdGma','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','/smartapi/permit/role/delete'];a155_0x526d=function(){return _0x43911c;};return a155_0x526d();}function a155_0x5d6e(_0x57691e,_0x63c5a9){_0x57691e=_0x57691e-0x181;const _0x526db3=a155_0x526d();let _0x5d6e10=_0x526db3[_0x57691e];return _0x5d6e10;}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a155_0x309357(0x187);export const roleDelete={'service':'role','command':a155_0x309357(0x192),'description':a155_0x309357(0x186),'risk':a155_0x309357(0x183),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x10ef92){const _0x1bae03=a155_0x309357,_0x5e077a=_0x10ef92[_0x1bae03(0x18f)]('id'),_0x444c3f=await getRoleById(_0x10ef92['appCode'],_0x5e077a);return assertCustomRole(_0x444c3f,_0x1bae03(0x192)),asDryRunResult({'operation':_0x1bae03(0x192),'selector':{'appCode':_0x10ef92['appCode'],'roleId':_0x5e077a,'roleName':_0x444c3f[_0x1bae03(0x18d)]},'before':projectRole(_0x444c3f),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x444c3f[_0x1bae03(0x189)]>0x0?[_0x1bae03(0x188)+_0x444c3f[_0x1bae03(0x189)]+_0x1bae03(0x18a)]:[]},{'method':_0x1bae03(0x18c),'url':DELETE_PATH});},async 'execute'(_0x5a2b9f){const _0x2be3b8=a155_0x309357,_0x531aad=_0x5a2b9f[_0x2be3b8(0x18f)]('id'),_0x39df95=await getRoleById(_0x5a2b9f[_0x2be3b8(0x196)],_0x531aad);return assertCustomRole(_0x39df95,_0x2be3b8(0x192)),await deleteAppRole(_0x531aad),{'ok':!![],'data':{'operation':_0x2be3b8(0x192),'selector':{'appCode':_0x5a2b9f[_0x2be3b8(0x196)],'roleId':_0x531aad,'roleName':_0x39df95['roleName']},'before':projectRole(_0x39df95),'after':null,'dryRun':![],'backend':{'method':_0x2be3b8(0x18c),'path':DELETE_PATH},'warnings':[]},'message':_0x2be3b8(0x194)+_0x39df95['roleName']+_0x2be3b8(0x193)+_0x531aad+')'};}};
1
+ const a155_0x22ed38=a155_0x3ead;function a155_0x11bd(){const _0x29c04e=['\x20(id=','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','role','appCode','Deleted\x20role\x20','4694400iNVeVX','delete','3727878hijLku','/smartapi/permit/role/delete','1225358RXGNib','7vBhujs','2080688WoPtSb','userCount','2532365FinieJ','Role\x20still\x20has\x20','3266166BsvtJb','high-risk-write','1171060DUJANU','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','POST','num','roleName'];a155_0x11bd=function(){return _0x29c04e;};return a155_0x11bd();}(function(_0x39dc8e,_0x158701){const _0x367870=a155_0x3ead,_0x44fa03=_0x39dc8e();while(!![]){try{const _0x3657de=-parseInt(_0x367870(0x76))/0x1+parseInt(_0x367870(0x6e))/0x2+parseInt(_0x367870(0x6c))/0x3+parseInt(_0x367870(0x70))/0x4+-parseInt(_0x367870(0x72))/0x5+-parseInt(_0x367870(0x74))/0x6*(-parseInt(_0x367870(0x6f))/0x7)+-parseInt(_0x367870(0x6a))/0x8;if(_0x3657de===_0x158701)break;else _0x44fa03['push'](_0x44fa03['shift']());}catch(_0x45bdf0){_0x44fa03['push'](_0x44fa03['shift']());}}}(a155_0x11bd,0xa0091));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a155_0x3ead(_0x156ee1,_0x2af492){_0x156ee1=_0x156ee1-0x66;const _0x11bd60=a155_0x11bd();let _0x3ead73=_0x11bd60[_0x156ee1];return _0x3ead73;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a155_0x22ed38(0x6d);export const roleDelete={'service':a155_0x22ed38(0x67),'command':a155_0x22ed38(0x6b),'description':a155_0x22ed38(0x66),'risk':a155_0x22ed38(0x75),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1657cb){const _0x3b2117=a155_0x22ed38,_0x4e7245=_0x1657cb[_0x3b2117(0x79)]('id'),_0x824c76=await getRoleById(_0x1657cb['appCode'],_0x4e7245);return assertCustomRole(_0x824c76,'delete'),asDryRunResult({'operation':'delete','selector':{'appCode':_0x1657cb[_0x3b2117(0x68)],'roleId':_0x4e7245,'roleName':_0x824c76['roleName']},'before':projectRole(_0x824c76),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x824c76['userCount']>0x0?[_0x3b2117(0x73)+_0x824c76[_0x3b2117(0x71)]+_0x3b2117(0x77)]:[]},{'method':_0x3b2117(0x78),'url':DELETE_PATH});},async 'execute'(_0x5e1af9){const _0x10b031=a155_0x22ed38,_0x3b8f51=_0x5e1af9['num']('id'),_0x123050=await getRoleById(_0x5e1af9[_0x10b031(0x68)],_0x3b8f51);return assertCustomRole(_0x123050,_0x10b031(0x6b)),await deleteAppRole(_0x3b8f51),{'ok':!![],'data':{'operation':_0x10b031(0x6b),'selector':{'appCode':_0x5e1af9['appCode'],'roleId':_0x3b8f51,'roleName':_0x123050[_0x10b031(0x7a)]},'before':projectRole(_0x123050),'after':null,'dryRun':![],'backend':{'method':_0x10b031(0x78),'path':DELETE_PATH},'warnings':[]},'message':_0x10b031(0x69)+_0x123050[_0x10b031(0x7a)]+_0x10b031(0x7b)+_0x3b8f51+')'};}};
@@ -1 +1 @@
1
- const a156_0x5a4c59=a156_0x86bb;(function(_0x4c6e1a,_0x198324){const _0x2d2ee0=a156_0x86bb,_0x543c3f=_0x4c6e1a();while(!![]){try{const _0x203c40=-parseInt(_0x2d2ee0(0x90))/0x1+-parseInt(_0x2d2ee0(0x89))/0x2+parseInt(_0x2d2ee0(0x87))/0x3*(-parseInt(_0x2d2ee0(0x8b))/0x4)+parseInt(_0x2d2ee0(0x93))/0x5*(-parseInt(_0x2d2ee0(0x8f))/0x6)+-parseInt(_0x2d2ee0(0x8c))/0x7+-parseInt(_0x2d2ee0(0x8d))/0x8*(parseInt(_0x2d2ee0(0x88))/0x9)+parseInt(_0x2d2ee0(0x8e))/0xa;if(_0x203c40===_0x198324)break;else _0x543c3f['push'](_0x543c3f['shift']());}catch(_0x559c5f){_0x543c3f['push'](_0x543c3f['shift']());}}}(a156_0x2aad,0x44f11));function a156_0x2aad(){const _0x250d07=['192AmghZg','454755QuQQzi','detail','appCode','74390GftNzi','roleType','read','Show\x20a\x20single\x20role\x27s\x20detail','role','num','1081137OtRfAw','213093ixNoWQ','565436hYcfGk','roleName','4qZACYF','1209243grKgql','144vUDQlO','24552680SBHROY'];a156_0x2aad=function(){return _0x250d07;};return a156_0x2aad();}function a156_0x86bb(_0x5466bb,_0x286584){_0x5466bb=_0x5466bb-0x86;const _0x2aadd3=a156_0x2aad();let _0x86bbd7=_0x2aadd3[_0x5466bb];return _0x86bbd7;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a156_0x5a4c59(0x97),'command':a156_0x5a4c59(0x91),'description':a156_0x5a4c59(0x96),'risk':a156_0x5a4c59(0x95),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x217478){const _0x3ce935=a156_0x5a4c59,_0x4ed48c=_0x217478[_0x3ce935(0x86)]('id'),_0x2fc4ad=await getRoleById(_0x217478[_0x3ce935(0x92)],_0x4ed48c);return{'ok':!![],'data':{'role':projectRole(_0x2fc4ad)},'message':'Role\x20'+_0x2fc4ad[_0x3ce935(0x8a)]+'\x20('+_0x2fc4ad[_0x3ce935(0x94)]+')'};}};
1
+ const a156_0x5e77da=a156_0x5d6f;(function(_0x54eda6,_0x5c5956){const _0x435312=a156_0x5d6f,_0x18119c=_0x54eda6();while(!![]){try{const _0x46ecdf=-parseInt(_0x435312(0x73))/0x1*(parseInt(_0x435312(0x7b))/0x2)+parseInt(_0x435312(0x74))/0x3+parseInt(_0x435312(0x75))/0x4*(-parseInt(_0x435312(0x72))/0x5)+parseInt(_0x435312(0x77))/0x6*(parseInt(_0x435312(0x6c))/0x7)+parseInt(_0x435312(0x76))/0x8*(-parseInt(_0x435312(0x70))/0x9)+parseInt(_0x435312(0x6f))/0xa+parseInt(_0x435312(0x7c))/0xb;if(_0x46ecdf===_0x5c5956)break;else _0x18119c['push'](_0x18119c['shift']());}catch(_0x14cf79){_0x18119c['push'](_0x18119c['shift']());}}}(a156_0x336c,0xaf896));function a156_0x5d6f(_0x2fb3d1,_0x5ee7fc){_0x2fb3d1=_0x2fb3d1-0x6b;const _0x336cfa=a156_0x336c();let _0x5d6f18=_0x336cfa[_0x2fb3d1];return _0x5d6f18;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a156_0x336c(){const _0x1b5e06=['12dHKuvn','16zUxtyS','6rwZcsl','appCode','read','Role\x20','86aaqaDR','14003638sfhLRx','detail','Show\x20a\x20single\x20role\x27s\x20detail','4381993pBgQiT','roleType','role','3841570GWfLsI','5591493GZrRlG','roleName','1034080bdlXyM','3877iTGZBA','1396491JEakXR'];a156_0x336c=function(){return _0x1b5e06;};return a156_0x336c();}export const roleDetail={'service':a156_0x5e77da(0x6e),'command':a156_0x5e77da(0x7d),'description':a156_0x5e77da(0x6b),'risk':a156_0x5e77da(0x79),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x515711){const _0x13ec05=a156_0x5e77da,_0x479567=_0x515711['num']('id'),_0x203d7f=await getRoleById(_0x515711[_0x13ec05(0x78)],_0x479567);return{'ok':!![],'data':{'role':projectRole(_0x203d7f)},'message':_0x13ec05(0x7a)+_0x203d7f[_0x13ec05(0x71)]+'\x20('+_0x203d7f[_0x13ec05(0x6d)]+')'};}};
@@ -1 +1 @@
1
- (function(_0x35c5ba,_0x4cd01f){const _0x5d2a5d=a157_0x1443,_0x1b3fd8=_0x35c5ba();while(!![]){try{const _0x55215f=-parseInt(_0x5d2a5d(0x185))/0x1*(-parseInt(_0x5d2a5d(0x190))/0x2)+parseInt(_0x5d2a5d(0x18d))/0x3*(parseInt(_0x5d2a5d(0x18c))/0x4)+-parseInt(_0x5d2a5d(0x186))/0x5*(-parseInt(_0x5d2a5d(0x18b))/0x6)+-parseInt(_0x5d2a5d(0x18a))/0x7*(parseInt(_0x5d2a5d(0x183))/0x8)+-parseInt(_0x5d2a5d(0x18f))/0x9*(-parseInt(_0x5d2a5d(0x18e))/0xa)+-parseInt(_0x5d2a5d(0x187))/0xb*(parseInt(_0x5d2a5d(0x188))/0xc)+-parseInt(_0x5d2a5d(0x184))/0xd*(-parseInt(_0x5d2a5d(0x189))/0xe);if(_0x55215f===_0x4cd01f)break;else _0x1b3fd8['push'](_0x1b3fd8['shift']());}catch(_0xee6c5){_0x1b3fd8['push'](_0x1b3fd8['shift']());}}}(a157_0x5f33,0xc210c));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';function a157_0x1443(_0x3d1c07,_0x1ea734){_0x3d1c07=_0x3d1c07-0x183;const _0x5f33dd=a157_0x5f33();let _0x1443ef=_0x5f33dd[_0x3d1c07];return _0x1443ef;}function a157_0x5f33(){const _0x4dbd20=['480575loyBsb','15712708WjmAzA','12qiKDYA','1064434RZgvqx','77aAdtyc','30QLISsY','452VaFHiz','19545vHSIno','623820OrvFvo','90EGmYMF','373564Hwgjak','797512dkwdjA','221HhznmH','1CwjIut'];a157_0x5f33=function(){return _0x4dbd20;};return a157_0x5f33();}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(_0x3e5b7d,_0x397777){const _0x59d15a=a157_0x281e,_0xf98b3=_0x3e5b7d();while(!![]){try{const _0x2ffa73=-parseInt(_0x59d15a(0x88))/0x1+-parseInt(_0x59d15a(0x8c))/0x2+-parseInt(_0x59d15a(0x82))/0x3*(-parseInt(_0x59d15a(0x8a))/0x4)+parseInt(_0x59d15a(0x85))/0x5*(parseInt(_0x59d15a(0x8b))/0x6)+-parseInt(_0x59d15a(0x83))/0x7+parseInt(_0x59d15a(0x89))/0x8*(-parseInt(_0x59d15a(0x86))/0x9)+-parseInt(_0x59d15a(0x87))/0xa*(-parseInt(_0x59d15a(0x84))/0xb);if(_0x2ffa73===_0x397777)break;else _0xf98b3['push'](_0xf98b3['shift']());}catch(_0x51d4c7){_0xf98b3['push'](_0xf98b3['shift']());}}}(a157_0x458f,0x6454e));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';function a157_0x281e(_0x250c0b,_0x914817){_0x250c0b=_0x250c0b-0x82;const _0x458fbc=a157_0x458f();let _0x281e0e=_0x458fbc[_0x250c0b];return _0x281e0e;}import{roleDelete}from'../../commands/role/delete.js';function a157_0x458f(){const _0x3010ce=['388812PNNigS','2172684BYxmgy','1385426hOfzTv','5192176hyIyQz','35xXIwQT','1017qaHKEM','20afhObA','551628xyazDg','22696rKWnNu','4uNuGUa','6198FsAvKe'];a157_0x458f=function(){return _0x3010ce;};return a157_0x458f();}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
- const a158_0x408e01=a158_0x2011;function a158_0x2a53(){const _0x611baf=['role','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','1502872NclEDf','Found\x20','ADMIN','pagesize','validation','2515938YFMijL','1072236RcKrRb','str','6890712LPucXh','list','CUSTOM','join','Invalid\x20--type\x20\x22','string','1047650GgMwjK','7hcCXXA','3984309ZXVbls','Page\x20size\x20(1-100)','19991286hQpYeF','25XPcLAR','type','map','length','Page\x20index\x20(1-based)','num','DEV','roleType','page','USER','appCode','read','Filter\x20by\x20role\x20type','trim','toUpperCase','number','filter'];a158_0x2a53=function(){return _0x611baf;};return a158_0x2a53();}(function(_0x53cd48,_0xc90a7e){const _0x4e0025=a158_0x2011,_0x78c5af=_0x53cd48();while(!![]){try{const _0x5b3de3=-parseInt(_0x4e0025(0xea))/0x1+parseInt(_0x4e0025(0x107))/0x2+-parseInt(_0x4e0025(0xec))/0x3+-parseInt(_0x4e0025(0xe2))/0x4*(parseInt(_0x4e0025(0xef))/0x5)+parseInt(_0x4e0025(0xe4))/0x6+parseInt(_0x4e0025(0xeb))/0x7*(-parseInt(_0x4e0025(0x102))/0x8)+parseInt(_0x4e0025(0xee))/0x9;if(_0x5b3de3===_0xc90a7e)break;else _0x78c5af['push'](_0x78c5af['shift']());}catch(_0x515e79){_0x78c5af['push'](_0x78c5af['shift']());}}}(a158_0x2a53,0xb0b38));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a158_0x2011(_0x1d84f4,_0x1fd3dc){_0x1d84f4=_0x1d84f4-0xe2;const _0x2a53be=a158_0x2a53();let _0x201199=_0x2a53be[_0x1d84f4];return _0x201199;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a158_0x408e01(0x104),a158_0x408e01(0xf5),a158_0x408e01(0xf8),a158_0x408e01(0xe6)];export const roleList={'service':a158_0x408e01(0x100),'command':a158_0x408e01(0xe5),'description':a158_0x408e01(0x101),'risk':a158_0x408e01(0xfa),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a158_0x408e01(0xf0),'type':a158_0x408e01(0xe9),'required':![],'description':a158_0x408e01(0xfb),'enum':ROLE_TYPES},{'name':'page','type':a158_0x408e01(0xfe),'description':a158_0x408e01(0xf3),'default':0x1},{'name':'pagesize','type':a158_0x408e01(0xfe),'description':a158_0x408e01(0xed),'default':0x64}],async 'validate'(_0x26b791){const _0x3aff76=a158_0x408e01,_0xc5a291=_0x26b791['str']('type')[_0x3aff76(0xfc)]();if(_0xc5a291&&!ROLE_TYPES['includes'](_0xc5a291[_0x3aff76(0xfd)]()))throw CliErrors['validation'](_0x3aff76(0xe8)+_0xc5a291+'\x22.','Use\x20one\x20of:\x20'+ROLE_TYPES[_0x3aff76(0xe7)](',\x20')+'.');const _0x2394e5=_0x26b791[_0x3aff76(0xf4)]('page',0x1),_0x255477=_0x26b791[_0x3aff76(0xf4)](_0x3aff76(0x105),0x64);if(_0x2394e5<0x1)throw CliErrors['validation']('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x255477<0x1||_0x255477>0x64)throw CliErrors[_0x3aff76(0x106)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x161243){const _0x487798=a158_0x408e01,_0x15b295=_0x161243[_0x487798(0xf4)](_0x487798(0xf7),0x1)||0x1,_0x9fbd60=_0x161243[_0x487798(0xf4)]('pagesize',0x64)||0x64,_0x421be=_0x161243[_0x487798(0xe3)](_0x487798(0xf0))['trim']()[_0x487798(0xfd)](),{items:_0x137a1c,paging:_0x2974c9}=await listAppRoles(_0x161243[_0x487798(0xf9)],{'currentPage':_0x15b295,'pageSize':_0x9fbd60}),_0x390db1=_0x421be?_0x137a1c[_0x487798(0xff)](_0x55498c=>_0x55498c[_0x487798(0xf6)]===_0x421be):_0x137a1c,_0x383f91=_0x390db1[_0x487798(0xf1)](projectRole);return{'ok':!![],'data':{'roles':_0x383f91,'paging':_0x2974c9},'message':_0x487798(0x103)+_0x383f91[_0x487798(0xf2)]+'\x20role(s)'};}};
1
+ const a158_0x21ed9e=a158_0x3404;(function(_0x457747,_0xa0118a){const _0x3326f3=a158_0x3404,_0x519955=_0x457747();while(!![]){try{const _0x154b61=parseInt(_0x3326f3(0x10a))/0x1*(parseInt(_0x3326f3(0x104))/0x2)+parseInt(_0x3326f3(0xf5))/0x3*(-parseInt(_0x3326f3(0x103))/0x4)+parseInt(_0x3326f3(0x101))/0x5*(parseInt(_0x3326f3(0xf7))/0x6)+parseInt(_0x3326f3(0x10e))/0x7*(parseInt(_0x3326f3(0xfe))/0x8)+-parseInt(_0x3326f3(0x116))/0x9*(-parseInt(_0x3326f3(0x110))/0xa)+-parseInt(_0x3326f3(0x10b))/0xb*(-parseInt(_0x3326f3(0x105))/0xc)+parseInt(_0x3326f3(0x102))/0xd;if(_0x154b61===_0xa0118a)break;else _0x519955['push'](_0x519955['shift']());}catch(_0x4c6f28){_0x519955['push'](_0x519955['shift']());}}}(a158_0x25e5,0x42773));function a158_0x3404(_0x1bbf56,_0x158543){_0x1bbf56=_0x1bbf56-0xf3;const _0x25e54a=a158_0x25e5();let _0x34047d=_0x25e54a[_0x1bbf56];return _0x34047d;}import{listAppRoles}from'../../core/api-client.js';function a158_0x25e5(){const _0x4315d5=['validation','number','read','includes','map','Found\x20','33SMNUVF','DEV','24YozHFG','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','appCode','Page\x20index\x20(1-based)','num','page','Filter\x20by\x20role\x20type','101224xnvkvo','toUpperCase','trim','101825dxSRYi','1217970cSPbeA','113908evFUJN','33946GJfbkw','84QfDSjr','join','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','ADMIN','type','1VTLNAN','979DgRlgy','string','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','161afXRoy','str','1017250aBvAdQ','roleType','Page\x20size\x20(1-100)','Use\x20one\x20of:\x20','Invalid\x20--type\x20\x22','CUSTOM','9AiLhHP','pagesize','\x20role(s)'];a158_0x25e5=function(){return _0x4315d5;};return a158_0x25e5();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a158_0x21ed9e(0x108),a158_0x21ed9e(0xf6),'USER',a158_0x21ed9e(0x115)];export const roleList={'service':'role','command':'list','description':a158_0x21ed9e(0x107),'risk':a158_0x21ed9e(0x11b),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':a158_0x21ed9e(0x10c),'required':![],'description':a158_0x21ed9e(0xfd),'enum':ROLE_TYPES},{'name':a158_0x21ed9e(0xfc),'type':'number','description':a158_0x21ed9e(0xfa),'default':0x1},{'name':a158_0x21ed9e(0x117),'type':a158_0x21ed9e(0x11a),'description':a158_0x21ed9e(0x112),'default':0x64}],async 'validate'(_0x3d4c01){const _0x111713=a158_0x21ed9e,_0x1a2cee=_0x3d4c01[_0x111713(0x10f)](_0x111713(0x109))['trim']();if(_0x1a2cee&&!ROLE_TYPES[_0x111713(0x11c)](_0x1a2cee[_0x111713(0xff)]()))throw CliErrors[_0x111713(0x119)](_0x111713(0x114)+_0x1a2cee+'\x22.',_0x111713(0x113)+ROLE_TYPES[_0x111713(0x106)](',\x20')+'.');const _0x119625=_0x3d4c01[_0x111713(0xfb)](_0x111713(0xfc),0x1),_0x21672f=_0x3d4c01['num']('pagesize',0x64);if(_0x119625<0x1)throw CliErrors[_0x111713(0x119)](_0x111713(0xf8));if(_0x21672f<0x1||_0x21672f>0x64)throw CliErrors[_0x111713(0x119)](_0x111713(0x10d));},async 'execute'(_0x40457b){const _0xde7c7c=a158_0x21ed9e,_0x3e2169=_0x40457b[_0xde7c7c(0xfb)](_0xde7c7c(0xfc),0x1)||0x1,_0x22cf4a=_0x40457b['num'](_0xde7c7c(0x117),0x64)||0x64,_0x27ee00=_0x40457b[_0xde7c7c(0x10f)]('type')[_0xde7c7c(0x100)]()[_0xde7c7c(0xff)](),{items:_0x58e6c7,paging:_0x515b42}=await listAppRoles(_0x40457b[_0xde7c7c(0xf9)],{'currentPage':_0x3e2169,'pageSize':_0x22cf4a}),_0x43f953=_0x27ee00?_0x58e6c7['filter'](_0x54f8b8=>_0x54f8b8[_0xde7c7c(0x111)]===_0x27ee00):_0x58e6c7,_0x1f80a4=_0x43f953[_0xde7c7c(0xf3)](projectRole);return{'ok':!![],'data':{'roles':_0x1f80a4,'paging':_0x515b42},'message':_0xde7c7c(0xf4)+_0x1f80a4['length']+_0xde7c7c(0x118)};}};
@@ -1 +1 @@
1
- const a159_0x2b9f00=a159_0x2b7c;(function(_0x22c7e2,_0x7efe7a){const _0x597fa2=a159_0x2b7c,_0x44ede2=_0x22c7e2();while(!![]){try{const _0x4d9881=parseInt(_0x597fa2(0x1f2))/0x1*(parseInt(_0x597fa2(0x1ed))/0x2)+parseInt(_0x597fa2(0x1f8))/0x3+-parseInt(_0x597fa2(0x1ce))/0x4*(parseInt(_0x597fa2(0x1cb))/0x5)+-parseInt(_0x597fa2(0x1ea))/0x6+-parseInt(_0x597fa2(0x1d2))/0x7*(-parseInt(_0x597fa2(0x1fd))/0x8)+parseInt(_0x597fa2(0x1ff))/0x9+parseInt(_0x597fa2(0x1d7))/0xa*(-parseInt(_0x597fa2(0x1b4))/0xb);if(_0x4d9881===_0x7efe7a)break;else _0x44ede2['push'](_0x44ede2['shift']());}catch(_0x16a898){_0x44ede2['push'](_0x44ede2['shift']());}}}(a159_0x3f4a,0x840aa));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':a159_0x2b9f00(0x1ee),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a159_0x2b9f00(0x1d1),'type':a159_0x2b9f00(0x1eb),'required':!![],'description':a159_0x2b9f00(0x1ca)};export const USER_REF_FLAG={'name':'user','type':'string','required':!![],'description':a159_0x2b9f00(0x1b1)};export const NAME_FLAG={'name':'name','type':'string','required':!![],'description':a159_0x2b9f00(0x1cc)};export const USER_NAME_FLAG={'name':a159_0x2b9f00(0x1b6),'type':a159_0x2b9f00(0x1eb),'required':!![],'description':a159_0x2b9f00(0x202)};export const REMARK_FLAG={'name':'remark','type':'string','required':![],'description':a159_0x2b9f00(0x1e8)};export const EXPECT_USER_COUNT_FLAG={'name':a159_0x2b9f00(0x1b5),'type':a159_0x2b9f00(0x1ee),'required':![],'description':a159_0x2b9f00(0x1cf)};export const BUILTIN_ROLE_TYPES=[a159_0x2b9f00(0x1f5),a159_0x2b9f00(0x1e9),a159_0x2b9f00(0x1ef)];export function isBuiltinRole(_0x5dbb2c){const _0x406fe1=a159_0x2b9f00;return BUILTIN_ROLE_TYPES[_0x406fe1(0x1f4)](_0x5dbb2c);}export function assertCustomRole(_0x33328f,_0x2a8a84){const _0x252dbc=a159_0x2b9f00;if(_0x33328f[_0x252dbc(0x1d8)]!=='CUSTOM')throw CliErrors[_0x252dbc(0x1c8)](_0x252dbc(0x1f1)+_0x2a8a84+'\x20built-in\x20role\x20'+_0x33328f[_0x252dbc(0x1d0)]+'\x20('+_0x33328f[_0x252dbc(0x1d8)]+').',_0x252dbc(0x201));}export function assertPermConfigurable(_0x4cf64b){const _0x511ec9=a159_0x2b9f00;if(_0x4cf64b[_0x511ec9(0x1d8)]===_0x511ec9(0x1e9)||_0x4cf64b[_0x511ec9(0x1d8)]==='ADMIN')throw CliErrors[_0x511ec9(0x1c8)](_0x511ec9(0x1c0)+_0x4cf64b[_0x511ec9(0x1d0)]+'\x20('+_0x4cf64b[_0x511ec9(0x1d8)]+').',_0x511ec9(0x1fa));}export function projectRole(_0x24196b){const _0x3495c6=a159_0x2b9f00;return{'id':_0x24196b['id'],'roleName':_0x24196b[_0x3495c6(0x1d0)],'roleType':_0x24196b['roleType'],'remark':_0x24196b[_0x3495c6(0x1c6)],'userCount':_0x24196b[_0x3495c6(0x1e0)],'permitCount':_0x24196b['permitCount'],'builtin':isBuiltinRole(_0x24196b[_0x3495c6(0x1d8)])};}export async function resolveRoleRef(_0x3febdb,_0x127fb8){const _0x2c1483=a159_0x2b9f00,_0x2ae97b=_0x127fb8[_0x2c1483(0x200)]();if(!_0x2ae97b)throw CliErrors[_0x2c1483(0x1c8)](_0x2c1483(0x1f6),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x2c1483(0x1bc)](_0x2ae97b))return getRoleById(_0x3febdb,Number(_0x2ae97b));const _0xd9ddd5=await listAllAppRoles(_0x3febdb),_0x846fd5=_0xd9ddd5[_0x2c1483(0x1da)](_0x1dfaf9=>_0x1dfaf9[_0x2c1483(0x1d0)]===_0x2ae97b);if(_0x846fd5['length']===0x0)throw CliErrors[_0x2c1483(0x1c8)](_0x2c1483(0x1c9)+_0x2ae97b+_0x2c1483(0x1d3)+_0x3febdb+'.',_0x2c1483(0x1c2));if(_0x846fd5[_0x2c1483(0x1dc)]>0x1){const _0x1d0eff=_0x846fd5['map'](_0x1daa14=>_0x1daa14['id'])[_0x2c1483(0x1e7)](',\x20');throw CliErrors[_0x2c1483(0x1c8)](_0x2c1483(0x1c9)+_0x2ae97b+_0x2c1483(0x1b2)+_0x1d0eff+').',_0x2c1483(0x1b8));}return _0x846fd5[0x0];}export async function getRoleById(_0x30d157,_0x47410d){const _0x47b232=a159_0x2b9f00,_0x69e615=await getAppRole(_0x47410d);if(!_0x69e615)throw CliErrors[_0x47b232(0x1c8)]('Role\x20id\x20'+_0x47410d+_0x47b232(0x1d5)+_0x30d157+'.',_0x47b232(0x1bd));return _0x69e615;}function a159_0x2b7c(_0x38a45c,_0x1d6288){_0x38a45c=_0x38a45c-0x1b0;const _0x3f4a04=a159_0x3f4a();let _0x2b7c97=_0x3f4a04[_0x38a45c];return _0x2b7c97;}async function listAllAppRoles(_0xc13232){const _0x1dd2d2=a159_0x2b9f00,_0x567a00=0x64,_0x1160d8=[];for(let _0x49bdec=0x1;;_0x49bdec+=0x1){const {items:_0x4daa6b,paging:_0xc7cfab}=await listAppRoles(_0xc13232,{'currentPage':_0x49bdec,'pageSize':_0x567a00});_0x1160d8[_0x1dd2d2(0x1e3)](..._0x4daa6b);if(_0x4daa6b[_0x1dd2d2(0x1dc)]<_0x567a00||_0xc7cfab&&_0x1160d8['length']>=_0xc7cfab[_0x1dd2d2(0x1fb)])return _0x1160d8;}}export async function resolveTenantCode(){const _0x308a2b=a159_0x2b9f00,_0x21f8a8=await getSessionUserInfo(),_0x538416=_0x21f8a8?.['user']?.[_0x308a2b(0x205)]?.[_0x308a2b(0x1e5)];if(!_0x538416)throw CliErrors['authRequired'](_0x308a2b(0x1c5));return _0x538416;}function matchMember(_0x1217d8,_0x37da8d){const _0x49dd61=a159_0x2b9f00,_0x257bf2=_0x37da8d[_0x49dd61(0x200)]()[_0x49dd61(0x1c1)]();return(_0x1217d8[_0x49dd61(0x1cd)]??'')[_0x49dd61(0x1c1)]()===_0x257bf2||(_0x1217d8[_0x49dd61(0x1f9)]??'')[_0x49dd61(0x1c1)]()===_0x257bf2;}export async function resolveUserRef(_0x2dfc6){const _0x1c627b=a159_0x2b9f00,_0x670be3=_0x2dfc6[_0x1c627b(0x200)]();if(!_0x670be3)throw CliErrors[_0x1c627b(0x1c8)](_0x1c627b(0x1fc),_0x1c627b(0x1b7));const _0x21cfe6=await resolveTenantCode(),_0x5b775c=await getTenantMembers(_0x21cfe6);if(/^\d+$/['test'](_0x670be3)){const _0x437e24=Number(_0x670be3),_0x3de7ca=_0x5b775c[_0x1c627b(0x203)](_0xc38d61=>_0xc38d61['userId']===_0x437e24);return{'userId':_0x437e24,'username':_0x3de7ca?.[_0x1c627b(0x1f9)]??String(_0x437e24),'nickname':_0x3de7ca?.['nickname'],'matchedBy':'id'};}const _0x1fa87f=_0x5b775c[_0x1c627b(0x1da)](_0x19c5f8=>matchMember(_0x19c5f8,_0x670be3));if(_0x1fa87f[_0x1c627b(0x1dc)]===0x0)throw CliErrors['validation'](_0x1c627b(0x1c7)+_0x670be3+'\x22.',_0x1c627b(0x1d6));if(_0x1fa87f[_0x1c627b(0x1dc)]>0x1){const _0x3ac3dc=_0x1fa87f['map'](_0x2f48df=>(_0x2f48df['nickname']??_0x2f48df[_0x1c627b(0x1f9)]??'?')+'('+_0x2f48df[_0x1c627b(0x1c3)]+')')[_0x1c627b(0x1e7)](',\x20');throw CliErrors[_0x1c627b(0x1c8)](_0x1c627b(0x1d9)+_0x670be3+_0x1c627b(0x1bf)+_0x3ac3dc+'.',_0x1c627b(0x1b3));}const _0x517c28=_0x1fa87f[0x0];return{'userId':_0x517c28['userId'],'username':_0x517c28['username']??String(_0x517c28['userId']),'nickname':_0x517c28[_0x1c627b(0x1cd)],'matchedBy':_0x1c627b(0x1b6)};}export const UPDATE_USER_LIST_PATH=a159_0x2b9f00(0x1db);function userIdsOf(_0x8f722a){const _0x1dd6e4=a159_0x2b9f00;return(_0x8f722a?.[_0x1dd6e4(0x1e2)]??[])[_0x1dd6e4(0x1fe)](_0x14a666=>_0x14a666[_0x1dd6e4(0x1c3)]);}export function computeRoleUserMutation(_0x3401e4){const _0x3943ce=a159_0x2b9f00,{operation:_0x3b5cc2,appCode:_0x551cc3,roleUsers:_0x5243ac,targetRoleId:_0x34d98e,user:_0x57ceea}=_0x3401e4,_0x434cac=_0x5243ac[_0x3943ce(0x203)](_0x119c41=>_0x119c41['id']===_0x34d98e);if(!_0x434cac)throw CliErrors[_0x3943ce(0x1c8)](_0x3943ce(0x204)+_0x34d98e+_0x3943ce(0x1b9),_0x3943ce(0x1bd));const _0x332280=userIdsOf(_0x434cac),_0x5b7ca8=[];if(_0x3401e4[_0x3943ce(0x1de)]!==undefined&&_0x3401e4[_0x3943ce(0x1de)]!==_0x332280[_0x3943ce(0x1dc)])throw CliErrors[_0x3943ce(0x1c8)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x3401e4[_0x3943ce(0x1de)]+_0x3943ce(0x1d4)+_0x332280[_0x3943ce(0x1dc)]+'.',_0x3943ce(0x1b0));const _0x5b0b93=_0x332280[_0x3943ce(0x1f4)](_0x57ceea[_0x3943ce(0x1c3)]);let _0x250fbd=![];const _0x2ecfa6=[..._0x434cac[_0x3943ce(0x1e2)]];if(_0x3b5cc2===_0x3943ce(0x1e1))_0x5b0b93?_0x5b7ca8[_0x3943ce(0x1e3)](_0x3943ce(0x1f0)+_0x57ceea[_0x3943ce(0x1c3)]+_0x3943ce(0x1ec)+_0x434cac['roleName']+_0x3943ce(0x1f7)):(_0x2ecfa6[_0x3943ce(0x1e3)]({'userId':_0x57ceea[_0x3943ce(0x1c3)],'username':_0x57ceea[_0x3943ce(0x1f9)],..._0x57ceea[_0x3943ce(0x1cd)]?{'nickname':_0x57ceea[_0x3943ce(0x1cd)]}:{}}),_0x250fbd=!![]);else{if(!_0x5b0b93)_0x5b7ca8['push'](_0x3943ce(0x1f0)+_0x57ceea[_0x3943ce(0x1c3)]+_0x3943ce(0x1df)+_0x434cac[_0x3943ce(0x1d0)]+';\x20no\x20change.');else{const _0x1fcda9=_0x2ecfa6[_0x3943ce(0x1bb)](_0x15c812=>_0x15c812[_0x3943ce(0x1c3)]===_0x57ceea['userId']);if(_0x1fcda9>=0x0)_0x2ecfa6[_0x3943ce(0x1dd)](_0x1fcda9,0x1);_0x250fbd=!![];}}const _0x4ae16a=_0x5243ac[_0x3943ce(0x1fe)](_0x559a29=>_0x559a29['id']===_0x34d98e?{..._0x559a29,'userList':_0x2ecfa6}:_0x559a29),_0x58b2db=_0x2ecfa6['map'](_0x5e1335=>_0x5e1335['userId']),_0x2787d5={'operation':_0x3b5cc2,'selector':{'appCode':_0x551cc3,'roleId':_0x34d98e,'roleName':_0x434cac[_0x3943ce(0x1d0)],'userId':_0x57ceea[_0x3943ce(0x1c3)]},'before':{'userIds':_0x332280},'after':{'userIds':_0x58b2db},'dryRun':_0x3401e4[_0x3943ce(0x1c4)],'backend':{'method':_0x3943ce(0x1e4),'path':UPDATE_USER_LIST_PATH},'warnings':_0x5b7ca8};return{'roleList':_0x4ae16a,'mutation':_0x2787d5,'changed':_0x250fbd};}export async function loadRoleUsers(_0x50e3a3){return listRoleUsers(_0x50e3a3);}export function readRoleRef(_0x3f40b5){const _0x26b612=a159_0x2b9f00,_0x2714=_0x3f40b5['str'](_0x26b612(0x1d1))[_0x26b612(0x200)]();if(!_0x2714)throw CliErrors[_0x26b612(0x1e6)](_0x26b612(0x1d1),'Pass\x20--role\x20<id|name>.');return _0x2714;}export async function prepareUserMutation(_0x155845,_0x14d805,_0x5b3166){const _0x5b3a2c=a159_0x2b9f00,_0x36f149=readRoleRef(_0x155845),_0x77a4bf=_0x155845['str']('user')[_0x5b3a2c(0x200)]();if(!_0x77a4bf)throw CliErrors['flagMissing'](_0x5b3a2c(0x1ba),_0x5b3a2c(0x1b7));const _0x1575bd=_0x155845[_0x5b3a2c(0x1f3)](_0x5b3a2c(0x1b5)),_0x3b2f1f=_0x1575bd===undefined||_0x1575bd===null?undefined:Number(_0x1575bd),_0x410812=await resolveRoleRef(_0x155845[_0x5b3a2c(0x1be)],_0x36f149),_0x50258d=await resolveUserRef(_0x77a4bf),_0x4535d1=await loadRoleUsers(_0x155845['appCode']);return computeRoleUserMutation({'operation':_0x14d805,'appCode':_0x155845[_0x5b3a2c(0x1be)],'roleUsers':_0x4535d1,'targetRoleId':_0x410812['id'],'user':{'userId':_0x50258d[_0x5b3a2c(0x1c3)],'username':_0x50258d[_0x5b3a2c(0x1f9)],'nickname':_0x50258d['nickname']},'dryRun':_0x5b3166,..._0x3b2f1f!==undefined?{'expectUserCount':_0x3b2f1f}:{}});}function a159_0x3f4a(){const _0x4d02de=['No\x20tenant\x20member\x20matches\x20\x22','validation','Role\x20name\x20\x22','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','3410siJGRJ','Role\x20name','nickname','2264bgDfSV','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','roleName','role','133SWpeQO','\x22\x20not\x20found\x20in\x20app\x20','\x20member(s)\x20but\x20role\x20has\x20','\x20not\x20found\x20in\x20app\x20','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','1051040CqQiKJ','roleType','Multiple\x20tenant\x20members\x20match\x20\x22','filter','/smartapi/permit/user-role/update-user-list','length','splice','expectUserCount','\x20is\x20not\x20a\x20member\x20of\x20role\x20','userCount','user-add','userList','push','POST','tenant_code','flagMissing','join','Optional\x20role\x20remark/description','DEV','375432unObvN','string','\x20is\x20already\x20a\x20member\x20of\x20role\x20','6XsUjRa','number','USER','User\x20','Cannot\x20','53039iNIgSk','flag','includes','ADMIN','Missing\x20role\x20reference.',';\x20no\x20change.','1165743qIuhuH','username','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','totalCount','Missing\x20user\x20reference.','280120shunRv','map','1771731NKuzSn','trim','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','find','Role\x20id\x20','tenant','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','\x22\x20is\x20ambiguous\x20(ids:\x20','Disambiguate\x20with\x20--user\x20<id>.','44RoOjaS','expect-user-count','name','Pass\x20--user\x20<id|name>.','Disambiguate\x20with\x20--role\x20<id>.','\x20not\x20found\x20in\x20the\x20user-role\x20list.','user','findIndex','test','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','appCode','\x22:\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','toLowerCase','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','userId','dryRun','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','remark'];a159_0x3f4a=function(){return _0x4d02de;};return a159_0x3f4a();}
1
+ const a159_0x5982d2=a159_0x9419;(function(_0x2300f1,_0x1f5af2){const _0x4ae676=a159_0x9419,_0x50eeb7=_0x2300f1();while(!![]){try{const _0x5879df=-parseInt(_0x4ae676(0xe8))/0x1+parseInt(_0x4ae676(0x10a))/0x2*(-parseInt(_0x4ae676(0xf3))/0x3)+-parseInt(_0x4ae676(0x101))/0x4+parseInt(_0x4ae676(0xf1))/0x5*(parseInt(_0x4ae676(0x112))/0x6)+-parseInt(_0x4ae676(0xed))/0x7*(parseInt(_0x4ae676(0xf8))/0x8)+-parseInt(_0x4ae676(0xf5))/0x9*(parseInt(_0x4ae676(0xdf))/0xa)+parseInt(_0x4ae676(0x111))/0xb;if(_0x5879df===_0x1f5af2)break;else _0x50eeb7['push'](_0x50eeb7['shift']());}catch(_0x698c56){_0x50eeb7['push'](_0x50eeb7['shift']());}}}(a159_0x5b76,0x596fc));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_0x5982d2(0xef)};export const ROLE_REF_FLAG={'name':a159_0x5982d2(0xe9),'type':a159_0x5982d2(0x108),'required':!![],'description':a159_0x5982d2(0x10b)};export const USER_REF_FLAG={'name':'user','type':a159_0x5982d2(0x108),'required':!![],'description':a159_0x5982d2(0xd8)};export const NAME_FLAG={'name':a159_0x5982d2(0x113),'type':a159_0x5982d2(0x108),'required':!![],'description':a159_0x5982d2(0x10d)};export const USER_NAME_FLAG={'name':'name','type':'string','required':!![],'description':a159_0x5982d2(0xe1)};export const REMARK_FLAG={'name':a159_0x5982d2(0x11a),'type':a159_0x5982d2(0x108),'required':![],'description':a159_0x5982d2(0xfb)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':'number','required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=['ADMIN',a159_0x5982d2(0xee),a159_0x5982d2(0x10f)];export function isBuiltinRole(_0x25ecf5){const _0x3131d7=a159_0x5982d2;return BUILTIN_ROLE_TYPES[_0x3131d7(0x100)](_0x25ecf5);}export function assertCustomRole(_0x1e8df0,_0x4fff87){const _0x14cc8d=a159_0x5982d2;if(_0x1e8df0['roleType']!==_0x14cc8d(0x11b))throw CliErrors['validation'](_0x14cc8d(0x10e)+_0x4fff87+_0x14cc8d(0xf7)+_0x1e8df0[_0x14cc8d(0x104)]+'\x20('+_0x1e8df0['roleType']+').',_0x14cc8d(0x120));}export function assertPermConfigurable(_0x5bbc4b){const _0x7425b4=a159_0x5982d2;if(_0x5bbc4b[_0x7425b4(0xde)]===_0x7425b4(0xee)||_0x5bbc4b[_0x7425b4(0xde)]===_0x7425b4(0xfd))throw CliErrors[_0x7425b4(0xf6)](_0x7425b4(0x121)+_0x5bbc4b[_0x7425b4(0x104)]+'\x20('+_0x5bbc4b['roleType']+').',_0x7425b4(0xdb));}export function projectRole(_0x9afa1b){const _0x483cff=a159_0x5982d2;return{'id':_0x9afa1b['id'],'roleName':_0x9afa1b[_0x483cff(0x104)],'roleType':_0x9afa1b[_0x483cff(0xde)],'remark':_0x9afa1b[_0x483cff(0x11a)],'userCount':_0x9afa1b['userCount'],'permitCount':_0x9afa1b[_0x483cff(0xdd)],'builtin':isBuiltinRole(_0x9afa1b['roleType'])};}export async function resolveRoleRef(_0xd9571f,_0x42173b){const _0x298a24=a159_0x5982d2,_0x127e1c=_0x42173b[_0x298a24(0x109)]();if(!_0x127e1c)throw CliErrors[_0x298a24(0xf6)](_0x298a24(0x117),_0x298a24(0xe6));if(/^\d+$/[_0x298a24(0xff)](_0x127e1c))return getRoleById(_0xd9571f,Number(_0x127e1c));const _0xa2dafe=await listAllAppRoles(_0xd9571f),_0x2aff54=_0xa2dafe[_0x298a24(0xdc)](_0x231a38=>_0x231a38[_0x298a24(0x104)]===_0x127e1c);if(_0x2aff54[_0x298a24(0x11c)]===0x0)throw CliErrors[_0x298a24(0xf6)](_0x298a24(0xe7)+_0x127e1c+'\x22\x20not\x20found\x20in\x20app\x20'+_0xd9571f+'.',_0x298a24(0xe3));if(_0x2aff54[_0x298a24(0x11c)]>0x1){const _0x1a8271=_0x2aff54[_0x298a24(0x110)](_0x4d475c=>_0x4d475c['id'])[_0x298a24(0x11d)](',\x20');throw CliErrors[_0x298a24(0xf6)](_0x298a24(0xe7)+_0x127e1c+_0x298a24(0x115)+_0x1a8271+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x2aff54[0x0];}export async function getRoleById(_0x2492ef,_0x52e499){const _0x278864=a159_0x5982d2,_0x33570a=await getAppRole(_0x52e499);if(!_0x33570a)throw CliErrors[_0x278864(0xf6)](_0x278864(0xd7)+_0x52e499+'\x20not\x20found\x20in\x20app\x20'+_0x2492ef+'.',_0x278864(0x114));return _0x33570a;}async function listAllAppRoles(_0x372362){const _0x4c7bf4=a159_0x5982d2,_0x43fb68=0x64,_0x24116d=[];for(let _0x2b210c=0x1;;_0x2b210c+=0x1){const {items:_0x102863,paging:_0x498591}=await listAppRoles(_0x372362,{'currentPage':_0x2b210c,'pageSize':_0x43fb68});_0x24116d[_0x4c7bf4(0xf0)](..._0x102863);if(_0x102863[_0x4c7bf4(0x11c)]<_0x43fb68||_0x498591&&_0x24116d[_0x4c7bf4(0x11c)]>=_0x498591['totalCount'])return _0x24116d;}}export async function resolveTenantCode(){const _0x18c19d=a159_0x5982d2,_0x566e45=await getSessionUserInfo(),_0xc292f6=_0x566e45?.[_0x18c19d(0x118)]?.['tenant']?.[_0x18c19d(0xec)];if(!_0xc292f6)throw CliErrors['authRequired'](_0x18c19d(0x10c));return _0xc292f6;}function matchMember(_0x3c95f8,_0x1c60e9){const _0x5d8c28=a159_0x5982d2,_0x559287=_0x1c60e9[_0x5d8c28(0x109)]()[_0x5d8c28(0x107)]();return(_0x3c95f8[_0x5d8c28(0x122)]??'')[_0x5d8c28(0x107)]()===_0x559287||(_0x3c95f8[_0x5d8c28(0x116)]??'')['toLowerCase']()===_0x559287;}export async function resolveUserRef(_0x1c1ab2){const _0x3b3c57=a159_0x5982d2,_0x373ad9=_0x1c1ab2['trim']();if(!_0x373ad9)throw CliErrors[_0x3b3c57(0xf6)]('Missing\x20user\x20reference.',_0x3b3c57(0xfe));const _0x4e07fc=await resolveTenantCode(),_0x125091=await getTenantMembers(_0x4e07fc);if(/^\d+$/['test'](_0x373ad9)){const _0x5e18cf=Number(_0x373ad9),_0x5bc0e8=_0x125091[_0x3b3c57(0x102)](_0x278631=>_0x278631[_0x3b3c57(0x11f)]===_0x5e18cf);return{'userId':_0x5e18cf,'username':_0x5bc0e8?.['username']??String(_0x5e18cf),'nickname':_0x5bc0e8?.[_0x3b3c57(0x122)],'matchedBy':'id'};}const _0x46d8f9=_0x125091[_0x3b3c57(0xdc)](_0x1a68d3=>matchMember(_0x1a68d3,_0x373ad9));if(_0x46d8f9[_0x3b3c57(0x11c)]===0x0)throw CliErrors[_0x3b3c57(0xf6)](_0x3b3c57(0xeb)+_0x373ad9+'\x22.',_0x3b3c57(0x119));if(_0x46d8f9['length']>0x1){const _0x3c06cb=_0x46d8f9[_0x3b3c57(0x110)](_0x13e65b=>(_0x13e65b[_0x3b3c57(0x122)]??_0x13e65b[_0x3b3c57(0x116)]??'?')+'('+_0x13e65b[_0x3b3c57(0x11f)]+')')[_0x3b3c57(0x11d)](',\x20');throw CliErrors[_0x3b3c57(0xf6)](_0x3b3c57(0xe2)+_0x373ad9+_0x3b3c57(0xd6)+_0x3c06cb+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x4d0b9b=_0x46d8f9[0x0];return{'userId':_0x4d0b9b[_0x3b3c57(0x11f)],'username':_0x4d0b9b[_0x3b3c57(0x116)]??String(_0x4d0b9b[_0x3b3c57(0x11f)]),'nickname':_0x4d0b9b[_0x3b3c57(0x122)],'matchedBy':_0x3b3c57(0x113)};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x24f3a5){const _0x5eab94=a159_0x5982d2;return(_0x24f3a5?.[_0x5eab94(0xf9)]??[])[_0x5eab94(0x110)](_0x469bbb=>_0x469bbb[_0x5eab94(0x11f)]);}export function computeRoleUserMutation(_0x43234d){const _0x25c9fb=a159_0x5982d2,{operation:_0x3a09d1,appCode:_0x5afb2e,roleUsers:_0x40a9eb,targetRoleId:_0x3f341a,user:_0xf7d95}=_0x43234d,_0x2eb5ca=_0x40a9eb[_0x25c9fb(0x102)](_0x454aad=>_0x454aad['id']===_0x3f341a);if(!_0x2eb5ca)throw CliErrors[_0x25c9fb(0xf6)](_0x25c9fb(0xd7)+_0x3f341a+'\x20not\x20found\x20in\x20the\x20user-role\x20list.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');const _0x5df2bb=userIdsOf(_0x2eb5ca),_0x4e7818=[];if(_0x43234d[_0x25c9fb(0xf4)]!==undefined&&_0x43234d[_0x25c9fb(0xf4)]!==_0x5df2bb[_0x25c9fb(0x11c)])throw CliErrors['validation'](_0x25c9fb(0xd9)+_0x43234d[_0x25c9fb(0xf4)]+_0x25c9fb(0x105)+_0x5df2bb[_0x25c9fb(0x11c)]+'.',_0x25c9fb(0xe0));const _0x198ab4=_0x5df2bb['includes'](_0xf7d95[_0x25c9fb(0x11f)]);let _0x1a7739=![];const _0x31e010=[..._0x2eb5ca[_0x25c9fb(0xf9)]];if(_0x3a09d1===_0x25c9fb(0xf2))_0x198ab4?_0x4e7818[_0x25c9fb(0xf0)](_0x25c9fb(0xfc)+_0xf7d95[_0x25c9fb(0x11f)]+_0x25c9fb(0x106)+_0x2eb5ca[_0x25c9fb(0x104)]+';\x20no\x20change.'):(_0x31e010['push']({'userId':_0xf7d95[_0x25c9fb(0x11f)],'username':_0xf7d95[_0x25c9fb(0x116)],..._0xf7d95[_0x25c9fb(0x122)]?{'nickname':_0xf7d95['nickname']}:{}}),_0x1a7739=!![]);else{if(!_0x198ab4)_0x4e7818[_0x25c9fb(0xf0)](_0x25c9fb(0xfc)+_0xf7d95['userId']+_0x25c9fb(0x11e)+_0x2eb5ca[_0x25c9fb(0x104)]+';\x20no\x20change.');else{const _0x40de2a=_0x31e010['findIndex'](_0x1d9af4=>_0x1d9af4['userId']===_0xf7d95['userId']);if(_0x40de2a>=0x0)_0x31e010[_0x25c9fb(0x103)](_0x40de2a,0x1);_0x1a7739=!![];}}const _0x90781=_0x40a9eb['map'](_0x4fdf74=>_0x4fdf74['id']===_0x3f341a?{..._0x4fdf74,'userList':_0x31e010}:_0x4fdf74),_0x5204ce=_0x31e010[_0x25c9fb(0x110)](_0x28b01b=>_0x28b01b['userId']),_0x222024={'operation':_0x3a09d1,'selector':{'appCode':_0x5afb2e,'roleId':_0x3f341a,'roleName':_0x2eb5ca[_0x25c9fb(0x104)],'userId':_0xf7d95['userId']},'before':{'userIds':_0x5df2bb},'after':{'userIds':_0x5204ce},'dryRun':_0x43234d[_0x25c9fb(0xe5)],'backend':{'method':'POST','path':UPDATE_USER_LIST_PATH},'warnings':_0x4e7818};return{'roleList':_0x90781,'mutation':_0x222024,'changed':_0x1a7739};}function a159_0x9419(_0x425dba,_0x4ab4cf){_0x425dba=_0x425dba-0xd6;const _0x5b76f8=a159_0x5b76();let _0x94193c=_0x5b76f8[_0x425dba];return _0x94193c;}function a159_0x5b76(){const _0x5c874=['dryRun','Pass\x20--role\x20<id|name>.','Role\x20name\x20\x22','342818btYmTc','role','flag','No\x20tenant\x20member\x20matches\x20\x22','tenant_code','45024yKyqFR','DEV','Role\x20id\x20(from\x20`role\x20list`)','push','10uEwmFH','user-add','14613pOFISv','expectUserCount','1746FSIZPP','validation','\x20built-in\x20role\x20','304zLZwuw','userList','flagMissing','Optional\x20role\x20remark/description','User\x20','ADMIN','Pass\x20--user\x20<id|name>.','test','includes','2413704ASooVK','find','splice','roleName','\x20member(s)\x20but\x20role\x20has\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','toLowerCase','string','trim','214gINDad','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Role\x20name','Cannot\x20','USER','map','19586127Sztdim','2033034xBfuQn','name','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','\x22\x20is\x20ambiguous\x20(ids:\x20','username','Missing\x20role\x20reference.','user','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','remark','CUSTOM','length','join','\x20is\x20not\x20a\x20member\x20of\x20role\x20','userId','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','nickname','expect-user-count','\x22:\x20','Role\x20id\x20','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Anti-drift\x20check\x20failed:\x20expected\x20','str','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','filter','permitCount','roleType','19590piOZqt','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Multiple\x20tenant\x20members\x20match\x20\x22','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','appCode'];a159_0x5b76=function(){return _0x5c874;};return a159_0x5b76();}export async function loadRoleUsers(_0x11d8f5){return listRoleUsers(_0x11d8f5);}export function readRoleRef(_0x28ad9a){const _0x2b9311=a159_0x5982d2,_0x55dec7=_0x28ad9a[_0x2b9311(0xda)](_0x2b9311(0xe9))[_0x2b9311(0x109)]();if(!_0x55dec7)throw CliErrors['flagMissing']('role',_0x2b9311(0xe6));return _0x55dec7;}export async function prepareUserMutation(_0x435a77,_0x448015,_0x595f76){const _0x427c3c=a159_0x5982d2,_0x1c20e6=readRoleRef(_0x435a77),_0xbfc475=_0x435a77[_0x427c3c(0xda)](_0x427c3c(0x118))['trim']();if(!_0xbfc475)throw CliErrors[_0x427c3c(0xfa)](_0x427c3c(0x118),_0x427c3c(0xfe));const _0x4fe010=_0x435a77[_0x427c3c(0xea)](_0x427c3c(0x123)),_0x58b12f=_0x4fe010===undefined||_0x4fe010===null?undefined:Number(_0x4fe010),_0x470851=await resolveRoleRef(_0x435a77[_0x427c3c(0xe4)],_0x1c20e6),_0x38add3=await resolveUserRef(_0xbfc475),_0x25ea5e=await loadRoleUsers(_0x435a77['appCode']);return computeRoleUserMutation({'operation':_0x448015,'appCode':_0x435a77[_0x427c3c(0xe4)],'roleUsers':_0x25ea5e,'targetRoleId':_0x470851['id'],'user':{'userId':_0x38add3['userId'],'username':_0x38add3['username'],'nickname':_0x38add3[_0x427c3c(0x122)]},'dryRun':_0x595f76,..._0x58b12f!==undefined?{'expectUserCount':_0x58b12f}:{}});}
@@ -1 +1 @@
1
- const a160_0x157a8a=a160_0x12e0;(function(_0x1b4ee4,_0x24af76){const _0x2c9ae1=a160_0x12e0,_0x64ecf0=_0x1b4ee4();while(!![]){try{const _0x361f44=-parseInt(_0x2c9ae1(0xa0))/0x1*(-parseInt(_0x2c9ae1(0x96))/0x2)+-parseInt(_0x2c9ae1(0x9e))/0x3+-parseInt(_0x2c9ae1(0x9b))/0x4*(-parseInt(_0x2c9ae1(0x92))/0x5)+parseInt(_0x2c9ae1(0x8e))/0x6*(-parseInt(_0x2c9ae1(0xa6))/0x7)+parseInt(_0x2c9ae1(0x99))/0x8+-parseInt(_0x2c9ae1(0xa5))/0x9+-parseInt(_0x2c9ae1(0x91))/0xa;if(_0x361f44===_0x24af76)break;else _0x64ecf0['push'](_0x64ecf0['shift']());}catch(_0x3a6c27){_0x64ecf0['push'](_0x64ecf0['shift']());}}}(a160_0x40cb,0x97e43));import{updateAppRole}from'../../core/api-client.js';function a160_0x40cb(){const _0x1b9af8=['205Iagwpq','update','remark','Updated\x20role\x20','2ipvhvM','roleName','num','8713248pfGqdP','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','103036vxaISy','name','length','246117YXgkYt','New\x20role\x20name','845333sedpKU','appCode','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','string','flag','11114757XDthRS','301yvhbLa','\x20(id=','validation','role','write','--name\x20cannot\x20be\x20empty.','39306GpYFcK','POST','Nothing\x20to\x20update.','7697560auvLmy'];a160_0x40cb=function(){return _0x1b9af8;};return a160_0x40cb();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a160_0x12e0(_0x877e4e,_0x212784){_0x877e4e=_0x877e4e-0x8e;const _0x40cb1c=a160_0x40cb();let _0x12e03f=_0x40cb1c[_0x877e4e];return _0x12e03f;}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(_0x9456ab){const _0x2c70d7=a160_0x12e0,_0x3129db=_0x9456ab[_0x2c70d7(0xa4)]('name'),_0x51b134=_0x9456ab['flag'](_0x2c70d7(0x94)),_0xc6fd73={};if(_0x3129db!==undefined&&_0x3129db!==null){const _0xbe6223=String(_0x3129db)['trim']();if(!_0xbe6223)throw CliErrors[_0x2c70d7(0xa8)](_0x2c70d7(0xab));if(_0xbe6223[_0x2c70d7(0x9d)]>0x40)throw CliErrors[_0x2c70d7(0xa8)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0xc6fd73[_0x2c70d7(0x97)]=_0xbe6223;}_0x51b134!==undefined&&_0x51b134!==null&&(_0xc6fd73[_0x2c70d7(0x94)]=String(_0x51b134));if(_0xc6fd73[_0x2c70d7(0x97)]===undefined&&_0xc6fd73[_0x2c70d7(0x94)]===undefined)throw CliErrors[_0x2c70d7(0xa8)](_0x2c70d7(0x90),_0x2c70d7(0xa2));return _0xc6fd73;}export const roleUpdate={'service':a160_0x157a8a(0xa9),'command':a160_0x157a8a(0x93),'description':a160_0x157a8a(0x9a),'risk':a160_0x157a8a(0xaa),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a160_0x157a8a(0x9c),'type':a160_0x157a8a(0xa3),'required':![],'description':a160_0x157a8a(0x9f)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x62b27e){readPatch(_0x62b27e);},async 'dryRun'(_0x56fa7e){const _0x4dfe93=a160_0x157a8a,_0x1c5341=_0x56fa7e[_0x4dfe93(0x98)]('id'),_0x527fa2=readPatch(_0x56fa7e),_0xdb5352=await getRoleById(_0x56fa7e[_0x4dfe93(0xa1)],_0x1c5341);return assertCustomRole(_0xdb5352,_0x4dfe93(0x93)),asDryRunResult({'operation':_0x4dfe93(0x93),'selector':{'appCode':_0x56fa7e[_0x4dfe93(0xa1)],'roleId':_0x1c5341,'roleName':_0xdb5352[_0x4dfe93(0x97)]},'before':projectRole(_0xdb5352),'after':projectRole({..._0xdb5352,..._0x527fa2['roleName']!==undefined?{'roleName':_0x527fa2[_0x4dfe93(0x97)]}:{},..._0x527fa2[_0x4dfe93(0x94)]!==undefined?{'remark':_0x527fa2[_0x4dfe93(0x94)]}:{}}),'dryRun':!![],'backend':{'method':_0x4dfe93(0x8f),'path':UPDATE_PATH},'warnings':[]},{'method':_0x4dfe93(0x8f),'url':UPDATE_PATH});},async 'execute'(_0x2c2d39){const _0x193559=a160_0x157a8a,_0x4e8473=_0x2c2d39[_0x193559(0x98)]('id'),_0x585f55=readPatch(_0x2c2d39),_0xc3a137=await getRoleById(_0x2c2d39[_0x193559(0xa1)],_0x4e8473);assertCustomRole(_0xc3a137,_0x193559(0x93)),await updateAppRole({'id':_0x4e8473,'appCode':_0x2c2d39['appCode'],..._0x585f55['roleName']!==undefined?{'roleName':_0x585f55[_0x193559(0x97)]}:{},..._0x585f55[_0x193559(0x94)]!==undefined?{'remark':_0x585f55[_0x193559(0x94)]}:{}});const _0x1f3c42=await getRoleById(_0x2c2d39[_0x193559(0xa1)],_0x4e8473);return{'ok':!![],'data':{'operation':_0x193559(0x93),'selector':{'appCode':_0x2c2d39[_0x193559(0xa1)],'roleId':_0x4e8473,'roleName':_0x1f3c42['roleName']},'before':projectRole(_0xc3a137),'after':projectRole(_0x1f3c42),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x193559(0x95)+_0x1f3c42[_0x193559(0x97)]+_0x193559(0xa7)+_0x4e8473+')'};}};
1
+ const a160_0x54e229=a160_0x208a;(function(_0xd92db6,_0x4edf84){const _0x10b687=a160_0x208a,_0x54e5bf=_0xd92db6();while(!![]){try{const _0x4f7764=-parseInt(_0x10b687(0xdb))/0x1+-parseInt(_0x10b687(0xda))/0x2*(parseInt(_0x10b687(0xd0))/0x3)+-parseInt(_0x10b687(0xcf))/0x4*(-parseInt(_0x10b687(0xdc))/0x5)+-parseInt(_0x10b687(0xc9))/0x6+-parseInt(_0x10b687(0xd1))/0x7*(parseInt(_0x10b687(0xc5))/0x8)+parseInt(_0x10b687(0xd6))/0x9+parseInt(_0x10b687(0xdd))/0xa;if(_0x4f7764===_0x4edf84)break;else _0x54e5bf['push'](_0x54e5bf['shift']());}catch(_0xe2be36){_0x54e5bf['push'](_0x54e5bf['shift']());}}}(a160_0x562b,0x97a03));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a160_0x562b(){const _0x5a2a02=['POST','appCode','update','3843084RJuElJ','177NxEqZl','2619239lkggVI','num','/smartapi/permit/role/update','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','validation','6148476NTwLIe','name','write','--name\x20cannot\x20be\x20empty.','9394lgxkCu','1037828Uhssuh','5VsfbLn','14461400UTzOZP','role','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','\x20(id=','roleName','string','8pSNzAu','flag','trim','Updated\x20role\x20','4679328lIJnXU','New\x20role\x20name','remark'];a160_0x562b=function(){return _0x5a2a02;};return a160_0x562b();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a160_0x208a(_0x59cb5a,_0xec869d){_0x59cb5a=_0x59cb5a-0xc5;const _0x562ba7=a160_0x562b();let _0x208a72=_0x562ba7[_0x59cb5a];return _0x208a72;}import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a160_0x54e229(0xd3);function readPatch(_0x529d05){const _0x14a1b6=a160_0x54e229,_0x2dab0a=_0x529d05[_0x14a1b6(0xc6)](_0x14a1b6(0xd7)),_0x2427d4=_0x529d05[_0x14a1b6(0xc6)]('remark'),_0x1a13b8={};if(_0x2dab0a!==undefined&&_0x2dab0a!==null){const _0xd7108b=String(_0x2dab0a)[_0x14a1b6(0xc7)]();if(!_0xd7108b)throw CliErrors[_0x14a1b6(0xd5)](_0x14a1b6(0xd9));if(_0xd7108b['length']>0x40)throw CliErrors[_0x14a1b6(0xd5)](_0x14a1b6(0xdf));_0x1a13b8[_0x14a1b6(0xe1)]=_0xd7108b;}_0x2427d4!==undefined&&_0x2427d4!==null&&(_0x1a13b8[_0x14a1b6(0xcb)]=String(_0x2427d4));if(_0x1a13b8[_0x14a1b6(0xe1)]===undefined&&_0x1a13b8['remark']===undefined)throw CliErrors[_0x14a1b6(0xd5)]('Nothing\x20to\x20update.',_0x14a1b6(0xd4));return _0x1a13b8;}export const roleUpdate={'service':a160_0x54e229(0xde),'command':a160_0x54e229(0xce),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','risk':a160_0x54e229(0xd8),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a160_0x54e229(0xe2),'required':![],'description':a160_0x54e229(0xca)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3721a4){readPatch(_0x3721a4);},async 'dryRun'(_0x5b9b65){const _0x534dd3=a160_0x54e229,_0x486d5f=_0x5b9b65[_0x534dd3(0xd2)]('id'),_0x1b0184=readPatch(_0x5b9b65),_0x4dc1b7=await getRoleById(_0x5b9b65[_0x534dd3(0xcd)],_0x486d5f);return assertCustomRole(_0x4dc1b7,_0x534dd3(0xce)),asDryRunResult({'operation':_0x534dd3(0xce),'selector':{'appCode':_0x5b9b65[_0x534dd3(0xcd)],'roleId':_0x486d5f,'roleName':_0x4dc1b7['roleName']},'before':projectRole(_0x4dc1b7),'after':projectRole({..._0x4dc1b7,..._0x1b0184[_0x534dd3(0xe1)]!==undefined?{'roleName':_0x1b0184[_0x534dd3(0xe1)]}:{},..._0x1b0184[_0x534dd3(0xcb)]!==undefined?{'remark':_0x1b0184[_0x534dd3(0xcb)]}:{}}),'dryRun':!![],'backend':{'method':_0x534dd3(0xcc),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x4e8e70){const _0x32b571=a160_0x54e229,_0x46b4af=_0x4e8e70[_0x32b571(0xd2)]('id'),_0x20e8f4=readPatch(_0x4e8e70),_0x2f32e3=await getRoleById(_0x4e8e70[_0x32b571(0xcd)],_0x46b4af);assertCustomRole(_0x2f32e3,_0x32b571(0xce)),await updateAppRole({'id':_0x46b4af,'appCode':_0x4e8e70['appCode'],..._0x20e8f4['roleName']!==undefined?{'roleName':_0x20e8f4[_0x32b571(0xe1)]}:{},..._0x20e8f4[_0x32b571(0xcb)]!==undefined?{'remark':_0x20e8f4[_0x32b571(0xcb)]}:{}});const _0x5de9ec=await getRoleById(_0x4e8e70[_0x32b571(0xcd)],_0x46b4af);return{'ok':!![],'data':{'operation':_0x32b571(0xce),'selector':{'appCode':_0x4e8e70[_0x32b571(0xcd)],'roleId':_0x46b4af,'roleName':_0x5de9ec[_0x32b571(0xe1)]},'before':projectRole(_0x2f32e3),'after':projectRole(_0x5de9ec),'dryRun':![],'backend':{'method':_0x32b571(0xcc),'path':UPDATE_PATH},'warnings':[]},'message':_0x32b571(0xc8)+_0x5de9ec[_0x32b571(0xe1)]+_0x32b571(0xe0)+_0x46b4af+')'};}};
@@ -1 +1 @@
1
- const a161_0xae86ec=a161_0x2b16;(function(_0x29c173,_0x4ee0d6){const _0x202e4c=a161_0x2b16,_0x45ef2e=_0x29c173();while(!![]){try{const _0x299ef9=parseInt(_0x202e4c(0x14b))/0x1*(parseInt(_0x202e4c(0x152))/0x2)+-parseInt(_0x202e4c(0x143))/0x3+parseInt(_0x202e4c(0x14a))/0x4+-parseInt(_0x202e4c(0x147))/0x5*(-parseInt(_0x202e4c(0x156))/0x6)+parseInt(_0x202e4c(0x14d))/0x7+-parseInt(_0x202e4c(0x155))/0x8*(-parseInt(_0x202e4c(0x151))/0x9)+parseInt(_0x202e4c(0x141))/0xa*(-parseInt(_0x202e4c(0x14f))/0xb);if(_0x299ef9===_0x4ee0d6)break;else _0x45ef2e['push'](_0x45ef2e['shift']());}catch(_0x56dd6e){_0x45ef2e['push'](_0x45ef2e['shift']());}}}(a161_0x3e62,0x619f4));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a161_0x2b16(_0x3946e9,_0x5ed6d8){_0x3946e9=_0x3946e9-0x141;const _0x3e62b4=a161_0x3e62();let _0x2b16d3=_0x3e62b4[_0x3946e9];return _0x2b16d3;}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':a161_0xae86ec(0x14e),'command':a161_0xae86ec(0x153),'description':a161_0xae86ec(0x150),'risk':a161_0xae86ec(0x149),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x165c83){const _0x4e5620=a161_0xae86ec,{mutation:_0x3b9628}=await prepareUserMutation(_0x165c83,_0x4e5620(0x153),!![]);return asDryRunResult(_0x3b9628,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x485805){const _0x47886b=a161_0xae86ec,{roleList:_0x5b7a33,mutation:_0x67f2e7,changed:_0x13b321}=await prepareUserMutation(_0x485805,_0x47886b(0x153),![]);return _0x13b321&&await updateRoleUsers(_0x485805[_0x47886b(0x154)],_0x5b7a33),{'ok':!![],'data':_0x67f2e7,'message':_0x13b321?_0x47886b(0x145)+_0x67f2e7[_0x47886b(0x148)][_0x47886b(0x144)]+'\x20to\x20role\x20'+_0x67f2e7[_0x47886b(0x148)][_0x47886b(0x142)]:_0x47886b(0x14c)+_0x67f2e7['selector']['userId']+_0x47886b(0x146)+_0x67f2e7[_0x47886b(0x148)][_0x47886b(0x142)]};}};function a161_0x3e62(){const _0x565191=['appCode','152sRfbjf','222cVEIXd','129810pckUxz','roleName','1532829yoQufp','userId','Added\x20user\x20','\x20already\x20in\x20role\x20','3170IzxlJK','selector','high-risk-write','2536012TXaOto','1rbNZsS','No\x20change:\x20user\x20','4626762jUlWGA','role','781BjcDWv','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','87750UyrOSI','657554chMRoF','user-add'];a161_0x3e62=function(){return _0x565191;};return a161_0x3e62();}
1
+ const a161_0x4cdbeb=a161_0x3fb9;function a161_0x3fb9(_0x318071,_0x4113b4){_0x318071=_0x318071-0x1bd;const _0x55ffa1=a161_0x55ff();let _0x3fb927=_0x55ffa1[_0x318071];return _0x3fb927;}(function(_0x332449,_0x3ca5e0){const _0x161e76=a161_0x3fb9,_0x47fc19=_0x332449();while(!![]){try{const _0x53645a=parseInt(_0x161e76(0x1bd))/0x1+-parseInt(_0x161e76(0x1cd))/0x2+parseInt(_0x161e76(0x1d1))/0x3+parseInt(_0x161e76(0x1c2))/0x4*(parseInt(_0x161e76(0x1cf))/0x5)+parseInt(_0x161e76(0x1be))/0x6*(parseInt(_0x161e76(0x1c9))/0x7)+parseInt(_0x161e76(0x1c8))/0x8+parseInt(_0x161e76(0x1d0))/0x9*(-parseInt(_0x161e76(0x1d3))/0xa);if(_0x53645a===_0x3ca5e0)break;else _0x47fc19['push'](_0x47fc19['shift']());}catch(_0x43e0cb){_0x47fc19['push'](_0x47fc19['shift']());}}}(a161_0x55ff,0x1eee6));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';function a161_0x55ff(){const _0xb99efe=['\x20already\x20in\x20role\x20','292780jbPUgt','selector','827990ALJisK','9BYEGoi','733572oESkAA','userId','2191260QARxLi','39980wpNCNE','624vKpxKW','roleName','POST','role','4YMzRqX','user-add','\x20to\x20role\x20','No\x20change:\x20user\x20','Added\x20user\x20','high-risk-write','103072rPBlQX','1967CyZzpt','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','appCode'];a161_0x55ff=function(){return _0xb99efe;};return a161_0x55ff();}export const roleUserAdd={'service':a161_0x4cdbeb(0x1c1),'command':a161_0x4cdbeb(0x1c3),'description':a161_0x4cdbeb(0x1ca),'risk':a161_0x4cdbeb(0x1c7),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2558d6){const _0xe1614f=a161_0x4cdbeb,{mutation:_0x359984}=await prepareUserMutation(_0x2558d6,_0xe1614f(0x1c3),!![]);return asDryRunResult(_0x359984,{'method':_0xe1614f(0x1c0),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0xe95894){const _0x987e06=a161_0x4cdbeb,{roleList:_0x37b6a5,mutation:_0x2fc592,changed:_0x56bf}=await prepareUserMutation(_0xe95894,_0x987e06(0x1c3),![]);return _0x56bf&&await updateRoleUsers(_0xe95894[_0x987e06(0x1cb)],_0x37b6a5),{'ok':!![],'data':_0x2fc592,'message':_0x56bf?_0x987e06(0x1c6)+_0x2fc592[_0x987e06(0x1ce)]['userId']+_0x987e06(0x1c4)+_0x2fc592[_0x987e06(0x1ce)][_0x987e06(0x1bf)]:_0x987e06(0x1c5)+_0x2fc592[_0x987e06(0x1ce)][_0x987e06(0x1d2)]+_0x987e06(0x1cc)+_0x2fc592['selector'][_0x987e06(0x1bf)]};}};
@@ -1 +1 @@
1
- const a162_0x444845=a162_0x25ab;(function(_0x5e1bc5,_0x480e10){const _0x598df3=a162_0x25ab,_0x17fca8=_0x5e1bc5();while(!![]){try{const _0xfeac31=parseInt(_0x598df3(0x100))/0x1*(-parseInt(_0x598df3(0xfe))/0x2)+-parseInt(_0x598df3(0xfc))/0x3*(parseInt(_0x598df3(0x104))/0x4)+-parseInt(_0x598df3(0xf4))/0x5+parseInt(_0x598df3(0xf2))/0x6*(parseInt(_0x598df3(0xf6))/0x7)+parseInt(_0x598df3(0x106))/0x8+parseInt(_0x598df3(0xff))/0x9*(parseInt(_0x598df3(0x101))/0xa)+parseInt(_0x598df3(0xf8))/0xb;if(_0xfeac31===_0x480e10)break;else _0x17fca8['push'](_0x17fca8['shift']());}catch(_0x373600){_0x17fca8['push'](_0x17fca8['shift']());}}}(a162_0xa644,0x458df));function a162_0xa644(){const _0x5a474b=['\x20not\x20in\x20role\x20','4KrEkBs','appCode','813008kEPoRW','42nIwsHG','roleName','2529320zElYrM','role','528010LhCnVL','user-remove','2332803wUvrlN','\x20from\x20role\x20','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','selector','278412zKwMbY','POST','14aAptxM','209673tBluNW','43943fJCzGL','150ChehDo','userId'];a162_0xa644=function(){return _0x5a474b;};return a162_0xa644();}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';function a162_0x25ab(_0x413970,_0x29c7d6){_0x413970=_0x413970-0xf2;const _0xa64430=a162_0xa644();let _0x25abfb=_0xa64430[_0x413970];return _0x25abfb;}export const roleUserRemove={'service':a162_0x444845(0xf5),'command':a162_0x444845(0xf7),'description':a162_0x444845(0xfa),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x562b4e){const _0x168999=a162_0x444845,{mutation:_0x148652}=await prepareUserMutation(_0x562b4e,_0x168999(0xf7),!![]);return asDryRunResult(_0x148652,{'method':_0x168999(0xfd),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x194897){const _0x3e17c5=a162_0x444845,{roleList:_0x34657e,mutation:_0x36667e,changed:_0x3764b7}=await prepareUserMutation(_0x194897,_0x3e17c5(0xf7),![]);return _0x3764b7&&await updateRoleUsers(_0x194897[_0x3e17c5(0x105)],_0x34657e),{'ok':!![],'data':_0x36667e,'message':_0x3764b7?'Removed\x20user\x20'+_0x36667e[_0x3e17c5(0xfb)]['userId']+_0x3e17c5(0xf9)+_0x36667e['selector'][_0x3e17c5(0xf3)]:'No\x20change:\x20user\x20'+_0x36667e[_0x3e17c5(0xfb)][_0x3e17c5(0x102)]+_0x3e17c5(0x103)+_0x36667e[_0x3e17c5(0xfb)][_0x3e17c5(0xf3)]};}};
1
+ const a162_0x359e40=a162_0x1878;(function(_0x32095b,_0x4dc105){const _0x5771c1=a162_0x1878,_0x14a0be=_0x32095b();while(!![]){try{const _0x341280=-parseInt(_0x5771c1(0x12f))/0x1+-parseInt(_0x5771c1(0x139))/0x2+-parseInt(_0x5771c1(0x136))/0x3+-parseInt(_0x5771c1(0x13b))/0x4*(-parseInt(_0x5771c1(0x132))/0x5)+-parseInt(_0x5771c1(0x135))/0x6+-parseInt(_0x5771c1(0x130))/0x7*(-parseInt(_0x5771c1(0x134))/0x8)+parseInt(_0x5771c1(0x129))/0x9;if(_0x341280===_0x4dc105)break;else _0x14a0be['push'](_0x14a0be['shift']());}catch(_0x435dfb){_0x14a0be['push'](_0x14a0be['shift']());}}}(a162_0x14cd,0x4a6e1));function a162_0x1878(_0x3cb2b8,_0x1866e1){_0x3cb2b8=_0x3cb2b8-0x128;const _0x14cde4=a162_0x14cd();let _0x187810=_0x14cde4[_0x3cb2b8];return _0x187810;}import{updateRoleUsers}from'../../core/api-client.js';function a162_0x14cd(){const _0x391f85=['appCode','role','userId','roleName','227128RbsFxg','7wvOLOv','user-remove','1065UAcwdF','No\x20change:\x20user\x20','3622072ujQKtt','2701068vqBrLx','944343uUZqpL','POST','high-risk-write','199020mApvBq','Removed\x20user\x20','9796IiilGp','\x20from\x20role\x20','3798594MEgLks','selector'];a162_0x14cd=function(){return _0x391f85;};return a162_0x14cd();}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_0x359e40(0x12c),'command':a162_0x359e40(0x131),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a162_0x359e40(0x138),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x345077){const _0x407215=a162_0x359e40,{mutation:_0x1830c3}=await prepareUserMutation(_0x345077,_0x407215(0x131),!![]);return asDryRunResult(_0x1830c3,{'method':_0x407215(0x137),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x14d42a){const _0x3dbb91=a162_0x359e40,{roleList:_0x187fe9,mutation:_0x181ccb,changed:_0xed2cdc}=await prepareUserMutation(_0x14d42a,'user-remove',![]);return _0xed2cdc&&await updateRoleUsers(_0x14d42a[_0x3dbb91(0x12b)],_0x187fe9),{'ok':!![],'data':_0x181ccb,'message':_0xed2cdc?_0x3dbb91(0x13a)+_0x181ccb[_0x3dbb91(0x12a)][_0x3dbb91(0x12d)]+_0x3dbb91(0x128)+_0x181ccb[_0x3dbb91(0x12a)][_0x3dbb91(0x12e)]:_0x3dbb91(0x133)+_0x181ccb['selector']['userId']+'\x20not\x20in\x20role\x20'+_0x181ccb['selector'][_0x3dbb91(0x12e)]};}};
@@ -1 +1 @@
1
- function a163_0x542e(){const _0x38e90a=['role','41ejdHxv','2269494JrZCyb','trim','name','username','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','str','Pass\x20--name\x20<nickname|username>.','flagMissing','matchedBy','8TrMCuo','4838589RnSBLI','5mBDmMR','37730uqqKfV','user-resolve','997760cNWRmc','userId','3503144ryFUuR','381174LeUoLg','\x22\x20→\x20userId\x20','read','4329045SzVegU','Resolved\x20\x22'];a163_0x542e=function(){return _0x38e90a;};return a163_0x542e();}const a163_0x3e0c64=a163_0x3d79;function a163_0x3d79(_0x1f9630,_0x370e03){_0x1f9630=_0x1f9630-0x76;const _0x542e81=a163_0x542e();let _0x3d79a0=_0x542e81[_0x1f9630];return _0x3d79a0;}(function(_0x4d2fda,_0x5d171f){const _0x9048fb=a163_0x3d79,_0x293145=_0x4d2fda();while(!![]){try{const _0x145bd6=parseInt(_0x9048fb(0x7b))/0x1*(parseInt(_0x9048fb(0x88))/0x2)+-parseInt(_0x9048fb(0x8d))/0x3*(parseInt(_0x9048fb(0x85))/0x4)+-parseInt(_0x9048fb(0x87))/0x5*(parseInt(_0x9048fb(0x7c))/0x6)+-parseInt(_0x9048fb(0x78))/0x7+parseInt(_0x9048fb(0x8c))/0x8+parseInt(_0x9048fb(0x86))/0x9+-parseInt(_0x9048fb(0x8a))/0xa;if(_0x145bd6===_0x5d171f)break;else _0x293145['push'](_0x293145['shift']());}catch(_0x388f5f){_0x293145['push'](_0x293145['shift']());}}}(a163_0x542e,0x61443));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':a163_0x3e0c64(0x7a),'command':a163_0x3e0c64(0x89),'description':a163_0x3e0c64(0x80),'risk':a163_0x3e0c64(0x77),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x46642a){const _0x1576a4=a163_0x3e0c64;if(!_0x46642a[_0x1576a4(0x81)]('name')[_0x1576a4(0x7d)]())throw CliErrors[_0x1576a4(0x83)](_0x1576a4(0x7e),_0x1576a4(0x82));},async 'execute'(_0x22818e){const _0x4548ff=a163_0x3e0c64,_0x8955f0=_0x22818e[_0x4548ff(0x81)](_0x4548ff(0x7e))[_0x4548ff(0x7d)](),_0x528efe=await resolveUserRef(_0x8955f0);return{'ok':!![],'data':{'user':{'userId':_0x528efe[_0x4548ff(0x8b)],'username':_0x528efe[_0x4548ff(0x7f)],'nickname':_0x528efe['nickname'],'matchedBy':_0x528efe[_0x4548ff(0x84)]}},'message':_0x4548ff(0x79)+_0x8955f0+_0x4548ff(0x76)+_0x528efe[_0x4548ff(0x8b)]};}};
1
+ const a163_0x5f1401=a163_0x39b3;function a163_0x39b3(_0x4e5210,_0x5807b1){_0x4e5210=_0x4e5210-0x1c1;const _0x15fbf2=a163_0x15fb();let _0x39b3c6=_0x15fbf2[_0x4e5210];return _0x39b3c6;}(function(_0x48b30c,_0x9e1b25){const _0x2d76db=a163_0x39b3,_0xe356e4=_0x48b30c();while(!![]){try{const _0x1be9f3=-parseInt(_0x2d76db(0x1d1))/0x1+-parseInt(_0x2d76db(0x1c2))/0x2*(-parseInt(_0x2d76db(0x1c9))/0x3)+parseInt(_0x2d76db(0x1c3))/0x4*(parseInt(_0x2d76db(0x1c4))/0x5)+-parseInt(_0x2d76db(0x1d5))/0x6+-parseInt(_0x2d76db(0x1d6))/0x7*(-parseInt(_0x2d76db(0x1c8))/0x8)+-parseInt(_0x2d76db(0x1c6))/0x9*(-parseInt(_0x2d76db(0x1d4))/0xa)+-parseInt(_0x2d76db(0x1d7))/0xb*(parseInt(_0x2d76db(0x1ce))/0xc);if(_0x1be9f3===_0x9e1b25)break;else _0xe356e4['push'](_0xe356e4['shift']());}catch(_0x3f9e0b){_0xe356e4['push'](_0xe356e4['shift']());}}}(a163_0x15fb,0xdeb47));function a163_0x15fb(){const _0x2ce27c=['user-resolve','9tkZBXF','read','2224MFerxA','12Usyzdq','name','matchedBy','str','userId','105972mmMuBp','username','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','901351yTURty','\x22\x20→\x20userId\x20','flagMissing','1745090fdxzDY','482256HERdNC','27062QGbHgO','737PTGinV','trim','446698btEhpi','760wduDaV','9025BtuRvw'];a163_0x15fb=function(){return _0x2ce27c;};return a163_0x15fb();}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_0x5f1401(0x1c5),'description':a163_0x5f1401(0x1d0),'risk':a163_0x5f1401(0x1c7),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5f15b4){const _0x41802f=a163_0x5f1401;if(!_0x5f15b4['str'](_0x41802f(0x1ca))[_0x41802f(0x1c1)]())throw CliErrors[_0x41802f(0x1d3)](_0x41802f(0x1ca),'Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x471a70){const _0xff374f=a163_0x5f1401,_0x4fd129=_0x471a70[_0xff374f(0x1cc)](_0xff374f(0x1ca))[_0xff374f(0x1c1)](),_0x2bfc90=await resolveUserRef(_0x4fd129);return{'ok':!![],'data':{'user':{'userId':_0x2bfc90[_0xff374f(0x1cd)],'username':_0x2bfc90[_0xff374f(0x1cf)],'nickname':_0x2bfc90['nickname'],'matchedBy':_0x2bfc90[_0xff374f(0x1cb)]}},'message':'Resolved\x20\x22'+_0x4fd129+_0xff374f(0x1d2)+_0x2bfc90[_0xff374f(0x1cd)]};}};