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

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 (560) hide show
  1. package/lib/api/api-doc.d.ts +9 -0
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.d.ts +2 -0
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.d.ts +8 -0
  6. package/lib/api/generate-api-file.js +1 -1
  7. package/lib/auth/auth-server-ui.d.ts +13 -0
  8. package/lib/auth/auth-server-ui.js +1 -1
  9. package/lib/auth/auth-server.d.ts +25 -0
  10. package/lib/auth/auth-server.js +1 -1
  11. package/lib/auth/constant.d.ts +2 -0
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.d.ts +1 -0
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.d.ts +51 -0
  16. package/lib/auth/get-session-user.js +1 -1
  17. package/lib/auth/is-session-valid.d.ts +1 -0
  18. package/lib/auth/is-session-valid.js +1 -1
  19. package/lib/auth/login-success-html.d.ts +5 -0
  20. package/lib/auth/login-success-html.js +1 -1
  21. package/lib/auth/logout.d.ts +1 -0
  22. package/lib/auth/logout.js +1 -1
  23. package/lib/cli-flags.d.ts +12 -0
  24. package/lib/cli-flags.js +1 -1
  25. package/lib/cli.d.ts +2 -0
  26. package/lib/cli.js +1 -1
  27. package/lib/commands/api/generate.d.ts +2 -0
  28. package/lib/commands/api/generate.js +1 -1
  29. package/lib/commands/api/index.d.ts +2 -0
  30. package/lib/commands/api/index.js +1 -1
  31. package/lib/commands/api/list.d.ts +2 -0
  32. package/lib/commands/api/list.js +1 -1
  33. package/lib/commands/api/pull.d.ts +2 -0
  34. package/lib/commands/api/pull.js +1 -1
  35. package/lib/commands/api/shared.d.ts +18 -0
  36. package/lib/commands/api/shared.js +1 -1
  37. package/lib/commands/app/index.d.ts +5 -0
  38. package/lib/commands/app/index.js +1 -1
  39. package/lib/commands/app/list.d.ts +10 -0
  40. package/lib/commands/app/list.js +1 -1
  41. package/lib/commands/app/members-list.d.ts +2 -0
  42. package/lib/commands/app/members-list.js +1 -1
  43. package/lib/commands/app/remote-directory.d.ts +11 -0
  44. package/lib/commands/app/remote-directory.js +1 -1
  45. package/lib/commands/app/shared.d.ts +46 -0
  46. package/lib/commands/app/shared.js +1 -1
  47. package/lib/commands/app-config/delete.d.ts +2 -0
  48. package/lib/commands/app-config/delete.js +1 -1
  49. package/lib/commands/app-config/get.d.ts +2 -0
  50. package/lib/commands/app-config/get.js +1 -1
  51. package/lib/commands/app-config/index.d.ts +2 -0
  52. package/lib/commands/app-config/index.js +1 -1
  53. package/lib/commands/app-config/list.d.ts +2 -0
  54. package/lib/commands/app-config/list.js +1 -1
  55. package/lib/commands/app-config/set.d.ts +2 -0
  56. package/lib/commands/app-config/set.js +1 -1
  57. package/lib/commands/app-config/shared.d.ts +105 -0
  58. package/lib/commands/app-config/shared.js +1 -1
  59. package/lib/commands/auth/index.d.ts +2 -0
  60. package/lib/commands/auth/index.js +1 -1
  61. package/lib/commands/bff/create.d.ts +4 -0
  62. package/lib/commands/bff/create.js +1 -1
  63. package/lib/commands/bff/delete.d.ts +2 -0
  64. package/lib/commands/bff/delete.js +1 -1
  65. package/lib/commands/bff/detail.d.ts +2 -0
  66. package/lib/commands/bff/detail.js +1 -1
  67. package/lib/commands/bff/index.d.ts +5 -0
  68. package/lib/commands/bff/index.js +1 -1
  69. package/lib/commands/bff/list.d.ts +2 -0
  70. package/lib/commands/bff/list.js +1 -1
  71. package/lib/commands/bff/pull.d.ts +2 -0
  72. package/lib/commands/bff/pull.js +1 -1
  73. package/lib/commands/bff/push.d.ts +2 -0
  74. package/lib/commands/bff/push.js +1 -1
  75. package/lib/commands/bff/status.d.ts +2 -0
  76. package/lib/commands/bff/status.js +1 -1
  77. package/lib/commands/cli-skill/index.d.ts +8 -0
  78. package/lib/commands/cli-skill/index.js +1 -1
  79. package/lib/commands/cli-update.d.ts +2 -0
  80. package/lib/commands/cli-update.js +1 -1
  81. package/lib/commands/codegen/index.d.ts +2 -0
  82. package/lib/commands/codegen/index.js +1 -1
  83. package/lib/commands/codegen/sdk.d.ts +2 -0
  84. package/lib/commands/codegen/sdk.js +1 -1
  85. package/lib/commands/codegen/sql.d.ts +2 -0
  86. package/lib/commands/codegen/sql.js +1 -1
  87. package/lib/commands/common/app-registry.d.ts +17 -0
  88. package/lib/commands/common/app-registry.js +1 -1
  89. package/lib/commands/common/app-selector.d.ts +17 -0
  90. package/lib/commands/common/app-selector.js +1 -1
  91. package/lib/commands/common/async-task.d.ts +11 -0
  92. package/lib/commands/common/async-task.js +1 -1
  93. package/lib/commands/common/dry-run.d.ts +12 -0
  94. package/lib/commands/common/dry-run.js +1 -1
  95. package/lib/commands/common/flags.d.ts +26 -0
  96. package/lib/commands/common/flags.js +1 -1
  97. package/lib/commands/common/local-file.d.ts +6 -0
  98. package/lib/commands/common/local-file.js +1 -1
  99. package/lib/commands/common/validate.d.ts +13 -0
  100. package/lib/commands/common/validate.js +1 -1
  101. package/lib/commands/config/get.d.ts +5 -0
  102. package/lib/commands/config/get.js +1 -1
  103. package/lib/commands/config/index.d.ts +5 -0
  104. package/lib/commands/config/index.js +1 -1
  105. package/lib/commands/config/list.d.ts +5 -0
  106. package/lib/commands/config/list.js +1 -1
  107. package/lib/commands/config/set.d.ts +5 -0
  108. package/lib/commands/config/set.js +1 -1
  109. package/lib/commands/config/shared.d.ts +16 -0
  110. package/lib/commands/config/shared.js +1 -1
  111. package/lib/commands/data/filter.d.ts +7 -0
  112. package/lib/commands/data/filter.js +1 -1
  113. package/lib/commands/data/getOne.d.ts +7 -0
  114. package/lib/commands/data/getOne.js +1 -1
  115. package/lib/commands/data/index.d.ts +8 -0
  116. package/lib/commands/data/index.js +1 -1
  117. package/lib/commands/data/shared.d.ts +33 -0
  118. package/lib/commands/data/shared.js +1 -1
  119. package/lib/commands/dataset/business-group-update.d.ts +18 -0
  120. package/lib/commands/dataset/business-group-update.js +1 -1
  121. package/lib/commands/dataset/capability.d.ts +11 -0
  122. package/lib/commands/dataset/capability.js +1 -1
  123. package/lib/commands/dataset/delete.d.ts +2 -0
  124. package/lib/commands/dataset/delete.js +1 -1
  125. package/lib/commands/dataset/detail.d.ts +2 -0
  126. package/lib/commands/dataset/detail.js +1 -1
  127. package/lib/commands/dataset/extend-update.d.ts +26 -0
  128. package/lib/commands/dataset/extend-update.js +1 -1
  129. package/lib/commands/dataset/field-update.d.ts +27 -0
  130. package/lib/commands/dataset/field-update.js +1 -1
  131. package/lib/commands/dataset/generate.d.ts +3 -0
  132. package/lib/commands/dataset/generate.js +1 -1
  133. package/lib/commands/dataset/index.d.ts +2 -0
  134. package/lib/commands/dataset/index.js +1 -1
  135. package/lib/commands/dataset/list.d.ts +2 -0
  136. package/lib/commands/dataset/list.js +1 -1
  137. package/lib/commands/dataset/operations.d.ts +2 -0
  138. package/lib/commands/dataset/operations.js +1 -1
  139. package/lib/commands/dataset/relation-audit.d.ts +2 -0
  140. package/lib/commands/dataset/relation-audit.js +1 -1
  141. package/lib/commands/dataset/relation-create.d.ts +2 -0
  142. package/lib/commands/dataset/relation-create.js +1 -1
  143. package/lib/commands/dataset/relation-delete.d.ts +2 -0
  144. package/lib/commands/dataset/relation-delete.js +1 -1
  145. package/lib/commands/dataset/relation-shared.d.ts +128 -0
  146. package/lib/commands/dataset/relation-shared.js +1 -1
  147. package/lib/commands/dataset/relation-update.d.ts +2 -0
  148. package/lib/commands/dataset/relation-update.js +1 -1
  149. package/lib/commands/dataset/relations.d.ts +53 -0
  150. package/lib/commands/dataset/relations.js +1 -1
  151. package/lib/commands/dataset/rename.d.ts +17 -0
  152. package/lib/commands/dataset/rename.js +1 -1
  153. package/lib/commands/dataset/restore.d.ts +2 -0
  154. package/lib/commands/dataset/restore.js +1 -1
  155. package/lib/commands/db/analysis-batching.d.ts +30 -0
  156. package/lib/commands/db/analysis-batching.js +1 -1
  157. package/lib/commands/db/analyze-batch-plan.d.ts +2 -0
  158. package/lib/commands/db/analyze-batch-plan.js +1 -1
  159. package/lib/commands/db/analyze-cancel.d.ts +2 -0
  160. package/lib/commands/db/analyze-cancel.js +1 -1
  161. package/lib/commands/db/analyze-start.d.ts +2 -0
  162. package/lib/commands/db/analyze-start.js +1 -1
  163. package/lib/commands/db/analyze-status.d.ts +2 -0
  164. package/lib/commands/db/analyze-status.js +1 -1
  165. package/lib/commands/db/create.d.ts +2 -0
  166. package/lib/commands/db/create.js +1 -1
  167. package/lib/commands/db/delete.d.ts +2 -0
  168. package/lib/commands/db/delete.js +1 -1
  169. package/lib/commands/db/detail.d.ts +2 -0
  170. package/lib/commands/db/detail.js +1 -1
  171. package/lib/commands/db/diff.d.ts +2 -0
  172. package/lib/commands/db/diff.js +1 -1
  173. package/lib/commands/db/index.d.ts +5 -0
  174. package/lib/commands/db/index.js +1 -1
  175. package/lib/commands/db/list.d.ts +2 -0
  176. package/lib/commands/db/list.js +1 -1
  177. package/lib/commands/db/shared.d.ts +15 -0
  178. package/lib/commands/db/shared.js +1 -1
  179. package/lib/commands/db/tables.d.ts +2 -0
  180. package/lib/commands/db/tables.js +1 -1
  181. package/lib/commands/db/test.d.ts +2 -0
  182. package/lib/commands/db/test.js +1 -1
  183. package/lib/commands/db/update.d.ts +2 -0
  184. package/lib/commands/db/update.js +1 -1
  185. package/lib/commands/doctor.d.ts +2 -0
  186. package/lib/commands/doctor.js +1 -1
  187. package/lib/commands/file/index.d.ts +2 -0
  188. package/lib/commands/file/index.js +1 -1
  189. package/lib/commands/init/index.d.ts +11 -0
  190. package/lib/commands/init/index.js +1 -1
  191. package/lib/commands/issue/index.d.ts +2 -0
  192. package/lib/commands/issue/index.js +1 -1
  193. package/lib/commands/issue/nudge.d.ts +23 -0
  194. package/lib/commands/issue/nudge.js +1 -1
  195. package/lib/commands/issue/report.d.ts +2 -0
  196. package/lib/commands/issue/report.js +1 -1
  197. package/lib/commands/issue/shared.d.ts +32 -0
  198. package/lib/commands/issue/shared.js +1 -1
  199. package/lib/commands/kb/create.d.ts +2 -0
  200. package/lib/commands/kb/create.js +1 -1
  201. package/lib/commands/kb/delete.d.ts +2 -0
  202. package/lib/commands/kb/delete.js +1 -1
  203. package/lib/commands/kb/detail.d.ts +2 -0
  204. package/lib/commands/kb/detail.js +1 -1
  205. package/lib/commands/kb/index.d.ts +2 -0
  206. package/lib/commands/kb/index.js +1 -1
  207. package/lib/commands/kb/list.d.ts +2 -0
  208. package/lib/commands/kb/list.js +1 -1
  209. package/lib/commands/kb/shared.d.ts +33 -0
  210. package/lib/commands/kb/shared.js +1 -1
  211. package/lib/commands/kb/update.d.ts +2 -0
  212. package/lib/commands/kb/update.js +1 -1
  213. package/lib/commands/logs/index.d.ts +5 -0
  214. package/lib/commands/logs/index.js +1 -1
  215. package/lib/commands/menu/asset-update.d.ts +2 -0
  216. package/lib/commands/menu/asset-update.js +1 -1
  217. package/lib/commands/menu/delete.d.ts +2 -0
  218. package/lib/commands/menu/delete.js +1 -1
  219. package/lib/commands/menu/external-link-create.d.ts +3 -0
  220. package/lib/commands/menu/external-link-create.js +1 -1
  221. package/lib/commands/menu/external-link-update.d.ts +2 -0
  222. package/lib/commands/menu/external-link-update.js +1 -1
  223. package/lib/commands/menu/group-create.d.ts +2 -0
  224. package/lib/commands/menu/group-create.js +1 -1
  225. package/lib/commands/menu/group-update.d.ts +2 -0
  226. package/lib/commands/menu/group-update.js +1 -1
  227. package/lib/commands/menu/index.d.ts +17 -0
  228. package/lib/commands/menu/index.js +1 -1
  229. package/lib/commands/menu/list.d.ts +2 -0
  230. package/lib/commands/menu/list.js +1 -1
  231. package/lib/commands/menu/move.d.ts +2 -0
  232. package/lib/commands/menu/move.js +1 -1
  233. package/lib/commands/menu/regroup-start.d.ts +2 -0
  234. package/lib/commands/menu/regroup-start.js +1 -1
  235. package/lib/commands/menu/rename.d.ts +2 -0
  236. package/lib/commands/menu/rename.js +1 -1
  237. package/lib/commands/menu/shared/compare-table.d.ts +27 -0
  238. package/lib/commands/menu/shared/compare-table.js +1 -1
  239. package/lib/commands/menu/shared/delete-plan.d.ts +51 -0
  240. package/lib/commands/menu/shared/delete-plan.js +1 -1
  241. package/lib/commands/menu/shared/facts.d.ts +12 -0
  242. package/lib/commands/menu/shared/facts.js +1 -1
  243. package/lib/commands/menu/shared/index.d.ts +12 -0
  244. package/lib/commands/menu/shared/index.js +1 -1
  245. package/lib/commands/menu/shared/inquirer.d.ts +10 -0
  246. package/lib/commands/menu/shared/inquirer.js +1 -1
  247. package/lib/commands/menu/shared/local-pages.d.ts +12 -0
  248. package/lib/commands/menu/shared/local-pages.js +1 -1
  249. package/lib/commands/menu/shared/logic.d.ts +28 -0
  250. package/lib/commands/menu/shared/logic.js +1 -1
  251. package/lib/commands/menu/shared/mutations.d.ts +69 -0
  252. package/lib/commands/menu/shared/mutations.js +1 -1
  253. package/lib/commands/menu/shared/service.d.ts +17 -0
  254. package/lib/commands/menu/shared/service.js +1 -1
  255. package/lib/commands/menu/shared/sync-core.d.ts +7 -0
  256. package/lib/commands/menu/shared/sync-core.js +1 -1
  257. package/lib/commands/menu/shared/types.d.ts +162 -0
  258. package/lib/commands/menu/shared/update-core.d.ts +11 -0
  259. package/lib/commands/menu/shared/update-core.js +1 -1
  260. package/lib/commands/menu/shared/valid-url.d.ts +6 -0
  261. package/lib/commands/menu/shared/valid-url.js +1 -1
  262. package/lib/commands/menu/sync.d.ts +2 -0
  263. package/lib/commands/menu/sync.js +1 -1
  264. package/lib/commands/notification/config-list.d.ts +2 -0
  265. package/lib/commands/notification/config-list.js +1 -1
  266. package/lib/commands/notification/index.d.ts +2 -0
  267. package/lib/commands/notification/index.js +1 -1
  268. package/lib/commands/ocr/index.d.ts +2 -0
  269. package/lib/commands/ocr/index.js +1 -1
  270. package/lib/commands/page/generate-start.d.ts +2 -0
  271. package/lib/commands/page/generate-start.js +1 -1
  272. package/lib/commands/page/generate-status.d.ts +2 -0
  273. package/lib/commands/page/generate-status.js +1 -1
  274. package/lib/commands/page/index.d.ts +2 -0
  275. package/lib/commands/page/index.js +1 -1
  276. package/lib/commands/page/pull.d.ts +2 -0
  277. package/lib/commands/page/pull.js +1 -1
  278. package/lib/commands/page/push.d.ts +2 -0
  279. package/lib/commands/page/push.js +1 -1
  280. package/lib/commands/page/relation-audit.d.ts +2 -0
  281. package/lib/commands/page/relation-audit.js +1 -1
  282. package/lib/commands/page/restore.d.ts +2 -0
  283. package/lib/commands/page/restore.js +1 -1
  284. package/lib/commands/page/shared.d.ts +105 -0
  285. package/lib/commands/page/shared.js +1 -1
  286. package/lib/commands/page/standard-page-status.d.ts +2 -0
  287. package/lib/commands/page/standard-page-status.js +1 -1
  288. package/lib/commands/page/sync.d.ts +2 -0
  289. package/lib/commands/page/sync.js +1 -1
  290. package/lib/commands/permit/index.d.ts +2 -0
  291. package/lib/commands/permit/index.js +1 -1
  292. package/lib/commands/permit/page-get.d.ts +2 -0
  293. package/lib/commands/permit/page-get.js +1 -1
  294. package/lib/commands/permit/page-set.d.ts +2 -0
  295. package/lib/commands/permit/page-set.js +1 -1
  296. package/lib/commands/permit/role-apis-set.d.ts +2 -0
  297. package/lib/commands/permit/role-apis-set.js +1 -1
  298. package/lib/commands/permit/role-menus-set.d.ts +2 -0
  299. package/lib/commands/permit/role-menus-set.js +1 -1
  300. package/lib/commands/permit/role-menus.d.ts +2 -0
  301. package/lib/commands/permit/role-menus.js +1 -1
  302. package/lib/commands/permit/shared.d.ts +74 -0
  303. package/lib/commands/permit/shared.js +1 -1
  304. package/lib/commands/project/create/enhanced-guided-create.d.ts +7 -0
  305. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  306. package/lib/commands/project/create/format-elapsed.d.ts +1 -0
  307. package/lib/commands/project/create/format-elapsed.js +1 -1
  308. package/lib/commands/project/create/main.d.ts +6 -0
  309. package/lib/commands/project/create/main.js +1 -1
  310. package/lib/commands/project/create/non-interactive.d.ts +9 -0
  311. package/lib/commands/project/create/non-interactive.js +1 -1
  312. package/lib/commands/project/create/project-template-path.d.ts +4 -0
  313. package/lib/commands/project/create/project-template-path.js +1 -1
  314. package/lib/commands/project/create/use-copy-project-template.d.ts +1 -0
  315. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  316. package/lib/commands/project/create/use-format-code.d.ts +1 -0
  317. package/lib/commands/project/create/use-format-code.js +1 -1
  318. package/lib/commands/project/create/use-install-dependencies.d.ts +1 -0
  319. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  320. package/lib/commands/project/index.d.ts +2 -0
  321. package/lib/commands/project/index.js +1 -1
  322. package/lib/commands/project/upgrade.d.ts +1 -0
  323. package/lib/commands/project/upgrade.js +1 -1
  324. package/lib/commands/registry.d.ts +66 -0
  325. package/lib/commands/registry.js +1 -1
  326. package/lib/commands/role/create.d.ts +2 -0
  327. package/lib/commands/role/create.js +1 -1
  328. package/lib/commands/role/delete.d.ts +2 -0
  329. package/lib/commands/role/delete.js +1 -1
  330. package/lib/commands/role/detail.d.ts +2 -0
  331. package/lib/commands/role/detail.js +1 -1
  332. package/lib/commands/role/index.d.ts +2 -0
  333. package/lib/commands/role/index.js +1 -1
  334. package/lib/commands/role/list.d.ts +2 -0
  335. package/lib/commands/role/list.js +1 -1
  336. package/lib/commands/role/shared.d.ts +107 -0
  337. package/lib/commands/role/shared.js +1 -1
  338. package/lib/commands/role/update.d.ts +2 -0
  339. package/lib/commands/role/update.js +1 -1
  340. package/lib/commands/role/user-add.d.ts +2 -0
  341. package/lib/commands/role/user-add.js +1 -1
  342. package/lib/commands/role/user-remove.d.ts +2 -0
  343. package/lib/commands/role/user-remove.js +1 -1
  344. package/lib/commands/role/user-resolve.d.ts +2 -0
  345. package/lib/commands/role/user-resolve.js +1 -1
  346. package/lib/commands/run/index.d.ts +2 -0
  347. package/lib/commands/run/index.js +1 -1
  348. package/lib/commands/schema.d.ts +5 -0
  349. package/lib/commands/schema.js +1 -1
  350. package/lib/commands/sql/create.d.ts +10 -0
  351. package/lib/commands/sql/create.js +1 -1
  352. package/lib/commands/sql/delete.d.ts +5 -0
  353. package/lib/commands/sql/delete.js +1 -1
  354. package/lib/commands/sql/detail.d.ts +2 -0
  355. package/lib/commands/sql/detail.js +1 -1
  356. package/lib/commands/sql/exec.d.ts +2 -0
  357. package/lib/commands/sql/exec.js +1 -1
  358. package/lib/commands/sql/index.d.ts +5 -0
  359. package/lib/commands/sql/index.js +1 -1
  360. package/lib/commands/sql/list.d.ts +2 -0
  361. package/lib/commands/sql/list.js +1 -1
  362. package/lib/commands/sql/pull.d.ts +5 -0
  363. package/lib/commands/sql/pull.js +1 -1
  364. package/lib/commands/sql/push.d.ts +5 -0
  365. package/lib/commands/sql/push.js +1 -1
  366. package/lib/commands/sql/shared.d.ts +23 -0
  367. package/lib/commands/sql/shared.js +1 -1
  368. package/lib/commands/sql/status.d.ts +5 -0
  369. package/lib/commands/sql/status.js +1 -1
  370. package/lib/commands/sql/validate.d.ts +2 -0
  371. package/lib/commands/sql/validate.js +1 -1
  372. package/lib/commands/task/index.d.ts +2 -0
  373. package/lib/commands/task/index.js +1 -1
  374. package/lib/commands/task/status.d.ts +2 -0
  375. package/lib/commands/task/status.js +1 -1
  376. package/lib/commands/tenant/index.d.ts +2 -0
  377. package/lib/commands/tenant/index.js +1 -1
  378. package/lib/commands/tenant/members-list.d.ts +2 -0
  379. package/lib/commands/tenant/members-list.js +1 -1
  380. package/lib/commands/tenant/shared.d.ts +10 -0
  381. package/lib/commands/tenant/shared.js +1 -1
  382. package/lib/commands/workspace/add.d.ts +6 -0
  383. package/lib/commands/workspace/add.js +1 -1
  384. package/lib/commands/workspace/index.d.ts +11 -0
  385. package/lib/commands/workspace/index.js +1 -1
  386. package/lib/commands/workspace/remove.d.ts +6 -0
  387. package/lib/commands/workspace/remove.js +1 -1
  388. package/lib/config/schema.d.ts +50 -0
  389. package/lib/config/schema.js +1 -1
  390. package/lib/constant/cdn.d.ts +1 -0
  391. package/lib/constant/cdn.js +1 -1
  392. package/lib/constant/cli.d.ts +34 -0
  393. package/lib/constant/cli.js +1 -1
  394. package/lib/constant/defaults.d.ts +10 -0
  395. package/lib/constant/defaults.js +1 -1
  396. package/lib/constant/domain.d.ts +14 -0
  397. package/lib/constant/domain.js +1 -1
  398. package/lib/constant/env.d.ts +11 -0
  399. package/lib/constant/env.js +1 -1
  400. package/lib/constant/output.d.ts +1 -0
  401. package/lib/constant/output.js +1 -1
  402. package/lib/constant/paths.d.ts +5 -0
  403. package/lib/constant/paths.js +1 -1
  404. package/lib/constant/risk.d.ts +1 -0
  405. package/lib/constant/risk.js +1 -1
  406. package/lib/context/app-resolver.d.ts +36 -0
  407. package/lib/context/app-resolver.js +1 -1
  408. package/lib/context/auth-resolver.d.ts +5 -0
  409. package/lib/context/auth-resolver.js +1 -1
  410. package/lib/context/config-loader.d.ts +61 -0
  411. package/lib/context/config-loader.js +1 -1
  412. package/lib/context.d.ts +102 -0
  413. package/lib/context.js +1 -1
  414. package/lib/core/alias-resolver.d.ts +31 -0
  415. package/lib/core/alias-resolver.js +1 -1
  416. package/lib/core/api-client.d.ts +1018 -0
  417. package/lib/core/api-client.js +1 -1
  418. package/lib/core/bff/config.d.ts +8 -0
  419. package/lib/core/bff/config.js +1 -1
  420. package/lib/core/bff/file-system.d.ts +28 -0
  421. package/lib/core/bff/file-system.js +1 -1
  422. package/lib/core/bff/hash.d.ts +7 -0
  423. package/lib/core/bff/hash.js +1 -1
  424. package/lib/core/bff/lock.d.ts +25 -0
  425. package/lib/core/bff/lock.js +1 -1
  426. package/lib/core/bff/types.d.ts +92 -0
  427. package/lib/core/bff/utils.d.ts +25 -0
  428. package/lib/core/bff/utils.js +1 -1
  429. package/lib/core/db-resolver.d.ts +43 -0
  430. package/lib/core/db-resolver.js +1 -1
  431. package/lib/core/page/file-system.d.ts +6 -0
  432. package/lib/core/page/file-system.js +1 -1
  433. package/lib/core/page/hash.d.ts +4 -0
  434. package/lib/core/page/hash.js +1 -1
  435. package/lib/core/page/lock.d.ts +8 -0
  436. package/lib/core/page/lock.js +1 -1
  437. package/lib/core/page/types.d.ts +22 -0
  438. package/lib/core/sql-index-auditor.d.ts +33 -0
  439. package/lib/core/sql-index-auditor.js +1 -1
  440. package/lib/core/sql-sync/config.d.ts +7 -0
  441. package/lib/core/sql-sync/config.js +1 -1
  442. package/lib/core/sql-sync/file-system.d.ts +7 -0
  443. package/lib/core/sql-sync/file-system.js +1 -1
  444. package/lib/core/sql-sync/hash.d.ts +5 -0
  445. package/lib/core/sql-sync/hash.js +1 -1
  446. package/lib/core/sql-sync/lock.d.ts +14 -0
  447. package/lib/core/sql-sync/lock.js +1 -1
  448. package/lib/core/sql-sync/types.d.ts +43 -0
  449. package/lib/core/sql-sync/utils.d.ts +10 -0
  450. package/lib/core/sql-sync/utils.js +1 -1
  451. package/lib/core/sql-validator.d.ts +34 -0
  452. package/lib/core/sql-validator.js +1 -1
  453. package/lib/errors.d.ts +3 -0
  454. package/lib/errors.js +1 -1
  455. package/lib/framework/build-all-flags.d.ts +2 -0
  456. package/lib/framework/build-all-flags.js +1 -1
  457. package/lib/framework/error-output.d.ts +9 -0
  458. package/lib/framework/error-output.js +1 -1
  459. package/lib/framework/explicit-yes.d.ts +3 -0
  460. package/lib/framework/explicit-yes.js +1 -1
  461. package/lib/framework/flags.d.ts +3 -0
  462. package/lib/framework/flags.js +1 -1
  463. package/lib/framework/help.d.ts +4 -0
  464. package/lib/framework/help.js +1 -1
  465. package/lib/framework/index.d.ts +11 -0
  466. package/lib/framework/index.js +1 -1
  467. package/lib/framework/output.d.ts +15 -0
  468. package/lib/framework/output.js +1 -1
  469. package/lib/framework/response.d.ts +2 -0
  470. package/lib/framework/response.js +1 -1
  471. package/lib/framework/runner-alias.d.ts +14 -0
  472. package/lib/framework/runner-alias.js +1 -1
  473. package/lib/framework/runner.d.ts +36 -0
  474. package/lib/framework/runner.js +1 -1
  475. package/lib/framework/schema-export.d.ts +3 -0
  476. package/lib/framework/schema-export.js +1 -1
  477. package/lib/framework/types.d.ts +63 -0
  478. package/lib/framework/types.js +1 -1
  479. package/lib/generated/build-info.d.ts +4 -0
  480. package/lib/generated/build-info.js +1 -1
  481. package/lib/help.d.ts +1 -0
  482. package/lib/help.js +1 -1
  483. package/lib/runtime/confirmation.d.ts +4 -0
  484. package/lib/runtime/confirmation.js +1 -0
  485. package/lib/runtime/event.d.ts +5 -0
  486. package/lib/runtime/event.js +1 -0
  487. package/lib/runtime/index.d.ts +7 -0
  488. package/lib/runtime/index.js +1 -0
  489. package/lib/runtime/queue.d.ts +5 -0
  490. package/lib/runtime/queue.js +1 -0
  491. package/lib/runtime/resolve.d.ts +8 -0
  492. package/lib/runtime/resolve.js +1 -0
  493. package/lib/runtime/types.d.ts +50 -0
  494. package/lib/runtime/types.js +1 -0
  495. package/lib/skills/main.d.ts +41 -0
  496. package/lib/skills/main.js +1 -1
  497. package/lib/skills/npx-skills-add.d.ts +99 -0
  498. package/lib/skills/npx-skills-add.js +1 -1
  499. package/lib/skills/skill-presence.d.ts +44 -0
  500. package/lib/skills/skill-presence.js +1 -1
  501. package/lib/telemetry/cli-command-trace.d.ts +12 -0
  502. package/lib/telemetry/cli-command-trace.js +1 -1
  503. package/lib/telemetry/cli-help-trace.d.ts +8 -0
  504. package/lib/telemetry/cli-help-trace.js +1 -1
  505. package/lib/telemetry/ensure-cli-otel-config.d.ts +6 -0
  506. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  507. package/lib/telemetry/register-otel-exit-shutdown.d.ts +3 -0
  508. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  509. package/lib/telemetry/send-cli-trace-log.d.ts +17 -0
  510. package/lib/telemetry/send-cli-trace-log.js +1 -1
  511. package/lib/telemetry/send-platform-issue-collect-log.d.ts +26 -0
  512. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  513. package/lib/types/index.d.ts +93 -0
  514. package/lib/utils/ai_config.d.ts +47 -0
  515. package/lib/utils/ai_config.js +1 -1
  516. package/lib/utils/apply-jq-filter.d.ts +1 -0
  517. package/lib/utils/apply-jq-filter.js +1 -1
  518. package/lib/utils/cdn-config.d.ts +42 -0
  519. package/lib/utils/cdn-config.js +1 -1
  520. package/lib/utils/check-sdk-version.d.ts +23 -0
  521. package/lib/utils/check-sdk-version.js +1 -1
  522. package/lib/utils/cli-version-check.d.ts +37 -0
  523. package/lib/utils/cli-version-check.js +1 -1
  524. package/lib/utils/cli-version-policy.d.ts +9 -0
  525. package/lib/utils/cli-version-policy.js +1 -1
  526. package/lib/utils/config.d.ts +42 -0
  527. package/lib/utils/config.js +1 -1
  528. package/lib/utils/copy-directory.d.ts +1 -0
  529. package/lib/utils/copy-directory.js +1 -1
  530. package/lib/utils/entity-with-id.d.ts +30 -0
  531. package/lib/utils/entity-with-id.js +1 -1
  532. package/lib/utils/file-utils.d.ts +25 -0
  533. package/lib/utils/file-utils.js +1 -1
  534. package/lib/utils/guides-cdn.d.ts +80 -0
  535. package/lib/utils/guides-cdn.js +1 -1
  536. package/lib/utils/http-client.d.ts +30 -0
  537. package/lib/utils/http-client.js +1 -1
  538. package/lib/utils/is-non-interactive.d.ts +7 -0
  539. package/lib/utils/is-non-interactive.js +1 -1
  540. package/lib/utils/logger.d.ts +62 -0
  541. package/lib/utils/logger.js +1 -1
  542. package/lib/utils/params.d.ts +15 -0
  543. package/lib/utils/params.js +1 -1
  544. package/lib/utils/platform.d.ts +21 -0
  545. package/lib/utils/platform.js +1 -1
  546. package/lib/utils/rules-cdn.d.ts +38 -0
  547. package/lib/utils/rules-cdn.js +1 -1
  548. package/lib/utils/sleep.d.ts +1 -0
  549. package/lib/utils/sleep.js +1 -1
  550. package/lib/utils/template-replacer.d.ts +55 -0
  551. package/lib/utils/template-replacer.js +1 -1
  552. package/lib/utils/update-notice.d.ts +10 -0
  553. package/lib/utils/update-notice.js +1 -1
  554. package/lib/utils/version.d.ts +1 -0
  555. package/lib/utils/version.js +1 -1
  556. package/lib/utils/with-active-cookie.d.ts +1 -0
  557. package/lib/utils/with-active-cookie.js +1 -1
  558. package/lib/utils/write-cli-side-channel.d.ts +6 -0
  559. package/lib/utils/write-cli-side-channel.js +1 -1
  560. package/package.json +9 -1
@@ -0,0 +1,66 @@
1
+ /**
2
+ * 统一命令注册表
3
+ *
4
+ * 所有命令统一 service + command 两级结构:
5
+ * rabetbase <service> <command> [flags]
6
+ *
7
+ * 声明式命令(全部)走 framework/runner 管线(风险门控、dry-run、formatOutput 全自动)。
8
+ *
9
+ * 帮助文本由 framework/help.ts 从 serviceRegistry 自动生成。
10
+ * 已移除命令只通过 resolveRemovedCommand 返回非发现式错误纠正提示。
11
+ */
12
+ import type { CommandDefinition, FlagDef } from "../framework/types.js";
13
+ export interface CommandModule {
14
+ name: string;
15
+ description: string;
16
+ /** 可选 flag 声明:声明后框架自动执行 parseFlags + validateFlags */
17
+ flags?: FlagDef[];
18
+ /** 自定义 USAGE 行,默认为 `<bin> <service> <command> [flags]` */
19
+ usage?: string;
20
+ subCommands?: Record<string, CommandModule>;
21
+ run(ctx: import("../context.js").CLIContext, args: string[], flags: Record<string, any>): Promise<void>;
22
+ }
23
+ export interface ServiceEntry {
24
+ /** service 名(dispatch 用) */
25
+ service: string;
26
+ /** 展示名(帮助文本中的分组标题) */
27
+ label: string;
28
+ /** 子命令展示信息 */
29
+ commands: {
30
+ command: string;
31
+ description: string;
32
+ tag?: string;
33
+ }[];
34
+ /** 声明式 = true(所有 service 均为声明式) */
35
+ declarative: true;
36
+ /** 默认子命令:rabetbase <service> 不带子命令时自动执行 */
37
+ defaultCommand?: string;
38
+ /**
39
+ * Wildcard 定义:任何未注册的子命令都路由到此 definition,
40
+ * command 名会被注入到 ctx.args[0],其余位置参数依次排后。
41
+ */
42
+ wildcardDef?: CommandDefinition;
43
+ /**
44
+ * 单命令 service 标记。
45
+ * true 时 help 将服务显示为直接命令(rabetbase init),
46
+ * 而非子命令形式(rabetbase init run)。
47
+ */
48
+ isSingleCommand?: boolean;
49
+ }
50
+ /** 按注册顺序排列(顺序 = 帮助展示顺序) */
51
+ export declare const serviceRegistry: ServiceEntry[];
52
+ export declare const definitions: Map<string, CommandDefinition>;
53
+ export declare const serviceGroups: Map<string, CommandDefinition[]>;
54
+ export interface RemovedCommand {
55
+ command: string;
56
+ message: string;
57
+ hint: string;
58
+ }
59
+ export declare function resolveRemovedCommand(service: string | undefined, command?: string | undefined): RemovedCommand | undefined;
60
+ export declare function findDefinition(service: string, command: string): CommandDefinition | undefined;
61
+ export declare function isKnownService(name: string): boolean;
62
+ export declare function isDeclarativeService(name: string): boolean;
63
+ export declare function getServiceEntry(name: string): ServiceEntry | undefined;
64
+ /** @deprecated Legacy 路由已删除,保留签名以防旧 import 引用 */
65
+ export declare function getLegacyHandler(_service: string, _command: string): undefined;
66
+ export declare function getAllDefinitions(): CommandDefinition[];
@@ -1 +1 @@
1
- const a162_0x375c96=a162_0x3aff;(function(_0x2a12dd,_0x4cdd43){const _0x4e2701=a162_0x3aff,_0x1b1760=_0x2a12dd();while(!![]){try{const _0x2e603c=-parseInt(_0x4e2701(0x144))/0x1+parseInt(_0x4e2701(0x182))/0x2*(parseInt(_0x4e2701(0x160))/0x3)+-parseInt(_0x4e2701(0x151))/0x4+-parseInt(_0x4e2701(0x171))/0x5*(parseInt(_0x4e2701(0x162))/0x6)+-parseInt(_0x4e2701(0x15f))/0x7+parseInt(_0x4e2701(0x149))/0x8*(parseInt(_0x4e2701(0x16a))/0x9)+parseInt(_0x4e2701(0x14e))/0xa;if(_0x2e603c===_0x4cdd43)break;else _0x1b1760['push'](_0x1b1760['shift']());}catch(_0x266afb){_0x1b1760['push'](_0x1b1760['shift']());}}}(a162_0x3583,0xb374b));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';function a162_0x3aff(_0x4af2c3,_0x236e8b){_0x4af2c3=_0x4af2c3-0x12b;const _0x358370=a162_0x3583();let _0x3aff9f=_0x358370[_0x4af2c3];return _0x3aff9f;}import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{taskDefinitions}from'../commands/task/index.js';import{tenantDefinitions}from'../commands/tenant/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];function a162_0x3583(){const _0x9bafbb=['Database\x20Connections','Run\x20any\x20package.json\x20script','app:remote','1054FFqCWa','rabetbase\x20run\x20preview','Use\x20`','menu:update','knowledge-base:update','wildcardDef','Platform\x20Issue','Runtime\x20App\x20Config\x20Management','sql:save','rabetbase\x20kb\x20detail','Smart\x20List\x20Pages','commands','Roles','knowledge-base:list','rabetbase\x20cli-skill\x20install','values','knowledge-base:create','logout','skill:install','install','length','<script>','run','File','CLI\x20Built-in\x20Skill','Diagnostics','app:add','set','command','create','Run\x20Scripts','description','rabetbase\x20run\x20start','Authentication','734221lPaBlk','login','rabetbase\x20menu\x20asset-update','build','skills:','1800LWUrvy','`\x20instead.','rabetbase\x20kb\x20create','hidden','rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>','19987000yDLWZp','rabetbase\x20auth\x20logout','Permissions','4693712olYgcu','\x20\x20[write]','\x20\x20[high-risk-write]','API\x20Development','defaultCommand','has','app:use','rabetbase\x20bff\x20create','get','project:init','app:remove','Notification\x20Configuration','Tenant\x20Members','`\x20has\x20been\x20removed.','5784408YkBlTB','4218VyfhHX','map','444558MJmLCk','rabetbase\x20kb\x20update','show','App\x20Management','Quick\x20Start','Project','bff:new','service','32139NPVbsv','Instant\x20API','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml','Configuration','rabetbase\x20sql\x20create','rabetbase\x20workspace\x20use\x20--app\x20<name>','read','5BXNTSr','isSingleCommand','rabetbase\x20run\x20build','Workspace','knowledge-base:detail','BFF\x20Scripts','Logs','rabetbase\x20kb\x20delete','skill:','Company\x20Knowledge\x20Base','start','sql:new','Schema','push'];a162_0x3583=function(){return _0x9bafbb;};return a162_0x3583();}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x14b854){const _0x916b1a=a162_0x3aff;for(const _0x321338 of _0x14b854){definitions[_0x916b1a(0x13d)](_0x321338['service']+':'+_0x321338[_0x916b1a(0x13e)],_0x321338);let _0x7c9ab0=serviceGroups[_0x916b1a(0x159)](_0x321338[_0x916b1a(0x169)]);!_0x7c9ab0&&(_0x7c9ab0=[],serviceGroups['set'](_0x321338['service'],_0x7c9ab0)),_0x7c9ab0[_0x916b1a(0x17e)](_0x321338);}}function registerDeclarativeService(_0x3d1749,_0x3c772b,_0x119355){const _0xbc8762=a162_0x3aff;registerDefinitions(_0x3c772b);_0x119355?.['wildcardDef']&&registerDefinitions([_0x119355['wildcardDef']]);const _0x5765ba=_0x2e89f7=>_0x2e89f7===_0xbc8762(0x170)?'':_0x2e89f7==='write'?_0xbc8762(0x152):_0xbc8762(0x153),_0x15dad6={'service':_0x3c772b[0x0][_0xbc8762(0x169)],'label':_0x3d1749,'commands':_0x3c772b['filter'](_0x4c2d76=>!_0x4c2d76[_0xbc8762(0x14c)])[_0xbc8762(0x161)](_0x5a2258=>({'command':_0x5a2258[_0xbc8762(0x13e)],'description':_0x5a2258[_0xbc8762(0x141)],'tag':_0x5765ba(_0x5a2258['risk'])})),'declarative':!![],'defaultCommand':_0x119355?.[_0xbc8762(0x155)]??(_0x119355?.[_0xbc8762(0x172)]?_0x3c772b[0x0][_0xbc8762(0x13e)]:undefined),'wildcardDef':_0x119355?.[_0xbc8762(0x187)],'isSingleCommand':_0x119355?.[_0xbc8762(0x172)]};serviceRegistry[_0xbc8762(0x17e)](_0x15dad6),serviceByName['set'](_0x15dad6['service'],_0x15dad6);}registerDeclarativeService(a162_0x375c96(0x166),initDefinitions,{'defaultCommand':a162_0x375c96(0x138),'isSingleCommand':!![]}),registerDeclarativeService(a162_0x375c96(0x167),projectDefinitions),registerDeclarativeService(a162_0x375c96(0x174),workspaceDefinitions),registerDeclarativeService(a162_0x375c96(0x165),appDefinitions),registerDeclarativeService(a162_0x375c96(0x143),authDefinitions,{'defaultCommand':a162_0x375c96(0x145)}),registerDeclarativeService(a162_0x375c96(0x15d),tenantDefinitions),registerDeclarativeService('Dataset\x20&\x20Operations',datasetDefinitions),registerDeclarativeService(a162_0x375c96(0x12c),pageDefinitions),registerDeclarativeService(a162_0x375c96(0x154),apiDefinitions),registerDeclarativeService(a162_0x375c96(0x16b),dataDefinitions),registerDeclarativeService(a162_0x375c96(0x176),bffDefinitions),registerDeclarativeService(a162_0x375c96(0x15c),notificationDefinitions),registerDeclarativeService('SQL\x20Queries',sqlDefinitions),registerDeclarativeService(a162_0x375c96(0x17f),dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService('Async\x20Tasks',taskDefinitions),registerDeclarativeService(a162_0x375c96(0x12e),roleDefinitions),registerDeclarativeService(a162_0x375c96(0x150),permitDefinitions),registerDeclarativeService(a162_0x375c96(0x189),appConfigDefinitions),registerDeclarativeService(a162_0x375c96(0x17a),kbDefinitions),registerDeclarativeService(a162_0x375c96(0x188),issueDefinitions),registerDeclarativeService(a162_0x375c96(0x139),fileDefinitions),registerDeclarativeService('OCR',ocrDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a162_0x375c96(0x16d),configDefinitions),registerDeclarativeService(a162_0x375c96(0x13b),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x375c96(0x17d),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x375c96(0x13a),cliSkillDefinitions,{'defaultCommand':a162_0x375c96(0x135)}),registerDeclarativeService(a162_0x375c96(0x177),logsDefinitions,{'defaultCommand':a162_0x375c96(0x164)}),registerDeclarativeService(a162_0x375c96(0x140),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a162_0x375c96(0x136)]-0x1];last[a162_0x375c96(0x12d)]=[{'command':a162_0x375c96(0x137),'description':a162_0x375c96(0x180),'tag':''}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([[a162_0x375c96(0x18a),a162_0x375c96(0x16c)],[a162_0x375c96(0x168),a162_0x375c96(0x158)],[a162_0x375c96(0x17c),a162_0x375c96(0x16e)],[a162_0x375c96(0x185),a162_0x375c96(0x146)],[a162_0x375c96(0x15a),'rabetbase\x20workspace\x20init\x20--appcode\x20<code>'],[a162_0x375c96(0x179),a162_0x375c96(0x130)],[a162_0x375c96(0x134),a162_0x375c96(0x130)],[a162_0x375c96(0x148),'rabetbase\x20cli-skill\x20install'],['skills:install',a162_0x375c96(0x130)],[a162_0x375c96(0x181),'rabetbase\x20app\x20list\x20--remote'],[a162_0x375c96(0x157),a162_0x375c96(0x16f)],[a162_0x375c96(0x13c),a162_0x375c96(0x14d)],[a162_0x375c96(0x15b),'rabetbase\x20workspace\x20remove\x20<name>'],[a162_0x375c96(0x12f),'rabetbase\x20kb\x20list'],[a162_0x375c96(0x175),a162_0x375c96(0x12b)],[a162_0x375c96(0x132),a162_0x375c96(0x14b)],[a162_0x375c96(0x186),a162_0x375c96(0x163)],['knowledge-base:delete',a162_0x375c96(0x178)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a162_0x375c96(0x13f),'rabetbase\x20project\x20create\x20<project-name>'],[a162_0x375c96(0x17b),a162_0x375c96(0x142)],[a162_0x375c96(0x147),a162_0x375c96(0x173)],['preview',a162_0x375c96(0x183)],[a162_0x375c96(0x133),a162_0x375c96(0x14f)]]);export function resolveRemovedCommand(_0x34d28f,_0x3c39ab){const _0x103667=a162_0x375c96;if(!_0x34d28f)return undefined;const _0x13d75d=REMOVED_COMMAND_REPLACEMENTS[_0x103667(0x159)](_0x34d28f+':'+(_0x3c39ab??'')),_0x4b5df5=REMOVED_FLAT_COMMAND_REPLACEMENTS[_0x103667(0x159)](_0x34d28f),_0x1d36d5=_0x13d75d??_0x4b5df5;if(!_0x1d36d5)return undefined;const _0x25b46c=_0x4b5df5?_0x34d28f:_0x3c39ab?_0x34d28f+'\x20'+_0x3c39ab:_0x34d28f;return{'command':_0x25b46c,'message':'`rabetbase\x20'+_0x25b46c+_0x103667(0x15e),'hint':_0x103667(0x184)+_0x1d36d5+_0x103667(0x14a)};}export function findDefinition(_0x5b85dc,_0x55ae5d){const _0x27bdcb=a162_0x375c96;return definitions[_0x27bdcb(0x159)](_0x5b85dc+':'+_0x55ae5d);}export function isKnownService(_0x505391){return serviceByName['has'](_0x505391);}export function isDeclarativeService(_0x54b6b5){const _0x21509e=a162_0x375c96;return serviceGroups[_0x21509e(0x156)](_0x54b6b5)||serviceByName[_0x21509e(0x159)](_0x54b6b5)?.[_0x21509e(0x187)]!==undefined;}export function getServiceEntry(_0x1628ce){const _0x1134c8=a162_0x375c96;return serviceByName[_0x1134c8(0x159)](_0x1628ce);}export function getLegacyHandler(_0x1cca8a,_0x238da4){return undefined;}export function getAllDefinitions(){const _0x2388ae=a162_0x375c96;return Array['from'](definitions[_0x2388ae(0x131)]());}
1
+ const a162_0x2cec0b=a162_0x31db;(function(_0x12213f,_0x98c1cd){const _0x34212c=a162_0x31db,_0x50292b=_0x12213f();while(!![]){try{const _0x552610=-parseInt(_0x34212c(0x1b1))/0x1+-parseInt(_0x34212c(0x1bc))/0x2*(-parseInt(_0x34212c(0x1de))/0x3)+-parseInt(_0x34212c(0x1b7))/0x4*(parseInt(_0x34212c(0x1a7))/0x5)+parseInt(_0x34212c(0x1a5))/0x6+-parseInt(_0x34212c(0x1bb))/0x7*(parseInt(_0x34212c(0x1d6))/0x8)+parseInt(_0x34212c(0x1b0))/0x9*(parseInt(_0x34212c(0x1e6))/0xa)+-parseInt(_0x34212c(0x1a1))/0xb*(-parseInt(_0x34212c(0x18b))/0xc);if(_0x552610===_0x98c1cd)break;else _0x50292b['push'](_0x50292b['shift']());}catch(_0x17bd38){_0x50292b['push'](_0x50292b['shift']());}}}(a162_0x4f7d,0x7c1be));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{taskDefinitions}from'../commands/task/index.js';import{tenantDefinitions}from'../commands/tenant/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';function a162_0x31db(_0x22c9e6,_0x3092ec){_0x22c9e6=_0x22c9e6-0x18a;const _0x4f7d51=a162_0x4f7d();let _0x31db35=_0x4f7d51[_0x22c9e6];return _0x31db35;}function a162_0x4f7d(){const _0x4def4d=['File','login','2778587AhTlOi','1986umjwFf','knowledge-base:update','`\x20has\x20been\x20removed.','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml','Use\x20`','knowledge-base:delete','skill:','Run\x20any\x20package.json\x20script','rabetbase\x20kb\x20delete','Permissions','`\x20instead.','show','Configuration','rabetbase\x20run\x20build','from','bff:new','rabetbase\x20bff\x20create','set','map','Quick\x20Start','Notification\x20Configuration','build','\x20\x20[write]','defaultCommand','Authentication','rabetbase\x20app\x20list\x20--remote','8qTpzIZ','rabetbase\x20project\x20create\x20<project-name>','sql:save','isSingleCommand','app:use','rabetbase\x20run\x20preview','rabetbase\x20sql\x20create','push','9QuCBnm','write','Diagnostics','Schema','skill:install','wildcardDef','Run\x20Scripts','Self\x20Update','26470qTjlWO','Logs','Instant\x20API','project:init','12972RMJShT','has','SQL\x20Queries','Code\x20Generation','BFF\x20Scripts','rabetbase\x20run\x20start','hidden','Tenant\x20Members','rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>','CLI\x20Built-in\x20Skill','create','description','Runtime\x20App\x20Config\x20Management','App\x20Management','service','rabetbase\x20kb\x20detail','knowledge-base:list','skills:','Project','Platform\x20Issue','Async\x20Tasks','<script>','13453rCscVS','rabetbase\x20kb\x20create','install','get','2684970nmLHVv','knowledge-base:create','1100oMEIkU','\x20\x20[high-risk-write]','values','preview','commands','rabetbase\x20cli-skill\x20install','run','rabetbase\x20auth\x20logout','`rabetbase\x20','2025caaEoT','449501cIQebo','command','rabetbase\x20kb\x20update','Smart\x20List\x20Pages','length','menu:update','18424KOSFhn','knowledge-base:detail'];a162_0x4f7d=function(){return _0x4def4d;};return a162_0x4f7d();}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(_0x3dc1d5){const _0x2809d0=a162_0x31db;for(const _0x2c397d of _0x3dc1d5){definitions[_0x2809d0(0x1cd)](_0x2c397d[_0x2809d0(0x199)]+':'+_0x2c397d[_0x2809d0(0x1b2)],_0x2c397d);let _0x5ac1a3=serviceGroups['get'](_0x2c397d[_0x2809d0(0x199)]);!_0x5ac1a3&&(_0x5ac1a3=[],serviceGroups[_0x2809d0(0x1cd)](_0x2c397d[_0x2809d0(0x199)],_0x5ac1a3)),_0x5ac1a3[_0x2809d0(0x1dd)](_0x2c397d);}}function registerDeclarativeService(_0x5e140e,_0x58460f,_0x24523f){const _0x313c7e=a162_0x31db;registerDefinitions(_0x58460f);_0x24523f?.[_0x313c7e(0x1e3)]&&registerDefinitions([_0x24523f['wildcardDef']]);const _0xb9f903=_0x217182=>_0x217182==='read'?'':_0x217182===_0x313c7e(0x1df)?_0x313c7e(0x1d2):_0x313c7e(0x1a8),_0x8dd7c6={'service':_0x58460f[0x0][_0x313c7e(0x199)],'label':_0x5e140e,'commands':_0x58460f['filter'](_0x4114bf=>!_0x4114bf[_0x313c7e(0x191)])[_0x313c7e(0x1ce)](_0x26a2a5=>({'command':_0x26a2a5['command'],'description':_0x26a2a5[_0x313c7e(0x196)],'tag':_0xb9f903(_0x26a2a5['risk'])})),'declarative':!![],'defaultCommand':_0x24523f?.[_0x313c7e(0x1d3)]??(_0x24523f?.[_0x313c7e(0x1d9)]?_0x58460f[0x0][_0x313c7e(0x1b2)]:undefined),'wildcardDef':_0x24523f?.['wildcardDef'],'isSingleCommand':_0x24523f?.[_0x313c7e(0x1d9)]};serviceRegistry[_0x313c7e(0x1dd)](_0x8dd7c6),serviceByName[_0x313c7e(0x1cd)](_0x8dd7c6[_0x313c7e(0x199)],_0x8dd7c6);}registerDeclarativeService(a162_0x2cec0b(0x1cf),initDefinitions,{'defaultCommand':a162_0x2cec0b(0x1ad),'isSingleCommand':!![]}),registerDeclarativeService(a162_0x2cec0b(0x19d),projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService(a162_0x2cec0b(0x198),appDefinitions),registerDeclarativeService(a162_0x2cec0b(0x1d4),authDefinitions,{'defaultCommand':a162_0x2cec0b(0x1ba)}),registerDeclarativeService(a162_0x2cec0b(0x192),tenantDefinitions),registerDeclarativeService('Dataset\x20&\x20Operations',datasetDefinitions),registerDeclarativeService(a162_0x2cec0b(0x1b4),pageDefinitions),registerDeclarativeService('API\x20Development',apiDefinitions),registerDeclarativeService(a162_0x2cec0b(0x1e8),dataDefinitions),registerDeclarativeService(a162_0x2cec0b(0x18f),bffDefinitions),registerDeclarativeService(a162_0x2cec0b(0x1d0),notificationDefinitions),registerDeclarativeService(a162_0x2cec0b(0x18d),sqlDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a162_0x2cec0b(0x19f),taskDefinitions),registerDeclarativeService('Roles',roleDefinitions),registerDeclarativeService(a162_0x2cec0b(0x1c5),permitDefinitions),registerDeclarativeService(a162_0x2cec0b(0x197),appConfigDefinitions),registerDeclarativeService('Company\x20Knowledge\x20Base',kbDefinitions),registerDeclarativeService(a162_0x2cec0b(0x19e),issueDefinitions),registerDeclarativeService(a162_0x2cec0b(0x1b9),fileDefinitions),registerDeclarativeService('OCR',ocrDefinitions),registerDeclarativeService(a162_0x2cec0b(0x18e),codegenDefinitions),registerDeclarativeService(a162_0x2cec0b(0x1c8),configDefinitions),registerDeclarativeService(a162_0x2cec0b(0x1e0),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x2cec0b(0x1e1),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x2cec0b(0x1e5),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a162_0x2cec0b(0x194),cliSkillDefinitions,{'defaultCommand':a162_0x2cec0b(0x1a3)}),registerDeclarativeService(a162_0x2cec0b(0x1e7),logsDefinitions,{'defaultCommand':a162_0x2cec0b(0x1c7)}),registerDeclarativeService(a162_0x2cec0b(0x1e4),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a162_0x2cec0b(0x1b5)]-0x1];last[a162_0x2cec0b(0x1ab)]=[{'command':a162_0x2cec0b(0x1a0),'description':a162_0x2cec0b(0x1c3),'tag':''}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([[a162_0x2cec0b(0x1d8),a162_0x2cec0b(0x1bf)],[a162_0x2cec0b(0x1cb),a162_0x2cec0b(0x1cc)],['sql:new',a162_0x2cec0b(0x1dc)],[a162_0x2cec0b(0x1b6),'rabetbase\x20menu\x20asset-update'],[a162_0x2cec0b(0x18a),'rabetbase\x20workspace\x20init\x20--appcode\x20<code>'],[a162_0x2cec0b(0x1c2),'rabetbase\x20cli-skill\x20install'],[a162_0x2cec0b(0x1e2),a162_0x2cec0b(0x1ac)],[a162_0x2cec0b(0x19c),a162_0x2cec0b(0x1ac)],['skills:install',a162_0x2cec0b(0x1ac)],['app:remote',a162_0x2cec0b(0x1d5)],[a162_0x2cec0b(0x1da),'rabetbase\x20workspace\x20use\x20--app\x20<name>'],['app:add',a162_0x2cec0b(0x193)],['app:remove','rabetbase\x20workspace\x20remove\x20<name>'],[a162_0x2cec0b(0x19b),'rabetbase\x20kb\x20list'],[a162_0x2cec0b(0x1b8),a162_0x2cec0b(0x19a)],[a162_0x2cec0b(0x1a6),a162_0x2cec0b(0x1a2)],[a162_0x2cec0b(0x1bd),a162_0x2cec0b(0x1b3)],[a162_0x2cec0b(0x1c1),a162_0x2cec0b(0x1c4)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a162_0x2cec0b(0x195),a162_0x2cec0b(0x1d7)],['start',a162_0x2cec0b(0x190)],[a162_0x2cec0b(0x1d1),a162_0x2cec0b(0x1c9)],[a162_0x2cec0b(0x1aa),a162_0x2cec0b(0x1db)],['logout',a162_0x2cec0b(0x1ae)]]);export function resolveRemovedCommand(_0x39c779,_0x2a78e8){const _0x5d51ac=a162_0x2cec0b;if(!_0x39c779)return undefined;const _0x3ba584=REMOVED_COMMAND_REPLACEMENTS[_0x5d51ac(0x1a4)](_0x39c779+':'+(_0x2a78e8??'')),_0x523e51=REMOVED_FLAT_COMMAND_REPLACEMENTS[_0x5d51ac(0x1a4)](_0x39c779),_0x5d641e=_0x3ba584??_0x523e51;if(!_0x5d641e)return undefined;const _0x19ea55=_0x523e51?_0x39c779:_0x2a78e8?_0x39c779+'\x20'+_0x2a78e8:_0x39c779;return{'command':_0x19ea55,'message':_0x5d51ac(0x1af)+_0x19ea55+_0x5d51ac(0x1be),'hint':_0x5d51ac(0x1c0)+_0x5d641e+_0x5d51ac(0x1c6)};}export function findDefinition(_0x13f9ba,_0x508563){const _0x24b192=a162_0x2cec0b;return definitions[_0x24b192(0x1a4)](_0x13f9ba+':'+_0x508563);}export function isKnownService(_0x29d5d4){const _0x6e3f37=a162_0x2cec0b;return serviceByName[_0x6e3f37(0x18c)](_0x29d5d4);}export function isDeclarativeService(_0x1d546f){const _0x530b46=a162_0x2cec0b;return serviceGroups['has'](_0x1d546f)||serviceByName[_0x530b46(0x1a4)](_0x1d546f)?.[_0x530b46(0x1e3)]!==undefined;}export function getServiceEntry(_0x58f92e){const _0x4260c7=a162_0x2cec0b;return serviceByName[_0x4260c7(0x1a4)](_0x58f92e);}export function getLegacyHandler(_0xacb196,_0x30b8c5){return undefined;}export function getAllDefinitions(){const _0x3ec15b=a162_0x2cec0b;return Array[_0x3ec15b(0x1ca)](definitions[_0x3ec15b(0x1a9)]());}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const roleCreate: CommandDefinition;
@@ -1 +1 @@
1
- const a163_0x8d0713=a163_0x5dff;(function(_0x389bbd,_0x17ea73){const _0x57eb00=a163_0x5dff,_0x58c20a=_0x389bbd();while(!![]){try{const _0x77869b=-parseInt(_0x57eb00(0x161))/0x1+parseInt(_0x57eb00(0x173))/0x2*(parseInt(_0x57eb00(0x165))/0x3)+parseInt(_0x57eb00(0x15e))/0x4+parseInt(_0x57eb00(0x167))/0x5*(-parseInt(_0x57eb00(0x15b))/0x6)+-parseInt(_0x57eb00(0x16e))/0x7*(-parseInt(_0x57eb00(0x16c))/0x8)+parseInt(_0x57eb00(0x169))/0x9+parseInt(_0x57eb00(0x15f))/0xa*(-parseInt(_0x57eb00(0x168))/0xb);if(_0x77869b===_0x17ea73)break;else _0x58c20a['push'](_0x58c20a['shift']());}catch(_0x5a8621){_0x58c20a['push'](_0x58c20a['shift']());}}}(a163_0x578f,0xb5100));function a163_0x5dff(_0x3e0bc3,_0x493c83){_0x3e0bc3=_0x3e0bc3-0x15a;const _0x578ff9=a163_0x578f();let _0x5dffe1=_0x578ff9[_0x3e0bc3];return _0x5dffe1;}import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH='/smartapi/permit/role/create';function readName(_0x5aa9e6){const _0x3d5506=a163_0x5dff,_0x54ed21=_0x5aa9e6[_0x3d5506(0x16f)](_0x3d5506(0x15d))[_0x3d5506(0x160)]();if(!_0x54ed21)throw CliErrors[_0x3d5506(0x174)](_0x3d5506(0x15d),_0x3d5506(0x15a));if(_0x54ed21[_0x3d5506(0x16a)]>0x40)throw CliErrors[_0x3d5506(0x16d)](_0x3d5506(0x170));return _0x54ed21;}function a163_0x578f(){const _0x275a71=['appCode','Pass\x20--name\x20<roleName>.','2082kmilui','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','name','3351244bQGPnX','20517610dqQnUF','trim','738312NojVKp','write','role','roleName','3110274bqMYAe','\x20(id=','4985Wdcstp','11JMmwYL','9721566QDrJLn','length','CUSTOM','184KeSnUX','validation','280889ZMMuJr','str','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','POST','create','2jhwiBU','flagMissing'];a163_0x578f=function(){return _0x275a71;};return a163_0x578f();}export const roleCreate={'service':a163_0x8d0713(0x163),'command':'create','description':a163_0x8d0713(0x15c),'risk':a163_0x8d0713(0x162),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x58169c){readName(_0x58169c);},async 'dryRun'(_0x1bcba6){const _0x1b35a9=a163_0x8d0713,_0x373f8e=readName(_0x1bcba6),_0x4380fb=_0x1bcba6['str']('remark')['trim']()||undefined;return asDryRunResult({'operation':_0x1b35a9(0x172),'selector':{'appCode':_0x1bcba6[_0x1b35a9(0x175)],'roleName':_0x373f8e},'before':null,'after':{'roleName':_0x373f8e,'roleType':_0x1b35a9(0x16b),'remark':_0x4380fb},'dryRun':!![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},{'method':_0x1b35a9(0x171),'url':CREATE_PATH});},async 'execute'(_0x584bbb){const _0x5ef988=a163_0x8d0713,_0x5b677f=readName(_0x584bbb),_0x59cce8=_0x584bbb[_0x5ef988(0x16f)]('remark')[_0x5ef988(0x160)]()||undefined,_0x4244b5=await createAppRole({'appCode':_0x584bbb[_0x5ef988(0x175)],'roleName':_0x5b677f,..._0x59cce8?{'remark':_0x59cce8}:{}});return{'ok':!![],'data':{'operation':_0x5ef988(0x172),'selector':{'appCode':_0x584bbb[_0x5ef988(0x175)],'roleId':_0x4244b5['id'],'roleName':_0x5b677f},'before':null,'after':projectRole(_0x4244b5),'dryRun':![],'backend':{'method':_0x5ef988(0x171),'path':CREATE_PATH},'warnings':[]},'message':'Created\x20role\x20'+_0x4244b5[_0x5ef988(0x164)]+_0x5ef988(0x166)+_0x4244b5['id']+')'};}};
1
+ const a163_0x45dfd3=a163_0x1549;function a163_0x86e4(){const _0xd91974=['6OGsBPZ','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','19697496AiHpRt','appCode','name','135CcPOPJ','create','2098EDYAHy','write','1612911Ypiqht','CUSTOM','250397bqcnFd','trim','POST','673ZtahHg','remark','6784515LMvnGt','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','length','validation','Pass\x20--name\x20<roleName>.','4RJxVgb','184KFqQVM','flagMissing','roleName','7499360nrPaon','Created\x20role\x20','str','\x20(id=','612190qJicjl'];a163_0x86e4=function(){return _0xd91974;};return a163_0x86e4();}(function(_0x45c2a5,_0x4eecc5){const _0x1a1946=a163_0x1549,_0x88b40c=_0x45c2a5();while(!![]){try{const _0x2b0421=-parseInt(_0x1a1946(0x87))/0x1*(-parseInt(_0x1a1946(0x80))/0x2)+-parseInt(_0x1a1946(0x82))/0x3*(-parseInt(_0x1a1946(0x70))/0x4)+-parseInt(_0x1a1946(0x89))/0x5*(parseInt(_0x1a1946(0x79))/0x6)+-parseInt(_0x1a1946(0x84))/0x7*(-parseInt(_0x1a1946(0x71))/0x8)+-parseInt(_0x1a1946(0x7e))/0x9*(parseInt(_0x1a1946(0x78))/0xa)+-parseInt(_0x1a1946(0x74))/0xb+parseInt(_0x1a1946(0x7b))/0xc;if(_0x2b0421===_0x4eecc5)break;else _0x88b40c['push'](_0x88b40c['shift']());}catch(_0x390967){_0x88b40c['push'](_0x88b40c['shift']());}}}(a163_0x86e4,0xb7509));function a163_0x1549(_0x58bd11,_0x4082ad){_0x58bd11=_0x58bd11-0x6e;const _0x86e4ea=a163_0x86e4();let _0x1549eb=_0x86e4ea[_0x58bd11];return _0x1549eb;}import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH='/smartapi/permit/role/create';function readName(_0x2c4450){const _0x4bd6ab=a163_0x1549,_0x219cfb=_0x2c4450[_0x4bd6ab(0x76)](_0x4bd6ab(0x7d))[_0x4bd6ab(0x85)]();if(!_0x219cfb)throw CliErrors[_0x4bd6ab(0x72)]('name',_0x4bd6ab(0x6f));if(_0x219cfb[_0x4bd6ab(0x8b)]>0x40)throw CliErrors[_0x4bd6ab(0x6e)](_0x4bd6ab(0x7a));return _0x219cfb;}export const roleCreate={'service':'role','command':'create','description':a163_0x45dfd3(0x8a),'risk':a163_0x45dfd3(0x81),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x51aedd){readName(_0x51aedd);},async 'dryRun'(_0x5023eb){const _0x2ccb85=a163_0x45dfd3,_0x394251=readName(_0x5023eb),_0x1f4b78=_0x5023eb['str'](_0x2ccb85(0x88))['trim']()||undefined;return asDryRunResult({'operation':_0x2ccb85(0x7f),'selector':{'appCode':_0x5023eb[_0x2ccb85(0x7c)],'roleName':_0x394251},'before':null,'after':{'roleName':_0x394251,'roleType':_0x2ccb85(0x83),'remark':_0x1f4b78},'dryRun':!![],'backend':{'method':_0x2ccb85(0x86),'path':CREATE_PATH},'warnings':[]},{'method':_0x2ccb85(0x86),'url':CREATE_PATH});},async 'execute'(_0x104c80){const _0x256837=a163_0x45dfd3,_0x276a4d=readName(_0x104c80),_0x43b308=_0x104c80[_0x256837(0x76)]('remark')[_0x256837(0x85)]()||undefined,_0x4303bb=await createAppRole({'appCode':_0x104c80[_0x256837(0x7c)],'roleName':_0x276a4d,..._0x43b308?{'remark':_0x43b308}:{}});return{'ok':!![],'data':{'operation':_0x256837(0x7f),'selector':{'appCode':_0x104c80[_0x256837(0x7c)],'roleId':_0x4303bb['id'],'roleName':_0x276a4d},'before':null,'after':projectRole(_0x4303bb),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},'message':_0x256837(0x75)+_0x4303bb[_0x256837(0x73)]+_0x256837(0x77)+_0x4303bb['id']+')'};}};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const roleDelete: CommandDefinition;
@@ -1 +1 @@
1
- const a164_0x5a4c74=a164_0xe573;function a164_0xe573(_0x174e01,_0x767c90){_0x174e01=_0x174e01-0x93;const _0x18a6b0=a164_0x18a6();let _0xe573cf=_0x18a6b0[_0x174e01];return _0xe573cf;}(function(_0x578552,_0x364578){const _0x2478b7=a164_0xe573,_0xe8d2f2=_0x578552();while(!![]){try{const _0x3bda8f=parseInt(_0x2478b7(0xa7))/0x1+parseInt(_0x2478b7(0x9f))/0x2*(parseInt(_0x2478b7(0x99))/0x3)+-parseInt(_0x2478b7(0x97))/0x4+-parseInt(_0x2478b7(0x9e))/0x5*(parseInt(_0x2478b7(0xa8))/0x6)+parseInt(_0x2478b7(0x9c))/0x7+-parseInt(_0x2478b7(0xa1))/0x8*(-parseInt(_0x2478b7(0xa2))/0x9)+-parseInt(_0x2478b7(0xa9))/0xa;if(_0x3bda8f===_0x364578)break;else _0xe8d2f2['push'](_0xe8d2f2['shift']());}catch(_0x258d55){_0xe8d2f2['push'](_0xe8d2f2['shift']());}}}(a164_0x18a6,0x1aefb));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a164_0x18a6(){const _0x22a313=['Deleted\x20role\x20','delete','num','206646NRCpoE','12lEYsWJ','1807150ZczWMn','\x20(id=','/smartapi/permit/role/delete','role','userCount','632052MDHDNV','Role\x20still\x20has\x20','97968wYJUbd','POST','roleName','944230TsIgQq','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','431275WhKoyJ','10kCuhwa','high-risk-write','133432RgYENX','63InOWeb','appCode'];a164_0x18a6=function(){return _0x22a313;};return a164_0x18a6();}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a164_0x5a4c74(0x94);export const roleDelete={'service':a164_0x5a4c74(0x95),'command':a164_0x5a4c74(0xa5),'description':a164_0x5a4c74(0x9d),'risk':a164_0x5a4c74(0xa0),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1b191d){const _0x4496aa=a164_0x5a4c74,_0x3b7841=_0x1b191d['num']('id'),_0x3deac6=await getRoleById(_0x1b191d['appCode'],_0x3b7841);return assertCustomRole(_0x3deac6,_0x4496aa(0xa5)),asDryRunResult({'operation':_0x4496aa(0xa5),'selector':{'appCode':_0x1b191d[_0x4496aa(0xa3)],'roleId':_0x3b7841,'roleName':_0x3deac6[_0x4496aa(0x9b)]},'before':projectRole(_0x3deac6),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x3deac6[_0x4496aa(0x96)]>0x0?[_0x4496aa(0x98)+_0x3deac6[_0x4496aa(0x96)]+'\x20member(s);\x20they\x20will\x20lose\x20this\x20group.']:[]},{'method':_0x4496aa(0x9a),'url':DELETE_PATH});},async 'execute'(_0x356d85){const _0xf5beff=a164_0x5a4c74,_0x1c747d=_0x356d85[_0xf5beff(0xa6)]('id'),_0x18bb74=await getRoleById(_0x356d85[_0xf5beff(0xa3)],_0x1c747d);return assertCustomRole(_0x18bb74,'delete'),await deleteAppRole(_0x1c747d),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0x356d85[_0xf5beff(0xa3)],'roleId':_0x1c747d,'roleName':_0x18bb74['roleName']},'before':projectRole(_0x18bb74),'after':null,'dryRun':![],'backend':{'method':_0xf5beff(0x9a),'path':DELETE_PATH},'warnings':[]},'message':_0xf5beff(0xa4)+_0x18bb74[_0xf5beff(0x9b)]+_0xf5beff(0x93)+_0x1c747d+')'};}};
1
+ const a164_0x51a89b=a164_0x5012;(function(_0x1a4b0a,_0x40b852){const _0x4cd205=a164_0x5012,_0x528744=_0x1a4b0a();while(!![]){try{const _0x2ec956=-parseInt(_0x4cd205(0x170))/0x1*(-parseInt(_0x4cd205(0x174))/0x2)+parseInt(_0x4cd205(0x178))/0x3*(parseInt(_0x4cd205(0x175))/0x4)+parseInt(_0x4cd205(0x180))/0x5*(parseInt(_0x4cd205(0x16e))/0x6)+parseInt(_0x4cd205(0x179))/0x7*(-parseInt(_0x4cd205(0x177))/0x8)+parseInt(_0x4cd205(0x173))/0x9*(-parseInt(_0x4cd205(0x183))/0xa)+-parseInt(_0x4cd205(0x181))/0xb+parseInt(_0x4cd205(0x17d))/0xc;if(_0x2ec956===_0x40b852)break;else _0x528744['push'](_0x528744['shift']());}catch(_0x260b05){_0x528744['push'](_0x528744['shift']());}}}(a164_0x307c,0x94959));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a164_0x5012(_0x363d95,_0x460893){_0x363d95=_0x363d95-0x16e;const _0x307c26=a164_0x307c();let _0x5012f0=_0x307c26[_0x363d95];return _0x5012f0;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a164_0x307c(){const _0x4c1771=['4226035QZeyRV','appCode','30yTfrKv','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','8226ftdPgh','num','101SKHtMb','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','userCount','3601413JlurkK','23378KsWsDa','2276ZVAbfM','delete','4454768nhvLaL','1335yuSPII','14hTMRgS','Role\x20still\x20has\x20','\x20(id=','roleName','10023696TMbWRQ','POST','role','3785DHTFmy'];a164_0x307c=function(){return _0x4c1771;};return a164_0x307c();}const DELETE_PATH='/smartapi/permit/role/delete';export const roleDelete={'service':a164_0x51a89b(0x17f),'command':a164_0x51a89b(0x176),'description':a164_0x51a89b(0x171),'risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1dbb0c){const _0x1106ca=a164_0x51a89b,_0x445ddf=_0x1dbb0c[_0x1106ca(0x16f)]('id'),_0x1486bf=await getRoleById(_0x1dbb0c['appCode'],_0x445ddf);return assertCustomRole(_0x1486bf,'delete'),asDryRunResult({'operation':'delete','selector':{'appCode':_0x1dbb0c['appCode'],'roleId':_0x445ddf,'roleName':_0x1486bf['roleName']},'before':projectRole(_0x1486bf),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x1486bf[_0x1106ca(0x172)]>0x0?[_0x1106ca(0x17a)+_0x1486bf[_0x1106ca(0x172)]+_0x1106ca(0x184)]:[]},{'method':_0x1106ca(0x17e),'url':DELETE_PATH});},async 'execute'(_0x3aefd2){const _0x459b0a=a164_0x51a89b,_0xe93427=_0x3aefd2[_0x459b0a(0x16f)]('id'),_0x3ec44e=await getRoleById(_0x3aefd2[_0x459b0a(0x182)],_0xe93427);return assertCustomRole(_0x3ec44e,_0x459b0a(0x176)),await deleteAppRole(_0xe93427),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0x3aefd2[_0x459b0a(0x182)],'roleId':_0xe93427,'roleName':_0x3ec44e[_0x459b0a(0x17c)]},'before':projectRole(_0x3ec44e),'after':null,'dryRun':![],'backend':{'method':_0x459b0a(0x17e),'path':DELETE_PATH},'warnings':[]},'message':'Deleted\x20role\x20'+_0x3ec44e[_0x459b0a(0x17c)]+_0x459b0a(0x17b)+_0xe93427+')'};}};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const roleDetail: CommandDefinition;
@@ -1 +1 @@
1
- function a165_0x5358(){const _0x5bda50=['roleType','Role\x20','9607130pLxQKZ','roleName','Show\x20a\x20single\x20role\x27s\x20detail','7931ESHPjq','1214964yuDPwy','785YkUajj','547359OzZrbp','detail','role','2974356DEkXRT','1282VdGCKA','num','read','9510EVqsGP','2504JdUdbP','10oBpRRI'];a165_0x5358=function(){return _0x5bda50;};return a165_0x5358();}const a165_0x186778=a165_0x4882;function a165_0x4882(_0x134592,_0x8849c2){_0x134592=_0x134592-0xca;const _0x5358d1=a165_0x5358();let _0x488215=_0x5358d1[_0x134592];return _0x488215;}(function(_0x4cdde4,_0x4f64db){const _0x1f02ee=a165_0x4882,_0x347173=_0x4cdde4();while(!![]){try{const _0x2dc65a=-parseInt(_0x1f02ee(0xd8))/0x1*(-parseInt(_0x1f02ee(0xcb))/0x2)+-parseInt(_0x1f02ee(0xd4))/0x3+-parseInt(_0x1f02ee(0xd2))/0x4+-parseInt(_0x1f02ee(0xd3))/0x5*(parseInt(_0x1f02ee(0xdb))/0x6)+parseInt(_0x1f02ee(0xd1))/0x7*(-parseInt(_0x1f02ee(0xca))/0x8)+parseInt(_0x1f02ee(0xd7))/0x9+parseInt(_0x1f02ee(0xce))/0xa;if(_0x2dc65a===_0x4f64db)break;else _0x347173['push'](_0x347173['shift']());}catch(_0x69bb3a){_0x347173['push'](_0x347173['shift']());}}}(a165_0x5358,0x32c43));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a165_0x186778(0xd6),'command':a165_0x186778(0xd5),'description':a165_0x186778(0xd0),'risk':a165_0x186778(0xda),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x3cc80e){const _0x35b53c=a165_0x186778,_0x31f06d=_0x3cc80e[_0x35b53c(0xd9)]('id'),_0x2e5830=await getRoleById(_0x3cc80e['appCode'],_0x31f06d);return{'ok':!![],'data':{'role':projectRole(_0x2e5830)},'message':_0x35b53c(0xcd)+_0x2e5830[_0x35b53c(0xcf)]+'\x20('+_0x2e5830[_0x35b53c(0xcc)]+')'};}};
1
+ const a165_0x5e41f2=a165_0x722a;function a165_0x722a(_0x45c9cc,_0x2f4190){_0x45c9cc=_0x45c9cc-0x1dc;const _0x530725=a165_0x5307();let _0x722ac7=_0x530725[_0x45c9cc];return _0x722ac7;}(function(_0x421173,_0x593a71){const _0x2bb806=a165_0x722a,_0x3e19b2=_0x421173();while(!![]){try{const _0x814b8d=-parseInt(_0x2bb806(0x1e6))/0x1*(parseInt(_0x2bb806(0x1df))/0x2)+-parseInt(_0x2bb806(0x1dd))/0x3+parseInt(_0x2bb806(0x1e0))/0x4+-parseInt(_0x2bb806(0x1e2))/0x5+parseInt(_0x2bb806(0x1e4))/0x6+-parseInt(_0x2bb806(0x1eb))/0x7*(-parseInt(_0x2bb806(0x1e8))/0x8)+-parseInt(_0x2bb806(0x1e5))/0x9*(-parseInt(_0x2bb806(0x1dc))/0xa);if(_0x814b8d===_0x593a71)break;else _0x3e19b2['push'](_0x3e19b2['shift']());}catch(_0x1e2eb4){_0x3e19b2['push'](_0x3e19b2['shift']());}}}(a165_0x5307,0xb459d));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a165_0x5307(){const _0xbdb73e=['role','read','41780ehkUhC','3924858oJrtEt','detail','2YwTcPa','1717604fiQXCr','Role\x20','4366810JiEqsS','appCode','7421196pIJPsh','2700FmnImk','265678kbLFFa','Show\x20a\x20single\x20role\x27s\x20detail','24OjGapA','roleName','roleType','621544cUuIQz'];a165_0x5307=function(){return _0xbdb73e;};return a165_0x5307();}export const roleDetail={'service':a165_0x5e41f2(0x1ec),'command':a165_0x5e41f2(0x1de),'description':a165_0x5e41f2(0x1e7),'risk':a165_0x5e41f2(0x1ed),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x4950dc){const _0x459ac0=a165_0x5e41f2,_0xcdd6fc=_0x4950dc['num']('id'),_0xeeeea5=await getRoleById(_0x4950dc[_0x459ac0(0x1e3)],_0xcdd6fc);return{'ok':!![],'data':{'role':projectRole(_0xeeeea5)},'message':_0x459ac0(0x1e1)+_0xeeeea5[_0x459ac0(0x1e9)]+'\x20('+_0xeeeea5[_0x459ac0(0x1ea)]+')'};}};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const roleDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- (function(_0xdb472c,_0x4b41f7){const _0xa5ebbf=a166_0x4b92,_0x523113=_0xdb472c();while(!![]){try{const _0x647b78=parseInt(_0xa5ebbf(0xb1))/0x1+-parseInt(_0xa5ebbf(0xaf))/0x2*(parseInt(_0xa5ebbf(0xb3))/0x3)+-parseInt(_0xa5ebbf(0xb6))/0x4+parseInt(_0xa5ebbf(0xb5))/0x5*(-parseInt(_0xa5ebbf(0xb0))/0x6)+-parseInt(_0xa5ebbf(0xb7))/0x7*(parseInt(_0xa5ebbf(0xb2))/0x8)+-parseInt(_0xa5ebbf(0xb8))/0x9+parseInt(_0xa5ebbf(0xb4))/0xa;if(_0x647b78===_0x4b41f7)break;else _0x523113['push'](_0x523113['shift']());}catch(_0x52c9b6){_0x523113['push'](_0x523113['shift']());}}}(a166_0x18cb,0x7be03));function a166_0x4b92(_0xc5d2fb,_0x1b8257){_0xc5d2fb=_0xc5d2fb-0xaf;const _0x18cbef=a166_0x18cb();let _0x4b9204=_0x18cbef[_0xc5d2fb];return _0x4b9204;}import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';function a166_0x18cb(){const _0xa0cd33=['212LMJyxn','222774dqcVzs','844276TGapwn','152kwRiIc','21633ZVoQCd','17342150PPdpSE','10DkySST','61636BmdggW','287672xolouj','3926151BZSdXs'];a166_0x18cb=function(){return _0xa0cd33;};return a166_0x18cb();}export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0x34aef9,_0x131989){const _0x14a1bb=a166_0x4002,_0x302d0e=_0x34aef9();while(!![]){try{const _0x5379cd=parseInt(_0x14a1bb(0x110))/0x1*(-parseInt(_0x14a1bb(0x10f))/0x2)+-parseInt(_0x14a1bb(0x112))/0x3+parseInt(_0x14a1bb(0x111))/0x4*(parseInt(_0x14a1bb(0x10c))/0x5)+parseInt(_0x14a1bb(0x10e))/0x6+-parseInt(_0x14a1bb(0x10d))/0x7+parseInt(_0x14a1bb(0x10b))/0x8+parseInt(_0x14a1bb(0x113))/0x9;if(_0x5379cd===_0x131989)break;else _0x302d0e['push'](_0x302d0e['shift']());}catch(_0x3714de){_0x302d0e['push'](_0x302d0e['shift']());}}}(a166_0xe547,0x961b4));function a166_0x4002(_0x5aa227,_0xecb253){_0x5aa227=_0x5aa227-0x10b;const _0xe547e7=a166_0xe547();let _0x400250=_0xe547e7[_0x5aa227];return _0x400250;}import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];function a166_0xe547(){const _0x102b02=['5eimAhC','3075632WNGsdw','7363314DLelyQ','2kHrjvr','1107767lBFEob','766252LKpiuZ','598836QJclcR','3524949lVNwUc','4409184WwDMDm'];a166_0xe547=function(){return _0x102b02;};return a166_0xe547();}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const roleList: CommandDefinition;
@@ -1 +1 @@
1
- const a167_0x17ac67=a167_0x178e;(function(_0x27cd63,_0x13b894){const _0x561064=a167_0x178e,_0x26b64d=_0x27cd63();while(!![]){try{const _0x4608cf=-parseInt(_0x561064(0x155))/0x1*(parseInt(_0x561064(0x14e))/0x2)+-parseInt(_0x561064(0x151))/0x3*(-parseInt(_0x561064(0x145))/0x4)+parseInt(_0x561064(0x15f))/0x5*(parseInt(_0x561064(0x144))/0x6)+-parseInt(_0x561064(0x14c))/0x7*(parseInt(_0x561064(0x162))/0x8)+parseInt(_0x561064(0x148))/0x9*(parseInt(_0x561064(0x146))/0xa)+parseInt(_0x561064(0x149))/0xb*(parseInt(_0x561064(0x165))/0xc)+-parseInt(_0x561064(0x15e))/0xd*(parseInt(_0x561064(0x150))/0xe);if(_0x4608cf===_0x13b894)break;else _0x26b64d['push'](_0x26b64d['shift']());}catch(_0x244a43){_0x26b64d['push'](_0x26b64d['shift']());}}}(a167_0x3ea0,0x896d3));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a167_0x178e(_0x27ef19,_0x1ef3c0){_0x27ef19=_0x27ef19-0x143;const _0x3ea051=a167_0x3ea0();let _0x178e11=_0x3ea051[_0x27ef19];return _0x178e11;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';function a167_0x3ea0(){const _0x5532a1=['join','ADMIN','78PdkseI','4NdHiAf','10yQOQxg','number','10068372FuEdES','11DTjFEI','filter','includes','49gKSLOU','appCode','15760liBaLJ','Page\x20index\x20(1-based)','126TfObyy','2517615IOMvfO','Invalid\x20--type\x20\x22','Page\x20size\x20(1-100)','Found\x20','2adugsa','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','list','validation','Use\x20one\x20of:\x20','trim','type','toUpperCase','roleType','2501915AhHlkr','159665OakrSu','pagesize','role','380136XJdCVW','num','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','3243972BIbpcM','str','string','USER','page'];a167_0x3ea0=function(){return _0x5532a1;};return a167_0x3ea0();}const ROLE_TYPES=[a167_0x17ac67(0x143),'DEV',a167_0x17ac67(0x168),'CUSTOM'];export const roleList={'service':a167_0x17ac67(0x161),'command':a167_0x17ac67(0x157),'description':a167_0x17ac67(0x156),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a167_0x17ac67(0x15b),'type':a167_0x17ac67(0x167),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':a167_0x17ac67(0x169),'type':a167_0x17ac67(0x147),'description':a167_0x17ac67(0x14f),'default':0x1},{'name':a167_0x17ac67(0x160),'type':'number','description':a167_0x17ac67(0x153),'default':0x64}],async 'validate'(_0x45c961){const _0x5ab86c=a167_0x17ac67,_0x3d9dc2=_0x45c961['str'](_0x5ab86c(0x15b))[_0x5ab86c(0x15a)]();if(_0x3d9dc2&&!ROLE_TYPES[_0x5ab86c(0x14b)](_0x3d9dc2[_0x5ab86c(0x15c)]()))throw CliErrors[_0x5ab86c(0x158)](_0x5ab86c(0x152)+_0x3d9dc2+'\x22.',_0x5ab86c(0x159)+ROLE_TYPES[_0x5ab86c(0x16a)](',\x20')+'.');const _0x359fd5=_0x45c961[_0x5ab86c(0x163)]('page',0x1),_0x1eb0a2=_0x45c961['num'](_0x5ab86c(0x160),0x64);if(_0x359fd5<0x1)throw CliErrors[_0x5ab86c(0x158)]('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x1eb0a2<0x1||_0x1eb0a2>0x64)throw CliErrors[_0x5ab86c(0x158)](_0x5ab86c(0x164));},async 'execute'(_0x1516ee){const _0x1ded09=a167_0x17ac67,_0x252751=_0x1516ee[_0x1ded09(0x163)](_0x1ded09(0x169),0x1)||0x1,_0x11acdf=_0x1516ee[_0x1ded09(0x163)](_0x1ded09(0x160),0x64)||0x64,_0x258797=_0x1516ee[_0x1ded09(0x166)]('type')['trim']()[_0x1ded09(0x15c)](),{items:_0x196741,paging:_0x1d43af}=await listAppRoles(_0x1516ee[_0x1ded09(0x14d)],{'currentPage':_0x252751,'pageSize':_0x11acdf}),_0x1698e9=_0x258797?_0x196741[_0x1ded09(0x14a)](_0x19010d=>_0x19010d[_0x1ded09(0x15d)]===_0x258797):_0x196741,_0x2627c5=_0x1698e9['map'](projectRole);return{'ok':!![],'data':{'roles':_0x2627c5,'paging':_0x1d43af},'message':_0x1ded09(0x154)+_0x2627c5['length']+'\x20role(s)'};}};
1
+ const a167_0x54cc0a=a167_0x3e4a;(function(_0x3e1839,_0x194974){const _0x834bc7=a167_0x3e4a,_0x2e1933=_0x3e1839();while(!![]){try{const _0x46b6ba=parseInt(_0x834bc7(0xf3))/0x1+-parseInt(_0x834bc7(0xe1))/0x2+parseInt(_0x834bc7(0xee))/0x3+-parseInt(_0x834bc7(0xef))/0x4*(parseInt(_0x834bc7(0xdc))/0x5)+parseInt(_0x834bc7(0xe8))/0x6*(-parseInt(_0x834bc7(0xeb))/0x7)+parseInt(_0x834bc7(0xe3))/0x8*(-parseInt(_0x834bc7(0xce))/0x9)+parseInt(_0x834bc7(0xd2))/0xa*(parseInt(_0x834bc7(0xd1))/0xb);if(_0x46b6ba===_0x194974)break;else _0x2e1933['push'](_0x2e1933['shift']());}catch(_0x55a18f){_0x2e1933['push'](_0x2e1933['shift']());}}}(a167_0x5962,0xcb31e));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a167_0x3e4a(_0x1f604f,_0x504a84){_0x1f604f=_0x1f604f-0xce;const _0x5962f8=a167_0x5962();let _0x3e4a02=_0x5962f8[_0x1f604f];return _0x3e4a02;}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a167_0x54cc0a(0xe2),a167_0x54cc0a(0xf1),a167_0x54cc0a(0xd7),'CUSTOM'];function a167_0x5962(){const _0x15712f=['join','trim','11CAbGKV','47849210UMLIiq','includes','Found\x20','\x20role(s)','filter','USER','num','type','Filter\x20by\x20role\x20type','validation','1205SUgDGf','roleType','toUpperCase','appCode','role','3227484LzLUPG','ADMIN','11665992UsrSJq','map','list','pagesize','number','12978VexmkQ','string','Invalid\x20--type\x20\x22','3115mVVrDM','page','str','679722KdVrky','17628evoqJC','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','DEV','Page\x20size\x20(1-100)','917404oTECvd','length','9yCSmMk'];a167_0x5962=function(){return _0x15712f;};return a167_0x5962();}export const roleList={'service':a167_0x54cc0a(0xe0),'command':a167_0x54cc0a(0xe5),'description':a167_0x54cc0a(0xf0),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a167_0x54cc0a(0xd9),'type':a167_0x54cc0a(0xe9),'required':![],'description':a167_0x54cc0a(0xda),'enum':ROLE_TYPES},{'name':a167_0x54cc0a(0xec),'type':a167_0x54cc0a(0xe7),'description':'Page\x20index\x20(1-based)','default':0x1},{'name':'pagesize','type':a167_0x54cc0a(0xe7),'description':a167_0x54cc0a(0xf2),'default':0x64}],async 'validate'(_0x4ea334){const _0x3ac19c=a167_0x54cc0a,_0x2e0915=_0x4ea334[_0x3ac19c(0xed)](_0x3ac19c(0xd9))[_0x3ac19c(0xd0)]();if(_0x2e0915&&!ROLE_TYPES[_0x3ac19c(0xd3)](_0x2e0915[_0x3ac19c(0xde)]()))throw CliErrors['validation'](_0x3ac19c(0xea)+_0x2e0915+'\x22.','Use\x20one\x20of:\x20'+ROLE_TYPES[_0x3ac19c(0xcf)](',\x20')+'.');const _0x4057b6=_0x4ea334[_0x3ac19c(0xd8)](_0x3ac19c(0xec),0x1),_0xecd8de=_0x4ea334[_0x3ac19c(0xd8)]('pagesize',0x64);if(_0x4057b6<0x1)throw CliErrors['validation']('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0xecd8de<0x1||_0xecd8de>0x64)throw CliErrors[_0x3ac19c(0xdb)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x499b0e){const _0x428e90=a167_0x54cc0a,_0x1be5eb=_0x499b0e[_0x428e90(0xd8)](_0x428e90(0xec),0x1)||0x1,_0x4eb06e=_0x499b0e['num'](_0x428e90(0xe6),0x64)||0x64,_0x7a0b20=_0x499b0e[_0x428e90(0xed)](_0x428e90(0xd9))[_0x428e90(0xd0)]()[_0x428e90(0xde)](),{items:_0x4b6150,paging:_0x1426af}=await listAppRoles(_0x499b0e[_0x428e90(0xdf)],{'currentPage':_0x1be5eb,'pageSize':_0x4eb06e}),_0x350b5e=_0x7a0b20?_0x4b6150[_0x428e90(0xd6)](_0x45e1da=>_0x45e1da[_0x428e90(0xdd)]===_0x7a0b20):_0x4b6150,_0x472a27=_0x350b5e[_0x428e90(0xe4)](projectRole);return{'ok':!![],'data':{'roles':_0x472a27,'paging':_0x1426af},'message':_0x428e90(0xd4)+_0x472a27[_0x428e90(0xf4)]+_0x428e90(0xd5)};}};
@@ -0,0 +1,107 @@
1
+ /**
2
+ * role service 共享逻辑(SSOT)
3
+ *
4
+ * 集中:内置角色守卫、角色引用解析(id 单查 / name 全分页)、
5
+ * 查人(tenant 成员目录)、user-list 全量 merge、投影与写命令输出信封。
6
+ * 命令文件只引用这里,不重复合并/守卫规则(见 AGENTS.md 声明式方法论 SSOT)。
7
+ */
8
+ import { type AppRole, type RoleUsers } from "../../core/api-client.js";
9
+ import type { FlagDef, RuntimeContext } from "../../framework/types.js";
10
+ export declare const ROLE_ID_FLAG: FlagDef;
11
+ export declare const ROLE_REF_FLAG: FlagDef;
12
+ export declare const USER_REF_FLAG: FlagDef;
13
+ export declare const NAME_FLAG: FlagDef;
14
+ export declare const USER_NAME_FLAG: FlagDef;
15
+ export declare const REMARK_FLAG: FlagDef;
16
+ export declare const EXPECT_USER_COUNT_FLAG: FlagDef;
17
+ /** 内置角色类型(不可作为普通 CUSTOM 处理) */
18
+ export declare const BUILTIN_ROLE_TYPES: AppRole["roleType"][];
19
+ export declare function isBuiltinRole(roleType: string): boolean;
20
+ /** update / delete:仅允许 CUSTOM 角色 */
21
+ export declare function assertCustomRole(role: AppRole, action: string): void;
22
+ /** role-menus-set / role-apis-set:拒绝改 DEV / ADMIN 的权限矩阵 */
23
+ export declare function assertPermConfigurable(role: AppRole): void;
24
+ export interface RoleProjection {
25
+ id: number;
26
+ roleName: string;
27
+ roleType: AppRole["roleType"];
28
+ remark?: string;
29
+ userCount: number;
30
+ permitCount: number;
31
+ builtin: boolean;
32
+ }
33
+ export declare function projectRole(role: AppRole): RoleProjection;
34
+ /**
35
+ * 解析角色引用:纯数字按 id 匹配,否则按 roleName 精确匹配。
36
+ * 命中 0 个报 not found;命中多个报歧义要求用 --id 明确。
37
+ */
38
+ export declare function resolveRoleRef(appCode: string, ref: string): Promise<AppRole>;
39
+ /** 按 id 取角色(用于 detail / update / delete 的前置读取) */
40
+ export declare function getRoleById(appCode: string, id: number): Promise<AppRole>;
41
+ /** 从当前会话解析 tenantCode(getByTenantCode 查人所需) */
42
+ export declare function resolveTenantCode(): Promise<string>;
43
+ export interface UserResolution {
44
+ userId: number;
45
+ username: string;
46
+ nickname?: string;
47
+ matchedBy: "id" | "name";
48
+ }
49
+ /**
50
+ * 解析用户引用(--user / --name):
51
+ * - 纯数字:按 userId 命中租户成员补全信息;成员目录查不到时回退最小 { userId }。
52
+ * - 昵称/用户名:租户成员目录精确匹配;0 个 not found,多个报歧义。
53
+ */
54
+ export declare function resolveUserRef(ref: string): Promise<UserResolution>;
55
+ export interface RoleUserMutationData {
56
+ operation: "user-add" | "user-remove";
57
+ selector: {
58
+ appCode: string;
59
+ roleId: number;
60
+ roleName: string;
61
+ userId: number;
62
+ };
63
+ before: {
64
+ userIds: number[];
65
+ };
66
+ after: {
67
+ userIds: number[];
68
+ };
69
+ dryRun: boolean;
70
+ backend: {
71
+ method: "POST";
72
+ path: string;
73
+ };
74
+ warnings: string[];
75
+ }
76
+ export declare const UPDATE_USER_LIST_PATH = "/smartapi/permit/user-role/update-user-list";
77
+ /**
78
+ * 计算 user-add / user-remove 的全量回写结果与 before/after。
79
+ * 只改目标 role 的 userList,其余 role 原样带回。
80
+ * 返回 { roleList, mutation, changed };changed=false 表示无需写(幂等)。
81
+ */
82
+ export declare function computeRoleUserMutation(params: {
83
+ operation: "user-add" | "user-remove";
84
+ appCode: string;
85
+ roleUsers: RoleUsers[];
86
+ targetRoleId: number;
87
+ user: {
88
+ userId: number;
89
+ username: string;
90
+ nickname?: string;
91
+ };
92
+ dryRun: boolean;
93
+ expectUserCount?: number;
94
+ }): {
95
+ roleList: RoleUsers[];
96
+ mutation: RoleUserMutationData;
97
+ changed: boolean;
98
+ };
99
+ /** 读取目标 role 的全量成员列表(供 add/remove 前置) */
100
+ export declare function loadRoleUsers(appCode: string): Promise<RoleUsers[]>;
101
+ /** 供命令 ctx 读取角色引用 flag 的小工具 */
102
+ export declare function readRoleRef(ctx: RuntimeContext): string;
103
+ /**
104
+ * user-add / user-remove 的完整前置编排(供两个命令的 dryRun / execute 共用):
105
+ * 解析角色引用 → 解析用户 → 读全量成员 → 计算全量回写与 before/after。
106
+ */
107
+ export declare function prepareUserMutation(ctx: RuntimeContext, operation: "user-add" | "user-remove", dryRun: boolean): Promise<ReturnType<typeof computeRoleUserMutation>>;
@@ -1 +1 @@
1
- const a168_0x46bcac=a168_0x3664;(function(_0x8fb62,_0x169fcf){const _0x148715=a168_0x3664,_0x32745b=_0x8fb62();while(!![]){try{const _0x3be6ba=-parseInt(_0x148715(0x131))/0x1*(parseInt(_0x148715(0x13c))/0x2)+-parseInt(_0x148715(0x139))/0x3+parseInt(_0x148715(0x119))/0x4*(parseInt(_0x148715(0x109))/0x5)+parseInt(_0x148715(0x12e))/0x6+-parseInt(_0x148715(0x125))/0x7+-parseInt(_0x148715(0x12d))/0x8+parseInt(_0x148715(0x102))/0x9;if(_0x3be6ba===_0x169fcf)break;else _0x32745b['push'](_0x32745b['shift']());}catch(_0x57a356){_0x32745b['push'](_0x32745b['shift']());}}}(a168_0x2ea0,0x8de57));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a168_0x46bcac(0xf3),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a168_0x46bcac(0x136),'type':a168_0x46bcac(0x12c),'required':!![],'description':a168_0x46bcac(0x11d)};export const USER_REF_FLAG={'name':a168_0x46bcac(0x10e),'type':a168_0x46bcac(0x12c),'required':!![],'description':a168_0x46bcac(0x13b)};export const NAME_FLAG={'name':'name','type':a168_0x46bcac(0x12c),'required':!![],'description':a168_0x46bcac(0x135)};export const USER_NAME_FLAG={'name':a168_0x46bcac(0x105),'type':a168_0x46bcac(0x12c),'required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a168_0x46bcac(0x12a),'type':a168_0x46bcac(0x12c),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a168_0x46bcac(0xf4),'type':'number','required':![],'description':a168_0x46bcac(0x13a)};export const BUILTIN_ROLE_TYPES=['ADMIN',a168_0x46bcac(0x124),a168_0x46bcac(0xf2)];export function isBuiltinRole(_0x476e10){const _0x598a96=a168_0x46bcac;return BUILTIN_ROLE_TYPES[_0x598a96(0x128)](_0x476e10);}export function assertCustomRole(_0x3a07c2,_0x3f1f1d){const _0x11b1e0=a168_0x46bcac;if(_0x3a07c2[_0x11b1e0(0xf5)]!==_0x11b1e0(0x11b))throw CliErrors[_0x11b1e0(0x12b)](_0x11b1e0(0xff)+_0x3f1f1d+_0x11b1e0(0xef)+_0x3a07c2[_0x11b1e0(0x104)]+'\x20('+_0x3a07c2[_0x11b1e0(0xf5)]+').',_0x11b1e0(0x115));}function a168_0x3664(_0x4b5e0a,_0x5a3c61){_0x4b5e0a=_0x4b5e0a-0xef;const _0x2ea075=a168_0x2ea0();let _0x366442=_0x2ea075[_0x4b5e0a];return _0x366442;}export function assertPermConfigurable(_0x12541f){const _0x22a4dd=a168_0x46bcac;if(_0x12541f['roleType']===_0x22a4dd(0x124)||_0x12541f[_0x22a4dd(0xf5)]===_0x22a4dd(0xfe))throw CliErrors['validation']('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x12541f['roleName']+'\x20('+_0x12541f[_0x22a4dd(0xf5)]+').',_0x22a4dd(0x10b));}export function projectRole(_0x5ca300){const _0x5df4b5=a168_0x46bcac;return{'id':_0x5ca300['id'],'roleName':_0x5ca300['roleName'],'roleType':_0x5ca300['roleType'],'remark':_0x5ca300[_0x5df4b5(0x12a)],'userCount':_0x5ca300[_0x5df4b5(0x113)],'permitCount':_0x5ca300['permitCount'],'builtin':isBuiltinRole(_0x5ca300[_0x5df4b5(0xf5)])};}export async function resolveRoleRef(_0xa09a3d,_0x42e09d){const _0x1529c2=a168_0x46bcac,_0x277c17=_0x42e09d[_0x1529c2(0x107)]();if(!_0x277c17)throw CliErrors[_0x1529c2(0x12b)]('Missing\x20role\x20reference.',_0x1529c2(0x11c));if(/^\d+$/[_0x1529c2(0x101)](_0x277c17))return getRoleById(_0xa09a3d,Number(_0x277c17));const _0x12e114=await listAllAppRoles(_0xa09a3d),_0x3e3b2d=_0x12e114['filter'](_0x115f79=>_0x115f79[_0x1529c2(0x104)]===_0x277c17);if(_0x3e3b2d[_0x1529c2(0x10c)]===0x0)throw CliErrors[_0x1529c2(0x12b)]('Role\x20name\x20\x22'+_0x277c17+_0x1529c2(0x10a)+_0xa09a3d+'.',_0x1529c2(0xf9));if(_0x3e3b2d[_0x1529c2(0x10c)]>0x1){const _0x1d53d8=_0x3e3b2d['map'](_0x14ce4c=>_0x14ce4c['id'])[_0x1529c2(0xf6)](',\x20');throw CliErrors[_0x1529c2(0x12b)](_0x1529c2(0xf8)+_0x277c17+_0x1529c2(0xfa)+_0x1d53d8+').',_0x1529c2(0xf0));}return _0x3e3b2d[0x0];}export async function getRoleById(_0x3a820f,_0x7b92f9){const _0x5300ba=a168_0x46bcac,_0x5ae609=await getAppRole(_0x7b92f9);if(!_0x5ae609)throw CliErrors[_0x5300ba(0x12b)]('Role\x20id\x20'+_0x7b92f9+_0x5300ba(0x138)+_0x3a820f+'.',_0x5300ba(0xf1));return _0x5ae609;}async function listAllAppRoles(_0xbbd1c2){const _0x27bf60=a168_0x46bcac,_0x2ebe43=0x64,_0x5bedbd=[];for(let _0x3c3315=0x1;;_0x3c3315+=0x1){const {items:_0x4a4925,paging:_0x5b7b36}=await listAppRoles(_0xbbd1c2,{'currentPage':_0x3c3315,'pageSize':_0x2ebe43});_0x5bedbd[_0x27bf60(0x108)](..._0x4a4925);if(_0x4a4925[_0x27bf60(0x10c)]<_0x2ebe43||_0x5b7b36&&_0x5bedbd[_0x27bf60(0x10c)]>=_0x5b7b36[_0x27bf60(0x112)])return _0x5bedbd;}}export async function resolveTenantCode(){const _0x3bc5f0=a168_0x46bcac,_0x4f97d3=await getSessionUserInfo(),_0x135391=_0x4f97d3?.[_0x3bc5f0(0x10e)]?.[_0x3bc5f0(0xfd)]?.['tenant_code'];if(!_0x135391)throw CliErrors['authRequired'](_0x3bc5f0(0x120));return _0x135391;}function matchMember(_0x21e501,_0x1efe1d){const _0x1929a2=a168_0x46bcac,_0x24ae06=_0x1efe1d['trim']()[_0x1929a2(0x10d)]();return(_0x21e501[_0x1929a2(0x114)]??'')['toLowerCase']()===_0x24ae06||(_0x21e501['username']??'')[_0x1929a2(0x10d)]()===_0x24ae06;}export async function resolveUserRef(_0x18a764){const _0x4dfdb0=a168_0x46bcac,_0x2d3d33=_0x18a764[_0x4dfdb0(0x107)]();if(!_0x2d3d33)throw CliErrors['validation'](_0x4dfdb0(0x11a),_0x4dfdb0(0x11f));const _0x2d7b92=await resolveTenantCode(),_0x394511=await getTenantMembers(_0x2d7b92);if(/^\d+$/['test'](_0x2d3d33)){const _0x5dc85e=Number(_0x2d3d33),_0x5a24bc=_0x394511[_0x4dfdb0(0x126)](_0x29376e=>_0x29376e[_0x4dfdb0(0x130)]===_0x5dc85e);return{'userId':_0x5dc85e,'username':_0x5a24bc?.['username']??String(_0x5dc85e),'nickname':_0x5a24bc?.[_0x4dfdb0(0x114)],'matchedBy':'id'};}const _0x21c9b9=_0x394511[_0x4dfdb0(0x134)](_0x35b6b7=>matchMember(_0x35b6b7,_0x2d3d33));if(_0x21c9b9[_0x4dfdb0(0x10c)]===0x0)throw CliErrors[_0x4dfdb0(0x12b)](_0x4dfdb0(0x127)+_0x2d3d33+'\x22.',_0x4dfdb0(0xfc));if(_0x21c9b9['length']>0x1){const _0x4b2339=_0x21c9b9[_0x4dfdb0(0x106)](_0xb2bd33=>(_0xb2bd33[_0x4dfdb0(0x114)]??_0xb2bd33[_0x4dfdb0(0x121)]??'?')+'('+_0xb2bd33[_0x4dfdb0(0x130)]+')')['join'](',\x20');throw CliErrors[_0x4dfdb0(0x12b)](_0x4dfdb0(0x122)+_0x2d3d33+_0x4dfdb0(0xfb)+_0x4b2339+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x5579cb=_0x21c9b9[0x0];return{'userId':_0x5579cb[_0x4dfdb0(0x130)],'username':_0x5579cb['username']??String(_0x5579cb['userId']),'nickname':_0x5579cb[_0x4dfdb0(0x114)],'matchedBy':_0x4dfdb0(0x105)};}function a168_0x2ea0(){const _0x1d007d=['Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','tenant','ADMIN','Cannot\x20','User\x20','test','10698417oWuLzk',';\x20no\x20change.','roleName','name','map','trim','push','505hAqpNU','\x22\x20not\x20found\x20in\x20app\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','length','toLowerCase','user','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','str','findIndex','totalCount','userCount','nickname','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','flagMissing','Role\x20id\x20','\x20is\x20not\x20a\x20member\x20of\x20role\x20','23704honbgg','Missing\x20user\x20reference.','CUSTOM','Pass\x20--role\x20<id|name>.','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Pass\x20--user\x20<id|name>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','username','Multiple\x20tenant\x20members\x20match\x20\x22','splice','DEV','355355MNfjpA','find','No\x20tenant\x20member\x20matches\x20\x22','includes','expectUserCount','remark','validation','string','998528tQeGod','3005130poMnSC','\x20not\x20found\x20in\x20the\x20user-role\x20list.','userId','1RFPaWx','dryRun','appCode','filter','Role\x20name','role','userList','\x20not\x20found\x20in\x20app\x20','2549205vXGJSe','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','1363142rQBBtV','\x20built-in\x20role\x20','Disambiguate\x20with\x20--role\x20<id>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','USER','number','expect-user-count','roleType','join','POST','Role\x20name\x20\x22','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','\x22\x20is\x20ambiguous\x20(ids:\x20','\x22:\x20'];a168_0x2ea0=function(){return _0x1d007d;};return a168_0x2ea0();}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x34f72b){const _0x2a1c44=a168_0x46bcac;return(_0x34f72b?.[_0x2a1c44(0x137)]??[])[_0x2a1c44(0x106)](_0x22cc5c=>_0x22cc5c[_0x2a1c44(0x130)]);}export function computeRoleUserMutation(_0xe7d0cc){const _0x57fb39=a168_0x46bcac,{operation:_0x14817b,appCode:_0x5af3d7,roleUsers:_0x361742,targetRoleId:_0x246b75,user:_0x5e5467}=_0xe7d0cc,_0x5f7f82=_0x361742[_0x57fb39(0x126)](_0x59d9f6=>_0x59d9f6['id']===_0x246b75);if(!_0x5f7f82)throw CliErrors[_0x57fb39(0x12b)](_0x57fb39(0x117)+_0x246b75+_0x57fb39(0x12f),_0x57fb39(0xf1));const _0x19c299=userIdsOf(_0x5f7f82),_0x3bf8ea=[];if(_0xe7d0cc[_0x57fb39(0x129)]!==undefined&&_0xe7d0cc[_0x57fb39(0x129)]!==_0x19c299[_0x57fb39(0x10c)])throw CliErrors[_0x57fb39(0x12b)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0xe7d0cc[_0x57fb39(0x129)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x19c299['length']+'.',_0x57fb39(0x10f));const _0x5c3517=_0x19c299[_0x57fb39(0x128)](_0x5e5467[_0x57fb39(0x130)]);let _0x55d9cb=![];const _0x47d65d=[..._0x5f7f82['userList']];if(_0x14817b==='user-add')_0x5c3517?_0x3bf8ea[_0x57fb39(0x108)]('User\x20'+_0x5e5467[_0x57fb39(0x130)]+_0x57fb39(0x11e)+_0x5f7f82[_0x57fb39(0x104)]+_0x57fb39(0x103)):(_0x47d65d[_0x57fb39(0x108)]({'userId':_0x5e5467[_0x57fb39(0x130)],'username':_0x5e5467[_0x57fb39(0x121)],..._0x5e5467['nickname']?{'nickname':_0x5e5467['nickname']}:{}}),_0x55d9cb=!![]);else{if(!_0x5c3517)_0x3bf8ea[_0x57fb39(0x108)](_0x57fb39(0x100)+_0x5e5467['userId']+_0x57fb39(0x118)+_0x5f7f82[_0x57fb39(0x104)]+_0x57fb39(0x103));else{const _0x3d8eb7=_0x47d65d[_0x57fb39(0x111)](_0x9e1988=>_0x9e1988[_0x57fb39(0x130)]===_0x5e5467['userId']);if(_0x3d8eb7>=0x0)_0x47d65d[_0x57fb39(0x123)](_0x3d8eb7,0x1);_0x55d9cb=!![];}}const _0x2264b2=_0x361742[_0x57fb39(0x106)](_0x4ae3d1=>_0x4ae3d1['id']===_0x246b75?{..._0x4ae3d1,'userList':_0x47d65d}:_0x4ae3d1),_0x3405a8=_0x47d65d[_0x57fb39(0x106)](_0xf2f527=>_0xf2f527['userId']),_0xa8381={'operation':_0x14817b,'selector':{'appCode':_0x5af3d7,'roleId':_0x246b75,'roleName':_0x5f7f82[_0x57fb39(0x104)],'userId':_0x5e5467['userId']},'before':{'userIds':_0x19c299},'after':{'userIds':_0x3405a8},'dryRun':_0xe7d0cc[_0x57fb39(0x132)],'backend':{'method':_0x57fb39(0xf7),'path':UPDATE_USER_LIST_PATH},'warnings':_0x3bf8ea};return{'roleList':_0x2264b2,'mutation':_0xa8381,'changed':_0x55d9cb};}export async function loadRoleUsers(_0x3d3168){return listRoleUsers(_0x3d3168);}export function readRoleRef(_0x40be03){const _0x17f119=a168_0x46bcac,_0x3238eb=_0x40be03[_0x17f119(0x110)]('role')['trim']();if(!_0x3238eb)throw CliErrors['flagMissing'](_0x17f119(0x136),_0x17f119(0x11c));return _0x3238eb;}export async function prepareUserMutation(_0x4d8dda,_0x52a468,_0x4ac1ae){const _0x468248=a168_0x46bcac,_0x1a2bf4=readRoleRef(_0x4d8dda),_0x225215=_0x4d8dda[_0x468248(0x110)]('user')[_0x468248(0x107)]();if(!_0x225215)throw CliErrors[_0x468248(0x116)](_0x468248(0x10e),_0x468248(0x11f));const _0x3fab0e=_0x4d8dda['flag'](_0x468248(0xf4)),_0x3aee2b=_0x3fab0e===undefined||_0x3fab0e===null?undefined:Number(_0x3fab0e),_0xfcc64e=await resolveRoleRef(_0x4d8dda[_0x468248(0x133)],_0x1a2bf4),_0x3b3b01=await resolveUserRef(_0x225215),_0x641cc6=await loadRoleUsers(_0x4d8dda[_0x468248(0x133)]);return computeRoleUserMutation({'operation':_0x52a468,'appCode':_0x4d8dda[_0x468248(0x133)],'roleUsers':_0x641cc6,'targetRoleId':_0xfcc64e['id'],'user':{'userId':_0x3b3b01[_0x468248(0x130)],'username':_0x3b3b01[_0x468248(0x121)],'nickname':_0x3b3b01[_0x468248(0x114)]},'dryRun':_0x4ac1ae,..._0x3aee2b!==undefined?{'expectUserCount':_0x3aee2b}:{}});}
1
+ const a168_0x4854d6=a168_0xb324;(function(_0x3e91d4,_0x5ea9dd){const _0x91ec0a=a168_0xb324,_0x40d3b6=_0x3e91d4();while(!![]){try{const _0x3cc5f5=-parseInt(_0x91ec0a(0x135))/0x1+-parseInt(_0x91ec0a(0x116))/0x2+parseInt(_0x91ec0a(0x124))/0x3+-parseInt(_0x91ec0a(0x145))/0x4*(-parseInt(_0x91ec0a(0x141))/0x5)+-parseInt(_0x91ec0a(0x12a))/0x6+-parseInt(_0x91ec0a(0x14f))/0x7*(parseInt(_0x91ec0a(0x13b))/0x8)+parseInt(_0x91ec0a(0x123))/0x9;if(_0x3cc5f5===_0x5ea9dd)break;else _0x40d3b6['push'](_0x40d3b6['shift']());}catch(_0x3462c4){_0x40d3b6['push'](_0x40d3b6['shift']());}}}(a168_0xec25,0x45746));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';function a168_0xb324(_0x51f52c,_0x551ebf){_0x51f52c=_0x51f52c-0x102;const _0xec25f4=a168_0xec25();let _0xb324ef=_0xec25f4[_0x51f52c];return _0xb324ef;}export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a168_0x4854d6(0x121),'type':a168_0x4854d6(0x10d),'required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':a168_0x4854d6(0x11b),'type':a168_0x4854d6(0x10d),'required':!![],'description':a168_0x4854d6(0x13d)};export const NAME_FLAG={'name':a168_0x4854d6(0x115),'type':a168_0x4854d6(0x10d),'required':!![],'description':a168_0x4854d6(0x133)};export const USER_NAME_FLAG={'name':a168_0x4854d6(0x115),'type':a168_0x4854d6(0x10d),'required':!![],'description':a168_0x4854d6(0x125)};export const REMARK_FLAG={'name':a168_0x4854d6(0x136),'type':'string','required':![],'description':a168_0x4854d6(0x109)};export const EXPECT_USER_COUNT_FLAG={'name':a168_0x4854d6(0x137),'type':a168_0x4854d6(0x149),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a168_0x4854d6(0x139),a168_0x4854d6(0x112),'USER'];export function isBuiltinRole(_0x23ffbf){const _0x450d05=a168_0x4854d6;return BUILTIN_ROLE_TYPES[_0x450d05(0x132)](_0x23ffbf);}export function assertCustomRole(_0x5d4d46,_0x4b091c){const _0x3983ed=a168_0x4854d6;if(_0x5d4d46[_0x3983ed(0x14e)]!==_0x3983ed(0x11e))throw CliErrors['validation'](_0x3983ed(0x129)+_0x4b091c+_0x3983ed(0x120)+_0x5d4d46[_0x3983ed(0x10e)]+'\x20('+_0x5d4d46[_0x3983ed(0x14e)]+').',_0x3983ed(0x148));}export function assertPermConfigurable(_0x4570cd){const _0x17e33f=a168_0x4854d6;if(_0x4570cd['roleType']===_0x17e33f(0x112)||_0x4570cd[_0x17e33f(0x14e)]===_0x17e33f(0x139))throw CliErrors['validation'](_0x17e33f(0x13e)+_0x4570cd[_0x17e33f(0x10e)]+'\x20('+_0x4570cd[_0x17e33f(0x14e)]+').',_0x17e33f(0x102));}export function projectRole(_0x26a57a){const _0x596efe=a168_0x4854d6;return{'id':_0x26a57a['id'],'roleName':_0x26a57a[_0x596efe(0x10e)],'roleType':_0x26a57a[_0x596efe(0x14e)],'remark':_0x26a57a['remark'],'userCount':_0x26a57a[_0x596efe(0x147)],'permitCount':_0x26a57a[_0x596efe(0x14d)],'builtin':isBuiltinRole(_0x26a57a[_0x596efe(0x14e)])};}export async function resolveRoleRef(_0x114744,_0x4f25d1){const _0x2ac675=a168_0x4854d6,_0x49c3ec=_0x4f25d1[_0x2ac675(0x14b)]();if(!_0x49c3ec)throw CliErrors['validation'](_0x2ac675(0x10c),_0x2ac675(0x117));if(/^\d+$/[_0x2ac675(0x119)](_0x49c3ec))return getRoleById(_0x114744,Number(_0x49c3ec));const _0x1c28a5=await listAllAppRoles(_0x114744),_0xc90c9c=_0x1c28a5['filter'](_0x548bcd=>_0x548bcd[_0x2ac675(0x10e)]===_0x49c3ec);if(_0xc90c9c[_0x2ac675(0x10f)]===0x0)throw CliErrors['validation']('Role\x20name\x20\x22'+_0x49c3ec+_0x2ac675(0x104)+_0x114744+'.',_0x2ac675(0x134));if(_0xc90c9c[_0x2ac675(0x10f)]>0x1){const _0x8a490e=_0xc90c9c[_0x2ac675(0x11a)](_0x5ce363=>_0x5ce363['id'])[_0x2ac675(0x142)](',\x20');throw CliErrors[_0x2ac675(0x127)]('Role\x20name\x20\x22'+_0x49c3ec+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x8a490e+').',_0x2ac675(0x118));}return _0xc90c9c[0x0];}export async function getRoleById(_0x3d5fe4,_0x449692){const _0x5c2aaa=a168_0x4854d6,_0x3c5833=await getAppRole(_0x449692);if(!_0x3c5833)throw CliErrors[_0x5c2aaa(0x127)](_0x5c2aaa(0x103)+_0x449692+'\x20not\x20found\x20in\x20app\x20'+_0x3d5fe4+'.',_0x5c2aaa(0x107));return _0x3c5833;}async function listAllAppRoles(_0x32d104){const _0xce6e31=a168_0x4854d6,_0x141b4e=0x64,_0x50d143=[];for(let _0x101c26=0x1;;_0x101c26+=0x1){const {items:_0xa9f0c1,paging:_0x370f31}=await listAppRoles(_0x32d104,{'currentPage':_0x101c26,'pageSize':_0x141b4e});_0x50d143[_0xce6e31(0x131)](..._0xa9f0c1);if(_0xa9f0c1[_0xce6e31(0x10f)]<_0x141b4e||_0x370f31&&_0x50d143['length']>=_0x370f31[_0xce6e31(0x144)])return _0x50d143;}}function a168_0xec25(){const _0x42c92e=['No\x20tenant\x20member\x20matches\x20\x22','\x20member(s)\x20but\x20role\x20has\x20','nickname','push','includes','Role\x20name','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','459455vBhJoV','remark','expect-user-count','\x20not\x20found\x20in\x20the\x20user-role\x20list.','ADMIN','Pass\x20--user\x20<id|name>.','8ePJGzK','userList','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','findIndex','userId','25niqGhH','join','\x20is\x20not\x20a\x20member\x20of\x20role\x20','totalCount','58172tGDIDP','toLowerCase','userCount','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','number','appCode','trim','splice','permitCount','roleType','1333031kamNsI','user-add','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','Role\x20id\x20','\x22\x20not\x20found\x20in\x20app\x20','\x22:\x20','/smartapi/permit/user-role/update-user-list','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','str','Optional\x20role\x20remark/description','expectUserCount','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Missing\x20role\x20reference.','string','roleName','length','flag','authRequired','DEV','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.',';\x20no\x20change.','name','193020cUaFjE','Pass\x20--role\x20<id|name>.','Disambiguate\x20with\x20--role\x20<id>.','test','map','user','dryRun','find','CUSTOM','\x20is\x20already\x20a\x20member\x20of\x20role\x20','\x20built-in\x20role\x20','role','tenant_code','7203924OqhQrq','922503jYaeoz','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Anti-drift\x20check\x20failed:\x20expected\x20','validation','flagMissing','Cannot\x20','898608SHOyON','User\x20','Disambiguate\x20with\x20--user\x20<id>.','username'];a168_0xec25=function(){return _0x42c92e;};return a168_0xec25();}export async function resolveTenantCode(){const _0x2272b7=a168_0x4854d6,_0x55fc7f=await getSessionUserInfo(),_0x1b7ef2=_0x55fc7f?.[_0x2272b7(0x11b)]?.['tenant']?.[_0x2272b7(0x122)];if(!_0x1b7ef2)throw CliErrors[_0x2272b7(0x111)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x1b7ef2;}function matchMember(_0x5c4db1,_0x56b4bc){const _0x805e=a168_0x4854d6,_0x333f14=_0x56b4bc[_0x805e(0x14b)]()[_0x805e(0x146)]();return(_0x5c4db1['nickname']??'')[_0x805e(0x146)]()===_0x333f14||(_0x5c4db1['username']??'')[_0x805e(0x146)]()===_0x333f14;}export async function resolveUserRef(_0x417be2){const _0x739dd5=a168_0x4854d6,_0x4a4e7d=_0x417be2[_0x739dd5(0x14b)]();if(!_0x4a4e7d)throw CliErrors[_0x739dd5(0x127)]('Missing\x20user\x20reference.',_0x739dd5(0x13a));const _0x4bff62=await resolveTenantCode(),_0x5c12bd=await getTenantMembers(_0x4bff62);if(/^\d+$/[_0x739dd5(0x119)](_0x4a4e7d)){const _0x37a8bc=Number(_0x4a4e7d),_0x192e57=_0x5c12bd[_0x739dd5(0x11d)](_0x29e06b=>_0x29e06b['userId']===_0x37a8bc);return{'userId':_0x37a8bc,'username':_0x192e57?.[_0x739dd5(0x12d)]??String(_0x37a8bc),'nickname':_0x192e57?.[_0x739dd5(0x130)],'matchedBy':'id'};}const _0x1d4e2b=_0x5c12bd['filter'](_0x1f3eec=>matchMember(_0x1f3eec,_0x4a4e7d));if(_0x1d4e2b['length']===0x0)throw CliErrors['validation'](_0x739dd5(0x12e)+_0x4a4e7d+'\x22.',_0x739dd5(0x113));if(_0x1d4e2b[_0x739dd5(0x10f)]>0x1){const _0xdb3a28=_0x1d4e2b[_0x739dd5(0x11a)](_0x40915c=>(_0x40915c[_0x739dd5(0x130)]??_0x40915c[_0x739dd5(0x12d)]??'?')+'('+_0x40915c[_0x739dd5(0x140)]+')')[_0x739dd5(0x142)](',\x20');throw CliErrors[_0x739dd5(0x127)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x4a4e7d+_0x739dd5(0x105)+_0xdb3a28+'.',_0x739dd5(0x12c));}const _0x38a5ac=_0x1d4e2b[0x0];return{'userId':_0x38a5ac[_0x739dd5(0x140)],'username':_0x38a5ac[_0x739dd5(0x12d)]??String(_0x38a5ac[_0x739dd5(0x140)]),'nickname':_0x38a5ac[_0x739dd5(0x130)],'matchedBy':_0x739dd5(0x115)};}export const UPDATE_USER_LIST_PATH=a168_0x4854d6(0x106);function userIdsOf(_0x925f40){const _0x531472=a168_0x4854d6;return(_0x925f40?.[_0x531472(0x13c)]??[])[_0x531472(0x11a)](_0x4c5678=>_0x4c5678['userId']);}export function computeRoleUserMutation(_0x47b40f){const _0x5121bd=a168_0x4854d6,{operation:_0x3f9744,appCode:_0x409d49,roleUsers:_0x387746,targetRoleId:_0x1766c0,user:_0x233204}=_0x47b40f,_0x1c4009=_0x387746[_0x5121bd(0x11d)](_0x25389f=>_0x25389f['id']===_0x1766c0);if(!_0x1c4009)throw CliErrors['validation'](_0x5121bd(0x103)+_0x1766c0+_0x5121bd(0x138),_0x5121bd(0x107));const _0x2e4550=userIdsOf(_0x1c4009),_0xc47f81=[];if(_0x47b40f['expectUserCount']!==undefined&&_0x47b40f['expectUserCount']!==_0x2e4550['length'])throw CliErrors[_0x5121bd(0x127)](_0x5121bd(0x126)+_0x47b40f[_0x5121bd(0x10a)]+_0x5121bd(0x12f)+_0x2e4550[_0x5121bd(0x10f)]+'.',_0x5121bd(0x10b));const _0x32de8c=_0x2e4550['includes'](_0x233204[_0x5121bd(0x140)]);let _0x22bdfc=![];const _0x536839=[..._0x1c4009[_0x5121bd(0x13c)]];if(_0x3f9744===_0x5121bd(0x150))_0x32de8c?_0xc47f81[_0x5121bd(0x131)]('User\x20'+_0x233204[_0x5121bd(0x140)]+_0x5121bd(0x11f)+_0x1c4009['roleName']+_0x5121bd(0x114)):(_0x536839[_0x5121bd(0x131)]({'userId':_0x233204[_0x5121bd(0x140)],'username':_0x233204[_0x5121bd(0x12d)],..._0x233204['nickname']?{'nickname':_0x233204[_0x5121bd(0x130)]}:{}}),_0x22bdfc=!![]);else{if(!_0x32de8c)_0xc47f81[_0x5121bd(0x131)](_0x5121bd(0x12b)+_0x233204[_0x5121bd(0x140)]+_0x5121bd(0x143)+_0x1c4009[_0x5121bd(0x10e)]+_0x5121bd(0x114));else{const _0xd84985=_0x536839[_0x5121bd(0x13f)](_0x190af4=>_0x190af4[_0x5121bd(0x140)]===_0x233204['userId']);if(_0xd84985>=0x0)_0x536839[_0x5121bd(0x14c)](_0xd84985,0x1);_0x22bdfc=!![];}}const _0x167e0e=_0x387746['map'](_0x2fe703=>_0x2fe703['id']===_0x1766c0?{..._0x2fe703,'userList':_0x536839}:_0x2fe703),_0x440dc0=_0x536839[_0x5121bd(0x11a)](_0x50e13b=>_0x50e13b[_0x5121bd(0x140)]),_0xaf5452={'operation':_0x3f9744,'selector':{'appCode':_0x409d49,'roleId':_0x1766c0,'roleName':_0x1c4009[_0x5121bd(0x10e)],'userId':_0x233204['userId']},'before':{'userIds':_0x2e4550},'after':{'userIds':_0x440dc0},'dryRun':_0x47b40f[_0x5121bd(0x11c)],'backend':{'method':'POST','path':UPDATE_USER_LIST_PATH},'warnings':_0xc47f81};return{'roleList':_0x167e0e,'mutation':_0xaf5452,'changed':_0x22bdfc};}export async function loadRoleUsers(_0x4c1a31){return listRoleUsers(_0x4c1a31);}export function readRoleRef(_0x4bcea5){const _0x2617dd=a168_0x4854d6,_0x48c310=_0x4bcea5[_0x2617dd(0x108)](_0x2617dd(0x121))[_0x2617dd(0x14b)]();if(!_0x48c310)throw CliErrors[_0x2617dd(0x128)]('role',_0x2617dd(0x117));return _0x48c310;}export async function prepareUserMutation(_0x18cf5a,_0x2c688e,_0x3d5114){const _0x3998a4=a168_0x4854d6,_0x4fe0e5=readRoleRef(_0x18cf5a),_0x1dbcd7=_0x18cf5a[_0x3998a4(0x108)]('user')[_0x3998a4(0x14b)]();if(!_0x1dbcd7)throw CliErrors[_0x3998a4(0x128)](_0x3998a4(0x11b),_0x3998a4(0x13a));const _0xcccc26=_0x18cf5a[_0x3998a4(0x110)](_0x3998a4(0x137)),_0x1be1c9=_0xcccc26===undefined||_0xcccc26===null?undefined:Number(_0xcccc26),_0x36d8dd=await resolveRoleRef(_0x18cf5a[_0x3998a4(0x14a)],_0x4fe0e5),_0x2cf492=await resolveUserRef(_0x1dbcd7),_0x387eda=await loadRoleUsers(_0x18cf5a[_0x3998a4(0x14a)]);return computeRoleUserMutation({'operation':_0x2c688e,'appCode':_0x18cf5a[_0x3998a4(0x14a)],'roleUsers':_0x387eda,'targetRoleId':_0x36d8dd['id'],'user':{'userId':_0x2cf492['userId'],'username':_0x2cf492['username'],'nickname':_0x2cf492['nickname']},'dryRun':_0x3d5114,..._0x1be1c9!==undefined?{'expectUserCount':_0x1be1c9}:{}});}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const roleUpdate: CommandDefinition;
@@ -1 +1 @@
1
- const a169_0x15bf0e=a169_0x5d94;(function(_0x3a778b,_0x548311){const _0x3b4fba=a169_0x5d94,_0x3b959f=_0x3a778b();while(!![]){try{const _0x599e2a=parseInt(_0x3b4fba(0xb1))/0x1+-parseInt(_0x3b4fba(0xb6))/0x2+parseInt(_0x3b4fba(0xc3))/0x3+-parseInt(_0x3b4fba(0xb7))/0x4*(parseInt(_0x3b4fba(0xc6))/0x5)+parseInt(_0x3b4fba(0xb2))/0x6*(parseInt(_0x3b4fba(0xc4))/0x7)+parseInt(_0x3b4fba(0xc8))/0x8+parseInt(_0x3b4fba(0xc0))/0x9*(-parseInt(_0x3b4fba(0xc7))/0xa);if(_0x599e2a===_0x548311)break;else _0x3b959f['push'](_0x3b959f['shift']());}catch(_0x52b393){_0x3b959f['push'](_0x3b959f['shift']());}}}(a169_0x245d,0x4f8e2));function a169_0x5d94(_0x29c25e,_0x192f65){_0x29c25e=_0x29c25e-0xb1;const _0x245d8b=a169_0x245d();let _0x5d9482=_0x245d8b[_0x29c25e];return _0x5d9482;}import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a169_0x245d(){const _0x51c8f1=['num','write','195164RjkAph','485200bkwHKh','POST','appCode','New\x20role\x20name','/smartapi/permit/role/update','string','\x20(id=','trim','remark','10750977cDSFKu','roleName','length','1547598GPPnXQ','231hzDYYt','--name\x20cannot\x20be\x20empty.','15JqhnTA','10fGmatN','5159512cuDMMl','flag','update','name','195441YgSJua','113754bcvBRJ','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.'];a169_0x245d=function(){return _0x51c8f1;};return a169_0x245d();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a169_0x15bf0e(0xbb);function readPatch(_0x31970f){const _0x5249da=a169_0x15bf0e,_0x174bb2=_0x31970f[_0x5249da(0xc9)](_0x5249da(0xcb)),_0x3a2334=_0x31970f['flag']('remark'),_0x480601={};if(_0x174bb2!==undefined&&_0x174bb2!==null){const _0x4b8f75=String(_0x174bb2)[_0x5249da(0xbe)]();if(!_0x4b8f75)throw CliErrors['validation'](_0x5249da(0xc5));if(_0x4b8f75[_0x5249da(0xc2)]>0x40)throw CliErrors['validation']('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x480601[_0x5249da(0xc1)]=_0x4b8f75;}_0x3a2334!==undefined&&_0x3a2334!==null&&(_0x480601[_0x5249da(0xbf)]=String(_0x3a2334));if(_0x480601[_0x5249da(0xc1)]===undefined&&_0x480601[_0x5249da(0xbf)]===undefined)throw CliErrors['validation']('Nothing\x20to\x20update.',_0x5249da(0xb3));return _0x480601;}export const roleUpdate={'service':'role','command':a169_0x15bf0e(0xca),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','risk':a169_0x15bf0e(0xb5),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a169_0x15bf0e(0xcb),'type':a169_0x15bf0e(0xbc),'required':![],'description':a169_0x15bf0e(0xba)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x111391){readPatch(_0x111391);},async 'dryRun'(_0x26f902){const _0x12db9b=a169_0x15bf0e,_0x2e1761=_0x26f902['num']('id'),_0x3ad545=readPatch(_0x26f902),_0x655e4a=await getRoleById(_0x26f902['appCode'],_0x2e1761);return assertCustomRole(_0x655e4a,'update'),asDryRunResult({'operation':'update','selector':{'appCode':_0x26f902[_0x12db9b(0xb9)],'roleId':_0x2e1761,'roleName':_0x655e4a[_0x12db9b(0xc1)]},'before':projectRole(_0x655e4a),'after':projectRole({..._0x655e4a,..._0x3ad545[_0x12db9b(0xc1)]!==undefined?{'roleName':_0x3ad545[_0x12db9b(0xc1)]}:{},..._0x3ad545[_0x12db9b(0xbf)]!==undefined?{'remark':_0x3ad545['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x12db9b(0xb8),'path':UPDATE_PATH},'warnings':[]},{'method':_0x12db9b(0xb8),'url':UPDATE_PATH});},async 'execute'(_0x40f5cd){const _0x1244a0=a169_0x15bf0e,_0x590a22=_0x40f5cd[_0x1244a0(0xb4)]('id'),_0x112c6b=readPatch(_0x40f5cd),_0x58a903=await getRoleById(_0x40f5cd[_0x1244a0(0xb9)],_0x590a22);assertCustomRole(_0x58a903,_0x1244a0(0xca)),await updateAppRole({'id':_0x590a22,'appCode':_0x40f5cd['appCode'],..._0x112c6b[_0x1244a0(0xc1)]!==undefined?{'roleName':_0x112c6b[_0x1244a0(0xc1)]}:{},..._0x112c6b[_0x1244a0(0xbf)]!==undefined?{'remark':_0x112c6b['remark']}:{}});const _0x304fc1=await getRoleById(_0x40f5cd[_0x1244a0(0xb9)],_0x590a22);return{'ok':!![],'data':{'operation':'update','selector':{'appCode':_0x40f5cd[_0x1244a0(0xb9)],'roleId':_0x590a22,'roleName':_0x304fc1[_0x1244a0(0xc1)]},'before':projectRole(_0x58a903),'after':projectRole(_0x304fc1),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0x304fc1[_0x1244a0(0xc1)]+_0x1244a0(0xbd)+_0x590a22+')'};}};
1
+ const a169_0x55dea0=a169_0x46cf;(function(_0x10e060,_0x4c64ca){const _0x1291c8=a169_0x46cf,_0x3abd20=_0x10e060();while(!![]){try{const _0x55fbaa=-parseInt(_0x1291c8(0x12b))/0x1+-parseInt(_0x1291c8(0x12f))/0x2+parseInt(_0x1291c8(0x12a))/0x3+-parseInt(_0x1291c8(0x127))/0x4+parseInt(_0x1291c8(0x125))/0x5+parseInt(_0x1291c8(0x123))/0x6+parseInt(_0x1291c8(0x12c))/0x7;if(_0x55fbaa===_0x4c64ca)break;else _0x3abd20['push'](_0x3abd20['shift']());}catch(_0x1c36c7){_0x3abd20['push'](_0x3abd20['shift']());}}}(a169_0x3700,0x34a96));function a169_0x46cf(_0x2db91a,_0x4a309a){_0x2db91a=_0x2db91a-0x11a;const _0x370088=a169_0x3700();let _0x46cfde=_0x370088[_0x2db91a];return _0x46cfde;}import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a169_0x55dea0(0x126);function a169_0x3700(){const _0x35b12d=['flag','trim','1658454CyTJxA','name','1047490JvSUPj','/smartapi/permit/role/update','1725352qeCRjg','validation','roleName','789915btptbe','9385pObKsQ','117369BSiiFu','\x20(id=','appCode','219108zycbCG','POST','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','Updated\x20role\x20','string','Nothing\x20to\x20update.','num','update','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','--name\x20cannot\x20be\x20empty.','role','remark'];a169_0x3700=function(){return _0x35b12d;};return a169_0x3700();}function readPatch(_0x240753){const _0x6900f=a169_0x55dea0,_0x3fcebe=_0x240753['flag']('name'),_0x38b103=_0x240753[_0x6900f(0x121)]('remark'),_0x5457f1={};if(_0x3fcebe!==undefined&&_0x3fcebe!==null){const _0x4a37bf=String(_0x3fcebe)[_0x6900f(0x122)]();if(!_0x4a37bf)throw CliErrors[_0x6900f(0x128)](_0x6900f(0x11e));if(_0x4a37bf['length']>0x40)throw CliErrors[_0x6900f(0x128)](_0x6900f(0x131));_0x5457f1[_0x6900f(0x129)]=_0x4a37bf;}_0x38b103!==undefined&&_0x38b103!==null&&(_0x5457f1['remark']=String(_0x38b103));if(_0x5457f1[_0x6900f(0x129)]===undefined&&_0x5457f1[_0x6900f(0x120)]===undefined)throw CliErrors['validation'](_0x6900f(0x134),_0x6900f(0x11c));return _0x5457f1;}export const roleUpdate={'service':a169_0x55dea0(0x11f),'command':'update','description':a169_0x55dea0(0x11d),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a169_0x55dea0(0x124),'type':a169_0x55dea0(0x133),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2ce616){readPatch(_0x2ce616);},async 'dryRun'(_0x2613c8){const _0x43997d=a169_0x55dea0,_0x19af2e=_0x2613c8[_0x43997d(0x11a)]('id'),_0x1801b4=readPatch(_0x2613c8),_0x16a912=await getRoleById(_0x2613c8[_0x43997d(0x12e)],_0x19af2e);return assertCustomRole(_0x16a912,'update'),asDryRunResult({'operation':_0x43997d(0x11b),'selector':{'appCode':_0x2613c8[_0x43997d(0x12e)],'roleId':_0x19af2e,'roleName':_0x16a912['roleName']},'before':projectRole(_0x16a912),'after':projectRole({..._0x16a912,..._0x1801b4[_0x43997d(0x129)]!==undefined?{'roleName':_0x1801b4[_0x43997d(0x129)]}:{},..._0x1801b4[_0x43997d(0x120)]!==undefined?{'remark':_0x1801b4[_0x43997d(0x120)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x43997d(0x130),'url':UPDATE_PATH});},async 'execute'(_0x4c1887){const _0x15cc20=a169_0x55dea0,_0x514acd=_0x4c1887[_0x15cc20(0x11a)]('id'),_0x5e07ba=readPatch(_0x4c1887),_0x1d785f=await getRoleById(_0x4c1887[_0x15cc20(0x12e)],_0x514acd);assertCustomRole(_0x1d785f,_0x15cc20(0x11b)),await updateAppRole({'id':_0x514acd,'appCode':_0x4c1887[_0x15cc20(0x12e)],..._0x5e07ba['roleName']!==undefined?{'roleName':_0x5e07ba[_0x15cc20(0x129)]}:{},..._0x5e07ba[_0x15cc20(0x120)]!==undefined?{'remark':_0x5e07ba[_0x15cc20(0x120)]}:{}});const _0x4ab627=await getRoleById(_0x4c1887['appCode'],_0x514acd);return{'ok':!![],'data':{'operation':'update','selector':{'appCode':_0x4c1887[_0x15cc20(0x12e)],'roleId':_0x514acd,'roleName':_0x4ab627[_0x15cc20(0x129)]},'before':projectRole(_0x1d785f),'after':projectRole(_0x4ab627),'dryRun':![],'backend':{'method':_0x15cc20(0x130),'path':UPDATE_PATH},'warnings':[]},'message':_0x15cc20(0x132)+_0x4ab627['roleName']+_0x15cc20(0x12d)+_0x514acd+')'};}};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const roleUserAdd: CommandDefinition;
@@ -1 +1 @@
1
- const a170_0x1fc14c=a170_0x5981;(function(_0x160668,_0x159630){const _0x9a1bc8=a170_0x5981,_0x16efc3=_0x160668();while(!![]){try{const _0x58a723=parseInt(_0x9a1bc8(0x1e5))/0x1*(parseInt(_0x9a1bc8(0x1dd))/0x2)+parseInt(_0x9a1bc8(0x1de))/0x3+-parseInt(_0x9a1bc8(0x1e7))/0x4+-parseInt(_0x9a1bc8(0x1d5))/0x5*(parseInt(_0x9a1bc8(0x1d8))/0x6)+parseInt(_0x9a1bc8(0x1e1))/0x7+-parseInt(_0x9a1bc8(0x1d9))/0x8*(parseInt(_0x9a1bc8(0x1e4))/0x9)+parseInt(_0x9a1bc8(0x1e6))/0xa*(parseInt(_0x9a1bc8(0x1dc))/0xb);if(_0x58a723===_0x159630)break;else _0x16efc3['push'](_0x16efc3['shift']());}catch(_0x3a4870){_0x16efc3['push'](_0x16efc3['shift']());}}}(a170_0xfba3,0xdc50a));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a170_0xfba3(){const _0x21240f=['3823787pPHuZY','109288qpyCPD','2644170AGfXTv','appCode','roleName','8772512Cvjgdv','selector','high-risk-write','6273gCmSwq','20JTywtH','30cstWvH','2060908eZBUep','user-add','userId','445saZybY','role','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','120612wULLxf','12208wqpRew','Added\x20user\x20','No\x20change:\x20user\x20'];a170_0xfba3=function(){return _0x21240f;};return a170_0xfba3();}import{asDryRunResult}from'../../commands/common/dry-run.js';function a170_0x5981(_0x5f323a,_0x4212b8){_0x5f323a=_0x5f323a-0x1d3;const _0xfba32c=a170_0xfba3();let _0x598195=_0xfba32c[_0x5f323a];return _0x598195;}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':a170_0x1fc14c(0x1d6),'command':a170_0x1fc14c(0x1d3),'description':a170_0x1fc14c(0x1d7),'risk':a170_0x1fc14c(0x1e3),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x23c66a){const {mutation:_0x15b5d8}=await prepareUserMutation(_0x23c66a,'user-add',!![]);return asDryRunResult(_0x15b5d8,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x26dbaa){const _0x583b8d=a170_0x1fc14c,{roleList:_0x140d04,mutation:_0x15b48c,changed:_0x5eae34}=await prepareUserMutation(_0x26dbaa,_0x583b8d(0x1d3),![]);return _0x5eae34&&await updateRoleUsers(_0x26dbaa[_0x583b8d(0x1df)],_0x140d04),{'ok':!![],'data':_0x15b48c,'message':_0x5eae34?_0x583b8d(0x1da)+_0x15b48c[_0x583b8d(0x1e2)][_0x583b8d(0x1d4)]+'\x20to\x20role\x20'+_0x15b48c[_0x583b8d(0x1e2)][_0x583b8d(0x1e0)]:_0x583b8d(0x1db)+_0x15b48c['selector'][_0x583b8d(0x1d4)]+'\x20already\x20in\x20role\x20'+_0x15b48c[_0x583b8d(0x1e2)][_0x583b8d(0x1e0)]};}};
1
+ const a170_0x48399b=a170_0x59bc;function a170_0x59bc(_0x1959f5,_0x40895c){_0x1959f5=_0x1959f5-0x9a;const _0x3f01fa=a170_0x3f01();let _0x59bc56=_0x3f01fa[_0x1959f5];return _0x59bc56;}(function(_0xe8045a,_0xc7cd71){const _0x5778b2=a170_0x59bc,_0x5e5a2d=_0xe8045a();while(!![]){try{const _0x2dc802=parseInt(_0x5778b2(0xa9))/0x1+-parseInt(_0x5778b2(0xa1))/0x2*(parseInt(_0x5778b2(0xa8))/0x3)+-parseInt(_0x5778b2(0xa4))/0x4+parseInt(_0x5778b2(0xa6))/0x5+parseInt(_0x5778b2(0xab))/0x6+parseInt(_0x5778b2(0x9f))/0x7*(parseInt(_0x5778b2(0xa7))/0x8)+-parseInt(_0x5778b2(0xa5))/0x9;if(_0x2dc802===_0xc7cd71)break;else _0x5e5a2d['push'](_0x5e5a2d['shift']());}catch(_0x2cfbbc){_0x5e5a2d['push'](_0x5e5a2d['shift']());}}}(a170_0x3f01,0xb4d2e));import{updateRoleUsers}from'../../core/api-client.js';function a170_0x3f01(){const _0x523e43=['user-add','selector','appCode','Added\x20user\x20','7dUcSUJ','role','33172hFGsoj','No\x20change:\x20user\x20','\x20to\x20role\x20','4808144cyiWoQ','1842921APtHHG','6699900hjzxyz','7115568EdCYdx','261FRDjCG','1177917wVtSIw','high-risk-write','1098588KpDHtG','roleName','\x20already\x20in\x20role\x20'];a170_0x3f01=function(){return _0x523e43;};return a170_0x3f01();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a170_0x48399b(0xa0),'command':'user-add','description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a170_0x48399b(0xaa),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x6ec519){const _0x47aa51=a170_0x48399b,{mutation:_0x2273e6}=await prepareUserMutation(_0x6ec519,_0x47aa51(0x9b),!![]);return asDryRunResult(_0x2273e6,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x12358e){const _0xbc4983=a170_0x48399b,{roleList:_0x16aa8d,mutation:_0x585d0a,changed:_0x36164a}=await prepareUserMutation(_0x12358e,_0xbc4983(0x9b),![]);return _0x36164a&&await updateRoleUsers(_0x12358e[_0xbc4983(0x9d)],_0x16aa8d),{'ok':!![],'data':_0x585d0a,'message':_0x36164a?_0xbc4983(0x9e)+_0x585d0a[_0xbc4983(0x9c)]['userId']+_0xbc4983(0xa3)+_0x585d0a['selector'][_0xbc4983(0xac)]:_0xbc4983(0xa2)+_0x585d0a[_0xbc4983(0x9c)]['userId']+_0xbc4983(0x9a)+_0x585d0a[_0xbc4983(0x9c)]['roleName']};}};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const roleUserRemove: CommandDefinition;
@@ -1 +1 @@
1
- function a171_0x1aac(){const _0xca9d35=['74348bCdWkk','Removed\x20user\x20','21537HtytdK','POST','760baKQqF','2161092FIQeFc','360185YAAUuC','role','3eRPmhj','user-remove','1350048gsVjFe','\x20from\x20role\x20','33zOcYAx','appCode','roleName','No\x20change:\x20user\x20','910640HDXLQl','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','\x20not\x20in\x20role\x20','5OimMBZ','high-risk-write','2139530yDKXAY','userId','selector'];a171_0x1aac=function(){return _0xca9d35;};return a171_0x1aac();}const a171_0x537bb1=a171_0xe00a;function a171_0xe00a(_0x2586b2,_0x1ecfe6){_0x2586b2=_0x2586b2-0x18d;const _0x1aacd9=a171_0x1aac();let _0xe00a98=_0x1aacd9[_0x2586b2];return _0xe00a98;}(function(_0x1ed0b7,_0x8c6bb){const _0x2b6a08=a171_0xe00a,_0x20d5f7=_0x1ed0b7();while(!![]){try{const _0x50a87d=-parseInt(_0x2b6a08(0x193))/0x1+parseInt(_0x2b6a08(0x18d))/0x2*(parseInt(_0x2b6a08(0x195))/0x3)+-parseInt(_0x2b6a08(0x19d))/0x4*(-parseInt(_0x2b6a08(0x1a0))/0x5)+-parseInt(_0x2b6a08(0x192))/0x6+-parseInt(_0x2b6a08(0x197))/0x7+parseInt(_0x2b6a08(0x191))/0x8*(parseInt(_0x2b6a08(0x18f))/0x9)+-parseInt(_0x2b6a08(0x1a2))/0xa*(-parseInt(_0x2b6a08(0x199))/0xb);if(_0x50a87d===_0x8c6bb)break;else _0x20d5f7['push'](_0x20d5f7['shift']());}catch(_0x5da706){_0x20d5f7['push'](_0x20d5f7['shift']());}}}(a171_0x1aac,0x35e7d));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a171_0x537bb1(0x194),'command':a171_0x537bb1(0x196),'description':a171_0x537bb1(0x19e),'risk':a171_0x537bb1(0x1a1),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x5c79a2){const _0x2af312=a171_0x537bb1,{mutation:_0x3753e7}=await prepareUserMutation(_0x5c79a2,'user-remove',!![]);return asDryRunResult(_0x3753e7,{'method':_0x2af312(0x190),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x41b744){const _0x2fe50e=a171_0x537bb1,{roleList:_0x1dea99,mutation:_0x5b9d83,changed:_0x3dce50}=await prepareUserMutation(_0x41b744,_0x2fe50e(0x196),![]);return _0x3dce50&&await updateRoleUsers(_0x41b744[_0x2fe50e(0x19a)],_0x1dea99),{'ok':!![],'data':_0x5b9d83,'message':_0x3dce50?_0x2fe50e(0x18e)+_0x5b9d83[_0x2fe50e(0x1a4)][_0x2fe50e(0x1a3)]+_0x2fe50e(0x198)+_0x5b9d83[_0x2fe50e(0x1a4)][_0x2fe50e(0x19b)]:_0x2fe50e(0x19c)+_0x5b9d83['selector']['userId']+_0x2fe50e(0x19f)+_0x5b9d83[_0x2fe50e(0x1a4)][_0x2fe50e(0x19b)]};}};
1
+ function a171_0x2445(){const _0x2eb686=['Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','3763824ZqUYdI','high-risk-write','36124SWPmsq','role','selector','appCode','No\x20change:\x20user\x20','488180NWiBNd','1505079xtJIwT','952232ciBhcz','roleName','1550830kzRTXr','143bbUXCh','66CmwxQN','1821262GdXoav','Removed\x20user\x20','user-remove','351gyHfdG','userId','\x20from\x20role\x20','POST','21bvLwpG'];a171_0x2445=function(){return _0x2eb686;};return a171_0x2445();}const a171_0x1d9358=a171_0xb5d9;function a171_0xb5d9(_0x33988f,_0x5c7f16){_0x33988f=_0x33988f-0xf1;const _0x24455d=a171_0x2445();let _0xb5d9fa=_0x24455d[_0x33988f];return _0xb5d9fa;}(function(_0x1d9fda,_0x264b68){const _0x7c9bd1=a171_0xb5d9,_0x28cf2c=_0x1d9fda();while(!![]){try{const _0x5842f1=parseInt(_0x7c9bd1(0x105))/0x1+-parseInt(_0x7c9bd1(0x100))/0x2+parseInt(_0x7c9bd1(0xf1))/0x3*(-parseInt(_0x7c9bd1(0xf9))/0x4)+-parseInt(_0x7c9bd1(0xfe))/0x5*(-parseInt(_0x7c9bd1(0x104))/0x6)+parseInt(_0x7c9bd1(0xf5))/0x7*(parseInt(_0x7c9bd1(0xf7))/0x8)+parseInt(_0x7c9bd1(0xff))/0x9+parseInt(_0x7c9bd1(0x102))/0xa*(-parseInt(_0x7c9bd1(0x103))/0xb);if(_0x5842f1===_0x264b68)break;else _0x28cf2c['push'](_0x28cf2c['shift']());}catch(_0x3d5d5a){_0x28cf2c['push'](_0x28cf2c['shift']());}}}(a171_0x2445,0xe1dad));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a171_0x1d9358(0xfa),'command':a171_0x1d9358(0x107),'description':a171_0x1d9358(0xf6),'risk':a171_0x1d9358(0xf8),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x16bdcd){const _0x5bfb4b=a171_0x1d9358,{mutation:_0x429ff6}=await prepareUserMutation(_0x16bdcd,_0x5bfb4b(0x107),!![]);return asDryRunResult(_0x429ff6,{'method':_0x5bfb4b(0xf4),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x331354){const _0x4189bc=a171_0x1d9358,{roleList:_0x46878c,mutation:_0x5c4334,changed:_0x5ea64b}=await prepareUserMutation(_0x331354,_0x4189bc(0x107),![]);return _0x5ea64b&&await updateRoleUsers(_0x331354[_0x4189bc(0xfc)],_0x46878c),{'ok':!![],'data':_0x5c4334,'message':_0x5ea64b?_0x4189bc(0x106)+_0x5c4334['selector'][_0x4189bc(0xf2)]+_0x4189bc(0xf3)+_0x5c4334[_0x4189bc(0xfb)][_0x4189bc(0x101)]:_0x4189bc(0xfd)+_0x5c4334[_0x4189bc(0xfb)][_0x4189bc(0xf2)]+'\x20not\x20in\x20role\x20'+_0x5c4334[_0x4189bc(0xfb)][_0x4189bc(0x101)]};}};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const roleUserResolve: CommandDefinition;
@@ -1 +1 @@
1
- const a172_0x1cbd9d=a172_0x142f;(function(_0x13d754,_0x52f33d){const _0x58794c=a172_0x142f,_0x3f0bd0=_0x13d754();while(!![]){try{const _0xd9d92e=parseInt(_0x58794c(0xc3))/0x1+parseInt(_0x58794c(0xbe))/0x2+-parseInt(_0x58794c(0xc2))/0x3+-parseInt(_0x58794c(0xbc))/0x4+-parseInt(_0x58794c(0xc0))/0x5+parseInt(_0x58794c(0xbd))/0x6*(-parseInt(_0x58794c(0xbf))/0x7)+parseInt(_0x58794c(0xb8))/0x8*(parseInt(_0x58794c(0xc1))/0x9);if(_0xd9d92e===_0x52f33d)break;else _0x3f0bd0['push'](_0x3f0bd0['shift']());}catch(_0x45a392){_0x3f0bd0['push'](_0x3f0bd0['shift']());}}}(a172_0x4b83,0x65630));import{CliErrors}from'../../errors.js';function a172_0x4b83(){const _0x395f62=['user-resolve','username','trim','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','16TxPuPO','Resolved\x20\x22','name','str','798448kbGrOi','368292MrBYPe','1638628OVYrMy','49sHeFWT','3859500WjPFyk','2688039HvXmhE','571743Zdmelj','590391EvQjhN','\x22\x20→\x20userId\x20','flagMissing','matchedBy','Pass\x20--name\x20<nickname|username>.','role','nickname','userId'];a172_0x4b83=function(){return _0x395f62;};return a172_0x4b83();}function a172_0x142f(_0x24c6b3,_0x430838){_0x24c6b3=_0x24c6b3-0xad;const _0x4b836a=a172_0x4b83();let _0x142f66=_0x4b836a[_0x24c6b3];return _0x142f66;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a172_0x1cbd9d(0xb1),'command':a172_0x1cbd9d(0xb4),'description':a172_0x1cbd9d(0xb7),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4c74c0){const _0x452885=a172_0x1cbd9d;if(!_0x4c74c0[_0x452885(0xbb)](_0x452885(0xba))[_0x452885(0xb6)]())throw CliErrors[_0x452885(0xae)]('name',_0x452885(0xb0));},async 'execute'(_0x5b9c2f){const _0x4c489f=a172_0x1cbd9d,_0x5844ad=_0x5b9c2f['str'](_0x4c489f(0xba))[_0x4c489f(0xb6)](),_0x3ef9c0=await resolveUserRef(_0x5844ad);return{'ok':!![],'data':{'user':{'userId':_0x3ef9c0[_0x4c489f(0xb3)],'username':_0x3ef9c0[_0x4c489f(0xb5)],'nickname':_0x3ef9c0[_0x4c489f(0xb2)],'matchedBy':_0x3ef9c0[_0x4c489f(0xaf)]}},'message':_0x4c489f(0xb9)+_0x5844ad+_0x4c489f(0xad)+_0x3ef9c0['userId']};}};
1
+ const a172_0x4c5034=a172_0x2171;(function(_0x41c984,_0x3c72d6){const _0x1b23aa=a172_0x2171,_0x9b5c0f=_0x41c984();while(!![]){try{const _0xe494f3=-parseInt(_0x1b23aa(0x120))/0x1+-parseInt(_0x1b23aa(0x126))/0x2+parseInt(_0x1b23aa(0x130))/0x3+-parseInt(_0x1b23aa(0x12d))/0x4+-parseInt(_0x1b23aa(0x12a))/0x5+-parseInt(_0x1b23aa(0x12f))/0x6+parseInt(_0x1b23aa(0x12c))/0x7*(parseInt(_0x1b23aa(0x125))/0x8);if(_0xe494f3===_0x3c72d6)break;else _0x9b5c0f['push'](_0x9b5c0f['shift']());}catch(_0x19da50){_0x9b5c0f['push'](_0x9b5c0f['shift']());}}}(a172_0x24a3,0xf2cd1));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a172_0x2171(_0x2229b8,_0x48104a){_0x2229b8=_0x2229b8-0x120;const _0x24a3e2=a172_0x24a3();let _0x21713c=_0x24a3e2[_0x2229b8];return _0x21713c;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a172_0x24a3(){const _0x2bac29=['1400861bIzPrQ','name','str','user-resolve','userId','1752464cqOzQt','2006974PoxFBO','trim','read','Resolved\x20\x22','5318680oTHBRU','\x22\x20→\x20userId\x20','189IOfAdm','5509656ICFOiF','Pass\x20--name\x20<nickname|username>.','3216732FttDGT','1384701vyMwiG','flagMissing'];a172_0x24a3=function(){return _0x2bac29;};return a172_0x24a3();}export const roleUserResolve={'service':'role','command':a172_0x4c5034(0x123),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a172_0x4c5034(0x128),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x56bed2){const _0x5501d7=a172_0x4c5034;if(!_0x56bed2[_0x5501d7(0x122)](_0x5501d7(0x121))[_0x5501d7(0x127)]())throw CliErrors[_0x5501d7(0x131)](_0x5501d7(0x121),_0x5501d7(0x12e));},async 'execute'(_0x5cfff5){const _0xe3c465=a172_0x4c5034,_0x101508=_0x5cfff5[_0xe3c465(0x122)]('name')[_0xe3c465(0x127)](),_0x10db37=await resolveUserRef(_0x101508);return{'ok':!![],'data':{'user':{'userId':_0x10db37[_0xe3c465(0x124)],'username':_0x10db37['username'],'nickname':_0x10db37['nickname'],'matchedBy':_0x10db37['matchedBy']}},'message':_0xe3c465(0x129)+_0x101508+_0xe3c465(0x12b)+_0x10db37['userId']};}};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const runDefinition: CommandDefinition;