@lovrabet/rabetbase-cli 2.5.0-beta.6 → 2.5.1-beta.1

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 (312) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/api/generate-sdk-config-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.d.ts +7 -0
  7. package/lib/auth/auth-server.js +1 -1
  8. package/lib/auth/constant.js +1 -1
  9. package/lib/auth/get-cookie.js +1 -1
  10. package/lib/auth/get-session-user.js +1 -1
  11. package/lib/auth/is-session-valid.js +1 -1
  12. package/lib/auth/login-success-html.js +1 -1
  13. package/lib/auth/logout.js +1 -1
  14. package/lib/cli-flags.js +1 -1
  15. package/lib/cli.js +1 -1
  16. package/lib/commands/api/generate.js +1 -1
  17. package/lib/commands/api/index.js +1 -1
  18. package/lib/commands/api/list.js +1 -1
  19. package/lib/commands/api/pull.js +1 -1
  20. package/lib/commands/api/shared.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/members-list.js +1 -1
  24. package/lib/commands/app/remote-directory.js +1 -1
  25. package/lib/commands/app/shared.js +1 -1
  26. package/lib/commands/app-config/delete.js +1 -1
  27. package/lib/commands/app-config/get.js +1 -1
  28. package/lib/commands/app-config/index.js +1 -1
  29. package/lib/commands/app-config/list.js +1 -1
  30. package/lib/commands/app-config/set.js +1 -1
  31. package/lib/commands/app-config/shared.js +1 -1
  32. package/lib/commands/auth/index.js +1 -1
  33. package/lib/commands/bff/create.js +1 -1
  34. package/lib/commands/bff/delete.js +1 -1
  35. package/lib/commands/bff/detail.js +1 -1
  36. package/lib/commands/bff/index.js +1 -1
  37. package/lib/commands/bff/list.js +1 -1
  38. package/lib/commands/bff/pull.js +1 -1
  39. package/lib/commands/bff/push.js +1 -1
  40. package/lib/commands/bff/status.js +1 -1
  41. package/lib/commands/cli-skill/index.js +1 -1
  42. package/lib/commands/cli-update.js +1 -1
  43. package/lib/commands/codegen/index.js +1 -1
  44. package/lib/commands/codegen/sdk.js +1 -1
  45. package/lib/commands/codegen/sql.js +1 -1
  46. package/lib/commands/common/app-registry.js +1 -1
  47. package/lib/commands/common/app-selector.js +1 -1
  48. package/lib/commands/common/async-task.js +1 -1
  49. package/lib/commands/common/dry-run.js +1 -1
  50. package/lib/commands/common/flags.js +1 -1
  51. package/lib/commands/common/local-file.js +1 -1
  52. package/lib/commands/common/validate.js +1 -1
  53. package/lib/commands/config/delete.js +1 -1
  54. package/lib/commands/config/get.js +1 -1
  55. package/lib/commands/config/index.js +1 -1
  56. package/lib/commands/config/init.d.ts +1 -1
  57. package/lib/commands/config/init.js +1 -1
  58. package/lib/commands/config/list.js +1 -1
  59. package/lib/commands/config/set.js +1 -1
  60. package/lib/commands/config/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/table-diff-shared.js +1 -1
  95. package/lib/commands/db/tables.js +1 -1
  96. package/lib/commands/db/test.js +1 -1
  97. package/lib/commands/db/update.js +1 -1
  98. package/lib/commands/doctor.js +1 -1
  99. package/lib/commands/file/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/search.js +1 -1
  110. package/lib/commands/kb/shared.js +1 -1
  111. package/lib/commands/kb/update.js +1 -1
  112. package/lib/commands/logs/index.js +1 -1
  113. package/lib/commands/menu/asset-update.js +1 -1
  114. package/lib/commands/menu/delete.js +1 -1
  115. package/lib/commands/menu/external-link-create.js +1 -1
  116. package/lib/commands/menu/external-link-update.js +1 -1
  117. package/lib/commands/menu/group-create.js +1 -1
  118. package/lib/commands/menu/group-update.js +1 -1
  119. package/lib/commands/menu/index.js +1 -1
  120. package/lib/commands/menu/list.js +1 -1
  121. package/lib/commands/menu/move.js +1 -1
  122. package/lib/commands/menu/regroup-start.js +1 -1
  123. package/lib/commands/menu/rename.js +1 -1
  124. package/lib/commands/menu/shared/compare-table.js +1 -1
  125. package/lib/commands/menu/shared/delete-plan.js +1 -1
  126. package/lib/commands/menu/shared/facts.js +1 -1
  127. package/lib/commands/menu/shared/index.js +1 -1
  128. package/lib/commands/menu/shared/inquirer.js +1 -1
  129. package/lib/commands/menu/shared/local-pages.js +1 -1
  130. package/lib/commands/menu/shared/logic.js +1 -1
  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/update-core.js +1 -1
  135. package/lib/commands/menu/shared/valid-url.js +1 -1
  136. package/lib/commands/menu/sync.js +1 -1
  137. package/lib/commands/menu/visibility-update.js +1 -1
  138. package/lib/commands/notification/config-create.js +1 -1
  139. package/lib/commands/notification/config-delete.js +1 -1
  140. package/lib/commands/notification/config-list.js +1 -1
  141. package/lib/commands/notification/config-update.js +1 -1
  142. package/lib/commands/notification/index.js +1 -1
  143. package/lib/commands/notification/shared.js +1 -1
  144. package/lib/commands/ocr/index.js +1 -1
  145. package/lib/commands/page/create.js +1 -1
  146. package/lib/commands/page/custom/detail.js +1 -1
  147. package/lib/commands/page/custom/list.js +1 -1
  148. package/lib/commands/page/custom/publish.js +1 -1
  149. package/lib/commands/page/custom/shared.js +1 -1
  150. package/lib/commands/page/custom/syntax.js +1 -1
  151. package/lib/commands/page/custom/template.js +1 -1
  152. package/lib/commands/page/custom/update.js +1 -1
  153. package/lib/commands/page/data-list-status.js +1 -1
  154. package/lib/commands/page/generate-start.js +1 -1
  155. package/lib/commands/page/generate-status.js +1 -1
  156. package/lib/commands/page/index.js +1 -1
  157. package/lib/commands/page/pull.js +1 -1
  158. package/lib/commands/page/push.js +1 -1
  159. package/lib/commands/page/relation-audit.js +1 -1
  160. package/lib/commands/page/restore.js +1 -1
  161. package/lib/commands/page/shared.js +1 -1
  162. package/lib/commands/page/sync.js +1 -1
  163. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  164. package/lib/commands/project/create/format-elapsed.js +1 -1
  165. package/lib/commands/project/create/main.js +1 -1
  166. package/lib/commands/project/create/materialize-project-template.js +1 -1
  167. package/lib/commands/project/create/project-name.js +1 -1
  168. package/lib/commands/project/create/project-template-archive.js +1 -1
  169. package/lib/commands/project/create/project-template-path.js +1 -1
  170. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  171. package/lib/commands/project/create/use-format-code.js +1 -1
  172. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  173. package/lib/commands/project/index.js +1 -1
  174. package/lib/commands/project/upgrade.js +1 -1
  175. package/lib/commands/registry.js +1 -1
  176. package/lib/commands/role/delete.js +1 -1
  177. package/lib/commands/role/detail.js +1 -1
  178. package/lib/commands/role/index.js +1 -1
  179. package/lib/commands/role/list.js +1 -1
  180. package/lib/commands/role/shared.js +1 -1
  181. package/lib/commands/role/update.js +1 -1
  182. package/lib/commands/role/user-add.js +1 -1
  183. package/lib/commands/role/user-remove.js +1 -1
  184. package/lib/commands/role/user-resolve.js +1 -1
  185. package/lib/commands/run/index.js +1 -1
  186. package/lib/commands/schema.js +1 -1
  187. package/lib/commands/sql/create.js +1 -1
  188. package/lib/commands/sql/delete.js +1 -1
  189. package/lib/commands/sql/detail.js +1 -1
  190. package/lib/commands/sql/exec.js +1 -1
  191. package/lib/commands/sql/index.js +1 -1
  192. package/lib/commands/sql/list.js +1 -1
  193. package/lib/commands/sql/pull.js +1 -1
  194. package/lib/commands/sql/push.js +1 -1
  195. package/lib/commands/sql/shared.js +1 -1
  196. package/lib/commands/sql/status.js +1 -1
  197. package/lib/commands/sql/validate.js +1 -1
  198. package/lib/commands/task/index.js +1 -1
  199. package/lib/commands/task/status.js +1 -1
  200. package/lib/commands/tenant/index.js +1 -1
  201. package/lib/commands/tenant/members-list.js +1 -1
  202. package/lib/commands/tenant/shared.js +1 -1
  203. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  204. package/lib/commands/user-account/index.js +1 -1
  205. package/lib/commands/workspace/add.js +1 -1
  206. package/lib/commands/workspace/index.js +1 -1
  207. package/lib/commands/workspace/remove.js +1 -1
  208. package/lib/config/domain-config.d.ts +1 -1
  209. package/lib/config/domain-config.js +1 -1
  210. package/lib/config/project-routing.d.ts +30 -0
  211. package/lib/config/project-routing.js +1 -0
  212. package/lib/config/schema.d.ts +1 -1
  213. package/lib/config/schema.js +1 -1
  214. package/lib/constant/cdn.js +1 -1
  215. package/lib/constant/cli.js +1 -1
  216. package/lib/constant/defaults.js +1 -1
  217. package/lib/constant/domain.d.ts +7 -2
  218. package/lib/constant/domain.js +1 -1
  219. package/lib/constant/env.js +1 -1
  220. package/lib/constant/output.js +1 -1
  221. package/lib/constant/paths.js +1 -1
  222. package/lib/constant/region.d.ts +2 -2
  223. package/lib/constant/region.js +1 -1
  224. package/lib/constant/risk.js +1 -1
  225. package/lib/constant/routing-profile.d.ts +115 -0
  226. package/lib/constant/routing-profile.js +1 -0
  227. package/lib/context/app-resolver.js +1 -1
  228. package/lib/context/auth-resolver.js +1 -1
  229. package/lib/context/config-loader.js +1 -1
  230. package/lib/context.js +1 -1
  231. package/lib/core/alias-resolver.js +1 -1
  232. package/lib/core/api-client.js +1 -1
  233. package/lib/core/bff/config.js +1 -1
  234. package/lib/core/bff/file-system.js +1 -1
  235. package/lib/core/bff/hash.js +1 -1
  236. package/lib/core/bff/lock.js +1 -1
  237. package/lib/core/bff/utils.js +1 -1
  238. package/lib/core/db-resolver.js +1 -1
  239. package/lib/core/page/file-system.js +1 -1
  240. package/lib/core/page/hash.js +1 -1
  241. package/lib/core/page/lock.js +1 -1
  242. package/lib/core/sql-index-auditor.js +1 -1
  243. package/lib/core/sql-sync/config.js +1 -1
  244. package/lib/core/sql-sync/file-system.js +1 -1
  245. package/lib/core/sql-sync/hash.js +1 -1
  246. package/lib/core/sql-sync/lock.js +1 -1
  247. package/lib/core/sql-sync/utils.js +1 -1
  248. package/lib/core/sql-validator.js +1 -1
  249. package/lib/errors.js +1 -1
  250. package/lib/framework/build-all-flags.js +1 -1
  251. package/lib/framework/error-output.js +1 -1
  252. package/lib/framework/explicit-yes.js +1 -1
  253. package/lib/framework/flags.js +1 -1
  254. package/lib/framework/help.js +1 -1
  255. package/lib/framework/index.js +1 -1
  256. package/lib/framework/output.js +1 -1
  257. package/lib/framework/response.js +1 -1
  258. package/lib/framework/runner-alias.js +1 -1
  259. package/lib/framework/runner.js +1 -1
  260. package/lib/framework/schema-export.js +1 -1
  261. package/lib/framework/types.js +1 -1
  262. package/lib/generated/build-info.d.ts +4 -4
  263. package/lib/generated/build-info.js +1 -1
  264. package/lib/help.js +1 -1
  265. package/lib/postinstall.js +1 -1
  266. package/lib/runtime/confirmation.js +1 -1
  267. package/lib/runtime/event.js +1 -1
  268. package/lib/runtime/index.js +1 -1
  269. package/lib/runtime/queue.js +1 -1
  270. package/lib/runtime/resolve.js +1 -1
  271. package/lib/skills/builtin-skill.js +1 -1
  272. package/lib/skills/main.js +1 -1
  273. package/lib/skills/npx-skills-add.js +1 -1
  274. package/lib/skills/skill-presence.js +1 -1
  275. package/lib/telemetry/cli-command-trace.js +1 -1
  276. package/lib/telemetry/cli-help-trace.js +1 -1
  277. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  278. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  279. package/lib/telemetry/send-cli-trace-log.js +1 -1
  280. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  281. package/lib/utils/ai_config.js +1 -1
  282. package/lib/utils/apply-jq-filter.js +1 -1
  283. package/lib/utils/cdn-config.js +1 -1
  284. package/lib/utils/check-sdk-version.js +1 -1
  285. package/lib/utils/cli-version-check.js +1 -1
  286. package/lib/utils/cli-version-policy.js +1 -1
  287. package/lib/utils/config.js +1 -1
  288. package/lib/utils/entity-with-id.js +1 -1
  289. package/lib/utils/file-utils.js +1 -1
  290. package/lib/utils/guides-cdn.js +1 -1
  291. package/lib/utils/http-client.js +1 -1
  292. package/lib/utils/is-non-interactive.js +1 -1
  293. package/lib/utils/logger.js +1 -1
  294. package/lib/utils/params.js +1 -1
  295. package/lib/utils/platform.js +1 -1
  296. package/lib/utils/sleep.js +1 -1
  297. package/lib/utils/template-replacer.js +1 -1
  298. package/lib/utils/update-notice.js +1 -1
  299. package/lib/utils/version.js +1 -1
  300. package/lib/utils/with-active-cookie.js +1 -1
  301. package/lib/utils/write-cli-side-channel.js +1 -1
  302. package/package.json +1 -2
  303. package/skills/rabetbase/SKILL.md +10 -5
  304. package/skills/rabetbase/guides/frontend-development.md +2 -0
  305. package/skills/rabetbase/guides/sdk-client-generation.md +3 -2
  306. package/skills/rabetbase/guides/typescript-sdk.md +42 -0
  307. package/skills/rabetbase/references/rabetbase-api-pull.md +5 -3
  308. package/skills/rabetbase/references/rabetbase-config.md +9 -5
  309. package/skills/rabetbase/references/rabetbase-init.md +11 -5
  310. package/skills/rabetbase/references/rabetbase-project-create.md +6 -5
  311. package/skills/rabetbase.manifest.json +3 -3
  312. package/templates/README.md +13 -17
@@ -1 +1 @@
1
- function a174_0x5cc1(){const _0x49e74d=['\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','Deleted\x20role\x20','328675wAfpvV','delete','116634jdYvUV','num','5IAQVjx','POST','appCode','10097857ClMKiC','201elBgGX','1298388MblmVF','userCount','Role\x20still\x20has\x20','8hDEAqa','roleName','916506NvlOnZ','35QrSKpi','\x20(id=','2146260OUmGgC','high-risk-write','/smartapi/permit/role/delete','dev','4008HAZMks'];a174_0x5cc1=function(){return _0x49e74d;};return a174_0x5cc1();}const a174_0x2c90f4=a174_0x110f;(function(_0x20b21c,_0x2c357e){const _0x1702b2=a174_0x110f,_0x18c359=_0x20b21c();while(!![]){try{const _0x2078a4=-parseInt(_0x1702b2(0x18b))/0x1+parseInt(_0x1702b2(0x188))/0x2*(parseInt(_0x1702b2(0x193))/0x3)+parseInt(_0x1702b2(0x194))/0x4*(-parseInt(_0x1702b2(0x18f))/0x5)+parseInt(_0x1702b2(0x18d))/0x6*(-parseInt(_0x1702b2(0x19a))/0x7)+-parseInt(_0x1702b2(0x197))/0x8*(-parseInt(_0x1702b2(0x199))/0x9)+-parseInt(_0x1702b2(0x19c))/0xa+parseInt(_0x1702b2(0x192))/0xb;if(_0x2078a4===_0x2c357e)break;else _0x18c359['push'](_0x18c359['shift']());}catch(_0x7c168b){_0x18c359['push'](_0x18c359['shift']());}}}(a174_0x5cc1,0x2e244));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a174_0x110f(_0x104304,_0x524f16){_0x104304=_0x104304-0x187;const _0x5cc12f=a174_0x5cc1();let _0x110ff7=_0x5cc12f[_0x104304];return _0x110ff7;}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a174_0x2c90f4(0x19e);export const roleDelete={'service':'role','command':a174_0x2c90f4(0x18c),'description':'Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','risk':a174_0x2c90f4(0x19d),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x47c4de){const _0x2972bd=a174_0x2c90f4,_0x22e19f=_0x47c4de['num']('id'),_0x18ebff=await getRoleById(_0x47c4de[_0x2972bd(0x191)],_0x22e19f);return assertCustomRole(_0x18ebff,'delete'),asDryRunResult({'scope':'dev','operation':_0x2972bd(0x18c),'selector':{'appCode':_0x47c4de[_0x2972bd(0x191)],'roleId':_0x22e19f,'roleName':_0x18ebff[_0x2972bd(0x198)]},'before':projectRole(_0x18ebff),'after':null,'dryRun':!![],'backend':{'method':_0x2972bd(0x190),'path':DELETE_PATH},'warnings':_0x18ebff[_0x2972bd(0x195)]>0x0?[_0x2972bd(0x196)+_0x18ebff[_0x2972bd(0x195)]+_0x2972bd(0x189)]:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x1d49a4){const _0x22932a=a174_0x2c90f4,_0x4c9b55=_0x1d49a4[_0x22932a(0x18e)]('id'),_0x2f0dff=await getRoleById(_0x1d49a4['appCode'],_0x4c9b55);return assertCustomRole(_0x2f0dff,_0x22932a(0x18c)),await deleteAppRole(_0x4c9b55),{'ok':!![],'data':{'scope':_0x22932a(0x187),'operation':'delete','selector':{'appCode':_0x1d49a4[_0x22932a(0x191)],'roleId':_0x4c9b55,'roleName':_0x2f0dff[_0x22932a(0x198)]},'before':projectRole(_0x2f0dff),'after':null,'dryRun':![],'backend':{'method':_0x22932a(0x190),'path':DELETE_PATH},'warnings':[]},'message':_0x22932a(0x18a)+_0x2f0dff[_0x22932a(0x198)]+_0x22932a(0x19b)+_0x4c9b55+')'};}};
1
+ const a174_0x3e71c6=a174_0x44d8;(function(_0x81752a,_0x4af760){const _0x229be5=a174_0x44d8,_0x397f9a=_0x81752a();while(!![]){try{const _0x1072a0=parseInt(_0x229be5(0x1b7))/0x1+parseInt(_0x229be5(0x1b3))/0x2+parseInt(_0x229be5(0x1b5))/0x3+-parseInt(_0x229be5(0x1bb))/0x4*(-parseInt(_0x229be5(0x1b4))/0x5)+parseInt(_0x229be5(0x1c6))/0x6*(-parseInt(_0x229be5(0x1c7))/0x7)+-parseInt(_0x229be5(0x1c9))/0x8*(-parseInt(_0x229be5(0x1ba))/0x9)+-parseInt(_0x229be5(0x1bf))/0xa;if(_0x1072a0===_0x4af760)break;else _0x397f9a['push'](_0x397f9a['shift']());}catch(_0xd6d130){_0x397f9a['push'](_0x397f9a['shift']());}}}(a174_0x5bdf,0x40d73));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a174_0x5bdf(){const _0x29ef6d=['24LGQzkR','43967Fxthdp','high-risk-write','143176rhxhkf','Role\x20still\x20has\x20','994456UiYxxP','105XIjmKM','959268cmGrJz','POST','213410FlwfTo','\x20(id=','role','180TXoXvn','55464VHrMgY','delete','Deleted\x20role\x20','roleName','13888090oRKYIz','num','dev','userCount','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','appCode','/smartapi/permit/role/delete'];a174_0x5bdf=function(){return _0x29ef6d;};return a174_0x5bdf();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a174_0x3e71c6(0x1c5);function a174_0x44d8(_0x158d0e,_0x43be1f){_0x158d0e=_0x158d0e-0x1b2;const _0x5bdf16=a174_0x5bdf();let _0x44d807=_0x5bdf16[_0x158d0e];return _0x44d807;}export const roleDelete={'service':a174_0x3e71c6(0x1b9),'command':a174_0x3e71c6(0x1bc),'description':'Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','risk':a174_0x3e71c6(0x1c8),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x10589b){const _0x4aa50e=a174_0x3e71c6,_0x1231a6=_0x10589b[_0x4aa50e(0x1c0)]('id'),_0x169086=await getRoleById(_0x10589b[_0x4aa50e(0x1c4)],_0x1231a6);return assertCustomRole(_0x169086,_0x4aa50e(0x1bc)),asDryRunResult({'scope':'dev','operation':_0x4aa50e(0x1bc),'selector':{'appCode':_0x10589b[_0x4aa50e(0x1c4)],'roleId':_0x1231a6,'roleName':_0x169086[_0x4aa50e(0x1be)]},'before':projectRole(_0x169086),'after':null,'dryRun':!![],'backend':{'method':_0x4aa50e(0x1b6),'path':DELETE_PATH},'warnings':_0x169086[_0x4aa50e(0x1c2)]>0x0?[_0x4aa50e(0x1b2)+_0x169086[_0x4aa50e(0x1c2)]+_0x4aa50e(0x1c3)]:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x4a5c55){const _0x56b17a=a174_0x3e71c6,_0x585129=_0x4a5c55[_0x56b17a(0x1c0)]('id'),_0x1d7f28=await getRoleById(_0x4a5c55[_0x56b17a(0x1c4)],_0x585129);return assertCustomRole(_0x1d7f28,'delete'),await deleteAppRole(_0x585129),{'ok':!![],'data':{'scope':_0x56b17a(0x1c1),'operation':_0x56b17a(0x1bc),'selector':{'appCode':_0x4a5c55[_0x56b17a(0x1c4)],'roleId':_0x585129,'roleName':_0x1d7f28[_0x56b17a(0x1be)]},'before':projectRole(_0x1d7f28),'after':null,'dryRun':![],'backend':{'method':_0x56b17a(0x1b6),'path':DELETE_PATH},'warnings':[]},'message':_0x56b17a(0x1bd)+_0x1d7f28[_0x56b17a(0x1be)]+_0x56b17a(0x1b8)+_0x585129+')'};}};
@@ -1 +1 @@
1
- const a175_0xb38f3=a175_0x15c8;function a175_0x15c8(_0x265e39,_0x219e4a){_0x265e39=_0x265e39-0x14e;const _0x43f3f9=a175_0x43f3();let _0x15c8c1=_0x43f3f9[_0x265e39];return _0x15c8c1;}(function(_0x2f5094,_0x4fa85b){const _0x580972=a175_0x15c8,_0x5d9178=_0x2f5094();while(!![]){try{const _0x254615=-parseInt(_0x580972(0x159))/0x1*(parseInt(_0x580972(0x150))/0x2)+-parseInt(_0x580972(0x154))/0x3+-parseInt(_0x580972(0x160))/0x4+parseInt(_0x580972(0x14e))/0x5*(-parseInt(_0x580972(0x153))/0x6)+-parseInt(_0x580972(0x15d))/0x7+parseInt(_0x580972(0x15a))/0x8*(-parseInt(_0x580972(0x157))/0x9)+parseInt(_0x580972(0x15e))/0xa;if(_0x254615===_0x4fa85b)break;else _0x5d9178['push'](_0x5d9178['shift']());}catch(_0x376b5e){_0x5d9178['push'](_0x5d9178['shift']());}}}(a175_0x43f3,0xeb6f6));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a175_0x43f3(){const _0x7e6fcd=['Role\x20','detail','23742RWWvUx','roleType','373kAQYsa','3048MeSGcz','roleName','appCode','5432378pbjQig','60298080HYgmHP','role','5995584NeZLqW','35HlMMWZ','dev','1678DwbLmG','read','num','1069962gIMzcu','672606WIdrqo'];a175_0x43f3=function(){return _0x7e6fcd;};return a175_0x43f3();}export const roleDetail={'service':a175_0xb38f3(0x15f),'command':a175_0xb38f3(0x156),'description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':a175_0xb38f3(0x151),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x29115f){const _0x58452c=a175_0xb38f3,_0x1b562c=_0x29115f[_0x58452c(0x152)]('id'),_0x1c8ce5=await getRoleById(_0x29115f[_0x58452c(0x15c)],_0x1b562c);return{'ok':!![],'data':{'scope':_0x58452c(0x14f),'role':projectRole(_0x1c8ce5)},'message':_0x58452c(0x155)+_0x1c8ce5[_0x58452c(0x15b)]+'\x20('+_0x1c8ce5[_0x58452c(0x158)]+')'};}};
1
+ const a175_0x59647d=a175_0x5797;function a175_0x5797(_0x538d1d,_0x556bee){_0x538d1d=_0x538d1d-0xe4;const _0x54b98c=a175_0x54b9();let _0x579720=_0x54b98c[_0x538d1d];return _0x579720;}(function(_0xd746d8,_0xde539d){const _0x37d781=a175_0x5797,_0x2e25ae=_0xd746d8();while(!![]){try{const _0x4a2aad=-parseInt(_0x37d781(0xeb))/0x1*(-parseInt(_0x37d781(0xee))/0x2)+parseInt(_0x37d781(0xf0))/0x3+-parseInt(_0x37d781(0xf2))/0x4+-parseInt(_0x37d781(0xe6))/0x5+-parseInt(_0x37d781(0xe9))/0x6*(parseInt(_0x37d781(0xec))/0x7)+-parseInt(_0x37d781(0xe7))/0x8+parseInt(_0x37d781(0xed))/0x9;if(_0x4a2aad===_0xde539d)break;else _0x2e25ae['push'](_0x2e25ae['shift']());}catch(_0x1a4868){_0x2e25ae['push'](_0x2e25ae['shift']());}}}(a175_0x54b9,0x4d330));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a175_0x54b9(){const _0x425da6=['Role\x20','1028478zJuxvP','role','60502LTfPzF','7GkfeNi','12085920oDVTOJ','4mgPeXD','detail','979398WasWHw','Show\x20a\x20single\x20role\x27s\x20detail','1987624mznVvL','roleName','read','roleType','2551965mSQfwJ','2363440OSqKCR'];a175_0x54b9=function(){return _0x425da6;};return a175_0x54b9();}export const roleDetail={'service':a175_0x59647d(0xea),'command':a175_0x59647d(0xef),'description':a175_0x59647d(0xf1),'risk':a175_0x59647d(0xe4),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x9458b0){const _0x35f662=a175_0x59647d,_0x5aec30=_0x9458b0['num']('id'),_0x2109e4=await getRoleById(_0x9458b0['appCode'],_0x5aec30);return{'ok':!![],'data':{'scope':'dev','role':projectRole(_0x2109e4)},'message':_0x35f662(0xe8)+_0x2109e4[_0x35f662(0xf3)]+'\x20('+_0x2109e4[_0x35f662(0xe5)]+')'};}};
@@ -1 +1 @@
1
- (function(_0xcecf7e,_0x916a8){const _0x3e27b2=a176_0x3aa9,_0x44b953=_0xcecf7e();while(!![]){try{const _0x2db7d7=-parseInt(_0x3e27b2(0x1b5))/0x1*(-parseInt(_0x3e27b2(0x1ae))/0x2)+parseInt(_0x3e27b2(0x1b2))/0x3*(parseInt(_0x3e27b2(0x1af))/0x4)+-parseInt(_0x3e27b2(0x1b3))/0x5*(-parseInt(_0x3e27b2(0x1ad))/0x6)+-parseInt(_0x3e27b2(0x1b6))/0x7*(parseInt(_0x3e27b2(0x1b4))/0x8)+-parseInt(_0x3e27b2(0x1b7))/0x9+parseInt(_0x3e27b2(0x1b0))/0xa+-parseInt(_0x3e27b2(0x1b1))/0xb;if(_0x2db7d7===_0x916a8)break;else _0x44b953['push'](_0x44b953['shift']());}catch(_0x448c03){_0x44b953['push'](_0x44b953['shift']());}}}(a176_0x8df5,0x3921f));function a176_0x8df5(){const _0x162391=['3833208QHxvly','6fEMJAu','10iRASvQ','76372uKEnUv','4675060ZERRSG','3593491eMdFgw','69wSHVrx','398685eZbIUU','238808ZNmLzt','53777UMSDYE','63PMAxcx'];a176_0x8df5=function(){return _0x162391;};return a176_0x8df5();}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_0x3aa9(_0x1889ff,_0x45cc67){_0x1889ff=_0x1889ff-0x1ad;const _0x8df56f=a176_0x8df5();let _0x3aa9ba=_0x8df56f[_0x1889ff];return _0x3aa9ba;}import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0x51537f,_0x102e0e){const _0x31ffdd=a176_0x40fb,_0xd3ea49=_0x51537f();while(!![]){try{const _0x314445=parseInt(_0x31ffdd(0xb1))/0x1+-parseInt(_0x31ffdd(0xb3))/0x2+parseInt(_0x31ffdd(0xb2))/0x3+-parseInt(_0x31ffdd(0xb4))/0x4*(parseInt(_0x31ffdd(0xb5))/0x5)+parseInt(_0x31ffdd(0xb7))/0x6+-parseInt(_0x31ffdd(0xb8))/0x7+-parseInt(_0x31ffdd(0xb6))/0x8;if(_0x314445===_0x102e0e)break;else _0xd3ea49['push'](_0xd3ea49['shift']());}catch(_0x462566){_0xd3ea49['push'](_0xd3ea49['shift']());}}}(a176_0x1a4f,0x7e0d6));function a176_0x1a4f(){const _0x4c8c91=['1579504xidanB','4yGhpii','580205BUyOvy','6933080hGoeTD','3061044ZAPVGV','134918flntaM','958767pRaIYC','2517213LjhUYP'];a176_0x1a4f=function(){return _0x4c8c91;};return a176_0x1a4f();}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';function a176_0x40fb(_0x492932,_0x3d1863){_0x492932=_0x492932-0xb1;const _0x1a4f48=a176_0x1a4f();let _0x40fb27=_0x1a4f48[_0x492932];return _0x40fb27;}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 +1 @@
1
- const a177_0x38fdee=a177_0x3a32;(function(_0x25f683,_0x148477){const _0x54de98=a177_0x3a32,_0xdbe513=_0x25f683();while(!![]){try{const _0x57cad9=parseInt(_0x54de98(0x116))/0x1+parseInt(_0x54de98(0x121))/0x2*(-parseInt(_0x54de98(0x10f))/0x3)+parseInt(_0x54de98(0x100))/0x4+parseInt(_0x54de98(0x112))/0x5*(parseInt(_0x54de98(0x104))/0x6)+-parseInt(_0x54de98(0x117))/0x7+-parseInt(_0x54de98(0x113))/0x8*(-parseInt(_0x54de98(0x11d))/0x9)+parseInt(_0x54de98(0xfe))/0xa;if(_0x57cad9===_0x148477)break;else _0xdbe513['push'](_0xdbe513['shift']());}catch(_0x20bd21){_0xdbe513['push'](_0xdbe513['shift']());}}}(a177_0x2315,0x9de2f));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';function a177_0x3a32(_0x19f7e4,_0x1e0347){_0x19f7e4=_0x19f7e4-0xfc;const _0x231573=a177_0x2315();let _0x3a320d=_0x231573[_0x19f7e4];return _0x3a320d;}const ROLE_TYPES=['ADMIN',a177_0x38fdee(0x11b),a177_0x38fdee(0x107),'CUSTOM'];export const roleList={'service':a177_0x38fdee(0x115),'command':a177_0x38fdee(0xfd),'description':a177_0x38fdee(0x103),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a177_0x38fdee(0xfc),'type':a177_0x38fdee(0x11c),'required':![],'description':a177_0x38fdee(0x111),'enum':ROLE_TYPES},{'name':a177_0x38fdee(0x119),'type':a177_0x38fdee(0x114),'description':a177_0x38fdee(0x109),'default':0x1},{'name':'pagesize','type':a177_0x38fdee(0x114),'description':a177_0x38fdee(0x10d),'default':0x64}],async 'validate'(_0x32a8d2){const _0x1d9382=a177_0x38fdee,_0xb52b81=_0x32a8d2['str']('type')[_0x1d9382(0x110)]();if(_0xb52b81&&!ROLE_TYPES[_0x1d9382(0x10e)](_0xb52b81['toUpperCase']()))throw CliErrors[_0x1d9382(0x118)](_0x1d9382(0x10b)+_0xb52b81+'\x22.',_0x1d9382(0x10c)+ROLE_TYPES[_0x1d9382(0x11a)](',\x20')+'.');const _0x3b164c=_0x32a8d2[_0x1d9382(0x105)](_0x1d9382(0x119),0x1),_0x146cd8=_0x32a8d2[_0x1d9382(0x105)]('pagesize',0x64);if(_0x3b164c<0x1)throw CliErrors[_0x1d9382(0x118)](_0x1d9382(0x106));if(_0x146cd8<0x1||_0x146cd8>0x64)throw CliErrors['validation'](_0x1d9382(0xff));},async 'execute'(_0x23bed0){const _0x24edfb=a177_0x38fdee,_0x146a14=_0x23bed0['num'](_0x24edfb(0x119),0x1)||0x1,_0x6b516e=_0x23bed0[_0x24edfb(0x105)](_0x24edfb(0x102),0x64)||0x64,_0x36323a=_0x23bed0[_0x24edfb(0x108)]('type')['trim']()[_0x24edfb(0x11f)](),{items:_0x350c7a,paging:_0x589178}=await listAppRoles(_0x23bed0[_0x24edfb(0x101)],{'currentPage':_0x146a14,'pageSize':_0x6b516e}),_0x47896f=_0x36323a?_0x350c7a[_0x24edfb(0x11e)](_0x4cb6c6=>_0x4cb6c6['roleType']===_0x36323a):_0x350c7a,_0x50adc7=_0x47896f['map'](projectRole);return{'ok':!![],'data':{'scope':'dev','roles':_0x50adc7,'paging':_0x589178},'message':'Found\x20'+_0x50adc7[_0x24edfb(0x10a)]+_0x24edfb(0x120)};}};function a177_0x2315(){const _0x351e50=['appCode','pagesize','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','4425054cuXPJn','num','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','OWNER','str','Page\x20index\x20(1-based)','length','Invalid\x20--type\x20\x22','Use\x20one\x20of:\x20','Page\x20size\x20(1-100)','includes','3804423eqJuCZ','trim','Filter\x20by\x20role\x20type','5maCakt','303592sEZgJD','number','role','830398zwRfqO','7243467tfOzQE','validation','page','join','DEV','string','117vCSjHE','filter','toUpperCase','\x20role(s)','2MGdibo','type','list','8422340JMkxTN','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','184588FsNKrT'];a177_0x2315=function(){return _0x351e50;};return a177_0x2315();}
1
+ const a177_0x18e284=a177_0x4cdc;function a177_0x4cdc(_0xf7afeb,_0x50667b){_0xf7afeb=_0xf7afeb-0x142;const _0x4160af=a177_0x4160();let _0x4cdc1e=_0x4160af[_0xf7afeb];return _0x4cdc1e;}(function(_0x5ceb03,_0x566e60){const _0x544c15=a177_0x4cdc,_0x5ec117=_0x5ceb03();while(!![]){try{const _0x36ad73=parseInt(_0x544c15(0x162))/0x1*(parseInt(_0x544c15(0x15e))/0x2)+-parseInt(_0x544c15(0x144))/0x3+parseInt(_0x544c15(0x142))/0x4+parseInt(_0x544c15(0x163))/0x5+parseInt(_0x544c15(0x155))/0x6+parseInt(_0x544c15(0x146))/0x7+-parseInt(_0x544c15(0x157))/0x8*(parseInt(_0x544c15(0x151))/0x9);if(_0x36ad73===_0x566e60)break;else _0x5ec117['push'](_0x5ec117['shift']());}catch(_0x14b2c9){_0x5ec117['push'](_0x5ec117['shift']());}}}(a177_0x4160,0x28043));function a177_0x4160(){const _0x479cb8=['226962qRPuQT','num','19144ReORPj','number','string','map','trim','Filter\x20by\x20role\x20type','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','2FWoIym','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','\x20role(s)','length','164207rfqHzf','1485385sEBdbs','roleType','toUpperCase','Page\x20size\x20(1-100)','type','852376HPIwUP','includes','821271Ubzihb','appCode','373100oovkxz','Found\x20','join','validation','dev','str','page','role','Invalid\x20--type\x20\x22','pagesize','Page\x20index\x20(1-based)','1233NCDHxX','filter','list','Use\x20one\x20of:\x20'];a177_0x4160=function(){return _0x479cb8;};return a177_0x4160();}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','DEV','OWNER','CUSTOM'];export const roleList={'service':a177_0x18e284(0x14d),'command':a177_0x18e284(0x153),'description':a177_0x18e284(0x15d),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a177_0x18e284(0x167),'type':a177_0x18e284(0x159),'required':![],'description':a177_0x18e284(0x15c),'enum':ROLE_TYPES},{'name':a177_0x18e284(0x14c),'type':'number','description':a177_0x18e284(0x150),'default':0x1},{'name':'pagesize','type':a177_0x18e284(0x158),'description':a177_0x18e284(0x166),'default':0x64}],async 'validate'(_0xabcd09){const _0x44ee5a=a177_0x18e284,_0x422c2f=_0xabcd09['str'](_0x44ee5a(0x167))[_0x44ee5a(0x15b)]();if(_0x422c2f&&!ROLE_TYPES[_0x44ee5a(0x143)](_0x422c2f['toUpperCase']()))throw CliErrors[_0x44ee5a(0x149)](_0x44ee5a(0x14e)+_0x422c2f+'\x22.',_0x44ee5a(0x154)+ROLE_TYPES[_0x44ee5a(0x148)](',\x20')+'.');const _0x407d99=_0xabcd09[_0x44ee5a(0x156)](_0x44ee5a(0x14c),0x1),_0x26f880=_0xabcd09['num'](_0x44ee5a(0x14f),0x64);if(_0x407d99<0x1)throw CliErrors['validation'](_0x44ee5a(0x15f));if(_0x26f880<0x1||_0x26f880>0x64)throw CliErrors[_0x44ee5a(0x149)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x40de5e){const _0x18cc11=a177_0x18e284,_0x12f487=_0x40de5e[_0x18cc11(0x156)](_0x18cc11(0x14c),0x1)||0x1,_0x54d534=_0x40de5e[_0x18cc11(0x156)]('pagesize',0x64)||0x64,_0x47c5fa=_0x40de5e[_0x18cc11(0x14b)]('type')[_0x18cc11(0x15b)]()[_0x18cc11(0x165)](),{items:_0x56b929,paging:_0x21abcc}=await listAppRoles(_0x40de5e[_0x18cc11(0x145)],{'currentPage':_0x12f487,'pageSize':_0x54d534}),_0x34ed78=_0x47c5fa?_0x56b929[_0x18cc11(0x152)](_0x40c8b1=>_0x40c8b1[_0x18cc11(0x164)]===_0x47c5fa):_0x56b929,_0x388be4=_0x34ed78[_0x18cc11(0x15a)](projectRole);return{'ok':!![],'data':{'scope':_0x18cc11(0x14a),'roles':_0x388be4,'paging':_0x21abcc},'message':_0x18cc11(0x147)+_0x388be4[_0x18cc11(0x161)]+_0x18cc11(0x160)};}};
@@ -1 +1 @@
1
- const a178_0x2245a4=a178_0x53e1;function a178_0x5a31(){const _0x30b702=['4AdvGun','totalCount','dryRun','tenant_code','1033012zjkhOs','push','permitCount','\x20not\x20found\x20in\x20app\x20','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','string','user','Role\x20id\x20or\x20exact\x20role\x20name','toLowerCase','DEV','tenant','\x20built-in\x20role\x20','\x22\x20not\x20found\x20in\x20app\x20','number','name','Check\x20the\x20nickname/username.\x20','test','Missing\x20user\x20reference.','\x20members\x20of\x20the\x20OWNER\x20role.','Optional\x20role\x20remark/description','join','map','Role\x20id\x20','dev','11490984RdUcjB','Multiple\x20tenant\x20members\x20match\x20\x22','8XfbqQM','Cannot\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Pass\x20--user\x20<id|name>.','Pass\x20--role\x20<id|name>.','roleName','username','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','role','remark','flagMissing','Role\x20name\x20\x22','\x20duplicate\x20memberships\x20for\x20user\x20','filter','authRequired','User\x20','includes','143WyCOpC','ADMIN','Role\x20name','13466243SPoLWS','\x22\x20is\x20ambiguous\x20(ids:\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.',';\x20no\x20change.','/smartapi/permit/user-role/create','1254030DKGzSr','\x20member(s)\x20but\x20role\x20has\x20','userId','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','length','str','find','userCount','Anti-drift\x20check\x20failed:\x20expected\x20','CUSTOM','3amVYSy','9025715idsAqI','flag','roleType','validation','expect-user-count','OWNER','POST','expectUserCount','1713456hShFsX','nickname','appCode','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','trim','4991097zVMszN','user-add','Pass\x20--user\x20<id>.','Role\x20id\x20(from\x20`role\x20list`)'];a178_0x5a31=function(){return _0x30b702;};return a178_0x5a31();}(function(_0x31d315,_0x5d98fa){const _0x558024=a178_0x53e1,_0x4b08a8=_0x31d315();while(!![]){try{const _0x575042=parseInt(_0x558024(0xce))/0x1*(-parseInt(_0x558024(0xe5))/0x2)+-parseInt(_0x558024(0xdd))/0x3+-parseInt(_0x558024(0xe1))/0x4*(-parseInt(_0x558024(0xcf))/0x5)+parseInt(_0x558024(0xfd))/0x6+parseInt(_0x558024(0xbf))/0x7*(parseInt(_0x558024(0xff))/0x8)+parseInt(_0x558024(0xd7))/0x9+parseInt(_0x558024(0xc4))/0xa*(-parseInt(_0x558024(0xbc))/0xb);if(_0x575042===_0x5d98fa)break;else _0x4b08a8['push'](_0x4b08a8['shift']());}catch(_0x327add){_0x4b08a8['push'](_0x4b08a8['shift']());}}}(a178_0x5a31,0xf1f08));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':a178_0x2245a4(0xf2),'required':!![],'description':a178_0x2245a4(0xe0)};export const ROLE_REF_FLAG={'name':a178_0x2245a4(0x107),'type':a178_0x2245a4(0xea),'required':!![],'description':a178_0x2245a4(0xec)};export const USER_REF_FLAG={'name':a178_0x2245a4(0xeb),'type':'string','required':!![],'description':a178_0x2245a4(0x106)};export const NAME_FLAG={'name':a178_0x2245a4(0xf3),'type':a178_0x2245a4(0xea),'required':!![],'description':a178_0x2245a4(0xbe)};export const USER_NAME_FLAG={'name':a178_0x2245a4(0xf3),'type':a178_0x2245a4(0xea),'required':!![],'description':a178_0x2245a4(0xda)};export const REMARK_FLAG={'name':a178_0x2245a4(0x108),'type':a178_0x2245a4(0xea),'required':![],'description':a178_0x2245a4(0xf8)};export const EXPECT_USER_COUNT_FLAG={'name':a178_0x2245a4(0xd3),'type':'number','required':![],'description':a178_0x2245a4(0xc7)};export const BUILTIN_ROLE_TYPES=[a178_0x2245a4(0xbd),a178_0x2245a4(0xee),a178_0x2245a4(0xd4)];export function isBuiltinRole(_0x4cbc79){const _0x13b477=a178_0x2245a4;return BUILTIN_ROLE_TYPES[_0x13b477(0xbb)](_0x4cbc79);}export function assertCustomRole(_0x250e7c,_0x37e7ae){const _0x10a901=a178_0x2245a4;if(_0x250e7c[_0x10a901(0xd1)]!==_0x10a901(0xcd))throw CliErrors[_0x10a901(0xd2)](_0x10a901(0x100)+_0x37e7ae+_0x10a901(0xf0)+_0x250e7c[_0x10a901(0x104)]+'\x20('+_0x250e7c[_0x10a901(0xd1)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x59617d){const _0x1ece3f=a178_0x2245a4;return{'id':_0x59617d['id'],'roleName':_0x59617d[_0x1ece3f(0x104)],'roleType':_0x59617d['roleType'],'remark':_0x59617d[_0x1ece3f(0x108)],'userCount':_0x59617d[_0x1ece3f(0xcb)],'permitCount':_0x59617d[_0x1ece3f(0xe7)],'builtin':isBuiltinRole(_0x59617d['roleType'])};}export async function resolveRoleRef(_0x25f4b5,_0xaa2baf){const _0x1cd7cf=a178_0x2245a4,_0xc6a977=_0xaa2baf['trim']();if(!_0xc6a977)throw CliErrors[_0x1cd7cf(0xd2)]('Missing\x20role\x20reference.',_0x1cd7cf(0x103));if(/^\d+$/[_0x1cd7cf(0xf5)](_0xc6a977))return getRoleById(_0x25f4b5,Number(_0xc6a977));const _0x10b647=await listAllAppRoles(_0x25f4b5),_0x3ac98b=_0x10b647[_0x1cd7cf(0xb8)](_0x355658=>_0x355658[_0x1cd7cf(0x104)]===_0xc6a977);if(_0x3ac98b[_0x1cd7cf(0xc8)]===0x0)throw CliErrors[_0x1cd7cf(0xd2)](_0x1cd7cf(0xb6)+_0xc6a977+_0x1cd7cf(0xf1)+_0x25f4b5+'.',_0x1cd7cf(0x101));if(_0x3ac98b[_0x1cd7cf(0xc8)]>0x1){const _0x795451=_0x3ac98b['map'](_0x29eee4=>_0x29eee4['id'])[_0x1cd7cf(0xf9)](',\x20');throw CliErrors[_0x1cd7cf(0xd2)]('Role\x20name\x20\x22'+_0xc6a977+_0x1cd7cf(0xc0)+_0x795451+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x3ac98b[0x0];}export async function getRoleById(_0x7a98e0,_0x54cc49){const _0x50eb89=a178_0x2245a4,_0x2e38b5=await listAllAppRoles(_0x7a98e0),_0x2edb7d=_0x2e38b5[_0x50eb89(0xb8)](_0x154b2c=>_0x154b2c['id']===_0x54cc49&&(!_0x154b2c[_0x50eb89(0xd9)]||_0x154b2c[_0x50eb89(0xd9)]===_0x7a98e0));if(_0x2edb7d[_0x50eb89(0xc8)]!==0x1)throw CliErrors[_0x50eb89(0xd2)](_0x50eb89(0xfb)+_0x54cc49+_0x50eb89(0xe8)+_0x7a98e0+'.',_0x50eb89(0xc1));return _0x2edb7d[0x0];}async function listAllAppRoles(_0x206fd0){const _0x371b8f=a178_0x2245a4,_0x155cc7=0x64,_0x21766a=[];for(let _0x260698=0x1;;_0x260698+=0x1){const {items:_0x107c72,paging:_0x5a4ba0}=await listAppRoles(_0x206fd0,{'currentPage':_0x260698,'pageSize':_0x155cc7});_0x21766a[_0x371b8f(0xe6)](..._0x107c72);if(_0x107c72[_0x371b8f(0xc8)]<_0x155cc7||_0x5a4ba0&&_0x21766a['length']>=_0x5a4ba0[_0x371b8f(0xe2)])return _0x21766a;}}export async function resolveTenantCode(){const _0xb5bb83=a178_0x2245a4,_0x1b878d=await getSessionUserInfo(),_0x4ef568=_0x1b878d?.['user']?.[_0xb5bb83(0xef)]?.[_0xb5bb83(0xe4)];if(!_0x4ef568)throw CliErrors[_0xb5bb83(0xb9)](_0xb5bb83(0xdb));return _0x4ef568;}function matchMember(_0x45106e,_0x3fbfe1){const _0x4bbae9=a178_0x2245a4,_0x24dc39=_0x3fbfe1['trim']()['toLowerCase']();return(_0x45106e[_0x4bbae9(0xd8)]??'')[_0x4bbae9(0xed)]()===_0x24dc39||(_0x45106e[_0x4bbae9(0x105)]??'')[_0x4bbae9(0xed)]()===_0x24dc39;}export async function resolveUserRef(_0x4da721,_0x4332d5=a178_0x2245a4(0xdf)){const _0x6ec11b=a178_0x2245a4,_0x29a028=_0x4da721[_0x6ec11b(0xdc)]();if(!_0x29a028)throw CliErrors[_0x6ec11b(0xd2)](_0x6ec11b(0xf6),_0x6ec11b(0x102));const _0x250031=await resolveTenantCode(),_0x2629b0=await getTenantMembers(_0x250031);if(/^\d+$/['test'](_0x29a028)){const _0x49063d=Number(_0x29a028),_0x56eee6=_0x2629b0[_0x6ec11b(0xca)](_0x44b79f=>_0x44b79f[_0x6ec11b(0xc6)]===_0x49063d);return{'userId':_0x49063d,'username':_0x56eee6?.[_0x6ec11b(0x105)]??String(_0x49063d),'nickname':_0x56eee6?.['nickname'],'matchedBy':'id'};}const _0xaa0f8f=_0x2629b0[_0x6ec11b(0xb8)](_0x16cb43=>matchMember(_0x16cb43,_0x29a028));if(_0xaa0f8f[_0x6ec11b(0xc8)]===0x0)throw CliErrors['validation']('No\x20tenant\x20member\x20matches\x20\x22'+_0x29a028+'\x22.',_0x6ec11b(0xf4)+_0x4332d5);if(_0xaa0f8f[_0x6ec11b(0xc8)]>0x1){const _0x2d43b4=_0xaa0f8f[_0x6ec11b(0xfa)](_0x585ad1=>(_0x585ad1[_0x6ec11b(0xd8)]??_0x585ad1[_0x6ec11b(0x105)]??'?')+'('+_0x585ad1[_0x6ec11b(0xc6)]+')')[_0x6ec11b(0xf9)](',\x20');throw CliErrors[_0x6ec11b(0xd2)](_0x6ec11b(0xfe)+_0x29a028+'\x22:\x20'+_0x2d43b4+'.',_0x4332d5);}const _0x2c2689=_0xaa0f8f[0x0];return{'userId':_0x2c2689[_0x6ec11b(0xc6)],'username':_0x2c2689['username']??String(_0x2c2689['userId']),'nickname':_0x2c2689[_0x6ec11b(0xd8)],'matchedBy':_0x6ec11b(0xf3)};}export const CREATE_USER_ROLE_PATH=a178_0x2245a4(0xc3);export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x26b519){const _0x49c4a7=a178_0x2245a4,{operation:_0x2e0b5a,appCode:_0x27a344,role:_0x25fdb1,relations:_0xaa9a12,user:_0x10092f}=_0x26b519,_0x146762=[...new Set(_0xaa9a12[_0x49c4a7(0xfa)](_0x2982ed=>_0x2982ed[_0x49c4a7(0xc6)]))],_0x1806bd=[];if(_0x26b519['expectUserCount']!==undefined&&_0x26b519[_0x49c4a7(0xd6)]!==_0x146762[_0x49c4a7(0xc8)])throw CliErrors['validation'](_0x49c4a7(0xcc)+_0x26b519[_0x49c4a7(0xd6)]+_0x49c4a7(0xc5)+_0x146762[_0x49c4a7(0xc8)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x45882f=_0x146762['includes'](_0x10092f[_0x49c4a7(0xc6)]),_0x50f497=_0xaa9a12[_0x49c4a7(0xb8)](_0x12b155=>_0x12b155[_0x49c4a7(0xc6)]===_0x10092f[_0x49c4a7(0xc6)])['map'](_0x5c9598=>_0x5c9598['id']),_0x4a645d=_0x2e0b5a===_0x49c4a7(0xde)?!_0x45882f:_0x45882f;let _0x550833=_0x146762;_0x2e0b5a===_0x49c4a7(0xde)?_0x45882f?_0x1806bd[_0x49c4a7(0xe6)]('User\x20'+_0x10092f['userId']+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x25fdb1['roleName']+_0x49c4a7(0xc2)):_0x550833=[..._0x146762,_0x10092f[_0x49c4a7(0xc6)]]:!_0x45882f?_0x1806bd['push'](_0x49c4a7(0xba)+_0x10092f[_0x49c4a7(0xc6)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x25fdb1[_0x49c4a7(0x104)]+';\x20no\x20change.'):(_0x550833=_0x146762[_0x49c4a7(0xb8)](_0x42e21f=>_0x42e21f!==_0x10092f['userId']),_0x50f497['length']>0x1&&_0x1806bd['push']('Removed\x20'+_0x50f497[_0x49c4a7(0xc8)]+_0x49c4a7(0xb7)+_0x10092f[_0x49c4a7(0xc6)]+'.'));const _0x5b712b={'scope':_0x49c4a7(0xfc),'operation':_0x2e0b5a,'selector':{'appCode':_0x27a344,'roleId':_0x25fdb1['id'],'roleName':_0x25fdb1[_0x49c4a7(0x104)],'userId':_0x10092f[_0x49c4a7(0xc6)]},'before':{'userIds':_0x146762},'after':{'userIds':_0x550833},'dryRun':_0x26b519[_0x49c4a7(0xe3)],'backend':{'method':_0x49c4a7(0xd5),'path':_0x2e0b5a===_0x49c4a7(0xde)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x1806bd};return{'mutation':_0x5b712b,'changed':_0x4a645d,'matchingRelationIds':_0x50f497};}export async function loadDevRoleRelations(_0x524cad,_0x306480){const _0x503fcb=a178_0x2245a4,_0x5ae35a=0x64,_0x2cc7ce=[];for(let _0x2b8627=0x1;;_0x2b8627+=0x1){const {items:_0x51f44c,paging:_0x545cf2}=await listDevUserRoleRelations(_0x524cad,{'roleId':_0x306480,'currentPage':_0x2b8627,'pageSize':_0x5ae35a});_0x2cc7ce['push'](..._0x51f44c);if(_0x51f44c['length']<_0x5ae35a||_0x545cf2&&_0x2cc7ce[_0x503fcb(0xc8)]>=_0x545cf2[_0x503fcb(0xe2)])return _0x2cc7ce;}}function a178_0x53e1(_0xbdb43d,_0x22b739){_0xbdb43d=_0xbdb43d-0xb5;const _0x5a318a=a178_0x5a31();let _0x53e1ad=_0x5a318a[_0xbdb43d];return _0x53e1ad;}export function readRoleRef(_0x25d18f){const _0x3a60d0=a178_0x2245a4,_0x377914=_0x25d18f[_0x3a60d0(0xc9)](_0x3a60d0(0x107))[_0x3a60d0(0xdc)]();if(!_0x377914)throw CliErrors[_0x3a60d0(0xb5)](_0x3a60d0(0x107),_0x3a60d0(0x103));return _0x377914;}export async function prepareUserMutation(_0x3bd98d,_0x3429ff,_0x1f7cbc){const _0x2289d5=a178_0x2245a4,_0x57500a=readRoleRef(_0x3bd98d),_0x2b6284=_0x3bd98d[_0x2289d5(0xc9)](_0x2289d5(0xeb))[_0x2289d5(0xdc)]();if(!_0x2b6284)throw CliErrors[_0x2289d5(0xb5)]('user','Pass\x20--user\x20<id|name>.');const _0x14f532=_0x3bd98d[_0x2289d5(0xd0)]('expect-user-count'),_0xd47555=_0x14f532===undefined||_0x14f532===null?undefined:Number(_0x14f532),_0x4ef455=await resolveRoleRef(_0x3bd98d[_0x2289d5(0xd9)],_0x57500a);if(_0x4ef455['roleType']==='OWNER')throw CliErrors[_0x2289d5(0xd2)](_0x2289d5(0x100)+_0x3429ff+_0x2289d5(0xf7),_0x2289d5(0xe9));const _0x391be5=await resolveUserRef(_0x2b6284),_0x514186=await loadDevRoleRelations(_0x3bd98d[_0x2289d5(0xd9)],_0x4ef455['id']);return{...computeRoleUserMutation({'operation':_0x3429ff,'appCode':_0x3bd98d[_0x2289d5(0xd9)],'role':_0x4ef455,'relations':_0x514186,'user':{'userId':_0x391be5['userId'],'username':_0x391be5[_0x2289d5(0x105)],'nickname':_0x391be5[_0x2289d5(0xd8)]},'dryRun':_0x1f7cbc,..._0xd47555!==undefined?{'expectUserCount':_0xd47555}:{}}),'role':_0x4ef455,'user':_0x391be5};}
1
+ const a178_0x44357d=a178_0x2a25;function a178_0x30ab(){const _0x1869db=['Role\x20id\x20or\x20exact\x20role\x20name','join','Pass\x20--user\x20<id|name>.','\x20members\x20of\x20the\x20OWNER\x20role.','str','push','flagMissing','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Optional\x20role\x20remark/description','nickname','/smartapi/permit/user-role/delete','username','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','dryRun','OWNER','expect-user-count','length','4WpKgFI','2905413QUsJns','\x22\x20is\x20ambiguous\x20(ids:\x20','Pass\x20--user\x20<id>.','tenant_code','\x22:\x20','trim','61CNvnoE','roleName','authRequired','\x20not\x20found\x20in\x20app\x20','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','ADMIN','number','role','expectUserCount','permitCount','roleType','3703740WHcpgA','flag','Role\x20name\x20\x22','totalCount','Check\x20the\x20nickname/username.\x20','POST','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','3569330HtIUro','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','1927096DkvNrR','User\x20','filter','Missing\x20role\x20reference.','validation','tenant','map','11XdAvFy','user-add','\x20member(s)\x20but\x20role\x20has\x20','includes','\x22\x20not\x20found\x20in\x20app\x20','Role\x20id\x20','9bztWJw','\x20is\x20not\x20a\x20member\x20of\x20role\x20','find','toLowerCase','dev','18586jBFsyL','\x20built-in\x20role\x20','user','appCode','string','2038794MFBeBn','Role\x20id\x20(from\x20`role\x20list`)','CUSTOM','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Disambiguate\x20with\x20--role\x20<id>.','test','Pass\x20--role\x20<id|name>.','No\x20tenant\x20member\x20matches\x20\x22','Removed\x20','4348125LtXsfp','Cannot\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Multiple\x20tenant\x20members\x20match\x20\x22','/smartapi/permit/user-role/create',';\x20no\x20change.','name','userId','remark'];a178_0x30ab=function(){return _0x1869db;};return a178_0x30ab();}(function(_0x57f174,_0xbab1dc){const _0x316054=a178_0x2a25,_0x49db7d=_0x57f174();while(!![]){try{const _0x3ed1cf=parseInt(_0x316054(0x1fa))/0x1*(parseInt(_0x316054(0x1ca))/0x2)+parseInt(_0x316054(0x1cf))/0x3*(-parseInt(_0x316054(0x1f3))/0x4)+parseInt(_0x316054(0x1d9))/0x5+-parseInt(_0x316054(0x205))/0x6+parseInt(_0x316054(0x1f4))/0x7+-parseInt(_0x316054(0x20e))/0x8*(-parseInt(_0x316054(0x1c5))/0x9)+-parseInt(_0x316054(0x20c))/0xa*(parseInt(_0x316054(0x215))/0xb);if(_0x3ed1cf===_0xbab1dc)break;else _0x49db7d['push'](_0x49db7d['shift']());}catch(_0x5cf290){_0x49db7d['push'](_0x49db7d['shift']());}}}(a178_0x30ab,0x6b15f));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':a178_0x44357d(0x200),'required':!![],'description':a178_0x44357d(0x1d0)};export const ROLE_REF_FLAG={'name':a178_0x44357d(0x201),'type':a178_0x44357d(0x1ce),'required':!![],'description':a178_0x44357d(0x1e2)};export const USER_REF_FLAG={'name':a178_0x44357d(0x1cc),'type':a178_0x44357d(0x1ce),'required':!![],'description':a178_0x44357d(0x1ee)};export const NAME_FLAG={'name':'name','type':a178_0x44357d(0x1ce),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a178_0x44357d(0x1df),'type':a178_0x44357d(0x1ce),'required':!![],'description':a178_0x44357d(0x20d)};export const REMARK_FLAG={'name':a178_0x44357d(0x1e1),'type':a178_0x44357d(0x1ce),'required':![],'description':a178_0x44357d(0x1ea)};function a178_0x2a25(_0x28314c,_0x292062){_0x28314c=_0x28314c-0x1c0;const _0x30ab2a=a178_0x30ab();let _0x2a256a=_0x30ab2a[_0x28314c];return _0x2a256a;}export const EXPECT_USER_COUNT_FLAG={'name':a178_0x44357d(0x1f1),'type':a178_0x44357d(0x200),'required':![],'description':a178_0x44357d(0x1d2)};export const BUILTIN_ROLE_TYPES=[a178_0x44357d(0x1ff),'DEV',a178_0x44357d(0x1f0)];export function isBuiltinRole(_0x3b4a13){const _0xbce2bd=a178_0x44357d;return BUILTIN_ROLE_TYPES[_0xbce2bd(0x1c2)](_0x3b4a13);}export function assertCustomRole(_0x666b25,_0x40b89d){const _0x3d0636=a178_0x44357d;if(_0x666b25['roleType']!==_0x3d0636(0x1d1))throw CliErrors[_0x3d0636(0x212)](_0x3d0636(0x1da)+_0x40b89d+_0x3d0636(0x1cb)+_0x666b25[_0x3d0636(0x1fb)]+'\x20('+_0x666b25['roleType']+').',_0x3d0636(0x1e9));}export function projectRole(_0x5c3ed2){const _0x5bb258=a178_0x44357d;return{'id':_0x5c3ed2['id'],'roleName':_0x5c3ed2[_0x5bb258(0x1fb)],'roleType':_0x5c3ed2[_0x5bb258(0x204)],'remark':_0x5c3ed2['remark'],'userCount':_0x5c3ed2['userCount'],'permitCount':_0x5c3ed2[_0x5bb258(0x203)],'builtin':isBuiltinRole(_0x5c3ed2['roleType'])};}export async function resolveRoleRef(_0x292290,_0x2c0b2e){const _0x702157=a178_0x44357d,_0x46bd2d=_0x2c0b2e[_0x702157(0x1f9)]();if(!_0x46bd2d)throw CliErrors['validation'](_0x702157(0x211),_0x702157(0x1d6));if(/^\d+$/[_0x702157(0x1d5)](_0x46bd2d))return getRoleById(_0x292290,Number(_0x46bd2d));const _0x2349a4=await listAllAppRoles(_0x292290),_0x46dbc6=_0x2349a4['filter'](_0x357ae1=>_0x357ae1[_0x702157(0x1fb)]===_0x46bd2d);if(_0x46dbc6['length']===0x0)throw CliErrors[_0x702157(0x212)](_0x702157(0x207)+_0x46bd2d+_0x702157(0x1c3)+_0x292290+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x46dbc6[_0x702157(0x1f2)]>0x1){const _0x1b8d69=_0x46dbc6[_0x702157(0x214)](_0x28c99e=>_0x28c99e['id'])[_0x702157(0x1e3)](',\x20');throw CliErrors[_0x702157(0x212)](_0x702157(0x207)+_0x46bd2d+_0x702157(0x1f5)+_0x1b8d69+').',_0x702157(0x1d4));}return _0x46dbc6[0x0];}export async function getRoleById(_0x35e389,_0xa8feda){const _0xa95bf1=a178_0x44357d,_0x4380fe=await listAllAppRoles(_0x35e389),_0x5d29ef=_0x4380fe[_0xa95bf1(0x210)](_0x9d9fc2=>_0x9d9fc2['id']===_0xa8feda&&(!_0x9d9fc2[_0xa95bf1(0x1cd)]||_0x9d9fc2['appCode']===_0x35e389));if(_0x5d29ef[_0xa95bf1(0x1f2)]!==0x1)throw CliErrors[_0xa95bf1(0x212)](_0xa95bf1(0x1c4)+_0xa8feda+_0xa95bf1(0x1fd)+_0x35e389+'.',_0xa95bf1(0x1d3));return _0x5d29ef[0x0];}async function listAllAppRoles(_0x200d85){const _0xff6949=a178_0x44357d,_0x34a034=0x64,_0x25ad33=[];for(let _0x36bef5=0x1;;_0x36bef5+=0x1){const {items:_0x1402d3,paging:_0x38bfd1}=await listAppRoles(_0x200d85,{'currentPage':_0x36bef5,'pageSize':_0x34a034});_0x25ad33[_0xff6949(0x1e7)](..._0x1402d3);if(_0x1402d3[_0xff6949(0x1f2)]<_0x34a034||_0x38bfd1&&_0x25ad33[_0xff6949(0x1f2)]>=_0x38bfd1[_0xff6949(0x208)])return _0x25ad33;}}export async function resolveTenantCode(){const _0x10d549=a178_0x44357d,_0x3deed7=await getSessionUserInfo(),_0x51f455=_0x3deed7?.[_0x10d549(0x1cc)]?.[_0x10d549(0x213)]?.[_0x10d549(0x1f7)];if(!_0x51f455)throw CliErrors[_0x10d549(0x1fc)](_0x10d549(0x20b));return _0x51f455;}function matchMember(_0x162f4d,_0x3aef72){const _0x51fd10=a178_0x44357d,_0x357580=_0x3aef72[_0x51fd10(0x1f9)]()[_0x51fd10(0x1c8)]();return(_0x162f4d['nickname']??'')[_0x51fd10(0x1c8)]()===_0x357580||(_0x162f4d[_0x51fd10(0x1ed)]??'')[_0x51fd10(0x1c8)]()===_0x357580;}export async function resolveUserRef(_0x2e92bf,_0x21cbba=a178_0x44357d(0x1f6)){const _0x5e7952=a178_0x44357d,_0x1b0f0d=_0x2e92bf[_0x5e7952(0x1f9)]();if(!_0x1b0f0d)throw CliErrors[_0x5e7952(0x212)]('Missing\x20user\x20reference.',_0x5e7952(0x1e4));const _0x3ed743=await resolveTenantCode(),_0x52320c=await getTenantMembers(_0x3ed743);if(/^\d+$/[_0x5e7952(0x1d5)](_0x1b0f0d)){const _0x2425ca=Number(_0x1b0f0d),_0x528991=_0x52320c[_0x5e7952(0x1c7)](_0x306be8=>_0x306be8['userId']===_0x2425ca);return{'userId':_0x2425ca,'username':_0x528991?.[_0x5e7952(0x1ed)]??String(_0x2425ca),'nickname':_0x528991?.[_0x5e7952(0x1eb)],'matchedBy':'id'};}const _0x2b5a0f=_0x52320c[_0x5e7952(0x210)](_0x5b3502=>matchMember(_0x5b3502,_0x1b0f0d));if(_0x2b5a0f[_0x5e7952(0x1f2)]===0x0)throw CliErrors[_0x5e7952(0x212)](_0x5e7952(0x1d7)+_0x1b0f0d+'\x22.',_0x5e7952(0x209)+_0x21cbba);if(_0x2b5a0f[_0x5e7952(0x1f2)]>0x1){const _0x1cfae1=_0x2b5a0f['map'](_0x403a0c=>(_0x403a0c[_0x5e7952(0x1eb)]??_0x403a0c['username']??'?')+'('+_0x403a0c[_0x5e7952(0x1e0)]+')')[_0x5e7952(0x1e3)](',\x20');throw CliErrors['validation'](_0x5e7952(0x1dc)+_0x1b0f0d+_0x5e7952(0x1f8)+_0x1cfae1+'.',_0x21cbba);}const _0x5b184b=_0x2b5a0f[0x0];return{'userId':_0x5b184b[_0x5e7952(0x1e0)],'username':_0x5b184b['username']??String(_0x5b184b[_0x5e7952(0x1e0)]),'nickname':_0x5b184b[_0x5e7952(0x1eb)],'matchedBy':_0x5e7952(0x1df)};}export const CREATE_USER_ROLE_PATH=a178_0x44357d(0x1dd);export const DELETE_USER_ROLE_PATH=a178_0x44357d(0x1ec);export function computeRoleUserMutation(_0x4b4b96){const _0x13134c=a178_0x44357d,{operation:_0x167d73,appCode:_0x508611,role:_0x164ce0,relations:_0x28ef88,user:_0x463894}=_0x4b4b96,_0x2236df=[...new Set(_0x28ef88['map'](_0x2ef87f=>_0x2ef87f['userId']))],_0xec95c=[];if(_0x4b4b96['expectUserCount']!==undefined&&_0x4b4b96[_0x13134c(0x202)]!==_0x2236df[_0x13134c(0x1f2)])throw CliErrors['validation']('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x4b4b96[_0x13134c(0x202)]+_0x13134c(0x1c1)+_0x2236df[_0x13134c(0x1f2)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x37286=_0x2236df[_0x13134c(0x1c2)](_0x463894[_0x13134c(0x1e0)]),_0x3b5f29=_0x28ef88[_0x13134c(0x210)](_0x3e3049=>_0x3e3049[_0x13134c(0x1e0)]===_0x463894[_0x13134c(0x1e0)])[_0x13134c(0x214)](_0x2dac95=>_0x2dac95['id']),_0x1dc3c3=_0x167d73===_0x13134c(0x1c0)?!_0x37286:_0x37286;let _0x4403e2=_0x2236df;_0x167d73===_0x13134c(0x1c0)?_0x37286?_0xec95c[_0x13134c(0x1e7)]('User\x20'+_0x463894[_0x13134c(0x1e0)]+_0x13134c(0x1db)+_0x164ce0[_0x13134c(0x1fb)]+_0x13134c(0x1de)):_0x4403e2=[..._0x2236df,_0x463894['userId']]:!_0x37286?_0xec95c[_0x13134c(0x1e7)](_0x13134c(0x20f)+_0x463894[_0x13134c(0x1e0)]+_0x13134c(0x1c6)+_0x164ce0[_0x13134c(0x1fb)]+_0x13134c(0x1de)):(_0x4403e2=_0x2236df['filter'](_0x4a76ad=>_0x4a76ad!==_0x463894[_0x13134c(0x1e0)]),_0x3b5f29[_0x13134c(0x1f2)]>0x1&&_0xec95c[_0x13134c(0x1e7)](_0x13134c(0x1d8)+_0x3b5f29[_0x13134c(0x1f2)]+'\x20duplicate\x20memberships\x20for\x20user\x20'+_0x463894[_0x13134c(0x1e0)]+'.'));const _0x54d374={'scope':_0x13134c(0x1c9),'operation':_0x167d73,'selector':{'appCode':_0x508611,'roleId':_0x164ce0['id'],'roleName':_0x164ce0[_0x13134c(0x1fb)],'userId':_0x463894[_0x13134c(0x1e0)]},'before':{'userIds':_0x2236df},'after':{'userIds':_0x4403e2},'dryRun':_0x4b4b96[_0x13134c(0x1ef)],'backend':{'method':_0x13134c(0x20a),'path':_0x167d73===_0x13134c(0x1c0)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0xec95c};return{'mutation':_0x54d374,'changed':_0x1dc3c3,'matchingRelationIds':_0x3b5f29};}export async function loadDevRoleRelations(_0x22824e,_0x532cde){const _0x42c5fd=a178_0x44357d,_0x2519bc=0x64,_0x1d8a32=[];for(let _0x1572bc=0x1;;_0x1572bc+=0x1){const {items:_0x5a7140,paging:_0x4d25b5}=await listDevUserRoleRelations(_0x22824e,{'roleId':_0x532cde,'currentPage':_0x1572bc,'pageSize':_0x2519bc});_0x1d8a32[_0x42c5fd(0x1e7)](..._0x5a7140);if(_0x5a7140[_0x42c5fd(0x1f2)]<_0x2519bc||_0x4d25b5&&_0x1d8a32[_0x42c5fd(0x1f2)]>=_0x4d25b5[_0x42c5fd(0x208)])return _0x1d8a32;}}export function readRoleRef(_0x39d2df){const _0x42e9ce=a178_0x44357d,_0xed0b65=_0x39d2df[_0x42e9ce(0x1e6)]('role')[_0x42e9ce(0x1f9)]();if(!_0xed0b65)throw CliErrors['flagMissing'](_0x42e9ce(0x201),'Pass\x20--role\x20<id|name>.');return _0xed0b65;}export async function prepareUserMutation(_0x2aa4cc,_0x17b4ca,_0x402794){const _0x5850f6=a178_0x44357d,_0x250208=readRoleRef(_0x2aa4cc),_0x3589f8=_0x2aa4cc[_0x5850f6(0x1e6)](_0x5850f6(0x1cc))[_0x5850f6(0x1f9)]();if(!_0x3589f8)throw CliErrors[_0x5850f6(0x1e8)](_0x5850f6(0x1cc),_0x5850f6(0x1e4));const _0x1b6d75=_0x2aa4cc[_0x5850f6(0x206)](_0x5850f6(0x1f1)),_0x28edc9=_0x1b6d75===undefined||_0x1b6d75===null?undefined:Number(_0x1b6d75),_0x43a9d9=await resolveRoleRef(_0x2aa4cc[_0x5850f6(0x1cd)],_0x250208);if(_0x43a9d9[_0x5850f6(0x204)]===_0x5850f6(0x1f0))throw CliErrors[_0x5850f6(0x212)]('Cannot\x20'+_0x17b4ca+_0x5850f6(0x1e5),_0x5850f6(0x1fe));const _0x5b95b9=await resolveUserRef(_0x3589f8),_0x77028=await loadDevRoleRelations(_0x2aa4cc[_0x5850f6(0x1cd)],_0x43a9d9['id']);return{...computeRoleUserMutation({'operation':_0x17b4ca,'appCode':_0x2aa4cc[_0x5850f6(0x1cd)],'role':_0x43a9d9,'relations':_0x77028,'user':{'userId':_0x5b95b9[_0x5850f6(0x1e0)],'username':_0x5b95b9['username'],'nickname':_0x5b95b9['nickname']},'dryRun':_0x402794,..._0x28edc9!==undefined?{'expectUserCount':_0x28edc9}:{}}),'role':_0x43a9d9,'user':_0x5b95b9};}
@@ -1 +1 @@
1
- const a179_0x48bdaa=a179_0x133f;(function(_0x5c1587,_0x52755f){const _0x10dfbe=a179_0x133f,_0x3adf7b=_0x5c1587();while(!![]){try{const _0x22f5f5=-parseInt(_0x10dfbe(0xb9))/0x1*(-parseInt(_0x10dfbe(0xca))/0x2)+parseInt(_0x10dfbe(0xb6))/0x3+parseInt(_0x10dfbe(0xbe))/0x4+parseInt(_0x10dfbe(0xc2))/0x5*(parseInt(_0x10dfbe(0xcc))/0x6)+-parseInt(_0x10dfbe(0xc7))/0x7*(-parseInt(_0x10dfbe(0xc4))/0x8)+parseInt(_0x10dfbe(0xbf))/0x9+-parseInt(_0x10dfbe(0xbc))/0xa;if(_0x22f5f5===_0x52755f)break;else _0x3adf7b['push'](_0x3adf7b['shift']());}catch(_0x1b946a){_0x3adf7b['push'](_0x3adf7b['shift']());}}}(a179_0xa85b,0x4e953));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a179_0x133f(_0x15706c,_0xaba341){_0x15706c=_0x15706c-0xb2;const _0xa85b21=a179_0xa85b();let _0x133fdd=_0xa85b21[_0x15706c];return _0x133fdd;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a179_0xa85b(){const _0x2dd181=['15498530ZBDvUG','string','224080aRBZqT','4930029hENaln','appCode','--name\x20cannot\x20be\x20empty.','1093930YVYwHI','dev','6568gkzTIE','POST','flag','651OCcPWN','role','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','229434snsiyR','New\x20role\x20name','6snMsYk','write','update','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','/smartapi/permit/role/update','name','roleName','1197609kYbnKF','num','remark','5maeThU','\x20(id=','length'];a179_0xa85b=function(){return _0x2dd181;};return a179_0xa85b();}import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a179_0x48bdaa(0xb3);function readPatch(_0x4c0244){const _0x3d405a=a179_0x48bdaa,_0xc84c80=_0x4c0244[_0x3d405a(0xc6)](_0x3d405a(0xb4)),_0x15ff4d=_0x4c0244[_0x3d405a(0xc6)](_0x3d405a(0xb8)),_0x4be87f={};if(_0xc84c80!==undefined&&_0xc84c80!==null){const _0x4bdc7a=String(_0xc84c80)['trim']();if(!_0x4bdc7a)throw CliErrors['validation'](_0x3d405a(0xc1));if(_0x4bdc7a[_0x3d405a(0xbb)]>0x40)throw CliErrors['validation']('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x4be87f[_0x3d405a(0xb5)]=_0x4bdc7a;}_0x15ff4d!==undefined&&_0x15ff4d!==null&&(_0x4be87f[_0x3d405a(0xb8)]=String(_0x15ff4d));if(_0x4be87f['roleName']===undefined&&_0x4be87f[_0x3d405a(0xb8)]===undefined)throw CliErrors['validation']('Nothing\x20to\x20update.',_0x3d405a(0xb2));return _0x4be87f;}export const roleUpdate={'service':a179_0x48bdaa(0xc8),'command':'update','description':a179_0x48bdaa(0xc9),'risk':a179_0x48bdaa(0xcd),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a179_0x48bdaa(0xbd),'required':![],'description':a179_0x48bdaa(0xcb)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x51f8c2){readPatch(_0x51f8c2);},async 'dryRun'(_0x369c79){const _0x26e09a=a179_0x48bdaa,_0xe66d6=_0x369c79['num']('id'),_0x419455=readPatch(_0x369c79),_0x4109a1=await getRoleById(_0x369c79['appCode'],_0xe66d6);return assertCustomRole(_0x4109a1,_0x26e09a(0xce)),asDryRunResult({'scope':_0x26e09a(0xc3),'operation':_0x26e09a(0xce),'selector':{'appCode':_0x369c79[_0x26e09a(0xc0)],'roleId':_0xe66d6,'roleName':_0x4109a1[_0x26e09a(0xb5)]},'before':projectRole(_0x4109a1),'after':projectRole({..._0x4109a1,..._0x419455[_0x26e09a(0xb5)]!==undefined?{'roleName':_0x419455['roleName']}:{},..._0x419455[_0x26e09a(0xb8)]!==undefined?{'remark':_0x419455[_0x26e09a(0xb8)]}:{}}),'dryRun':!![],'backend':{'method':_0x26e09a(0xc5),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0xb74ac0){const _0x5143d4=a179_0x48bdaa,_0x3c0f78=_0xb74ac0[_0x5143d4(0xb7)]('id'),_0x438074=readPatch(_0xb74ac0),_0x2fc95f=await getRoleById(_0xb74ac0['appCode'],_0x3c0f78);assertCustomRole(_0x2fc95f,_0x5143d4(0xce)),await updateAppRole({'id':_0x3c0f78,'appCode':_0xb74ac0[_0x5143d4(0xc0)],..._0x438074[_0x5143d4(0xb5)]!==undefined?{'roleName':_0x438074[_0x5143d4(0xb5)]}:{},..._0x438074['remark']!==undefined?{'remark':_0x438074['remark']}:{}});const _0x1e0b71=await getRoleById(_0xb74ac0[_0x5143d4(0xc0)],_0x3c0f78);return{'ok':!![],'data':{'scope':'dev','operation':_0x5143d4(0xce),'selector':{'appCode':_0xb74ac0[_0x5143d4(0xc0)],'roleId':_0x3c0f78,'roleName':_0x1e0b71[_0x5143d4(0xb5)]},'before':projectRole(_0x2fc95f),'after':projectRole(_0x1e0b71),'dryRun':![],'backend':{'method':_0x5143d4(0xc5),'path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0x1e0b71['roleName']+_0x5143d4(0xba)+_0x3c0f78+')'};}};
1
+ const a179_0x367c41=a179_0x2c6c;(function(_0x3a3fe7,_0x218d03){const _0x42fb9d=a179_0x2c6c,_0x2e8ee1=_0x3a3fe7();while(!![]){try{const _0x55887f=parseInt(_0x42fb9d(0x164))/0x1+parseInt(_0x42fb9d(0x171))/0x2+parseInt(_0x42fb9d(0x165))/0x3+parseInt(_0x42fb9d(0x170))/0x4*(-parseInt(_0x42fb9d(0x159))/0x5)+parseInt(_0x42fb9d(0x176))/0x6*(-parseInt(_0x42fb9d(0x169))/0x7)+parseInt(_0x42fb9d(0x177))/0x8*(-parseInt(_0x42fb9d(0x15f))/0x9)+-parseInt(_0x42fb9d(0x15c))/0xa*(parseInt(_0x42fb9d(0x160))/0xb);if(_0x55887f===_0x218d03)break;else _0x2e8ee1['push'](_0x2e8ee1['shift']());}catch(_0x690c79){_0x2e8ee1['push'](_0x2e8ee1['shift']());}}}(a179_0x5d18,0x2c571));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a179_0x5d18(){const _0x3695ed=['update','44ZNCzPn','600366VhKOzK','Nothing\x20to\x20update.','remark','appCode','/smartapi/permit/role/update','6JwjcZE','891224YtuoNb','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','role','138045ZtWFHr','New\x20role\x20name','validation','8580zLkNRk','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','\x20(id=','9fjurSP','2563SsAadT','write','roleName','length','360683ekxNOR','807156xShSkG','name','POST','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','932995xeymGR','trim','num','flag','dev','string'];a179_0x5d18=function(){return _0x3695ed;};return a179_0x5d18();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a179_0x2c6c(_0x3f2750,_0x36129c){_0x3f2750=_0x3f2750-0x158;const _0x5d1851=a179_0x5d18();let _0x2c6c7e=_0x5d1851[_0x3f2750];return _0x2c6c7e;}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_0x367c41(0x175);function readPatch(_0x3825c6){const _0xd4b890=a179_0x367c41,_0x41968d=_0x3825c6[_0xd4b890(0x16c)](_0xd4b890(0x166)),_0x44963d=_0x3825c6[_0xd4b890(0x16c)](_0xd4b890(0x173)),_0x4b61c0={};if(_0x41968d!==undefined&&_0x41968d!==null){const _0x5e36ba=String(_0x41968d)[_0xd4b890(0x16a)]();if(!_0x5e36ba)throw CliErrors[_0xd4b890(0x15b)]('--name\x20cannot\x20be\x20empty.');if(_0x5e36ba[_0xd4b890(0x163)]>0x40)throw CliErrors[_0xd4b890(0x15b)](_0xd4b890(0x168));_0x4b61c0['roleName']=_0x5e36ba;}_0x44963d!==undefined&&_0x44963d!==null&&(_0x4b61c0['remark']=String(_0x44963d));if(_0x4b61c0[_0xd4b890(0x162)]===undefined&&_0x4b61c0[_0xd4b890(0x173)]===undefined)throw CliErrors[_0xd4b890(0x15b)](_0xd4b890(0x172),_0xd4b890(0x178));return _0x4b61c0;}export const roleUpdate={'service':a179_0x367c41(0x158),'command':a179_0x367c41(0x16f),'description':a179_0x367c41(0x15d),'risk':a179_0x367c41(0x161),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a179_0x367c41(0x166),'type':a179_0x367c41(0x16e),'required':![],'description':a179_0x367c41(0x15a)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x522d0a){readPatch(_0x522d0a);},async 'dryRun'(_0x55430c){const _0x130369=a179_0x367c41,_0x1a3af3=_0x55430c['num']('id'),_0x54cddd=readPatch(_0x55430c),_0x537de3=await getRoleById(_0x55430c['appCode'],_0x1a3af3);return assertCustomRole(_0x537de3,_0x130369(0x16f)),asDryRunResult({'scope':'dev','operation':_0x130369(0x16f),'selector':{'appCode':_0x55430c[_0x130369(0x174)],'roleId':_0x1a3af3,'roleName':_0x537de3['roleName']},'before':projectRole(_0x537de3),'after':projectRole({..._0x537de3,..._0x54cddd[_0x130369(0x162)]!==undefined?{'roleName':_0x54cddd[_0x130369(0x162)]}:{},..._0x54cddd[_0x130369(0x173)]!==undefined?{'remark':_0x54cddd[_0x130369(0x173)]}:{}}),'dryRun':!![],'backend':{'method':_0x130369(0x167),'path':UPDATE_PATH},'warnings':[]},{'method':_0x130369(0x167),'url':UPDATE_PATH});},async 'execute'(_0x764aa0){const _0x2e92c2=a179_0x367c41,_0x152de5=_0x764aa0[_0x2e92c2(0x16b)]('id'),_0x15205d=readPatch(_0x764aa0),_0x13e3a2=await getRoleById(_0x764aa0[_0x2e92c2(0x174)],_0x152de5);assertCustomRole(_0x13e3a2,_0x2e92c2(0x16f)),await updateAppRole({'id':_0x152de5,'appCode':_0x764aa0['appCode'],..._0x15205d[_0x2e92c2(0x162)]!==undefined?{'roleName':_0x15205d[_0x2e92c2(0x162)]}:{},..._0x15205d['remark']!==undefined?{'remark':_0x15205d[_0x2e92c2(0x173)]}:{}});const _0x3d1fb6=await getRoleById(_0x764aa0[_0x2e92c2(0x174)],_0x152de5);return{'ok':!![],'data':{'scope':_0x2e92c2(0x16d),'operation':'update','selector':{'appCode':_0x764aa0[_0x2e92c2(0x174)],'roleId':_0x152de5,'roleName':_0x3d1fb6[_0x2e92c2(0x162)]},'before':projectRole(_0x13e3a2),'after':projectRole(_0x3d1fb6),'dryRun':![],'backend':{'method':_0x2e92c2(0x167),'path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0x3d1fb6[_0x2e92c2(0x162)]+_0x2e92c2(0x15e)+_0x152de5+')'};}};
@@ -1 +1 @@
1
- const a180_0x2d9842=a180_0x2b77;(function(_0x1243fe,_0x1e1037){const _0x5199d7=a180_0x2b77,_0x4445d2=_0x1243fe();while(!![]){try{const _0x4e92b4=-parseInt(_0x5199d7(0xa4))/0x1*(parseInt(_0x5199d7(0xa2))/0x2)+-parseInt(_0x5199d7(0xab))/0x3*(-parseInt(_0x5199d7(0xa8))/0x4)+-parseInt(_0x5199d7(0xaa))/0x5+parseInt(_0x5199d7(0xa6))/0x6+-parseInt(_0x5199d7(0x9a))/0x7*(parseInt(_0x5199d7(0xa3))/0x8)+-parseInt(_0x5199d7(0x9b))/0x9+parseInt(_0x5199d7(0xa9))/0xa;if(_0x4e92b4===_0x1e1037)break;else _0x4445d2['push'](_0x4445d2['shift']());}catch(_0x4e4dba){_0x4445d2['push'](_0x4445d2['shift']());}}}(a180_0x15dc,0x6a031));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a180_0x2b77(_0x354f89,_0x529313){_0x354f89=_0x354f89-0x97;const _0x15dc13=a180_0x15dc();let _0x2b7779=_0x15dc13[_0x354f89];return _0x2b7779;}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':a180_0x2d9842(0x9f),'command':a180_0x2d9842(0x98),'description':a180_0x2d9842(0x9d),'risk':a180_0x2d9842(0xa7),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x430100){const _0x208d90=a180_0x2d9842,{mutation:_0x3ad15d}=await prepareUserMutation(_0x430100,'user-add',!![]);return asDryRunResult(_0x3ad15d,{'method':_0x208d90(0x9e),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x58d8b5){const _0x39f858=a180_0x2d9842,{mutation:_0x2ba787,changed:_0x5462cf,role:_0x2c72c0,user:_0x517d1e}=await prepareUserMutation(_0x58d8b5,_0x39f858(0x98),![]);return _0x5462cf&&await createDevUserRole({'appCode':_0x58d8b5[_0x39f858(0xa5)],'userId':_0x517d1e[_0x39f858(0x97)],'username':_0x517d1e['username'],'roleType':_0x2c72c0[_0x39f858(0xac)],'roleId':_0x2ba787['selector']['roleId']}),{'ok':!![],'data':_0x2ba787,'message':_0x5462cf?_0x39f858(0xa0)+_0x2ba787['selector']['userId']+'\x20to\x20role\x20'+_0x2ba787[_0x39f858(0x9c)][_0x39f858(0x99)]:_0x39f858(0xa1)+_0x2ba787[_0x39f858(0x9c)][_0x39f858(0x97)]+'\x20already\x20in\x20role\x20'+_0x2ba787[_0x39f858(0x9c)]['roleName']};}};function a180_0x15dc(){const _0x5393ef=['5126652rBLDRq','selector','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','POST','role','Added\x20user\x20','No\x20change:\x20user\x20','8250gYTdwU','8qwJSJg','109auoPTF','appCode','1744638xHgvll','high-risk-write','120728AMPXnQ','15600620rFubox','3334370EBGkGR','54LNMbod','roleType','userId','user-add','roleName','1916313KGRIuz'];a180_0x15dc=function(){return _0x5393ef;};return a180_0x15dc();}
1
+ const a180_0x3f95ab=a180_0x503c;(function(_0x3790a2,_0x2c0e75){const _0x1cc56e=a180_0x503c,_0x4799a4=_0x3790a2();while(!![]){try{const _0x2246f0=-parseInt(_0x1cc56e(0x1b7))/0x1+-parseInt(_0x1cc56e(0x1bf))/0x2+parseInt(_0x1cc56e(0x1b3))/0x3+parseInt(_0x1cc56e(0x1bc))/0x4+parseInt(_0x1cc56e(0x1b4))/0x5+-parseInt(_0x1cc56e(0x1c1))/0x6*(parseInt(_0x1cc56e(0x1b0))/0x7)+parseInt(_0x1cc56e(0x1b5))/0x8*(parseInt(_0x1cc56e(0x1ad))/0x9);if(_0x2246f0===_0x2c0e75)break;else _0x4799a4['push'](_0x4799a4['shift']());}catch(_0x2c9c79){_0x4799a4['push'](_0x4799a4['shift']());}}}(a180_0x53a0,0x796c3));function a180_0x503c(_0x453a35,_0x27139d){_0x453a35=_0x453a35-0x1ad;const _0x53a01b=a180_0x53a0();let _0x503ca5=_0x53a01b[_0x453a35];return _0x503ca5;}import{createDevUserRole}from'../../core/api-client.js';function a180_0x53a0(){const _0x3532d9=['username','roleId','1546100nbatEI','user-add','294AfMKlW','3645567rzMHun','No\x20change:\x20user\x20','POST','3199vUUUej','\x20already\x20in\x20role\x20','high-risk-write','762870jwocXY','3994185lxKVAs','8RtYJxD','userId','896288YDpthT','roleType','role','selector','roleName','2923552pHkcBg'];a180_0x53a0=function(){return _0x3532d9;};return a180_0x53a0();}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';export const roleUserAdd={'service':a180_0x3f95ab(0x1b9),'command':a180_0x3f95ab(0x1c0),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a180_0x3f95ab(0x1b2),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2fae80){const _0x2c56e6=a180_0x3f95ab,{mutation:_0x2073b9}=await prepareUserMutation(_0x2fae80,_0x2c56e6(0x1c0),!![]);return asDryRunResult(_0x2073b9,{'method':_0x2c56e6(0x1af),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x38aa79){const _0x5b195c=a180_0x3f95ab,{mutation:_0x15383e,changed:_0x3a49d4,role:_0x50d9c0,user:_0x3b2ae2}=await prepareUserMutation(_0x38aa79,_0x5b195c(0x1c0),![]);return _0x3a49d4&&await createDevUserRole({'appCode':_0x38aa79['appCode'],'userId':_0x3b2ae2[_0x5b195c(0x1b6)],'username':_0x3b2ae2[_0x5b195c(0x1bd)],'roleType':_0x50d9c0[_0x5b195c(0x1b8)],'roleId':_0x15383e[_0x5b195c(0x1ba)][_0x5b195c(0x1be)]}),{'ok':!![],'data':_0x15383e,'message':_0x3a49d4?'Added\x20user\x20'+_0x15383e[_0x5b195c(0x1ba)][_0x5b195c(0x1b6)]+'\x20to\x20role\x20'+_0x15383e[_0x5b195c(0x1ba)][_0x5b195c(0x1bb)]:_0x5b195c(0x1ae)+_0x15383e[_0x5b195c(0x1ba)][_0x5b195c(0x1b6)]+_0x5b195c(0x1b1)+_0x15383e['selector'][_0x5b195c(0x1bb)]};}};
@@ -1 +1 @@
1
- const a181_0x20056e=a181_0x2b5c;function a181_0x2b5c(_0x3eeeee,_0x1b21a1){_0x3eeeee=_0x3eeeee-0x74;const _0x426166=a181_0x4261();let _0x2b5c8c=_0x426166[_0x3eeeee];return _0x2b5c8c;}(function(_0x3e9930,_0x5a1487){const _0x48a997=a181_0x2b5c,_0xb1bb8a=_0x3e9930();while(!![]){try{const _0x9a4370=parseInt(_0x48a997(0x75))/0x1*(-parseInt(_0x48a997(0x87))/0x2)+-parseInt(_0x48a997(0x82))/0x3+parseInt(_0x48a997(0x79))/0x4+parseInt(_0x48a997(0x7e))/0x5*(parseInt(_0x48a997(0x86))/0x6)+parseInt(_0x48a997(0x76))/0x7+parseInt(_0x48a997(0x84))/0x8*(parseInt(_0x48a997(0x78))/0x9)+parseInt(_0x48a997(0x85))/0xa;if(_0x9a4370===_0x5a1487)break;else _0xb1bb8a['push'](_0xb1bb8a['shift']());}catch(_0x43bf3a){_0xb1bb8a['push'](_0xb1bb8a['shift']());}}}(a181_0x4261,0xb49de));import{deleteDevUserRole}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,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a181_0x4261(){const _0x1e9dbe=['9yVTUbL','3186044JaPzUB','role','\x20from\x20role\x20','user-remove','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','1150VAvfIU','userId','Removed\x20user\x20','No\x20change:\x20user\x20','3474126yXSaMq','POST','6890608MFfena','171600ugrygP','14844buSpyE','21598EnZlCm','roleName','46yfeZmS','1054095TvlPNn','selector'];a181_0x4261=function(){return _0x1e9dbe;};return a181_0x4261();}export const roleUserRemove={'service':a181_0x20056e(0x7a),'command':'user-remove','description':a181_0x20056e(0x7d),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3ec039){const _0xacac13=a181_0x20056e,{mutation:_0x46852b}=await prepareUserMutation(_0x3ec039,'user-remove',!![]);return asDryRunResult(_0x46852b,{'method':_0xacac13(0x83),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x5ed844){const _0x5770bf=a181_0x20056e,{matchingRelationIds:_0x5a4438,mutation:_0x2ca872,changed:_0x5f5d83}=await prepareUserMutation(_0x5ed844,_0x5770bf(0x7c),![]);if(_0x5f5d83)for(const _0x4520fb of _0x5a4438){await deleteDevUserRole(_0x4520fb);}return{'ok':!![],'data':_0x2ca872,'message':_0x5f5d83?_0x5770bf(0x80)+_0x2ca872[_0x5770bf(0x77)][_0x5770bf(0x7f)]+_0x5770bf(0x7b)+_0x2ca872['selector'][_0x5770bf(0x74)]:_0x5770bf(0x81)+_0x2ca872['selector'][_0x5770bf(0x7f)]+'\x20not\x20in\x20role\x20'+_0x2ca872[_0x5770bf(0x77)][_0x5770bf(0x74)]};}};
1
+ const a181_0x1c0bd5=a181_0x4ab5;(function(_0x4170a4,_0x546916){const _0x1a5056=a181_0x4ab5,_0x2b0962=_0x4170a4();while(!![]){try{const _0xded976=-parseInt(_0x1a5056(0x13c))/0x1+-parseInt(_0x1a5056(0x141))/0x2*(-parseInt(_0x1a5056(0x13b))/0x3)+-parseInt(_0x1a5056(0x12f))/0x4+-parseInt(_0x1a5056(0x136))/0x5+parseInt(_0x1a5056(0x138))/0x6+-parseInt(_0x1a5056(0x13e))/0x7*(parseInt(_0x1a5056(0x13d))/0x8)+parseInt(_0x1a5056(0x131))/0x9*(parseInt(_0x1a5056(0x130))/0xa);if(_0xded976===_0x546916)break;else _0x2b0962['push'](_0x2b0962['shift']());}catch(_0x2ed85c){_0x2b0962['push'](_0x2b0962['shift']());}}}(a181_0x4a0f,0x2d952));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a181_0x4a0f(){const _0x447d46=['No\x20change:\x20user\x20','41439oijORt','269968RJWSxO','824HzFTDG','14791gyEIHS','\x20from\x20role\x20','user-remove','2jGMwOA','636832xhPCtp','10XAPAaZ','8212599HyFyDp','selector','POST','high-risk-write','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','1215770RPhbPh','userId','902106IASxSE','roleName'];a181_0x4a0f=function(){return _0x447d46;};return a181_0x4a0f();}import{asDryRunResult}from'../../commands/common/dry-run.js';function a181_0x4ab5(_0x24a693,_0x4f1db2){_0x24a693=_0x24a693-0x12f;const _0x4a0f82=a181_0x4a0f();let _0x4ab5e5=_0x4a0f82[_0x24a693];return _0x4ab5e5;}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':'role','command':a181_0x1c0bd5(0x140),'description':a181_0x1c0bd5(0x135),'risk':a181_0x1c0bd5(0x134),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x41c864){const _0x2d41ae=a181_0x1c0bd5,{mutation:_0x717ae2}=await prepareUserMutation(_0x41c864,_0x2d41ae(0x140),!![]);return asDryRunResult(_0x717ae2,{'method':_0x2d41ae(0x133),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x5e8dbf){const _0x446c83=a181_0x1c0bd5,{matchingRelationIds:_0x121618,mutation:_0x12caf6,changed:_0x46f9e0}=await prepareUserMutation(_0x5e8dbf,'user-remove',![]);if(_0x46f9e0)for(const _0x1e1914 of _0x121618){await deleteDevUserRole(_0x1e1914);}return{'ok':!![],'data':_0x12caf6,'message':_0x46f9e0?'Removed\x20user\x20'+_0x12caf6[_0x446c83(0x132)][_0x446c83(0x137)]+_0x446c83(0x13f)+_0x12caf6['selector']['roleName']:_0x446c83(0x13a)+_0x12caf6[_0x446c83(0x132)]['userId']+'\x20not\x20in\x20role\x20'+_0x12caf6[_0x446c83(0x132)][_0x446c83(0x139)]};}};
@@ -1 +1 @@
1
- const a182_0x322e0c=a182_0x2517;(function(_0x1c268c,_0x2c980f){const _0x1245c1=a182_0x2517,_0x2df777=_0x1c268c();while(!![]){try{const _0x103ecc=parseInt(_0x1245c1(0x140))/0x1+-parseInt(_0x1245c1(0x13f))/0x2*(parseInt(_0x1245c1(0x138))/0x3)+-parseInt(_0x1245c1(0x136))/0x4*(parseInt(_0x1245c1(0x132))/0x5)+-parseInt(_0x1245c1(0x137))/0x6*(parseInt(_0x1245c1(0x133))/0x7)+parseInt(_0x1245c1(0x13b))/0x8+parseInt(_0x1245c1(0x13d))/0x9*(-parseInt(_0x1245c1(0x147))/0xa)+-parseInt(_0x1245c1(0x142))/0xb*(-parseInt(_0x1245c1(0x144))/0xc);if(_0x103ecc===_0x2c980f)break;else _0x2df777['push'](_0x2df777['shift']());}catch(_0x50a938){_0x2df777['push'](_0x2df777['shift']());}}}(a182_0x48c1,0x3fd46));function a182_0x48c1(){const _0x54ca14=['3480akgOMX','user-resolve','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','20CANjIN','read','name','flagMissing','10yFpRTk','1877729nfLaMU','matchedBy','Pass\x20--name\x20<nickname|username>.','69668kRZZfA','6nWUCig','23583LZLiel','username','userId','1008496xxoGZx','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','1666179fRtfQz','role','44byYkya','22639QpiGqJ','trim','36377amYkaN','str'];a182_0x48c1=function(){return _0x54ca14;};return a182_0x48c1();}function a182_0x2517(_0x3b8413,_0x186662){_0x3b8413=_0x3b8413-0x130;const _0x48c1b0=a182_0x48c1();let _0x25175a=_0x48c1b0[_0x3b8413];return _0x25175a;}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_0x322e0c(0x13e),'command':a182_0x322e0c(0x145),'description':a182_0x322e0c(0x13c),'risk':a182_0x322e0c(0x148),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1f73da){const _0x463d92=a182_0x322e0c;if(!_0x1f73da[_0x463d92(0x143)](_0x463d92(0x130))[_0x463d92(0x141)]())throw CliErrors[_0x463d92(0x131)](_0x463d92(0x130),_0x463d92(0x135));},async 'execute'(_0x47d61b){const _0x11af97=a182_0x322e0c,_0x1d729e=_0x47d61b[_0x11af97(0x143)](_0x11af97(0x130))[_0x11af97(0x141)](),_0x191c53=await resolveUserRef(_0x1d729e,_0x11af97(0x146));return{'ok':!![],'data':{'user':{'userId':_0x191c53['userId'],'username':_0x191c53[_0x11af97(0x139)],'nickname':_0x191c53['nickname'],'matchedBy':_0x191c53[_0x11af97(0x134)]}},'message':'Resolved\x20\x22'+_0x1d729e+'\x22\x20→\x20userId\x20'+_0x191c53[_0x11af97(0x13a)]};}};
1
+ function a182_0x4bb0(_0x4960df,_0x586de9){_0x4960df=_0x4960df-0x12d;const _0x34dda5=a182_0x34dd();let _0x4bb060=_0x34dda5[_0x4960df];return _0x4bb060;}const a182_0x1a095a=a182_0x4bb0;(function(_0x2688f,_0x47e32e){const _0x34223f=a182_0x4bb0,_0x43da32=_0x2688f();while(!![]){try{const _0x169bb0=-parseInt(_0x34223f(0x142))/0x1+-parseInt(_0x34223f(0x133))/0x2+parseInt(_0x34223f(0x132))/0x3*(parseInt(_0x34223f(0x139))/0x4)+parseInt(_0x34223f(0x143))/0x5+-parseInt(_0x34223f(0x12e))/0x6*(-parseInt(_0x34223f(0x13a))/0x7)+parseInt(_0x34223f(0x13d))/0x8*(-parseInt(_0x34223f(0x13b))/0x9)+-parseInt(_0x34223f(0x136))/0xa*(parseInt(_0x34223f(0x13e))/0xb);if(_0x169bb0===_0x47e32e)break;else _0x43da32['push'](_0x43da32['shift']());}catch(_0x51bd86){_0x43da32['push'](_0x43da32['shift']());}}}(a182_0x34dd,0x9f422));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_0x1a095a(0x134),'command':'user-resolve','description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a182_0x1a095a(0x12d),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1fa4ea){const _0x3e105a=a182_0x1a095a;if(!_0x1fa4ea[_0x3e105a(0x140)](_0x3e105a(0x131))[_0x3e105a(0x144)]())throw CliErrors[_0x3e105a(0x13c)](_0x3e105a(0x131),'Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0xc97628){const _0x43ad48=a182_0x1a095a,_0x22e10d=_0xc97628[_0x43ad48(0x140)]('name')[_0x43ad48(0x144)](),_0x33d107=await resolveUserRef(_0x22e10d,_0x43ad48(0x137));return{'ok':!![],'data':{'user':{'userId':_0x33d107[_0x43ad48(0x141)],'username':_0x33d107[_0x43ad48(0x135)],'nickname':_0x33d107[_0x43ad48(0x130)],'matchedBy':_0x33d107[_0x43ad48(0x12f)]}},'message':_0x43ad48(0x138)+_0x22e10d+_0x43ad48(0x13f)+_0x33d107[_0x43ad48(0x141)]};}};function a182_0x34dd(){const _0x4b7545=['Resolved\x20\x22','143268qHMYNi','211652YeJwIP','36aVIZec','flagMissing','2195888fsjUvF','3800049RbRgYw','\x22\x20→\x20userId\x20','str','userId','594861rqnGSW','4792760foMGzX','trim','read','258IVSYrf','matchedBy','nickname','name','51RwQuFY','354006iPGCUo','role','username','10egqpGn','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.'];a182_0x34dd=function(){return _0x4b7545;};return a182_0x34dd();}
@@ -1 +1 @@
1
- const a183_0x25b150=a183_0x55aa;function a183_0x55aa(_0x4542f7,_0x4b632b){_0x4542f7=_0x4542f7-0x179;const _0x2d80a4=a183_0x2d80();let _0x55aa3e=_0x2d80a4[_0x4542f7];return _0x55aa3e;}function a183_0x2d80(){const _0x31d47b=['write','No\x20package.json\x20found\x20in\x20current\x20directory.','\x20\x20EXAMPLES','boolean','scripts','470xaNhkc','\x20run\x20','build','start','6366980aXIsqG','args','keys','belowMinimum','preview','error','yarn','Run\x20a\x20package.json\x20script','length','Script\x20\x22','\x20\x20\x20\x20','bun.lock','7426170GxLGdY','dev','bun','283952mAKLzJ','\x20run\x20start','needsUpgrade','pnpm','Enable\x20watch\x20mode\x20for\x20preview','all','Script\x20name\x20defined\x20in\x20package.json','join','inherit','\x0a\x20\x20Usage:\x20','script','close','\x20run\x20build','vite\x20preview\x20exited\x20with\x20code\x20','--watch','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','run','npm','\x0a\x20\x20Available\x20scripts:\x0a','\x20run\x20<script>\x0a','3gamZzY','15400wZGifH','\x20exited\x20with\x20code\x20','has','33678623ymZCDI','utf-8','bun.lockb','watch','pnpm-lock.yaml','log','12SUtfNz','.bin','\x20run\x20preview\x20--watch','node_modules','validation','276370mmGixW','\x22\x20not\x20found\x20in\x20package.json.','144mrCPam','No\x20scripts\x20defined\x20in\x20package.json.','48462WYiDwr','2xRziMe','cwd','push'];a183_0x2d80=function(){return _0x31d47b;};return a183_0x2d80();}(function(_0x41b5e2,_0x3d36da){const _0x2af4a1=a183_0x55aa,_0x5073c2=_0x41b5e2();while(!![]){try{const _0x3f65fb=-parseInt(_0x2af4a1(0x193))/0x1*(parseInt(_0x2af4a1(0x198))/0x2)+parseInt(_0x2af4a1(0x184))/0x3*(-parseInt(_0x2af4a1(0x1b3))/0x4)+-parseInt(_0x2af4a1(0x1a0))/0x5*(parseInt(_0x2af4a1(0x197))/0x6)+parseInt(_0x2af4a1(0x185))/0x7*(-parseInt(_0x2af4a1(0x195))/0x8)+-parseInt(_0x2af4a1(0x1b0))/0x9+-parseInt(_0x2af4a1(0x1a4))/0xa+parseInt(_0x2af4a1(0x188))/0xb*(parseInt(_0x2af4a1(0x18e))/0xc);if(_0x3f65fb===_0x3d36da)break;else _0x5073c2['push'](_0x5073c2['shift']());}catch(_0x1ef80e){_0x5073c2['push'](_0x5073c2['shift']());}}}(a183_0x2d80,0x6ec25));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([a183_0x25b150(0x1a3),a183_0x25b150(0x1b1)]);function readPackageScripts(_0x4816bf){const _0x1da561=a183_0x25b150,_0x406661=resolve(_0x4816bf,'package.json');if(!existsSync(_0x406661))return null;try{const _0x5e8acf=JSON['parse'](readFileSync(_0x406661,_0x1da561(0x189)));return _0x5e8acf[_0x1da561(0x19f)]??{};}catch{return null;}}function detectPackageManager(_0x11333a){const _0x4d346c=a183_0x25b150;if(existsSync(resolve(_0x11333a,_0x4d346c(0x18a)))||existsSync(resolve(_0x11333a,_0x4d346c(0x1af))))return _0x4d346c(0x1b2);if(existsSync(resolve(_0x11333a,_0x4d346c(0x18c))))return _0x4d346c(0x1b6);if(existsSync(resolve(_0x11333a,'yarn.lock')))return _0x4d346c(0x1aa);return _0x4d346c(0x181);}async function versionCheck(_0x4b9f37){const _0x392a7a=a183_0x25b150,_0x2a00ae=await checkCliVersion();(_0x2a00ae[_0x392a7a(0x1b5)]||_0x2a00ae[_0x392a7a(0x1a7)])&&(printCliUpgradeWarning(_0x2a00ae),assertCliVersionSupported(_0x2a00ae));const _0x378a65=await checkSdkVersion(_0x4b9f37);if(_0x378a65['needsUpgrade'])printSdkUpgradeWarning(_0x378a65);}function spawnScript(_0x598786,_0x184c98,_0x398ae1,_0x3c770c){return new Promise((_0x17102b,_0x3b8718)=>{const _0x4c291d=a183_0x55aa,_0x26589c=[_0x4c291d(0x180),_0x184c98,..._0x398ae1],_0x5c35a4=spawn(_0x598786,_0x26589c,{'cwd':_0x3c770c,'stdio':_0x4c291d(0x1bb),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3c770c,_0x4c291d(0x191),'.bin')+delimiter+process.env.PATH}});_0x5c35a4['on'](_0x4c291d(0x17b),_0x823992=>{const _0x411df4=_0x4c291d;if(_0x823992===0x0||_0x823992===null)_0x17102b();else _0x3b8718(new Error(_0x598786+_0x411df4(0x1a1)+_0x184c98+_0x411df4(0x186)+_0x823992));}),_0x5c35a4['on'](_0x4c291d(0x1a9),_0x3b8718);});}function spawnViteBuildWatch(_0x5a497b){return new Promise((_0x2b5a24,_0x551cfb)=>{const _0x20e5e6=a183_0x55aa,_0x45bd8e=spawn('vite',[_0x20e5e6(0x1a2),_0x20e5e6(0x17e)],{'cwd':_0x5a497b,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x5a497b,'node_modules',_0x20e5e6(0x18f))+delimiter+process.env.PATH}});_0x45bd8e['on']('close',_0xff9af8=>{const _0x4a1280=_0x20e5e6;if(_0xff9af8===0x0||_0xff9af8===null)_0x2b5a24();else _0x551cfb(new Error(_0x4a1280(0x17f)+_0xff9af8));}),_0x45bd8e['on'](_0x20e5e6(0x1a9),_0x551cfb);});}function spawnVitePreview(_0x5dc85a){return new Promise((_0x2ad7ad,_0x27b9cf)=>{const _0x5b043e=a183_0x55aa,_0x38cdd7=spawn('vite',[_0x5b043e(0x1a8)],{'cwd':_0x5dc85a,'stdio':_0x5b043e(0x1bb),'shell':!![],'env':{...process.env,'PATH':''+join(_0x5dc85a,_0x5b043e(0x191),_0x5b043e(0x18f))+delimiter+process.env.PATH}});_0x38cdd7['on'](_0x5b043e(0x17b),_0x335301=>{const _0x6fbcc1=_0x5b043e;if(_0x335301===0x0||_0x335301===null)_0x2ad7ad();else _0x27b9cf(new Error(_0x6fbcc1(0x17d)+_0x335301));}),_0x38cdd7['on'](_0x5b043e(0x1a9),_0x27b9cf);});}const runFlags=[{'name':a183_0x25b150(0x18b),'type':a183_0x25b150(0x19e),'description':a183_0x25b150(0x1b7),'default':![]}];export const runDefinition={'service':a183_0x25b150(0x180),'command':'run','description':a183_0x25b150(0x1ab),'risk':a183_0x25b150(0x19b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a183_0x25b150(0x17a),'description':a183_0x25b150(0x1b9),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x28ffdc=a183_0x25b150,_0x2be4bf=[];return _0x2be4bf[_0x28ffdc(0x19a)](_0x28ffdc(0x19d)),_0x2be4bf[_0x28ffdc(0x19a)](_0x28ffdc(0x1ae)+CLI_BIN_NAME+_0x28ffdc(0x1b4)),_0x2be4bf['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x28ffdc(0x17c)),_0x2be4bf[_0x28ffdc(0x19a)](_0x28ffdc(0x1ae)+CLI_BIN_NAME+'\x20run\x20preview'),_0x2be4bf[_0x28ffdc(0x19a)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x28ffdc(0x190)),_0x2be4bf[_0x28ffdc(0x1ba)]('\x0a');},async 'execute'(_0x56097c){const _0x2b23ab=a183_0x25b150,_0x2d3e02=process[_0x2b23ab(0x199)](),_0x45ce22=_0x56097c[_0x2b23ab(0x1a5)][0x0],_0x54eacb=_0x56097c[_0x2b23ab(0x1a5)]['slice'](0x1),_0x55cad2=readPackageScripts(_0x2d3e02);if(!_0x55cad2)throw CliErrors[_0x2b23ab(0x192)](_0x2b23ab(0x19c));if(!_0x45ce22){const _0x23e13a=Object[_0x2b23ab(0x1a6)](_0x55cad2);if(_0x23e13a[_0x2b23ab(0x1ac)]===0x0)console[_0x2b23ab(0x18d)](_0x2b23ab(0x196));else{console[_0x2b23ab(0x18d)](_0x2b23ab(0x182));for(const _0x4660f9 of _0x23e13a){console[_0x2b23ab(0x18d)](_0x2b23ab(0x1ae)+_0x4660f9);}console[_0x2b23ab(0x18d)](_0x2b23ab(0x179)+CLI_BIN_NAME+_0x2b23ab(0x183));}return{'ok':!![]};}if(!_0x55cad2[_0x45ce22])throw CliErrors[_0x2b23ab(0x192)](_0x2b23ab(0x1ad)+_0x45ce22+_0x2b23ab(0x194),'Available:\x20'+(Object['keys'](_0x55cad2)[_0x2b23ab(0x1ba)](',\x20')||'(none)'));const _0x2f6799=detectPackageManager(_0x2d3e02);VERSION_CHECK_SCRIPTS[_0x2b23ab(0x187)](_0x45ce22)&&await versionCheck(_0x2d3e02);if(_0x45ce22===_0x2b23ab(0x1a8)&&_0x56097c['bool']('watch'))return await Promise[_0x2b23ab(0x1b8)]([spawnViteBuildWatch(_0x2d3e02),spawnVitePreview(_0x2d3e02)]),{'ok':!![]};return await spawnScript(_0x2f6799,_0x45ce22,_0x54eacb,_0x2d3e02),{'ok':!![]};}};
1
+ const a183_0xc6e504=a183_0x2f97;(function(_0x32b7bd,_0x758808){const _0x33bd78=a183_0x2f97,_0xd2e5aa=_0x32b7bd();while(!![]){try{const _0x38bd66=parseInt(_0x33bd78(0x8e))/0x1+-parseInt(_0x33bd78(0x7e))/0x2+parseInt(_0x33bd78(0x86))/0x3+-parseInt(_0x33bd78(0x94))/0x4+parseInt(_0x33bd78(0x76))/0x5*(parseInt(_0x33bd78(0x6a))/0x6)+-parseInt(_0x33bd78(0x93))/0x7+parseInt(_0x33bd78(0x73))/0x8;if(_0x38bd66===_0x758808)break;else _0xd2e5aa['push'](_0xd2e5aa['shift']());}catch(_0x176827){_0xd2e5aa['push'](_0xd2e5aa['shift']());}}}(a183_0x1eaf,0x88b81));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',a183_0xc6e504(0x88)]);function readPackageScripts(_0x20df31){const _0x18b9e2=a183_0xc6e504,_0x161463=resolve(_0x20df31,'package.json');if(!existsSync(_0x161463))return null;try{const _0x5e532c=JSON[_0x18b9e2(0x84)](readFileSync(_0x161463,_0x18b9e2(0x92)));return _0x5e532c['scripts']??{};}catch{return null;}}function detectPackageManager(_0x2535a8){const _0x31145a=a183_0xc6e504;if(existsSync(resolve(_0x2535a8,_0x31145a(0x95)))||existsSync(resolve(_0x2535a8,_0x31145a(0x79))))return'bun';if(existsSync(resolve(_0x2535a8,_0x31145a(0x98))))return _0x31145a(0x91);if(existsSync(resolve(_0x2535a8,'yarn.lock')))return _0x31145a(0x9b);return'npm';}function a183_0x2f97(_0x140b65,_0x37db04){_0x140b65=_0x140b65-0x67;const _0x1eafd9=a183_0x1eaf();let _0x2f97cf=_0x1eafd9[_0x140b65];return _0x2f97cf;}async function versionCheck(_0x36b170){const _0x1bf301=a183_0xc6e504,_0xe50323=await checkCliVersion();(_0xe50323[_0x1bf301(0x75)]||_0xe50323['belowMinimum'])&&(printCliUpgradeWarning(_0xe50323),assertCliVersionSupported(_0xe50323));const _0x4e3666=await checkSdkVersion(_0x36b170);if(_0x4e3666[_0x1bf301(0x75)])printSdkUpgradeWarning(_0x4e3666);}function spawnScript(_0x5c07f6,_0x32a4ea,_0x5b93f0,_0xa470af){return new Promise((_0x4a53af,_0x508b9c)=>{const _0x171693=a183_0x2f97,_0x2899e4=[_0x171693(0x7c),_0x32a4ea,..._0x5b93f0],_0x297f14=spawn(_0x5c07f6,_0x2899e4,{'cwd':_0xa470af,'stdio':_0x171693(0x7d),'shell':!![],'env':{...process.env,'PATH':''+join(_0xa470af,_0x171693(0x9a),_0x171693(0x69))+delimiter+process.env.PATH}});_0x297f14['on'](_0x171693(0x70),_0x4b297c=>{const _0x3d6f90=_0x171693;if(_0x4b297c===0x0||_0x4b297c===null)_0x4a53af();else _0x508b9c(new Error(_0x5c07f6+_0x3d6f90(0x85)+_0x32a4ea+'\x20exited\x20with\x20code\x20'+_0x4b297c));}),_0x297f14['on']('error',_0x508b9c);});}function a183_0x1eaf(){const _0x20c9e9=['Available:\x20','length','write','\x20run\x20start','parse','\x20run\x20','1315203vGMYVP','bool','dev','push','Script\x20\x22','\x0a\x20\x20Usage:\x20','\x22\x20not\x20found\x20in\x20package.json.','log','38180BywiNc','has','all','pnpm','utf-8','542885RYbaCb','3299212mxrtVI','bun.lockb','vite','\x20\x20\x20\x20','pnpm-lock.yaml','args','node_modules','yarn','watch','keys','\x20run\x20<script>\x0a','.bin','100662aynQvr','\x0a\x20\x20Available\x20scripts:\x0a','Run\x20a\x20package.json\x20script','validation','Script\x20name\x20defined\x20in\x20package.json','build','close','join','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','3717664sWgCnz','preview','needsUpgrade','235zCmOic','error','\x20run\x20build','bun.lock','\x20\x20EXAMPLES','\x20run\x20preview\x20--watch','run','inherit','534898nRcLSK','boolean'];a183_0x1eaf=function(){return _0x20c9e9;};return a183_0x1eaf();}function spawnViteBuildWatch(_0x395f7b){return new Promise((_0x838b4d,_0x50f5b5)=>{const _0x59595e=a183_0x2f97,_0x56b278=spawn('vite',[_0x59595e(0x6f),'--watch'],{'cwd':_0x395f7b,'stdio':_0x59595e(0x7d),'shell':!![],'env':{...process.env,'PATH':''+join(_0x395f7b,_0x59595e(0x9a),_0x59595e(0x69))+delimiter+process.env.PATH}});_0x56b278['on']('close',_0xd3d13c=>{const _0x45325e=_0x59595e;if(_0xd3d13c===0x0||_0xd3d13c===null)_0x838b4d();else _0x50f5b5(new Error(_0x45325e(0x72)+_0xd3d13c));}),_0x56b278['on'](_0x59595e(0x77),_0x50f5b5);});}function spawnVitePreview(_0x4bf365){return new Promise((_0x1981d9,_0xe45901)=>{const _0x3bef5f=a183_0x2f97,_0x4831cc=spawn(_0x3bef5f(0x96),['preview'],{'cwd':_0x4bf365,'stdio':_0x3bef5f(0x7d),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4bf365,_0x3bef5f(0x9a),_0x3bef5f(0x69))+delimiter+process.env.PATH}});_0x4831cc['on'](_0x3bef5f(0x70),_0x210771=>{if(_0x210771===0x0||_0x210771===null)_0x1981d9();else _0xe45901(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x210771));}),_0x4831cc['on'](_0x3bef5f(0x77),_0xe45901);});}const runFlags=[{'name':a183_0xc6e504(0x9c),'type':a183_0xc6e504(0x7f),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a183_0xc6e504(0x7c),'command':a183_0xc6e504(0x7c),'description':a183_0xc6e504(0x6c),'risk':a183_0xc6e504(0x82),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a183_0xc6e504(0x6e),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x1c2f95=a183_0xc6e504,_0x20fddb=[];return _0x20fddb[_0x1c2f95(0x89)](_0x1c2f95(0x7a)),_0x20fddb[_0x1c2f95(0x89)](_0x1c2f95(0x97)+CLI_BIN_NAME+_0x1c2f95(0x83)),_0x20fddb['push'](_0x1c2f95(0x97)+CLI_BIN_NAME+_0x1c2f95(0x78)),_0x20fddb[_0x1c2f95(0x89)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20preview'),_0x20fddb['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x1c2f95(0x7b)),_0x20fddb['join']('\x0a');},async 'execute'(_0x242b06){const _0x517433=a183_0xc6e504,_0x11087a=process['cwd'](),_0x1166eb=_0x242b06[_0x517433(0x99)][0x0],_0x5644f3=_0x242b06[_0x517433(0x99)]['slice'](0x1),_0x5696a2=readPackageScripts(_0x11087a);if(!_0x5696a2)throw CliErrors[_0x517433(0x6d)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x1166eb){const _0x40f0f6=Object[_0x517433(0x67)](_0x5696a2);if(_0x40f0f6[_0x517433(0x81)]===0x0)console[_0x517433(0x8d)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console[_0x517433(0x8d)](_0x517433(0x6b));for(const _0x4c2513 of _0x40f0f6){console['log'](_0x517433(0x97)+_0x4c2513);}console['log'](_0x517433(0x8b)+CLI_BIN_NAME+_0x517433(0x68));}return{'ok':!![]};}if(!_0x5696a2[_0x1166eb])throw CliErrors['validation'](_0x517433(0x8a)+_0x1166eb+_0x517433(0x8c),_0x517433(0x80)+(Object[_0x517433(0x67)](_0x5696a2)[_0x517433(0x71)](',\x20')||'(none)'));const _0x5ca143=detectPackageManager(_0x11087a);VERSION_CHECK_SCRIPTS[_0x517433(0x8f)](_0x1166eb)&&await versionCheck(_0x11087a);if(_0x1166eb===_0x517433(0x74)&&_0x242b06[_0x517433(0x87)](_0x517433(0x9c)))return await Promise[_0x517433(0x90)]([spawnViteBuildWatch(_0x11087a),spawnVitePreview(_0x11087a)]),{'ok':!![]};return await spawnScript(_0x5ca143,_0x1166eb,_0x5644f3,_0x11087a),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a184_0x4a4ab2=a184_0x1b21;(function(_0x243832,_0x58a2c9){const _0x3fc0f7=a184_0x1b21,_0xe8cc6a=_0x243832();while(!![]){try{const _0x54a741=parseInt(_0x3fc0f7(0xfe))/0x1*(-parseInt(_0x3fc0f7(0xf4))/0x2)+-parseInt(_0x3fc0f7(0xf6))/0x3*(-parseInt(_0x3fc0f7(0xf8))/0x4)+parseInt(_0x3fc0f7(0xf3))/0x5+parseInt(_0x3fc0f7(0xfb))/0x6*(parseInt(_0x3fc0f7(0xf2))/0x7)+parseInt(_0x3fc0f7(0xff))/0x8+parseInt(_0x3fc0f7(0xf7))/0x9+-parseInt(_0x3fc0f7(0xf5))/0xa;if(_0x54a741===_0x58a2c9)break;else _0xe8cc6a['push'](_0xe8cc6a['shift']());}catch(_0x1311ae){_0xe8cc6a['push'](_0xe8cc6a['shift']());}}}(a184_0x6b58,0x3f384));function a184_0x6b58(){const _0x52f8f1=['4279392tSfySP','2014476zkclUZ','read','export','618NldwyA','json','schema','18znKKlK','1952456lvGgbz','8337yzMmHb','1342590gWrZNO','20818GchzaP','11680450smPUYI','3thQMWm'];a184_0x6b58=function(){return _0x52f8f1;};return a184_0x6b58();}import{buildSchemaPayload}from'../framework/schema-export.js';function a184_0x1b21(_0x5355fb,_0x29c35e){_0x5355fb=_0x5355fb-0xf2;const _0x6b589=a184_0x6b58();let _0x1b21fb=_0x6b589[_0x5355fb];return _0x1b21fb;}async function execute(_0x44ff29){const _0x115a96=await buildSchemaPayload();return{'ok':!![],'data':_0x115a96};}export const schemaDefinition={'service':a184_0x4a4ab2(0xfd),'command':a184_0x4a4ab2(0xfa),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a184_0x4a4ab2(0xf9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a184_0x4a4ab2(0xfc),'flags':[],'execute':execute};
1
+ function a184_0x20f3(_0x2f247d,_0x494bc9){_0x2f247d=_0x2f247d-0x1db;const _0x4de31a=a184_0x4de3();let _0x20f3c1=_0x4de31a[_0x2f247d];return _0x20f3c1;}const a184_0x5d8f32=a184_0x20f3;function a184_0x4de3(){const _0x5b92d3=['Export\x20machine-readable\x20command\x20schema\x20(JSON)','read','3572569kIVihE','11235qTDtOp','6zBuioG','617335isTpBE','3118908wdfjFt','1007634MfTNJr','7131160eZkCJl','9ybkYCo','1001PIUcjg','export','70456ncdJHA','1868FagXHr'];a184_0x4de3=function(){return _0x5b92d3;};return a184_0x4de3();}(function(_0x489d3c,_0x827657){const _0x169464=a184_0x20f3,_0x2018be=_0x489d3c();while(!![]){try{const _0x136c58=-parseInt(_0x169464(0x1e0))/0x1+-parseInt(_0x169464(0x1df))/0x2+-parseInt(_0x169464(0x1dc))/0x3*(-parseInt(_0x169464(0x1e6))/0x4)+parseInt(_0x169464(0x1de))/0x5*(parseInt(_0x169464(0x1dd))/0x6)+-parseInt(_0x169464(0x1e3))/0x7*(-parseInt(_0x169464(0x1e5))/0x8)+-parseInt(_0x169464(0x1e2))/0x9*(-parseInt(_0x169464(0x1e1))/0xa)+-parseInt(_0x169464(0x1db))/0xb;if(_0x136c58===_0x827657)break;else _0x2018be['push'](_0x2018be['shift']());}catch(_0x2a050e){_0x2018be['push'](_0x2018be['shift']());}}}(a184_0x4de3,0xe8ac8));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5cfb01){const _0x5589b5=await buildSchemaPayload();return{'ok':!![],'data':_0x5589b5};}export const schemaDefinition={'service':'schema','command':a184_0x5d8f32(0x1e4),'description':a184_0x5d8f32(0x1e7),'risk':a184_0x5d8f32(0x1e8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a185_0x4c194e=a185_0x3135;(function(_0x290318,_0x139e07){const _0x1a20bb=a185_0x3135,_0x4fc720=_0x290318();while(!![]){try{const _0x3a3f6f=parseInt(_0x1a20bb(0xf7))/0x1*(parseInt(_0x1a20bb(0x104))/0x2)+-parseInt(_0x1a20bb(0x10b))/0x3*(parseInt(_0x1a20bb(0x10a))/0x4)+-parseInt(_0x1a20bb(0x11b))/0x5*(-parseInt(_0x1a20bb(0xe4))/0x6)+parseInt(_0x1a20bb(0x110))/0x7+parseInt(_0x1a20bb(0xe9))/0x8+-parseInt(_0x1a20bb(0x111))/0x9+parseInt(_0x1a20bb(0xe3))/0xa;if(_0x3a3f6f===_0x139e07)break;else _0x4fc720['push'](_0x4fc720['shift']());}catch(_0x13a468){_0x4fc720['push'](_0x4fc720['shift']());}}}(a185_0x2683,0x58b37));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';function a185_0x2683(){const _0x4bef14=['<server-generated-sqlCode>','10733CcmHKB','mybatisXml','SELECT\x201\x20AS\x20id;','stringify','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','length','new','Select\x20the\x20local\x20SQL\x20mode:','/smartapi/custom/saveUserCustomSql','create','dbId\x20cannot\x20be\x20empty','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','</select>','10ZDIQFt','Created\x20SQL\x20query\x20','sqlRootDir','isInteger','description','catch','724cbgCnr','11847vaVWsL','__manual__','dbName','number','sqlCode','3973438nzxxXh','4232853SKlJZH','string','Target\x20database\x20dbId:','sqlName','toISOString','sql','SQL\x20name\x20cannot\x20be\x20empty','File\x20already\x20exists:\x20','utf8','isFinite','170RxnobN','SQL\x20query\x20display\x20name','lockFilePath','str','Target\x20database\x20ID','appCode','nonInteractive','dbId\x20must\x20be\x20a\x20positive\x20integer','parse','1787990UKOTwd','35934bouLhq','sqls','mode','trim','Local\x20SQL\x20file\x20mode','4357448wSvGMf','Select\x20the\x20target\x20database:','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','join','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','lastSync','dbId','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','flagMissing','db-id','MyBatis\x20XML\x20(mybatisXml)','name','validation'];a185_0x2683=function(){return _0x4bef14;};return a185_0x2683();}import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';function a185_0x3135(_0x20a79a,_0x169896){_0x20a79a=_0x20a79a-0xe3;const _0x26835b=a185_0x2683();let _0x313516=_0x26835b[_0x20a79a];return _0x313516;}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';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x134102){const _0x1cd155=a185_0x3135;if(_0x134102==='mybatisXml')return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','\x20\x20SELECT\x201\x20AS\x20id',_0x1cd155(0x103),''][_0x1cd155(0xec)]('\x0a');return[_0x1cd155(0xf9),''][_0x1cd155(0xec)]('\x0a');}export const sqlCreate={'service':a185_0x4c194e(0x116),'command':a185_0x4c194e(0x100),'description':a185_0x4c194e(0xeb),'risk':'write','flags':[{'name':a185_0x4c194e(0xf4),'type':a185_0x4c194e(0x112),'description':a185_0x4c194e(0x11c)},{'name':a185_0x4c194e(0xf2),'type':'number','description':a185_0x4c194e(0x11f)},{'name':a185_0x4c194e(0xe6),'type':a185_0x4c194e(0x112),'enum':[a185_0x4c194e(0x116),a185_0x4c194e(0xf8)],'description':a185_0x4c194e(0xe8)}],async 'validate'(_0x24cbb){const _0x146292=a185_0x4c194e;if(!_0x24cbb[_0x146292(0x121)])return;if(!_0x24cbb['str'](_0x146292(0xf4))[_0x146292(0xe7)]())throw CliErrors[_0x146292(0xf1)](_0x146292(0xf4),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x395861=resolveProvidedDbId(_0x24cbb);if(typeof _0x395861!=='number'||!Number[_0x146292(0x11a)](_0x395861)||_0x395861<=0x0)throw CliErrors[_0x146292(0xf1)](_0x146292(0xf2),_0x146292(0xfb));if(!_0x24cbb[_0x146292(0x11e)](_0x146292(0xe6))['trim']())throw CliErrors[_0x146292(0xf1)](_0x146292(0xe6),_0x146292(0xf0));},async 'dryRun'(_0x5c2701){const _0x12b7d8=a185_0x4c194e,_0xb20e=loadSqlProjectConfig(_0x5c2701[_0x12b7d8(0x120)]),{sqlName:_0x958599,dbId:_0x3af1f9,dbName:_0x5710d4,mode:_0x538bde}=await resolveSqlNewInputs(_0x5c2701),_0x16ab80=buildSqlRelativePath(_0x12b7d8(0xf6),_0x958599,_0x5710d4,_0x538bde,_0x3af1f9),_0x27d268=_0xb20e[_0x12b7d8(0x106)]+'/'+_0x16ab80;return{'method':'POST','url':_0x12b7d8(0xff),'body':{'appCode':_0x5c2701[_0x12b7d8(0x120)],'sqlName':_0x958599,'dbId':_0x3af1f9,'mode':_0x538bde,'localPath':_0x27d268},'description':_0x12b7d8(0xed)+_0xb20e[_0x12b7d8(0x106)]};},async 'execute'(_0x86e8e1){const _0x13ba4d=a185_0x4c194e,_0x11fa6e=loadSqlProjectConfig(_0x86e8e1['appCode']),{sqlName:_0x20ad94,dbId:_0x3c735b,dbName:_0x1971ff,mode:_0x1b3f0c}=await resolveSqlNewInputs(_0x86e8e1),_0x1131f4=generateSqlTemplate(_0x1b3f0c),_0x39917d=await createSqlQuery({'appCode':_0x86e8e1[_0x13ba4d(0x120)],'sqlName':_0x20ad94,'dbId':_0x3c735b,'sqlContent':_0x1131f4}),_0x27b4c7=ensureRemoteSqlContent(_0x39917d),_0x25cd2b=_0x1971ff||await getDbName(_0x86e8e1['appCode'],_0x3c735b)[_0x13ba4d(0x109)](()=>undefined),_0x12d5ae=buildSqlRelativePath(_0x39917d['sqlCode'],_0x39917d[_0x13ba4d(0x114)],_0x25cd2b,_0x1b3f0c,_0x3c735b),_0x198715=_0x11fa6e['sqlRootDir']+'/'+_0x12d5ae,_0x3e5049=buildLocalSqlFileContent({'sqlCode':_0x39917d[_0x13ba4d(0x10f)],'sqlName':_0x39917d[_0x13ba4d(0x114)],'dbId':_0x39917d['dbId']},_0x27b4c7,{'dbName':_0x25cd2b,'mode':_0x1b3f0c,'syncedAt':new Date()[_0x13ba4d(0x115)](),'description':_0x39917d[_0x13ba4d(0x108)]});if(await fileExists(_0x198715))throw CliErrors[_0x13ba4d(0xf5)](_0x13ba4d(0x118)+_0x198715);await ensureParentDirectory(_0x198715),await writeFile(_0x198715,_0x3e5049,_0x13ba4d(0x119));const _0x39d6be=await readSqlLockFile(_0x11fa6e[_0x13ba4d(0x11d)]),{lockData:_0x393baf,appLock:_0x34845f}=ensureSqlLockScope(_0x39d6be??createEmptySqlLock(),_0x11fa6e[_0x13ba4d(0x120)],_0x11fa6e['sqlRoot'],_0x13ba4d(0xfd));return _0x34845f[_0x13ba4d(0xe5)][_0x39917d[_0x13ba4d(0x10f)]]={...buildSqlLockEntry(_0x39917d,_0x27b4c7,computeSqlContentHash(_0x3e5049),{'dbName':_0x25cd2b}),'path':_0x12d5ae,'mode':_0x1b3f0c},_0x34845f[_0x13ba4d(0xee)]=new Date()[_0x13ba4d(0x115)](),await writeSqlLockFile(_0x11fa6e[_0x13ba4d(0x11d)],_0x393baf),{'ok':!![],'data':{'id':_0x39917d['id'],'sqlCode':_0x39917d[_0x13ba4d(0x10f)],'sqlName':_0x39917d['sqlName'],'dbId':_0x39917d['dbId'],'path':_0x198715,'mode':_0x1b3f0c},'message':_0x13ba4d(0x105)+_0x39917d[_0x13ba4d(0x10f)]};}};async function resolveSqlNewInputs(_0x101613){const _0x2d8313=await resolveSqlNameInput(_0x101613),{dbId:_0x3872b3,dbName:_0xfcfdf}=await resolveDbSelection(_0x101613),_0x552e67=await resolveSqlModeInput(_0x101613);return{'sqlName':_0x2d8313,'dbId':_0x3872b3,'dbName':_0xfcfdf,'mode':_0x552e67};}async function resolveSqlNameInput(_0x5b7b8c){const _0x499329=a185_0x4c194e,_0x18aa52=_0x5b7b8c[_0x499329(0x11e)](_0x499329(0xf4))['trim']();if(_0x18aa52)return _0x18aa52;if(_0x5b7b8c['nonInteractive'])throw CliErrors['flagMissing'](_0x499329(0xf4),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':'SQL\x20name:','validate':_0x3c6d78=>_0x3c6d78[_0x499329(0xe7)]()?!![]:_0x499329(0x117)}))[_0x499329(0xe7)]();}async function resolveDbSelection(_0x2a9dc0){const _0x5595fd=a185_0x4c194e,_0x45eed8=resolveProvidedDbId(_0x2a9dc0);if(typeof _0x45eed8===_0x5595fd(0x10e)&&Number['isFinite'](_0x45eed8)&&_0x45eed8>0x0)return{'dbId':_0x45eed8,'dbName':await getDbName(_0x2a9dc0[_0x5595fd(0x120)],_0x45eed8)[_0x5595fd(0x109)](()=>undefined)};if(_0x2a9dc0['nonInteractive'])throw CliErrors[_0x5595fd(0xf1)](_0x5595fd(0xf2),_0x5595fd(0xfb));const _0xe8ed5b=await listDatabases(_0x2a9dc0[_0x5595fd(0x120)])['catch'](()=>[]);if(_0xe8ed5b[_0x5595fd(0xfc)]===0x1)return{'dbId':_0xe8ed5b[0x0][_0x5595fd(0xef)],'dbName':_0xe8ed5b[0x0][_0x5595fd(0x10d)]};if(_0xe8ed5b[_0x5595fd(0xfc)]>0x1){const _0x226e67=await select({'message':_0x5595fd(0xea),'choices':[..._0xe8ed5b['map'](_0x25f823=>({'name':_0x25f823[_0x5595fd(0x10d)]+'\x20('+_0x25f823[_0x5595fd(0xef)]+')','value':serializeDbSelection(_0x25f823)})),{'name':'✎\x20Enter\x20dbId\x20manually','value':_0x5595fd(0x10c)}]});if(_0x226e67!==_0x5595fd(0x10c))return deserializeDbSelection(_0x226e67);}const _0x3b3f81=await input({'message':_0x5595fd(0x113),'validate':_0x4277cb=>{const _0x1af4b5=_0x5595fd,_0x365258=_0x4277cb[_0x1af4b5(0xe7)]();if(!_0x365258)return _0x1af4b5(0x101);const _0x4d5d24=Number(_0x365258);if(!Number[_0x1af4b5(0x107)](_0x4d5d24)||_0x4d5d24<=0x0)return _0x1af4b5(0x122);return!![];}});return{'dbId':Number(_0x3b3f81['trim']())};}async function resolveSqlModeInput(_0x187481){const _0x37045c=a185_0x4c194e,_0x439ac0=_0x187481[_0x37045c(0x11e)](_0x37045c(0xe6))['trim']();if(_0x439ac0===_0x37045c(0x116)||_0x439ac0===_0x37045c(0xf8))return _0x439ac0;if(_0x187481[_0x37045c(0x121)])throw CliErrors[_0x37045c(0xf1)](_0x37045c(0xe6),_0x37045c(0xf0));return await select({'message':_0x37045c(0xfe),'choices':[{'name':'Plain\x20SQL\x20(sql)','value':_0x37045c(0x116),'description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':_0x37045c(0xf3),'value':_0x37045c(0xf8),'description':_0x37045c(0x102)}]});}function serializeDbSelection(_0x4f692c){const _0x55c168=a185_0x4c194e;return JSON[_0x55c168(0xfa)]({'dbId':_0x4f692c[_0x55c168(0xef)],'dbName':_0x4f692c['dbName']});}function deserializeDbSelection(_0x4d8cc9){const _0x9913d7=a185_0x4c194e;try{const _0x5756ac=JSON[_0x9913d7(0x123)](_0x4d8cc9);if(typeof _0x5756ac['dbId']===_0x9913d7(0x10e)&&Number[_0x9913d7(0x11a)](_0x5756ac[_0x9913d7(0xef)]))return{'dbId':_0x5756ac['dbId'],'dbName':_0x5756ac[_0x9913d7(0x10d)]};}catch{}throw CliErrors[_0x9913d7(0xf5)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x4d8cc9);}function resolveProvidedDbId(_0x1da503){const _0x374a70=a185_0x4c194e,_0x3dcb31=_0x1da503['flag'](_0x374a70(0xf2));if(typeof _0x3dcb31===_0x374a70(0x10e)&&Number[_0x374a70(0x11a)](_0x3dcb31))return _0x3dcb31;return undefined;}
1
+ const a185_0x457397=a185_0x1823;(function(_0x330867,_0x3a8e84){const _0x15db39=a185_0x1823,_0x5dbd72=_0x330867();while(!![]){try{const _0x591371=-parseInt(_0x15db39(0x15e))/0x1+-parseInt(_0x15db39(0x158))/0x2+-parseInt(_0x15db39(0x17e))/0x3*(-parseInt(_0x15db39(0x163))/0x4)+-parseInt(_0x15db39(0x16a))/0x5*(-parseInt(_0x15db39(0x14f))/0x6)+parseInt(_0x15db39(0x167))/0x7*(-parseInt(_0x15db39(0x181))/0x8)+parseInt(_0x15db39(0x146))/0x9*(parseInt(_0x15db39(0x164))/0xa)+-parseInt(_0x15db39(0x17f))/0xb;if(_0x591371===_0x3a8e84)break;else _0x5dbd72['push'](_0x5dbd72['shift']());}catch(_0x4ec90f){_0x5dbd72['push'](_0x5dbd72['shift']());}}}(a185_0x2d78,0x4787e));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';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x2413ad){const _0xdb2d5a=a185_0x1823;if(_0x2413ad==='mybatisXml')return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0xdb2d5a(0x15c),_0xdb2d5a(0x147),'']['join']('\x0a');return[_0xdb2d5a(0x170),''][_0xdb2d5a(0x16f)]('\x0a');}export const sqlCreate={'service':a185_0x457397(0x149),'command':a185_0x457397(0x17a),'description':a185_0x457397(0x15a),'risk':a185_0x457397(0x165),'flags':[{'name':a185_0x457397(0x157),'type':a185_0x457397(0x169),'description':a185_0x457397(0x140)},{'name':a185_0x457397(0x176),'type':'number','description':a185_0x457397(0x171)},{'name':'mode','type':a185_0x457397(0x169),'enum':[a185_0x457397(0x149),'mybatisXml'],'description':a185_0x457397(0x17b)}],async 'validate'(_0x5d9b55){const _0x4fe34c=a185_0x457397;if(!_0x5d9b55[_0x4fe34c(0x150)])return;if(!_0x5d9b55['str']('name')[_0x4fe34c(0x16b)]())throw CliErrors[_0x4fe34c(0x16d)]('name',_0x4fe34c(0x178));const _0x1879bc=resolveProvidedDbId(_0x5d9b55);if(typeof _0x1879bc!==_0x4fe34c(0x161)||!Number[_0x4fe34c(0x148)](_0x1879bc)||_0x1879bc<=0x0)throw CliErrors['flagMissing'](_0x4fe34c(0x176),_0x4fe34c(0x14b));if(!_0x5d9b55[_0x4fe34c(0x159)]('mode')[_0x4fe34c(0x16b)]())throw CliErrors[_0x4fe34c(0x16d)](_0x4fe34c(0x180),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x40c745){const _0x5134de=a185_0x457397,_0x128a98=loadSqlProjectConfig(_0x40c745['appCode']),{sqlName:_0x38dad2,dbId:_0x2dcdde,dbName:_0x442028,mode:_0x2d345e}=await resolveSqlNewInputs(_0x40c745),_0x25e35a=buildSqlRelativePath('<server-generated-sqlCode>',_0x38dad2,_0x442028,_0x2d345e,_0x2dcdde),_0x1cd1c0=_0x128a98[_0x5134de(0x15f)]+'/'+_0x25e35a;return{'method':'POST','url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x40c745[_0x5134de(0x174)],'sqlName':_0x38dad2,'dbId':_0x2dcdde,'mode':_0x2d345e,'localPath':_0x1cd1c0},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x128a98[_0x5134de(0x15f)]};},async 'execute'(_0x1ae5f6){const _0x15bd31=a185_0x457397,_0x150bc6=loadSqlProjectConfig(_0x1ae5f6[_0x15bd31(0x174)]),{sqlName:_0x3043d5,dbId:_0x225040,dbName:_0x455f00,mode:_0x2f4f23}=await resolveSqlNewInputs(_0x1ae5f6),_0x703e80=generateSqlTemplate(_0x2f4f23),_0x5c085c=await createSqlQuery({'appCode':_0x1ae5f6[_0x15bd31(0x174)],'sqlName':_0x3043d5,'dbId':_0x225040,'sqlContent':_0x703e80}),_0x13d7ac=ensureRemoteSqlContent(_0x5c085c),_0x2044db=_0x455f00||await getDbName(_0x1ae5f6[_0x15bd31(0x174)],_0x225040)[_0x15bd31(0x145)](()=>undefined),_0x5db2b4=buildSqlRelativePath(_0x5c085c[_0x15bd31(0x141)],_0x5c085c[_0x15bd31(0x172)],_0x2044db,_0x2f4f23,_0x225040),_0x18f5be=_0x150bc6[_0x15bd31(0x15f)]+'/'+_0x5db2b4,_0x12641e=buildLocalSqlFileContent({'sqlCode':_0x5c085c[_0x15bd31(0x141)],'sqlName':_0x5c085c[_0x15bd31(0x172)],'dbId':_0x5c085c['dbId']},_0x13d7ac,{'dbName':_0x2044db,'mode':_0x2f4f23,'syncedAt':new Date()[_0x15bd31(0x16e)](),'description':_0x5c085c[_0x15bd31(0x144)]});if(await fileExists(_0x18f5be))throw CliErrors[_0x15bd31(0x182)](_0x15bd31(0x15d)+_0x18f5be);await ensureParentDirectory(_0x18f5be),await writeFile(_0x18f5be,_0x12641e,_0x15bd31(0x154));const _0x10f77a=await readSqlLockFile(_0x150bc6[_0x15bd31(0x17c)]),{lockData:_0x19416a,appLock:_0x2b11ea}=ensureSqlLockScope(_0x10f77a??createEmptySqlLock(),_0x150bc6['appCode'],_0x150bc6[_0x15bd31(0x142)],_0x15bd31(0x14c));return _0x2b11ea[_0x15bd31(0x14e)][_0x5c085c[_0x15bd31(0x141)]]={...buildSqlLockEntry(_0x5c085c,_0x13d7ac,computeSqlContentHash(_0x12641e),{'dbName':_0x2044db}),'path':_0x5db2b4,'mode':_0x2f4f23},_0x2b11ea[_0x15bd31(0x143)]=new Date()[_0x15bd31(0x16e)](),await writeSqlLockFile(_0x150bc6[_0x15bd31(0x17c)],_0x19416a),{'ok':!![],'data':{'id':_0x5c085c['id'],'sqlCode':_0x5c085c['sqlCode'],'sqlName':_0x5c085c[_0x15bd31(0x172)],'dbId':_0x5c085c[_0x15bd31(0x175)],'path':_0x18f5be,'mode':_0x2f4f23},'message':_0x15bd31(0x168)+_0x5c085c[_0x15bd31(0x141)]};}};async function resolveSqlNewInputs(_0x290592){const _0x1d399d=await resolveSqlNameInput(_0x290592),{dbId:_0x293ace,dbName:_0x133675}=await resolveDbSelection(_0x290592),_0x34ef92=await resolveSqlModeInput(_0x290592);return{'sqlName':_0x1d399d,'dbId':_0x293ace,'dbName':_0x133675,'mode':_0x34ef92};}async function resolveSqlNameInput(_0x43c169){const _0x3799bb=a185_0x457397,_0x593ef0=_0x43c169[_0x3799bb(0x159)](_0x3799bb(0x157))[_0x3799bb(0x16b)]();if(_0x593ef0)return _0x593ef0;if(_0x43c169['nonInteractive'])throw CliErrors[_0x3799bb(0x16d)](_0x3799bb(0x157),_0x3799bb(0x178));return(await input({'message':_0x3799bb(0x166),'validate':_0x5dc076=>_0x5dc076[_0x3799bb(0x16b)]()?!![]:_0x3799bb(0x160)}))['trim']();}async function resolveDbSelection(_0x58befc){const _0x9f8ca6=a185_0x457397,_0x530cd7=resolveProvidedDbId(_0x58befc);if(typeof _0x530cd7===_0x9f8ca6(0x161)&&Number[_0x9f8ca6(0x148)](_0x530cd7)&&_0x530cd7>0x0)return{'dbId':_0x530cd7,'dbName':await getDbName(_0x58befc[_0x9f8ca6(0x174)],_0x530cd7)[_0x9f8ca6(0x145)](()=>undefined)};if(_0x58befc[_0x9f8ca6(0x150)])throw CliErrors[_0x9f8ca6(0x16d)](_0x9f8ca6(0x176),_0x9f8ca6(0x14b));const _0x3775a4=await listDatabases(_0x58befc[_0x9f8ca6(0x174)])[_0x9f8ca6(0x145)](()=>[]);if(_0x3775a4[_0x9f8ca6(0x14d)]===0x1)return{'dbId':_0x3775a4[0x0][_0x9f8ca6(0x175)],'dbName':_0x3775a4[0x0]['dbName']};if(_0x3775a4[_0x9f8ca6(0x14d)]>0x1){const _0x48cd3e=await select({'message':_0x9f8ca6(0x15b),'choices':[..._0x3775a4[_0x9f8ca6(0x16c)](_0x44f265=>({'name':_0x44f265[_0x9f8ca6(0x179)]+'\x20('+_0x44f265['dbId']+')','value':serializeDbSelection(_0x44f265)})),{'name':'✎\x20Enter\x20dbId\x20manually','value':_0x9f8ca6(0x152)}]});if(_0x48cd3e!=='__manual__')return deserializeDbSelection(_0x48cd3e);}const _0x3b0cac=await input({'message':'Target\x20database\x20dbId:','validate':_0x2c1d4c=>{const _0xdbbbe9=_0x9f8ca6,_0x2df917=_0x2c1d4c[_0xdbbbe9(0x16b)]();if(!_0x2df917)return _0xdbbbe9(0x173);const _0x52b5bf=Number(_0x2df917);if(!Number['isInteger'](_0x52b5bf)||_0x52b5bf<=0x0)return _0xdbbbe9(0x14a);return!![];}});return{'dbId':Number(_0x3b0cac[_0x9f8ca6(0x16b)]())};}async function resolveSqlModeInput(_0x5273df){const _0x13d386=a185_0x457397,_0x2aa072=_0x5273df[_0x13d386(0x159)](_0x13d386(0x180))[_0x13d386(0x16b)]();if(_0x2aa072===_0x13d386(0x149)||_0x2aa072===_0x13d386(0x153))return _0x2aa072;if(_0x5273df['nonInteractive'])throw CliErrors[_0x13d386(0x16d)](_0x13d386(0x180),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x13d386(0x177),'choices':[{'name':_0x13d386(0x13e),'value':_0x13d386(0x149),'description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':_0x13d386(0x156),'value':'mybatisXml','description':_0x13d386(0x155)}]});}function serializeDbSelection(_0x1870cc){const _0x4df4a1=a185_0x457397;return JSON[_0x4df4a1(0x151)]({'dbId':_0x1870cc[_0x4df4a1(0x175)],'dbName':_0x1870cc['dbName']});}function a185_0x2d78(){const _0x559090=['SQL\x20query\x20display\x20name','sqlCode','sqlRoot','lastSync','description','catch','261693CkUnVs','</select>','isFinite','sql','dbId\x20must\x20be\x20a\x20positive\x20integer','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','new','length','sqls','18762DIyZul','nonInteractive','stringify','__manual__','mybatisXml','utf8','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','MyBatis\x20XML\x20(mybatisXml)','name','482978StMMix','str','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Select\x20the\x20target\x20database:','\x20\x20SELECT\x201\x20AS\x20id','File\x20already\x20exists:\x20','320915vKTQqR','sqlRootDir','SQL\x20name\x20cannot\x20be\x20empty','number','flag','304mjXrsD','170SwuASI','write','SQL\x20name:','35077iIzNPz','Created\x20SQL\x20query\x20','string','935cQQmdJ','trim','map','flagMissing','toISOString','join','SELECT\x201\x20AS\x20id;','Target\x20database\x20ID','sqlName','dbId\x20cannot\x20be\x20empty','appCode','dbId','db-id','Select\x20the\x20local\x20SQL\x20mode:','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','dbName','create','Local\x20SQL\x20file\x20mode','lockFilePath','Invalid\x20database\x20selection\x20payload:\x20','8013KnBIVk','2323057PqZlwl','mode','344bjtkKO','validation','Plain\x20SQL\x20(sql)','parse'];a185_0x2d78=function(){return _0x559090;};return a185_0x2d78();}function a185_0x1823(_0x2cafd5,_0x375de1){_0x2cafd5=_0x2cafd5-0x13e;const _0x2d78e1=a185_0x2d78();let _0x1823e7=_0x2d78e1[_0x2cafd5];return _0x1823e7;}function deserializeDbSelection(_0x4b0ae1){const _0x3e15a0=a185_0x457397;try{const _0x5296ba=JSON[_0x3e15a0(0x13f)](_0x4b0ae1);if(typeof _0x5296ba[_0x3e15a0(0x175)]===_0x3e15a0(0x161)&&Number[_0x3e15a0(0x148)](_0x5296ba[_0x3e15a0(0x175)]))return{'dbId':_0x5296ba['dbId'],'dbName':_0x5296ba[_0x3e15a0(0x179)]};}catch{}throw CliErrors[_0x3e15a0(0x182)](_0x3e15a0(0x17d)+_0x4b0ae1);}function resolveProvidedDbId(_0x1960c4){const _0x154ce0=a185_0x457397,_0x259c95=_0x1960c4[_0x154ce0(0x162)](_0x154ce0(0x176));if(typeof _0x259c95==='number'&&Number[_0x154ce0(0x148)](_0x259c95))return _0x259c95;return undefined;}
@@ -1 +1 @@
1
- const a186_0x569b8a=a186_0xfac1;(function(_0xf66fd4,_0xd2764d){const _0x896c93=a186_0xfac1,_0x50e036=_0xf66fd4();while(!![]){try{const _0x3da566=parseInt(_0x896c93(0x103))/0x1*(parseInt(_0x896c93(0x107))/0x2)+parseInt(_0x896c93(0xfe))/0x3*(-parseInt(_0x896c93(0x115))/0x4)+parseInt(_0x896c93(0x119))/0x5*(-parseInt(_0x896c93(0x11e))/0x6)+parseInt(_0x896c93(0x116))/0x7+-parseInt(_0x896c93(0xf9))/0x8*(-parseInt(_0x896c93(0x11c))/0x9)+-parseInt(_0x896c93(0x102))/0xa+-parseInt(_0x896c93(0x10d))/0xb*(parseInt(_0x896c93(0x108))/0xc);if(_0x3da566===_0xd2764d)break;else _0x50e036['push'](_0x50e036['shift']());}catch(_0x1a46df){_0x50e036['push'](_0x50e036['shift']());}}}(a186_0xaac8,0x39de0));function a186_0xfac1(_0x28097b,_0x54d49e){_0x28097b=_0x28097b-0xf9;const _0xaac8e8=a186_0xaac8();let _0xfac1d7=_0xaac8e8[_0x28097b];return _0xfac1d7;}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';function a186_0xaac8(){const _0x21f7c2=['3574360AsjYUH','201211WewjnU','replace','filter','sqlcode','2NznaXT','156lgvhwt','length','delete','trashDir','startsWith','74437VyazLP','\x20(local\x20file\x20moved\x20to\x20trash)','projectRoot','high-risk-write','SQL\x20lock\x20file\x20not\x20found.','sqlRoot','str','POST','96XhtHWq','2059771GxwkHW','lockFilePath','fromEntries','217015PmwYPK','Deleted\x20','remoteId','114318GEWInh','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','6BzIrzD','sqlRootDir','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','152iLfTVi','lastSync','entries','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','sqls','1371AGHCnz','appCode','toISOString','validation'];a186_0xaac8=function(){return _0x21f7c2;};return a186_0xaac8();}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':a186_0x569b8a(0x10a),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a186_0x569b8a(0x110),'flags':[SQLCODE_FLAG],async 'validate'(_0x1e7049){const _0x2e2874=a186_0x569b8a,_0xb5c29=loadSqlProjectConfig(_0x1e7049[_0x2e2874(0xff)]),_0x52a788=await readSqlLockFile(_0xb5c29['lockFilePath']);if(!_0x52a788)throw CliErrors[_0x2e2874(0x101)](_0x2e2874(0x120));},async 'dryRun'(_0x5201b7){const _0x2e2c7c=a186_0x569b8a,_0xd65c8f=loadSqlProjectConfig(_0x5201b7[_0x2e2c7c(0xff)]),_0x32a351=await readSqlLockFile(_0xd65c8f[_0x2e2c7c(0x117)]);if(!_0x32a351)throw CliErrors[_0x2e2c7c(0x101)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x7773e4}=ensureSqlLockScope(_0x32a351,_0x5201b7['appCode'],_0xd65c8f[_0x2e2c7c(0x112)],_0x2e2c7c(0x10a)),_0x1cde72=_0x5201b7['str']('sqlcode'),_0x4fd4d2=_0x7773e4['sqls'][_0x1cde72];if(!_0x4fd4d2)throw CliErrors[_0x2e2c7c(0x101)](_0x2e2c7c(0x11d)+_0x1cde72+'\x22.');return{'method':_0x2e2c7c(0x114),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x1cde72,'id':_0x4fd4d2[_0x2e2c7c(0x11b)],'localPath':resolveLocalSqlFilePath(_0xd65c8f,_0x1cde72,_0x4fd4d2)},'description':'Would\x20delete\x20SQL\x20'+_0x1cde72+_0x2e2c7c(0xfc)+_0xd65c8f['trashDir']};},async 'execute'(_0x23dc22){const _0x59a65a=a186_0x569b8a,_0x45e452=loadSqlProjectConfig(_0x23dc22[_0x59a65a(0xff)]),_0x19276c=await readSqlLockFile(_0x45e452[_0x59a65a(0x117)]);if(!_0x19276c)throw CliErrors['validation'](_0x59a65a(0x111));const {lockData:_0x3e41da,appLock:_0x50a006}=ensureSqlLockScope(_0x19276c,_0x23dc22[_0x59a65a(0xff)],_0x45e452[_0x59a65a(0x112)],'delete'),_0x36cda5=_0x23dc22[_0x59a65a(0x113)](_0x59a65a(0x106)),_0x53d2f8=_0x50a006['sqls'][_0x36cda5];if(!_0x53d2f8)throw CliErrors['validation'](_0x59a65a(0x11d)+_0x36cda5+'\x22.');await deleteSqlQuery({'id':_0x53d2f8[_0x59a65a(0x11b)],'sqlCode':_0x36cda5}),_0x50a006[_0x59a65a(0xfd)]=Object[_0x59a65a(0x118)](Object[_0x59a65a(0xfb)](_0x50a006['sqls'])[_0x59a65a(0x105)](([_0x1b1fc7])=>_0x1b1fc7!==_0x36cda5)),_0x50a006[_0x59a65a(0xfa)]=new Date()[_0x59a65a(0x100)](),await writeSqlLockFile(_0x45e452[_0x59a65a(0x117)],_0x3e41da);const _0x6c40a7=resolveLocalSqlFilePath(_0x45e452,_0x36cda5,_0x53d2f8);let _0x41024c;await fileExists(_0x6c40a7)&&(_0x41024c=await moveToTrash(_0x45e452[_0x59a65a(0x10f)],_0x45e452[_0x59a65a(0x10b)],_0x6c40a7),await cleanupEmptyDirectories(dirname(_0x6c40a7),_0x45e452[_0x59a65a(0x11f)]));const _0x43667d={'deleted':_0x36cda5,'remoteId':_0x53d2f8[_0x59a65a(0x11b)]};if(_0x41024c)_0x43667d['trashedTo']=_0x41024c;return{'ok':!![],'data':_0x43667d,'message':_0x59a65a(0x11a)+_0x36cda5+(_0x41024c?_0x59a65a(0x10e):'')};}};async function moveToTrash(_0x5601ce,_0x10f736,_0x516e53){const _0x24f5df=a186_0x569b8a,_0x4de2f4=new Date()[_0x24f5df(0x100)]()[_0x24f5df(0x104)](/[:.]/g,'-'),_0x886279=relative(_0x5601ce,_0x516e53),_0x38bc57=join(_0x10f736,_0x4de2f4,_0x886279);return await mkdir(dirname(_0x38bc57),{'recursive':!![]}),await rename(_0x516e53,_0x38bc57),_0x38bc57;}async function cleanupEmptyDirectories(_0x13037c,_0x161fe1){const _0x19ed79=a186_0x569b8a;let _0x3c4df8=resolve(_0x13037c);const _0x17d792=resolve(_0x161fe1);while(_0x3c4df8[_0x19ed79(0x10c)](''+_0x17d792+sep)||_0x3c4df8===_0x17d792){if(_0x3c4df8===_0x17d792)return;try{const _0x225a87=await readdir(_0x3c4df8);if(_0x225a87[_0x19ed79(0x109)]>0x0)return;await rmdir(_0x3c4df8);}catch{return;}_0x3c4df8=dirname(_0x3c4df8);}}
1
+ function a186_0x37de(_0x2566ce,_0x6e314a){_0x2566ce=_0x2566ce-0x96;const _0x17bbe1=a186_0x17bb();let _0x37de20=_0x17bbe1[_0x2566ce];return _0x37de20;}const a186_0x26778f=a186_0x37de;(function(_0x575aba,_0x3f123f){const _0x4b2c30=a186_0x37de,_0x208100=_0x575aba();while(!![]){try{const _0x3fd963=parseInt(_0x4b2c30(0xb1))/0x1+parseInt(_0x4b2c30(0x96))/0x2+parseInt(_0x4b2c30(0xa5))/0x3*(-parseInt(_0x4b2c30(0x9b))/0x4)+-parseInt(_0x4b2c30(0x98))/0x5+-parseInt(_0x4b2c30(0xa4))/0x6+parseInt(_0x4b2c30(0xaa))/0x7*(parseInt(_0x4b2c30(0xb4))/0x8)+parseInt(_0x4b2c30(0xb3))/0x9*(-parseInt(_0x4b2c30(0xa3))/0xa);if(_0x3fd963===_0x3f123f)break;else _0x208100['push'](_0x208100['shift']());}catch(_0x2e0423){_0x208100['push'](_0x208100['shift']());}}}(a186_0x17bb,0x6fa79));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';function a186_0x17bb(){const _0x383df7=['sql','str','toISOString','322373UYlUui','validation','3179871fHNirC','6516248PCEJmW','filter','length','remoteId','trashedTo','472094OqzRXU','entries','1464200adOuUf','replace','sqlRoot','8mhYauY','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','Deleted\x20','POST','sqlRootDir','sqlcode','lockFilePath','appCode','10xDgtiV','1470798QzGAhr','36483BsRreJ','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','projectRoot','delete','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','7ERIyxW','startsWith','sqls','trashDir'];a186_0x17bb=function(){return _0x383df7;};return a186_0x17bb();}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_0x26778f(0xae),'command':a186_0x26778f(0xa8),'description':a186_0x26778f(0xa9),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x93c4b7){const _0x1ba423=a186_0x26778f,_0xf610de=loadSqlProjectConfig(_0x93c4b7[_0x1ba423(0xa2)]),_0x59f04a=await readSqlLockFile(_0xf610de[_0x1ba423(0xa1)]);if(!_0x59f04a)throw CliErrors['validation'](_0x1ba423(0xa6));},async 'dryRun'(_0x2169bb){const _0x355f9a=a186_0x26778f,_0x52814d=loadSqlProjectConfig(_0x2169bb[_0x355f9a(0xa2)]),_0x45b89e=await readSqlLockFile(_0x52814d[_0x355f9a(0xa1)]);if(!_0x45b89e)throw CliErrors[_0x355f9a(0xb2)](_0x355f9a(0xa6));const {appLock:_0x5bd1e0}=ensureSqlLockScope(_0x45b89e,_0x2169bb[_0x355f9a(0xa2)],_0x52814d[_0x355f9a(0x9a)],_0x355f9a(0xa8)),_0x32317f=_0x2169bb[_0x355f9a(0xaf)](_0x355f9a(0xa0)),_0x35bc67=_0x5bd1e0[_0x355f9a(0xac)][_0x32317f];if(!_0x35bc67)throw CliErrors[_0x355f9a(0xb2)](_0x355f9a(0x9c)+_0x32317f+'\x22.');return{'method':_0x355f9a(0x9e),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x32317f,'id':_0x35bc67['remoteId'],'localPath':resolveLocalSqlFilePath(_0x52814d,_0x32317f,_0x35bc67)},'description':'Would\x20delete\x20SQL\x20'+_0x32317f+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x52814d[_0x355f9a(0xad)]};},async 'execute'(_0x23834d){const _0x580758=a186_0x26778f,_0x1f5268=loadSqlProjectConfig(_0x23834d[_0x580758(0xa2)]),_0x5da37a=await readSqlLockFile(_0x1f5268[_0x580758(0xa1)]);if(!_0x5da37a)throw CliErrors[_0x580758(0xb2)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x2cafb0,appLock:_0x2f2345}=ensureSqlLockScope(_0x5da37a,_0x23834d[_0x580758(0xa2)],_0x1f5268['sqlRoot'],'delete'),_0x3c868e=_0x23834d[_0x580758(0xaf)]('sqlcode'),_0x2440a2=_0x2f2345[_0x580758(0xac)][_0x3c868e];if(!_0x2440a2)throw CliErrors['validation'](_0x580758(0x9c)+_0x3c868e+'\x22.');await deleteSqlQuery({'id':_0x2440a2[_0x580758(0xb7)],'sqlCode':_0x3c868e}),_0x2f2345['sqls']=Object['fromEntries'](Object[_0x580758(0x97)](_0x2f2345[_0x580758(0xac)])[_0x580758(0xb5)](([_0x22e129])=>_0x22e129!==_0x3c868e)),_0x2f2345['lastSync']=new Date()[_0x580758(0xb0)](),await writeSqlLockFile(_0x1f5268[_0x580758(0xa1)],_0x2cafb0);const _0x55674c=resolveLocalSqlFilePath(_0x1f5268,_0x3c868e,_0x2440a2);let _0x271572;await fileExists(_0x55674c)&&(_0x271572=await moveToTrash(_0x1f5268[_0x580758(0xa7)],_0x1f5268['trashDir'],_0x55674c),await cleanupEmptyDirectories(dirname(_0x55674c),_0x1f5268[_0x580758(0x9f)]));const _0x50e955={'deleted':_0x3c868e,'remoteId':_0x2440a2[_0x580758(0xb7)]};if(_0x271572)_0x50e955[_0x580758(0xb8)]=_0x271572;return{'ok':!![],'data':_0x50e955,'message':_0x580758(0x9d)+_0x3c868e+(_0x271572?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x1fb8cc,_0x43caa8,_0x3ca563){const _0x25b7d1=a186_0x26778f,_0x30e504=new Date()[_0x25b7d1(0xb0)]()[_0x25b7d1(0x99)](/[:.]/g,'-'),_0x6c099=relative(_0x1fb8cc,_0x3ca563),_0x3e79e4=join(_0x43caa8,_0x30e504,_0x6c099);return await mkdir(dirname(_0x3e79e4),{'recursive':!![]}),await rename(_0x3ca563,_0x3e79e4),_0x3e79e4;}async function cleanupEmptyDirectories(_0x1c7da5,_0x3bae9b){const _0x2b2c70=a186_0x26778f;let _0x7474d8=resolve(_0x1c7da5);const _0x55dfd3=resolve(_0x3bae9b);while(_0x7474d8[_0x2b2c70(0xab)](''+_0x55dfd3+sep)||_0x7474d8===_0x55dfd3){if(_0x7474d8===_0x55dfd3)return;try{const _0xe5e9a2=await readdir(_0x7474d8);if(_0xe5e9a2[_0x2b2c70(0xb6)]>0x0)return;await rmdir(_0x7474d8);}catch{return;}_0x7474d8=dirname(_0x7474d8);}}
@@ -1 +1 @@
1
- const a187_0x4952e9=a187_0x3476;function a187_0x3476(_0x1e0b8f,_0x41e93a){_0x1e0b8f=_0x1e0b8f-0x1cb;const _0xf5b9b4=a187_0xf5b9();let _0x34769d=_0xf5b9b4[_0x1e0b8f];return _0x34769d;}function a187_0xf5b9(){const _0x174e84=['1312NRjjoI','dbId','description','161565NExMtf','4228248JDWrOt','190775hFMCiz','sqlcode','sqlContent','verbose','appCode','str','798398UzgUPP','4781187qnILUG','read','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','60sReaSO','sql','238646iwpNek','sqlName','boolean','Return\x20full\x20raw\x20SQL\x20query\x20object','98wBwOwi','bool'];a187_0xf5b9=function(){return _0x174e84;};return a187_0xf5b9();}(function(_0x1f6d45,_0x511db3){const _0x30c734=a187_0x3476,_0x12e96d=_0x1f6d45();while(!![]){try{const _0x53051f=parseInt(_0x30c734(0x1cd))/0x1+-parseInt(_0x30c734(0x1de))/0x2+parseInt(_0x30c734(0x1d6))/0x3*(parseInt(_0x30c734(0x1cb))/0x4)+-parseInt(_0x30c734(0x1d8))/0x5+-parseInt(_0x30c734(0x1d7))/0x6+-parseInt(_0x30c734(0x1d1))/0x7*(-parseInt(_0x30c734(0x1d3))/0x8)+parseInt(_0x30c734(0x1df))/0x9;if(_0x53051f===_0x511db3)break;else _0x12e96d['push'](_0x12e96d['shift']());}catch(_0x10eee2){_0x12e96d['push'](_0x12e96d['shift']());}}}(a187_0xf5b9,0x6aebc));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_0x4952e9(0x1cc),'command':'detail','description':a187_0x4952e9(0x1e1),'risk':a187_0x4952e9(0x1e0),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a187_0x4952e9(0x1cf),'description':a187_0x4952e9(0x1d0)}],async 'execute'(_0x1d65aa){const _0x211a27=a187_0x4952e9,_0x4e141=await getSqlQueryInfo(_0x1d65aa[_0x211a27(0x1dc)],_0x1d65aa[_0x211a27(0x1dd)](_0x211a27(0x1d9))),_0x19cb4f=_0x1d65aa[_0x211a27(0x1d2)](_0x211a27(0x1db));if(_0x19cb4f)return{'ok':!![],'data':_0x4e141};const _0x4e7745=_0x4e141[_0x211a27(0x1d4)]?await getDbName(_0x1d65aa['appCode'],_0x4e141[_0x211a27(0x1d4)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x4e141['sqlCode'],'sqlName':_0x4e141[_0x211a27(0x1ce)],'db':_0x4e7745?_0x4e7745+'\x20('+_0x4e141[_0x211a27(0x1d4)]+')':_0x4e141[_0x211a27(0x1d4)]??'','description':_0x4e141[_0x211a27(0x1d5)]??'','sqlContent':_0x4e141[_0x211a27(0x1da)]??''}};}};
1
+ const a187_0x424a89=a187_0x5629;function a187_0x5629(_0x278ab5,_0xb87336){_0x278ab5=_0x278ab5-0x8f;const _0x540e8d=a187_0x540e();let _0x5629d5=_0x540e8d[_0x278ab5];return _0x5629d5;}function a187_0x540e(){const _0x1697a9=['Return\x20full\x20raw\x20SQL\x20query\x20object','detail','sqlName','59474fbwsry','169593bJGxDM','sql','str','sqlcode','346040whNDmi','appCode','boolean','dbId','verbose','198lMOioO','9416oYZnUo','4977JWpUuH','3489110Mkwhby','795463xGOlBn','bool','12qZTTWP','sqlCode','4598760XYsCHc'];a187_0x540e=function(){return _0x1697a9;};return a187_0x540e();}(function(_0x28776f,_0x554fc9){const _0xaa07ec=a187_0x5629,_0x2628ee=_0x28776f();while(!![]){try{const _0x527632=parseInt(_0xaa07ec(0xa0))/0x1+-parseInt(_0xaa07ec(0x92))/0x2+-parseInt(_0xaa07ec(0x93))/0x3*(parseInt(_0xaa07ec(0xa2))/0x4)+parseInt(_0xaa07ec(0x9f))/0x5+-parseInt(_0xaa07ec(0xa4))/0x6+-parseInt(_0xaa07ec(0x9e))/0x7*(parseInt(_0xaa07ec(0x9d))/0x8)+-parseInt(_0xaa07ec(0x9c))/0x9*(-parseInt(_0xaa07ec(0x97))/0xa);if(_0x527632===_0x554fc9)break;else _0x2628ee['push'](_0x2628ee['shift']());}catch(_0x26c609){_0x2628ee['push'](_0x2628ee['shift']());}}}(a187_0x540e,0x6e560));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_0x424a89(0x94),'command':a187_0x424a89(0x90),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':'read','flags':[SQLCODE_FLAG,{'name':a187_0x424a89(0x9b),'type':a187_0x424a89(0x99),'description':a187_0x424a89(0x8f)}],async 'execute'(_0x37584f){const _0x4f058b=a187_0x424a89,_0x3e1d46=await getSqlQueryInfo(_0x37584f[_0x4f058b(0x98)],_0x37584f[_0x4f058b(0x95)](_0x4f058b(0x96))),_0x574e21=_0x37584f[_0x4f058b(0xa1)](_0x4f058b(0x9b));if(_0x574e21)return{'ok':!![],'data':_0x3e1d46};const _0x51d680=_0x3e1d46[_0x4f058b(0x9a)]?await getDbName(_0x37584f[_0x4f058b(0x98)],_0x3e1d46[_0x4f058b(0x9a)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x3e1d46[_0x4f058b(0xa3)],'sqlName':_0x3e1d46[_0x4f058b(0x91)],'db':_0x51d680?_0x51d680+'\x20('+_0x3e1d46[_0x4f058b(0x9a)]+')':_0x3e1d46[_0x4f058b(0x9a)]??'','description':_0x3e1d46['description']??'','sqlContent':_0x3e1d46['sqlContent']??''}};}};
@@ -1 +1 @@
1
- const a188_0x288217=a188_0x1838;(function(_0x264916,_0x5d3d4a){const _0x4cdd69=a188_0x1838,_0x24e202=_0x264916();while(!![]){try{const _0x1e1300=-parseInt(_0x4cdd69(0x1a9))/0x1+-parseInt(_0x4cdd69(0x1b0))/0x2+parseInt(_0x4cdd69(0x1ad))/0x3*(parseInt(_0x4cdd69(0x1a4))/0x4)+parseInt(_0x4cdd69(0x1a1))/0x5*(-parseInt(_0x4cdd69(0x1b4))/0x6)+-parseInt(_0x4cdd69(0x1a8))/0x7+-parseInt(_0x4cdd69(0x19e))/0x8*(-parseInt(_0x4cdd69(0x1ac))/0x9)+parseInt(_0x4cdd69(0x1a3))/0xa;if(_0x1e1300===_0x5d3d4a)break;else _0x24e202['push'](_0x24e202['shift']());}catch(_0x4bd7d1){_0x24e202['push'](_0x24e202['shift']());}}}(a188_0x38e6,0x5ba52));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a188_0x1838(_0x49bca0,_0x555d11){_0x49bca0=_0x49bca0-0x19d;const _0x38e6b0=a188_0x38e6();let _0x183816=_0x38e6b0[_0x49bca0];return _0x183816;}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a188_0x288217(0x1a7),'command':a188_0x288217(0x1af),'description':a188_0x288217(0x1b1),'risk':a188_0x288217(0x1b6),'flags':[SQLCODE_FLAG,{'name':a188_0x288217(0x1b5),'type':a188_0x288217(0x1aa),'description':a188_0x288217(0x1ae)}],async 'execute'(_0x570b96){const _0x15f858=a188_0x288217,_0x210905=parseJsonParams(_0x570b96[_0x15f858(0x1a5)](_0x15f858(0x1b5))),_0x35bd87=Date[_0x15f858(0x1a2)](),_0x45d0cf=await executeSql(_0x570b96[_0x15f858(0x1a6)],_0x570b96['str']('sqlcode'),_0x210905),_0x5f44cd=Date['now']()-_0x35bd87,_0x574dca=_0x45d0cf?.[_0x15f858(0x1a0)]??_0x45d0cf,_0x16912b=_0x45d0cf?.[_0x15f858(0x1b2)]??!![];if(!_0x16912b)return{'ok':![],'data':{'error':_0x45d0cf?.['execError']||_0x15f858(0x1ab),'elapsed':_0x5f44cd},'message':'SQL\x20execution\x20failed'};const _0x378e49=Array[_0x15f858(0x19f)](_0x574dca)?_0x574dca:[];return{'ok':!![],'data':{'rows':_0x378e49,'rowCount':_0x378e49[_0x15f858(0x1b3)],'elapsed':_0x5f44cd},'message':_0x15f858(0x19d)+_0x378e49['length']+'\x20row(s)\x20in\x20'+_0x5f44cd+'ms'};}};function a188_0x38e6(){const _0x8a3489=['129729lCOgDK','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','exec','294358GhzHmZ','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','execSuccess','length','2720760hhCTeL','params','read','Returned\x20','1208968SfAqbx','isArray','execResult','5CyaLsg','now','15947610ZfQAsd','4otzYxz','str','appCode','sql','537691JopjNt','736295GGqsHI','string','SQL\x20execution\x20failed','9rDzBhq'];a188_0x38e6=function(){return _0x8a3489;};return a188_0x38e6();}
1
+ const a188_0x4e226d=a188_0x3b50;(function(_0x2ae646,_0x2ddf73){const _0x1fe714=a188_0x3b50,_0x4570ab=_0x2ae646();while(!![]){try{const _0x53ce5b=-parseInt(_0x1fe714(0x196))/0x1*(parseInt(_0x1fe714(0x1a1))/0x2)+parseInt(_0x1fe714(0x18e))/0x3+-parseInt(_0x1fe714(0x18c))/0x4*(parseInt(_0x1fe714(0x192))/0x5)+-parseInt(_0x1fe714(0x194))/0x6*(parseInt(_0x1fe714(0x189))/0x7)+-parseInt(_0x1fe714(0x195))/0x8*(parseInt(_0x1fe714(0x19d))/0x9)+parseInt(_0x1fe714(0x197))/0xa+parseInt(_0x1fe714(0x190))/0xb;if(_0x53ce5b===_0x2ddf73)break;else _0x4570ab['push'](_0x4570ab['shift']());}catch(_0x14dd73){_0x4570ab['push'](_0x4570ab['shift']());}}}(a188_0x5d37,0xe6bfd));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a188_0x5d37(){const _0x3f20a2=['SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','isArray','10720881EAZVfi','SQL\x20execution\x20failed','\x20row(s)\x20in\x20','Returned\x20','12418iRKBnw','execSuccess','sqlcode','11948153SHEtSA','params','appCode','143492mAdPQg','string','5013228vlBVzU','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','34573407PzMpFL','execResult','145dinTBE','sql','6euNbsh','8iFzjKD','151ZMpNWl','10070000sqccBp','str','length','execError'];a188_0x5d37=function(){return _0x3f20a2;};return a188_0x5d37();}function a188_0x3b50(_0x29bec6,_0xa956e1){_0x29bec6=_0x29bec6-0x187;const _0x5d3748=a188_0x5d37();let _0x3b5038=_0x5d3748[_0x29bec6];return _0x3b5038;}export const sqlExec={'service':a188_0x4e226d(0x193),'command':'exec','description':a188_0x4e226d(0x18f),'risk':'read','flags':[SQLCODE_FLAG,{'name':a188_0x4e226d(0x18a),'type':a188_0x4e226d(0x18d),'description':a188_0x4e226d(0x19b)}],async 'execute'(_0x17a6a8){const _0x2e947e=a188_0x4e226d,_0x529e00=parseJsonParams(_0x17a6a8[_0x2e947e(0x198)](_0x2e947e(0x18a))),_0x43b206=Date['now'](),_0x49e40f=await executeSql(_0x17a6a8[_0x2e947e(0x18b)],_0x17a6a8[_0x2e947e(0x198)](_0x2e947e(0x188)),_0x529e00),_0x8cd90d=Date['now']()-_0x43b206,_0x445e82=_0x49e40f?.[_0x2e947e(0x191)]??_0x49e40f,_0x149ec5=_0x49e40f?.[_0x2e947e(0x187)]??!![];if(!_0x149ec5)return{'ok':![],'data':{'error':_0x49e40f?.[_0x2e947e(0x19a)]||_0x2e947e(0x19e),'elapsed':_0x8cd90d},'message':_0x2e947e(0x19e)};const _0x1128f3=Array[_0x2e947e(0x19c)](_0x445e82)?_0x445e82:[];return{'ok':!![],'data':{'rows':_0x1128f3,'rowCount':_0x1128f3[_0x2e947e(0x199)],'elapsed':_0x8cd90d},'message':_0x2e947e(0x1a0)+_0x1128f3[_0x2e947e(0x199)]+_0x2e947e(0x19f)+_0x8cd90d+'ms'};}};
@@ -1 +1 @@
1
- function a189_0x198f(){const _0x1f556a=['2351682CbJgDd','31246780pmETFR','5100ZZnlYe','2141385NKHckK','6825ifDaQy','9htiUuM','3317564jAcjEW','3130360iqFZtL','172902zBCwNm','2ZdmHma'];a189_0x198f=function(){return _0x1f556a;};return a189_0x198f();}(function(_0x32e1b1,_0x5201b9){const _0xfd8c9a=a189_0x4de6,_0x35d496=_0x32e1b1();while(!![]){try{const _0x42f51c=-parseInt(_0xfd8c9a(0x1aa))/0x1*(parseInt(_0xfd8c9a(0x1a9))/0x2)+-parseInt(_0xfd8c9a(0x1ab))/0x3+-parseInt(_0xfd8c9a(0x1a7))/0x4+-parseInt(_0xfd8c9a(0x1ae))/0x5+-parseInt(_0xfd8c9a(0x1ad))/0x6*(parseInt(_0xfd8c9a(0x1af))/0x7)+-parseInt(_0xfd8c9a(0x1a8))/0x8*(-parseInt(_0xfd8c9a(0x1a6))/0x9)+parseInt(_0xfd8c9a(0x1ac))/0xa;if(_0x42f51c===_0x5201b9)break;else _0x35d496['push'](_0x35d496['shift']());}catch(_0x3f3b91){_0x35d496['push'](_0x35d496['shift']());}}}(a189_0x198f,0x736b7));import{sqlList}from'../../commands/sql/list.js';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';function a189_0x4de6(_0x1795bd,_0x1df4b6){_0x1795bd=_0x1795bd-0x1a6;const _0x198f6b=a189_0x198f();let _0x4de614=_0x198f6b[_0x1795bd];return _0x4de614;}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 a189_0x5832(){const _0x5a69a2=['48IvSKZQ','316PwjrMq','161544bRKfUD','2058110oPGXux','72401QEnybY','1149ATVsDd','398142uOFBEF','365PiXzvy','3352CSkPJK','51121PqmFAq'];a189_0x5832=function(){return _0x5a69a2;};return a189_0x5832();}(function(_0x57d52f,_0x357db8){const _0x34ad15=a189_0x578f,_0x5db901=_0x57d52f();while(!![]){try{const _0x1d2b45=parseInt(_0x34ad15(0x1d2))/0x1+-parseInt(_0x34ad15(0x1d4))/0x2*(parseInt(_0x34ad15(0x1ce))/0x3)+-parseInt(_0x34ad15(0x1d1))/0x4*(parseInt(_0x34ad15(0x1d0))/0x5)+-parseInt(_0x34ad15(0x1d3))/0x6*(-parseInt(_0x34ad15(0x1d7))/0x7)+-parseInt(_0x34ad15(0x1d5))/0x8+-parseInt(_0x34ad15(0x1cf))/0x9+parseInt(_0x34ad15(0x1d6))/0xa;if(_0x1d2b45===_0x357db8)break;else _0x5db901['push'](_0x5db901['shift']());}catch(_0x3fef89){_0x5db901['push'](_0x5db901['shift']());}}}(a189_0x5832,0x257d5));import{sqlList}from'../../commands/sql/list.js';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';function a189_0x578f(_0x44097e,_0x4b38e5){_0x44097e=_0x44097e-0x1ce;const _0x5832f6=a189_0x5832();let _0x578fd9=_0x5832f6[_0x44097e];return _0x578fd9;}export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a190_0xff3f32=a190_0x41e4;(function(_0x27878e,_0x75aafc){const _0x417d6a=a190_0x41e4,_0x55affa=_0x27878e();while(!![]){try{const _0x1b495b=-parseInt(_0x417d6a(0x1b0))/0x1*(-parseInt(_0x417d6a(0x1b4))/0x2)+parseInt(_0x417d6a(0x1c5))/0x3+parseInt(_0x417d6a(0x1aa))/0x4*(parseInt(_0x417d6a(0x1ad))/0x5)+-parseInt(_0x417d6a(0x1c1))/0x6*(parseInt(_0x417d6a(0x1a9))/0x7)+-parseInt(_0x417d6a(0x1a6))/0x8+parseInt(_0x417d6a(0x1a5))/0x9+-parseInt(_0x417d6a(0x1ae))/0xa;if(_0x1b495b===_0x75aafc)break;else _0x55affa['push'](_0x55affa['shift']());}catch(_0x1b5214){_0x55affa['push'](_0x55affa['shift']());}}}(a190_0x5be5,0x6c9ca));function a190_0x5be5(){const _0x5be4b3=['bool','totalCount','list','sql','string','read','18fMJfYh','str','page','\x20SQL\x20queries\x20(total:\x20','1358805CciKny','verbose','Page\x20size','List\x20custom\x20SQL\x20queries','sqlName','boolean','3615084ZjDNph','2086824WyQHVp','paging','Found\x20','1492498bqsPfk','4AxuIOj','length','tableData','2026175jtGnLA','7686490sDMhDZ','sqlcode','3KwcJES','num','sqlCode','appCode','569448wGdKws','number','pagesize','name','map','dbId','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'];a190_0x5be5=function(){return _0x5be4b3;};return a190_0x5be5();}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a190_0x41e4(_0x48942b,_0x390ba3){_0x48942b=_0x48942b-0x1a5;const _0x5be56b=a190_0x5be5();let _0x41e422=_0x5be56b[_0x48942b];return _0x41e422;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a190_0xff3f32(0x1be),'command':a190_0xff3f32(0x1bd),'description':a190_0xff3f32(0x1c8),'risk':a190_0xff3f32(0x1c0),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a190_0xff3f32(0x1b7),'type':a190_0xff3f32(0x1bf),'description':'Filter\x20by\x20SQL\x20name'},{'name':a190_0xff3f32(0x1c3),'type':a190_0xff3f32(0x1b5),'description':'Page\x20number','default':0x1},{'name':a190_0xff3f32(0x1b6),'type':a190_0xff3f32(0x1b5),'description':a190_0xff3f32(0x1c7)},{'name':a190_0xff3f32(0x1c6),'type':a190_0xff3f32(0x1ca),'description':a190_0xff3f32(0x1ba)}],async 'execute'(_0x4d8f57){const _0x230673=a190_0xff3f32,_0x3d93b6=await listSqlQueries(_0x4d8f57[_0x230673(0x1b3)],{'sqlCode':_0x4d8f57['str'](_0x230673(0x1af))||undefined,'sqlName':_0x4d8f57[_0x230673(0x1c2)]('name')||undefined,'currentPage':_0x4d8f57[_0x230673(0x1b1)](_0x230673(0x1c3)),'pageSize':_0x4d8f57[_0x230673(0x1b1)]('pagesize',0x32)}),_0x365fa9=_0x4d8f57[_0x230673(0x1bb)]('verbose'),_0x5934bb=_0x3d93b6[_0x230673(0x1ac)]??[],_0x149c70=_0x3d93b6[_0x230673(0x1a7)]?.[_0x230673(0x1bc)]??_0x5934bb['length'];let _0x4f2fbc;return _0x365fa9?_0x4f2fbc=_0x5934bb:_0x4f2fbc=await Promise['all'](_0x5934bb[_0x230673(0x1b8)](async _0x5221d3=>{const _0x36cc11=_0x230673;let _0x4e887a;try{_0x4e887a=_0x5221d3[_0x36cc11(0x1b9)]?await getDbName(_0x4d8f57[_0x36cc11(0x1b3)],_0x5221d3['dbId']):undefined;}catch{}return{'sqlCode':_0x5221d3[_0x36cc11(0x1b2)],'sqlName':_0x5221d3[_0x36cc11(0x1c9)],'description':_0x5221d3['description']??'','db':_0x4e887a?_0x4e887a+'\x20('+_0x5221d3['dbId']+')':_0x5221d3['dbId']??''};})),{'ok':!![],'data':_0x4f2fbc,'message':_0x5934bb[_0x230673(0x1ab)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x230673(0x1a8)+_0x5934bb['length']+_0x230673(0x1c4)+_0x149c70+').'};}};
1
+ function a190_0x5410(_0x3b5eeb,_0xd12afc){_0x3b5eeb=_0x3b5eeb-0x147;const _0x4ed60d=a190_0x4ed6();let _0x5410f6=_0x4ed60d[_0x3b5eeb];return _0x5410f6;}const a190_0x4e970f=a190_0x5410;(function(_0x15d14d,_0x51a72f){const _0x5bc308=a190_0x5410,_0x161761=_0x15d14d();while(!![]){try{const _0x222374=parseInt(_0x5bc308(0x163))/0x1+parseInt(_0x5bc308(0x153))/0x2+parseInt(_0x5bc308(0x14f))/0x3*(-parseInt(_0x5bc308(0x15d))/0x4)+parseInt(_0x5bc308(0x156))/0x5+-parseInt(_0x5bc308(0x155))/0x6+-parseInt(_0x5bc308(0x162))/0x7+parseInt(_0x5bc308(0x152))/0x8*(-parseInt(_0x5bc308(0x15e))/0x9);if(_0x222374===_0x51a72f)break;else _0x161761['push'](_0x161761['shift']());}catch(_0x4008e){_0x161761['push'](_0x161761['shift']());}}}(a190_0x4ed6,0xc52b7));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a190_0x4ed6(){const _0x504155=['name','Page\x20number','paging','List\x20custom\x20SQL\x20queries','read','136Njpzpu','4191939gTESCc','appCode','Filter\x20by\x20SQL\x20name','map','489615hicEXT','478335PsKHvV','pagesize','string','num','number','bool','sqlName','sqlcode','page','tableData','all','length','123666FJwYdy','\x20SQL\x20queries\x20(total:\x20','dbId','8TIRyqE','2654136BkidUD','boolean','996030TuKDjJ','5527365xTMNTA','verbose'];a190_0x4ed6=function(){return _0x504155;};return a190_0x4ed6();}export const sqlList={'service':'sql','command':'list','description':a190_0x4e970f(0x15b),'risk':a190_0x4e970f(0x15c),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a190_0x4e970f(0x158),'type':a190_0x4e970f(0x165),'description':a190_0x4e970f(0x160)},{'name':a190_0x4e970f(0x14b),'type':a190_0x4e970f(0x147),'description':a190_0x4e970f(0x159),'default':0x1},{'name':a190_0x4e970f(0x164),'type':a190_0x4e970f(0x147),'description':'Page\x20size'},{'name':a190_0x4e970f(0x157),'type':a190_0x4e970f(0x154),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x46b992){const _0x44b0b1=a190_0x4e970f,_0x174707=await listSqlQueries(_0x46b992[_0x44b0b1(0x15f)],{'sqlCode':_0x46b992['str'](_0x44b0b1(0x14a))||undefined,'sqlName':_0x46b992['str'](_0x44b0b1(0x158))||undefined,'currentPage':_0x46b992['num'](_0x44b0b1(0x14b)),'pageSize':_0x46b992[_0x44b0b1(0x166)](_0x44b0b1(0x164),0x32)}),_0x2eacaf=_0x46b992[_0x44b0b1(0x148)]('verbose'),_0x14a906=_0x174707[_0x44b0b1(0x14c)]??[],_0x3be15c=_0x174707[_0x44b0b1(0x15a)]?.['totalCount']??_0x14a906['length'];let _0x2bebb8;return _0x2eacaf?_0x2bebb8=_0x14a906:_0x2bebb8=await Promise[_0x44b0b1(0x14d)](_0x14a906[_0x44b0b1(0x161)](async _0x172397=>{const _0x53c662=_0x44b0b1;let _0x578689;try{_0x578689=_0x172397[_0x53c662(0x151)]?await getDbName(_0x46b992['appCode'],_0x172397['dbId']):undefined;}catch{}return{'sqlCode':_0x172397['sqlCode'],'sqlName':_0x172397[_0x53c662(0x149)],'description':_0x172397['description']??'','db':_0x578689?_0x578689+'\x20('+_0x172397['dbId']+')':_0x172397[_0x53c662(0x151)]??''};})),{'ok':!![],'data':_0x2bebb8,'message':_0x14a906[_0x44b0b1(0x14e)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x14a906[_0x44b0b1(0x14e)]+_0x44b0b1(0x150)+_0x3be15c+').'};}};