@lovrabet/rabetbase-cli 2.5.0-beta.2 → 2.5.0-beta.3

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 (295) 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/tables.js +1 -1
  93. package/lib/commands/db/test.js +1 -1
  94. package/lib/commands/db/update.js +1 -1
  95. package/lib/commands/doctor.js +1 -1
  96. package/lib/commands/file/index.js +1 -1
  97. package/lib/commands/issue/index.js +1 -1
  98. package/lib/commands/issue/nudge.js +1 -1
  99. package/lib/commands/issue/report.js +1 -1
  100. package/lib/commands/issue/shared.js +1 -1
  101. package/lib/commands/kb/create.js +1 -1
  102. package/lib/commands/kb/delete.js +1 -1
  103. package/lib/commands/kb/detail.js +1 -1
  104. package/lib/commands/kb/index.js +1 -1
  105. package/lib/commands/kb/list.js +1 -1
  106. package/lib/commands/kb/search.js +1 -1
  107. package/lib/commands/kb/shared.js +1 -1
  108. package/lib/commands/kb/update.js +1 -1
  109. package/lib/commands/logs/index.js +1 -1
  110. package/lib/commands/menu/asset-update.js +1 -1
  111. package/lib/commands/menu/delete.js +1 -1
  112. package/lib/commands/menu/external-link-create.js +1 -1
  113. package/lib/commands/menu/external-link-update.js +1 -1
  114. package/lib/commands/menu/group-create.js +1 -1
  115. package/lib/commands/menu/group-update.js +1 -1
  116. package/lib/commands/menu/index.js +1 -1
  117. package/lib/commands/menu/list.js +1 -1
  118. package/lib/commands/menu/move.js +1 -1
  119. package/lib/commands/menu/regroup-start.js +1 -1
  120. package/lib/commands/menu/rename.js +1 -1
  121. package/lib/commands/menu/shared/compare-table.js +1 -1
  122. package/lib/commands/menu/shared/delete-plan.js +1 -1
  123. package/lib/commands/menu/shared/facts.js +1 -1
  124. package/lib/commands/menu/shared/index.js +1 -1
  125. package/lib/commands/menu/shared/inquirer.js +1 -1
  126. package/lib/commands/menu/shared/local-pages.js +1 -1
  127. package/lib/commands/menu/shared/logic.js +1 -1
  128. package/lib/commands/menu/shared/mutations.js +1 -1
  129. package/lib/commands/menu/shared/service.js +1 -1
  130. package/lib/commands/menu/shared/sync-core.js +1 -1
  131. package/lib/commands/menu/shared/update-core.js +1 -1
  132. package/lib/commands/menu/shared/valid-url.js +1 -1
  133. package/lib/commands/menu/sync.js +1 -1
  134. package/lib/commands/menu/visibility-update.js +1 -1
  135. package/lib/commands/notification/config-create.js +1 -1
  136. package/lib/commands/notification/config-delete.js +1 -1
  137. package/lib/commands/notification/config-list.js +1 -1
  138. package/lib/commands/notification/config-update.js +1 -1
  139. package/lib/commands/notification/index.js +1 -1
  140. package/lib/commands/notification/shared.js +1 -1
  141. package/lib/commands/ocr/index.js +1 -1
  142. package/lib/commands/page/create.js +1 -1
  143. package/lib/commands/page/custom/detail.js +1 -1
  144. package/lib/commands/page/custom/list.js +1 -1
  145. package/lib/commands/page/custom/publish.js +1 -1
  146. package/lib/commands/page/custom/shared.js +1 -1
  147. package/lib/commands/page/custom/syntax.js +1 -1
  148. package/lib/commands/page/custom/template.js +1 -1
  149. package/lib/commands/page/custom/update.js +1 -1
  150. package/lib/commands/page/data-list-status.js +1 -1
  151. package/lib/commands/page/generate-start.js +1 -1
  152. package/lib/commands/page/generate-status.js +1 -1
  153. package/lib/commands/page/index.js +1 -1
  154. package/lib/commands/page/pull.js +1 -1
  155. package/lib/commands/page/push.js +1 -1
  156. package/lib/commands/page/relation-audit.js +1 -1
  157. package/lib/commands/page/restore.js +1 -1
  158. package/lib/commands/page/shared.js +1 -1
  159. package/lib/commands/page/sync.js +1 -1
  160. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  161. package/lib/commands/project/create/format-elapsed.js +1 -1
  162. package/lib/commands/project/create/main.js +1 -1
  163. package/lib/commands/project/create/materialize-project-template.js +1 -1
  164. package/lib/commands/project/create/project-name.js +1 -1
  165. package/lib/commands/project/create/project-template-archive.js +1 -1
  166. package/lib/commands/project/create/project-template-path.js +1 -1
  167. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  168. package/lib/commands/project/create/use-format-code.js +1 -1
  169. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  170. package/lib/commands/project/index.js +1 -1
  171. package/lib/commands/project/upgrade.js +1 -1
  172. package/lib/commands/registry.js +1 -1
  173. package/lib/commands/role/delete.js +1 -1
  174. package/lib/commands/role/detail.js +1 -1
  175. package/lib/commands/role/index.js +1 -1
  176. package/lib/commands/role/list.js +1 -1
  177. package/lib/commands/role/shared.js +1 -1
  178. package/lib/commands/role/update.js +1 -1
  179. package/lib/commands/role/user-add.js +1 -1
  180. package/lib/commands/role/user-remove.js +1 -1
  181. package/lib/commands/role/user-resolve.js +1 -1
  182. package/lib/commands/run/index.js +1 -1
  183. package/lib/commands/schema.js +1 -1
  184. package/lib/commands/sql/create.js +1 -1
  185. package/lib/commands/sql/delete.js +1 -1
  186. package/lib/commands/sql/detail.js +1 -1
  187. package/lib/commands/sql/exec.js +1 -1
  188. package/lib/commands/sql/index.js +1 -1
  189. package/lib/commands/sql/list.js +1 -1
  190. package/lib/commands/sql/pull.js +1 -1
  191. package/lib/commands/sql/push.js +1 -1
  192. package/lib/commands/sql/shared.js +1 -1
  193. package/lib/commands/sql/status.js +1 -1
  194. package/lib/commands/sql/validate.js +1 -1
  195. package/lib/commands/task/index.js +1 -1
  196. package/lib/commands/task/status.js +1 -1
  197. package/lib/commands/tenant/index.js +1 -1
  198. package/lib/commands/tenant/members-list.js +1 -1
  199. package/lib/commands/tenant/shared.js +1 -1
  200. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  201. package/lib/commands/user-account/index.js +1 -1
  202. package/lib/commands/workspace/add.js +1 -1
  203. package/lib/commands/workspace/index.js +1 -1
  204. package/lib/commands/workspace/remove.js +1 -1
  205. package/lib/config/domain-config.js +1 -1
  206. package/lib/config/schema.js +1 -1
  207. package/lib/constant/cdn.js +1 -1
  208. package/lib/constant/cli.js +1 -1
  209. package/lib/constant/defaults.js +1 -1
  210. package/lib/constant/domain.js +1 -1
  211. package/lib/constant/env.js +1 -1
  212. package/lib/constant/output.js +1 -1
  213. package/lib/constant/paths.js +1 -1
  214. package/lib/constant/region.js +1 -1
  215. package/lib/constant/risk.js +1 -1
  216. package/lib/context/app-resolver.js +1 -1
  217. package/lib/context/auth-resolver.js +1 -1
  218. package/lib/context/config-loader.js +1 -1
  219. package/lib/context.js +1 -1
  220. package/lib/core/alias-resolver.js +1 -1
  221. package/lib/core/api-client.js +1 -1
  222. package/lib/core/bff/config.js +1 -1
  223. package/lib/core/bff/file-system.js +1 -1
  224. package/lib/core/bff/hash.js +1 -1
  225. package/lib/core/bff/lock.js +1 -1
  226. package/lib/core/bff/utils.js +1 -1
  227. package/lib/core/db-resolver.js +1 -1
  228. package/lib/core/page/file-system.js +1 -1
  229. package/lib/core/page/hash.js +1 -1
  230. package/lib/core/page/lock.js +1 -1
  231. package/lib/core/sql-index-auditor.js +1 -1
  232. package/lib/core/sql-sync/config.js +1 -1
  233. package/lib/core/sql-sync/file-system.js +1 -1
  234. package/lib/core/sql-sync/hash.js +1 -1
  235. package/lib/core/sql-sync/lock.js +1 -1
  236. package/lib/core/sql-sync/utils.js +1 -1
  237. package/lib/core/sql-validator.js +1 -1
  238. package/lib/errors.js +1 -1
  239. package/lib/framework/build-all-flags.js +1 -1
  240. package/lib/framework/error-output.js +1 -1
  241. package/lib/framework/explicit-yes.js +1 -1
  242. package/lib/framework/flags.js +1 -1
  243. package/lib/framework/help.js +1 -1
  244. package/lib/framework/index.js +1 -1
  245. package/lib/framework/output.js +1 -1
  246. package/lib/framework/response.js +1 -1
  247. package/lib/framework/runner-alias.js +1 -1
  248. package/lib/framework/runner.js +1 -1
  249. package/lib/framework/schema-export.js +1 -1
  250. package/lib/framework/types.js +1 -1
  251. package/lib/generated/build-info.d.ts +4 -4
  252. package/lib/generated/build-info.js +1 -1
  253. package/lib/help.js +1 -1
  254. package/lib/postinstall.js +1 -1
  255. package/lib/runtime/confirmation.js +1 -1
  256. package/lib/runtime/event.js +1 -1
  257. package/lib/runtime/index.js +1 -1
  258. package/lib/runtime/queue.js +1 -1
  259. package/lib/runtime/resolve.js +1 -1
  260. package/lib/skills/builtin-skill.js +1 -1
  261. package/lib/skills/main.js +1 -1
  262. package/lib/skills/npx-skills-add.js +1 -1
  263. package/lib/skills/skill-presence.js +1 -1
  264. package/lib/telemetry/cli-command-trace.js +1 -1
  265. package/lib/telemetry/cli-help-trace.js +1 -1
  266. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  267. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  268. package/lib/telemetry/send-cli-trace-log.js +1 -1
  269. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  270. package/lib/utils/ai_config.js +1 -1
  271. package/lib/utils/apply-jq-filter.js +1 -1
  272. package/lib/utils/cdn-config.js +1 -1
  273. package/lib/utils/check-sdk-version.js +1 -1
  274. package/lib/utils/cli-version-check.js +1 -1
  275. package/lib/utils/cli-version-policy.js +1 -1
  276. package/lib/utils/config.js +1 -1
  277. package/lib/utils/entity-with-id.js +1 -1
  278. package/lib/utils/file-utils.js +1 -1
  279. package/lib/utils/guides-cdn.js +1 -1
  280. package/lib/utils/http-client.js +1 -1
  281. package/lib/utils/is-non-interactive.js +1 -1
  282. package/lib/utils/logger.js +1 -1
  283. package/lib/utils/params.js +1 -1
  284. package/lib/utils/platform.js +1 -1
  285. package/lib/utils/sleep.js +1 -1
  286. package/lib/utils/template-replacer.js +1 -1
  287. package/lib/utils/update-notice.js +1 -1
  288. package/lib/utils/version.js +1 -1
  289. package/lib/utils/with-active-cookie.js +1 -1
  290. package/lib/utils/write-cli-side-channel.js +1 -1
  291. package/package.json +1 -1
  292. package/skills/rabetbase/SKILL.md +1 -1
  293. package/skills/rabetbase/guides/custom-page-workflow.md +1 -1
  294. package/skills/rabetbase/references/rabetbase-page-custom-list.md +5 -2
  295. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a173_0x2dbc70=a173_0x4060;(function(_0x3f5353,_0x1eda5e){const _0x33d9cc=a173_0x4060,_0x2b017c=_0x3f5353();while(!![]){try{const _0x396661=parseInt(_0x33d9cc(0xe6))/0x1*(parseInt(_0x33d9cc(0xe2))/0x2)+-parseInt(_0x33d9cc(0xe8))/0x3*(parseInt(_0x33d9cc(0xef))/0x4)+-parseInt(_0x33d9cc(0xf1))/0x5*(-parseInt(_0x33d9cc(0xe9))/0x6)+-parseInt(_0x33d9cc(0xdd))/0x7*(parseInt(_0x33d9cc(0xed))/0x8)+parseInt(_0x33d9cc(0xe7))/0x9*(parseInt(_0x33d9cc(0xda))/0xa)+-parseInt(_0x33d9cc(0xec))/0xb+parseInt(_0x33d9cc(0xdc))/0xc*(parseInt(_0x33d9cc(0xe1))/0xd);if(_0x396661===_0x1eda5e)break;else _0x2b017c['push'](_0x2b017c['shift']());}catch(_0x464ca7){_0x2b017c['push'](_0x2b017c['shift']());}}}(a173_0x5e41,0xf3a44));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH='/smartapi/permit/role/delete';function a173_0x4060(_0x5992bf,_0x5d7794){_0x5992bf=_0x5992bf-0xda;const _0x5e411c=a173_0x5e41();let _0x40608b=_0x5e411c[_0x5992bf];return _0x40608b;}export const roleDelete={'service':a173_0x2dbc70(0xe4),'command':a173_0x2dbc70(0xf0),'description':a173_0x2dbc70(0xdf),'risk':a173_0x2dbc70(0xee),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x269f94){const _0x2bf7e8=a173_0x2dbc70,_0x55e2b9=_0x269f94[_0x2bf7e8(0xea)]('id'),_0xdbf076=await getRoleById(_0x269f94[_0x2bf7e8(0xe5)],_0x55e2b9);return assertCustomRole(_0xdbf076,_0x2bf7e8(0xf0)),asDryRunResult({'scope':_0x2bf7e8(0xe3),'operation':'delete','selector':{'appCode':_0x269f94[_0x2bf7e8(0xe5)],'roleId':_0x55e2b9,'roleName':_0xdbf076[_0x2bf7e8(0xf2)]},'before':projectRole(_0xdbf076),'after':null,'dryRun':!![],'backend':{'method':_0x2bf7e8(0xde),'path':DELETE_PATH},'warnings':_0xdbf076[_0x2bf7e8(0xe0)]>0x0?['Role\x20still\x20has\x20'+_0xdbf076[_0x2bf7e8(0xe0)]+_0x2bf7e8(0xeb)]:[]},{'method':_0x2bf7e8(0xde),'url':DELETE_PATH});},async 'execute'(_0x49a88c){const _0x254e9e=a173_0x2dbc70,_0x72295c=_0x49a88c[_0x254e9e(0xea)]('id'),_0x5737f3=await getRoleById(_0x49a88c['appCode'],_0x72295c);return assertCustomRole(_0x5737f3,_0x254e9e(0xf0)),await deleteAppRole(_0x72295c),{'ok':!![],'data':{'scope':'dev','operation':_0x254e9e(0xf0),'selector':{'appCode':_0x49a88c[_0x254e9e(0xe5)],'roleId':_0x72295c,'roleName':_0x5737f3['roleName']},'before':projectRole(_0x5737f3),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':'Deleted\x20role\x20'+_0x5737f3[_0x254e9e(0xf2)]+_0x254e9e(0xdb)+_0x72295c+')'};}};function a173_0x5e41(){const _0x5821a4=['high-risk-write','4JpkbJF','delete','5YXpZfk','roleName','10683670ikYZLC','\x20(id=','56244ymGWgW','322aEmwMp','POST','Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','userCount','4043RVBCVd','23810oHWaqF','dev','role','appCode','97wbFJob','9eUGdhW','1106268IFkljf','1964154DYEzOU','num','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','7431094RxXvLQ','341896HXUiME'];a173_0x5e41=function(){return _0x5821a4;};return a173_0x5e41();}
1
+ const a173_0x3fdc53=a173_0x1a66;(function(_0x3b9697,_0x3e5ed4){const _0x4c76e4=a173_0x1a66,_0x527bc1=_0x3b9697();while(!![]){try{const _0x53a650=-parseInt(_0x4c76e4(0x1c3))/0x1+parseInt(_0x4c76e4(0x1b8))/0x2*(parseInt(_0x4c76e4(0x1be))/0x3)+-parseInt(_0x4c76e4(0x1c1))/0x4*(-parseInt(_0x4c76e4(0x1bc))/0x5)+-parseInt(_0x4c76e4(0x1c2))/0x6*(-parseInt(_0x4c76e4(0x1bd))/0x7)+parseInt(_0x4c76e4(0x1b7))/0x8*(-parseInt(_0x4c76e4(0x1c7))/0x9)+-parseInt(_0x4c76e4(0x1b9))/0xa+parseInt(_0x4c76e4(0x1c5))/0xb*(parseInt(_0x4c76e4(0x1c6))/0xc);if(_0x53a650===_0x3e5ed4)break;else _0x527bc1['push'](_0x527bc1['shift']());}catch(_0xa6051b){_0x527bc1['push'](_0x527bc1['shift']());}}}(a173_0x3447,0xee5b1));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a173_0x1a66(_0x16b990,_0x226752){_0x16b990=_0x16b990-0x1ae;const _0x34477d=a173_0x3447();let _0x1a66f8=_0x34477d[_0x16b990];return _0x1a66f8;}function a173_0x3447(){const _0x45c099=['Deleted\x20role\x20','\x20(id=','14165kPjVBm','64806dXwDNp','15909LqTrsq','POST','dev','1588guJFzF','846ulAtMs','1910567XQqDiZ','num','72303viJitG','816qikMVR','522OioMMK','appCode','delete','high-risk-write','roleName','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','Role\x20still\x20has\x20','role','userCount','36224WhNJvE','570WRoNuC','12389020LvCscf'];a173_0x3447=function(){return _0x45c099;};return a173_0x3447();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH='/smartapi/permit/role/delete';export const roleDelete={'service':a173_0x3fdc53(0x1b5),'command':a173_0x3fdc53(0x1af),'description':a173_0x3fdc53(0x1b3),'risk':a173_0x3fdc53(0x1b0),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4f3917){const _0x5e2d9f=a173_0x3fdc53,_0x5a0c38=_0x4f3917[_0x5e2d9f(0x1c4)]('id'),_0x3e1da6=await getRoleById(_0x4f3917['appCode'],_0x5a0c38);return assertCustomRole(_0x3e1da6,_0x5e2d9f(0x1af)),asDryRunResult({'scope':_0x5e2d9f(0x1c0),'operation':_0x5e2d9f(0x1af),'selector':{'appCode':_0x4f3917[_0x5e2d9f(0x1ae)],'roleId':_0x5a0c38,'roleName':_0x3e1da6[_0x5e2d9f(0x1b1)]},'before':projectRole(_0x3e1da6),'after':null,'dryRun':!![],'backend':{'method':_0x5e2d9f(0x1bf),'path':DELETE_PATH},'warnings':_0x3e1da6[_0x5e2d9f(0x1b6)]>0x0?[_0x5e2d9f(0x1b4)+_0x3e1da6[_0x5e2d9f(0x1b6)]+_0x5e2d9f(0x1b2)]:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x2e19cc){const _0x8589c=a173_0x3fdc53,_0x2fe8ec=_0x2e19cc['num']('id'),_0xc8b944=await getRoleById(_0x2e19cc[_0x8589c(0x1ae)],_0x2fe8ec);return assertCustomRole(_0xc8b944,_0x8589c(0x1af)),await deleteAppRole(_0x2fe8ec),{'ok':!![],'data':{'scope':_0x8589c(0x1c0),'operation':'delete','selector':{'appCode':_0x2e19cc['appCode'],'roleId':_0x2fe8ec,'roleName':_0xc8b944[_0x8589c(0x1b1)]},'before':projectRole(_0xc8b944),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x8589c(0x1ba)+_0xc8b944['roleName']+_0x8589c(0x1bb)+_0x2fe8ec+')'};}};
@@ -1 +1 @@
1
- const a174_0x5e1716=a174_0x59bb;(function(_0x5801c8,_0x596c8f){const _0x38b82b=a174_0x59bb,_0x2e35ce=_0x5801c8();while(!![]){try{const _0x1b9cde=parseInt(_0x38b82b(0xea))/0x1+-parseInt(_0x38b82b(0xef))/0x2*(parseInt(_0x38b82b(0xe3))/0x3)+-parseInt(_0x38b82b(0xe8))/0x4+parseInt(_0x38b82b(0xf5))/0x5*(parseInt(_0x38b82b(0xe4))/0x6)+parseInt(_0x38b82b(0xe9))/0x7+-parseInt(_0x38b82b(0xf2))/0x8*(-parseInt(_0x38b82b(0xec))/0x9)+-parseInt(_0x38b82b(0xe5))/0xa;if(_0x1b9cde===_0x596c8f)break;else _0x2e35ce['push'](_0x2e35ce['shift']());}catch(_0x3454ab){_0x2e35ce['push'](_0x2e35ce['shift']());}}}(a174_0x28e8,0xb0c42));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a174_0x59bb(_0x550c4e,_0x4b881e){_0x550c4e=_0x550c4e-0xe2;const _0x28e82=a174_0x28e8();let _0x59bb20=_0x28e82[_0x550c4e];return _0x59bb20;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a174_0x28e8(){const _0x5933b1=['roleType','33926SbkWNO','detail','dev','24EAMpxU','Role\x20','num','432455CjsWUs','appCode','177PufJBP','78dazgdb','4071920JhosGG','roleName','Show\x20a\x20single\x20role\x27s\x20detail','4222720GPAFWn','2459471RQdlSc','599824LnqrmO','role','3336489tyUddl','read'];a174_0x28e8=function(){return _0x5933b1;};return a174_0x28e8();}export const roleDetail={'service':a174_0x5e1716(0xeb),'command':a174_0x5e1716(0xf0),'description':a174_0x5e1716(0xe7),'risk':a174_0x5e1716(0xed),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x2f85e4){const _0x218e2e=a174_0x5e1716,_0x8cd7b7=_0x2f85e4[_0x218e2e(0xf4)]('id'),_0x150545=await getRoleById(_0x2f85e4[_0x218e2e(0xe2)],_0x8cd7b7);return{'ok':!![],'data':{'scope':_0x218e2e(0xf1),'role':projectRole(_0x150545)},'message':_0x218e2e(0xf3)+_0x150545[_0x218e2e(0xe6)]+'\x20('+_0x150545[_0x218e2e(0xee)]+')'};}};
1
+ const a174_0x11fb29=a174_0x4249;(function(_0x15a7b4,_0x5503c2){const _0x11a330=a174_0x4249,_0x3a7ece=_0x15a7b4();while(!![]){try{const _0x2ec21f=-parseInt(_0x11a330(0x19c))/0x1*(parseInt(_0x11a330(0x18d))/0x2)+parseInt(_0x11a330(0x199))/0x3+parseInt(_0x11a330(0x19b))/0x4+parseInt(_0x11a330(0x195))/0x5+-parseInt(_0x11a330(0x19a))/0x6+parseInt(_0x11a330(0x192))/0x7*(-parseInt(_0x11a330(0x19e))/0x8)+parseInt(_0x11a330(0x19d))/0x9;if(_0x2ec21f===_0x5503c2)break;else _0x3a7ece['push'](_0x3a7ece['shift']());}catch(_0x272f8d){_0x3a7ece['push'](_0x3a7ece['shift']());}}}(a174_0x2edc,0xa9353));function a174_0x4249(_0xd6c326,_0x453178){_0xd6c326=_0xd6c326-0x18d;const _0x2edcb8=a174_0x2edc();let _0x4249db=_0x2edcb8[_0xd6c326];return _0x4249db;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a174_0x2edc(){const _0x3eb8da=['944085gbhbbB','3842616xsKZgF','2043852OAJbqx','361866UbkRRh','6470199UeQcAm','48LYGDmm','2NoznJk','role','Role\x20','appCode','detail','1063489fSDwLe','Show\x20a\x20single\x20role\x27s\x20detail','read','5311850YwhZif','roleName','roleType','num'];a174_0x2edc=function(){return _0x3eb8da;};return a174_0x2edc();}export const roleDetail={'service':a174_0x11fb29(0x18e),'command':a174_0x11fb29(0x191),'description':a174_0x11fb29(0x193),'risk':a174_0x11fb29(0x194),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x145993){const _0x20729d=a174_0x11fb29,_0x1a1a35=_0x145993[_0x20729d(0x198)]('id'),_0x17dd31=await getRoleById(_0x145993[_0x20729d(0x190)],_0x1a1a35);return{'ok':!![],'data':{'scope':'dev','role':projectRole(_0x17dd31)},'message':_0x20729d(0x18f)+_0x17dd31[_0x20729d(0x196)]+'\x20('+_0x17dd31[_0x20729d(0x197)]+')'};}};
@@ -1 +1 @@
1
- function a175_0x572f(){const _0xc3ae61=['754026Fbcnpx','1557fLDIFe','885276KqALdY','39594PvCLLB','150rUuEgB','2NGrRHt','183053GfwOZD','703680nuGMWQ','15367ZtORNV','13584nTPkAO','5880WciqlP'];a175_0x572f=function(){return _0xc3ae61;};return a175_0x572f();}(function(_0x1bb762,_0x5dc779){const _0x245b55=a175_0x5016,_0x573d6f=_0x1bb762();while(!![]){try{const _0x43ce19=-parseInt(_0x245b55(0x156))/0x1*(-parseInt(_0x245b55(0x155))/0x2)+parseInt(_0x245b55(0x150))/0x3+parseInt(_0x245b55(0x157))/0x4+-parseInt(_0x245b55(0x154))/0x5*(-parseInt(_0x245b55(0x153))/0x6)+-parseInt(_0x245b55(0x152))/0x7+-parseInt(_0x245b55(0x159))/0x8*(-parseInt(_0x245b55(0x151))/0x9)+parseInt(_0x245b55(0x15a))/0xa*(-parseInt(_0x245b55(0x158))/0xb);if(_0x43ce19===_0x5dc779)break;else _0x573d6f['push'](_0x573d6f['shift']());}catch(_0x5ad340){_0x573d6f['push'](_0x573d6f['shift']());}}}(a175_0x572f,0x25a17));import{roleList}from'../../commands/role/list.js';function a175_0x5016(_0x36b0a4,_0x3a36bb){_0x36b0a4=_0x36b0a4-0x150;const _0x572fc4=a175_0x572f();let _0x50164c=_0x572fc4[_0x36b0a4];return _0x50164c;}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(_0x35776d,_0x5373ff){const _0x3f1069=a175_0x22e5,_0x1ab550=_0x35776d();while(!![]){try{const _0x2cf026=parseInt(_0x3f1069(0xe2))/0x1+-parseInt(_0x3f1069(0xdf))/0x2+parseInt(_0x3f1069(0xe3))/0x3*(parseInt(_0x3f1069(0xe5))/0x4)+-parseInt(_0x3f1069(0xe7))/0x5+parseInt(_0x3f1069(0xe0))/0x6+-parseInt(_0x3f1069(0xe6))/0x7*(parseInt(_0x3f1069(0xe4))/0x8)+-parseInt(_0x3f1069(0xe1))/0x9;if(_0x2cf026===_0x5373ff)break;else _0x1ab550['push'](_0x1ab550['shift']());}catch(_0x39c4d5){_0x1ab550['push'](_0x1ab550['shift']());}}}(a175_0x14ec,0x2b1e0));function a175_0x14ec(){const _0x3c4808=['191157pFJSba','225333GhEDoA','1760752AyGnee','16UdJvIG','7BFJJCK','876085fUbvem','57252BsTbwu','1554642ATLVQl','1351467FRlbYx'];a175_0x14ec=function(){return _0x3c4808;};return a175_0x14ec();}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';function a175_0x22e5(_0x31ae9c,_0x216b5a){_0x31ae9c=_0x31ae9c-0xdf;const _0x14ecd3=a175_0x14ec();let _0x22e50e=_0x14ecd3[_0x31ae9c];return _0x22e50e;}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 +1 @@
1
- const a176_0x2f12d6=a176_0xc4ab;function a176_0xc4ab(_0x455a1b,_0x35ecd0){_0x455a1b=_0x455a1b-0x1ae;const _0x1dd824=a176_0x1dd8();let _0xc4ab3d=_0x1dd824[_0x455a1b];return _0xc4ab3d;}(function(_0xa557eb,_0xf4aebb){const _0x5818dc=a176_0xc4ab,_0x26d217=_0xa557eb();while(!![]){try{const _0x56c022=parseInt(_0x5818dc(0x1c5))/0x1*(parseInt(_0x5818dc(0x1c0))/0x2)+-parseInt(_0x5818dc(0x1b3))/0x3+parseInt(_0x5818dc(0x1b2))/0x4*(-parseInt(_0x5818dc(0x1c3))/0x5)+-parseInt(_0x5818dc(0x1cf))/0x6*(parseInt(_0x5818dc(0x1af))/0x7)+parseInt(_0x5818dc(0x1c1))/0x8+-parseInt(_0x5818dc(0x1c4))/0x9+-parseInt(_0x5818dc(0x1be))/0xa*(-parseInt(_0x5818dc(0x1b4))/0xb);if(_0x56c022===_0xf4aebb)break;else _0x26d217['push'](_0x26d217['shift']());}catch(_0x212b71){_0x26d217['push'](_0x26d217['shift']());}}}(a176_0x1dd8,0xbca6d));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=[a176_0x2f12d6(0x1d1),a176_0x2f12d6(0x1b6),'OWNER',a176_0x2f12d6(0x1b7)];export const roleList={'service':a176_0x2f12d6(0x1b8),'command':a176_0x2f12d6(0x1bd),'description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a176_0x2f12d6(0x1c6),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a176_0x2f12d6(0x1cd),'type':a176_0x2f12d6(0x1cc),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':a176_0x2f12d6(0x1b1),'type':'number','description':a176_0x2f12d6(0x1b0),'default':0x1},{'name':a176_0x2f12d6(0x1ae),'type':a176_0x2f12d6(0x1c7),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x491949){const _0x4adf02=a176_0x2f12d6,_0x26d76a=_0x491949['str'](_0x4adf02(0x1cd))[_0x4adf02(0x1c9)]();if(_0x26d76a&&!ROLE_TYPES[_0x4adf02(0x1d2)](_0x26d76a['toUpperCase']()))throw CliErrors[_0x4adf02(0x1bf)](_0x4adf02(0x1b5)+_0x26d76a+'\x22.',_0x4adf02(0x1ce)+ROLE_TYPES[_0x4adf02(0x1b9)](',\x20')+'.');const _0x1ae9b8=_0x491949['num']('page',0x1),_0xd45a00=_0x491949[_0x4adf02(0x1d0)](_0x4adf02(0x1ae),0x64);if(_0x1ae9b8<0x1)throw CliErrors['validation'](_0x4adf02(0x1bb));if(_0xd45a00<0x1||_0xd45a00>0x64)throw CliErrors['validation'](_0x4adf02(0x1ca));},async 'execute'(_0x4fd728){const _0x4a431a=a176_0x2f12d6,_0x179e62=_0x4fd728['num']('page',0x1)||0x1,_0x429eb9=_0x4fd728['num']('pagesize',0x64)||0x64,_0x58fc77=_0x4fd728[_0x4a431a(0x1cb)](_0x4a431a(0x1cd))[_0x4a431a(0x1c9)]()[_0x4a431a(0x1c2)](),{items:_0x3a702e,paging:_0x47f25b}=await listAppRoles(_0x4fd728[_0x4a431a(0x1d3)],{'currentPage':_0x179e62,'pageSize':_0x429eb9}),_0x53eb7f=_0x58fc77?_0x3a702e[_0x4a431a(0x1bc)](_0x22ca37=>_0x22ca37['roleType']===_0x58fc77):_0x3a702e,_0x408f85=_0x53eb7f[_0x4a431a(0x1c8)](projectRole);return{'ok':!![],'data':{'scope':'dev','roles':_0x408f85,'paging':_0x47f25b},'message':'Found\x20'+_0x408f85['length']+_0x4a431a(0x1ba)};}};function a176_0x1dd8(){const _0x555f9d=['CUSTOM','role','join','\x20role(s)','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','filter','list','12512760SXxQfw','validation','18gLNGjU','6823744zSDrvH','toUpperCase','5PfqZBV','6754338rXWUsQ','74017oEaKPA','read','number','map','trim','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','str','string','type','Use\x20one\x20of:\x20','1488ObIQjU','num','ADMIN','includes','appCode','pagesize','2961CPJFOf','Page\x20index\x20(1-based)','page','4013468gyOcKh','4170609awNQbe','22NogKgu','Invalid\x20--type\x20\x22','DEV'];a176_0x1dd8=function(){return _0x555f9d;};return a176_0x1dd8();}
1
+ const a176_0x1216ea=a176_0x2cb2;function a176_0x2cb2(_0x516369,_0x584543){_0x516369=_0x516369-0x10f;const _0x222ffe=a176_0x222f();let _0x2cb225=_0x222ffe[_0x516369];return _0x2cb225;}function a176_0x222f(){const _0x819500=['list','role','string','5897680OGSPZR','12043170wRAVoR','\x20role(s)','11266qBhoZU','validation','4495765TtwWDU','number','trim','toUpperCase','Found\x20','includes','Page\x20index\x20(1-based)','10952515EQsXAz','type','OWNER','Filter\x20by\x20role\x20type','1746788uaVLJR','map','str','DEV','appCode','6JsrwCj','num','ADMIN','Invalid\x20--type\x20\x22','9KuzhVn','345noUhgj','dev','3606548VpEszn','Use\x20one\x20of:\x20','page','pagesize','CUSTOM','filter','roleType','length'];a176_0x222f=function(){return _0x819500;};return a176_0x222f();}(function(_0x416326,_0x3197de){const _0x10b378=a176_0x2cb2,_0x5dc703=_0x416326();while(!![]){try{const _0x498cc1=-parseInt(_0x10b378(0x12e))/0x1+parseInt(_0x10b378(0x121))/0x2*(parseInt(_0x10b378(0x111))/0x3)+-parseInt(_0x10b378(0x113))/0x4+parseInt(_0x10b378(0x123))/0x5*(parseInt(_0x10b378(0x133))/0x6)+parseInt(_0x10b378(0x12a))/0x7+-parseInt(_0x10b378(0x11e))/0x8+-parseInt(_0x10b378(0x110))/0x9*(-parseInt(_0x10b378(0x11f))/0xa);if(_0x498cc1===_0x3197de)break;else _0x5dc703['push'](_0x5dc703['shift']());}catch(_0x16e010){_0x5dc703['push'](_0x5dc703['shift']());}}}(a176_0x222f,0xe31e3));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=[a176_0x1216ea(0x135),a176_0x1216ea(0x131),a176_0x1216ea(0x12c),a176_0x1216ea(0x117)];export const roleList={'service':a176_0x1216ea(0x11c),'command':a176_0x1216ea(0x11b),'description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a176_0x1216ea(0x12b),'type':a176_0x1216ea(0x11d),'required':![],'description':a176_0x1216ea(0x12d),'enum':ROLE_TYPES},{'name':a176_0x1216ea(0x115),'type':a176_0x1216ea(0x124),'description':a176_0x1216ea(0x129),'default':0x1},{'name':'pagesize','type':a176_0x1216ea(0x124),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x2ad68a){const _0x3984c4=a176_0x1216ea,_0x225f2f=_0x2ad68a[_0x3984c4(0x130)]('type')[_0x3984c4(0x125)]();if(_0x225f2f&&!ROLE_TYPES[_0x3984c4(0x128)](_0x225f2f[_0x3984c4(0x126)]()))throw CliErrors['validation'](_0x3984c4(0x10f)+_0x225f2f+'\x22.',_0x3984c4(0x114)+ROLE_TYPES['join'](',\x20')+'.');const _0x5623e8=_0x2ad68a[_0x3984c4(0x134)]('page',0x1),_0x12d07c=_0x2ad68a[_0x3984c4(0x134)](_0x3984c4(0x116),0x64);if(_0x5623e8<0x1)throw CliErrors[_0x3984c4(0x122)]('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x12d07c<0x1||_0x12d07c>0x64)throw CliErrors['validation']('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x4756cd){const _0x1b38c8=a176_0x1216ea,_0x179b04=_0x4756cd[_0x1b38c8(0x134)](_0x1b38c8(0x115),0x1)||0x1,_0x26eabf=_0x4756cd[_0x1b38c8(0x134)](_0x1b38c8(0x116),0x64)||0x64,_0x3ab4e0=_0x4756cd[_0x1b38c8(0x130)]('type')['trim']()[_0x1b38c8(0x126)](),{items:_0x499f61,paging:_0x4cb68c}=await listAppRoles(_0x4756cd[_0x1b38c8(0x132)],{'currentPage':_0x179b04,'pageSize':_0x26eabf}),_0x7f8e46=_0x3ab4e0?_0x499f61[_0x1b38c8(0x118)](_0x5af4f2=>_0x5af4f2[_0x1b38c8(0x119)]===_0x3ab4e0):_0x499f61,_0x551930=_0x7f8e46[_0x1b38c8(0x12f)](projectRole);return{'ok':!![],'data':{'scope':_0x1b38c8(0x112),'roles':_0x551930,'paging':_0x4cb68c},'message':_0x1b38c8(0x127)+_0x551930[_0x1b38c8(0x11a)]+_0x1b38c8(0x120)};}};
@@ -1 +1 @@
1
- const a177_0x30c665=a177_0x36d7;(function(_0x2e1484,_0x5b9147){const _0x490156=a177_0x36d7,_0x2b87e0=_0x2e1484();while(!![]){try{const _0x21842f=parseInt(_0x490156(0x147))/0x1*(-parseInt(_0x490156(0x13d))/0x2)+parseInt(_0x490156(0x157))/0x3*(-parseInt(_0x490156(0x127))/0x4)+-parseInt(_0x490156(0x12a))/0x5+-parseInt(_0x490156(0x11f))/0x6+parseInt(_0x490156(0x139))/0x7*(-parseInt(_0x490156(0x159))/0x8)+-parseInt(_0x490156(0x13c))/0x9*(-parseInt(_0x490156(0x122))/0xa)+parseInt(_0x490156(0x138))/0xb*(parseInt(_0x490156(0x12b))/0xc);if(_0x21842f===_0x5b9147)break;else _0x2b87e0['push'](_0x2b87e0['shift']());}catch(_0x543208){_0x2b87e0['push'](_0x2b87e0['shift']());}}}(a177_0x1073,0x35f17));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';function a177_0x36d7(_0x4b0ba,_0x2c87bf){_0x4b0ba=_0x4b0ba-0x113;const _0x10734f=a177_0x1073();let _0x36d713=_0x10734f[_0x4b0ba];return _0x36d713;}import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a177_0x30c665(0x12e),'required':!![],'description':a177_0x30c665(0x161)};export const ROLE_REF_FLAG={'name':'role','type':a177_0x30c665(0x152),'required':!![],'description':a177_0x30c665(0x123)};export const USER_REF_FLAG={'name':a177_0x30c665(0x118),'type':'string','required':!![],'description':a177_0x30c665(0x129)};export const NAME_FLAG={'name':a177_0x30c665(0x145),'type':'string','required':!![],'description':a177_0x30c665(0x15a)};export const USER_NAME_FLAG={'name':a177_0x30c665(0x145),'type':'string','required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a177_0x30c665(0x11b),'type':'string','required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a177_0x30c665(0x125),'type':'number','required':![],'description':a177_0x30c665(0x15c)};export const BUILTIN_ROLE_TYPES=[a177_0x30c665(0x12d),a177_0x30c665(0x134),a177_0x30c665(0x126)];function a177_0x1073(){const _0x501ab8=['\x20is\x20already\x20a\x20member\x20of\x20role\x20','toLowerCase','\x22\x20not\x20found\x20in\x20app\x20','\x22:\x20','nickname','filter','name','Pass\x20--user\x20<id|name>.','46362wtfXjz','POST','Missing\x20role\x20reference.','Role\x20name\x20\x22',';\x20no\x20change.','Pass\x20--role\x20<id|name>.','dryRun','/smartapi/permit/user-role/delete','CUSTOM','totalCount','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','string','/smartapi/permit/user-role/create','\x20duplicate\x20memberships\x20for\x20user\x20','user-add','flagMissing','4749xGqOwZ','userId','95896SdzQeU','Role\x20name','tenant','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','\x20members\x20of\x20the\x20OWNER\x20role.','flag','length','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Role\x20id\x20(from\x20`role\x20list`)','Check\x20the\x20nickname/username.\x20','\x20member(s)\x20but\x20role\x20has\x20','map','Missing\x20user\x20reference.','str','appCode','tenant_code','expectUserCount','user','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','roleName','remark','role','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x22\x20is\x20ambiguous\x20(ids:\x20','1138182wDmtUn','permitCount','push','30GqUDbJ','Role\x20id\x20or\x20exact\x20role\x20name','validation','expect-user-count','OWNER','456CkCLdi','dev','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','1256810cRqvLA','7238688wdXiUq','userCount','ADMIN','number','test','join','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Disambiguate\x20with\x20--role\x20<id>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','DEV','roleType','username','find','22aXuZIN','35uUWuvl','trim','User\x20','200565zLzTae','16weuaYI','No\x20tenant\x20member\x20matches\x20\x22'];a177_0x1073=function(){return _0x501ab8;};return a177_0x1073();}export function isBuiltinRole(_0x53afc5){return BUILTIN_ROLE_TYPES['includes'](_0x53afc5);}export function assertCustomRole(_0x2d9754,_0x252f96){const _0xe26c31=a177_0x30c665;if(_0x2d9754[_0xe26c31(0x135)]!==_0xe26c31(0x14f))throw CliErrors[_0xe26c31(0x124)]('Cannot\x20'+_0x252f96+'\x20built-in\x20role\x20'+_0x2d9754[_0xe26c31(0x11a)]+'\x20('+_0x2d9754[_0xe26c31(0x135)]+').',_0xe26c31(0x151));}export function projectRole(_0x57dca6){const _0x3aa6d5=a177_0x30c665;return{'id':_0x57dca6['id'],'roleName':_0x57dca6[_0x3aa6d5(0x11a)],'roleType':_0x57dca6[_0x3aa6d5(0x135)],'remark':_0x57dca6['remark'],'userCount':_0x57dca6[_0x3aa6d5(0x12c)],'permitCount':_0x57dca6[_0x3aa6d5(0x120)],'builtin':isBuiltinRole(_0x57dca6[_0x3aa6d5(0x135)])};}export async function resolveRoleRef(_0x2200e0,_0x4aa7fc){const _0x3ba70c=a177_0x30c665,_0x51b436=_0x4aa7fc[_0x3ba70c(0x13a)]();if(!_0x51b436)throw CliErrors[_0x3ba70c(0x124)](_0x3ba70c(0x149),_0x3ba70c(0x14c));if(/^\d+$/['test'](_0x51b436))return getRoleById(_0x2200e0,Number(_0x51b436));const _0x48e641=await listAllAppRoles(_0x2200e0),_0x1cddcd=_0x48e641['filter'](_0xf329fa=>_0xf329fa[_0x3ba70c(0x11a)]===_0x51b436);if(_0x1cddcd[_0x3ba70c(0x15f)]===0x0)throw CliErrors[_0x3ba70c(0x124)](_0x3ba70c(0x14a)+_0x51b436+_0x3ba70c(0x141)+_0x2200e0+'.',_0x3ba70c(0x133));if(_0x1cddcd['length']>0x1){const _0x350adf=_0x1cddcd[_0x3ba70c(0x164)](_0x5af15f=>_0x5af15f['id'])[_0x3ba70c(0x130)](',\x20');throw CliErrors['validation']('Role\x20name\x20\x22'+_0x51b436+_0x3ba70c(0x11e)+_0x350adf+').',_0x3ba70c(0x132));}return _0x1cddcd[0x0];}export async function getRoleById(_0x65fecf,_0x2851a7){const _0x24a70c=a177_0x30c665,_0xaaafa=await listAllAppRoles(_0x65fecf),_0x59d11b=_0xaaafa[_0x24a70c(0x144)](_0x1caa53=>_0x1caa53['id']===_0x2851a7&&(!_0x1caa53[_0x24a70c(0x115)]||_0x1caa53[_0x24a70c(0x115)]===_0x65fecf));if(_0x59d11b[_0x24a70c(0x15f)]!==0x1)throw CliErrors[_0x24a70c(0x124)]('Role\x20id\x20'+_0x2851a7+'\x20not\x20found\x20in\x20app\x20'+_0x65fecf+'.',_0x24a70c(0x131));return _0x59d11b[0x0];}async function listAllAppRoles(_0x1be02e){const _0x21ea8a=a177_0x30c665,_0xfe3e4d=0x64,_0x2b30ca=[];for(let _0x598df6=0x1;;_0x598df6+=0x1){const {items:_0x315781,paging:_0x132d98}=await listAppRoles(_0x1be02e,{'currentPage':_0x598df6,'pageSize':_0xfe3e4d});_0x2b30ca[_0x21ea8a(0x121)](..._0x315781);if(_0x315781[_0x21ea8a(0x15f)]<_0xfe3e4d||_0x132d98&&_0x2b30ca[_0x21ea8a(0x15f)]>=_0x132d98[_0x21ea8a(0x150)])return _0x2b30ca;}}export async function resolveTenantCode(){const _0x247e22=a177_0x30c665,_0x226f79=await getSessionUserInfo(),_0x1bd467=_0x226f79?.['user']?.[_0x247e22(0x15b)]?.[_0x247e22(0x116)];if(!_0x1bd467)throw CliErrors['authRequired'](_0x247e22(0x119));return _0x1bd467;}function matchMember(_0x3e6577,_0x3742a5){const _0x547022=a177_0x30c665,_0x1120d9=_0x3742a5[_0x547022(0x13a)]()[_0x547022(0x140)]();return(_0x3e6577[_0x547022(0x143)]??'')[_0x547022(0x140)]()===_0x1120d9||(_0x3e6577[_0x547022(0x136)]??'')['toLowerCase']()===_0x1120d9;}export async function resolveUserRef(_0x5d3384,_0x2f8f13='Pass\x20--user\x20<id>.'){const _0xa3d98d=a177_0x30c665,_0x3472ea=_0x5d3384[_0xa3d98d(0x13a)]();if(!_0x3472ea)throw CliErrors[_0xa3d98d(0x124)](_0xa3d98d(0x113),'Pass\x20--user\x20<id|name>.');const _0xbb0f8d=await resolveTenantCode(),_0x366e64=await getTenantMembers(_0xbb0f8d);if(/^\d+$/[_0xa3d98d(0x12f)](_0x3472ea)){const _0x410811=Number(_0x3472ea),_0x1391c1=_0x366e64[_0xa3d98d(0x137)](_0xe1ac6b=>_0xe1ac6b[_0xa3d98d(0x158)]===_0x410811);return{'userId':_0x410811,'username':_0x1391c1?.[_0xa3d98d(0x136)]??String(_0x410811),'nickname':_0x1391c1?.['nickname'],'matchedBy':'id'};}const _0x504ac4=_0x366e64['filter'](_0x2f6846=>matchMember(_0x2f6846,_0x3472ea));if(_0x504ac4['length']===0x0)throw CliErrors[_0xa3d98d(0x124)](_0xa3d98d(0x13e)+_0x3472ea+'\x22.',_0xa3d98d(0x162)+_0x2f8f13);if(_0x504ac4['length']>0x1){const _0x4e8d6f=_0x504ac4['map'](_0x2a0092=>(_0x2a0092[_0xa3d98d(0x143)]??_0x2a0092['username']??'?')+'('+_0x2a0092[_0xa3d98d(0x158)]+')')[_0xa3d98d(0x130)](',\x20');throw CliErrors['validation']('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x3472ea+_0xa3d98d(0x142)+_0x4e8d6f+'.',_0x2f8f13);}const _0x15262f=_0x504ac4[0x0];return{'userId':_0x15262f[_0xa3d98d(0x158)],'username':_0x15262f[_0xa3d98d(0x136)]??String(_0x15262f[_0xa3d98d(0x158)]),'nickname':_0x15262f[_0xa3d98d(0x143)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a177_0x30c665(0x153);export const DELETE_USER_ROLE_PATH=a177_0x30c665(0x14e);export function computeRoleUserMutation(_0x46db58){const _0x4d8778=a177_0x30c665,{operation:_0x381cd2,appCode:_0x5ad49b,role:_0x1ccceb,relations:_0x20d3fd,user:_0xa7980a}=_0x46db58,_0x2b6c57=[...new Set(_0x20d3fd['map'](_0x5fb61c=>_0x5fb61c['userId']))],_0xd23f08=[];if(_0x46db58[_0x4d8778(0x117)]!==undefined&&_0x46db58['expectUserCount']!==_0x2b6c57['length'])throw CliErrors[_0x4d8778(0x124)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x46db58[_0x4d8778(0x117)]+_0x4d8778(0x163)+_0x2b6c57[_0x4d8778(0x15f)]+'.',_0x4d8778(0x11d));const _0x41b8c6=_0x2b6c57['includes'](_0xa7980a[_0x4d8778(0x158)]),_0x2ce033=_0x20d3fd['filter'](_0x4210bd=>_0x4210bd[_0x4d8778(0x158)]===_0xa7980a[_0x4d8778(0x158)])[_0x4d8778(0x164)](_0x4cbbde=>_0x4cbbde['id']),_0x331cc5=_0x381cd2===_0x4d8778(0x155)?!_0x41b8c6:_0x41b8c6;let _0x29e655=_0x2b6c57;_0x381cd2===_0x4d8778(0x155)?_0x41b8c6?_0xd23f08['push'](_0x4d8778(0x13b)+_0xa7980a[_0x4d8778(0x158)]+_0x4d8778(0x13f)+_0x1ccceb[_0x4d8778(0x11a)]+';\x20no\x20change.'):_0x29e655=[..._0x2b6c57,_0xa7980a[_0x4d8778(0x158)]]:!_0x41b8c6?_0xd23f08[_0x4d8778(0x121)](_0x4d8778(0x13b)+_0xa7980a[_0x4d8778(0x158)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x1ccceb[_0x4d8778(0x11a)]+_0x4d8778(0x14b)):(_0x29e655=_0x2b6c57['filter'](_0x21a1bf=>_0x21a1bf!==_0xa7980a['userId']),_0x2ce033['length']>0x1&&_0xd23f08[_0x4d8778(0x121)]('Removed\x20'+_0x2ce033[_0x4d8778(0x15f)]+_0x4d8778(0x154)+_0xa7980a[_0x4d8778(0x158)]+'.'));const _0x29ca2f={'scope':_0x4d8778(0x128),'operation':_0x381cd2,'selector':{'appCode':_0x5ad49b,'roleId':_0x1ccceb['id'],'roleName':_0x1ccceb[_0x4d8778(0x11a)],'userId':_0xa7980a[_0x4d8778(0x158)]},'before':{'userIds':_0x2b6c57},'after':{'userIds':_0x29e655},'dryRun':_0x46db58[_0x4d8778(0x14d)],'backend':{'method':_0x4d8778(0x148),'path':_0x381cd2===_0x4d8778(0x155)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0xd23f08};return{'mutation':_0x29ca2f,'changed':_0x331cc5,'matchingRelationIds':_0x2ce033};}export async function loadDevRoleRelations(_0x531964,_0x32b54b){const _0x4051fd=a177_0x30c665,_0x2f8013=0x64,_0x5b999b=[];for(let _0x5c0142=0x1;;_0x5c0142+=0x1){const {items:_0x49e90b,paging:_0x39c1d9}=await listDevUserRoleRelations(_0x531964,{'roleId':_0x32b54b,'currentPage':_0x5c0142,'pageSize':_0x2f8013});_0x5b999b[_0x4051fd(0x121)](..._0x49e90b);if(_0x49e90b['length']<_0x2f8013||_0x39c1d9&&_0x5b999b[_0x4051fd(0x15f)]>=_0x39c1d9[_0x4051fd(0x150)])return _0x5b999b;}}export function readRoleRef(_0x165123){const _0x4a9f00=a177_0x30c665,_0x4fbc29=_0x165123[_0x4a9f00(0x114)](_0x4a9f00(0x11c))[_0x4a9f00(0x13a)]();if(!_0x4fbc29)throw CliErrors[_0x4a9f00(0x156)]('role','Pass\x20--role\x20<id|name>.');return _0x4fbc29;}export async function prepareUserMutation(_0x497c9c,_0x1fbec3,_0x180cb4){const _0x158909=a177_0x30c665,_0x5ac347=readRoleRef(_0x497c9c),_0x1ea66b=_0x497c9c[_0x158909(0x114)](_0x158909(0x118))[_0x158909(0x13a)]();if(!_0x1ea66b)throw CliErrors[_0x158909(0x156)]('user',_0x158909(0x146));const _0x32289c=_0x497c9c[_0x158909(0x15e)](_0x158909(0x125)),_0x2d8a45=_0x32289c===undefined||_0x32289c===null?undefined:Number(_0x32289c),_0x1fe342=await resolveRoleRef(_0x497c9c[_0x158909(0x115)],_0x5ac347);if(_0x1fe342[_0x158909(0x135)]===_0x158909(0x126))throw CliErrors[_0x158909(0x124)]('Cannot\x20'+_0x1fbec3+_0x158909(0x15d),_0x158909(0x160));const _0x11df16=await resolveUserRef(_0x1ea66b),_0x5a4dce=await loadDevRoleRelations(_0x497c9c['appCode'],_0x1fe342['id']);return{...computeRoleUserMutation({'operation':_0x1fbec3,'appCode':_0x497c9c['appCode'],'role':_0x1fe342,'relations':_0x5a4dce,'user':{'userId':_0x11df16[_0x158909(0x158)],'username':_0x11df16[_0x158909(0x136)],'nickname':_0x11df16['nickname']},'dryRun':_0x180cb4,..._0x2d8a45!==undefined?{'expectUserCount':_0x2d8a45}:{}}),'role':_0x1fe342,'user':_0x11df16};}
1
+ const a177_0x3e1a28=a177_0x3acf;(function(_0x4abe13,_0xf6c6a6){const _0x5b5914=a177_0x3acf,_0x3f604c=_0x4abe13();while(!![]){try{const _0x1de7cb=-parseInt(_0x5b5914(0x134))/0x1*(-parseInt(_0x5b5914(0x123))/0x2)+parseInt(_0x5b5914(0x15b))/0x3+parseInt(_0x5b5914(0x129))/0x4*(parseInt(_0x5b5914(0x140))/0x5)+parseInt(_0x5b5914(0x128))/0x6*(parseInt(_0x5b5914(0x14f))/0x7)+parseInt(_0x5b5914(0x118))/0x8*(-parseInt(_0x5b5914(0x133))/0x9)+parseInt(_0x5b5914(0x135))/0xa+-parseInt(_0x5b5914(0x130))/0xb*(parseInt(_0x5b5914(0x162))/0xc);if(_0x1de7cb===_0xf6c6a6)break;else _0x3f604c['push'](_0x3f604c['shift']());}catch(_0x1ed4f7){_0x3f604c['push'](_0x3f604c['shift']());}}}(a177_0x220e,0xc5a11));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a177_0x3e1a28(0x148),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a177_0x3e1a28(0x12c),'type':a177_0x3e1a28(0x15f),'required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':a177_0x3e1a28(0x14b),'type':a177_0x3e1a28(0x15f),'required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':'name','type':'string','required':!![],'description':a177_0x3e1a28(0x11e)};export const USER_NAME_FLAG={'name':a177_0x3e1a28(0x15e),'type':'string','required':!![],'description':a177_0x3e1a28(0x124)};export const REMARK_FLAG={'name':a177_0x3e1a28(0x120),'type':a177_0x3e1a28(0x15f),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a177_0x3e1a28(0x151),'type':'number','required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a177_0x3e1a28(0x15c),a177_0x3e1a28(0x155),a177_0x3e1a28(0x136)];export function isBuiltinRole(_0x3f6294){const _0x1f3fdb=a177_0x3e1a28;return BUILTIN_ROLE_TYPES[_0x1f3fdb(0x141)](_0x3f6294);}export function assertCustomRole(_0x11b00e,_0x104881){const _0xa18291=a177_0x3e1a28;if(_0x11b00e[_0xa18291(0x137)]!==_0xa18291(0x167))throw CliErrors['validation'](_0xa18291(0x166)+_0x104881+_0xa18291(0x14d)+_0x11b00e[_0xa18291(0x121)]+'\x20('+_0x11b00e[_0xa18291(0x137)]+').',_0xa18291(0x138));}function a177_0x220e(){const _0x7b3679=['roleType','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','/smartapi/permit/user-role/create','str','Pass\x20--role\x20<id|name>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Pass\x20--user\x20<id>.','user-add','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','10HtltWO','includes','totalCount','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x22\x20is\x20ambiguous\x20(ids:\x20','Removed\x20','find','Missing\x20role\x20reference.','number','permitCount','expectUserCount','user','validation','\x20built-in\x20role\x20','dev','1434881FdIpNT','flag','expect-user-count','Disambiguate\x20with\x20--role\x20<id>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','push','DEV',';\x20no\x20change.','toLowerCase','Multiple\x20tenant\x20members\x20match\x20\x22','Check\x20the\x20nickname/username.\x20','username','3132438EFTFUY','ADMIN','\x20members\x20of\x20the\x20OWNER\x20role.','name','string','flagMissing','userId','876EMsjtA','\x22\x20not\x20found\x20in\x20app\x20','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','authRequired','Cannot\x20','CUSTOM','\x20not\x20found\x20in\x20app\x20','POST','join','dryRun','\x20is\x20not\x20a\x20member\x20of\x20role\x20','/smartapi/permit/user-role/delete','3032QkTQvu','userCount','nickname','appCode','No\x20tenant\x20member\x20matches\x20\x22','Pass\x20--user\x20<id|name>.','Role\x20name','\x20duplicate\x20memberships\x20for\x20user\x20','remark','roleName','tenant','13082aiilgN','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','test','\x22:\x20','tenant_code','30lKjvPb','788288MMFgJD','map','Role\x20id\x20','role','length','trim','filter','353254DPXCsK','Role\x20name\x20\x22','Anti-drift\x20check\x20failed:\x20expected\x20','10494auPbFT','14unPeoE','10409460DIoIvO','OWNER'];a177_0x220e=function(){return _0x7b3679;};return a177_0x220e();}export function projectRole(_0x5ac05b){const _0x6b21c9=a177_0x3e1a28;return{'id':_0x5ac05b['id'],'roleName':_0x5ac05b[_0x6b21c9(0x121)],'roleType':_0x5ac05b['roleType'],'remark':_0x5ac05b[_0x6b21c9(0x120)],'userCount':_0x5ac05b[_0x6b21c9(0x119)],'permitCount':_0x5ac05b[_0x6b21c9(0x149)],'builtin':isBuiltinRole(_0x5ac05b['roleType'])};}export async function resolveRoleRef(_0x1aa8d8,_0xb19bba){const _0x206350=a177_0x3e1a28,_0x165638=_0xb19bba[_0x206350(0x12e)]();if(!_0x165638)throw CliErrors[_0x206350(0x14c)](_0x206350(0x147),'Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x165638))return getRoleById(_0x1aa8d8,Number(_0x165638));const _0x3499a9=await listAllAppRoles(_0x1aa8d8),_0x3fef17=_0x3499a9[_0x206350(0x12f)](_0x7a23e3=>_0x7a23e3[_0x206350(0x121)]===_0x165638);if(_0x3fef17[_0x206350(0x12d)]===0x0)throw CliErrors[_0x206350(0x14c)](_0x206350(0x131)+_0x165638+_0x206350(0x163)+_0x1aa8d8+'.',_0x206350(0x13f));if(_0x3fef17[_0x206350(0x12d)]>0x1){const _0x324ffe=_0x3fef17[_0x206350(0x12a)](_0x2336ec=>_0x2336ec['id'])[_0x206350(0x16a)](',\x20');throw CliErrors['validation']('Role\x20name\x20\x22'+_0x165638+_0x206350(0x144)+_0x324ffe+').',_0x206350(0x152));}return _0x3fef17[0x0];}export async function getRoleById(_0x247984,_0x3561d4){const _0x4dc75b=a177_0x3e1a28,_0x5235a0=await listAllAppRoles(_0x247984),_0x3582bf=_0x5235a0[_0x4dc75b(0x12f)](_0x1609ec=>_0x1609ec['id']===_0x3561d4&&(!_0x1609ec[_0x4dc75b(0x11b)]||_0x1609ec[_0x4dc75b(0x11b)]===_0x247984));if(_0x3582bf[_0x4dc75b(0x12d)]!==0x1)throw CliErrors['validation'](_0x4dc75b(0x12b)+_0x3561d4+_0x4dc75b(0x168)+_0x247984+'.',_0x4dc75b(0x13c));return _0x3582bf[0x0];}async function listAllAppRoles(_0x3ad18a){const _0x575390=a177_0x3e1a28,_0x192739=0x64,_0x205946=[];for(let _0x31a776=0x1;;_0x31a776+=0x1){const {items:_0xa5c87b,paging:_0x56d69b}=await listAppRoles(_0x3ad18a,{'currentPage':_0x31a776,'pageSize':_0x192739});_0x205946[_0x575390(0x154)](..._0xa5c87b);if(_0xa5c87b[_0x575390(0x12d)]<_0x192739||_0x56d69b&&_0x205946[_0x575390(0x12d)]>=_0x56d69b[_0x575390(0x142)])return _0x205946;}}function a177_0x3acf(_0x1a6c77,_0x53caf8){_0x1a6c77=_0x1a6c77-0x118;const _0x220e91=a177_0x220e();let _0x3acf11=_0x220e91[_0x1a6c77];return _0x3acf11;}export async function resolveTenantCode(){const _0x2f63f=a177_0x3e1a28,_0x235821=await getSessionUserInfo(),_0x4d5f55=_0x235821?.['user']?.[_0x2f63f(0x122)]?.[_0x2f63f(0x127)];if(!_0x4d5f55)throw CliErrors[_0x2f63f(0x165)](_0x2f63f(0x153));return _0x4d5f55;}function matchMember(_0x31bb97,_0x436af4){const _0x1e73a9=a177_0x3e1a28,_0x2d9b71=_0x436af4[_0x1e73a9(0x12e)]()[_0x1e73a9(0x157)]();return(_0x31bb97[_0x1e73a9(0x11a)]??'')['toLowerCase']()===_0x2d9b71||(_0x31bb97[_0x1e73a9(0x15a)]??'')[_0x1e73a9(0x157)]()===_0x2d9b71;}export async function resolveUserRef(_0x13da8a,_0x4bd5ca=a177_0x3e1a28(0x13d)){const _0x337190=a177_0x3e1a28,_0x83dbe5=_0x13da8a[_0x337190(0x12e)]();if(!_0x83dbe5)throw CliErrors['validation']('Missing\x20user\x20reference.','Pass\x20--user\x20<id|name>.');const _0x1cd546=await resolveTenantCode(),_0x29b9d0=await getTenantMembers(_0x1cd546);if(/^\d+$/[_0x337190(0x125)](_0x83dbe5)){const _0x207263=Number(_0x83dbe5),_0x56b2d5=_0x29b9d0[_0x337190(0x146)](_0x41b2a0=>_0x41b2a0[_0x337190(0x161)]===_0x207263);return{'userId':_0x207263,'username':_0x56b2d5?.[_0x337190(0x15a)]??String(_0x207263),'nickname':_0x56b2d5?.[_0x337190(0x11a)],'matchedBy':'id'};}const _0x8c714d=_0x29b9d0[_0x337190(0x12f)](_0x1194de=>matchMember(_0x1194de,_0x83dbe5));if(_0x8c714d[_0x337190(0x12d)]===0x0)throw CliErrors[_0x337190(0x14c)](_0x337190(0x11c)+_0x83dbe5+'\x22.',_0x337190(0x159)+_0x4bd5ca);if(_0x8c714d[_0x337190(0x12d)]>0x1){const _0x458e2e=_0x8c714d[_0x337190(0x12a)](_0x4f30fc=>(_0x4f30fc[_0x337190(0x11a)]??_0x4f30fc[_0x337190(0x15a)]??'?')+'('+_0x4f30fc[_0x337190(0x161)]+')')[_0x337190(0x16a)](',\x20');throw CliErrors[_0x337190(0x14c)](_0x337190(0x158)+_0x83dbe5+_0x337190(0x126)+_0x458e2e+'.',_0x4bd5ca);}const _0x54ebee=_0x8c714d[0x0];return{'userId':_0x54ebee[_0x337190(0x161)],'username':_0x54ebee['username']??String(_0x54ebee[_0x337190(0x161)]),'nickname':_0x54ebee[_0x337190(0x11a)],'matchedBy':_0x337190(0x15e)};}export const CREATE_USER_ROLE_PATH=a177_0x3e1a28(0x139);export const DELETE_USER_ROLE_PATH=a177_0x3e1a28(0x16d);export function computeRoleUserMutation(_0x21c26e){const _0x1ff0d9=a177_0x3e1a28,{operation:_0x3a18c7,appCode:_0x3c164e,role:_0x43a9d0,relations:_0x513109,user:_0x1f1927}=_0x21c26e,_0x336fd2=[...new Set(_0x513109[_0x1ff0d9(0x12a)](_0x28d3bc=>_0x28d3bc[_0x1ff0d9(0x161)]))],_0x330cb6=[];if(_0x21c26e[_0x1ff0d9(0x14a)]!==undefined&&_0x21c26e[_0x1ff0d9(0x14a)]!==_0x336fd2[_0x1ff0d9(0x12d)])throw CliErrors[_0x1ff0d9(0x14c)](_0x1ff0d9(0x132)+_0x21c26e[_0x1ff0d9(0x14a)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x336fd2[_0x1ff0d9(0x12d)]+'.',_0x1ff0d9(0x143));const _0x261f33=_0x336fd2[_0x1ff0d9(0x141)](_0x1f1927[_0x1ff0d9(0x161)]),_0x5d8683=_0x513109[_0x1ff0d9(0x12f)](_0x5c8ce1=>_0x5c8ce1[_0x1ff0d9(0x161)]===_0x1f1927[_0x1ff0d9(0x161)])[_0x1ff0d9(0x12a)](_0x2ceb41=>_0x2ceb41['id']),_0xd77712=_0x3a18c7===_0x1ff0d9(0x13e)?!_0x261f33:_0x261f33;let _0x3e55c1=_0x336fd2;_0x3a18c7==='user-add'?_0x261f33?_0x330cb6[_0x1ff0d9(0x154)]('User\x20'+_0x1f1927[_0x1ff0d9(0x161)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x43a9d0[_0x1ff0d9(0x121)]+';\x20no\x20change.'):_0x3e55c1=[..._0x336fd2,_0x1f1927['userId']]:!_0x261f33?_0x330cb6[_0x1ff0d9(0x154)]('User\x20'+_0x1f1927['userId']+_0x1ff0d9(0x16c)+_0x43a9d0['roleName']+_0x1ff0d9(0x156)):(_0x3e55c1=_0x336fd2['filter'](_0x586a76=>_0x586a76!==_0x1f1927['userId']),_0x5d8683['length']>0x1&&_0x330cb6['push'](_0x1ff0d9(0x145)+_0x5d8683[_0x1ff0d9(0x12d)]+_0x1ff0d9(0x11f)+_0x1f1927['userId']+'.'));const _0x2eb3e7={'scope':_0x1ff0d9(0x14e),'operation':_0x3a18c7,'selector':{'appCode':_0x3c164e,'roleId':_0x43a9d0['id'],'roleName':_0x43a9d0[_0x1ff0d9(0x121)],'userId':_0x1f1927[_0x1ff0d9(0x161)]},'before':{'userIds':_0x336fd2},'after':{'userIds':_0x3e55c1},'dryRun':_0x21c26e[_0x1ff0d9(0x16b)],'backend':{'method':_0x1ff0d9(0x169),'path':_0x3a18c7==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x330cb6};return{'mutation':_0x2eb3e7,'changed':_0xd77712,'matchingRelationIds':_0x5d8683};}export async function loadDevRoleRelations(_0x46517b,_0x2aa5a6){const _0x26a596=a177_0x3e1a28,_0x3e9122=0x64,_0x2222e2=[];for(let _0x18de9b=0x1;;_0x18de9b+=0x1){const {items:_0x5c6a24,paging:_0x5a12d2}=await listDevUserRoleRelations(_0x46517b,{'roleId':_0x2aa5a6,'currentPage':_0x18de9b,'pageSize':_0x3e9122});_0x2222e2[_0x26a596(0x154)](..._0x5c6a24);if(_0x5c6a24[_0x26a596(0x12d)]<_0x3e9122||_0x5a12d2&&_0x2222e2['length']>=_0x5a12d2[_0x26a596(0x142)])return _0x2222e2;}}export function readRoleRef(_0x667c6f){const _0x23379f=a177_0x3e1a28,_0x3eb5ff=_0x667c6f[_0x23379f(0x13a)]('role')['trim']();if(!_0x3eb5ff)throw CliErrors[_0x23379f(0x160)]('role',_0x23379f(0x13b));return _0x3eb5ff;}export async function prepareUserMutation(_0xc8f3ef,_0x5c116c,_0x147e84){const _0x4bcac6=a177_0x3e1a28,_0x4f923a=readRoleRef(_0xc8f3ef),_0x4dfff4=_0xc8f3ef['str'](_0x4bcac6(0x14b))[_0x4bcac6(0x12e)]();if(!_0x4dfff4)throw CliErrors[_0x4bcac6(0x160)](_0x4bcac6(0x14b),_0x4bcac6(0x11d));const _0x1637e4=_0xc8f3ef[_0x4bcac6(0x150)]('expect-user-count'),_0xb78754=_0x1637e4===undefined||_0x1637e4===null?undefined:Number(_0x1637e4),_0x574737=await resolveRoleRef(_0xc8f3ef[_0x4bcac6(0x11b)],_0x4f923a);if(_0x574737[_0x4bcac6(0x137)]===_0x4bcac6(0x136))throw CliErrors['validation'](_0x4bcac6(0x166)+_0x5c116c+_0x4bcac6(0x15d),_0x4bcac6(0x164));const _0x30ec6f=await resolveUserRef(_0x4dfff4),_0x38d004=await loadDevRoleRelations(_0xc8f3ef[_0x4bcac6(0x11b)],_0x574737['id']);return{...computeRoleUserMutation({'operation':_0x5c116c,'appCode':_0xc8f3ef[_0x4bcac6(0x11b)],'role':_0x574737,'relations':_0x38d004,'user':{'userId':_0x30ec6f['userId'],'username':_0x30ec6f[_0x4bcac6(0x15a)],'nickname':_0x30ec6f['nickname']},'dryRun':_0x147e84,..._0xb78754!==undefined?{'expectUserCount':_0xb78754}:{}}),'role':_0x574737,'user':_0x30ec6f};}
@@ -1 +1 @@
1
- const a178_0x3c3014=a178_0x4517;(function(_0xd80ae3,_0x11cb1b){const _0xfddf5=a178_0x4517,_0x23bec5=_0xd80ae3();while(!![]){try{const _0xa82953=-parseInt(_0xfddf5(0x1e7))/0x1+-parseInt(_0xfddf5(0x1f6))/0x2*(-parseInt(_0xfddf5(0x1e9))/0x3)+-parseInt(_0xfddf5(0x1f3))/0x4+-parseInt(_0xfddf5(0x1ee))/0x5+parseInt(_0xfddf5(0x1ed))/0x6*(-parseInt(_0xfddf5(0x1ea))/0x7)+parseInt(_0xfddf5(0x1e0))/0x8+parseInt(_0xfddf5(0x1fa))/0x9;if(_0xa82953===_0x11cb1b)break;else _0x23bec5['push'](_0x23bec5['shift']());}catch(_0x3097f0){_0x23bec5['push'](_0x23bec5['shift']());}}}(a178_0x4230,0x958c2));function a178_0x4230(){const _0x3aa7ef=['Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','2ckDJhr','\x20(id=','dev','trim','32550003uRDkZU','num','Updated\x20role\x20','roleName','7181392IZWfbI','validation','name','Nothing\x20to\x20update.','POST','/smartapi/permit/role/update','update','900687gViPho','string','691617jbiZHf','91DJlPbu','--name\x20cannot\x20be\x20empty.','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','562344mkmTGC','5833170rFUhib','appCode','role','remark','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','3386404PdMyzv','flag'];a178_0x4230=function(){return _0x3aa7ef;};return a178_0x4230();}import{updateAppRole}from'../../core/api-client.js';function a178_0x4517(_0x2165c5,_0x194fd2){_0x2165c5=_0x2165c5-0x1e0;const _0x4230da=a178_0x4230();let _0x451747=_0x4230da[_0x2165c5];return _0x451747;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a178_0x3c3014(0x1e5);function readPatch(_0x52a97c){const _0x2f609d=a178_0x3c3014,_0x55622c=_0x52a97c['flag'](_0x2f609d(0x1e2)),_0xaa1170=_0x52a97c[_0x2f609d(0x1f4)](_0x2f609d(0x1f1)),_0x59173e={};if(_0x55622c!==undefined&&_0x55622c!==null){const _0x13939b=String(_0x55622c)[_0x2f609d(0x1f9)]();if(!_0x13939b)throw CliErrors[_0x2f609d(0x1e1)](_0x2f609d(0x1eb));if(_0x13939b['length']>0x40)throw CliErrors[_0x2f609d(0x1e1)](_0x2f609d(0x1f2));_0x59173e['roleName']=_0x13939b;}_0xaa1170!==undefined&&_0xaa1170!==null&&(_0x59173e[_0x2f609d(0x1f1)]=String(_0xaa1170));if(_0x59173e[_0x2f609d(0x1fd)]===undefined&&_0x59173e[_0x2f609d(0x1f1)]===undefined)throw CliErrors[_0x2f609d(0x1e1)](_0x2f609d(0x1e3),_0x2f609d(0x1ec));return _0x59173e;}export const roleUpdate={'service':a178_0x3c3014(0x1f0),'command':a178_0x3c3014(0x1e6),'description':a178_0x3c3014(0x1f5),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a178_0x3c3014(0x1e2),'type':a178_0x3c3014(0x1e8),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x30eb1f){readPatch(_0x30eb1f);},async 'dryRun'(_0x18a7f1){const _0x4c50fb=a178_0x3c3014,_0x3b7fbd=_0x18a7f1[_0x4c50fb(0x1fb)]('id'),_0x58c8bb=readPatch(_0x18a7f1),_0xc4457b=await getRoleById(_0x18a7f1[_0x4c50fb(0x1ef)],_0x3b7fbd);return assertCustomRole(_0xc4457b,_0x4c50fb(0x1e6)),asDryRunResult({'scope':'dev','operation':'update','selector':{'appCode':_0x18a7f1[_0x4c50fb(0x1ef)],'roleId':_0x3b7fbd,'roleName':_0xc4457b[_0x4c50fb(0x1fd)]},'before':projectRole(_0xc4457b),'after':projectRole({..._0xc4457b,..._0x58c8bb['roleName']!==undefined?{'roleName':_0x58c8bb['roleName']}:{},..._0x58c8bb[_0x4c50fb(0x1f1)]!==undefined?{'remark':_0x58c8bb[_0x4c50fb(0x1f1)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x4c50fb(0x1e4),'url':UPDATE_PATH});},async 'execute'(_0x2af476){const _0x1b0579=a178_0x3c3014,_0x3476c5=_0x2af476[_0x1b0579(0x1fb)]('id'),_0x2ede37=readPatch(_0x2af476),_0x2cb24b=await getRoleById(_0x2af476[_0x1b0579(0x1ef)],_0x3476c5);assertCustomRole(_0x2cb24b,_0x1b0579(0x1e6)),await updateAppRole({'id':_0x3476c5,'appCode':_0x2af476[_0x1b0579(0x1ef)],..._0x2ede37[_0x1b0579(0x1fd)]!==undefined?{'roleName':_0x2ede37[_0x1b0579(0x1fd)]}:{},..._0x2ede37[_0x1b0579(0x1f1)]!==undefined?{'remark':_0x2ede37['remark']}:{}});const _0x40dc33=await getRoleById(_0x2af476[_0x1b0579(0x1ef)],_0x3476c5);return{'ok':!![],'data':{'scope':_0x1b0579(0x1f8),'operation':_0x1b0579(0x1e6),'selector':{'appCode':_0x2af476[_0x1b0579(0x1ef)],'roleId':_0x3476c5,'roleName':_0x40dc33[_0x1b0579(0x1fd)]},'before':projectRole(_0x2cb24b),'after':projectRole(_0x40dc33),'dryRun':![],'backend':{'method':_0x1b0579(0x1e4),'path':UPDATE_PATH},'warnings':[]},'message':_0x1b0579(0x1fc)+_0x40dc33[_0x1b0579(0x1fd)]+_0x1b0579(0x1f7)+_0x3476c5+')'};}};
1
+ const a178_0x3c343e=a178_0xca46;(function(_0x4b488f,_0x1e6008){const _0x31d094=a178_0xca46,_0x107354=_0x4b488f();while(!![]){try{const _0xd623fb=parseInt(_0x31d094(0x1e0))/0x1+-parseInt(_0x31d094(0x1d0))/0x2*(parseInt(_0x31d094(0x1c7))/0x3)+-parseInt(_0x31d094(0x1d2))/0x4*(parseInt(_0x31d094(0x1c1))/0x5)+parseInt(_0x31d094(0x1c4))/0x6*(-parseInt(_0x31d094(0x1d8))/0x7)+parseInt(_0x31d094(0x1d5))/0x8*(-parseInt(_0x31d094(0x1dc))/0x9)+parseInt(_0x31d094(0x1e1))/0xa+-parseInt(_0x31d094(0x1c5))/0xb*(-parseInt(_0x31d094(0x1ce))/0xc);if(_0xd623fb===_0x1e6008)break;else _0x107354['push'](_0x107354['shift']());}catch(_0x31db06){_0x107354['push'](_0x107354['shift']());}}}(a178_0x2329,0x3233b));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a178_0x2329(){const _0x1cf5e3=['Nothing\x20to\x20update.','length','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','60vaCifF','string','364134ngteUh','remark','3928jrypFw','roleName','trim','8ystJFN','appCode','name','45451BRcJFN','validation','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','New\x20role\x20name','486324EQYhjT','flag','POST','write','32348AgugpZ','2190080SedDSU','--name\x20cannot\x20be\x20empty.','660ZsDiqR','Updated\x20role\x20','update','24lffKrR','761134cnkjgM','num','3dMTzcz','\x20(id=','dev','/smartapi/permit/role/update'];a178_0x2329=function(){return _0x1cf5e3;};return a178_0x2329();}import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a178_0x3c343e(0x1ca);function readPatch(_0x2d83c2){const _0x4d5395=a178_0x3c343e,_0x47916a=_0x2d83c2['flag'](_0x4d5395(0x1d7)),_0x48d97c=_0x2d83c2[_0x4d5395(0x1dd)](_0x4d5395(0x1d1)),_0x2fc461={};if(_0x47916a!==undefined&&_0x47916a!==null){const _0x28bb36=String(_0x47916a)[_0x4d5395(0x1d4)]();if(!_0x28bb36)throw CliErrors[_0x4d5395(0x1d9)](_0x4d5395(0x1e2));if(_0x28bb36[_0x4d5395(0x1cc)]>0x40)throw CliErrors[_0x4d5395(0x1d9)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x2fc461[_0x4d5395(0x1d3)]=_0x28bb36;}_0x48d97c!==undefined&&_0x48d97c!==null&&(_0x2fc461[_0x4d5395(0x1d1)]=String(_0x48d97c));if(_0x2fc461[_0x4d5395(0x1d3)]===undefined&&_0x2fc461[_0x4d5395(0x1d1)]===undefined)throw CliErrors[_0x4d5395(0x1d9)](_0x4d5395(0x1cb),_0x4d5395(0x1da));return _0x2fc461;}function a178_0xca46(_0x5e0322,_0x57a1f1){_0x5e0322=_0x5e0322-0x1c1;const _0x2329fa=a178_0x2329();let _0xca4608=_0x2329fa[_0x5e0322];return _0xca4608;}export const roleUpdate={'service':'role','command':a178_0x3c343e(0x1c3),'description':a178_0x3c343e(0x1cd),'risk':a178_0x3c343e(0x1df),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a178_0x3c343e(0x1d7),'type':a178_0x3c343e(0x1cf),'required':![],'description':a178_0x3c343e(0x1db)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5aefc2){readPatch(_0x5aefc2);},async 'dryRun'(_0x234223){const _0x4aeec2=a178_0x3c343e,_0x156f23=_0x234223['num']('id'),_0x1ed196=readPatch(_0x234223),_0x2160c4=await getRoleById(_0x234223['appCode'],_0x156f23);return assertCustomRole(_0x2160c4,_0x4aeec2(0x1c3)),asDryRunResult({'scope':'dev','operation':_0x4aeec2(0x1c3),'selector':{'appCode':_0x234223[_0x4aeec2(0x1d6)],'roleId':_0x156f23,'roleName':_0x2160c4[_0x4aeec2(0x1d3)]},'before':projectRole(_0x2160c4),'after':projectRole({..._0x2160c4,..._0x1ed196[_0x4aeec2(0x1d3)]!==undefined?{'roleName':_0x1ed196[_0x4aeec2(0x1d3)]}:{},..._0x1ed196['remark']!==undefined?{'remark':_0x1ed196[_0x4aeec2(0x1d1)]}:{}}),'dryRun':!![],'backend':{'method':_0x4aeec2(0x1de),'path':UPDATE_PATH},'warnings':[]},{'method':_0x4aeec2(0x1de),'url':UPDATE_PATH});},async 'execute'(_0x1f6d8b){const _0x2d087b=a178_0x3c343e,_0x40066b=_0x1f6d8b[_0x2d087b(0x1c6)]('id'),_0xa5158b=readPatch(_0x1f6d8b),_0x50bd90=await getRoleById(_0x1f6d8b['appCode'],_0x40066b);assertCustomRole(_0x50bd90,_0x2d087b(0x1c3)),await updateAppRole({'id':_0x40066b,'appCode':_0x1f6d8b[_0x2d087b(0x1d6)],..._0xa5158b[_0x2d087b(0x1d3)]!==undefined?{'roleName':_0xa5158b['roleName']}:{},..._0xa5158b[_0x2d087b(0x1d1)]!==undefined?{'remark':_0xa5158b[_0x2d087b(0x1d1)]}:{}});const _0x758b7b=await getRoleById(_0x1f6d8b[_0x2d087b(0x1d6)],_0x40066b);return{'ok':!![],'data':{'scope':_0x2d087b(0x1c9),'operation':_0x2d087b(0x1c3),'selector':{'appCode':_0x1f6d8b['appCode'],'roleId':_0x40066b,'roleName':_0x758b7b['roleName']},'before':projectRole(_0x50bd90),'after':projectRole(_0x758b7b),'dryRun':![],'backend':{'method':_0x2d087b(0x1de),'path':UPDATE_PATH},'warnings':[]},'message':_0x2d087b(0x1c2)+_0x758b7b[_0x2d087b(0x1d3)]+_0x2d087b(0x1c8)+_0x40066b+')'};}};
@@ -1 +1 @@
1
- const a179_0x1e9441=a179_0x1b69;(function(_0x82b654,_0xcc8e7a){const _0x3825cc=a179_0x1b69,_0x3fe189=_0x82b654();while(!![]){try{const _0x400e7e=parseInt(_0x3825cc(0x13b))/0x1*(parseInt(_0x3825cc(0x12d))/0x2)+parseInt(_0x3825cc(0x136))/0x3*(-parseInt(_0x3825cc(0x131))/0x4)+parseInt(_0x3825cc(0x137))/0x5*(-parseInt(_0x3825cc(0x140))/0x6)+parseInt(_0x3825cc(0x13f))/0x7*(-parseInt(_0x3825cc(0x130))/0x8)+parseInt(_0x3825cc(0x12f))/0x9*(parseInt(_0x3825cc(0x143))/0xa)+-parseInt(_0x3825cc(0x13e))/0xb+-parseInt(_0x3825cc(0x142))/0xc*(-parseInt(_0x3825cc(0x12e))/0xd);if(_0x400e7e===_0xcc8e7a)break;else _0x3fe189['push'](_0x3fe189['shift']());}catch(_0x9e1b6c){_0x3fe189['push'](_0x3fe189['shift']());}}}(a179_0x540d,0x77707));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a179_0x1b69(_0x39966e,_0xde3e04){_0x39966e=_0x39966e-0x12a;const _0x540df5=a179_0x540d();let _0x1b69a3=_0x540df5[_0x39966e];return _0x1b69a3;}function a179_0x540d(){const _0xb4e122=['userId','POST','6450466gqcFcw','1358YDrpYv','813726kzZblL','Added\x20user\x20','11547552ekDDtj','80pGsNxu','\x20already\x20in\x20role\x20','selector','No\x20change:\x20user\x20','4cftylW','13kiypew','571797nTmomy','9608ibHdYK','6056AIHttv','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','\x20to\x20role\x20','roleName','roleType','1338rJqkdM','5bSZhtG','username','high-risk-write','user-add','324464hnkEqi'];a179_0x540d=function(){return _0xb4e122;};return a179_0x540d();}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':'role','command':a179_0x1e9441(0x13a),'description':a179_0x1e9441(0x132),'risk':a179_0x1e9441(0x139),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x44a382){const _0x518df6=a179_0x1e9441,{mutation:_0x1ea0be}=await prepareUserMutation(_0x44a382,_0x518df6(0x13a),!![]);return asDryRunResult(_0x1ea0be,{'method':_0x518df6(0x13d),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x4d19c2){const _0x12811b=a179_0x1e9441,{mutation:_0x53c86d,changed:_0x18dea9,role:_0x2d26da,user:_0x4c7473}=await prepareUserMutation(_0x4d19c2,'user-add',![]);return _0x18dea9&&await createDevUserRole({'appCode':_0x4d19c2['appCode'],'userId':_0x4c7473[_0x12811b(0x13c)],'username':_0x4c7473[_0x12811b(0x138)],'roleType':_0x2d26da[_0x12811b(0x135)],'roleId':_0x53c86d[_0x12811b(0x12b)]['roleId']}),{'ok':!![],'data':_0x53c86d,'message':_0x18dea9?_0x12811b(0x141)+_0x53c86d['selector']['userId']+_0x12811b(0x133)+_0x53c86d[_0x12811b(0x12b)][_0x12811b(0x134)]:_0x12811b(0x12c)+_0x53c86d[_0x12811b(0x12b)][_0x12811b(0x13c)]+_0x12811b(0x12a)+_0x53c86d[_0x12811b(0x12b)]['roleName']};}};
1
+ function a179_0x1980(){const _0xefd09a=['96194yamPhs','role','5305cJlcCT','user-add','4404iLxfrg','roleId','Added\x20user\x20','No\x20change:\x20user\x20','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','15807htZVPO','userId','305298ckyxEc','2047266mmjqLX','selector','username','POST','3444UTPsUH','176jtGgfm','roleName','10hiVJxF','\x20to\x20role\x20','538BWMFFX','7957370jwbPAt','9sJQzrh','33PJqNOq'];a179_0x1980=function(){return _0xefd09a;};return a179_0x1980();}const a179_0x5c8c4a=a179_0xadeb;(function(_0x51e05a,_0x288836){const _0x4b150c=a179_0xadeb,_0x13a35f=_0x51e05a();while(!![]){try{const _0x22645c=parseInt(_0x4b150c(0x136))/0x1*(parseInt(_0x4b150c(0x149))/0x2)+parseInt(_0x4b150c(0x14c))/0x3*(parseInt(_0x4b150c(0x144))/0x4)+parseInt(_0x4b150c(0x147))/0x5*(-parseInt(_0x4b150c(0x13f))/0x6)+-parseInt(_0x4b150c(0x14d))/0x7*(parseInt(_0x4b150c(0x145))/0x8)+-parseInt(_0x4b150c(0x14b))/0x9*(parseInt(_0x4b150c(0x14a))/0xa)+parseInt(_0x4b150c(0x13d))/0xb*(parseInt(_0x4b150c(0x138))/0xc)+parseInt(_0x4b150c(0x140))/0xd;if(_0x22645c===_0x288836)break;else _0x13a35f['push'](_0x13a35f['shift']());}catch(_0x1bb4cf){_0x13a35f['push'](_0x13a35f['shift']());}}}(a179_0x1980,0xe0fce));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a179_0xadeb(_0x576df0,_0x3e3dc5){_0x576df0=_0x576df0-0x135;const _0x19803e=a179_0x1980();let _0xadebfa=_0x19803e[_0x576df0];return _0xadebfa;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a179_0x5c8c4a(0x135),'command':a179_0x5c8c4a(0x137),'description':a179_0x5c8c4a(0x13c),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1ab18e){const _0x265d41=a179_0x5c8c4a,{mutation:_0x423d22}=await prepareUserMutation(_0x1ab18e,_0x265d41(0x137),!![]);return asDryRunResult(_0x423d22,{'method':_0x265d41(0x143),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x2751af){const _0x19cfb5=a179_0x5c8c4a,{mutation:_0x417310,changed:_0x1425cd,role:_0x1168e6,user:_0x3163b9}=await prepareUserMutation(_0x2751af,_0x19cfb5(0x137),![]);return _0x1425cd&&await createDevUserRole({'appCode':_0x2751af['appCode'],'userId':_0x3163b9[_0x19cfb5(0x13e)],'username':_0x3163b9[_0x19cfb5(0x142)],'roleType':_0x1168e6['roleType'],'roleId':_0x417310[_0x19cfb5(0x141)][_0x19cfb5(0x139)]}),{'ok':!![],'data':_0x417310,'message':_0x1425cd?_0x19cfb5(0x13a)+_0x417310[_0x19cfb5(0x141)][_0x19cfb5(0x13e)]+_0x19cfb5(0x148)+_0x417310[_0x19cfb5(0x141)][_0x19cfb5(0x146)]:_0x19cfb5(0x13b)+_0x417310[_0x19cfb5(0x141)]['userId']+'\x20already\x20in\x20role\x20'+_0x417310[_0x19cfb5(0x141)][_0x19cfb5(0x146)]};}};
@@ -1 +1 @@
1
- const a180_0x176137=a180_0x3687;(function(_0x218885,_0xdc806d){const _0x19f146=a180_0x3687,_0x58f139=_0x218885();while(!![]){try{const _0x3b9ab2=-parseInt(_0x19f146(0x8c))/0x1*(parseInt(_0x19f146(0x80))/0x2)+parseInt(_0x19f146(0x8a))/0x3*(-parseInt(_0x19f146(0x84))/0x4)+-parseInt(_0x19f146(0x8d))/0x5+-parseInt(_0x19f146(0x7f))/0x6+-parseInt(_0x19f146(0x7c))/0x7*(parseInt(_0x19f146(0x88))/0x8)+parseInt(_0x19f146(0x86))/0x9+parseInt(_0x19f146(0x82))/0xa*(parseInt(_0x19f146(0x81))/0xb);if(_0x3b9ab2===_0xdc806d)break;else _0x58f139['push'](_0x58f139['shift']());}catch(_0x1c4d41){_0x58f139['push'](_0x58f139['shift']());}}}(a180_0x5e62,0x242af));function a180_0x3687(_0x4645dd,_0xcae26d){_0x4645dd=_0x4645dd-0x7a;const _0x5e6273=a180_0x5e62();let _0x3687b6=_0x5e6273[_0x4645dd];return _0x3687b6;}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';export const roleUserRemove={'service':'role','command':a180_0x176137(0x8b),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a180_0x176137(0x7e),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x578096){const _0x437bb2=a180_0x176137,{mutation:_0x4187f5}=await prepareUserMutation(_0x578096,'user-remove',!![]);return asDryRunResult(_0x4187f5,{'method':_0x437bb2(0x8e),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x15c508){const _0x516086=a180_0x176137,{matchingRelationIds:_0xb038c7,mutation:_0x20e7ca,changed:_0x5f1e08}=await prepareUserMutation(_0x15c508,_0x516086(0x8b),![]);if(_0x5f1e08)for(const _0x1a8136 of _0xb038c7){await deleteDevUserRole(_0x1a8136);}return{'ok':!![],'data':_0x20e7ca,'message':_0x5f1e08?_0x516086(0x89)+_0x20e7ca[_0x516086(0x85)][_0x516086(0x7b)]+_0x516086(0x83)+_0x20e7ca[_0x516086(0x85)][_0x516086(0x87)]:_0x516086(0x7a)+_0x20e7ca[_0x516086(0x85)]['userId']+_0x516086(0x7d)+_0x20e7ca[_0x516086(0x85)][_0x516086(0x87)]};}};function a180_0x5e62(){const _0x56591f=['1315458hbGaUi','roleName','600bHXeYm','Removed\x20user\x20','3wmczWn','user-remove','21LoZZHr','617995dkjhPu','POST','No\x20change:\x20user\x20','userId','16289JRYoKT','\x20not\x20in\x20role\x20','high-risk-write','358776SsHKXz','9602sbfvof','77jJNYrG','700830MakGuu','\x20from\x20role\x20','119436pQpkNL','selector'];a180_0x5e62=function(){return _0x56591f;};return a180_0x5e62();}
1
+ const a180_0x2fd351=a180_0x52a7;function a180_0x52a7(_0x30dd5a,_0x3cb134){_0x30dd5a=_0x30dd5a-0x1b4;const _0x8458f2=a180_0x8458();let _0x52a725=_0x8458f2[_0x30dd5a];return _0x52a725;}(function(_0x4a7d0e,_0x1f972c){const _0x50c0b6=a180_0x52a7,_0x3ea18d=_0x4a7d0e();while(!![]){try{const _0x4eb4fb=parseInt(_0x50c0b6(0x1c0))/0x1+-parseInt(_0x50c0b6(0x1ba))/0x2*(-parseInt(_0x50c0b6(0x1bd))/0x3)+-parseInt(_0x50c0b6(0x1c9))/0x4+parseInt(_0x50c0b6(0x1b9))/0x5+parseInt(_0x50c0b6(0x1c7))/0x6*(parseInt(_0x50c0b6(0x1bc))/0x7)+parseInt(_0x50c0b6(0x1c2))/0x8+parseInt(_0x50c0b6(0x1c6))/0x9*(-parseInt(_0x50c0b6(0x1b5))/0xa);if(_0x4eb4fb===_0x1f972c)break;else _0x3ea18d['push'](_0x3ea18d['shift']());}catch(_0x510f66){_0x3ea18d['push'](_0x3ea18d['shift']());}}}(a180_0x8458,0x4afd3));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';export const roleUserRemove={'service':a180_0x2fd351(0x1b6),'command':a180_0x2fd351(0x1b7),'description':a180_0x2fd351(0x1b4),'risk':a180_0x2fd351(0x1bf),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x5c8df4){const _0x69a699=a180_0x2fd351,{mutation:_0x22f083}=await prepareUserMutation(_0x5c8df4,'user-remove',!![]);return asDryRunResult(_0x22f083,{'method':_0x69a699(0x1c8),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x4b410d){const _0x5bbf4b=a180_0x2fd351,{matchingRelationIds:_0x377475,mutation:_0x25b0d2,changed:_0x3e91ce}=await prepareUserMutation(_0x4b410d,_0x5bbf4b(0x1b7),![]);if(_0x3e91ce)for(const _0x43a611 of _0x377475){await deleteDevUserRole(_0x43a611);}return{'ok':!![],'data':_0x25b0d2,'message':_0x3e91ce?_0x5bbf4b(0x1c1)+_0x25b0d2[_0x5bbf4b(0x1c4)][_0x5bbf4b(0x1c3)]+_0x5bbf4b(0x1bb)+_0x25b0d2[_0x5bbf4b(0x1c4)][_0x5bbf4b(0x1b8)]:_0x5bbf4b(0x1c5)+_0x25b0d2[_0x5bbf4b(0x1c4)][_0x5bbf4b(0x1c3)]+_0x5bbf4b(0x1be)+_0x25b0d2[_0x5bbf4b(0x1c4)][_0x5bbf4b(0x1b8)]};}};function a180_0x8458(){const _0x288e77=['10Epprzq','role','user-remove','roleName','2560395UdaRta','502PPCiGM','\x20from\x20role\x20','3028263oxexCA','6309YHkxbI','\x20not\x20in\x20role\x20','high-risk-write','574968kxEVqO','Removed\x20user\x20','2977704SAHkQZ','userId','selector','No\x20change:\x20user\x20','18200655YvVZQY','6PPPWBR','POST','361088oynayd','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes'];a180_0x8458=function(){return _0x288e77;};return a180_0x8458();}
@@ -1 +1 @@
1
- const a181_0x463809=a181_0x23c0;(function(_0x21994c,_0x2d2b22){const _0x315d42=a181_0x23c0,_0x20aa9c=_0x21994c();while(!![]){try{const _0x93058d=-parseInt(_0x315d42(0x1ce))/0x1*(-parseInt(_0x315d42(0x1c6))/0x2)+parseInt(_0x315d42(0x1c3))/0x3*(parseInt(_0x315d42(0x1c5))/0x4)+-parseInt(_0x315d42(0x1d8))/0x5+parseInt(_0x315d42(0x1c2))/0x6*(parseInt(_0x315d42(0x1d4))/0x7)+-parseInt(_0x315d42(0x1cc))/0x8*(-parseInt(_0x315d42(0x1cb))/0x9)+parseInt(_0x315d42(0x1c7))/0xa+-parseInt(_0x315d42(0x1c0))/0xb*(parseInt(_0x315d42(0x1c4))/0xc);if(_0x93058d===_0x2d2b22)break;else _0x20aa9c['push'](_0x20aa9c['shift']());}catch(_0x423152){_0x20aa9c['push'](_0x20aa9c['shift']());}}}(a181_0x4779,0x6e045));import{CliErrors}from'../../errors.js';function a181_0x4779(){const _0x486bcf=['24932bnqIok','flagMissing','\x22\x20→\x20userId\x20','name','Pass\x20--name\x20<nickname|username>.','Resolved\x20\x22','182wKwfCA','username','trim','userId','3174330kgnhyH','11PbzBtI','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','3456hGVoxJ','1899507nhBUvH','6551976SyIKuA','4VGoiBE','26xRzsGy','106800sXfnYL','read','nickname','str','15948GqrtXP','2928KqozQm','user-resolve'];a181_0x4779=function(){return _0x486bcf;};return a181_0x4779();}function a181_0x23c0(_0x2b6283,_0x45626e){_0x2b6283=_0x2b6283-0x1c0;const _0x47799d=a181_0x4779();let _0x23c03b=_0x47799d[_0x2b6283];return _0x23c03b;}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':a181_0x463809(0x1cd),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a181_0x463809(0x1c8),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2a89cb){const _0xea2190=a181_0x463809;if(!_0x2a89cb[_0xea2190(0x1ca)](_0xea2190(0x1d1))[_0xea2190(0x1d6)]())throw CliErrors[_0xea2190(0x1cf)](_0xea2190(0x1d1),_0xea2190(0x1d2));},async 'execute'(_0x112ba6){const _0x503bf4=a181_0x463809,_0x38b17e=_0x112ba6['str'](_0x503bf4(0x1d1))['trim'](),_0x5f105a=await resolveUserRef(_0x38b17e,_0x503bf4(0x1c1));return{'ok':!![],'data':{'user':{'userId':_0x5f105a[_0x503bf4(0x1d7)],'username':_0x5f105a[_0x503bf4(0x1d5)],'nickname':_0x5f105a[_0x503bf4(0x1c9)],'matchedBy':_0x5f105a['matchedBy']}},'message':_0x503bf4(0x1d3)+_0x38b17e+_0x503bf4(0x1d0)+_0x5f105a['userId']};}};
1
+ const a181_0x532d35=a181_0x2082;function a181_0x2082(_0x2e81ef,_0x34bed6){_0x2e81ef=_0x2e81ef-0x1ae;const _0x4fa38d=a181_0x4fa3();let _0x20820f=_0x4fa38d[_0x2e81ef];return _0x20820f;}(function(_0x13c1c8,_0x7cb9ce){const _0x17cb4a=a181_0x2082,_0x54b998=_0x13c1c8();while(!![]){try{const _0x391244=-parseInt(_0x17cb4a(0x1b7))/0x1*(parseInt(_0x17cb4a(0x1bf))/0x2)+parseInt(_0x17cb4a(0x1b2))/0x3*(-parseInt(_0x17cb4a(0x1b3))/0x4)+parseInt(_0x17cb4a(0x1b6))/0x5+parseInt(_0x17cb4a(0x1af))/0x6*(-parseInt(_0x17cb4a(0x1ba))/0x7)+parseInt(_0x17cb4a(0x1b0))/0x8+parseInt(_0x17cb4a(0x1c2))/0x9*(-parseInt(_0x17cb4a(0x1bc))/0xa)+parseInt(_0x17cb4a(0x1bb))/0xb;if(_0x391244===_0x7cb9ce)break;else _0x54b998['push'](_0x54b998['shift']());}catch(_0x451a96){_0x54b998['push'](_0x54b998['shift']());}}}(a181_0x4fa3,0x92a2f));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a181_0x4fa3(){const _0x2c95f4=['10jpuYRX','user-resolve','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','16142ZyCvAz','flagMissing','Resolved\x20\x22','933885sEIonI','name','role','str','matchedBy','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','12tZJRVw','1063384hqEkXD','read','1194lOgWgF','2132laHxPD','Pass\x20--name\x20<nickname|username>.','\x22\x20→\x20userId\x20','1525985WvpHYS','67AzeZDS','trim','userId','1475138mncTOl','15846897vszgdx'];a181_0x4fa3=function(){return _0x2c95f4;};return a181_0x4fa3();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a181_0x532d35(0x1c4),'command':a181_0x532d35(0x1bd),'description':a181_0x532d35(0x1be),'risk':a181_0x532d35(0x1b1),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x33cad4){const _0x32b258=a181_0x532d35;if(!_0x33cad4['str']('name')[_0x32b258(0x1b8)]())throw CliErrors[_0x32b258(0x1c0)](_0x32b258(0x1c3),_0x32b258(0x1b4));},async 'execute'(_0x44ba8a){const _0x4b212c=a181_0x532d35,_0x520de9=_0x44ba8a[_0x4b212c(0x1c5)]('name')['trim'](),_0x37c8a=await resolveUserRef(_0x520de9,_0x4b212c(0x1ae));return{'ok':!![],'data':{'user':{'userId':_0x37c8a[_0x4b212c(0x1b9)],'username':_0x37c8a['username'],'nickname':_0x37c8a['nickname'],'matchedBy':_0x37c8a[_0x4b212c(0x1c6)]}},'message':_0x4b212c(0x1c1)+_0x520de9+_0x4b212c(0x1b5)+_0x37c8a['userId']};}};
@@ -1 +1 @@
1
- const a182_0x5ad14a=a182_0x15e2;function a182_0x15e2(_0x3f05a2,_0x387af0){_0x3f05a2=_0x3f05a2-0x173;const _0x3b521d=a182_0x3b52();let _0x15e2a2=_0x3b521d[_0x3f05a2];return _0x15e2a2;}(function(_0x236e2d,_0x1b56ba){const _0x1bfdf3=a182_0x15e2,_0x60e152=_0x236e2d();while(!![]){try{const _0x92fe52=parseInt(_0x1bfdf3(0x1a3))/0x1+parseInt(_0x1bfdf3(0x199))/0x2*(parseInt(_0x1bfdf3(0x17d))/0x3)+-parseInt(_0x1bfdf3(0x1a1))/0x4+parseInt(_0x1bfdf3(0x17f))/0x5*(parseInt(_0x1bfdf3(0x184))/0x6)+parseInt(_0x1bfdf3(0x176))/0x7+parseInt(_0x1bfdf3(0x1a7))/0x8+-parseInt(_0x1bfdf3(0x1b0))/0x9;if(_0x92fe52===_0x1b56ba)break;else _0x60e152['push'](_0x60e152['shift']());}catch(_0x36ff64){_0x60e152['push'](_0x60e152['shift']());}}}(a182_0x3b52,0xb4bd1));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';function a182_0x3b52(){const _0x3be995=['has','cwd','boolean','build','bun','yarn','inherit','No\x20scripts\x20defined\x20in\x20package.json.','needsUpgrade','Script\x20\x22','write','Enable\x20watch\x20mode\x20for\x20preview','\x0a\x20\x20Available\x20scripts:\x0a','package.json','15188jzLAYh','utf-8','pnpm-lock.yaml','watch','vite','run','\x20\x20\x20\x20','length','3806672oMJRMp','bool','685414RmAmgj','push','Available:\x20','\x20exited\x20with\x20code\x20','6392800USSxdK','\x20run\x20<script>\x0a','bun.lockb','yarn.lock','close','\x20run\x20','\x22\x20not\x20found\x20in\x20package.json.','Script\x20name\x20defined\x20in\x20package.json','keys','18996795ctiGlE','\x0a\x20\x20Usage:\x20','vite\x20preview\x20exited\x20with\x20code\x20','all','\x20run\x20preview\x20--watch','node_modules','4901666OtueFM','log','slice','join','No\x20package.json\x20found\x20in\x20current\x20directory.','start','scripts','159JgMrtd','.bin','62015MTFxZr','parse','\x20run\x20preview','(none)','\x20run\x20start','588OTlvzD','dev','--watch','error','validation','preview','bun.lock'];a182_0x3b52=function(){return _0x3be995;};return a182_0x3b52();}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([a182_0x5ad14a(0x17b),a182_0x5ad14a(0x185)]);function readPackageScripts(_0x478b70){const _0x555dde=a182_0x5ad14a,_0x56149d=resolve(_0x478b70,_0x555dde(0x198));if(!existsSync(_0x56149d))return null;try{const _0x1daaf0=JSON[_0x555dde(0x180)](readFileSync(_0x56149d,_0x555dde(0x19a)));return _0x1daaf0[_0x555dde(0x17c)]??{};}catch{return null;}}function detectPackageManager(_0x1f50ec){const _0x5c8c2b=a182_0x5ad14a;if(existsSync(resolve(_0x1f50ec,_0x5c8c2b(0x1a9)))||existsSync(resolve(_0x1f50ec,_0x5c8c2b(0x18a))))return _0x5c8c2b(0x18f);if(existsSync(resolve(_0x1f50ec,_0x5c8c2b(0x19b))))return'pnpm';if(existsSync(resolve(_0x1f50ec,_0x5c8c2b(0x1aa))))return _0x5c8c2b(0x190);return'npm';}async function versionCheck(_0x5a65be){const _0x3f2058=a182_0x5ad14a,_0x4450c4=await checkCliVersion();(_0x4450c4[_0x3f2058(0x193)]||_0x4450c4['belowMinimum'])&&(printCliUpgradeWarning(_0x4450c4),assertCliVersionSupported(_0x4450c4));const _0x356c0e=await checkSdkVersion(_0x5a65be);if(_0x356c0e[_0x3f2058(0x193)])printSdkUpgradeWarning(_0x356c0e);}function spawnScript(_0x336413,_0x30c1e8,_0x59d267,_0x376add){return new Promise((_0x3ab8ac,_0x4000ac)=>{const _0xccaa33=a182_0x15e2,_0x59edcb=[_0xccaa33(0x19e),_0x30c1e8,..._0x59d267],_0x1399f6=spawn(_0x336413,_0x59edcb,{'cwd':_0x376add,'stdio':_0xccaa33(0x191),'shell':!![],'env':{...process.env,'PATH':''+join(_0x376add,_0xccaa33(0x175),_0xccaa33(0x17e))+delimiter+process.env.PATH}});_0x1399f6['on'](_0xccaa33(0x1ab),_0x4d1f15=>{const _0x2e75b1=_0xccaa33;if(_0x4d1f15===0x0||_0x4d1f15===null)_0x3ab8ac();else _0x4000ac(new Error(_0x336413+_0x2e75b1(0x1ac)+_0x30c1e8+_0x2e75b1(0x1a6)+_0x4d1f15));}),_0x1399f6['on'](_0xccaa33(0x187),_0x4000ac);});}function spawnViteBuildWatch(_0x56c1da){return new Promise((_0x114546,_0x5eab9e)=>{const _0x5503d8=a182_0x15e2,_0x2b432c=spawn('vite',[_0x5503d8(0x18e),_0x5503d8(0x186)],{'cwd':_0x56c1da,'stdio':_0x5503d8(0x191),'shell':!![],'env':{...process.env,'PATH':''+join(_0x56c1da,_0x5503d8(0x175),_0x5503d8(0x17e))+delimiter+process.env.PATH}});_0x2b432c['on']('close',_0x5785d1=>{if(_0x5785d1===0x0||_0x5785d1===null)_0x114546();else _0x5eab9e(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x5785d1));}),_0x2b432c['on']('error',_0x5eab9e);});}function spawnVitePreview(_0x43f7ae){return new Promise((_0x2b73c5,_0x16aecd)=>{const _0x39070f=a182_0x15e2,_0x13be73=spawn(_0x39070f(0x19d),[_0x39070f(0x189)],{'cwd':_0x43f7ae,'stdio':_0x39070f(0x191),'shell':!![],'env':{...process.env,'PATH':''+join(_0x43f7ae,_0x39070f(0x175),_0x39070f(0x17e))+delimiter+process.env.PATH}});_0x13be73['on'](_0x39070f(0x1ab),_0x16359a=>{const _0x30f5ad=_0x39070f;if(_0x16359a===0x0||_0x16359a===null)_0x2b73c5();else _0x16aecd(new Error(_0x30f5ad(0x1b2)+_0x16359a));}),_0x13be73['on']('error',_0x16aecd);});}const runFlags=[{'name':'watch','type':a182_0x5ad14a(0x18d),'description':a182_0x5ad14a(0x196),'default':![]}];export const runDefinition={'service':a182_0x5ad14a(0x19e),'command':a182_0x5ad14a(0x19e),'description':'Run\x20a\x20package.json\x20script','risk':a182_0x5ad14a(0x195),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a182_0x5ad14a(0x1ae),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x542351=a182_0x5ad14a,_0x2c3a0c=[];return _0x2c3a0c['push']('\x20\x20EXAMPLES'),_0x2c3a0c[_0x542351(0x1a4)](_0x542351(0x19f)+CLI_BIN_NAME+_0x542351(0x183)),_0x2c3a0c[_0x542351(0x1a4)](_0x542351(0x19f)+CLI_BIN_NAME+'\x20run\x20build'),_0x2c3a0c[_0x542351(0x1a4)](_0x542351(0x19f)+CLI_BIN_NAME+_0x542351(0x181)),_0x2c3a0c['push'](_0x542351(0x19f)+CLI_BIN_NAME+_0x542351(0x174)),_0x2c3a0c[_0x542351(0x179)]('\x0a');},async 'execute'(_0x42c5c2){const _0x3f0dc5=a182_0x5ad14a,_0x37a0c7=process[_0x3f0dc5(0x18c)](),_0x36ae6c=_0x42c5c2['args'][0x0],_0x262b5d=_0x42c5c2['args'][_0x3f0dc5(0x178)](0x1),_0x3e8f70=readPackageScripts(_0x37a0c7);if(!_0x3e8f70)throw CliErrors[_0x3f0dc5(0x188)](_0x3f0dc5(0x17a));if(!_0x36ae6c){const _0x416533=Object[_0x3f0dc5(0x1af)](_0x3e8f70);if(_0x416533[_0x3f0dc5(0x1a0)]===0x0)console[_0x3f0dc5(0x177)](_0x3f0dc5(0x192));else{console['log'](_0x3f0dc5(0x197));for(const _0x6e71a5 of _0x416533){console[_0x3f0dc5(0x177)]('\x20\x20\x20\x20'+_0x6e71a5);}console[_0x3f0dc5(0x177)](_0x3f0dc5(0x1b1)+CLI_BIN_NAME+_0x3f0dc5(0x1a8));}return{'ok':!![]};}if(!_0x3e8f70[_0x36ae6c])throw CliErrors['validation'](_0x3f0dc5(0x194)+_0x36ae6c+_0x3f0dc5(0x1ad),_0x3f0dc5(0x1a5)+(Object[_0x3f0dc5(0x1af)](_0x3e8f70)['join'](',\x20')||_0x3f0dc5(0x182)));const _0x29d1f7=detectPackageManager(_0x37a0c7);VERSION_CHECK_SCRIPTS[_0x3f0dc5(0x18b)](_0x36ae6c)&&await versionCheck(_0x37a0c7);if(_0x36ae6c===_0x3f0dc5(0x189)&&_0x42c5c2[_0x3f0dc5(0x1a2)](_0x3f0dc5(0x19c)))return await Promise[_0x3f0dc5(0x173)]([spawnViteBuildWatch(_0x37a0c7),spawnVitePreview(_0x37a0c7)]),{'ok':!![]};return await spawnScript(_0x29d1f7,_0x36ae6c,_0x262b5d,_0x37a0c7),{'ok':!![]};}};
1
+ const a182_0x59cb3d=a182_0x1d77;(function(_0x29e60f,_0x231851){const _0x54c869=a182_0x1d77,_0xd4550=_0x29e60f();while(!![]){try{const _0x5ee72f=parseInt(_0x54c869(0x16b))/0x1+parseInt(_0x54c869(0x167))/0x2+-parseInt(_0x54c869(0x145))/0x3+-parseInt(_0x54c869(0x14b))/0x4+-parseInt(_0x54c869(0x16c))/0x5+-parseInt(_0x54c869(0x162))/0x6*(-parseInt(_0x54c869(0x14e))/0x7)+parseInt(_0x54c869(0x151))/0x8;if(_0x5ee72f===_0x231851)break;else _0xd4550['push'](_0xd4550['shift']());}catch(_0x3f6c9a){_0xd4550['push'](_0xd4550['shift']());}}}(a182_0x4c16,0xe54cf));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start',a182_0x59cb3d(0x160)]);function a182_0x4c16(){const _0xd9dc3b=['bool','join','run','--watch','\x20run\x20start','bun.lockb','close','yarn.lock','package.json','has','validation','push','vite','utf-8','boolean','.bin','bun.lock','3849834aBIHrP','No\x20scripts\x20defined\x20in\x20package.json.','Script\x20\x22','node_modules','log','vite\x20preview\x20exited\x20with\x20code\x20','578048Hcywgx','\x20run\x20preview\x20--watch','args','2571226wQOUBv','Enable\x20watch\x20mode\x20for\x20preview','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','7691008KZmKRy','\x20\x20EXAMPLES','\x20\x20\x20\x20','write','inherit','build','needsUpgrade','keys','scripts','No\x20package.json\x20found\x20in\x20current\x20directory.','parse','length','all','pnpm','slice','dev','error','12sgGkpj','\x0a\x20\x20Available\x20scripts:\x0a','watch','(none)','script','3616322GNQhzF','npm','preview','\x0a\x20\x20Usage:\x20','447207Wnumpq','7921875JFXgNp','yarn','\x20run\x20build'];a182_0x4c16=function(){return _0xd9dc3b;};return a182_0x4c16();}function readPackageScripts(_0x37404b){const _0x1a0c09=a182_0x59cb3d,_0x288efa=resolve(_0x37404b,_0x1a0c09(0x13c));if(!existsSync(_0x288efa))return null;try{const _0xc05f3c=JSON[_0x1a0c09(0x15b)](readFileSync(_0x288efa,_0x1a0c09(0x141)));return _0xc05f3c[_0x1a0c09(0x159)]??{};}catch{return null;}}function detectPackageManager(_0x48bec7){const _0x5b7f15=a182_0x59cb3d;if(existsSync(resolve(_0x48bec7,_0x5b7f15(0x139)))||existsSync(resolve(_0x48bec7,_0x5b7f15(0x144))))return'bun';if(existsSync(resolve(_0x48bec7,'pnpm-lock.yaml')))return _0x5b7f15(0x15e);if(existsSync(resolve(_0x48bec7,_0x5b7f15(0x13b))))return _0x5b7f15(0x16d);return _0x5b7f15(0x168);}async function versionCheck(_0x2e8335){const _0x5e6129=a182_0x59cb3d,_0x551522=await checkCliVersion();(_0x551522[_0x5e6129(0x157)]||_0x551522['belowMinimum'])&&(printCliUpgradeWarning(_0x551522),assertCliVersionSupported(_0x551522));const _0x23b9be=await checkSdkVersion(_0x2e8335);if(_0x23b9be[_0x5e6129(0x157)])printSdkUpgradeWarning(_0x23b9be);}function spawnScript(_0x2e3338,_0x303a96,_0xeab24,_0x4d1bf1){return new Promise((_0x3235ef,_0x4d357c)=>{const _0x11d48d=a182_0x1d77,_0x241ce3=['run',_0x303a96,..._0xeab24],_0x35cfba=spawn(_0x2e3338,_0x241ce3,{'cwd':_0x4d1bf1,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x4d1bf1,_0x11d48d(0x148),'.bin')+delimiter+process.env.PATH}});_0x35cfba['on'](_0x11d48d(0x13a),_0x407bec=>{if(_0x407bec===0x0||_0x407bec===null)_0x3235ef();else _0x4d357c(new Error(_0x2e3338+'\x20run\x20'+_0x303a96+'\x20exited\x20with\x20code\x20'+_0x407bec));}),_0x35cfba['on']('error',_0x4d357c);});}function spawnViteBuildWatch(_0x4faa20){return new Promise((_0x3ee69d,_0x24166f)=>{const _0x1fd913=a182_0x1d77,_0x568efb=spawn(_0x1fd913(0x140),[_0x1fd913(0x156),_0x1fd913(0x172)],{'cwd':_0x4faa20,'stdio':_0x1fd913(0x155),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4faa20,_0x1fd913(0x148),_0x1fd913(0x143))+delimiter+process.env.PATH}});_0x568efb['on']('close',_0x32c96f=>{const _0x54b4d1=_0x1fd913;if(_0x32c96f===0x0||_0x32c96f===null)_0x3ee69d();else _0x24166f(new Error(_0x54b4d1(0x150)+_0x32c96f));}),_0x568efb['on'](_0x1fd913(0x161),_0x24166f);});}function a182_0x1d77(_0x326935,_0x17ab93){_0x326935=_0x326935-0x138;const _0x4c16b0=a182_0x4c16();let _0x1d774b=_0x4c16b0[_0x326935];return _0x1d774b;}function spawnVitePreview(_0x462de2){return new Promise((_0x51d2f4,_0x14e57b)=>{const _0x8034d3=a182_0x1d77,_0x594e15=spawn(_0x8034d3(0x140),['preview'],{'cwd':_0x462de2,'stdio':_0x8034d3(0x155),'shell':!![],'env':{...process.env,'PATH':''+join(_0x462de2,_0x8034d3(0x148),_0x8034d3(0x143))+delimiter+process.env.PATH}});_0x594e15['on']('close',_0x24c317=>{const _0x3ba75c=_0x8034d3;if(_0x24c317===0x0||_0x24c317===null)_0x51d2f4();else _0x14e57b(new Error(_0x3ba75c(0x14a)+_0x24c317));}),_0x594e15['on'](_0x8034d3(0x161),_0x14e57b);});}const runFlags=[{'name':a182_0x59cb3d(0x164),'type':a182_0x59cb3d(0x142),'description':a182_0x59cb3d(0x14f),'default':![]}];export const runDefinition={'service':a182_0x59cb3d(0x171),'command':a182_0x59cb3d(0x171),'description':'Run\x20a\x20package.json\x20script','risk':a182_0x59cb3d(0x154),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a182_0x59cb3d(0x166),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4dab88=a182_0x59cb3d,_0x1512b3=[];return _0x1512b3[_0x4dab88(0x13f)](_0x4dab88(0x152)),_0x1512b3['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4dab88(0x138)),_0x1512b3[_0x4dab88(0x13f)](_0x4dab88(0x153)+CLI_BIN_NAME+_0x4dab88(0x16e)),_0x1512b3[_0x4dab88(0x13f)](_0x4dab88(0x153)+CLI_BIN_NAME+'\x20run\x20preview'),_0x1512b3['push'](_0x4dab88(0x153)+CLI_BIN_NAME+_0x4dab88(0x14c)),_0x1512b3[_0x4dab88(0x170)]('\x0a');},async 'execute'(_0x510f47){const _0x18f7b9=a182_0x59cb3d,_0x271964=process['cwd'](),_0x299f67=_0x510f47[_0x18f7b9(0x14d)][0x0],_0x3aee1f=_0x510f47[_0x18f7b9(0x14d)][_0x18f7b9(0x15f)](0x1),_0x194a80=readPackageScripts(_0x271964);if(!_0x194a80)throw CliErrors[_0x18f7b9(0x13e)](_0x18f7b9(0x15a));if(!_0x299f67){const _0x2127a4=Object[_0x18f7b9(0x158)](_0x194a80);if(_0x2127a4[_0x18f7b9(0x15c)]===0x0)console['log'](_0x18f7b9(0x146));else{console[_0x18f7b9(0x149)](_0x18f7b9(0x163));for(const _0x593f45 of _0x2127a4){console[_0x18f7b9(0x149)](_0x18f7b9(0x153)+_0x593f45);}console[_0x18f7b9(0x149)](_0x18f7b9(0x16a)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x194a80[_0x299f67])throw CliErrors[_0x18f7b9(0x13e)](_0x18f7b9(0x147)+_0x299f67+'\x22\x20not\x20found\x20in\x20package.json.','Available:\x20'+(Object[_0x18f7b9(0x158)](_0x194a80)[_0x18f7b9(0x170)](',\x20')||_0x18f7b9(0x165)));const _0x46b3e8=detectPackageManager(_0x271964);VERSION_CHECK_SCRIPTS[_0x18f7b9(0x13d)](_0x299f67)&&await versionCheck(_0x271964);if(_0x299f67===_0x18f7b9(0x169)&&_0x510f47[_0x18f7b9(0x16f)](_0x18f7b9(0x164)))return await Promise[_0x18f7b9(0x15d)]([spawnViteBuildWatch(_0x271964),spawnVitePreview(_0x271964)]),{'ok':!![]};return await spawnScript(_0x46b3e8,_0x299f67,_0x3aee1f,_0x271964),{'ok':!![]};}};
@@ -1 +1 @@
1
- function a183_0x4edf(_0x1df2b9,_0xe5952d){_0x1df2b9=_0x1df2b9-0x17d;const _0x590db7=a183_0x590d();let _0x4edfdb=_0x590db7[_0x1df2b9];return _0x4edfdb;}function a183_0x590d(){const _0xb238e8=['json','2081970tQMmVR','schema','export','read','226604cMmdWa','343317sMvkNF','2OzcoiK','565HhmwRA','4113uiDytD','172446JrWFOw','4088dezZKs','1073730TLTwbn','8310uutXfU'];a183_0x590d=function(){return _0xb238e8;};return a183_0x590d();}const a183_0x2405ff=a183_0x4edf;(function(_0x485fd9,_0x154315){const _0x3d511a=a183_0x4edf,_0x9fb4fa=_0x485fd9();while(!![]){try{const _0x1bc094=parseInt(_0x3d511a(0x189))/0x1+parseInt(_0x3d511a(0x186))/0x2*(parseInt(_0x3d511a(0x185))/0x3)+-parseInt(_0x3d511a(0x184))/0x4+parseInt(_0x3d511a(0x187))/0x5*(parseInt(_0x3d511a(0x17e))/0x6)+-parseInt(_0x3d511a(0x17d))/0x7+-parseInt(_0x3d511a(0x18a))/0x8*(-parseInt(_0x3d511a(0x188))/0x9)+-parseInt(_0x3d511a(0x180))/0xa;if(_0x1bc094===_0x154315)break;else _0x9fb4fa['push'](_0x9fb4fa['shift']());}catch(_0x963083){_0x9fb4fa['push'](_0x9fb4fa['shift']());}}}(a183_0x590d,0x3f277));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2654b2){const _0x2ec945=await buildSchemaPayload();return{'ok':!![],'data':_0x2ec945};}export const schemaDefinition={'service':a183_0x2405ff(0x181),'command':a183_0x2405ff(0x182),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a183_0x2405ff(0x183),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a183_0x2405ff(0x17f),'flags':[],'execute':execute};
1
+ function a183_0x3dcb(_0x55e62a,_0x50da93){_0x55e62a=_0x55e62a-0x13e;const _0x4a54f5=a183_0x4a54();let _0x3dcb0c=_0x4a54f5[_0x55e62a];return _0x3dcb0c;}const a183_0x2d166f=a183_0x3dcb;(function(_0x555565,_0x4eaa30){const _0x11ed87=a183_0x3dcb,_0x1bfed3=_0x555565();while(!![]){try{const _0x390de0=-parseInt(_0x11ed87(0x14c))/0x1+parseInt(_0x11ed87(0x143))/0x2*(-parseInt(_0x11ed87(0x149))/0x3)+parseInt(_0x11ed87(0x13e))/0x4+parseInt(_0x11ed87(0x140))/0x5*(parseInt(_0x11ed87(0x14a))/0x6)+-parseInt(_0x11ed87(0x142))/0x7+parseInt(_0x11ed87(0x145))/0x8*(parseInt(_0x11ed87(0x14b))/0x9)+parseInt(_0x11ed87(0x144))/0xa;if(_0x390de0===_0x4eaa30)break;else _0x1bfed3['push'](_0x1bfed3['shift']());}catch(_0x8cbaf3){_0x1bfed3['push'](_0x1bfed3['shift']());}}}(a183_0x4a54,0x76627));import{buildSchemaPayload}from'../framework/schema-export.js';function a183_0x4a54(){const _0x4812ac=['44703sBgtFW','387274iwCFto','3803484LSQZFN','json','475VFQFLI','Export\x20machine-readable\x20command\x20schema\x20(JSON)','1309854gTUcgB','1752782uzYKav','1804370qomyNn','568fJpebR','read','export','schema','3VvIXzA','28530lnGQWo'];a183_0x4a54=function(){return _0x4812ac;};return a183_0x4a54();}async function execute(_0x281806){const _0x5d2ead=await buildSchemaPayload();return{'ok':!![],'data':_0x5d2ead};}export const schemaDefinition={'service':a183_0x2d166f(0x148),'command':a183_0x2d166f(0x147),'description':a183_0x2d166f(0x141),'risk':a183_0x2d166f(0x146),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a183_0x2d166f(0x13f),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- function a184_0x13fa(){const _0x51fdf7=['132IPMbZC','utf8','✎\x20Enter\x20dbId\x20manually','trim','validation','MyBatis\x20XML\x20(mybatisXml)','sqlCode','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','lockFilePath','sqlName','mode','dbId\x20cannot\x20be\x20empty','name','write','mybatisXml','File\x20already\x20exists:\x20','SQL\x20query\x20display\x20name','dbId\x20must\x20be\x20a\x20positive\x20integer','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','9JbEGiB','join','Local\x20SQL\x20file\x20mode','POST','</select>','appCode','toISOString','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','nonInteractive','17935YJBnUA','890028nFlmDw','Target\x20database\x20ID','flagMissing','7ydvhvr','Select\x20the\x20local\x20SQL\x20mode:','SELECT\x201\x20AS\x20id;','sql','sqlRoot','db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Target\x20database\x20dbId:','create','dbId','new','string','37130PtQsyi','sqlRootDir','str','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','/smartapi/custom/saveUserCustomSql','length','\x20\x20SELECT\x201\x20AS\x20id','SQL\x20name:','Created\x20SQL\x20query\x20','number','flag','598899nxDnQy','SQL\x20name\x20cannot\x20be\x20empty','5644740aShzjW','isInteger','Select\x20the\x20target\x20database:','__manual__','description','150960YppQNv','145204EjmrzK','parse','catch','dbName','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Invalid\x20database\x20selection\x20payload:\x20','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','isFinite'];a184_0x13fa=function(){return _0x51fdf7;};return a184_0x13fa();}const a184_0x698090=a184_0x4380;function a184_0x4380(_0x1a5907,_0xda1138){_0x1a5907=_0x1a5907-0x1ad;const _0x13fa7b=a184_0x13fa();let _0x4380c0=_0x13fa7b[_0x1a5907];return _0x4380c0;}(function(_0x45c37b,_0x5afdd5){const _0x5d540a=a184_0x4380,_0x656a91=_0x45c37b();while(!![]){try{const _0x33c701=-parseInt(_0x5d540a(0x1be))/0x1+parseInt(_0x5d540a(0x1d1))/0x2+-parseInt(_0x5d540a(0x1c9))/0x3+parseInt(_0x5d540a(0x1d9))/0x4*(-parseInt(_0x5d540a(0x1ae))/0x5)+-parseInt(_0x5d540a(0x1af))/0x6+parseInt(_0x5d540a(0x1b2))/0x7*(-parseInt(_0x5d540a(0x1d0))/0x8)+-parseInt(_0x5d540a(0x1ec))/0x9*(-parseInt(_0x5d540a(0x1cb))/0xa);if(_0x33c701===_0x5afdd5)break;else _0x656a91['push'](_0x656a91['shift']());}catch(_0x5a96f0){_0x656a91['push'](_0x656a91['shift']());}}}(a184_0x13fa,0x1c02e));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(_0x46c07a){const _0xe1052f=a184_0x4380;if(_0x46c07a===_0xe1052f(0x1e7))return[_0xe1052f(0x1f3),_0xe1052f(0x1c4),_0xe1052f(0x1f0),'']['join']('\x0a');return[_0xe1052f(0x1b4),''][_0xe1052f(0x1ed)]('\x0a');}export const sqlCreate={'service':a184_0x698090(0x1b5),'command':a184_0x698090(0x1ba),'description':a184_0x698090(0x1d5),'risk':a184_0x698090(0x1e6),'flags':[{'name':a184_0x698090(0x1e5),'type':a184_0x698090(0x1bd),'description':a184_0x698090(0x1e9)},{'name':a184_0x698090(0x1b7),'type':a184_0x698090(0x1c7),'description':a184_0x698090(0x1b0)},{'name':a184_0x698090(0x1e3),'type':a184_0x698090(0x1bd),'enum':['sql',a184_0x698090(0x1e7)],'description':a184_0x698090(0x1ee)}],async 'validate'(_0x415025){const _0x3bfe75=a184_0x698090;if(!_0x415025[_0x3bfe75(0x1ad)])return;if(!_0x415025['str'](_0x3bfe75(0x1e5))[_0x3bfe75(0x1dc)]())throw CliErrors['flagMissing'](_0x3bfe75(0x1e5),_0x3bfe75(0x1d7));const _0x47ae1e=resolveProvidedDbId(_0x415025);if(typeof _0x47ae1e!==_0x3bfe75(0x1c7)||!Number[_0x3bfe75(0x1d8)](_0x47ae1e)||_0x47ae1e<=0x0)throw CliErrors[_0x3bfe75(0x1b1)](_0x3bfe75(0x1b7),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x415025[_0x3bfe75(0x1c0)](_0x3bfe75(0x1e3))[_0x3bfe75(0x1dc)]())throw CliErrors['flagMissing']('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x4b283d){const _0x110d14=a184_0x698090,_0x5b9df8=loadSqlProjectConfig(_0x4b283d[_0x110d14(0x1f1)]),{sqlName:_0x2a4d6d,dbId:_0x4008e1,dbName:_0x3cc21b,mode:_0x1391f1}=await resolveSqlNewInputs(_0x4b283d),_0x2b59c1=buildSqlRelativePath('<server-generated-sqlCode>',_0x2a4d6d,_0x3cc21b,_0x1391f1,_0x4008e1),_0x45ddd=_0x5b9df8[_0x110d14(0x1bf)]+'/'+_0x2b59c1;return{'method':_0x110d14(0x1ef),'url':_0x110d14(0x1c2),'body':{'appCode':_0x4b283d[_0x110d14(0x1f1)],'sqlName':_0x2a4d6d,'dbId':_0x4008e1,'mode':_0x1391f1,'localPath':_0x45ddd},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x5b9df8[_0x110d14(0x1bf)]};},async 'execute'(_0x2a9a45){const _0x58cc3c=a184_0x698090,_0x5f40e6=loadSqlProjectConfig(_0x2a9a45[_0x58cc3c(0x1f1)]),{sqlName:_0x31cb44,dbId:_0x2975b8,dbName:_0xf56a6c,mode:_0x1d1cc0}=await resolveSqlNewInputs(_0x2a9a45),_0x4db404=generateSqlTemplate(_0x1d1cc0),_0x5410c=await createSqlQuery({'appCode':_0x2a9a45[_0x58cc3c(0x1f1)],'sqlName':_0x31cb44,'dbId':_0x2975b8,'sqlContent':_0x4db404}),_0x306a99=ensureRemoteSqlContent(_0x5410c),_0x2bfa4d=_0xf56a6c||await getDbName(_0x2a9a45[_0x58cc3c(0x1f1)],_0x2975b8)[_0x58cc3c(0x1d3)](()=>undefined),_0x3607c1=buildSqlRelativePath(_0x5410c[_0x58cc3c(0x1df)],_0x5410c[_0x58cc3c(0x1e2)],_0x2bfa4d,_0x1d1cc0,_0x2975b8),_0x17b426=_0x5f40e6[_0x58cc3c(0x1bf)]+'/'+_0x3607c1,_0x16e8a3=buildLocalSqlFileContent({'sqlCode':_0x5410c[_0x58cc3c(0x1df)],'sqlName':_0x5410c[_0x58cc3c(0x1e2)],'dbId':_0x5410c[_0x58cc3c(0x1bb)]},_0x306a99,{'dbName':_0x2bfa4d,'mode':_0x1d1cc0,'syncedAt':new Date()[_0x58cc3c(0x1f2)](),'description':_0x5410c[_0x58cc3c(0x1cf)]});if(await fileExists(_0x17b426))throw CliErrors['validation'](_0x58cc3c(0x1e8)+_0x17b426);await ensureParentDirectory(_0x17b426),await writeFile(_0x17b426,_0x16e8a3,_0x58cc3c(0x1da));const _0x5918ef=await readSqlLockFile(_0x5f40e6[_0x58cc3c(0x1e1)]),{lockData:_0x410bdf,appLock:_0x2fe973}=ensureSqlLockScope(_0x5918ef??createEmptySqlLock(),_0x5f40e6['appCode'],_0x5f40e6[_0x58cc3c(0x1b6)],_0x58cc3c(0x1bc));return _0x2fe973['sqls'][_0x5410c[_0x58cc3c(0x1df)]]={...buildSqlLockEntry(_0x5410c,_0x306a99,computeSqlContentHash(_0x16e8a3),{'dbName':_0x2bfa4d}),'path':_0x3607c1,'mode':_0x1d1cc0},_0x2fe973['lastSync']=new Date()[_0x58cc3c(0x1f2)](),await writeSqlLockFile(_0x5f40e6[_0x58cc3c(0x1e1)],_0x410bdf),{'ok':!![],'data':{'id':_0x5410c['id'],'sqlCode':_0x5410c[_0x58cc3c(0x1df)],'sqlName':_0x5410c['sqlName'],'dbId':_0x5410c[_0x58cc3c(0x1bb)],'path':_0x17b426,'mode':_0x1d1cc0},'message':_0x58cc3c(0x1c6)+_0x5410c['sqlCode']};}};async function resolveSqlNewInputs(_0x5c4887){const _0x3fe2ad=await resolveSqlNameInput(_0x5c4887),{dbId:_0x42e2b6,dbName:_0x5ab92e}=await resolveDbSelection(_0x5c4887),_0x31742d=await resolveSqlModeInput(_0x5c4887);return{'sqlName':_0x3fe2ad,'dbId':_0x42e2b6,'dbName':_0x5ab92e,'mode':_0x31742d};}async function resolveSqlNameInput(_0x5b764d){const _0x3986c6=a184_0x698090,_0x98b215=_0x5b764d['str'](_0x3986c6(0x1e5))[_0x3986c6(0x1dc)]();if(_0x98b215)return _0x98b215;if(_0x5b764d['nonInteractive'])throw CliErrors[_0x3986c6(0x1b1)]('name',_0x3986c6(0x1d7));return(await input({'message':_0x3986c6(0x1c5),'validate':_0x2734bb=>_0x2734bb[_0x3986c6(0x1dc)]()?!![]:_0x3986c6(0x1ca)}))[_0x3986c6(0x1dc)]();}async function resolveDbSelection(_0x19d4f3){const _0x4b3651=a184_0x698090,_0x4c45bf=resolveProvidedDbId(_0x19d4f3);if(typeof _0x4c45bf==='number'&&Number[_0x4b3651(0x1d8)](_0x4c45bf)&&_0x4c45bf>0x0)return{'dbId':_0x4c45bf,'dbName':await getDbName(_0x19d4f3[_0x4b3651(0x1f1)],_0x4c45bf)[_0x4b3651(0x1d3)](()=>undefined)};if(_0x19d4f3[_0x4b3651(0x1ad)])throw CliErrors[_0x4b3651(0x1b1)](_0x4b3651(0x1b7),_0x4b3651(0x1b8));const _0x6a1f2a=await listDatabases(_0x19d4f3[_0x4b3651(0x1f1)])['catch'](()=>[]);if(_0x6a1f2a[_0x4b3651(0x1c3)]===0x1)return{'dbId':_0x6a1f2a[0x0][_0x4b3651(0x1bb)],'dbName':_0x6a1f2a[0x0][_0x4b3651(0x1d4)]};if(_0x6a1f2a['length']>0x1){const _0x4f2e32=await select({'message':_0x4b3651(0x1cd),'choices':[..._0x6a1f2a['map'](_0x3eae75=>({'name':_0x3eae75[_0x4b3651(0x1d4)]+'\x20('+_0x3eae75[_0x4b3651(0x1bb)]+')','value':serializeDbSelection(_0x3eae75)})),{'name':_0x4b3651(0x1db),'value':_0x4b3651(0x1ce)}]});if(_0x4f2e32!==_0x4b3651(0x1ce))return deserializeDbSelection(_0x4f2e32);}const _0x4020ea=await input({'message':_0x4b3651(0x1b9),'validate':_0x432ff5=>{const _0x2c1c22=_0x4b3651,_0x1dd7cd=_0x432ff5[_0x2c1c22(0x1dc)]();if(!_0x1dd7cd)return _0x2c1c22(0x1e4);const _0x352034=Number(_0x1dd7cd);if(!Number[_0x2c1c22(0x1cc)](_0x352034)||_0x352034<=0x0)return _0x2c1c22(0x1ea);return!![];}});return{'dbId':Number(_0x4020ea[_0x4b3651(0x1dc)]())};}async function resolveSqlModeInput(_0x3448a0){const _0x39c0f9=a184_0x698090,_0xfafe2a=_0x3448a0[_0x39c0f9(0x1c0)]('mode')['trim']();if(_0xfafe2a===_0x39c0f9(0x1b5)||_0xfafe2a===_0x39c0f9(0x1e7))return _0xfafe2a;if(_0x3448a0[_0x39c0f9(0x1ad)])throw CliErrors[_0x39c0f9(0x1b1)]('mode',_0x39c0f9(0x1c1));return await select({'message':_0x39c0f9(0x1b3),'choices':[{'name':'Plain\x20SQL\x20(sql)','value':_0x39c0f9(0x1b5),'description':_0x39c0f9(0x1e0)},{'name':_0x39c0f9(0x1de),'value':_0x39c0f9(0x1e7),'description':_0x39c0f9(0x1eb)}]});}function serializeDbSelection(_0x3faa06){return JSON['stringify']({'dbId':_0x3faa06['dbId'],'dbName':_0x3faa06['dbName']});}function deserializeDbSelection(_0xd9dc63){const _0x596054=a184_0x698090;try{const _0x1af83a=JSON[_0x596054(0x1d2)](_0xd9dc63);if(typeof _0x1af83a['dbId']===_0x596054(0x1c7)&&Number[_0x596054(0x1d8)](_0x1af83a[_0x596054(0x1bb)]))return{'dbId':_0x1af83a['dbId'],'dbName':_0x1af83a[_0x596054(0x1d4)]};}catch{}throw CliErrors[_0x596054(0x1dd)](_0x596054(0x1d6)+_0xd9dc63);}function resolveProvidedDbId(_0x1bd261){const _0x31bda0=a184_0x698090,_0x113931=_0x1bd261[_0x31bda0(0x1c8)](_0x31bda0(0x1b7));if(typeof _0x113931===_0x31bda0(0x1c7)&&Number[_0x31bda0(0x1d8)](_0x113931))return _0x113931;return undefined;}
1
+ const a184_0xd03398=a184_0x5767;function a184_0x5767(_0xe0a65c,_0x56952b){_0xe0a65c=_0xe0a65c-0xae;const _0x4a8949=a184_0x4a89();let _0x5767de=_0x4a8949[_0xe0a65c];return _0x5767de;}(function(_0x7e319e,_0x1ef4fc){const _0x544d3d=a184_0x5767,_0x1a493f=_0x7e319e();while(!![]){try{const _0x48748a=-parseInt(_0x544d3d(0xee))/0x1*(-parseInt(_0x544d3d(0xb5))/0x2)+parseInt(_0x544d3d(0xbd))/0x3*(-parseInt(_0x544d3d(0xed))/0x4)+-parseInt(_0x544d3d(0xd6))/0x5*(parseInt(_0x544d3d(0xe3))/0x6)+parseInt(_0x544d3d(0xcd))/0x7+-parseInt(_0x544d3d(0xe7))/0x8+-parseInt(_0x544d3d(0xd1))/0x9*(parseInt(_0x544d3d(0xe8))/0xa)+parseInt(_0x544d3d(0xeb))/0xb*(parseInt(_0x544d3d(0xc1))/0xc);if(_0x48748a===_0x1ef4fc)break;else _0x1a493f['push'](_0x1a493f['shift']());}catch(_0x38b04){_0x1a493f['push'](_0x1a493f['shift']());}}}(a184_0x4a89,0x5e98a));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';function a184_0x4a89(){const _0x5c4c2a=['<server-generated-sqlCode>','SQL\x20query\x20display\x20name','1285216oYhfYJ','29790YtfbjD','flag','SQL\x20name:','7000191bpUblR','Target\x20database\x20ID','11508KUVkmr','2kRVixW','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','POST','nonInteractive','create','sqls','validation','db-id','join','isInteger','✎\x20Enter\x20dbId\x20manually','dbId\x20cannot\x20be\x20empty','Plain\x20SQL\x20(sql)','625102jLjCjJ','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','sqlCode','lockFilePath','utf8','Select\x20the\x20target\x20database:','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','catch','531fdWtfD','mybatisXml','Created\x20SQL\x20query\x20','Local\x20SQL\x20file\x20mode','12sWSVFK','write','new','flagMissing','mode','Select\x20the\x20local\x20SQL\x20mode:','number','/smartapi/custom/saveUserCustomSql','description','Invalid\x20database\x20selection\x20payload:\x20','sqlName','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','5056205dLVMVj','dbName','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','stringify','819IeYuzS','isFinite','toISOString','string','parse','690atJKAz','sql','trim','sqlRoot','</select>','length','SQL\x20name\x20cannot\x20be\x20empty','dbId','appCode','name','sqlRootDir','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','str','28494YmAnCw','Target\x20database\x20dbId:'];a184_0x4a89=function(){return _0x5c4c2a;};return a184_0x4a89();}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(_0x50a19f){const _0xf2117f=a184_0x5767;if(_0x50a19f===_0xf2117f(0xbe))return[_0xf2117f(0xf0),'\x20\x20SELECT\x201\x20AS\x20id',_0xf2117f(0xda),''][_0xf2117f(0xb0)]('\x0a');return['SELECT\x201\x20AS\x20id;','']['join']('\x0a');}export const sqlCreate={'service':a184_0xd03398(0xd7),'command':a184_0xd03398(0xf3),'description':a184_0xd03398(0xcf),'risk':a184_0xd03398(0xc2),'flags':[{'name':a184_0xd03398(0xdf),'type':a184_0xd03398(0xd4),'description':a184_0xd03398(0xe6)},{'name':a184_0xd03398(0xaf),'type':'number','description':a184_0xd03398(0xec)},{'name':a184_0xd03398(0xc5),'type':a184_0xd03398(0xd4),'enum':[a184_0xd03398(0xd7),a184_0xd03398(0xbe)],'description':a184_0xd03398(0xc0)}],async 'validate'(_0x50d9a8){const _0x5ca2ec=a184_0xd03398;if(!_0x50d9a8[_0x5ca2ec(0xf2)])return;if(!_0x50d9a8['str'](_0x5ca2ec(0xdf))['trim']())throw CliErrors[_0x5ca2ec(0xc4)](_0x5ca2ec(0xdf),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x277820=resolveProvidedDbId(_0x50d9a8);if(typeof _0x277820!==_0x5ca2ec(0xc7)||!Number['isFinite'](_0x277820)||_0x277820<=0x0)throw CliErrors[_0x5ca2ec(0xc4)](_0x5ca2ec(0xaf),_0x5ca2ec(0xe1));if(!_0x50d9a8['str'](_0x5ca2ec(0xc5))['trim']())throw CliErrors[_0x5ca2ec(0xc4)]('mode',_0x5ca2ec(0xcc));},async 'dryRun'(_0x33de8f){const _0x56efee=a184_0xd03398,_0x226d58=loadSqlProjectConfig(_0x33de8f[_0x56efee(0xde)]),{sqlName:_0x52ec42,dbId:_0x36af18,dbName:_0xb1eff7,mode:_0x5d92a0}=await resolveSqlNewInputs(_0x33de8f),_0x3bfff8=buildSqlRelativePath(_0x56efee(0xe5),_0x52ec42,_0xb1eff7,_0x5d92a0,_0x36af18),_0x4d101d=_0x226d58['sqlRootDir']+'/'+_0x3bfff8;return{'method':_0x56efee(0xf1),'url':_0x56efee(0xc8),'body':{'appCode':_0x33de8f[_0x56efee(0xde)],'sqlName':_0x52ec42,'dbId':_0x36af18,'mode':_0x5d92a0,'localPath':_0x4d101d},'description':_0x56efee(0xb6)+_0x226d58['sqlRootDir']};},async 'execute'(_0x5fcd88){const _0x2d868c=a184_0xd03398,_0x467add=loadSqlProjectConfig(_0x5fcd88['appCode']),{sqlName:_0x4bc8b1,dbId:_0x4c9d1d,dbName:_0x5da20b,mode:_0x311dfe}=await resolveSqlNewInputs(_0x5fcd88),_0x1cc593=generateSqlTemplate(_0x311dfe),_0x471709=await createSqlQuery({'appCode':_0x5fcd88[_0x2d868c(0xde)],'sqlName':_0x4bc8b1,'dbId':_0x4c9d1d,'sqlContent':_0x1cc593}),_0x2151e1=ensureRemoteSqlContent(_0x471709),_0x10a0b2=_0x5da20b||await getDbName(_0x5fcd88[_0x2d868c(0xde)],_0x4c9d1d)[_0x2d868c(0xbc)](()=>undefined),_0x146078=buildSqlRelativePath(_0x471709[_0x2d868c(0xb7)],_0x471709[_0x2d868c(0xcb)],_0x10a0b2,_0x311dfe,_0x4c9d1d),_0xb3bb83=_0x467add[_0x2d868c(0xe0)]+'/'+_0x146078,_0x395fdc=buildLocalSqlFileContent({'sqlCode':_0x471709[_0x2d868c(0xb7)],'sqlName':_0x471709[_0x2d868c(0xcb)],'dbId':_0x471709[_0x2d868c(0xdd)]},_0x2151e1,{'dbName':_0x10a0b2,'mode':_0x311dfe,'syncedAt':new Date()[_0x2d868c(0xd3)](),'description':_0x471709[_0x2d868c(0xc9)]});if(await fileExists(_0xb3bb83))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0xb3bb83);await ensureParentDirectory(_0xb3bb83),await writeFile(_0xb3bb83,_0x395fdc,_0x2d868c(0xb9));const _0x1da842=await readSqlLockFile(_0x467add[_0x2d868c(0xb8)]),{lockData:_0xf71977,appLock:_0x4ff3b4}=ensureSqlLockScope(_0x1da842??createEmptySqlLock(),_0x467add[_0x2d868c(0xde)],_0x467add[_0x2d868c(0xd9)],_0x2d868c(0xc3));return _0x4ff3b4[_0x2d868c(0xf4)][_0x471709['sqlCode']]={...buildSqlLockEntry(_0x471709,_0x2151e1,computeSqlContentHash(_0x395fdc),{'dbName':_0x10a0b2}),'path':_0x146078,'mode':_0x311dfe},_0x4ff3b4['lastSync']=new Date()[_0x2d868c(0xd3)](),await writeSqlLockFile(_0x467add[_0x2d868c(0xb8)],_0xf71977),{'ok':!![],'data':{'id':_0x471709['id'],'sqlCode':_0x471709[_0x2d868c(0xb7)],'sqlName':_0x471709[_0x2d868c(0xcb)],'dbId':_0x471709[_0x2d868c(0xdd)],'path':_0xb3bb83,'mode':_0x311dfe},'message':_0x2d868c(0xbf)+_0x471709['sqlCode']};}};async function resolveSqlNewInputs(_0x1ea6ff){const _0x3a72e6=await resolveSqlNameInput(_0x1ea6ff),{dbId:_0x1c0289,dbName:_0x19ad8f}=await resolveDbSelection(_0x1ea6ff),_0x2a70b9=await resolveSqlModeInput(_0x1ea6ff);return{'sqlName':_0x3a72e6,'dbId':_0x1c0289,'dbName':_0x19ad8f,'mode':_0x2a70b9};}async function resolveSqlNameInput(_0xd8ee81){const _0x11b1fb=a184_0xd03398,_0xc4a8d7=_0xd8ee81[_0x11b1fb(0xe2)]('name')[_0x11b1fb(0xd8)]();if(_0xc4a8d7)return _0xc4a8d7;if(_0xd8ee81[_0x11b1fb(0xf2)])throw CliErrors[_0x11b1fb(0xc4)]('name',_0x11b1fb(0xef));return(await input({'message':_0x11b1fb(0xea),'validate':_0x41a188=>_0x41a188[_0x11b1fb(0xd8)]()?!![]:_0x11b1fb(0xdc)}))[_0x11b1fb(0xd8)]();}async function resolveDbSelection(_0x58f529){const _0x52c865=a184_0xd03398,_0x207a95=resolveProvidedDbId(_0x58f529);if(typeof _0x207a95===_0x52c865(0xc7)&&Number[_0x52c865(0xd2)](_0x207a95)&&_0x207a95>0x0)return{'dbId':_0x207a95,'dbName':await getDbName(_0x58f529[_0x52c865(0xde)],_0x207a95)[_0x52c865(0xbc)](()=>undefined)};if(_0x58f529['nonInteractive'])throw CliErrors['flagMissing'](_0x52c865(0xaf),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x4de6b3=await listDatabases(_0x58f529['appCode'])[_0x52c865(0xbc)](()=>[]);if(_0x4de6b3[_0x52c865(0xdb)]===0x1)return{'dbId':_0x4de6b3[0x0][_0x52c865(0xdd)],'dbName':_0x4de6b3[0x0]['dbName']};if(_0x4de6b3['length']>0x1){const _0x2d3557=await select({'message':_0x52c865(0xba),'choices':[..._0x4de6b3['map'](_0x1fbc76=>({'name':_0x1fbc76['dbName']+'\x20('+_0x1fbc76[_0x52c865(0xdd)]+')','value':serializeDbSelection(_0x1fbc76)})),{'name':_0x52c865(0xb2),'value':'__manual__'}]});if(_0x2d3557!=='__manual__')return deserializeDbSelection(_0x2d3557);}const _0x47581c=await input({'message':_0x52c865(0xe4),'validate':_0x2fa5c3=>{const _0x4eae02=_0x52c865,_0x15f45f=_0x2fa5c3[_0x4eae02(0xd8)]();if(!_0x15f45f)return _0x4eae02(0xb3);const _0x29ce61=Number(_0x15f45f);if(!Number[_0x4eae02(0xb1)](_0x29ce61)||_0x29ce61<=0x0)return'dbId\x20must\x20be\x20a\x20positive\x20integer';return!![];}});return{'dbId':Number(_0x47581c[_0x52c865(0xd8)]())};}async function resolveSqlModeInput(_0x107487){const _0x25e054=a184_0xd03398,_0x44514c=_0x107487[_0x25e054(0xe2)]('mode')[_0x25e054(0xd8)]();if(_0x44514c===_0x25e054(0xd7)||_0x44514c===_0x25e054(0xbe))return _0x44514c;if(_0x107487[_0x25e054(0xf2)])throw CliErrors['flagMissing'](_0x25e054(0xc5),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x25e054(0xc6),'choices':[{'name':_0x25e054(0xb4),'value':_0x25e054(0xd7),'description':_0x25e054(0xbb)},{'name':'MyBatis\x20XML\x20(mybatisXml)','value':'mybatisXml','description':'For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags'}]});}function serializeDbSelection(_0x3cf8ba){const _0x3667d8=a184_0xd03398;return JSON[_0x3667d8(0xd0)]({'dbId':_0x3cf8ba[_0x3667d8(0xdd)],'dbName':_0x3cf8ba[_0x3667d8(0xce)]});}function deserializeDbSelection(_0x37a400){const _0x4b553e=a184_0xd03398;try{const _0xd0386e=JSON[_0x4b553e(0xd5)](_0x37a400);if(typeof _0xd0386e[_0x4b553e(0xdd)]==='number'&&Number[_0x4b553e(0xd2)](_0xd0386e[_0x4b553e(0xdd)]))return{'dbId':_0xd0386e[_0x4b553e(0xdd)],'dbName':_0xd0386e['dbName']};}catch{}throw CliErrors[_0x4b553e(0xae)](_0x4b553e(0xca)+_0x37a400);}function resolveProvidedDbId(_0xc84548){const _0x52b90d=a184_0xd03398,_0x6cf2f9=_0xc84548[_0x52b90d(0xe9)]('db-id');if(typeof _0x6cf2f9===_0x52b90d(0xc7)&&Number[_0x52b90d(0xd2)](_0x6cf2f9))return _0x6cf2f9;return undefined;}
@@ -1 +1 @@
1
- const a185_0x1eead5=a185_0x3ce6;(function(_0x32550d,_0x861079){const _0x27f741=a185_0x3ce6,_0x43d517=_0x32550d();while(!![]){try{const _0x361a19=parseInt(_0x27f741(0x1b1))/0x1*(-parseInt(_0x27f741(0x1a1))/0x2)+parseInt(_0x27f741(0x1ad))/0x3+-parseInt(_0x27f741(0x1b3))/0x4+-parseInt(_0x27f741(0x192))/0x5+-parseInt(_0x27f741(0x1a6))/0x6*(-parseInt(_0x27f741(0x1a7))/0x7)+parseInt(_0x27f741(0x194))/0x8+parseInt(_0x27f741(0x19e))/0x9*(parseInt(_0x27f741(0x1a9))/0xa);if(_0x361a19===_0x861079)break;else _0x43d517['push'](_0x43d517['shift']());}catch(_0x5ed5a4){_0x43d517['push'](_0x43d517['shift']());}}}(a185_0xe4ef,0x3d96d));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a185_0x3ce6(_0x5a2d53,_0x4f3f45){_0x5a2d53=_0x5a2d53-0x190;const _0xe4efa8=a185_0xe4ef();let _0x3ce669=_0xe4efa8[_0x5a2d53];return _0x3ce669;}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a185_0x1eead5(0x1a0),'command':a185_0x1eead5(0x19c),'description':a185_0x1eead5(0x1a3),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x564594){const _0x58c340=a185_0x1eead5,_0x5d4fac=loadSqlProjectConfig(_0x564594[_0x58c340(0x199)]),_0xc41558=await readSqlLockFile(_0x5d4fac['lockFilePath']);if(!_0xc41558)throw CliErrors[_0x58c340(0x19b)](_0x58c340(0x191));},async 'dryRun'(_0x89a062){const _0x5e4584=a185_0x1eead5,_0x8e2ca9=loadSqlProjectConfig(_0x89a062[_0x5e4584(0x199)]),_0x1ac521=await readSqlLockFile(_0x8e2ca9[_0x5e4584(0x1b0)]);if(!_0x1ac521)throw CliErrors['validation']('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x3115fd}=ensureSqlLockScope(_0x1ac521,_0x89a062['appCode'],_0x8e2ca9[_0x5e4584(0x1ac)],_0x5e4584(0x19c)),_0x17503e=_0x89a062[_0x5e4584(0x1a8)](_0x5e4584(0x196)),_0x4df838=_0x3115fd['sqls'][_0x17503e];if(!_0x4df838)throw CliErrors['validation'](_0x5e4584(0x1aa)+_0x17503e+'\x22.');return{'method':_0x5e4584(0x1b4),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x17503e,'id':_0x4df838['remoteId'],'localPath':resolveLocalSqlFilePath(_0x8e2ca9,_0x17503e,_0x4df838)},'description':_0x5e4584(0x1af)+_0x17503e+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x8e2ca9[_0x5e4584(0x1a4)]};},async 'execute'(_0x1e0d86){const _0xa94e20=a185_0x1eead5,_0x434816=loadSqlProjectConfig(_0x1e0d86[_0xa94e20(0x199)]),_0x2724b1=await readSqlLockFile(_0x434816[_0xa94e20(0x1b0)]);if(!_0x2724b1)throw CliErrors[_0xa94e20(0x19b)](_0xa94e20(0x1a5));const {lockData:_0x195d1c,appLock:_0x249c93}=ensureSqlLockScope(_0x2724b1,_0x1e0d86['appCode'],_0x434816[_0xa94e20(0x1ac)],_0xa94e20(0x19c)),_0x4cff19=_0x1e0d86[_0xa94e20(0x1a8)](_0xa94e20(0x196)),_0x5708b6=_0x249c93['sqls'][_0x4cff19];if(!_0x5708b6)throw CliErrors[_0xa94e20(0x19b)](_0xa94e20(0x1aa)+_0x4cff19+'\x22.');await deleteSqlQuery({'id':_0x5708b6[_0xa94e20(0x190)],'sqlCode':_0x4cff19}),_0x249c93[_0xa94e20(0x19f)]=Object[_0xa94e20(0x19a)](Object[_0xa94e20(0x19d)](_0x249c93['sqls'])[_0xa94e20(0x195)](([_0x2abb9])=>_0x2abb9!==_0x4cff19)),_0x249c93['lastSync']=new Date()[_0xa94e20(0x1a2)](),await writeSqlLockFile(_0x434816[_0xa94e20(0x1b0)],_0x195d1c);const _0x9164f1=resolveLocalSqlFilePath(_0x434816,_0x4cff19,_0x5708b6);let _0x33c385;await fileExists(_0x9164f1)&&(_0x33c385=await moveToTrash(_0x434816[_0xa94e20(0x1ab)],_0x434816[_0xa94e20(0x1a4)],_0x9164f1),await cleanupEmptyDirectories(dirname(_0x9164f1),_0x434816[_0xa94e20(0x1b2)]));const _0x42f74e={'deleted':_0x4cff19,'remoteId':_0x5708b6[_0xa94e20(0x190)]};if(_0x33c385)_0x42f74e[_0xa94e20(0x1ae)]=_0x33c385;return{'ok':!![],'data':_0x42f74e,'message':_0xa94e20(0x193)+_0x4cff19+(_0x33c385?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x564370,_0x5eb9fb,_0x5a35f0){const _0x4e3e63=a185_0x1eead5,_0x2486f5=new Date()[_0x4e3e63(0x1a2)]()['replace'](/[:.]/g,'-'),_0xf72f88=relative(_0x564370,_0x5a35f0),_0x31c741=join(_0x5eb9fb,_0x2486f5,_0xf72f88);return await mkdir(dirname(_0x31c741),{'recursive':!![]}),await rename(_0x5a35f0,_0x31c741),_0x31c741;}function a185_0xe4ef(){const _0x1178cd=['sqlRootDir','78420JdzccS','POST','remoteId','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','1901625aepKib','Deleted\x20','131512lbvAmi','filter','sqlcode','startsWith','length','appCode','fromEntries','validation','delete','entries','27eiGYCS','sqls','sql','21354NsJonb','toISOString','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','trashDir','SQL\x20lock\x20file\x20not\x20found.','2544vpCgsQ','581MZrBID','str','1427730crmKiS','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','projectRoot','sqlRoot','676902CCighy','trashedTo','Would\x20delete\x20SQL\x20','lockFilePath','5krOVEv'];a185_0xe4ef=function(){return _0x1178cd;};return a185_0xe4ef();}async function cleanupEmptyDirectories(_0x2b1702,_0x13e1fd){const _0x489d71=a185_0x1eead5;let _0x4e9c60=resolve(_0x2b1702);const _0x594130=resolve(_0x13e1fd);while(_0x4e9c60[_0x489d71(0x197)](''+_0x594130+sep)||_0x4e9c60===_0x594130){if(_0x4e9c60===_0x594130)return;try{const _0x5f379c=await readdir(_0x4e9c60);if(_0x5f379c[_0x489d71(0x198)]>0x0)return;await rmdir(_0x4e9c60);}catch{return;}_0x4e9c60=dirname(_0x4e9c60);}}
1
+ const a185_0x364373=a185_0x2178;(function(_0x521859,_0x39cbb4){const _0x54d5f7=a185_0x2178,_0x266a21=_0x521859();while(!![]){try{const _0x27298d=parseInt(_0x54d5f7(0x1b7))/0x1*(parseInt(_0x54d5f7(0x1b0))/0x2)+parseInt(_0x54d5f7(0x1ba))/0x3*(-parseInt(_0x54d5f7(0x1a6))/0x4)+-parseInt(_0x54d5f7(0x1af))/0x5+-parseInt(_0x54d5f7(0x1b9))/0x6+parseInt(_0x54d5f7(0x1b5))/0x7*(-parseInt(_0x54d5f7(0x1b8))/0x8)+parseInt(_0x54d5f7(0x1a3))/0x9*(-parseInt(_0x54d5f7(0x1b6))/0xa)+parseInt(_0x54d5f7(0x1a8))/0xb;if(_0x27298d===_0x39cbb4)break;else _0x266a21['push'](_0x266a21['shift']());}catch(_0x116652){_0x266a21['push'](_0x266a21['shift']());}}}(a185_0x48ef,0xefbd0));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';function a185_0x48ef(){const _0x593cab=['1249902DWeodL','/smartapi/custom/deleteUserCustomSql','replace','1652clwKqZ','delete','56287638uocxuz','toISOString','Would\x20delete\x20SQL\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','trashedTo','startsWith','156915rsPKOx','2JBIhyC','appCode','validation','POST','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','42EgbUUF','40zjwikO','292286yjPSFC','1507528UNhHEP','11213802garQfl','6108IjYbYZ','remoteId','lockFilePath','fromEntries','filter','entries','projectRoot','sqlRootDir','SQL\x20lock\x20file\x20not\x20found.','trashDir','sqlRoot','high-risk-write','str','sqls','\x20(local\x20file\x20moved\x20to\x20trash)'];a185_0x48ef=function(){return _0x593cab;};return a185_0x48ef();}import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a185_0x2178(_0x27a543,_0x5b0689){_0x27a543=_0x27a543-0x1a0;const _0x48efdb=a185_0x48ef();let _0x217834=_0x48efdb[_0x27a543];return _0x217834;}export const sqlDelete={'service':'sql','command':a185_0x364373(0x1a7),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a185_0x364373(0x1c5),'flags':[SQLCODE_FLAG],async 'validate'(_0x125367){const _0x468ed4=a185_0x364373,_0x1a2675=loadSqlProjectConfig(_0x125367[_0x468ed4(0x1b1)]),_0x53a85a=await readSqlLockFile(_0x1a2675[_0x468ed4(0x1bc)]);if(!_0x53a85a)throw CliErrors['validation'](_0x468ed4(0x1ac));},async 'dryRun'(_0xde224){const _0x414d0e=a185_0x364373,_0x2ac3de=loadSqlProjectConfig(_0xde224[_0x414d0e(0x1b1)]),_0x368ec=await readSqlLockFile(_0x2ac3de['lockFilePath']);if(!_0x368ec)throw CliErrors[_0x414d0e(0x1b2)](_0x414d0e(0x1ac));const {appLock:_0x2bdc17}=ensureSqlLockScope(_0x368ec,_0xde224[_0x414d0e(0x1b1)],_0x2ac3de[_0x414d0e(0x1c4)],_0x414d0e(0x1a7)),_0x873a5=_0xde224['str']('sqlcode'),_0x249a09=_0x2bdc17[_0x414d0e(0x1a1)][_0x873a5];if(!_0x249a09)throw CliErrors['validation']('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x873a5+'\x22.');return{'method':_0x414d0e(0x1b3),'url':_0x414d0e(0x1a4),'body':{'sqlCode':_0x873a5,'id':_0x249a09[_0x414d0e(0x1bb)],'localPath':resolveLocalSqlFilePath(_0x2ac3de,_0x873a5,_0x249a09)},'description':_0x414d0e(0x1aa)+_0x873a5+_0x414d0e(0x1ab)+_0x2ac3de[_0x414d0e(0x1c3)]};},async 'execute'(_0x4daee2){const _0x414780=a185_0x364373,_0x489781=loadSqlProjectConfig(_0x4daee2['appCode']),_0x51c8f3=await readSqlLockFile(_0x489781[_0x414780(0x1bc)]);if(!_0x51c8f3)throw CliErrors[_0x414780(0x1b2)](_0x414780(0x1c2));const {lockData:_0x1b5033,appLock:_0x47a7a3}=ensureSqlLockScope(_0x51c8f3,_0x4daee2['appCode'],_0x489781[_0x414780(0x1c4)],_0x414780(0x1a7)),_0x3d46ff=_0x4daee2[_0x414780(0x1a0)]('sqlcode'),_0x3ff591=_0x47a7a3['sqls'][_0x3d46ff];if(!_0x3ff591)throw CliErrors[_0x414780(0x1b2)](_0x414780(0x1b4)+_0x3d46ff+'\x22.');await deleteSqlQuery({'id':_0x3ff591[_0x414780(0x1bb)],'sqlCode':_0x3d46ff}),_0x47a7a3[_0x414780(0x1a1)]=Object[_0x414780(0x1bd)](Object[_0x414780(0x1bf)](_0x47a7a3[_0x414780(0x1a1)])[_0x414780(0x1be)](([_0xcb6b55])=>_0xcb6b55!==_0x3d46ff)),_0x47a7a3['lastSync']=new Date()[_0x414780(0x1a9)](),await writeSqlLockFile(_0x489781[_0x414780(0x1bc)],_0x1b5033);const _0x41f711=resolveLocalSqlFilePath(_0x489781,_0x3d46ff,_0x3ff591);let _0x29daeb;await fileExists(_0x41f711)&&(_0x29daeb=await moveToTrash(_0x489781[_0x414780(0x1c0)],_0x489781[_0x414780(0x1c3)],_0x41f711),await cleanupEmptyDirectories(dirname(_0x41f711),_0x489781[_0x414780(0x1c1)]));const _0x128b3e={'deleted':_0x3d46ff,'remoteId':_0x3ff591['remoteId']};if(_0x29daeb)_0x128b3e[_0x414780(0x1ad)]=_0x29daeb;return{'ok':!![],'data':_0x128b3e,'message':'Deleted\x20'+_0x3d46ff+(_0x29daeb?_0x414780(0x1a2):'')};}};async function moveToTrash(_0x29dfa6,_0x561a39,_0x4e83ec){const _0x27f983=a185_0x364373,_0x4d21e8=new Date()[_0x27f983(0x1a9)]()[_0x27f983(0x1a5)](/[:.]/g,'-'),_0x3d3aca=relative(_0x29dfa6,_0x4e83ec),_0x7fd91b=join(_0x561a39,_0x4d21e8,_0x3d3aca);return await mkdir(dirname(_0x7fd91b),{'recursive':!![]}),await rename(_0x4e83ec,_0x7fd91b),_0x7fd91b;}async function cleanupEmptyDirectories(_0x175d75,_0x288306){const _0x5e6f59=a185_0x364373;let _0x5d327f=resolve(_0x175d75);const _0x5f204d=resolve(_0x288306);while(_0x5d327f[_0x5e6f59(0x1ae)](''+_0x5f204d+sep)||_0x5d327f===_0x5f204d){if(_0x5d327f===_0x5f204d)return;try{const _0x3f32c9=await readdir(_0x5d327f);if(_0x3f32c9['length']>0x0)return;await rmdir(_0x5d327f);}catch{return;}_0x5d327f=dirname(_0x5d327f);}}
@@ -1 +1 @@
1
- function a186_0x1d52(_0x37d525,_0x5d8cb){_0x37d525=_0x37d525-0x1bd;const _0x154fc3=a186_0x154f();let _0x1d52da=_0x154fc3[_0x37d525];return _0x1d52da;}const a186_0x3816d6=a186_0x1d52;(function(_0xf9f74a,_0x260411){const _0xd5949c=a186_0x1d52,_0x275942=_0xf9f74a();while(!![]){try{const _0x13a41b=parseInt(_0xd5949c(0x1cd))/0x1+-parseInt(_0xd5949c(0x1c5))/0x2*(parseInt(_0xd5949c(0x1d1))/0x3)+-parseInt(_0xd5949c(0x1ce))/0x4+-parseInt(_0xd5949c(0x1cf))/0x5*(parseInt(_0xd5949c(0x1c1))/0x6)+-parseInt(_0xd5949c(0x1be))/0x7+-parseInt(_0xd5949c(0x1c4))/0x8*(-parseInt(_0xd5949c(0x1ca))/0x9)+parseInt(_0xd5949c(0x1c8))/0xa*(-parseInt(_0xd5949c(0x1d4))/0xb);if(_0x13a41b===_0x260411)break;else _0x275942['push'](_0x275942['shift']());}catch(_0x59bf94){_0x275942['push'](_0x275942['shift']());}}}(a186_0x154f,0xc47a7));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a186_0x154f(){const _0x5683ef=['sqlCode','872llebhQ','24406plaHVP','str','Return\x20full\x20raw\x20SQL\x20query\x20object','1961330oVIHNE','sqlContent','103689GEQRWA','appCode','read','1266869ZlaDRk','383264xyHUMr','40855CimQFD','dbId','108PpkNFF','boolean','bool','22ANrucV','verbose','271327FwKObL','sqlcode','sqlName','552UfHYPW','detail'];a186_0x154f=function(){return _0x5683ef;};return a186_0x154f();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a186_0x3816d6(0x1c2),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a186_0x3816d6(0x1cc),'flags':[SQLCODE_FLAG,{'name':a186_0x3816d6(0x1bd),'type':a186_0x3816d6(0x1d2),'description':a186_0x3816d6(0x1c7)}],async 'execute'(_0x1533ac){const _0x5d3679=a186_0x3816d6,_0x45ebd3=await getSqlQueryInfo(_0x1533ac[_0x5d3679(0x1cb)],_0x1533ac[_0x5d3679(0x1c6)](_0x5d3679(0x1bf))),_0x24cecf=_0x1533ac[_0x5d3679(0x1d3)]('verbose');if(_0x24cecf)return{'ok':!![],'data':_0x45ebd3};const _0x552db9=_0x45ebd3[_0x5d3679(0x1d0)]?await getDbName(_0x1533ac[_0x5d3679(0x1cb)],_0x45ebd3[_0x5d3679(0x1d0)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x45ebd3[_0x5d3679(0x1c3)],'sqlName':_0x45ebd3[_0x5d3679(0x1c0)],'db':_0x552db9?_0x552db9+'\x20('+_0x45ebd3['dbId']+')':_0x45ebd3[_0x5d3679(0x1d0)]??'','description':_0x45ebd3['description']??'','sqlContent':_0x45ebd3[_0x5d3679(0x1c9)]??''}};}};
1
+ const a186_0x2ba05f=a186_0x1ead;function a186_0xf1be(){const _0x56cee6=['detail','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','sql','description','6924764StpKhd','verbose','6828402riNueR','sqlName','10655hhEEWZ','491748LRQhyl','read','93042bktGjI','str','sqlCode','1233880IhMJbb','bool','1159024VyNYnL','sqlContent','dbId','sqlcode','boolean','292mVJdgn','63CVvhri','appCode'];a186_0xf1be=function(){return _0x56cee6;};return a186_0xf1be();}(function(_0x3758ad,_0x468e28){const _0x284b71=a186_0x1ead,_0x5f4a63=_0x3758ad();while(!![]){try{const _0xa05448=parseInt(_0x284b71(0x133))/0x1+parseInt(_0x284b71(0x130))/0x2+parseInt(_0x284b71(0x12e))/0x3+-parseInt(_0x284b71(0x122))/0x4*(-parseInt(_0x284b71(0x12d))/0x5)+parseInt(_0x284b71(0x12b))/0x6+-parseInt(_0x284b71(0x129))/0x7+-parseInt(_0x284b71(0x135))/0x8*(parseInt(_0x284b71(0x123))/0x9);if(_0xa05448===_0x468e28)break;else _0x5f4a63['push'](_0x5f4a63['shift']());}catch(_0x25c216){_0x5f4a63['push'](_0x5f4a63['shift']());}}}(a186_0xf1be,0xb3555));import{getSqlQueryInfo}from'../../core/api-client.js';function a186_0x1ead(_0x5e1b05,_0x4e8f37){_0x5e1b05=_0x5e1b05-0x121;const _0xf1be5f=a186_0xf1be();let _0x1ead43=_0xf1be5f[_0x5e1b05];return _0x1ead43;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a186_0x2ba05f(0x127),'command':a186_0x2ba05f(0x125),'description':a186_0x2ba05f(0x126),'risk':a186_0x2ba05f(0x12f),'flags':[SQLCODE_FLAG,{'name':a186_0x2ba05f(0x12a),'type':a186_0x2ba05f(0x121),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x126548){const _0x2c22ba=a186_0x2ba05f,_0x489522=await getSqlQueryInfo(_0x126548[_0x2c22ba(0x124)],_0x126548[_0x2c22ba(0x131)](_0x2c22ba(0x138))),_0x48eec5=_0x126548[_0x2c22ba(0x134)]('verbose');if(_0x48eec5)return{'ok':!![],'data':_0x489522};const _0x4e0b4a=_0x489522['dbId']?await getDbName(_0x126548[_0x2c22ba(0x124)],_0x489522[_0x2c22ba(0x137)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x489522[_0x2c22ba(0x132)],'sqlName':_0x489522[_0x2c22ba(0x12c)],'db':_0x4e0b4a?_0x4e0b4a+'\x20('+_0x489522[_0x2c22ba(0x137)]+')':_0x489522['dbId']??'','description':_0x489522[_0x2c22ba(0x128)]??'','sqlContent':_0x489522[_0x2c22ba(0x136)]??''}};}};
@@ -1 +1 @@
1
- function a187_0x2f4a(_0x587e1a,_0x40eed0){_0x587e1a=_0x587e1a-0xbf;const _0x5f0d47=a187_0x5f0d();let _0x2f4ab1=_0x5f0d47[_0x587e1a];return _0x2f4ab1;}const a187_0x5d37dd=a187_0x2f4a;(function(_0x34f477,_0x5e152c){const _0x280338=a187_0x2f4a,_0x2a154b=_0x34f477();while(!![]){try{const _0x303614=parseInt(_0x280338(0xcd))/0x1*(parseInt(_0x280338(0xbf))/0x2)+-parseInt(_0x280338(0xc8))/0x3*(parseInt(_0x280338(0xc4))/0x4)+parseInt(_0x280338(0xd2))/0x5+-parseInt(_0x280338(0xd6))/0x6+-parseInt(_0x280338(0xd7))/0x7*(-parseInt(_0x280338(0xc7))/0x8)+-parseInt(_0x280338(0xd4))/0x9+parseInt(_0x280338(0xc5))/0xa;if(_0x303614===_0x5e152c)break;else _0x2a154b['push'](_0x2a154b['shift']());}catch(_0x25da99){_0x2a154b['push'](_0x2a154b['shift']());}}}(a187_0x5f0d,0x8adbe));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a187_0x5f0d(){const _0x1a62b1=['69825PtdyxR','SQL\x20execution\x20failed','exec','301222QLhyJU','length','execError','now','isArray','4hZPlLJ','13919530oaPypc','str','320xOhEEm','652551YyNAxJ','\x20row(s)\x20in\x20','appCode','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','sqlcode','1uKbDdg','string','execResult','Returned\x20','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','710350Gdmirf','execSuccess','8133984VzXxQQ','params','2361450nsicMz'];a187_0x5f0d=function(){return _0x1a62b1;};return a187_0x5f0d();}export const sqlExec={'service':'sql','command':a187_0x5d37dd(0xd9),'description':a187_0x5d37dd(0xcb),'risk':'read','flags':[SQLCODE_FLAG,{'name':a187_0x5d37dd(0xd5),'type':a187_0x5d37dd(0xce),'description':a187_0x5d37dd(0xd1)}],async 'execute'(_0x52d17e){const _0x28038c=a187_0x5d37dd,_0x1e36f0=parseJsonParams(_0x52d17e[_0x28038c(0xc6)]('params')),_0x40bc9b=Date[_0x28038c(0xc2)](),_0x596444=await executeSql(_0x52d17e[_0x28038c(0xca)],_0x52d17e[_0x28038c(0xc6)](_0x28038c(0xcc)),_0x1e36f0),_0x6bcc91=Date['now']()-_0x40bc9b,_0xe743b=_0x596444?.[_0x28038c(0xcf)]??_0x596444,_0x6b8222=_0x596444?.[_0x28038c(0xd3)]??!![];if(!_0x6b8222)return{'ok':![],'data':{'error':_0x596444?.[_0x28038c(0xc1)]||_0x28038c(0xd8),'elapsed':_0x6bcc91},'message':_0x28038c(0xd8)};const _0x1736a7=Array[_0x28038c(0xc3)](_0xe743b)?_0xe743b:[];return{'ok':!![],'data':{'rows':_0x1736a7,'rowCount':_0x1736a7['length'],'elapsed':_0x6bcc91},'message':_0x28038c(0xd0)+_0x1736a7[_0x28038c(0xc0)]+_0x28038c(0xc9)+_0x6bcc91+'ms'};}};
1
+ const a187_0x34cc26=a187_0x98b5;(function(_0x1a60ca,_0x3d67e4){const _0x215ec1=a187_0x98b5,_0x26441b=_0x1a60ca();while(!![]){try{const _0x4db47d=-parseInt(_0x215ec1(0x1b0))/0x1+parseInt(_0x215ec1(0x1ad))/0x2*(parseInt(_0x215ec1(0x1b6))/0x3)+-parseInt(_0x215ec1(0x1b1))/0x4+-parseInt(_0x215ec1(0x1bb))/0x5*(parseInt(_0x215ec1(0x1ae))/0x6)+-parseInt(_0x215ec1(0x1af))/0x7*(parseInt(_0x215ec1(0x1bd))/0x8)+parseInt(_0x215ec1(0x1ac))/0x9+parseInt(_0x215ec1(0x1ba))/0xa;if(_0x4db47d===_0x3d67e4)break;else _0x26441b['push'](_0x26441b['shift']());}catch(_0x5df280){_0x26441b['push'](_0x26441b['shift']());}}}(a187_0x88a1,0x716dd));function a187_0x98b5(_0x4572c4,_0x38bcd7){_0x4572c4=_0x4572c4-0x1a7;const _0x88a1c4=a187_0x88a1();let _0x98b5cb=_0x88a1c4[_0x4572c4];return _0x98b5cb;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a187_0x88a1(){const _0xe5ba7c=['Returned\x20','\x20row(s)\x20in\x20','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','length','now','read','6790131bqZMTD','1444890YSODhn','14460ILEoiy','187313mUErzN','64925rVhvbV','1886612uwQkuQ','sql','string','execError','execResult','3cOkMih','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','params','sqlcode','1150580RvnTem','615RTIxyQ','str','88fRhSLc'];a187_0x88a1=function(){return _0xe5ba7c;};return a187_0x88a1();}export const sqlExec={'service':a187_0x34cc26(0x1b2),'command':'exec','description':a187_0x34cc26(0x1a8),'risk':a187_0x34cc26(0x1ab),'flags':[SQLCODE_FLAG,{'name':a187_0x34cc26(0x1b8),'type':a187_0x34cc26(0x1b3),'description':a187_0x34cc26(0x1b7)}],async 'execute'(_0xbeca54){const _0x3deb6a=a187_0x34cc26,_0x5894e1=parseJsonParams(_0xbeca54[_0x3deb6a(0x1bc)](_0x3deb6a(0x1b8))),_0x257b0a=Date[_0x3deb6a(0x1aa)](),_0x27abf4=await executeSql(_0xbeca54['appCode'],_0xbeca54['str'](_0x3deb6a(0x1b9)),_0x5894e1),_0x354491=Date[_0x3deb6a(0x1aa)]()-_0x257b0a,_0x1c0aea=_0x27abf4?.[_0x3deb6a(0x1b5)]??_0x27abf4,_0x32272e=_0x27abf4?.['execSuccess']??!![];if(!_0x32272e)return{'ok':![],'data':{'error':_0x27abf4?.[_0x3deb6a(0x1b4)]||'SQL\x20execution\x20failed','elapsed':_0x354491},'message':'SQL\x20execution\x20failed'};const _0x2a352a=Array['isArray'](_0x1c0aea)?_0x1c0aea:[];return{'ok':!![],'data':{'rows':_0x2a352a,'rowCount':_0x2a352a[_0x3deb6a(0x1a9)],'elapsed':_0x354491},'message':_0x3deb6a(0x1be)+_0x2a352a[_0x3deb6a(0x1a9)]+_0x3deb6a(0x1a7)+_0x354491+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x285cd5,_0x41c087){const _0x1e7e31=a188_0x48bc,_0x1a3d88=_0x285cd5();while(!![]){try{const _0x4162f1=-parseInt(_0x1e7e31(0x18c))/0x1+parseInt(_0x1e7e31(0x187))/0x2+-parseInt(_0x1e7e31(0x189))/0x3*(parseInt(_0x1e7e31(0x183))/0x4)+parseInt(_0x1e7e31(0x18d))/0x5*(parseInt(_0x1e7e31(0x186))/0x6)+-parseInt(_0x1e7e31(0x185))/0x7+parseInt(_0x1e7e31(0x18b))/0x8*(-parseInt(_0x1e7e31(0x184))/0x9)+parseInt(_0x1e7e31(0x18a))/0xa*(parseInt(_0x1e7e31(0x188))/0xb);if(_0x4162f1===_0x41c087)break;else _0x1a3d88['push'](_0x1a3d88['shift']());}catch(_0x3f5600){_0x1a3d88['push'](_0x1a3d88['shift']());}}}(a188_0x225e,0xa6b18));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a188_0x225e(){const _0x3956cf=['1638396kATDbW','7407603nRwEdZ','23778PKkdmY','622972yZqdAk','4235253QRPNxX','791676NbAVBD','100GlvaLV','56POpmzd','189910GbOYJg','125SJEgtF','16XwtxCB'];a188_0x225e=function(){return _0x3956cf;};return a188_0x225e();}function a188_0x48bc(_0x2324c7,_0x523dde){_0x2324c7=_0x2324c7-0x183;const _0x225e73=a188_0x225e();let _0x48bcad=_0x225e73[_0x2324c7];return _0x48bcad;}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x1ce65d,_0x110e3b){const _0x285720=a188_0x5d61,_0x5eb13d=_0x1ce65d();while(!![]){try{const _0x461ca5=-parseInt(_0x285720(0x119))/0x1*(-parseInt(_0x285720(0x113))/0x2)+-parseInt(_0x285720(0x116))/0x3+parseInt(_0x285720(0x114))/0x4*(parseInt(_0x285720(0x117))/0x5)+parseInt(_0x285720(0x118))/0x6*(parseInt(_0x285720(0x11c))/0x7)+-parseInt(_0x285720(0x11a))/0x8*(-parseInt(_0x285720(0x11b))/0x9)+-parseInt(_0x285720(0x11d))/0xa+-parseInt(_0x285720(0x112))/0xb*(-parseInt(_0x285720(0x115))/0xc);if(_0x461ca5===_0x110e3b)break;else _0x5eb13d['push'](_0x5eb13d['shift']());}catch(_0xed9b9){_0x5eb13d['push'](_0x5eb13d['shift']());}}}(a188_0x4e13,0x61c5f));function a188_0x5d61(_0x265262,_0x5755cd){_0x265262=_0x265262-0x112;const _0x4e137e=a188_0x4e13();let _0x5d61be=_0x4e137e[_0x265262];return _0x5d61be;}import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];function a188_0x4e13(){const _0x2eca83=['5154010Lqkxqd','99zYJrcL','423816Reschk','1023884PQrTFK','28068CObYZM','2099625ePMorW','15LrENgH','864JLrWtN','3VTAabu','28632YOBSLy','441nbQgAT','763iBSMJJ'];a188_0x4e13=function(){return _0x2eca83;};return a188_0x4e13();}
@@ -1 +1 @@
1
- const a189_0x39cd9d=a189_0x39f7;function a189_0x4e10(){const _0x452e83=['length','2543814FaAKTQ','70969CNnRrT','sqlCode','Page\x20number','Page\x20size','4578080VaNxAJ','appCode','read','1296240SpGJzF','string','boolean','pagesize','1225049lijsgD','\x20SQL\x20queries\x20(total:\x20','sqlcode','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','dbId','verbose','number','19013013Jrijek','description','2356XXFGOj','name','list','num','5379stXpeY','map','Found\x20','22rFrcPb','all','bool','List\x20custom\x20SQL\x20queries'];a189_0x4e10=function(){return _0x452e83;};return a189_0x4e10();}(function(_0x52dfa8,_0x310651){const _0x5c2b23=a189_0x39f7,_0x542347=_0x52dfa8();while(!![]){try{const _0x2af983=-parseInt(_0x5c2b23(0x1ac))/0x1*(-parseInt(_0x5c2b23(0x1a6))/0x2)+-parseInt(_0x5c2b23(0x1a3))/0x3*(-parseInt(_0x5c2b23(0x19f))/0x4)+parseInt(_0x5c2b23(0x1b0))/0x5+-parseInt(_0x5c2b23(0x1ab))/0x6+parseInt(_0x5c2b23(0x1b7))/0x7+parseInt(_0x5c2b23(0x1b3))/0x8+-parseInt(_0x5c2b23(0x1be))/0x9;if(_0x2af983===_0x310651)break;else _0x542347['push'](_0x542347['shift']());}catch(_0xa10232){_0x542347['push'](_0x542347['shift']());}}}(a189_0x4e10,0x86f9f));import{listSqlQueries}from'../../core/api-client.js';function a189_0x39f7(_0x41da30,_0x3896d7){_0x41da30=_0x41da30-0x19e;const _0x4e106c=a189_0x4e10();let _0x39f7df=_0x4e106c[_0x41da30];return _0x39f7df;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':a189_0x39cd9d(0x1a1),'description':a189_0x39cd9d(0x1a9),'risk':a189_0x39cd9d(0x1b2),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a189_0x39cd9d(0x1a0),'type':a189_0x39cd9d(0x1b4),'description':'Filter\x20by\x20SQL\x20name'},{'name':'page','type':a189_0x39cd9d(0x1bd),'description':a189_0x39cd9d(0x1ae),'default':0x1},{'name':a189_0x39cd9d(0x1b6),'type':a189_0x39cd9d(0x1bd),'description':a189_0x39cd9d(0x1af)},{'name':a189_0x39cd9d(0x1bc),'type':a189_0x39cd9d(0x1b5),'description':a189_0x39cd9d(0x1ba)}],async 'execute'(_0x206011){const _0x50f5c2=a189_0x39cd9d,_0x4e1631=await listSqlQueries(_0x206011[_0x50f5c2(0x1b1)],{'sqlCode':_0x206011['str'](_0x50f5c2(0x1b9))||undefined,'sqlName':_0x206011['str'](_0x50f5c2(0x1a0))||undefined,'currentPage':_0x206011[_0x50f5c2(0x1a2)]('page'),'pageSize':_0x206011[_0x50f5c2(0x1a2)](_0x50f5c2(0x1b6),0x32)}),_0x4cfc7a=_0x206011[_0x50f5c2(0x1a8)](_0x50f5c2(0x1bc)),_0xfde8c3=_0x4e1631['tableData']??[],_0xcd0fb7=_0x4e1631['paging']?.['totalCount']??_0xfde8c3[_0x50f5c2(0x1aa)];let _0x346b56;return _0x4cfc7a?_0x346b56=_0xfde8c3:_0x346b56=await Promise[_0x50f5c2(0x1a7)](_0xfde8c3[_0x50f5c2(0x1a4)](async _0x42c044=>{const _0x30b69a=_0x50f5c2;let _0x1f759f;try{_0x1f759f=_0x42c044[_0x30b69a(0x1bb)]?await getDbName(_0x206011[_0x30b69a(0x1b1)],_0x42c044[_0x30b69a(0x1bb)]):undefined;}catch{}return{'sqlCode':_0x42c044[_0x30b69a(0x1ad)],'sqlName':_0x42c044['sqlName'],'description':_0x42c044[_0x30b69a(0x19e)]??'','db':_0x1f759f?_0x1f759f+'\x20('+_0x42c044[_0x30b69a(0x1bb)]+')':_0x42c044['dbId']??''};})),{'ok':!![],'data':_0x346b56,'message':_0xfde8c3[_0x50f5c2(0x1aa)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x50f5c2(0x1a5)+_0xfde8c3[_0x50f5c2(0x1aa)]+_0x50f5c2(0x1b8)+_0xcd0fb7+').'};}};
1
+ const a189_0x169a56=a189_0x165e;(function(_0x7d5769,_0x14258f){const _0x475744=a189_0x165e,_0x56a4e4=_0x7d5769();while(!![]){try{const _0x576e3f=parseInt(_0x475744(0x172))/0x1*(parseInt(_0x475744(0x187))/0x2)+-parseInt(_0x475744(0x16d))/0x3*(-parseInt(_0x475744(0x18b))/0x4)+-parseInt(_0x475744(0x17b))/0x5*(-parseInt(_0x475744(0x189))/0x6)+-parseInt(_0x475744(0x18c))/0x7+parseInt(_0x475744(0x17e))/0x8+-parseInt(_0x475744(0x17a))/0x9+-parseInt(_0x475744(0x170))/0xa;if(_0x576e3f===_0x14258f)break;else _0x56a4e4['push'](_0x56a4e4['shift']());}catch(_0x28f00f){_0x56a4e4['push'](_0x56a4e4['shift']());}}}(a189_0x3bf0,0xd3792));import{listSqlQueries}from'../../core/api-client.js';function a189_0x3bf0(){const _0x439fda=['77738hgBAam','page','map','paging','num','Page\x20size','length','description','2821986OSWfgl','660phjirD','read','Found\x20','11578264QUbgJH','verbose','Filter\x20by\x20SQL\x20name','tableData','totalCount','str','all','boolean','sqlcode','38trecqZ','name','1680BtMrUl','Page\x20number','148mufIUJ','8633807cwwktl','No\x20custom\x20SQL\x20queries\x20found.','list','number','dbId','30423pyFwLb','appCode','sql','9233330HUTafG','pagesize'];a189_0x3bf0=function(){return _0x439fda;};return a189_0x3bf0();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a189_0x165e(_0x291864,_0x5d673d){_0x291864=_0x291864-0x16d;const _0x3bf0a7=a189_0x3bf0();let _0x165ef1=_0x3bf0a7[_0x291864];return _0x165ef1;}export const sqlList={'service':a189_0x169a56(0x16f),'command':a189_0x169a56(0x18e),'description':'List\x20custom\x20SQL\x20queries','risk':a189_0x169a56(0x17c),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a189_0x169a56(0x188),'type':'string','description':a189_0x169a56(0x180)},{'name':a189_0x169a56(0x173),'type':a189_0x169a56(0x18f),'description':a189_0x169a56(0x18a),'default':0x1},{'name':a189_0x169a56(0x171),'type':a189_0x169a56(0x18f),'description':a189_0x169a56(0x177)},{'name':a189_0x169a56(0x17f),'type':a189_0x169a56(0x185),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x1b0e8a){const _0x3f5010=a189_0x169a56,_0x575886=await listSqlQueries(_0x1b0e8a[_0x3f5010(0x16e)],{'sqlCode':_0x1b0e8a[_0x3f5010(0x183)](_0x3f5010(0x186))||undefined,'sqlName':_0x1b0e8a['str']('name')||undefined,'currentPage':_0x1b0e8a[_0x3f5010(0x176)]('page'),'pageSize':_0x1b0e8a['num'](_0x3f5010(0x171),0x32)}),_0xf3669e=_0x1b0e8a['bool'](_0x3f5010(0x17f)),_0x330ebb=_0x575886[_0x3f5010(0x181)]??[],_0x27b29d=_0x575886[_0x3f5010(0x175)]?.[_0x3f5010(0x182)]??_0x330ebb[_0x3f5010(0x178)];let _0x4e514b;return _0xf3669e?_0x4e514b=_0x330ebb:_0x4e514b=await Promise[_0x3f5010(0x184)](_0x330ebb[_0x3f5010(0x174)](async _0x47cf6c=>{const _0x2aa0da=_0x3f5010;let _0x527e0e;try{_0x527e0e=_0x47cf6c[_0x2aa0da(0x190)]?await getDbName(_0x1b0e8a[_0x2aa0da(0x16e)],_0x47cf6c[_0x2aa0da(0x190)]):undefined;}catch{}return{'sqlCode':_0x47cf6c['sqlCode'],'sqlName':_0x47cf6c['sqlName'],'description':_0x47cf6c[_0x2aa0da(0x179)]??'','db':_0x527e0e?_0x527e0e+'\x20('+_0x47cf6c['dbId']+')':_0x47cf6c[_0x2aa0da(0x190)]??''};})),{'ok':!![],'data':_0x4e514b,'message':_0x330ebb[_0x3f5010(0x178)]===0x0?_0x3f5010(0x18d):_0x3f5010(0x17d)+_0x330ebb['length']+'\x20SQL\x20queries\x20(total:\x20'+_0x27b29d+').'};}};