@lovrabet/rabetbase-cli 2.5.0-beta.5 → 2.5.0-beta.6

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 (294) 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.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/delete.js +1 -1
  53. package/lib/commands/config/get.js +1 -1
  54. package/lib/commands/config/index.js +1 -1
  55. package/lib/commands/config/init.js +1 -1
  56. package/lib/commands/config/list.js +1 -1
  57. package/lib/commands/config/set.js +1 -1
  58. package/lib/commands/config/shared.js +1 -1
  59. package/lib/commands/dataset/business-group-update.js +1 -1
  60. package/lib/commands/dataset/business-groups.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff-refresh-start.js +1 -1
  87. package/lib/commands/db/diff-refresh-status.js +1 -1
  88. package/lib/commands/db/diff.js +1 -1
  89. package/lib/commands/db/index.js +1 -1
  90. package/lib/commands/db/list.js +1 -1
  91. package/lib/commands/db/shared.js +1 -1
  92. package/lib/commands/db/table-diff-shared.js +1 -1
  93. package/lib/commands/db/tables.js +1 -1
  94. package/lib/commands/db/test.js +1 -1
  95. package/lib/commands/db/update.js +1 -1
  96. package/lib/commands/doctor.js +1 -1
  97. package/lib/commands/file/index.js +1 -1
  98. package/lib/commands/issue/index.js +1 -1
  99. package/lib/commands/issue/nudge.js +1 -1
  100. package/lib/commands/issue/report.js +1 -1
  101. package/lib/commands/issue/shared.js +1 -1
  102. package/lib/commands/kb/create.js +1 -1
  103. package/lib/commands/kb/delete.js +1 -1
  104. package/lib/commands/kb/detail.js +1 -1
  105. package/lib/commands/kb/index.js +1 -1
  106. package/lib/commands/kb/list.js +1 -1
  107. package/lib/commands/kb/search.js +1 -1
  108. package/lib/commands/kb/shared.js +1 -1
  109. package/lib/commands/kb/update.js +1 -1
  110. package/lib/commands/logs/index.js +1 -1
  111. package/lib/commands/menu/asset-update.js +1 -1
  112. package/lib/commands/menu/delete.js +1 -1
  113. package/lib/commands/menu/external-link-create.js +1 -1
  114. package/lib/commands/menu/external-link-update.js +1 -1
  115. package/lib/commands/menu/group-create.js +1 -1
  116. package/lib/commands/menu/group-update.js +1 -1
  117. package/lib/commands/menu/index.js +1 -1
  118. package/lib/commands/menu/list.js +1 -1
  119. package/lib/commands/menu/move.js +1 -1
  120. package/lib/commands/menu/regroup-start.js +1 -1
  121. package/lib/commands/menu/rename.js +1 -1
  122. package/lib/commands/menu/shared/compare-table.js +1 -1
  123. package/lib/commands/menu/shared/delete-plan.js +1 -1
  124. package/lib/commands/menu/shared/facts.js +1 -1
  125. package/lib/commands/menu/shared/index.js +1 -1
  126. package/lib/commands/menu/shared/inquirer.js +1 -1
  127. package/lib/commands/menu/shared/local-pages.js +1 -1
  128. package/lib/commands/menu/shared/logic.js +1 -1
  129. package/lib/commands/menu/shared/mutations.js +1 -1
  130. package/lib/commands/menu/shared/service.js +1 -1
  131. package/lib/commands/menu/shared/sync-core.js +1 -1
  132. package/lib/commands/menu/shared/update-core.js +1 -1
  133. package/lib/commands/menu/shared/valid-url.js +1 -1
  134. package/lib/commands/menu/sync.js +1 -1
  135. package/lib/commands/menu/visibility-update.js +1 -1
  136. package/lib/commands/notification/config-create.js +1 -1
  137. package/lib/commands/notification/config-delete.js +1 -1
  138. package/lib/commands/notification/config-list.js +1 -1
  139. package/lib/commands/notification/config-update.js +1 -1
  140. package/lib/commands/notification/index.js +1 -1
  141. package/lib/commands/notification/shared.js +1 -1
  142. package/lib/commands/ocr/index.js +1 -1
  143. package/lib/commands/page/create.js +1 -1
  144. package/lib/commands/page/custom/detail.js +1 -1
  145. package/lib/commands/page/custom/list.js +1 -1
  146. package/lib/commands/page/custom/publish.js +1 -1
  147. package/lib/commands/page/custom/shared.js +1 -1
  148. package/lib/commands/page/custom/syntax.js +1 -1
  149. package/lib/commands/page/custom/template.js +1 -1
  150. package/lib/commands/page/custom/update.js +1 -1
  151. package/lib/commands/page/data-list-status.js +1 -1
  152. package/lib/commands/page/generate-start.js +1 -1
  153. package/lib/commands/page/generate-status.js +1 -1
  154. package/lib/commands/page/index.js +1 -1
  155. package/lib/commands/page/pull.js +1 -1
  156. package/lib/commands/page/push.js +1 -1
  157. package/lib/commands/page/relation-audit.js +1 -1
  158. package/lib/commands/page/restore.js +1 -1
  159. package/lib/commands/page/shared.js +1 -1
  160. package/lib/commands/page/sync.js +1 -1
  161. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  162. package/lib/commands/project/create/format-elapsed.js +1 -1
  163. package/lib/commands/project/create/main.js +1 -1
  164. package/lib/commands/project/create/materialize-project-template.js +1 -1
  165. package/lib/commands/project/create/project-name.js +1 -1
  166. package/lib/commands/project/create/project-template-archive.js +1 -1
  167. package/lib/commands/project/create/project-template-path.js +1 -1
  168. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  169. package/lib/commands/project/create/use-format-code.js +1 -1
  170. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  171. package/lib/commands/project/index.js +1 -1
  172. package/lib/commands/project/upgrade.js +1 -1
  173. package/lib/commands/registry.js +1 -1
  174. package/lib/commands/role/delete.js +1 -1
  175. package/lib/commands/role/detail.js +1 -1
  176. package/lib/commands/role/index.js +1 -1
  177. package/lib/commands/role/list.js +1 -1
  178. package/lib/commands/role/shared.js +1 -1
  179. package/lib/commands/role/update.js +1 -1
  180. package/lib/commands/role/user-add.js +1 -1
  181. package/lib/commands/role/user-remove.js +1 -1
  182. package/lib/commands/role/user-resolve.js +1 -1
  183. package/lib/commands/run/index.js +1 -1
  184. package/lib/commands/schema.js +1 -1
  185. package/lib/commands/sql/create.js +1 -1
  186. package/lib/commands/sql/delete.js +1 -1
  187. package/lib/commands/sql/detail.js +1 -1
  188. package/lib/commands/sql/exec.js +1 -1
  189. package/lib/commands/sql/index.js +1 -1
  190. package/lib/commands/sql/list.js +1 -1
  191. package/lib/commands/sql/pull.js +1 -1
  192. package/lib/commands/sql/push.js +1 -1
  193. package/lib/commands/sql/shared.js +1 -1
  194. package/lib/commands/sql/status.js +1 -1
  195. package/lib/commands/sql/validate.js +1 -1
  196. package/lib/commands/task/index.js +1 -1
  197. package/lib/commands/task/status.js +1 -1
  198. package/lib/commands/tenant/index.js +1 -1
  199. package/lib/commands/tenant/members-list.js +1 -1
  200. package/lib/commands/tenant/shared.js +1 -1
  201. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  202. package/lib/commands/user-account/index.js +1 -1
  203. package/lib/commands/workspace/add.js +1 -1
  204. package/lib/commands/workspace/index.js +1 -1
  205. package/lib/commands/workspace/remove.js +1 -1
  206. package/lib/config/domain-config.js +1 -1
  207. package/lib/config/schema.js +1 -1
  208. package/lib/constant/cdn.js +1 -1
  209. package/lib/constant/cli.js +1 -1
  210. package/lib/constant/defaults.js +1 -1
  211. package/lib/constant/domain.js +1 -1
  212. package/lib/constant/env.js +1 -1
  213. package/lib/constant/output.js +1 -1
  214. package/lib/constant/paths.js +1 -1
  215. package/lib/constant/region.js +1 -1
  216. package/lib/constant/risk.js +1 -1
  217. package/lib/context/app-resolver.js +1 -1
  218. package/lib/context/auth-resolver.js +1 -1
  219. package/lib/context/config-loader.js +1 -1
  220. package/lib/context.js +1 -1
  221. package/lib/core/alias-resolver.js +1 -1
  222. package/lib/core/api-client.js +1 -1
  223. package/lib/core/bff/config.js +1 -1
  224. package/lib/core/bff/file-system.js +1 -1
  225. package/lib/core/bff/hash.js +1 -1
  226. package/lib/core/bff/lock.js +1 -1
  227. package/lib/core/bff/utils.js +1 -1
  228. package/lib/core/db-resolver.js +1 -1
  229. package/lib/core/page/file-system.js +1 -1
  230. package/lib/core/page/hash.js +1 -1
  231. package/lib/core/page/lock.js +1 -1
  232. package/lib/core/sql-index-auditor.js +1 -1
  233. package/lib/core/sql-sync/config.js +1 -1
  234. package/lib/core/sql-sync/file-system.js +1 -1
  235. package/lib/core/sql-sync/hash.js +1 -1
  236. package/lib/core/sql-sync/lock.js +1 -1
  237. package/lib/core/sql-sync/utils.js +1 -1
  238. package/lib/core/sql-validator.js +1 -1
  239. package/lib/errors.js +1 -1
  240. package/lib/framework/build-all-flags.js +1 -1
  241. package/lib/framework/error-output.js +1 -1
  242. package/lib/framework/explicit-yes.js +1 -1
  243. package/lib/framework/flags.js +1 -1
  244. package/lib/framework/help.js +1 -1
  245. package/lib/framework/index.js +1 -1
  246. package/lib/framework/output.js +1 -1
  247. package/lib/framework/response.js +1 -1
  248. package/lib/framework/runner-alias.js +1 -1
  249. package/lib/framework/runner.js +1 -1
  250. package/lib/framework/schema-export.js +1 -1
  251. package/lib/framework/types.js +1 -1
  252. package/lib/generated/build-info.d.ts +4 -4
  253. package/lib/generated/build-info.js +1 -1
  254. package/lib/help.js +1 -1
  255. package/lib/postinstall.js +1 -1
  256. package/lib/runtime/confirmation.js +1 -1
  257. package/lib/runtime/event.js +1 -1
  258. package/lib/runtime/index.js +1 -1
  259. package/lib/runtime/queue.js +1 -1
  260. package/lib/runtime/resolve.js +1 -1
  261. package/lib/skills/builtin-skill.js +1 -1
  262. package/lib/skills/main.js +1 -1
  263. package/lib/skills/npx-skills-add.js +1 -1
  264. package/lib/skills/skill-presence.js +1 -1
  265. package/lib/telemetry/cli-command-trace.js +1 -1
  266. package/lib/telemetry/cli-help-trace.js +1 -1
  267. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  268. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  269. package/lib/telemetry/send-cli-trace-log.js +1 -1
  270. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  271. package/lib/utils/ai_config.js +1 -1
  272. package/lib/utils/apply-jq-filter.js +1 -1
  273. package/lib/utils/cdn-config.js +1 -1
  274. package/lib/utils/check-sdk-version.js +1 -1
  275. package/lib/utils/cli-version-check.js +1 -1
  276. package/lib/utils/cli-version-policy.js +1 -1
  277. package/lib/utils/config.js +1 -1
  278. package/lib/utils/entity-with-id.js +1 -1
  279. package/lib/utils/file-utils.js +1 -1
  280. package/lib/utils/guides-cdn.js +1 -1
  281. package/lib/utils/http-client.js +1 -1
  282. package/lib/utils/is-non-interactive.js +1 -1
  283. package/lib/utils/logger.js +1 -1
  284. package/lib/utils/params.js +1 -1
  285. package/lib/utils/platform.js +1 -1
  286. package/lib/utils/sleep.js +1 -1
  287. package/lib/utils/template-replacer.js +1 -1
  288. package/lib/utils/update-notice.js +1 -1
  289. package/lib/utils/version.js +1 -1
  290. package/lib/utils/with-active-cookie.js +1 -1
  291. package/lib/utils/write-cli-side-channel.js +1 -1
  292. package/package.json +1 -1
  293. package/skills/rabetbase/SKILL.md +2 -2
  294. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a174_0x224695=a174_0x2806;(function(_0x20a450,_0x24c1b2){const _0x1a09f3=a174_0x2806,_0x2720d7=_0x20a450();while(!![]){try{const _0x305ce9=-parseInt(_0x1a09f3(0x8e))/0x1*(parseInt(_0x1a09f3(0x97))/0x2)+parseInt(_0x1a09f3(0x85))/0x3*(parseInt(_0x1a09f3(0x84))/0x4)+parseInt(_0x1a09f3(0x92))/0x5*(-parseInt(_0x1a09f3(0x7f))/0x6)+-parseInt(_0x1a09f3(0x93))/0x7*(-parseInt(_0x1a09f3(0x87))/0x8)+parseInt(_0x1a09f3(0x7e))/0x9*(-parseInt(_0x1a09f3(0x90))/0xa)+-parseInt(_0x1a09f3(0x7d))/0xb*(parseInt(_0x1a09f3(0x8b))/0xc)+-parseInt(_0x1a09f3(0x86))/0xd*(-parseInt(_0x1a09f3(0x8d))/0xe);if(_0x305ce9===_0x24c1b2)break;else _0x2720d7['push'](_0x2720d7['shift']());}catch(_0x3c20bd){_0x2720d7['push'](_0x2720d7['shift']());}}}(a174_0x108b,0x2f177));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_0x2806(_0x578d06,_0x597ea5){_0x578d06=_0x578d06-0x7d;const _0x108bbe=a174_0x108b();let _0x2806cf=_0x108bbe[_0x578d06];return _0x2806cf;}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a174_0x108b(){const _0x57a2a0=['num','Deleted\x20role\x20','4284Gxbjiw','delete','14463176nDBfOn','163369krnWYB','role','156580ezMCFU','Role\x20still\x20has\x20','27130WFCOgh','49161aSsQPb','dev','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','roleName','4SyNzxh','6886NqaNco','171ApTYpK','288aBLnet','POST','high-risk-write','appCode','userCount','4SHrGcy','382539pBznkL','13blIGsu','160zBOAJs','/smartapi/permit/role/delete'];a174_0x108b=function(){return _0x57a2a0;};return a174_0x108b();}const DELETE_PATH=a174_0x224695(0x88);export const roleDelete={'service':a174_0x224695(0x8f),'command':a174_0x224695(0x8c),'description':'Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','risk':a174_0x224695(0x81),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x554227){const _0x5802f0=a174_0x224695,_0x31f1cc=_0x554227[_0x5802f0(0x89)]('id'),_0x452a93=await getRoleById(_0x554227[_0x5802f0(0x82)],_0x31f1cc);return assertCustomRole(_0x452a93,_0x5802f0(0x8c)),asDryRunResult({'scope':'dev','operation':_0x5802f0(0x8c),'selector':{'appCode':_0x554227['appCode'],'roleId':_0x31f1cc,'roleName':_0x452a93[_0x5802f0(0x96)]},'before':projectRole(_0x452a93),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x452a93[_0x5802f0(0x83)]>0x0?[_0x5802f0(0x91)+_0x452a93[_0x5802f0(0x83)]+_0x5802f0(0x95)]:[]},{'method':_0x5802f0(0x80),'url':DELETE_PATH});},async 'execute'(_0x452e13){const _0x3b6c24=a174_0x224695,_0x156b0a=_0x452e13[_0x3b6c24(0x89)]('id'),_0x352691=await getRoleById(_0x452e13[_0x3b6c24(0x82)],_0x156b0a);return assertCustomRole(_0x352691,'delete'),await deleteAppRole(_0x156b0a),{'ok':!![],'data':{'scope':_0x3b6c24(0x94),'operation':_0x3b6c24(0x8c),'selector':{'appCode':_0x452e13[_0x3b6c24(0x82)],'roleId':_0x156b0a,'roleName':_0x352691[_0x3b6c24(0x96)]},'before':projectRole(_0x352691),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x3b6c24(0x8a)+_0x352691[_0x3b6c24(0x96)]+'\x20(id='+_0x156b0a+')'};}};
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 +1 @@
1
- const a175_0x3c15d6=a175_0x489a;(function(_0x16df41,_0xe38ddd){const _0x2be9a4=a175_0x489a,_0xe5e3d7=_0x16df41();while(!![]){try{const _0x530cae=parseInt(_0x2be9a4(0x126))/0x1*(parseInt(_0x2be9a4(0x121))/0x2)+parseInt(_0x2be9a4(0x125))/0x3+parseInt(_0x2be9a4(0x120))/0x4+parseInt(_0x2be9a4(0x11c))/0x5+-parseInt(_0x2be9a4(0x123))/0x6+-parseInt(_0x2be9a4(0x127))/0x7*(-parseInt(_0x2be9a4(0x119))/0x8)+-parseInt(_0x2be9a4(0x11f))/0x9;if(_0x530cae===_0xe38ddd)break;else _0xe5e3d7['push'](_0xe5e3d7['shift']());}catch(_0x5e4f0d){_0xe5e3d7['push'](_0xe5e3d7['shift']());}}}(a175_0xc73e,0x75a97));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a175_0x489a(_0x33e3cc,_0x2bb3d5){_0x33e3cc=_0x33e3cc-0x118;const _0xc73eaf=a175_0xc73e();let _0x489a6d=_0xc73eaf[_0x33e3cc];return _0x489a6d;}function a175_0xc73e(){const _0x1c595c=['3101veWRru','11487GnwSpQ','Show\x20a\x20single\x20role\x27s\x20detail','1824KKQTzd','dev','Role\x20','1228535yXJmTK','roleType','num','17341353MCpCBV','2340892ohizPY','446fpsRpo','read','649374IfFGPl','detail','1861164oqGefR'];a175_0xc73e=function(){return _0x1c595c;};return a175_0xc73e();}export const roleDetail={'service':'role','command':a175_0x3c15d6(0x124),'description':a175_0x3c15d6(0x118),'risk':a175_0x3c15d6(0x122),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x157107){const _0x555052=a175_0x3c15d6,_0x29d816=_0x157107[_0x555052(0x11e)]('id'),_0x126aae=await getRoleById(_0x157107['appCode'],_0x29d816);return{'ok':!![],'data':{'scope':_0x555052(0x11a),'role':projectRole(_0x126aae)},'message':_0x555052(0x11b)+_0x126aae['roleName']+'\x20('+_0x126aae[_0x555052(0x11d)]+')'};}};
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 +1 @@
1
- (function(_0x38e8f1,_0x43b65e){const _0x3d5a71=a176_0x461a,_0x673a40=_0x38e8f1();while(!![]){try{const _0x2cdba4=-parseInt(_0x3d5a71(0x116))/0x1+parseInt(_0x3d5a71(0x114))/0x2+parseInt(_0x3d5a71(0x11a))/0x3*(parseInt(_0x3d5a71(0x117))/0x4)+parseInt(_0x3d5a71(0x115))/0x5*(parseInt(_0x3d5a71(0x11b))/0x6)+-parseInt(_0x3d5a71(0x118))/0x7+parseInt(_0x3d5a71(0x113))/0x8+-parseInt(_0x3d5a71(0x119))/0x9*(-parseInt(_0x3d5a71(0x112))/0xa);if(_0x2cdba4===_0x43b65e)break;else _0x673a40['push'](_0x673a40['shift']());}catch(_0x53fec9){_0x673a40['push'](_0x673a40['shift']());}}}(a176_0x39e1,0x51f10));function a176_0x39e1(){const _0x51c810=['350133gfFWGL','556204gONIhm','3015383MWdSwz','207aGMfZX','3lsLhhm','6QEbBnP','133670mSueqq','581568BBwdqy','74676pTHfJz','2800040YYLQdP'];a176_0x39e1=function(){return _0x51c810;};return a176_0x39e1();}function a176_0x461a(_0x3bdc4b,_0xba99c4){_0x3bdc4b=_0x3bdc4b-0x112;const _0x39e17a=a176_0x39e1();let _0x461ae2=_0x39e17a[_0x3bdc4b];return _0x461ae2;}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';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
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 +1 @@
1
- function a177_0x28d0(){const _0x5f33a9=['Page\x20index\x20(1-based)','pagesize','includes','4057910dgGfPQ','2079720qzyCxR','length','join','number','1602636REVOrI','type','\x20role(s)','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','DEV','roleType','1112340omBWcS','page','role','CUSTOM','trim','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','map','toUpperCase','Filter\x20by\x20role\x20type','Found\x20','654222PaayOX','Page\x20size\x20(1-100)','Use\x20one\x20of:\x20','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','str','744424NHjZvg','1831970qxgniQ','8MThUXT','12ItfgKp','Invalid\x20--type\x20\x22','num','OWNER','appCode','validation'];a177_0x28d0=function(){return _0x5f33a9;};return a177_0x28d0();}const a177_0x5e73b9=a177_0x4dea;function a177_0x4dea(_0x5f3f42,_0x17a2b0){_0x5f3f42=_0x5f3f42-0xf2;const _0x28d0c8=a177_0x28d0();let _0x4dea76=_0x28d0c8[_0x5f3f42];return _0x4dea76;}(function(_0x279521,_0x585bb3){const _0x59fd4b=a177_0x4dea,_0x3bf673=_0x279521();while(!![]){try{const _0x3ca613=-parseInt(_0x59fd4b(0xf3))/0x1+parseInt(_0x59fd4b(0xf9))/0x2+-parseInt(_0x59fd4b(0xfb))/0x3*(parseInt(_0x59fd4b(0xf8))/0x4)+parseInt(_0x59fd4b(0x104))/0x5+parseInt(_0x59fd4b(0x10f))/0x6+parseInt(_0x59fd4b(0x109))/0x7*(-parseInt(_0x59fd4b(0xfa))/0x8)+parseInt(_0x59fd4b(0x105))/0x9;if(_0x3ca613===_0x585bb3)break;else _0x3bf673['push'](_0x3bf673['shift']());}catch(_0x573688){_0x3bf673['push'](_0x3bf673['shift']());}}}(a177_0x28d0,0x7e15b));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',a177_0x5e73b9(0x10d),a177_0x5e73b9(0xfe),a177_0x5e73b9(0x112)];export const roleList={'service':a177_0x5e73b9(0x111),'command':'list','description':a177_0x5e73b9(0xf6),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a177_0x5e73b9(0x10a),'type':'string','required':![],'description':a177_0x5e73b9(0x117),'enum':ROLE_TYPES},{'name':'page','type':'number','description':a177_0x5e73b9(0x101),'default':0x1},{'name':'pagesize','type':a177_0x5e73b9(0x108),'description':a177_0x5e73b9(0xf4),'default':0x64}],async 'validate'(_0x41754d){const _0x227612=a177_0x5e73b9,_0x492f3a=_0x41754d[_0x227612(0xf7)]('type')[_0x227612(0x113)]();if(_0x492f3a&&!ROLE_TYPES[_0x227612(0x103)](_0x492f3a[_0x227612(0x116)]()))throw CliErrors[_0x227612(0x100)](_0x227612(0xfc)+_0x492f3a+'\x22.',_0x227612(0xf5)+ROLE_TYPES[_0x227612(0x107)](',\x20')+'.');const _0xeae30c=_0x41754d[_0x227612(0xfd)](_0x227612(0x110),0x1),_0x50082c=_0x41754d['num'](_0x227612(0x102),0x64);if(_0xeae30c<0x1)throw CliErrors[_0x227612(0x100)](_0x227612(0x10c));if(_0x50082c<0x1||_0x50082c>0x64)throw CliErrors[_0x227612(0x100)](_0x227612(0x114));},async 'execute'(_0x1770f1){const _0xba6802=a177_0x5e73b9,_0x55eaff=_0x1770f1[_0xba6802(0xfd)](_0xba6802(0x110),0x1)||0x1,_0x1f2958=_0x1770f1[_0xba6802(0xfd)]('pagesize',0x64)||0x64,_0x272076=_0x1770f1['str'](_0xba6802(0x10a))[_0xba6802(0x113)]()[_0xba6802(0x116)](),{items:_0x2b0e25,paging:_0x1e3cfa}=await listAppRoles(_0x1770f1[_0xba6802(0xff)],{'currentPage':_0x55eaff,'pageSize':_0x1f2958}),_0x178536=_0x272076?_0x2b0e25['filter'](_0x41a038=>_0x41a038[_0xba6802(0x10e)]===_0x272076):_0x2b0e25,_0x137384=_0x178536[_0xba6802(0x115)](projectRole);return{'ok':!![],'data':{'scope':'dev','roles':_0x137384,'paging':_0x1e3cfa},'message':_0xba6802(0xf2)+_0x137384[_0xba6802(0x106)]+_0xba6802(0x10b)};}};
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 +1 @@
1
- const a178_0x19e903=a178_0x355e;(function(_0xf37989,_0x2fd630){const _0x5c76e2=a178_0x355e,_0x5a3f30=_0xf37989();while(!![]){try{const _0x119cab=-parseInt(_0x5c76e2(0x1cf))/0x1*(-parseInt(_0x5c76e2(0x1d1))/0x2)+parseInt(_0x5c76e2(0x1ad))/0x3+parseInt(_0x5c76e2(0x1ac))/0x4*(-parseInt(_0x5c76e2(0x1ce))/0x5)+parseInt(_0x5c76e2(0x1b5))/0x6*(-parseInt(_0x5c76e2(0x198))/0x7)+parseInt(_0x5c76e2(0x1a5))/0x8+-parseInt(_0x5c76e2(0x1a1))/0x9*(-parseInt(_0x5c76e2(0x1b1))/0xa)+parseInt(_0x5c76e2(0x196))/0xb*(-parseInt(_0x5c76e2(0x18a))/0xc);if(_0x119cab===_0x2fd630)break;else _0x5a3f30['push'](_0x5a3f30['shift']());}catch(_0x341dea){_0x5a3f30['push'](_0x5a3f30['shift']());}}}(a178_0x55da,0x2e257));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_0x19e903(0x1c4),'required':!![],'description':a178_0x19e903(0x1a0)};export const ROLE_REF_FLAG={'name':a178_0x19e903(0x1b9),'type':'string','required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':a178_0x19e903(0x189),'type':'string','required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':a178_0x19e903(0x188),'type':a178_0x19e903(0x1c2),'required':!![],'description':a178_0x19e903(0x1a2)};export const USER_NAME_FLAG={'name':a178_0x19e903(0x188),'type':'string','required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a178_0x19e903(0x186),'type':'string','required':![],'description':'Optional\x20role\x20remark/description'};function a178_0x55da(){const _0x6dd09a=['Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','\x20is\x20already\x20a\x20member\x20of\x20role\x20','36256phcywd','Pass\x20--user\x20<id|name>.','1387946BFNkNK','validation','nickname','Pass\x20--role\x20<id|name>.','username','push','dryRun','/smartapi/permit/user-role/delete','Role\x20id\x20(from\x20`role\x20list`)','284499ViHcLD','Role\x20name','roleType','\x20is\x20not\x20a\x20member\x20of\x20role\x20','1943992exMNrX','ADMIN','\x20duplicate\x20memberships\x20for\x20user\x20','tenant_code','Role\x20name\x20\x22','\x22:\x20','Check\x20the\x20nickname/username.\x20','8ptGTTF','18957pIJSQg','\x20members\x20of\x20the\x20OWNER\x20role.','user-add','trim','50BKWoCc','userCount','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.',';\x20no\x20change.','6jCNBuK','test','join','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','role','expectUserCount','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','toLowerCase','filter','roleName','totalCount','userId','map','string','str','number','Missing\x20user\x20reference.','flagMissing','length','Role\x20id\x20','\x20built-in\x20role\x20','tenant','includes','\x22\x20is\x20ambiguous\x20(ids:\x20','flag','277775vppcZO','15721xVzyYC','Multiple\x20tenant\x20members\x20match\x20\x22','12ZdLSpg','Pass\x20--user\x20<id>.','No\x20tenant\x20member\x20matches\x20\x22','remark','appCode','name','user','12GMAJHJ','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','find','/smartapi/permit/user-role/create','dev','DEV','\x20not\x20found\x20in\x20app\x20','\x20member(s)\x20but\x20role\x20has\x20','\x22\x20not\x20found\x20in\x20app\x20','permitCount'];a178_0x55da=function(){return _0x6dd09a;};return a178_0x55da();}export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a178_0x19e903(0x1c4),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a178_0x19e903(0x1a6),a178_0x19e903(0x18f),'OWNER'];export function isBuiltinRole(_0x49e8a5){const _0x3d863f=a178_0x19e903;return BUILTIN_ROLE_TYPES[_0x3d863f(0x1cb)](_0x49e8a5);}export function assertCustomRole(_0x870e7d,_0x225b41){const _0xe5f7a0=a178_0x19e903;if(_0x870e7d[_0xe5f7a0(0x1a3)]!=='CUSTOM')throw CliErrors['validation']('Cannot\x20'+_0x225b41+_0xe5f7a0(0x1c9)+_0x870e7d[_0xe5f7a0(0x1be)]+'\x20('+_0x870e7d[_0xe5f7a0(0x1a3)]+').',_0xe5f7a0(0x1bb));}export function projectRole(_0x537951){const _0x395319=a178_0x19e903;return{'id':_0x537951['id'],'roleName':_0x537951[_0x395319(0x1be)],'roleType':_0x537951[_0x395319(0x1a3)],'remark':_0x537951[_0x395319(0x186)],'userCount':_0x537951[_0x395319(0x1b2)],'permitCount':_0x537951[_0x395319(0x193)],'builtin':isBuiltinRole(_0x537951[_0x395319(0x1a3)])};}export async function resolveRoleRef(_0x41846e,_0x29a86a){const _0x13713d=a178_0x19e903,_0x122129=_0x29a86a[_0x13713d(0x1b0)]();if(!_0x122129)throw CliErrors['validation']('Missing\x20role\x20reference.',_0x13713d(0x19b));if(/^\d+$/[_0x13713d(0x1b6)](_0x122129))return getRoleById(_0x41846e,Number(_0x122129));const _0x11465=await listAllAppRoles(_0x41846e),_0xdddaf6=_0x11465[_0x13713d(0x1bd)](_0x2813ed=>_0x2813ed['roleName']===_0x122129);if(_0xdddaf6['length']===0x0)throw CliErrors[_0x13713d(0x199)](_0x13713d(0x1a9)+_0x122129+_0x13713d(0x192)+_0x41846e+'.',_0x13713d(0x1b3));if(_0xdddaf6['length']>0x1){const _0x356d8f=_0xdddaf6[_0x13713d(0x1c1)](_0x4f3d58=>_0x4f3d58['id'])[_0x13713d(0x1b7)](',\x20');throw CliErrors['validation'](_0x13713d(0x1a9)+_0x122129+_0x13713d(0x1cc)+_0x356d8f+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0xdddaf6[0x0];}export async function getRoleById(_0x2e384a,_0x29ee3b){const _0x7a555=a178_0x19e903,_0x581774=await listAllAppRoles(_0x2e384a),_0x564e5b=_0x581774[_0x7a555(0x1bd)](_0x3a1a18=>_0x3a1a18['id']===_0x29ee3b&&(!_0x3a1a18[_0x7a555(0x187)]||_0x3a1a18[_0x7a555(0x187)]===_0x2e384a));if(_0x564e5b[_0x7a555(0x1c7)]!==0x1)throw CliErrors[_0x7a555(0x199)](_0x7a555(0x1c8)+_0x29ee3b+_0x7a555(0x190)+_0x2e384a+'.',_0x7a555(0x194));return _0x564e5b[0x0];}async function listAllAppRoles(_0x85e207){const _0x4ff196=a178_0x19e903,_0x37a36c=0x64,_0x55155e=[];for(let _0x586ab6=0x1;;_0x586ab6+=0x1){const {items:_0x2de4b3,paging:_0x51a7e8}=await listAppRoles(_0x85e207,{'currentPage':_0x586ab6,'pageSize':_0x37a36c});_0x55155e['push'](..._0x2de4b3);if(_0x2de4b3[_0x4ff196(0x1c7)]<_0x37a36c||_0x51a7e8&&_0x55155e[_0x4ff196(0x1c7)]>=_0x51a7e8[_0x4ff196(0x1bf)])return _0x55155e;}}export async function resolveTenantCode(){const _0x256e72=a178_0x19e903,_0x15dba9=await getSessionUserInfo(),_0x15e8bc=_0x15dba9?.[_0x256e72(0x189)]?.[_0x256e72(0x1ca)]?.[_0x256e72(0x1a8)];if(!_0x15e8bc)throw CliErrors['authRequired'](_0x256e72(0x1b8));return _0x15e8bc;}function matchMember(_0x453b4d,_0x376673){const _0x42a002=a178_0x19e903,_0x3cbfa2=_0x376673[_0x42a002(0x1b0)]()[_0x42a002(0x1bc)]();return(_0x453b4d[_0x42a002(0x19a)]??'')['toLowerCase']()===_0x3cbfa2||(_0x453b4d[_0x42a002(0x19c)]??'')[_0x42a002(0x1bc)]()===_0x3cbfa2;}function a178_0x355e(_0x3cf0a1,_0x20f0a2){_0x3cf0a1=_0x3cf0a1-0x186;const _0x55da6f=a178_0x55da();let _0x355e91=_0x55da6f[_0x3cf0a1];return _0x355e91;}export async function resolveUserRef(_0x17acc1,_0x576931=a178_0x19e903(0x1d2)){const _0x1314eb=a178_0x19e903,_0x2e2541=_0x17acc1[_0x1314eb(0x1b0)]();if(!_0x2e2541)throw CliErrors[_0x1314eb(0x199)](_0x1314eb(0x1c5),_0x1314eb(0x197));const _0x1e58e8=await resolveTenantCode(),_0xe70493=await getTenantMembers(_0x1e58e8);if(/^\d+$/[_0x1314eb(0x1b6)](_0x2e2541)){const _0xd6eadb=Number(_0x2e2541),_0x1e9bfd=_0xe70493[_0x1314eb(0x18c)](_0x4f3c36=>_0x4f3c36[_0x1314eb(0x1c0)]===_0xd6eadb);return{'userId':_0xd6eadb,'username':_0x1e9bfd?.['username']??String(_0xd6eadb),'nickname':_0x1e9bfd?.['nickname'],'matchedBy':'id'};}const _0x5ed2f6=_0xe70493[_0x1314eb(0x1bd)](_0x45d488=>matchMember(_0x45d488,_0x2e2541));if(_0x5ed2f6[_0x1314eb(0x1c7)]===0x0)throw CliErrors[_0x1314eb(0x199)](_0x1314eb(0x1d3)+_0x2e2541+'\x22.',_0x1314eb(0x1ab)+_0x576931);if(_0x5ed2f6['length']>0x1){const _0x2ef22c=_0x5ed2f6[_0x1314eb(0x1c1)](_0x371f43=>(_0x371f43[_0x1314eb(0x19a)]??_0x371f43[_0x1314eb(0x19c)]??'?')+'('+_0x371f43[_0x1314eb(0x1c0)]+')')[_0x1314eb(0x1b7)](',\x20');throw CliErrors[_0x1314eb(0x199)](_0x1314eb(0x1d0)+_0x2e2541+_0x1314eb(0x1aa)+_0x2ef22c+'.',_0x576931);}const _0x210f69=_0x5ed2f6[0x0];return{'userId':_0x210f69['userId'],'username':_0x210f69[_0x1314eb(0x19c)]??String(_0x210f69[_0x1314eb(0x1c0)]),'nickname':_0x210f69['nickname'],'matchedBy':_0x1314eb(0x188)};}export const CREATE_USER_ROLE_PATH=a178_0x19e903(0x18d);export const DELETE_USER_ROLE_PATH=a178_0x19e903(0x19f);export function computeRoleUserMutation(_0x5dd141){const _0x20c905=a178_0x19e903,{operation:_0x131bda,appCode:_0x18ca11,role:_0x101e02,relations:_0x441bc2,user:_0x12a03c}=_0x5dd141,_0x455e8f=[...new Set(_0x441bc2[_0x20c905(0x1c1)](_0x35038e=>_0x35038e[_0x20c905(0x1c0)]))],_0x266e94=[];if(_0x5dd141[_0x20c905(0x1ba)]!==undefined&&_0x5dd141[_0x20c905(0x1ba)]!==_0x455e8f[_0x20c905(0x1c7)])throw CliErrors['validation']('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x5dd141['expectUserCount']+_0x20c905(0x191)+_0x455e8f[_0x20c905(0x1c7)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x56f1c4=_0x455e8f[_0x20c905(0x1cb)](_0x12a03c[_0x20c905(0x1c0)]),_0x62b055=_0x441bc2['filter'](_0x18cdcd=>_0x18cdcd[_0x20c905(0x1c0)]===_0x12a03c['userId'])[_0x20c905(0x1c1)](_0x22d5a6=>_0x22d5a6['id']),_0x4f4e0b=_0x131bda===_0x20c905(0x1af)?!_0x56f1c4:_0x56f1c4;let _0x23b63d=_0x455e8f;_0x131bda===_0x20c905(0x1af)?_0x56f1c4?_0x266e94['push']('User\x20'+_0x12a03c['userId']+_0x20c905(0x195)+_0x101e02[_0x20c905(0x1be)]+_0x20c905(0x1b4)):_0x23b63d=[..._0x455e8f,_0x12a03c['userId']]:!_0x56f1c4?_0x266e94[_0x20c905(0x19d)]('User\x20'+_0x12a03c['userId']+_0x20c905(0x1a4)+_0x101e02['roleName']+_0x20c905(0x1b4)):(_0x23b63d=_0x455e8f[_0x20c905(0x1bd)](_0x4c48e6=>_0x4c48e6!==_0x12a03c['userId']),_0x62b055[_0x20c905(0x1c7)]>0x1&&_0x266e94[_0x20c905(0x19d)]('Removed\x20'+_0x62b055[_0x20c905(0x1c7)]+_0x20c905(0x1a7)+_0x12a03c[_0x20c905(0x1c0)]+'.'));const _0x5d910d={'scope':_0x20c905(0x18e),'operation':_0x131bda,'selector':{'appCode':_0x18ca11,'roleId':_0x101e02['id'],'roleName':_0x101e02[_0x20c905(0x1be)],'userId':_0x12a03c[_0x20c905(0x1c0)]},'before':{'userIds':_0x455e8f},'after':{'userIds':_0x23b63d},'dryRun':_0x5dd141[_0x20c905(0x19e)],'backend':{'method':'POST','path':_0x131bda==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x266e94};return{'mutation':_0x5d910d,'changed':_0x4f4e0b,'matchingRelationIds':_0x62b055};}export async function loadDevRoleRelations(_0x42d653,_0x33e29c){const _0x57bc55=a178_0x19e903,_0x2cb412=0x64,_0x5b1b21=[];for(let _0x22fb65=0x1;;_0x22fb65+=0x1){const {items:_0x4a25d0,paging:_0x4e3278}=await listDevUserRoleRelations(_0x42d653,{'roleId':_0x33e29c,'currentPage':_0x22fb65,'pageSize':_0x2cb412});_0x5b1b21['push'](..._0x4a25d0);if(_0x4a25d0[_0x57bc55(0x1c7)]<_0x2cb412||_0x4e3278&&_0x5b1b21['length']>=_0x4e3278['totalCount'])return _0x5b1b21;}}export function readRoleRef(_0x2082c9){const _0x380bdd=a178_0x19e903,_0x2001a9=_0x2082c9[_0x380bdd(0x1c3)](_0x380bdd(0x1b9))[_0x380bdd(0x1b0)]();if(!_0x2001a9)throw CliErrors[_0x380bdd(0x1c6)](_0x380bdd(0x1b9),'Pass\x20--role\x20<id|name>.');return _0x2001a9;}export async function prepareUserMutation(_0x22e066,_0x561f86,_0x54ab2e){const _0x258e5a=a178_0x19e903,_0x1e462b=readRoleRef(_0x22e066),_0x704c9e=_0x22e066[_0x258e5a(0x1c3)]('user')[_0x258e5a(0x1b0)]();if(!_0x704c9e)throw CliErrors[_0x258e5a(0x1c6)](_0x258e5a(0x189),'Pass\x20--user\x20<id|name>.');const _0x5edddd=_0x22e066[_0x258e5a(0x1cd)]('expect-user-count'),_0x17d688=_0x5edddd===undefined||_0x5edddd===null?undefined:Number(_0x5edddd),_0x5b6aec=await resolveRoleRef(_0x22e066[_0x258e5a(0x187)],_0x1e462b);if(_0x5b6aec['roleType']==='OWNER')throw CliErrors[_0x258e5a(0x199)]('Cannot\x20'+_0x561f86+_0x258e5a(0x1ae),_0x258e5a(0x18b));const _0x184fef=await resolveUserRef(_0x704c9e),_0x4bc4d7=await loadDevRoleRelations(_0x22e066[_0x258e5a(0x187)],_0x5b6aec['id']);return{...computeRoleUserMutation({'operation':_0x561f86,'appCode':_0x22e066[_0x258e5a(0x187)],'role':_0x5b6aec,'relations':_0x4bc4d7,'user':{'userId':_0x184fef[_0x258e5a(0x1c0)],'username':_0x184fef[_0x258e5a(0x19c)],'nickname':_0x184fef[_0x258e5a(0x19a)]},'dryRun':_0x54ab2e,..._0x17d688!==undefined?{'expectUserCount':_0x17d688}:{}}),'role':_0x5b6aec,'user':_0x184fef};}
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 +1 @@
1
- const a179_0x199a96=a179_0x13fa;(function(_0x2482b1,_0x558614){const _0x81f58e=a179_0x13fa,_0x1391a4=_0x2482b1();while(!![]){try{const _0x2f46cc=parseInt(_0x81f58e(0xe2))/0x1*(-parseInt(_0x81f58e(0xe9))/0x2)+parseInt(_0x81f58e(0xf4))/0x3*(parseInt(_0x81f58e(0xdf))/0x4)+parseInt(_0x81f58e(0xdb))/0x5*(parseInt(_0x81f58e(0xeb))/0x6)+-parseInt(_0x81f58e(0xe4))/0x7+parseInt(_0x81f58e(0xf7))/0x8+parseInt(_0x81f58e(0xe6))/0x9*(parseInt(_0x81f58e(0xe0))/0xa)+-parseInt(_0x81f58e(0xe5))/0xb*(parseInt(_0x81f58e(0xde))/0xc);if(_0x2f46cc===_0x558614)break;else _0x1391a4['push'](_0x1391a4['shift']());}catch(_0x4c9cf8){_0x1391a4['push'](_0x1391a4['shift']());}}}(a179_0x2aa7,0x45662));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a179_0x13fa(_0x5e4941,_0x34bf18){_0x5e4941=_0x5e4941-0xdb;const _0x2aa789=a179_0x2aa7();let _0x13fa60=_0x2aa789[_0x5e4941];return _0x13fa60;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x40487a){const _0x3d0929=a179_0x13fa,_0x181083=_0x40487a[_0x3d0929(0xee)](_0x3d0929(0xdd)),_0x17c8d4=_0x40487a[_0x3d0929(0xee)](_0x3d0929(0xe7)),_0x9efbc={};if(_0x181083!==undefined&&_0x181083!==null){const _0x35d417=String(_0x181083)[_0x3d0929(0xe1)]();if(!_0x35d417)throw CliErrors[_0x3d0929(0xef)](_0x3d0929(0xea));if(_0x35d417['length']>0x40)throw CliErrors[_0x3d0929(0xef)](_0x3d0929(0xf5));_0x9efbc[_0x3d0929(0xec)]=_0x35d417;}_0x17c8d4!==undefined&&_0x17c8d4!==null&&(_0x9efbc[_0x3d0929(0xe7)]=String(_0x17c8d4));if(_0x9efbc[_0x3d0929(0xec)]===undefined&&_0x9efbc[_0x3d0929(0xe7)]===undefined)throw CliErrors[_0x3d0929(0xef)](_0x3d0929(0xf8),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x9efbc;}function a179_0x2aa7(){const _0x13f215=['5lAHhzl','update','name','329676nbMCsn','729276QzNYLB','20ikuvhy','trim','401NlbXpN','appCode','2542715chBoMW','121nUrIaY','96687tGveXZ','remark','role','8gWyGBv','--name\x20cannot\x20be\x20empty.','2084460vULAkl','roleName','Updated\x20role\x20','flag','validation','dev','num','POST','string','3efpOQp','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','New\x20role\x20name','3200760xZFFPn','Nothing\x20to\x20update.'];a179_0x2aa7=function(){return _0x13f215;};return a179_0x2aa7();}export const roleUpdate={'service':a179_0x199a96(0xe8),'command':a179_0x199a96(0xdc),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a179_0x199a96(0xdd),'type':a179_0x199a96(0xf3),'required':![],'description':a179_0x199a96(0xf6)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x386994){readPatch(_0x386994);},async 'dryRun'(_0x49a57d){const _0x5318af=a179_0x199a96,_0x1d3cb5=_0x49a57d[_0x5318af(0xf1)]('id'),_0x5a6bd0=readPatch(_0x49a57d),_0xf0fae8=await getRoleById(_0x49a57d[_0x5318af(0xe3)],_0x1d3cb5);return assertCustomRole(_0xf0fae8,_0x5318af(0xdc)),asDryRunResult({'scope':_0x5318af(0xf0),'operation':_0x5318af(0xdc),'selector':{'appCode':_0x49a57d[_0x5318af(0xe3)],'roleId':_0x1d3cb5,'roleName':_0xf0fae8[_0x5318af(0xec)]},'before':projectRole(_0xf0fae8),'after':projectRole({..._0xf0fae8,..._0x5a6bd0[_0x5318af(0xec)]!==undefined?{'roleName':_0x5a6bd0[_0x5318af(0xec)]}:{},..._0x5a6bd0[_0x5318af(0xe7)]!==undefined?{'remark':_0x5a6bd0[_0x5318af(0xe7)]}:{}}),'dryRun':!![],'backend':{'method':_0x5318af(0xf2),'path':UPDATE_PATH},'warnings':[]},{'method':_0x5318af(0xf2),'url':UPDATE_PATH});},async 'execute'(_0x424b26){const _0x1eda12=a179_0x199a96,_0x21adfc=_0x424b26[_0x1eda12(0xf1)]('id'),_0x443c1a=readPatch(_0x424b26),_0x9e069e=await getRoleById(_0x424b26['appCode'],_0x21adfc);assertCustomRole(_0x9e069e,_0x1eda12(0xdc)),await updateAppRole({'id':_0x21adfc,'appCode':_0x424b26[_0x1eda12(0xe3)],..._0x443c1a[_0x1eda12(0xec)]!==undefined?{'roleName':_0x443c1a[_0x1eda12(0xec)]}:{},..._0x443c1a[_0x1eda12(0xe7)]!==undefined?{'remark':_0x443c1a['remark']}:{}});const _0x5a2f65=await getRoleById(_0x424b26['appCode'],_0x21adfc);return{'ok':!![],'data':{'scope':_0x1eda12(0xf0),'operation':_0x1eda12(0xdc),'selector':{'appCode':_0x424b26['appCode'],'roleId':_0x21adfc,'roleName':_0x5a2f65[_0x1eda12(0xec)]},'before':projectRole(_0x9e069e),'after':projectRole(_0x5a2f65),'dryRun':![],'backend':{'method':_0x1eda12(0xf2),'path':UPDATE_PATH},'warnings':[]},'message':_0x1eda12(0xed)+_0x5a2f65['roleName']+'\x20(id='+_0x21adfc+')'};}};
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 +1 @@
1
- const a180_0x5e6e13=a180_0x4f5e;(function(_0x14e424,_0x4b2c2a){const _0x31c7a6=a180_0x4f5e,_0x4d04c9=_0x14e424();while(!![]){try{const _0x3de6f6=parseInt(_0x31c7a6(0x107))/0x1+parseInt(_0x31c7a6(0x101))/0x2+parseInt(_0x31c7a6(0x106))/0x3*(parseInt(_0x31c7a6(0x10f))/0x4)+parseInt(_0x31c7a6(0xfc))/0x5*(parseInt(_0x31c7a6(0x100))/0x6)+parseInt(_0x31c7a6(0xf9))/0x7+-parseInt(_0x31c7a6(0x10d))/0x8*(-parseInt(_0x31c7a6(0xfd))/0x9)+parseInt(_0x31c7a6(0x10b))/0xa*(-parseInt(_0x31c7a6(0x105))/0xb);if(_0x3de6f6===_0x4b2c2a)break;else _0x4d04c9['push'](_0x4d04c9['shift']());}catch(_0x4f9149){_0x4d04c9['push'](_0x4d04c9['shift']());}}}(a180_0x22c8,0xe3625));import{createDevUserRole}from'../../core/api-client.js';function a180_0x22c8(){const _0x4cabd0=['11309802eQsefn','\x20to\x20role\x20','appCode','5ycZoNG','45XHPShc','role','\x20already\x20in\x20role\x20','3290616JKnJjM','3308624ZNNEXy','Added\x20user\x20','roleType','user-add','363NGzZAa','1056858hAWAWH','1044184Vxkfrv','roleName','high-risk-write','selector','2104690YpiWae','POST','2568128KKmMTQ','userId','16adnapS','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes'];a180_0x22c8=function(){return _0x4cabd0;};return a180_0x22c8();}function a180_0x4f5e(_0xe0e9c1,_0x3be1f8){_0xe0e9c1=_0xe0e9c1-0xf8;const _0x22c80d=a180_0x22c8();let _0x4f5e1d=_0x22c80d[_0xe0e9c1];return _0x4f5e1d;}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_0x5e6e13(0xfe),'command':a180_0x5e6e13(0x104),'description':a180_0x5e6e13(0xf8),'risk':a180_0x5e6e13(0x109),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x75952e){const _0x422f24=a180_0x5e6e13,{mutation:_0x1d4769}=await prepareUserMutation(_0x75952e,_0x422f24(0x104),!![]);return asDryRunResult(_0x1d4769,{'method':_0x422f24(0x10c),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x5dafb6){const _0x4b820b=a180_0x5e6e13,{mutation:_0xc2226f,changed:_0x5d493c,role:_0xec8880,user:_0x278af3}=await prepareUserMutation(_0x5dafb6,_0x4b820b(0x104),![]);return _0x5d493c&&await createDevUserRole({'appCode':_0x5dafb6[_0x4b820b(0xfb)],'userId':_0x278af3['userId'],'username':_0x278af3['username'],'roleType':_0xec8880[_0x4b820b(0x103)],'roleId':_0xc2226f[_0x4b820b(0x10a)]['roleId']}),{'ok':!![],'data':_0xc2226f,'message':_0x5d493c?_0x4b820b(0x102)+_0xc2226f[_0x4b820b(0x10a)][_0x4b820b(0x10e)]+_0x4b820b(0xfa)+_0xc2226f[_0x4b820b(0x10a)][_0x4b820b(0x108)]:'No\x20change:\x20user\x20'+_0xc2226f['selector'][_0x4b820b(0x10e)]+_0x4b820b(0xff)+_0xc2226f[_0x4b820b(0x10a)]['roleName']};}};
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 +1 @@
1
- const a181_0x39e7f2=a181_0x4ca2;(function(_0x1484b0,_0x5915e1){const _0x199844=a181_0x4ca2,_0x42599e=_0x1484b0();while(!![]){try{const _0x59f2a1=parseInt(_0x199844(0x18f))/0x1*(parseInt(_0x199844(0x19f))/0x2)+-parseInt(_0x199844(0x195))/0x3+parseInt(_0x199844(0x19c))/0x4+parseInt(_0x199844(0x196))/0x5+parseInt(_0x199844(0x190))/0x6+parseInt(_0x199844(0x19a))/0x7*(parseInt(_0x199844(0x1a1))/0x8)+-parseInt(_0x199844(0x1a0))/0x9;if(_0x59f2a1===_0x5915e1)break;else _0x42599e['push'](_0x42599e['shift']());}catch(_0x49ab22){_0x42599e['push'](_0x42599e['shift']());}}}(a181_0xd7a4,0xc58ec));import{deleteDevUserRole}from'../../core/api-client.js';function a181_0xd7a4(){const _0x5089dc=['user-remove','6027656sajUVt','userId','role','2YTZcLG','24465006WYLATm','344nRPiME','1559033OEGcAE','2024796KwpoGL','roleName','\x20not\x20in\x20role\x20','high-risk-write','selector','4247115CxGosJ','2405380MMyNal','No\x20change:\x20user\x20','\x20from\x20role\x20','Removed\x20user\x20','172354qdwzYq'];a181_0xd7a4=function(){return _0x5089dc;};return a181_0xd7a4();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a181_0x4ca2(_0x5196a6,_0x399daf){_0x5196a6=_0x5196a6-0x18f;const _0xd7a448=a181_0xd7a4();let _0x4ca270=_0xd7a448[_0x5196a6];return _0x4ca270;}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':a181_0x39e7f2(0x19e),'command':a181_0x39e7f2(0x19b),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a181_0x39e7f2(0x193),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x181f24){const _0x4dded0=a181_0x39e7f2,{mutation:_0x569ca7}=await prepareUserMutation(_0x181f24,_0x4dded0(0x19b),!![]);return asDryRunResult(_0x569ca7,{'method':'POST','url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x4fa2b1){const _0xe63226=a181_0x39e7f2,{matchingRelationIds:_0x3d805f,mutation:_0xf72bb8,changed:_0x11fb98}=await prepareUserMutation(_0x4fa2b1,_0xe63226(0x19b),![]);if(_0x11fb98)for(const _0x59944b of _0x3d805f){await deleteDevUserRole(_0x59944b);}return{'ok':!![],'data':_0xf72bb8,'message':_0x11fb98?_0xe63226(0x199)+_0xf72bb8['selector'][_0xe63226(0x19d)]+_0xe63226(0x198)+_0xf72bb8[_0xe63226(0x194)][_0xe63226(0x191)]:_0xe63226(0x197)+_0xf72bb8[_0xe63226(0x194)]['userId']+_0xe63226(0x192)+_0xf72bb8[_0xe63226(0x194)][_0xe63226(0x191)]};}};
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 +1 @@
1
- function a182_0x5d9e(_0x4a510f,_0x40b93f){_0x4a510f=_0x4a510f-0x138;const _0x463b1f=a182_0x463b();let _0x5d9e39=_0x463b1f[_0x4a510f];return _0x5d9e39;}const a182_0x86ea78=a182_0x5d9e;(function(_0x2c29ae,_0x180bfc){const _0xd31dd9=a182_0x5d9e,_0x5ca48f=_0x2c29ae();while(!![]){try{const _0x43ff27=parseInt(_0xd31dd9(0x13c))/0x1*(parseInt(_0xd31dd9(0x13f))/0x2)+parseInt(_0xd31dd9(0x138))/0x3+-parseInt(_0xd31dd9(0x147))/0x4+parseInt(_0xd31dd9(0x141))/0x5*(-parseInt(_0xd31dd9(0x14b))/0x6)+-parseInt(_0xd31dd9(0x148))/0x7+parseInt(_0xd31dd9(0x13b))/0x8+parseInt(_0xd31dd9(0x14a))/0x9;if(_0x43ff27===_0x180bfc)break;else _0x5ca48f['push'](_0x5ca48f['shift']());}catch(_0x527423){_0x5ca48f['push'](_0x5ca48f['shift']());}}}(a182_0x463b,0xc898f));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a182_0x86ea78(0x14d),'description':a182_0x86ea78(0x14f),'risk':a182_0x86ea78(0x149),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4b1270){const _0x1673be=a182_0x86ea78;if(!_0x4b1270[_0x1673be(0x139)](_0x1673be(0x13d))[_0x1673be(0x146)]())throw CliErrors[_0x1673be(0x13e)](_0x1673be(0x13d),_0x1673be(0x14c));},async 'execute'(_0x3ecaab){const _0x42f7e8=a182_0x86ea78,_0x5896a5=_0x3ecaab[_0x42f7e8(0x139)](_0x42f7e8(0x13d))['trim'](),_0x17b1bd=await resolveUserRef(_0x5896a5,_0x42f7e8(0x140));return{'ok':!![],'data':{'user':{'userId':_0x17b1bd['userId'],'username':_0x17b1bd[_0x42f7e8(0x145)],'nickname':_0x17b1bd[_0x42f7e8(0x144)],'matchedBy':_0x17b1bd[_0x42f7e8(0x14e)]}},'message':_0x42f7e8(0x143)+_0x5896a5+_0x42f7e8(0x142)+_0x17b1bd[_0x42f7e8(0x13a)]};}};function a182_0x463b(){const _0x5b3abf=['Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','3345483HzhWGq','str','userId','583856LTfcbu','25QwhvEF','name','flagMissing','103066eVSlVS','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','25UUWYLt','\x22\x20→\x20userId\x20','Resolved\x20\x22','nickname','username','trim','698316EGwxtS','8460515ndHWKo','read','3819852IfIamq','835230IePveX','Pass\x20--name\x20<nickname|username>.','user-resolve','matchedBy'];a182_0x463b=function(){return _0x5b3abf;};return a182_0x463b();}
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 +1 @@
1
- function a183_0x1416(_0xd2e3e6,_0x45f40a){_0xd2e3e6=_0xd2e3e6-0x91;const _0x197ab0=a183_0x197a();let _0x14165f=_0x197ab0[_0xd2e3e6];return _0x14165f;}const a183_0x2a2361=a183_0x1416;(function(_0x18b119,_0x5488ba){const _0x2327ab=a183_0x1416,_0x2888be=_0x18b119();while(!![]){try{const _0x4cb27f=-parseInt(_0x2327ab(0xb4))/0x1*(-parseInt(_0x2327ab(0xba))/0x2)+-parseInt(_0x2327ab(0xc2))/0x3+-parseInt(_0x2327ab(0x9a))/0x4*(parseInt(_0x2327ab(0xb6))/0x5)+-parseInt(_0x2327ab(0x95))/0x6*(-parseInt(_0x2327ab(0x97))/0x7)+-parseInt(_0x2327ab(0x99))/0x8+parseInt(_0x2327ab(0xad))/0x9+parseInt(_0x2327ab(0x93))/0xa;if(_0x4cb27f===_0x5488ba)break;else _0x2888be['push'](_0x2888be['shift']());}catch(_0x1e4daf){_0x2888be['push'](_0x2888be['shift']());}}}(a183_0x197a,0xb0819));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';function a183_0x197a(){const _0x2cabef=['inherit','push','has','Available:\x20','\x20\x20\x20\x20','vite\x20preview\x20exited\x20with\x20code\x20','build','pnpm-lock.yaml','needsUpgrade','Enable\x20watch\x20mode\x20for\x20preview','Run\x20a\x20package.json\x20script','close','6595173oorgeI','preview','package.json','npm','keys','\x20\x20EXAMPLES','bun','1lymISz','length','5EEBAAW','error','parse','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','331710WEXDFN','--watch','vite','log','write','run','all','dev','836550CoMPJg','start','node_modules','\x0a\x20\x20Usage:\x20','watch','validation','\x20run\x20start','boolean','args','\x20exited\x20with\x20code\x20','\x20run\x20<script>\x0a','utf-8','slice','yarn.lock','17431300LcpzIm','Script\x20name\x20defined\x20in\x20package.json','6MZMFfZ','bool','1627157tIwAms','.bin','8036328UOthxz','3471492rHCXxS','\x20run\x20','join','bun.lockb','\x22\x20not\x20found\x20in\x20package.json.','\x0a\x20\x20Available\x20scripts:\x0a','pnpm'];a183_0x197a=function(){return _0x2cabef;};return a183_0x197a();}const VERSION_CHECK_SCRIPTS=new Set([a183_0x2a2361(0xc3),a183_0x2a2361(0xc1)]);function readPackageScripts(_0x1a362e){const _0x37052d=a183_0x2a2361,_0x19729e=resolve(_0x1a362e,_0x37052d(0xaf));if(!existsSync(_0x19729e))return null;try{const _0x4d8d20=JSON[_0x37052d(0xb8)](readFileSync(_0x19729e,_0x37052d(0xcd)));return _0x4d8d20['scripts']??{};}catch{return null;}}function detectPackageManager(_0x266cb4){const _0x160938=a183_0x2a2361;if(existsSync(resolve(_0x266cb4,_0x160938(0x9d)))||existsSync(resolve(_0x266cb4,'bun.lock')))return _0x160938(0xb3);if(existsSync(resolve(_0x266cb4,_0x160938(0xa8))))return _0x160938(0xa0);if(existsSync(resolve(_0x266cb4,_0x160938(0x92))))return'yarn';return _0x160938(0xb0);}async function versionCheck(_0x3b6bde){const _0x14ff60=a183_0x2a2361,_0x40409d=await checkCliVersion();(_0x40409d[_0x14ff60(0xa9)]||_0x40409d['belowMinimum'])&&(printCliUpgradeWarning(_0x40409d),assertCliVersionSupported(_0x40409d));const _0x1396b0=await checkSdkVersion(_0x3b6bde);if(_0x1396b0[_0x14ff60(0xa9)])printSdkUpgradeWarning(_0x1396b0);}function spawnScript(_0x176f08,_0x2ef861,_0x25fe94,_0x576d85){return new Promise((_0xa0d5d8,_0x4a7079)=>{const _0x19ee60=a183_0x1416,_0x1f71bf=[_0x19ee60(0xbf),_0x2ef861,..._0x25fe94],_0x41c5ce=spawn(_0x176f08,_0x1f71bf,{'cwd':_0x576d85,'stdio':_0x19ee60(0xa1),'shell':!![],'env':{...process.env,'PATH':''+join(_0x576d85,_0x19ee60(0xc4),_0x19ee60(0x98))+delimiter+process.env.PATH}});_0x41c5ce['on'](_0x19ee60(0xac),_0x256023=>{const _0x450f71=_0x19ee60;if(_0x256023===0x0||_0x256023===null)_0xa0d5d8();else _0x4a7079(new Error(_0x176f08+_0x450f71(0x9b)+_0x2ef861+_0x450f71(0xcb)+_0x256023));}),_0x41c5ce['on'](_0x19ee60(0xb7),_0x4a7079);});}function spawnViteBuildWatch(_0xa85202){return new Promise((_0x3f4cdf,_0xde92f8)=>{const _0xbe01db=a183_0x1416,_0x52fdf9=spawn(_0xbe01db(0xbc),[_0xbe01db(0xa7),_0xbe01db(0xbb)],{'cwd':_0xa85202,'stdio':_0xbe01db(0xa1),'shell':!![],'env':{...process.env,'PATH':''+join(_0xa85202,_0xbe01db(0xc4),'.bin')+delimiter+process.env.PATH}});_0x52fdf9['on'](_0xbe01db(0xac),_0x57fafe=>{const _0x42ae1e=_0xbe01db;if(_0x57fafe===0x0||_0x57fafe===null)_0x3f4cdf();else _0xde92f8(new Error(_0x42ae1e(0xb9)+_0x57fafe));}),_0x52fdf9['on'](_0xbe01db(0xb7),_0xde92f8);});}function spawnVitePreview(_0x1989ac){return new Promise((_0x25b323,_0x526e75)=>{const _0x11cf6c=a183_0x1416,_0x321c7b=spawn(_0x11cf6c(0xbc),[_0x11cf6c(0xae)],{'cwd':_0x1989ac,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x1989ac,_0x11cf6c(0xc4),_0x11cf6c(0x98))+delimiter+process.env.PATH}});_0x321c7b['on'](_0x11cf6c(0xac),_0x45a31c=>{const _0x303b71=_0x11cf6c;if(_0x45a31c===0x0||_0x45a31c===null)_0x25b323();else _0x526e75(new Error(_0x303b71(0xa6)+_0x45a31c));}),_0x321c7b['on'](_0x11cf6c(0xb7),_0x526e75);});}const runFlags=[{'name':a183_0x2a2361(0xc6),'type':a183_0x2a2361(0xc9),'description':a183_0x2a2361(0xaa),'default':![]}];export const runDefinition={'service':a183_0x2a2361(0xbf),'command':a183_0x2a2361(0xbf),'description':a183_0x2a2361(0xab),'risk':a183_0x2a2361(0xbe),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a183_0x2a2361(0x94),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x385e38=a183_0x2a2361,_0x4a1ae6=[];return _0x4a1ae6['push'](_0x385e38(0xb2)),_0x4a1ae6['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x385e38(0xc8)),_0x4a1ae6['push'](_0x385e38(0xa5)+CLI_BIN_NAME+'\x20run\x20build'),_0x4a1ae6[_0x385e38(0xa2)](_0x385e38(0xa5)+CLI_BIN_NAME+'\x20run\x20preview'),_0x4a1ae6[_0x385e38(0xa2)](_0x385e38(0xa5)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x4a1ae6[_0x385e38(0x9c)]('\x0a');},async 'execute'(_0x510000){const _0xd3b93e=a183_0x2a2361,_0x2dad93=process['cwd'](),_0x258108=_0x510000[_0xd3b93e(0xca)][0x0],_0x5e1e5d=_0x510000['args'][_0xd3b93e(0x91)](0x1),_0x3b59b6=readPackageScripts(_0x2dad93);if(!_0x3b59b6)throw CliErrors[_0xd3b93e(0xc7)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x258108){const _0x3ac88a=Object[_0xd3b93e(0xb1)](_0x3b59b6);if(_0x3ac88a[_0xd3b93e(0xb5)]===0x0)console[_0xd3b93e(0xbd)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console[_0xd3b93e(0xbd)](_0xd3b93e(0x9f));for(const _0x3ec905 of _0x3ac88a){console[_0xd3b93e(0xbd)](_0xd3b93e(0xa5)+_0x3ec905);}console[_0xd3b93e(0xbd)](_0xd3b93e(0xc5)+CLI_BIN_NAME+_0xd3b93e(0xcc));}return{'ok':!![]};}if(!_0x3b59b6[_0x258108])throw CliErrors['validation']('Script\x20\x22'+_0x258108+_0xd3b93e(0x9e),_0xd3b93e(0xa4)+(Object[_0xd3b93e(0xb1)](_0x3b59b6)['join'](',\x20')||'(none)'));const _0x2ebfda=detectPackageManager(_0x2dad93);VERSION_CHECK_SCRIPTS[_0xd3b93e(0xa3)](_0x258108)&&await versionCheck(_0x2dad93);if(_0x258108===_0xd3b93e(0xae)&&_0x510000[_0xd3b93e(0x96)]('watch'))return await Promise[_0xd3b93e(0xc0)]([spawnViteBuildWatch(_0x2dad93),spawnVitePreview(_0x2dad93)]),{'ok':!![]};return await spawnScript(_0x2ebfda,_0x258108,_0x5e1e5d,_0x2dad93),{'ok':!![]};}};
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 +1 @@
1
- const a184_0x2c179d=a184_0x13d0;function a184_0x13d0(_0x525856,_0x47b496){_0x525856=_0x525856-0x71;const _0xda73=a184_0xda73();let _0x13d018=_0xda73[_0x525856];return _0x13d018;}(function(_0x44273b,_0x3718fb){const _0x33c004=a184_0x13d0,_0x5c4713=_0x44273b();while(!![]){try{const _0x27c648=-parseInt(_0x33c004(0x79))/0x1*(-parseInt(_0x33c004(0x78))/0x2)+parseInt(_0x33c004(0x75))/0x3+-parseInt(_0x33c004(0x77))/0x4*(-parseInt(_0x33c004(0x71))/0x5)+parseInt(_0x33c004(0x7d))/0x6*(parseInt(_0x33c004(0x73))/0x7)+parseInt(_0x33c004(0x76))/0x8+parseInt(_0x33c004(0x7c))/0x9+-parseInt(_0x33c004(0x7b))/0xa;if(_0x27c648===_0x3718fb)break;else _0x5c4713['push'](_0x5c4713['shift']());}catch(_0x17291e){_0x5c4713['push'](_0x5c4713['shift']());}}}(a184_0xda73,0xe2c57));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1e4836){const _0x5b3621=await buildSchemaPayload();return{'ok':!![],'data':_0x5b3621};}export const schemaDefinition={'service':a184_0x2c179d(0x74),'command':a184_0x2c179d(0x72),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a184_0x2c179d(0x7e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a184_0x2c179d(0x7a),'flags':[],'execute':execute};function a184_0xda73(){const _0x23158f=['2128vQCRdh','schema','2526195ctuWFf','11316448DerOGk','28XCoaFj','74ayqGBi','24913DrwKzJ','json','61204940vnkeoU','9827055noWVBa','27726lNqlGU','read','981620RKeRus','export'];a184_0xda73=function(){return _0x23158f;};return a184_0xda73();}
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 +1 @@
1
- const a185_0x549dc7=a185_0x5265;(function(_0x46a6a8,_0x34b2a3){const _0x48bae7=a185_0x5265,_0x575eed=_0x46a6a8();while(!![]){try{const _0x15ff3e=parseInt(_0x48bae7(0x13b))/0x1*(-parseInt(_0x48bae7(0x102))/0x2)+-parseInt(_0x48bae7(0x12d))/0x3*(parseInt(_0x48bae7(0x13e))/0x4)+parseInt(_0x48bae7(0x12b))/0x5*(parseInt(_0x48bae7(0x109))/0x6)+parseInt(_0x48bae7(0xf8))/0x7+-parseInt(_0x48bae7(0x10d))/0x8*(-parseInt(_0x48bae7(0x12e))/0x9)+parseInt(_0x48bae7(0xf7))/0xa*(parseInt(_0x48bae7(0x11c))/0xb)+-parseInt(_0x48bae7(0x119))/0xc*(parseInt(_0x48bae7(0x10f))/0xd);if(_0x15ff3e===_0x34b2a3)break;else _0x575eed['push'](_0x575eed['shift']());}catch(_0x478276){_0x575eed['push'](_0x575eed['shift']());}}}(a185_0x4cb3,0x7a015));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(_0x3c7c2b){const _0x195d97=a185_0x5265;if(_0x3c7c2b==='mybatisXml')return[_0x195d97(0x117),_0x195d97(0xfb),_0x195d97(0x131),''][_0x195d97(0x12f)]('\x0a');return[_0x195d97(0x121),''][_0x195d97(0x12f)]('\x0a');}export const sqlCreate={'service':a185_0x549dc7(0x137),'command':a185_0x549dc7(0x128),'description':a185_0x549dc7(0x113),'risk':a185_0x549dc7(0x130),'flags':[{'name':'name','type':'string','description':a185_0x549dc7(0x122)},{'name':a185_0x549dc7(0x115),'type':a185_0x549dc7(0x118),'description':a185_0x549dc7(0x124)},{'name':a185_0x549dc7(0x103),'type':a185_0x549dc7(0x135),'enum':['sql',a185_0x549dc7(0x105)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x5245a5){const _0xea3f13=a185_0x549dc7;if(!_0x5245a5[_0xea3f13(0x13a)])return;if(!_0x5245a5[_0xea3f13(0x125)](_0xea3f13(0xfd))['trim']())throw CliErrors[_0xea3f13(0x129)]('name','--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x46ebf4=resolveProvidedDbId(_0x5245a5);if(typeof _0x46ebf4!=='number'||!Number[_0xea3f13(0x139)](_0x46ebf4)||_0x46ebf4<=0x0)throw CliErrors[_0xea3f13(0x129)]('db-id',_0xea3f13(0x126));if(!_0x5245a5[_0xea3f13(0x125)](_0xea3f13(0x103))[_0xea3f13(0x114)]())throw CliErrors[_0xea3f13(0x129)](_0xea3f13(0x103),_0xea3f13(0x100));},async 'dryRun'(_0x18fb11){const _0x16a2b3=a185_0x549dc7,_0xd4e307=loadSqlProjectConfig(_0x18fb11['appCode']),{sqlName:_0x52f1d6,dbId:_0x5160ce,dbName:_0x51b5ad,mode:_0x12d2aa}=await resolveSqlNewInputs(_0x18fb11),_0x21250a=buildSqlRelativePath(_0x16a2b3(0xf9),_0x52f1d6,_0x51b5ad,_0x12d2aa,_0x5160ce),_0x2b9d1d=_0xd4e307[_0x16a2b3(0x11f)]+'/'+_0x21250a;return{'method':_0x16a2b3(0xfc),'url':_0x16a2b3(0xff),'body':{'appCode':_0x18fb11[_0x16a2b3(0x112)],'sqlName':_0x52f1d6,'dbId':_0x5160ce,'mode':_0x12d2aa,'localPath':_0x2b9d1d},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0xd4e307[_0x16a2b3(0x11f)]};},async 'execute'(_0x468ebb){const _0x316043=a185_0x549dc7,_0x24081c=loadSqlProjectConfig(_0x468ebb[_0x316043(0x112)]),{sqlName:_0x3b8bc7,dbId:_0x3c94ab,dbName:_0x5732ff,mode:_0xfe1c4d}=await resolveSqlNewInputs(_0x468ebb),_0xd93ca4=generateSqlTemplate(_0xfe1c4d),_0x53abf0=await createSqlQuery({'appCode':_0x468ebb[_0x316043(0x112)],'sqlName':_0x3b8bc7,'dbId':_0x3c94ab,'sqlContent':_0xd93ca4}),_0x12b0f4=ensureRemoteSqlContent(_0x53abf0),_0x1e5e40=_0x5732ff||await getDbName(_0x468ebb['appCode'],_0x3c94ab)[_0x316043(0x111)](()=>undefined),_0x344604=buildSqlRelativePath(_0x53abf0[_0x316043(0x138)],_0x53abf0[_0x316043(0x10a)],_0x1e5e40,_0xfe1c4d,_0x3c94ab),_0x596045=_0x24081c[_0x316043(0x11f)]+'/'+_0x344604,_0xb52678=buildLocalSqlFileContent({'sqlCode':_0x53abf0[_0x316043(0x138)],'sqlName':_0x53abf0['sqlName'],'dbId':_0x53abf0[_0x316043(0x11b)]},_0x12b0f4,{'dbName':_0x1e5e40,'mode':_0xfe1c4d,'syncedAt':new Date()[_0x316043(0x106)](),'description':_0x53abf0[_0x316043(0xfe)]});if(await fileExists(_0x596045))throw CliErrors[_0x316043(0x13c)](_0x316043(0x101)+_0x596045);await ensureParentDirectory(_0x596045),await writeFile(_0x596045,_0xb52678,_0x316043(0x12c));const _0x238feb=await readSqlLockFile(_0x24081c[_0x316043(0x107)]),{lockData:_0xb57c4,appLock:_0x5490a6}=ensureSqlLockScope(_0x238feb??createEmptySqlLock(),_0x24081c['appCode'],_0x24081c[_0x316043(0x127)],'new');return _0x5490a6[_0x316043(0x116)][_0x53abf0[_0x316043(0x138)]]={...buildSqlLockEntry(_0x53abf0,_0x12b0f4,computeSqlContentHash(_0xb52678),{'dbName':_0x1e5e40}),'path':_0x344604,'mode':_0xfe1c4d},_0x5490a6[_0x316043(0x120)]=new Date()[_0x316043(0x106)](),await writeSqlLockFile(_0x24081c['lockFilePath'],_0xb57c4),{'ok':!![],'data':{'id':_0x53abf0['id'],'sqlCode':_0x53abf0[_0x316043(0x138)],'sqlName':_0x53abf0[_0x316043(0x10a)],'dbId':_0x53abf0[_0x316043(0x11b)],'path':_0x596045,'mode':_0xfe1c4d},'message':_0x316043(0x104)+_0x53abf0[_0x316043(0x138)]};}};async function resolveSqlNewInputs(_0x148574){const _0x1a3b99=await resolveSqlNameInput(_0x148574),{dbId:_0x4dd2a1,dbName:_0x528a7c}=await resolveDbSelection(_0x148574),_0x93eb40=await resolveSqlModeInput(_0x148574);return{'sqlName':_0x1a3b99,'dbId':_0x4dd2a1,'dbName':_0x528a7c,'mode':_0x93eb40};}async function resolveSqlNameInput(_0xc18e11){const _0x3af86d=a185_0x549dc7,_0x2a850d=_0xc18e11[_0x3af86d(0x125)]('name')['trim']();if(_0x2a850d)return _0x2a850d;if(_0xc18e11['nonInteractive'])throw CliErrors[_0x3af86d(0x129)](_0x3af86d(0xfd),_0x3af86d(0x13f));return(await input({'message':_0x3af86d(0x10b),'validate':_0x5d5025=>_0x5d5025[_0x3af86d(0x114)]()?!![]:'SQL\x20name\x20cannot\x20be\x20empty'}))[_0x3af86d(0x114)]();}async function resolveDbSelection(_0x5c9b44){const _0x1a8b97=a185_0x549dc7,_0x154874=resolveProvidedDbId(_0x5c9b44);if(typeof _0x154874==='number'&&Number[_0x1a8b97(0x139)](_0x154874)&&_0x154874>0x0)return{'dbId':_0x154874,'dbName':await getDbName(_0x5c9b44[_0x1a8b97(0x112)],_0x154874)[_0x1a8b97(0x111)](()=>undefined)};if(_0x5c9b44['nonInteractive'])throw CliErrors['flagMissing'](_0x1a8b97(0x115),_0x1a8b97(0x126));const _0x566612=await listDatabases(_0x5c9b44['appCode'])[_0x1a8b97(0x111)](()=>[]);if(_0x566612['length']===0x1)return{'dbId':_0x566612[0x0][_0x1a8b97(0x11b)],'dbName':_0x566612[0x0][_0x1a8b97(0x10c)]};if(_0x566612[_0x1a8b97(0x108)]>0x1){const _0x47c601=await select({'message':_0x1a8b97(0x133),'choices':[..._0x566612[_0x1a8b97(0x136)](_0x1b8529=>({'name':_0x1b8529['dbName']+'\x20('+_0x1b8529[_0x1a8b97(0x11b)]+')','value':serializeDbSelection(_0x1b8529)})),{'name':_0x1a8b97(0x110),'value':_0x1a8b97(0x10e)}]});if(_0x47c601!==_0x1a8b97(0x10e))return deserializeDbSelection(_0x47c601);}const _0x415847=await input({'message':_0x1a8b97(0x134),'validate':_0x5e3bf5=>{const _0x32c645=_0x1a8b97,_0x26d873=_0x5e3bf5[_0x32c645(0x114)]();if(!_0x26d873)return'dbId\x20cannot\x20be\x20empty';const _0x2fd624=Number(_0x26d873);if(!Number['isInteger'](_0x2fd624)||_0x2fd624<=0x0)return _0x32c645(0x123);return!![];}});return{'dbId':Number(_0x415847[_0x1a8b97(0x114)]())};}function a185_0x5265(_0x2b4556,_0x5a1e5d){_0x2b4556=_0x2b4556-0xf7;const _0x4cb30f=a185_0x4cb3();let _0x52656b=_0x4cb30f[_0x2b4556];return _0x52656b;}function a185_0x4cb3(){const _0x31abe3=['create','flagMissing','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','115BWyLbd','utf8','12210RarwGx','2979afeVLR','join','write','</select>','Select\x20the\x20local\x20SQL\x20mode:','Select\x20the\x20target\x20database:','Target\x20database\x20dbId:','string','map','sql','sqlCode','isFinite','nonInteractive','244PuZJYs','validation','MyBatis\x20XML\x20(mybatisXml)','8pMSACw','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','1402510RNIMMS','5570397DdKDgz','<server-generated-sqlCode>','Invalid\x20database\x20selection\x20payload:\x20','\x20\x20SELECT\x201\x20AS\x20id','POST','name','description','/smartapi/custom/saveUserCustomSql','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','File\x20already\x20exists:\x20','3212ObFifs','mode','Created\x20SQL\x20query\x20','mybatisXml','toISOString','lockFilePath','length','115302QndGXs','sqlName','SQL\x20name:','dbName','14712qqxBZb','__manual__','14130805keqQzI','✎\x20Enter\x20dbId\x20manually','catch','appCode','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','trim','db-id','sqls','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','number','12kLOTDs','parse','dbId','11vuHslQ','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','Plain\x20SQL\x20(sql)','sqlRootDir','lastSync','SELECT\x201\x20AS\x20id;','SQL\x20query\x20display\x20name','dbId\x20must\x20be\x20a\x20positive\x20integer','Target\x20database\x20ID','str','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlRoot'];a185_0x4cb3=function(){return _0x31abe3;};return a185_0x4cb3();}async function resolveSqlModeInput(_0x2f20b3){const _0x56a770=a185_0x549dc7,_0x228dc9=_0x2f20b3[_0x56a770(0x125)]('mode')[_0x56a770(0x114)]();if(_0x228dc9===_0x56a770(0x137)||_0x228dc9===_0x56a770(0x105))return _0x228dc9;if(_0x2f20b3['nonInteractive'])throw CliErrors['flagMissing'](_0x56a770(0x103),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x56a770(0x132),'choices':[{'name':_0x56a770(0x11e),'value':'sql','description':_0x56a770(0x11d)},{'name':_0x56a770(0x13d),'value':'mybatisXml','description':_0x56a770(0x12a)}]});}function serializeDbSelection(_0x27902a){const _0x2a257f=a185_0x549dc7;return JSON['stringify']({'dbId':_0x27902a[_0x2a257f(0x11b)],'dbName':_0x27902a[_0x2a257f(0x10c)]});}function deserializeDbSelection(_0x3ce428){const _0x3c7fcd=a185_0x549dc7;try{const _0x2b5493=JSON[_0x3c7fcd(0x11a)](_0x3ce428);if(typeof _0x2b5493['dbId']==='number'&&Number['isFinite'](_0x2b5493[_0x3c7fcd(0x11b)]))return{'dbId':_0x2b5493[_0x3c7fcd(0x11b)],'dbName':_0x2b5493[_0x3c7fcd(0x10c)]};}catch{}throw CliErrors[_0x3c7fcd(0x13c)](_0x3c7fcd(0xfa)+_0x3ce428);}function resolveProvidedDbId(_0x4c3cd8){const _0x1b4e9b=a185_0x549dc7,_0x30f258=_0x4c3cd8['flag'](_0x1b4e9b(0x115));if(typeof _0x30f258===_0x1b4e9b(0x118)&&Number[_0x1b4e9b(0x139)](_0x30f258))return _0x30f258;return undefined;}
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 +1 @@
1
- const a186_0x2e6dcf=a186_0x25e6;(function(_0x4977cc,_0x3aea61){const _0x401381=a186_0x25e6,_0x73d3dd=_0x4977cc();while(!![]){try{const _0x59ac88=parseInt(_0x401381(0x142))/0x1+-parseInt(_0x401381(0x149))/0x2*(-parseInt(_0x401381(0x12c))/0x3)+parseInt(_0x401381(0x13f))/0x4+parseInt(_0x401381(0x126))/0x5*(-parseInt(_0x401381(0x13b))/0x6)+-parseInt(_0x401381(0x12e))/0x7*(parseInt(_0x401381(0x131))/0x8)+parseInt(_0x401381(0x14b))/0x9*(parseInt(_0x401381(0x132))/0xa)+-parseInt(_0x401381(0x147))/0xb*(parseInt(_0x401381(0x14a))/0xc);if(_0x59ac88===_0x3aea61)break;else _0x73d3dd['push'](_0x73d3dd['shift']());}catch(_0xae6097){_0x73d3dd['push'](_0x73d3dd['shift']());}}}(a186_0x1caa,0xf0807));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';function a186_0x25e6(_0x2966bd,_0x1866f5){_0x2966bd=_0x2966bd-0x125;const _0x1caaf4=a186_0x1caa();let _0x25e6f4=_0x1caaf4[_0x2966bd];return _0x25e6f4;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':a186_0x2e6dcf(0x130),'description':a186_0x2e6dcf(0x13a),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x4e9d72){const _0x5e8834=a186_0x2e6dcf,_0x449cdc=loadSqlProjectConfig(_0x4e9d72[_0x5e8834(0x12a)]),_0xbbfe02=await readSqlLockFile(_0x449cdc[_0x5e8834(0x144)]);if(!_0xbbfe02)throw CliErrors[_0x5e8834(0x128)](_0x5e8834(0x12d));},async 'dryRun'(_0x19e578){const _0x4d094c=a186_0x2e6dcf,_0x2d3e65=loadSqlProjectConfig(_0x19e578['appCode']),_0x30eea5=await readSqlLockFile(_0x2d3e65[_0x4d094c(0x144)]);if(!_0x30eea5)throw CliErrors[_0x4d094c(0x128)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x51a6f7}=ensureSqlLockScope(_0x30eea5,_0x19e578[_0x4d094c(0x12a)],_0x2d3e65[_0x4d094c(0x129)],_0x4d094c(0x130)),_0x5687af=_0x19e578[_0x4d094c(0x133)](_0x4d094c(0x145)),_0x40f5f3=_0x51a6f7[_0x4d094c(0x138)][_0x5687af];if(!_0x40f5f3)throw CliErrors[_0x4d094c(0x128)](_0x4d094c(0x127)+_0x5687af+'\x22.');return{'method':'POST','url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x5687af,'id':_0x40f5f3[_0x4d094c(0x134)],'localPath':resolveLocalSqlFilePath(_0x2d3e65,_0x5687af,_0x40f5f3)},'description':_0x4d094c(0x13e)+_0x5687af+_0x4d094c(0x13c)+_0x2d3e65[_0x4d094c(0x12b)]};},async 'execute'(_0x5ad086){const _0x354fe8=a186_0x2e6dcf,_0xd2bb5c=loadSqlProjectConfig(_0x5ad086[_0x354fe8(0x12a)]),_0x3beece=await readSqlLockFile(_0xd2bb5c['lockFilePath']);if(!_0x3beece)throw CliErrors['validation']('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x473745,appLock:_0x15c10e}=ensureSqlLockScope(_0x3beece,_0x5ad086['appCode'],_0xd2bb5c[_0x354fe8(0x129)],_0x354fe8(0x130)),_0x2c62d4=_0x5ad086['str']('sqlcode'),_0x1af7e4=_0x15c10e[_0x354fe8(0x138)][_0x2c62d4];if(!_0x1af7e4)throw CliErrors[_0x354fe8(0x128)](_0x354fe8(0x127)+_0x2c62d4+'\x22.');await deleteSqlQuery({'id':_0x1af7e4[_0x354fe8(0x134)],'sqlCode':_0x2c62d4}),_0x15c10e[_0x354fe8(0x138)]=Object[_0x354fe8(0x148)](Object[_0x354fe8(0x146)](_0x15c10e['sqls'])[_0x354fe8(0x137)](([_0x211572])=>_0x211572!==_0x2c62d4)),_0x15c10e[_0x354fe8(0x141)]=new Date()[_0x354fe8(0x140)](),await writeSqlLockFile(_0xd2bb5c[_0x354fe8(0x144)],_0x473745);const _0x442431=resolveLocalSqlFilePath(_0xd2bb5c,_0x2c62d4,_0x1af7e4);let _0x491a26;await fileExists(_0x442431)&&(_0x491a26=await moveToTrash(_0xd2bb5c[_0x354fe8(0x139)],_0xd2bb5c[_0x354fe8(0x12b)],_0x442431),await cleanupEmptyDirectories(dirname(_0x442431),_0xd2bb5c[_0x354fe8(0x12f)]));const _0x7673d5={'deleted':_0x2c62d4,'remoteId':_0x1af7e4[_0x354fe8(0x134)]};if(_0x491a26)_0x7673d5[_0x354fe8(0x143)]=_0x491a26;return{'ok':!![],'data':_0x7673d5,'message':_0x354fe8(0x13d)+_0x2c62d4+(_0x491a26?_0x354fe8(0x135):'')};}};async function moveToTrash(_0xeadf87,_0x58f1d7,_0x513330){const _0x1fe555=a186_0x2e6dcf,_0x1ba1e3=new Date()[_0x1fe555(0x140)]()[_0x1fe555(0x125)](/[:.]/g,'-'),_0xfc64a5=relative(_0xeadf87,_0x513330),_0x16bba4=join(_0x58f1d7,_0x1ba1e3,_0xfc64a5);return await mkdir(dirname(_0x16bba4),{'recursive':!![]}),await rename(_0x513330,_0x16bba4),_0x16bba4;}async function cleanupEmptyDirectories(_0x4b815b,_0x5b116f){const _0x2b1bae=a186_0x2e6dcf;let _0x9c0d31=resolve(_0x4b815b);const _0x4c5c25=resolve(_0x5b116f);while(_0x9c0d31[_0x2b1bae(0x136)](''+_0x4c5c25+sep)||_0x9c0d31===_0x4c5c25){if(_0x9c0d31===_0x4c5c25)return;try{const _0x29e5e8=await readdir(_0x9c0d31);if(_0x29e5e8['length']>0x0)return;await rmdir(_0x9c0d31);}catch{return;}_0x9c0d31=dirname(_0x9c0d31);}}function a186_0x1caa(){const _0x343a92=['sqlRoot','appCode','trashDir','188268kkwepF','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','9919VpZkuu','sqlRootDir','delete','6904gZYpHx','60ZQcZuo','str','remoteId','\x20(local\x20file\x20moved\x20to\x20trash)','startsWith','filter','sqls','projectRoot','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','1854puQLia','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','Deleted\x20','Would\x20delete\x20SQL\x20','6195384paLWTy','toISOString','lastSync','543540RnTkkj','trashedTo','lockFilePath','sqlcode','entries','688369LHLUwV','fromEntries','52HyUUYo','156FROxYY','1300293UZZENj','replace','25395gLuTNt','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','validation'];a186_0x1caa=function(){return _0x343a92;};return a186_0x1caa();}
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 +1 @@
1
- const a187_0x38759b=a187_0x58b7;function a187_0x58b7(_0x222e25,_0x5ef0bb){_0x222e25=_0x222e25-0x101;const _0x24c507=a187_0x24c5();let _0x58b723=_0x24c507[_0x222e25];return _0x58b723;}(function(_0x5d4767,_0x1dc476){const _0x58470c=a187_0x58b7,_0x52baa2=_0x5d4767();while(!![]){try{const _0x2c8c6e=parseInt(_0x58470c(0x101))/0x1+parseInt(_0x58470c(0x114))/0x2*(parseInt(_0x58470c(0x10c))/0x3)+parseInt(_0x58470c(0x103))/0x4+parseInt(_0x58470c(0x10b))/0x5+-parseInt(_0x58470c(0x10a))/0x6*(parseInt(_0x58470c(0x104))/0x7)+-parseInt(_0x58470c(0x106))/0x8+parseInt(_0x58470c(0x10d))/0x9*(-parseInt(_0x58470c(0x102))/0xa);if(_0x2c8c6e===_0x1dc476)break;else _0x52baa2['push'](_0x52baa2['shift']());}catch(_0x52cb11){_0x52baa2['push'](_0x52baa2['shift']());}}}(a187_0x24c5,0xed055));import{getSqlQueryInfo}from'../../core/api-client.js';function a187_0x24c5(){const _0x28fdc2=['1492888cmWvAJ','10PEnsDw','1125492rkrCha','7aRWRyg','Return\x20full\x20raw\x20SQL\x20query\x20object','14314656esApeD','sqlContent','bool','sqlcode','3535464uYuSGI','1880960DIMbXo','18uHizhR','386658edydEH','description','sqlName','str','sql','verbose','read','413974svIRLL','detail','dbId'];a187_0x24c5=function(){return _0x28fdc2;};return a187_0x24c5();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a187_0x38759b(0x111),'command':a187_0x38759b(0x115),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a187_0x38759b(0x113),'flags':[SQLCODE_FLAG,{'name':a187_0x38759b(0x112),'type':'boolean','description':a187_0x38759b(0x105)}],async 'execute'(_0x136066){const _0x5803a1=a187_0x38759b,_0x1c7b24=await getSqlQueryInfo(_0x136066['appCode'],_0x136066[_0x5803a1(0x110)](_0x5803a1(0x109))),_0x48d3e9=_0x136066[_0x5803a1(0x108)](_0x5803a1(0x112));if(_0x48d3e9)return{'ok':!![],'data':_0x1c7b24};const _0x225d9d=_0x1c7b24[_0x5803a1(0x116)]?await getDbName(_0x136066['appCode'],_0x1c7b24[_0x5803a1(0x116)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x1c7b24['sqlCode'],'sqlName':_0x1c7b24[_0x5803a1(0x10f)],'db':_0x225d9d?_0x225d9d+'\x20('+_0x1c7b24[_0x5803a1(0x116)]+')':_0x1c7b24[_0x5803a1(0x116)]??'','description':_0x1c7b24[_0x5803a1(0x10e)]??'','sqlContent':_0x1c7b24[_0x5803a1(0x107)]??''}};}};
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 +1 @@
1
- const a188_0x557468=a188_0x4920;(function(_0x2f921f,_0x4b5a31){const _0x243e93=a188_0x4920,_0x2f7906=_0x2f921f();while(!![]){try{const _0x493256=parseInt(_0x243e93(0x1b8))/0x1*(parseInt(_0x243e93(0x1c0))/0x2)+-parseInt(_0x243e93(0x1b6))/0x3+parseInt(_0x243e93(0x1ba))/0x4+parseInt(_0x243e93(0x1ac))/0x5*(parseInt(_0x243e93(0x1b0))/0x6)+parseInt(_0x243e93(0x1bf))/0x7*(parseInt(_0x243e93(0x1aa))/0x8)+parseInt(_0x243e93(0x1bc))/0x9+-parseInt(_0x243e93(0x1bd))/0xa;if(_0x493256===_0x4b5a31)break;else _0x2f7906['push'](_0x2f7906['shift']());}catch(_0x14ba9f){_0x2f7906['push'](_0x2f7906['shift']());}}}(a188_0x28ce,0x5b398));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a188_0x28ce(){const _0x5e58f5=['44106besoQg','str','execError','read','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','execResult','1102632ivZSHk','now','1JpseLi','Returned\x20','1602456JfQDGo','\x20row(s)\x20in\x20','4397337DWaWXk','7063890hhaMdj','appCode','14yidSyY','347566PnkKtV','isArray','params','1156144atZSIQ','SQL\x20execution\x20failed','65FBQWUo','sqlcode','exec','length'];a188_0x28ce=function(){return _0x5e58f5;};return a188_0x28ce();}function a188_0x4920(_0x2eec65,_0x1e9332){_0x2eec65=_0x2eec65-0x1aa;const _0x28ce78=a188_0x28ce();let _0x4920a8=_0x28ce78[_0x2eec65];return _0x4920a8;}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':a188_0x557468(0x1ae),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a188_0x557468(0x1b3),'flags':[SQLCODE_FLAG,{'name':a188_0x557468(0x1c2),'type':'string','description':a188_0x557468(0x1b4)}],async 'execute'(_0x4beaaa){const _0x173b97=a188_0x557468,_0x4367fb=parseJsonParams(_0x4beaaa[_0x173b97(0x1b1)](_0x173b97(0x1c2))),_0x1edbb1=Date[_0x173b97(0x1b7)](),_0x13c4e7=await executeSql(_0x4beaaa[_0x173b97(0x1be)],_0x4beaaa[_0x173b97(0x1b1)](_0x173b97(0x1ad)),_0x4367fb),_0xe650df=Date[_0x173b97(0x1b7)]()-_0x1edbb1,_0x2d10f5=_0x13c4e7?.[_0x173b97(0x1b5)]??_0x13c4e7,_0x1917f0=_0x13c4e7?.['execSuccess']??!![];if(!_0x1917f0)return{'ok':![],'data':{'error':_0x13c4e7?.[_0x173b97(0x1b2)]||_0x173b97(0x1ab),'elapsed':_0xe650df},'message':_0x173b97(0x1ab)};const _0x48180c=Array[_0x173b97(0x1c1)](_0x2d10f5)?_0x2d10f5:[];return{'ok':!![],'data':{'rows':_0x48180c,'rowCount':_0x48180c['length'],'elapsed':_0xe650df},'message':_0x173b97(0x1b9)+_0x48180c[_0x173b97(0x1af)]+_0x173b97(0x1bb)+_0xe650df+'ms'};}};
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 +1 @@
1
- (function(_0x23fbe1,_0x8c591d){const _0x13d211=a189_0x61c8,_0x439b55=_0x23fbe1();while(!![]){try{const _0x15d8eb=-parseInt(_0x13d211(0x1a4))/0x1+-parseInt(_0x13d211(0x1a7))/0x2+parseInt(_0x13d211(0x1a2))/0x3+parseInt(_0x13d211(0x1a6))/0x4+parseInt(_0x13d211(0x1a1))/0x5*(-parseInt(_0x13d211(0x1a3))/0x6)+-parseInt(_0x13d211(0x19f))/0x7+parseInt(_0x13d211(0x1a5))/0x8*(parseInt(_0x13d211(0x1a0))/0x9);if(_0x15d8eb===_0x8c591d)break;else _0x439b55['push'](_0x439b55['shift']());}catch(_0x48da11){_0x439b55['push'](_0x439b55['shift']());}}}(a189_0x3ffa,0x4f5da));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';function a189_0x3ffa(){const _0x317ce8=['10DtcieJ','467739uZTdNI','396684ORgZnU','510670JJPhHe','8gCsoRT','2495792lxsOrF','1259408RDSRdg','8477IIuIHS','7371306hUVdOo'];a189_0x3ffa=function(){return _0x317ce8;};return a189_0x3ffa();}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';function a189_0x61c8(_0x5f381d,_0x123937){_0x5f381d=_0x5f381d-0x19f;const _0x3ffaea=a189_0x3ffa();let _0x61c8bd=_0x3ffaea[_0x5f381d];return _0x61c8bd;}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
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 +1 @@
1
- const a190_0x4bb0cd=a190_0x1ff7;function a190_0x1ff7(_0x46d34d,_0xbad0c3){_0x46d34d=_0x46d34d-0x1c6;const _0x43e31a=a190_0x43e3();let _0x1ff7da=_0x43e31a[_0x46d34d];return _0x1ff7da;}(function(_0x23834c,_0x317579){const _0x2a1877=a190_0x1ff7,_0x326b0a=_0x23834c();while(!![]){try{const _0x33869d=parseInt(_0x2a1877(0x1dc))/0x1*(-parseInt(_0x2a1877(0x1d8))/0x2)+parseInt(_0x2a1877(0x1d1))/0x3+parseInt(_0x2a1877(0x1d7))/0x4+parseInt(_0x2a1877(0x1d6))/0x5+parseInt(_0x2a1877(0x1e8))/0x6*(parseInt(_0x2a1877(0x1c7))/0x7)+-parseInt(_0x2a1877(0x1cc))/0x8*(parseInt(_0x2a1877(0x1e9))/0x9)+-parseInt(_0x2a1877(0x1ef))/0xa*(-parseInt(_0x2a1877(0x1c6))/0xb);if(_0x33869d===_0x317579)break;else _0x326b0a['push'](_0x326b0a['shift']());}catch(_0x56b1a1){_0x326b0a['push'](_0x326b0a['shift']());}}}(a190_0x43e3,0x54fd4));function a190_0x43e3(){const _0x159ca7=['number','dbId','verbose','read','all','6EEljTt','81nBEYWK','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','tableData','bool','Filter\x20by\x20SQL\x20name','string','7620670gvMmBI','paging','11lnsmxp','842366BKOrQK','pagesize','sql','length','map','281928dCPFdb','sqlcode','Page\x20number','num','str','105186Kngujl','name','description','No\x20custom\x20SQL\x20queries\x20found.','list','403365PpgqXC','397976oTKYgD','864698cNNsUQ','sqlName','page','Found\x20','1OZbBgN','Page\x20size','appCode','boolean','List\x20custom\x20SQL\x20queries','totalCount','sqlCode'];a190_0x43e3=function(){return _0x159ca7;};return a190_0x43e3();}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a190_0x4bb0cd(0x1c9),'command':a190_0x4bb0cd(0x1d5),'description':a190_0x4bb0cd(0x1e0),'risk':a190_0x4bb0cd(0x1e6),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a190_0x4bb0cd(0x1d2),'type':a190_0x4bb0cd(0x1ee),'description':a190_0x4bb0cd(0x1ed)},{'name':'page','type':a190_0x4bb0cd(0x1e3),'description':a190_0x4bb0cd(0x1ce),'default':0x1},{'name':a190_0x4bb0cd(0x1c8),'type':'number','description':a190_0x4bb0cd(0x1dd)},{'name':a190_0x4bb0cd(0x1e5),'type':a190_0x4bb0cd(0x1df),'description':a190_0x4bb0cd(0x1ea)}],async 'execute'(_0xdd2bf1){const _0x3af104=a190_0x4bb0cd,_0x3a1e7a=await listSqlQueries(_0xdd2bf1[_0x3af104(0x1de)],{'sqlCode':_0xdd2bf1['str'](_0x3af104(0x1cd))||undefined,'sqlName':_0xdd2bf1[_0x3af104(0x1d0)](_0x3af104(0x1d2))||undefined,'currentPage':_0xdd2bf1[_0x3af104(0x1cf)](_0x3af104(0x1da)),'pageSize':_0xdd2bf1[_0x3af104(0x1cf)](_0x3af104(0x1c8),0x32)}),_0x306e53=_0xdd2bf1[_0x3af104(0x1ec)]('verbose'),_0x1b17f4=_0x3a1e7a[_0x3af104(0x1eb)]??[],_0x1cf83f=_0x3a1e7a[_0x3af104(0x1f0)]?.[_0x3af104(0x1e1)]??_0x1b17f4['length'];let _0x3de482;return _0x306e53?_0x3de482=_0x1b17f4:_0x3de482=await Promise[_0x3af104(0x1e7)](_0x1b17f4[_0x3af104(0x1cb)](async _0x4b96eb=>{const _0x1fa4f3=_0x3af104;let _0x3046ad;try{_0x3046ad=_0x4b96eb[_0x1fa4f3(0x1e4)]?await getDbName(_0xdd2bf1['appCode'],_0x4b96eb[_0x1fa4f3(0x1e4)]):undefined;}catch{}return{'sqlCode':_0x4b96eb[_0x1fa4f3(0x1e2)],'sqlName':_0x4b96eb[_0x1fa4f3(0x1d9)],'description':_0x4b96eb[_0x1fa4f3(0x1d3)]??'','db':_0x3046ad?_0x3046ad+'\x20('+_0x4b96eb['dbId']+')':_0x4b96eb[_0x1fa4f3(0x1e4)]??''};})),{'ok':!![],'data':_0x3de482,'message':_0x1b17f4['length']===0x0?_0x3af104(0x1d4):_0x3af104(0x1db)+_0x1b17f4[_0x3af104(0x1ca)]+'\x20SQL\x20queries\x20(total:\x20'+_0x1cf83f+').'};}};
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+').'};}};