@lovrabet/rabetbase-cli 2.3.6 → 2.3.7-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) 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/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -0
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -0
  79. package/lib/commands/db/analyze-batch-plan.js +1 -0
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -0
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/logs/index.js +1 -1
  101. package/lib/commands/menu/index.js +1 -1
  102. package/lib/commands/menu/list.js +1 -1
  103. package/lib/commands/menu/shared/compare-table.js +1 -1
  104. package/lib/commands/menu/shared/index.js +1 -1
  105. package/lib/commands/menu/shared/inquirer.js +1 -1
  106. package/lib/commands/menu/shared/local-pages.js +1 -1
  107. package/lib/commands/menu/shared/logic.js +1 -1
  108. package/lib/commands/menu/shared/service.js +1 -1
  109. package/lib/commands/menu/shared/sync-core.js +1 -1
  110. package/lib/commands/menu/shared/update-core.js +1 -1
  111. package/lib/commands/menu/shared/valid-url.js +1 -1
  112. package/lib/commands/menu/sync.js +1 -1
  113. package/lib/commands/menu/update.js +1 -1
  114. package/lib/commands/page/generate-start.js +1 -1
  115. package/lib/commands/page/generate-status.js +1 -1
  116. package/lib/commands/page/index.js +1 -1
  117. package/lib/commands/page/pull.js +1 -1
  118. package/lib/commands/page/push.js +1 -1
  119. package/lib/commands/page/relation-audit.js +1 -1
  120. package/lib/commands/page/shared.js +1 -1
  121. package/lib/commands/page/standard-page-status.js +1 -1
  122. package/lib/commands/page/sync.js +1 -1
  123. package/lib/commands/permit/index.js +1 -1
  124. package/lib/commands/permit/page-get.js +1 -1
  125. package/lib/commands/permit/page-set.js +1 -1
  126. package/lib/commands/permit/role-apis-set.js +1 -1
  127. package/lib/commands/permit/role-menus-set.js +1 -1
  128. package/lib/commands/permit/role-menus.js +1 -1
  129. package/lib/commands/permit/shared.js +1 -1
  130. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  131. package/lib/commands/project/create/format-elapsed.js +1 -1
  132. package/lib/commands/project/create/main.js +1 -1
  133. package/lib/commands/project/create/non-interactive.js +1 -1
  134. package/lib/commands/project/create/project-template-path.js +1 -1
  135. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  136. package/lib/commands/project/create/use-format-code.js +1 -1
  137. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  138. package/lib/commands/project/index.js +1 -1
  139. package/lib/commands/project/init.js +1 -1
  140. package/lib/commands/project/upgrade.js +1 -1
  141. package/lib/commands/registry.js +1 -1
  142. package/lib/commands/role/create.js +1 -1
  143. package/lib/commands/role/delete.js +1 -1
  144. package/lib/commands/role/detail.js +1 -1
  145. package/lib/commands/role/index.js +1 -1
  146. package/lib/commands/role/list.js +1 -1
  147. package/lib/commands/role/shared.js +1 -1
  148. package/lib/commands/role/update.js +1 -1
  149. package/lib/commands/role/user-add.js +1 -1
  150. package/lib/commands/role/user-remove.js +1 -1
  151. package/lib/commands/role/user-resolve.js +1 -1
  152. package/lib/commands/run/index.js +1 -1
  153. package/lib/commands/schema.js +1 -1
  154. package/lib/commands/sql/create.js +1 -1
  155. package/lib/commands/sql/delete.js +1 -1
  156. package/lib/commands/sql/detail.js +1 -1
  157. package/lib/commands/sql/exec.js +1 -1
  158. package/lib/commands/sql/index.js +1 -1
  159. package/lib/commands/sql/list.js +1 -1
  160. package/lib/commands/sql/pull.js +1 -1
  161. package/lib/commands/sql/push.js +1 -1
  162. package/lib/commands/sql/save.js +1 -1
  163. package/lib/commands/sql/shared.js +1 -1
  164. package/lib/commands/sql/status.js +1 -1
  165. package/lib/commands/sql/validate.js +1 -1
  166. package/lib/commands/workspace/add.js +1 -1
  167. package/lib/commands/workspace/index.js +1 -1
  168. package/lib/commands/workspace/remove.js +1 -1
  169. package/lib/config/schema.js +1 -1
  170. package/lib/constant/cdn.js +1 -1
  171. package/lib/constant/cli.js +1 -1
  172. package/lib/constant/defaults.js +1 -1
  173. package/lib/constant/domain.js +1 -1
  174. package/lib/constant/env.js +1 -1
  175. package/lib/constant/output.js +1 -1
  176. package/lib/constant/paths.js +1 -1
  177. package/lib/constant/risk.js +1 -1
  178. package/lib/context/app-resolver.js +1 -1
  179. package/lib/context/auth-resolver.js +1 -1
  180. package/lib/context/config-loader.js +1 -1
  181. package/lib/context.js +1 -1
  182. package/lib/core/alias-resolver.js +1 -1
  183. package/lib/core/api-client.js +1 -1
  184. package/lib/core/bff/config.js +1 -1
  185. package/lib/core/bff/file-system.js +1 -1
  186. package/lib/core/bff/hash.js +1 -1
  187. package/lib/core/bff/lock.js +1 -1
  188. package/lib/core/bff/utils.js +1 -1
  189. package/lib/core/db-resolver.js +1 -1
  190. package/lib/core/page/file-system.js +1 -1
  191. package/lib/core/page/hash.js +1 -1
  192. package/lib/core/page/lock.js +1 -1
  193. package/lib/core/sql-sync/config.js +1 -1
  194. package/lib/core/sql-sync/file-system.js +1 -1
  195. package/lib/core/sql-sync/hash.js +1 -1
  196. package/lib/core/sql-sync/lock.js +1 -1
  197. package/lib/core/sql-sync/utils.js +1 -1
  198. package/lib/core/sql-validator.js +1 -1
  199. package/lib/errors.js +1 -1
  200. package/lib/framework/build-all-flags.js +1 -1
  201. package/lib/framework/flags.js +1 -1
  202. package/lib/framework/help.js +1 -1
  203. package/lib/framework/index.js +1 -1
  204. package/lib/framework/output.js +1 -1
  205. package/lib/framework/response.js +1 -1
  206. package/lib/framework/runner-alias.js +1 -1
  207. package/lib/framework/runner.js +1 -1
  208. package/lib/framework/schema-export.js +1 -1
  209. package/lib/framework/types.js +1 -1
  210. package/lib/generated/build-info.js +1 -1
  211. package/lib/help.js +1 -1
  212. package/lib/skills/main.js +1 -1
  213. package/lib/skills/npx-skills-add.js +1 -1
  214. package/lib/telemetry/cli-command-trace.js +1 -1
  215. package/lib/telemetry/cli-help-trace.js +1 -1
  216. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  217. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  218. package/lib/telemetry/send-cli-trace-log.js +1 -1
  219. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  220. package/lib/utils/ai_config.js +1 -1
  221. package/lib/utils/apply-jq-filter.js +1 -1
  222. package/lib/utils/cdn-config.js +1 -1
  223. package/lib/utils/check-sdk-version.js +1 -1
  224. package/lib/utils/cli-version-check.js +1 -1
  225. package/lib/utils/cli-version-policy.js +1 -1
  226. package/lib/utils/config.js +1 -1
  227. package/lib/utils/copy-directory.js +1 -1
  228. package/lib/utils/entity-with-id.js +1 -1
  229. package/lib/utils/file-utils.js +1 -1
  230. package/lib/utils/guides-cdn.js +1 -1
  231. package/lib/utils/http-client.js +1 -1
  232. package/lib/utils/is-non-interactive.js +1 -1
  233. package/lib/utils/logger.js +1 -1
  234. package/lib/utils/params.js +1 -1
  235. package/lib/utils/platform.js +1 -1
  236. package/lib/utils/rules-cdn.js +1 -1
  237. package/lib/utils/sleep.js +1 -1
  238. package/lib/utils/template-replacer.js +1 -1
  239. package/lib/utils/update-notice.js +1 -1
  240. package/lib/utils/version.js +1 -1
  241. package/lib/utils/with-active-cookie.js +1 -1
  242. package/lib/utils/write-cli-side-channel.js +1 -1
  243. package/package.json +1 -1
@@ -1 +1 @@
1
- function a140_0x59e8(_0x1d21ba,_0x252b7b){_0x1d21ba=_0x1d21ba-0x190;const _0x1a854d=a140_0x1a85();let _0x59e8a2=_0x1a854d[_0x1d21ba];return _0x59e8a2;}const a140_0x5853b3=a140_0x59e8;function a140_0x1a85(){const _0x4f8762=['roleType','num','6rhMEyD','detail','2309135UdBhpA','10KgQndk','22632BffBuF','338891qzOyXp','171MDJVhN','roleName','120KWTnMp','1690447MAxKLJ','read','1802092FTTrrU','7741368LOlBal','Show\x20a\x20single\x20role\x27s\x20detail','role','appCode','833766XyEniL'];a140_0x1a85=function(){return _0x4f8762;};return a140_0x1a85();}(function(_0xf7c9bc,_0x253e86){const _0xfdc73d=a140_0x59e8,_0x1b7d15=_0xf7c9bc();while(!![]){try{const _0x1a63e3=parseInt(_0xfdc73d(0x19c))/0x1+parseInt(_0xfdc73d(0x190))/0x2*(-parseInt(_0xfdc73d(0x192))/0x3)+-parseInt(_0xfdc73d(0x197))/0x4+parseInt(_0xfdc73d(0x1a1))/0x5*(parseInt(_0xfdc73d(0x19f))/0x6)+parseInt(_0xfdc73d(0x191))/0x7*(-parseInt(_0xfdc73d(0x194))/0x8)+parseInt(_0xfdc73d(0x198))/0x9+-parseInt(_0xfdc73d(0x1a2))/0xa*(-parseInt(_0xfdc73d(0x195))/0xb);if(_0x1a63e3===_0x253e86)break;else _0x1b7d15['push'](_0x1b7d15['shift']());}catch(_0x3897c2){_0x1b7d15['push'](_0x1b7d15['shift']());}}}(a140_0x1a85,0x7710c));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a140_0x5853b3(0x19a),'command':a140_0x5853b3(0x1a0),'description':a140_0x5853b3(0x199),'risk':a140_0x5853b3(0x196),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x475179){const _0x171940=a140_0x5853b3,_0x4bcdef=_0x475179[_0x171940(0x19e)]('id'),_0x55608a=await getRoleById(_0x475179[_0x171940(0x19b)],_0x4bcdef);return{'ok':!![],'data':{'role':projectRole(_0x55608a)},'message':'Role\x20'+_0x55608a[_0x171940(0x193)]+'\x20('+_0x55608a[_0x171940(0x19d)]+')'};}};
1
+ const a144_0x184d21=a144_0x442e;(function(_0xd815b0,_0x30d5bd){const _0x18f1a4=a144_0x442e,_0x426c92=_0xd815b0();while(!![]){try{const _0x3b6023=-parseInt(_0x18f1a4(0x188))/0x1+parseInt(_0x18f1a4(0x184))/0x2+-parseInt(_0x18f1a4(0x18e))/0x3*(-parseInt(_0x18f1a4(0x187))/0x4)+parseInt(_0x18f1a4(0x18f))/0x5+parseInt(_0x18f1a4(0x18a))/0x6*(-parseInt(_0x18f1a4(0x18d))/0x7)+-parseInt(_0x18f1a4(0x185))/0x8*(-parseInt(_0x18f1a4(0x191))/0x9)+-parseInt(_0x18f1a4(0x18b))/0xa;if(_0x3b6023===_0x30d5bd)break;else _0x426c92['push'](_0x426c92['shift']());}catch(_0x432fb1){_0x426c92['push'](_0x426c92['shift']());}}}(a144_0x3aab,0xac4c2));function a144_0x442e(_0x23ae7a,_0x4cdf48){_0x23ae7a=_0x23ae7a-0x183;const _0x3aabfd=a144_0x3aab();let _0x442e62=_0x3aabfd[_0x23ae7a];return _0x442e62;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a144_0x184d21(0x18c),'command':a144_0x184d21(0x186),'description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':a144_0x184d21(0x189),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0xdecf9d){const _0xdc41e4=a144_0x184d21,_0x19b0a9=_0xdecf9d['num']('id'),_0x1e4505=await getRoleById(_0xdecf9d['appCode'],_0x19b0a9);return{'ok':!![],'data':{'role':projectRole(_0x1e4505)},'message':_0xdc41e4(0x183)+_0x1e4505[_0xdc41e4(0x190)]+'\x20('+_0x1e4505['roleType']+')'};}};function a144_0x3aab(){const _0x3663fb=['Role\x20','1148110JjlAeX','26952LOdEPj','detail','434904vNHeic','688317LrItYX','read','6alnNNE','5288330xAvItM','role','2350103TEkNja','6pVcpfG','5246730JFIIie','roleName','1116zTMqiN'];a144_0x3aab=function(){return _0x3663fb;};return a144_0x3aab();}
@@ -1 +1 @@
1
- (function(_0x4de281,_0x481265){const _0x3fff68=a141_0x4541,_0xd9eb5f=_0x4de281();while(!![]){try{const _0x1190b4=-parseInt(_0x3fff68(0x118))/0x1*(parseInt(_0x3fff68(0x116))/0x2)+parseInt(_0x3fff68(0x119))/0x3*(-parseInt(_0x3fff68(0x11d))/0x4)+parseInt(_0x3fff68(0x11c))/0x5+parseInt(_0x3fff68(0x11f))/0x6+-parseInt(_0x3fff68(0x11e))/0x7*(-parseInt(_0x3fff68(0x11a))/0x8)+-parseInt(_0x3fff68(0x11b))/0x9+-parseInt(_0x3fff68(0x117))/0xa*(-parseInt(_0x3fff68(0x115))/0xb);if(_0x1190b4===_0x481265)break;else _0xd9eb5f['push'](_0xd9eb5f['shift']());}catch(_0x2fbf8a){_0xd9eb5f['push'](_0xd9eb5f['shift']());}}}(a141_0x3a2b,0x2326a));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';function a141_0x4541(_0x5c2859,_0x3194fe){_0x5c2859=_0x5c2859-0x115;const _0x3a2bca=a141_0x3a2b();let _0x4541d8=_0x3a2bca[_0x5c2859];return _0x4541d8;}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 a141_0x3a2b(){const _0x4e98b3=['68043eNhJuO','8AgGahW','2533905ryYaeV','182375VSFdWm','28sfcUEx','1266146etbKzi','378096RHtRKz','11BLeKXZ','280778blaEhR','4443100XRIQKe','1BpGdbG'];a141_0x3a2b=function(){return _0x4e98b3;};return a141_0x3a2b();}
1
+ (function(_0x3ae07c,_0x25d400){const _0xa83f75=a145_0x585d,_0x587e9b=_0x3ae07c();while(!![]){try{const _0x52adc7=-parseInt(_0xa83f75(0x1af))/0x1+-parseInt(_0xa83f75(0x1b1))/0x2+-parseInt(_0xa83f75(0x1b5))/0x3+-parseInt(_0xa83f75(0x1b6))/0x4+parseInt(_0xa83f75(0x1b2))/0x5*(-parseInt(_0xa83f75(0x1b7))/0x6)+-parseInt(_0xa83f75(0x1b0))/0x7*(-parseInt(_0xa83f75(0x1b4))/0x8)+parseInt(_0xa83f75(0x1b3))/0x9;if(_0x52adc7===_0x25d400)break;else _0x587e9b['push'](_0x587e9b['shift']());}catch(_0x3eac6d){_0x587e9b['push'](_0x587e9b['shift']());}}}(a145_0x9ec0,0xf2a94));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a145_0x585d(_0x2e7073,_0x49737d){_0x2e7073=_0x2e7073-0x1af;const _0x9ec0af=a145_0x9ec0();let _0x585dc3=_0x9ec0af[_0x2e7073];return _0x585dc3;}import{roleCreate}from'../../commands/role/create.js';function a145_0x9ec0(){const _0x37c67d=['42weZOQO','1693752tuqlnj','723335nxcNIt','35001441LYvPLW','2312976VpPIjw','405264eRpABf','5919484iltfGH','30tBCpog','1444671oqtQTx'];a145_0x9ec0=function(){return _0x37c67d;};return a145_0x9ec0();}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 +1 @@
1
- const a142_0x5b9a5b=a142_0xb467;(function(_0x1a4249,_0x554a53){const _0x183ac9=a142_0xb467,_0x36f4aa=_0x1a4249();while(!![]){try{const _0x1af606=parseInt(_0x183ac9(0x105))/0x1+parseInt(_0x183ac9(0xf1))/0x2*(parseInt(_0x183ac9(0xf7))/0x3)+-parseInt(_0x183ac9(0x10f))/0x4*(parseInt(_0x183ac9(0x10c))/0x5)+-parseInt(_0x183ac9(0xf6))/0x6+parseInt(_0x183ac9(0x101))/0x7+-parseInt(_0x183ac9(0x102))/0x8+parseInt(_0x183ac9(0x107))/0x9;if(_0x1af606===_0x554a53)break;else _0x36f4aa['push'](_0x36f4aa['shift']());}catch(_0x5464bb){_0x36f4aa['push'](_0x36f4aa['shift']());}}}(a142_0x4712,0x1d6f0));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',a142_0x5b9a5b(0x10a),'USER',a142_0x5b9a5b(0x109)];export const roleList={'service':'role','command':a142_0x5b9a5b(0xfe),'description':a142_0x5b9a5b(0x103),'risk':a142_0x5b9a5b(0xf8),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a142_0x5b9a5b(0xf9),'type':a142_0x5b9a5b(0x10b),'required':![],'description':a142_0x5b9a5b(0xf5),'enum':ROLE_TYPES},{'name':a142_0x5b9a5b(0xfb),'type':'number','description':'Page\x20index\x20(1-based)','default':0x1},{'name':a142_0x5b9a5b(0x10d),'type':a142_0x5b9a5b(0x104),'description':a142_0x5b9a5b(0xf2),'default':0x64}],async 'validate'(_0x3c1954){const _0xee6c7a=a142_0x5b9a5b,_0x3f2daa=_0x3c1954[_0xee6c7a(0xff)]('type')[_0xee6c7a(0xfc)]();if(_0x3f2daa&&!ROLE_TYPES[_0xee6c7a(0xf4)](_0x3f2daa['toUpperCase']()))throw CliErrors['validation']('Invalid\x20--type\x20\x22'+_0x3f2daa+'\x22.',_0xee6c7a(0xf0)+ROLE_TYPES[_0xee6c7a(0xfd)](',\x20')+'.');const _0x13f119=_0x3c1954['num'](_0xee6c7a(0xfb),0x1),_0x5c4062=_0x3c1954[_0xee6c7a(0x106)](_0xee6c7a(0x10d),0x64);if(_0x13f119<0x1)throw CliErrors[_0xee6c7a(0xf3)](_0xee6c7a(0xfa));if(_0x5c4062<0x1||_0x5c4062>0x64)throw CliErrors['validation'](_0xee6c7a(0x110));},async 'execute'(_0x477e53){const _0x54fac9=a142_0x5b9a5b,_0x2f6c63=_0x477e53[_0x54fac9(0x106)]('page',0x1)||0x1,_0x51ccdf=_0x477e53['num']('pagesize',0x64)||0x64,_0x447008=_0x477e53[_0x54fac9(0xff)](_0x54fac9(0xf9))['trim']()['toUpperCase'](),{items:_0x4b8e3e,paging:_0x56c881}=await listAppRoles(_0x477e53[_0x54fac9(0x108)],{'currentPage':_0x2f6c63,'pageSize':_0x51ccdf}),_0x20cb91=_0x447008?_0x4b8e3e[_0x54fac9(0x100)](_0xa51abe=>_0xa51abe['roleType']===_0x447008):_0x4b8e3e,_0x2fb2d1=_0x20cb91['map'](projectRole);return{'ok':!![],'data':{'roles':_0x2fb2d1,'paging':_0x56c881},'message':'Found\x20'+_0x2fb2d1[_0x54fac9(0x10e)]+'\x20role(s)'};}};function a142_0xb467(_0x12d336,_0x5e8694){_0x12d336=_0x12d336-0xf0;const _0x47128f=a142_0x4712();let _0xb46722=_0x47128f[_0x12d336];return _0xb46722;}function a142_0x4712(){const _0x405f78=['pagesize','length','284NpXDAf','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','Use\x20one\x20of:\x20','2bBsbFK','Page\x20size\x20(1-100)','validation','includes','Filter\x20by\x20role\x20type','1337100zvHteF','704073QRNlZW','read','type','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','page','trim','join','list','str','filter','517916qGMFDf','747048kQIBQq','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','number','212063BomGtu','num','1015110KakAGN','appCode','CUSTOM','DEV','string','13855IhVShX'];a142_0x4712=function(){return _0x405f78;};return a142_0x4712();}
1
+ const a146_0x334da7=a146_0x1629;function a146_0x4d88(){const _0x20efa9=['length','9108yThHjK','str','filter','string','1deIgBH','ADMIN','DEV','num','roleType','Use\x20one\x20of:\x20','819216RBDEnA','4741868nWsNcj','page','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','list','validation','Found\x20','number','trim','24OddCjl','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','Page\x20size\x20(1-100)','USER','includes','type','Filter\x20by\x20role\x20type','6rFiltb','CUSTOM','2297652diQtLw','\x20role(s)','Page\x20index\x20(1-based)','7410Pfhdbo','6981464GnRHLH','99Fnyzkc','5HwVLaE','393746GFjtYm','toUpperCase','appCode','Invalid\x20--type\x20\x22','12019384hJrYAi','pagesize'];a146_0x4d88=function(){return _0x20efa9;};return a146_0x4d88();}function a146_0x1629(_0x2ab815,_0x2d681a){_0x2ab815=_0x2ab815-0x116;const _0x4d887a=a146_0x4d88();let _0x162956=_0x4d887a[_0x2ab815];return _0x162956;}(function(_0xff88b1,_0x5435fc){const _0x354fab=a146_0x1629,_0x5c6c90=_0xff88b1();while(!![]){try{const _0x471d68=parseInt(_0x354fab(0x137))/0x1*(-parseInt(_0x354fab(0x12c))/0x2)+parseInt(_0x354fab(0x125))/0x3+parseInt(_0x354fab(0x13e))/0x4*(parseInt(_0x354fab(0x12b))/0x5)+-parseInt(_0x354fab(0x123))/0x6*(parseInt(_0x354fab(0x129))/0x7)+-parseInt(_0x354fab(0x13d))/0x8*(parseInt(_0x354fab(0x12a))/0x9)+parseInt(_0x354fab(0x128))/0xa*(-parseInt(_0x354fab(0x133))/0xb)+-parseInt(_0x354fab(0x11c))/0xc*(-parseInt(_0x354fab(0x130))/0xd);if(_0x471d68===_0x5435fc)break;else _0x5c6c90['push'](_0x5c6c90['shift']());}catch(_0x1696a5){_0x5c6c90['push'](_0x5c6c90['shift']());}}}(a146_0x4d88,0xd37f4));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=[a146_0x334da7(0x138),a146_0x334da7(0x139),a146_0x334da7(0x11f),a146_0x334da7(0x124)];export const roleList={'service':'role','command':a146_0x334da7(0x117),'description':a146_0x334da7(0x116),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a146_0x334da7(0x121),'type':a146_0x334da7(0x136),'required':![],'description':a146_0x334da7(0x122),'enum':ROLE_TYPES},{'name':a146_0x334da7(0x13f),'type':a146_0x334da7(0x11a),'description':a146_0x334da7(0x127),'default':0x1},{'name':a146_0x334da7(0x131),'type':'number','description':a146_0x334da7(0x11e),'default':0x64}],async 'validate'(_0x586d51){const _0x29b997=a146_0x334da7,_0x493451=_0x586d51[_0x29b997(0x134)]('type')['trim']();if(_0x493451&&!ROLE_TYPES[_0x29b997(0x120)](_0x493451[_0x29b997(0x12d)]()))throw CliErrors['validation'](_0x29b997(0x12f)+_0x493451+'\x22.',_0x29b997(0x13c)+ROLE_TYPES['join'](',\x20')+'.');const _0xa273f0=_0x586d51[_0x29b997(0x13a)](_0x29b997(0x13f),0x1),_0x376365=_0x586d51[_0x29b997(0x13a)](_0x29b997(0x131),0x64);if(_0xa273f0<0x1)throw CliErrors[_0x29b997(0x118)](_0x29b997(0x11d));if(_0x376365<0x1||_0x376365>0x64)throw CliErrors['validation']('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x4a717e){const _0x4ab4f9=a146_0x334da7,_0x373ab1=_0x4a717e[_0x4ab4f9(0x13a)](_0x4ab4f9(0x13f),0x1)||0x1,_0x2ccabc=_0x4a717e[_0x4ab4f9(0x13a)]('pagesize',0x64)||0x64,_0x2f9bed=_0x4a717e[_0x4ab4f9(0x134)](_0x4ab4f9(0x121))[_0x4ab4f9(0x11b)]()[_0x4ab4f9(0x12d)](),{items:_0xfac244,paging:_0x301197}=await listAppRoles(_0x4a717e[_0x4ab4f9(0x12e)],{'currentPage':_0x373ab1,'pageSize':_0x2ccabc}),_0x36e192=_0x2f9bed?_0xfac244[_0x4ab4f9(0x135)](_0x165b92=>_0x165b92[_0x4ab4f9(0x13b)]===_0x2f9bed):_0xfac244,_0x5042d7=_0x36e192['map'](projectRole);return{'ok':!![],'data':{'roles':_0x5042d7,'paging':_0x301197},'message':_0x4ab4f9(0x119)+_0x5042d7[_0x4ab4f9(0x132)]+_0x4ab4f9(0x126)};}};
@@ -1 +1 @@
1
- const a143_0x212a93=a143_0x24ad;function a143_0x5b37(){const _0x254a87=['roleType','DEV','userList','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','push','ADMIN','Missing\x20user\x20reference.','Pass\x20--role\x20<id|name>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','\x22\x20is\x20ambiguous\x20(ids:\x20','196473AkSfdo','number','\x20member(s)\x20but\x20role\x20has\x20','role','\x20not\x20found\x20in\x20app\x20','find','tenant_code','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','Role\x20name\x20\x22','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','filter','includes','USER','12KukfTF','\x20not\x20found\x20in\x20the\x20user-role\x20list.','name','splice','userId','Disambiguate\x20with\x20--user\x20<id>.','user','validation','authRequired','userCount','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','join','expect-user-count','remark','string','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','roleName','flagMissing','map','test','Cannot\x20','trim','user-add','4022ZRuONB','nickname','/smartapi/permit/user-role/update-user-list','\x22\x20not\x20found\x20in\x20app\x20','No\x20tenant\x20member\x20matches\x20\x22','Anti-drift\x20check\x20failed:\x20expected\x20','Pass\x20--user\x20<id|name>.','permitCount','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','POST','Disambiguate\x20with\x20--role\x20<id>.','CUSTOM','4628150iDRosw',';\x20no\x20change.','str','toLowerCase','username','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Optional\x20role\x20remark/description','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','1206Xivgye','length','78095NhvjLP','31129xeFeEi','flag','129SibSvY','10936gODqKz','User\x20','tenant','Role\x20id\x20','\x22:\x20','findIndex','\x20built-in\x20role\x20','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','334684NGMQLQ','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Role\x20id\x20(from\x20`role\x20list`)','appCode','expectUserCount'];a143_0x5b37=function(){return _0x254a87;};return a143_0x5b37();}(function(_0x127eed,_0x540321){const _0x311ab0=a143_0x24ad,_0x502c72=_0x127eed();while(!![]){try{const _0x5d929d=parseInt(_0x311ab0(0xbc))/0x1+-parseInt(_0x311ab0(0x89))/0x2*(-parseInt(_0x311ab0(0xa4))/0x3)+parseInt(_0x311ab0(0xad))/0x4+parseInt(_0x311ab0(0xa1))/0x5+parseInt(_0x311ab0(0x72))/0x6*(parseInt(_0x311ab0(0xa2))/0x7)+-parseInt(_0x311ab0(0xa5))/0x8*(-parseInt(_0x311ab0(0x9f))/0x9)+-parseInt(_0x311ab0(0x96))/0xa;if(_0x5d929d===_0x540321)break;else _0x502c72['push'](_0x502c72['shift']());}catch(_0x4fac52){_0x502c72['push'](_0x502c72['shift']());}}}(a143_0x5b37,0x1b385));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';function a143_0x24ad(_0xbbf427,_0x55db0b){_0xbbf427=_0xbbf427-0x6a;const _0x5b3767=a143_0x5b37();let _0x24ad3f=_0x5b3767[_0xbbf427];return _0x24ad3f;}import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a143_0x212a93(0xbd),'required':!![],'description':a143_0x212a93(0xaf)};export const ROLE_REF_FLAG={'name':a143_0x212a93(0xbf),'type':a143_0x212a93(0x80),'required':!![],'description':a143_0x212a93(0x6b)};export const USER_REF_FLAG={'name':'user','type':a143_0x212a93(0x80),'required':!![],'description':a143_0x212a93(0xac)};export const NAME_FLAG={'name':'name','type':a143_0x212a93(0x80),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':'name','type':a143_0x212a93(0x80),'required':!![],'description':a143_0x212a93(0x9c)};export const REMARK_FLAG={'name':a143_0x212a93(0x7f),'type':a143_0x212a93(0x80),'required':![],'description':a143_0x212a93(0x9d)};export const EXPECT_USER_COUNT_FLAG={'name':a143_0x212a93(0x7e),'type':a143_0x212a93(0xbd),'required':![],'description':a143_0x212a93(0x6e)};export const BUILTIN_ROLE_TYPES=[a143_0x212a93(0xb7),a143_0x212a93(0xb3),a143_0x212a93(0x71)];export function isBuiltinRole(_0x1adaf2){return BUILTIN_ROLE_TYPES['includes'](_0x1adaf2);}export function assertCustomRole(_0x52b9ac,_0x4ace83){const _0x39d186=a143_0x212a93;if(_0x52b9ac[_0x39d186(0xb2)]!==_0x39d186(0x95))throw CliErrors[_0x39d186(0x79)](_0x39d186(0x86)+_0x4ace83+_0x39d186(0xab)+_0x52b9ac['roleName']+'\x20('+_0x52b9ac[_0x39d186(0xb2)]+').',_0x39d186(0x9e));}export function assertPermConfigurable(_0xf6b897){const _0x55596b=a143_0x212a93;if(_0xf6b897[_0x55596b(0xb2)]===_0x55596b(0xb3)||_0xf6b897[_0x55596b(0xb2)]===_0x55596b(0xb7))throw CliErrors[_0x55596b(0x79)](_0x55596b(0x92)+_0xf6b897['roleName']+'\x20('+_0xf6b897[_0x55596b(0xb2)]+').',_0x55596b(0x6c));}export function projectRole(_0x24c8ae){const _0x3502fd=a143_0x212a93;return{'id':_0x24c8ae['id'],'roleName':_0x24c8ae[_0x3502fd(0x82)],'roleType':_0x24c8ae[_0x3502fd(0xb2)],'remark':_0x24c8ae[_0x3502fd(0x7f)],'userCount':_0x24c8ae[_0x3502fd(0x7b)],'permitCount':_0x24c8ae[_0x3502fd(0x90)],'builtin':isBuiltinRole(_0x24c8ae[_0x3502fd(0xb2)])};}export async function resolveRoleRef(_0x703074,_0x1d5a98){const _0x4326ac=a143_0x212a93,_0x2b5c77=_0x1d5a98[_0x4326ac(0x87)]();if(!_0x2b5c77)throw CliErrors['validation']('Missing\x20role\x20reference.','Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x2b5c77))return getRoleById(_0x703074,Number(_0x2b5c77));const _0x5c0331=await listAllAppRoles(_0x703074),_0x3aa34f=_0x5c0331[_0x4326ac(0x6f)](_0x5c7389=>_0x5c7389[_0x4326ac(0x82)]===_0x2b5c77);if(_0x3aa34f[_0x4326ac(0xa0)]===0x0)throw CliErrors[_0x4326ac(0x79)](_0x4326ac(0x6d)+_0x2b5c77+_0x4326ac(0x8c)+_0x703074+'.',_0x4326ac(0xba));if(_0x3aa34f[_0x4326ac(0xa0)]>0x1){const _0x7be9cb=_0x3aa34f['map'](_0x33846e=>_0x33846e['id'])[_0x4326ac(0x7d)](',\x20');throw CliErrors[_0x4326ac(0x79)](_0x4326ac(0x6d)+_0x2b5c77+_0x4326ac(0xbb)+_0x7be9cb+').',_0x4326ac(0x94));}return _0x3aa34f[0x0];}export async function getRoleById(_0x559a66,_0x4f132c){const _0x4578ac=a143_0x212a93,_0x2873e5=await getAppRole(_0x4f132c);if(!_0x2873e5)throw CliErrors[_0x4578ac(0x79)](_0x4578ac(0xa8)+_0x4f132c+_0x4578ac(0xc0)+_0x559a66+'.',_0x4578ac(0xae));return _0x2873e5;}async function listAllAppRoles(_0x226060){const _0x25e40d=a143_0x212a93,_0x106952=0x64,_0x1eb374=[];for(let _0x41fd6e=0x1;;_0x41fd6e+=0x1){const {items:_0x50ec10,paging:_0x5cf9d5}=await listAppRoles(_0x226060,{'currentPage':_0x41fd6e,'pageSize':_0x106952});_0x1eb374[_0x25e40d(0xb6)](..._0x50ec10);if(_0x50ec10[_0x25e40d(0xa0)]<_0x106952||_0x5cf9d5&&_0x1eb374[_0x25e40d(0xa0)]>=_0x5cf9d5['totalCount'])return _0x1eb374;}}export async function resolveTenantCode(){const _0x582a69=a143_0x212a93,_0x583c4b=await getSessionUserInfo(),_0x5a7ded=_0x583c4b?.[_0x582a69(0x78)]?.[_0x582a69(0xa7)]?.[_0x582a69(0x6a)];if(!_0x5a7ded)throw CliErrors[_0x582a69(0x7a)](_0x582a69(0x81));return _0x5a7ded;}function matchMember(_0x46c117,_0x2eb3cc){const _0x2aaab6=a143_0x212a93,_0x4e504f=_0x2eb3cc[_0x2aaab6(0x87)]()[_0x2aaab6(0x99)]();return(_0x46c117['nickname']??'')[_0x2aaab6(0x99)]()===_0x4e504f||(_0x46c117[_0x2aaab6(0x9a)]??'')[_0x2aaab6(0x99)]()===_0x4e504f;}export async function resolveUserRef(_0x441634){const _0x13c5bf=a143_0x212a93,_0xb251a5=_0x441634[_0x13c5bf(0x87)]();if(!_0xb251a5)throw CliErrors[_0x13c5bf(0x79)](_0x13c5bf(0xb8),_0x13c5bf(0x8f));const _0x661f5c=await resolveTenantCode(),_0x417b7f=await getTenantMembers(_0x661f5c);if(/^\d+$/[_0x13c5bf(0x85)](_0xb251a5)){const _0x18895c=Number(_0xb251a5),_0x51f2e0=_0x417b7f[_0x13c5bf(0xc1)](_0x19496d=>_0x19496d[_0x13c5bf(0x76)]===_0x18895c);return{'userId':_0x18895c,'username':_0x51f2e0?.[_0x13c5bf(0x9a)]??String(_0x18895c),'nickname':_0x51f2e0?.[_0x13c5bf(0x8a)],'matchedBy':'id'};}const _0x576209=_0x417b7f['filter'](_0x4e47c2=>matchMember(_0x4e47c2,_0xb251a5));if(_0x576209[_0x13c5bf(0xa0)]===0x0)throw CliErrors[_0x13c5bf(0x79)](_0x13c5bf(0x8d)+_0xb251a5+'\x22.',_0x13c5bf(0xb5));if(_0x576209[_0x13c5bf(0xa0)]>0x1){const _0x4171b9=_0x576209[_0x13c5bf(0x84)](_0x15b62d=>(_0x15b62d[_0x13c5bf(0x8a)]??_0x15b62d[_0x13c5bf(0x9a)]??'?')+'('+_0x15b62d[_0x13c5bf(0x76)]+')')[_0x13c5bf(0x7d)](',\x20');throw CliErrors['validation']('Multiple\x20tenant\x20members\x20match\x20\x22'+_0xb251a5+_0x13c5bf(0xa9)+_0x4171b9+'.',_0x13c5bf(0x77));}const _0xf3fc14=_0x576209[0x0];return{'userId':_0xf3fc14['userId'],'username':_0xf3fc14[_0x13c5bf(0x9a)]??String(_0xf3fc14[_0x13c5bf(0x76)]),'nickname':_0xf3fc14['nickname'],'matchedBy':_0x13c5bf(0x74)};}export const UPDATE_USER_LIST_PATH=a143_0x212a93(0x8b);function userIdsOf(_0x2d9335){const _0x285c39=a143_0x212a93;return(_0x2d9335?.[_0x285c39(0xb4)]??[])['map'](_0x170564=>_0x170564[_0x285c39(0x76)]);}export function computeRoleUserMutation(_0x4261cc){const _0x51f4bd=a143_0x212a93,{operation:_0x2a05f5,appCode:_0x5d5881,roleUsers:_0x213dff,targetRoleId:_0x403370,user:_0x291a9d}=_0x4261cc,_0xca37ba=_0x213dff[_0x51f4bd(0xc1)](_0x3f7dd1=>_0x3f7dd1['id']===_0x403370);if(!_0xca37ba)throw CliErrors['validation'](_0x51f4bd(0xa8)+_0x403370+_0x51f4bd(0x73),_0x51f4bd(0xae));const _0x20d015=userIdsOf(_0xca37ba),_0x5ee56f=[];if(_0x4261cc[_0x51f4bd(0xb1)]!==undefined&&_0x4261cc[_0x51f4bd(0xb1)]!==_0x20d015[_0x51f4bd(0xa0)])throw CliErrors[_0x51f4bd(0x79)](_0x51f4bd(0x8e)+_0x4261cc[_0x51f4bd(0xb1)]+_0x51f4bd(0xbe)+_0x20d015['length']+'.',_0x51f4bd(0x7c));const _0x5f4517=_0x20d015[_0x51f4bd(0x70)](_0x291a9d[_0x51f4bd(0x76)]);let _0x27795e=![];const _0x564adb=[..._0xca37ba[_0x51f4bd(0xb4)]];if(_0x2a05f5===_0x51f4bd(0x88))_0x5f4517?_0x5ee56f[_0x51f4bd(0xb6)]('User\x20'+_0x291a9d[_0x51f4bd(0x76)]+_0x51f4bd(0x9b)+_0xca37ba['roleName']+';\x20no\x20change.'):(_0x564adb['push']({'userId':_0x291a9d['userId'],'username':_0x291a9d[_0x51f4bd(0x9a)],..._0x291a9d[_0x51f4bd(0x8a)]?{'nickname':_0x291a9d[_0x51f4bd(0x8a)]}:{}}),_0x27795e=!![]);else{if(!_0x5f4517)_0x5ee56f[_0x51f4bd(0xb6)](_0x51f4bd(0xa6)+_0x291a9d[_0x51f4bd(0x76)]+_0x51f4bd(0x91)+_0xca37ba[_0x51f4bd(0x82)]+_0x51f4bd(0x97));else{const _0x4e49d5=_0x564adb[_0x51f4bd(0xaa)](_0x36c561=>_0x36c561[_0x51f4bd(0x76)]===_0x291a9d['userId']);if(_0x4e49d5>=0x0)_0x564adb[_0x51f4bd(0x75)](_0x4e49d5,0x1);_0x27795e=!![];}}const _0x1966d2=_0x213dff['map'](_0x41e91d=>_0x41e91d['id']===_0x403370?{..._0x41e91d,'userList':_0x564adb}:_0x41e91d),_0x55b482=_0x564adb['map'](_0x5c0b5d=>_0x5c0b5d['userId']),_0x2d6f5b={'operation':_0x2a05f5,'selector':{'appCode':_0x5d5881,'roleId':_0x403370,'roleName':_0xca37ba[_0x51f4bd(0x82)],'userId':_0x291a9d[_0x51f4bd(0x76)]},'before':{'userIds':_0x20d015},'after':{'userIds':_0x55b482},'dryRun':_0x4261cc['dryRun'],'backend':{'method':_0x51f4bd(0x93),'path':UPDATE_USER_LIST_PATH},'warnings':_0x5ee56f};return{'roleList':_0x1966d2,'mutation':_0x2d6f5b,'changed':_0x27795e};}export async function loadRoleUsers(_0x58b42b){return listRoleUsers(_0x58b42b);}export function readRoleRef(_0x22658a){const _0x3c49a5=a143_0x212a93,_0x27aa83=_0x22658a[_0x3c49a5(0x98)]('role')[_0x3c49a5(0x87)]();if(!_0x27aa83)throw CliErrors[_0x3c49a5(0x83)]('role',_0x3c49a5(0xb9));return _0x27aa83;}export async function prepareUserMutation(_0x4343fe,_0x2f7e42,_0x3d8643){const _0x29dc62=a143_0x212a93,_0x5c4eb0=readRoleRef(_0x4343fe),_0x8ddb46=_0x4343fe['str'](_0x29dc62(0x78))[_0x29dc62(0x87)]();if(!_0x8ddb46)throw CliErrors['flagMissing'](_0x29dc62(0x78),_0x29dc62(0x8f));const _0x1c9ad2=_0x4343fe[_0x29dc62(0xa3)](_0x29dc62(0x7e)),_0x2e1744=_0x1c9ad2===undefined||_0x1c9ad2===null?undefined:Number(_0x1c9ad2),_0x185c72=await resolveRoleRef(_0x4343fe[_0x29dc62(0xb0)],_0x5c4eb0),_0x3f6c27=await resolveUserRef(_0x8ddb46),_0x173428=await loadRoleUsers(_0x4343fe[_0x29dc62(0xb0)]);return computeRoleUserMutation({'operation':_0x2f7e42,'appCode':_0x4343fe[_0x29dc62(0xb0)],'roleUsers':_0x173428,'targetRoleId':_0x185c72['id'],'user':{'userId':_0x3f6c27[_0x29dc62(0x76)],'username':_0x3f6c27[_0x29dc62(0x9a)],'nickname':_0x3f6c27['nickname']},'dryRun':_0x3d8643,..._0x2e1744!==undefined?{'expectUserCount':_0x2e1744}:{}});}
1
+ const a147_0x3dfbef=a147_0x2231;(function(_0x5e229d,_0x30cfbb){const _0xdf0420=a147_0x2231,_0x3f2e64=_0x5e229d();while(!![]){try{const _0x243605=parseInt(_0xdf0420(0x21d))/0x1+parseInt(_0xdf0420(0x225))/0x2*(parseInt(_0xdf0420(0x204))/0x3)+parseInt(_0xdf0420(0x222))/0x4*(parseInt(_0xdf0420(0x20a))/0x5)+-parseInt(_0xdf0420(0x21e))/0x6+-parseInt(_0xdf0420(0x1f8))/0x7+-parseInt(_0xdf0420(0x1fa))/0x8+parseInt(_0xdf0420(0x216))/0x9;if(_0x243605===_0x30cfbb)break;else _0x3f2e64['push'](_0x3f2e64['shift']());}catch(_0x2bacf3){_0x3f2e64['push'](_0x3f2e64['shift']());}}}(a147_0x2e0b,0x51782));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':a147_0x3dfbef(0x1fb),'required':!![],'description':a147_0x3dfbef(0x211)};export const ROLE_REF_FLAG={'name':a147_0x3dfbef(0x1fc),'type':a147_0x3dfbef(0x202),'required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':a147_0x3dfbef(0x1de),'type':a147_0x3dfbef(0x202),'required':!![],'description':a147_0x3dfbef(0x1f3)};export const NAME_FLAG={'name':a147_0x3dfbef(0x210),'type':'string','required':!![],'description':a147_0x3dfbef(0x229)};export const USER_NAME_FLAG={'name':a147_0x3dfbef(0x210),'type':'string','required':!![],'description':a147_0x3dfbef(0x207)};function a147_0x2231(_0x17a248,_0x520abc){_0x17a248=_0x17a248-0x1de;const _0x2e0b76=a147_0x2e0b();let _0x223185=_0x2e0b76[_0x17a248];return _0x223185;}export const REMARK_FLAG={'name':'remark','type':a147_0x3dfbef(0x202),'required':![],'description':a147_0x3dfbef(0x21c)};export const EXPECT_USER_COUNT_FLAG={'name':a147_0x3dfbef(0x217),'type':a147_0x3dfbef(0x1fb),'required':![],'description':a147_0x3dfbef(0x1e3)};export const BUILTIN_ROLE_TYPES=[a147_0x3dfbef(0x201),a147_0x3dfbef(0x20d),a147_0x3dfbef(0x1e1)];export function isBuiltinRole(_0x21d3b9){const _0x53e0df=a147_0x3dfbef;return BUILTIN_ROLE_TYPES[_0x53e0df(0x21a)](_0x21d3b9);}export function assertCustomRole(_0x368988,_0x3e3bd9){const _0x2400e6=a147_0x3dfbef;if(_0x368988[_0x2400e6(0x1fd)]!==_0x2400e6(0x1ec))throw CliErrors['validation'](_0x2400e6(0x226)+_0x3e3bd9+_0x2400e6(0x1e6)+_0x368988[_0x2400e6(0x20f)]+'\x20('+_0x368988['roleType']+').',_0x2400e6(0x212));}export function assertPermConfigurable(_0x4ad6f8){const _0x6833d7=a147_0x3dfbef;if(_0x4ad6f8[_0x6833d7(0x1fd)]==='DEV'||_0x4ad6f8['roleType']===_0x6833d7(0x201))throw CliErrors[_0x6833d7(0x1ee)]('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x4ad6f8['roleName']+'\x20('+_0x4ad6f8['roleType']+').',_0x6833d7(0x1ea));}export function projectRole(_0x4ec584){const _0x5e246f=a147_0x3dfbef;return{'id':_0x4ec584['id'],'roleName':_0x4ec584[_0x5e246f(0x20f)],'roleType':_0x4ec584[_0x5e246f(0x1fd)],'remark':_0x4ec584[_0x5e246f(0x20b)],'userCount':_0x4ec584['userCount'],'permitCount':_0x4ec584[_0x5e246f(0x1df)],'builtin':isBuiltinRole(_0x4ec584[_0x5e246f(0x1fd)])};}export async function resolveRoleRef(_0x494bb0,_0x1cdaf4){const _0x553669=a147_0x3dfbef,_0x485cb8=_0x1cdaf4[_0x553669(0x215)]();if(!_0x485cb8)throw CliErrors[_0x553669(0x1ee)](_0x553669(0x1e8),_0x553669(0x220));if(/^\d+$/[_0x553669(0x223)](_0x485cb8))return getRoleById(_0x494bb0,Number(_0x485cb8));const _0x316b88=await listAllAppRoles(_0x494bb0),_0x4477e9=_0x316b88['filter'](_0x1abc02=>_0x1abc02['roleName']===_0x485cb8);if(_0x4477e9[_0x553669(0x21f)]===0x0)throw CliErrors[_0x553669(0x1ee)]('Role\x20name\x20\x22'+_0x485cb8+_0x553669(0x1e7)+_0x494bb0+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x4477e9[_0x553669(0x21f)]>0x1){const _0x23b8f6=_0x4477e9[_0x553669(0x1ef)](_0x539e7a=>_0x539e7a['id'])['join'](',\x20');throw CliErrors['validation']('Role\x20name\x20\x22'+_0x485cb8+_0x553669(0x214)+_0x23b8f6+').',_0x553669(0x227));}return _0x4477e9[0x0];}function a147_0x2e0b(){const _0x14bdc5=['authRequired','push','\x20built-in\x20role\x20','\x22\x20not\x20found\x20in\x20app\x20','Missing\x20role\x20reference.','Anti-drift\x20check\x20failed:\x20expected\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','flag','CUSTOM','Pass\x20--user\x20<id|name>.','validation','map','totalCount','\x20is\x20not\x20a\x20member\x20of\x20role\x20','username','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','filter','findIndex','dryRun','flagMissing','2604609jKdyHC','toLowerCase','4800912bMeuiy','number','role','roleType','userList','\x20is\x20already\x20a\x20member\x20of\x20role\x20','find','ADMIN','string','nickname','39idIrFD','POST',';\x20no\x20change.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Disambiguate\x20with\x20--user\x20<id>.','appCode','800050kNQJgp','remark','\x20member(s)\x20but\x20role\x20has\x20','DEV','Role\x20id\x20','roleName','name','Role\x20id\x20(from\x20`role\x20list`)','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','join','\x22\x20is\x20ambiguous\x20(ids:\x20','trim','5693589XkDUVs','expect-user-count','expectUserCount','tenant_code','includes','\x20not\x20found\x20in\x20app\x20','Optional\x20role\x20remark/description','661419hBelcv','1802988fnPSUo','length','Pass\x20--role\x20<id|name>.','str','4HsXAKh','test','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','23438jFoJqG','Cannot\x20','Disambiguate\x20with\x20--role\x20<id>.','No\x20tenant\x20member\x20matches\x20\x22','Role\x20name','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','userId','user','permitCount','Multiple\x20tenant\x20members\x20match\x20\x22','USER','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'];a147_0x2e0b=function(){return _0x14bdc5;};return a147_0x2e0b();}export async function getRoleById(_0x463ec9,_0x326628){const _0x5e4731=a147_0x3dfbef,_0x51d14f=await getAppRole(_0x326628);if(!_0x51d14f)throw CliErrors['validation'](_0x5e4731(0x20e)+_0x326628+_0x5e4731(0x21b)+_0x463ec9+'.',_0x5e4731(0x224));return _0x51d14f;}async function listAllAppRoles(_0x57cc42){const _0x506078=a147_0x3dfbef,_0x4ef83d=0x64,_0x121877=[];for(let _0x5c1952=0x1;;_0x5c1952+=0x1){const {items:_0x45bb10,paging:_0x301976}=await listAppRoles(_0x57cc42,{'currentPage':_0x5c1952,'pageSize':_0x4ef83d});_0x121877[_0x506078(0x1e5)](..._0x45bb10);if(_0x45bb10[_0x506078(0x21f)]<_0x4ef83d||_0x301976&&_0x121877['length']>=_0x301976[_0x506078(0x1f0)])return _0x121877;}}export async function resolveTenantCode(){const _0x5abf1c=a147_0x3dfbef,_0x40b23d=await getSessionUserInfo(),_0x58816e=_0x40b23d?.['user']?.['tenant']?.[_0x5abf1c(0x219)];if(!_0x58816e)throw CliErrors[_0x5abf1c(0x1e4)](_0x5abf1c(0x22b));return _0x58816e;}function matchMember(_0x994389,_0x101cff){const _0x40dfcc=a147_0x3dfbef,_0x56af7a=_0x101cff[_0x40dfcc(0x215)]()[_0x40dfcc(0x1f9)]();return(_0x994389[_0x40dfcc(0x203)]??'')[_0x40dfcc(0x1f9)]()===_0x56af7a||(_0x994389[_0x40dfcc(0x1f2)]??'')['toLowerCase']()===_0x56af7a;}export async function resolveUserRef(_0x2da609){const _0x4e246b=a147_0x3dfbef,_0x364554=_0x2da609[_0x4e246b(0x215)]();if(!_0x364554)throw CliErrors['validation']('Missing\x20user\x20reference.','Pass\x20--user\x20<id|name>.');const _0x155b21=await resolveTenantCode(),_0x1f35ba=await getTenantMembers(_0x155b21);if(/^\d+$/[_0x4e246b(0x223)](_0x364554)){const _0x4df940=Number(_0x364554),_0x4815b4=_0x1f35ba[_0x4e246b(0x200)](_0x37be3e=>_0x37be3e['userId']===_0x4df940);return{'userId':_0x4df940,'username':_0x4815b4?.[_0x4e246b(0x1f2)]??String(_0x4df940),'nickname':_0x4815b4?.[_0x4e246b(0x203)],'matchedBy':'id'};}const _0x54171e=_0x1f35ba[_0x4e246b(0x1f4)](_0x2aba05=>matchMember(_0x2aba05,_0x364554));if(_0x54171e[_0x4e246b(0x21f)]===0x0)throw CliErrors[_0x4e246b(0x1ee)](_0x4e246b(0x228)+_0x364554+'\x22.',_0x4e246b(0x22a));if(_0x54171e[_0x4e246b(0x21f)]>0x1){const _0x3612d4=_0x54171e[_0x4e246b(0x1ef)](_0x14eabc=>(_0x14eabc['nickname']??_0x14eabc[_0x4e246b(0x1f2)]??'?')+'('+_0x14eabc[_0x4e246b(0x22c)]+')')[_0x4e246b(0x213)](',\x20');throw CliErrors[_0x4e246b(0x1ee)](_0x4e246b(0x1e0)+_0x364554+'\x22:\x20'+_0x3612d4+'.',_0x4e246b(0x208));}const _0x4db788=_0x54171e[0x0];return{'userId':_0x4db788[_0x4e246b(0x22c)],'username':_0x4db788['username']??String(_0x4db788[_0x4e246b(0x22c)]),'nickname':_0x4db788['nickname'],'matchedBy':_0x4e246b(0x210)};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x17ddd0){const _0x4381a0=a147_0x3dfbef;return(_0x17ddd0?.[_0x4381a0(0x1fe)]??[])[_0x4381a0(0x1ef)](_0x1fe409=>_0x1fe409[_0x4381a0(0x22c)]);}export function computeRoleUserMutation(_0x7363ab){const _0x238233=a147_0x3dfbef,{operation:_0x3ca898,appCode:_0x3c216a,roleUsers:_0x34ab44,targetRoleId:_0x49f436,user:_0x5dee96}=_0x7363ab,_0x1f3d34=_0x34ab44[_0x238233(0x200)](_0x14af23=>_0x14af23['id']===_0x49f436);if(!_0x1f3d34)throw CliErrors[_0x238233(0x1ee)](_0x238233(0x20e)+_0x49f436+_0x238233(0x1e2),_0x238233(0x224));const _0xfedc34=userIdsOf(_0x1f3d34),_0x488421=[];if(_0x7363ab[_0x238233(0x218)]!==undefined&&_0x7363ab[_0x238233(0x218)]!==_0xfedc34[_0x238233(0x21f)])throw CliErrors[_0x238233(0x1ee)](_0x238233(0x1e9)+_0x7363ab[_0x238233(0x218)]+_0x238233(0x20c)+_0xfedc34[_0x238233(0x21f)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x728cfa=_0xfedc34[_0x238233(0x21a)](_0x5dee96[_0x238233(0x22c)]);let _0x52c56a=![];const _0x3b310c=[..._0x1f3d34[_0x238233(0x1fe)]];if(_0x3ca898==='user-add')_0x728cfa?_0x488421[_0x238233(0x1e5)]('User\x20'+_0x5dee96[_0x238233(0x22c)]+_0x238233(0x1ff)+_0x1f3d34['roleName']+_0x238233(0x206)):(_0x3b310c[_0x238233(0x1e5)]({'userId':_0x5dee96[_0x238233(0x22c)],'username':_0x5dee96[_0x238233(0x1f2)],..._0x5dee96['nickname']?{'nickname':_0x5dee96[_0x238233(0x203)]}:{}}),_0x52c56a=!![]);else{if(!_0x728cfa)_0x488421[_0x238233(0x1e5)]('User\x20'+_0x5dee96['userId']+_0x238233(0x1f1)+_0x1f3d34[_0x238233(0x20f)]+';\x20no\x20change.');else{const _0x4742a1=_0x3b310c[_0x238233(0x1f5)](_0x570dca=>_0x570dca[_0x238233(0x22c)]===_0x5dee96[_0x238233(0x22c)]);if(_0x4742a1>=0x0)_0x3b310c['splice'](_0x4742a1,0x1);_0x52c56a=!![];}}const _0x25328b=_0x34ab44[_0x238233(0x1ef)](_0x5c415b=>_0x5c415b['id']===_0x49f436?{..._0x5c415b,'userList':_0x3b310c}:_0x5c415b),_0x4dc636=_0x3b310c['map'](_0x4240a9=>_0x4240a9[_0x238233(0x22c)]),_0x439f89={'operation':_0x3ca898,'selector':{'appCode':_0x3c216a,'roleId':_0x49f436,'roleName':_0x1f3d34[_0x238233(0x20f)],'userId':_0x5dee96[_0x238233(0x22c)]},'before':{'userIds':_0xfedc34},'after':{'userIds':_0x4dc636},'dryRun':_0x7363ab[_0x238233(0x1f6)],'backend':{'method':_0x238233(0x205),'path':UPDATE_USER_LIST_PATH},'warnings':_0x488421};return{'roleList':_0x25328b,'mutation':_0x439f89,'changed':_0x52c56a};}export async function loadRoleUsers(_0x2e6a4d){return listRoleUsers(_0x2e6a4d);}export function readRoleRef(_0x19c67c){const _0x91d6d1=a147_0x3dfbef,_0x67328d=_0x19c67c[_0x91d6d1(0x221)](_0x91d6d1(0x1fc))['trim']();if(!_0x67328d)throw CliErrors[_0x91d6d1(0x1f7)](_0x91d6d1(0x1fc),_0x91d6d1(0x220));return _0x67328d;}export async function prepareUserMutation(_0x2a5cda,_0x4a2fc8,_0x18a656){const _0x4c2b40=a147_0x3dfbef,_0x5eb463=readRoleRef(_0x2a5cda),_0x19136f=_0x2a5cda[_0x4c2b40(0x221)](_0x4c2b40(0x1de))[_0x4c2b40(0x215)]();if(!_0x19136f)throw CliErrors['flagMissing']('user',_0x4c2b40(0x1ed));const _0x442753=_0x2a5cda[_0x4c2b40(0x1eb)](_0x4c2b40(0x217)),_0x1a8d40=_0x442753===undefined||_0x442753===null?undefined:Number(_0x442753),_0x3a49e4=await resolveRoleRef(_0x2a5cda[_0x4c2b40(0x209)],_0x5eb463),_0x50ecb4=await resolveUserRef(_0x19136f),_0x13e367=await loadRoleUsers(_0x2a5cda[_0x4c2b40(0x209)]);return computeRoleUserMutation({'operation':_0x4a2fc8,'appCode':_0x2a5cda['appCode'],'roleUsers':_0x13e367,'targetRoleId':_0x3a49e4['id'],'user':{'userId':_0x50ecb4[_0x4c2b40(0x22c)],'username':_0x50ecb4[_0x4c2b40(0x1f2)],'nickname':_0x50ecb4[_0x4c2b40(0x203)]},'dryRun':_0x18a656,..._0x1a8d40!==undefined?{'expectUserCount':_0x1a8d40}:{}});}
@@ -1 +1 @@
1
- const a144_0x59cdbe=a144_0x8721;(function(_0x1216a7,_0x3d17a6){const _0x17f5f0=a144_0x8721,_0x40a0cf=_0x1216a7();while(!![]){try{const _0x2666e3=parseInt(_0x17f5f0(0x207))/0x1*(-parseInt(_0x17f5f0(0x1f7))/0x2)+parseInt(_0x17f5f0(0x1f6))/0x3*(-parseInt(_0x17f5f0(0x1fd))/0x4)+-parseInt(_0x17f5f0(0x1ff))/0x5*(parseInt(_0x17f5f0(0x1f4))/0x6)+parseInt(_0x17f5f0(0x209))/0x7+-parseInt(_0x17f5f0(0x1fa))/0x8+-parseInt(_0x17f5f0(0x1f9))/0x9*(parseInt(_0x17f5f0(0x1fe))/0xa)+parseInt(_0x17f5f0(0x20d))/0xb;if(_0x2666e3===_0x3d17a6)break;else _0x40a0cf['push'](_0x40a0cf['shift']());}catch(_0x4a005f){_0x40a0cf['push'](_0x40a0cf['shift']());}}}(a144_0x2972,0xa693c));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a144_0x8721(_0x88d179,_0x3f6146){_0x88d179=_0x88d179-0x1f3;const _0x297259=a144_0x2972();let _0x87211c=_0x297259[_0x88d179];return _0x87211c;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0xf364ba){const _0x37467d=a144_0x8721,_0x2d98ce=_0xf364ba[_0x37467d(0x205)](_0x37467d(0x20a)),_0x4ce004=_0xf364ba[_0x37467d(0x205)]('remark'),_0x3dbaf9={};if(_0x2d98ce!==undefined&&_0x2d98ce!==null){const _0x536990=String(_0x2d98ce)[_0x37467d(0x20c)]();if(!_0x536990)throw CliErrors[_0x37467d(0x208)]('--name\x20cannot\x20be\x20empty.');if(_0x536990[_0x37467d(0x1f3)]>0x40)throw CliErrors[_0x37467d(0x208)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x3dbaf9[_0x37467d(0x1f8)]=_0x536990;}_0x4ce004!==undefined&&_0x4ce004!==null&&(_0x3dbaf9['remark']=String(_0x4ce004));if(_0x3dbaf9['roleName']===undefined&&_0x3dbaf9[_0x37467d(0x1f5)]===undefined)throw CliErrors[_0x37467d(0x208)]('Nothing\x20to\x20update.',_0x37467d(0x1fb));return _0x3dbaf9;}function a144_0x2972(){const _0x2ff979=['8854993ovVvvd','name','role','trim','27590178sOFNjI','Updated\x20role\x20','appCode','length','3363090PCmrXw','remark','3051RrFclZ','6ZoVQOc','roleName','146016OOMQha','2405032lzTJEV','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','num','2364JcxOYd','240xykebx','5kvBIop','string','write','New\x20role\x20name','update','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','flag','POST','413110ptntEP','validation'];a144_0x2972=function(){return _0x2ff979;};return a144_0x2972();}export const roleUpdate={'service':a144_0x59cdbe(0x20b),'command':a144_0x59cdbe(0x203),'description':a144_0x59cdbe(0x204),'risk':a144_0x59cdbe(0x201),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a144_0x59cdbe(0x20a),'type':a144_0x59cdbe(0x200),'required':![],'description':a144_0x59cdbe(0x202)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x422012){readPatch(_0x422012);},async 'dryRun'(_0x488578){const _0x5a30d9=a144_0x59cdbe,_0x116758=_0x488578['num']('id'),_0x5193c9=readPatch(_0x488578),_0x42742c=await getRoleById(_0x488578[_0x5a30d9(0x20f)],_0x116758);return assertCustomRole(_0x42742c,_0x5a30d9(0x203)),asDryRunResult({'operation':'update','selector':{'appCode':_0x488578[_0x5a30d9(0x20f)],'roleId':_0x116758,'roleName':_0x42742c['roleName']},'before':projectRole(_0x42742c),'after':projectRole({..._0x42742c,..._0x5193c9['roleName']!==undefined?{'roleName':_0x5193c9[_0x5a30d9(0x1f8)]}:{},..._0x5193c9[_0x5a30d9(0x1f5)]!==undefined?{'remark':_0x5193c9[_0x5a30d9(0x1f5)]}:{}}),'dryRun':!![],'backend':{'method':_0x5a30d9(0x206),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0xea2ad7){const _0x1a7747=a144_0x59cdbe,_0x490055=_0xea2ad7[_0x1a7747(0x1fc)]('id'),_0x2a6e9e=readPatch(_0xea2ad7),_0x316bae=await getRoleById(_0xea2ad7[_0x1a7747(0x20f)],_0x490055);assertCustomRole(_0x316bae,_0x1a7747(0x203)),await updateAppRole({'id':_0x490055,'appCode':_0xea2ad7[_0x1a7747(0x20f)],..._0x2a6e9e[_0x1a7747(0x1f8)]!==undefined?{'roleName':_0x2a6e9e[_0x1a7747(0x1f8)]}:{},..._0x2a6e9e['remark']!==undefined?{'remark':_0x2a6e9e['remark']}:{}});const _0x3be282=await getRoleById(_0xea2ad7[_0x1a7747(0x20f)],_0x490055);return{'ok':!![],'data':{'operation':'update','selector':{'appCode':_0xea2ad7['appCode'],'roleId':_0x490055,'roleName':_0x3be282[_0x1a7747(0x1f8)]},'before':projectRole(_0x316bae),'after':projectRole(_0x3be282),'dryRun':![],'backend':{'method':_0x1a7747(0x206),'path':UPDATE_PATH},'warnings':[]},'message':_0x1a7747(0x20e)+_0x3be282[_0x1a7747(0x1f8)]+'\x20(id='+_0x490055+')'};}};
1
+ const a148_0x3fef77=a148_0x5bdf;(function(_0x3cbae4,_0xf9226f){const _0x97c751=a148_0x5bdf,_0x286c94=_0x3cbae4();while(!![]){try{const _0x2c527c=-parseInt(_0x97c751(0x147))/0x1+-parseInt(_0x97c751(0x135))/0x2*(parseInt(_0x97c751(0x134))/0x3)+parseInt(_0x97c751(0x12e))/0x4*(-parseInt(_0x97c751(0x12d))/0x5)+parseInt(_0x97c751(0x13b))/0x6+-parseInt(_0x97c751(0x146))/0x7*(-parseInt(_0x97c751(0x137))/0x8)+parseInt(_0x97c751(0x12c))/0x9*(parseInt(_0x97c751(0x148))/0xa)+parseInt(_0x97c751(0x141))/0xb*(parseInt(_0x97c751(0x133))/0xc);if(_0x2c527c===_0xf9226f)break;else _0x286c94['push'](_0x286c94['shift']());}catch(_0x4732cb){_0x286c94['push'](_0x286c94['shift']());}}}(a148_0x5211,0x6b56d));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a148_0x5bdf(_0x37a87b,_0x5d09e9){_0x37a87b=_0x37a87b-0x12c;const _0x521188=a148_0x5211();let _0x5bdf88=_0x521188[_0x37a87b];return _0x5bdf88;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a148_0x5211(){const _0x119a2e=['601726sYwyQj','2295860HteAdy','string','18oPrnyb','433130uAFzRc','24obTpcA','num','Nothing\x20to\x20update.','roleName','update','7728564fqVYfT','1599159iIoBIi','2FfhRJz','remark','6445936FqRnxn','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','New\x20role\x20name','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','1111410jKUddz','POST','trim','write','role','name','11bnUNBX','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','flag','appCode','Updated\x20role\x20','7ysmZYE'];a148_0x5211=function(){return _0x119a2e;};return a148_0x5211();}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(_0x2b307c){const _0x22ee7a=a148_0x5bdf,_0x14ce54=_0x2b307c['flag'](_0x22ee7a(0x140)),_0x34d113=_0x2b307c[_0x22ee7a(0x143)](_0x22ee7a(0x136)),_0x59d91e={};if(_0x14ce54!==undefined&&_0x14ce54!==null){const _0xc35bac=String(_0x14ce54)[_0x22ee7a(0x13d)]();if(!_0xc35bac)throw CliErrors['validation']('--name\x20cannot\x20be\x20empty.');if(_0xc35bac['length']>0x40)throw CliErrors['validation'](_0x22ee7a(0x142));_0x59d91e['roleName']=_0xc35bac;}_0x34d113!==undefined&&_0x34d113!==null&&(_0x59d91e[_0x22ee7a(0x136)]=String(_0x34d113));if(_0x59d91e[_0x22ee7a(0x131)]===undefined&&_0x59d91e['remark']===undefined)throw CliErrors['validation'](_0x22ee7a(0x130),_0x22ee7a(0x138));return _0x59d91e;}export const roleUpdate={'service':a148_0x3fef77(0x13f),'command':a148_0x3fef77(0x132),'description':a148_0x3fef77(0x13a),'risk':a148_0x3fef77(0x13e),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a148_0x3fef77(0x140),'type':a148_0x3fef77(0x149),'required':![],'description':a148_0x3fef77(0x139)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1233cf){readPatch(_0x1233cf);},async 'dryRun'(_0xd78191){const _0x5b9b4a=a148_0x3fef77,_0x39bc7e=_0xd78191['num']('id'),_0x9ef130=readPatch(_0xd78191),_0x5f44a9=await getRoleById(_0xd78191[_0x5b9b4a(0x144)],_0x39bc7e);return assertCustomRole(_0x5f44a9,_0x5b9b4a(0x132)),asDryRunResult({'operation':_0x5b9b4a(0x132),'selector':{'appCode':_0xd78191[_0x5b9b4a(0x144)],'roleId':_0x39bc7e,'roleName':_0x5f44a9[_0x5b9b4a(0x131)]},'before':projectRole(_0x5f44a9),'after':projectRole({..._0x5f44a9,..._0x9ef130[_0x5b9b4a(0x131)]!==undefined?{'roleName':_0x9ef130[_0x5b9b4a(0x131)]}:{},..._0x9ef130[_0x5b9b4a(0x136)]!==undefined?{'remark':_0x9ef130[_0x5b9b4a(0x136)]}:{}}),'dryRun':!![],'backend':{'method':_0x5b9b4a(0x13c),'path':UPDATE_PATH},'warnings':[]},{'method':_0x5b9b4a(0x13c),'url':UPDATE_PATH});},async 'execute'(_0x112227){const _0x5bf4c3=a148_0x3fef77,_0x5a164a=_0x112227[_0x5bf4c3(0x12f)]('id'),_0x4ceb58=readPatch(_0x112227),_0x4e9c5d=await getRoleById(_0x112227[_0x5bf4c3(0x144)],_0x5a164a);assertCustomRole(_0x4e9c5d,_0x5bf4c3(0x132)),await updateAppRole({'id':_0x5a164a,'appCode':_0x112227[_0x5bf4c3(0x144)],..._0x4ceb58['roleName']!==undefined?{'roleName':_0x4ceb58[_0x5bf4c3(0x131)]}:{},..._0x4ceb58[_0x5bf4c3(0x136)]!==undefined?{'remark':_0x4ceb58[_0x5bf4c3(0x136)]}:{}});const _0x35dbdc=await getRoleById(_0x112227[_0x5bf4c3(0x144)],_0x5a164a);return{'ok':!![],'data':{'operation':_0x5bf4c3(0x132),'selector':{'appCode':_0x112227[_0x5bf4c3(0x144)],'roleId':_0x5a164a,'roleName':_0x35dbdc[_0x5bf4c3(0x131)]},'before':projectRole(_0x4e9c5d),'after':projectRole(_0x35dbdc),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x5bf4c3(0x145)+_0x35dbdc[_0x5bf4c3(0x131)]+'\x20(id='+_0x5a164a+')'};}};
@@ -1 +1 @@
1
- const a145_0xa5dab9=a145_0x5ddc;(function(_0x5b7b71,_0x25eda9){const _0x13863e=a145_0x5ddc,_0x1770de=_0x5b7b71();while(!![]){try{const _0x5c1d9c=parseInt(_0x13863e(0x188))/0x1+parseInt(_0x13863e(0x18a))/0x2*(-parseInt(_0x13863e(0x186))/0x3)+parseInt(_0x13863e(0x190))/0x4+parseInt(_0x13863e(0x199))/0x5*(-parseInt(_0x13863e(0x192))/0x6)+-parseInt(_0x13863e(0x198))/0x7+parseInt(_0x13863e(0x191))/0x8+parseInt(_0x13863e(0x18b))/0x9;if(_0x5c1d9c===_0x25eda9)break;else _0x1770de['push'](_0x1770de['shift']());}catch(_0x287b66){_0x1770de['push'](_0x1770de['shift']());}}}(a145_0x3a85,0xb407c));import{updateRoleUsers}from'../../core/api-client.js';function a145_0x5ddc(_0x3f3146,_0x392f83){_0x3f3146=_0x3f3146-0x186;const _0x3a85e4=a145_0x3a85();let _0x5ddc8b=_0x3a85e4[_0x3f3146];return _0x5ddc8b;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a145_0x3a85(){const _0x5efd9d=['2688872mQXMPw','18RYjbvi','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','\x20to\x20role\x20','user-add','high-risk-write','Added\x20user\x20','3469137XPVqFJ','2380095iIToee','1149NKLOeE','\x20already\x20in\x20role\x20','822366ZzQDUO','appCode','5742aghKOI','16666335PEaoOr','roleName','userId','selector','role','3001420iOsenL'];a145_0x3a85=function(){return _0x5efd9d;};return a145_0x3a85();}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':a145_0xa5dab9(0x18f),'command':a145_0xa5dab9(0x195),'description':a145_0xa5dab9(0x193),'risk':a145_0xa5dab9(0x196),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x15120a){const _0x5ef9ad=a145_0xa5dab9,{mutation:_0x2138a8}=await prepareUserMutation(_0x15120a,_0x5ef9ad(0x195),!![]);return asDryRunResult(_0x2138a8,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0xa05302){const _0x1d4051=a145_0xa5dab9,{roleList:_0x4f87c8,mutation:_0x3792d4,changed:_0x3e811a}=await prepareUserMutation(_0xa05302,_0x1d4051(0x195),![]);return _0x3e811a&&await updateRoleUsers(_0xa05302[_0x1d4051(0x189)],_0x4f87c8),{'ok':!![],'data':_0x3792d4,'message':_0x3e811a?_0x1d4051(0x197)+_0x3792d4['selector'][_0x1d4051(0x18d)]+_0x1d4051(0x194)+_0x3792d4[_0x1d4051(0x18e)][_0x1d4051(0x18c)]:'No\x20change:\x20user\x20'+_0x3792d4['selector'][_0x1d4051(0x18d)]+_0x1d4051(0x187)+_0x3792d4[_0x1d4051(0x18e)][_0x1d4051(0x18c)]};}};
1
+ function a149_0x13bd(){const _0x37db5c=['selector','roleName','\x20already\x20in\x20role\x20','1xAyNHI','4073268NkpGcp','12498050qMcXCV','high-risk-write','user-add','6UGBVLl','22RkwKWR','userId','6619464BAQIJH','192734yeYCic','2673360XWnXwB','appCode','8501248zzWLFn','\x20to\x20role\x20','3086015gkZwgV','role','16UJDEOF'];a149_0x13bd=function(){return _0x37db5c;};return a149_0x13bd();}const a149_0x541265=a149_0x250a;(function(_0x1324b6,_0x59f326){const _0x34750e=a149_0x250a,_0x3e573c=_0x1324b6();while(!![]){try{const _0x67ac50=parseInt(_0x34750e(0x119))/0x1*(-parseInt(_0x34750e(0x122))/0x2)+-parseInt(_0x34750e(0x11a))/0x3+parseInt(_0x34750e(0x123))/0x4+parseInt(_0x34750e(0x127))/0x5*(-parseInt(_0x34750e(0x11e))/0x6)+parseInt(_0x34750e(0x125))/0x7+parseInt(_0x34750e(0x115))/0x8*(-parseInt(_0x34750e(0x121))/0x9)+parseInt(_0x34750e(0x11b))/0xa*(parseInt(_0x34750e(0x11f))/0xb);if(_0x67ac50===_0x59f326)break;else _0x3e573c['push'](_0x3e573c['shift']());}catch(_0x464619){_0x3e573c['push'](_0x3e573c['shift']());}}}(a149_0x13bd,0xcd1a0));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';function a149_0x250a(_0x3b7fdd,_0x1038f2){_0x3b7fdd=_0x3b7fdd-0x114;const _0x13bd4f=a149_0x13bd();let _0x250a57=_0x13bd4f[_0x3b7fdd];return _0x250a57;}export const roleUserAdd={'service':a149_0x541265(0x114),'command':a149_0x541265(0x11d),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a149_0x541265(0x11c),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x16a311){const {mutation:_0x402f56}=await prepareUserMutation(_0x16a311,'user-add',!![]);return asDryRunResult(_0x402f56,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x525a52){const _0x25eaaf=a149_0x541265,{roleList:_0x378ac2,mutation:_0x29dd21,changed:_0x135c3a}=await prepareUserMutation(_0x525a52,_0x25eaaf(0x11d),![]);return _0x135c3a&&await updateRoleUsers(_0x525a52[_0x25eaaf(0x124)],_0x378ac2),{'ok':!![],'data':_0x29dd21,'message':_0x135c3a?'Added\x20user\x20'+_0x29dd21['selector'][_0x25eaaf(0x120)]+_0x25eaaf(0x126)+_0x29dd21[_0x25eaaf(0x116)][_0x25eaaf(0x117)]:'No\x20change:\x20user\x20'+_0x29dd21['selector'][_0x25eaaf(0x120)]+_0x25eaaf(0x118)+_0x29dd21[_0x25eaaf(0x116)][_0x25eaaf(0x117)]};}};
@@ -1 +1 @@
1
- const a146_0x29b1b0=a146_0x5cc8;(function(_0x52f0fd,_0x4276e0){const _0x218952=a146_0x5cc8,_0x522933=_0x52f0fd();while(!![]){try{const _0x392dba=parseInt(_0x218952(0x1c4))/0x1*(parseInt(_0x218952(0x1ca))/0x2)+-parseInt(_0x218952(0x1b8))/0x3*(parseInt(_0x218952(0x1c2))/0x4)+-parseInt(_0x218952(0x1b6))/0x5+-parseInt(_0x218952(0x1c9))/0x6+parseInt(_0x218952(0x1ba))/0x7*(parseInt(_0x218952(0x1c8))/0x8)+-parseInt(_0x218952(0x1bb))/0x9+parseInt(_0x218952(0x1bd))/0xa;if(_0x392dba===_0x4276e0)break;else _0x522933['push'](_0x522933['shift']());}catch(_0x23dc5a){_0x522933['push'](_0x522933['shift']());}}}(a146_0x4c56,0xe1600));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':a146_0x29b1b0(0x1c6),'command':a146_0x29b1b0(0x1b5),'description':a146_0x29b1b0(0x1c1),'risk':a146_0x29b1b0(0x1bf),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xd35d4e){const _0x1b2cf8=a146_0x29b1b0,{mutation:_0x54c777}=await prepareUserMutation(_0xd35d4e,_0x1b2cf8(0x1b5),!![]);return asDryRunResult(_0x54c777,{'method':_0x1b2cf8(0x1c5),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x1bb453){const _0x5597da=a146_0x29b1b0,{roleList:_0x2785f6,mutation:_0x491423,changed:_0x5d1573}=await prepareUserMutation(_0x1bb453,'user-remove',![]);return _0x5d1573&&await updateRoleUsers(_0x1bb453[_0x5597da(0x1bc)],_0x2785f6),{'ok':!![],'data':_0x491423,'message':_0x5d1573?'Removed\x20user\x20'+_0x491423[_0x5597da(0x1c7)][_0x5597da(0x1c0)]+_0x5597da(0x1be)+_0x491423[_0x5597da(0x1c7)][_0x5597da(0x1c3)]:_0x5597da(0x1b7)+_0x491423[_0x5597da(0x1c7)]['userId']+_0x5597da(0x1b9)+_0x491423['selector'][_0x5597da(0x1c3)]};}};function a146_0x5cc8(_0x3d10a2,_0xd9c511){_0x3d10a2=_0x3d10a2-0x1b5;const _0x4c5640=a146_0x4c56();let _0x5cc83e=_0x4c5640[_0x3d10a2];return _0x5cc83e;}function a146_0x4c56(){const _0x1db334=['POST','role','selector','464hywVVV','3759012iZgGUU','2098946xTWIDI','user-remove','935920YERAsn','No\x20change:\x20user\x20','6VzluDp','\x20not\x20in\x20role\x20','148477kHNkEX','15270651NdfHBZ','appCode','19441480DlCoCS','\x20from\x20role\x20','high-risk-write','userId','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','1580596QUxBUZ','roleName','1IhRumQ'];a146_0x4c56=function(){return _0x1db334;};return a146_0x4c56();}
1
+ function a150_0x590c(){const _0x39a371=['user-remove','1074QHrfHh','574029TMvCtG','4595CCdnlJ','No\x20change:\x20user\x20','6047PIfdzm','158cgFziw','7084665DZOFwh','2690334dMjRSf','appCode','role','\x20not\x20in\x20role\x20','selector','56MIGBLQ','roleName','4591680qHMPPj','userId','3515890wmjYpJ','11EKevDE'];a150_0x590c=function(){return _0x39a371;};return a150_0x590c();}const a150_0x7ab26d=a150_0x1bfd;(function(_0x100a04,_0x1e654e){const _0x5bbe8f=a150_0x1bfd,_0x12b94b=_0x100a04();while(!![]){try{const _0x3492cf=-parseInt(_0x5bbe8f(0x1f8))/0x1*(-parseInt(_0x5bbe8f(0x1f9))/0x2)+-parseInt(_0x5bbe8f(0x1fb))/0x3+parseInt(_0x5bbe8f(0x1ef))/0x4+parseInt(_0x5bbe8f(0x1f6))/0x5*(parseInt(_0x5bbe8f(0x1f4))/0x6)+-parseInt(_0x5bbe8f(0x1fa))/0x7+parseInt(_0x5bbe8f(0x1ed))/0x8*(parseInt(_0x5bbe8f(0x1f5))/0x9)+parseInt(_0x5bbe8f(0x1f1))/0xa*(parseInt(_0x5bbe8f(0x1f2))/0xb);if(_0x3492cf===_0x1e654e)break;else _0x12b94b['push'](_0x12b94b['shift']());}catch(_0x25430d){_0x12b94b['push'](_0x12b94b['shift']());}}}(a150_0x590c,0xa5d95));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';function a150_0x1bfd(_0x2767ff,_0x3999d8){_0x2767ff=_0x2767ff-0x1ec;const _0x590cbc=a150_0x590c();let _0x1bfd7c=_0x590cbc[_0x2767ff];return _0x1bfd7c;}export const roleUserRemove={'service':a150_0x7ab26d(0x1fd),'command':a150_0x7ab26d(0x1f3),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2eac59){const _0x54baae=a150_0x7ab26d,{mutation:_0x563074}=await prepareUserMutation(_0x2eac59,_0x54baae(0x1f3),!![]);return asDryRunResult(_0x563074,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x14fe75){const _0x4d8963=a150_0x7ab26d,{roleList:_0x627bc9,mutation:_0x38c946,changed:_0xefc5c1}=await prepareUserMutation(_0x14fe75,_0x4d8963(0x1f3),![]);return _0xefc5c1&&await updateRoleUsers(_0x14fe75[_0x4d8963(0x1fc)],_0x627bc9),{'ok':!![],'data':_0x38c946,'message':_0xefc5c1?'Removed\x20user\x20'+_0x38c946[_0x4d8963(0x1ec)][_0x4d8963(0x1f0)]+'\x20from\x20role\x20'+_0x38c946[_0x4d8963(0x1ec)][_0x4d8963(0x1ee)]:_0x4d8963(0x1f7)+_0x38c946['selector'][_0x4d8963(0x1f0)]+_0x4d8963(0x1fe)+_0x38c946['selector'][_0x4d8963(0x1ee)]};}};
@@ -1 +1 @@
1
- const a147_0x174881=a147_0x333b;function a147_0x3c45(){const _0x5bd57d=['flagMissing','123QwSGrX','5302465HWjOrg','666321outOSu','424434GKvjll','6NzphTF','read','str','7103592XgFwFc','nickname','160nUfFIP','\x22\x20→\x20userId\x20','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','username','userId','name','user-resolve','10QPJeIe','trim','857916PAhrOJ','550976eavGRy'];a147_0x3c45=function(){return _0x5bd57d;};return a147_0x3c45();}(function(_0x5dc965,_0x331122){const _0x31a34c=a147_0x333b,_0x5106d2=_0x5dc965();while(!![]){try{const _0x5c7116=parseInt(_0x31a34c(0x68))/0x1+-parseInt(_0x31a34c(0x6a))/0x2*(parseInt(_0x31a34c(0x66))/0x3)+parseInt(_0x31a34c(0x64))/0x4+-parseInt(_0x31a34c(0x76))/0x5*(parseInt(_0x31a34c(0x69))/0x6)+-parseInt(_0x31a34c(0x67))/0x7+-parseInt(_0x31a34c(0x6d))/0x8+parseInt(_0x31a34c(0x78))/0x9*(parseInt(_0x31a34c(0x6f))/0xa);if(_0x5c7116===_0x331122)break;else _0x5106d2['push'](_0x5106d2['shift']());}catch(_0x28454f){_0x5106d2['push'](_0x5106d2['shift']());}}}(a147_0x3c45,0x845fc));import{CliErrors}from'../../errors.js';function a147_0x333b(_0x1bc7a6,_0x1e7b6d){_0x1bc7a6=_0x1bc7a6-0x64;const _0x3c4560=a147_0x3c45();let _0x333bfe=_0x3c4560[_0x1bc7a6];return _0x333bfe;}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':a147_0x174881(0x75),'description':a147_0x174881(0x71),'risk':a147_0x174881(0x6b),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x29176f){const _0x29636a=a147_0x174881;if(!_0x29176f[_0x29636a(0x6c)](_0x29636a(0x74))['trim']())throw CliErrors[_0x29636a(0x65)]('name','Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x2fde5e){const _0x3cd116=a147_0x174881,_0x405ec3=_0x2fde5e[_0x3cd116(0x6c)](_0x3cd116(0x74))[_0x3cd116(0x77)](),_0x3a865e=await resolveUserRef(_0x405ec3);return{'ok':!![],'data':{'user':{'userId':_0x3a865e[_0x3cd116(0x73)],'username':_0x3a865e[_0x3cd116(0x72)],'nickname':_0x3a865e[_0x3cd116(0x6e)],'matchedBy':_0x3a865e['matchedBy']}},'message':'Resolved\x20\x22'+_0x405ec3+_0x3cd116(0x70)+_0x3a865e[_0x3cd116(0x73)]};}};
1
+ function a151_0x1ae9(){const _0x330cc6=['str','\x22\x20→\x20userId\x20','40LUBxcZ','userId','name','374373jJVjwL','12EwweFq','3fYyrHQ','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','407391sXpxPJ','matchedBy','108482VYjeHL','71145MpegjN','Resolved\x20\x22','username','trim','read','300mNnEpM','1046344rjEGKV','flagMissing','nickname','6kSYzWV','303639oPHAEu','48466uIfIUB'];a151_0x1ae9=function(){return _0x330cc6;};return a151_0x1ae9();}const a151_0x4e9d06=a151_0x2bb5;(function(_0x388ffc,_0x14a69c){const _0x5191ce=a151_0x2bb5,_0x1729c1=_0x388ffc();while(!![]){try{const _0x1e2fa7=-parseInt(_0x5191ce(0x15d))/0x1*(parseInt(_0x5191ce(0x155))/0x2)+parseInt(_0x5191ce(0x15f))/0x3+parseInt(_0x5191ce(0x15c))/0x4*(parseInt(_0x5191ce(0x162))/0x5)+-parseInt(_0x5191ce(0x153))/0x6*(parseInt(_0x5191ce(0x154))/0x7)+parseInt(_0x5191ce(0x150))/0x8+parseInt(_0x5191ce(0x15b))/0x9*(parseInt(_0x5191ce(0x158))/0xa)+-parseInt(_0x5191ce(0x161))/0xb*(parseInt(_0x5191ce(0x14f))/0xc);if(_0x1e2fa7===_0x14a69c)break;else _0x1729c1['push'](_0x1729c1['shift']());}catch(_0x5e1206){_0x1729c1['push'](_0x1729c1['shift']());}}}(a151_0x1ae9,0x1b98f));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a151_0x2bb5(_0x288593,_0x1a4fb1){_0x288593=_0x288593-0x14d;const _0x1ae9ce=a151_0x1ae9();let _0x2bb56d=_0x1ae9ce[_0x288593];return _0x2bb56d;}export const roleUserResolve={'service':'role','command':'user-resolve','description':a151_0x4e9d06(0x15e),'risk':a151_0x4e9d06(0x14e),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5e6f9){const _0x138018=a151_0x4e9d06;if(!_0x5e6f9[_0x138018(0x156)](_0x138018(0x15a))[_0x138018(0x14d)]())throw CliErrors[_0x138018(0x151)]('name','Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x2e11cd){const _0x1a9f1a=a151_0x4e9d06,_0x34f390=_0x2e11cd['str']('name')[_0x1a9f1a(0x14d)](),_0x29b9aa=await resolveUserRef(_0x34f390);return{'ok':!![],'data':{'user':{'userId':_0x29b9aa[_0x1a9f1a(0x159)],'username':_0x29b9aa[_0x1a9f1a(0x164)],'nickname':_0x29b9aa[_0x1a9f1a(0x152)],'matchedBy':_0x29b9aa[_0x1a9f1a(0x160)]}},'message':_0x1a9f1a(0x163)+_0x34f390+_0x1a9f1a(0x157)+_0x29b9aa[_0x1a9f1a(0x159)]};}};
@@ -1 +1 @@
1
- const a148_0x1164b6=a148_0x4bc8;(function(_0x49c25d,_0xa8e79d){const _0x4bbb46=a148_0x4bc8,_0x51d8c1=_0x49c25d();while(!![]){try{const _0x60a4ab=parseInt(_0x4bbb46(0xd7))/0x1*(parseInt(_0x4bbb46(0xc3))/0x2)+parseInt(_0x4bbb46(0xad))/0x3+-parseInt(_0x4bbb46(0xe0))/0x4+parseInt(_0x4bbb46(0xaf))/0x5*(-parseInt(_0x4bbb46(0xb0))/0x6)+parseInt(_0x4bbb46(0xc2))/0x7+parseInt(_0x4bbb46(0xb2))/0x8*(-parseInt(_0x4bbb46(0xc9))/0x9)+parseInt(_0x4bbb46(0xdd))/0xa*(parseInt(_0x4bbb46(0xba))/0xb);if(_0x60a4ab===_0xa8e79d)break;else _0x51d8c1['push'](_0x51d8c1['shift']());}catch(_0x10ffc8){_0x51d8c1['push'](_0x51d8c1['shift']());}}}(a148_0x4dd3,0x5d0d8));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([a148_0x1164b6(0xcf),'dev']);function readPackageScripts(_0x22e491){const _0x291ae3=a148_0x1164b6,_0x159865=resolve(_0x22e491,_0x291ae3(0xbc));if(!existsSync(_0x159865))return null;try{const _0x54ddad=JSON[_0x291ae3(0xda)](readFileSync(_0x159865,_0x291ae3(0xab)));return _0x54ddad[_0x291ae3(0xd9)]??{};}catch{return null;}}function detectPackageManager(_0x4c4df7){const _0x5e888c=a148_0x1164b6;if(existsSync(resolve(_0x4c4df7,'bun.lockb'))||existsSync(resolve(_0x4c4df7,_0x5e888c(0xa5))))return _0x5e888c(0xca);if(existsSync(resolve(_0x4c4df7,_0x5e888c(0xde))))return _0x5e888c(0xd0);if(existsSync(resolve(_0x4c4df7,'yarn.lock')))return _0x5e888c(0xcb);return _0x5e888c(0xc8);}async function versionCheck(_0x58a98c){const _0xebb07d=a148_0x1164b6,_0x161b0a=await checkCliVersion();(_0x161b0a['needsUpgrade']||_0x161b0a[_0xebb07d(0xce)])&&(printCliUpgradeWarning(_0x161b0a),assertCliVersionSupported(_0x161b0a));const _0x3f5839=await checkSdkVersion(_0x58a98c);if(_0x3f5839[_0xebb07d(0xb9)])printSdkUpgradeWarning(_0x3f5839);}function spawnScript(_0x30eead,_0x507fe4,_0x5c7421,_0x3d69c3){return new Promise((_0x3494b1,_0x2996c7)=>{const _0x2d099e=a148_0x4bc8,_0x474ee1=[_0x2d099e(0xbd),_0x507fe4,..._0x5c7421],_0x2d1252=spawn(_0x30eead,_0x474ee1,{'cwd':_0x3d69c3,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x3d69c3,'node_modules','.bin')+delimiter+process.env.PATH}});_0x2d1252['on'](_0x2d099e(0xc7),_0x3083b6=>{const _0x5de34f=_0x2d099e;if(_0x3083b6===0x0||_0x3083b6===null)_0x3494b1();else _0x2996c7(new Error(_0x30eead+_0x5de34f(0xb5)+_0x507fe4+_0x5de34f(0xac)+_0x3083b6));}),_0x2d1252['on'](_0x2d099e(0xd2),_0x2996c7);});}function spawnViteBuildWatch(_0x58ab44){return new Promise((_0x10de51,_0x45b704)=>{const _0x8f88ef=a148_0x4bc8,_0x38c9a5=spawn(_0x8f88ef(0xcc),[_0x8f88ef(0xc6),_0x8f88ef(0xb7)],{'cwd':_0x58ab44,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x58ab44,_0x8f88ef(0xc0),'.bin')+delimiter+process.env.PATH}});_0x38c9a5['on']('close',_0x11d2b9=>{const _0x187732=_0x8f88ef;if(_0x11d2b9===0x0||_0x11d2b9===null)_0x10de51();else _0x45b704(new Error(_0x187732(0xb1)+_0x11d2b9));}),_0x38c9a5['on'](_0x8f88ef(0xd2),_0x45b704);});}function spawnVitePreview(_0x337b32){return new Promise((_0x3257fe,_0x18dca3)=>{const _0x5fdbc2=a148_0x4bc8,_0x4d5609=spawn(_0x5fdbc2(0xcc),[_0x5fdbc2(0xd1)],{'cwd':_0x337b32,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x337b32,_0x5fdbc2(0xc0),_0x5fdbc2(0xb8))+delimiter+process.env.PATH}});_0x4d5609['on'](_0x5fdbc2(0xc7),_0x1fc903=>{if(_0x1fc903===0x0||_0x1fc903===null)_0x3257fe();else _0x18dca3(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x1fc903));}),_0x4d5609['on'](_0x5fdbc2(0xd2),_0x18dca3);});}function a148_0x4bc8(_0x2c5fd2,_0x25093f){_0x2c5fd2=_0x2c5fd2-0xa5;const _0x4dd3d9=a148_0x4dd3();let _0x4bc863=_0x4dd3d9[_0x2c5fd2];return _0x4bc863;}const runFlags=[{'name':a148_0x1164b6(0xc1),'type':'boolean','description':a148_0x1164b6(0xa9),'default':![]}];export const runDefinition={'service':a148_0x1164b6(0xbd),'command':a148_0x1164b6(0xbd),'description':a148_0x1164b6(0xb6),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a148_0x1164b6(0xdf),'description':a148_0x1164b6(0xa6),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x5e42db=a148_0x1164b6,_0x33c1e9=[];return _0x33c1e9[_0x5e42db(0xb4)](_0x5e42db(0xbb)),_0x33c1e9['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x5e42db(0xdb)),_0x33c1e9['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x5e42db(0xd5)),_0x33c1e9[_0x5e42db(0xb4)](_0x5e42db(0xbf)+CLI_BIN_NAME+'\x20run\x20preview'),_0x33c1e9[_0x5e42db(0xb4)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x33c1e9[_0x5e42db(0xc4)]('\x0a');},async 'execute'(_0x3e6909){const _0x9af8e=a148_0x1164b6,_0x3b6e17=process[_0x9af8e(0xd4)](),_0x5285be=_0x3e6909['args'][0x0],_0x3d7ea0=_0x3e6909['args'][_0x9af8e(0xc5)](0x1),_0x404129=readPackageScripts(_0x3b6e17);if(!_0x404129)throw CliErrors[_0x9af8e(0xe1)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x5285be){const _0x366c08=Object[_0x9af8e(0xd3)](_0x404129);if(_0x366c08['length']===0x0)console[_0x9af8e(0xd6)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console[_0x9af8e(0xd6)](_0x9af8e(0xae));for(const _0x2d2ebc of _0x366c08){console[_0x9af8e(0xd6)](_0x9af8e(0xbf)+_0x2d2ebc);}console[_0x9af8e(0xd6)](_0x9af8e(0xcd)+CLI_BIN_NAME+_0x9af8e(0xbe));}return{'ok':!![]};}if(!_0x404129[_0x5285be])throw CliErrors['validation'](_0x9af8e(0xdc)+_0x5285be+'\x22\x20not\x20found\x20in\x20package.json.',_0x9af8e(0xaa)+(Object[_0x9af8e(0xd3)](_0x404129)[_0x9af8e(0xc4)](',\x20')||_0x9af8e(0xb3)));const _0xa8d0db=detectPackageManager(_0x3b6e17);VERSION_CHECK_SCRIPTS[_0x9af8e(0xa8)](_0x5285be)&&await versionCheck(_0x3b6e17);if(_0x5285be===_0x9af8e(0xd1)&&_0x3e6909[_0x9af8e(0xd8)](_0x9af8e(0xc1)))return await Promise[_0x9af8e(0xa7)]([spawnViteBuildWatch(_0x3b6e17),spawnVitePreview(_0x3b6e17)]),{'ok':!![]};return await spawnScript(_0xa8d0db,_0x5285be,_0x3d7ea0,_0x3b6e17),{'ok':!![]};}};function a148_0x4dd3(){const _0x474115=['\x20run\x20','Run\x20a\x20package.json\x20script','--watch','.bin','needsUpgrade','9410390lNtTik','\x20\x20EXAMPLES','package.json','run','\x20run\x20<script>\x0a','\x20\x20\x20\x20','node_modules','watch','4405226iZLvIN','2FLVGSc','join','slice','build','close','npm','9lwzGiA','bun','yarn','vite','\x0a\x20\x20Usage:\x20','belowMinimum','start','pnpm','preview','error','keys','cwd','\x20run\x20build','log','107577XKJfGQ','bool','scripts','parse','\x20run\x20start','Script\x20\x22','10EKhpfU','pnpm-lock.yaml','script','1024968YIxQbj','validation','bun.lock','Script\x20name\x20defined\x20in\x20package.json','all','has','Enable\x20watch\x20mode\x20for\x20preview','Available:\x20','utf-8','\x20exited\x20with\x20code\x20','268443cAbpcv','\x0a\x20\x20Available\x20scripts:\x0a','49385argIus','402lCsoRO','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','3061768ebLQHg','(none)','push'];a148_0x4dd3=function(){return _0x474115;};return a148_0x4dd3();}
1
+ const a152_0x4754c8=a152_0x3432;(function(_0x488634,_0x2c1632){const _0x49ca2f=a152_0x3432,_0x11e30b=_0x488634();while(!![]){try{const _0x34df7d=parseInt(_0x49ca2f(0xd1))/0x1*(parseInt(_0x49ca2f(0xd6))/0x2)+parseInt(_0x49ca2f(0xd9))/0x3*(-parseInt(_0x49ca2f(0xd3))/0x4)+-parseInt(_0x49ca2f(0xad))/0x5*(-parseInt(_0x49ca2f(0xe2))/0x6)+parseInt(_0x49ca2f(0xb0))/0x7*(parseInt(_0x49ca2f(0xc0))/0x8)+parseInt(_0x49ca2f(0xc6))/0x9*(-parseInt(_0x49ca2f(0xcd))/0xa)+-parseInt(_0x49ca2f(0xe3))/0xb+-parseInt(_0x49ca2f(0xb4))/0xc;if(_0x34df7d===_0x2c1632)break;else _0x11e30b['push'](_0x11e30b['shift']());}catch(_0x864e7f){_0x11e30b['push'](_0x11e30b['shift']());}}}(a152_0x4e66,0xbf2a1));import{readFileSync,existsSync}from'node:fs';function a152_0x4e66(){const _0x148c1b=['5wnFfjL','vite\x20preview\x20exited\x20with\x20code\x20','No\x20package.json\x20found\x20in\x20current\x20directory.','7agLTjZ','\x0a\x20\x20Usage:\x20','\x20run\x20build','npm','5872488AQjlJB','(none)','vite','pnpm-lock.yaml','bool','script','watch','parse','start','preview','log','yarn','5379416oFdnLt','\x20run\x20preview','node_modules','validation','\x20run\x20start','bun.lockb','4266dPRuKK','build','close','No\x20scripts\x20defined\x20in\x20package.json.','\x20run\x20<script>\x0a','\x20\x20EXAMPLES','keys','5140DtxxMW','Script\x20\x22','\x20\x20\x20\x20','error','1320623ozaVLl','run','1108532WrfErO','args','pnpm','2wAzXIm','\x20exited\x20with\x20code\x20','scripts','3ukmlob','\x0a\x20\x20Available\x20scripts:\x0a','inherit','read','\x22\x20not\x20found\x20in\x20package.json.','bun.lock','.bin','push','Available:\x20','6342588OqkbMI','13826956zLqbaw','all','join','belowMinimum','\x20run\x20','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','boolean'];a152_0x4e66=function(){return _0x148c1b;};return a152_0x4e66();}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([a152_0x4754c8(0xbc),'dev']);function readPackageScripts(_0x8fc21c){const _0x454dbd=a152_0x4754c8,_0x4befc1=resolve(_0x8fc21c,'package.json');if(!existsSync(_0x4befc1))return null;try{const _0x3c39c4=JSON[_0x454dbd(0xbb)](readFileSync(_0x4befc1,'utf-8'));return _0x3c39c4[_0x454dbd(0xd8)]??{};}catch{return null;}}function detectPackageManager(_0x225084){const _0x5675f6=a152_0x4754c8;if(existsSync(resolve(_0x225084,_0x5675f6(0xc5)))||existsSync(resolve(_0x225084,_0x5675f6(0xde))))return'bun';if(existsSync(resolve(_0x225084,_0x5675f6(0xb7))))return _0x5675f6(0xd5);if(existsSync(resolve(_0x225084,'yarn.lock')))return _0x5675f6(0xbf);return _0x5675f6(0xb3);}async function versionCheck(_0x33b90b){const _0x389edd=a152_0x4754c8,_0x3d3072=await checkCliVersion();(_0x3d3072['needsUpgrade']||_0x3d3072[_0x389edd(0xe6)])&&(printCliUpgradeWarning(_0x3d3072),assertCliVersionSupported(_0x3d3072));const _0x3f7786=await checkSdkVersion(_0x33b90b);if(_0x3f7786['needsUpgrade'])printSdkUpgradeWarning(_0x3f7786);}function a152_0x3432(_0x32c1ea,_0x196532){_0x32c1ea=_0x32c1ea-0xac;const _0x4e6672=a152_0x4e66();let _0x3432c3=_0x4e6672[_0x32c1ea];return _0x3432c3;}function spawnScript(_0x46c6ad,_0x4167f1,_0x36086c,_0x28cb63){return new Promise((_0xbade05,_0x30a883)=>{const _0x372080=a152_0x3432,_0x2c9701=[_0x372080(0xd2),_0x4167f1,..._0x36086c],_0x2074aa=spawn(_0x46c6ad,_0x2c9701,{'cwd':_0x28cb63,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x28cb63,_0x372080(0xc2),_0x372080(0xdf))+delimiter+process.env.PATH}});_0x2074aa['on']('close',_0x235a83=>{const _0x516a7f=_0x372080;if(_0x235a83===0x0||_0x235a83===null)_0xbade05();else _0x30a883(new Error(_0x46c6ad+_0x516a7f(0xe7)+_0x4167f1+_0x516a7f(0xd7)+_0x235a83));}),_0x2074aa['on']('error',_0x30a883);});}function spawnViteBuildWatch(_0xdfa2e6){return new Promise((_0x5e57a5,_0x2f2266)=>{const _0x3bfa83=a152_0x3432,_0x49d2ed=spawn('vite',[_0x3bfa83(0xc7),'--watch'],{'cwd':_0xdfa2e6,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0xdfa2e6,_0x3bfa83(0xc2),_0x3bfa83(0xdf))+delimiter+process.env.PATH}});_0x49d2ed['on'](_0x3bfa83(0xc8),_0x1e7ba2=>{const _0x38a1fe=_0x3bfa83;if(_0x1e7ba2===0x0||_0x1e7ba2===null)_0x5e57a5();else _0x2f2266(new Error(_0x38a1fe(0xe8)+_0x1e7ba2));}),_0x49d2ed['on'](_0x3bfa83(0xd0),_0x2f2266);});}function spawnVitePreview(_0x1ecb1e){return new Promise((_0xdf1b2f,_0x4b5c12)=>{const _0x4949db=a152_0x3432,_0x36bc38=spawn(_0x4949db(0xb6),['preview'],{'cwd':_0x1ecb1e,'stdio':_0x4949db(0xdb),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1ecb1e,_0x4949db(0xc2),_0x4949db(0xdf))+delimiter+process.env.PATH}});_0x36bc38['on'](_0x4949db(0xc8),_0x154cfd=>{const _0x335263=_0x4949db;if(_0x154cfd===0x0||_0x154cfd===null)_0xdf1b2f();else _0x4b5c12(new Error(_0x335263(0xae)+_0x154cfd));}),_0x36bc38['on'](_0x4949db(0xd0),_0x4b5c12);});}const runFlags=[{'name':a152_0x4754c8(0xba),'type':a152_0x4754c8(0xac),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a152_0x4754c8(0xd2),'command':a152_0x4754c8(0xd2),'description':'Run\x20a\x20package.json\x20script','risk':a152_0x4754c8(0xdc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a152_0x4754c8(0xb9),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x2ce408=a152_0x4754c8,_0x254d6d=[];return _0x254d6d[_0x2ce408(0xe0)](_0x2ce408(0xcb)),_0x254d6d[_0x2ce408(0xe0)](_0x2ce408(0xcf)+CLI_BIN_NAME+_0x2ce408(0xc4)),_0x254d6d[_0x2ce408(0xe0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x2ce408(0xb2)),_0x254d6d['push'](_0x2ce408(0xcf)+CLI_BIN_NAME+_0x2ce408(0xc1)),_0x254d6d[_0x2ce408(0xe0)](_0x2ce408(0xcf)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x254d6d[_0x2ce408(0xe5)]('\x0a');},async 'execute'(_0xa1b0a6){const _0x200c4b=a152_0x4754c8,_0x4aa515=process['cwd'](),_0x59711f=_0xa1b0a6[_0x200c4b(0xd4)][0x0],_0x5f0ff7=_0xa1b0a6['args']['slice'](0x1),_0x5d5d2f=readPackageScripts(_0x4aa515);if(!_0x5d5d2f)throw CliErrors[_0x200c4b(0xc3)](_0x200c4b(0xaf));if(!_0x59711f){const _0x5b0166=Object[_0x200c4b(0xcc)](_0x5d5d2f);if(_0x5b0166['length']===0x0)console[_0x200c4b(0xbe)](_0x200c4b(0xc9));else{console[_0x200c4b(0xbe)](_0x200c4b(0xda));for(const _0x581f44 of _0x5b0166){console[_0x200c4b(0xbe)](_0x200c4b(0xcf)+_0x581f44);}console[_0x200c4b(0xbe)](_0x200c4b(0xb1)+CLI_BIN_NAME+_0x200c4b(0xca));}return{'ok':!![]};}if(!_0x5d5d2f[_0x59711f])throw CliErrors['validation'](_0x200c4b(0xce)+_0x59711f+_0x200c4b(0xdd),_0x200c4b(0xe1)+(Object['keys'](_0x5d5d2f)[_0x200c4b(0xe5)](',\x20')||_0x200c4b(0xb5)));const _0x33a0bb=detectPackageManager(_0x4aa515);VERSION_CHECK_SCRIPTS['has'](_0x59711f)&&await versionCheck(_0x4aa515);if(_0x59711f===_0x200c4b(0xbd)&&_0xa1b0a6[_0x200c4b(0xb8)](_0x200c4b(0xba)))return await Promise[_0x200c4b(0xe4)]([spawnViteBuildWatch(_0x4aa515),spawnVitePreview(_0x4aa515)]),{'ok':!![]};return await spawnScript(_0x33a0bb,_0x59711f,_0x5f0ff7,_0x4aa515),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a149_0x1e315d=a149_0x1a7a;(function(_0x23af9a,_0x8a0dbc){const _0x58d223=a149_0x1a7a,_0x3cdcce=_0x23af9a();while(!![]){try{const _0xe4e0c3=parseInt(_0x58d223(0x10e))/0x1*(-parseInt(_0x58d223(0x115))/0x2)+parseInt(_0x58d223(0x119))/0x3*(-parseInt(_0x58d223(0x118))/0x4)+parseInt(_0x58d223(0x113))/0x5*(-parseInt(_0x58d223(0x112))/0x6)+-parseInt(_0x58d223(0x11a))/0x7*(parseInt(_0x58d223(0x10c))/0x8)+parseInt(_0x58d223(0x10d))/0x9*(parseInt(_0x58d223(0x111))/0xa)+-parseInt(_0x58d223(0x110))/0xb+-parseInt(_0x58d223(0x116))/0xc*(-parseInt(_0x58d223(0x10f))/0xd);if(_0xe4e0c3===_0x8a0dbc)break;else _0x3cdcce['push'](_0x3cdcce['shift']());}catch(_0x94835a){_0x3cdcce['push'](_0x3cdcce['shift']());}}}(a149_0x1661,0x950e0));function a149_0x1a7a(_0xf0fc15,_0x3e71db){_0xf0fc15=_0xf0fc15-0x10c;const _0x16611e=a149_0x1661();let _0x1a7af4=_0x16611e[_0xf0fc15];return _0x1a7af4;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x13cd3f){const _0x33821f=await buildSchemaPayload();return{'ok':!![],'data':_0x33821f};}function a149_0x1661(){const _0xfda10d=['10pckeeD','6uBJOte','830565DUkXrv','json','4184zqeRmJ','144UcIQKR','read','1688MscPuX','8643SvGXnn','1652hIRNsK','12568ISFqaI','2759067PtxSqr','187MBsabS','3247400VtLjMm','6047580uOHhzX'];a149_0x1661=function(){return _0xfda10d;};return a149_0x1661();}export const schemaDefinition={'service':'schema','command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a149_0x1e315d(0x117),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a149_0x1e315d(0x114),'flags':[],'execute':execute};
1
+ const a153_0x318e99=a153_0x3b62;(function(_0x57b0fb,_0xe53a61){const _0xfe0421=a153_0x3b62,_0x18dd51=_0x57b0fb();while(!![]){try{const _0x7cc052=-parseInt(_0xfe0421(0xe0))/0x1+-parseInt(_0xfe0421(0xe1))/0x2+-parseInt(_0xfe0421(0xe2))/0x3*(-parseInt(_0xfe0421(0xde))/0x4)+parseInt(_0xfe0421(0xdc))/0x5+parseInt(_0xfe0421(0xe5))/0x6+-parseInt(_0xfe0421(0xe6))/0x7*(-parseInt(_0xfe0421(0xe3))/0x8)+parseInt(_0xfe0421(0xe7))/0x9;if(_0x7cc052===_0xe53a61)break;else _0x18dd51['push'](_0x18dd51['shift']());}catch(_0x255a5a){_0x18dd51['push'](_0x18dd51['shift']());}}}(a153_0x3d89,0x29455));import{buildSchemaPayload}from'../framework/schema-export.js';function a153_0x3b62(_0x3846d7,_0x9acfdd){_0x3846d7=_0x3846d7-0xdc;const _0x3d8958=a153_0x3d89();let _0x3b62b5=_0x3d8958[_0x3846d7];return _0x3b62b5;}async function execute(_0x636472){const _0x416a94=await buildSchemaPayload();return{'ok':!![],'data':_0x416a94};}export const schemaDefinition={'service':a153_0x318e99(0xdd),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a153_0x318e99(0xe4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a153_0x318e99(0xdf),'flags':[],'execute':execute};function a153_0x3d89(){const _0x4c6164=['8gbqDxf','read','454290RTjvZH','579089kwurEJ','1071972oCEVEV','471040wLVwbS','schema','291012MDYUzq','json','125922HUrTeB','590100BgMMxu','9IRhIKr'];a153_0x3d89=function(){return _0x4c6164;};return a153_0x3d89();}
@@ -1 +1 @@
1
- const a150_0x551c5e=a150_0x512f;(function(_0x254201,_0x1eaed3){const _0xee77c0=a150_0x512f,_0x576820=_0x254201();while(!![]){try{const _0x191733=parseInt(_0xee77c0(0x200))/0x1+parseInt(_0xee77c0(0x204))/0x2+parseInt(_0xee77c0(0x20b))/0x3+-parseInt(_0xee77c0(0x1f4))/0x4+-parseInt(_0xee77c0(0x1e7))/0x5+-parseInt(_0xee77c0(0x208))/0x6*(parseInt(_0xee77c0(0x1d4))/0x7)+parseInt(_0xee77c0(0x1f5))/0x8*(-parseInt(_0xee77c0(0x1f3))/0x9);if(_0x191733===_0x1eaed3)break;else _0x576820['push'](_0x576820['shift']());}catch(_0x27cb1e){_0x576820['push'](_0x576820['shift']());}}}(a150_0x2ab3,0x25b36));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x41de33){const _0x5289c=a150_0x512f;if(_0x41de33===_0x5289c(0x1df))return[_0x5289c(0x1f2),_0x5289c(0x207),_0x5289c(0x1e8),'']['join']('\x0a');return[_0x5289c(0x20e),''][_0x5289c(0x203)]('\x0a');}export const sqlCreate={'service':a150_0x551c5e(0x209),'command':'create','description':a150_0x551c5e(0x1fa),'risk':a150_0x551c5e(0x20d),'flags':[{'name':a150_0x551c5e(0x1de),'type':a150_0x551c5e(0x1e1),'description':'SQL\x20query\x20display\x20name'},{'name':a150_0x551c5e(0x1eb),'type':a150_0x551c5e(0x206),'description':a150_0x551c5e(0x1f7)},{'name':a150_0x551c5e(0x1ea),'type':a150_0x551c5e(0x1e1),'enum':[a150_0x551c5e(0x209),a150_0x551c5e(0x1df)],'description':a150_0x551c5e(0x1d7)}],async 'validate'(_0x4eb253){const _0x53d74d=a150_0x551c5e;if(!_0x4eb253[_0x53d74d(0x1f6)])return;if(!_0x4eb253[_0x53d74d(0x1d6)](_0x53d74d(0x1de))[_0x53d74d(0x1ec)]())throw CliErrors[_0x53d74d(0x1fc)](_0x53d74d(0x1de),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x16b7ba=resolveProvidedDbId(_0x4eb253);if(typeof _0x16b7ba!==_0x53d74d(0x206)||!Number[_0x53d74d(0x202)](_0x16b7ba)||_0x16b7ba<=0x0)throw CliErrors['flagMissing'](_0x53d74d(0x1eb),_0x53d74d(0x1dd));if(!_0x4eb253[_0x53d74d(0x1d6)](_0x53d74d(0x1ea))[_0x53d74d(0x1ec)]())throw CliErrors[_0x53d74d(0x1fc)](_0x53d74d(0x1ea),_0x53d74d(0x213));},async 'dryRun'(_0x3fa9a1){const _0x2dc455=a150_0x551c5e,_0x1469aa=loadSqlProjectConfig(_0x3fa9a1['appCode']),{sqlName:_0x25e29e,dbId:_0x353f16,dbName:_0x542201,mode:_0x5e3bf3}=await resolveSqlNewInputs(_0x3fa9a1),_0x3623a3=buildSqlRelativePath(_0x2dc455(0x1e0),_0x25e29e,_0x542201,_0x5e3bf3,_0x353f16),_0x4307e5=_0x1469aa[_0x2dc455(0x211)]+'/'+_0x3623a3;return{'method':_0x2dc455(0x1e6),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x3fa9a1[_0x2dc455(0x1fe)],'sqlName':_0x25e29e,'dbId':_0x353f16,'mode':_0x5e3bf3,'localPath':_0x4307e5},'description':_0x2dc455(0x1f1)+_0x1469aa[_0x2dc455(0x211)]};},async 'execute'(_0x11ec55){const _0x1fdc20=a150_0x551c5e,_0x27b5ac=loadSqlProjectConfig(_0x11ec55[_0x1fdc20(0x1fe)]),{sqlName:_0x485ede,dbId:_0x1e96e2,dbName:_0x4b252b,mode:_0x6bcf5}=await resolveSqlNewInputs(_0x11ec55),_0x51ae5d=generateSqlTemplate(_0x6bcf5),_0x440304=await createSqlQuery({'appCode':_0x11ec55[_0x1fdc20(0x1fe)],'sqlName':_0x485ede,'dbId':_0x1e96e2,'sqlContent':_0x51ae5d}),_0x349ca5=ensureRemoteSqlContent(_0x440304),_0x1585a8=_0x4b252b||await getDbName(_0x11ec55[_0x1fdc20(0x1fe)],_0x1e96e2)[_0x1fdc20(0x1da)](()=>undefined),_0x26a135=buildSqlRelativePath(_0x440304[_0x1fdc20(0x1f9)],_0x440304[_0x1fdc20(0x1e2)],_0x1585a8,_0x6bcf5,_0x1e96e2),_0x29ca5d=_0x27b5ac[_0x1fdc20(0x211)]+'/'+_0x26a135,_0xdae4e1=buildLocalSqlFileContent({'sqlCode':_0x440304[_0x1fdc20(0x1f9)],'sqlName':_0x440304[_0x1fdc20(0x1e2)],'dbId':_0x440304[_0x1fdc20(0x1fb)]},_0x349ca5,{'dbName':_0x1585a8,'mode':_0x6bcf5,'syncedAt':new Date()[_0x1fdc20(0x20a)](),'description':_0x440304['description']});if(await fileExists(_0x29ca5d))throw CliErrors[_0x1fdc20(0x1e4)](_0x1fdc20(0x1d8)+_0x29ca5d);await ensureParentDirectory(_0x29ca5d),await writeFile(_0x29ca5d,_0xdae4e1,_0x1fdc20(0x1d2));const _0x207df8=await readSqlLockFile(_0x27b5ac[_0x1fdc20(0x1d3)]),{lockData:_0x1c5999,appLock:_0x19bd61}=ensureSqlLockScope(_0x207df8??createEmptySqlLock(),_0x27b5ac[_0x1fdc20(0x1fe)],_0x27b5ac[_0x1fdc20(0x20f)],_0x1fdc20(0x1f8));return _0x19bd61[_0x1fdc20(0x212)][_0x440304['sqlCode']]={...buildSqlLockEntry(_0x440304,_0x349ca5,computeSqlContentHash(_0xdae4e1),{'dbName':_0x1585a8}),'path':_0x26a135,'mode':_0x6bcf5},_0x19bd61['lastSync']=new Date()[_0x1fdc20(0x20a)](),await writeSqlLockFile(_0x27b5ac['lockFilePath'],_0x1c5999),{'ok':!![],'data':{'id':_0x440304['id'],'sqlCode':_0x440304['sqlCode'],'sqlName':_0x440304[_0x1fdc20(0x1e2)],'dbId':_0x440304['dbId'],'path':_0x29ca5d,'mode':_0x6bcf5},'message':'Created\x20SQL\x20query\x20'+_0x440304[_0x1fdc20(0x1f9)]};}};function a150_0x512f(_0x14431f,_0x441c43){_0x14431f=_0x14431f-0x1d2;const _0x2ab33c=a150_0x2ab3();let _0x512fc6=_0x2ab33c[_0x14431f];return _0x512fc6;}async function resolveSqlNewInputs(_0x3854ec){const _0x154b6b=await resolveSqlNameInput(_0x3854ec),{dbId:_0x5f120f,dbName:_0x35ea4d}=await resolveDbSelection(_0x3854ec),_0x1553fa=await resolveSqlModeInput(_0x3854ec);return{'sqlName':_0x154b6b,'dbId':_0x5f120f,'dbName':_0x35ea4d,'mode':_0x1553fa};}async function resolveSqlNameInput(_0x4ab22d){const _0x45a52a=a150_0x551c5e,_0x4755ff=_0x4ab22d['str'](_0x45a52a(0x1de))[_0x45a52a(0x1ec)]();if(_0x4755ff)return _0x4755ff;if(_0x4ab22d[_0x45a52a(0x1f6)])throw CliErrors[_0x45a52a(0x1fc)](_0x45a52a(0x1de),_0x45a52a(0x20c));return(await input({'message':_0x45a52a(0x1d5),'validate':_0x55596f=>_0x55596f[_0x45a52a(0x1ec)]()?!![]:_0x45a52a(0x1ed)}))['trim']();}async function resolveDbSelection(_0x1eed98){const _0x58811b=a150_0x551c5e,_0x5260bf=resolveProvidedDbId(_0x1eed98);if(typeof _0x5260bf===_0x58811b(0x206)&&Number[_0x58811b(0x202)](_0x5260bf)&&_0x5260bf>0x0)return{'dbId':_0x5260bf,'dbName':await getDbName(_0x1eed98[_0x58811b(0x1fe)],_0x5260bf)['catch'](()=>undefined)};if(_0x1eed98[_0x58811b(0x1f6)])throw CliErrors[_0x58811b(0x1fc)]('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x21169c=await listDatabases(_0x1eed98['appCode'])[_0x58811b(0x1da)](()=>[]);if(_0x21169c['length']===0x1)return{'dbId':_0x21169c[0x0][_0x58811b(0x1fb)],'dbName':_0x21169c[0x0][_0x58811b(0x1d9)]};if(_0x21169c[_0x58811b(0x1ff)]>0x1){const _0x17a00d=await select({'message':_0x58811b(0x210),'choices':[..._0x21169c['map'](_0x441115=>({'name':_0x441115[_0x58811b(0x1d9)]+'\x20('+_0x441115[_0x58811b(0x1fb)]+')','value':serializeDbSelection(_0x441115)})),{'name':'✎\x20手动输入\x20dbId','value':'__manual__'}]});if(_0x17a00d!==_0x58811b(0x1ee))return deserializeDbSelection(_0x17a00d);}const _0x108122=await input({'message':_0x58811b(0x1e3),'validate':_0x4047b4=>{const _0x210b65=_0x58811b,_0x330287=_0x4047b4[_0x210b65(0x1ec)]();if(!_0x330287)return _0x210b65(0x205);const _0x898aa7=Number(_0x330287);if(!Number['isInteger'](_0x898aa7)||_0x898aa7<=0x0)return _0x210b65(0x1e9);return!![];}});return{'dbId':Number(_0x108122[_0x58811b(0x1ec)]())};}async function resolveSqlModeInput(_0x585f28){const _0x11ccc1=a150_0x551c5e,_0x4ec02a=_0x585f28[_0x11ccc1(0x1d6)](_0x11ccc1(0x1ea))[_0x11ccc1(0x1ec)]();if(_0x4ec02a===_0x11ccc1(0x209)||_0x4ec02a===_0x11ccc1(0x1df))return _0x4ec02a;if(_0x585f28[_0x11ccc1(0x1f6)])throw CliErrors[_0x11ccc1(0x1fc)](_0x11ccc1(0x1ea),_0x11ccc1(0x213));return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x11ccc1(0x1e5),'value':_0x11ccc1(0x209),'description':_0x11ccc1(0x201)},{'name':_0x11ccc1(0x1dc),'value':_0x11ccc1(0x1df),'description':_0x11ccc1(0x214)}]});}function a150_0x2ab3(){const _0x38e050=['--name\x20is\x20required\x20in\x20non-interactive\x20mode.','high-risk-write','SELECT\x201\x20AS\x20id;','sqlRoot','请选择目标数据库:','sqlRootDir','sqls','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','适合带动态标签的\x20MyBatis\x20XML\x20SQL','utf8','lockFilePath','434Xvbshf','请输入\x20SQL\x20名称:','str','Local\x20SQL\x20file\x20mode','File\x20already\x20exists:\x20','dbName','catch','flag','MyBatis\x20XML(mybatisXml)','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','name','mybatisXml','<server-generated-sqlCode>','string','sqlName','请输入目标数据库\x20dbId:','validation','普通\x20SQL(sql)','POST','1306740oTSDOz','</select>','dbId\x20必须为正整数','mode','db-id','trim','SQL\x20名称不能为空','__manual__','stringify','parse','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','730791TfrVxS','449320MVQkAJ','16zoksTt','nonInteractive','Target\x20database\x20ID','new','sqlCode','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','dbId','flagMissing','Invalid\x20database\x20selection\x20payload:\x20','appCode','length','250996ruLJSJ','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','isFinite','join','583952rUXeHP','dbId\x20不能为空','number','\x20\x20SELECT\x201\x20AS\x20id','1956cdejCQ','sql','toISOString','503214SsWZDq'];a150_0x2ab3=function(){return _0x38e050;};return a150_0x2ab3();}function serializeDbSelection(_0x44ac0a){const _0x3d3352=a150_0x551c5e;return JSON[_0x3d3352(0x1ef)]({'dbId':_0x44ac0a[_0x3d3352(0x1fb)],'dbName':_0x44ac0a[_0x3d3352(0x1d9)]});}function deserializeDbSelection(_0x416185){const _0x13b28f=a150_0x551c5e;try{const _0x228d61=JSON[_0x13b28f(0x1f0)](_0x416185);if(typeof _0x228d61[_0x13b28f(0x1fb)]==='number'&&Number['isFinite'](_0x228d61[_0x13b28f(0x1fb)]))return{'dbId':_0x228d61[_0x13b28f(0x1fb)],'dbName':_0x228d61['dbName']};}catch{}throw CliErrors[_0x13b28f(0x1e4)](_0x13b28f(0x1fd)+_0x416185);}function resolveProvidedDbId(_0xdee31d){const _0x32db69=a150_0x551c5e,_0x2fb03c=_0xdee31d[_0x32db69(0x1db)](_0x32db69(0x1eb));if(typeof _0x2fb03c==='number'&&Number[_0x32db69(0x202)](_0x2fb03c))return _0x2fb03c;return undefined;}
1
+ const a154_0x48826e=a154_0x426d;(function(_0x25271c,_0x42e9c1){const _0x2ba92c=a154_0x426d,_0x3004ff=_0x25271c();while(!![]){try{const _0x1faf7f=-parseInt(_0x2ba92c(0x1ac))/0x1+-parseInt(_0x2ba92c(0x16e))/0x2*(parseInt(_0x2ba92c(0x1a3))/0x3)+parseInt(_0x2ba92c(0x184))/0x4+-parseInt(_0x2ba92c(0x18f))/0x5*(parseInt(_0x2ba92c(0x16f))/0x6)+-parseInt(_0x2ba92c(0x178))/0x7*(parseInt(_0x2ba92c(0x19f))/0x8)+parseInt(_0x2ba92c(0x187))/0x9+parseInt(_0x2ba92c(0x189))/0xa;if(_0x1faf7f===_0x42e9c1)break;else _0x3004ff['push'](_0x3004ff['shift']());}catch(_0x1f3cdd){_0x3004ff['push'](_0x3004ff['shift']());}}}(a154_0x16d7,0x1c360));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';function a154_0x426d(_0x36bbee,_0x2b7a5a){_0x36bbee=_0x36bbee-0x16d;const _0x16d79e=a154_0x16d7();let _0x426d2b=_0x16d79e[_0x36bbee];return _0x426d2b;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x3590f5){const _0x3de08a=a154_0x426d;if(_0x3590f5==='mybatisXml')return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x3de08a(0x1a9),'</select>',''][_0x3de08a(0x17d)]('\x0a');return[_0x3de08a(0x1a7),''][_0x3de08a(0x17d)]('\x0a');}export const sqlCreate={'service':a154_0x48826e(0x1ad),'command':a154_0x48826e(0x1a4),'description':a154_0x48826e(0x1a0),'risk':'high-risk-write','flags':[{'name':a154_0x48826e(0x17b),'type':a154_0x48826e(0x1a8),'description':a154_0x48826e(0x177)},{'name':a154_0x48826e(0x171),'type':'number','description':a154_0x48826e(0x1aa)},{'name':'mode','type':'string','enum':['sql','mybatisXml'],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x30923c){const _0x4c9a3a=a154_0x48826e;if(!_0x30923c[_0x4c9a3a(0x18c)])return;if(!_0x30923c[_0x4c9a3a(0x190)]('name')[_0x4c9a3a(0x17f)]())throw CliErrors['flagMissing'](_0x4c9a3a(0x17b),_0x4c9a3a(0x17c));const _0x53f12d=resolveProvidedDbId(_0x30923c);if(typeof _0x53f12d!==_0x4c9a3a(0x19c)||!Number[_0x4c9a3a(0x195)](_0x53f12d)||_0x53f12d<=0x0)throw CliErrors[_0x4c9a3a(0x196)](_0x4c9a3a(0x171),_0x4c9a3a(0x191));if(!_0x30923c[_0x4c9a3a(0x190)](_0x4c9a3a(0x192))[_0x4c9a3a(0x17f)]())throw CliErrors[_0x4c9a3a(0x196)](_0x4c9a3a(0x192),_0x4c9a3a(0x183));},async 'dryRun'(_0x3e12bb){const _0x1948f2=a154_0x48826e,_0x3ba0b4=loadSqlProjectConfig(_0x3e12bb['appCode']),{sqlName:_0x284cab,dbId:_0x3cf03d,dbName:_0x1cf78c,mode:_0x324f03}=await resolveSqlNewInputs(_0x3e12bb),_0x25e3c9=buildSqlRelativePath(_0x1948f2(0x194),_0x284cab,_0x1cf78c,_0x324f03,_0x3cf03d),_0x257236=_0x3ba0b4[_0x1948f2(0x19d)]+'/'+_0x25e3c9;return{'method':'POST','url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x3e12bb[_0x1948f2(0x174)],'sqlName':_0x284cab,'dbId':_0x3cf03d,'mode':_0x324f03,'localPath':_0x257236},'description':_0x1948f2(0x186)+_0x3ba0b4[_0x1948f2(0x19d)]};},async 'execute'(_0x4a6f5c){const _0x57a324=a154_0x48826e,_0x334aa9=loadSqlProjectConfig(_0x4a6f5c[_0x57a324(0x174)]),{sqlName:_0x1119bd,dbId:_0x2d6bbb,dbName:_0x13b253,mode:_0x304272}=await resolveSqlNewInputs(_0x4a6f5c),_0x37cc84=generateSqlTemplate(_0x304272),_0x59d33f=await createSqlQuery({'appCode':_0x4a6f5c[_0x57a324(0x174)],'sqlName':_0x1119bd,'dbId':_0x2d6bbb,'sqlContent':_0x37cc84}),_0x30541a=ensureRemoteSqlContent(_0x59d33f),_0x80d6f9=_0x13b253||await getDbName(_0x4a6f5c['appCode'],_0x2d6bbb)[_0x57a324(0x1a2)](()=>undefined),_0x2fa8e3=buildSqlRelativePath(_0x59d33f[_0x57a324(0x19a)],_0x59d33f[_0x57a324(0x1a6)],_0x80d6f9,_0x304272,_0x2d6bbb),_0x1107be=_0x334aa9[_0x57a324(0x19d)]+'/'+_0x2fa8e3,_0x22ba3a=buildLocalSqlFileContent({'sqlCode':_0x59d33f[_0x57a324(0x19a)],'sqlName':_0x59d33f[_0x57a324(0x1a6)],'dbId':_0x59d33f[_0x57a324(0x185)]},_0x30541a,{'dbName':_0x80d6f9,'mode':_0x304272,'syncedAt':new Date()['toISOString'](),'description':_0x59d33f[_0x57a324(0x198)]});if(await fileExists(_0x1107be))throw CliErrors[_0x57a324(0x19b)](_0x57a324(0x182)+_0x1107be);await ensureParentDirectory(_0x1107be),await writeFile(_0x1107be,_0x22ba3a,_0x57a324(0x179));const _0x510200=await readSqlLockFile(_0x334aa9['lockFilePath']),{lockData:_0x56b6fe,appLock:_0x1a7f39}=ensureSqlLockScope(_0x510200??createEmptySqlLock(),_0x334aa9[_0x57a324(0x174)],_0x334aa9['sqlRoot'],_0x57a324(0x18b));return _0x1a7f39[_0x57a324(0x199)][_0x59d33f[_0x57a324(0x19a)]]={...buildSqlLockEntry(_0x59d33f,_0x30541a,computeSqlContentHash(_0x22ba3a),{'dbName':_0x80d6f9}),'path':_0x2fa8e3,'mode':_0x304272},_0x1a7f39[_0x57a324(0x193)]=new Date()[_0x57a324(0x1a1)](),await writeSqlLockFile(_0x334aa9[_0x57a324(0x181)],_0x56b6fe),{'ok':!![],'data':{'id':_0x59d33f['id'],'sqlCode':_0x59d33f['sqlCode'],'sqlName':_0x59d33f[_0x57a324(0x1a6)],'dbId':_0x59d33f[_0x57a324(0x185)],'path':_0x1107be,'mode':_0x304272},'message':'Created\x20SQL\x20query\x20'+_0x59d33f[_0x57a324(0x19a)]};}};async function resolveSqlNewInputs(_0xff77fe){const _0x37fbb2=await resolveSqlNameInput(_0xff77fe),{dbId:_0x51e888,dbName:_0x48387b}=await resolveDbSelection(_0xff77fe),_0x39267d=await resolveSqlModeInput(_0xff77fe);return{'sqlName':_0x37fbb2,'dbId':_0x51e888,'dbName':_0x48387b,'mode':_0x39267d};}function a154_0x16d7(){const _0x2cb065=['stringify','appCode','length','flag','SQL\x20query\x20display\x20name','14zHObaG','utf8','isInteger','name','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','join','__manual__','trim','dbId\x20不能为空','lockFilePath','File\x20already\x20exists:\x20','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','214264arZtKE','dbId','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','519687cUPtDD','parse','5809440XzzyNF','dbId\x20必须为正整数','new','nonInteractive','普通\x20SQL(sql)','请选择本地\x20SQL\x20模式:','22735hqryTb','str','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','mode','lastSync','<server-generated-sqlCode>','isFinite','flagMissing','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','description','sqls','sqlCode','validation','number','sqlRootDir','SQL\x20名称不能为空','783856FJIjJI','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','toISOString','catch','663603yvfitF','create','Invalid\x20database\x20selection\x20payload:\x20','sqlName','SELECT\x201\x20AS\x20id;','string','\x20\x20SELECT\x201\x20AS\x20id','Target\x20database\x20ID','请选择目标数据库:','45861IppeNK','sql','MyBatis\x20XML(mybatisXml)','2xxvCrA','150oueKuc','mybatisXml','db-id','dbName'];a154_0x16d7=function(){return _0x2cb065;};return a154_0x16d7();}async function resolveSqlNameInput(_0x10aad1){const _0x556403=a154_0x48826e,_0x273fc4=_0x10aad1[_0x556403(0x190)](_0x556403(0x17b))['trim']();if(_0x273fc4)return _0x273fc4;if(_0x10aad1['nonInteractive'])throw CliErrors['flagMissing']('name',_0x556403(0x17c));return(await input({'message':'请输入\x20SQL\x20名称:','validate':_0x3d2bc5=>_0x3d2bc5['trim']()?!![]:_0x556403(0x19e)}))[_0x556403(0x17f)]();}async function resolveDbSelection(_0xd8b5a8){const _0x347eb8=a154_0x48826e,_0x53b962=resolveProvidedDbId(_0xd8b5a8);if(typeof _0x53b962==='number'&&Number[_0x347eb8(0x195)](_0x53b962)&&_0x53b962>0x0)return{'dbId':_0x53b962,'dbName':await getDbName(_0xd8b5a8[_0x347eb8(0x174)],_0x53b962)[_0x347eb8(0x1a2)](()=>undefined)};if(_0xd8b5a8[_0x347eb8(0x18c)])throw CliErrors[_0x347eb8(0x196)](_0x347eb8(0x171),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x34329e=await listDatabases(_0xd8b5a8[_0x347eb8(0x174)])[_0x347eb8(0x1a2)](()=>[]);if(_0x34329e[_0x347eb8(0x175)]===0x1)return{'dbId':_0x34329e[0x0]['dbId'],'dbName':_0x34329e[0x0][_0x347eb8(0x172)]};if(_0x34329e[_0x347eb8(0x175)]>0x1){const _0x48e863=await select({'message':_0x347eb8(0x1ab),'choices':[..._0x34329e['map'](_0x3fa1a0=>({'name':_0x3fa1a0[_0x347eb8(0x172)]+'\x20('+_0x3fa1a0[_0x347eb8(0x185)]+')','value':serializeDbSelection(_0x3fa1a0)})),{'name':'✎\x20手动输入\x20dbId','value':'__manual__'}]});if(_0x48e863!==_0x347eb8(0x17e))return deserializeDbSelection(_0x48e863);}const _0x323279=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x125209=>{const _0x2aedf3=_0x347eb8,_0x347bef=_0x125209['trim']();if(!_0x347bef)return _0x2aedf3(0x180);const _0x8816f9=Number(_0x347bef);if(!Number[_0x2aedf3(0x17a)](_0x8816f9)||_0x8816f9<=0x0)return _0x2aedf3(0x18a);return!![];}});return{'dbId':Number(_0x323279[_0x347eb8(0x17f)]())};}async function resolveSqlModeInput(_0x39e985){const _0x2cf719=a154_0x48826e,_0x2713fd=_0x39e985[_0x2cf719(0x190)](_0x2cf719(0x192))[_0x2cf719(0x17f)]();if(_0x2713fd===_0x2cf719(0x1ad)||_0x2713fd==='mybatisXml')return _0x2713fd;if(_0x39e985[_0x2cf719(0x18c)])throw CliErrors[_0x2cf719(0x196)](_0x2cf719(0x192),_0x2cf719(0x183));return await select({'message':_0x2cf719(0x18e),'choices':[{'name':_0x2cf719(0x18d),'value':_0x2cf719(0x1ad),'description':_0x2cf719(0x197)},{'name':_0x2cf719(0x16d),'value':_0x2cf719(0x170),'description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function serializeDbSelection(_0x47be0c){const _0x24b432=a154_0x48826e;return JSON[_0x24b432(0x173)]({'dbId':_0x47be0c['dbId'],'dbName':_0x47be0c['dbName']});}function deserializeDbSelection(_0x4c3a1d){const _0x1b0cee=a154_0x48826e;try{const _0x25e151=JSON[_0x1b0cee(0x188)](_0x4c3a1d);if(typeof _0x25e151[_0x1b0cee(0x185)]===_0x1b0cee(0x19c)&&Number['isFinite'](_0x25e151[_0x1b0cee(0x185)]))return{'dbId':_0x25e151[_0x1b0cee(0x185)],'dbName':_0x25e151['dbName']};}catch{}throw CliErrors[_0x1b0cee(0x19b)](_0x1b0cee(0x1a5)+_0x4c3a1d);}function resolveProvidedDbId(_0x2ea61e){const _0xb4f694=a154_0x48826e,_0x364c99=_0x2ea61e[_0xb4f694(0x176)](_0xb4f694(0x171));if(typeof _0x364c99===_0xb4f694(0x19c)&&Number['isFinite'](_0x364c99))return _0x364c99;return undefined;}
@@ -1 +1 @@
1
- const a151_0x34ff80=a151_0x4f13;(function(_0x36cb96,_0x39143a){const _0x7d50d9=a151_0x4f13,_0x3b0296=_0x36cb96();while(!![]){try{const _0xee2124=-parseInt(_0x7d50d9(0x126))/0x1+parseInt(_0x7d50d9(0x125))/0x2+-parseInt(_0x7d50d9(0x116))/0x3+-parseInt(_0x7d50d9(0x12a))/0x4+-parseInt(_0x7d50d9(0x135))/0x5*(parseInt(_0x7d50d9(0x122))/0x6)+parseInt(_0x7d50d9(0x127))/0x7+-parseInt(_0x7d50d9(0x133))/0x8*(-parseInt(_0x7d50d9(0x11e))/0x9);if(_0xee2124===_0x39143a)break;else _0x3b0296['push'](_0x3b0296['shift']());}catch(_0x583b37){_0x3b0296['push'](_0x3b0296['shift']());}}}(a151_0x3f03,0xc97f1));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a151_0x3f03(){const _0x456b9f=['POST','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','fromEntries','str','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','startsWith','trashDir','filter','8LcqiPW','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','2699950SaOWvh','\x20(local\x20file\x20moved\x20to\x20trash)','SQL\x20lock\x20file\x20not\x20found.','Would\x20delete\x20SQL\x20','4932942DDMvlu','sqlRoot','delete','validation','entries','Deleted\x20','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','sqlcode','29620989DKNBSu','/smartapi/custom/deleteUserCustomSql','appCode','trashedTo','12BhDIWh','remoteId','projectRoot','2188876dTAJUX','245129bfdCmr','680449NcvUWI','lockFilePath','sqls','2752456KBouuf'];a151_0x3f03=function(){return _0x456b9f;};return a151_0x3f03();}import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a151_0x4f13(_0x266552,_0x21a835){_0x266552=_0x266552-0x114;const _0x3f030a=a151_0x3f03();let _0x4f1394=_0x3f030a[_0x266552];return _0x4f1394;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':'delete','description':a151_0x34ff80(0x134),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x59b07c){const _0x561433=a151_0x34ff80,_0x23fa01=loadSqlProjectConfig(_0x59b07c[_0x561433(0x120)]),_0x18e2eb=await readSqlLockFile(_0x23fa01[_0x561433(0x128)]);if(!_0x18e2eb)throw CliErrors[_0x561433(0x119)](_0x561433(0x12c));},async 'dryRun'(_0x5e7758){const _0x5e5bfe=a151_0x34ff80,_0x3f62d6=loadSqlProjectConfig(_0x5e7758[_0x5e5bfe(0x120)]),_0x1e7da9=await readSqlLockFile(_0x3f62d6[_0x5e5bfe(0x128)]);if(!_0x1e7da9)throw CliErrors[_0x5e5bfe(0x119)](_0x5e5bfe(0x12c));const {appLock:_0x3e5009}=ensureSqlLockScope(_0x1e7da9,_0x5e7758[_0x5e5bfe(0x120)],_0x3f62d6[_0x5e5bfe(0x117)],_0x5e5bfe(0x118)),_0x32776f=_0x5e7758[_0x5e5bfe(0x12e)]('sqlcode'),_0x36bbef=_0x3e5009[_0x5e5bfe(0x129)][_0x32776f];if(!_0x36bbef)throw CliErrors['validation'](_0x5e5bfe(0x11c)+_0x32776f+'\x22.');return{'method':_0x5e5bfe(0x12b),'url':_0x5e5bfe(0x11f),'body':{'sqlCode':_0x32776f,'id':_0x36bbef['remoteId'],'localPath':resolveLocalSqlFilePath(_0x3f62d6,_0x32776f,_0x36bbef)},'description':_0x5e5bfe(0x115)+_0x32776f+_0x5e5bfe(0x12f)+_0x3f62d6['trashDir']};},async 'execute'(_0x9d5f4a){const _0x14079f=a151_0x34ff80,_0x5af5ff=loadSqlProjectConfig(_0x9d5f4a[_0x14079f(0x120)]),_0x110750=await readSqlLockFile(_0x5af5ff[_0x14079f(0x128)]);if(!_0x110750)throw CliErrors[_0x14079f(0x119)](_0x14079f(0x114));const {lockData:_0x3861b7,appLock:_0xd99483}=ensureSqlLockScope(_0x110750,_0x9d5f4a[_0x14079f(0x120)],_0x5af5ff[_0x14079f(0x117)],_0x14079f(0x118)),_0x32aeb9=_0x9d5f4a[_0x14079f(0x12e)](_0x14079f(0x11d)),_0x137160=_0xd99483['sqls'][_0x32aeb9];if(!_0x137160)throw CliErrors['validation'](_0x14079f(0x11c)+_0x32aeb9+'\x22.');await deleteSqlQuery({'id':_0x137160[_0x14079f(0x123)],'sqlCode':_0x32aeb9}),_0xd99483['sqls']=Object[_0x14079f(0x12d)](Object[_0x14079f(0x11a)](_0xd99483['sqls'])[_0x14079f(0x132)](([_0x5775ac])=>_0x5775ac!==_0x32aeb9)),_0xd99483['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x5af5ff['lockFilePath'],_0x3861b7);const _0x1d4473=resolveLocalSqlFilePath(_0x5af5ff,_0x32aeb9,_0x137160);let _0x4e6a57;await fileExists(_0x1d4473)&&(_0x4e6a57=await moveToTrash(_0x5af5ff[_0x14079f(0x124)],_0x5af5ff[_0x14079f(0x131)],_0x1d4473),await cleanupEmptyDirectories(dirname(_0x1d4473),_0x5af5ff['sqlRootDir']));const _0x10b865={'deleted':_0x32aeb9,'remoteId':_0x137160['remoteId']};if(_0x4e6a57)_0x10b865[_0x14079f(0x121)]=_0x4e6a57;return{'ok':!![],'data':_0x10b865,'message':_0x14079f(0x11b)+_0x32aeb9+(_0x4e6a57?_0x14079f(0x136):'')};}};async function moveToTrash(_0x31e5d3,_0x5b6554,_0x5dd82e){const _0xfb991b=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0xe2ff26=relative(_0x31e5d3,_0x5dd82e),_0x31825f=join(_0x5b6554,_0xfb991b,_0xe2ff26);return await mkdir(dirname(_0x31825f),{'recursive':!![]}),await rename(_0x5dd82e,_0x31825f),_0x31825f;}async function cleanupEmptyDirectories(_0x287bfd,_0x2d7208){const _0x221f79=a151_0x34ff80;let _0x2203af=resolve(_0x287bfd);const _0x5262a3=resolve(_0x2d7208);while(_0x2203af[_0x221f79(0x130)](''+_0x5262a3+sep)||_0x2203af===_0x5262a3){if(_0x2203af===_0x5262a3)return;try{const _0x3f14d0=await readdir(_0x2203af);if(_0x3f14d0['length']>0x0)return;await rmdir(_0x2203af);}catch{return;}_0x2203af=dirname(_0x2203af);}}
1
+ const a155_0x3b6913=a155_0x24e8;(function(_0x15589a,_0x1899ba){const _0x3f4ef6=a155_0x24e8,_0x3dfe8f=_0x15589a();while(!![]){try{const _0x3fe606=parseInt(_0x3f4ef6(0x125))/0x1*(-parseInt(_0x3f4ef6(0x11b))/0x2)+parseInt(_0x3f4ef6(0x10e))/0x3+-parseInt(_0x3f4ef6(0x11f))/0x4*(-parseInt(_0x3f4ef6(0x108))/0x5)+-parseInt(_0x3f4ef6(0x107))/0x6+-parseInt(_0x3f4ef6(0x10a))/0x7*(-parseInt(_0x3f4ef6(0x124))/0x8)+-parseInt(_0x3f4ef6(0x111))/0x9+-parseInt(_0x3f4ef6(0x11a))/0xa*(-parseInt(_0x3f4ef6(0x103))/0xb);if(_0x3fe606===_0x1899ba)break;else _0x3dfe8f['push'](_0x3dfe8f['shift']());}catch(_0xffc7d7){_0x3dfe8f['push'](_0x3dfe8f['shift']());}}}(a155_0x2056,0xeb130));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a155_0x2056(){const _0x4ec8a1=['toISOString','str','148056QGupUj','sqlRoot','sql','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','validation','79896NJUmfg','539950tdeofo','1838001XwonAd','projectRoot','high-risk-write','length','6810648hJnjol','10gjWwmq','sqlcode','427OYEWsO','trashDir','delete','replace','3867213ToyQxA','lastSync','startsWith','3840003OSVELV','appCode','trashedTo','lockFilePath','sqls','remoteId','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','POST','/smartapi/custom/deleteUserCustomSql','130FAEFgg','6TKNIYp','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'];a155_0x2056=function(){return _0x4ec8a1;};return a155_0x2056();}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 a155_0x24e8(_0x168053,_0x54781f){_0x168053=_0x168053-0x103;const _0x205602=a155_0x2056();let _0x24e8d5=_0x205602[_0x168053];return _0x24e8d5;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a155_0x3b6913(0x121),'command':a155_0x3b6913(0x10c),'description':a155_0x3b6913(0x117),'risk':a155_0x3b6913(0x105),'flags':[SQLCODE_FLAG],async 'validate'(_0x232843){const _0x96122d=a155_0x3b6913,_0x55ddb9=loadSqlProjectConfig(_0x232843['appCode']),_0x16cf36=await readSqlLockFile(_0x55ddb9[_0x96122d(0x114)]);if(!_0x16cf36)throw CliErrors[_0x96122d(0x123)](_0x96122d(0x122));},async 'dryRun'(_0x2066aa){const _0x2a8d65=a155_0x3b6913,_0x1b55a3=loadSqlProjectConfig(_0x2066aa[_0x2a8d65(0x112)]),_0x490490=await readSqlLockFile(_0x1b55a3[_0x2a8d65(0x114)]);if(!_0x490490)throw CliErrors['validation'](_0x2a8d65(0x122));const {appLock:_0x1b6226}=ensureSqlLockScope(_0x490490,_0x2066aa[_0x2a8d65(0x112)],_0x1b55a3[_0x2a8d65(0x120)],_0x2a8d65(0x10c)),_0x261bd5=_0x2066aa[_0x2a8d65(0x11e)](_0x2a8d65(0x109)),_0x2eed13=_0x1b6226['sqls'][_0x261bd5];if(!_0x2eed13)throw CliErrors[_0x2a8d65(0x123)](_0x2a8d65(0x11c)+_0x261bd5+'\x22.');return{'method':_0x2a8d65(0x118),'url':_0x2a8d65(0x119),'body':{'sqlCode':_0x261bd5,'id':_0x2eed13[_0x2a8d65(0x116)],'localPath':resolveLocalSqlFilePath(_0x1b55a3,_0x261bd5,_0x2eed13)},'description':'Would\x20delete\x20SQL\x20'+_0x261bd5+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x1b55a3[_0x2a8d65(0x10b)]};},async 'execute'(_0x36e494){const _0x1e7094=a155_0x3b6913,_0x46c163=loadSqlProjectConfig(_0x36e494[_0x1e7094(0x112)]),_0x5188fc=await readSqlLockFile(_0x46c163[_0x1e7094(0x114)]);if(!_0x5188fc)throw CliErrors[_0x1e7094(0x123)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x4ac785,appLock:_0x1008d0}=ensureSqlLockScope(_0x5188fc,_0x36e494[_0x1e7094(0x112)],_0x46c163[_0x1e7094(0x120)],_0x1e7094(0x10c)),_0x12f6e4=_0x36e494['str'](_0x1e7094(0x109)),_0x340537=_0x1008d0[_0x1e7094(0x115)][_0x12f6e4];if(!_0x340537)throw CliErrors['validation'](_0x1e7094(0x11c)+_0x12f6e4+'\x22.');await deleteSqlQuery({'id':_0x340537[_0x1e7094(0x116)],'sqlCode':_0x12f6e4}),_0x1008d0['sqls']=Object['fromEntries'](Object['entries'](_0x1008d0['sqls'])['filter'](([_0x48ea0c])=>_0x48ea0c!==_0x12f6e4)),_0x1008d0[_0x1e7094(0x10f)]=new Date()[_0x1e7094(0x11d)](),await writeSqlLockFile(_0x46c163[_0x1e7094(0x114)],_0x4ac785);const _0x5f098e=resolveLocalSqlFilePath(_0x46c163,_0x12f6e4,_0x340537);let _0x900115;await fileExists(_0x5f098e)&&(_0x900115=await moveToTrash(_0x46c163[_0x1e7094(0x104)],_0x46c163[_0x1e7094(0x10b)],_0x5f098e),await cleanupEmptyDirectories(dirname(_0x5f098e),_0x46c163['sqlRootDir']));const _0x230379={'deleted':_0x12f6e4,'remoteId':_0x340537['remoteId']};if(_0x900115)_0x230379[_0x1e7094(0x113)]=_0x900115;return{'ok':!![],'data':_0x230379,'message':'Deleted\x20'+_0x12f6e4+(_0x900115?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x1c4899,_0x2e5ac1,_0x4d2409){const _0x2894ad=a155_0x3b6913,_0x584404=new Date()[_0x2894ad(0x11d)]()[_0x2894ad(0x10d)](/[:.]/g,'-'),_0x5c3737=relative(_0x1c4899,_0x4d2409),_0x5820c4=join(_0x2e5ac1,_0x584404,_0x5c3737);return await mkdir(dirname(_0x5820c4),{'recursive':!![]}),await rename(_0x4d2409,_0x5820c4),_0x5820c4;}async function cleanupEmptyDirectories(_0x443a32,_0x5b48ae){const _0x188724=a155_0x3b6913;let _0x162945=resolve(_0x443a32);const _0xd621bc=resolve(_0x5b48ae);while(_0x162945[_0x188724(0x110)](''+_0xd621bc+sep)||_0x162945===_0xd621bc){if(_0x162945===_0xd621bc)return;try{const _0x4e19ae=await readdir(_0x162945);if(_0x4e19ae[_0x188724(0x106)]>0x0)return;await rmdir(_0x162945);}catch{return;}_0x162945=dirname(_0x162945);}}
@@ -1 +1 @@
1
- const a152_0x469c98=a152_0x4db2;(function(_0x4f8663,_0x19ce3c){const _0x2d2198=a152_0x4db2,_0x2be7bc=_0x4f8663();while(!![]){try{const _0x444c23=parseInt(_0x2d2198(0x12b))/0x1*(-parseInt(_0x2d2198(0x125))/0x2)+-parseInt(_0x2d2198(0x12a))/0x3*(-parseInt(_0x2d2198(0x11a))/0x4)+parseInt(_0x2d2198(0x130))/0x5+parseInt(_0x2d2198(0x11e))/0x6+parseInt(_0x2d2198(0x11b))/0x7*(parseInt(_0x2d2198(0x12c))/0x8)+parseInt(_0x2d2198(0x121))/0x9*(parseInt(_0x2d2198(0x11d))/0xa)+parseInt(_0x2d2198(0x127))/0xb*(-parseInt(_0x2d2198(0x126))/0xc);if(_0x444c23===_0x19ce3c)break;else _0x2be7bc['push'](_0x2be7bc['shift']());}catch(_0x395a3c){_0x2be7bc['push'](_0x2be7bc['shift']());}}}(a152_0x197b,0x86593));function a152_0x4db2(_0x5e452e,_0x3ca35d){_0x5e452e=_0x5e452e-0x11a;const _0x197bbb=a152_0x197b();let _0x4db226=_0x197bbb[_0x5e452e];return _0x4db226;}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a152_0x197b(){const _0x284038=['9768UKXsbe','detail','verbose','sql','2878870MtvGyN','dbId','2766652zagpVQ','1743iGMtsr','appCode','150jFPBeY','3557220CSIZXZ','bool','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','332334EGHrdT','Return\x20full\x20raw\x20SQL\x20query\x20object','sqlCode','sqlcode','4070xIpkyu','1320sVInkp','168157qOYfEE','description','str','3DKMrnW','239xeEysX'];a152_0x197b=function(){return _0x284038;};return a152_0x197b();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a152_0x469c98(0x12f),'command':a152_0x469c98(0x12d),'description':a152_0x469c98(0x120),'risk':'read','flags':[SQLCODE_FLAG,{'name':a152_0x469c98(0x12e),'type':'boolean','description':a152_0x469c98(0x122)}],async 'execute'(_0x30cf3f){const _0x43d555=a152_0x469c98,_0x4c3cf1=await getSqlQueryInfo(_0x30cf3f[_0x43d555(0x11c)],_0x30cf3f[_0x43d555(0x129)](_0x43d555(0x124))),_0xa76f43=_0x30cf3f[_0x43d555(0x11f)](_0x43d555(0x12e));if(_0xa76f43)return{'ok':!![],'data':_0x4c3cf1};const _0x2073e0=_0x4c3cf1[_0x43d555(0x131)]?await getDbName(_0x30cf3f[_0x43d555(0x11c)],_0x4c3cf1['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x4c3cf1[_0x43d555(0x123)],'sqlName':_0x4c3cf1['sqlName'],'db':_0x2073e0?_0x2073e0+'\x20('+_0x4c3cf1[_0x43d555(0x131)]+')':_0x4c3cf1[_0x43d555(0x131)]??'','description':_0x4c3cf1[_0x43d555(0x128)]??'','sqlContent':_0x4c3cf1['sqlContent']??''}};}};
1
+ const a156_0x2d077b=a156_0x3bc0;(function(_0x258b42,_0x2e5b48){const _0x465328=a156_0x3bc0,_0x253287=_0x258b42();while(!![]){try{const _0x48bc32=-parseInt(_0x465328(0x1f2))/0x1+parseInt(_0x465328(0x1f0))/0x2+parseInt(_0x465328(0x1e6))/0x3+-parseInt(_0x465328(0x1ea))/0x4+-parseInt(_0x465328(0x1e4))/0x5*(parseInt(_0x465328(0x1f1))/0x6)+-parseInt(_0x465328(0x1e9))/0x7+parseInt(_0x465328(0x1f7))/0x8;if(_0x48bc32===_0x2e5b48)break;else _0x253287['push'](_0x253287['shift']());}catch(_0x4982d0){_0x253287['push'](_0x253287['shift']());}}}(a156_0x509a,0x21ed1));import{getSqlQueryInfo}from'../../core/api-client.js';function a156_0x509a(){const _0x1db7ed=['sqlName','950362KpMpAL','1053644pMAzNT','read','sqlContent','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','verbose','bool','392064KFASdR','6lgIbfl','263722SFhJCZ','detail','appCode','sqlCode','dbId','4524504nDcMTY','772715TLrIFm','boolean','584424UsiMWs','sql'];a156_0x509a=function(){return _0x1db7ed;};return a156_0x509a();}import{getDbName}from'../../core/db-resolver.js';function a156_0x3bc0(_0x1825de,_0x4fe6fe){_0x1825de=_0x1825de-0x1e4;const _0x509a53=a156_0x509a();let _0x3bc043=_0x509a53[_0x1825de];return _0x3bc043;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a156_0x2d077b(0x1e7),'command':a156_0x2d077b(0x1f3),'description':a156_0x2d077b(0x1ed),'risk':a156_0x2d077b(0x1eb),'flags':[SQLCODE_FLAG,{'name':a156_0x2d077b(0x1ee),'type':a156_0x2d077b(0x1e5),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x1bd1f4){const _0xa9d75e=a156_0x2d077b,_0x3ccfdd=await getSqlQueryInfo(_0x1bd1f4[_0xa9d75e(0x1f4)],_0x1bd1f4['str']('sqlcode')),_0x4156f7=_0x1bd1f4[_0xa9d75e(0x1ef)](_0xa9d75e(0x1ee));if(_0x4156f7)return{'ok':!![],'data':_0x3ccfdd};const _0x2b3af1=_0x3ccfdd['dbId']?await getDbName(_0x1bd1f4['appCode'],_0x3ccfdd[_0xa9d75e(0x1f6)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x3ccfdd[_0xa9d75e(0x1f5)],'sqlName':_0x3ccfdd[_0xa9d75e(0x1e8)],'db':_0x2b3af1?_0x2b3af1+'\x20('+_0x3ccfdd[_0xa9d75e(0x1f6)]+')':_0x3ccfdd['dbId']??'','description':_0x3ccfdd['description']??'','sqlContent':_0x3ccfdd[_0xa9d75e(0x1ec)]??''}};}};
@@ -1 +1 @@
1
- const a153_0x1cbb36=a153_0x2c2e;function a153_0x1dc8(){const _0x5da112=['2338400EMGpdQ','104556klVmmq','\x20row(s)\x20in\x20','execError','88543jPJFtP','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','str','length','268725jMZxCr','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','491bGkzed','now','1327472HugmJE','15gCijUv','sqlcode','params','6rgSImc','913392hOjIFl','290gMJuSr','Returned\x20','SQL\x20execution\x20failed','string'];a153_0x1dc8=function(){return _0x5da112;};return a153_0x1dc8();}(function(_0x13735f,_0xd892f0){const _0x2e02f5=a153_0x2c2e,_0x30fee7=_0x13735f();while(!![]){try{const _0x181670=parseInt(_0x2e02f5(0x1bb))/0x1*(-parseInt(_0x2e02f5(0x1c3))/0x2)+-parseInt(_0x2e02f5(0x1b9))/0x3+-parseInt(_0x2e02f5(0x1b2))/0x4*(-parseInt(_0x2e02f5(0x1be))/0x5)+-parseInt(_0x2e02f5(0x1c1))/0x6*(parseInt(_0x2e02f5(0x1b5))/0x7)+parseInt(_0x2e02f5(0x1bd))/0x8+-parseInt(_0x2e02f5(0x1c2))/0x9+parseInt(_0x2e02f5(0x1c7))/0xa;if(_0x181670===_0xd892f0)break;else _0x30fee7['push'](_0x30fee7['shift']());}catch(_0x3c8b4b){_0x30fee7['push'](_0x30fee7['shift']());}}}(a153_0x1dc8,0x31a14));import{executeSql}from'../../core/api-client.js';function a153_0x2c2e(_0x51b853,_0x4277be){_0x51b853=_0x51b853-0x1b2;const _0x1dc8a2=a153_0x1dc8();let _0x2c2e76=_0x1dc8a2[_0x51b853];return _0x2c2e76;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':'exec','description':a153_0x1cbb36(0x1b6),'risk':'read','flags':[SQLCODE_FLAG,{'name':a153_0x1cbb36(0x1c0),'type':a153_0x1cbb36(0x1c6),'description':a153_0x1cbb36(0x1ba)}],async 'execute'(_0x4f66d6){const _0x44b547=a153_0x1cbb36,_0x3e3d9f=parseJsonParams(_0x4f66d6[_0x44b547(0x1b7)](_0x44b547(0x1c0))),_0x5e58b8=Date[_0x44b547(0x1bc)](),_0x430979=await executeSql(_0x4f66d6['appCode'],_0x4f66d6[_0x44b547(0x1b7)](_0x44b547(0x1bf)),_0x3e3d9f),_0x1ae3d1=Date[_0x44b547(0x1bc)]()-_0x5e58b8,_0x16d66e=_0x430979?.['execResult']??_0x430979,_0x9ce86e=_0x430979?.['execSuccess']??!![];if(!_0x9ce86e)return{'ok':![],'data':{'error':_0x430979?.[_0x44b547(0x1b4)]||_0x44b547(0x1c5),'elapsed':_0x1ae3d1},'message':'SQL\x20execution\x20failed'};const _0x1ca374=Array['isArray'](_0x16d66e)?_0x16d66e:[];return{'ok':!![],'data':{'rows':_0x1ca374,'rowCount':_0x1ca374[_0x44b547(0x1b8)],'elapsed':_0x1ae3d1},'message':_0x44b547(0x1c4)+_0x1ca374['length']+_0x44b547(0x1b3)+_0x1ae3d1+'ms'};}};
1
+ const a157_0x26fe2a=a157_0x5444;(function(_0x2d0685,_0x1b36a6){const _0x1dbeb9=a157_0x5444,_0x336592=_0x2d0685();while(!![]){try{const _0x2c9eb4=parseInt(_0x1dbeb9(0x76))/0x1*(-parseInt(_0x1dbeb9(0x7c))/0x2)+-parseInt(_0x1dbeb9(0x73))/0x3*(-parseInt(_0x1dbeb9(0x72))/0x4)+-parseInt(_0x1dbeb9(0x75))/0x5*(parseInt(_0x1dbeb9(0x82))/0x6)+parseInt(_0x1dbeb9(0x7f))/0x7+-parseInt(_0x1dbeb9(0x79))/0x8+-parseInt(_0x1dbeb9(0x71))/0x9+-parseInt(_0x1dbeb9(0x7d))/0xa*(-parseInt(_0x1dbeb9(0x6b))/0xb);if(_0x2c9eb4===_0x1b36a6)break;else _0x336592['push'](_0x336592['shift']());}catch(_0x24dcec){_0x336592['push'](_0x336592['shift']());}}}(a157_0x1c77,0xcbd5c));import{executeSql}from'../../core/api-client.js';function a157_0x5444(_0x318832,_0x426001){_0x318832=_0x318832-0x6a;const _0x1c771e=a157_0x1c77();let _0x5444b8=_0x1c771e[_0x318832];return _0x5444b8;}function a157_0x1c77(){const _0x3249d7=['Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','execResult','32JMHGMC','250bavMFL','exec','5207020icPPmh','\x20row(s)\x20in\x20','string','3054BTzoMG','SQL\x20execution\x20failed','1222111kFQgPK','sql','str','read','appCode','length','14078808fVewPv','29960wSICCh','585ZLpKzP','execSuccess','8135IxGJca','60610AnONRK','params','Returned\x20','6278496vKtJkL'];a157_0x1c77=function(){return _0x3249d7;};return a157_0x1c77();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a157_0x26fe2a(0x6c),'command':a157_0x26fe2a(0x7e),'description':a157_0x26fe2a(0x7a),'risk':a157_0x26fe2a(0x6e),'flags':[SQLCODE_FLAG,{'name':'params','type':a157_0x26fe2a(0x81),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x3a0f41){const _0x27bde4=a157_0x26fe2a,_0x49056b=parseJsonParams(_0x3a0f41[_0x27bde4(0x6d)](_0x27bde4(0x77))),_0x39f69a=Date['now'](),_0x143269=await executeSql(_0x3a0f41[_0x27bde4(0x6f)],_0x3a0f41[_0x27bde4(0x6d)]('sqlcode'),_0x49056b),_0x357842=Date['now']()-_0x39f69a,_0x52121d=_0x143269?.[_0x27bde4(0x7b)]??_0x143269,_0x37a27d=_0x143269?.[_0x27bde4(0x74)]??!![];if(!_0x37a27d)return{'ok':![],'data':{'error':_0x143269?.['execError']||_0x27bde4(0x6a),'elapsed':_0x357842},'message':_0x27bde4(0x6a)};const _0x4e3475=Array['isArray'](_0x52121d)?_0x52121d:[];return{'ok':!![],'data':{'rows':_0x4e3475,'rowCount':_0x4e3475[_0x27bde4(0x70)],'elapsed':_0x357842},'message':_0x27bde4(0x78)+_0x4e3475[_0x27bde4(0x70)]+_0x27bde4(0x80)+_0x357842+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x491320,_0x1df513){const _0xc9a5ef=a154_0x564f,_0x439738=_0x491320();while(!![]){try{const _0x48b40f=parseInt(_0xc9a5ef(0x9a))/0x1+-parseInt(_0xc9a5ef(0x96))/0x2+-parseInt(_0xc9a5ef(0x97))/0x3*(parseInt(_0xc9a5ef(0x99))/0x4)+parseInt(_0xc9a5ef(0x95))/0x5+-parseInt(_0xc9a5ef(0x98))/0x6+parseInt(_0xc9a5ef(0x9b))/0x7+parseInt(_0xc9a5ef(0x94))/0x8;if(_0x48b40f===_0x1df513)break;else _0x439738['push'](_0x439738['shift']());}catch(_0x44c8be){_0x439738['push'](_0x439738['shift']());}}}(a154_0x5a68,0x3275d));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';function a154_0x5a68(){const _0x5dfa90=['1569384VZDAuJ','120kAuABH','217865eYwXUc','1092441CJmrgh','2843216InwZaU','1279910kGPFVl','567086tjNgLe','23352hkxcwW'];a154_0x5a68=function(){return _0x5dfa90;};return a154_0x5a68();}import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';function a154_0x564f(_0x5d19c3,_0x8f75dc){_0x5d19c3=_0x5d19c3-0x94;const _0x5a68a5=a154_0x5a68();let _0x564f65=_0x5a68a5[_0x5d19c3];return _0x564f65;}export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x23f675,_0x23bb1f){const _0x4f7956=a158_0x7d04,_0xe23146=_0x23f675();while(!![]){try{const _0x5076a7=-parseInt(_0x4f7956(0x123))/0x1*(parseInt(_0x4f7956(0x120))/0x2)+-parseInt(_0x4f7956(0x11b))/0x3+parseInt(_0x4f7956(0x11a))/0x4*(-parseInt(_0x4f7956(0x124))/0x5)+parseInt(_0x4f7956(0x11d))/0x6+-parseInt(_0x4f7956(0x121))/0x7*(-parseInt(_0x4f7956(0x11c))/0x8)+parseInt(_0x4f7956(0x11e))/0x9*(-parseInt(_0x4f7956(0x11f))/0xa)+parseInt(_0x4f7956(0x122))/0xb;if(_0x5076a7===_0x23bb1f)break;else _0xe23146['push'](_0xe23146['shift']());}catch(_0x5ce372){_0xe23146['push'](_0xe23146['shift']());}}}(a158_0x164c,0x8dd1b));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a158_0x7d04(_0x5b3f43,_0xd899ed){_0x5b3f43=_0x5b3f43-0x11a;const _0x164c39=a158_0x164c();let _0x7d0472=_0x164c39[_0x5b3f43];return _0x7d0472;}import{sqlSave}from'../../commands/sql/save.js';function a158_0x164c(){const _0x228cbe=['12447hMOftr','7070KSgpFy','328sIWqMf','63273LDbFZe','28147735TIVJzE','2855oWkCPc','25NFbxqV','326748ddHjEg','3036603XjYuuD','160hBjmZQ','4247178mwmLzx'];a158_0x164c=function(){return _0x228cbe;};return a158_0x164c();}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- function a155_0x51d7(){const _0x46c840=['919662FMMJKF','\x20SQL\x20queries\x20(total:\x20','str','description','sqlCode','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','sqlName','pagesize','Page\x20size','boolean','num','No\x20custom\x20SQL\x20queries\x20found.','verbose','8JjzAcv','Page\x20number','2tpubXX','length','number','10MEpnzx','2182176nyEonY','Found\x20','bool','Filter\x20by\x20SQL\x20name','totalCount','2052685OoFQlG','2890608KHPdHd','page','List\x20custom\x20SQL\x20queries','21348052itntKH','8fxYdSP','name','tableData','list','dbId','6258672PMljer','all','paging','8233011jSowyn','string','appCode'];a155_0x51d7=function(){return _0x46c840;};return a155_0x51d7();}const a155_0x13ce30=a155_0x50af;(function(_0x14c673,_0x4449c9){const _0x8dd7c6=a155_0x50af,_0x39cb32=_0x14c673();while(!![]){try{const _0x3ae152=parseInt(_0x8dd7c6(0xfe))/0x1*(parseInt(_0x8dd7c6(0x10d))/0x2)+-parseInt(_0x8dd7c6(0x111))/0x3+parseInt(_0x8dd7c6(0x10b))/0x4*(parseInt(_0x8dd7c6(0x116))/0x5)+parseInt(_0x8dd7c6(0xf8))/0x6+-parseInt(_0x8dd7c6(0x117))/0x7+-parseInt(_0x8dd7c6(0x11b))/0x8*(-parseInt(_0x8dd7c6(0xfb))/0x9)+parseInt(_0x8dd7c6(0x110))/0xa*(-parseInt(_0x8dd7c6(0x11a))/0xb);if(_0x3ae152===_0x4449c9)break;else _0x39cb32['push'](_0x39cb32['shift']());}catch(_0x2a9cad){_0x39cb32['push'](_0x39cb32['shift']());}}}(a155_0x51d7,0x96c57));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a155_0x50af(_0x2158d3,_0x44c58b){_0x2158d3=_0x2158d3-0xf5;const _0x51d7f1=a155_0x51d7();let _0x50af1c=_0x51d7f1[_0x2158d3];return _0x50af1c;}export const sqlList={'service':'sql','command':a155_0x13ce30(0xf6),'description':a155_0x13ce30(0x119),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a155_0x13ce30(0x11c),'type':a155_0x13ce30(0xfc),'description':a155_0x13ce30(0x114)},{'name':a155_0x13ce30(0x118),'type':a155_0x13ce30(0x10f),'description':a155_0x13ce30(0x10c),'default':0x1},{'name':a155_0x13ce30(0x105),'type':a155_0x13ce30(0x10f),'description':a155_0x13ce30(0x106)},{'name':a155_0x13ce30(0x10a),'type':a155_0x13ce30(0x107),'description':a155_0x13ce30(0x103)}],async 'execute'(_0x677b6f){const _0x196f06=a155_0x13ce30,_0x3e724d=await listSqlQueries(_0x677b6f[_0x196f06(0xfd)],{'sqlCode':_0x677b6f[_0x196f06(0x100)]('sqlcode')||undefined,'sqlName':_0x677b6f[_0x196f06(0x100)](_0x196f06(0x11c))||undefined,'currentPage':_0x677b6f['num'](_0x196f06(0x118)),'pageSize':_0x677b6f[_0x196f06(0x108)](_0x196f06(0x105),0x32)}),_0x2355e0=_0x677b6f[_0x196f06(0x113)](_0x196f06(0x10a)),_0x17dd61=_0x3e724d[_0x196f06(0xf5)]??[],_0x5da2bf=_0x3e724d[_0x196f06(0xfa)]?.[_0x196f06(0x115)]??_0x17dd61[_0x196f06(0x10e)];let _0xcc5ff;return _0x2355e0?_0xcc5ff=_0x17dd61:_0xcc5ff=await Promise[_0x196f06(0xf9)](_0x17dd61['map'](async _0xc2d84=>{const _0x5894e0=_0x196f06;let _0x32f1f8;try{_0x32f1f8=_0xc2d84[_0x5894e0(0xf7)]?await getDbName(_0x677b6f[_0x5894e0(0xfd)],_0xc2d84[_0x5894e0(0xf7)]):undefined;}catch{}return{'sqlCode':_0xc2d84[_0x5894e0(0x102)],'sqlName':_0xc2d84[_0x5894e0(0x104)],'description':_0xc2d84[_0x5894e0(0x101)]??'','db':_0x32f1f8?_0x32f1f8+'\x20('+_0xc2d84[_0x5894e0(0xf7)]+')':_0xc2d84['dbId']??''};})),{'ok':!![],'data':_0xcc5ff,'message':_0x17dd61[_0x196f06(0x10e)]===0x0?_0x196f06(0x109):_0x196f06(0x112)+_0x17dd61[_0x196f06(0x10e)]+_0x196f06(0xff)+_0x5da2bf+').'};}};
1
+ const a159_0x18bd18=a159_0x77a9;(function(_0x3a599d,_0x98cd){const _0x1df0b8=a159_0x77a9,_0x2d38ba=_0x3a599d();while(!![]){try{const _0x515aab=parseInt(_0x1df0b8(0x1a4))/0x1*(-parseInt(_0x1df0b8(0x199))/0x2)+parseInt(_0x1df0b8(0x1b8))/0x3*(parseInt(_0x1df0b8(0x19e))/0x4)+-parseInt(_0x1df0b8(0x1ba))/0x5*(-parseInt(_0x1df0b8(0x1af))/0x6)+parseInt(_0x1df0b8(0x19d))/0x7*(-parseInt(_0x1df0b8(0x196))/0x8)+-parseInt(_0x1df0b8(0x1b1))/0x9*(-parseInt(_0x1df0b8(0x1b6))/0xa)+-parseInt(_0x1df0b8(0x19f))/0xb*(parseInt(_0x1df0b8(0x195))/0xc)+parseInt(_0x1df0b8(0x1a9))/0xd;if(_0x515aab===_0x98cd)break;else _0x2d38ba['push'](_0x2d38ba['shift']());}catch(_0x18babe){_0x2d38ba['push'](_0x2d38ba['shift']());}}}(a159_0x231e,0x71f76));function a159_0x231e(){const _0x2ee159=['1958735qNQUtF','dbId','all','bool','9132DGneeF','864mbvDtM','length','map','8966aOQjKH','boolean','name','description','59843AJWUmK','28XCBbzv','12034lPFtZZ','str','pagesize','read','sqlName','23MoGkeH','tableData','Page\x20size','sql','verbose','4036422ygpJum','Page\x20number','List\x20custom\x20SQL\x20queries','sqlcode','page','num','6nOHJpr','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','9vNKvSw','list','string','number','appCode','8241910MfDggw','paging','342561AQnSpG','totalCount'];a159_0x231e=function(){return _0x2ee159;};return a159_0x231e();}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a159_0x77a9(_0x328138,_0x5dc4d0){_0x328138=_0x328138-0x192;const _0x231e32=a159_0x231e();let _0x77a9a5=_0x231e32[_0x328138];return _0x77a9a5;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a159_0x18bd18(0x1a7),'command':a159_0x18bd18(0x1b2),'description':a159_0x18bd18(0x1ab),'risk':a159_0x18bd18(0x1a2),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a159_0x18bd18(0x19b),'type':a159_0x18bd18(0x1b3),'description':'Filter\x20by\x20SQL\x20name'},{'name':'page','type':a159_0x18bd18(0x1b4),'description':a159_0x18bd18(0x1aa),'default':0x1},{'name':a159_0x18bd18(0x1a1),'type':a159_0x18bd18(0x1b4),'description':a159_0x18bd18(0x1a6)},{'name':a159_0x18bd18(0x1a8),'type':a159_0x18bd18(0x19a),'description':a159_0x18bd18(0x1b0)}],async 'execute'(_0x3d6ae1){const _0x19e370=a159_0x18bd18,_0xef66c8=await listSqlQueries(_0x3d6ae1[_0x19e370(0x1b5)],{'sqlCode':_0x3d6ae1[_0x19e370(0x1a0)](_0x19e370(0x1ac))||undefined,'sqlName':_0x3d6ae1[_0x19e370(0x1a0)](_0x19e370(0x19b))||undefined,'currentPage':_0x3d6ae1[_0x19e370(0x1ae)](_0x19e370(0x1ad)),'pageSize':_0x3d6ae1[_0x19e370(0x1ae)](_0x19e370(0x1a1),0x32)}),_0x4d7f58=_0x3d6ae1[_0x19e370(0x194)](_0x19e370(0x1a8)),_0x34ac53=_0xef66c8[_0x19e370(0x1a5)]??[],_0x28fd78=_0xef66c8[_0x19e370(0x1b7)]?.[_0x19e370(0x1b9)]??_0x34ac53[_0x19e370(0x197)];let _0x5cc2b5;return _0x4d7f58?_0x5cc2b5=_0x34ac53:_0x5cc2b5=await Promise[_0x19e370(0x193)](_0x34ac53[_0x19e370(0x198)](async _0x3cfe4b=>{const _0x4d0d41=_0x19e370;let _0x12b20d;try{_0x12b20d=_0x3cfe4b[_0x4d0d41(0x192)]?await getDbName(_0x3d6ae1[_0x4d0d41(0x1b5)],_0x3cfe4b[_0x4d0d41(0x192)]):undefined;}catch{}return{'sqlCode':_0x3cfe4b['sqlCode'],'sqlName':_0x3cfe4b[_0x4d0d41(0x1a3)],'description':_0x3cfe4b[_0x4d0d41(0x19c)]??'','db':_0x12b20d?_0x12b20d+'\x20('+_0x3cfe4b[_0x4d0d41(0x192)]+')':_0x3cfe4b[_0x4d0d41(0x192)]??''};})),{'ok':!![],'data':_0x5cc2b5,'message':_0x34ac53['length']===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x34ac53[_0x19e370(0x197)]+'\x20SQL\x20queries\x20(total:\x20'+_0x28fd78+').'};}};