@lovrabet/rabetbase-cli 2.4.5 → 2.4.6-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/README.md +3 -2
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/business-groups.js +1 -1
  63. package/lib/commands/dataset/capability.js +1 -1
  64. package/lib/commands/dataset/delete.js +1 -1
  65. package/lib/commands/dataset/detail.js +1 -1
  66. package/lib/commands/dataset/extend-update.js +1 -1
  67. package/lib/commands/dataset/field-update.js +1 -1
  68. package/lib/commands/dataset/generate.js +1 -1
  69. package/lib/commands/dataset/index.js +1 -1
  70. package/lib/commands/dataset/list.js +1 -1
  71. package/lib/commands/dataset/operations.js +1 -1
  72. package/lib/commands/dataset/relation-audit.js +1 -1
  73. package/lib/commands/dataset/relation-create.js +1 -1
  74. package/lib/commands/dataset/relation-delete.js +1 -1
  75. package/lib/commands/dataset/relation-shared.js +1 -1
  76. package/lib/commands/dataset/relation-update.js +1 -1
  77. package/lib/commands/dataset/relations.js +1 -1
  78. package/lib/commands/dataset/rename.js +1 -1
  79. package/lib/commands/dataset/restore.js +1 -1
  80. package/lib/commands/db/analysis-batching.js +1 -1
  81. package/lib/commands/db/analyze-batch-plan.js +1 -1
  82. package/lib/commands/db/analyze-cancel.js +1 -1
  83. package/lib/commands/db/analyze-start.js +1 -1
  84. package/lib/commands/db/analyze-status.js +1 -1
  85. package/lib/commands/db/create.js +1 -1
  86. package/lib/commands/db/delete.js +1 -1
  87. package/lib/commands/db/detail.js +1 -1
  88. package/lib/commands/db/diff-refresh-start.js +1 -1
  89. package/lib/commands/db/diff-refresh-status.js +1 -1
  90. package/lib/commands/db/diff.js +1 -1
  91. package/lib/commands/db/index.js +1 -1
  92. package/lib/commands/db/list.js +1 -1
  93. package/lib/commands/db/shared.js +1 -1
  94. package/lib/commands/db/tables.js +1 -1
  95. package/lib/commands/db/test.js +1 -1
  96. package/lib/commands/db/update.js +1 -1
  97. package/lib/commands/doctor.js +1 -1
  98. package/lib/commands/file/index.js +1 -1
  99. package/lib/commands/init/index.js +1 -1
  100. package/lib/commands/issue/index.js +1 -1
  101. package/lib/commands/issue/nudge.js +1 -1
  102. package/lib/commands/issue/report.js +1 -1
  103. package/lib/commands/issue/shared.js +1 -1
  104. package/lib/commands/kb/create.js +1 -1
  105. package/lib/commands/kb/delete.js +1 -1
  106. package/lib/commands/kb/detail.js +1 -1
  107. package/lib/commands/kb/index.js +1 -1
  108. package/lib/commands/kb/list.js +1 -1
  109. package/lib/commands/kb/shared.js +1 -1
  110. package/lib/commands/kb/update.js +1 -1
  111. package/lib/commands/logs/index.js +1 -1
  112. package/lib/commands/menu/asset-update.js +1 -1
  113. package/lib/commands/menu/delete.js +1 -1
  114. package/lib/commands/menu/external-link-create.js +1 -1
  115. package/lib/commands/menu/external-link-update.js +1 -1
  116. package/lib/commands/menu/group-create.js +1 -1
  117. package/lib/commands/menu/group-update.js +1 -1
  118. package/lib/commands/menu/index.js +1 -1
  119. package/lib/commands/menu/list.js +1 -1
  120. package/lib/commands/menu/move.js +1 -1
  121. package/lib/commands/menu/regroup-start.js +1 -1
  122. package/lib/commands/menu/rename.js +1 -1
  123. package/lib/commands/menu/shared/compare-table.js +1 -1
  124. package/lib/commands/menu/shared/delete-plan.js +1 -1
  125. package/lib/commands/menu/shared/facts.js +1 -1
  126. package/lib/commands/menu/shared/index.js +1 -1
  127. package/lib/commands/menu/shared/inquirer.js +1 -1
  128. package/lib/commands/menu/shared/local-pages.js +1 -1
  129. package/lib/commands/menu/shared/logic.js +1 -1
  130. package/lib/commands/menu/shared/mutations.d.ts +8 -7
  131. package/lib/commands/menu/shared/mutations.js +1 -1
  132. package/lib/commands/menu/shared/service.js +1 -1
  133. package/lib/commands/menu/shared/sync-core.js +1 -1
  134. package/lib/commands/menu/shared/types.d.ts +17 -2
  135. package/lib/commands/menu/shared/update-core.js +1 -1
  136. package/lib/commands/menu/shared/valid-url.js +1 -1
  137. package/lib/commands/menu/sync.js +1 -1
  138. package/lib/commands/{page/standard-page-status.d.ts → menu/visibility-update.d.ts} +1 -1
  139. package/lib/commands/menu/visibility-update.js +1 -0
  140. package/lib/commands/notification/config-create.js +1 -1
  141. package/lib/commands/notification/config-delete.js +1 -1
  142. package/lib/commands/notification/config-list.js +1 -1
  143. package/lib/commands/notification/config-update.js +1 -1
  144. package/lib/commands/notification/index.js +1 -1
  145. package/lib/commands/notification/shared.js +1 -1
  146. package/lib/commands/ocr/index.js +1 -1
  147. package/lib/commands/page/create.d.ts +2 -0
  148. package/lib/commands/page/create.js +1 -0
  149. package/lib/commands/page/{react → custom}/detail.d.ts +1 -1
  150. package/lib/commands/page/custom/detail.js +1 -0
  151. package/lib/commands/page/{react → custom}/list.d.ts +1 -1
  152. package/lib/commands/page/custom/list.js +1 -0
  153. package/lib/commands/page/{react → custom}/publish.d.ts +1 -1
  154. package/lib/commands/page/custom/publish.js +1 -0
  155. package/lib/commands/page/{react → custom}/shared.d.ts +15 -15
  156. package/lib/commands/page/custom/shared.js +1 -0
  157. package/lib/commands/page/{react → custom}/syntax.d.ts +2 -2
  158. package/lib/commands/page/custom/syntax.js +1 -0
  159. package/lib/commands/page/custom/template.js +1 -0
  160. package/lib/commands/page/{react → custom}/update.d.ts +1 -1
  161. package/lib/commands/page/custom/update.js +1 -0
  162. package/lib/commands/page/data-list-status.d.ts +2 -0
  163. package/lib/commands/page/data-list-status.js +1 -0
  164. package/lib/commands/page/generate-start.js +1 -1
  165. package/lib/commands/page/generate-status.js +1 -1
  166. package/lib/commands/page/index.js +1 -1
  167. package/lib/commands/page/pull.js +1 -1
  168. package/lib/commands/page/push.js +1 -1
  169. package/lib/commands/page/relation-audit.js +1 -1
  170. package/lib/commands/page/restore.js +1 -1
  171. package/lib/commands/page/shared.d.ts +18 -18
  172. package/lib/commands/page/shared.js +1 -1
  173. package/lib/commands/page/sync.js +1 -1
  174. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  175. package/lib/commands/project/create/format-elapsed.js +1 -1
  176. package/lib/commands/project/create/main.js +1 -1
  177. package/lib/commands/project/create/materialize-project-template.js +1 -1
  178. package/lib/commands/project/create/project-name.js +1 -1
  179. package/lib/commands/project/create/project-template-archive.js +1 -1
  180. package/lib/commands/project/create/project-template-path.js +1 -1
  181. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  182. package/lib/commands/project/create/use-format-code.js +1 -1
  183. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  184. package/lib/commands/project/index.js +1 -1
  185. package/lib/commands/project/upgrade.js +1 -1
  186. package/lib/commands/registry.js +1 -1
  187. package/lib/commands/role/delete.js +1 -1
  188. package/lib/commands/role/detail.js +1 -1
  189. package/lib/commands/role/index.js +1 -1
  190. package/lib/commands/role/list.js +1 -1
  191. package/lib/commands/role/shared.js +1 -1
  192. package/lib/commands/role/update.js +1 -1
  193. package/lib/commands/role/user-add.js +1 -1
  194. package/lib/commands/role/user-remove.js +1 -1
  195. package/lib/commands/role/user-resolve.js +1 -1
  196. package/lib/commands/run/index.js +1 -1
  197. package/lib/commands/schema.js +1 -1
  198. package/lib/commands/sql/create.js +1 -1
  199. package/lib/commands/sql/delete.js +1 -1
  200. package/lib/commands/sql/detail.js +1 -1
  201. package/lib/commands/sql/exec.js +1 -1
  202. package/lib/commands/sql/index.js +1 -1
  203. package/lib/commands/sql/list.js +1 -1
  204. package/lib/commands/sql/pull.js +1 -1
  205. package/lib/commands/sql/push.js +1 -1
  206. package/lib/commands/sql/shared.js +1 -1
  207. package/lib/commands/sql/status.js +1 -1
  208. package/lib/commands/sql/validate.js +1 -1
  209. package/lib/commands/task/index.js +1 -1
  210. package/lib/commands/task/status.js +1 -1
  211. package/lib/commands/tenant/index.js +1 -1
  212. package/lib/commands/tenant/members-list.js +1 -1
  213. package/lib/commands/tenant/shared.js +1 -1
  214. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  215. package/lib/commands/user-account/index.js +1 -1
  216. package/lib/commands/workspace/add.js +1 -1
  217. package/lib/commands/workspace/index.js +1 -1
  218. package/lib/commands/workspace/remove.js +1 -1
  219. package/lib/config/schema.js +1 -1
  220. package/lib/constant/cdn.js +1 -1
  221. package/lib/constant/cli.js +1 -1
  222. package/lib/constant/defaults.js +1 -1
  223. package/lib/constant/domain.js +1 -1
  224. package/lib/constant/env.js +1 -1
  225. package/lib/constant/output.js +1 -1
  226. package/lib/constant/paths.js +1 -1
  227. package/lib/constant/risk.js +1 -1
  228. package/lib/context/app-resolver.js +1 -1
  229. package/lib/context/auth-resolver.js +1 -1
  230. package/lib/context/config-loader.js +1 -1
  231. package/lib/context.js +1 -1
  232. package/lib/core/alias-resolver.js +1 -1
  233. package/lib/core/api-client.d.ts +43 -43
  234. package/lib/core/api-client.js +1 -1
  235. package/lib/core/bff/config.js +1 -1
  236. package/lib/core/bff/file-system.js +1 -1
  237. package/lib/core/bff/hash.js +1 -1
  238. package/lib/core/bff/lock.js +1 -1
  239. package/lib/core/bff/utils.d.ts +3 -1
  240. package/lib/core/bff/utils.js +1 -1
  241. package/lib/core/db-resolver.js +1 -1
  242. package/lib/core/page/file-system.js +1 -1
  243. package/lib/core/page/hash.js +1 -1
  244. package/lib/core/page/lock.js +1 -1
  245. package/lib/core/sql-index-auditor.js +1 -1
  246. package/lib/core/sql-sync/config.js +1 -1
  247. package/lib/core/sql-sync/file-system.js +1 -1
  248. package/lib/core/sql-sync/hash.js +1 -1
  249. package/lib/core/sql-sync/lock.js +1 -1
  250. package/lib/core/sql-sync/utils.js +1 -1
  251. package/lib/core/sql-validator.js +1 -1
  252. package/lib/errors.js +1 -1
  253. package/lib/framework/build-all-flags.js +1 -1
  254. package/lib/framework/error-output.js +1 -1
  255. package/lib/framework/explicit-yes.js +1 -1
  256. package/lib/framework/flags.js +1 -1
  257. package/lib/framework/help.js +1 -1
  258. package/lib/framework/index.js +1 -1
  259. package/lib/framework/output.js +1 -1
  260. package/lib/framework/response.js +1 -1
  261. package/lib/framework/runner-alias.js +1 -1
  262. package/lib/framework/runner.js +1 -1
  263. package/lib/framework/schema-export.js +1 -1
  264. package/lib/framework/types.js +1 -1
  265. package/lib/generated/build-info.d.ts +4 -4
  266. package/lib/generated/build-info.js +1 -1
  267. package/lib/help.js +1 -1
  268. package/lib/postinstall.js +1 -1
  269. package/lib/runtime/confirmation.js +1 -1
  270. package/lib/runtime/event.js +1 -1
  271. package/lib/runtime/index.js +1 -1
  272. package/lib/runtime/queue.js +1 -1
  273. package/lib/runtime/resolve.js +1 -1
  274. package/lib/skills/builtin-skill.js +1 -1
  275. package/lib/skills/main.js +1 -1
  276. package/lib/skills/npx-skills-add.js +1 -1
  277. package/lib/skills/skill-presence.js +1 -1
  278. package/lib/telemetry/cli-command-trace.js +1 -1
  279. package/lib/telemetry/cli-help-trace.js +1 -1
  280. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  281. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  282. package/lib/telemetry/send-cli-trace-log.js +1 -1
  283. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  284. package/lib/utils/ai_config.js +1 -1
  285. package/lib/utils/apply-jq-filter.js +1 -1
  286. package/lib/utils/cdn-config.js +1 -1
  287. package/lib/utils/check-sdk-version.js +1 -1
  288. package/lib/utils/cli-version-check.js +1 -1
  289. package/lib/utils/cli-version-policy.js +1 -1
  290. package/lib/utils/config.js +1 -1
  291. package/lib/utils/entity-with-id.js +1 -1
  292. package/lib/utils/file-utils.js +1 -1
  293. package/lib/utils/guides-cdn.js +1 -1
  294. package/lib/utils/http-client.js +1 -1
  295. package/lib/utils/is-non-interactive.js +1 -1
  296. package/lib/utils/logger.js +1 -1
  297. package/lib/utils/params.js +1 -1
  298. package/lib/utils/platform.js +1 -1
  299. package/lib/utils/rules-cdn.js +1 -1
  300. package/lib/utils/sleep.js +1 -1
  301. package/lib/utils/template-replacer.js +1 -1
  302. package/lib/utils/update-notice.js +1 -1
  303. package/lib/utils/version.js +1 -1
  304. package/lib/utils/with-active-cookie.js +1 -1
  305. package/lib/utils/write-cli-side-channel.js +1 -1
  306. package/package.json +1 -1
  307. package/skills/rabetbase/SKILL.md +35 -34
  308. package/skills/rabetbase/guides/backend-function.md +63 -18
  309. package/skills/rabetbase/guides/bff-creation-workflow.md +2 -0
  310. package/skills/rabetbase/guides/{react-custom-page-workflow.md → custom-page-workflow.md} +45 -45
  311. package/skills/rabetbase/guides/page-development-workflow.md +22 -22
  312. package/skills/rabetbase/knowledge/{react-page → custom-page}/components.md +2 -2
  313. package/skills/rabetbase/knowledge/{react-page → custom-page}/generation-standards.md +6 -6
  314. package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +6 -6
  315. package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +1 -1
  316. package/skills/rabetbase/references/rabetbase-bff-create.md +2 -0
  317. package/skills/rabetbase/references/{rabetbase-standard-page-status.md → rabetbase-data-list-status.md} +6 -6
  318. package/skills/rabetbase/references/rabetbase-dataset-generate.md +1 -1
  319. package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +1 -1
  320. package/skills/rabetbase/references/rabetbase-dataset-relations.md +1 -1
  321. package/skills/rabetbase/references/rabetbase-dataset-restore.md +1 -1
  322. package/skills/rabetbase/references/rabetbase-menu-list.md +4 -2
  323. package/skills/rabetbase/references/rabetbase-menu-visibility-update.md +59 -0
  324. package/skills/rabetbase/references/rabetbase-page-create.md +31 -0
  325. package/skills/rabetbase/references/{rabetbase-page-react-detail.md → rabetbase-page-custom-detail.md} +5 -5
  326. package/skills/rabetbase/references/{rabetbase-page-react-list.md → rabetbase-page-custom-list.md} +4 -4
  327. package/skills/rabetbase/references/{rabetbase-page-react-publish.md → rabetbase-page-custom-publish.md} +6 -6
  328. package/skills/rabetbase/references/{rabetbase-page-react-update.md → rabetbase-page-custom-update.md} +6 -6
  329. package/skills/rabetbase/references/rabetbase-page-generate-start.md +5 -4
  330. package/skills/rabetbase/references/rabetbase-page-generate-status.md +4 -4
  331. package/skills/rabetbase/references/rabetbase-page-pull.md +2 -2
  332. package/skills/rabetbase/references/rabetbase-page-relation-binding.md +1 -1
  333. package/skills/rabetbase/references/rabetbase-page-restore.md +7 -7
  334. package/skills/rabetbase/references/rabetbase-page-sync.md +3 -3
  335. package/skills/rabetbase.manifest.json +13 -12
  336. package/lib/commands/page/react/create.d.ts +0 -2
  337. package/lib/commands/page/react/create.js +0 -1
  338. package/lib/commands/page/react/detail.js +0 -1
  339. package/lib/commands/page/react/list.js +0 -1
  340. package/lib/commands/page/react/publish.js +0 -1
  341. package/lib/commands/page/react/shared.js +0 -1
  342. package/lib/commands/page/react/syntax.js +0 -1
  343. package/lib/commands/page/react/template.js +0 -1
  344. package/lib/commands/page/react/update.js +0 -1
  345. package/lib/commands/page/standard-page-status.js +0 -1
  346. package/skills/rabetbase/references/rabetbase-page-react-create.md +0 -29
  347. /package/lib/commands/page/{react → custom}/template.d.ts +0 -0
@@ -1 +1 @@
1
- const a173_0x22ac7a=a173_0x4cac;function a173_0x4cac(_0x18ed13,_0x1224a0){_0x18ed13=_0x18ed13-0xc9;const _0x43832e=a173_0x4383();let _0x4cac30=_0x43832e[_0x18ed13];return _0x4cac30;}function a173_0x4383(){const _0x2cbaf3=['4478301BBGuiV','appCode','delete','dev','Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','2761608mTqYhs','104DmpFSN','5zcWLld','106974lgdIWz','33qdZPUw','Role\x20still\x20has\x20','userCount','78172SpKRXX','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','42MJTfah','/smartapi/permit/role/delete','\x20(id=','1584318ibitDA','role','num','8143356PQhEwX','1XKdegZ','high-risk-write','POST','5842740mbFKBz'];a173_0x4383=function(){return _0x2cbaf3;};return a173_0x4383();}(function(_0x3ef10a,_0x4d9b09){const _0x270c71=a173_0x4cac,_0x412b18=_0x3ef10a();while(!![]){try{const _0x1eda40=-parseInt(_0x270c71(0xde))/0x1*(parseInt(_0x270c71(0xce))/0x2)+-parseInt(_0x270c71(0xd7))/0x3*(parseInt(_0x270c71(0xd5))/0x4)+-parseInt(_0x270c71(0xd0))/0x5*(-parseInt(_0x270c71(0xda))/0x6)+-parseInt(_0x270c71(0xd1))/0x7*(-parseInt(_0x270c71(0xcf))/0x8)+parseInt(_0x270c71(0xc9))/0x9+-parseInt(_0x270c71(0xe1))/0xa+-parseInt(_0x270c71(0xd2))/0xb*(-parseInt(_0x270c71(0xdd))/0xc);if(_0x1eda40===_0x4d9b09)break;else _0x412b18['push'](_0x412b18['shift']());}catch(_0x5c0bbe){_0x412b18['push'](_0x412b18['shift']());}}}(a173_0x4383,0xb8edb));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a173_0x22ac7a(0xd8);export const roleDelete={'service':a173_0x22ac7a(0xdb),'command':a173_0x22ac7a(0xcb),'description':a173_0x22ac7a(0xcd),'risk':a173_0x22ac7a(0xdf),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x19ec4e){const _0x3593f5=a173_0x22ac7a,_0x3c7471=_0x19ec4e[_0x3593f5(0xdc)]('id'),_0x5d1870=await getRoleById(_0x19ec4e[_0x3593f5(0xca)],_0x3c7471);return assertCustomRole(_0x5d1870,'delete'),asDryRunResult({'scope':_0x3593f5(0xcc),'operation':_0x3593f5(0xcb),'selector':{'appCode':_0x19ec4e['appCode'],'roleId':_0x3c7471,'roleName':_0x5d1870['roleName']},'before':projectRole(_0x5d1870),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x5d1870[_0x3593f5(0xd4)]>0x0?[_0x3593f5(0xd3)+_0x5d1870['userCount']+_0x3593f5(0xd6)]:[]},{'method':_0x3593f5(0xe0),'url':DELETE_PATH});},async 'execute'(_0x2e31df){const _0x25422b=a173_0x22ac7a,_0x2f181d=_0x2e31df['num']('id'),_0x58376b=await getRoleById(_0x2e31df[_0x25422b(0xca)],_0x2f181d);return assertCustomRole(_0x58376b,_0x25422b(0xcb)),await deleteAppRole(_0x2f181d),{'ok':!![],'data':{'scope':_0x25422b(0xcc),'operation':_0x25422b(0xcb),'selector':{'appCode':_0x2e31df[_0x25422b(0xca)],'roleId':_0x2f181d,'roleName':_0x58376b['roleName']},'before':projectRole(_0x58376b),'after':null,'dryRun':![],'backend':{'method':_0x25422b(0xe0),'path':DELETE_PATH},'warnings':[]},'message':'Deleted\x20role\x20'+_0x58376b['roleName']+_0x25422b(0xd9)+_0x2f181d+')'};}};
1
+ function a174_0x12b3(_0x4ab613,_0x2bfa3f){_0x4ab613=_0x4ab613-0x141;const _0x5aec98=a174_0x5aec();let _0x12b3b5=_0x5aec98[_0x4ab613];return _0x12b3b5;}const a174_0x127d71=a174_0x12b3;(function(_0x489019,_0x1ca096){const _0x27df07=a174_0x12b3,_0x40cfef=_0x489019();while(!![]){try{const _0x29c583=-parseInt(_0x27df07(0x154))/0x1*(parseInt(_0x27df07(0x146))/0x2)+parseInt(_0x27df07(0x14d))/0x3*(parseInt(_0x27df07(0x14e))/0x4)+-parseInt(_0x27df07(0x145))/0x5+parseInt(_0x27df07(0x153))/0x6+parseInt(_0x27df07(0x152))/0x7+parseInt(_0x27df07(0x14b))/0x8*(-parseInt(_0x27df07(0x150))/0x9)+parseInt(_0x27df07(0x14f))/0xa*(parseInt(_0x27df07(0x141))/0xb);if(_0x29c583===_0x1ca096)break;else _0x40cfef['push'](_0x40cfef['shift']());}catch(_0x26faf9){_0x40cfef['push'](_0x40cfef['shift']());}}}(a174_0x5aec,0x78816));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a174_0x127d71(0x149);export const roleDelete={'service':'role','command':a174_0x127d71(0x151),'description':'Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3ca3e2){const _0x4b7b76=a174_0x127d71,_0x330f53=_0x3ca3e2[_0x4b7b76(0x143)]('id'),_0x59b963=await getRoleById(_0x3ca3e2[_0x4b7b76(0x148)],_0x330f53);return assertCustomRole(_0x59b963,'delete'),asDryRunResult({'scope':'dev','operation':_0x4b7b76(0x151),'selector':{'appCode':_0x3ca3e2[_0x4b7b76(0x148)],'roleId':_0x330f53,'roleName':_0x59b963[_0x4b7b76(0x155)]},'before':projectRole(_0x59b963),'after':null,'dryRun':!![],'backend':{'method':_0x4b7b76(0x147),'path':DELETE_PATH},'warnings':_0x59b963[_0x4b7b76(0x14a)]>0x0?['Role\x20still\x20has\x20'+_0x59b963['userCount']+'\x20member(s);\x20they\x20will\x20lose\x20this\x20group.']:[]},{'method':_0x4b7b76(0x147),'url':DELETE_PATH});},async 'execute'(_0x5f0fca){const _0x10f3a4=a174_0x127d71,_0x3d746d=_0x5f0fca[_0x10f3a4(0x143)]('id'),_0xcfa95d=await getRoleById(_0x5f0fca[_0x10f3a4(0x148)],_0x3d746d);return assertCustomRole(_0xcfa95d,'delete'),await deleteAppRole(_0x3d746d),{'ok':!![],'data':{'scope':_0x10f3a4(0x14c),'operation':_0x10f3a4(0x151),'selector':{'appCode':_0x5f0fca[_0x10f3a4(0x148)],'roleId':_0x3d746d,'roleName':_0xcfa95d[_0x10f3a4(0x155)]},'before':projectRole(_0xcfa95d),'after':null,'dryRun':![],'backend':{'method':_0x10f3a4(0x147),'path':DELETE_PATH},'warnings':[]},'message':_0x10f3a4(0x144)+_0xcfa95d[_0x10f3a4(0x155)]+_0x10f3a4(0x142)+_0x3d746d+')'};}};function a174_0x5aec(){const _0x375df5=['roleName','18691299nxAgqc','\x20(id=','num','Deleted\x20role\x20','4376760aLpoHM','14qBZIkd','POST','appCode','/smartapi/permit/role/delete','userCount','42808ZaaIBk','dev','18456JADBZP','40oWMjMn','10hqUirL','657vQXrIF','delete','1901515VyWFWY','3427422cZCrrm','120578nWAWZP'];a174_0x5aec=function(){return _0x375df5;};return a174_0x5aec();}
@@ -1 +1 @@
1
- function a174_0x1eaf(){const _0x4e8a0b=['16iHqqxM','Show\x20a\x20single\x20role\x27s\x20detail','appCode','detail','3XBxaqm','4489716eWcHHx','1530135fsOALr','451010dxLaNo','roleName','442498LwhFht','628108jKoAcj','1385ZBVPFg','num','22RjEqHn','9993RMbOGs','roleType','role','Role\x20','4566XjbAFs'];a174_0x1eaf=function(){return _0x4e8a0b;};return a174_0x1eaf();}const a174_0x36f176=a174_0x2614;(function(_0x555d66,_0x2928ec){const _0x372dc3=a174_0x2614,_0x46d653=_0x555d66();while(!![]){try{const _0x275d66=parseInt(_0x372dc3(0x140))/0x1*(parseInt(_0x372dc3(0x13f))/0x2)+-parseInt(_0x372dc3(0x149))/0x3*(parseInt(_0x372dc3(0x13c))/0x4)+parseInt(_0x372dc3(0x13d))/0x5*(-parseInt(_0x372dc3(0x144))/0x6)+parseInt(_0x372dc3(0x13b))/0x7*(-parseInt(_0x372dc3(0x145))/0x8)+parseInt(_0x372dc3(0x138))/0x9+-parseInt(_0x372dc3(0x139))/0xa+parseInt(_0x372dc3(0x14a))/0xb;if(_0x275d66===_0x2928ec)break;else _0x46d653['push'](_0x46d653['shift']());}catch(_0x3aea45){_0x46d653['push'](_0x46d653['shift']());}}}(a174_0x1eaf,0x24505));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a174_0x2614(_0x2533f3,_0x206aad){_0x2533f3=_0x2533f3-0x138;const _0x1eafa7=a174_0x1eaf();let _0x2614ef=_0x1eafa7[_0x2533f3];return _0x2614ef;}export const roleDetail={'service':a174_0x36f176(0x142),'command':a174_0x36f176(0x148),'description':a174_0x36f176(0x146),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x12dc49){const _0x2a2f07=a174_0x36f176,_0x437237=_0x12dc49[_0x2a2f07(0x13e)]('id'),_0x378f51=await getRoleById(_0x12dc49[_0x2a2f07(0x147)],_0x437237);return{'ok':!![],'data':{'scope':'dev','role':projectRole(_0x378f51)},'message':_0x2a2f07(0x143)+_0x378f51[_0x2a2f07(0x13a)]+'\x20('+_0x378f51[_0x2a2f07(0x141)]+')'};}};
1
+ const a175_0x483d16=a175_0x1e57;(function(_0x5aaa5e,_0x352137){const _0x4982c6=a175_0x1e57,_0x4979dc=_0x5aaa5e();while(!![]){try{const _0x1ccae7=-parseInt(_0x4982c6(0x155))/0x1*(-parseInt(_0x4982c6(0x154))/0x2)+parseInt(_0x4982c6(0x14a))/0x3+-parseInt(_0x4982c6(0x153))/0x4+-parseInt(_0x4982c6(0x14f))/0x5*(-parseInt(_0x4982c6(0x149))/0x6)+-parseInt(_0x4982c6(0x156))/0x7*(-parseInt(_0x4982c6(0x14e))/0x8)+-parseInt(_0x4982c6(0x14b))/0x9*(-parseInt(_0x4982c6(0x148))/0xa)+parseInt(_0x4982c6(0x151))/0xb*(-parseInt(_0x4982c6(0x14c))/0xc);if(_0x1ccae7===_0x352137)break;else _0x4979dc['push'](_0x4979dc['shift']());}catch(_0x52bfd4){_0x4979dc['push'](_0x4979dc['shift']());}}}(a175_0x5cd5,0xdbca2));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a175_0x1e57(_0x9f6bda,_0x28395b){_0x9f6bda=_0x9f6bda-0x148;const _0x5cd51d=a175_0x5cd5();let _0x1e574d=_0x5cd51d[_0x9f6bda];return _0x1e574d;}function a175_0x5cd5(){const _0x50c780=['4443112xvJAYS','122jBFwhe','2340zYUprj','1239ILNGpy','read','40hLMFkH','127926qNYvyR','4844862qKPXCy','1015587hsFtPs','324yHlHmi','Show\x20a\x20single\x20role\x27s\x20detail','70352EjZnuG','225AuZKyy','detail','1105709SfOYmM','dev'];a175_0x5cd5=function(){return _0x50c780;};return a175_0x5cd5();}export const roleDetail={'service':'role','command':a175_0x483d16(0x150),'description':a175_0x483d16(0x14d),'risk':a175_0x483d16(0x157),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x38c630){const _0x2f968a=a175_0x483d16,_0x18d8ee=_0x38c630['num']('id'),_0x481ea8=await getRoleById(_0x38c630['appCode'],_0x18d8ee);return{'ok':!![],'data':{'scope':_0x2f968a(0x152),'role':projectRole(_0x481ea8)},'message':'Role\x20'+_0x481ea8['roleName']+'\x20('+_0x481ea8['roleType']+')'};}};
@@ -1 +1 @@
1
- function a175_0x2c18(){const _0x3378b6=['96iQxyno','2023796TDqyXC','17906RrpIhO','993792QQAuTg','1767423QiYNjA','3507120zGGLCT','2256282rEhPkl','2202ZWRMjg','997695yVEVon'];a175_0x2c18=function(){return _0x3378b6;};return a175_0x2c18();}(function(_0x1cfd5f,_0x19064e){const _0x2a285c=a175_0x4963,_0x2b86f6=_0x1cfd5f();while(!![]){try{const _0x151e66=parseInt(_0x2a285c(0x1da))/0x1+-parseInt(_0x2a285c(0x1d3))/0x2+-parseInt(_0x2a285c(0x1d6))/0x3+-parseInt(_0x2a285c(0x1d5))/0x4+-parseInt(_0x2a285c(0x1d7))/0x5+parseInt(_0x2a285c(0x1d9))/0x6*(-parseInt(_0x2a285c(0x1d4))/0x7)+-parseInt(_0x2a285c(0x1db))/0x8*(-parseInt(_0x2a285c(0x1d8))/0x9);if(_0x151e66===_0x19064e)break;else _0x2b86f6['push'](_0x2b86f6['shift']());}catch(_0x4942ad){_0x2b86f6['push'](_0x2b86f6['shift']());}}}(a175_0x2c18,0x7e116));import{roleList}from'../../commands/role/list.js';function a175_0x4963(_0x11556f,_0x3197b9){_0x11556f=_0x11556f-0x1d3;const _0x2c1841=a175_0x2c18();let _0x496355=_0x2c1841[_0x11556f];return _0x496355;}import{roleDetail}from'../../commands/role/detail.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,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0x4bdb48,_0x373640){const _0x3468f3=a176_0x130a,_0x9955d1=_0x4bdb48();while(!![]){try{const _0x198c5b=-parseInt(_0x3468f3(0x199))/0x1+parseInt(_0x3468f3(0x192))/0x2*(parseInt(_0x3468f3(0x195))/0x3)+parseInt(_0x3468f3(0x194))/0x4*(parseInt(_0x3468f3(0x193))/0x5)+-parseInt(_0x3468f3(0x198))/0x6*(parseInt(_0x3468f3(0x19d))/0x7)+parseInt(_0x3468f3(0x19a))/0x8+-parseInt(_0x3468f3(0x196))/0x9*(parseInt(_0x3468f3(0x19c))/0xa)+-parseInt(_0x3468f3(0x197))/0xb*(-parseInt(_0x3468f3(0x19b))/0xc);if(_0x198c5b===_0x373640)break;else _0x9955d1['push'](_0x9955d1['shift']());}catch(_0x44c9d4){_0x9955d1['push'](_0x9955d1['shift']());}}}(a176_0x4de6,0x92c1a));function a176_0x4de6(){const _0x4d2fe1=['204169hFQRMy','146236yBnboY','237745tlrGTX','24usegsp','39wnzsrq','9iqysXK','22297dJUZdO','102jAabSH','577086spGdAo','3933400qMiaWs','5820CcLlJD','10365590PfZhEx'];a176_0x4de6=function(){return _0x4d2fe1;};return a176_0x4de6();}import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.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';function a176_0x130a(_0x3406eb,_0x111937){_0x3406eb=_0x3406eb-0x192;const _0x4de6c5=a176_0x4de6();let _0x130af4=_0x4de6c5[_0x3406eb];return _0x130af4;}import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- function a176_0x16f6(_0x481e48,_0x5c5701){_0x481e48=_0x481e48-0x1bf;const _0x3e676e=a176_0x3e67();let _0x16f6f7=_0x3e676e[_0x481e48];return _0x16f6f7;}const a176_0x358837=a176_0x16f6;(function(_0x6aaa05,_0x4a8e0c){const _0x222087=a176_0x16f6,_0x2952f8=_0x6aaa05();while(!![]){try{const _0x5ebeb1=parseInt(_0x222087(0x1e0))/0x1*(parseInt(_0x222087(0x1e6))/0x2)+-parseInt(_0x222087(0x1da))/0x3*(parseInt(_0x222087(0x1c1))/0x4)+-parseInt(_0x222087(0x1d9))/0x5+-parseInt(_0x222087(0x1c5))/0x6*(parseInt(_0x222087(0x1c2))/0x7)+parseInt(_0x222087(0x1e2))/0x8*(parseInt(_0x222087(0x1e5))/0x9)+-parseInt(_0x222087(0x1db))/0xa+-parseInt(_0x222087(0x1d7))/0xb*(-parseInt(_0x222087(0x1e4))/0xc);if(_0x5ebeb1===_0x4a8e0c)break;else _0x2952f8['push'](_0x2952f8['shift']());}catch(_0x7e06c0){_0x2952f8['push'](_0x2952f8['shift']());}}}(a176_0x3e67,0xbc542));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=['ADMIN',a176_0x358837(0x1bf),a176_0x358837(0x1d1),a176_0x358837(0x1cd)];export const roleList={'service':a176_0x358837(0x1d2),'command':'list','description':a176_0x358837(0x1cf),'risk':a176_0x358837(0x1c7),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a176_0x358837(0x1dd),'type':'string','required':![],'description':a176_0x358837(0x1d8),'enum':ROLE_TYPES},{'name':a176_0x358837(0x1ca),'type':a176_0x358837(0x1e8),'description':a176_0x358837(0x1c3),'default':0x1},{'name':'pagesize','type':'number','description':a176_0x358837(0x1df),'default':0x64}],async 'validate'(_0x895032){const _0x4fd17=a176_0x358837,_0x5f4fa0=_0x895032[_0x4fd17(0x1d4)](_0x4fd17(0x1dd))['trim']();if(_0x5f4fa0&&!ROLE_TYPES[_0x4fd17(0x1d0)](_0x5f4fa0[_0x4fd17(0x1c6)]()))throw CliErrors[_0x4fd17(0x1e3)](_0x4fd17(0x1e7)+_0x5f4fa0+'\x22.',_0x4fd17(0x1e1)+ROLE_TYPES[_0x4fd17(0x1c0)](',\x20')+'.');const _0x44916a=_0x895032[_0x4fd17(0x1cb)](_0x4fd17(0x1ca),0x1),_0x19d932=_0x895032['num'](_0x4fd17(0x1d6),0x64);if(_0x44916a<0x1)throw CliErrors['validation'](_0x4fd17(0x1de));if(_0x19d932<0x1||_0x19d932>0x64)throw CliErrors[_0x4fd17(0x1e3)](_0x4fd17(0x1cc));},async 'execute'(_0x305d8f){const _0x467689=a176_0x358837,_0x3a906e=_0x305d8f[_0x467689(0x1cb)](_0x467689(0x1ca),0x1)||0x1,_0x36983d=_0x305d8f['num'](_0x467689(0x1d6),0x64)||0x64,_0xc8d77f=_0x305d8f['str'](_0x467689(0x1dd))[_0x467689(0x1c4)]()[_0x467689(0x1c6)](),{items:_0x3111ca,paging:_0x29fba4}=await listAppRoles(_0x305d8f[_0x467689(0x1c8)],{'currentPage':_0x3a906e,'pageSize':_0x36983d}),_0x51c413=_0xc8d77f?_0x3111ca['filter'](_0x26cbdf=>_0x26cbdf[_0x467689(0x1ce)]===_0xc8d77f):_0x3111ca,_0x544005=_0x51c413['map'](projectRole);return{'ok':!![],'data':{'scope':_0x467689(0x1d5),'roles':_0x544005,'paging':_0x29fba4},'message':_0x467689(0x1d3)+_0x544005[_0x467689(0x1c9)]+_0x467689(0x1dc)};}};function a176_0x3e67(){const _0x573890=['type','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','Page\x20size\x20(1-100)','19QEpNkj','Use\x20one\x20of:\x20','433232KWgPhc','validation','60tVAHwD','27AYwMmQ','128920qrIihe','Invalid\x20--type\x20\x22','number','DEV','join','488Uaeqha','8304135YtFVyw','Page\x20index\x20(1-based)','trim','6llwPxI','toUpperCase','read','appCode','length','page','num','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','CUSTOM','roleType','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','includes','OWNER','role','Found\x20','str','dev','pagesize','6100446VpASPi','Filter\x20by\x20role\x20type','3367180QZSEUV','13539yPvWrO','9784110nsoCDT','\x20role(s)'];a176_0x3e67=function(){return _0x573890;};return a176_0x3e67();}
1
+ const a177_0x13a735=a177_0x4149;(function(_0x4070aa,_0x187146){const _0x4a44ff=a177_0x4149,_0x27c31a=_0x4070aa();while(!![]){try{const _0x4d6a5f=-parseInt(_0x4a44ff(0x12a))/0x1*(-parseInt(_0x4a44ff(0x10d))/0x2)+-parseInt(_0x4a44ff(0x12b))/0x3*(parseInt(_0x4a44ff(0x119))/0x4)+parseInt(_0x4a44ff(0x123))/0x5+-parseInt(_0x4a44ff(0x11c))/0x6*(-parseInt(_0x4a44ff(0x120))/0x7)+-parseInt(_0x4a44ff(0x126))/0x8*(-parseInt(_0x4a44ff(0x103))/0x9)+-parseInt(_0x4a44ff(0x116))/0xa*(-parseInt(_0x4a44ff(0x10f))/0xb)+-parseInt(_0x4a44ff(0x114))/0xc;if(_0x4d6a5f===_0x187146)break;else _0x27c31a['push'](_0x27c31a['shift']());}catch(_0x484f6d){_0x27c31a['push'](_0x27c31a['shift']());}}}(a177_0xf591,0x5e281));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a177_0x13a735(0x124),a177_0x13a735(0x121),a177_0x13a735(0x12e),a177_0x13a735(0x11b)];function a177_0x4149(_0x3da624,_0x37eae9){_0x3da624=_0x3da624-0x103;const _0xf591f8=a177_0xf591();let _0x414932=_0xf591f8[_0x3da624];return _0x414932;}export const roleList={'service':a177_0x13a735(0x106),'command':a177_0x13a735(0x117),'description':a177_0x13a735(0x115),'risk':a177_0x13a735(0x128),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a177_0x13a735(0x11a),'type':a177_0x13a735(0x11d),'required':![],'description':a177_0x13a735(0x107),'enum':ROLE_TYPES},{'name':a177_0x13a735(0x12d),'type':a177_0x13a735(0x10c),'description':a177_0x13a735(0x10a),'default':0x1},{'name':a177_0x13a735(0x113),'type':a177_0x13a735(0x10c),'description':a177_0x13a735(0x10e),'default':0x64}],async 'validate'(_0xc9f2f3){const _0x3aba1c=a177_0x13a735,_0x390cec=_0xc9f2f3[_0x3aba1c(0x109)](_0x3aba1c(0x11a))[_0x3aba1c(0x108)]();if(_0x390cec&&!ROLE_TYPES[_0x3aba1c(0x129)](_0x390cec[_0x3aba1c(0x11e)]()))throw CliErrors[_0x3aba1c(0x112)](_0x3aba1c(0x11f)+_0x390cec+'\x22.','Use\x20one\x20of:\x20'+ROLE_TYPES['join'](',\x20')+'.');const _0x52c9a3=_0xc9f2f3[_0x3aba1c(0x111)]('page',0x1),_0x5637c9=_0xc9f2f3['num'](_0x3aba1c(0x113),0x64);if(_0x52c9a3<0x1)throw CliErrors[_0x3aba1c(0x112)](_0x3aba1c(0x118));if(_0x5637c9<0x1||_0x5637c9>0x64)throw CliErrors['validation'](_0x3aba1c(0x125));},async 'execute'(_0x444943){const _0x10195c=a177_0x13a735,_0x1d6bd8=_0x444943[_0x10195c(0x111)](_0x10195c(0x12d),0x1)||0x1,_0x4b7687=_0x444943['num'](_0x10195c(0x113),0x64)||0x64,_0x2dede8=_0x444943[_0x10195c(0x109)](_0x10195c(0x11a))['trim']()[_0x10195c(0x11e)](),{items:_0x2fbe75,paging:_0x303378}=await listAppRoles(_0x444943[_0x10195c(0x12c)],{'currentPage':_0x1d6bd8,'pageSize':_0x4b7687}),_0x796ca5=_0x2dede8?_0x2fbe75['filter'](_0x5c9441=>_0x5c9441[_0x10195c(0x105)]===_0x2dede8):_0x2fbe75,_0x5ed45a=_0x796ca5[_0x10195c(0x10b)](projectRole);return{'ok':!![],'data':{'scope':_0x10195c(0x122),'roles':_0x5ed45a,'paging':_0x303378},'message':_0x10195c(0x127)+_0x5ed45a[_0x10195c(0x110)]+_0x10195c(0x104)};}};function a177_0xf591(){const _0x1acd19=['toUpperCase','Invalid\x20--type\x20\x22','15190epLwju','DEV','dev','209485OJgDyC','ADMIN','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','17152wYTIOt','Found\x20','read','includes','1tJEUWR','109338dGFkiT','appCode','page','OWNER','702bitheH','\x20role(s)','roleType','role','Filter\x20by\x20role\x20type','trim','str','Page\x20index\x20(1-based)','map','number','1039364iHFEEX','Page\x20size\x20(1-100)','11yaBZvt','length','num','validation','pagesize','1049652BzpqFS','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','1234810QINtrA','list','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','64GMxrZY','type','CUSTOM','564DxdqEp','string'];a177_0xf591=function(){return _0x1acd19;};return a177_0xf591();}
@@ -1 +1 @@
1
- const a177_0xa877c=a177_0x3873;(function(_0x41618c,_0x216f64){const _0x1f3cf0=a177_0x3873,_0x301eaa=_0x41618c();while(!![]){try{const _0x4908c9=parseInt(_0x1f3cf0(0x7e))/0x1+-parseInt(_0x1f3cf0(0xb1))/0x2+-parseInt(_0x1f3cf0(0x91))/0x3*(parseInt(_0x1f3cf0(0x90))/0x4)+-parseInt(_0x1f3cf0(0x7b))/0x5*(-parseInt(_0x1f3cf0(0xa8))/0x6)+-parseInt(_0x1f3cf0(0x89))/0x7*(parseInt(_0x1f3cf0(0xae))/0x8)+-parseInt(_0x1f3cf0(0x7f))/0x9+parseInt(_0x1f3cf0(0xa9))/0xa;if(_0x4908c9===_0x216f64)break;else _0x301eaa['push'](_0x301eaa['shift']());}catch(_0x5a90d){_0x301eaa['push'](_0x301eaa['shift']());}}}(a177_0x448f,0xdbed0));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}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':a177_0xa877c(0x8d),'required':!![],'description':a177_0xa877c(0x79)};export const ROLE_REF_FLAG={'name':'role','type':a177_0xa877c(0x80),'required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':a177_0xa877c(0xbf),'type':a177_0xa877c(0x80),'required':!![],'description':a177_0xa877c(0x84)};function a177_0x3873(_0xa594f1,_0x9b6fa8){_0xa594f1=_0xa594f1-0x76;const _0x448f0a=a177_0x448f();let _0x38738b=_0x448f0a[_0xa594f1];return _0x38738b;}export const NAME_FLAG={'name':a177_0xa877c(0x92),'type':a177_0xa877c(0x80),'required':!![],'description':a177_0xa877c(0xbd)};export const USER_NAME_FLAG={'name':a177_0xa877c(0x92),'type':a177_0xa877c(0x80),'required':!![],'description':a177_0xa877c(0xc1)};export const REMARK_FLAG={'name':'remark','type':a177_0xa877c(0x80),'required':![],'description':a177_0xa877c(0x81)};export const EXPECT_USER_COUNT_FLAG={'name':a177_0xa877c(0xba),'type':a177_0xa877c(0x8d),'required':![],'description':a177_0xa877c(0x97)};export const BUILTIN_ROLE_TYPES=[a177_0xa877c(0x7c),a177_0xa877c(0x9b),'OWNER'];export function isBuiltinRole(_0x228db3){const _0x1b3b32=a177_0xa877c;return BUILTIN_ROLE_TYPES[_0x1b3b32(0x98)](_0x228db3);}export function assertCustomRole(_0x55d820,_0x1f338e){const _0x2426b8=a177_0xa877c;if(_0x55d820[_0x2426b8(0x86)]!==_0x2426b8(0xbb))throw CliErrors[_0x2426b8(0x95)]('Cannot\x20'+_0x1f338e+'\x20built-in\x20role\x20'+_0x55d820[_0x2426b8(0xb7)]+'\x20('+_0x55d820[_0x2426b8(0x86)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x360b4f){const _0x36d26f=a177_0xa877c;return{'id':_0x360b4f['id'],'roleName':_0x360b4f['roleName'],'roleType':_0x360b4f[_0x36d26f(0x86)],'remark':_0x360b4f[_0x36d26f(0x7a)],'userCount':_0x360b4f[_0x36d26f(0x8f)],'permitCount':_0x360b4f['permitCount'],'builtin':isBuiltinRole(_0x360b4f[_0x36d26f(0x86)])};}function a177_0x448f(){const _0x47dff9=['name','dev','\x22:\x20','validation','tenant','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','includes','Pass\x20--role\x20<id|name>.','Role\x20name\x20\x22','DEV','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','User\x20','Disambiguate\x20with\x20--user\x20<id>.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','\x20member(s)\x20but\x20role\x20has\x20','join','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Removed\x20','expectUserCount','trim',';\x20no\x20change.','test','414SbwfCc','36764990QZvqJa','totalCount','/smartapi/permit/user-role/create','flagMissing','Role\x20id\x20','4785824ULSuJn','str','flag','1236894hHuUfl','username','No\x20tenant\x20member\x20matches\x20\x22','\x20members\x20of\x20the\x20OWNER\x20role.','filter','role','roleName','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','appCode','expect-user-count','CUSTOM','\x22\x20is\x20ambiguous\x20(ids:\x20','Role\x20name','\x20not\x20found\x20in\x20app\x20','user','push','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','toLowerCase','\x20duplicate\x20memberships\x20for\x20user\x20','map','Role\x20id\x20(from\x20`role\x20list`)','remark','37545IkXxft','ADMIN','nickname','337031VChSSw','5987583iPCLQV','string','Optional\x20role\x20remark/description','Anti-drift\x20check\x20failed:\x20expected\x20','tenant_code','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','userId','roleType','Missing\x20user\x20reference.','length','21flvrVJ','Missing\x20role\x20reference.','Pass\x20--user\x20<id|name>.','authRequired','number','user-add','userCount','2209668qkqVaa','3lsHpxW'];a177_0x448f=function(){return _0x47dff9;};return a177_0x448f();}export async function resolveRoleRef(_0x434023,_0x99ca10){const _0xcd1899=a177_0xa877c,_0x3d75bf=_0x99ca10[_0xcd1899(0xa5)]();if(!_0x3d75bf)throw CliErrors[_0xcd1899(0x95)](_0xcd1899(0x8a),'Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x3d75bf))return getRoleById(_0x434023,Number(_0x3d75bf));const _0x54a421=await listAllAppRoles(_0x434023),_0x39b6d6=_0x54a421[_0xcd1899(0xb5)](_0x35e6c9=>_0x35e6c9[_0xcd1899(0xb7)]===_0x3d75bf);if(_0x39b6d6[_0xcd1899(0x88)]===0x0)throw CliErrors[_0xcd1899(0x95)](_0xcd1899(0x9a)+_0x3d75bf+'\x22\x20not\x20found\x20in\x20app\x20'+_0x434023+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x39b6d6[_0xcd1899(0x88)]>0x1){const _0x19adfa=_0x39b6d6[_0xcd1899(0x78)](_0x1df87d=>_0x1df87d['id'])[_0xcd1899(0xa1)](',\x20');throw CliErrors[_0xcd1899(0x95)](_0xcd1899(0x9a)+_0x3d75bf+_0xcd1899(0xbc)+_0x19adfa+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x39b6d6[0x0];}export async function getRoleById(_0x14a0c2,_0x50c7ca){const _0x35df89=a177_0xa877c,_0x5ce763=await listAllAppRoles(_0x14a0c2),_0x1c9117=_0x5ce763[_0x35df89(0xb5)](_0x1a8a00=>_0x1a8a00['id']===_0x50c7ca&&(!_0x1a8a00[_0x35df89(0xb9)]||_0x1a8a00[_0x35df89(0xb9)]===_0x14a0c2));if(_0x1c9117['length']!==0x1)throw CliErrors['validation'](_0x35df89(0xad)+_0x50c7ca+_0x35df89(0xbe)+_0x14a0c2+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x1c9117[0x0];}async function listAllAppRoles(_0x2a190d){const _0xd9644b=a177_0xa877c,_0x26079a=0x64,_0x37c7aa=[];for(let _0x13a634=0x1;;_0x13a634+=0x1){const {items:_0x317cfe,paging:_0x9bd44b}=await listAppRoles(_0x2a190d,{'currentPage':_0x13a634,'pageSize':_0x26079a});_0x37c7aa[_0xd9644b(0xc0)](..._0x317cfe);if(_0x317cfe[_0xd9644b(0x88)]<_0x26079a||_0x9bd44b&&_0x37c7aa[_0xd9644b(0x88)]>=_0x9bd44b[_0xd9644b(0xaa)])return _0x37c7aa;}}export async function resolveTenantCode(){const _0x5210d2=a177_0xa877c,_0x39f538=await getSessionUserInfo(),_0x2d7414=_0x39f538?.[_0x5210d2(0xbf)]?.[_0x5210d2(0x96)]?.[_0x5210d2(0x83)];if(!_0x2d7414)throw CliErrors[_0x5210d2(0x8c)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x2d7414;}function matchMember(_0x4f7266,_0x5d9c6e){const _0x1e5706=a177_0xa877c,_0x470e84=_0x5d9c6e[_0x1e5706(0xa5)]()['toLowerCase']();return(_0x4f7266[_0x1e5706(0x7d)]??'')[_0x1e5706(0x76)]()===_0x470e84||(_0x4f7266[_0x1e5706(0xb2)]??'')[_0x1e5706(0x76)]()===_0x470e84;}export async function resolveUserRef(_0x39b7b9){const _0x140267=a177_0xa877c,_0x5e2bfa=_0x39b7b9[_0x140267(0xa5)]();if(!_0x5e2bfa)throw CliErrors['validation'](_0x140267(0x87),_0x140267(0x8b));const _0x1120f2=await resolveTenantCode(),_0x45e61c=await getTenantMembers(_0x1120f2);if(/^\d+$/[_0x140267(0xa7)](_0x5e2bfa)){const _0x2e9d35=Number(_0x5e2bfa),_0x5d1f6e=_0x45e61c['find'](_0x11772c=>_0x11772c[_0x140267(0x85)]===_0x2e9d35);return{'userId':_0x2e9d35,'username':_0x5d1f6e?.[_0x140267(0xb2)]??String(_0x2e9d35),'nickname':_0x5d1f6e?.[_0x140267(0x7d)],'matchedBy':'id'};}const _0x5aad98=_0x45e61c['filter'](_0x537241=>matchMember(_0x537241,_0x5e2bfa));if(_0x5aad98['length']===0x0)throw CliErrors[_0x140267(0x95)](_0x140267(0xb3)+_0x5e2bfa+'\x22.',_0x140267(0x9f));if(_0x5aad98['length']>0x1){const _0x3bfcdc=_0x5aad98[_0x140267(0x78)](_0x109420=>(_0x109420[_0x140267(0x7d)]??_0x109420[_0x140267(0xb2)]??'?')+'('+_0x109420['userId']+')')[_0x140267(0xa1)](',\x20');throw CliErrors[_0x140267(0x95)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x5e2bfa+_0x140267(0x94)+_0x3bfcdc+'.',_0x140267(0x9e));}const _0xa13b4f=_0x5aad98[0x0];return{'userId':_0xa13b4f['userId'],'username':_0xa13b4f['username']??String(_0xa13b4f['userId']),'nickname':_0xa13b4f[_0x140267(0x7d)],'matchedBy':_0x140267(0x92)};}export const CREATE_USER_ROLE_PATH=a177_0xa877c(0xab);export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x4cfd84){const _0x457759=a177_0xa877c,{operation:_0x55b95b,appCode:_0xa72d95,role:_0x320083,relations:_0x5338d4,user:_0x3437f1}=_0x4cfd84,_0x22ddb2=[...new Set(_0x5338d4[_0x457759(0x78)](_0x274977=>_0x274977[_0x457759(0x85)]))],_0x185e59=[];if(_0x4cfd84['expectUserCount']!==undefined&&_0x4cfd84['expectUserCount']!==_0x22ddb2[_0x457759(0x88)])throw CliErrors[_0x457759(0x95)](_0x457759(0x82)+_0x4cfd84[_0x457759(0xa4)]+_0x457759(0xa0)+_0x22ddb2[_0x457759(0x88)]+'.',_0x457759(0x9c));const _0x40c60d=_0x22ddb2['includes'](_0x3437f1[_0x457759(0x85)]),_0x45f510=_0x5338d4[_0x457759(0xb5)](_0x2fbd4b=>_0x2fbd4b[_0x457759(0x85)]===_0x3437f1['userId'])['map'](_0x19a978=>_0x19a978['id']),_0xdbbc4d=_0x55b95b===_0x457759(0x8e)?!_0x40c60d:_0x40c60d;let _0x4648cb=_0x22ddb2;_0x55b95b==='user-add'?_0x40c60d?_0x185e59['push'](_0x457759(0x9d)+_0x3437f1['userId']+_0x457759(0xa2)+_0x320083[_0x457759(0xb7)]+_0x457759(0xa6)):_0x4648cb=[..._0x22ddb2,_0x3437f1['userId']]:!_0x40c60d?_0x185e59[_0x457759(0xc0)](_0x457759(0x9d)+_0x3437f1[_0x457759(0x85)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x320083['roleName']+_0x457759(0xa6)):(_0x4648cb=_0x22ddb2[_0x457759(0xb5)](_0x1d1c53=>_0x1d1c53!==_0x3437f1[_0x457759(0x85)]),_0x45f510[_0x457759(0x88)]>0x1&&_0x185e59[_0x457759(0xc0)](_0x457759(0xa3)+_0x45f510[_0x457759(0x88)]+_0x457759(0x77)+_0x3437f1[_0x457759(0x85)]+'.'));const _0xc35c7c={'scope':_0x457759(0x93),'operation':_0x55b95b,'selector':{'appCode':_0xa72d95,'roleId':_0x320083['id'],'roleName':_0x320083['roleName'],'userId':_0x3437f1[_0x457759(0x85)]},'before':{'userIds':_0x22ddb2},'after':{'userIds':_0x4648cb},'dryRun':_0x4cfd84['dryRun'],'backend':{'method':'POST','path':_0x55b95b==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x185e59};return{'mutation':_0xc35c7c,'changed':_0xdbbc4d,'matchingRelationIds':_0x45f510};}export async function loadDevRoleRelations(_0x377bfd,_0x1a2ba2){const _0x1f9e2e=a177_0xa877c,_0x553428=0x64,_0x28e0a3=[];for(let _0x7e75fd=0x1;;_0x7e75fd+=0x1){const {items:_0x2dcf5d,paging:_0xd215b3}=await listDevUserRoleRelations(_0x377bfd,{'roleId':_0x1a2ba2,'currentPage':_0x7e75fd,'pageSize':_0x553428});_0x28e0a3[_0x1f9e2e(0xc0)](..._0x2dcf5d);if(_0x2dcf5d[_0x1f9e2e(0x88)]<_0x553428||_0xd215b3&&_0x28e0a3[_0x1f9e2e(0x88)]>=_0xd215b3[_0x1f9e2e(0xaa)])return _0x28e0a3;}}export function readRoleRef(_0x37c5e9){const _0x56b8d0=a177_0xa877c,_0x2a18c2=_0x37c5e9[_0x56b8d0(0xaf)](_0x56b8d0(0xb6))[_0x56b8d0(0xa5)]();if(!_0x2a18c2)throw CliErrors[_0x56b8d0(0xac)](_0x56b8d0(0xb6),_0x56b8d0(0x99));return _0x2a18c2;}export async function prepareUserMutation(_0x413950,_0x12bf6f,_0x1fd54c){const _0x13b85a=a177_0xa877c,_0x1014ca=readRoleRef(_0x413950),_0xff3a25=_0x413950[_0x13b85a(0xaf)](_0x13b85a(0xbf))['trim']();if(!_0xff3a25)throw CliErrors[_0x13b85a(0xac)](_0x13b85a(0xbf),_0x13b85a(0x8b));const _0x41f452=_0x413950[_0x13b85a(0xb0)](_0x13b85a(0xba)),_0x4dc20b=_0x41f452===undefined||_0x41f452===null?undefined:Number(_0x41f452),_0x9b0dc9=await resolveRoleRef(_0x413950['appCode'],_0x1014ca);if(_0x9b0dc9['roleType']==='OWNER')throw CliErrors['validation']('Cannot\x20'+_0x12bf6f+_0x13b85a(0xb4),_0x13b85a(0xb8));const _0x57222e=await resolveUserRef(_0xff3a25),_0x1dc1aa=await loadDevRoleRelations(_0x413950[_0x13b85a(0xb9)],_0x9b0dc9['id']);return{...computeRoleUserMutation({'operation':_0x12bf6f,'appCode':_0x413950[_0x13b85a(0xb9)],'role':_0x9b0dc9,'relations':_0x1dc1aa,'user':{'userId':_0x57222e[_0x13b85a(0x85)],'username':_0x57222e[_0x13b85a(0xb2)],'nickname':_0x57222e['nickname']},'dryRun':_0x1fd54c,..._0x4dc20b!==undefined?{'expectUserCount':_0x4dc20b}:{}}),'role':_0x9b0dc9,'user':_0x57222e};}
1
+ const a178_0x5de534=a178_0x577a;(function(_0x34d43a,_0x2d08cb){const _0x70b04d=a178_0x577a,_0x48b215=_0x34d43a();while(!![]){try{const _0x27d562=-parseInt(_0x70b04d(0x1e7))/0x1+-parseInt(_0x70b04d(0x219))/0x2*(parseInt(_0x70b04d(0x224))/0x3)+-parseInt(_0x70b04d(0x21b))/0x4*(-parseInt(_0x70b04d(0x1e8))/0x5)+-parseInt(_0x70b04d(0x21c))/0x6+parseInt(_0x70b04d(0x21e))/0x7+parseInt(_0x70b04d(0x221))/0x8*(-parseInt(_0x70b04d(0x21a))/0x9)+parseInt(_0x70b04d(0x1ee))/0xa;if(_0x27d562===_0x2d08cb)break;else _0x48b215['push'](_0x48b215['shift']());}catch(_0x27c15b){_0x48b215['push'](_0x48b215['shift']());}}}(a178_0x1f8b,0x569f7));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a178_0x5de534(0x1f3),'type':'string','required':!![],'description':a178_0x5de534(0x204)};export const USER_REF_FLAG={'name':a178_0x5de534(0x208),'type':a178_0x5de534(0x211),'required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':a178_0x5de534(0x1e5),'type':a178_0x5de534(0x211),'required':!![],'description':a178_0x5de534(0x1e3)};export const USER_NAME_FLAG={'name':a178_0x5de534(0x1e5),'type':'string','required':!![],'description':a178_0x5de534(0x1f5)};function a178_0x577a(_0x2da6df,_0x53563d){_0x2da6df=_0x2da6df-0x1dc;const _0x1f8b19=a178_0x1f8b();let _0x577ace=_0x1f8b19[_0x2da6df];return _0x577ace;}export const REMARK_FLAG={'name':'remark','type':'string','required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':'number','required':![],'description':a178_0x5de534(0x1f4)};export const BUILTIN_ROLE_TYPES=[a178_0x5de534(0x1f2),a178_0x5de534(0x217),a178_0x5de534(0x1f6)];export function isBuiltinRole(_0x5d0be9){const _0x5cb00b=a178_0x5de534;return BUILTIN_ROLE_TYPES[_0x5cb00b(0x229)](_0x5d0be9);}export function assertCustomRole(_0x5d0249,_0x589f8a){const _0xe146f2=a178_0x5de534;if(_0x5d0249['roleType']!==_0xe146f2(0x1f9))throw CliErrors['validation'](_0xe146f2(0x1e9)+_0x589f8a+_0xe146f2(0x222)+_0x5d0249[_0xe146f2(0x203)]+'\x20('+_0x5d0249[_0xe146f2(0x1df)]+').',_0xe146f2(0x215));}export function projectRole(_0x2460f8){const _0x305f6f=a178_0x5de534;return{'id':_0x2460f8['id'],'roleName':_0x2460f8[_0x305f6f(0x203)],'roleType':_0x2460f8['roleType'],'remark':_0x2460f8[_0x305f6f(0x1ff)],'userCount':_0x2460f8[_0x305f6f(0x216)],'permitCount':_0x2460f8['permitCount'],'builtin':isBuiltinRole(_0x2460f8['roleType'])};}export async function resolveRoleRef(_0x56d9b2,_0xc9a882){const _0x22c5a8=a178_0x5de534,_0x52058b=_0xc9a882[_0x22c5a8(0x20d)]();if(!_0x52058b)throw CliErrors['validation'](_0x22c5a8(0x1de),_0x22c5a8(0x20f));if(/^\d+$/[_0x22c5a8(0x1f0)](_0x52058b))return getRoleById(_0x56d9b2,Number(_0x52058b));const _0x37c36f=await listAllAppRoles(_0x56d9b2),_0x340b46=_0x37c36f['filter'](_0x39aa4a=>_0x39aa4a[_0x22c5a8(0x203)]===_0x52058b);if(_0x340b46[_0x22c5a8(0x20a)]===0x0)throw CliErrors[_0x22c5a8(0x1ef)](_0x22c5a8(0x1e6)+_0x52058b+_0x22c5a8(0x207)+_0x56d9b2+'.',_0x22c5a8(0x223));if(_0x340b46[_0x22c5a8(0x20a)]>0x1){const _0x21f3d9=_0x340b46[_0x22c5a8(0x200)](_0x188f40=>_0x188f40['id'])['join'](',\x20');throw CliErrors[_0x22c5a8(0x1ef)](_0x22c5a8(0x1e6)+_0x52058b+_0x22c5a8(0x1e1)+_0x21f3d9+').',_0x22c5a8(0x228));}return _0x340b46[0x0];}export async function getRoleById(_0x496544,_0x26fe5d){const _0xbc1ac=a178_0x5de534,_0x3a752f=await listAllAppRoles(_0x496544),_0x10631f=_0x3a752f[_0xbc1ac(0x201)](_0x5f1e28=>_0x5f1e28['id']===_0x26fe5d&&(!_0x5f1e28[_0xbc1ac(0x212)]||_0x5f1e28['appCode']===_0x496544));if(_0x10631f['length']!==0x1)throw CliErrors[_0xbc1ac(0x1ef)]('Role\x20id\x20'+_0x26fe5d+_0xbc1ac(0x1fb)+_0x496544+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x10631f[0x0];}async function listAllAppRoles(_0x239cb1){const _0xcf1c50=a178_0x5de534,_0x2eaefc=0x64,_0x3eefe9=[];for(let _0x1f86e2=0x1;;_0x1f86e2+=0x1){const {items:_0x417602,paging:_0x37f9da}=await listAppRoles(_0x239cb1,{'currentPage':_0x1f86e2,'pageSize':_0x2eaefc});_0x3eefe9[_0xcf1c50(0x206)](..._0x417602);if(_0x417602[_0xcf1c50(0x20a)]<_0x2eaefc||_0x37f9da&&_0x3eefe9['length']>=_0x37f9da[_0xcf1c50(0x1fe)])return _0x3eefe9;}}export async function resolveTenantCode(){const _0x425107=a178_0x5de534,_0x392262=await getSessionUserInfo(),_0x394fa1=_0x392262?.['user']?.[_0x425107(0x213)]?.[_0x425107(0x1e4)];if(!_0x394fa1)throw CliErrors[_0x425107(0x20b)](_0x425107(0x1f7));return _0x394fa1;}function matchMember(_0x30f5c2,_0x16aace){const _0x24b69b=a178_0x5de534,_0x306080=_0x16aace[_0x24b69b(0x20d)]()['toLowerCase']();return(_0x30f5c2[_0x24b69b(0x1ea)]??'')[_0x24b69b(0x205)]()===_0x306080||(_0x30f5c2[_0x24b69b(0x1ed)]??'')[_0x24b69b(0x205)]()===_0x306080;}export async function resolveUserRef(_0x196ac4){const _0x319742=a178_0x5de534,_0x501c4b=_0x196ac4[_0x319742(0x20d)]();if(!_0x501c4b)throw CliErrors[_0x319742(0x1ef)]('Missing\x20user\x20reference.','Pass\x20--user\x20<id|name>.');const _0x2f96e9=await resolveTenantCode(),_0x8e3f88=await getTenantMembers(_0x2f96e9);if(/^\d+$/[_0x319742(0x1f0)](_0x501c4b)){const _0x3c2a8e=Number(_0x501c4b),_0x4cbdb7=_0x8e3f88[_0x319742(0x1fd)](_0x353615=>_0x353615[_0x319742(0x218)]===_0x3c2a8e);return{'userId':_0x3c2a8e,'username':_0x4cbdb7?.[_0x319742(0x1ed)]??String(_0x3c2a8e),'nickname':_0x4cbdb7?.[_0x319742(0x1ea)],'matchedBy':'id'};}const _0x39811f=_0x8e3f88[_0x319742(0x201)](_0x394d22=>matchMember(_0x394d22,_0x501c4b));if(_0x39811f[_0x319742(0x20a)]===0x0)throw CliErrors[_0x319742(0x1ef)](_0x319742(0x220)+_0x501c4b+'\x22.',_0x319742(0x20e));if(_0x39811f[_0x319742(0x20a)]>0x1){const _0x536401=_0x39811f[_0x319742(0x200)](_0x2e368c=>(_0x2e368c[_0x319742(0x1ea)]??_0x2e368c[_0x319742(0x1ed)]??'?')+'('+_0x2e368c[_0x319742(0x218)]+')')[_0x319742(0x225)](',\x20');throw CliErrors[_0x319742(0x1ef)](_0x319742(0x1fa)+_0x501c4b+_0x319742(0x202)+_0x536401+'.',_0x319742(0x21d));}const _0x1d3063=_0x39811f[0x0];return{'userId':_0x1d3063[_0x319742(0x218)],'username':_0x1d3063[_0x319742(0x1ed)]??String(_0x1d3063[_0x319742(0x218)]),'nickname':_0x1d3063[_0x319742(0x1ea)],'matchedBy':_0x319742(0x1e5)};}export const CREATE_USER_ROLE_PATH=a178_0x5de534(0x20c);function a178_0x1f8b(){const _0x29c633=['OWNER','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','flagMissing','CUSTOM','Multiple\x20tenant\x20members\x20match\x20\x22','\x20not\x20found\x20in\x20app\x20',';\x20no\x20change.','find','totalCount','remark','map','filter','\x22:\x20','roleName','Role\x20id\x20or\x20exact\x20role\x20name','toLowerCase','push','\x22\x20not\x20found\x20in\x20app\x20','user','\x20is\x20not\x20a\x20member\x20of\x20role\x20','length','authRequired','/smartapi/permit/user-role/create','trim','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','Pass\x20--role\x20<id|name>.','\x20member(s)\x20but\x20role\x20has\x20','string','appCode','tenant','expect-user-count','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','userCount','DEV','userId','1318YGEcvL','45HzrddZ','602264yBxFQn','34332MWfsDF','Disambiguate\x20with\x20--user\x20<id>.','3705562FyyfoY','Anti-drift\x20check\x20failed:\x20expected\x20','No\x20tenant\x20member\x20matches\x20\x22','471176QmhooR','\x20built-in\x20role\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','2199rdnNbg','join','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','expectUserCount','Disambiguate\x20with\x20--role\x20<id>.','includes','POST','User\x20','Missing\x20role\x20reference.','roleType','Removed\x20','\x22\x20is\x20ambiguous\x20(ids:\x20','flag','Role\x20name','tenant_code','name','Role\x20name\x20\x22','153903uAbLyE','5kDaCOI','Cannot\x20','nickname','user-add','\x20members\x20of\x20the\x20OWNER\x20role.','username','6120320zMdIjf','validation','test','\x20duplicate\x20memberships\x20for\x20user\x20','ADMIN','role','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'];a178_0x1f8b=function(){return _0x29c633;};return a178_0x1f8b();}export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x6524f5){const _0x3526cb=a178_0x5de534,{operation:_0x261159,appCode:_0x1649c2,role:_0x598995,relations:_0x3231de,user:_0x199d7d}=_0x6524f5,_0x18f048=[...new Set(_0x3231de[_0x3526cb(0x200)](_0x345085=>_0x345085[_0x3526cb(0x218)]))],_0x5b86bb=[];if(_0x6524f5[_0x3526cb(0x227)]!==undefined&&_0x6524f5[_0x3526cb(0x227)]!==_0x18f048[_0x3526cb(0x20a)])throw CliErrors[_0x3526cb(0x1ef)](_0x3526cb(0x21f)+_0x6524f5['expectUserCount']+_0x3526cb(0x210)+_0x18f048['length']+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x3efe70=_0x18f048[_0x3526cb(0x229)](_0x199d7d[_0x3526cb(0x218)]),_0x246207=_0x3231de['filter'](_0x792eed=>_0x792eed[_0x3526cb(0x218)]===_0x199d7d['userId'])[_0x3526cb(0x200)](_0x4ea646=>_0x4ea646['id']),_0x2d3195=_0x261159===_0x3526cb(0x1eb)?!_0x3efe70:_0x3efe70;let _0x1404a7=_0x18f048;_0x261159==='user-add'?_0x3efe70?_0x5b86bb['push'](_0x3526cb(0x1dd)+_0x199d7d['userId']+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x598995[_0x3526cb(0x203)]+';\x20no\x20change.'):_0x1404a7=[..._0x18f048,_0x199d7d[_0x3526cb(0x218)]]:!_0x3efe70?_0x5b86bb[_0x3526cb(0x206)](_0x3526cb(0x1dd)+_0x199d7d[_0x3526cb(0x218)]+_0x3526cb(0x209)+_0x598995[_0x3526cb(0x203)]+_0x3526cb(0x1fc)):(_0x1404a7=_0x18f048['filter'](_0x6a3e1=>_0x6a3e1!==_0x199d7d[_0x3526cb(0x218)]),_0x246207[_0x3526cb(0x20a)]>0x1&&_0x5b86bb[_0x3526cb(0x206)](_0x3526cb(0x1e0)+_0x246207[_0x3526cb(0x20a)]+_0x3526cb(0x1f1)+_0x199d7d[_0x3526cb(0x218)]+'.'));const _0x5633f8={'scope':'dev','operation':_0x261159,'selector':{'appCode':_0x1649c2,'roleId':_0x598995['id'],'roleName':_0x598995[_0x3526cb(0x203)],'userId':_0x199d7d[_0x3526cb(0x218)]},'before':{'userIds':_0x18f048},'after':{'userIds':_0x1404a7},'dryRun':_0x6524f5['dryRun'],'backend':{'method':_0x3526cb(0x1dc),'path':_0x261159===_0x3526cb(0x1eb)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x5b86bb};return{'mutation':_0x5633f8,'changed':_0x2d3195,'matchingRelationIds':_0x246207};}export async function loadDevRoleRelations(_0x1b7a35,_0x56c47e){const _0x2337c1=a178_0x5de534,_0x160741=0x64,_0x3bedeb=[];for(let _0x57755b=0x1;;_0x57755b+=0x1){const {items:_0x57c61d,paging:_0x19fec1}=await listDevUserRoleRelations(_0x1b7a35,{'roleId':_0x56c47e,'currentPage':_0x57755b,'pageSize':_0x160741});_0x3bedeb[_0x2337c1(0x206)](..._0x57c61d);if(_0x57c61d[_0x2337c1(0x20a)]<_0x160741||_0x19fec1&&_0x3bedeb['length']>=_0x19fec1[_0x2337c1(0x1fe)])return _0x3bedeb;}}export function readRoleRef(_0x17600e){const _0x330106=a178_0x5de534,_0x1fd9c7=_0x17600e['str'](_0x330106(0x1f3))['trim']();if(!_0x1fd9c7)throw CliErrors['flagMissing']('role','Pass\x20--role\x20<id|name>.');return _0x1fd9c7;}export async function prepareUserMutation(_0x10c436,_0x281841,_0x243409){const _0x156c01=a178_0x5de534,_0x4cb3d6=readRoleRef(_0x10c436),_0x466d24=_0x10c436['str']('user')[_0x156c01(0x20d)]();if(!_0x466d24)throw CliErrors[_0x156c01(0x1f8)](_0x156c01(0x208),'Pass\x20--user\x20<id|name>.');const _0xfc44c0=_0x10c436[_0x156c01(0x1e2)](_0x156c01(0x214)),_0x20ff0c=_0xfc44c0===undefined||_0xfc44c0===null?undefined:Number(_0xfc44c0),_0x3b86d9=await resolveRoleRef(_0x10c436[_0x156c01(0x212)],_0x4cb3d6);if(_0x3b86d9[_0x156c01(0x1df)]===_0x156c01(0x1f6))throw CliErrors[_0x156c01(0x1ef)](_0x156c01(0x1e9)+_0x281841+_0x156c01(0x1ec),_0x156c01(0x226));const _0x4b18f1=await resolveUserRef(_0x466d24),_0x407006=await loadDevRoleRelations(_0x10c436[_0x156c01(0x212)],_0x3b86d9['id']);return{...computeRoleUserMutation({'operation':_0x281841,'appCode':_0x10c436[_0x156c01(0x212)],'role':_0x3b86d9,'relations':_0x407006,'user':{'userId':_0x4b18f1[_0x156c01(0x218)],'username':_0x4b18f1[_0x156c01(0x1ed)],'nickname':_0x4b18f1[_0x156c01(0x1ea)]},'dryRun':_0x243409,..._0x20ff0c!==undefined?{'expectUserCount':_0x20ff0c}:{}}),'role':_0x3b86d9,'user':_0x4b18f1};}
@@ -1 +1 @@
1
- const a178_0x1358ec=a178_0x1bf9;(function(_0x3775f9,_0x1a70da){const _0x4dfe71=a178_0x1bf9,_0x824647=_0x3775f9();while(!![]){try{const _0x1bd1e6=-parseInt(_0x4dfe71(0x1f3))/0x1+parseInt(_0x4dfe71(0x20a))/0x2*(parseInt(_0x4dfe71(0x204))/0x3)+parseInt(_0x4dfe71(0x1f4))/0x4*(parseInt(_0x4dfe71(0x201))/0x5)+-parseInt(_0x4dfe71(0x1eb))/0x6*(parseInt(_0x4dfe71(0x206))/0x7)+-parseInt(_0x4dfe71(0x1f6))/0x8*(parseInt(_0x4dfe71(0x1ec))/0x9)+-parseInt(_0x4dfe71(0x209))/0xa+parseInt(_0x4dfe71(0x208))/0xb;if(_0x1bd1e6===_0x1a70da)break;else _0x824647['push'](_0x824647['shift']());}catch(_0x6896fe){_0x824647['push'](_0x824647['shift']());}}}(a178_0x436d,0xe895d));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=a178_0x1358ec(0x207);function readPatch(_0x2e4a2a){const _0x38b1e9=a178_0x1358ec,_0x2b2674=_0x2e4a2a[_0x38b1e9(0x1ed)](_0x38b1e9(0x1f5)),_0x338c7b=_0x2e4a2a['flag'](_0x38b1e9(0x1e9)),_0x1e809f={};if(_0x2b2674!==undefined&&_0x2b2674!==null){const _0x5a3d9e=String(_0x2b2674)[_0x38b1e9(0x1f7)]();if(!_0x5a3d9e)throw CliErrors[_0x38b1e9(0x1f9)](_0x38b1e9(0x1fa));if(_0x5a3d9e[_0x38b1e9(0x1ff)]>0x40)throw CliErrors[_0x38b1e9(0x1f9)](_0x38b1e9(0x1f1));_0x1e809f[_0x38b1e9(0x1f2)]=_0x5a3d9e;}_0x338c7b!==undefined&&_0x338c7b!==null&&(_0x1e809f[_0x38b1e9(0x1e9)]=String(_0x338c7b));if(_0x1e809f[_0x38b1e9(0x1f2)]===undefined&&_0x1e809f[_0x38b1e9(0x1e9)]===undefined)throw CliErrors[_0x38b1e9(0x1f9)](_0x38b1e9(0x1fb),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x1e809f;}function a178_0x436d(){const _0x2af1e4=['role','update','159cesoil','\x20(id=','28eRKrAH','/smartapi/permit/role/update','10043704tJbSAZ','5754310TtbMHc','38108YHzmqJ','remark','New\x20role\x20name','1544658huwQSH','2269305vShdrX','flag','string','dev','Updated\x20role\x20','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','roleName','177421WDmifA','4XEuMHR','name','16KbCwyD','trim','POST','validation','--name\x20cannot\x20be\x20empty.','Nothing\x20to\x20update.','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','write','num','length','appCode','6583285pDwTEi'];a178_0x436d=function(){return _0x2af1e4;};return a178_0x436d();}function a178_0x1bf9(_0x236cb3,_0xf5878d){_0x236cb3=_0x236cb3-0x1e9;const _0x436d3b=a178_0x436d();let _0x1bf96a=_0x436d3b[_0x236cb3];return _0x1bf96a;}export const roleUpdate={'service':a178_0x1358ec(0x202),'command':a178_0x1358ec(0x203),'description':a178_0x1358ec(0x1fc),'risk':a178_0x1358ec(0x1fd),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a178_0x1358ec(0x1f5),'type':a178_0x1358ec(0x1ee),'required':![],'description':a178_0x1358ec(0x1ea)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x19263f){readPatch(_0x19263f);},async 'dryRun'(_0x366894){const _0x344fe1=a178_0x1358ec,_0x40f1ff=_0x366894[_0x344fe1(0x1fe)]('id'),_0xfa8855=readPatch(_0x366894),_0x236d5a=await getRoleById(_0x366894[_0x344fe1(0x200)],_0x40f1ff);return assertCustomRole(_0x236d5a,_0x344fe1(0x203)),asDryRunResult({'scope':_0x344fe1(0x1ef),'operation':_0x344fe1(0x203),'selector':{'appCode':_0x366894[_0x344fe1(0x200)],'roleId':_0x40f1ff,'roleName':_0x236d5a[_0x344fe1(0x1f2)]},'before':projectRole(_0x236d5a),'after':projectRole({..._0x236d5a,..._0xfa8855['roleName']!==undefined?{'roleName':_0xfa8855[_0x344fe1(0x1f2)]}:{},..._0xfa8855[_0x344fe1(0x1e9)]!==undefined?{'remark':_0xfa8855[_0x344fe1(0x1e9)]}:{}}),'dryRun':!![],'backend':{'method':_0x344fe1(0x1f8),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x1f0e46){const _0x4f65bb=a178_0x1358ec,_0x3a8ea4=_0x1f0e46[_0x4f65bb(0x1fe)]('id'),_0x24d89e=readPatch(_0x1f0e46),_0x13fecc=await getRoleById(_0x1f0e46[_0x4f65bb(0x200)],_0x3a8ea4);assertCustomRole(_0x13fecc,_0x4f65bb(0x203)),await updateAppRole({'id':_0x3a8ea4,'appCode':_0x1f0e46[_0x4f65bb(0x200)],..._0x24d89e[_0x4f65bb(0x1f2)]!==undefined?{'roleName':_0x24d89e[_0x4f65bb(0x1f2)]}:{},..._0x24d89e[_0x4f65bb(0x1e9)]!==undefined?{'remark':_0x24d89e[_0x4f65bb(0x1e9)]}:{}});const _0x2b9f9b=await getRoleById(_0x1f0e46[_0x4f65bb(0x200)],_0x3a8ea4);return{'ok':!![],'data':{'scope':_0x4f65bb(0x1ef),'operation':_0x4f65bb(0x203),'selector':{'appCode':_0x1f0e46[_0x4f65bb(0x200)],'roleId':_0x3a8ea4,'roleName':_0x2b9f9b[_0x4f65bb(0x1f2)]},'before':projectRole(_0x13fecc),'after':projectRole(_0x2b9f9b),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x4f65bb(0x1f0)+_0x2b9f9b[_0x4f65bb(0x1f2)]+_0x4f65bb(0x205)+_0x3a8ea4+')'};}};
1
+ const a179_0x3e641a=a179_0x418b;(function(_0x5d4cff,_0x5d5e76){const _0x5ce575=a179_0x418b,_0x24b485=_0x5d4cff();while(!![]){try{const _0x534001=parseInt(_0x5ce575(0x194))/0x1*(-parseInt(_0x5ce575(0x193))/0x2)+-parseInt(_0x5ce575(0x191))/0x3+parseInt(_0x5ce575(0x19c))/0x4*(-parseInt(_0x5ce575(0x182))/0x5)+parseInt(_0x5ce575(0x190))/0x6+-parseInt(_0x5ce575(0x185))/0x7+-parseInt(_0x5ce575(0x18b))/0x8+parseInt(_0x5ce575(0x19a))/0x9*(parseInt(_0x5ce575(0x199))/0xa);if(_0x534001===_0x5d5e76)break;else _0x24b485['push'](_0x24b485['shift']());}catch(_0x3f3c25){_0x24b485['push'](_0x24b485['shift']());}}}(a179_0xdaa1,0x5abe5));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a179_0xdaa1(){const _0x12c069=['Updated\x20role\x20','num','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','dev','5300176QMhtdG','\x20(id=','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','flag','role','4211682KCYXkQ','656010nASqoo','New\x20role\x20name','1934SVfopx','446vHaPWr','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','POST','remark','name','20840tZpfUu','6786DDRgqi','write','1916fcfMYR','appCode','--name\x20cannot\x20be\x20empty.','validation','roleName','string','1745ExbwIg','update','length','2953671oVOrgn','/smartapi/permit/role/update'];a179_0xdaa1=function(){return _0x12c069;};return a179_0xdaa1();}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=a179_0x3e641a(0x186);function a179_0x418b(_0x120995,_0x20fb2a){_0x120995=_0x120995-0x17f;const _0xdaa155=a179_0xdaa1();let _0x418bf0=_0xdaa155[_0x120995];return _0x418bf0;}function readPatch(_0x41344b){const _0x276fad=a179_0x3e641a,_0x2e38a8=_0x41344b[_0x276fad(0x18e)](_0x276fad(0x198)),_0xdf7bd8=_0x41344b[_0x276fad(0x18e)](_0x276fad(0x197)),_0x3d53ce={};if(_0x2e38a8!==undefined&&_0x2e38a8!==null){const _0x4ddf69=String(_0x2e38a8)['trim']();if(!_0x4ddf69)throw CliErrors['validation'](_0x276fad(0x19e));if(_0x4ddf69[_0x276fad(0x184)]>0x40)throw CliErrors[_0x276fad(0x17f)](_0x276fad(0x189));_0x3d53ce[_0x276fad(0x180)]=_0x4ddf69;}_0xdf7bd8!==undefined&&_0xdf7bd8!==null&&(_0x3d53ce[_0x276fad(0x197)]=String(_0xdf7bd8));if(_0x3d53ce['roleName']===undefined&&_0x3d53ce[_0x276fad(0x197)]===undefined)throw CliErrors['validation']('Nothing\x20to\x20update.',_0x276fad(0x195));return _0x3d53ce;}export const roleUpdate={'service':a179_0x3e641a(0x18f),'command':'update','description':a179_0x3e641a(0x18d),'risk':a179_0x3e641a(0x19b),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a179_0x3e641a(0x181),'required':![],'description':a179_0x3e641a(0x192)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x296dd9){readPatch(_0x296dd9);},async 'dryRun'(_0x11a830){const _0x19f38a=a179_0x3e641a,_0x13d2ec=_0x11a830['num']('id'),_0x25aedd=readPatch(_0x11a830),_0x5ace2a=await getRoleById(_0x11a830[_0x19f38a(0x19d)],_0x13d2ec);return assertCustomRole(_0x5ace2a,_0x19f38a(0x183)),asDryRunResult({'scope':_0x19f38a(0x18a),'operation':'update','selector':{'appCode':_0x11a830[_0x19f38a(0x19d)],'roleId':_0x13d2ec,'roleName':_0x5ace2a[_0x19f38a(0x180)]},'before':projectRole(_0x5ace2a),'after':projectRole({..._0x5ace2a,..._0x25aedd[_0x19f38a(0x180)]!==undefined?{'roleName':_0x25aedd[_0x19f38a(0x180)]}:{},..._0x25aedd[_0x19f38a(0x197)]!==undefined?{'remark':_0x25aedd[_0x19f38a(0x197)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x1dfd97){const _0xefe87f=a179_0x3e641a,_0x46506a=_0x1dfd97[_0xefe87f(0x188)]('id'),_0x5a1324=readPatch(_0x1dfd97),_0x1aad9a=await getRoleById(_0x1dfd97[_0xefe87f(0x19d)],_0x46506a);assertCustomRole(_0x1aad9a,'update'),await updateAppRole({'id':_0x46506a,'appCode':_0x1dfd97[_0xefe87f(0x19d)],..._0x5a1324[_0xefe87f(0x180)]!==undefined?{'roleName':_0x5a1324['roleName']}:{},..._0x5a1324[_0xefe87f(0x197)]!==undefined?{'remark':_0x5a1324['remark']}:{}});const _0xb30258=await getRoleById(_0x1dfd97['appCode'],_0x46506a);return{'ok':!![],'data':{'scope':_0xefe87f(0x18a),'operation':_0xefe87f(0x183),'selector':{'appCode':_0x1dfd97[_0xefe87f(0x19d)],'roleId':_0x46506a,'roleName':_0xb30258[_0xefe87f(0x180)]},'before':projectRole(_0x1aad9a),'after':projectRole(_0xb30258),'dryRun':![],'backend':{'method':_0xefe87f(0x196),'path':UPDATE_PATH},'warnings':[]},'message':_0xefe87f(0x187)+_0xb30258[_0xefe87f(0x180)]+_0xefe87f(0x18c)+_0x46506a+')'};}};
@@ -1 +1 @@
1
- function a179_0x14cb(_0x3ceb13,_0x520c09){_0x3ceb13=_0x3ceb13-0x90;const _0x33c6ad=a179_0x33c6();let _0x14cbfe=_0x33c6ad[_0x3ceb13];return _0x14cbfe;}const a179_0x53ae6d=a179_0x14cb;(function(_0x2e3510,_0x27c862){const _0x436ccd=a179_0x14cb,_0x4f7b1a=_0x2e3510();while(!![]){try{const _0x434ecd=-parseInt(_0x436ccd(0x9c))/0x1*(-parseInt(_0x436ccd(0xa5))/0x2)+parseInt(_0x436ccd(0x9b))/0x3+-parseInt(_0x436ccd(0xa3))/0x4+parseInt(_0x436ccd(0xa1))/0x5+parseInt(_0x436ccd(0x9f))/0x6+parseInt(_0x436ccd(0x96))/0x7*(parseInt(_0x436ccd(0x9a))/0x8)+-parseInt(_0x436ccd(0x97))/0x9;if(_0x434ecd===_0x27c862)break;else _0x4f7b1a['push'](_0x4f7b1a['shift']());}catch(_0x57c7cf){_0x4f7b1a['push'](_0x4f7b1a['shift']());}}}(a179_0x33c6,0x5b1bd));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a179_0x33c6(){const _0x648fba=['roleType','49357pgYTpw','8991828LLlczO','Added\x20user\x20','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','112xmhYdt','1595997NsIgIJ','153514kzGdOp','selector','roleId','3241140VteuMc','role','375295cCwRWK','username','108812JVWZjR','roleName','2MCogCA','user-add','appCode','high-risk-write','No\x20change:\x20user\x20','\x20to\x20role\x20','userId'];a179_0x33c6=function(){return _0x648fba;};return a179_0x33c6();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a179_0x53ae6d(0xa0),'command':a179_0x53ae6d(0xa6),'description':a179_0x53ae6d(0x99),'risk':a179_0x53ae6d(0x91),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1def1f){const _0x3e6af8=a179_0x53ae6d,{mutation:_0x214bd9}=await prepareUserMutation(_0x1def1f,_0x3e6af8(0xa6),!![]);return asDryRunResult(_0x214bd9,{'method':'POST','url':CREATE_USER_ROLE_PATH});},async 'execute'(_0xa40120){const _0x20f8b9=a179_0x53ae6d,{mutation:_0x36c61c,changed:_0x43b1e4,role:_0x1a8b32,user:_0x2564a8}=await prepareUserMutation(_0xa40120,_0x20f8b9(0xa6),![]);return _0x43b1e4&&await createDevUserRole({'appCode':_0xa40120[_0x20f8b9(0x90)],'userId':_0x2564a8[_0x20f8b9(0x94)],'username':_0x2564a8[_0x20f8b9(0xa2)],'roleType':_0x1a8b32[_0x20f8b9(0x95)],'roleId':_0x36c61c[_0x20f8b9(0x9d)][_0x20f8b9(0x9e)]}),{'ok':!![],'data':_0x36c61c,'message':_0x43b1e4?_0x20f8b9(0x98)+_0x36c61c[_0x20f8b9(0x9d)][_0x20f8b9(0x94)]+_0x20f8b9(0x93)+_0x36c61c['selector'][_0x20f8b9(0xa4)]:_0x20f8b9(0x92)+_0x36c61c[_0x20f8b9(0x9d)][_0x20f8b9(0x94)]+'\x20already\x20in\x20role\x20'+_0x36c61c[_0x20f8b9(0x9d)][_0x20f8b9(0xa4)]};}};
1
+ const a180_0x575676=a180_0x2301;function a180_0x1c59(){const _0x3ecb21=['username','No\x20change:\x20user\x20','selector','user-add','7574308PjASos','\x20already\x20in\x20role\x20','1496gTSDWV','344sgibdb','2040USqxpp','31689MMRybK','role','Added\x20user\x20','appCode','POST','23975690qPUvNf','188660vcctxr','roleName','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','1953756xvQUzS','userId','335UagbEF','98364qMokil'];a180_0x1c59=function(){return _0x3ecb21;};return a180_0x1c59();}(function(_0x56e38a,_0x592d14){const _0x4bf5c5=a180_0x2301,_0x2a52a5=_0x56e38a();while(!![]){try{const _0x308fac=-parseInt(_0x4bf5c5(0x78))/0x1+parseInt(_0x4bf5c5(0x7b))/0x2+parseInt(_0x4bf5c5(0x87))/0x3*(-parseInt(_0x4bf5c5(0x85))/0x4)+parseInt(_0x4bf5c5(0x7d))/0x5*(-parseInt(_0x4bf5c5(0x7e))/0x6)+-parseInt(_0x4bf5c5(0x83))/0x7+parseInt(_0x4bf5c5(0x86))/0x8*(-parseInt(_0x4bf5c5(0x88))/0x9)+parseInt(_0x4bf5c5(0x77))/0xa;if(_0x308fac===_0x592d14)break;else _0x2a52a5['push'](_0x2a52a5['shift']());}catch(_0x1c2492){_0x2a52a5['push'](_0x2a52a5['shift']());}}}(a180_0x1c59,0x92646));import{createDevUserRole}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,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a180_0x2301(_0x4be41c,_0x9655a6){_0x4be41c=_0x4be41c-0x75;const _0x1c5905=a180_0x1c59();let _0x230100=_0x1c5905[_0x4be41c];return _0x230100;}export const roleUserAdd={'service':a180_0x575676(0x89),'command':a180_0x575676(0x82),'description':a180_0x575676(0x7a),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x389d8a){const _0x151873=a180_0x575676,{mutation:_0x15db5e}=await prepareUserMutation(_0x389d8a,_0x151873(0x82),!![]);return asDryRunResult(_0x15db5e,{'method':_0x151873(0x76),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x23965f){const _0x2875ee=a180_0x575676,{mutation:_0x438cc6,changed:_0x52ee92,role:_0xdd2395,user:_0x10864e}=await prepareUserMutation(_0x23965f,'user-add',![]);return _0x52ee92&&await createDevUserRole({'appCode':_0x23965f[_0x2875ee(0x75)],'userId':_0x10864e[_0x2875ee(0x7c)],'username':_0x10864e[_0x2875ee(0x7f)],'roleType':_0xdd2395['roleType'],'roleId':_0x438cc6[_0x2875ee(0x81)]['roleId']}),{'ok':!![],'data':_0x438cc6,'message':_0x52ee92?_0x2875ee(0x8a)+_0x438cc6['selector'][_0x2875ee(0x7c)]+'\x20to\x20role\x20'+_0x438cc6[_0x2875ee(0x81)][_0x2875ee(0x79)]:_0x2875ee(0x80)+_0x438cc6['selector'][_0x2875ee(0x7c)]+_0x2875ee(0x84)+_0x438cc6[_0x2875ee(0x81)]['roleName']};}};
@@ -1 +1 @@
1
- const a180_0x5ce8fe=a180_0x4062;(function(_0xacc81a,_0x3fedd8){const _0x4a22f5=a180_0x4062,_0x307173=_0xacc81a();while(!![]){try{const _0x347357=parseInt(_0x4a22f5(0x89))/0x1+-parseInt(_0x4a22f5(0x84))/0x2*(parseInt(_0x4a22f5(0x8c))/0x3)+-parseInt(_0x4a22f5(0x8f))/0x4+parseInt(_0x4a22f5(0x86))/0x5*(parseInt(_0x4a22f5(0x81))/0x6)+parseInt(_0x4a22f5(0x7f))/0x7*(-parseInt(_0x4a22f5(0x8e))/0x8)+-parseInt(_0x4a22f5(0x80))/0x9+parseInt(_0x4a22f5(0x85))/0xa;if(_0x347357===_0x3fedd8)break;else _0x307173['push'](_0x307173['shift']());}catch(_0x1ba395){_0x307173['push'](_0x307173['shift']());}}}(a180_0x3f92,0x95e73));import{deleteDevUserRole}from'../../core/api-client.js';function a180_0x4062(_0x18b4d5,_0x3a1cf7){_0x18b4d5=_0x18b4d5-0x7b;const _0x3f9289=a180_0x3f92();let _0x406282=_0x3f9289[_0x18b4d5];return _0x406282;}function a180_0x3f92(){const _0x5a9f89=['userId','selector','\x20not\x20in\x20role\x20','\x20from\x20role\x20','7bRFPDo','9630891CJVOTy','18ZCjmCC','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','high-risk-write','2qCeIMr','20781960ujbNNa','1301555JbAmNn','Removed\x20user\x20','No\x20change:\x20user\x20','394454lunCOO','user-remove','roleName','3100473rzvUQA','POST','1791760TcBEZM','1248080eOEAtV','role'];a180_0x3f92=function(){return _0x5a9f89;};return a180_0x3f92();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a180_0x5ce8fe(0x90),'command':a180_0x5ce8fe(0x8a),'description':a180_0x5ce8fe(0x82),'risk':a180_0x5ce8fe(0x83),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x38c803){const _0x5b6927=a180_0x5ce8fe,{mutation:_0x1c3b7c}=await prepareUserMutation(_0x38c803,_0x5b6927(0x8a),!![]);return asDryRunResult(_0x1c3b7c,{'method':_0x5b6927(0x8d),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x4d1d07){const _0x3b6388=a180_0x5ce8fe,{matchingRelationIds:_0x45942b,mutation:_0x4847ec,changed:_0x318194}=await prepareUserMutation(_0x4d1d07,_0x3b6388(0x8a),![]);if(_0x318194)for(const _0x4b4764 of _0x45942b){await deleteDevUserRole(_0x4b4764);}return{'ok':!![],'data':_0x4847ec,'message':_0x318194?_0x3b6388(0x87)+_0x4847ec[_0x3b6388(0x7c)]['userId']+_0x3b6388(0x7e)+_0x4847ec['selector'][_0x3b6388(0x8b)]:_0x3b6388(0x88)+_0x4847ec[_0x3b6388(0x7c)][_0x3b6388(0x7b)]+_0x3b6388(0x7d)+_0x4847ec[_0x3b6388(0x7c)][_0x3b6388(0x8b)]};}};
1
+ const a181_0x348c3a=a181_0x44fb;(function(_0x20d94c,_0x28fa6f){const _0x15efcc=a181_0x44fb,_0x146a49=_0x20d94c();while(!![]){try{const _0x3b2c02=parseInt(_0x15efcc(0x15e))/0x1*(-parseInt(_0x15efcc(0x163))/0x2)+parseInt(_0x15efcc(0x15a))/0x3+parseInt(_0x15efcc(0x157))/0x4*(parseInt(_0x15efcc(0x15f))/0x5)+-parseInt(_0x15efcc(0x160))/0x6*(parseInt(_0x15efcc(0x166))/0x7)+parseInt(_0x15efcc(0x16a))/0x8*(-parseInt(_0x15efcc(0x156))/0x9)+-parseInt(_0x15efcc(0x169))/0xa+parseInt(_0x15efcc(0x158))/0xb;if(_0x3b2c02===_0x28fa6f)break;else _0x146a49['push'](_0x146a49['shift']());}catch(_0x50c743){_0x146a49['push'](_0x146a49['shift']());}}}(a181_0x5b3f,0xd64ab));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a181_0x44fb(_0x50450f,_0x344990){_0x50450f=_0x50450f-0x156;const _0x5b3f05=a181_0x5b3f();let _0x44fb18=_0x5b3f05[_0x50450f];return _0x44fb18;}import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a181_0x5b3f(){const _0x1f20b1=['3413520sTmdQA','8oWlBap','1859769LxxXNO','4eTkFDZ','4258485alnYGg','userId','4053351wIEkpD','POST','roleName','role','4582AXTLTj','7458155ZoPwsr','11874TlniZs','high-risk-write','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','372sKVjXK','selector','No\x20change:\x20user\x20','3367swCsDK','user-remove','\x20not\x20in\x20role\x20'];a181_0x5b3f=function(){return _0x1f20b1;};return a181_0x5b3f();}export const roleUserRemove={'service':a181_0x348c3a(0x15d),'command':'user-remove','description':a181_0x348c3a(0x162),'risk':a181_0x348c3a(0x161),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1f7834){const _0x4f3056=a181_0x348c3a,{mutation:_0x1fe6e8}=await prepareUserMutation(_0x1f7834,_0x4f3056(0x167),!![]);return asDryRunResult(_0x1fe6e8,{'method':_0x4f3056(0x15b),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x24c3cf){const _0xf5944=a181_0x348c3a,{matchingRelationIds:_0x10a2cf,mutation:_0xd85b9f,changed:_0x5cf916}=await prepareUserMutation(_0x24c3cf,'user-remove',![]);if(_0x5cf916)for(const _0x1d8003 of _0x10a2cf){await deleteDevUserRole(_0x1d8003);}return{'ok':!![],'data':_0xd85b9f,'message':_0x5cf916?'Removed\x20user\x20'+_0xd85b9f[_0xf5944(0x164)][_0xf5944(0x159)]+'\x20from\x20role\x20'+_0xd85b9f[_0xf5944(0x164)][_0xf5944(0x15c)]:_0xf5944(0x165)+_0xd85b9f['selector'][_0xf5944(0x159)]+_0xf5944(0x168)+_0xd85b9f[_0xf5944(0x164)]['roleName']};}};
@@ -1 +1 @@
1
- const a181_0x2bdae9=a181_0x2b5c;(function(_0x28d779,_0x1d8c0a){const _0x16f72d=a181_0x2b5c,_0x1067f1=_0x28d779();while(!![]){try{const _0x25b7c6=-parseInt(_0x16f72d(0x18c))/0x1+parseInt(_0x16f72d(0x18b))/0x2+parseInt(_0x16f72d(0x190))/0x3+-parseInt(_0x16f72d(0x18d))/0x4+-parseInt(_0x16f72d(0x195))/0x5+-parseInt(_0x16f72d(0x18e))/0x6*(parseInt(_0x16f72d(0x194))/0x7)+parseInt(_0x16f72d(0x18f))/0x8;if(_0x25b7c6===_0x1d8c0a)break;else _0x1067f1['push'](_0x1067f1['shift']());}catch(_0x1a13b3){_0x1067f1['push'](_0x1067f1['shift']());}}}(a181_0x3900,0xde3c9));function a181_0x3900(){const _0x19b546=['307072iRWoGR','514476CUlTNA','7225324UgmWJl','96EbdgwM','30134480SGjnhv','4155480AsBXYT','\x22\x20→\x20userId\x20','name','flagMissing','196217zOEyQt','8129610iFDfLr','read','matchedBy','trim','userId','str','role','user-resolve'];a181_0x3900=function(){return _0x19b546;};return a181_0x3900();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a181_0x2b5c(_0x5b52c4,_0x165297){_0x5b52c4=_0x5b52c4-0x188;const _0x390012=a181_0x3900();let _0x2b5c78=_0x390012[_0x5b52c4];return _0x2b5c78;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a181_0x2bdae9(0x189),'command':a181_0x2bdae9(0x18a),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a181_0x2bdae9(0x196),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x36eace){const _0x22ff63=a181_0x2bdae9;if(!_0x36eace['str'](_0x22ff63(0x192))[_0x22ff63(0x198)]())throw CliErrors[_0x22ff63(0x193)](_0x22ff63(0x192),'Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x3fa09b){const _0xfaa2f6=a181_0x2bdae9,_0x174f09=_0x3fa09b[_0xfaa2f6(0x188)](_0xfaa2f6(0x192))['trim'](),_0x5ca574=await resolveUserRef(_0x174f09);return{'ok':!![],'data':{'user':{'userId':_0x5ca574[_0xfaa2f6(0x199)],'username':_0x5ca574['username'],'nickname':_0x5ca574['nickname'],'matchedBy':_0x5ca574[_0xfaa2f6(0x197)]}},'message':'Resolved\x20\x22'+_0x174f09+_0xfaa2f6(0x191)+_0x5ca574[_0xfaa2f6(0x199)]};}};
1
+ const a182_0x237cf2=a182_0xc33e;(function(_0x19f8e0,_0x45e8a9){const _0x16ee59=a182_0xc33e,_0x1c2bde=_0x19f8e0();while(!![]){try{const _0x138000=parseInt(_0x16ee59(0x77))/0x1+parseInt(_0x16ee59(0x79))/0x2*(parseInt(_0x16ee59(0x6d))/0x3)+-parseInt(_0x16ee59(0x70))/0x4*(parseInt(_0x16ee59(0x72))/0x5)+-parseInt(_0x16ee59(0x76))/0x6*(-parseInt(_0x16ee59(0x71))/0x7)+parseInt(_0x16ee59(0x78))/0x8+-parseInt(_0x16ee59(0x7c))/0x9*(parseInt(_0x16ee59(0x6b))/0xa)+-parseInt(_0x16ee59(0x75))/0xb;if(_0x138000===_0x45e8a9)break;else _0x1c2bde['push'](_0x1c2bde['shift']());}catch(_0x20b34d){_0x1c2bde['push'](_0x1c2bde['shift']());}}}(a182_0x4aa1,0x27482));function a182_0xc33e(_0x3b4693,_0x240f57){_0x3b4693=_0x3b4693-0x68;const _0x4aa15f=a182_0x4aa1();let _0xc33e9b=_0x4aa15f[_0x3b4693];return _0xc33e9b;}function a182_0x4aa1(){const _0x450768=['30mesIHf','trim','8757wrvKhj','str','nickname','851308MQDBmI','33985bFidsm','5FXVeJg','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','matchedBy','3479619DhjUDc','300rNcLJH','139099bIrWYJ','2500968ndsGFy','204OgTThe','Pass\x20--name\x20<nickname|username>.','name','906462ySCUZZ','username','read','role'];a182_0x4aa1=function(){return _0x450768;};return a182_0x4aa1();}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':a182_0x237cf2(0x6a),'command':'user-resolve','description':a182_0x237cf2(0x73),'risk':a182_0x237cf2(0x69),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x528441){const _0xf3f78d=a182_0x237cf2;if(!_0x528441[_0xf3f78d(0x6e)](_0xf3f78d(0x7b))[_0xf3f78d(0x6c)]())throw CliErrors['flagMissing'](_0xf3f78d(0x7b),_0xf3f78d(0x7a));},async 'execute'(_0x9dec1d){const _0x5e3494=a182_0x237cf2,_0x7fb056=_0x9dec1d['str']('name')[_0x5e3494(0x6c)](),_0x24448b=await resolveUserRef(_0x7fb056);return{'ok':!![],'data':{'user':{'userId':_0x24448b['userId'],'username':_0x24448b[_0x5e3494(0x68)],'nickname':_0x24448b[_0x5e3494(0x6f)],'matchedBy':_0x24448b[_0x5e3494(0x74)]}},'message':'Resolved\x20\x22'+_0x7fb056+'\x22\x20→\x20userId\x20'+_0x24448b['userId']};}};
@@ -1 +1 @@
1
- const a182_0x3d3ea3=a182_0x3bc2;function a182_0x4d7c(){const _0x36cc09=['boolean','bun','pnpm','180768rsNlDK','scripts','18495851MAiopz','parse','bun.lockb','keys','--watch','vite\x20preview\x20exited\x20with\x20code\x20','\x20run\x20build','No\x20scripts\x20defined\x20in\x20package.json.','args','\x0a\x20\x20Usage:\x20','Available:\x20','needsUpgrade','validation','17323PoLaeu','preview','12871523PtWELF','Script\x20name\x20defined\x20in\x20package.json','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','vite','log','28278vtzZpu','21wYzLBv','bun.lock','belowMinimum','watch','bool','push','1112rjbNSD','error','.bin','15528260vjfwkO','\x20run\x20preview\x20--watch','run','\x20run\x20','\x22\x20not\x20found\x20in\x20package.json.','node_modules','yarn.lock','\x20\x20\x20\x20','pnpm-lock.yaml','\x20run\x20<script>\x0a','(none)','write','6VwdOpv','has','build','\x20run\x20start','cwd','npm','Enable\x20watch\x20mode\x20for\x20preview','\x0a\x20\x20Available\x20scripts:\x0a','utf-8','2099540nTMVvJ','15GkzEsu','script','No\x20package.json\x20found\x20in\x20current\x20directory.','close','inherit','\x20run\x20preview'];a182_0x4d7c=function(){return _0x36cc09;};return a182_0x4d7c();}(function(_0x1b3552,_0x281013){const _0x49b5c2=a182_0x3bc2,_0x2a79ea=_0x1b3552();while(!![]){try{const _0x294cdf=parseInt(_0x49b5c2(0x1e3))/0x1+-parseInt(_0x49b5c2(0x213))/0x2*(-parseInt(_0x49b5c2(0x1eb))/0x3)+-parseInt(_0x49b5c2(0x209))/0x4*(-parseInt(_0x49b5c2(0x20a))/0x5)+-parseInt(_0x49b5c2(0x200))/0x6*(parseInt(_0x49b5c2(0x1e5))/0x7)+parseInt(_0x49b5c2(0x1f1))/0x8*(parseInt(_0x49b5c2(0x1ea))/0x9)+-parseInt(_0x49b5c2(0x1f4))/0xa+parseInt(_0x49b5c2(0x215))/0xb;if(_0x294cdf===_0x281013)break;else _0x2a79ea['push'](_0x2a79ea['shift']());}catch(_0x41e9f9){_0x2a79ea['push'](_0x2a79ea['shift']());}}}(a182_0x4d7c,0xe83be));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start','dev']);function a182_0x3bc2(_0x22583f,_0x3e438c){_0x22583f=_0x22583f-0x1d7;const _0x4d7ca6=a182_0x4d7c();let _0x3bc272=_0x4d7ca6[_0x22583f];return _0x3bc272;}function readPackageScripts(_0x30708f){const _0x46b0a7=a182_0x3bc2,_0x1980fb=resolve(_0x30708f,'package.json');if(!existsSync(_0x1980fb))return null;try{const _0x13968d=JSON[_0x46b0a7(0x1d7)](readFileSync(_0x1980fb,_0x46b0a7(0x208)));return _0x13968d[_0x46b0a7(0x214)]??{};}catch{return null;}}function detectPackageManager(_0x324c65){const _0xa21266=a182_0x3bc2;if(existsSync(resolve(_0x324c65,_0xa21266(0x1d8)))||existsSync(resolve(_0x324c65,_0xa21266(0x1ec))))return _0xa21266(0x211);if(existsSync(resolve(_0x324c65,_0xa21266(0x1fc))))return _0xa21266(0x212);if(existsSync(resolve(_0x324c65,_0xa21266(0x1fa))))return'yarn';return _0xa21266(0x205);}async function versionCheck(_0x51556d){const _0x456779=a182_0x3bc2,_0x119f90=await checkCliVersion();(_0x119f90['needsUpgrade']||_0x119f90[_0x456779(0x1ed)])&&(printCliUpgradeWarning(_0x119f90),assertCliVersionSupported(_0x119f90));const _0x379593=await checkSdkVersion(_0x51556d);if(_0x379593[_0x456779(0x1e1)])printSdkUpgradeWarning(_0x379593);}function spawnScript(_0x5aa92b,_0x562c56,_0x157be7,_0x3234a5){return new Promise((_0x2fb929,_0x1772dd)=>{const _0x427951=a182_0x3bc2,_0x1d385e=['run',_0x562c56,..._0x157be7],_0x1e4e8d=spawn(_0x5aa92b,_0x1d385e,{'cwd':_0x3234a5,'stdio':_0x427951(0x20e),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3234a5,_0x427951(0x1f9),_0x427951(0x1f3))+delimiter+process.env.PATH}});_0x1e4e8d['on']('close',_0xf639ff=>{const _0xbad69b=_0x427951;if(_0xf639ff===0x0||_0xf639ff===null)_0x2fb929();else _0x1772dd(new Error(_0x5aa92b+_0xbad69b(0x1f7)+_0x562c56+'\x20exited\x20with\x20code\x20'+_0xf639ff));}),_0x1e4e8d['on'](_0x427951(0x1f2),_0x1772dd);});}function spawnViteBuildWatch(_0x1e6775){return new Promise((_0x4c6dcf,_0x343df5)=>{const _0x4b57b2=a182_0x3bc2,_0x3bf68d=spawn(_0x4b57b2(0x1e8),[_0x4b57b2(0x202),_0x4b57b2(0x1da)],{'cwd':_0x1e6775,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x1e6775,'node_modules',_0x4b57b2(0x1f3))+delimiter+process.env.PATH}});_0x3bf68d['on'](_0x4b57b2(0x20d),_0xb96cb3=>{const _0x5cca8f=_0x4b57b2;if(_0xb96cb3===0x0||_0xb96cb3===null)_0x4c6dcf();else _0x343df5(new Error(_0x5cca8f(0x1e7)+_0xb96cb3));}),_0x3bf68d['on'](_0x4b57b2(0x1f2),_0x343df5);});}function spawnVitePreview(_0x2d235c){return new Promise((_0x2f69ac,_0x3680ee)=>{const _0x5927e7=a182_0x3bc2,_0x36651c=spawn(_0x5927e7(0x1e8),[_0x5927e7(0x1e4)],{'cwd':_0x2d235c,'stdio':_0x5927e7(0x20e),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2d235c,_0x5927e7(0x1f9),_0x5927e7(0x1f3))+delimiter+process.env.PATH}});_0x36651c['on'](_0x5927e7(0x20d),_0x52ccae=>{const _0x2292d9=_0x5927e7;if(_0x52ccae===0x0||_0x52ccae===null)_0x2f69ac();else _0x3680ee(new Error(_0x2292d9(0x1db)+_0x52ccae));}),_0x36651c['on'](_0x5927e7(0x1f2),_0x3680ee);});}const runFlags=[{'name':a182_0x3d3ea3(0x1ee),'type':a182_0x3d3ea3(0x210),'description':a182_0x3d3ea3(0x206),'default':![]}];export const runDefinition={'service':a182_0x3d3ea3(0x1f6),'command':'run','description':'Run\x20a\x20package.json\x20script','risk':a182_0x3d3ea3(0x1ff),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a182_0x3d3ea3(0x20b),'description':a182_0x3d3ea3(0x1e6),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x200463=a182_0x3d3ea3,_0x9c9db6=[];return _0x9c9db6[_0x200463(0x1f0)]('\x20\x20EXAMPLES'),_0x9c9db6[_0x200463(0x1f0)](_0x200463(0x1fb)+CLI_BIN_NAME+_0x200463(0x203)),_0x9c9db6['push'](_0x200463(0x1fb)+CLI_BIN_NAME+_0x200463(0x1dc)),_0x9c9db6[_0x200463(0x1f0)](_0x200463(0x1fb)+CLI_BIN_NAME+_0x200463(0x20f)),_0x9c9db6[_0x200463(0x1f0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x200463(0x1f5)),_0x9c9db6['join']('\x0a');},async 'execute'(_0xa7fa67){const _0x590706=a182_0x3d3ea3,_0x2c015c=process[_0x590706(0x204)](),_0x1303f9=_0xa7fa67['args'][0x0],_0x540184=_0xa7fa67[_0x590706(0x1de)]['slice'](0x1),_0x19acb5=readPackageScripts(_0x2c015c);if(!_0x19acb5)throw CliErrors[_0x590706(0x1e2)](_0x590706(0x20c));if(!_0x1303f9){const _0x3ce00a=Object['keys'](_0x19acb5);if(_0x3ce00a['length']===0x0)console[_0x590706(0x1e9)](_0x590706(0x1dd));else{console[_0x590706(0x1e9)](_0x590706(0x207));for(const _0x5e6fec of _0x3ce00a){console[_0x590706(0x1e9)](_0x590706(0x1fb)+_0x5e6fec);}console['log'](_0x590706(0x1df)+CLI_BIN_NAME+_0x590706(0x1fd));}return{'ok':!![]};}if(!_0x19acb5[_0x1303f9])throw CliErrors[_0x590706(0x1e2)]('Script\x20\x22'+_0x1303f9+_0x590706(0x1f8),_0x590706(0x1e0)+(Object[_0x590706(0x1d9)](_0x19acb5)['join'](',\x20')||_0x590706(0x1fe)));const _0x571306=detectPackageManager(_0x2c015c);VERSION_CHECK_SCRIPTS[_0x590706(0x201)](_0x1303f9)&&await versionCheck(_0x2c015c);if(_0x1303f9===_0x590706(0x1e4)&&_0xa7fa67[_0x590706(0x1ef)](_0x590706(0x1ee)))return await Promise['all']([spawnViteBuildWatch(_0x2c015c),spawnVitePreview(_0x2c015c)]),{'ok':!![]};return await spawnScript(_0x571306,_0x1303f9,_0x540184,_0x2c015c),{'ok':!![]};}};
1
+ const a183_0x231dca=a183_0x383a;(function(_0x2b86c1,_0x34261c){const _0x163a61=a183_0x383a,_0x13618b=_0x2b86c1();while(!![]){try{const _0x258441=-parseInt(_0x163a61(0x203))/0x1+parseInt(_0x163a61(0x1fb))/0x2+parseInt(_0x163a61(0x1e5))/0x3*(-parseInt(_0x163a61(0x1e4))/0x4)+-parseInt(_0x163a61(0x219))/0x5+parseInt(_0x163a61(0x1ff))/0x6*(parseInt(_0x163a61(0x1f2))/0x7)+-parseInt(_0x163a61(0x1ec))/0x8*(-parseInt(_0x163a61(0x1ef))/0x9)+-parseInt(_0x163a61(0x205))/0xa*(-parseInt(_0x163a61(0x218))/0xb);if(_0x258441===_0x34261c)break;else _0x13618b['push'](_0x13618b['shift']());}catch(_0xb76fde){_0x13618b['push'](_0x13618b['shift']());}}}(a183_0x310a,0x3d19f));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';function a183_0x383a(_0x3f8693,_0x3e2755){_0x3f8693=_0x3f8693-0x1dc;const _0x310a73=a183_0x310a();let _0x383a2d=_0x310a73[_0x3f8693];return _0x383a2d;}import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a183_0x231dca(0x1f1),a183_0x231dca(0x1e8)]);function readPackageScripts(_0x56ed7a){const _0x4e0e10=a183_0x231dca,_0x57751d=resolve(_0x56ed7a,_0x4e0e10(0x1ea));if(!existsSync(_0x57751d))return null;try{const _0x2e2595=JSON[_0x4e0e10(0x21b)](readFileSync(_0x57751d,_0x4e0e10(0x217)));return _0x2e2595[_0x4e0e10(0x201)]??{};}catch{return null;}}function detectPackageManager(_0x5d14d8){const _0x1d05d3=a183_0x231dca;if(existsSync(resolve(_0x5d14d8,_0x1d05d3(0x20b)))||existsSync(resolve(_0x5d14d8,_0x1d05d3(0x1fa))))return _0x1d05d3(0x214);if(existsSync(resolve(_0x5d14d8,'pnpm-lock.yaml')))return _0x1d05d3(0x20f);if(existsSync(resolve(_0x5d14d8,_0x1d05d3(0x1dd))))return _0x1d05d3(0x1e2);return _0x1d05d3(0x20e);}async function versionCheck(_0x322581){const _0x48b6c5=a183_0x231dca,_0x34e783=await checkCliVersion();(_0x34e783[_0x48b6c5(0x1dc)]||_0x34e783[_0x48b6c5(0x20a)])&&(printCliUpgradeWarning(_0x34e783),assertCliVersionSupported(_0x34e783));const _0x47b349=await checkSdkVersion(_0x322581);if(_0x47b349[_0x48b6c5(0x1dc)])printSdkUpgradeWarning(_0x47b349);}function spawnScript(_0x3ab3ac,_0x58589a,_0x11dd80,_0x1dc92e){return new Promise((_0x4f8c97,_0x4718e3)=>{const _0x436570=a183_0x383a,_0xf63c2d=[_0x436570(0x1ee),_0x58589a,..._0x11dd80],_0x109133=spawn(_0x3ab3ac,_0xf63c2d,{'cwd':_0x1dc92e,'stdio':_0x436570(0x1f6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1dc92e,'node_modules','.bin')+delimiter+process.env.PATH}});_0x109133['on']('close',_0xacd72a=>{const _0x150d1f=_0x436570;if(_0xacd72a===0x0||_0xacd72a===null)_0x4f8c97();else _0x4718e3(new Error(_0x3ab3ac+_0x150d1f(0x207)+_0x58589a+_0x150d1f(0x1fe)+_0xacd72a));}),_0x109133['on'](_0x436570(0x211),_0x4718e3);});}function spawnViteBuildWatch(_0x2f92e5){return new Promise((_0x252381,_0x2ce86c)=>{const _0x2b2a40=a183_0x383a,_0x56bea4=spawn('vite',[_0x2b2a40(0x1ed),_0x2b2a40(0x213)],{'cwd':_0x2f92e5,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x2f92e5,_0x2b2a40(0x208),'.bin')+delimiter+process.env.PATH}});_0x56bea4['on'](_0x2b2a40(0x1e9),_0x13c7d0=>{const _0x187c98=_0x2b2a40;if(_0x13c7d0===0x0||_0x13c7d0===null)_0x252381();else _0x2ce86c(new Error(_0x187c98(0x1eb)+_0x13c7d0));}),_0x56bea4['on']('error',_0x2ce86c);});}function spawnVitePreview(_0x39dd0e){return new Promise((_0x74ebff,_0x12a792)=>{const _0x12c356=a183_0x383a,_0x5c869f=spawn(_0x12c356(0x1e6),[_0x12c356(0x1df)],{'cwd':_0x39dd0e,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x39dd0e,_0x12c356(0x208),_0x12c356(0x21a))+delimiter+process.env.PATH}});_0x5c869f['on']('close',_0x476a29=>{const _0xea0264=_0x12c356;if(_0x476a29===0x0||_0x476a29===null)_0x74ebff();else _0x12a792(new Error(_0xea0264(0x1de)+_0x476a29));}),_0x5c869f['on']('error',_0x12a792);});}function a183_0x310a(){const _0x2e051e=['489392JAloPj','script','\x0a\x20\x20Available\x20scripts:\x0a','\x20exited\x20with\x20code\x20','144lxBmOY','keys','scripts','\x0a\x20\x20Usage:\x20','112418meMlCN','has','10NJvKRf','Script\x20name\x20defined\x20in\x20package.json','\x20run\x20','node_modules','push','belowMinimum','bun.lockb','Run\x20a\x20package.json\x20script','validation','npm','pnpm','cwd','error','length','--watch','bun','Available:\x20','watch','utf-8','3615524EombVi','2448020zpZpDY','.bin','parse','needsUpgrade','yarn.lock','vite\x20preview\x20exited\x20with\x20code\x20','preview','slice','\x20\x20\x20\x20','yarn','\x20run\x20start','4UWsFgw','708219Crjzay','vite','join','dev','close','package.json','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','561712ovcjUE','build','run','27aMskzj','Script\x20\x22','start','88767KxdNnq','Enable\x20watch\x20mode\x20for\x20preview','(none)','\x20run\x20build','inherit','log','\x20run\x20preview','write','bun.lock'];a183_0x310a=function(){return _0x2e051e;};return a183_0x310a();}const runFlags=[{'name':'watch','type':'boolean','description':a183_0x231dca(0x1f3),'default':![]}];export const runDefinition={'service':a183_0x231dca(0x1ee),'command':'run','description':a183_0x231dca(0x20c),'risk':a183_0x231dca(0x1f9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a183_0x231dca(0x1fc),'description':a183_0x231dca(0x206),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x5227d3=a183_0x231dca,_0x4b124d=[];return _0x4b124d['push']('\x20\x20EXAMPLES'),_0x4b124d['push'](_0x5227d3(0x1e1)+CLI_BIN_NAME+_0x5227d3(0x1e3)),_0x4b124d[_0x5227d3(0x209)](_0x5227d3(0x1e1)+CLI_BIN_NAME+_0x5227d3(0x1f5)),_0x4b124d[_0x5227d3(0x209)](_0x5227d3(0x1e1)+CLI_BIN_NAME+_0x5227d3(0x1f8)),_0x4b124d['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x4b124d[_0x5227d3(0x1e7)]('\x0a');},async 'execute'(_0x266451){const _0x32bb05=a183_0x231dca,_0x112612=process[_0x32bb05(0x210)](),_0x3ab21d=_0x266451['args'][0x0],_0x3f57bd=_0x266451['args'][_0x32bb05(0x1e0)](0x1),_0x49319e=readPackageScripts(_0x112612);if(!_0x49319e)throw CliErrors[_0x32bb05(0x20d)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x3ab21d){const _0x104443=Object[_0x32bb05(0x200)](_0x49319e);if(_0x104443[_0x32bb05(0x212)]===0x0)console[_0x32bb05(0x1f7)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console[_0x32bb05(0x1f7)](_0x32bb05(0x1fd));for(const _0x2ef9ab of _0x104443){console[_0x32bb05(0x1f7)]('\x20\x20\x20\x20'+_0x2ef9ab);}console[_0x32bb05(0x1f7)](_0x32bb05(0x202)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x49319e[_0x3ab21d])throw CliErrors[_0x32bb05(0x20d)](_0x32bb05(0x1f0)+_0x3ab21d+'\x22\x20not\x20found\x20in\x20package.json.',_0x32bb05(0x215)+(Object[_0x32bb05(0x200)](_0x49319e)[_0x32bb05(0x1e7)](',\x20')||_0x32bb05(0x1f4)));const _0x38c9dd=detectPackageManager(_0x112612);VERSION_CHECK_SCRIPTS[_0x32bb05(0x204)](_0x3ab21d)&&await versionCheck(_0x112612);if(_0x3ab21d==='preview'&&_0x266451['bool'](_0x32bb05(0x216)))return await Promise['all']([spawnViteBuildWatch(_0x112612),spawnVitePreview(_0x112612)]),{'ok':!![]};return await spawnScript(_0x38c9dd,_0x3ab21d,_0x3f57bd,_0x112612),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a183_0x1846bd=a183_0x1ac8;function a183_0x1ac8(_0x681f3,_0x22c6fe){_0x681f3=_0x681f3-0x1be;const _0x292b97=a183_0x292b();let _0x1ac89e=_0x292b97[_0x681f3];return _0x1ac89e;}(function(_0x53eaa3,_0x314591){const _0x3c7555=a183_0x1ac8,_0x3e0694=_0x53eaa3();while(!![]){try{const _0x5e0809=parseInt(_0x3c7555(0x1c6))/0x1+-parseInt(_0x3c7555(0x1bf))/0x2+parseInt(_0x3c7555(0x1c1))/0x3+-parseInt(_0x3c7555(0x1c7))/0x4+-parseInt(_0x3c7555(0x1c3))/0x5*(-parseInt(_0x3c7555(0x1be))/0x6)+parseInt(_0x3c7555(0x1c5))/0x7+-parseInt(_0x3c7555(0x1c0))/0x8;if(_0x5e0809===_0x314591)break;else _0x3e0694['push'](_0x3e0694['shift']());}catch(_0x2363fd){_0x3e0694['push'](_0x3e0694['shift']());}}}(a183_0x292b,0x9188d));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x530cb6){const _0x546a3e=await buildSchemaPayload();return{'ok':!![],'data':_0x546a3e};}function a183_0x292b(){const _0x40530f=['438003OdNlQy','Export\x20machine-readable\x20command\x20schema\x20(JSON)','82490nDDBYM','schema','5016900JbTQwV','500268hMYPdd','3935616UJqCnd','318DuUQsL','1286102ChLuXu','114392KQLnWl'];a183_0x292b=function(){return _0x40530f;};return a183_0x292b();}export const schemaDefinition={'service':a183_0x1846bd(0x1c4),'command':'export','description':a183_0x1846bd(0x1c2),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
1
+ const a184_0x5ac2a7=a184_0x4d83;(function(_0x499f43,_0xa82988){const _0x25bd61=a184_0x4d83,_0x44dd64=_0x499f43();while(!![]){try{const _0xfec7cb=-parseInt(_0x25bd61(0x119))/0x1+-parseInt(_0x25bd61(0x11e))/0x2*(-parseInt(_0x25bd61(0x113))/0x3)+-parseInt(_0x25bd61(0x117))/0x4+parseInt(_0x25bd61(0x120))/0x5+-parseInt(_0x25bd61(0x118))/0x6*(-parseInt(_0x25bd61(0x11b))/0x7)+-parseInt(_0x25bd61(0x114))/0x8+parseInt(_0x25bd61(0x115))/0x9*(parseInt(_0x25bd61(0x11a))/0xa);if(_0xfec7cb===_0xa82988)break;else _0x44dd64['push'](_0x44dd64['shift']());}catch(_0x3e3f09){_0x44dd64['push'](_0x44dd64['shift']());}}}(a184_0x251b,0x27156));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x8e39b2){const _0x40224c=await buildSchemaPayload();return{'ok':!![],'data':_0x40224c};}export const schemaDefinition={'service':a184_0x5ac2a7(0x11c),'command':a184_0x5ac2a7(0x116),'description':a184_0x5ac2a7(0x11d),'risk':a184_0x5ac2a7(0x11f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a184_0x5ac2a7(0x121),'flags':[],'execute':execute};function a184_0x4d83(_0x2d0a67,_0x69b372){_0x2d0a67=_0x2d0a67-0x113;const _0x251b70=a184_0x251b();let _0x4d83d1=_0x251b70[_0x2d0a67];return _0x4d83d1;}function a184_0x251b(){const _0x49601a=['7976uNcvMt','read','895545CDSsLt','json','9cmkuSY','565704tyJhrl','2205bCfRjx','export','1218676yETtFo','6uPFafC','237731HPZZLR','16010Nevarw','1329167zIhaNt','schema','Export\x20machine-readable\x20command\x20schema\x20(JSON)'];a184_0x251b=function(){return _0x49601a;};return a184_0x251b();}
@@ -1 +1 @@
1
- const a184_0x17ea2a=a184_0x1f1d;(function(_0x5e3b35,_0x4c1dfe){const _0x3477a0=a184_0x1f1d,_0x280730=_0x5e3b35();while(!![]){try{const _0x1b74e7=parseInt(_0x3477a0(0x10d))/0x1+parseInt(_0x3477a0(0x11f))/0x2+parseInt(_0x3477a0(0xeb))/0x3+parseInt(_0x3477a0(0x109))/0x4*(parseInt(_0x3477a0(0x107))/0x5)+-parseInt(_0x3477a0(0x100))/0x6+-parseInt(_0x3477a0(0xf2))/0x7+-parseInt(_0x3477a0(0xf7))/0x8*(parseInt(_0x3477a0(0xed))/0x9);if(_0x1b74e7===_0x4c1dfe)break;else _0x280730['push'](_0x280730['shift']());}catch(_0x1fe016){_0x280730['push'](_0x280730['shift']());}}}(a184_0x1a73,0x487ff));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';function a184_0x1f1d(_0x3591e8,_0x3a90ff){_0x3591e8=_0x3591e8-0xe0;const _0x1a73e7=a184_0x1a73();let _0x1f1d49=_0x1a73e7[_0x3591e8];return _0x1f1d49;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';function a184_0x1a73(){const _0xc5f6cd=['MyBatis\x20XML(mybatisXml)','✎\x20手动输入\x20dbId','str','dbId\x20不能为空','map','write','Invalid\x20database\x20selection\x20payload:\x20','请选择本地\x20SQL\x20模式:','请输入目标数据库\x20dbId:','lastSync','__manual__','catch','Created\x20SQL\x20query\x20','isInteger','416452IRKLTT','Local\x20SQL\x20file\x20mode','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','toISOString','create','sqlCode','length','string','File\x20already\x20exists:\x20','name','dbName','stringify','db-id','1330116ujDIYG','new','27SmBqZZ','dbId\x20必须为正整数','validation','trim','number','2291254PaRHgl','SQL\x20query\x20display\x20name','sql','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','sqls','1546368hxBZEB','appCode','Target\x20database\x20ID','utf8','</select>','sqlName','dbId','<server-generated-sqlCode>','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','845418xwFMya','mode','mybatisXml','join','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','flag','flagMissing','85010pTWqOn','sqlRootDir','100bXXLZu','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','SELECT\x201\x20AS\x20id;','POST','268424ehKkOt','nonInteractive','isFinite','适合带动态标签的\x20MyBatis\x20XML\x20SQL'];a184_0x1a73=function(){return _0xc5f6cd;};return a184_0x1a73();}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x2d5468){const _0x76ca03=a184_0x1f1d;if(_0x2d5468===_0x76ca03(0x102))return[_0x76ca03(0x10a),'\x20\x20SELECT\x201\x20AS\x20id',_0x76ca03(0xfb),''][_0x76ca03(0x103)]('\x0a');return[_0x76ca03(0x10b),'']['join']('\x0a');}export const sqlCreate={'service':'sql','command':a184_0x17ea2a(0xe2),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a184_0x17ea2a(0x116),'flags':[{'name':a184_0x17ea2a(0xe7),'type':a184_0x17ea2a(0xe5),'description':a184_0x17ea2a(0xf3)},{'name':a184_0x17ea2a(0xea),'type':a184_0x17ea2a(0xf1),'description':a184_0x17ea2a(0xf9)},{'name':a184_0x17ea2a(0x101),'type':a184_0x17ea2a(0xe5),'enum':[a184_0x17ea2a(0xf4),'mybatisXml'],'description':a184_0x17ea2a(0x120)}],async 'validate'(_0x1e872f){const _0x42ffc2=a184_0x17ea2a;if(!_0x1e872f['nonInteractive'])return;if(!_0x1e872f[_0x42ffc2(0x113)](_0x42ffc2(0xe7))[_0x42ffc2(0xf0)]())throw CliErrors[_0x42ffc2(0x106)](_0x42ffc2(0xe7),_0x42ffc2(0xe0));const _0x50c504=resolveProvidedDbId(_0x1e872f);if(typeof _0x50c504!=='number'||!Number[_0x42ffc2(0x10f)](_0x50c504)||_0x50c504<=0x0)throw CliErrors['flagMissing'](_0x42ffc2(0xea),_0x42ffc2(0xf5));if(!_0x1e872f['str'](_0x42ffc2(0x101))[_0x42ffc2(0xf0)]())throw CliErrors[_0x42ffc2(0x106)]('mode',_0x42ffc2(0x104));},async 'dryRun'(_0x35fa68){const _0x13cd56=a184_0x17ea2a,_0x1bcfa5=loadSqlProjectConfig(_0x35fa68[_0x13cd56(0xf8)]),{sqlName:_0x22dbcd,dbId:_0xae6863,dbName:_0x182617,mode:_0x40099e}=await resolveSqlNewInputs(_0x35fa68),_0x3e455d=buildSqlRelativePath(_0x13cd56(0xfe),_0x22dbcd,_0x182617,_0x40099e,_0xae6863),_0x522983=_0x1bcfa5['sqlRootDir']+'/'+_0x3e455d;return{'method':_0x13cd56(0x10c),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x35fa68[_0x13cd56(0xf8)],'sqlName':_0x22dbcd,'dbId':_0xae6863,'mode':_0x40099e,'localPath':_0x522983},'description':_0x13cd56(0xff)+_0x1bcfa5[_0x13cd56(0x108)]};},async 'execute'(_0x5e32f1){const _0x4304f2=a184_0x17ea2a,_0xa761bd=loadSqlProjectConfig(_0x5e32f1['appCode']),{sqlName:_0xa98927,dbId:_0xc27f41,dbName:_0x258e19,mode:_0x4438a}=await resolveSqlNewInputs(_0x5e32f1),_0x20f238=generateSqlTemplate(_0x4438a),_0x52447f=await createSqlQuery({'appCode':_0x5e32f1[_0x4304f2(0xf8)],'sqlName':_0xa98927,'dbId':_0xc27f41,'sqlContent':_0x20f238}),_0x289cfb=ensureRemoteSqlContent(_0x52447f),_0x3b4a46=_0x258e19||await getDbName(_0x5e32f1['appCode'],_0xc27f41)[_0x4304f2(0x11c)](()=>undefined),_0x3d1d18=buildSqlRelativePath(_0x52447f['sqlCode'],_0x52447f['sqlName'],_0x3b4a46,_0x4438a,_0xc27f41),_0x1fb5e6=_0xa761bd[_0x4304f2(0x108)]+'/'+_0x3d1d18,_0x3ad4e8=buildLocalSqlFileContent({'sqlCode':_0x52447f[_0x4304f2(0xe3)],'sqlName':_0x52447f[_0x4304f2(0xfc)],'dbId':_0x52447f['dbId']},_0x289cfb,{'dbName':_0x3b4a46,'mode':_0x4438a,'syncedAt':new Date()[_0x4304f2(0xe1)](),'description':_0x52447f['description']});if(await fileExists(_0x1fb5e6))throw CliErrors[_0x4304f2(0xef)](_0x4304f2(0xe6)+_0x1fb5e6);await ensureParentDirectory(_0x1fb5e6),await writeFile(_0x1fb5e6,_0x3ad4e8,_0x4304f2(0xfa));const _0xbe2d51=await readSqlLockFile(_0xa761bd['lockFilePath']),{lockData:_0x296bd4,appLock:_0x26471c}=ensureSqlLockScope(_0xbe2d51??createEmptySqlLock(),_0xa761bd[_0x4304f2(0xf8)],_0xa761bd['sqlRoot'],_0x4304f2(0xec));return _0x26471c[_0x4304f2(0xf6)][_0x52447f['sqlCode']]={...buildSqlLockEntry(_0x52447f,_0x289cfb,computeSqlContentHash(_0x3ad4e8),{'dbName':_0x3b4a46}),'path':_0x3d1d18,'mode':_0x4438a},_0x26471c[_0x4304f2(0x11a)]=new Date()[_0x4304f2(0xe1)](),await writeSqlLockFile(_0xa761bd['lockFilePath'],_0x296bd4),{'ok':!![],'data':{'id':_0x52447f['id'],'sqlCode':_0x52447f[_0x4304f2(0xe3)],'sqlName':_0x52447f[_0x4304f2(0xfc)],'dbId':_0x52447f['dbId'],'path':_0x1fb5e6,'mode':_0x4438a},'message':_0x4304f2(0x11d)+_0x52447f['sqlCode']};}};async function resolveSqlNewInputs(_0x426f26){const _0x531412=await resolveSqlNameInput(_0x426f26),{dbId:_0x46a44b,dbName:_0xfb3533}=await resolveDbSelection(_0x426f26),_0x6ed5a1=await resolveSqlModeInput(_0x426f26);return{'sqlName':_0x531412,'dbId':_0x46a44b,'dbName':_0xfb3533,'mode':_0x6ed5a1};}async function resolveSqlNameInput(_0x20a4c2){const _0x4a3bd8=a184_0x17ea2a,_0x416ea6=_0x20a4c2['str'](_0x4a3bd8(0xe7))[_0x4a3bd8(0xf0)]();if(_0x416ea6)return _0x416ea6;if(_0x20a4c2[_0x4a3bd8(0x10e)])throw CliErrors[_0x4a3bd8(0x106)](_0x4a3bd8(0xe7),_0x4a3bd8(0xe0));return(await input({'message':'请输入\x20SQL\x20名称:','validate':_0x284c8a=>_0x284c8a[_0x4a3bd8(0xf0)]()?!![]:'SQL\x20名称不能为空'}))[_0x4a3bd8(0xf0)]();}async function resolveDbSelection(_0x5faf8d){const _0x4270d0=a184_0x17ea2a,_0xd582c0=resolveProvidedDbId(_0x5faf8d);if(typeof _0xd582c0===_0x4270d0(0xf1)&&Number['isFinite'](_0xd582c0)&&_0xd582c0>0x0)return{'dbId':_0xd582c0,'dbName':await getDbName(_0x5faf8d['appCode'],_0xd582c0)[_0x4270d0(0x11c)](()=>undefined)};if(_0x5faf8d['nonInteractive'])throw CliErrors[_0x4270d0(0x106)](_0x4270d0(0xea),_0x4270d0(0xf5));const _0x2925f9=await listDatabases(_0x5faf8d[_0x4270d0(0xf8)])['catch'](()=>[]);if(_0x2925f9[_0x4270d0(0xe4)]===0x1)return{'dbId':_0x2925f9[0x0][_0x4270d0(0xfd)],'dbName':_0x2925f9[0x0]['dbName']};if(_0x2925f9['length']>0x1){const _0x2d39bc=await select({'message':'请选择目标数据库:','choices':[..._0x2925f9[_0x4270d0(0x115)](_0x734b2d=>({'name':_0x734b2d[_0x4270d0(0xe8)]+'\x20('+_0x734b2d[_0x4270d0(0xfd)]+')','value':serializeDbSelection(_0x734b2d)})),{'name':_0x4270d0(0x112),'value':'__manual__'}]});if(_0x2d39bc!==_0x4270d0(0x11b))return deserializeDbSelection(_0x2d39bc);}const _0x411f2c=await input({'message':_0x4270d0(0x119),'validate':_0x10c149=>{const _0x33d5cf=_0x4270d0,_0x1bf166=_0x10c149[_0x33d5cf(0xf0)]();if(!_0x1bf166)return _0x33d5cf(0x114);const _0x178a00=Number(_0x1bf166);if(!Number[_0x33d5cf(0x11e)](_0x178a00)||_0x178a00<=0x0)return _0x33d5cf(0xee);return!![];}});return{'dbId':Number(_0x411f2c['trim']())};}async function resolveSqlModeInput(_0x18b84f){const _0x26db8e=a184_0x17ea2a,_0x424721=_0x18b84f[_0x26db8e(0x113)](_0x26db8e(0x101))[_0x26db8e(0xf0)]();if(_0x424721===_0x26db8e(0xf4)||_0x424721===_0x26db8e(0x102))return _0x424721;if(_0x18b84f[_0x26db8e(0x10e)])throw CliErrors['flagMissing'](_0x26db8e(0x101),_0x26db8e(0x104));return await select({'message':_0x26db8e(0x118),'choices':[{'name':'普通\x20SQL(sql)','value':_0x26db8e(0xf4),'description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':_0x26db8e(0x111),'value':_0x26db8e(0x102),'description':_0x26db8e(0x110)}]});}function serializeDbSelection(_0x1e18e3){const _0x4bffb4=a184_0x17ea2a;return JSON[_0x4bffb4(0xe9)]({'dbId':_0x1e18e3['dbId'],'dbName':_0x1e18e3[_0x4bffb4(0xe8)]});}function deserializeDbSelection(_0x13ae92){const _0x217810=a184_0x17ea2a;try{const _0x5cef3b=JSON['parse'](_0x13ae92);if(typeof _0x5cef3b[_0x217810(0xfd)]==='number'&&Number[_0x217810(0x10f)](_0x5cef3b[_0x217810(0xfd)]))return{'dbId':_0x5cef3b[_0x217810(0xfd)],'dbName':_0x5cef3b[_0x217810(0xe8)]};}catch{}throw CliErrors['validation'](_0x217810(0x117)+_0x13ae92);}function resolveProvidedDbId(_0x3120cf){const _0x3bdb2b=a184_0x17ea2a,_0x22b77f=_0x3120cf[_0x3bdb2b(0x105)](_0x3bdb2b(0xea));if(typeof _0x22b77f===_0x3bdb2b(0xf1)&&Number[_0x3bdb2b(0x10f)](_0x22b77f))return _0x22b77f;return undefined;}
1
+ const a185_0x3f5031=a185_0x3eb3;(function(_0x4cbf60,_0x407c65){const _0x143f05=a185_0x3eb3,_0x56e715=_0x4cbf60();while(!![]){try{const _0x1c5f67=-parseInt(_0x143f05(0xcc))/0x1*(-parseInt(_0x143f05(0xc4))/0x2)+-parseInt(_0x143f05(0xa4))/0x3*(-parseInt(_0x143f05(0xc2))/0x4)+-parseInt(_0x143f05(0xc9))/0x5+-parseInt(_0x143f05(0xd0))/0x6+parseInt(_0x143f05(0x99))/0x7*(parseInt(_0x143f05(0xc8))/0x8)+-parseInt(_0x143f05(0xd6))/0x9+-parseInt(_0x143f05(0xad))/0xa*(-parseInt(_0x143f05(0xa8))/0xb);if(_0x1c5f67===_0x407c65)break;else _0x56e715['push'](_0x56e715['shift']());}catch(_0xd4302a){_0x56e715['push'](_0x56e715['shift']());}}}(a185_0x24a9,0xb247d));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';function a185_0x24a9(){const _0x5a0385=['create','</select>','isInteger','21koxfYg','dbName','sqlCode','toISOString','5297281NrbcQu','sqlRootDir','new','db-id','lockFilePath','20SjrKcz','catch','appCode','/smartapi/custom/saveUserCustomSql','name','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','sqlRoot','Local\x20SQL\x20file\x20mode','lastSync','length','flag','Target\x20database\x20ID','dbId\x20必须为正整数','dbId','mybatisXml','validation','number','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','sqls','<server-generated-sqlCode>','✎\x20手动输入\x20dbId','489708tNcSyU','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','290XrpULP','\x20\x20SELECT\x201\x20AS\x20id','sqlName','write','208mwrWMq','3360345pOjWrL','sql','utf8','5114sPDOjz','str','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','请选择目标数据库:','6107508ToBPMq','请选择本地\x20SQL\x20模式:','isFinite','flagMissing','适合带动态标签的\x20MyBatis\x20XML\x20SQL','dbId\x20不能为空','6473115pAAEsC','stringify','parse','trim','POST','join','MyBatis\x20XML(mybatisXml)','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','mode','__manual__','SQL\x20query\x20display\x20name','map','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','155561doWvdI','Created\x20SQL\x20query\x20','请输入\x20SQL\x20名称:','请输入目标数据库\x20dbId:','普通\x20SQL(sql)','SELECT\x201\x20AS\x20id;','nonInteractive','string'];a185_0x24a9=function(){return _0x5a0385;};return a185_0x24a9();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';function a185_0x3eb3(_0x499123,_0x57a116){_0x499123=_0x499123-0x92;const _0x24a9b5=a185_0x24a9();let _0x3eb3ef=_0x24a9b5[_0x499123];return _0x3eb3ef;}import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x58b7d6){const _0x4ad693=a185_0x3eb3;if(_0x58b7d6===_0x4ad693(0xbb))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x4ad693(0xc5),_0x4ad693(0xa2),''][_0x4ad693(0xdb)]('\x0a');return[_0x4ad693(0x9e),''][_0x4ad693(0xdb)]('\x0a');}export const sqlCreate={'service':'sql','command':a185_0x3f5031(0xa1),'description':a185_0x3f5031(0xc3),'risk':a185_0x3f5031(0xc7),'flags':[{'name':a185_0x3f5031(0xb1),'type':a185_0x3f5031(0xa0),'description':a185_0x3f5031(0x96)},{'name':'db-id','type':a185_0x3f5031(0xbd),'description':a185_0x3f5031(0xb8)},{'name':a185_0x3f5031(0x94),'type':a185_0x3f5031(0xa0),'enum':[a185_0x3f5031(0xca),a185_0x3f5031(0xbb)],'description':a185_0x3f5031(0xb4)}],async 'validate'(_0x6110a4){const _0x1b60b0=a185_0x3f5031;if(!_0x6110a4[_0x1b60b0(0x9f)])return;if(!_0x6110a4[_0x1b60b0(0xcd)](_0x1b60b0(0xb1))[_0x1b60b0(0xd9)]())throw CliErrors[_0x1b60b0(0xd3)](_0x1b60b0(0xb1),_0x1b60b0(0xce));const _0x593648=resolveProvidedDbId(_0x6110a4);if(typeof _0x593648!=='number'||!Number[_0x1b60b0(0xd2)](_0x593648)||_0x593648<=0x0)throw CliErrors['flagMissing'](_0x1b60b0(0xab),_0x1b60b0(0x98));if(!_0x6110a4['str'](_0x1b60b0(0x94))[_0x1b60b0(0xd9)]())throw CliErrors[_0x1b60b0(0xd3)]('mode',_0x1b60b0(0x93));},async 'dryRun'(_0x4c3583){const _0x4fd68d=a185_0x3f5031,_0x2613d7=loadSqlProjectConfig(_0x4c3583[_0x4fd68d(0xaf)]),{sqlName:_0xaabb2c,dbId:_0x192a12,dbName:_0x5ddc62,mode:_0x59c95a}=await resolveSqlNewInputs(_0x4c3583),_0x24cee7=buildSqlRelativePath(_0x4fd68d(0xc0),_0xaabb2c,_0x5ddc62,_0x59c95a,_0x192a12),_0x41cb7b=_0x2613d7[_0x4fd68d(0xa9)]+'/'+_0x24cee7;return{'method':_0x4fd68d(0xda),'url':_0x4fd68d(0xb0),'body':{'appCode':_0x4c3583[_0x4fd68d(0xaf)],'sqlName':_0xaabb2c,'dbId':_0x192a12,'mode':_0x59c95a,'localPath':_0x41cb7b},'description':_0x4fd68d(0xb2)+_0x2613d7[_0x4fd68d(0xa9)]};},async 'execute'(_0x14857a){const _0x18134f=a185_0x3f5031,_0x3a3a24=loadSqlProjectConfig(_0x14857a['appCode']),{sqlName:_0x33dee9,dbId:_0x3ef6fb,dbName:_0x343312,mode:_0x5bc255}=await resolveSqlNewInputs(_0x14857a),_0x425df9=generateSqlTemplate(_0x5bc255),_0x2c0182=await createSqlQuery({'appCode':_0x14857a[_0x18134f(0xaf)],'sqlName':_0x33dee9,'dbId':_0x3ef6fb,'sqlContent':_0x425df9}),_0x39a7e3=ensureRemoteSqlContent(_0x2c0182),_0x204b5e=_0x343312||await getDbName(_0x14857a['appCode'],_0x3ef6fb)[_0x18134f(0xae)](()=>undefined),_0x34f2ee=buildSqlRelativePath(_0x2c0182[_0x18134f(0xa6)],_0x2c0182[_0x18134f(0xc6)],_0x204b5e,_0x5bc255,_0x3ef6fb),_0x1f4708=_0x3a3a24[_0x18134f(0xa9)]+'/'+_0x34f2ee,_0x3c1b7f=buildLocalSqlFileContent({'sqlCode':_0x2c0182[_0x18134f(0xa6)],'sqlName':_0x2c0182['sqlName'],'dbId':_0x2c0182[_0x18134f(0xba)]},_0x39a7e3,{'dbName':_0x204b5e,'mode':_0x5bc255,'syncedAt':new Date()['toISOString'](),'description':_0x2c0182['description']});if(await fileExists(_0x1f4708))throw CliErrors[_0x18134f(0xbc)]('File\x20already\x20exists:\x20'+_0x1f4708);await ensureParentDirectory(_0x1f4708),await writeFile(_0x1f4708,_0x3c1b7f,_0x18134f(0xcb));const _0x191922=await readSqlLockFile(_0x3a3a24[_0x18134f(0xac)]),{lockData:_0x5ac44c,appLock:_0x45b4c6}=ensureSqlLockScope(_0x191922??createEmptySqlLock(),_0x3a3a24[_0x18134f(0xaf)],_0x3a3a24[_0x18134f(0xb3)],_0x18134f(0xaa));return _0x45b4c6[_0x18134f(0xbf)][_0x2c0182[_0x18134f(0xa6)]]={...buildSqlLockEntry(_0x2c0182,_0x39a7e3,computeSqlContentHash(_0x3c1b7f),{'dbName':_0x204b5e}),'path':_0x34f2ee,'mode':_0x5bc255},_0x45b4c6[_0x18134f(0xb5)]=new Date()[_0x18134f(0xa7)](),await writeSqlLockFile(_0x3a3a24['lockFilePath'],_0x5ac44c),{'ok':!![],'data':{'id':_0x2c0182['id'],'sqlCode':_0x2c0182[_0x18134f(0xa6)],'sqlName':_0x2c0182[_0x18134f(0xc6)],'dbId':_0x2c0182[_0x18134f(0xba)],'path':_0x1f4708,'mode':_0x5bc255},'message':_0x18134f(0x9a)+_0x2c0182[_0x18134f(0xa6)]};}};async function resolveSqlNewInputs(_0x5da130){const _0x126e11=await resolveSqlNameInput(_0x5da130),{dbId:_0xb5812a,dbName:_0x242e81}=await resolveDbSelection(_0x5da130),_0x52a02a=await resolveSqlModeInput(_0x5da130);return{'sqlName':_0x126e11,'dbId':_0xb5812a,'dbName':_0x242e81,'mode':_0x52a02a};}async function resolveSqlNameInput(_0x4be940){const _0x1a530a=a185_0x3f5031,_0xfa4f7b=_0x4be940[_0x1a530a(0xcd)](_0x1a530a(0xb1))[_0x1a530a(0xd9)]();if(_0xfa4f7b)return _0xfa4f7b;if(_0x4be940[_0x1a530a(0x9f)])throw CliErrors[_0x1a530a(0xd3)](_0x1a530a(0xb1),_0x1a530a(0xce));return(await input({'message':_0x1a530a(0x9b),'validate':_0x41fc5a=>_0x41fc5a[_0x1a530a(0xd9)]()?!![]:'SQL\x20名称不能为空'}))['trim']();}async function resolveDbSelection(_0x582290){const _0x7f84df=a185_0x3f5031,_0x196b77=resolveProvidedDbId(_0x582290);if(typeof _0x196b77===_0x7f84df(0xbd)&&Number[_0x7f84df(0xd2)](_0x196b77)&&_0x196b77>0x0)return{'dbId':_0x196b77,'dbName':await getDbName(_0x582290[_0x7f84df(0xaf)],_0x196b77)[_0x7f84df(0xae)](()=>undefined)};if(_0x582290['nonInteractive'])throw CliErrors[_0x7f84df(0xd3)](_0x7f84df(0xab),_0x7f84df(0x98));const _0x434e96=await listDatabases(_0x582290[_0x7f84df(0xaf)])['catch'](()=>[]);if(_0x434e96[_0x7f84df(0xb6)]===0x1)return{'dbId':_0x434e96[0x0][_0x7f84df(0xba)],'dbName':_0x434e96[0x0][_0x7f84df(0xa5)]};if(_0x434e96['length']>0x1){const _0xe6e75f=await select({'message':_0x7f84df(0xcf),'choices':[..._0x434e96[_0x7f84df(0x97)](_0x157eed=>({'name':_0x157eed['dbName']+'\x20('+_0x157eed[_0x7f84df(0xba)]+')','value':serializeDbSelection(_0x157eed)})),{'name':_0x7f84df(0xc1),'value':_0x7f84df(0x95)}]});if(_0xe6e75f!==_0x7f84df(0x95))return deserializeDbSelection(_0xe6e75f);}const _0xe94575=await input({'message':_0x7f84df(0x9c),'validate':_0x3a9504=>{const _0x531d49=_0x7f84df,_0xf23cf6=_0x3a9504[_0x531d49(0xd9)]();if(!_0xf23cf6)return _0x531d49(0xd5);const _0xf44382=Number(_0xf23cf6);if(!Number[_0x531d49(0xa3)](_0xf44382)||_0xf44382<=0x0)return _0x531d49(0xb9);return!![];}});return{'dbId':Number(_0xe94575[_0x7f84df(0xd9)]())};}async function resolveSqlModeInput(_0x2f0474){const _0x1f641c=a185_0x3f5031,_0x4b387e=_0x2f0474[_0x1f641c(0xcd)](_0x1f641c(0x94))[_0x1f641c(0xd9)]();if(_0x4b387e==='sql'||_0x4b387e==='mybatisXml')return _0x4b387e;if(_0x2f0474[_0x1f641c(0x9f)])throw CliErrors[_0x1f641c(0xd3)](_0x1f641c(0x94),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x1f641c(0xd1),'choices':[{'name':_0x1f641c(0x9d),'value':_0x1f641c(0xca),'description':_0x1f641c(0xbe)},{'name':_0x1f641c(0x92),'value':_0x1f641c(0xbb),'description':_0x1f641c(0xd4)}]});}function serializeDbSelection(_0x5b8300){const _0x5a6ee8=a185_0x3f5031;return JSON[_0x5a6ee8(0xd7)]({'dbId':_0x5b8300['dbId'],'dbName':_0x5b8300['dbName']});}function deserializeDbSelection(_0x1220a0){const _0xadf127=a185_0x3f5031;try{const _0x37a6be=JSON[_0xadf127(0xd8)](_0x1220a0);if(typeof _0x37a6be['dbId']===_0xadf127(0xbd)&&Number[_0xadf127(0xd2)](_0x37a6be[_0xadf127(0xba)]))return{'dbId':_0x37a6be['dbId'],'dbName':_0x37a6be[_0xadf127(0xa5)]};}catch{}throw CliErrors[_0xadf127(0xbc)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x1220a0);}function resolveProvidedDbId(_0x452cb3){const _0x1edb4a=a185_0x3f5031,_0x1c463f=_0x452cb3[_0x1edb4a(0xb7)]('db-id');if(typeof _0x1c463f===_0x1edb4a(0xbd)&&Number[_0x1edb4a(0xd2)](_0x1c463f))return _0x1c463f;return undefined;}
@@ -1 +1 @@
1
- function a185_0x31f5(_0x4da8a0,_0x2f2550){_0x4da8a0=_0x4da8a0-0x173;const _0x4045f4=a185_0x4045();let _0x31f58e=_0x4045f4[_0x4da8a0];return _0x31f58e;}const a185_0x183710=a185_0x31f5;(function(_0x500f84,_0x485291){const _0x8eec9b=a185_0x31f5,_0x184740=_0x500f84();while(!![]){try{const _0x41beb0=parseInt(_0x8eec9b(0x199))/0x1+-parseInt(_0x8eec9b(0x191))/0x2*(parseInt(_0x8eec9b(0x188))/0x3)+parseInt(_0x8eec9b(0x192))/0x4+-parseInt(_0x8eec9b(0x194))/0x5+parseInt(_0x8eec9b(0x17f))/0x6+-parseInt(_0x8eec9b(0x184))/0x7+-parseInt(_0x8eec9b(0x196))/0x8*(parseInt(_0x8eec9b(0x18a))/0x9);if(_0x41beb0===_0x485291)break;else _0x184740['push'](_0x184740['shift']());}catch(_0x849a96){_0x184740['push'](_0x184740['shift']());}}}(a185_0x4045,0x87361));function a185_0x4045(){const _0x458538=['length','validation','SQL\x20lock\x20file\x20not\x20found.','1658262SUUfyf','replace','trashDir','/smartapi/custom/deleteUserCustomSql','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','5041876EtjmVn','delete','sqls','toISOString','3LneEOV','sqlcode','65601DrFaix','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','startsWith','sqlRoot','Would\x20delete\x20SQL\x20','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','1170978sebtwi','4397448fRHOaE','fromEntries','833475VGurkS','projectRoot','128NGtNTo','sqlRootDir','entries','767162ZeXnTN','\x20(local\x20file\x20moved\x20to\x20trash)','filter','sql','str','lockFilePath','POST','lastSync','remoteId','appCode','trashedTo'];a185_0x4045=function(){return _0x458538;};return a185_0x4045();}import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a185_0x183710(0x174),'command':a185_0x183710(0x185),'description':a185_0x183710(0x18f),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0xab95ae){const _0x1ad1e0=a185_0x183710,_0x41443b=loadSqlProjectConfig(_0xab95ae[_0x1ad1e0(0x17a)]),_0x1d9f02=await readSqlLockFile(_0x41443b['lockFilePath']);if(!_0x1d9f02)throw CliErrors[_0x1ad1e0(0x17d)](_0x1ad1e0(0x190));},async 'dryRun'(_0x28b389){const _0x5d9dc4=a185_0x183710,_0x301dcb=loadSqlProjectConfig(_0x28b389[_0x5d9dc4(0x17a)]),_0x4a8b26=await readSqlLockFile(_0x301dcb[_0x5d9dc4(0x176)]);if(!_0x4a8b26)throw CliErrors[_0x5d9dc4(0x17d)](_0x5d9dc4(0x190));const {appLock:_0x38f9b1}=ensureSqlLockScope(_0x4a8b26,_0x28b389[_0x5d9dc4(0x17a)],_0x301dcb['sqlRoot'],_0x5d9dc4(0x185)),_0x8d57c9=_0x28b389[_0x5d9dc4(0x175)](_0x5d9dc4(0x189)),_0x5d8d4e=_0x38f9b1[_0x5d9dc4(0x186)][_0x8d57c9];if(!_0x5d8d4e)throw CliErrors[_0x5d9dc4(0x17d)](_0x5d9dc4(0x18b)+_0x8d57c9+'\x22.');return{'method':_0x5d9dc4(0x177),'url':_0x5d9dc4(0x182),'body':{'sqlCode':_0x8d57c9,'id':_0x5d8d4e[_0x5d9dc4(0x179)],'localPath':resolveLocalSqlFilePath(_0x301dcb,_0x8d57c9,_0x5d8d4e)},'description':_0x5d9dc4(0x18e)+_0x8d57c9+_0x5d9dc4(0x183)+_0x301dcb[_0x5d9dc4(0x181)]};},async 'execute'(_0xc8b155){const _0x3bedf2=a185_0x183710,_0x29f819=loadSqlProjectConfig(_0xc8b155['appCode']),_0x557630=await readSqlLockFile(_0x29f819[_0x3bedf2(0x176)]);if(!_0x557630)throw CliErrors[_0x3bedf2(0x17d)](_0x3bedf2(0x17e));const {lockData:_0x3f5116,appLock:_0x1ec4b3}=ensureSqlLockScope(_0x557630,_0xc8b155['appCode'],_0x29f819[_0x3bedf2(0x18d)],_0x3bedf2(0x185)),_0x3fe719=_0xc8b155[_0x3bedf2(0x175)](_0x3bedf2(0x189)),_0x373cae=_0x1ec4b3[_0x3bedf2(0x186)][_0x3fe719];if(!_0x373cae)throw CliErrors['validation'](_0x3bedf2(0x18b)+_0x3fe719+'\x22.');await deleteSqlQuery({'id':_0x373cae[_0x3bedf2(0x179)],'sqlCode':_0x3fe719}),_0x1ec4b3['sqls']=Object[_0x3bedf2(0x193)](Object[_0x3bedf2(0x198)](_0x1ec4b3[_0x3bedf2(0x186)])[_0x3bedf2(0x173)](([_0x9d8e3e])=>_0x9d8e3e!==_0x3fe719)),_0x1ec4b3[_0x3bedf2(0x178)]=new Date()[_0x3bedf2(0x187)](),await writeSqlLockFile(_0x29f819['lockFilePath'],_0x3f5116);const _0x3d0104=resolveLocalSqlFilePath(_0x29f819,_0x3fe719,_0x373cae);let _0x12d221;await fileExists(_0x3d0104)&&(_0x12d221=await moveToTrash(_0x29f819[_0x3bedf2(0x195)],_0x29f819[_0x3bedf2(0x181)],_0x3d0104),await cleanupEmptyDirectories(dirname(_0x3d0104),_0x29f819[_0x3bedf2(0x197)]));const _0x126829={'deleted':_0x3fe719,'remoteId':_0x373cae[_0x3bedf2(0x179)]};if(_0x12d221)_0x126829[_0x3bedf2(0x17b)]=_0x12d221;return{'ok':!![],'data':_0x126829,'message':'Deleted\x20'+_0x3fe719+(_0x12d221?_0x3bedf2(0x19a):'')};}};async function moveToTrash(_0x303227,_0x36a38d,_0x115749){const _0x2940fd=a185_0x183710,_0x3e3d03=new Date()[_0x2940fd(0x187)]()[_0x2940fd(0x180)](/[:.]/g,'-'),_0x3f3c3d=relative(_0x303227,_0x115749),_0x3c3509=join(_0x36a38d,_0x3e3d03,_0x3f3c3d);return await mkdir(dirname(_0x3c3509),{'recursive':!![]}),await rename(_0x115749,_0x3c3509),_0x3c3509;}async function cleanupEmptyDirectories(_0x5243d6,_0x1ac64e){const _0x176004=a185_0x183710;let _0xfd60c4=resolve(_0x5243d6);const _0xb0af75=resolve(_0x1ac64e);while(_0xfd60c4[_0x176004(0x18c)](''+_0xb0af75+sep)||_0xfd60c4===_0xb0af75){if(_0xfd60c4===_0xb0af75)return;try{const _0x5c3800=await readdir(_0xfd60c4);if(_0x5c3800[_0x176004(0x17c)]>0x0)return;await rmdir(_0xfd60c4);}catch{return;}_0xfd60c4=dirname(_0xfd60c4);}}
1
+ function a186_0x92a4(_0x4dfe05,_0x10e794){_0x4dfe05=_0x4dfe05-0xd2;const _0x3be31f=a186_0x3be3();let _0x92a445=_0x3be31f[_0x4dfe05];return _0x92a445;}const a186_0x36f1bf=a186_0x92a4;(function(_0x239194,_0x3253e0){const _0x1833da=a186_0x92a4,_0x4c74fc=_0x239194();while(!![]){try{const _0x584abc=parseInt(_0x1833da(0xe4))/0x1*(-parseInt(_0x1833da(0xd5))/0x2)+parseInt(_0x1833da(0xf1))/0x3*(parseInt(_0x1833da(0xdc))/0x4)+parseInt(_0x1833da(0xd4))/0x5+parseInt(_0x1833da(0xe6))/0x6*(-parseInt(_0x1833da(0xe3))/0x7)+parseInt(_0x1833da(0xe0))/0x8+parseInt(_0x1833da(0xd8))/0x9+-parseInt(_0x1833da(0xe8))/0xa;if(_0x584abc===_0x3253e0)break;else _0x4c74fc['push'](_0x4c74fc['shift']());}catch(_0x2555ce){_0x4c74fc['push'](_0x4c74fc['shift']());}}}(a186_0x3be3,0x4de5b));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a186_0x36f1bf(0xe5),'command':a186_0x36f1bf(0xdd),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a186_0x36f1bf(0xe1),'flags':[SQLCODE_FLAG],async 'validate'(_0x34a5d5){const _0x45b586=a186_0x36f1bf,_0x1775ba=loadSqlProjectConfig(_0x34a5d5[_0x45b586(0xd2)]),_0x16586f=await readSqlLockFile(_0x1775ba[_0x45b586(0xe9)]);if(!_0x16586f)throw CliErrors['validation']('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x50be85){const _0x31a792=a186_0x36f1bf,_0x17c3b5=loadSqlProjectConfig(_0x50be85['appCode']),_0x1fef36=await readSqlLockFile(_0x17c3b5['lockFilePath']);if(!_0x1fef36)throw CliErrors[_0x31a792(0xd7)](_0x31a792(0xdf));const {appLock:_0x2591ed}=ensureSqlLockScope(_0x1fef36,_0x50be85[_0x31a792(0xd2)],_0x17c3b5[_0x31a792(0xde)],_0x31a792(0xdd)),_0x580305=_0x50be85[_0x31a792(0xf0)]('sqlcode'),_0x581310=_0x2591ed['sqls'][_0x580305];if(!_0x581310)throw CliErrors[_0x31a792(0xd7)](_0x31a792(0xf2)+_0x580305+'\x22.');return{'method':'POST','url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x580305,'id':_0x581310[_0x31a792(0xeb)],'localPath':resolveLocalSqlFilePath(_0x17c3b5,_0x580305,_0x581310)},'description':_0x31a792(0xef)+_0x580305+_0x31a792(0xe7)+_0x17c3b5[_0x31a792(0xec)]};},async 'execute'(_0x4892c5){const _0x135370=a186_0x36f1bf,_0x2f86aa=loadSqlProjectConfig(_0x4892c5[_0x135370(0xd2)]),_0x3d6232=await readSqlLockFile(_0x2f86aa[_0x135370(0xe9)]);if(!_0x3d6232)throw CliErrors[_0x135370(0xd7)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x12a2df,appLock:_0x2de0b1}=ensureSqlLockScope(_0x3d6232,_0x4892c5[_0x135370(0xd2)],_0x2f86aa[_0x135370(0xde)],_0x135370(0xdd)),_0xc57f8b=_0x4892c5[_0x135370(0xf0)]('sqlcode'),_0x2ce32d=_0x2de0b1[_0x135370(0xda)][_0xc57f8b];if(!_0x2ce32d)throw CliErrors['validation'](_0x135370(0xf2)+_0xc57f8b+'\x22.');await deleteSqlQuery({'id':_0x2ce32d['remoteId'],'sqlCode':_0xc57f8b}),_0x2de0b1['sqls']=Object[_0x135370(0xed)](Object[_0x135370(0xee)](_0x2de0b1[_0x135370(0xda)])[_0x135370(0xd9)](([_0x36c3e4])=>_0x36c3e4!==_0xc57f8b)),_0x2de0b1['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x2f86aa[_0x135370(0xe9)],_0x12a2df);const _0x4fc8df=resolveLocalSqlFilePath(_0x2f86aa,_0xc57f8b,_0x2ce32d);let _0x5933a1;await fileExists(_0x4fc8df)&&(_0x5933a1=await moveToTrash(_0x2f86aa[_0x135370(0xf3)],_0x2f86aa[_0x135370(0xec)],_0x4fc8df),await cleanupEmptyDirectories(dirname(_0x4fc8df),_0x2f86aa[_0x135370(0xdb)]));const _0x3bf84={'deleted':_0xc57f8b,'remoteId':_0x2ce32d[_0x135370(0xeb)]};if(_0x5933a1)_0x3bf84['trashedTo']=_0x5933a1;return{'ok':!![],'data':_0x3bf84,'message':_0x135370(0xd3)+_0xc57f8b+(_0x5933a1?_0x135370(0xd6):'')};}};function a186_0x3be3(){const _0x3f7ff2=['sqls','sqlRootDir','352972msjCSq','delete','sqlRoot','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','1484736hdTDex','high-risk-write','toISOString','217245xspOZe','397814ehvCSf','sql','6oMCZXQ','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','7621660SqnzvZ','lockFilePath','startsWith','remoteId','trashDir','fromEntries','entries','Would\x20delete\x20SQL\x20','str','18ORIrBO','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','projectRoot','replace','appCode','Deleted\x20','1690300UecDDJ','2ZhEkYn','\x20(local\x20file\x20moved\x20to\x20trash)','validation','4112748yswhBZ','filter'];a186_0x3be3=function(){return _0x3f7ff2;};return a186_0x3be3();}async function moveToTrash(_0x4192aa,_0x474a8d,_0x33a962){const _0x328586=a186_0x36f1bf,_0x526eaa=new Date()[_0x328586(0xe2)]()[_0x328586(0xf4)](/[:.]/g,'-'),_0xe0b15d=relative(_0x4192aa,_0x33a962),_0x235e30=join(_0x474a8d,_0x526eaa,_0xe0b15d);return await mkdir(dirname(_0x235e30),{'recursive':!![]}),await rename(_0x33a962,_0x235e30),_0x235e30;}async function cleanupEmptyDirectories(_0x1e2d76,_0x23712c){const _0x35ab2d=a186_0x36f1bf;let _0x5c4d3c=resolve(_0x1e2d76);const _0x1370a6=resolve(_0x23712c);while(_0x5c4d3c[_0x35ab2d(0xea)](''+_0x1370a6+sep)||_0x5c4d3c===_0x1370a6){if(_0x5c4d3c===_0x1370a6)return;try{const _0x31f57f=await readdir(_0x5c4d3c);if(_0x31f57f['length']>0x0)return;await rmdir(_0x5c4d3c);}catch{return;}_0x5c4d3c=dirname(_0x5c4d3c);}}
@@ -1 +1 @@
1
- function a186_0xc620(_0x5c03b0,_0xae9062){_0x5c03b0=_0x5c03b0-0x74;const _0x19cde9=a186_0x19cd();let _0xc6206d=_0x19cde9[_0x5c03b0];return _0xc6206d;}const a186_0x532156=a186_0xc620;(function(_0x4f0773,_0x5d265c){const _0xb3d94c=a186_0xc620,_0x4ce16b=_0x4f0773();while(!![]){try{const _0x3571b4=-parseInt(_0xb3d94c(0x81))/0x1+parseInt(_0xb3d94c(0x87))/0x2*(-parseInt(_0xb3d94c(0x86))/0x3)+-parseInt(_0xb3d94c(0x7a))/0x4*(parseInt(_0xb3d94c(0x7b))/0x5)+-parseInt(_0xb3d94c(0x82))/0x6*(parseInt(_0xb3d94c(0x84))/0x7)+-parseInt(_0xb3d94c(0x7d))/0x8*(-parseInt(_0xb3d94c(0x85))/0x9)+parseInt(_0xb3d94c(0x7e))/0xa+parseInt(_0xb3d94c(0x89))/0xb;if(_0x3571b4===_0x5d265c)break;else _0x4ce16b['push'](_0x4ce16b['shift']());}catch(_0x12cfd0){_0x4ce16b['push'](_0x4ce16b['shift']());}}}(a186_0x19cd,0xec4f0));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a186_0x19cd(){const _0x1bc7d5=['read','dbId','detail','Return\x20full\x20raw\x20SQL\x20query\x20object','boolean','sqlcode','bool','sqlName','11420dftKwj','1080AddBaq','sql','48eiUaRg','1444960SPqwzb','appCode','verbose','410317MQQorg','1332QHaeVM','str','3409JXUWXQ','1091421ScimWE','3xAwtAp','107698zfclai','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','14132470QrKDGe'];a186_0x19cd=function(){return _0x1bc7d5;};return a186_0x19cd();}export const sqlDetail={'service':a186_0x532156(0x7c),'command':a186_0x532156(0x74),'description':a186_0x532156(0x88),'risk':a186_0x532156(0x8a),'flags':[SQLCODE_FLAG,{'name':a186_0x532156(0x80),'type':a186_0x532156(0x76),'description':a186_0x532156(0x75)}],async 'execute'(_0x42d9a3){const _0x46dcf6=a186_0x532156,_0x1707ab=await getSqlQueryInfo(_0x42d9a3[_0x46dcf6(0x7f)],_0x42d9a3[_0x46dcf6(0x83)](_0x46dcf6(0x77))),_0x4507b6=_0x42d9a3[_0x46dcf6(0x78)](_0x46dcf6(0x80));if(_0x4507b6)return{'ok':!![],'data':_0x1707ab};const _0x508a21=_0x1707ab['dbId']?await getDbName(_0x42d9a3['appCode'],_0x1707ab[_0x46dcf6(0x8b)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x1707ab['sqlCode'],'sqlName':_0x1707ab[_0x46dcf6(0x79)],'db':_0x508a21?_0x508a21+'\x20('+_0x1707ab[_0x46dcf6(0x8b)]+')':_0x1707ab['dbId']??'','description':_0x1707ab['description']??'','sqlContent':_0x1707ab['sqlContent']??''}};}};
1
+ const a187_0x5cf6a2=a187_0x2df3;function a187_0x1080(){const _0x4767c8=['402733OEAQvW','boolean','sqlCode','3821034bYMglB','120qnBEhh','1169226KfGwqo','sqlName','verbose','bool','670GTYeZP','1103475BnTlrm','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','9032EeqZrP','appCode','detail','sql','str','713745HaZkND','read','1678514xjCKXs','dbId'];a187_0x1080=function(){return _0x4767c8;};return a187_0x1080();}(function(_0x5a51ca,_0x469289){const _0x3567eb=a187_0x2df3,_0x5d838d=_0x5a51ca();while(!![]){try{const _0x46c4bb=parseInt(_0x3567eb(0xda))/0x1+-parseInt(_0x3567eb(0xd8))/0x2+-parseInt(_0x3567eb(0xcf))/0x3+parseInt(_0x3567eb(0xd1))/0x4*(-parseInt(_0x3567eb(0xce))/0x5)+-parseInt(_0x3567eb(0xca))/0x6+parseInt(_0x3567eb(0xdd))/0x7+parseInt(_0x3567eb(0xde))/0x8*(parseInt(_0x3567eb(0xd6))/0x9);if(_0x46c4bb===_0x469289)break;else _0x5d838d['push'](_0x5d838d['shift']());}catch(_0x259cd4){_0x5d838d['push'](_0x5d838d['shift']());}}}(a187_0x1080,0x69ded));function a187_0x2df3(_0x51fe44,_0x12ec35){_0x51fe44=_0x51fe44-0xca;const _0x108002=a187_0x1080();let _0x2df333=_0x108002[_0x51fe44];return _0x2df333;}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a187_0x5cf6a2(0xd4),'command':a187_0x5cf6a2(0xd3),'description':a187_0x5cf6a2(0xd0),'risk':a187_0x5cf6a2(0xd7),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a187_0x5cf6a2(0xdb),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x9716d3){const _0x4cf442=a187_0x5cf6a2,_0x2066f8=await getSqlQueryInfo(_0x9716d3['appCode'],_0x9716d3[_0x4cf442(0xd5)]('sqlcode')),_0x5ef3e4=_0x9716d3[_0x4cf442(0xcd)](_0x4cf442(0xcc));if(_0x5ef3e4)return{'ok':!![],'data':_0x2066f8};const _0x343775=_0x2066f8[_0x4cf442(0xd9)]?await getDbName(_0x9716d3[_0x4cf442(0xd2)],_0x2066f8[_0x4cf442(0xd9)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x2066f8[_0x4cf442(0xdc)],'sqlName':_0x2066f8[_0x4cf442(0xcb)],'db':_0x343775?_0x343775+'\x20('+_0x2066f8[_0x4cf442(0xd9)]+')':_0x2066f8[_0x4cf442(0xd9)]??'','description':_0x2066f8['description']??'','sqlContent':_0x2066f8['sqlContent']??''}};}};
@@ -1 +1 @@
1
- const a187_0x332709=a187_0xfbeb;function a187_0x2909(){const _0x57319e=['read','6dfCkjq','execResult','str','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','1577415omACRA','172668XZdbcZ','Returned\x20','execError','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','1786284TRuMZG','params','\x20row(s)\x20in\x20','SQL\x20execution\x20failed','525338xFymuG','1944RVXPFw','length','isArray','4032081PagRxP','appCode','4382JmfeRA','now','sql','935456HcRJED'];a187_0x2909=function(){return _0x57319e;};return a187_0x2909();}(function(_0x433789,_0x57d8d9){const _0x106927=a187_0xfbeb,_0x1fee53=_0x433789();while(!![]){try{const _0x1f46da=parseInt(_0x106927(0x1c1))/0x1+-parseInt(_0x106927(0x1b9))/0x2*(-parseInt(_0x106927(0x1b4))/0x3)+parseInt(_0x106927(0x1bd))/0x4+-parseInt(_0x106927(0x1b8))/0x5+-parseInt(_0x106927(0x1c2))/0x6*(parseInt(_0x106927(0x1af))/0x7)+parseInt(_0x106927(0x1b2))/0x8+-parseInt(_0x106927(0x1ad))/0x9;if(_0x1f46da===_0x57d8d9)break;else _0x1fee53['push'](_0x1fee53['shift']());}catch(_0x42a607){_0x1fee53['push'](_0x1fee53['shift']());}}}(a187_0x2909,0x48119));function a187_0xfbeb(_0x405f64,_0xac21f5){_0x405f64=_0x405f64-0x1ad;const _0x2909e3=a187_0x2909();let _0xfbeb77=_0x2909e3[_0x405f64];return _0xfbeb77;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a187_0x332709(0x1b1),'command':'exec','description':a187_0x332709(0x1bc),'risk':a187_0x332709(0x1b3),'flags':[SQLCODE_FLAG,{'name':a187_0x332709(0x1be),'type':'string','description':a187_0x332709(0x1b7)}],async 'execute'(_0x7ed86){const _0x3d5146=a187_0x332709,_0x34e2cd=parseJsonParams(_0x7ed86[_0x3d5146(0x1b6)]('params')),_0x1debaa=Date[_0x3d5146(0x1b0)](),_0x30a3dc=await executeSql(_0x7ed86[_0x3d5146(0x1ae)],_0x7ed86[_0x3d5146(0x1b6)]('sqlcode'),_0x34e2cd),_0x4a2b37=Date[_0x3d5146(0x1b0)]()-_0x1debaa,_0x375158=_0x30a3dc?.[_0x3d5146(0x1b5)]??_0x30a3dc,_0x27ae88=_0x30a3dc?.['execSuccess']??!![];if(!_0x27ae88)return{'ok':![],'data':{'error':_0x30a3dc?.[_0x3d5146(0x1bb)]||_0x3d5146(0x1c0),'elapsed':_0x4a2b37},'message':'SQL\x20execution\x20failed'};const _0x415c73=Array[_0x3d5146(0x1c4)](_0x375158)?_0x375158:[];return{'ok':!![],'data':{'rows':_0x415c73,'rowCount':_0x415c73['length'],'elapsed':_0x4a2b37},'message':_0x3d5146(0x1ba)+_0x415c73[_0x3d5146(0x1c3)]+_0x3d5146(0x1bf)+_0x4a2b37+'ms'};}};
1
+ function a188_0x55cb(_0x3dc725,_0x499e48){_0x3dc725=_0x3dc725-0xd6;const _0x5565c3=a188_0x5565();let _0x55cb9f=_0x5565c3[_0x3dc725];return _0x55cb9f;}const a188_0x31c093=a188_0x55cb;(function(_0x270e45,_0x2ec55d){const _0x240c3b=a188_0x55cb,_0x149a8d=_0x270e45();while(!![]){try{const _0x210c83=-parseInt(_0x240c3b(0xe5))/0x1*(-parseInt(_0x240c3b(0xdd))/0x2)+-parseInt(_0x240c3b(0xe8))/0x3+parseInt(_0x240c3b(0xe7))/0x4*(parseInt(_0x240c3b(0xd9))/0x5)+-parseInt(_0x240c3b(0xe4))/0x6+parseInt(_0x240c3b(0xec))/0x7*(parseInt(_0x240c3b(0xed))/0x8)+parseInt(_0x240c3b(0xea))/0x9+parseInt(_0x240c3b(0xd7))/0xa*(parseInt(_0x240c3b(0xe0))/0xb);if(_0x210c83===_0x2ec55d)break;else _0x149a8d['push'](_0x149a8d['shift']());}catch(_0x364ca4){_0x149a8d['push'](_0x149a8d['shift']());}}}(a188_0x5565,0xb70f9));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a188_0x31c093(0xe3),'command':a188_0x31c093(0xda),'description':a188_0x31c093(0xe1),'risk':a188_0x31c093(0xeb),'flags':[SQLCODE_FLAG,{'name':a188_0x31c093(0xdc),'type':a188_0x31c093(0xee),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0xe27d80){const _0x584a80=a188_0x31c093,_0x2e303f=parseJsonParams(_0xe27d80[_0x584a80(0xe9)]('params')),_0x583c81=Date[_0x584a80(0xe2)](),_0x23e9c9=await executeSql(_0xe27d80[_0x584a80(0xdb)],_0xe27d80[_0x584a80(0xe9)](_0x584a80(0xe6)),_0x2e303f),_0x5a89aa=Date[_0x584a80(0xe2)]()-_0x583c81,_0xf94a71=_0x23e9c9?.['execResult']??_0x23e9c9,_0x4f19d0=_0x23e9c9?.[_0x584a80(0xdf)]??!![];if(!_0x4f19d0)return{'ok':![],'data':{'error':_0x23e9c9?.[_0x584a80(0xd8)]||_0x584a80(0xde),'elapsed':_0x5a89aa},'message':_0x584a80(0xde)};const _0x159734=Array['isArray'](_0xf94a71)?_0xf94a71:[];return{'ok':!![],'data':{'rows':_0x159734,'rowCount':_0x159734['length'],'elapsed':_0x5a89aa},'message':'Returned\x20'+_0x159734['length']+_0x584a80(0xd6)+_0x5a89aa+'ms'};}};function a188_0x5565(){const _0x432046=['330696agETdZ','3449868rDKESk','str','7802091LQQmqq','read','294cJaLGI','144968RVhDuP','string','\x20row(s)\x20in\x20','18230rwMskQ','execError','10szRujC','exec','appCode','params','4VbvgUQ','SQL\x20execution\x20failed','execSuccess','3014JODAUP','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','now','sql','6660324XQPpOn','358498XDZztE','sqlcode'];a188_0x5565=function(){return _0x432046;};return a188_0x5565();}
@@ -1 +1 @@
1
- function a188_0x1f53(_0x2d4372,_0x24cf84){_0x2d4372=_0x2d4372-0x1d0;const _0x8242a6=a188_0x8242();let _0x1f531e=_0x8242a6[_0x2d4372];return _0x1f531e;}(function(_0x1fe869,_0x12a86d){const _0x79f9d2=a188_0x1f53,_0x495677=_0x1fe869();while(!![]){try{const _0x30b67b=parseInt(_0x79f9d2(0x1d6))/0x1+parseInt(_0x79f9d2(0x1d8))/0x2*(parseInt(_0x79f9d2(0x1da))/0x3)+parseInt(_0x79f9d2(0x1d2))/0x4*(-parseInt(_0x79f9d2(0x1d9))/0x5)+parseInt(_0x79f9d2(0x1d0))/0x6+-parseInt(_0x79f9d2(0x1d7))/0x7*(-parseInt(_0x79f9d2(0x1d5))/0x8)+parseInt(_0x79f9d2(0x1d1))/0x9+-parseInt(_0x79f9d2(0x1d3))/0xa*(parseInt(_0x79f9d2(0x1d4))/0xb);if(_0x30b67b===_0x12a86d)break;else _0x495677['push'](_0x495677['shift']());}catch(_0x121ffa){_0x495677['push'](_0x495677['shift']());}}}(a188_0x8242,0xe5897));import{sqlList}from'../../commands/sql/list.js';function a188_0x8242(){const _0x2c5b55=['3165010CBJRHl','3745nHRrlH','3yfxQKj','9459684GUWamS','5490513waiGgJ','3996bhOSXI','4263890ZIJhRE','121qDEfgi','1552FeasxU','1554759wBErwW','38059WSxpGL'];a188_0x8242=function(){return _0x2c5b55;};return a188_0x8242();}import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x2f0690,_0x2a8c86){const _0x3b0562=a189_0x53cb,_0x2eacff=_0x2f0690();while(!![]){try{const _0x1f88c8=parseInt(_0x3b0562(0x1de))/0x1*(parseInt(_0x3b0562(0x1e2))/0x2)+-parseInt(_0x3b0562(0x1e5))/0x3*(-parseInt(_0x3b0562(0x1df))/0x4)+-parseInt(_0x3b0562(0x1e6))/0x5+parseInt(_0x3b0562(0x1e1))/0x6*(-parseInt(_0x3b0562(0x1e4))/0x7)+parseInt(_0x3b0562(0x1e0))/0x8+-parseInt(_0x3b0562(0x1e7))/0x9+parseInt(_0x3b0562(0x1dd))/0xa*(parseInt(_0x3b0562(0x1e3))/0xb);if(_0x1f88c8===_0x2a8c86)break;else _0x2eacff['push'](_0x2eacff['shift']());}catch(_0x4794ad){_0x2eacff['push'](_0x2eacff['shift']());}}}(a189_0x312c,0xeb56e));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a189_0x312c(){const _0x3a0f28=['2Mfaxga','1380709YRVeQJ','497pisSkC','12TwdwHz','4876760uGEfTX','5032512mYniRi','40mUUUqL','1056623zExLHV','903664UCDgiA','1436784urdxpy','12126JZTkCf'];a189_0x312c=function(){return _0x3a0f28;};return a189_0x312c();}import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';function a189_0x53cb(_0x32fc25,_0x7aa41e){_0x32fc25=_0x32fc25-0x1dd;const _0x312c4d=a189_0x312c();let _0x53cbbe=_0x312c4d[_0x32fc25];return _0x53cbbe;}import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a189_0x4edeb5=a189_0x2dea;(function(_0x5a5c05,_0x2379a2){const _0xc1328e=a189_0x2dea,_0x3157d6=_0x5a5c05();while(!![]){try{const _0x408a40=-parseInt(_0xc1328e(0xf3))/0x1*(-parseInt(_0xc1328e(0xf2))/0x2)+parseInt(_0xc1328e(0xde))/0x3*(-parseInt(_0xc1328e(0xe1))/0x4)+parseInt(_0xc1328e(0xe3))/0x5+-parseInt(_0xc1328e(0xef))/0x6*(-parseInt(_0xc1328e(0xf1))/0x7)+-parseInt(_0xc1328e(0xe8))/0x8*(-parseInt(_0xc1328e(0xee))/0x9)+-parseInt(_0xc1328e(0xf5))/0xa+-parseInt(_0xc1328e(0xf7))/0xb;if(_0x408a40===_0x2379a2)break;else _0x3157d6['push'](_0x3157d6['shift']());}catch(_0xb0e348){_0x3157d6['push'](_0x3157d6['shift']());}}}(a189_0x43dd,0xc1203));function a189_0x2dea(_0x4275a5,_0x49ccc8){_0x4275a5=_0x4275a5-0xde;const _0x43dd98=a189_0x43dd();let _0x2dea6a=_0x43dd98[_0x4275a5];return _0x2dea6a;}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a189_0x43dd(){const _0x246f2a=['all','148cgYkzs','Page\x20number','5325085aMfvUw','length','dbId','No\x20custom\x20SQL\x20queries\x20found.','name','7032SHjzte','num','paging','tableData','pagesize','Found\x20','10818yMhBzN','6SPvrLP','sql','394898JIqYsR','52942MXNsCo','31dZROQR','sqlcode','14760260SLyCGb','Page\x20size','7737004lLZsoz','List\x20custom\x20SQL\x20queries','str','list','Filter\x20by\x20SQL\x20name','page','boolean','verbose','\x20SQL\x20queries\x20(total:\x20','2283MtnYLb','number'];a189_0x43dd=function(){return _0x246f2a;};return a189_0x43dd();}export const sqlList={'service':a189_0x4edeb5(0xf0),'command':a189_0x4edeb5(0xfa),'description':a189_0x4edeb5(0xf8),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':'string','description':a189_0x4edeb5(0xfb)},{'name':a189_0x4edeb5(0xfc),'type':a189_0x4edeb5(0xdf),'description':a189_0x4edeb5(0xe2),'default':0x1},{'name':a189_0x4edeb5(0xec),'type':a189_0x4edeb5(0xdf),'description':a189_0x4edeb5(0xf6)},{'name':a189_0x4edeb5(0xfe),'type':a189_0x4edeb5(0xfd),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x1198e5){const _0x54b436=a189_0x4edeb5,_0x507cf2=await listSqlQueries(_0x1198e5['appCode'],{'sqlCode':_0x1198e5[_0x54b436(0xf9)](_0x54b436(0xf4))||undefined,'sqlName':_0x1198e5[_0x54b436(0xf9)](_0x54b436(0xe7))||undefined,'currentPage':_0x1198e5[_0x54b436(0xe9)]('page'),'pageSize':_0x1198e5['num']('pagesize',0x32)}),_0x5868b3=_0x1198e5['bool'](_0x54b436(0xfe)),_0x3220c8=_0x507cf2[_0x54b436(0xeb)]??[],_0x21d3f5=_0x507cf2[_0x54b436(0xea)]?.['totalCount']??_0x3220c8[_0x54b436(0xe4)];let _0x5a9024;return _0x5868b3?_0x5a9024=_0x3220c8:_0x5a9024=await Promise[_0x54b436(0xe0)](_0x3220c8['map'](async _0x4ec019=>{const _0x522a8f=_0x54b436;let _0x2a5dee;try{_0x2a5dee=_0x4ec019[_0x522a8f(0xe5)]?await getDbName(_0x1198e5['appCode'],_0x4ec019[_0x522a8f(0xe5)]):undefined;}catch{}return{'sqlCode':_0x4ec019['sqlCode'],'sqlName':_0x4ec019['sqlName'],'description':_0x4ec019['description']??'','db':_0x2a5dee?_0x2a5dee+'\x20('+_0x4ec019[_0x522a8f(0xe5)]+')':_0x4ec019['dbId']??''};})),{'ok':!![],'data':_0x5a9024,'message':_0x3220c8[_0x54b436(0xe4)]===0x0?_0x54b436(0xe6):_0x54b436(0xed)+_0x3220c8[_0x54b436(0xe4)]+_0x54b436(0xff)+_0x21d3f5+').'};}};
1
+ function a190_0x3424(_0x52e790,_0xecfb70){_0x52e790=_0x52e790-0x1b4;const _0x26a4cb=a190_0x26a4();let _0x3424c7=_0x26a4cb[_0x52e790];return _0x3424c7;}const a190_0x37f9e8=a190_0x3424;(function(_0xe30fc,_0x17a22d){const _0x1d7715=a190_0x3424,_0x38ac44=_0xe30fc();while(!![]){try{const _0x4f0a74=-parseInt(_0x1d7715(0x1d8))/0x1*(-parseInt(_0x1d7715(0x1c0))/0x2)+parseInt(_0x1d7715(0x1ce))/0x3+parseInt(_0x1d7715(0x1cd))/0x4*(parseInt(_0x1d7715(0x1c9))/0x5)+-parseInt(_0x1d7715(0x1bd))/0x6+-parseInt(_0x1d7715(0x1be))/0x7*(parseInt(_0x1d7715(0x1d7))/0x8)+-parseInt(_0x1d7715(0x1bc))/0x9*(parseInt(_0x1d7715(0x1d5))/0xa)+parseInt(_0x1d7715(0x1b7))/0xb*(parseInt(_0x1d7715(0x1bb))/0xc);if(_0x4f0a74===_0x17a22d)break;else _0x38ac44['push'](_0x38ac44['shift']());}catch(_0x121e59){_0x38ac44['push'](_0x38ac44['shift']());}}}(a190_0x26a4,0xb3e82));function a190_0x26a4(){const _0xc54d4c=['pagesize','Page\x20number','Page\x20size','sqlName','Found\x20','10QIcfcE','totalCount','16oGkCag','435761lGciEJ','dbId','all','sqlCode','11IcZKWP','sqlcode','map','name','20405604VOwzEz','423882mvgdLt','4588110HvyFFW','5001647GGMQAQ','sql','2ljIcsa','verbose','number','length','tableData','paging','num','Filter\x20by\x20SQL\x20name','appCode','920iSQjXc','page','string','\x20SQL\x20queries\x20(total:\x20','1088zTTxdb','2374341VShlBG','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'];a190_0x26a4=function(){return _0xc54d4c;};return a190_0x26a4();}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a190_0x37f9e8(0x1bf),'command':'list','description':'List\x20custom\x20SQL\x20queries','risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a190_0x37f9e8(0x1ba),'type':a190_0x37f9e8(0x1cb),'description':a190_0x37f9e8(0x1c7)},{'name':a190_0x37f9e8(0x1ca),'type':a190_0x37f9e8(0x1c2),'description':a190_0x37f9e8(0x1d1),'default':0x1},{'name':a190_0x37f9e8(0x1d0),'type':a190_0x37f9e8(0x1c2),'description':a190_0x37f9e8(0x1d2)},{'name':a190_0x37f9e8(0x1c1),'type':'boolean','description':a190_0x37f9e8(0x1cf)}],async 'execute'(_0x2f409b){const _0x5c4306=a190_0x37f9e8,_0x1a50d3=await listSqlQueries(_0x2f409b['appCode'],{'sqlCode':_0x2f409b['str'](_0x5c4306(0x1b8))||undefined,'sqlName':_0x2f409b['str'](_0x5c4306(0x1ba))||undefined,'currentPage':_0x2f409b[_0x5c4306(0x1c6)]('page'),'pageSize':_0x2f409b['num'](_0x5c4306(0x1d0),0x32)}),_0x3cd3b7=_0x2f409b['bool'](_0x5c4306(0x1c1)),_0x60d611=_0x1a50d3[_0x5c4306(0x1c4)]??[],_0x3c0788=_0x1a50d3[_0x5c4306(0x1c5)]?.[_0x5c4306(0x1d6)]??_0x60d611['length'];let _0x31a5d5;return _0x3cd3b7?_0x31a5d5=_0x60d611:_0x31a5d5=await Promise[_0x5c4306(0x1b5)](_0x60d611[_0x5c4306(0x1b9)](async _0x5b5793=>{const _0x36e74c=_0x5c4306;let _0x24c7c5;try{_0x24c7c5=_0x5b5793[_0x36e74c(0x1b4)]?await getDbName(_0x2f409b[_0x36e74c(0x1c8)],_0x5b5793['dbId']):undefined;}catch{}return{'sqlCode':_0x5b5793[_0x36e74c(0x1b6)],'sqlName':_0x5b5793[_0x36e74c(0x1d3)],'description':_0x5b5793['description']??'','db':_0x24c7c5?_0x24c7c5+'\x20('+_0x5b5793[_0x36e74c(0x1b4)]+')':_0x5b5793[_0x36e74c(0x1b4)]??''};})),{'ok':!![],'data':_0x31a5d5,'message':_0x60d611[_0x5c4306(0x1c3)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x5c4306(0x1d4)+_0x60d611[_0x5c4306(0x1c3)]+_0x5c4306(0x1cc)+_0x3c0788+').'};}};