@lovrabet/rabetbase-cli 2.3.16-beta.3 → 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 (568) 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
  561. package/lib/commands/page/react/create.js +0 -1
  562. package/lib/commands/page/react/detail.js +0 -1
  563. package/lib/commands/page/react/list.js +0 -1
  564. package/lib/commands/page/react/publish.js +0 -1
  565. package/lib/commands/page/react/shared.js +0 -1
  566. package/lib/commands/page/react/syntax.js +0 -1
  567. package/lib/commands/page/react/template.js +0 -1
  568. package/lib/commands/page/react/update.js +0 -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 a170_0x976ef7=a170_0x31b4;(function(_0x56ab8f,_0x500488){const _0x3249bd=a170_0x31b4,_0x3bd9d5=_0x56ab8f();while(!![]){try{const _0xaa257b=-parseInt(_0x3249bd(0x1dd))/0x1*(-parseInt(_0x3249bd(0x21a))/0x2)+-parseInt(_0x3249bd(0x216))/0x3*(parseInt(_0x3249bd(0x204))/0x4)+-parseInt(_0x3249bd(0x205))/0x5+-parseInt(_0x3249bd(0x1ea))/0x6+-parseInt(_0x3249bd(0x1cf))/0x7+-parseInt(_0x3249bd(0x1cb))/0x8+-parseInt(_0x3249bd(0x211))/0x9*(-parseInt(_0x3249bd(0x1cd))/0xa);if(_0xaa257b===_0x500488)break;else _0x3bd9d5['push'](_0x3bd9d5['shift']());}catch(_0x1bf4b7){_0x3bd9d5['push'](_0x3bd9d5['shift']());}}}(a170_0x25d5,0x3623b));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{taskDefinitions}from'../commands/task/index.js';import{tenantDefinitions}from'../commands/tenant/index.js';import{roleDefinitions}from'../commands/role/index.js';function a170_0x31b4(_0x2cce38,_0x29334b){_0x2cce38=_0x2cce38-0x1c1;const _0x25d503=a170_0x25d5();let _0x31b42f=_0x25d503[_0x2cce38];return _0x31b42f;}import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';function a170_0x25d5(){const _0x27b5a5=['210268gDSmqB','1964325VcUTAN','menu:update','filter','Notification\x20Configuration','project:init','create','rabetbase\x20kb\x20delete','OCR','wildcardDef','values','knowledge-base:delete','App\x20Management','18NYDdfx','service','Self\x20Update','description','rabetbase\x20workspace\x20init\x20--appcode\x20<code>','24wzwKso','app:use','rabetbase\x20auth\x20logout','read','9274JolkBe','write','rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml','skills:install','Tenant\x20Members','knowledge-base:list','Code\x20Generation','Async\x20Tasks','knowledge-base:create','`\x20instead.','SQL\x20Queries','build','app:remove','2521840axdSIi','rabetbase\x20run\x20preview','9469920dRmhRT','Dataset\x20&\x20Operations','2488367SUuLQj','commands','rabetbase\x20workspace\x20use\x20--app\x20<name>','sql:save','\x20\x20[write]','rabetbase\x20run\x20start','rabetbase\x20kb\x20update','login','Schema','skill:install','CLI\x20Built-in\x20Skill','\x20\x20[high-risk-write]','rabetbase\x20bff\x20create','rabetbase\x20run\x20build','29JRcLzj','rabetbase\x20kb\x20list','File','command','set','length','start','skill:','Company\x20Knowledge\x20Base','isSingleCommand','Menu','knowledge-base:detail','Diagnostics','1935540KQskUF','Authentication','install','`\x20has\x20been\x20removed.','rabetbase\x20sql\x20create','rabetbase\x20cli-skill\x20install','Runtime\x20App\x20Config\x20Management','Platform\x20Issue','Roles','Logs','Configuration','Quick\x20Start','app:remote','rabetbase\x20app\x20list\x20--remote','from','app:add','run','skills:','BFF\x20Scripts','rabetbase\x20workspace\x20remove\x20<name>','risk','show','get','map','<script>','Instant\x20API'];a170_0x25d5=function(){return _0x27b5a5;};return a170_0x25d5();}import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x248138){const _0x3b3359=a170_0x31b4;for(const _0x24c24c of _0x248138){definitions['set'](_0x24c24c[_0x3b3359(0x212)]+':'+_0x24c24c[_0x3b3359(0x1e0)],_0x24c24c);let _0x336b4b=serviceGroups[_0x3b3359(0x200)](_0x24c24c[_0x3b3359(0x212)]);!_0x336b4b&&(_0x336b4b=[],serviceGroups['set'](_0x24c24c[_0x3b3359(0x212)],_0x336b4b)),_0x336b4b['push'](_0x24c24c);}}function registerDeclarativeService(_0x469009,_0x1ea2af,_0x2b0509){const _0x285b2a=a170_0x31b4;registerDefinitions(_0x1ea2af);_0x2b0509?.['wildcardDef']&&registerDefinitions([_0x2b0509[_0x285b2a(0x20d)]]);const _0x5092f3=_0x2c968a=>_0x2c968a===_0x285b2a(0x219)?'':_0x2c968a===_0x285b2a(0x21b)?_0x285b2a(0x1d3):_0x285b2a(0x1da),_0x50fab4={'service':_0x1ea2af[0x0][_0x285b2a(0x212)],'label':_0x469009,'commands':_0x1ea2af[_0x285b2a(0x207)](_0x578aae=>!_0x578aae['hidden'])[_0x285b2a(0x201)](_0x4b92aa=>({'command':_0x4b92aa[_0x285b2a(0x1e0)],'description':_0x4b92aa[_0x285b2a(0x214)],'tag':_0x5092f3(_0x4b92aa[_0x285b2a(0x1fe)])})),'declarative':!![],'defaultCommand':_0x2b0509?.['defaultCommand']??(_0x2b0509?.['isSingleCommand']?_0x1ea2af[0x0]['command']:undefined),'wildcardDef':_0x2b0509?.[_0x285b2a(0x20d)],'isSingleCommand':_0x2b0509?.[_0x285b2a(0x1e6)]};serviceRegistry['push'](_0x50fab4),serviceByName[_0x285b2a(0x1e1)](_0x50fab4[_0x285b2a(0x212)],_0x50fab4);}registerDeclarativeService(a170_0x976ef7(0x1f5),initDefinitions,{'defaultCommand':a170_0x976ef7(0x1fa),'isSingleCommand':!![]}),registerDeclarativeService('Project',projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService(a170_0x976ef7(0x210),appDefinitions),registerDeclarativeService(a170_0x976ef7(0x1eb),authDefinitions,{'defaultCommand':a170_0x976ef7(0x1d6)}),registerDeclarativeService(a170_0x976ef7(0x1c2),tenantDefinitions),registerDeclarativeService(a170_0x976ef7(0x1ce),datasetDefinitions),registerDeclarativeService('Smart\x20List\x20Pages',pageDefinitions),registerDeclarativeService('API\x20Development',apiDefinitions),registerDeclarativeService(a170_0x976ef7(0x203),dataDefinitions),registerDeclarativeService(a170_0x976ef7(0x1fc),bffDefinitions),registerDeclarativeService(a170_0x976ef7(0x208),notificationDefinitions),registerDeclarativeService(a170_0x976ef7(0x1c8),sqlDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService(a170_0x976ef7(0x1e7),menuDefinitions),registerDeclarativeService(a170_0x976ef7(0x1c5),taskDefinitions),registerDeclarativeService(a170_0x976ef7(0x1f2),roleDefinitions),registerDeclarativeService('Permissions',permitDefinitions),registerDeclarativeService(a170_0x976ef7(0x1f0),appConfigDefinitions),registerDeclarativeService(a170_0x976ef7(0x1e5),kbDefinitions),registerDeclarativeService(a170_0x976ef7(0x1f1),issueDefinitions),registerDeclarativeService(a170_0x976ef7(0x1df),fileDefinitions),registerDeclarativeService(a170_0x976ef7(0x20c),ocrDefinitions),registerDeclarativeService(a170_0x976ef7(0x1c4),codegenDefinitions),registerDeclarativeService(a170_0x976ef7(0x1f4),configDefinitions),registerDeclarativeService(a170_0x976ef7(0x1e9),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0x976ef7(0x1d7),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0x976ef7(0x213),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a170_0x976ef7(0x1d9),cliSkillDefinitions,{'defaultCommand':a170_0x976ef7(0x1ec)}),registerDeclarativeService(a170_0x976ef7(0x1f3),logsDefinitions,{'defaultCommand':a170_0x976ef7(0x1ff)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a170_0x976ef7(0x1e2)]-0x1];last[a170_0x976ef7(0x1d0)]=[{'command':a170_0x976ef7(0x202),'description':'Run\x20any\x20package.json\x20script','tag':''}];}const REMOVED_COMMAND_REPLACEMENTS=new Map([[a170_0x976ef7(0x1d2),a170_0x976ef7(0x21c)],['bff:new',a170_0x976ef7(0x1db)],['sql:new',a170_0x976ef7(0x1ee)],[a170_0x976ef7(0x206),'rabetbase\x20menu\x20asset-update'],[a170_0x976ef7(0x209),a170_0x976ef7(0x215)],[a170_0x976ef7(0x1e4),'rabetbase\x20cli-skill\x20install'],[a170_0x976ef7(0x1d8),a170_0x976ef7(0x1ef)],[a170_0x976ef7(0x1fb),a170_0x976ef7(0x1ef)],[a170_0x976ef7(0x1c1),'rabetbase\x20cli-skill\x20install'],[a170_0x976ef7(0x1f6),a170_0x976ef7(0x1f7)],[a170_0x976ef7(0x217),a170_0x976ef7(0x1d1)],[a170_0x976ef7(0x1f9),'rabetbase\x20workspace\x20add\x20<name>\x20--appcode\x20<code>'],[a170_0x976ef7(0x1ca),a170_0x976ef7(0x1fd)],[a170_0x976ef7(0x1c3),a170_0x976ef7(0x1de)],[a170_0x976ef7(0x1e8),'rabetbase\x20kb\x20detail'],[a170_0x976ef7(0x1c6),'rabetbase\x20kb\x20create'],['knowledge-base:update',a170_0x976ef7(0x1d5)],[a170_0x976ef7(0x20f),a170_0x976ef7(0x20b)]]),REMOVED_FLAT_COMMAND_REPLACEMENTS=new Map([[a170_0x976ef7(0x20a),'rabetbase\x20project\x20create\x20<project-name>'],[a170_0x976ef7(0x1e3),a170_0x976ef7(0x1d4)],[a170_0x976ef7(0x1c9),a170_0x976ef7(0x1dc)],['preview',a170_0x976ef7(0x1cc)],['logout',a170_0x976ef7(0x218)]]);export function resolveRemovedCommand(_0x3a695d,_0x4293a8){const _0x4c6e23=a170_0x976ef7;if(!_0x3a695d)return undefined;const _0x4f9c54=REMOVED_COMMAND_REPLACEMENTS[_0x4c6e23(0x200)](_0x3a695d+':'+(_0x4293a8??'')),_0x3bfb9a=REMOVED_FLAT_COMMAND_REPLACEMENTS[_0x4c6e23(0x200)](_0x3a695d),_0x14aee3=_0x4f9c54??_0x3bfb9a;if(!_0x14aee3)return undefined;const _0x501066=_0x3bfb9a?_0x3a695d:_0x4293a8?_0x3a695d+'\x20'+_0x4293a8:_0x3a695d;return{'command':_0x501066,'message':'`rabetbase\x20'+_0x501066+_0x4c6e23(0x1ed),'hint':'Use\x20`'+_0x14aee3+_0x4c6e23(0x1c7)};}export function findDefinition(_0xefc823,_0x203f7f){const _0x3c1f91=a170_0x976ef7;return definitions[_0x3c1f91(0x200)](_0xefc823+':'+_0x203f7f);}export function isKnownService(_0x851069){return serviceByName['has'](_0x851069);}export function isDeclarativeService(_0x1fd569){const _0x344464=a170_0x976ef7;return serviceGroups['has'](_0x1fd569)||serviceByName[_0x344464(0x200)](_0x1fd569)?.[_0x344464(0x20d)]!==undefined;}export function getServiceEntry(_0x56215e){const _0x116811=a170_0x976ef7;return serviceByName[_0x116811(0x200)](_0x56215e);}export function getLegacyHandler(_0x228408,_0x22212c){return undefined;}export function getAllDefinitions(){const _0x31bd85=a170_0x976ef7;return Array[_0x31bd85(0x1f8)](definitions[_0x31bd85(0x20e)]());}
1
+ const a162_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 a171_0x2a08c8=a171_0x4d4b;(function(_0x15affb,_0x28e34b){const _0x286871=a171_0x4d4b,_0x5a5b47=_0x15affb();while(!![]){try{const _0x1d75e6=-parseInt(_0x286871(0x91))/0x1+-parseInt(_0x286871(0x93))/0x2+-parseInt(_0x286871(0x9a))/0x3+parseInt(_0x286871(0x8f))/0x4*(-parseInt(_0x286871(0x98))/0x5)+-parseInt(_0x286871(0x97))/0x6*(-parseInt(_0x286871(0x8d))/0x7)+parseInt(_0x286871(0x9e))/0x8*(-parseInt(_0x286871(0x9d))/0x9)+-parseInt(_0x286871(0x99))/0xa*(-parseInt(_0x286871(0x94))/0xb);if(_0x1d75e6===_0x28e34b)break;else _0x5a5b47['push'](_0x5a5b47['shift']());}catch(_0x5cb27e){_0x5a5b47['push'](_0x5a5b47['shift']());}}}(a171_0x1a5b,0x57d2c));import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a171_0x1a5b(){const _0x383df3=['Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','360764jnpheV','55ITyHbX','flagMissing','appCode','3108318FwCHzM','955LbjSMo','3361970QcMRrz','1818831TUpGkM','name','remark','138456rzSjGk','304ZGBCWK','roleName','POST','validation','length','create','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','trim','7XGljps','str','232yrVJUk','Created\x20role\x20','456985BWgcKW'];a171_0x1a5b=function(){return _0x383df3;};return a171_0x1a5b();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';function a171_0x4d4b(_0x2e0e3f,_0x47dd90){_0x2e0e3f=_0x2e0e3f-0x86;const _0x1a5b50=a171_0x1a5b();let _0x4d4ba8=_0x1a5b50[_0x2e0e3f];return _0x4d4ba8;}const CREATE_PATH='/smartapi/permit/role/create';function readName(_0x4f6370){const _0x1ddd03=a171_0x4d4b,_0x195d50=_0x4f6370[_0x1ddd03(0x8e)](_0x1ddd03(0x9b))['trim']();if(!_0x195d50)throw CliErrors[_0x1ddd03(0x95)]('name','Pass\x20--name\x20<roleName>.');if(_0x195d50[_0x1ddd03(0x89)]>0x40)throw CliErrors[_0x1ddd03(0x88)](_0x1ddd03(0x8b));return _0x195d50;}export const roleCreate={'service':'role','command':a171_0x2a08c8(0x8a),'description':a171_0x2a08c8(0x92),'risk':'write','flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5d532c){readName(_0x5d532c);},async 'dryRun'(_0x131cfd){const _0x37d530=a171_0x2a08c8,_0x55fe2f=readName(_0x131cfd),_0xba9b28=_0x131cfd[_0x37d530(0x8e)](_0x37d530(0x9c))[_0x37d530(0x8c)]()||undefined;return asDryRunResult({'operation':'create','selector':{'appCode':_0x131cfd[_0x37d530(0x96)],'roleName':_0x55fe2f},'before':null,'after':{'roleName':_0x55fe2f,'roleType':'CUSTOM','remark':_0xba9b28},'dryRun':!![],'backend':{'method':_0x37d530(0x87),'path':CREATE_PATH},'warnings':[]},{'method':_0x37d530(0x87),'url':CREATE_PATH});},async 'execute'(_0x27d161){const _0x381dd4=a171_0x2a08c8,_0x20fdb5=readName(_0x27d161),_0x20bbae=_0x27d161['str'](_0x381dd4(0x9c))[_0x381dd4(0x8c)]()||undefined,_0x25892f=await createAppRole({'appCode':_0x27d161[_0x381dd4(0x96)],'roleName':_0x20fdb5,..._0x20bbae?{'remark':_0x20bbae}:{}});return{'ok':!![],'data':{'operation':_0x381dd4(0x8a),'selector':{'appCode':_0x27d161[_0x381dd4(0x96)],'roleId':_0x25892f['id'],'roleName':_0x20fdb5},'before':null,'after':projectRole(_0x25892f),'dryRun':![],'backend':{'method':_0x381dd4(0x87),'path':CREATE_PATH},'warnings':[]},'message':_0x381dd4(0x90)+_0x25892f[_0x381dd4(0x86)]+'\x20(id='+_0x25892f['id']+')'};}};
1
+ const a163_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 a172_0x43eda7=a172_0x32f5;(function(_0x42494c,_0x1205e9){const _0x55a9fc=a172_0x32f5,_0x8d058=_0x42494c();while(!![]){try{const _0x2b2e28=-parseInt(_0x55a9fc(0x113))/0x1+-parseInt(_0x55a9fc(0xff))/0x2*(parseInt(_0x55a9fc(0x114))/0x3)+parseInt(_0x55a9fc(0x107))/0x4+-parseInt(_0x55a9fc(0x101))/0x5*(parseInt(_0x55a9fc(0x103))/0x6)+parseInt(_0x55a9fc(0x10e))/0x7+-parseInt(_0x55a9fc(0x108))/0x8+parseInt(_0x55a9fc(0x10b))/0x9;if(_0x2b2e28===_0x1205e9)break;else _0x8d058['push'](_0x8d058['shift']());}catch(_0x1274db){_0x8d058['push'](_0x8d058['shift']());}}}(a172_0x5345,0xc7d87));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a172_0x32f5(_0x34421b,_0x6f555){_0x34421b=_0x34421b-0xff;const _0x5345a4=a172_0x5345();let _0x32f575=_0x5345a4[_0x34421b];return _0x32f575;}function a172_0x5345(){const _0x204594=['\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','/smartapi/permit/role/delete','24452802TdswIB','Deleted\x20role\x20','num','7931770KrMFLh','role','roleName','\x20(id=','userCount','512411LuFYzg','112224oWrsEj','40uhrjqj','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','10RuZaKX','Role\x20still\x20has\x20','4601328lsyNoR','delete','POST','appCode','3708192UxiPPh','9313776MDWIxV'];a172_0x5345=function(){return _0x204594;};return a172_0x5345();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a172_0x43eda7(0x10a);export const roleDelete={'service':a172_0x43eda7(0x10f),'command':a172_0x43eda7(0x104),'description':a172_0x43eda7(0x100),'risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x153f1a){const _0x5aaa6f=a172_0x43eda7,_0x3c871f=_0x153f1a[_0x5aaa6f(0x10d)]('id'),_0x275789=await getRoleById(_0x153f1a['appCode'],_0x3c871f);return assertCustomRole(_0x275789,'delete'),asDryRunResult({'operation':_0x5aaa6f(0x104),'selector':{'appCode':_0x153f1a[_0x5aaa6f(0x106)],'roleId':_0x3c871f,'roleName':_0x275789[_0x5aaa6f(0x110)]},'before':projectRole(_0x275789),'after':null,'dryRun':!![],'backend':{'method':_0x5aaa6f(0x105),'path':DELETE_PATH},'warnings':_0x275789['userCount']>0x0?[_0x5aaa6f(0x102)+_0x275789[_0x5aaa6f(0x112)]+_0x5aaa6f(0x109)]:[]},{'method':_0x5aaa6f(0x105),'url':DELETE_PATH});},async 'execute'(_0x4a8629){const _0x15676b=a172_0x43eda7,_0x142202=_0x4a8629[_0x15676b(0x10d)]('id'),_0x563139=await getRoleById(_0x4a8629['appCode'],_0x142202);return assertCustomRole(_0x563139,'delete'),await deleteAppRole(_0x142202),{'ok':!![],'data':{'operation':_0x15676b(0x104),'selector':{'appCode':_0x4a8629[_0x15676b(0x106)],'roleId':_0x142202,'roleName':_0x563139['roleName']},'before':projectRole(_0x563139),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x15676b(0x10c)+_0x563139[_0x15676b(0x110)]+_0x15676b(0x111)+_0x142202+')'};}};
1
+ const a164_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
- const a173_0x57e9b5=a173_0x35d2;(function(_0x1b0132,_0x8422c2){const _0x215d86=a173_0x35d2,_0x1ff8c1=_0x1b0132();while(!![]){try{const _0x46c1c9=parseInt(_0x215d86(0x150))/0x1*(-parseInt(_0x215d86(0x158))/0x2)+parseInt(_0x215d86(0x157))/0x3*(-parseInt(_0x215d86(0x152))/0x4)+parseInt(_0x215d86(0x155))/0x5*(parseInt(_0x215d86(0x151))/0x6)+parseInt(_0x215d86(0x153))/0x7+-parseInt(_0x215d86(0x14b))/0x8*(-parseInt(_0x215d86(0x14d))/0x9)+-parseInt(_0x215d86(0x15a))/0xa*(parseInt(_0x215d86(0x14e))/0xb)+-parseInt(_0x215d86(0x154))/0xc*(-parseInt(_0x215d86(0x156))/0xd);if(_0x46c1c9===_0x8422c2)break;else _0x1ff8c1['push'](_0x1ff8c1['shift']());}catch(_0x467eca){_0x1ff8c1['push'](_0x1ff8c1['shift']());}}}(a173_0x283f,0xf3dd2));function a173_0x35d2(_0x582d43,_0x51850e){_0x582d43=_0x582d43-0x14a;const _0x283fbe=a173_0x283f();let _0x35d23d=_0x283fbe[_0x582d43];return _0x35d23d;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a173_0x283f(){const _0x5eae1f=['768460rpYEqd','60lBWoaK','20RCQrue','5859529ABVXWx','3UXPDRG','2pDAScc','roleType','84010GLlvRe','Show\x20a\x20single\x20role\x27s\x20detail','8JQwSVI','roleName','12187386pDTPsq','1914wJJvys','role','1531078wIuJUr','1863942kpalFq','3874036ozwsWt'];a173_0x283f=function(){return _0x5eae1f;};return a173_0x283f();}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a173_0x57e9b5(0x14f),'command':'detail','description':a173_0x57e9b5(0x14a),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x1a80ca){const _0x548a9a=a173_0x57e9b5,_0x45b8ab=_0x1a80ca['num']('id'),_0x3ebf06=await getRoleById(_0x1a80ca['appCode'],_0x45b8ab);return{'ok':!![],'data':{'role':projectRole(_0x3ebf06)},'message':'Role\x20'+_0x3ebf06[_0x548a9a(0x14c)]+'\x20('+_0x3ebf06[_0x548a9a(0x159)]+')'};}};
1
+ 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 a174_0x4829(){const _0x2bd90d=['39KBWENy','729952FbQWFu','21764urNzhU','9uZySus','832210oiDSHF','10396UHVijY','35UKJlET','1948765MMFwZA','1332294FaxORq','39513arLStl','55CWNZGk'];a174_0x4829=function(){return _0x2bd90d;};return a174_0x4829();}(function(_0x374654,_0x3f1fcc){const _0x27aa95=a174_0xe0e9,_0x1f4a4f=_0x374654();while(!![]){try{const _0x2442c1=parseInt(_0x27aa95(0x1bf))/0x1+parseInt(_0x27aa95(0x1c3))/0x2*(parseInt(_0x27aa95(0x1c1))/0x3)+-parseInt(_0x27aa95(0x1c6))/0x4*(-parseInt(_0x27aa95(0x1bc))/0x5)+parseInt(_0x27aa95(0x1be))/0x6+parseInt(_0x27aa95(0x1bd))/0x7+parseInt(_0x27aa95(0x1c2))/0x8*(-parseInt(_0x27aa95(0x1c4))/0x9)+-parseInt(_0x27aa95(0x1c5))/0xa*(parseInt(_0x27aa95(0x1c0))/0xb);if(_0x2442c1===_0x3f1fcc)break;else _0x1f4a4f['push'](_0x1f4a4f['shift']());}catch(_0xf51779){_0x1f4a4f['push'](_0x1f4a4f['shift']());}}}(a174_0x4829,0x2ef0b));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';function a174_0xe0e9(_0x25699c,_0x1481bb){_0x25699c=_0x25699c-0x1bc;const _0x482984=a174_0x4829();let _0xe0e986=_0x482984[_0x25699c];return _0xe0e986;}import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_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 a175_0x1edd84=a175_0xab32;(function(_0x500d82,_0x4b6fbd){const _0xeb1bde=a175_0xab32,_0x42d0d9=_0x500d82();while(!![]){try{const _0xc2b1bb=parseInt(_0xeb1bde(0xd9))/0x1*(-parseInt(_0xeb1bde(0xc7))/0x2)+-parseInt(_0xeb1bde(0xcc))/0x3*(parseInt(_0xeb1bde(0xe5))/0x4)+-parseInt(_0xeb1bde(0xcd))/0x5*(parseInt(_0xeb1bde(0xdf))/0x6)+parseInt(_0xeb1bde(0xe2))/0x7+-parseInt(_0xeb1bde(0xcb))/0x8*(parseInt(_0xeb1bde(0xc5))/0x9)+-parseInt(_0xeb1bde(0xcf))/0xa+parseInt(_0xeb1bde(0xda))/0xb;if(_0xc2b1bb===_0x4b6fbd)break;else _0x42d0d9['push'](_0x42d0d9['shift']());}catch(_0x197a97){_0x42d0d9['push'](_0x42d0d9['shift']());}}}(a175_0x1a69,0x68742));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a175_0x1a69(){const _0x59da15=['num','read','validation','2033032YwodBR','530259PkSVbY','2900nRAdeY','roleType','4917000ewnQmq','Invalid\x20--type\x20\x22','trim','includes','number','Found\x20','CUSTOM','DEV','type','str','3toRYFl','28357857LZPcFg','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','appCode','map','toUpperCase','6702ivljTI','Page\x20index\x20(1-based)','pagesize','5278966dzMrsU','Filter\x20by\x20role\x20type','role','16wKvCJg','length','\x20role(s)','page','string','18kMQCfa','Use\x20one\x20of:\x20','366302Hgieqw'];a175_0x1a69=function(){return _0x59da15;};return a175_0x1a69();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a175_0xab32(_0x124768,_0x2da06c){_0x124768=_0x124768-0xc2;const _0x1a69df=a175_0x1a69();let _0xab323=_0x1a69df[_0x124768];return _0xab323;}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=['ADMIN',a175_0x1edd84(0xd6),'USER',a175_0x1edd84(0xd5)];export const roleList={'service':a175_0x1edd84(0xe4),'command':'list','description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a175_0x1edd84(0xc9),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a175_0x1edd84(0xd7),'type':a175_0x1edd84(0xc4),'required':![],'description':a175_0x1edd84(0xe3),'enum':ROLE_TYPES},{'name':a175_0x1edd84(0xc3),'type':'number','description':a175_0x1edd84(0xe0),'default':0x1},{'name':a175_0x1edd84(0xe1),'type':a175_0x1edd84(0xd3),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x9f2127){const _0x592200=a175_0x1edd84,_0x4aabb2=_0x9f2127[_0x592200(0xd8)]('type')[_0x592200(0xd1)]();if(_0x4aabb2&&!ROLE_TYPES[_0x592200(0xd2)](_0x4aabb2['toUpperCase']()))throw CliErrors[_0x592200(0xca)](_0x592200(0xd0)+_0x4aabb2+'\x22.',_0x592200(0xc6)+ROLE_TYPES['join'](',\x20')+'.');const _0x2f7b47=_0x9f2127['num'](_0x592200(0xc3),0x1),_0x5a48e6=_0x9f2127[_0x592200(0xc8)]('pagesize',0x64);if(_0x2f7b47<0x1)throw CliErrors[_0x592200(0xca)]('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x5a48e6<0x1||_0x5a48e6>0x64)throw CliErrors[_0x592200(0xca)](_0x592200(0xdb));},async 'execute'(_0x1ead74){const _0x244c22=a175_0x1edd84,_0x4d08e8=_0x1ead74[_0x244c22(0xc8)]('page',0x1)||0x1,_0x5b8869=_0x1ead74[_0x244c22(0xc8)](_0x244c22(0xe1),0x64)||0x64,_0x560294=_0x1ead74[_0x244c22(0xd8)](_0x244c22(0xd7))[_0x244c22(0xd1)]()[_0x244c22(0xde)](),{items:_0x4b8486,paging:_0x2701d3}=await listAppRoles(_0x1ead74[_0x244c22(0xdc)],{'currentPage':_0x4d08e8,'pageSize':_0x5b8869}),_0x577793=_0x560294?_0x4b8486['filter'](_0x10fb28=>_0x10fb28[_0x244c22(0xce)]===_0x560294):_0x4b8486,_0x3d8068=_0x577793[_0x244c22(0xdd)](projectRole);return{'ok':!![],'data':{'roles':_0x3d8068,'paging':_0x2701d3},'message':_0x244c22(0xd4)+_0x3d8068[_0x244c22(0xe6)]+_0x244c22(0xc2)};}};
1
+ const a167_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 a176_0x28f530=a176_0xbb3d;(function(_0x1e6096,_0x10cb0b){const _0x501083=a176_0xbb3d,_0x4a7bfd=_0x1e6096();while(!![]){try{const _0x16b8ea=-parseInt(_0x501083(0xcb))/0x1+parseInt(_0x501083(0xa4))/0x2+-parseInt(_0x501083(0xaa))/0x3+parseInt(_0x501083(0xc0))/0x4+parseInt(_0x501083(0xa6))/0x5*(-parseInt(_0x501083(0xa2))/0x6)+parseInt(_0x501083(0xb7))/0x7*(-parseInt(_0x501083(0xb9))/0x8)+-parseInt(_0x501083(0x87))/0x9*(parseInt(_0x501083(0xc1))/0xa);if(_0x16b8ea===_0x10cb0b)break;else _0x4a7bfd['push'](_0x4a7bfd['shift']());}catch(_0x5e47f9){_0x4a7bfd['push'](_0x4a7bfd['shift']());}}}(a176_0x3910,0x41f2d));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a176_0x28f530(0xba),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};function a176_0x3910(){const _0x4f9423=['push','tenant_code','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','authRequired','roleName','userCount','POST','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','154aZgJbw','expect-user-count','96792fudyDW','number','userId','filter','Missing\x20user\x20reference.','CUSTOM','/smartapi/permit/user-role/update-user-list','2104488QLZFzG','110300rUPAnh','name','tenant','totalCount','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','dryRun','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','user-add','Disambiguate\x20with\x20--role\x20<id>.','Anti-drift\x20check\x20failed:\x20expected\x20','13763ZehOfC','user','appCode','\x22:\x20','str','splice','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','map','DEV','Cannot\x20','toLowerCase','Optional\x20role\x20remark/description','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','string','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','Disambiguate\x20with\x20--user\x20<id>.','Pass\x20--role\x20<id|name>.','No\x20tenant\x20member\x20matches\x20\x22','135tbPxwM','includes','trim','Role\x20name\x20\x22','remark','test','userList','role','permitCount','\x22\x20is\x20ambiguous\x20(ids:\x20','\x20member(s)\x20but\x20role\x20has\x20','\x20not\x20found\x20in\x20app\x20','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs',';\x20no\x20change.','Role\x20id\x20','\x22\x20not\x20found\x20in\x20app\x20','\x20is\x20not\x20a\x20member\x20of\x20role\x20','\x20built-in\x20role\x20','expectUserCount','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','nickname','validation','length','flagMissing','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','\x20not\x20found\x20in\x20the\x20user-role\x20list.','username','8334WaYgkB','roleType','876802UNtiLY','Role\x20name','715OqFLKm','join','User\x20','ADMIN','151140SgzEbq','find','Multiple\x20tenant\x20members\x20match\x20\x22'];a176_0x3910=function(){return _0x4f9423;};return a176_0x3910();}export const ROLE_REF_FLAG={'name':a176_0x28f530(0x8e),'type':a176_0x28f530(0xd8),'required':!![],'description':a176_0x28f530(0xd7)};export const USER_REF_FLAG={'name':a176_0x28f530(0xcc),'type':a176_0x28f530(0xd8),'required':!![],'description':a176_0x28f530(0xaf)};export const NAME_FLAG={'name':a176_0x28f530(0xc2),'type':'string','required':!![],'description':a176_0x28f530(0xa5)};export const USER_NAME_FLAG={'name':'name','type':a176_0x28f530(0xd8),'required':!![],'description':a176_0x28f530(0x9f)};export const REMARK_FLAG={'name':a176_0x28f530(0x8b),'type':a176_0x28f530(0xd8),'required':![],'description':a176_0x28f530(0xd6)};export const EXPECT_USER_COUNT_FLAG={'name':a176_0x28f530(0xb8),'type':'number','required':![],'description':a176_0x28f530(0x93)};export const BUILTIN_ROLE_TYPES=['ADMIN',a176_0x28f530(0xd3),'USER'];export function isBuiltinRole(_0x448c1b){const _0x2a0199=a176_0x28f530;return BUILTIN_ROLE_TYPES[_0x2a0199(0x88)](_0x448c1b);}export function assertCustomRole(_0x5c7e82,_0x44dbe3){const _0x9eada6=a176_0x28f530;if(_0x5c7e82[_0x9eada6(0xa3)]!==_0x9eada6(0xbe))throw CliErrors[_0x9eada6(0x9c)](_0x9eada6(0xd4)+_0x44dbe3+_0x9eada6(0x98)+_0x5c7e82[_0x9eada6(0xb2)]+'\x20('+_0x5c7e82['roleType']+').',_0x9eada6(0xc7));}export function assertPermConfigurable(_0x5cfa9f){const _0x3961e5=a176_0x28f530;if(_0x5cfa9f['roleType']===_0x3961e5(0xd3)||_0x5cfa9f[_0x3961e5(0xa3)]===_0x3961e5(0xa9))throw CliErrors[_0x3961e5(0x9c)](_0x3961e5(0xb6)+_0x5cfa9f[_0x3961e5(0xb2)]+'\x20('+_0x5cfa9f[_0x3961e5(0xa3)]+').',_0x3961e5(0xd9));}export function projectRole(_0x44d7ad){const _0x1b93f8=a176_0x28f530;return{'id':_0x44d7ad['id'],'roleName':_0x44d7ad['roleName'],'roleType':_0x44d7ad[_0x1b93f8(0xa3)],'remark':_0x44d7ad[_0x1b93f8(0x8b)],'userCount':_0x44d7ad[_0x1b93f8(0xb3)],'permitCount':_0x44d7ad[_0x1b93f8(0x8f)],'builtin':isBuiltinRole(_0x44d7ad[_0x1b93f8(0xa3)])};}export async function resolveRoleRef(_0x11f145,_0x2fa639){const _0x393d16=a176_0x28f530,_0x1995e9=_0x2fa639[_0x393d16(0x89)]();if(!_0x1995e9)throw CliErrors[_0x393d16(0x9c)]('Missing\x20role\x20reference.',_0x393d16(0xdb));if(/^\d+$/[_0x393d16(0x8c)](_0x1995e9))return getRoleById(_0x11f145,Number(_0x1995e9));const _0x20f6b3=await listAllAppRoles(_0x11f145),_0x2d7bbc=_0x20f6b3['filter'](_0x451a14=>_0x451a14[_0x393d16(0xb2)]===_0x1995e9);if(_0x2d7bbc[_0x393d16(0x9d)]===0x0)throw CliErrors[_0x393d16(0x9c)](_0x393d16(0x8a)+_0x1995e9+_0x393d16(0x96)+_0x11f145+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x2d7bbc['length']>0x1){const _0x53f96d=_0x2d7bbc[_0x393d16(0xd2)](_0x3e92ce=>_0x3e92ce['id'])[_0x393d16(0xa7)](',\x20');throw CliErrors[_0x393d16(0x9c)]('Role\x20name\x20\x22'+_0x1995e9+_0x393d16(0x90)+_0x53f96d+').',_0x393d16(0xc9));}return _0x2d7bbc[0x0];}export async function getRoleById(_0x335c0c,_0x2dbc4c){const _0x22992d=a176_0x28f530,_0x84f0a8=await getAppRole(_0x2dbc4c);if(!_0x84f0a8)throw CliErrors[_0x22992d(0x9c)](_0x22992d(0x95)+_0x2dbc4c+_0x22992d(0x92)+_0x335c0c+'.',_0x22992d(0xb0));return _0x84f0a8;}async function listAllAppRoles(_0x4b90c2){const _0x59f748=a176_0x28f530,_0x150820=0x64,_0x3c04fa=[];for(let _0x478b54=0x1;;_0x478b54+=0x1){const {items:_0x5b508c,paging:_0x26e43f}=await listAppRoles(_0x4b90c2,{'currentPage':_0x478b54,'pageSize':_0x150820});_0x3c04fa[_0x59f748(0xad)](..._0x5b508c);if(_0x5b508c[_0x59f748(0x9d)]<_0x150820||_0x26e43f&&_0x3c04fa[_0x59f748(0x9d)]>=_0x26e43f[_0x59f748(0xc4)])return _0x3c04fa;}}export async function resolveTenantCode(){const _0x583dde=a176_0x28f530,_0x12aaa5=await getSessionUserInfo(),_0x589fe3=_0x12aaa5?.[_0x583dde(0xcc)]?.[_0x583dde(0xc3)]?.[_0x583dde(0xae)];if(!_0x589fe3)throw CliErrors[_0x583dde(0xb1)](_0x583dde(0xd1));return _0x589fe3;}function matchMember(_0x1e3da8,_0x2200bf){const _0x216cfd=a176_0x28f530,_0x1f4f05=_0x2200bf[_0x216cfd(0x89)]()[_0x216cfd(0xd5)]();return(_0x1e3da8['nickname']??'')[_0x216cfd(0xd5)]()===_0x1f4f05||(_0x1e3da8[_0x216cfd(0xa1)]??'')[_0x216cfd(0xd5)]()===_0x1f4f05;}export async function resolveUserRef(_0x39b57c){const _0x3393bc=a176_0x28f530,_0x2159e4=_0x39b57c[_0x3393bc(0x89)]();if(!_0x2159e4)throw CliErrors[_0x3393bc(0x9c)](_0x3393bc(0xbd),'Pass\x20--user\x20<id|name>.');const _0x1ff08e=await resolveTenantCode(),_0x428d80=await getTenantMembers(_0x1ff08e);if(/^\d+$/[_0x3393bc(0x8c)](_0x2159e4)){const _0x126b26=Number(_0x2159e4),_0x179be1=_0x428d80['find'](_0x4a1f8e=>_0x4a1f8e['userId']===_0x126b26);return{'userId':_0x126b26,'username':_0x179be1?.['username']??String(_0x126b26),'nickname':_0x179be1?.[_0x3393bc(0x9b)],'matchedBy':'id'};}const _0x36fd20=_0x428d80[_0x3393bc(0xbc)](_0x366318=>matchMember(_0x366318,_0x2159e4));if(_0x36fd20[_0x3393bc(0x9d)]===0x0)throw CliErrors[_0x3393bc(0x9c)](_0x3393bc(0x86)+_0x2159e4+'\x22.',_0x3393bc(0x9a));if(_0x36fd20[_0x3393bc(0x9d)]>0x1){const _0x32d261=_0x36fd20[_0x3393bc(0xd2)](_0x33a722=>(_0x33a722[_0x3393bc(0x9b)]??_0x33a722[_0x3393bc(0xa1)]??'?')+'('+_0x33a722['userId']+')')['join'](',\x20');throw CliErrors[_0x3393bc(0x9c)](_0x3393bc(0xac)+_0x2159e4+_0x3393bc(0xce)+_0x32d261+'.',_0x3393bc(0xda));}const _0x459a75=_0x36fd20[0x0];return{'userId':_0x459a75[_0x3393bc(0xbb)],'username':_0x459a75[_0x3393bc(0xa1)]??String(_0x459a75['userId']),'nickname':_0x459a75[_0x3393bc(0x9b)],'matchedBy':'name'};}export const UPDATE_USER_LIST_PATH=a176_0x28f530(0xbf);function userIdsOf(_0x3a70e3){const _0x2c25b7=a176_0x28f530;return(_0x3a70e3?.['userList']??[])[_0x2c25b7(0xd2)](_0x4ff66c=>_0x4ff66c[_0x2c25b7(0xbb)]);}export function computeRoleUserMutation(_0x34340a){const _0x48a93c=a176_0x28f530,{operation:_0x3f1570,appCode:_0x205b21,roleUsers:_0x9e9521,targetRoleId:_0xf98ac8,user:_0x367a33}=_0x34340a,_0x2e9c3f=_0x9e9521[_0x48a93c(0xab)](_0x1d10d4=>_0x1d10d4['id']===_0xf98ac8);if(!_0x2e9c3f)throw CliErrors['validation'](_0x48a93c(0x95)+_0xf98ac8+_0x48a93c(0xa0),_0x48a93c(0xb0));const _0x4a3a9f=userIdsOf(_0x2e9c3f),_0x36050a=[];if(_0x34340a[_0x48a93c(0x99)]!==undefined&&_0x34340a[_0x48a93c(0x99)]!==_0x4a3a9f['length'])throw CliErrors[_0x48a93c(0x9c)](_0x48a93c(0xca)+_0x34340a[_0x48a93c(0x99)]+_0x48a93c(0x91)+_0x4a3a9f[_0x48a93c(0x9d)]+'.',_0x48a93c(0xc5));const _0x1314a8=_0x4a3a9f[_0x48a93c(0x88)](_0x367a33[_0x48a93c(0xbb)]);let _0x1de91a=![];const _0x214c51=[..._0x2e9c3f[_0x48a93c(0x8d)]];if(_0x3f1570===_0x48a93c(0xc8))_0x1314a8?_0x36050a[_0x48a93c(0xad)](_0x48a93c(0xa8)+_0x367a33[_0x48a93c(0xbb)]+_0x48a93c(0xb5)+_0x2e9c3f[_0x48a93c(0xb2)]+_0x48a93c(0x94)):(_0x214c51[_0x48a93c(0xad)]({'userId':_0x367a33['userId'],'username':_0x367a33[_0x48a93c(0xa1)],..._0x367a33[_0x48a93c(0x9b)]?{'nickname':_0x367a33['nickname']}:{}}),_0x1de91a=!![]);else{if(!_0x1314a8)_0x36050a[_0x48a93c(0xad)](_0x48a93c(0xa8)+_0x367a33['userId']+_0x48a93c(0x97)+_0x2e9c3f[_0x48a93c(0xb2)]+_0x48a93c(0x94));else{const _0x36fb19=_0x214c51['findIndex'](_0x5c240b=>_0x5c240b[_0x48a93c(0xbb)]===_0x367a33['userId']);if(_0x36fb19>=0x0)_0x214c51[_0x48a93c(0xd0)](_0x36fb19,0x1);_0x1de91a=!![];}}const _0x574e91=_0x9e9521[_0x48a93c(0xd2)](_0x474882=>_0x474882['id']===_0xf98ac8?{..._0x474882,'userList':_0x214c51}:_0x474882),_0x590281=_0x214c51[_0x48a93c(0xd2)](_0xcf32af=>_0xcf32af[_0x48a93c(0xbb)]),_0x540c6b={'operation':_0x3f1570,'selector':{'appCode':_0x205b21,'roleId':_0xf98ac8,'roleName':_0x2e9c3f[_0x48a93c(0xb2)],'userId':_0x367a33[_0x48a93c(0xbb)]},'before':{'userIds':_0x4a3a9f},'after':{'userIds':_0x590281},'dryRun':_0x34340a[_0x48a93c(0xc6)],'backend':{'method':_0x48a93c(0xb4),'path':UPDATE_USER_LIST_PATH},'warnings':_0x36050a};return{'roleList':_0x574e91,'mutation':_0x540c6b,'changed':_0x1de91a};}export async function loadRoleUsers(_0x409df3){return listRoleUsers(_0x409df3);}function a176_0xbb3d(_0x5da565,_0x39ef96){_0x5da565=_0x5da565-0x86;const _0x391069=a176_0x3910();let _0xbb3dc8=_0x391069[_0x5da565];return _0xbb3dc8;}export function readRoleRef(_0xa202b7){const _0x490fa2=a176_0x28f530,_0x357096=_0xa202b7[_0x490fa2(0xcf)](_0x490fa2(0x8e))[_0x490fa2(0x89)]();if(!_0x357096)throw CliErrors[_0x490fa2(0x9e)](_0x490fa2(0x8e),_0x490fa2(0xdb));return _0x357096;}export async function prepareUserMutation(_0x150124,_0x26d96b,_0x59d488){const _0x423173=a176_0x28f530,_0x30f5a4=readRoleRef(_0x150124),_0x292b9e=_0x150124[_0x423173(0xcf)]('user')[_0x423173(0x89)]();if(!_0x292b9e)throw CliErrors[_0x423173(0x9e)](_0x423173(0xcc),'Pass\x20--user\x20<id|name>.');const _0x55a13b=_0x150124['flag']('expect-user-count'),_0x4bea67=_0x55a13b===undefined||_0x55a13b===null?undefined:Number(_0x55a13b),_0x565e0d=await resolveRoleRef(_0x150124[_0x423173(0xcd)],_0x30f5a4),_0x2b944f=await resolveUserRef(_0x292b9e),_0x271aea=await loadRoleUsers(_0x150124['appCode']);return computeRoleUserMutation({'operation':_0x26d96b,'appCode':_0x150124[_0x423173(0xcd)],'roleUsers':_0x271aea,'targetRoleId':_0x565e0d['id'],'user':{'userId':_0x2b944f[_0x423173(0xbb)],'username':_0x2b944f['username'],'nickname':_0x2b944f[_0x423173(0x9b)]},'dryRun':_0x59d488,..._0x4bea67!==undefined?{'expectUserCount':_0x4bea67}:{}});}
1
+ const a168_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 a177_0x5b4098=a177_0x4959;function a177_0x2552(){const _0x7f53eb=['5IuAaEF','\x20(id=','Updated\x20role\x20','192380bYNRfQ','remark','flag','appCode','name','1106680smvsyB','POST','176vzfZfi','Nothing\x20to\x20update.','trim','3012102LVJGDm','/smartapi/permit/role/update','num','1317939ywWFtr','700Hgpsjn','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','update','2948106nLCcIL','1OqZoQK','New\x20role\x20name','roleName','validation','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','--name\x20cannot\x20be\x20empty.','21960agpEgd','189386qkjsVL'];a177_0x2552=function(){return _0x7f53eb;};return a177_0x2552();}(function(_0x5ceaa4,_0x45b7ea){const _0x1e7bd4=a177_0x4959,_0x5e3fba=_0x5ceaa4();while(!![]){try{const _0x9fb8b7=-parseInt(_0x1e7bd4(0x148))/0x1*(parseInt(_0x1e7bd4(0x132))/0x2)+parseInt(_0x1e7bd4(0x143))/0x3+-parseInt(_0x1e7bd4(0x13b))/0x4+parseInt(_0x1e7bd4(0x133))/0x5*(parseInt(_0x1e7bd4(0x147))/0x6)+-parseInt(_0x1e7bd4(0x144))/0x7*(parseInt(_0x1e7bd4(0x131))/0x8)+parseInt(_0x1e7bd4(0x140))/0x9+parseInt(_0x1e7bd4(0x136))/0xa*(-parseInt(_0x1e7bd4(0x13d))/0xb);if(_0x9fb8b7===_0x45b7ea)break;else _0x5e3fba['push'](_0x5e3fba['shift']());}catch(_0x45e492){_0x5e3fba['push'](_0x5e3fba['shift']());}}}(a177_0x2552,0x4c177));function a177_0x4959(_0x5d475e,_0x3d756f){_0x5d475e=_0x5d475e-0x12d;const _0x255282=a177_0x2552();let _0x49596c=_0x255282[_0x5d475e];return _0x49596c;}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=a177_0x5b4098(0x141);function readPatch(_0x3579fa){const _0x303ec8=a177_0x5b4098,_0x4a24d3=_0x3579fa[_0x303ec8(0x138)](_0x303ec8(0x13a)),_0x551493=_0x3579fa[_0x303ec8(0x138)](_0x303ec8(0x137)),_0x3ce7f0={};if(_0x4a24d3!==undefined&&_0x4a24d3!==null){const _0x72f923=String(_0x4a24d3)[_0x303ec8(0x13f)]();if(!_0x72f923)throw CliErrors[_0x303ec8(0x12e)](_0x303ec8(0x130));if(_0x72f923['length']>0x40)throw CliErrors[_0x303ec8(0x12e)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x3ce7f0[_0x303ec8(0x12d)]=_0x72f923;}_0x551493!==undefined&&_0x551493!==null&&(_0x3ce7f0[_0x303ec8(0x137)]=String(_0x551493));if(_0x3ce7f0[_0x303ec8(0x12d)]===undefined&&_0x3ce7f0[_0x303ec8(0x137)]===undefined)throw CliErrors['validation'](_0x303ec8(0x13e),_0x303ec8(0x145));return _0x3ce7f0;}export const roleUpdate={'service':'role','command':a177_0x5b4098(0x146),'description':a177_0x5b4098(0x12f),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a177_0x5b4098(0x13a),'type':'string','required':![],'description':a177_0x5b4098(0x149)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x109ee3){readPatch(_0x109ee3);},async 'dryRun'(_0x43ea50){const _0x5688ff=a177_0x5b4098,_0x470489=_0x43ea50[_0x5688ff(0x142)]('id'),_0x325905=readPatch(_0x43ea50),_0x457753=await getRoleById(_0x43ea50[_0x5688ff(0x139)],_0x470489);return assertCustomRole(_0x457753,'update'),asDryRunResult({'operation':_0x5688ff(0x146),'selector':{'appCode':_0x43ea50[_0x5688ff(0x139)],'roleId':_0x470489,'roleName':_0x457753[_0x5688ff(0x12d)]},'before':projectRole(_0x457753),'after':projectRole({..._0x457753,..._0x325905['roleName']!==undefined?{'roleName':_0x325905[_0x5688ff(0x12d)]}:{},..._0x325905['remark']!==undefined?{'remark':_0x325905['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x5688ff(0x13c),'path':UPDATE_PATH},'warnings':[]},{'method':_0x5688ff(0x13c),'url':UPDATE_PATH});},async 'execute'(_0x677ecf){const _0x1f4ed5=a177_0x5b4098,_0x563792=_0x677ecf[_0x1f4ed5(0x142)]('id'),_0x1ebfbe=readPatch(_0x677ecf),_0x384e4a=await getRoleById(_0x677ecf[_0x1f4ed5(0x139)],_0x563792);assertCustomRole(_0x384e4a,_0x1f4ed5(0x146)),await updateAppRole({'id':_0x563792,'appCode':_0x677ecf['appCode'],..._0x1ebfbe['roleName']!==undefined?{'roleName':_0x1ebfbe[_0x1f4ed5(0x12d)]}:{},..._0x1ebfbe[_0x1f4ed5(0x137)]!==undefined?{'remark':_0x1ebfbe['remark']}:{}});const _0x37f4e2=await getRoleById(_0x677ecf['appCode'],_0x563792);return{'ok':!![],'data':{'operation':'update','selector':{'appCode':_0x677ecf[_0x1f4ed5(0x139)],'roleId':_0x563792,'roleName':_0x37f4e2['roleName']},'before':projectRole(_0x384e4a),'after':projectRole(_0x37f4e2),'dryRun':![],'backend':{'method':_0x1f4ed5(0x13c),'path':UPDATE_PATH},'warnings':[]},'message':_0x1f4ed5(0x135)+_0x37f4e2['roleName']+_0x1f4ed5(0x134)+_0x563792+')'};}};
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
- function a178_0x3d4f(_0x477883,_0x4eb3e1){_0x477883=_0x477883-0x18a;const _0x2651a3=a178_0x2651();let _0x3d4f41=_0x2651a3[_0x477883];return _0x3d4f41;}const a178_0x1eca78=a178_0x3d4f;(function(_0x105ccd,_0x4ba7a8){const _0x248869=a178_0x3d4f,_0x6218f8=_0x105ccd();while(!![]){try{const _0x2f362e=-parseInt(_0x248869(0x19b))/0x1*(parseInt(_0x248869(0x196))/0x2)+parseInt(_0x248869(0x18c))/0x3*(-parseInt(_0x248869(0x197))/0x4)+parseInt(_0x248869(0x18b))/0x5+-parseInt(_0x248869(0x198))/0x6*(-parseInt(_0x248869(0x19c))/0x7)+parseInt(_0x248869(0x192))/0x8*(-parseInt(_0x248869(0x194))/0x9)+parseInt(_0x248869(0x193))/0xa+parseInt(_0x248869(0x19d))/0xb;if(_0x2f362e===_0x4ba7a8)break;else _0x6218f8['push'](_0x6218f8['shift']());}catch(_0xc1d724){_0x6218f8['push'](_0x6218f8['shift']());}}}(a178_0x2651,0x21684));function a178_0x2651(){const _0x4ed5fc=['377707FEsiKj','user-add','1040635dLXMtT','681MpJtTB','roleName','appCode','userId','\x20already\x20in\x20role\x20','\x20to\x20role\x20','287816hXSChp','37840PXBfDk','9YYUEAy','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','259848xLqHVD','3356MUbQCv','82314nVJUyj','role','selector','1rFhsAu','126oSssTm'];a178_0x2651=function(){return _0x4ed5fc;};return a178_0x2651();}import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a178_0x1eca78(0x199),'command':a178_0x1eca78(0x18a),'description':a178_0x1eca78(0x195),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x52b839){const _0x1d44f5=a178_0x1eca78,{mutation:_0x232546}=await prepareUserMutation(_0x52b839,_0x1d44f5(0x18a),!![]);return asDryRunResult(_0x232546,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x2130c3){const _0x594667=a178_0x1eca78,{roleList:_0x2b7770,mutation:_0x5b3838,changed:_0x4c67a3}=await prepareUserMutation(_0x2130c3,_0x594667(0x18a),![]);return _0x4c67a3&&await updateRoleUsers(_0x2130c3[_0x594667(0x18e)],_0x2b7770),{'ok':!![],'data':_0x5b3838,'message':_0x4c67a3?'Added\x20user\x20'+_0x5b3838[_0x594667(0x19a)][_0x594667(0x18f)]+_0x594667(0x191)+_0x5b3838[_0x594667(0x19a)][_0x594667(0x18d)]:'No\x20change:\x20user\x20'+_0x5b3838[_0x594667(0x19a)]['userId']+_0x594667(0x190)+_0x5b3838[_0x594667(0x19a)][_0x594667(0x18d)]};}};
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 a179_0x5e4f(_0x3bd098,_0x29a7f2){_0x3bd098=_0x3bd098-0x1d1;const _0x2bf27e=a179_0x2bf2();let _0x5e4f06=_0x2bf27e[_0x3bd098];return _0x5e4f06;}function a179_0x2bf2(){const _0x5342b5=['\x20from\x20role\x20','POST','selector','19CSDqdv','33AyqYdp','appCode','4112976MkMXnF','669326nddFFq','38902PTRrWp','Removed\x20user\x20','796365unOLbX','1773288kEBsnG','No\x20change:\x20user\x20','role','18qSUkZL','\x20not\x20in\x20role\x20','high-risk-write','8295190lOLmnJ','roleName','48yLsLyT','943350ZkTDVu','user-remove','userId'];a179_0x2bf2=function(){return _0x5342b5;};return a179_0x2bf2();}const a179_0x2c5644=a179_0x5e4f;(function(_0x5f5e79,_0x4d9084){const _0x591e9c=a179_0x5e4f,_0x19824f=_0x5f5e79();while(!![]){try{const _0x2c6655=-parseInt(_0x591e9c(0x1e2))/0x1*(parseInt(_0x591e9c(0x1e7))/0x2)+parseInt(_0x591e9c(0x1dc))/0x3+-parseInt(_0x591e9c(0x1e5))/0x4+parseInt(_0x591e9c(0x1d2))/0x5+-parseInt(_0x591e9c(0x1d6))/0x6*(-parseInt(_0x591e9c(0x1e6))/0x7)+-parseInt(_0x591e9c(0x1db))/0x8*(parseInt(_0x591e9c(0x1d3))/0x9)+parseInt(_0x591e9c(0x1d9))/0xa*(parseInt(_0x591e9c(0x1e3))/0xb);if(_0x2c6655===_0x4d9084)break;else _0x19824f['push'](_0x19824f['shift']());}catch(_0x52938e){_0x19824f['push'](_0x19824f['shift']());}}}(a179_0x2bf2,0xa35c9));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':a179_0x2c5644(0x1d5),'command':a179_0x2c5644(0x1dd),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a179_0x2c5644(0x1d8),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4094df){const _0x9d5094=a179_0x2c5644,{mutation:_0x3ebe6f}=await prepareUserMutation(_0x4094df,_0x9d5094(0x1dd),!![]);return asDryRunResult(_0x3ebe6f,{'method':_0x9d5094(0x1e0),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x4ed33b){const _0x53c40b=a179_0x2c5644,{roleList:_0x192856,mutation:_0x3b0b25,changed:_0x40b98d}=await prepareUserMutation(_0x4ed33b,_0x53c40b(0x1dd),![]);return _0x40b98d&&await updateRoleUsers(_0x4ed33b[_0x53c40b(0x1e4)],_0x192856),{'ok':!![],'data':_0x3b0b25,'message':_0x40b98d?_0x53c40b(0x1d1)+_0x3b0b25[_0x53c40b(0x1e1)]['userId']+_0x53c40b(0x1df)+_0x3b0b25['selector'][_0x53c40b(0x1da)]:_0x53c40b(0x1d4)+_0x3b0b25[_0x53c40b(0x1e1)][_0x53c40b(0x1de)]+_0x53c40b(0x1d7)+_0x3b0b25[_0x53c40b(0x1e1)][_0x53c40b(0x1da)]};}};
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 a180_0x31ae93=a180_0x36fc;function a180_0x1c18(){const _0x5bcc67=['user-resolve','1211355EGteZz','username','Pass\x20--name\x20<nickname|username>.','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','368547wUlKAo','1297780exOvpb','flagMissing','nickname','404303JbiLZn','str','16mtMOVm','name','16JJcnfh','trim','1846182jqHgiS','120Bmiqlk','role','userId','307130yFieXS','\x22\x20→\x20userId\x20','397691GiItBY'];a180_0x1c18=function(){return _0x5bcc67;};return a180_0x1c18();}function a180_0x36fc(_0x4983a6,_0xf8c312){_0x4983a6=_0x4983a6-0x165;const _0x1c189e=a180_0x1c18();let _0x36fcc2=_0x1c189e[_0x4983a6];return _0x36fcc2;}(function(_0x5fdc26,_0x5da2a1){const _0x47ff94=a180_0x36fc,_0xe3eaca=_0x5fdc26();while(!![]){try{const _0x56b63f=parseInt(_0x47ff94(0x167))/0x1+parseInt(_0x47ff94(0x16d))/0x2+parseInt(_0x47ff94(0x179))/0x3*(parseInt(_0x47ff94(0x16b))/0x4)+parseInt(_0x47ff94(0x171))/0x5*(-parseInt(_0x47ff94(0x16e))/0x6)+-parseInt(_0x47ff94(0x173))/0x7*(-parseInt(_0x47ff94(0x169))/0x8)+-parseInt(_0x47ff94(0x175))/0x9+parseInt(_0x47ff94(0x17a))/0xa;if(_0x56b63f===_0x5da2a1)break;else _0xe3eaca['push'](_0xe3eaca['shift']());}catch(_0x33d213){_0xe3eaca['push'](_0xe3eaca['shift']());}}}(a180_0x1c18,0xaaac7));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a180_0x31ae93(0x16f),'command':a180_0x31ae93(0x174),'description':a180_0x31ae93(0x178),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2d21f8){const _0x19760f=a180_0x31ae93;if(!_0x2d21f8[_0x19760f(0x168)](_0x19760f(0x16a))[_0x19760f(0x16c)]())throw CliErrors[_0x19760f(0x165)](_0x19760f(0x16a),_0x19760f(0x177));},async 'execute'(_0x370ff2){const _0x5b1ff5=a180_0x31ae93,_0x387d8e=_0x370ff2['str']('name')['trim'](),_0x5e6294=await resolveUserRef(_0x387d8e);return{'ok':!![],'data':{'user':{'userId':_0x5e6294[_0x5b1ff5(0x170)],'username':_0x5e6294[_0x5b1ff5(0x176)],'nickname':_0x5e6294[_0x5b1ff5(0x166)],'matchedBy':_0x5e6294['matchedBy']}},'message':'Resolved\x20\x22'+_0x387d8e+_0x5b1ff5(0x172)+_0x5e6294['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;