@lovrabet/rabetbase-cli 2.3.11 → 2.3.12-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) 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/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.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/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/db/analysis-batching.js +1 -1
  80. package/lib/commands/db/analyze-batch-plan.js +1 -1
  81. package/lib/commands/db/analyze-cancel.js +1 -1
  82. package/lib/commands/db/analyze-start.js +1 -1
  83. package/lib/commands/db/analyze-status.js +1 -1
  84. package/lib/commands/db/create.js +1 -1
  85. package/lib/commands/db/delete.js +1 -1
  86. package/lib/commands/db/detail.js +1 -1
  87. package/lib/commands/db/diff.js +1 -1
  88. package/lib/commands/db/index.js +1 -1
  89. package/lib/commands/db/list.js +1 -1
  90. package/lib/commands/db/shared.js +1 -1
  91. package/lib/commands/db/tables.js +1 -1
  92. package/lib/commands/db/test.js +1 -1
  93. package/lib/commands/db/update.js +1 -1
  94. package/lib/commands/doctor.js +1 -1
  95. package/lib/commands/file/index.js +1 -1
  96. package/lib/commands/init/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/logs/index.js +1 -1
  102. package/lib/commands/menu/delete.js +1 -1
  103. package/lib/commands/menu/external-link-create.js +1 -1
  104. package/lib/commands/menu/group-create.js +1 -1
  105. package/lib/commands/menu/group-update.js +1 -1
  106. package/lib/commands/menu/index.js +1 -1
  107. package/lib/commands/menu/list.js +1 -1
  108. package/lib/commands/menu/move.js +1 -1
  109. package/lib/commands/menu/regroup-start.js +1 -1
  110. package/lib/commands/menu/shared/compare-table.js +1 -1
  111. package/lib/commands/menu/shared/delete-plan.js +1 -1
  112. package/lib/commands/menu/shared/facts.js +1 -1
  113. package/lib/commands/menu/shared/index.js +1 -1
  114. package/lib/commands/menu/shared/inquirer.js +1 -1
  115. package/lib/commands/menu/shared/local-pages.js +1 -1
  116. package/lib/commands/menu/shared/logic.js +1 -1
  117. package/lib/commands/menu/shared/mutations.js +1 -1
  118. package/lib/commands/menu/shared/service.js +1 -1
  119. package/lib/commands/menu/shared/sync-core.js +1 -1
  120. package/lib/commands/menu/shared/update-core.js +1 -1
  121. package/lib/commands/menu/shared/valid-url.js +1 -1
  122. package/lib/commands/menu/sync.js +1 -1
  123. package/lib/commands/menu/update.js +1 -1
  124. package/lib/commands/notification/config-list.js +1 -1
  125. package/lib/commands/notification/index.js +1 -1
  126. package/lib/commands/page/generate-start.js +1 -1
  127. package/lib/commands/page/generate-status.js +1 -1
  128. package/lib/commands/page/index.js +1 -1
  129. package/lib/commands/page/pull.js +1 -1
  130. package/lib/commands/page/push.js +1 -1
  131. package/lib/commands/page/relation-audit.js +1 -1
  132. package/lib/commands/page/shared.js +1 -1
  133. package/lib/commands/page/standard-page-status.js +1 -1
  134. package/lib/commands/page/sync.js +1 -1
  135. package/lib/commands/permit/index.js +1 -1
  136. package/lib/commands/permit/page-get.js +1 -1
  137. package/lib/commands/permit/page-set.js +1 -1
  138. package/lib/commands/permit/role-apis-set.js +1 -1
  139. package/lib/commands/permit/role-menus-set.js +1 -1
  140. package/lib/commands/permit/role-menus.js +1 -1
  141. package/lib/commands/permit/shared.js +1 -1
  142. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  143. package/lib/commands/project/create/format-elapsed.js +1 -1
  144. package/lib/commands/project/create/main.js +1 -1
  145. package/lib/commands/project/create/non-interactive.js +1 -1
  146. package/lib/commands/project/create/project-template-path.js +1 -1
  147. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  148. package/lib/commands/project/create/use-format-code.js +1 -1
  149. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  150. package/lib/commands/project/index.js +1 -1
  151. package/lib/commands/project/init.js +1 -1
  152. package/lib/commands/project/upgrade.js +1 -1
  153. package/lib/commands/registry.js +1 -1
  154. package/lib/commands/role/create.js +1 -1
  155. package/lib/commands/role/delete.js +1 -1
  156. package/lib/commands/role/detail.js +1 -1
  157. package/lib/commands/role/index.js +1 -1
  158. package/lib/commands/role/list.js +1 -1
  159. package/lib/commands/role/shared.js +1 -1
  160. package/lib/commands/role/update.js +1 -1
  161. package/lib/commands/role/user-add.js +1 -1
  162. package/lib/commands/role/user-remove.js +1 -1
  163. package/lib/commands/role/user-resolve.js +1 -1
  164. package/lib/commands/run/index.js +1 -1
  165. package/lib/commands/schema.js +1 -1
  166. package/lib/commands/sql/create.js +1 -1
  167. package/lib/commands/sql/delete.js +1 -1
  168. package/lib/commands/sql/detail.js +1 -1
  169. package/lib/commands/sql/exec.js +1 -1
  170. package/lib/commands/sql/index.js +1 -1
  171. package/lib/commands/sql/list.js +1 -1
  172. package/lib/commands/sql/pull.js +1 -1
  173. package/lib/commands/sql/push.js +1 -1
  174. package/lib/commands/sql/save.js +1 -1
  175. package/lib/commands/sql/shared.js +1 -1
  176. package/lib/commands/sql/status.js +1 -1
  177. package/lib/commands/sql/validate.js +1 -1
  178. package/lib/commands/task/index.js +1 -1
  179. package/lib/commands/task/status.js +1 -1
  180. package/lib/commands/workspace/add.js +1 -1
  181. package/lib/commands/workspace/index.js +1 -1
  182. package/lib/commands/workspace/remove.js +1 -1
  183. package/lib/config/schema.js +1 -1
  184. package/lib/constant/cdn.js +1 -1
  185. package/lib/constant/cli.js +1 -1
  186. package/lib/constant/defaults.js +1 -1
  187. package/lib/constant/domain.js +1 -1
  188. package/lib/constant/env.js +1 -1
  189. package/lib/constant/output.js +1 -1
  190. package/lib/constant/paths.js +1 -1
  191. package/lib/constant/risk.js +1 -1
  192. package/lib/context/app-resolver.js +1 -1
  193. package/lib/context/auth-resolver.js +1 -1
  194. package/lib/context/config-loader.js +1 -1
  195. package/lib/context.js +1 -1
  196. package/lib/core/alias-resolver.js +1 -1
  197. package/lib/core/api-client.js +1 -1
  198. package/lib/core/bff/config.js +1 -1
  199. package/lib/core/bff/file-system.js +1 -1
  200. package/lib/core/bff/hash.js +1 -1
  201. package/lib/core/bff/lock.js +1 -1
  202. package/lib/core/bff/utils.js +1 -1
  203. package/lib/core/db-resolver.js +1 -1
  204. package/lib/core/page/file-system.js +1 -1
  205. package/lib/core/page/hash.js +1 -1
  206. package/lib/core/page/lock.js +1 -1
  207. package/lib/core/sql-index-auditor.js +1 -1
  208. package/lib/core/sql-sync/config.js +1 -1
  209. package/lib/core/sql-sync/file-system.js +1 -1
  210. package/lib/core/sql-sync/hash.js +1 -1
  211. package/lib/core/sql-sync/lock.js +1 -1
  212. package/lib/core/sql-sync/utils.js +1 -1
  213. package/lib/core/sql-validator.js +1 -1
  214. package/lib/errors.js +1 -1
  215. package/lib/framework/build-all-flags.js +1 -1
  216. package/lib/framework/error-output.js +1 -1
  217. package/lib/framework/explicit-yes.js +1 -1
  218. package/lib/framework/flags.js +1 -1
  219. package/lib/framework/help.js +1 -1
  220. package/lib/framework/index.js +1 -1
  221. package/lib/framework/output.js +1 -1
  222. package/lib/framework/response.js +1 -1
  223. package/lib/framework/runner-alias.js +1 -1
  224. package/lib/framework/runner.js +1 -1
  225. package/lib/framework/schema-export.js +1 -1
  226. package/lib/framework/types.js +1 -1
  227. package/lib/generated/build-info.js +1 -1
  228. package/lib/help.js +1 -1
  229. package/lib/skills/main.js +1 -1
  230. package/lib/skills/npx-skills-add.js +1 -1
  231. package/lib/telemetry/cli-command-trace.js +1 -1
  232. package/lib/telemetry/cli-help-trace.js +1 -1
  233. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  234. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  235. package/lib/telemetry/send-cli-trace-log.js +1 -1
  236. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  237. package/lib/utils/ai_config.js +1 -1
  238. package/lib/utils/apply-jq-filter.js +1 -1
  239. package/lib/utils/cdn-config.js +1 -1
  240. package/lib/utils/check-sdk-version.js +1 -1
  241. package/lib/utils/cli-version-check.js +1 -1
  242. package/lib/utils/cli-version-policy.js +1 -1
  243. package/lib/utils/config.js +1 -1
  244. package/lib/utils/copy-directory.js +1 -1
  245. package/lib/utils/entity-with-id.js +1 -1
  246. package/lib/utils/file-utils.js +1 -1
  247. package/lib/utils/guides-cdn.js +1 -1
  248. package/lib/utils/http-client.js +1 -1
  249. package/lib/utils/is-non-interactive.js +1 -1
  250. package/lib/utils/logger.js +1 -1
  251. package/lib/utils/params.js +1 -1
  252. package/lib/utils/platform.js +1 -1
  253. package/lib/utils/rules-cdn.js +1 -1
  254. package/lib/utils/sleep.js +1 -1
  255. package/lib/utils/template-replacer.js +1 -1
  256. package/lib/utils/update-notice.js +1 -1
  257. package/lib/utils/version.js +1 -1
  258. package/lib/utils/with-active-cookie.js +1 -1
  259. package/lib/utils/write-cli-side-channel.js +1 -1
  260. package/package.json +1 -1
@@ -1 +1 @@
1
- const a155_0x35779f=a155_0x31e0;(function(_0xca8cb7,_0x45be26){const _0x337519=a155_0x31e0,_0x30e3b3=_0xca8cb7();while(!![]){try{const _0x352dd7=parseInt(_0x337519(0x1c1))/0x1*(-parseInt(_0x337519(0x1b6))/0x2)+-parseInt(_0x337519(0x1b0))/0x3+-parseInt(_0x337519(0x1b4))/0x4+parseInt(_0x337519(0x1bf))/0x5*(parseInt(_0x337519(0x1b2))/0x6)+-parseInt(_0x337519(0x1b3))/0x7*(-parseInt(_0x337519(0x1bb))/0x8)+-parseInt(_0x337519(0x1c0))/0x9+parseInt(_0x337519(0x1c3))/0xa;if(_0x352dd7===_0x45be26)break;else _0x30e3b3['push'](_0x30e3b3['shift']());}catch(_0x5c21f4){_0x30e3b3['push'](_0x30e3b3['shift']());}}}(a155_0x1ea9,0xa4a34));import{deleteAppRole}from'../../core/api-client.js';function a155_0x1ea9(){const _0x4111cc=['\x20(id=','/smartapi/permit/role/delete','userCount','Deleted\x20role\x20','8gJSoSA','delete','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','role','10ndSxAh','10226583rmXiPP','61FLgIfG','roleName','39641900JqmSiX','high-risk-write','3845751hbiWNW','POST','456054VNAhgu','1882622vbmIQD','4621132UzBlMz','appCode','4502uRajiL'];a155_0x1ea9=function(){return _0x4111cc;};return a155_0x1ea9();}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';function a155_0x31e0(_0x3dcbd3,_0x41ee09){_0x3dcbd3=_0x3dcbd3-0x1b0;const _0x1ea9bc=a155_0x1ea9();let _0x31e064=_0x1ea9bc[_0x3dcbd3];return _0x31e064;}const DELETE_PATH=a155_0x35779f(0x1b8);export const roleDelete={'service':a155_0x35779f(0x1be),'command':'delete','description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':a155_0x35779f(0x1c4),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4f7cfc){const _0x2865bf=a155_0x35779f,_0xdbbf99=_0x4f7cfc['num']('id'),_0x45d3c9=await getRoleById(_0x4f7cfc[_0x2865bf(0x1b5)],_0xdbbf99);return assertCustomRole(_0x45d3c9,_0x2865bf(0x1bc)),asDryRunResult({'operation':'delete','selector':{'appCode':_0x4f7cfc['appCode'],'roleId':_0xdbbf99,'roleName':_0x45d3c9[_0x2865bf(0x1c2)]},'before':projectRole(_0x45d3c9),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x45d3c9[_0x2865bf(0x1b9)]>0x0?['Role\x20still\x20has\x20'+_0x45d3c9[_0x2865bf(0x1b9)]+_0x2865bf(0x1bd)]:[]},{'method':_0x2865bf(0x1b1),'url':DELETE_PATH});},async 'execute'(_0x43b62b){const _0x27d998=a155_0x35779f,_0x5cc192=_0x43b62b['num']('id'),_0x4f9eb2=await getRoleById(_0x43b62b[_0x27d998(0x1b5)],_0x5cc192);return assertCustomRole(_0x4f9eb2,'delete'),await deleteAppRole(_0x5cc192),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0x43b62b[_0x27d998(0x1b5)],'roleId':_0x5cc192,'roleName':_0x4f9eb2[_0x27d998(0x1c2)]},'before':projectRole(_0x4f9eb2),'after':null,'dryRun':![],'backend':{'method':_0x27d998(0x1b1),'path':DELETE_PATH},'warnings':[]},'message':_0x27d998(0x1ba)+_0x4f9eb2[_0x27d998(0x1c2)]+_0x27d998(0x1b7)+_0x5cc192+')'};}};
1
+ const a155_0x53809c=a155_0x14ca;(function(_0x160573,_0x140f7c){const _0x58d85e=a155_0x14ca,_0x283a32=_0x160573();while(!![]){try{const _0x1b425e=parseInt(_0x58d85e(0x14f))/0x1+parseInt(_0x58d85e(0x14e))/0x2+-parseInt(_0x58d85e(0x148))/0x3*(-parseInt(_0x58d85e(0x142))/0x4)+parseInt(_0x58d85e(0x156))/0x5*(parseInt(_0x58d85e(0x14a))/0x6)+-parseInt(_0x58d85e(0x144))/0x7+-parseInt(_0x58d85e(0x14d))/0x8*(parseInt(_0x58d85e(0x153))/0x9)+parseInt(_0x58d85e(0x149))/0xa*(parseInt(_0x58d85e(0x14b))/0xb);if(_0x1b425e===_0x140f7c)break;else _0x283a32['push'](_0x283a32['shift']());}catch(_0x1b4a2c){_0x283a32['push'](_0x283a32['shift']());}}}(a155_0x3802,0x68fa0));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a155_0x14ca(_0x16c79a,_0x4b914c){_0x16c79a=_0x16c79a-0x142;const _0x3802e8=a155_0x3802();let _0x14ca84=_0x3802e8[_0x16c79a];return _0x14ca84;}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH='/smartapi/permit/role/delete';export const roleDelete={'service':a155_0x53809c(0x147),'command':'delete','description':a155_0x53809c(0x150),'risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3e8f5f){const _0x198d9d=a155_0x53809c,_0xb3ce71=_0x3e8f5f[_0x198d9d(0x146)]('id'),_0x511b36=await getRoleById(_0x3e8f5f[_0x198d9d(0x155)],_0xb3ce71);return assertCustomRole(_0x511b36,_0x198d9d(0x143)),asDryRunResult({'operation':'delete','selector':{'appCode':_0x3e8f5f[_0x198d9d(0x155)],'roleId':_0xb3ce71,'roleName':_0x511b36['roleName']},'before':projectRole(_0x511b36),'after':null,'dryRun':!![],'backend':{'method':_0x198d9d(0x151),'path':DELETE_PATH},'warnings':_0x511b36[_0x198d9d(0x157)]>0x0?[_0x198d9d(0x152)+_0x511b36[_0x198d9d(0x157)]+_0x198d9d(0x154)]:[]},{'method':_0x198d9d(0x151),'url':DELETE_PATH});},async 'execute'(_0x3e607d){const _0x12273b=a155_0x53809c,_0x4811de=_0x3e607d[_0x12273b(0x146)]('id'),_0x40d205=await getRoleById(_0x3e607d[_0x12273b(0x155)],_0x4811de);return assertCustomRole(_0x40d205,_0x12273b(0x143)),await deleteAppRole(_0x4811de),{'ok':!![],'data':{'operation':_0x12273b(0x143),'selector':{'appCode':_0x3e607d[_0x12273b(0x155)],'roleId':_0x4811de,'roleName':_0x40d205['roleName']},'before':projectRole(_0x40d205),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x12273b(0x14c)+_0x40d205[_0x12273b(0x145)]+_0x12273b(0x158)+_0x4811de+')'};}};function a155_0x3802(){const _0x1a4fb9=['6202089ZApJMO','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','appCode','15NQrXTs','userCount','\x20(id=','48144NUgIxD','delete','155512QpJCyf','roleName','num','role','15ovpsCH','363470uPoAKF','520716NrVJPU','11CoUAtr','Deleted\x20role\x20','8XjAnFK','574918eBVHxr','496977JTBsOD','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','POST','Role\x20still\x20has\x20'];a155_0x3802=function(){return _0x1a4fb9;};return a155_0x3802();}
@@ -1 +1 @@
1
- const a156_0x17827b=a156_0x6dc4;(function(_0x54b74b,_0x3c0bd7){const _0x2dbc3c=a156_0x6dc4,_0x218099=_0x54b74b();while(!![]){try{const _0x4ca3e8=-parseInt(_0x2dbc3c(0x8c))/0x1+-parseInt(_0x2dbc3c(0x94))/0x2+parseInt(_0x2dbc3c(0x91))/0x3+-parseInt(_0x2dbc3c(0x93))/0x4+-parseInt(_0x2dbc3c(0x8d))/0x5+-parseInt(_0x2dbc3c(0x90))/0x6+parseInt(_0x2dbc3c(0x8e))/0x7;if(_0x4ca3e8===_0x3c0bd7)break;else _0x218099['push'](_0x218099['shift']());}catch(_0x153584){_0x218099['push'](_0x218099['shift']());}}}(a156_0xaa41,0x81dc9));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a156_0x6dc4(_0x2b3e26,_0x17d53e){_0x2b3e26=_0x2b3e26-0x89;const _0xaa41b9=a156_0xaa41();let _0x6dc404=_0xaa41b9[_0x2b3e26];return _0x6dc404;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a156_0x17827b(0x8a),'command':'detail','description':a156_0x17827b(0x8b),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x2d3d72){const _0x1c188e=a156_0x17827b,_0x41af54=_0x2d3d72[_0x1c188e(0x89)]('id'),_0x35ce40=await getRoleById(_0x2d3d72[_0x1c188e(0x8f)],_0x41af54);return{'ok':!![],'data':{'role':projectRole(_0x35ce40)},'message':'Role\x20'+_0x35ce40[_0x1c188e(0x92)]+'\x20('+_0x35ce40['roleType']+')'};}};function a156_0xaa41(){const _0x420da4=['role','Show\x20a\x20single\x20role\x27s\x20detail','912788OVpiKN','876235XvDLDd','15804061aAPoFJ','appCode','4538070KwKvaJ','2088585INLKWS','roleName','332cdxWuj','1155084PhcMhP','num'];a156_0xaa41=function(){return _0x420da4;};return a156_0xaa41();}
1
+ const a156_0x5a0e9d=a156_0x43cd;(function(_0x7d4b2e,_0x24f833){const _0x1aa944=a156_0x43cd,_0x247c58=_0x7d4b2e();while(!![]){try{const _0x423d16=parseInt(_0x1aa944(0xdd))/0x1+parseInt(_0x1aa944(0xe0))/0x2*(-parseInt(_0x1aa944(0xd5))/0x3)+parseInt(_0x1aa944(0xde))/0x4*(parseInt(_0x1aa944(0xdb))/0x5)+parseInt(_0x1aa944(0xd6))/0x6+-parseInt(_0x1aa944(0xd8))/0x7+-parseInt(_0x1aa944(0xd9))/0x8+parseInt(_0x1aa944(0xe2))/0x9;if(_0x423d16===_0x24f833)break;else _0x247c58['push'](_0x247c58['shift']());}catch(_0x4bdc3b){_0x247c58['push'](_0x247c58['shift']());}}}(a156_0x2b90,0xe730d));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a156_0x43cd(_0x324a60,_0x30d286){_0x324a60=_0x324a60-0xd5;const _0x2b9022=a156_0x2b90();let _0x43cd12=_0x2b9022[_0x324a60];return _0x43cd12;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a156_0x5a0e9d(0xe1),'command':a156_0x5a0e9d(0xdf),'description':a156_0x5a0e9d(0xd7),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x29797e){const _0x98351a=a156_0x5a0e9d,_0x5e5233=_0x29797e[_0x98351a(0xdc)]('id'),_0x28f428=await getRoleById(_0x29797e['appCode'],_0x5e5233);return{'ok':!![],'data':{'role':projectRole(_0x28f428)},'message':_0x98351a(0xda)+_0x28f428['roleName']+'\x20('+_0x28f428['roleType']+')'};}};function a156_0x2b90(){const _0x3e6c96=['1521066eIRhfv','3071496CShHGs','Show\x20a\x20single\x20role\x27s\x20detail','6585411FFYezT','13095096xxTVkW','Role\x20','30ERhRPh','num','643132oxrUjy','178896zGaxdp','detail','4vliNkw','role','28037421EdcqRA'];a156_0x2b90=function(){return _0x3e6c96;};return a156_0x2b90();}
@@ -1 +1 @@
1
- (function(_0x5dacdb,_0x4b2b46){const _0x28bdc6=a157_0x3434,_0x44f997=_0x5dacdb();while(!![]){try{const _0x4ca7c7=parseInt(_0x28bdc6(0x151))/0x1+-parseInt(_0x28bdc6(0x153))/0x2+-parseInt(_0x28bdc6(0x14a))/0x3*(parseInt(_0x28bdc6(0x14f))/0x4)+parseInt(_0x28bdc6(0x154))/0x5*(-parseInt(_0x28bdc6(0x14d))/0x6)+-parseInt(_0x28bdc6(0x14c))/0x7+parseInt(_0x28bdc6(0x14e))/0x8*(-parseInt(_0x28bdc6(0x14b))/0x9)+parseInt(_0x28bdc6(0x152))/0xa*(parseInt(_0x28bdc6(0x150))/0xb);if(_0x4ca7c7===_0x4b2b46)break;else _0x44f997['push'](_0x44f997['shift']());}catch(_0x459917){_0x44f997['push'](_0x44f997['shift']());}}}(a157_0x2874,0xba2a3));function a157_0x3434(_0x109555,_0xf85285){_0x109555=_0x109555-0x14a;const _0x2874b0=a157_0x2874();let _0x3434dd=_0x2874b0[_0x109555];return _0x3434dd;}function a157_0x2874(){const _0x3c8954=['29547wJrfPg','458997jsnuac','2076qovrLP','672uwzLly','240FTqEMd','11kppmSh','689121JOzSeg','36109070zKWNSw','2712164qnXEfJ','5960dUbFgk','71382PhUhMH'];a157_0x2874=function(){return _0x3c8954;};return a157_0x2874();}import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0x5f31dc,_0x462621){const _0xe24d4b=a157_0x46cb,_0x538504=_0x5f31dc();while(!![]){try{const _0x193c95=parseInt(_0xe24d4b(0xef))/0x1+-parseInt(_0xe24d4b(0xee))/0x2*(-parseInt(_0xe24d4b(0xeb))/0x3)+-parseInt(_0xe24d4b(0xe8))/0x4+-parseInt(_0xe24d4b(0xec))/0x5*(parseInt(_0xe24d4b(0xf1))/0x6)+parseInt(_0xe24d4b(0xed))/0x7+-parseInt(_0xe24d4b(0xe9))/0x8*(-parseInt(_0xe24d4b(0xf0))/0x9)+-parseInt(_0xe24d4b(0xea))/0xa;if(_0x193c95===_0x462621)break;else _0x538504['push'](_0x538504['shift']());}catch(_0x2b1fc0){_0x538504['push'](_0x538504['shift']());}}}(a157_0x2299,0x63366));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];function a157_0x46cb(_0x4abbb3,_0x3ec35f){_0x4abbb3=_0x4abbb3-0xe8;const _0x2299f7=a157_0x2299();let _0x46cb86=_0x2299f7[_0x4abbb3];return _0x46cb86;}function a157_0x2299(){const _0x46e8b2=['2dgKUtq','627269yhRtOT','9Orzibf','1274874NjdgtY','290280zMAPaS','497144QKJJKT','7208530BpVqiJ','699186MKzBXf','10omqDtn','4915967bYgigu'];a157_0x2299=function(){return _0x46e8b2;};return a157_0x2299();}
@@ -1 +1 @@
1
- function a158_0x4d00(){const _0x3c5bfc=['page','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','163324TnWBBO','407464xuQuMo','trim','num','Page\x20size\x20(1-100)','role','type','ADMIN','33356MDNtRv','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','string','2605230IhhjbG','roleType','USER','\x20role(s)','CUSTOM','appCode','str','Filter\x20by\x20role\x20type','filter','length','312YkjmmG','947274gMHMSo','map','list','4340413GOnHkz','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','56leOkWz','validation','number','join','pagesize','Use\x20one\x20of:\x20','4152285NkGJji','toUpperCase'];a158_0x4d00=function(){return _0x3c5bfc;};return a158_0x4d00();}const a158_0x11afdc=a158_0x3aae;(function(_0x224d25,_0x100dce){const _0x26875a=a158_0x3aae,_0x208e75=_0x224d25();while(!![]){try{const _0x5f33ff=-parseInt(_0x26875a(0xdb))/0x1+parseInt(_0x26875a(0xda))/0x2+-parseInt(_0x26875a(0xef))/0x3*(parseInt(_0x26875a(0xe2))/0x4)+-parseInt(_0x26875a(0xd6))/0x5+-parseInt(_0x26875a(0xf0))/0x6+parseInt(_0x26875a(0xf3))/0x7+-parseInt(_0x26875a(0xd0))/0x8*(-parseInt(_0x26875a(0xe5))/0x9);if(_0x5f33ff===_0x100dce)break;else _0x208e75['push'](_0x208e75['shift']());}catch(_0x15a43a){_0x208e75['push'](_0x208e75['shift']());}}}(a158_0x4d00,0x7183b));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a158_0x3aae(_0x1077fc,_0x333e4a){_0x1077fc=_0x1077fc-0xd0;const _0x4d000f=a158_0x4d00();let _0x3aaecf=_0x4d000f[_0x1077fc];return _0x3aaecf;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a158_0x11afdc(0xe1),'DEV',a158_0x11afdc(0xe7),a158_0x11afdc(0xe9)];export const roleList={'service':a158_0x11afdc(0xdf),'command':a158_0x11afdc(0xf2),'description':a158_0x11afdc(0xd9),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a158_0x11afdc(0xe0),'type':a158_0x11afdc(0xe4),'required':![],'description':a158_0x11afdc(0xec),'enum':ROLE_TYPES},{'name':a158_0x11afdc(0xd8),'type':a158_0x11afdc(0xd2),'description':'Page\x20index\x20(1-based)','default':0x1},{'name':a158_0x11afdc(0xd4),'type':'number','description':a158_0x11afdc(0xde),'default':0x64}],async 'validate'(_0x585b74){const _0x1abe48=a158_0x11afdc,_0x5242fd=_0x585b74['str'](_0x1abe48(0xe0))[_0x1abe48(0xdc)]();if(_0x5242fd&&!ROLE_TYPES['includes'](_0x5242fd[_0x1abe48(0xd7)]()))throw CliErrors[_0x1abe48(0xd1)]('Invalid\x20--type\x20\x22'+_0x5242fd+'\x22.',_0x1abe48(0xd5)+ROLE_TYPES[_0x1abe48(0xd3)](',\x20')+'.');const _0x2378b3=_0x585b74[_0x1abe48(0xdd)](_0x1abe48(0xd8),0x1),_0x373ba4=_0x585b74[_0x1abe48(0xdd)](_0x1abe48(0xd4),0x64);if(_0x2378b3<0x1)throw CliErrors[_0x1abe48(0xd1)](_0x1abe48(0xf4));if(_0x373ba4<0x1||_0x373ba4>0x64)throw CliErrors[_0x1abe48(0xd1)](_0x1abe48(0xe3));},async 'execute'(_0x38cf8d){const _0x32fd8c=a158_0x11afdc,_0x4bd28b=_0x38cf8d['num'](_0x32fd8c(0xd8),0x1)||0x1,_0x3efc3a=_0x38cf8d[_0x32fd8c(0xdd)]('pagesize',0x64)||0x64,_0x488dd2=_0x38cf8d[_0x32fd8c(0xeb)]('type')[_0x32fd8c(0xdc)]()[_0x32fd8c(0xd7)](),{items:_0x4e6155,paging:_0x2ad14a}=await listAppRoles(_0x38cf8d[_0x32fd8c(0xea)],{'currentPage':_0x4bd28b,'pageSize':_0x3efc3a}),_0x2bfae1=_0x488dd2?_0x4e6155[_0x32fd8c(0xed)](_0x10541d=>_0x10541d[_0x32fd8c(0xe6)]===_0x488dd2):_0x4e6155,_0x1f000a=_0x2bfae1[_0x32fd8c(0xf1)](projectRole);return{'ok':!![],'data':{'roles':_0x1f000a,'paging':_0x2ad14a},'message':'Found\x20'+_0x1f000a[_0x32fd8c(0xee)]+_0x32fd8c(0xe8)};}};
1
+ function a158_0x1ad2(){const _0x4d089d=['Found\x20','pagesize','Invalid\x20--type\x20\x22','25zkSKqt','678792EPveyn','20hHyPHO','type','Use\x20one\x20of:\x20','num','toUpperCase','appCode','string','42RoRwwN','includes','4292100LMnUEM','Page\x20index\x20(1-based)','1404006cJBqIo','DEV','Filter\x20by\x20role\x20type','number','map','join','48630PrktXA','page','CUSTOM','read','filter','5792DZVpAt','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','290xdKdjr','validation','str','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','4941lUggbH','150931GGAmIn','USER','trim','387093MycGzX'];a158_0x1ad2=function(){return _0x4d089d;};return a158_0x1ad2();}function a158_0x3deb(_0x5cebf9,_0x3d392b){_0x5cebf9=_0x5cebf9-0x176;const _0x1ad20c=a158_0x1ad2();let _0x3deb19=_0x1ad20c[_0x5cebf9];return _0x3deb19;}const a158_0x4076a3=a158_0x3deb;(function(_0x1bfcf6,_0x222520){const _0x26dfbb=a158_0x3deb,_0x42c0c6=_0x1bfcf6();while(!![]){try{const _0x1c53f9=-parseInt(_0x26dfbb(0x19a))/0x1*(parseInt(_0x26dfbb(0x189))/0x2)+-parseInt(_0x26dfbb(0x194))/0x3+parseInt(_0x26dfbb(0x188))/0x4*(parseInt(_0x26dfbb(0x187))/0x5)+parseInt(_0x26dfbb(0x190))/0x6*(parseInt(_0x26dfbb(0x183))/0x7)+parseInt(_0x26dfbb(0x179))/0x8*(-parseInt(_0x26dfbb(0x17f))/0x9)+-parseInt(_0x26dfbb(0x17b))/0xa*(-parseInt(_0x26dfbb(0x180))/0xb)+parseInt(_0x26dfbb(0x192))/0xc;if(_0x1c53f9===_0x222520)break;else _0x42c0c6['push'](_0x42c0c6['shift']());}catch(_0x274baa){_0x42c0c6['push'](_0x42c0c6['shift']());}}}(a158_0x1ad2,0x9c19d));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=['ADMIN',a158_0x4076a3(0x195),a158_0x4076a3(0x181),a158_0x4076a3(0x176)];export const roleList={'service':'role','command':'list','description':a158_0x4076a3(0x17a),'risk':a158_0x4076a3(0x177),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':a158_0x4076a3(0x18f),'required':![],'description':a158_0x4076a3(0x196),'enum':ROLE_TYPES},{'name':a158_0x4076a3(0x19b),'type':a158_0x4076a3(0x197),'description':a158_0x4076a3(0x193),'default':0x1},{'name':a158_0x4076a3(0x185),'type':a158_0x4076a3(0x197),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x66759e){const _0x96c529=a158_0x4076a3,_0x276ece=_0x66759e[_0x96c529(0x17d)]('type')['trim']();if(_0x276ece&&!ROLE_TYPES[_0x96c529(0x191)](_0x276ece['toUpperCase']()))throw CliErrors[_0x96c529(0x17c)](_0x96c529(0x186)+_0x276ece+'\x22.',_0x96c529(0x18b)+ROLE_TYPES[_0x96c529(0x199)](',\x20')+'.');const _0x34c74a=_0x66759e[_0x96c529(0x18c)](_0x96c529(0x19b),0x1),_0x131263=_0x66759e[_0x96c529(0x18c)](_0x96c529(0x185),0x64);if(_0x34c74a<0x1)throw CliErrors[_0x96c529(0x17c)]('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x131263<0x1||_0x131263>0x64)throw CliErrors[_0x96c529(0x17c)](_0x96c529(0x17e));},async 'execute'(_0x38764a){const _0x3d67f1=a158_0x4076a3,_0x503dc5=_0x38764a[_0x3d67f1(0x18c)]('page',0x1)||0x1,_0x1fe4f7=_0x38764a[_0x3d67f1(0x18c)](_0x3d67f1(0x185),0x64)||0x64,_0x12833e=_0x38764a[_0x3d67f1(0x17d)](_0x3d67f1(0x18a))[_0x3d67f1(0x182)]()[_0x3d67f1(0x18d)](),{items:_0x5a0141,paging:_0xd2281}=await listAppRoles(_0x38764a[_0x3d67f1(0x18e)],{'currentPage':_0x503dc5,'pageSize':_0x1fe4f7}),_0x2da4d9=_0x12833e?_0x5a0141[_0x3d67f1(0x178)](_0x3044d8=>_0x3044d8['roleType']===_0x12833e):_0x5a0141,_0x1924bb=_0x2da4d9[_0x3d67f1(0x198)](projectRole);return{'ok':!![],'data':{'roles':_0x1924bb,'paging':_0xd2281},'message':_0x3d67f1(0x184)+_0x1924bb['length']+'\x20role(s)'};}};
@@ -1 +1 @@
1
- const a159_0x368088=a159_0x1417;(function(_0xd9d646,_0x43c5cb){const _0x3c48f5=a159_0x1417,_0x134106=_0xd9d646();while(!![]){try{const _0x508a54=-parseInt(_0x3c48f5(0x239))/0x1*(parseInt(_0x3c48f5(0x1f6))/0x2)+parseInt(_0x3c48f5(0x1fa))/0x3+parseInt(_0x3c48f5(0x21c))/0x4+-parseInt(_0x3c48f5(0x20f))/0x5+-parseInt(_0x3c48f5(0x235))/0x6+parseInt(_0x3c48f5(0x22c))/0x7+parseInt(_0x3c48f5(0x22d))/0x8*(parseInt(_0x3c48f5(0x1f0))/0x9);if(_0x508a54===_0x43c5cb)break;else _0x134106['push'](_0x134106['shift']());}catch(_0x45e62f){_0x134106['push'](_0x134106['shift']());}}}(a159_0x3c05,0x818d5));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a159_0x368088(0x21f)};export const ROLE_REF_FLAG={'name':a159_0x368088(0x22a),'type':a159_0x368088(0x21e),'required':!![],'description':a159_0x368088(0x214)};function a159_0x1417(_0x4b2ef8,_0x58e2a6){_0x4b2ef8=_0x4b2ef8-0x1eb;const _0x3c053d=a159_0x3c05();let _0x1417c8=_0x3c053d[_0x4b2ef8];return _0x1417c8;}export const USER_REF_FLAG={'name':a159_0x368088(0x238),'type':a159_0x368088(0x21e),'required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':a159_0x368088(0x1f9),'type':a159_0x368088(0x21e),'required':!![],'description':a159_0x368088(0x1fc)};export const USER_NAME_FLAG={'name':a159_0x368088(0x1f9),'type':a159_0x368088(0x21e),'required':!![],'description':a159_0x368088(0x236)};export const REMARK_FLAG={'name':a159_0x368088(0x232),'type':a159_0x368088(0x21e),'required':![],'description':a159_0x368088(0x23a)};export const EXPECT_USER_COUNT_FLAG={'name':a159_0x368088(0x200),'type':a159_0x368088(0x215),'required':![],'description':a159_0x368088(0x221)};export const BUILTIN_ROLE_TYPES=[a159_0x368088(0x1ff),a159_0x368088(0x1f4),a159_0x368088(0x20d)];function a159_0x3c05(){const _0x1ce5d4=['\x22\x20not\x20found\x20in\x20app\x20','userList','8361vCBXkp','Pass\x20--role\x20<id|name>.','No\x20tenant\x20member\x20matches\x20\x22','username','DEV','\x20is\x20already\x20a\x20member\x20of\x20role\x20','1320SRvtMX','/smartapi/permit/user-role/update-user-list','nickname','name','1602201DSEDuX','Cannot\x20','Role\x20name','Role\x20name\x20\x22','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','ADMIN','expect-user-count','\x20member(s)\x20but\x20role\x20has\x20','appCode','roleType','trim','validation','POST','toLowerCase','tenant_code','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','test','\x20not\x20found\x20in\x20app\x20','USER','user-add','2475645OwyqwF','CUSTOM','Role\x20id\x20','Disambiguate\x20with\x20--role\x20<id>.','includes','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','number','tenant','filter','map','flagMissing','str','User\x20','2493956qaKASo','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','string','Role\x20id\x20(from\x20`role\x20list`)','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','dryRun','findIndex','\x22:\x20','Missing\x20user\x20reference.','\x22\x20is\x20ambiguous\x20(ids:\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','flag',';\x20no\x20change.','role','push','5041498nXrBFn','2600nWoItK','expectUserCount','\x20built-in\x20role\x20','length','roleName','remark','Anti-drift\x20check\x20failed:\x20expected\x20','authRequired','5660286iFXErJ','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','user','319pphVfG','Optional\x20role\x20remark/description','userId','Disambiguate\x20with\x20--user\x20<id>.','totalCount','splice'];a159_0x3c05=function(){return _0x1ce5d4;};return a159_0x3c05();}export function isBuiltinRole(_0x59a667){const _0x4cf0c2=a159_0x368088;return BUILTIN_ROLE_TYPES[_0x4cf0c2(0x213)](_0x59a667);}export function assertCustomRole(_0x5f0687,_0x2da087){const _0x64db26=a159_0x368088;if(_0x5f0687[_0x64db26(0x203)]!==_0x64db26(0x210))throw CliErrors['validation'](_0x64db26(0x1fb)+_0x2da087+_0x64db26(0x22f)+_0x5f0687[_0x64db26(0x231)]+'\x20('+_0x5f0687['roleType']+').',_0x64db26(0x209));}export function assertPermConfigurable(_0x395bd9){const _0x559119=a159_0x368088;if(_0x395bd9[_0x559119(0x203)]===_0x559119(0x1f4)||_0x395bd9[_0x559119(0x203)]===_0x559119(0x1ff))throw CliErrors[_0x559119(0x205)](_0x559119(0x227)+_0x395bd9[_0x559119(0x231)]+'\x20('+_0x395bd9[_0x559119(0x203)]+').',_0x559119(0x1fe));}export function projectRole(_0x14212e){const _0x34b171=a159_0x368088;return{'id':_0x14212e['id'],'roleName':_0x14212e[_0x34b171(0x231)],'roleType':_0x14212e[_0x34b171(0x203)],'remark':_0x14212e['remark'],'userCount':_0x14212e['userCount'],'permitCount':_0x14212e['permitCount'],'builtin':isBuiltinRole(_0x14212e[_0x34b171(0x203)])};}export async function resolveRoleRef(_0x151121,_0x148e70){const _0x57bc73=a159_0x368088,_0x4f6a6c=_0x148e70[_0x57bc73(0x204)]();if(!_0x4f6a6c)throw CliErrors[_0x57bc73(0x205)]('Missing\x20role\x20reference.',_0x57bc73(0x1f1));if(/^\d+$/[_0x57bc73(0x20b)](_0x4f6a6c))return getRoleById(_0x151121,Number(_0x4f6a6c));const _0x3247ea=await listAllAppRoles(_0x151121),_0x598de3=_0x3247ea[_0x57bc73(0x217)](_0x189878=>_0x189878[_0x57bc73(0x231)]===_0x4f6a6c);if(_0x598de3[_0x57bc73(0x230)]===0x0)throw CliErrors[_0x57bc73(0x205)]('Role\x20name\x20\x22'+_0x4f6a6c+_0x57bc73(0x1ee)+_0x151121+'.',_0x57bc73(0x220));if(_0x598de3[_0x57bc73(0x230)]>0x1){const _0x188e3e=_0x598de3['map'](_0x458db6=>_0x458db6['id'])['join'](',\x20');throw CliErrors[_0x57bc73(0x205)](_0x57bc73(0x1fd)+_0x4f6a6c+_0x57bc73(0x226)+_0x188e3e+').',_0x57bc73(0x212));}return _0x598de3[0x0];}export async function getRoleById(_0x46c796,_0x1a1a17){const _0x36bd98=a159_0x368088,_0x48b531=await getAppRole(_0x1a1a17);if(!_0x48b531)throw CliErrors['validation'](_0x36bd98(0x211)+_0x1a1a17+_0x36bd98(0x20c)+_0x46c796+'.',_0x36bd98(0x20a));return _0x48b531;}async function listAllAppRoles(_0x4bb37c){const _0x4b6f34=a159_0x368088,_0x101bca=0x64,_0x44e39e=[];for(let _0x5a1812=0x1;;_0x5a1812+=0x1){const {items:_0x2de48d,paging:_0x5ae265}=await listAppRoles(_0x4bb37c,{'currentPage':_0x5a1812,'pageSize':_0x101bca});_0x44e39e['push'](..._0x2de48d);if(_0x2de48d[_0x4b6f34(0x230)]<_0x101bca||_0x5ae265&&_0x44e39e[_0x4b6f34(0x230)]>=_0x5ae265[_0x4b6f34(0x1ec)])return _0x44e39e;}}export async function resolveTenantCode(){const _0xdf02ee=a159_0x368088,_0x1dc1d3=await getSessionUserInfo(),_0x3cf3e7=_0x1dc1d3?.[_0xdf02ee(0x238)]?.[_0xdf02ee(0x216)]?.[_0xdf02ee(0x208)];if(!_0x3cf3e7)throw CliErrors[_0xdf02ee(0x234)](_0xdf02ee(0x237));return _0x3cf3e7;}function matchMember(_0x717537,_0xe5409c){const _0x1d93a9=a159_0x368088,_0x21a3db=_0xe5409c[_0x1d93a9(0x204)]()[_0x1d93a9(0x207)]();return(_0x717537['nickname']??'')['toLowerCase']()===_0x21a3db||(_0x717537[_0x1d93a9(0x1f3)]??'')[_0x1d93a9(0x207)]()===_0x21a3db;}export async function resolveUserRef(_0x27a7d7){const _0x5b7211=a159_0x368088,_0xa32c70=_0x27a7d7['trim']();if(!_0xa32c70)throw CliErrors[_0x5b7211(0x205)](_0x5b7211(0x225),'Pass\x20--user\x20<id|name>.');const _0x8a26ca=await resolveTenantCode(),_0x40d978=await getTenantMembers(_0x8a26ca);if(/^\d+$/[_0x5b7211(0x20b)](_0xa32c70)){const _0x5a59b1=Number(_0xa32c70),_0x5dc9ad=_0x40d978['find'](_0x2c4445=>_0x2c4445[_0x5b7211(0x23b)]===_0x5a59b1);return{'userId':_0x5a59b1,'username':_0x5dc9ad?.[_0x5b7211(0x1f3)]??String(_0x5a59b1),'nickname':_0x5dc9ad?.[_0x5b7211(0x1f8)],'matchedBy':'id'};}const _0x271308=_0x40d978[_0x5b7211(0x217)](_0x24b922=>matchMember(_0x24b922,_0xa32c70));if(_0x271308['length']===0x0)throw CliErrors[_0x5b7211(0x205)](_0x5b7211(0x1f2)+_0xa32c70+'\x22.',_0x5b7211(0x21d));if(_0x271308[_0x5b7211(0x230)]>0x1){const _0x37f9bd=_0x271308['map'](_0x67d9ba=>(_0x67d9ba[_0x5b7211(0x1f8)]??_0x67d9ba[_0x5b7211(0x1f3)]??'?')+'('+_0x67d9ba[_0x5b7211(0x23b)]+')')['join'](',\x20');throw CliErrors[_0x5b7211(0x205)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0xa32c70+_0x5b7211(0x224)+_0x37f9bd+'.',_0x5b7211(0x1eb));}const _0x514cd0=_0x271308[0x0];return{'userId':_0x514cd0[_0x5b7211(0x23b)],'username':_0x514cd0[_0x5b7211(0x1f3)]??String(_0x514cd0['userId']),'nickname':_0x514cd0[_0x5b7211(0x1f8)],'matchedBy':_0x5b7211(0x1f9)};}export const UPDATE_USER_LIST_PATH=a159_0x368088(0x1f7);function userIdsOf(_0x2430b8){const _0x1c57e9=a159_0x368088;return(_0x2430b8?.[_0x1c57e9(0x1ef)]??[])[_0x1c57e9(0x218)](_0x1417c9=>_0x1417c9[_0x1c57e9(0x23b)]);}export function computeRoleUserMutation(_0xd878fe){const _0x2db412=a159_0x368088,{operation:_0x56914a,appCode:_0x591ba5,roleUsers:_0x2f7ad2,targetRoleId:_0x434862,user:_0x409229}=_0xd878fe,_0x284fcf=_0x2f7ad2['find'](_0x1341be=>_0x1341be['id']===_0x434862);if(!_0x284fcf)throw CliErrors[_0x2db412(0x205)](_0x2db412(0x211)+_0x434862+'\x20not\x20found\x20in\x20the\x20user-role\x20list.',_0x2db412(0x20a));const _0x1decc9=userIdsOf(_0x284fcf),_0x240989=[];if(_0xd878fe[_0x2db412(0x22e)]!==undefined&&_0xd878fe[_0x2db412(0x22e)]!==_0x1decc9[_0x2db412(0x230)])throw CliErrors[_0x2db412(0x205)](_0x2db412(0x233)+_0xd878fe[_0x2db412(0x22e)]+_0x2db412(0x201)+_0x1decc9[_0x2db412(0x230)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x3a4c4d=_0x1decc9['includes'](_0x409229[_0x2db412(0x23b)]);let _0xd385af=![];const _0x2fc8f5=[..._0x284fcf[_0x2db412(0x1ef)]];if(_0x56914a===_0x2db412(0x20e))_0x3a4c4d?_0x240989[_0x2db412(0x22b)]('User\x20'+_0x409229[_0x2db412(0x23b)]+_0x2db412(0x1f5)+_0x284fcf[_0x2db412(0x231)]+_0x2db412(0x229)):(_0x2fc8f5[_0x2db412(0x22b)]({'userId':_0x409229[_0x2db412(0x23b)],'username':_0x409229['username'],..._0x409229[_0x2db412(0x1f8)]?{'nickname':_0x409229['nickname']}:{}}),_0xd385af=!![]);else{if(!_0x3a4c4d)_0x240989[_0x2db412(0x22b)](_0x2db412(0x21b)+_0x409229[_0x2db412(0x23b)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x284fcf[_0x2db412(0x231)]+_0x2db412(0x229));else{const _0x44d0ae=_0x2fc8f5[_0x2db412(0x223)](_0x4e9bca=>_0x4e9bca['userId']===_0x409229[_0x2db412(0x23b)]);if(_0x44d0ae>=0x0)_0x2fc8f5[_0x2db412(0x1ed)](_0x44d0ae,0x1);_0xd385af=!![];}}const _0xb8321b=_0x2f7ad2[_0x2db412(0x218)](_0x2dea43=>_0x2dea43['id']===_0x434862?{..._0x2dea43,'userList':_0x2fc8f5}:_0x2dea43),_0x3f248b=_0x2fc8f5[_0x2db412(0x218)](_0x13e87d=>_0x13e87d[_0x2db412(0x23b)]),_0x1b6783={'operation':_0x56914a,'selector':{'appCode':_0x591ba5,'roleId':_0x434862,'roleName':_0x284fcf[_0x2db412(0x231)],'userId':_0x409229[_0x2db412(0x23b)]},'before':{'userIds':_0x1decc9},'after':{'userIds':_0x3f248b},'dryRun':_0xd878fe[_0x2db412(0x222)],'backend':{'method':_0x2db412(0x206),'path':UPDATE_USER_LIST_PATH},'warnings':_0x240989};return{'roleList':_0xb8321b,'mutation':_0x1b6783,'changed':_0xd385af};}export async function loadRoleUsers(_0x52dfa4){return listRoleUsers(_0x52dfa4);}export function readRoleRef(_0x385f88){const _0x388efc=a159_0x368088,_0x55709d=_0x385f88[_0x388efc(0x21a)]('role')['trim']();if(!_0x55709d)throw CliErrors[_0x388efc(0x219)](_0x388efc(0x22a),_0x388efc(0x1f1));return _0x55709d;}export async function prepareUserMutation(_0x587a44,_0x2facbb,_0xfef0b2){const _0x12b46d=a159_0x368088,_0x257501=readRoleRef(_0x587a44),_0xab5c11=_0x587a44[_0x12b46d(0x21a)](_0x12b46d(0x238))[_0x12b46d(0x204)]();if(!_0xab5c11)throw CliErrors[_0x12b46d(0x219)]('user','Pass\x20--user\x20<id|name>.');const _0x7fcf79=_0x587a44[_0x12b46d(0x228)](_0x12b46d(0x200)),_0x4e7f0d=_0x7fcf79===undefined||_0x7fcf79===null?undefined:Number(_0x7fcf79),_0x680f1a=await resolveRoleRef(_0x587a44[_0x12b46d(0x202)],_0x257501),_0x4ec160=await resolveUserRef(_0xab5c11),_0x37294d=await loadRoleUsers(_0x587a44[_0x12b46d(0x202)]);return computeRoleUserMutation({'operation':_0x2facbb,'appCode':_0x587a44[_0x12b46d(0x202)],'roleUsers':_0x37294d,'targetRoleId':_0x680f1a['id'],'user':{'userId':_0x4ec160[_0x12b46d(0x23b)],'username':_0x4ec160[_0x12b46d(0x1f3)],'nickname':_0x4ec160['nickname']},'dryRun':_0xfef0b2,..._0x4e7f0d!==undefined?{'expectUserCount':_0x4e7f0d}:{}});}
1
+ const a159_0x491fc5=a159_0x51e7;(function(_0x4572c4,_0x32d0cc){const _0x356877=a159_0x51e7,_0x48e070=_0x4572c4();while(!![]){try{const _0x463fbe=parseInt(_0x356877(0x12b))/0x1+parseInt(_0x356877(0x160))/0x2+parseInt(_0x356877(0x152))/0x3*(parseInt(_0x356877(0x12c))/0x4)+-parseInt(_0x356877(0x134))/0x5+-parseInt(_0x356877(0x155))/0x6*(parseInt(_0x356877(0x12a))/0x7)+parseInt(_0x356877(0x154))/0x8*(-parseInt(_0x356877(0x16d))/0x9)+parseInt(_0x356877(0x146))/0xa;if(_0x463fbe===_0x32d0cc)break;else _0x48e070['push'](_0x48e070['shift']());}catch(_0x58b2ab){_0x48e070['push'](_0x48e070['shift']());}}}(a159_0x23d2,0x78f5c));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a159_0x491fc5(0x164),'type':a159_0x491fc5(0x145),'required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':a159_0x491fc5(0x13e),'type':a159_0x491fc5(0x145),'required':!![],'description':a159_0x491fc5(0x15b)};export const NAME_FLAG={'name':a159_0x491fc5(0x15e),'type':'string','required':!![],'description':a159_0x491fc5(0x173)};export const USER_NAME_FLAG={'name':a159_0x491fc5(0x15e),'type':a159_0x491fc5(0x145),'required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a159_0x491fc5(0x138),'type':a159_0x491fc5(0x145),'required':![],'description':a159_0x491fc5(0x169)};function a159_0x51e7(_0x35a7d8,_0x92e5e1){_0x35a7d8=_0x35a7d8-0x126;const _0x23d2de=a159_0x23d2();let _0x51e716=_0x23d2de[_0x35a7d8];return _0x51e716;}export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a159_0x491fc5(0x132),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a159_0x491fc5(0x149),a159_0x491fc5(0x13f),a159_0x491fc5(0x16e)];export function isBuiltinRole(_0x166189){return BUILTIN_ROLE_TYPES['includes'](_0x166189);}export function assertCustomRole(_0x3128ef,_0x2b4b0a){const _0x5e6fd2=a159_0x491fc5;if(_0x3128ef[_0x5e6fd2(0x16f)]!==_0x5e6fd2(0x137))throw CliErrors[_0x5e6fd2(0x168)](_0x5e6fd2(0x14b)+_0x2b4b0a+_0x5e6fd2(0x13c)+_0x3128ef[_0x5e6fd2(0x167)]+'\x20('+_0x3128ef['roleType']+').',_0x5e6fd2(0x14f));}export function assertPermConfigurable(_0x3b8243){const _0x485aac=a159_0x491fc5;if(_0x3b8243[_0x485aac(0x16f)]==='DEV'||_0x3b8243[_0x485aac(0x16f)]===_0x485aac(0x149))throw CliErrors[_0x485aac(0x168)](_0x485aac(0x13a)+_0x3b8243['roleName']+'\x20('+_0x3b8243[_0x485aac(0x16f)]+').','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.');}export function projectRole(_0xc45af9){const _0x3f6d13=a159_0x491fc5;return{'id':_0xc45af9['id'],'roleName':_0xc45af9[_0x3f6d13(0x167)],'roleType':_0xc45af9['roleType'],'remark':_0xc45af9[_0x3f6d13(0x138)],'userCount':_0xc45af9[_0x3f6d13(0x172)],'permitCount':_0xc45af9[_0x3f6d13(0x174)],'builtin':isBuiltinRole(_0xc45af9[_0x3f6d13(0x16f)])};}export async function resolveRoleRef(_0x29acfb,_0x36e81e){const _0x596077=a159_0x491fc5,_0x3ad6b8=_0x36e81e[_0x596077(0x139)]();if(!_0x3ad6b8)throw CliErrors['validation']('Missing\x20role\x20reference.',_0x596077(0x147));if(/^\d+$/[_0x596077(0x16b)](_0x3ad6b8))return getRoleById(_0x29acfb,Number(_0x3ad6b8));const _0x37ff18=await listAllAppRoles(_0x29acfb),_0x32fb3b=_0x37ff18[_0x596077(0x153)](_0x5beae4=>_0x5beae4[_0x596077(0x167)]===_0x3ad6b8);if(_0x32fb3b['length']===0x0)throw CliErrors['validation']('Role\x20name\x20\x22'+_0x3ad6b8+_0x596077(0x128)+_0x29acfb+'.',_0x596077(0x158));if(_0x32fb3b[_0x596077(0x159)]>0x1){const _0x25d342=_0x32fb3b[_0x596077(0x130)](_0x1b8c55=>_0x1b8c55['id'])[_0x596077(0x151)](',\x20');throw CliErrors[_0x596077(0x168)](_0x596077(0x14c)+_0x3ad6b8+_0x596077(0x171)+_0x25d342+').',_0x596077(0x15d));}return _0x32fb3b[0x0];}export async function getRoleById(_0x31ba85,_0xf2d1aa){const _0x4829e3=a159_0x491fc5,_0x5ef091=await getAppRole(_0xf2d1aa);if(!_0x5ef091)throw CliErrors[_0x4829e3(0x168)](_0x4829e3(0x12f)+_0xf2d1aa+_0x4829e3(0x16c)+_0x31ba85+'.',_0x4829e3(0x162));return _0x5ef091;}async function listAllAppRoles(_0x169839){const _0x2d88bf=a159_0x491fc5,_0x2734d7=0x64,_0x5d126a=[];for(let _0x208b3f=0x1;;_0x208b3f+=0x1){const {items:_0x59167e,paging:_0x488dce}=await listAppRoles(_0x169839,{'currentPage':_0x208b3f,'pageSize':_0x2734d7});_0x5d126a[_0x2d88bf(0x12d)](..._0x59167e);if(_0x59167e['length']<_0x2734d7||_0x488dce&&_0x5d126a[_0x2d88bf(0x159)]>=_0x488dce[_0x2d88bf(0x170)])return _0x5d126a;}}export async function resolveTenantCode(){const _0x3b7982=a159_0x491fc5,_0x562ba5=await getSessionUserInfo(),_0x3ac0c0=_0x562ba5?.['user']?.[_0x3b7982(0x14d)]?.[_0x3b7982(0x157)];if(!_0x3ac0c0)throw CliErrors['authRequired']('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x3ac0c0;}function matchMember(_0x1b7e0f,_0x13bec7){const _0x1e5978=a159_0x491fc5,_0x195679=_0x13bec7[_0x1e5978(0x139)]()[_0x1e5978(0x15f)]();return(_0x1b7e0f[_0x1e5978(0x126)]??'')[_0x1e5978(0x15f)]()===_0x195679||(_0x1b7e0f[_0x1e5978(0x127)]??'')[_0x1e5978(0x15f)]()===_0x195679;}export async function resolveUserRef(_0x51f27e){const _0x542ac9=a159_0x491fc5,_0x285d29=_0x51f27e[_0x542ac9(0x139)]();if(!_0x285d29)throw CliErrors[_0x542ac9(0x168)](_0x542ac9(0x131),'Pass\x20--user\x20<id|name>.');const _0xed5a1a=await resolveTenantCode(),_0x1b4812=await getTenantMembers(_0xed5a1a);if(/^\d+$/[_0x542ac9(0x16b)](_0x285d29)){const _0x31580a=Number(_0x285d29),_0x37332b=_0x1b4812[_0x542ac9(0x142)](_0x126d65=>_0x126d65[_0x542ac9(0x156)]===_0x31580a);return{'userId':_0x31580a,'username':_0x37332b?.[_0x542ac9(0x127)]??String(_0x31580a),'nickname':_0x37332b?.[_0x542ac9(0x126)],'matchedBy':'id'};}const _0x34aa62=_0x1b4812[_0x542ac9(0x153)](_0x4be98a=>matchMember(_0x4be98a,_0x285d29));if(_0x34aa62[_0x542ac9(0x159)]===0x0)throw CliErrors[_0x542ac9(0x168)](_0x542ac9(0x143)+_0x285d29+'\x22.',_0x542ac9(0x161));if(_0x34aa62['length']>0x1){const _0x448cdd=_0x34aa62['map'](_0xb880fd=>(_0xb880fd[_0x542ac9(0x126)]??_0xb880fd['username']??'?')+'('+_0xb880fd[_0x542ac9(0x156)]+')')[_0x542ac9(0x151)](',\x20');throw CliErrors[_0x542ac9(0x168)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x285d29+_0x542ac9(0x12e)+_0x448cdd+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x2fbdfb=_0x34aa62[0x0];return{'userId':_0x2fbdfb['userId'],'username':_0x2fbdfb['username']??String(_0x2fbdfb[_0x542ac9(0x156)]),'nickname':_0x2fbdfb[_0x542ac9(0x126)],'matchedBy':'name'};}export const UPDATE_USER_LIST_PATH=a159_0x491fc5(0x148);function a159_0x23d2(){const _0x5f5a51=['Disambiguate\x20with\x20--role\x20<id>.','name','toLowerCase','634976jNZOVx','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','\x20is\x20already\x20a\x20member\x20of\x20role\x20','role','findIndex','POST','roleName','validation','Optional\x20role\x20remark/description','\x20not\x20found\x20in\x20the\x20user-role\x20list.','test','\x20not\x20found\x20in\x20app\x20','46854SHkpzn','USER','roleType','totalCount','\x22\x20is\x20ambiguous\x20(ids:\x20','userCount','Role\x20name','permitCount','Pass\x20--user\x20<id|name>.','nickname','username','\x22\x20not\x20found\x20in\x20app\x20','\x20member(s)\x20but\x20role\x20has\x20','217xEmlKd','777224tGECty','3789472mNWJQk','push','\x22:\x20','Role\x20id\x20','map','Missing\x20user\x20reference.','number','flag','4649885hcMdRL','expectUserCount','appCode','CUSTOM','remark','trim','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','userList','\x20built-in\x20role\x20','user-add','user','DEV',';\x20no\x20change.','User\x20','find','No\x20tenant\x20member\x20matches\x20\x22','dryRun','string','1357210eTMSBs','Pass\x20--role\x20<id|name>.','/smartapi/permit/user-role/update-user-list','ADMIN','str','Cannot\x20','Role\x20name\x20\x22','tenant','flagMissing','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','\x20is\x20not\x20a\x20member\x20of\x20role\x20','join','3WSTEFu','filter','488mcpnVt','84156guWdcZ','userId','tenant_code','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','length','expect-user-count','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','splice'];a159_0x23d2=function(){return _0x5f5a51;};return a159_0x23d2();}function userIdsOf(_0x3ecfe0){const _0x26e821=a159_0x491fc5;return(_0x3ecfe0?.['userList']??[])[_0x26e821(0x130)](_0x20f62c=>_0x20f62c[_0x26e821(0x156)]);}export function computeRoleUserMutation(_0x38bacb){const _0x12423b=a159_0x491fc5,{operation:_0x26f703,appCode:_0x2b3666,roleUsers:_0x21a2bf,targetRoleId:_0x3acd41,user:_0x5e774c}=_0x38bacb,_0x1cca14=_0x21a2bf[_0x12423b(0x142)](_0x40efab=>_0x40efab['id']===_0x3acd41);if(!_0x1cca14)throw CliErrors[_0x12423b(0x168)](_0x12423b(0x12f)+_0x3acd41+_0x12423b(0x16a),_0x12423b(0x162));const _0x1dfdf8=userIdsOf(_0x1cca14),_0x10af43=[];if(_0x38bacb[_0x12423b(0x135)]!==undefined&&_0x38bacb['expectUserCount']!==_0x1dfdf8[_0x12423b(0x159)])throw CliErrors[_0x12423b(0x168)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x38bacb[_0x12423b(0x135)]+_0x12423b(0x129)+_0x1dfdf8[_0x12423b(0x159)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x1a710c=_0x1dfdf8['includes'](_0x5e774c[_0x12423b(0x156)]);let _0x29c8fa=![];const _0x591897=[..._0x1cca14[_0x12423b(0x13b)]];if(_0x26f703===_0x12423b(0x13d))_0x1a710c?_0x10af43['push'](_0x12423b(0x141)+_0x5e774c['userId']+_0x12423b(0x163)+_0x1cca14[_0x12423b(0x167)]+_0x12423b(0x140)):(_0x591897[_0x12423b(0x12d)]({'userId':_0x5e774c[_0x12423b(0x156)],'username':_0x5e774c[_0x12423b(0x127)],..._0x5e774c[_0x12423b(0x126)]?{'nickname':_0x5e774c['nickname']}:{}}),_0x29c8fa=!![]);else{if(!_0x1a710c)_0x10af43[_0x12423b(0x12d)](_0x12423b(0x141)+_0x5e774c[_0x12423b(0x156)]+_0x12423b(0x150)+_0x1cca14[_0x12423b(0x167)]+';\x20no\x20change.');else{const _0x45f601=_0x591897[_0x12423b(0x165)](_0x18ecf2=>_0x18ecf2[_0x12423b(0x156)]===_0x5e774c[_0x12423b(0x156)]);if(_0x45f601>=0x0)_0x591897[_0x12423b(0x15c)](_0x45f601,0x1);_0x29c8fa=!![];}}const _0x27f689=_0x21a2bf[_0x12423b(0x130)](_0x43367e=>_0x43367e['id']===_0x3acd41?{..._0x43367e,'userList':_0x591897}:_0x43367e),_0xc6d90f=_0x591897[_0x12423b(0x130)](_0x326845=>_0x326845[_0x12423b(0x156)]),_0x5199fd={'operation':_0x26f703,'selector':{'appCode':_0x2b3666,'roleId':_0x3acd41,'roleName':_0x1cca14[_0x12423b(0x167)],'userId':_0x5e774c[_0x12423b(0x156)]},'before':{'userIds':_0x1dfdf8},'after':{'userIds':_0xc6d90f},'dryRun':_0x38bacb[_0x12423b(0x144)],'backend':{'method':_0x12423b(0x166),'path':UPDATE_USER_LIST_PATH},'warnings':_0x10af43};return{'roleList':_0x27f689,'mutation':_0x5199fd,'changed':_0x29c8fa};}export async function loadRoleUsers(_0x2b2a7b){return listRoleUsers(_0x2b2a7b);}export function readRoleRef(_0x5dd307){const _0x4f1e08=a159_0x491fc5,_0x3b4ee4=_0x5dd307[_0x4f1e08(0x14a)](_0x4f1e08(0x164))['trim']();if(!_0x3b4ee4)throw CliErrors['flagMissing']('role',_0x4f1e08(0x147));return _0x3b4ee4;}export async function prepareUserMutation(_0x17b19f,_0x56b5dd,_0x5eb7c7){const _0x5421f7=a159_0x491fc5,_0x922c73=readRoleRef(_0x17b19f),_0x1ffca2=_0x17b19f[_0x5421f7(0x14a)](_0x5421f7(0x13e))[_0x5421f7(0x139)]();if(!_0x1ffca2)throw CliErrors[_0x5421f7(0x14e)](_0x5421f7(0x13e),_0x5421f7(0x175));const _0x125c80=_0x17b19f[_0x5421f7(0x133)](_0x5421f7(0x15a)),_0x3659b8=_0x125c80===undefined||_0x125c80===null?undefined:Number(_0x125c80),_0x2322a5=await resolveRoleRef(_0x17b19f[_0x5421f7(0x136)],_0x922c73),_0x3fa817=await resolveUserRef(_0x1ffca2),_0x2b800c=await loadRoleUsers(_0x17b19f[_0x5421f7(0x136)]);return computeRoleUserMutation({'operation':_0x56b5dd,'appCode':_0x17b19f[_0x5421f7(0x136)],'roleUsers':_0x2b800c,'targetRoleId':_0x2322a5['id'],'user':{'userId':_0x3fa817[_0x5421f7(0x156)],'username':_0x3fa817[_0x5421f7(0x127)],'nickname':_0x3fa817[_0x5421f7(0x126)]},'dryRun':_0x5eb7c7,..._0x3659b8!==undefined?{'expectUserCount':_0x3659b8}:{}});}
@@ -1 +1 @@
1
- const a160_0x3a78ef=a160_0x2c29;function a160_0x2c29(_0x24e28c,_0x467c4f){_0x24e28c=_0x24e28c-0x1c8;const _0x5c7591=a160_0x5c75();let _0x2c29bd=_0x5c7591[_0x24e28c];return _0x2c29bd;}(function(_0x41db52,_0x399910){const _0x21ecf2=a160_0x2c29,_0x107287=_0x41db52();while(!![]){try{const _0x27cd44=parseInt(_0x21ecf2(0x1d5))/0x1*(-parseInt(_0x21ecf2(0x1d2))/0x2)+-parseInt(_0x21ecf2(0x1cb))/0x3+-parseInt(_0x21ecf2(0x1c8))/0x4+-parseInt(_0x21ecf2(0x1df))/0x5+-parseInt(_0x21ecf2(0x1d7))/0x6*(parseInt(_0x21ecf2(0x1ce))/0x7)+parseInt(_0x21ecf2(0x1ca))/0x8+parseInt(_0x21ecf2(0x1cf))/0x9;if(_0x27cd44===_0x399910)break;else _0x107287['push'](_0x107287['shift']());}catch(_0x5de101){_0x107287['push'](_0x107287['shift']());}}}(a160_0x5c75,0xa0c49));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a160_0x5c75(){const _0x36cb5e=['9103hfXybj','update','14172rTOfLD','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','POST','validation','appCode','\x20(id=','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','2977925KlPjtT','New\x20role\x20name','1121700owWdgz','roleName','306984peDIQD','2658483ryfBhD','name','num','2387BzyrsP','34506522nMTtmO','role','remark','142QOWjCX','--name\x20cannot\x20be\x20empty.','Updated\x20role\x20'];a160_0x5c75=function(){return _0x36cb5e;};return a160_0x5c75();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x3f4683){const _0x1951c6=a160_0x2c29,_0x5e06e8=_0x3f4683['flag']('name'),_0x3f1532=_0x3f4683['flag']('remark'),_0x1afb33={};if(_0x5e06e8!==undefined&&_0x5e06e8!==null){const _0x2eda80=String(_0x5e06e8)['trim']();if(!_0x2eda80)throw CliErrors[_0x1951c6(0x1da)](_0x1951c6(0x1d3));if(_0x2eda80['length']>0x40)throw CliErrors['validation'](_0x1951c6(0x1d8));_0x1afb33['roleName']=_0x2eda80;}_0x3f1532!==undefined&&_0x3f1532!==null&&(_0x1afb33[_0x1951c6(0x1d1)]=String(_0x3f1532));if(_0x1afb33[_0x1951c6(0x1c9)]===undefined&&_0x1afb33['remark']===undefined)throw CliErrors[_0x1951c6(0x1da)]('Nothing\x20to\x20update.',_0x1951c6(0x1de));return _0x1afb33;}export const roleUpdate={'service':a160_0x3a78ef(0x1d0),'command':'update','description':a160_0x3a78ef(0x1dd),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a160_0x3a78ef(0x1cc),'type':'string','required':![],'description':a160_0x3a78ef(0x1e0)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x356f38){readPatch(_0x356f38);},async 'dryRun'(_0x45c90d){const _0x2ec9a4=a160_0x3a78ef,_0x4dc072=_0x45c90d[_0x2ec9a4(0x1cd)]('id'),_0x2661ec=readPatch(_0x45c90d),_0x3ea537=await getRoleById(_0x45c90d[_0x2ec9a4(0x1db)],_0x4dc072);return assertCustomRole(_0x3ea537,'update'),asDryRunResult({'operation':_0x2ec9a4(0x1d6),'selector':{'appCode':_0x45c90d[_0x2ec9a4(0x1db)],'roleId':_0x4dc072,'roleName':_0x3ea537[_0x2ec9a4(0x1c9)]},'before':projectRole(_0x3ea537),'after':projectRole({..._0x3ea537,..._0x2661ec['roleName']!==undefined?{'roleName':_0x2661ec[_0x2ec9a4(0x1c9)]}:{},..._0x2661ec[_0x2ec9a4(0x1d1)]!==undefined?{'remark':_0x2661ec['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x2ec9a4(0x1d9),'path':UPDATE_PATH},'warnings':[]},{'method':_0x2ec9a4(0x1d9),'url':UPDATE_PATH});},async 'execute'(_0x321159){const _0x34ee8f=a160_0x3a78ef,_0x4261ce=_0x321159['num']('id'),_0x28d975=readPatch(_0x321159),_0x4cdf6a=await getRoleById(_0x321159[_0x34ee8f(0x1db)],_0x4261ce);assertCustomRole(_0x4cdf6a,_0x34ee8f(0x1d6)),await updateAppRole({'id':_0x4261ce,'appCode':_0x321159['appCode'],..._0x28d975[_0x34ee8f(0x1c9)]!==undefined?{'roleName':_0x28d975[_0x34ee8f(0x1c9)]}:{},..._0x28d975[_0x34ee8f(0x1d1)]!==undefined?{'remark':_0x28d975[_0x34ee8f(0x1d1)]}:{}});const _0x3d5b3e=await getRoleById(_0x321159['appCode'],_0x4261ce);return{'ok':!![],'data':{'operation':_0x34ee8f(0x1d6),'selector':{'appCode':_0x321159[_0x34ee8f(0x1db)],'roleId':_0x4261ce,'roleName':_0x3d5b3e[_0x34ee8f(0x1c9)]},'before':projectRole(_0x4cdf6a),'after':projectRole(_0x3d5b3e),'dryRun':![],'backend':{'method':_0x34ee8f(0x1d9),'path':UPDATE_PATH},'warnings':[]},'message':_0x34ee8f(0x1d4)+_0x3d5b3e[_0x34ee8f(0x1c9)]+_0x34ee8f(0x1dc)+_0x4261ce+')'};}};
1
+ const a160_0xb453ce=a160_0x5f0a;(function(_0x31b4ef,_0x3f1150){const _0x4c7880=a160_0x5f0a,_0x29e26b=_0x31b4ef();while(!![]){try{const _0x24e402=parseInt(_0x4c7880(0x176))/0x1*(-parseInt(_0x4c7880(0x169))/0x2)+-parseInt(_0x4c7880(0x171))/0x3*(-parseInt(_0x4c7880(0x17b))/0x4)+parseInt(_0x4c7880(0x16c))/0x5+parseInt(_0x4c7880(0x175))/0x6+-parseInt(_0x4c7880(0x17c))/0x7+parseInt(_0x4c7880(0x17a))/0x8*(parseInt(_0x4c7880(0x179))/0x9)+-parseInt(_0x4c7880(0x165))/0xa;if(_0x24e402===_0x3f1150)break;else _0x29e26b['push'](_0x29e26b['shift']());}catch(_0x438dee){_0x29e26b['push'](_0x29e26b['shift']());}}}(a160_0x4514,0xa047c));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a160_0x4514(){const _0x1fac64=['flag','2075490aOVfTu','validation','\x20(id=','remark','write','2157HhIiJU','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','/smartapi/permit/role/update','trim','4382580YSMvUG','771Eohshs','update','name','1974807KgelEU','24BuClyK','1780eJctTF','996030KAgcUV','Nothing\x20to\x20update.','POST','string','1198810JWhIId','Updated\x20role\x20','roleName','appCode','3126KzMXJt','length'];a160_0x4514=function(){return _0x1fac64;};return a160_0x4514();}function a160_0x5f0a(_0x43ff85,_0x48fb7e){_0x43ff85=_0x43ff85-0x162;const _0x45143b=a160_0x4514();let _0x5f0ae1=_0x45143b[_0x43ff85];return _0x5f0ae1;}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=a160_0xb453ce(0x173);function readPatch(_0x396eda){const _0x4fd4ec=a160_0xb453ce,_0x2297dd=_0x396eda['flag']('name'),_0x2ef991=_0x396eda[_0x4fd4ec(0x16b)]('remark'),_0x283ab4={};if(_0x2297dd!==undefined&&_0x2297dd!==null){const _0x2e2c76=String(_0x2297dd)[_0x4fd4ec(0x174)]();if(!_0x2e2c76)throw CliErrors[_0x4fd4ec(0x16d)]('--name\x20cannot\x20be\x20empty.');if(_0x2e2c76[_0x4fd4ec(0x16a)]>0x40)throw CliErrors[_0x4fd4ec(0x16d)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x283ab4[_0x4fd4ec(0x167)]=_0x2e2c76;}_0x2ef991!==undefined&&_0x2ef991!==null&&(_0x283ab4[_0x4fd4ec(0x16f)]=String(_0x2ef991));if(_0x283ab4['roleName']===undefined&&_0x283ab4[_0x4fd4ec(0x16f)]===undefined)throw CliErrors[_0x4fd4ec(0x16d)](_0x4fd4ec(0x162),_0x4fd4ec(0x172));return _0x283ab4;}export const roleUpdate={'service':'role','command':a160_0xb453ce(0x177),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','risk':a160_0xb453ce(0x170),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a160_0xb453ce(0x178),'type':a160_0xb453ce(0x164),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x21f1e1){readPatch(_0x21f1e1);},async 'dryRun'(_0x15c4a1){const _0x1a6818=a160_0xb453ce,_0x47fc95=_0x15c4a1['num']('id'),_0x26c440=readPatch(_0x15c4a1),_0x10734a=await getRoleById(_0x15c4a1[_0x1a6818(0x168)],_0x47fc95);return assertCustomRole(_0x10734a,_0x1a6818(0x177)),asDryRunResult({'operation':'update','selector':{'appCode':_0x15c4a1['appCode'],'roleId':_0x47fc95,'roleName':_0x10734a['roleName']},'before':projectRole(_0x10734a),'after':projectRole({..._0x10734a,..._0x26c440['roleName']!==undefined?{'roleName':_0x26c440[_0x1a6818(0x167)]}:{},..._0x26c440[_0x1a6818(0x16f)]!==undefined?{'remark':_0x26c440['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x1a6818(0x163),'path':UPDATE_PATH},'warnings':[]},{'method':_0x1a6818(0x163),'url':UPDATE_PATH});},async 'execute'(_0x82f4ba){const _0x440bd7=a160_0xb453ce,_0x4e2058=_0x82f4ba['num']('id'),_0x3f6505=readPatch(_0x82f4ba),_0x5c1637=await getRoleById(_0x82f4ba[_0x440bd7(0x168)],_0x4e2058);assertCustomRole(_0x5c1637,_0x440bd7(0x177)),await updateAppRole({'id':_0x4e2058,'appCode':_0x82f4ba[_0x440bd7(0x168)],..._0x3f6505[_0x440bd7(0x167)]!==undefined?{'roleName':_0x3f6505[_0x440bd7(0x167)]}:{},..._0x3f6505['remark']!==undefined?{'remark':_0x3f6505[_0x440bd7(0x16f)]}:{}});const _0x38b109=await getRoleById(_0x82f4ba[_0x440bd7(0x168)],_0x4e2058);return{'ok':!![],'data':{'operation':_0x440bd7(0x177),'selector':{'appCode':_0x82f4ba[_0x440bd7(0x168)],'roleId':_0x4e2058,'roleName':_0x38b109[_0x440bd7(0x167)]},'before':projectRole(_0x5c1637),'after':projectRole(_0x38b109),'dryRun':![],'backend':{'method':_0x440bd7(0x163),'path':UPDATE_PATH},'warnings':[]},'message':_0x440bd7(0x166)+_0x38b109['roleName']+_0x440bd7(0x16e)+_0x4e2058+')'};}};
@@ -1 +1 @@
1
- const a161_0x4c0d0a=a161_0x1cbc;(function(_0x574a58,_0x36bde2){const _0x502220=a161_0x1cbc,_0x2d22dc=_0x574a58();while(!![]){try{const _0x24623a=-parseInt(_0x502220(0x154))/0x1*(parseInt(_0x502220(0x148))/0x2)+-parseInt(_0x502220(0x14f))/0x3*(-parseInt(_0x502220(0x142))/0x4)+-parseInt(_0x502220(0x149))/0x5*(-parseInt(_0x502220(0x144))/0x6)+-parseInt(_0x502220(0x153))/0x7*(-parseInt(_0x502220(0x151))/0x8)+-parseInt(_0x502220(0x145))/0x9+parseInt(_0x502220(0x146))/0xa*(parseInt(_0x502220(0x147))/0xb)+-parseInt(_0x502220(0x14a))/0xc;if(_0x24623a===_0x36bde2)break;else _0x2d22dc['push'](_0x2d22dc['shift']());}catch(_0x5a9382){_0x2d22dc['push'](_0x2d22dc['shift']());}}}(a161_0x2c24,0x49387));function a161_0x1cbc(_0x794599,_0x38b871){_0x794599=_0x794599-0x141;const _0x2c2425=a161_0x2c24();let _0x1cbcad=_0x2c2425[_0x794599];return _0x1cbcad;}import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':'role','command':a161_0x4c0d0a(0x152),'description':a161_0x4c0d0a(0x14c),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3d9260){const _0x1decab=a161_0x4c0d0a,{mutation:_0x911b43}=await prepareUserMutation(_0x3d9260,_0x1decab(0x152),!![]);return asDryRunResult(_0x911b43,{'method':_0x1decab(0x14d),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0xf52a0e){const _0x1d94ab=a161_0x4c0d0a,{roleList:_0x4dfbfb,mutation:_0x337b79,changed:_0x1f4b49}=await prepareUserMutation(_0xf52a0e,_0x1d94ab(0x152),![]);return _0x1f4b49&&await updateRoleUsers(_0xf52a0e[_0x1d94ab(0x150)],_0x4dfbfb),{'ok':!![],'data':_0x337b79,'message':_0x1f4b49?_0x1d94ab(0x143)+_0x337b79['selector']['userId']+_0x1d94ab(0x157)+_0x337b79[_0x1d94ab(0x14b)]['roleName']:_0x1d94ab(0x155)+_0x337b79[_0x1d94ab(0x14b)][_0x1d94ab(0x14e)]+_0x1d94ab(0x156)+_0x337b79[_0x1d94ab(0x14b)][_0x1d94ab(0x141)]};}};function a161_0x2c24(){const _0x4a6691=['57849PvyKKf','37798FerRuk','5ImalKv','1068420xHqePN','selector','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','POST','userId','9RNbsIl','appCode','88WhqSQV','user-add','98623fFYaeZ','16egufez','No\x20change:\x20user\x20','\x20already\x20in\x20role\x20','\x20to\x20role\x20','roleName','104564jNRREb','Added\x20user\x20','628014BfYFUo','843804HOjuJr','850qoXARG'];a161_0x2c24=function(){return _0x4a6691;};return a161_0x2c24();}
1
+ const a161_0x22f74f=a161_0x38cd;function a161_0x38cd(_0x2c1139,_0x265a2a){_0x2c1139=_0x2c1139-0x13f;const _0xdaa9a=a161_0xdaa9();let _0x38cd20=_0xdaa9a[_0x2c1139];return _0x38cd20;}(function(_0x28b3cf,_0x30f0e7){const _0x2cae2a=a161_0x38cd,_0x3d0164=_0x28b3cf();while(!![]){try{const _0x1dd64e=parseInt(_0x2cae2a(0x144))/0x1*(-parseInt(_0x2cae2a(0x14e))/0x2)+parseInt(_0x2cae2a(0x14b))/0x3*(-parseInt(_0x2cae2a(0x140))/0x4)+parseInt(_0x2cae2a(0x141))/0x5*(-parseInt(_0x2cae2a(0x13f))/0x6)+-parseInt(_0x2cae2a(0x145))/0x7+-parseInt(_0x2cae2a(0x151))/0x8+parseInt(_0x2cae2a(0x148))/0x9*(-parseInt(_0x2cae2a(0x149))/0xa)+parseInt(_0x2cae2a(0x147))/0xb;if(_0x1dd64e===_0x30f0e7)break;else _0x3d0164['push'](_0x3d0164['shift']());}catch(_0x23a66f){_0x3d0164['push'](_0x3d0164['shift']());}}}(a161_0xdaa9,0x48530));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a161_0xdaa9(){const _0x11f6c1=['\x20to\x20role\x20','selector','1NVApos','2070005PJTjre','POST','23951884LMLVlF','36711hDTiax','1100yiZHEN','Added\x20user\x20','177501GlxZGm','roleName','userId','823726QbraiE','user-add','role','1914328lTjwvD','high-risk-write','\x20already\x20in\x20role\x20','564fTZXcR','4RZPaNj','22685onzgSW'];a161_0xdaa9=function(){return _0x11f6c1;};return a161_0xdaa9();}import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a161_0x22f74f(0x150),'command':a161_0x22f74f(0x14f),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a161_0x22f74f(0x152),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3f89ad){const _0x471bc2=a161_0x22f74f,{mutation:_0x42c3a8}=await prepareUserMutation(_0x3f89ad,_0x471bc2(0x14f),!![]);return asDryRunResult(_0x42c3a8,{'method':_0x471bc2(0x146),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x3d6f04){const _0x2400fa=a161_0x22f74f,{roleList:_0x17bdd7,mutation:_0x5c1c2e,changed:_0x6da215}=await prepareUserMutation(_0x3d6f04,_0x2400fa(0x14f),![]);return _0x6da215&&await updateRoleUsers(_0x3d6f04['appCode'],_0x17bdd7),{'ok':!![],'data':_0x5c1c2e,'message':_0x6da215?_0x2400fa(0x14a)+_0x5c1c2e['selector'][_0x2400fa(0x14d)]+_0x2400fa(0x142)+_0x5c1c2e[_0x2400fa(0x143)]['roleName']:'No\x20change:\x20user\x20'+_0x5c1c2e[_0x2400fa(0x143)][_0x2400fa(0x14d)]+_0x2400fa(0x153)+_0x5c1c2e[_0x2400fa(0x143)][_0x2400fa(0x14c)]};}};
@@ -1 +1 @@
1
- const a162_0x28af7e=a162_0x428d;(function(_0x2e0bca,_0x37f855){const _0x97ca72=a162_0x428d,_0x4ec60a=_0x2e0bca();while(!![]){try{const _0x52a0fd=-parseInt(_0x97ca72(0x15c))/0x1+-parseInt(_0x97ca72(0x15b))/0x2+parseInt(_0x97ca72(0x158))/0x3*(-parseInt(_0x97ca72(0x156))/0x4)+-parseInt(_0x97ca72(0x153))/0x5*(-parseInt(_0x97ca72(0x159))/0x6)+-parseInt(_0x97ca72(0x151))/0x7*(-parseInt(_0x97ca72(0x14a))/0x8)+-parseInt(_0x97ca72(0x157))/0x9*(-parseInt(_0x97ca72(0x154))/0xa)+parseInt(_0x97ca72(0x149))/0xb;if(_0x52a0fd===_0x37f855)break;else _0x4ec60a['push'](_0x4ec60a['shift']());}catch(_0x62b07a){_0x4ec60a['push'](_0x4ec60a['shift']());}}}(a162_0x45ac,0x9d9e9));function a162_0x428d(_0x26ccf8,_0x5a8ac5){_0x26ccf8=_0x26ccf8-0x149;const _0x45ac08=a162_0x45ac();let _0x428d4c=_0x45ac08[_0x26ccf8];return _0x428d4c;}import{updateRoleUsers}from'../../core/api-client.js';function a162_0x45ac(){const _0x37b807=['role','1623288bSJcRm','1249005vAAKPZ','appCode','user-remove','23055142HQGprV','8loWzCe','userId','roleName','\x20not\x20in\x20role\x20','\x20from\x20role\x20','No\x20change:\x20user\x20','Removed\x20user\x20','3455053Esxxow','high-risk-write','12205fnTiGk','222490iKboyS','selector','536yoLKxX','36IDjXZf','1947gzyyxq','282MCIjvv'];a162_0x45ac=function(){return _0x37b807;};return a162_0x45ac();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a162_0x28af7e(0x15a),'command':a162_0x28af7e(0x15e),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a162_0x28af7e(0x152),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2bfd4d){const _0x4bade7=a162_0x28af7e,{mutation:_0x1efd8b}=await prepareUserMutation(_0x2bfd4d,_0x4bade7(0x15e),!![]);return asDryRunResult(_0x1efd8b,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x2a8002){const _0x5cca92=a162_0x28af7e,{roleList:_0x9bde3b,mutation:_0xda91de,changed:_0x3c7c36}=await prepareUserMutation(_0x2a8002,'user-remove',![]);return _0x3c7c36&&await updateRoleUsers(_0x2a8002[_0x5cca92(0x15d)],_0x9bde3b),{'ok':!![],'data':_0xda91de,'message':_0x3c7c36?_0x5cca92(0x150)+_0xda91de[_0x5cca92(0x155)][_0x5cca92(0x14b)]+_0x5cca92(0x14e)+_0xda91de['selector'][_0x5cca92(0x14c)]:_0x5cca92(0x14f)+_0xda91de[_0x5cca92(0x155)][_0x5cca92(0x14b)]+_0x5cca92(0x14d)+_0xda91de[_0x5cca92(0x155)][_0x5cca92(0x14c)]};}};
1
+ const a162_0x8dba92=a162_0xea33;(function(_0x392578,_0x39d022){const _0x5eb81a=a162_0xea33,_0x47bb06=_0x392578();while(!![]){try{const _0x2e0ea1=-parseInt(_0x5eb81a(0x80))/0x1+parseInt(_0x5eb81a(0x86))/0x2*(-parseInt(_0x5eb81a(0x85))/0x3)+-parseInt(_0x5eb81a(0x87))/0x4*(-parseInt(_0x5eb81a(0x7a))/0x5)+-parseInt(_0x5eb81a(0x84))/0x6+-parseInt(_0x5eb81a(0x76))/0x7*(-parseInt(_0x5eb81a(0x75))/0x8)+-parseInt(_0x5eb81a(0x7d))/0x9+-parseInt(_0x5eb81a(0x88))/0xa*(-parseInt(_0x5eb81a(0x7c))/0xb);if(_0x2e0ea1===_0x39d022)break;else _0x47bb06['push'](_0x47bb06['shift']());}catch(_0x2b3350){_0x47bb06['push'](_0x47bb06['shift']());}}}(a162_0x4fbb,0x4d6ef));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':'role','command':a162_0x8dba92(0x77),'description':a162_0x8dba92(0x78),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x39b5d7){const _0xc210b0=a162_0x8dba92,{mutation:_0x47300d}=await prepareUserMutation(_0x39b5d7,'user-remove',!![]);return asDryRunResult(_0x47300d,{'method':_0xc210b0(0x7e),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x588a0a){const _0x36c2ed=a162_0x8dba92,{roleList:_0x576bac,mutation:_0x199132,changed:_0x260b24}=await prepareUserMutation(_0x588a0a,_0x36c2ed(0x77),![]);return _0x260b24&&await updateRoleUsers(_0x588a0a[_0x36c2ed(0x7b)],_0x576bac),{'ok':!![],'data':_0x199132,'message':_0x260b24?_0x36c2ed(0x83)+_0x199132['selector'][_0x36c2ed(0x81)]+'\x20from\x20role\x20'+_0x199132[_0x36c2ed(0x79)]['roleName']:_0x36c2ed(0x82)+_0x199132['selector'][_0x36c2ed(0x81)]+'\x20not\x20in\x20role\x20'+_0x199132[_0x36c2ed(0x79)][_0x36c2ed(0x7f)]};}};function a162_0xea33(_0x4c7356,_0x4a079c){_0x4c7356=_0x4c7356-0x75;const _0x4fbb0a=a162_0x4fbb();let _0xea3300=_0x4fbb0a[_0x4c7356];return _0xea3300;}function a162_0x4fbb(){const _0x1e9ab6=['selector','218510tUkkCW','appCode','4690213YkwPfC','5708403aHnNKR','POST','roleName','496704VhdgXr','userId','No\x20change:\x20user\x20','Removed\x20user\x20','3697002HHzGQS','6SoQabL','403288pJXiXQ','56aAAbIh','30TSLIzS','1153232BMxkiL','28ooQGCH','user-remove','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes'];a162_0x4fbb=function(){return _0x1e9ab6;};return a162_0x4fbb();}
@@ -1 +1 @@
1
- const a163_0x581f23=a163_0x2449;function a163_0x2449(_0x33445a,_0x4f5dd6){_0x33445a=_0x33445a-0x170;const _0x344cc6=a163_0x344c();let _0x2449c5=_0x344cc6[_0x33445a];return _0x2449c5;}(function(_0x1cc47e,_0x532d45){const _0x35e599=a163_0x2449,_0x230ade=_0x1cc47e();while(!![]){try{const _0x2dbdaa=-parseInt(_0x35e599(0x186))/0x1+-parseInt(_0x35e599(0x175))/0x2+-parseInt(_0x35e599(0x173))/0x3*(parseInt(_0x35e599(0x17f))/0x4)+-parseInt(_0x35e599(0x183))/0x5+parseInt(_0x35e599(0x181))/0x6*(-parseInt(_0x35e599(0x170))/0x7)+parseInt(_0x35e599(0x176))/0x8+-parseInt(_0x35e599(0x179))/0x9*(-parseInt(_0x35e599(0x184))/0xa);if(_0x2dbdaa===_0x532d45)break;else _0x230ade['push'](_0x230ade['shift']());}catch(_0x528c04){_0x230ade['push'](_0x230ade['shift']());}}}(a163_0x344c,0x3bc24));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a163_0x581f23(0x17b),'description':a163_0x581f23(0x178),'risk':a163_0x581f23(0x17c),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x525b5a){const _0x51440b=a163_0x581f23;if(!_0x525b5a[_0x51440b(0x174)](_0x51440b(0x17a))[_0x51440b(0x182)]())throw CliErrors[_0x51440b(0x171)]('name',_0x51440b(0x17d));},async 'execute'(_0x5a461c){const _0xb6410d=a163_0x581f23,_0x369cfe=_0x5a461c['str']('name')[_0xb6410d(0x182)](),_0x18f282=await resolveUserRef(_0x369cfe);return{'ok':!![],'data':{'user':{'userId':_0x18f282['userId'],'username':_0x18f282[_0xb6410d(0x185)],'nickname':_0x18f282['nickname'],'matchedBy':_0x18f282[_0xb6410d(0x180)]}},'message':_0xb6410d(0x172)+_0x369cfe+_0xb6410d(0x17e)+_0x18f282[_0xb6410d(0x177)]};}};function a163_0x344c(){const _0x29f0d2=['read','Pass\x20--name\x20<nickname|username>.','\x22\x20→\x20userId\x20','1730348CHVCOW','matchedBy','1149180KfSLTr','trim','1663025DBKOkx','11919410DGLlTZ','username','19802zmGgVO','7tFLIBT','flagMissing','Resolved\x20\x22','3sYjtza','str','492530KovoqV','2204960AEUcyK','userId','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','9QgRUga','name','user-resolve'];a163_0x344c=function(){return _0x29f0d2;};return a163_0x344c();}
1
+ function a163_0x1ceb(){const _0x3db705=['Resolved\x20\x22','str','8325pWwlaR','name','4186SpxHwJ','userId','matchedBy','1796604bpYSxP','flagMissing','23830LhUUAF','1262678CEOaNS','2146640Dyzxki','role','1IkwBEO','username','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','read','nickname','389416IWqvPR','4496FTuhbf','trim','1365798bjYFCW','Pass\x20--name\x20<nickname|username>.'];a163_0x1ceb=function(){return _0x3db705;};return a163_0x1ceb();}const a163_0x508523=a163_0x57a5;(function(_0x551c4d,_0x115775){const _0x15283c=a163_0x57a5,_0x3d41bc=_0x551c4d();while(!![]){try{const _0x1d330c=parseInt(_0x15283c(0x1d4))/0x1*(-parseInt(_0x15283c(0x1d1))/0x2)+-parseInt(_0x15283c(0x1ce))/0x3+-parseInt(_0x15283c(0x1d9))/0x4+-parseInt(_0x15283c(0x1d2))/0x5+parseInt(_0x15283c(0x1dc))/0x6+parseInt(_0x15283c(0x1cb))/0x7*(-parseInt(_0x15283c(0x1da))/0x8)+parseInt(_0x15283c(0x1e0))/0x9*(parseInt(_0x15283c(0x1d0))/0xa);if(_0x1d330c===_0x115775)break;else _0x3d41bc['push'](_0x3d41bc['shift']());}catch(_0x37c5b8){_0x3d41bc['push'](_0x3d41bc['shift']());}}}(a163_0x1ceb,0x52bff));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a163_0x57a5(_0x58a183,_0x41e8e4){_0x58a183=_0x58a183-0x1ca;const _0x1cebbb=a163_0x1ceb();let _0x57a547=_0x1cebbb[_0x58a183];return _0x57a547;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a163_0x508523(0x1d3),'command':'user-resolve','description':a163_0x508523(0x1d6),'risk':a163_0x508523(0x1d7),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x40394b){const _0x3eebf0=a163_0x508523;if(!_0x40394b['str'](_0x3eebf0(0x1ca))[_0x3eebf0(0x1db)]())throw CliErrors[_0x3eebf0(0x1cf)](_0x3eebf0(0x1ca),_0x3eebf0(0x1dd));},async 'execute'(_0xd99ee8){const _0x40c124=a163_0x508523,_0x5ef8d6=_0xd99ee8[_0x40c124(0x1df)](_0x40c124(0x1ca))[_0x40c124(0x1db)](),_0x2ddd7e=await resolveUserRef(_0x5ef8d6);return{'ok':!![],'data':{'user':{'userId':_0x2ddd7e[_0x40c124(0x1cc)],'username':_0x2ddd7e[_0x40c124(0x1d5)],'nickname':_0x2ddd7e[_0x40c124(0x1d8)],'matchedBy':_0x2ddd7e[_0x40c124(0x1cd)]}},'message':_0x40c124(0x1de)+_0x5ef8d6+'\x22\x20→\x20userId\x20'+_0x2ddd7e[_0x40c124(0x1cc)]};}};
@@ -1 +1 @@
1
- const a164_0x5d1975=a164_0x1329;function a164_0x1329(_0xc7b777,_0x4e392f){_0xc7b777=_0xc7b777-0x141;const _0xddcd67=a164_0xddcd();let _0x13299e=_0xddcd67[_0xc7b777];return _0x13299e;}(function(_0x1c855b,_0x3051dc){const _0x126e7c=a164_0x1329,_0x3d311b=_0x1c855b();while(!![]){try{const _0xd27e46=-parseInt(_0x126e7c(0x161))/0x1+-parseInt(_0x126e7c(0x177))/0x2+parseInt(_0x126e7c(0x141))/0x3+parseInt(_0x126e7c(0x173))/0x4+-parseInt(_0x126e7c(0x15f))/0x5+-parseInt(_0x126e7c(0x163))/0x6+parseInt(_0x126e7c(0x14d))/0x7;if(_0xd27e46===_0x3051dc)break;else _0x3d311b['push'](_0x3d311b['shift']());}catch(_0x59e745){_0x3d311b['push'](_0x3d311b['shift']());}}}(a164_0xddcd,0xbec0e));function a164_0xddcd(){const _0x16b189=['slice','169060ZzFCOZ','\x20run\x20','834142JorkhT','build','2069382zHROGq','(none)','utf-8','bool','package.json','bun.lock','scripts','dev','keys','args','\x20run\x20build','bun.lockb','Enable\x20watch\x20mode\x20for\x20preview','inherit','\x0a\x20\x20Available\x20scripts:\x0a','\x0a\x20\x20Usage:\x20','6190292tValVr','\x20\x20\x20\x20','preview','Run\x20a\x20package.json\x20script','2332784TXFTyh','.bin','join','validation','No\x20scripts\x20defined\x20in\x20package.json.','needsUpgrade','pnpm','\x20run\x20start','257724Avdikw','\x20exited\x20with\x20code\x20','length','watch','boolean','Script\x20\x22','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','yarn','close','error','has','parse','10689616etECot','\x20run\x20<script>\x0a','pnpm-lock.yaml','push','No\x20package.json\x20found\x20in\x20current\x20directory.','Available:\x20','vite\x20preview\x20exited\x20with\x20code\x20','\x20run\x20preview\x20--watch','yarn.lock','script','vite','\x20run\x20preview','cwd','--watch','node_modules','run','log'];a164_0xddcd=function(){return _0x16b189;};return a164_0xddcd();}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',a164_0x5d1975(0x16a)]);function readPackageScripts(_0x6dd840){const _0x76a26a=a164_0x5d1975,_0x8e4e7b=resolve(_0x6dd840,_0x76a26a(0x167));if(!existsSync(_0x8e4e7b))return null;try{const _0x4a92f3=JSON[_0x76a26a(0x14c)](readFileSync(_0x8e4e7b,_0x76a26a(0x165)));return _0x4a92f3[_0x76a26a(0x169)]??{};}catch{return null;}}function detectPackageManager(_0x1bad56){const _0x4cf946=a164_0x5d1975;if(existsSync(resolve(_0x1bad56,_0x4cf946(0x16e)))||existsSync(resolve(_0x1bad56,_0x4cf946(0x168))))return'bun';if(existsSync(resolve(_0x1bad56,_0x4cf946(0x14f))))return _0x4cf946(0x17d);if(existsSync(resolve(_0x1bad56,_0x4cf946(0x155))))return _0x4cf946(0x148);return'npm';}async function versionCheck(_0x21a6cd){const _0x2fc29e=a164_0x5d1975,_0x3df2e5=await checkCliVersion();(_0x3df2e5[_0x2fc29e(0x17c)]||_0x3df2e5['belowMinimum'])&&(printCliUpgradeWarning(_0x3df2e5),assertCliVersionSupported(_0x3df2e5));const _0x13e61d=await checkSdkVersion(_0x21a6cd);if(_0x13e61d[_0x2fc29e(0x17c)])printSdkUpgradeWarning(_0x13e61d);}function spawnScript(_0x5118c1,_0x4e4f04,_0x2467ea,_0xc0991f){return new Promise((_0x4e52b4,_0x5cc8ff)=>{const _0x411375=a164_0x1329,_0x2f87a8=[_0x411375(0x15c),_0x4e4f04,..._0x2467ea],_0x2d68b7=spawn(_0x5118c1,_0x2f87a8,{'cwd':_0xc0991f,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0xc0991f,_0x411375(0x15b),_0x411375(0x178))+delimiter+process.env.PATH}});_0x2d68b7['on'](_0x411375(0x149),_0xa5cc8=>{const _0x337133=_0x411375;if(_0xa5cc8===0x0||_0xa5cc8===null)_0x4e52b4();else _0x5cc8ff(new Error(_0x5118c1+_0x337133(0x160)+_0x4e4f04+_0x337133(0x142)+_0xa5cc8));}),_0x2d68b7['on']('error',_0x5cc8ff);});}function spawnViteBuildWatch(_0x2d7883){return new Promise((_0x26c13,_0x4bd4c3)=>{const _0x1b8711=a164_0x1329,_0x2717cf=spawn('vite',[_0x1b8711(0x162),_0x1b8711(0x15a)],{'cwd':_0x2d7883,'stdio':_0x1b8711(0x170),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2d7883,_0x1b8711(0x15b),_0x1b8711(0x178))+delimiter+process.env.PATH}});_0x2717cf['on'](_0x1b8711(0x149),_0x35f558=>{const _0x49e7f0=_0x1b8711;if(_0x35f558===0x0||_0x35f558===null)_0x26c13();else _0x4bd4c3(new Error(_0x49e7f0(0x147)+_0x35f558));}),_0x2717cf['on']('error',_0x4bd4c3);});}function spawnVitePreview(_0x428cd9){return new Promise((_0x448bb5,_0x23dd5f)=>{const _0x5526a5=a164_0x1329,_0x437f5b=spawn(_0x5526a5(0x157),[_0x5526a5(0x175)],{'cwd':_0x428cd9,'stdio':_0x5526a5(0x170),'shell':!![],'env':{...process.env,'PATH':''+join(_0x428cd9,_0x5526a5(0x15b),_0x5526a5(0x178))+delimiter+process.env.PATH}});_0x437f5b['on'](_0x5526a5(0x149),_0x4e74d3=>{const _0x1de5ac=_0x5526a5;if(_0x4e74d3===0x0||_0x4e74d3===null)_0x448bb5();else _0x23dd5f(new Error(_0x1de5ac(0x153)+_0x4e74d3));}),_0x437f5b['on'](_0x5526a5(0x14a),_0x23dd5f);});}const runFlags=[{'name':a164_0x5d1975(0x144),'type':a164_0x5d1975(0x145),'description':a164_0x5d1975(0x16f),'default':![]}];export const runDefinition={'service':a164_0x5d1975(0x15c),'command':'run','description':a164_0x5d1975(0x176),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a164_0x5d1975(0x156),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4c4d03=a164_0x5d1975,_0x222629=[];return _0x222629[_0x4c4d03(0x150)]('\x20\x20EXAMPLES'),_0x222629[_0x4c4d03(0x150)](_0x4c4d03(0x174)+CLI_BIN_NAME+_0x4c4d03(0x17e)),_0x222629[_0x4c4d03(0x150)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4c4d03(0x16d)),_0x222629['push'](_0x4c4d03(0x174)+CLI_BIN_NAME+_0x4c4d03(0x158)),_0x222629['push'](_0x4c4d03(0x174)+CLI_BIN_NAME+_0x4c4d03(0x154)),_0x222629[_0x4c4d03(0x179)]('\x0a');},async 'execute'(_0x50f6a1){const _0x115fa8=a164_0x5d1975,_0x102d5a=process[_0x115fa8(0x159)](),_0x339e16=_0x50f6a1[_0x115fa8(0x16c)][0x0],_0x198f84=_0x50f6a1[_0x115fa8(0x16c)][_0x115fa8(0x15e)](0x1),_0x473401=readPackageScripts(_0x102d5a);if(!_0x473401)throw CliErrors[_0x115fa8(0x17a)](_0x115fa8(0x151));if(!_0x339e16){const _0x3a3586=Object[_0x115fa8(0x16b)](_0x473401);if(_0x3a3586[_0x115fa8(0x143)]===0x0)console[_0x115fa8(0x15d)](_0x115fa8(0x17b));else{console[_0x115fa8(0x15d)](_0x115fa8(0x171));for(const _0x305260 of _0x3a3586){console[_0x115fa8(0x15d)](_0x115fa8(0x174)+_0x305260);}console[_0x115fa8(0x15d)](_0x115fa8(0x172)+CLI_BIN_NAME+_0x115fa8(0x14e));}return{'ok':!![]};}if(!_0x473401[_0x339e16])throw CliErrors['validation'](_0x115fa8(0x146)+_0x339e16+'\x22\x20not\x20found\x20in\x20package.json.',_0x115fa8(0x152)+(Object[_0x115fa8(0x16b)](_0x473401)[_0x115fa8(0x179)](',\x20')||_0x115fa8(0x164)));const _0x3d0127=detectPackageManager(_0x102d5a);VERSION_CHECK_SCRIPTS[_0x115fa8(0x14b)](_0x339e16)&&await versionCheck(_0x102d5a);if(_0x339e16===_0x115fa8(0x175)&&_0x50f6a1[_0x115fa8(0x166)]('watch'))return await Promise['all']([spawnViteBuildWatch(_0x102d5a),spawnVitePreview(_0x102d5a)]),{'ok':!![]};return await spawnScript(_0x3d0127,_0x339e16,_0x198f84,_0x102d5a),{'ok':!![]};}};
1
+ const a164_0x2715bd=a164_0x5cca;(function(_0x4b660d,_0x177eda){const _0x5a7242=a164_0x5cca,_0x19710d=_0x4b660d();while(!![]){try{const _0x5af1e7=parseInt(_0x5a7242(0x1f8))/0x1*(parseInt(_0x5a7242(0x215))/0x2)+parseInt(_0x5a7242(0x211))/0x3+parseInt(_0x5a7242(0x219))/0x4+parseInt(_0x5a7242(0x22d))/0x5*(-parseInt(_0x5a7242(0x214))/0x6)+parseInt(_0x5a7242(0x20c))/0x7+-parseInt(_0x5a7242(0x208))/0x8*(-parseInt(_0x5a7242(0x212))/0x9)+parseInt(_0x5a7242(0x220))/0xa*(-parseInt(_0x5a7242(0x1fa))/0xb);if(_0x5af1e7===_0x177eda)break;else _0x19710d['push'](_0x19710d['shift']());}catch(_0x417b4c){_0x19710d['push'](_0x19710d['shift']());}}}(a164_0x1212,0xd497e));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';function a164_0x1212(){const _0x19fb1d=['watch','npm','7665785yPvdgp','read','bun.lockb','run','\x20run\x20','Script\x20\x22','yarn','vite','package.json','\x20run\x20preview\x20--watch','start','\x20\x20\x20\x20','2zfrsPU','log','3839xDCOdr','.bin','validation','No\x20package.json\x20found\x20in\x20current\x20directory.','boolean','Script\x20name\x20defined\x20in\x20package.json','all','bool','cwd','\x20run\x20<script>\x0a','inherit','\x20\x20EXAMPLES','has','script','818952LzZkIX','error','vite\x20preview\x20exited\x20with\x20code\x20','join','3035480XxxlOO','slice','pnpm','utf-8','bun.lock','2331828HEqUyu','135AfDWjQ','\x22\x20not\x20found\x20in\x20package.json.','6IkQaSD','135654oLQDUy','bun','node_modules','keys','4778364lOxWZx','needsUpgrade','yarn.lock','scripts','close','\x20run\x20build','No\x20scripts\x20defined\x20in\x20package.json.','47930VHIdvi','args','push','parse','Run\x20a\x20package.json\x20script','\x20run\x20preview','--watch','preview','length','build','\x0a\x20\x20Usage:\x20'];a164_0x1212=function(){return _0x19fb1d;};return a164_0x1212();}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([a164_0x2715bd(0x1f6),'dev']);function readPackageScripts(_0x2c96ae){const _0x5a005f=a164_0x2715bd,_0x9297d5=resolve(_0x2c96ae,_0x5a005f(0x1f4));if(!existsSync(_0x9297d5))return null;try{const _0x5523f6=JSON[_0x5a005f(0x223)](readFileSync(_0x9297d5,_0x5a005f(0x20f)));return _0x5523f6[_0x5a005f(0x21c)]??{};}catch{return null;}}function detectPackageManager(_0x3e4225){const _0xbb6aaa=a164_0x2715bd;if(existsSync(resolve(_0x3e4225,_0xbb6aaa(0x22f)))||existsSync(resolve(_0x3e4225,_0xbb6aaa(0x210))))return _0xbb6aaa(0x216);if(existsSync(resolve(_0x3e4225,'pnpm-lock.yaml')))return _0xbb6aaa(0x20e);if(existsSync(resolve(_0x3e4225,_0xbb6aaa(0x21b))))return _0xbb6aaa(0x1f2);return _0xbb6aaa(0x22c);}async function versionCheck(_0xdd0a5d){const _0x430a93=a164_0x2715bd,_0x14fa0c=await checkCliVersion();(_0x14fa0c[_0x430a93(0x21a)]||_0x14fa0c['belowMinimum'])&&(printCliUpgradeWarning(_0x14fa0c),assertCliVersionSupported(_0x14fa0c));const _0x277e3b=await checkSdkVersion(_0xdd0a5d);if(_0x277e3b[_0x430a93(0x21a)])printSdkUpgradeWarning(_0x277e3b);}function spawnScript(_0x5b3ba5,_0x520939,_0x48855a,_0x211087){return new Promise((_0x3a44e,_0x4eb2fd)=>{const _0x4c5a28=a164_0x5cca,_0x284b9e=[_0x4c5a28(0x230),_0x520939,..._0x48855a],_0x507cc6=spawn(_0x5b3ba5,_0x284b9e,{'cwd':_0x211087,'stdio':_0x4c5a28(0x204),'shell':!![],'env':{...process.env,'PATH':''+join(_0x211087,_0x4c5a28(0x217),_0x4c5a28(0x1fb))+delimiter+process.env.PATH}});_0x507cc6['on'](_0x4c5a28(0x21d),_0x4feacd=>{const _0x1d0248=_0x4c5a28;if(_0x4feacd===0x0||_0x4feacd===null)_0x3a44e();else _0x4eb2fd(new Error(_0x5b3ba5+_0x1d0248(0x1f0)+_0x520939+'\x20exited\x20with\x20code\x20'+_0x4feacd));}),_0x507cc6['on'](_0x4c5a28(0x209),_0x4eb2fd);});}function spawnViteBuildWatch(_0x2343f8){return new Promise((_0x177915,_0x56d906)=>{const _0x4cef84=a164_0x5cca,_0x49a3c9=spawn(_0x4cef84(0x1f3),[_0x4cef84(0x229),_0x4cef84(0x226)],{'cwd':_0x2343f8,'stdio':_0x4cef84(0x204),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2343f8,_0x4cef84(0x217),_0x4cef84(0x1fb))+delimiter+process.env.PATH}});_0x49a3c9['on']('close',_0x5bcb78=>{if(_0x5bcb78===0x0||_0x5bcb78===null)_0x177915();else _0x56d906(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x5bcb78));}),_0x49a3c9['on'](_0x4cef84(0x209),_0x56d906);});}function spawnVitePreview(_0xcc8f88){return new Promise((_0x105d6b,_0x528420)=>{const _0x4fd40d=a164_0x5cca,_0x2dca3f=spawn(_0x4fd40d(0x1f3),[_0x4fd40d(0x227)],{'cwd':_0xcc8f88,'stdio':_0x4fd40d(0x204),'shell':!![],'env':{...process.env,'PATH':''+join(_0xcc8f88,_0x4fd40d(0x217),_0x4fd40d(0x1fb))+delimiter+process.env.PATH}});_0x2dca3f['on'](_0x4fd40d(0x21d),_0x3a78a4=>{const _0x42b55d=_0x4fd40d;if(_0x3a78a4===0x0||_0x3a78a4===null)_0x105d6b();else _0x528420(new Error(_0x42b55d(0x20a)+_0x3a78a4));}),_0x2dca3f['on'](_0x4fd40d(0x209),_0x528420);});}function a164_0x5cca(_0x19bbb4,_0x4649b1){_0x19bbb4=_0x19bbb4-0x1f0;const _0x12127b=a164_0x1212();let _0x5ccaea=_0x12127b[_0x19bbb4];return _0x5ccaea;}const runFlags=[{'name':a164_0x2715bd(0x22b),'type':a164_0x2715bd(0x1fe),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a164_0x2715bd(0x230),'command':a164_0x2715bd(0x230),'description':a164_0x2715bd(0x224),'risk':a164_0x2715bd(0x22e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a164_0x2715bd(0x207),'description':a164_0x2715bd(0x1ff),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x5db40d=a164_0x2715bd,_0x3ab513=[];return _0x3ab513[_0x5db40d(0x222)](_0x5db40d(0x205)),_0x3ab513[_0x5db40d(0x222)](_0x5db40d(0x1f7)+CLI_BIN_NAME+'\x20run\x20start'),_0x3ab513[_0x5db40d(0x222)](_0x5db40d(0x1f7)+CLI_BIN_NAME+_0x5db40d(0x21e)),_0x3ab513['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x5db40d(0x225)),_0x3ab513['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x5db40d(0x1f5)),_0x3ab513[_0x5db40d(0x20b)]('\x0a');},async 'execute'(_0x3ba6ae){const _0x431eb8=a164_0x2715bd,_0x2b8a17=process[_0x431eb8(0x202)](),_0x39bbc8=_0x3ba6ae[_0x431eb8(0x221)][0x0],_0x16d09b=_0x3ba6ae[_0x431eb8(0x221)][_0x431eb8(0x20d)](0x1),_0x3626b1=readPackageScripts(_0x2b8a17);if(!_0x3626b1)throw CliErrors[_0x431eb8(0x1fc)](_0x431eb8(0x1fd));if(!_0x39bbc8){const _0x302885=Object[_0x431eb8(0x218)](_0x3626b1);if(_0x302885[_0x431eb8(0x228)]===0x0)console[_0x431eb8(0x1f9)](_0x431eb8(0x21f));else{console['log']('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x127016 of _0x302885){console[_0x431eb8(0x1f9)](_0x431eb8(0x1f7)+_0x127016);}console['log'](_0x431eb8(0x22a)+CLI_BIN_NAME+_0x431eb8(0x203));}return{'ok':!![]};}if(!_0x3626b1[_0x39bbc8])throw CliErrors[_0x431eb8(0x1fc)](_0x431eb8(0x1f1)+_0x39bbc8+_0x431eb8(0x213),'Available:\x20'+(Object[_0x431eb8(0x218)](_0x3626b1)[_0x431eb8(0x20b)](',\x20')||'(none)'));const _0x324d7a=detectPackageManager(_0x2b8a17);VERSION_CHECK_SCRIPTS[_0x431eb8(0x206)](_0x39bbc8)&&await versionCheck(_0x2b8a17);if(_0x39bbc8===_0x431eb8(0x227)&&_0x3ba6ae[_0x431eb8(0x201)](_0x431eb8(0x22b)))return await Promise[_0x431eb8(0x200)]([spawnViteBuildWatch(_0x2b8a17),spawnVitePreview(_0x2b8a17)]),{'ok':!![]};return await spawnScript(_0x324d7a,_0x39bbc8,_0x16d09b,_0x2b8a17),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a165_0x22be50=a165_0x5891;(function(_0x4cc3fa,_0x5dded1){const _0x9b8c71=a165_0x5891,_0x3534c3=_0x4cc3fa();while(!![]){try{const _0x12cf06=parseInt(_0x9b8c71(0x16c))/0x1*(parseInt(_0x9b8c71(0x16b))/0x2)+-parseInt(_0x9b8c71(0x171))/0x3+parseInt(_0x9b8c71(0x176))/0x4*(parseInt(_0x9b8c71(0x177))/0x5)+parseInt(_0x9b8c71(0x172))/0x6*(-parseInt(_0x9b8c71(0x175))/0x7)+-parseInt(_0x9b8c71(0x173))/0x8*(parseInt(_0x9b8c71(0x169))/0x9)+-parseInt(_0x9b8c71(0x16e))/0xa+parseInt(_0x9b8c71(0x174))/0xb;if(_0x12cf06===_0x5dded1)break;else _0x3534c3['push'](_0x3534c3['shift']());}catch(_0x326b6a){_0x3534c3['push'](_0x3534c3['shift']());}}}(a165_0x4f56,0x4e59d));function a165_0x4f56(){const _0x20b89d=['read','Export\x20machine-readable\x20command\x20schema\x20(JSON)','1446714gBLNuT','2758764cnjHtY','4648rwKpyI','12916552MxQksc','7HiHUNb','4dnBPyD','2251445genCGm','5760rqWYgH','schema','307206jXqMiq','1XbXbOw','json','1433270gDlYEZ'];a165_0x4f56=function(){return _0x20b89d;};return a165_0x4f56();}import{buildSchemaPayload}from'../framework/schema-export.js';function a165_0x5891(_0x595afa,_0x3d306a){_0x595afa=_0x595afa-0x169;const _0x4f5678=a165_0x4f56();let _0x589159=_0x4f5678[_0x595afa];return _0x589159;}async function execute(_0x109a2c){const _0x31020f=await buildSchemaPayload();return{'ok':!![],'data':_0x31020f};}export const schemaDefinition={'service':a165_0x22be50(0x16a),'command':'export','description':a165_0x22be50(0x170),'risk':a165_0x22be50(0x16f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a165_0x22be50(0x16d),'flags':[],'execute':execute};
1
+ function a165_0x45e2(){const _0x251ef8=['1203MicRXw','6JFjDTH','3020SKKgcr','2348BFrKRR','93311DyFcEm','export','50GvFOPc','799371RgROQx','432idoPpU','8393XojbEU','4542wooWra','1608xERxYe','read','json','4174874YYhDNY','151645yNvJZC','schema'];a165_0x45e2=function(){return _0x251ef8;};return a165_0x45e2();}const a165_0xbbc06a=a165_0x20c0;(function(_0x147ed2,_0x44e8ae){const _0x53979e=a165_0x20c0,_0x54b7e7=_0x147ed2();while(!![]){try{const _0x4a38cf=parseInt(_0x53979e(0x92))/0x1*(parseInt(_0x53979e(0x8f))/0x2)+-parseInt(_0x53979e(0x8e))/0x3*(-parseInt(_0x53979e(0x91))/0x4)+parseInt(_0x53979e(0x90))/0x5*(parseInt(_0x53979e(0x98))/0x6)+parseInt(_0x53979e(0x97))/0x7*(-parseInt(_0x53979e(0x99))/0x8)+-parseInt(_0x53979e(0x95))/0x9*(parseInt(_0x53979e(0x94))/0xa)+parseInt(_0x53979e(0x9c))/0xb+parseInt(_0x53979e(0x96))/0xc*(-parseInt(_0x53979e(0x9d))/0xd);if(_0x4a38cf===_0x44e8ae)break;else _0x54b7e7['push'](_0x54b7e7['shift']());}catch(_0x3bd5eb){_0x54b7e7['push'](_0x54b7e7['shift']());}}}(a165_0x45e2,0x3c508));import{buildSchemaPayload}from'../framework/schema-export.js';function a165_0x20c0(_0x2f9197,_0x36e225){_0x2f9197=_0x2f9197-0x8e;const _0x45e23f=a165_0x45e2();let _0x20c065=_0x45e23f[_0x2f9197];return _0x20c065;}async function execute(_0x1b9e2d){const _0x45c9ad=await buildSchemaPayload();return{'ok':!![],'data':_0x45c9ad};}export const schemaDefinition={'service':a165_0xbbc06a(0x9e),'command':a165_0xbbc06a(0x93),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a165_0xbbc06a(0x9a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a165_0xbbc06a(0x9b),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a166_0x2f9a5d=a166_0x4af8;(function(_0x42b0b1,_0x59c406){const _0x291c15=a166_0x4af8,_0x508d49=_0x42b0b1();while(!![]){try{const _0x20ceee=parseInt(_0x291c15(0x1d7))/0x1+-parseInt(_0x291c15(0x1df))/0x2+parseInt(_0x291c15(0x1eb))/0x3*(parseInt(_0x291c15(0x1dd))/0x4)+-parseInt(_0x291c15(0x1cc))/0x5*(-parseInt(_0x291c15(0x1de))/0x6)+parseInt(_0x291c15(0x1e2))/0x7*(-parseInt(_0x291c15(0x1c5))/0x8)+-parseInt(_0x291c15(0x1c6))/0x9*(parseInt(_0x291c15(0x1d1))/0xa)+parseInt(_0x291c15(0x1ef))/0xb;if(_0x20ceee===_0x59c406)break;else _0x508d49['push'](_0x508d49['shift']());}catch(_0x350aae){_0x508d49['push'](_0x508d49['shift']());}}}(a166_0xce5c,0x3ec03));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';function a166_0xce5c(){const _0x5050e8=['dbId\x20不能为空','137187hUAMLJ','sqlCode','length','stringify','2010305mkaoXI','catch','appCode','lockFilePath','number','Invalid\x20database\x20selection\x20payload:\x20','mybatisXml','✎\x20手动输入\x20dbId','sql','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','dbId','Local\x20SQL\x20file\x20mode','string','str','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','dbId\x20必须为正整数','flagMissing','high-risk-write','Target\x20database\x20ID','parse','name','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','new','lastSync','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','sqlRoot','263832cTSFAT','36OEQhxK','utf8','isFinite','sqlRootDir','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','map','25WSMsZI','/smartapi/custom/saveUserCustomSql','toISOString','适合带动态标签的\x20MyBatis\x20XML\x20SQL','sqls','669890quevjM','POST','join','请选择目标数据库:','sqlName','mode','189711ARXvQc','create','trim','请选择本地\x20SQL\x20模式:','dbName','Created\x20SQL\x20query\x20','8fshPfN','121776FrndCm','14884pNuSSS','MyBatis\x20XML(mybatisXml)','isInteger','7dyFwWK','db-id','SQL\x20query\x20display\x20name','普通\x20SQL(sql)','SQL\x20名称不能为空','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','nonInteractive','请输入目标数据库\x20dbId:'];a166_0xce5c=function(){return _0x5050e8;};return a166_0xce5c();}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x2885b2){const _0x2c12af=a166_0x4af8;if(_0x2885b2==='mybatisXml')return[_0x2c12af(0x1c0),'\x20\x20SELECT\x201\x20AS\x20id','</select>',''][_0x2c12af(0x1d3)]('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x2c12af(0x1d3)]('\x0a');}export const sqlCreate={'service':a166_0x2f9a5d(0x1b2),'command':a166_0x2f9a5d(0x1d8),'description':a166_0x2f9a5d(0x1e7),'risk':a166_0x2f9a5d(0x1bc),'flags':[{'name':a166_0x2f9a5d(0x1bf),'type':a166_0x2f9a5d(0x1b6),'description':a166_0x2f9a5d(0x1e4)},{'name':a166_0x2f9a5d(0x1e3),'type':a166_0x2f9a5d(0x1ae),'description':a166_0x2f9a5d(0x1bd)},{'name':a166_0x2f9a5d(0x1d6),'type':a166_0x2f9a5d(0x1b6),'enum':[a166_0x2f9a5d(0x1b2),a166_0x2f9a5d(0x1b0)],'description':a166_0x2f9a5d(0x1b5)}],async 'validate'(_0xaffaf8){const _0x55f90a=a166_0x2f9a5d;if(!_0xaffaf8[_0x55f90a(0x1e8)])return;if(!_0xaffaf8['str']('name')[_0x55f90a(0x1d9)]())throw CliErrors[_0x55f90a(0x1bb)](_0x55f90a(0x1bf),_0x55f90a(0x1b9));const _0x4b0294=resolveProvidedDbId(_0xaffaf8);if(typeof _0x4b0294!==_0x55f90a(0x1ae)||!Number[_0x55f90a(0x1c8)](_0x4b0294)||_0x4b0294<=0x0)throw CliErrors['flagMissing'](_0x55f90a(0x1e3),_0x55f90a(0x1ca));if(!_0xaffaf8[_0x55f90a(0x1b7)](_0x55f90a(0x1d6))['trim']())throw CliErrors[_0x55f90a(0x1bb)](_0x55f90a(0x1d6),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x3e4484){const _0xf9549f=a166_0x2f9a5d,_0x7f63db=loadSqlProjectConfig(_0x3e4484[_0xf9549f(0x1f1)]),{sqlName:_0x394d52,dbId:_0x2f9ab8,dbName:_0x4dab4e,mode:_0x3cad3a}=await resolveSqlNewInputs(_0x3e4484),_0xcbf286=buildSqlRelativePath('<server-generated-sqlCode>',_0x394d52,_0x4dab4e,_0x3cad3a,_0x2f9ab8),_0xb2ea99=_0x7f63db[_0xf9549f(0x1c9)]+'/'+_0xcbf286;return{'method':_0xf9549f(0x1d2),'url':_0xf9549f(0x1cd),'body':{'appCode':_0x3e4484['appCode'],'sqlName':_0x394d52,'dbId':_0x2f9ab8,'mode':_0x3cad3a,'localPath':_0xb2ea99},'description':_0xf9549f(0x1b3)+_0x7f63db['sqlRootDir']};},async 'execute'(_0x3b18b8){const _0x34e1ef=a166_0x2f9a5d,_0x4d2ab9=loadSqlProjectConfig(_0x3b18b8['appCode']),{sqlName:_0x34a6a5,dbId:_0x451410,dbName:_0x2b814f,mode:_0x49b21b}=await resolveSqlNewInputs(_0x3b18b8),_0x3d4e71=generateSqlTemplate(_0x49b21b),_0x2ee68d=await createSqlQuery({'appCode':_0x3b18b8[_0x34e1ef(0x1f1)],'sqlName':_0x34a6a5,'dbId':_0x451410,'sqlContent':_0x3d4e71}),_0x29fd60=ensureRemoteSqlContent(_0x2ee68d),_0xfb791b=_0x2b814f||await getDbName(_0x3b18b8[_0x34e1ef(0x1f1)],_0x451410)[_0x34e1ef(0x1f0)](()=>undefined),_0x5cd25b=buildSqlRelativePath(_0x2ee68d[_0x34e1ef(0x1ec)],_0x2ee68d[_0x34e1ef(0x1d5)],_0xfb791b,_0x49b21b,_0x451410),_0x53d85e=_0x4d2ab9[_0x34e1ef(0x1c9)]+'/'+_0x5cd25b,_0x441930=buildLocalSqlFileContent({'sqlCode':_0x2ee68d['sqlCode'],'sqlName':_0x2ee68d['sqlName'],'dbId':_0x2ee68d[_0x34e1ef(0x1b4)]},_0x29fd60,{'dbName':_0xfb791b,'mode':_0x49b21b,'syncedAt':new Date()[_0x34e1ef(0x1ce)](),'description':_0x2ee68d['description']});if(await fileExists(_0x53d85e))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x53d85e);await ensureParentDirectory(_0x53d85e),await writeFile(_0x53d85e,_0x441930,_0x34e1ef(0x1c7));const _0x11d5c5=await readSqlLockFile(_0x4d2ab9[_0x34e1ef(0x1ad)]),{lockData:_0x5bc5b3,appLock:_0x5dbc93}=ensureSqlLockScope(_0x11d5c5??createEmptySqlLock(),_0x4d2ab9[_0x34e1ef(0x1f1)],_0x4d2ab9[_0x34e1ef(0x1c4)],_0x34e1ef(0x1c1));return _0x5dbc93[_0x34e1ef(0x1d0)][_0x2ee68d[_0x34e1ef(0x1ec)]]={...buildSqlLockEntry(_0x2ee68d,_0x29fd60,computeSqlContentHash(_0x441930),{'dbName':_0xfb791b}),'path':_0x5cd25b,'mode':_0x49b21b},_0x5dbc93[_0x34e1ef(0x1c2)]=new Date()['toISOString'](),await writeSqlLockFile(_0x4d2ab9[_0x34e1ef(0x1ad)],_0x5bc5b3),{'ok':!![],'data':{'id':_0x2ee68d['id'],'sqlCode':_0x2ee68d[_0x34e1ef(0x1ec)],'sqlName':_0x2ee68d[_0x34e1ef(0x1d5)],'dbId':_0x2ee68d[_0x34e1ef(0x1b4)],'path':_0x53d85e,'mode':_0x49b21b},'message':_0x34e1ef(0x1dc)+_0x2ee68d[_0x34e1ef(0x1ec)]};}};async function resolveSqlNewInputs(_0x3f4f7b){const _0x1a8910=await resolveSqlNameInput(_0x3f4f7b),{dbId:_0x5510f2,dbName:_0x1eeddf}=await resolveDbSelection(_0x3f4f7b),_0x1aab62=await resolveSqlModeInput(_0x3f4f7b);return{'sqlName':_0x1a8910,'dbId':_0x5510f2,'dbName':_0x1eeddf,'mode':_0x1aab62};}function a166_0x4af8(_0x230288,_0x5d76cc){_0x230288=_0x230288-0x1ad;const _0xce5c5a=a166_0xce5c();let _0x4af862=_0xce5c5a[_0x230288];return _0x4af862;}async function resolveSqlNameInput(_0x92cffd){const _0x56ca18=a166_0x2f9a5d,_0x26f80a=_0x92cffd[_0x56ca18(0x1b7)](_0x56ca18(0x1bf))[_0x56ca18(0x1d9)]();if(_0x26f80a)return _0x26f80a;if(_0x92cffd[_0x56ca18(0x1e8)])throw CliErrors[_0x56ca18(0x1bb)](_0x56ca18(0x1bf),_0x56ca18(0x1b9));return(await input({'message':'请输入\x20SQL\x20名称:','validate':_0x115d04=>_0x115d04[_0x56ca18(0x1d9)]()?!![]:_0x56ca18(0x1e6)}))['trim']();}async function resolveDbSelection(_0x2a4312){const _0x2b8fc5=a166_0x2f9a5d,_0x3422f8=resolveProvidedDbId(_0x2a4312);if(typeof _0x3422f8==='number'&&Number['isFinite'](_0x3422f8)&&_0x3422f8>0x0)return{'dbId':_0x3422f8,'dbName':await getDbName(_0x2a4312['appCode'],_0x3422f8)[_0x2b8fc5(0x1f0)](()=>undefined)};if(_0x2a4312[_0x2b8fc5(0x1e8)])throw CliErrors[_0x2b8fc5(0x1bb)]('db-id',_0x2b8fc5(0x1ca));const _0x11d18a=await listDatabases(_0x2a4312[_0x2b8fc5(0x1f1)])[_0x2b8fc5(0x1f0)](()=>[]);if(_0x11d18a['length']===0x1)return{'dbId':_0x11d18a[0x0]['dbId'],'dbName':_0x11d18a[0x0]['dbName']};if(_0x11d18a[_0x2b8fc5(0x1ed)]>0x1){const _0x489d99=await select({'message':_0x2b8fc5(0x1d4),'choices':[..._0x11d18a[_0x2b8fc5(0x1cb)](_0x10cc5f=>({'name':_0x10cc5f[_0x2b8fc5(0x1db)]+'\x20('+_0x10cc5f[_0x2b8fc5(0x1b4)]+')','value':serializeDbSelection(_0x10cc5f)})),{'name':_0x2b8fc5(0x1b1),'value':'__manual__'}]});if(_0x489d99!=='__manual__')return deserializeDbSelection(_0x489d99);}const _0x281155=await input({'message':_0x2b8fc5(0x1e9),'validate':_0x3a04ba=>{const _0x5491b5=_0x2b8fc5,_0x2def22=_0x3a04ba[_0x5491b5(0x1d9)]();if(!_0x2def22)return _0x5491b5(0x1ea);const _0x532984=Number(_0x2def22);if(!Number[_0x5491b5(0x1e1)](_0x532984)||_0x532984<=0x0)return _0x5491b5(0x1ba);return!![];}});return{'dbId':Number(_0x281155[_0x2b8fc5(0x1d9)]())};}async function resolveSqlModeInput(_0xbcf81c){const _0x4d8106=a166_0x2f9a5d,_0x1af10e=_0xbcf81c['str'](_0x4d8106(0x1d6))['trim']();if(_0x1af10e===_0x4d8106(0x1b2)||_0x1af10e==='mybatisXml')return _0x1af10e;if(_0xbcf81c['nonInteractive'])throw CliErrors[_0x4d8106(0x1bb)]('mode',_0x4d8106(0x1b8));return await select({'message':_0x4d8106(0x1da),'choices':[{'name':_0x4d8106(0x1e5),'value':_0x4d8106(0x1b2),'description':_0x4d8106(0x1c3)},{'name':_0x4d8106(0x1e0),'value':'mybatisXml','description':_0x4d8106(0x1cf)}]});}function serializeDbSelection(_0x4bbd88){const _0xd90419=a166_0x2f9a5d;return JSON[_0xd90419(0x1ee)]({'dbId':_0x4bbd88[_0xd90419(0x1b4)],'dbName':_0x4bbd88[_0xd90419(0x1db)]});}function deserializeDbSelection(_0xfd6823){const _0xb38fcf=a166_0x2f9a5d;try{const _0x3e523b=JSON[_0xb38fcf(0x1be)](_0xfd6823);if(typeof _0x3e523b[_0xb38fcf(0x1b4)]==='number'&&Number[_0xb38fcf(0x1c8)](_0x3e523b['dbId']))return{'dbId':_0x3e523b[_0xb38fcf(0x1b4)],'dbName':_0x3e523b[_0xb38fcf(0x1db)]};}catch{}throw CliErrors['validation'](_0xb38fcf(0x1af)+_0xfd6823);}function resolveProvidedDbId(_0xa87c12){const _0x47140f=a166_0x2f9a5d,_0x2e496f=_0xa87c12['flag'](_0x47140f(0x1e3));if(typeof _0x2e496f===_0x47140f(0x1ae)&&Number[_0x47140f(0x1c8)](_0x2e496f))return _0x2e496f;return undefined;}
1
+ const a166_0x23d486=a166_0x4105;(function(_0x455a02,_0x446fc8){const _0x36a101=a166_0x4105,_0x3b47ee=_0x455a02();while(!![]){try{const _0x2cc04d=parseInt(_0x36a101(0x1fb))/0x1+-parseInt(_0x36a101(0x1e9))/0x2+-parseInt(_0x36a101(0x1f7))/0x3+parseInt(_0x36a101(0x1fa))/0x4*(parseInt(_0x36a101(0x211))/0x5)+-parseInt(_0x36a101(0x1e7))/0x6+-parseInt(_0x36a101(0x1e1))/0x7+-parseInt(_0x36a101(0x204))/0x8*(-parseInt(_0x36a101(0x1de))/0x9);if(_0x2cc04d===_0x446fc8)break;else _0x3b47ee['push'](_0x3b47ee['shift']());}catch(_0x27f1f0){_0x3b47ee['push'](_0x3b47ee['shift']());}}}(a166_0x2a7e,0x71ab2));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 a166_0x2a7e(){const _0x41ea6a=['--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','trim','SQL\x20query\x20display\x20name','dbName','Invalid\x20database\x20selection\x20payload:\x20','24718743DzdKYm','description','请选择本地\x20SQL\x20模式:','3650780gYqFVl','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','appCode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','dbId\x20不能为空','number','5137662TdDrPT','sqlRoot','1720700rbmHns','mode','validation','catch','str','POST','flag','isFinite','new','SQL\x20名称不能为空','/smartapi/custom/saveUserCustomSql','sql','sqlRootDir','isInteger','2132379LecfPW','flagMissing','</select>','4viZeVs','505557hcEcir','db-id','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','sqls','适合带动态标签的\x20MyBatis\x20XML\x20SQL','lastSync','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','length','MyBatis\x20XML(mybatisXml)','8SdioTY','utf8','__manual__','name','sqlCode','Target\x20database\x20ID','stringify','请输入\x20SQL\x20名称:','\x20\x20SELECT\x201\x20AS\x20id','string','Created\x20SQL\x20query\x20','请输入目标数据库\x20dbId:','lockFilePath','812310OtQQvb','mybatisXml','join','nonInteractive','sqlName','SELECT\x201\x20AS\x20id;','<server-generated-sqlCode>','toISOString','dbId'];a166_0x2a7e=function(){return _0x41ea6a;};return a166_0x2a7e();}function a166_0x4105(_0x12eef2,_0x306d00){_0x12eef2=_0x12eef2-0x1db;const _0x2a7e61=a166_0x2a7e();let _0x410524=_0x2a7e61[_0x12eef2];return _0x410524;}function generateSqlTemplate(_0x48d132){const _0x4d8331=a166_0x4105;if(_0x48d132===_0x4d8331(0x212))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x4d8331(0x20c),_0x4d8331(0x1f9),'']['join']('\x0a');return[_0x4d8331(0x216),''][_0x4d8331(0x213)]('\x0a');}export const sqlCreate={'service':'sql','command':'create','description':a166_0x23d486(0x1e2),'risk':'high-risk-write','flags':[{'name':a166_0x23d486(0x207),'type':a166_0x23d486(0x20d),'description':a166_0x23d486(0x1db)},{'name':a166_0x23d486(0x1fc),'type':a166_0x23d486(0x1e6),'description':a166_0x23d486(0x209)},{'name':a166_0x23d486(0x1ea),'type':a166_0x23d486(0x20d),'enum':[a166_0x23d486(0x1f4),a166_0x23d486(0x212)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x5d9e8d){const _0x13023c=a166_0x23d486;if(!_0x5d9e8d[_0x13023c(0x214)])return;if(!_0x5d9e8d['str'](_0x13023c(0x207))[_0x13023c(0x21b)]())throw CliErrors['flagMissing']('name',_0x13023c(0x201));const _0x27bcee=resolveProvidedDbId(_0x5d9e8d);if(typeof _0x27bcee!=='number'||!Number[_0x13023c(0x1f0)](_0x27bcee)||_0x27bcee<=0x0)throw CliErrors[_0x13023c(0x1f8)](_0x13023c(0x1fc),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x5d9e8d[_0x13023c(0x1ed)](_0x13023c(0x1ea))[_0x13023c(0x21b)]())throw CliErrors[_0x13023c(0x1f8)](_0x13023c(0x1ea),_0x13023c(0x1e4));},async 'dryRun'(_0x40d2bc){const _0x3fc550=a166_0x23d486,_0x171b29=loadSqlProjectConfig(_0x40d2bc[_0x3fc550(0x1e3)]),{sqlName:_0x1790e4,dbId:_0x45bd5f,dbName:_0x2037b6,mode:_0x350728}=await resolveSqlNewInputs(_0x40d2bc),_0x54ae31=buildSqlRelativePath(_0x3fc550(0x217),_0x1790e4,_0x2037b6,_0x350728,_0x45bd5f),_0x1c05a5=_0x171b29[_0x3fc550(0x1f5)]+'/'+_0x54ae31;return{'method':_0x3fc550(0x1ee),'url':_0x3fc550(0x1f3),'body':{'appCode':_0x40d2bc[_0x3fc550(0x1e3)],'sqlName':_0x1790e4,'dbId':_0x45bd5f,'mode':_0x350728,'localPath':_0x1c05a5},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x171b29[_0x3fc550(0x1f5)]};},async 'execute'(_0x41c191){const _0x4a3dff=a166_0x23d486,_0x2e7bac=loadSqlProjectConfig(_0x41c191[_0x4a3dff(0x1e3)]),{sqlName:_0xf571a7,dbId:_0x76761f,dbName:_0x3b5acf,mode:_0x24f56e}=await resolveSqlNewInputs(_0x41c191),_0x1a9d25=generateSqlTemplate(_0x24f56e),_0x4a64ea=await createSqlQuery({'appCode':_0x41c191[_0x4a3dff(0x1e3)],'sqlName':_0xf571a7,'dbId':_0x76761f,'sqlContent':_0x1a9d25}),_0x424d8d=ensureRemoteSqlContent(_0x4a64ea),_0x330ed4=_0x3b5acf||await getDbName(_0x41c191[_0x4a3dff(0x1e3)],_0x76761f)[_0x4a3dff(0x1ec)](()=>undefined),_0x5cf504=buildSqlRelativePath(_0x4a64ea[_0x4a3dff(0x208)],_0x4a64ea['sqlName'],_0x330ed4,_0x24f56e,_0x76761f),_0x1f741e=_0x2e7bac[_0x4a3dff(0x1f5)]+'/'+_0x5cf504,_0x1f4a36=buildLocalSqlFileContent({'sqlCode':_0x4a64ea[_0x4a3dff(0x208)],'sqlName':_0x4a64ea[_0x4a3dff(0x215)],'dbId':_0x4a64ea[_0x4a3dff(0x219)]},_0x424d8d,{'dbName':_0x330ed4,'mode':_0x24f56e,'syncedAt':new Date()[_0x4a3dff(0x218)](),'description':_0x4a64ea[_0x4a3dff(0x1df)]});if(await fileExists(_0x1f741e))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x1f741e);await ensureParentDirectory(_0x1f741e),await writeFile(_0x1f741e,_0x1f4a36,_0x4a3dff(0x205));const _0x1ad186=await readSqlLockFile(_0x2e7bac['lockFilePath']),{lockData:_0x580d22,appLock:_0x126099}=ensureSqlLockScope(_0x1ad186??createEmptySqlLock(),_0x2e7bac[_0x4a3dff(0x1e3)],_0x2e7bac[_0x4a3dff(0x1e8)],_0x4a3dff(0x1f1));return _0x126099[_0x4a3dff(0x1fe)][_0x4a64ea['sqlCode']]={...buildSqlLockEntry(_0x4a64ea,_0x424d8d,computeSqlContentHash(_0x1f4a36),{'dbName':_0x330ed4}),'path':_0x5cf504,'mode':_0x24f56e},_0x126099[_0x4a3dff(0x200)]=new Date()[_0x4a3dff(0x218)](),await writeSqlLockFile(_0x2e7bac[_0x4a3dff(0x210)],_0x580d22),{'ok':!![],'data':{'id':_0x4a64ea['id'],'sqlCode':_0x4a64ea[_0x4a3dff(0x208)],'sqlName':_0x4a64ea['sqlName'],'dbId':_0x4a64ea['dbId'],'path':_0x1f741e,'mode':_0x24f56e},'message':_0x4a3dff(0x20e)+_0x4a64ea[_0x4a3dff(0x208)]};}};async function resolveSqlNewInputs(_0x4645c2){const _0x57f053=await resolveSqlNameInput(_0x4645c2),{dbId:_0xf4f642,dbName:_0x36f70f}=await resolveDbSelection(_0x4645c2),_0x16a97a=await resolveSqlModeInput(_0x4645c2);return{'sqlName':_0x57f053,'dbId':_0xf4f642,'dbName':_0x36f70f,'mode':_0x16a97a};}async function resolveSqlNameInput(_0x436ab0){const _0x4908c8=a166_0x23d486,_0x2fdda1=_0x436ab0[_0x4908c8(0x1ed)](_0x4908c8(0x207))[_0x4908c8(0x21b)]();if(_0x2fdda1)return _0x2fdda1;if(_0x436ab0['nonInteractive'])throw CliErrors[_0x4908c8(0x1f8)]('name',_0x4908c8(0x201));return(await input({'message':_0x4908c8(0x20b),'validate':_0x3d97a0=>_0x3d97a0[_0x4908c8(0x21b)]()?!![]:_0x4908c8(0x1f2)}))[_0x4908c8(0x21b)]();}async function resolveDbSelection(_0xb01376){const _0x52c07c=a166_0x23d486,_0x247bc7=resolveProvidedDbId(_0xb01376);if(typeof _0x247bc7===_0x52c07c(0x1e6)&&Number[_0x52c07c(0x1f0)](_0x247bc7)&&_0x247bc7>0x0)return{'dbId':_0x247bc7,'dbName':await getDbName(_0xb01376[_0x52c07c(0x1e3)],_0x247bc7)[_0x52c07c(0x1ec)](()=>undefined)};if(_0xb01376['nonInteractive'])throw CliErrors[_0x52c07c(0x1f8)](_0x52c07c(0x1fc),_0x52c07c(0x21a));const _0x499f2e=await listDatabases(_0xb01376[_0x52c07c(0x1e3)])[_0x52c07c(0x1ec)](()=>[]);if(_0x499f2e[_0x52c07c(0x202)]===0x1)return{'dbId':_0x499f2e[0x0][_0x52c07c(0x219)],'dbName':_0x499f2e[0x0][_0x52c07c(0x1dc)]};if(_0x499f2e['length']>0x1){const _0x4c5a28=await select({'message':'请选择目标数据库:','choices':[..._0x499f2e['map'](_0x43f96e=>({'name':_0x43f96e[_0x52c07c(0x1dc)]+'\x20('+_0x43f96e['dbId']+')','value':serializeDbSelection(_0x43f96e)})),{'name':'✎\x20手动输入\x20dbId','value':_0x52c07c(0x206)}]});if(_0x4c5a28!==_0x52c07c(0x206))return deserializeDbSelection(_0x4c5a28);}const _0x21f16=await input({'message':_0x52c07c(0x20f),'validate':_0x2cd028=>{const _0xfa328a=_0x52c07c,_0x3e5036=_0x2cd028[_0xfa328a(0x21b)]();if(!_0x3e5036)return _0xfa328a(0x1e5);const _0x17f03b=Number(_0x3e5036);if(!Number[_0xfa328a(0x1f6)](_0x17f03b)||_0x17f03b<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x21f16['trim']())};}async function resolveSqlModeInput(_0x5e0675){const _0x487899=a166_0x23d486,_0x339961=_0x5e0675[_0x487899(0x1ed)](_0x487899(0x1ea))[_0x487899(0x21b)]();if(_0x339961===_0x487899(0x1f4)||_0x339961===_0x487899(0x212))return _0x339961;if(_0x5e0675[_0x487899(0x214)])throw CliErrors[_0x487899(0x1f8)](_0x487899(0x1ea),_0x487899(0x1e4));return await select({'message':_0x487899(0x1e0),'choices':[{'name':'普通\x20SQL(sql)','value':_0x487899(0x1f4),'description':_0x487899(0x1fd)},{'name':_0x487899(0x203),'value':_0x487899(0x212),'description':_0x487899(0x1ff)}]});}function serializeDbSelection(_0x338b74){const _0x5266a0=a166_0x23d486;return JSON[_0x5266a0(0x20a)]({'dbId':_0x338b74['dbId'],'dbName':_0x338b74[_0x5266a0(0x1dc)]});}function deserializeDbSelection(_0x21d40e){const _0xfceb8b=a166_0x23d486;try{const _0x2a2917=JSON['parse'](_0x21d40e);if(typeof _0x2a2917[_0xfceb8b(0x219)]===_0xfceb8b(0x1e6)&&Number[_0xfceb8b(0x1f0)](_0x2a2917[_0xfceb8b(0x219)]))return{'dbId':_0x2a2917[_0xfceb8b(0x219)],'dbName':_0x2a2917[_0xfceb8b(0x1dc)]};}catch{}throw CliErrors[_0xfceb8b(0x1eb)](_0xfceb8b(0x1dd)+_0x21d40e);}function resolveProvidedDbId(_0x2936ee){const _0x26ee34=a166_0x23d486,_0x50e43f=_0x2936ee[_0x26ee34(0x1ef)](_0x26ee34(0x1fc));if(typeof _0x50e43f===_0x26ee34(0x1e6)&&Number[_0x26ee34(0x1f0)](_0x50e43f))return _0x50e43f;return undefined;}
@@ -1 +1 @@
1
- const a167_0x5ef014=a167_0xb531;(function(_0x36f4da,_0x55bad1){const _0x578347=a167_0xb531,_0x405a8d=_0x36f4da();while(!![]){try{const _0x5364d2=parseInt(_0x578347(0x201))/0x1+-parseInt(_0x578347(0x1dd))/0x2+-parseInt(_0x578347(0x1f0))/0x3*(parseInt(_0x578347(0x1de))/0x4)+parseInt(_0x578347(0x1fc))/0x5+-parseInt(_0x578347(0x1ea))/0x6+parseInt(_0x578347(0x1e2))/0x7+parseInt(_0x578347(0x1e6))/0x8*(parseInt(_0x578347(0x1e5))/0x9);if(_0x5364d2===_0x55bad1)break;else _0x405a8d['push'](_0x405a8d['shift']());}catch(_0x79c9cf){_0x405a8d['push'](_0x405a8d['shift']());}}}(a167_0x4cae,0x90b1c));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';function a167_0xb531(_0x2cadee,_0x148afc){_0x2cadee=_0x2cadee-0x1dd;const _0x4cae1d=a167_0x4cae();let _0xb531ca=_0x4cae1d[_0x2cadee];return _0xb531ca;}import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';function a167_0x4cae(){const _0x212c3b=['sqlRootDir','replace','projectRoot','sqlcode','lockFilePath','1883380tTKerf','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','remoteId','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','length','539180ZIYYns','2070154HsOGuF','1856gzdBCR','sqlRoot','appCode','toISOString','5532142EtjNEE','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','sql','1738539pNfhRc','56vMVxIM','validation','high-risk-write','entries','2545188hfBpdl','SQL\x20lock\x20file\x20not\x20found.','Would\x20delete\x20SQL\x20','lastSync','startsWith','str','6507YpuhUz','delete','trashDir','Deleted\x20','sqls','/smartapi/custom/deleteUserCustomSql','\x20(local\x20file\x20moved\x20to\x20trash)'];a167_0x4cae=function(){return _0x212c3b;};return a167_0x4cae();}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':a167_0x5ef014(0x1e4),'command':a167_0x5ef014(0x1f1),'description':a167_0x5ef014(0x1e3),'risk':a167_0x5ef014(0x1e8),'flags':[SQLCODE_FLAG],async 'validate'(_0x17f45c){const _0x40b098=a167_0x5ef014,_0x4bdb61=loadSqlProjectConfig(_0x17f45c[_0x40b098(0x1e0)]),_0x1393b4=await readSqlLockFile(_0x4bdb61[_0x40b098(0x1fb)]);if(!_0x1393b4)throw CliErrors[_0x40b098(0x1e7)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x4987cd){const _0x72b978=a167_0x5ef014,_0x2f7c5c=loadSqlProjectConfig(_0x4987cd[_0x72b978(0x1e0)]),_0x46b391=await readSqlLockFile(_0x2f7c5c['lockFilePath']);if(!_0x46b391)throw CliErrors['validation'](_0x72b978(0x1ff));const {appLock:_0x4c4ddf}=ensureSqlLockScope(_0x46b391,_0x4987cd[_0x72b978(0x1e0)],_0x2f7c5c[_0x72b978(0x1df)],_0x72b978(0x1f1)),_0x19cd58=_0x4987cd[_0x72b978(0x1ef)](_0x72b978(0x1fa)),_0x45b9fb=_0x4c4ddf[_0x72b978(0x1f4)][_0x19cd58];if(!_0x45b9fb)throw CliErrors[_0x72b978(0x1e7)](_0x72b978(0x1fd)+_0x19cd58+'\x22.');return{'method':'POST','url':_0x72b978(0x1f5),'body':{'sqlCode':_0x19cd58,'id':_0x45b9fb[_0x72b978(0x1fe)],'localPath':resolveLocalSqlFilePath(_0x2f7c5c,_0x19cd58,_0x45b9fb)},'description':_0x72b978(0x1ec)+_0x19cd58+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x2f7c5c[_0x72b978(0x1f2)]};},async 'execute'(_0x5ff1a8){const _0x25bf33=a167_0x5ef014,_0x3cd586=loadSqlProjectConfig(_0x5ff1a8['appCode']),_0x348b91=await readSqlLockFile(_0x3cd586[_0x25bf33(0x1fb)]);if(!_0x348b91)throw CliErrors[_0x25bf33(0x1e7)](_0x25bf33(0x1eb));const {lockData:_0x739bce,appLock:_0x5908be}=ensureSqlLockScope(_0x348b91,_0x5ff1a8[_0x25bf33(0x1e0)],_0x3cd586[_0x25bf33(0x1df)],_0x25bf33(0x1f1)),_0x560374=_0x5ff1a8[_0x25bf33(0x1ef)](_0x25bf33(0x1fa)),_0x5c6ee1=_0x5908be[_0x25bf33(0x1f4)][_0x560374];if(!_0x5c6ee1)throw CliErrors['validation'](_0x25bf33(0x1fd)+_0x560374+'\x22.');await deleteSqlQuery({'id':_0x5c6ee1['remoteId'],'sqlCode':_0x560374}),_0x5908be['sqls']=Object['fromEntries'](Object[_0x25bf33(0x1e9)](_0x5908be[_0x25bf33(0x1f4)])['filter'](([_0x137205])=>_0x137205!==_0x560374)),_0x5908be[_0x25bf33(0x1ed)]=new Date()[_0x25bf33(0x1e1)](),await writeSqlLockFile(_0x3cd586[_0x25bf33(0x1fb)],_0x739bce);const _0x18414b=resolveLocalSqlFilePath(_0x3cd586,_0x560374,_0x5c6ee1);let _0x3ecdd0;await fileExists(_0x18414b)&&(_0x3ecdd0=await moveToTrash(_0x3cd586[_0x25bf33(0x1f9)],_0x3cd586[_0x25bf33(0x1f2)],_0x18414b),await cleanupEmptyDirectories(dirname(_0x18414b),_0x3cd586[_0x25bf33(0x1f7)]));const _0x125e5e={'deleted':_0x560374,'remoteId':_0x5c6ee1['remoteId']};if(_0x3ecdd0)_0x125e5e['trashedTo']=_0x3ecdd0;return{'ok':!![],'data':_0x125e5e,'message':_0x25bf33(0x1f3)+_0x560374+(_0x3ecdd0?_0x25bf33(0x1f6):'')};}};async function moveToTrash(_0x416fe6,_0x3c71f8,_0x4677e2){const _0x5e2b23=a167_0x5ef014,_0x7f068e=new Date()[_0x5e2b23(0x1e1)]()[_0x5e2b23(0x1f8)](/[:.]/g,'-'),_0x435dfa=relative(_0x416fe6,_0x4677e2),_0x3723ca=join(_0x3c71f8,_0x7f068e,_0x435dfa);return await mkdir(dirname(_0x3723ca),{'recursive':!![]}),await rename(_0x4677e2,_0x3723ca),_0x3723ca;}async function cleanupEmptyDirectories(_0x5a67af,_0x2c0bcd){const _0x413881=a167_0x5ef014;let _0x567f1d=resolve(_0x5a67af);const _0x5e0583=resolve(_0x2c0bcd);while(_0x567f1d[_0x413881(0x1ee)](''+_0x5e0583+sep)||_0x567f1d===_0x5e0583){if(_0x567f1d===_0x5e0583)return;try{const _0x1c9109=await readdir(_0x567f1d);if(_0x1c9109[_0x413881(0x200)]>0x0)return;await rmdir(_0x567f1d);}catch{return;}_0x567f1d=dirname(_0x567f1d);}}
1
+ const a167_0x801513=a167_0x4d95;(function(_0x3e5658,_0x5f2833){const _0x48d966=a167_0x4d95,_0x27e398=_0x3e5658();while(!![]){try{const _0x141263=parseInt(_0x48d966(0xe6))/0x1*(-parseInt(_0x48d966(0xf6))/0x2)+parseInt(_0x48d966(0xee))/0x3+-parseInt(_0x48d966(0x107))/0x4*(-parseInt(_0x48d966(0xe7))/0x5)+parseInt(_0x48d966(0xf2))/0x6+-parseInt(_0x48d966(0x109))/0x7+parseInt(_0x48d966(0xfe))/0x8+parseInt(_0x48d966(0x108))/0x9*(-parseInt(_0x48d966(0xfb))/0xa);if(_0x141263===_0x5f2833)break;else _0x27e398['push'](_0x27e398['shift']());}catch(_0x3ba193){_0x27e398['push'](_0x27e398['shift']());}}}(a167_0x5197,0x7e3b7));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';function a167_0x4d95(_0x5e9862,_0x25dcc9){_0x5e9862=_0x5e9862-0xe6;const _0x519744=a167_0x5197();let _0x4d951e=_0x519744[_0x5e9862];return _0x4d951e;}function a167_0x5197(){const _0x13345e=['validation','filter','49147gQpmxm','5735ATLvFG','lastSync','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','lockFilePath','remoteId','/smartapi/custom/deleteUserCustomSql','trashedTo','2478471RVKBdM','delete','length','appCode','1919484ClbLLE','startsWith','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','sqlRootDir','20yLuuQz','trashDir','sqlRoot','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','high-risk-write','429810fqejqP','replace','str','1705912aPvQBS','sqlcode','Deleted\x20','sqls','Would\x20delete\x20SQL\x20','\x20(local\x20file\x20moved\x20to\x20trash)','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','entries','toISOString','420xmHddJ','27mRlmqn','2395995cXuhLQ','sql'];a167_0x5197=function(){return _0x13345e;};return a167_0x5197();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a167_0x801513(0x10a),'command':a167_0x801513(0xef),'description':a167_0x801513(0xf4),'risk':a167_0x801513(0xfa),'flags':[SQLCODE_FLAG],async 'validate'(_0x234353){const _0x39c108=a167_0x801513,_0x408a10=loadSqlProjectConfig(_0x234353[_0x39c108(0xf1)]),_0x369cac=await readSqlLockFile(_0x408a10[_0x39c108(0xea)]);if(!_0x369cac)throw CliErrors[_0x39c108(0x10b)](_0x39c108(0xf9));},async 'dryRun'(_0x352338){const _0x1ef42d=a167_0x801513,_0x243090=loadSqlProjectConfig(_0x352338[_0x1ef42d(0xf1)]),_0x429154=await readSqlLockFile(_0x243090[_0x1ef42d(0xea)]);if(!_0x429154)throw CliErrors[_0x1ef42d(0x10b)](_0x1ef42d(0xf9));const {appLock:_0x330c7e}=ensureSqlLockScope(_0x429154,_0x352338[_0x1ef42d(0xf1)],_0x243090['sqlRoot'],_0x1ef42d(0xef)),_0x3e0ac5=_0x352338['str'](_0x1ef42d(0xff)),_0x1b02f9=_0x330c7e[_0x1ef42d(0x101)][_0x3e0ac5];if(!_0x1b02f9)throw CliErrors[_0x1ef42d(0x10b)](_0x1ef42d(0xe9)+_0x3e0ac5+'\x22.');return{'method':'POST','url':_0x1ef42d(0xec),'body':{'sqlCode':_0x3e0ac5,'id':_0x1b02f9['remoteId'],'localPath':resolveLocalSqlFilePath(_0x243090,_0x3e0ac5,_0x1b02f9)},'description':_0x1ef42d(0x102)+_0x3e0ac5+_0x1ef42d(0x104)+_0x243090[_0x1ef42d(0xf7)]};},async 'execute'(_0xbdaac5){const _0x10c524=a167_0x801513,_0x316deb=loadSqlProjectConfig(_0xbdaac5[_0x10c524(0xf1)]),_0x717c6a=await readSqlLockFile(_0x316deb[_0x10c524(0xea)]);if(!_0x717c6a)throw CliErrors[_0x10c524(0x10b)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x5b6518,appLock:_0x2560f8}=ensureSqlLockScope(_0x717c6a,_0xbdaac5[_0x10c524(0xf1)],_0x316deb[_0x10c524(0xf8)],'delete'),_0x136af5=_0xbdaac5[_0x10c524(0xfd)](_0x10c524(0xff)),_0x12ae4b=_0x2560f8[_0x10c524(0x101)][_0x136af5];if(!_0x12ae4b)throw CliErrors[_0x10c524(0x10b)](_0x10c524(0xe9)+_0x136af5+'\x22.');await deleteSqlQuery({'id':_0x12ae4b['remoteId'],'sqlCode':_0x136af5}),_0x2560f8[_0x10c524(0x101)]=Object['fromEntries'](Object[_0x10c524(0x105)](_0x2560f8[_0x10c524(0x101)])[_0x10c524(0x10c)](([_0x6253fb])=>_0x6253fb!==_0x136af5)),_0x2560f8[_0x10c524(0xe8)]=new Date()[_0x10c524(0x106)](),await writeSqlLockFile(_0x316deb['lockFilePath'],_0x5b6518);const _0x35499f=resolveLocalSqlFilePath(_0x316deb,_0x136af5,_0x12ae4b);let _0x56b1e3;await fileExists(_0x35499f)&&(_0x56b1e3=await moveToTrash(_0x316deb['projectRoot'],_0x316deb['trashDir'],_0x35499f),await cleanupEmptyDirectories(dirname(_0x35499f),_0x316deb[_0x10c524(0xf5)]));const _0x105600={'deleted':_0x136af5,'remoteId':_0x12ae4b[_0x10c524(0xeb)]};if(_0x56b1e3)_0x105600[_0x10c524(0xed)]=_0x56b1e3;return{'ok':!![],'data':_0x105600,'message':_0x10c524(0x100)+_0x136af5+(_0x56b1e3?_0x10c524(0x103):'')};}};async function moveToTrash(_0x118b2a,_0x170311,_0x39d054){const _0x58213c=a167_0x801513,_0x163fb2=new Date()['toISOString']()[_0x58213c(0xfc)](/[:.]/g,'-'),_0x2b2ec7=relative(_0x118b2a,_0x39d054),_0x3d8ec8=join(_0x170311,_0x163fb2,_0x2b2ec7);return await mkdir(dirname(_0x3d8ec8),{'recursive':!![]}),await rename(_0x39d054,_0x3d8ec8),_0x3d8ec8;}async function cleanupEmptyDirectories(_0x20cb50,_0x40fc5d){const _0x3dfaab=a167_0x801513;let _0x305f99=resolve(_0x20cb50);const _0x1728f6=resolve(_0x40fc5d);while(_0x305f99[_0x3dfaab(0xf3)](''+_0x1728f6+sep)||_0x305f99===_0x1728f6){if(_0x305f99===_0x1728f6)return;try{const _0x406b51=await readdir(_0x305f99);if(_0x406b51[_0x3dfaab(0xf0)]>0x0)return;await rmdir(_0x305f99);}catch{return;}_0x305f99=dirname(_0x305f99);}}
@@ -1 +1 @@
1
- const a168_0x1315be=a168_0x19b9;(function(_0x9e062f,_0x1799ad){const _0x4ffdf6=a168_0x19b9,_0x58803d=_0x9e062f();while(!![]){try{const _0x360c61=parseInt(_0x4ffdf6(0x1f3))/0x1+parseInt(_0x4ffdf6(0x1e5))/0x2+parseInt(_0x4ffdf6(0x1f7))/0x3+-parseInt(_0x4ffdf6(0x1ee))/0x4*(-parseInt(_0x4ffdf6(0x1eb))/0x5)+-parseInt(_0x4ffdf6(0x1ef))/0x6*(-parseInt(_0x4ffdf6(0x1f1))/0x7)+-parseInt(_0x4ffdf6(0x1e6))/0x8+-parseInt(_0x4ffdf6(0x1e8))/0x9;if(_0x360c61===_0x1799ad)break;else _0x58803d['push'](_0x58803d['shift']());}catch(_0x5ceef7){_0x58803d['push'](_0x58803d['shift']());}}}(a168_0x49d4,0x28595));function a168_0x19b9(_0x57663c,_0x5f3b24){_0x57663c=_0x57663c-0x1e4;const _0x49d415=a168_0x49d4();let _0x19b979=_0x49d415[_0x57663c];return _0x19b979;}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a168_0x1315be(0x1e9),'description':a168_0x1315be(0x1f5),'risk':'read','flags':[SQLCODE_FLAG,{'name':a168_0x1315be(0x1f0),'type':a168_0x1315be(0x1ed),'description':a168_0x1315be(0x1f8)}],async 'execute'(_0x32d220){const _0xf06b92=a168_0x1315be,_0x170acd=await getSqlQueryInfo(_0x32d220[_0xf06b92(0x1ec)],_0x32d220[_0xf06b92(0x1ea)](_0xf06b92(0x1fa))),_0x42173e=_0x32d220[_0xf06b92(0x1f2)]('verbose');if(_0x42173e)return{'ok':!![],'data':_0x170acd};const _0x394dd8=_0x170acd[_0xf06b92(0x1f9)]?await getDbName(_0x32d220[_0xf06b92(0x1ec)],_0x170acd['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x170acd[_0xf06b92(0x1e4)],'sqlName':_0x170acd[_0xf06b92(0x1f6)],'db':_0x394dd8?_0x394dd8+'\x20('+_0x170acd[_0xf06b92(0x1f9)]+')':_0x170acd[_0xf06b92(0x1f9)]??'','description':_0x170acd[_0xf06b92(0x1e7)]??'','sqlContent':_0x170acd[_0xf06b92(0x1f4)]??''}};}};function a168_0x49d4(){const _0x15c7a6=['sqlcode','sqlCode','537582kEeTpt','2013664sskDkT','description','4273875EDCrpm','detail','str','45kudtjo','appCode','boolean','53284LSmKAs','12TtuPHM','verbose','186053NrybUJ','bool','161368CJSkjB','sqlContent','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','sqlName','865938nhLyJr','Return\x20full\x20raw\x20SQL\x20query\x20object','dbId'];a168_0x49d4=function(){return _0x15c7a6;};return a168_0x49d4();}
1
+ const a168_0x30d188=a168_0x5581;(function(_0x2d6bd6,_0x2f119b){const _0x5e38a6=a168_0x5581,_0x199a83=_0x2d6bd6();while(!![]){try{const _0x16ef54=-parseInt(_0x5e38a6(0xdf))/0x1+parseInt(_0x5e38a6(0xda))/0x2+-parseInt(_0x5e38a6(0xe7))/0x3*(-parseInt(_0x5e38a6(0xdb))/0x4)+parseInt(_0x5e38a6(0xe2))/0x5*(-parseInt(_0x5e38a6(0xe1))/0x6)+parseInt(_0x5e38a6(0xe8))/0x7+-parseInt(_0x5e38a6(0xdd))/0x8*(-parseInt(_0x5e38a6(0xeb))/0x9)+parseInt(_0x5e38a6(0xd8))/0xa*(-parseInt(_0x5e38a6(0xd9))/0xb);if(_0x16ef54===_0x2f119b)break;else _0x199a83['push'](_0x199a83['shift']());}catch(_0x1bc8eb){_0x199a83['push'](_0x199a83['shift']());}}}(a168_0xdcb6,0x791e0));import{getSqlQueryInfo}from'../../core/api-client.js';function a168_0xdcb6(){const _0x4a0cfc=['1731576HmEDDW','1889824uflEYF','sqlName','8VfcrVT','dbId','808302IEMUHB','sql','5298mjUpTn','1465AgXEvL','appCode','detail','verbose','description','3wLMHpF','4097534ENeDgv','read','sqlcode','4927428vQSWKN','boolean','Return\x20full\x20raw\x20SQL\x20query\x20object','str','bool','10aChbGo','9987791RYnkND'];a168_0xdcb6=function(){return _0x4a0cfc;};return a168_0xdcb6();}function a168_0x5581(_0x5bab25,_0x30b703){_0x5bab25=_0x5bab25-0xd8;const _0xdcb68a=a168_0xdcb6();let _0x55816b=_0xdcb68a[_0x5bab25];return _0x55816b;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a168_0x30d188(0xe0),'command':a168_0x30d188(0xe4),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a168_0x30d188(0xe9),'flags':[SQLCODE_FLAG,{'name':a168_0x30d188(0xe5),'type':a168_0x30d188(0xec),'description':a168_0x30d188(0xed)}],async 'execute'(_0xebeef2){const _0x31b37f=a168_0x30d188,_0x4081d3=await getSqlQueryInfo(_0xebeef2['appCode'],_0xebeef2[_0x31b37f(0xee)](_0x31b37f(0xea))),_0x57a348=_0xebeef2[_0x31b37f(0xef)](_0x31b37f(0xe5));if(_0x57a348)return{'ok':!![],'data':_0x4081d3};const _0x19c1a8=_0x4081d3[_0x31b37f(0xde)]?await getDbName(_0xebeef2[_0x31b37f(0xe3)],_0x4081d3[_0x31b37f(0xde)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x4081d3['sqlCode'],'sqlName':_0x4081d3[_0x31b37f(0xdc)],'db':_0x19c1a8?_0x19c1a8+'\x20('+_0x4081d3[_0x31b37f(0xde)]+')':_0x4081d3[_0x31b37f(0xde)]??'','description':_0x4081d3[_0x31b37f(0xe6)]??'','sqlContent':_0x4081d3['sqlContent']??''}};}};
@@ -1 +1 @@
1
- const a169_0x3a677d=a169_0x1ff1;(function(_0x3884df,_0x3bbece){const _0x21e6d7=a169_0x1ff1,_0x5ed9a1=_0x3884df();while(!![]){try{const _0x1c123a=parseInt(_0x21e6d7(0x152))/0x1+parseInt(_0x21e6d7(0x15f))/0x2*(parseInt(_0x21e6d7(0x158))/0x3)+-parseInt(_0x21e6d7(0x168))/0x4*(-parseInt(_0x21e6d7(0x160))/0x5)+parseInt(_0x21e6d7(0x166))/0x6+-parseInt(_0x21e6d7(0x151))/0x7+-parseInt(_0x21e6d7(0x156))/0x8+parseInt(_0x21e6d7(0x14f))/0x9*(parseInt(_0x21e6d7(0x15c))/0xa);if(_0x1c123a===_0x3bbece)break;else _0x5ed9a1['push'](_0x5ed9a1['shift']());}catch(_0x2fa7e7){_0x5ed9a1['push'](_0x5ed9a1['shift']());}}}(a169_0x38f0,0x5412a));function a169_0x38f0(){const _0x3a3f11=['execSuccess','execError','210810kzaywO','read','SQL\x20execution\x20failed','33158WQfpTm','1027220LxJvsN','appCode','string','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','sql','\x20row(s)\x20in\x20','1734636acZJEh','params','8FGEBUx','63Mqufdw','length','4190585nWEfWx','674448NZCJbJ','isArray','now','Returned\x20','5029832ksvPAV','str','9PJkUzd','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode'];a169_0x38f0=function(){return _0x3a3f11;};return a169_0x38f0();}import{executeSql}from'../../core/api-client.js';function a169_0x1ff1(_0x5e7420,_0x590111){_0x5e7420=_0x5e7420-0x14f;const _0x38f0a4=a169_0x38f0();let _0x1ff1bb=_0x38f0a4[_0x5e7420];return _0x1ff1bb;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a169_0x3a677d(0x164),'command':'exec','description':a169_0x3a677d(0x159),'risk':a169_0x3a677d(0x15d),'flags':[SQLCODE_FLAG,{'name':a169_0x3a677d(0x167),'type':a169_0x3a677d(0x162),'description':a169_0x3a677d(0x163)}],async 'execute'(_0x30af40){const _0x12b754=a169_0x3a677d,_0x214e47=parseJsonParams(_0x30af40[_0x12b754(0x157)](_0x12b754(0x167))),_0x36d4cb=Date[_0x12b754(0x154)](),_0x4137c0=await executeSql(_0x30af40[_0x12b754(0x161)],_0x30af40[_0x12b754(0x157)]('sqlcode'),_0x214e47),_0x4ac8f7=Date['now']()-_0x36d4cb,_0x3d4089=_0x4137c0?.['execResult']??_0x4137c0,_0xd7640f=_0x4137c0?.[_0x12b754(0x15a)]??!![];if(!_0xd7640f)return{'ok':![],'data':{'error':_0x4137c0?.[_0x12b754(0x15b)]||_0x12b754(0x15e),'elapsed':_0x4ac8f7},'message':_0x12b754(0x15e)};const _0x43b5b3=Array[_0x12b754(0x153)](_0x3d4089)?_0x3d4089:[];return{'ok':!![],'data':{'rows':_0x43b5b3,'rowCount':_0x43b5b3[_0x12b754(0x150)],'elapsed':_0x4ac8f7},'message':_0x12b754(0x155)+_0x43b5b3[_0x12b754(0x150)]+_0x12b754(0x165)+_0x4ac8f7+'ms'};}};
1
+ function a169_0x1985(){const _0x406446=['execSuccess','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','3088jUSAcn','length','exec','sql','read','\x20row(s)\x20in\x20','36268erChYQ','750520Sfjpvj','270380quLsFS','4878wbvVxm','27369324glTref','6009vtgowO','341zvhKJO','350CwuqqU','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','SQL\x20execution\x20failed','isArray','Returned\x20','13UaXKTm','6531kRXjKa','params','598xiJFeP','execResult','19548vyhrXo','str','appCode','string','now'];a169_0x1985=function(){return _0x406446;};return a169_0x1985();}const a169_0x1f99a5=a169_0x4aa3;(function(_0x3457e1,_0x40dcc5){const _0x11c561=a169_0x4aa3,_0x35d7c9=_0x3457e1();while(!![]){try{const _0x30046e=parseInt(_0x11c561(0xcd))/0x1+parseInt(_0x11c561(0xdb))/0x2*(parseInt(_0x11c561(0xd1))/0x3)+-parseInt(_0x11c561(0xcc))/0x4*(-parseInt(_0x11c561(0xd3))/0x5)+parseInt(_0x11c561(0xcf))/0x6*(parseInt(_0x11c561(0xd9))/0x7)+parseInt(_0x11c561(0xc6))/0x8*(parseInt(_0x11c561(0xdd))/0x9)+parseInt(_0x11c561(0xce))/0xa*(-parseInt(_0x11c561(0xd2))/0xb)+-parseInt(_0x11c561(0xd0))/0xc*(parseInt(_0x11c561(0xd8))/0xd);if(_0x30046e===_0x40dcc5)break;else _0x35d7c9['push'](_0x35d7c9['shift']());}catch(_0x44abf1){_0x35d7c9['push'](_0x35d7c9['shift']());}}}(a169_0x1985,0x70cf9));function a169_0x4aa3(_0x5081f0,_0x2e8e7d){_0x5081f0=_0x5081f0-0xc5;const _0x198531=a169_0x1985();let _0x4aa3b2=_0x198531[_0x5081f0];return _0x4aa3b2;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a169_0x1f99a5(0xc9),'command':a169_0x1f99a5(0xc8),'description':a169_0x1f99a5(0xc5),'risk':a169_0x1f99a5(0xca),'flags':[SQLCODE_FLAG,{'name':a169_0x1f99a5(0xda),'type':a169_0x1f99a5(0xe0),'description':a169_0x1f99a5(0xd4)}],async 'execute'(_0x592edf){const _0x18a131=a169_0x1f99a5,_0x4e0b00=parseJsonParams(_0x592edf[_0x18a131(0xde)](_0x18a131(0xda))),_0x3e1a4d=Date[_0x18a131(0xe1)](),_0x591398=await executeSql(_0x592edf[_0x18a131(0xdf)],_0x592edf['str']('sqlcode'),_0x4e0b00),_0x4fce69=Date[_0x18a131(0xe1)]()-_0x3e1a4d,_0x541ab0=_0x591398?.[_0x18a131(0xdc)]??_0x591398,_0x5e07e4=_0x591398?.[_0x18a131(0xe2)]??!![];if(!_0x5e07e4)return{'ok':![],'data':{'error':_0x591398?.['execError']||_0x18a131(0xd5),'elapsed':_0x4fce69},'message':'SQL\x20execution\x20failed'};const _0x1e13d4=Array[_0x18a131(0xd6)](_0x541ab0)?_0x541ab0:[];return{'ok':!![],'data':{'rows':_0x1e13d4,'rowCount':_0x1e13d4[_0x18a131(0xc7)],'elapsed':_0x4fce69},'message':_0x18a131(0xd7)+_0x1e13d4['length']+_0x18a131(0xcb)+_0x4fce69+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x4a81c3,_0x3abe03){const _0x38a43d=a170_0x4961,_0x354ac5=_0x4a81c3();while(!![]){try{const _0x1bf20e=parseInt(_0x38a43d(0xae))/0x1+-parseInt(_0x38a43d(0xb0))/0x2*(parseInt(_0x38a43d(0xb3))/0x3)+parseInt(_0x38a43d(0xaa))/0x4+-parseInt(_0x38a43d(0xb2))/0x5+parseInt(_0x38a43d(0xb1))/0x6*(-parseInt(_0x38a43d(0xac))/0x7)+parseInt(_0x38a43d(0xaf))/0x8*(-parseInt(_0x38a43d(0xb4))/0x9)+-parseInt(_0x38a43d(0xab))/0xa*(-parseInt(_0x38a43d(0xad))/0xb);if(_0x1bf20e===_0x3abe03)break;else _0x354ac5['push'](_0x354ac5['shift']());}catch(_0x471b60){_0x354ac5['push'](_0x354ac5['shift']());}}}(a170_0x4bfa,0x2e6f4));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.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';function a170_0x4bfa(){const _0x398f3f=['1794KoGSZL','423620vaohzc','1902UfAnXe','32823oqAyqw','784752jjIDBF','1930CgDXeG','6286ZzVzPD','27313fxOhsH','80447ktCWlZ','224eyqGgc','348DUzsCq'];a170_0x4bfa=function(){return _0x398f3f;};return a170_0x4bfa();}function a170_0x4961(_0x2670dd,_0x2dea9b){_0x2670dd=_0x2670dd-0xaa;const _0x4bfaf5=a170_0x4bfa();let _0x496195=_0x4bfaf5[_0x2670dd];return _0x496195;}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x54f464,_0x1c2285){const _0x2c49d7=a170_0x17dc,_0x250861=_0x54f464();while(!![]){try{const _0x550f6e=-parseInt(_0x2c49d7(0x15e))/0x1+-parseInt(_0x2c49d7(0x15d))/0x2*(-parseInt(_0x2c49d7(0x157))/0x3)+parseInt(_0x2c49d7(0x15f))/0x4+parseInt(_0x2c49d7(0x15c))/0x5+parseInt(_0x2c49d7(0x160))/0x6+parseInt(_0x2c49d7(0x158))/0x7*(parseInt(_0x2c49d7(0x15b))/0x8)+parseInt(_0x2c49d7(0x15a))/0x9*(-parseInt(_0x2c49d7(0x159))/0xa);if(_0x550f6e===_0x1c2285)break;else _0x250861['push'](_0x250861['shift']());}catch(_0x485045){_0x250861['push'](_0x250861['shift']());}}}(a170_0x4647,0x1e130));import{sqlList}from'../../commands/sql/list.js';function a170_0x4647(){const _0x1a2735=['1173440cIkved','180cGHfZJ','113236JwbWYP','415436XgUiiq','617370vFKFYO','6687BPRtfC','28SfkgEL','1360pQkflj','27558RGqNFN','21600EucQXR'];a170_0x4647=function(){return _0x1a2735;};return a170_0x4647();}import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.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';function a170_0x17dc(_0x491f47,_0x443a96){_0x491f47=_0x491f47-0x157;const _0x4647a7=a170_0x4647();let _0x17dcff=_0x4647a7[_0x491f47];return _0x17dcff;}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a171_0x324774=a171_0x3eba;function a171_0x6787(){const _0x4f841f=['verbose','19124qdJsUx','819070deMqjS','78777wBiZnJ','str','description','112772aovMYX','all','number','293678gSKNZm','280LCQMPu','tableData','name','Page\x20size','75ozahAX','No\x20custom\x20SQL\x20queries\x20found.','page','Found\x20','length','sqlcode','paging','dbId','Page\x20number','List\x20custom\x20SQL\x20queries','pagesize','sql','\x20SQL\x20queries\x20(total:\x20','253122gZYlHN','appCode','string','sqlCode','map','464RfUlEe','num','bool','354ksIoUy','Filter\x20by\x20SQL\x20name','20VswRZQ','1808196ZtrVWf'];a171_0x6787=function(){return _0x4f841f;};return a171_0x6787();}(function(_0x277eb4,_0x2036c0){const _0x2ab9b5=a171_0x3eba,_0x237e5d=_0x277eb4();while(!![]){try{const _0x594e80=-parseInt(_0x2ab9b5(0x7c))/0x1+-parseInt(_0x2ab9b5(0x78))/0x2*(-parseInt(_0x2ab9b5(0x95))/0x3)+-parseInt(_0x2ab9b5(0x80))/0x4*(parseInt(_0x2ab9b5(0x88))/0x5)+parseInt(_0x2ab9b5(0x9d))/0x6*(-parseInt(_0x2ab9b5(0x7b))/0x7)+-parseInt(_0x2ab9b5(0x9a))/0x8*(-parseInt(_0x2ab9b5(0x7d))/0x9)+-parseInt(_0x2ab9b5(0x84))/0xa*(-parseInt(_0x2ab9b5(0x83))/0xb)+-parseInt(_0x2ab9b5(0x79))/0xc;if(_0x594e80===_0x2036c0)break;else _0x237e5d['push'](_0x237e5d['shift']());}catch(_0x5078ce){_0x237e5d['push'](_0x237e5d['shift']());}}}(a171_0x6787,0x85162));function a171_0x3eba(_0x15d613,_0x2bef92){_0x15d613=_0x15d613-0x78;const _0x6787b7=a171_0x6787();let _0x3ebad3=_0x6787b7[_0x15d613];return _0x3ebad3;}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a171_0x324774(0x93),'command':'list','description':a171_0x324774(0x91),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a171_0x324774(0x86),'type':a171_0x324774(0x97),'description':a171_0x324774(0x9e)},{'name':a171_0x324774(0x8a),'type':a171_0x324774(0x82),'description':a171_0x324774(0x90),'default':0x1},{'name':a171_0x324774(0x92),'type':a171_0x324774(0x82),'description':a171_0x324774(0x87)},{'name':a171_0x324774(0x7a),'type':'boolean','description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x52f90f){const _0x3acb6a=a171_0x324774,_0x115066=await listSqlQueries(_0x52f90f[_0x3acb6a(0x96)],{'sqlCode':_0x52f90f[_0x3acb6a(0x7e)](_0x3acb6a(0x8d))||undefined,'sqlName':_0x52f90f[_0x3acb6a(0x7e)](_0x3acb6a(0x86))||undefined,'currentPage':_0x52f90f['num']('page'),'pageSize':_0x52f90f[_0x3acb6a(0x9b)](_0x3acb6a(0x92),0x32)}),_0x3d4bb1=_0x52f90f[_0x3acb6a(0x9c)]('verbose'),_0x20f091=_0x115066[_0x3acb6a(0x85)]??[],_0x140ace=_0x115066[_0x3acb6a(0x8e)]?.['totalCount']??_0x20f091[_0x3acb6a(0x8c)];let _0x53bc68;return _0x3d4bb1?_0x53bc68=_0x20f091:_0x53bc68=await Promise[_0x3acb6a(0x81)](_0x20f091[_0x3acb6a(0x99)](async _0x172c7a=>{const _0x3e7906=_0x3acb6a;let _0x2b794f;try{_0x2b794f=_0x172c7a[_0x3e7906(0x8f)]?await getDbName(_0x52f90f[_0x3e7906(0x96)],_0x172c7a[_0x3e7906(0x8f)]):undefined;}catch{}return{'sqlCode':_0x172c7a[_0x3e7906(0x98)],'sqlName':_0x172c7a['sqlName'],'description':_0x172c7a[_0x3e7906(0x7f)]??'','db':_0x2b794f?_0x2b794f+'\x20('+_0x172c7a['dbId']+')':_0x172c7a[_0x3e7906(0x8f)]??''};})),{'ok':!![],'data':_0x53bc68,'message':_0x20f091['length']===0x0?_0x3acb6a(0x89):_0x3acb6a(0x8b)+_0x20f091[_0x3acb6a(0x8c)]+_0x3acb6a(0x94)+_0x140ace+').'};}};
1
+ const a171_0x1ecb17=a171_0x1856;(function(_0x2d0eb2,_0x711ce8){const _0x23dc96=a171_0x1856,_0xd997bc=_0x2d0eb2();while(!![]){try{const _0x138f72=parseInt(_0x23dc96(0x1cb))/0x1*(-parseInt(_0x23dc96(0x1c2))/0x2)+-parseInt(_0x23dc96(0x1be))/0x3*(-parseInt(_0x23dc96(0x1b5))/0x4)+parseInt(_0x23dc96(0x1c4))/0x5*(parseInt(_0x23dc96(0x1cd))/0x6)+parseInt(_0x23dc96(0x1ab))/0x7*(-parseInt(_0x23dc96(0x1b2))/0x8)+parseInt(_0x23dc96(0x1bf))/0x9+-parseInt(_0x23dc96(0x1c0))/0xa+-parseInt(_0x23dc96(0x1c9))/0xb*(-parseInt(_0x23dc96(0x1b3))/0xc);if(_0x138f72===_0x711ce8)break;else _0xd997bc['push'](_0xd997bc['shift']());}catch(_0x1cb192){_0xd997bc['push'](_0xd997bc['shift']());}}}(a171_0x3af6,0xd7abe));import{listSqlQueries}from'../../core/api-client.js';function a171_0x1856(_0x4995af,_0x1a7c2d){_0x4995af=_0x4995af-0x1aa;const _0x3af6d1=a171_0x3af6();let _0x185638=_0x3af6d1[_0x4995af];return _0x185638;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a171_0x3af6(){const _0x1a4ee1=['page','description','Page\x20size','str','number','list','30kgCDBu','11808522DDTSSo','13988910UobaCV','pagesize','204778jmxEDM','Page\x20number','5yjPSgo','totalCount','dbId','paging','string','141988NjLzaq','bool','11FxtboA','read','346044xVITzc','appCode','77266VmeFBe','No\x20custom\x20SQL\x20queries\x20found.','sqlCode','num','length','Found\x20','sql','872MUKuMH','2520ilKyNW','Filter\x20by\x20SQL\x20name','212516YFRibr','tableData','name'];a171_0x3af6=function(){return _0x1a4ee1;};return a171_0x3af6();}export const sqlList={'service':a171_0x1ecb17(0x1b1),'command':a171_0x1ecb17(0x1bd),'description':'List\x20custom\x20SQL\x20queries','risk':a171_0x1ecb17(0x1cc),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a171_0x1ecb17(0x1c8),'description':a171_0x1ecb17(0x1b4)},{'name':a171_0x1ecb17(0x1b8),'type':a171_0x1ecb17(0x1bc),'description':a171_0x1ecb17(0x1c3),'default':0x1},{'name':a171_0x1ecb17(0x1c1),'type':a171_0x1ecb17(0x1bc),'description':a171_0x1ecb17(0x1ba)},{'name':'verbose','type':'boolean','description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x4fb41c){const _0x1d0186=a171_0x1ecb17,_0x445f13=await listSqlQueries(_0x4fb41c[_0x1d0186(0x1aa)],{'sqlCode':_0x4fb41c[_0x1d0186(0x1bb)]('sqlcode')||undefined,'sqlName':_0x4fb41c['str'](_0x1d0186(0x1b7))||undefined,'currentPage':_0x4fb41c['num']('page'),'pageSize':_0x4fb41c[_0x1d0186(0x1ae)](_0x1d0186(0x1c1),0x32)}),_0x2bdd81=_0x4fb41c[_0x1d0186(0x1ca)]('verbose'),_0x1e0862=_0x445f13[_0x1d0186(0x1b6)]??[],_0x3806e4=_0x445f13[_0x1d0186(0x1c7)]?.[_0x1d0186(0x1c5)]??_0x1e0862[_0x1d0186(0x1af)];let _0x4e4a59;return _0x2bdd81?_0x4e4a59=_0x1e0862:_0x4e4a59=await Promise['all'](_0x1e0862['map'](async _0x432aea=>{const _0x443d99=_0x1d0186;let _0x59e296;try{_0x59e296=_0x432aea[_0x443d99(0x1c6)]?await getDbName(_0x4fb41c[_0x443d99(0x1aa)],_0x432aea[_0x443d99(0x1c6)]):undefined;}catch{}return{'sqlCode':_0x432aea[_0x443d99(0x1ad)],'sqlName':_0x432aea['sqlName'],'description':_0x432aea[_0x443d99(0x1b9)]??'','db':_0x59e296?_0x59e296+'\x20('+_0x432aea[_0x443d99(0x1c6)]+')':_0x432aea['dbId']??''};})),{'ok':!![],'data':_0x4e4a59,'message':_0x1e0862['length']===0x0?_0x1d0186(0x1ac):_0x1d0186(0x1b0)+_0x1e0862[_0x1d0186(0x1af)]+'\x20SQL\x20queries\x20(total:\x20'+_0x3806e4+').'};}};