@lovrabet/rabetbase-cli 2.3.4-beta.4 → 2.3.4

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 (239) 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/validate.js +1 -1
  50. package/lib/commands/config/get.js +1 -1
  51. package/lib/commands/config/index.js +1 -1
  52. package/lib/commands/config/list.js +1 -1
  53. package/lib/commands/config/set.js +1 -1
  54. package/lib/commands/config/shared.js +1 -1
  55. package/lib/commands/data/filter.js +1 -1
  56. package/lib/commands/data/getOne.js +1 -1
  57. package/lib/commands/data/index.js +1 -1
  58. package/lib/commands/data/shared.js +1 -1
  59. package/lib/commands/dataset/business-group-update.js +1 -1
  60. package/lib/commands/dataset/capability.js +1 -1
  61. package/lib/commands/dataset/delete.js +1 -1
  62. package/lib/commands/dataset/detail.js +1 -1
  63. package/lib/commands/dataset/extend-update.js +1 -1
  64. package/lib/commands/dataset/field-update.js +1 -1
  65. package/lib/commands/dataset/generate.js +1 -1
  66. package/lib/commands/dataset/index.js +1 -1
  67. package/lib/commands/dataset/list.js +1 -1
  68. package/lib/commands/dataset/operations.js +1 -1
  69. package/lib/commands/dataset/relation-audit.js +1 -1
  70. package/lib/commands/dataset/relation-create.js +1 -1
  71. package/lib/commands/dataset/relation-delete.js +1 -1
  72. package/lib/commands/dataset/relation-shared.js +1 -1
  73. package/lib/commands/dataset/relation-update.js +1 -1
  74. package/lib/commands/dataset/relations.js +1 -1
  75. package/lib/commands/dataset/rename.js +1 -1
  76. package/lib/commands/dataset/restore.js +1 -1
  77. package/lib/commands/db/analyze-cancel.js +1 -1
  78. package/lib/commands/db/analyze-start.js +1 -1
  79. package/lib/commands/db/analyze-status.js +1 -1
  80. package/lib/commands/db/create.js +1 -1
  81. package/lib/commands/db/delete.js +1 -1
  82. package/lib/commands/db/detail.js +1 -1
  83. package/lib/commands/db/diff.js +1 -1
  84. package/lib/commands/db/index.js +1 -1
  85. package/lib/commands/db/list.js +1 -1
  86. package/lib/commands/db/shared.js +1 -1
  87. package/lib/commands/db/tables.js +1 -1
  88. package/lib/commands/db/test.js +1 -1
  89. package/lib/commands/db/update.js +1 -1
  90. package/lib/commands/doctor.js +1 -1
  91. package/lib/commands/init/index.js +1 -1
  92. package/lib/commands/issue/index.js +1 -1
  93. package/lib/commands/issue/nudge.js +1 -1
  94. package/lib/commands/issue/report.js +1 -1
  95. package/lib/commands/issue/shared.js +1 -1
  96. package/lib/commands/logs/index.js +1 -1
  97. package/lib/commands/menu/index.js +1 -1
  98. package/lib/commands/menu/list.js +1 -1
  99. package/lib/commands/menu/shared/compare-table.js +1 -1
  100. package/lib/commands/menu/shared/index.js +1 -1
  101. package/lib/commands/menu/shared/inquirer.js +1 -1
  102. package/lib/commands/menu/shared/local-pages.js +1 -1
  103. package/lib/commands/menu/shared/logic.js +1 -1
  104. package/lib/commands/menu/shared/service.js +1 -1
  105. package/lib/commands/menu/shared/sync-core.js +1 -1
  106. package/lib/commands/menu/shared/update-core.js +1 -1
  107. package/lib/commands/menu/shared/valid-url.js +1 -1
  108. package/lib/commands/menu/sync.js +1 -1
  109. package/lib/commands/menu/update.js +1 -1
  110. package/lib/commands/page/generate-start.js +1 -1
  111. package/lib/commands/page/generate-status.js +1 -1
  112. package/lib/commands/page/index.js +1 -1
  113. package/lib/commands/page/pull.js +1 -1
  114. package/lib/commands/page/push.js +1 -1
  115. package/lib/commands/page/relation-audit.js +1 -1
  116. package/lib/commands/page/shared.js +1 -1
  117. package/lib/commands/page/standard-page-status.js +1 -1
  118. package/lib/commands/page/sync.js +1 -1
  119. package/lib/commands/permit/index.js +1 -1
  120. package/lib/commands/permit/page-get.js +1 -1
  121. package/lib/commands/permit/page-set.js +1 -1
  122. package/lib/commands/permit/role-apis-set.js +1 -1
  123. package/lib/commands/permit/role-menus-set.js +1 -1
  124. package/lib/commands/permit/role-menus.js +1 -1
  125. package/lib/commands/permit/shared.js +1 -1
  126. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  127. package/lib/commands/project/create/format-elapsed.js +1 -1
  128. package/lib/commands/project/create/main.js +1 -1
  129. package/lib/commands/project/create/non-interactive.js +1 -1
  130. package/lib/commands/project/create/project-template-path.js +1 -1
  131. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  132. package/lib/commands/project/create/use-format-code.js +1 -1
  133. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  134. package/lib/commands/project/index.js +1 -1
  135. package/lib/commands/project/init.js +1 -1
  136. package/lib/commands/project/upgrade.js +1 -1
  137. package/lib/commands/registry.js +1 -1
  138. package/lib/commands/role/create.js +1 -1
  139. package/lib/commands/role/delete.js +1 -1
  140. package/lib/commands/role/detail.js +1 -1
  141. package/lib/commands/role/index.js +1 -1
  142. package/lib/commands/role/list.js +1 -1
  143. package/lib/commands/role/shared.js +1 -1
  144. package/lib/commands/role/update.js +1 -1
  145. package/lib/commands/role/user-add.js +1 -1
  146. package/lib/commands/role/user-remove.js +1 -1
  147. package/lib/commands/role/user-resolve.js +1 -1
  148. package/lib/commands/run/index.js +1 -1
  149. package/lib/commands/schema.js +1 -1
  150. package/lib/commands/sql/create.js +1 -1
  151. package/lib/commands/sql/delete.js +1 -1
  152. package/lib/commands/sql/detail.js +1 -1
  153. package/lib/commands/sql/exec.js +1 -1
  154. package/lib/commands/sql/index.js +1 -1
  155. package/lib/commands/sql/list.js +1 -1
  156. package/lib/commands/sql/pull.js +1 -1
  157. package/lib/commands/sql/push.js +1 -1
  158. package/lib/commands/sql/save.js +1 -1
  159. package/lib/commands/sql/shared.js +1 -1
  160. package/lib/commands/sql/status.js +1 -1
  161. package/lib/commands/sql/validate.js +1 -1
  162. package/lib/commands/workspace/add.js +1 -1
  163. package/lib/commands/workspace/index.js +1 -1
  164. package/lib/commands/workspace/remove.js +1 -1
  165. package/lib/config/schema.js +1 -1
  166. package/lib/constant/cdn.js +1 -1
  167. package/lib/constant/cli.js +1 -1
  168. package/lib/constant/defaults.js +1 -1
  169. package/lib/constant/domain.js +1 -1
  170. package/lib/constant/env.js +1 -1
  171. package/lib/constant/output.js +1 -1
  172. package/lib/constant/paths.js +1 -1
  173. package/lib/constant/risk.js +1 -1
  174. package/lib/context/app-resolver.js +1 -1
  175. package/lib/context/auth-resolver.js +1 -1
  176. package/lib/context/config-loader.js +1 -1
  177. package/lib/context.js +1 -1
  178. package/lib/core/alias-resolver.js +1 -1
  179. package/lib/core/api-client.js +1 -1
  180. package/lib/core/bff/config.js +1 -1
  181. package/lib/core/bff/file-system.js +1 -1
  182. package/lib/core/bff/hash.js +1 -1
  183. package/lib/core/bff/lock.js +1 -1
  184. package/lib/core/bff/utils.js +1 -1
  185. package/lib/core/db-resolver.js +1 -1
  186. package/lib/core/page/file-system.js +1 -1
  187. package/lib/core/page/hash.js +1 -1
  188. package/lib/core/page/lock.js +1 -1
  189. package/lib/core/sql-sync/config.js +1 -1
  190. package/lib/core/sql-sync/file-system.js +1 -1
  191. package/lib/core/sql-sync/hash.js +1 -1
  192. package/lib/core/sql-sync/lock.js +1 -1
  193. package/lib/core/sql-sync/utils.js +1 -1
  194. package/lib/core/sql-validator.js +1 -1
  195. package/lib/errors.js +1 -1
  196. package/lib/framework/build-all-flags.js +1 -1
  197. package/lib/framework/flags.js +1 -1
  198. package/lib/framework/help.js +1 -1
  199. package/lib/framework/index.js +1 -1
  200. package/lib/framework/output.js +1 -1
  201. package/lib/framework/response.js +1 -1
  202. package/lib/framework/runner-alias.js +1 -1
  203. package/lib/framework/runner.js +1 -1
  204. package/lib/framework/schema-export.js +1 -1
  205. package/lib/framework/types.js +1 -1
  206. package/lib/generated/build-info.js +1 -1
  207. package/lib/help.js +1 -1
  208. package/lib/skills/main.js +1 -1
  209. package/lib/skills/npx-skills-add.js +1 -1
  210. package/lib/telemetry/cli-command-trace.js +1 -1
  211. package/lib/telemetry/cli-help-trace.js +1 -1
  212. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  213. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  214. package/lib/telemetry/send-cli-trace-log.js +1 -1
  215. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  216. package/lib/utils/ai_config.js +1 -1
  217. package/lib/utils/apply-jq-filter.js +1 -1
  218. package/lib/utils/cdn-config.js +1 -1
  219. package/lib/utils/check-sdk-version.js +1 -1
  220. package/lib/utils/cli-version-check.js +1 -1
  221. package/lib/utils/cli-version-policy.js +1 -1
  222. package/lib/utils/config.js +1 -1
  223. package/lib/utils/copy-directory.js +1 -1
  224. package/lib/utils/entity-with-id.js +1 -1
  225. package/lib/utils/file-utils.js +1 -1
  226. package/lib/utils/guides-cdn.js +1 -1
  227. package/lib/utils/http-client.js +1 -1
  228. package/lib/utils/is-non-interactive.js +1 -1
  229. package/lib/utils/logger.js +1 -1
  230. package/lib/utils/params.js +1 -1
  231. package/lib/utils/platform.js +1 -1
  232. package/lib/utils/rules-cdn.js +1 -1
  233. package/lib/utils/sleep.js +1 -1
  234. package/lib/utils/template-replacer.js +1 -1
  235. package/lib/utils/update-notice.js +1 -1
  236. package/lib/utils/version.js +1 -1
  237. package/lib/utils/with-active-cookie.js +1 -1
  238. package/lib/utils/write-cli-side-channel.js +1 -1
  239. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x38f8d8,_0xbd7bcc){const _0x4b3b12=a141_0x217a,_0xcb96d7=_0x38f8d8();while(!![]){try{const _0x239313=-parseInt(_0x4b3b12(0x121))/0x1+-parseInt(_0x4b3b12(0x11d))/0x2+parseInt(_0x4b3b12(0x120))/0x3+-parseInt(_0x4b3b12(0x118))/0x4*(-parseInt(_0x4b3b12(0x11c))/0x5)+-parseInt(_0x4b3b12(0x11b))/0x6*(parseInt(_0x4b3b12(0x119))/0x7)+parseInt(_0x4b3b12(0x11f))/0x8+-parseInt(_0x4b3b12(0x11e))/0x9*(-parseInt(_0x4b3b12(0x11a))/0xa);if(_0x239313===_0xbd7bcc)break;else _0xcb96d7['push'](_0xcb96d7['shift']());}catch(_0xe9553d){_0xcb96d7['push'](_0xcb96d7['shift']());}}}(a141_0x4886,0xbb7ac));import{roleList}from'../../commands/role/list.js';function a141_0x217a(_0x2d138b,_0x48f637){_0x2d138b=_0x2d138b-0x118;const _0x4886d3=a141_0x4886();let _0x217ac5=_0x4886d3[_0x2d138b];return _0x217ac5;}import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';function a141_0x4886(){const _0x538541=['6156198LjBpmr','160535DJdxeg','769486EySvCZ','4073787WTgqVe','9842008bKilmy','2029140RGJaIr','1339579PsrzWK','88TnEXeo','7SADRKM','20hDgmKt'];a141_0x4886=function(){return _0x538541;};return a141_0x4886();}import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0xfd883,_0x5d891c){const _0x42fd5b=a141_0x4d64,_0x3de24c=_0xfd883();while(!![]){try{const _0x36c977=-parseInt(_0x42fd5b(0x85))/0x1+-parseInt(_0x42fd5b(0x86))/0x2*(-parseInt(_0x42fd5b(0x8a))/0x3)+parseInt(_0x42fd5b(0x84))/0x4+-parseInt(_0x42fd5b(0x88))/0x5+parseInt(_0x42fd5b(0x8d))/0x6*(-parseInt(_0x42fd5b(0x8c))/0x7)+-parseInt(_0x42fd5b(0x87))/0x8+parseInt(_0x42fd5b(0x89))/0x9*(parseInt(_0x42fd5b(0x8b))/0xa);if(_0x36c977===_0x5d891c)break;else _0x3de24c['push'](_0x3de24c['shift']());}catch(_0x2287cc){_0x3de24c['push'](_0x3de24c['shift']());}}}(a141_0xceef,0xb9183));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a141_0x4d64(_0xc38797,_0x49f04d){_0xc38797=_0xc38797-0x84;const _0xceef1=a141_0xceef();let _0x4d6431=_0xceef1[_0xc38797];return _0x4d6431;}import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';function a141_0xceef(){const _0xd13716=['278472JTtaug','1395352VNcWYA','839370bfCozt','4RHUrbO','11809448GrFWYJ','5309560TawDfh','9ukxvQX','277050bEdkLD','38341320iqFUSo','35GYzdCn'];a141_0xceef=function(){return _0xd13716;};return a141_0xceef();}import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- function a142_0x49a1(_0x38e008,_0x29ab2e){_0x38e008=_0x38e008-0x64;const _0x297acb=a142_0x297a();let _0x49a1a9=_0x297acb[_0x38e008];return _0x49a1a9;}const a142_0x458746=a142_0x49a1;(function(_0x8b6331,_0x21f077){const _0xfbef7b=a142_0x49a1,_0x1fb63c=_0x8b6331();while(!![]){try{const _0x3c895e=-parseInt(_0xfbef7b(0x6c))/0x1*(-parseInt(_0xfbef7b(0x73))/0x2)+-parseInt(_0xfbef7b(0x64))/0x3+-parseInt(_0xfbef7b(0x74))/0x4*(-parseInt(_0xfbef7b(0x6e))/0x5)+-parseInt(_0xfbef7b(0x6a))/0x6*(parseInt(_0xfbef7b(0x83))/0x7)+-parseInt(_0xfbef7b(0x77))/0x8+parseInt(_0xfbef7b(0x79))/0x9*(-parseInt(_0xfbef7b(0x70))/0xa)+parseInt(_0xfbef7b(0x6b))/0xb*(parseInt(_0xfbef7b(0x7d))/0xc);if(_0x3c895e===_0x21f077)break;else _0x1fb63c['push'](_0x1fb63c['shift']());}catch(_0x403b6d){_0x1fb63c['push'](_0x1fb63c['shift']());}}}(a142_0x297a,0x5ecf7));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a142_0x297a(){const _0x489431=['10eTRALR','\x20role(s)','60BrbUFg','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','toUpperCase','733736PSlGTh','1105868Xhtlti','pagesize','Page\x20index\x20(1-based)','5515304cwXmVF','ADMIN','617247JUxdki','Invalid\x20--type\x20\x22','USER','read','1146084KkTBTs','list','type','num','join','validation','2275rOYDWk','length','number','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','Use\x20one\x20of:\x20','appCode','role','566679tiUxIZ','page','str','string','Found\x20','trim','12168aFXoaQ','121YsUmNq','2tMnDxW','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.'];a142_0x297a=function(){return _0x489431;};return a142_0x297a();}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a142_0x458746(0x78),'DEV',a142_0x458746(0x7b),'CUSTOM'];export const roleList={'service':a142_0x458746(0x89),'command':a142_0x458746(0x7e),'description':a142_0x458746(0x71),'risk':a142_0x458746(0x7c),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a142_0x458746(0x7f),'type':a142_0x458746(0x67),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':'page','type':a142_0x458746(0x85),'description':a142_0x458746(0x76),'default':0x1},{'name':a142_0x458746(0x75),'type':a142_0x458746(0x85),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x2b167e){const _0x53a67d=a142_0x458746,_0x579eac=_0x2b167e['str']('type')[_0x53a67d(0x69)]();if(_0x579eac&&!ROLE_TYPES['includes'](_0x579eac[_0x53a67d(0x72)]()))throw CliErrors[_0x53a67d(0x82)](_0x53a67d(0x7a)+_0x579eac+'\x22.',_0x53a67d(0x87)+ROLE_TYPES[_0x53a67d(0x81)](',\x20')+'.');const _0x32196a=_0x2b167e[_0x53a67d(0x80)](_0x53a67d(0x65),0x1),_0x4afbf8=_0x2b167e[_0x53a67d(0x80)](_0x53a67d(0x75),0x64);if(_0x32196a<0x1)throw CliErrors[_0x53a67d(0x82)](_0x53a67d(0x6d));if(_0x4afbf8<0x1||_0x4afbf8>0x64)throw CliErrors[_0x53a67d(0x82)](_0x53a67d(0x86));},async 'execute'(_0x5f1858){const _0x9d65da=a142_0x458746,_0x261807=_0x5f1858[_0x9d65da(0x80)](_0x9d65da(0x65),0x1)||0x1,_0x5e75c9=_0x5f1858[_0x9d65da(0x80)]('pagesize',0x64)||0x64,_0x15aa2d=_0x5f1858[_0x9d65da(0x66)](_0x9d65da(0x7f))[_0x9d65da(0x69)]()['toUpperCase'](),{items:_0x48f1ef,paging:_0xc4898}=await listAppRoles(_0x5f1858[_0x9d65da(0x88)],{'currentPage':_0x261807,'pageSize':_0x5e75c9}),_0x54b2e0=_0x15aa2d?_0x48f1ef['filter'](_0x1d8bad=>_0x1d8bad['roleType']===_0x15aa2d):_0x48f1ef,_0xab3476=_0x54b2e0['map'](projectRole);return{'ok':!![],'data':{'roles':_0xab3476,'paging':_0xc4898},'message':_0x9d65da(0x68)+_0xab3476[_0x9d65da(0x84)]+_0x9d65da(0x6f)};}};
1
+ const a142_0x5db59a=a142_0x32e8;(function(_0x1c3976,_0x3af28a){const _0x422f2f=a142_0x32e8,_0x3ea127=_0x1c3976();while(!![]){try{const _0xb48c30=-parseInt(_0x422f2f(0x1a7))/0x1+parseInt(_0x422f2f(0x1b5))/0x2*(parseInt(_0x422f2f(0x1ad))/0x3)+parseInt(_0x422f2f(0x1bb))/0x4*(-parseInt(_0x422f2f(0x1bf))/0x5)+parseInt(_0x422f2f(0x1a5))/0x6*(-parseInt(_0x422f2f(0x1a0))/0x7)+parseInt(_0x422f2f(0x1ba))/0x8*(-parseInt(_0x422f2f(0x1ae))/0x9)+-parseInt(_0x422f2f(0x1b4))/0xa+parseInt(_0x422f2f(0x1a9))/0xb;if(_0xb48c30===_0x3af28a)break;else _0x3ea127['push'](_0x3ea127['shift']());}catch(_0x23a4a9){_0x3ea127['push'](_0x3ea127['shift']());}}}(a142_0x1594,0x21217));function a142_0x32e8(_0x24d08e,_0x1e4da1){_0x24d08e=_0x24d08e-0x19e;const _0x159438=a142_0x1594();let _0x32e812=_0x159438[_0x24d08e];return _0x32e812;}import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';function a142_0x1594(){const _0xcd5cdf=['302482RQBMBc','trim','str','Invalid\x20--type\x20\x22','Page\x20index\x20(1-based)','109784LGCIkD','4WMKHXG','role','number','num','522615FqnbRT','CUSTOM','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','toUpperCase','string','DEV','7wqZnTX','Filter\x20by\x20role\x20type','Use\x20one\x20of:\x20','\x20role(s)','page','1361256VLoXej','validation','102288tXgQnI','includes','7857696nIUQZL','roleType','ADMIN','type','3galkvM','63xDQZBW','filter','read','length','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','2001260ysrMaU'];a142_0x1594=function(){return _0xcd5cdf;};return a142_0x1594();}const ROLE_TYPES=[a142_0x5db59a(0x1ab),a142_0x5db59a(0x19f),'USER',a142_0x5db59a(0x1c0)];export const roleList={'service':a142_0x5db59a(0x1bc),'command':'list','description':a142_0x5db59a(0x1b3),'risk':a142_0x5db59a(0x1b0),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':a142_0x5db59a(0x19e),'required':![],'description':a142_0x5db59a(0x1a1),'enum':ROLE_TYPES},{'name':'page','type':a142_0x5db59a(0x1bd),'description':a142_0x5db59a(0x1b9),'default':0x1},{'name':'pagesize','type':a142_0x5db59a(0x1bd),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x48d772){const _0x558d48=a142_0x5db59a,_0x37419d=_0x48d772['str'](_0x558d48(0x1ac))['trim']();if(_0x37419d&&!ROLE_TYPES[_0x558d48(0x1a8)](_0x37419d['toUpperCase']()))throw CliErrors[_0x558d48(0x1a6)](_0x558d48(0x1b8)+_0x37419d+'\x22.',_0x558d48(0x1a2)+ROLE_TYPES['join'](',\x20')+'.');const _0x148522=_0x48d772[_0x558d48(0x1be)](_0x558d48(0x1a4),0x1),_0x513ccb=_0x48d772[_0x558d48(0x1be)]('pagesize',0x64);if(_0x148522<0x1)throw CliErrors['validation'](_0x558d48(0x1c1));if(_0x513ccb<0x1||_0x513ccb>0x64)throw CliErrors['validation'](_0x558d48(0x1b2));},async 'execute'(_0x26648e){const _0x32cc39=a142_0x5db59a,_0x378927=_0x26648e[_0x32cc39(0x1be)](_0x32cc39(0x1a4),0x1)||0x1,_0x54f861=_0x26648e[_0x32cc39(0x1be)]('pagesize',0x64)||0x64,_0x401938=_0x26648e[_0x32cc39(0x1b7)](_0x32cc39(0x1ac))[_0x32cc39(0x1b6)]()[_0x32cc39(0x1c2)](),{items:_0x2c93ea,paging:_0x1dc617}=await listAppRoles(_0x26648e['appCode'],{'currentPage':_0x378927,'pageSize':_0x54f861}),_0x133fe8=_0x401938?_0x2c93ea[_0x32cc39(0x1af)](_0x3fdfa1=>_0x3fdfa1[_0x32cc39(0x1aa)]===_0x401938):_0x2c93ea,_0x55511c=_0x133fe8['map'](projectRole);return{'ok':!![],'data':{'roles':_0x55511c,'paging':_0x1dc617},'message':'Found\x20'+_0x55511c[_0x32cc39(0x1b1)]+_0x32cc39(0x1a3)};}};
@@ -1 +1 @@
1
- const a143_0x124284=a143_0x39a9;(function(_0x13bc88,_0x27e7eb){const _0x142969=a143_0x39a9,_0x45776a=_0x13bc88();while(!![]){try{const _0x27909b=-parseInt(_0x142969(0xbd))/0x1*(parseInt(_0x142969(0xa3))/0x2)+parseInt(_0x142969(0xc2))/0x3*(-parseInt(_0x142969(0xbb))/0x4)+-parseInt(_0x142969(0x8a))/0x5+-parseInt(_0x142969(0x93))/0x6+parseInt(_0x142969(0xbc))/0x7*(parseInt(_0x142969(0xcb))/0x8)+-parseInt(_0x142969(0xce))/0x9*(-parseInt(_0x142969(0xc7))/0xa)+parseInt(_0x142969(0x9f))/0xb;if(_0x27909b===_0x27e7eb)break;else _0x45776a['push'](_0x45776a['shift']());}catch(_0x1f10b3){_0x45776a['push'](_0x45776a['shift']());}}}(a143_0x3141,0x37623));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';function a143_0x3141(){const _0x4cafbf=['No\x20tenant\x20member\x20matches\x20\x22','remark','filter','14128268azSxmc','Missing\x20user\x20reference.','name','\x22:\x20','830572OUypEY','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','\x22\x20is\x20ambiguous\x20(ids:\x20','USER','totalCount','\x20is\x20already\x20a\x20member\x20of\x20role\x20','userList','DEV','flagMissing','\x20not\x20found\x20in\x20app\x20','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','test','find','Multiple\x20tenant\x20members\x20match\x20\x22','Role\x20name','includes','nickname','expectUserCount','join','user','CUSTOM','username','string','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','554252EuQgMi','21soHHxl','1bspREk','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','userId','map','permitCount','9wlwIof','userCount','role','Role\x20name\x20\x22','Role\x20id\x20','440060PdqBdZ','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Cannot\x20','roleType','459720PtLOrn','Missing\x20role\x20reference.','trim','27oZbZYQ','validation','tenant','user-add','\x20member(s)\x20but\x20role\x20has\x20','length','dryRun','expect-user-count','tenant_code','flag','roleName','Pass\x20--user\x20<id|name>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','2267230yzNTmT','str','appCode','splice','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','toLowerCase','number','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Disambiguate\x20with\x20--user\x20<id>.','465174gPcXrT','/smartapi/permit/user-role/update-user-list','Disambiguate\x20with\x20--role\x20<id>.','push','Pass\x20--role\x20<id|name>.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20',';\x20no\x20change.','ADMIN'];a143_0x3141=function(){return _0x4cafbf;};return a143_0x3141();}import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a143_0x124284(0x90),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a143_0x124284(0xc4),'type':a143_0x124284(0xb9),'required':!![],'description':a143_0x124284(0x8e)};export const USER_REF_FLAG={'name':a143_0x124284(0xb6),'type':a143_0x124284(0xb9),'required':!![],'description':a143_0x124284(0xba)};function a143_0x39a9(_0xdb2294,_0x1b97cb){_0xdb2294=_0xdb2294-0x84;const _0x3141f2=a143_0x3141();let _0x39a978=_0x3141f2[_0xdb2294];return _0x39a978;}export const NAME_FLAG={'name':a143_0x124284(0xa1),'type':a143_0x124284(0xb9),'required':!![],'description':a143_0x124284(0xb1)};export const USER_NAME_FLAG={'name':a143_0x124284(0xa1),'type':'string','required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a143_0x124284(0x9d),'type':a143_0x124284(0xb9),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a143_0x124284(0x84),'type':a143_0x124284(0x90),'required':![],'description':a143_0x124284(0xc8)};export const BUILTIN_ROLE_TYPES=[a143_0x124284(0x9b),'DEV',a143_0x124284(0xa6)];export function isBuiltinRole(_0x2f5a47){return BUILTIN_ROLE_TYPES['includes'](_0x2f5a47);}export function assertCustomRole(_0x13bd92,_0x10266c){const _0x485616=a143_0x124284;if(_0x13bd92['roleType']!==_0x485616(0xb7))throw CliErrors[_0x485616(0xcf)](_0x485616(0xc9)+_0x10266c+'\x20built-in\x20role\x20'+_0x13bd92['roleName']+'\x20('+_0x13bd92['roleType']+').',_0x485616(0xad));}export function assertPermConfigurable(_0x16869f){const _0x4b30df=a143_0x124284;if(_0x16869f[_0x4b30df(0xca)]===_0x4b30df(0xaa)||_0x16869f[_0x4b30df(0xca)]===_0x4b30df(0x9b))throw CliErrors[_0x4b30df(0xcf)](_0x4b30df(0x99)+_0x16869f[_0x4b30df(0x87)]+'\x20('+_0x16869f[_0x4b30df(0xca)]+').','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.');}export function projectRole(_0x13ef7e){const _0x2ac09a=a143_0x124284;return{'id':_0x13ef7e['id'],'roleName':_0x13ef7e['roleName'],'roleType':_0x13ef7e[_0x2ac09a(0xca)],'remark':_0x13ef7e[_0x2ac09a(0x9d)],'userCount':_0x13ef7e[_0x2ac09a(0xc3)],'permitCount':_0x13ef7e[_0x2ac09a(0xc1)],'builtin':isBuiltinRole(_0x13ef7e[_0x2ac09a(0xca)])};}export async function resolveRoleRef(_0x27690f,_0x2bc6f2){const _0x15c6d1=a143_0x124284,_0x3b1bfd=_0x2bc6f2[_0x15c6d1(0xcd)]();if(!_0x3b1bfd)throw CliErrors[_0x15c6d1(0xcf)](_0x15c6d1(0xcc),_0x15c6d1(0x97));if(/^\d+$/['test'](_0x3b1bfd))return getRoleById(_0x27690f,Number(_0x3b1bfd));const _0x23fb9b=await listAllAppRoles(_0x27690f),_0x3c5c05=_0x23fb9b['filter'](_0x1a8378=>_0x1a8378[_0x15c6d1(0x87)]===_0x3b1bfd);if(_0x3c5c05['length']===0x0)throw CliErrors[_0x15c6d1(0xcf)]('Role\x20name\x20\x22'+_0x3b1bfd+'\x22\x20not\x20found\x20in\x20app\x20'+_0x27690f+'.',_0x15c6d1(0x89));if(_0x3c5c05['length']>0x1){const _0x31d6c9=_0x3c5c05[_0x15c6d1(0xc0)](_0x543c52=>_0x543c52['id'])[_0x15c6d1(0xb5)](',\x20');throw CliErrors['validation'](_0x15c6d1(0xc5)+_0x3b1bfd+_0x15c6d1(0xa5)+_0x31d6c9+').',_0x15c6d1(0x95));}return _0x3c5c05[0x0];}export async function getRoleById(_0x5b662b,_0x400dc8){const _0x41d57b=a143_0x124284,_0xae2062=await getAppRole(_0x400dc8);if(!_0xae2062)throw CliErrors[_0x41d57b(0xcf)](_0x41d57b(0xc6)+_0x400dc8+_0x41d57b(0xac)+_0x5b662b+'.',_0x41d57b(0xa4));return _0xae2062;}async function listAllAppRoles(_0x173997){const _0x34b3e2=a143_0x124284,_0x2afedf=0x64,_0x20998b=[];for(let _0x375be1=0x1;;_0x375be1+=0x1){const {items:_0x1bc32d,paging:_0x41bdef}=await listAppRoles(_0x173997,{'currentPage':_0x375be1,'pageSize':_0x2afedf});_0x20998b['push'](..._0x1bc32d);if(_0x1bc32d['length']<_0x2afedf||_0x41bdef&&_0x20998b[_0x34b3e2(0xd3)]>=_0x41bdef[_0x34b3e2(0xa7)])return _0x20998b;}}export async function resolveTenantCode(){const _0x4ea68f=a143_0x124284,_0xf43a99=await getSessionUserInfo(),_0x520973=_0xf43a99?.['user']?.[_0x4ea68f(0xd0)]?.[_0x4ea68f(0x85)];if(!_0x520973)throw CliErrors['authRequired'](_0x4ea68f(0xbe));return _0x520973;}function matchMember(_0x2001ca,_0x4c2bee){const _0xe9068a=a143_0x124284,_0x308875=_0x4c2bee[_0xe9068a(0xcd)]()[_0xe9068a(0x8f)]();return(_0x2001ca[_0xe9068a(0xb3)]??'')[_0xe9068a(0x8f)]()===_0x308875||(_0x2001ca['username']??'')[_0xe9068a(0x8f)]()===_0x308875;}export async function resolveUserRef(_0x1358d5){const _0x4910ac=a143_0x124284,_0x16d7d4=_0x1358d5['trim']();if(!_0x16d7d4)throw CliErrors[_0x4910ac(0xcf)](_0x4910ac(0xa0),_0x4910ac(0x88));const _0x22bc8e=await resolveTenantCode(),_0x521167=await getTenantMembers(_0x22bc8e);if(/^\d+$/[_0x4910ac(0xae)](_0x16d7d4)){const _0x13b9d8=Number(_0x16d7d4),_0x8a9b42=_0x521167[_0x4910ac(0xaf)](_0x26852a=>_0x26852a[_0x4910ac(0xbf)]===_0x13b9d8);return{'userId':_0x13b9d8,'username':_0x8a9b42?.['username']??String(_0x13b9d8),'nickname':_0x8a9b42?.[_0x4910ac(0xb3)],'matchedBy':'id'};}const _0x39233a=_0x521167[_0x4910ac(0x9e)](_0x32c5b2=>matchMember(_0x32c5b2,_0x16d7d4));if(_0x39233a[_0x4910ac(0xd3)]===0x0)throw CliErrors[_0x4910ac(0xcf)](_0x4910ac(0x9c)+_0x16d7d4+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x39233a[_0x4910ac(0xd3)]>0x1){const _0xdc8906=_0x39233a[_0x4910ac(0xc0)](_0xa285b2=>(_0xa285b2['nickname']??_0xa285b2[_0x4910ac(0xb8)]??'?')+'('+_0xa285b2[_0x4910ac(0xbf)]+')')['join'](',\x20');throw CliErrors[_0x4910ac(0xcf)](_0x4910ac(0xb0)+_0x16d7d4+_0x4910ac(0xa2)+_0xdc8906+'.',_0x4910ac(0x92));}const _0x5c4c4d=_0x39233a[0x0];return{'userId':_0x5c4c4d[_0x4910ac(0xbf)],'username':_0x5c4c4d[_0x4910ac(0xb8)]??String(_0x5c4c4d[_0x4910ac(0xbf)]),'nickname':_0x5c4c4d[_0x4910ac(0xb3)],'matchedBy':'name'};}export const UPDATE_USER_LIST_PATH=a143_0x124284(0x94);function userIdsOf(_0x59f008){const _0x14cc57=a143_0x124284;return(_0x59f008?.[_0x14cc57(0xa9)]??[])[_0x14cc57(0xc0)](_0x2d94db=>_0x2d94db[_0x14cc57(0xbf)]);}export function computeRoleUserMutation(_0x31c708){const _0x4ccc02=a143_0x124284,{operation:_0x5cfaba,appCode:_0x45cb11,roleUsers:_0xb3f388,targetRoleId:_0x346152,user:_0x59534e}=_0x31c708,_0x567c0=_0xb3f388[_0x4ccc02(0xaf)](_0x5bd577=>_0x5bd577['id']===_0x346152);if(!_0x567c0)throw CliErrors[_0x4ccc02(0xcf)]('Role\x20id\x20'+_0x346152+_0x4ccc02(0x91),_0x4ccc02(0xa4));const _0x558bed=userIdsOf(_0x567c0),_0x403930=[];if(_0x31c708[_0x4ccc02(0xb4)]!==undefined&&_0x31c708[_0x4ccc02(0xb4)]!==_0x558bed[_0x4ccc02(0xd3)])throw CliErrors[_0x4ccc02(0xcf)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x31c708[_0x4ccc02(0xb4)]+_0x4ccc02(0xd2)+_0x558bed[_0x4ccc02(0xd3)]+'.',_0x4ccc02(0x98));const _0x3ef43e=_0x558bed[_0x4ccc02(0xb2)](_0x59534e['userId']);let _0x5c6525=![];const _0x227b40=[..._0x567c0['userList']];if(_0x5cfaba===_0x4ccc02(0xd1))_0x3ef43e?_0x403930['push']('User\x20'+_0x59534e[_0x4ccc02(0xbf)]+_0x4ccc02(0xa8)+_0x567c0[_0x4ccc02(0x87)]+_0x4ccc02(0x9a)):(_0x227b40[_0x4ccc02(0x96)]({'userId':_0x59534e['userId'],'username':_0x59534e[_0x4ccc02(0xb8)],..._0x59534e[_0x4ccc02(0xb3)]?{'nickname':_0x59534e[_0x4ccc02(0xb3)]}:{}}),_0x5c6525=!![]);else{if(!_0x3ef43e)_0x403930[_0x4ccc02(0x96)]('User\x20'+_0x59534e[_0x4ccc02(0xbf)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x567c0['roleName']+_0x4ccc02(0x9a));else{const _0x3d973d=_0x227b40['findIndex'](_0x12662a=>_0x12662a['userId']===_0x59534e['userId']);if(_0x3d973d>=0x0)_0x227b40[_0x4ccc02(0x8d)](_0x3d973d,0x1);_0x5c6525=!![];}}const _0x2b276f=_0xb3f388[_0x4ccc02(0xc0)](_0x56c560=>_0x56c560['id']===_0x346152?{..._0x56c560,'userList':_0x227b40}:_0x56c560),_0xab2aec=_0x227b40[_0x4ccc02(0xc0)](_0x16cd6e=>_0x16cd6e[_0x4ccc02(0xbf)]),_0x45ecae={'operation':_0x5cfaba,'selector':{'appCode':_0x45cb11,'roleId':_0x346152,'roleName':_0x567c0['roleName'],'userId':_0x59534e['userId']},'before':{'userIds':_0x558bed},'after':{'userIds':_0xab2aec},'dryRun':_0x31c708[_0x4ccc02(0xd4)],'backend':{'method':'POST','path':UPDATE_USER_LIST_PATH},'warnings':_0x403930};return{'roleList':_0x2b276f,'mutation':_0x45ecae,'changed':_0x5c6525};}export async function loadRoleUsers(_0x2d3438){return listRoleUsers(_0x2d3438);}export function readRoleRef(_0x5aed05){const _0x199a98=a143_0x124284,_0x531e16=_0x5aed05[_0x199a98(0x8b)](_0x199a98(0xc4))[_0x199a98(0xcd)]();if(!_0x531e16)throw CliErrors[_0x199a98(0xab)](_0x199a98(0xc4),_0x199a98(0x97));return _0x531e16;}export async function prepareUserMutation(_0x3d37f4,_0xf85ba2,_0x1ef17b){const _0x5c34a9=a143_0x124284,_0xffccd9=readRoleRef(_0x3d37f4),_0x201e64=_0x3d37f4[_0x5c34a9(0x8b)](_0x5c34a9(0xb6))[_0x5c34a9(0xcd)]();if(!_0x201e64)throw CliErrors[_0x5c34a9(0xab)](_0x5c34a9(0xb6),'Pass\x20--user\x20<id|name>.');const _0x2672a9=_0x3d37f4[_0x5c34a9(0x86)](_0x5c34a9(0x84)),_0x54a888=_0x2672a9===undefined||_0x2672a9===null?undefined:Number(_0x2672a9),_0x48c81c=await resolveRoleRef(_0x3d37f4[_0x5c34a9(0x8c)],_0xffccd9),_0xcde9ba=await resolveUserRef(_0x201e64),_0x5b3be5=await loadRoleUsers(_0x3d37f4[_0x5c34a9(0x8c)]);return computeRoleUserMutation({'operation':_0xf85ba2,'appCode':_0x3d37f4[_0x5c34a9(0x8c)],'roleUsers':_0x5b3be5,'targetRoleId':_0x48c81c['id'],'user':{'userId':_0xcde9ba['userId'],'username':_0xcde9ba[_0x5c34a9(0xb8)],'nickname':_0xcde9ba[_0x5c34a9(0xb3)]},'dryRun':_0x1ef17b,..._0x54a888!==undefined?{'expectUserCount':_0x54a888}:{}});}
1
+ const a143_0x3f82b4=a143_0x5ae1;function a143_0x38cf(){const _0x829ab1=['tenant_code','55zAaquc','validation','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x20not\x20found\x20in\x20app\x20','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','string','roleName','userCount','\x22:\x20','107792NOqVTm','name','userId','push','appCode','authRequired','Multiple\x20tenant\x20members\x20match\x20\x22','remark','userList','splice','toLowerCase','flagMissing','Disambiguate\x20with\x20--user\x20<id>.','Pass\x20--user\x20<id|name>.','Cannot\x20','username','user-add','trim','371FxJwDQ','Optional\x20role\x20remark/description','28092CxsWyZ','nickname','role','DEV','ADMIN','filter','roleType','totalCount','str','76680ScnSdg','expectUserCount','Missing\x20user\x20reference.','904278pLacac','610kWiXWR','length','POST','CUSTOM','user','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','Pass\x20--role\x20<id|name>.','138235dqdXco','test','Missing\x20role\x20reference.','includes','Anti-drift\x20check\x20failed:\x20expected\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','number','tenant','4xOBSrT','find','Role\x20name\x20\x22','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','dryRun','join','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Role\x20id\x20','Role\x20name','2141532DPJvqB',';\x20no\x20change.','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','199140lSSYVX','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','map','expect-user-count','Role\x20id\x20(from\x20`role\x20list`)','User\x20'];a143_0x38cf=function(){return _0x829ab1;};return a143_0x38cf();}(function(_0x23b12b,_0x199274){const _0x42195b=a143_0x5ae1,_0x24f29a=_0x23b12b();while(!![]){try{const _0x578812=parseInt(_0x42195b(0x147))/0x1+-parseInt(_0x42195b(0x14f))/0x2*(-parseInt(_0x42195b(0x13f))/0x3)+parseInt(_0x42195b(0x10e))/0x4+parseInt(_0x42195b(0x140))/0x5*(parseInt(_0x42195b(0x133))/0x6)+parseInt(_0x42195b(0x131))/0x7*(-parseInt(_0x42195b(0x11f))/0x8)+-parseInt(_0x42195b(0x10b))/0x9+-parseInt(_0x42195b(0x13c))/0xa*(parseInt(_0x42195b(0x115))/0xb);if(_0x578812===_0x199274)break;else _0x24f29a['push'](_0x24f29a['shift']());}catch(_0x30f0d6){_0x24f29a['push'](_0x24f29a['shift']());}}}(a143_0x38cf,0x5abd2));function a143_0x5ae1(_0x416ac7,_0x283f34){_0x416ac7=_0x416ac7-0x10b;const _0x38cf27=a143_0x38cf();let _0x5ae16b=_0x38cf27[_0x416ac7];return _0x5ae16b;}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':a143_0x3f82b4(0x14d),'required':!![],'description':a143_0x3f82b4(0x112)};export const ROLE_REF_FLAG={'name':a143_0x3f82b4(0x135),'type':a143_0x3f82b4(0x11b),'required':!![],'description':a143_0x3f82b4(0x10d)};export const USER_REF_FLAG={'name':a143_0x3f82b4(0x144),'type':a143_0x3f82b4(0x11b),'required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':a143_0x3f82b4(0x120),'type':a143_0x3f82b4(0x11b),'required':!![],'description':a143_0x3f82b4(0x157)};export const USER_NAME_FLAG={'name':a143_0x3f82b4(0x120),'type':a143_0x3f82b4(0x11b),'required':!![],'description':a143_0x3f82b4(0x11a)};export const REMARK_FLAG={'name':a143_0x3f82b4(0x126),'type':a143_0x3f82b4(0x11b),'required':![],'description':a143_0x3f82b4(0x132)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a143_0x3f82b4(0x14d),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a143_0x3f82b4(0x137),a143_0x3f82b4(0x136),'USER'];export function isBuiltinRole(_0x2a2f89){return BUILTIN_ROLE_TYPES['includes'](_0x2a2f89);}export function assertCustomRole(_0x18afff,_0x312d29){const _0x5d9946=a143_0x3f82b4;if(_0x18afff[_0x5d9946(0x139)]!==_0x5d9946(0x143))throw CliErrors[_0x5d9946(0x116)](_0x5d9946(0x12d)+_0x312d29+'\x20built-in\x20role\x20'+_0x18afff[_0x5d9946(0x11c)]+'\x20('+_0x18afff[_0x5d9946(0x139)]+').',_0x5d9946(0x119));}export function assertPermConfigurable(_0x7be575){const _0x1eeed8=a143_0x3f82b4;if(_0x7be575[_0x1eeed8(0x139)]===_0x1eeed8(0x136)||_0x7be575[_0x1eeed8(0x139)]===_0x1eeed8(0x137))throw CliErrors[_0x1eeed8(0x116)](_0x1eeed8(0x145)+_0x7be575[_0x1eeed8(0x11c)]+'\x20('+_0x7be575[_0x1eeed8(0x139)]+').',_0x1eeed8(0x152));}export function projectRole(_0x4592dc){const _0x201407=a143_0x3f82b4;return{'id':_0x4592dc['id'],'roleName':_0x4592dc[_0x201407(0x11c)],'roleType':_0x4592dc[_0x201407(0x139)],'remark':_0x4592dc[_0x201407(0x126)],'userCount':_0x4592dc[_0x201407(0x11d)],'permitCount':_0x4592dc['permitCount'],'builtin':isBuiltinRole(_0x4592dc[_0x201407(0x139)])};}export async function resolveRoleRef(_0x59fa4b,_0x3161c9){const _0x1dce8e=a143_0x3f82b4,_0x1164bd=_0x3161c9[_0x1dce8e(0x130)]();if(!_0x1164bd)throw CliErrors[_0x1dce8e(0x116)](_0x1dce8e(0x149),_0x1dce8e(0x146));if(/^\d+$/[_0x1dce8e(0x148)](_0x1164bd))return getRoleById(_0x59fa4b,Number(_0x1164bd));const _0xb8ec19=await listAllAppRoles(_0x59fa4b),_0x2257c7=_0xb8ec19[_0x1dce8e(0x138)](_0x524183=>_0x524183[_0x1dce8e(0x11c)]===_0x1164bd);if(_0x2257c7[_0x1dce8e(0x141)]===0x0)throw CliErrors['validation']('Role\x20name\x20\x22'+_0x1164bd+'\x22\x20not\x20found\x20in\x20app\x20'+_0x59fa4b+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x2257c7[_0x1dce8e(0x141)]>0x1){const _0x36fd92=_0x2257c7[_0x1dce8e(0x110)](_0x37732e=>_0x37732e['id'])[_0x1dce8e(0x154)](',\x20');throw CliErrors[_0x1dce8e(0x116)](_0x1dce8e(0x151)+_0x1164bd+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x36fd92+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x2257c7[0x0];}export async function getRoleById(_0x35a1ca,_0x3261b4){const _0x3c1744=a143_0x3f82b4,_0x156c99=await getAppRole(_0x3261b4);if(!_0x156c99)throw CliErrors[_0x3c1744(0x116)](_0x3c1744(0x156)+_0x3261b4+_0x3c1744(0x118)+_0x35a1ca+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x156c99;}async function listAllAppRoles(_0xbb69fd){const _0x24857c=a143_0x3f82b4,_0x10cbe5=0x64,_0x1545ed=[];for(let _0x1fdaae=0x1;;_0x1fdaae+=0x1){const {items:_0x41ce32,paging:_0x48eda8}=await listAppRoles(_0xbb69fd,{'currentPage':_0x1fdaae,'pageSize':_0x10cbe5});_0x1545ed[_0x24857c(0x122)](..._0x41ce32);if(_0x41ce32[_0x24857c(0x141)]<_0x10cbe5||_0x48eda8&&_0x1545ed['length']>=_0x48eda8[_0x24857c(0x13a)])return _0x1545ed;}}export async function resolveTenantCode(){const _0x394e65=a143_0x3f82b4,_0x1b6312=await getSessionUserInfo(),_0x48e184=_0x1b6312?.['user']?.[_0x394e65(0x14e)]?.[_0x394e65(0x114)];if(!_0x48e184)throw CliErrors[_0x394e65(0x124)](_0x394e65(0x10f));return _0x48e184;}function matchMember(_0x10f849,_0x4ba624){const _0x502752=a143_0x3f82b4,_0x15daea=_0x4ba624[_0x502752(0x130)]()[_0x502752(0x129)]();return(_0x10f849[_0x502752(0x134)]??'')[_0x502752(0x129)]()===_0x15daea||(_0x10f849[_0x502752(0x12e)]??'')[_0x502752(0x129)]()===_0x15daea;}export async function resolveUserRef(_0x1fb038){const _0x258a8c=a143_0x3f82b4,_0x3cbdfe=_0x1fb038[_0x258a8c(0x130)]();if(!_0x3cbdfe)throw CliErrors[_0x258a8c(0x116)](_0x258a8c(0x13e),_0x258a8c(0x12c));const _0x50f95e=await resolveTenantCode(),_0x370b5d=await getTenantMembers(_0x50f95e);if(/^\d+$/[_0x258a8c(0x148)](_0x3cbdfe)){const _0x5dd8c5=Number(_0x3cbdfe),_0x25f6df=_0x370b5d[_0x258a8c(0x150)](_0x20e3fc=>_0x20e3fc[_0x258a8c(0x121)]===_0x5dd8c5);return{'userId':_0x5dd8c5,'username':_0x25f6df?.[_0x258a8c(0x12e)]??String(_0x5dd8c5),'nickname':_0x25f6df?.['nickname'],'matchedBy':'id'};}const _0xcda70b=_0x370b5d[_0x258a8c(0x138)](_0x44e5b8=>matchMember(_0x44e5b8,_0x3cbdfe));if(_0xcda70b[_0x258a8c(0x141)]===0x0)throw CliErrors[_0x258a8c(0x116)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x3cbdfe+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0xcda70b['length']>0x1){const _0x44fafa=_0xcda70b[_0x258a8c(0x110)](_0x431e42=>(_0x431e42[_0x258a8c(0x134)]??_0x431e42[_0x258a8c(0x12e)]??'?')+'('+_0x431e42[_0x258a8c(0x121)]+')')[_0x258a8c(0x154)](',\x20');throw CliErrors[_0x258a8c(0x116)](_0x258a8c(0x125)+_0x3cbdfe+_0x258a8c(0x11e)+_0x44fafa+'.',_0x258a8c(0x12b));}const _0x3f0848=_0xcda70b[0x0];return{'userId':_0x3f0848['userId'],'username':_0x3f0848['username']??String(_0x3f0848[_0x258a8c(0x121)]),'nickname':_0x3f0848[_0x258a8c(0x134)],'matchedBy':_0x258a8c(0x120)};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x560ac5){const _0x35b36a=a143_0x3f82b4;return(_0x560ac5?.[_0x35b36a(0x127)]??[])['map'](_0x5a172f=>_0x5a172f[_0x35b36a(0x121)]);}export function computeRoleUserMutation(_0xb58aeb){const _0x190d5d=a143_0x3f82b4,{operation:_0x49206a,appCode:_0x82395c,roleUsers:_0x4facbd,targetRoleId:_0x28a350,user:_0x4bc07f}=_0xb58aeb,_0xfc82d7=_0x4facbd[_0x190d5d(0x150)](_0x1108c2=>_0x1108c2['id']===_0x28a350);if(!_0xfc82d7)throw CliErrors['validation'](_0x190d5d(0x156)+_0x28a350+'\x20not\x20found\x20in\x20the\x20user-role\x20list.',_0x190d5d(0x155));const _0x114135=userIdsOf(_0xfc82d7),_0x46ca6a=[];if(_0xb58aeb[_0x190d5d(0x13d)]!==undefined&&_0xb58aeb[_0x190d5d(0x13d)]!==_0x114135[_0x190d5d(0x141)])throw CliErrors[_0x190d5d(0x116)](_0x190d5d(0x14b)+_0xb58aeb[_0x190d5d(0x13d)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x114135[_0x190d5d(0x141)]+'.',_0x190d5d(0x117));const _0x221d9e=_0x114135[_0x190d5d(0x14a)](_0x4bc07f['userId']);let _0x377b40=![];const _0x503773=[..._0xfc82d7[_0x190d5d(0x127)]];if(_0x49206a===_0x190d5d(0x12f))_0x221d9e?_0x46ca6a[_0x190d5d(0x122)]('User\x20'+_0x4bc07f[_0x190d5d(0x121)]+_0x190d5d(0x14c)+_0xfc82d7[_0x190d5d(0x11c)]+_0x190d5d(0x10c)):(_0x503773[_0x190d5d(0x122)]({'userId':_0x4bc07f['userId'],'username':_0x4bc07f['username'],..._0x4bc07f['nickname']?{'nickname':_0x4bc07f[_0x190d5d(0x134)]}:{}}),_0x377b40=!![]);else{if(!_0x221d9e)_0x46ca6a['push'](_0x190d5d(0x113)+_0x4bc07f[_0x190d5d(0x121)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0xfc82d7[_0x190d5d(0x11c)]+_0x190d5d(0x10c));else{const _0x5d91f9=_0x503773['findIndex'](_0xeb9d0c=>_0xeb9d0c[_0x190d5d(0x121)]===_0x4bc07f[_0x190d5d(0x121)]);if(_0x5d91f9>=0x0)_0x503773[_0x190d5d(0x128)](_0x5d91f9,0x1);_0x377b40=!![];}}const _0x78b78=_0x4facbd[_0x190d5d(0x110)](_0x2ac738=>_0x2ac738['id']===_0x28a350?{..._0x2ac738,'userList':_0x503773}:_0x2ac738),_0x10cd80=_0x503773[_0x190d5d(0x110)](_0x241066=>_0x241066[_0x190d5d(0x121)]),_0x1d4122={'operation':_0x49206a,'selector':{'appCode':_0x82395c,'roleId':_0x28a350,'roleName':_0xfc82d7[_0x190d5d(0x11c)],'userId':_0x4bc07f[_0x190d5d(0x121)]},'before':{'userIds':_0x114135},'after':{'userIds':_0x10cd80},'dryRun':_0xb58aeb[_0x190d5d(0x153)],'backend':{'method':_0x190d5d(0x142),'path':UPDATE_USER_LIST_PATH},'warnings':_0x46ca6a};return{'roleList':_0x78b78,'mutation':_0x1d4122,'changed':_0x377b40};}export async function loadRoleUsers(_0x53c913){return listRoleUsers(_0x53c913);}export function readRoleRef(_0x1e496b){const _0x3ba628=a143_0x3f82b4,_0x446afa=_0x1e496b[_0x3ba628(0x13b)](_0x3ba628(0x135))['trim']();if(!_0x446afa)throw CliErrors[_0x3ba628(0x12a)](_0x3ba628(0x135),_0x3ba628(0x146));return _0x446afa;}export async function prepareUserMutation(_0x42578c,_0x10ee84,_0x4498ea){const _0x2ff5b2=a143_0x3f82b4,_0x514e6b=readRoleRef(_0x42578c),_0x49145d=_0x42578c['str']('user')[_0x2ff5b2(0x130)]();if(!_0x49145d)throw CliErrors[_0x2ff5b2(0x12a)]('user',_0x2ff5b2(0x12c));const _0x318177=_0x42578c['flag'](_0x2ff5b2(0x111)),_0x4866f9=_0x318177===undefined||_0x318177===null?undefined:Number(_0x318177),_0x270066=await resolveRoleRef(_0x42578c[_0x2ff5b2(0x123)],_0x514e6b),_0x4fefe1=await resolveUserRef(_0x49145d),_0x158601=await loadRoleUsers(_0x42578c[_0x2ff5b2(0x123)]);return computeRoleUserMutation({'operation':_0x10ee84,'appCode':_0x42578c[_0x2ff5b2(0x123)],'roleUsers':_0x158601,'targetRoleId':_0x270066['id'],'user':{'userId':_0x4fefe1[_0x2ff5b2(0x121)],'username':_0x4fefe1[_0x2ff5b2(0x12e)],'nickname':_0x4fefe1['nickname']},'dryRun':_0x4498ea,..._0x4866f9!==undefined?{'expectUserCount':_0x4866f9}:{}});}
@@ -1 +1 @@
1
- const a144_0xac0a8e=a144_0x49ff;function a144_0x49ff(_0x416a4c,_0x260acb){_0x416a4c=_0x416a4c-0xf9;const _0x24d8cc=a144_0x24d8();let _0x49ff71=_0x24d8cc[_0x416a4c];return _0x49ff71;}function a144_0x24d8(){const _0x5c400a=['role','702375dbMhdT','roleName','name','length','POST','15722KWMVWy','8483346KPuJOV','42490830cEEohB','8IWuran','/smartapi/permit/role/update','--name\x20cannot\x20be\x20empty.','\x20(id=','appCode','flag','validation','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','update','4ppMPjO','remark','2202anqdBT','1469743WQkhnF','num','4480587DgbDmM','3144622dkDGoF'];a144_0x24d8=function(){return _0x5c400a;};return a144_0x24d8();}(function(_0x3f86cd,_0x1104a6){const _0x10048c=a144_0x49ff,_0x501c51=_0x3f86cd();while(!![]){try{const _0x9c82bc=-parseInt(_0x10048c(0x107))/0x1+parseInt(_0x10048c(0x10a))/0x2+parseInt(_0x10048c(0x109))/0x3*(-parseInt(_0x10048c(0x104))/0x4)+-parseInt(_0x10048c(0x10c))/0x5+-parseInt(_0x10048c(0x106))/0x6*(parseInt(_0x10048c(0x111))/0x7)+parseInt(_0x10048c(0xfb))/0x8*(-parseInt(_0x10048c(0xf9))/0x9)+parseInt(_0x10048c(0xfa))/0xa;if(_0x9c82bc===_0x1104a6)break;else _0x501c51['push'](_0x501c51['shift']());}catch(_0x372b64){_0x501c51['push'](_0x501c51['shift']());}}}(a144_0x24d8,0xe81f3));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a144_0xac0a8e(0xfc);function readPatch(_0x14f900){const _0x1cecb4=a144_0xac0a8e,_0x5ec369=_0x14f900[_0x1cecb4(0x100)](_0x1cecb4(0x10e)),_0x493803=_0x14f900[_0x1cecb4(0x100)](_0x1cecb4(0x105)),_0x34e340={};if(_0x5ec369!==undefined&&_0x5ec369!==null){const _0x103622=String(_0x5ec369)['trim']();if(!_0x103622)throw CliErrors[_0x1cecb4(0x101)](_0x1cecb4(0xfd));if(_0x103622[_0x1cecb4(0x10f)]>0x40)throw CliErrors[_0x1cecb4(0x101)](_0x1cecb4(0x102));_0x34e340[_0x1cecb4(0x10d)]=_0x103622;}_0x493803!==undefined&&_0x493803!==null&&(_0x34e340[_0x1cecb4(0x105)]=String(_0x493803));if(_0x34e340[_0x1cecb4(0x10d)]===undefined&&_0x34e340['remark']===undefined)throw CliErrors[_0x1cecb4(0x101)]('Nothing\x20to\x20update.','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x34e340;}export const roleUpdate={'service':a144_0xac0a8e(0x10b),'command':'update','description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a144_0xac0a8e(0x10e),'type':'string','required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x407a82){readPatch(_0x407a82);},async 'dryRun'(_0x2f29ea){const _0x4e7191=a144_0xac0a8e,_0x2e5b42=_0x2f29ea[_0x4e7191(0x108)]('id'),_0x6a1b3a=readPatch(_0x2f29ea),_0x14e1fa=await getRoleById(_0x2f29ea[_0x4e7191(0xff)],_0x2e5b42);return assertCustomRole(_0x14e1fa,_0x4e7191(0x103)),asDryRunResult({'operation':_0x4e7191(0x103),'selector':{'appCode':_0x2f29ea[_0x4e7191(0xff)],'roleId':_0x2e5b42,'roleName':_0x14e1fa[_0x4e7191(0x10d)]},'before':projectRole(_0x14e1fa),'after':projectRole({..._0x14e1fa,..._0x6a1b3a[_0x4e7191(0x10d)]!==undefined?{'roleName':_0x6a1b3a[_0x4e7191(0x10d)]}:{},..._0x6a1b3a[_0x4e7191(0x105)]!==undefined?{'remark':_0x6a1b3a[_0x4e7191(0x105)]}:{}}),'dryRun':!![],'backend':{'method':_0x4e7191(0x110),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x4c536e){const _0x508be7=a144_0xac0a8e,_0x41f239=_0x4c536e[_0x508be7(0x108)]('id'),_0x59c045=readPatch(_0x4c536e),_0xd5c87e=await getRoleById(_0x4c536e[_0x508be7(0xff)],_0x41f239);assertCustomRole(_0xd5c87e,_0x508be7(0x103)),await updateAppRole({'id':_0x41f239,'appCode':_0x4c536e[_0x508be7(0xff)],..._0x59c045[_0x508be7(0x10d)]!==undefined?{'roleName':_0x59c045[_0x508be7(0x10d)]}:{},..._0x59c045[_0x508be7(0x105)]!==undefined?{'remark':_0x59c045['remark']}:{}});const _0x1f0320=await getRoleById(_0x4c536e[_0x508be7(0xff)],_0x41f239);return{'ok':!![],'data':{'operation':_0x508be7(0x103),'selector':{'appCode':_0x4c536e['appCode'],'roleId':_0x41f239,'roleName':_0x1f0320[_0x508be7(0x10d)]},'before':projectRole(_0xd5c87e),'after':projectRole(_0x1f0320),'dryRun':![],'backend':{'method':_0x508be7(0x110),'path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0x1f0320[_0x508be7(0x10d)]+_0x508be7(0xfe)+_0x41f239+')'};}};
1
+ const a144_0x5d1ff0=a144_0x25fb;(function(_0x55504d,_0x8d1ae6){const _0x3186e4=a144_0x25fb,_0x2f9913=_0x55504d();while(!![]){try{const _0x34188c=parseInt(_0x3186e4(0xcc))/0x1*(parseInt(_0x3186e4(0xb9))/0x2)+parseInt(_0x3186e4(0xcb))/0x3*(-parseInt(_0x3186e4(0xc0))/0x4)+-parseInt(_0x3186e4(0xc3))/0x5*(-parseInt(_0x3186e4(0xd1))/0x6)+-parseInt(_0x3186e4(0xb6))/0x7*(-parseInt(_0x3186e4(0xba))/0x8)+parseInt(_0x3186e4(0xd0))/0x9+parseInt(_0x3186e4(0xb8))/0xa+parseInt(_0x3186e4(0xbf))/0xb*(-parseInt(_0x3186e4(0xbe))/0xc);if(_0x34188c===_0x8d1ae6)break;else _0x2f9913['push'](_0x2f9913['shift']());}catch(_0x2d243b){_0x2f9913['push'](_0x2f9913['shift']());}}}(a144_0x5cb2,0x470cd));import{updateAppRole}from'../../core/api-client.js';function a144_0x5cb2(){const _0x26eb80=['/smartapi/permit/role/update','appCode','POST','num','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','Nothing\x20to\x20update.','Updated\x20role\x20','3OGMpBG','557815OuACYl','roleName','update','remark','103707YwnUiH','1910850sTnFMM','--name\x20cannot\x20be\x20empty.','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','validation','2517109vVejJg','write','3535630VTFwml','2AysyYb','8FuMhCP','role','\x20(id=','flag','1761816kfJHkp','88UWFLoP','541592JAFNwC','length','name','5URrLmK'];a144_0x5cb2=function(){return _0x26eb80;};return a144_0x5cb2();}function a144_0x25fb(_0x3d4d78,_0x33e486){_0x3d4d78=_0x3d4d78-0xb3;const _0x5cb224=a144_0x5cb2();let _0x25fb75=_0x5cb224[_0x3d4d78];return _0x25fb75;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a144_0x5d1ff0(0xc4);function readPatch(_0x3958d4){const _0x3fe531=a144_0x5d1ff0,_0x474a24=_0x3958d4['flag'](_0x3fe531(0xc2)),_0x4b6224=_0x3958d4[_0x3fe531(0xbd)]('remark'),_0xa042ae={};if(_0x474a24!==undefined&&_0x474a24!==null){const _0x16a5b9=String(_0x474a24)['trim']();if(!_0x16a5b9)throw CliErrors[_0x3fe531(0xb5)](_0x3fe531(0xb3));if(_0x16a5b9[_0x3fe531(0xc1)]>0x40)throw CliErrors['validation'](_0x3fe531(0xc8));_0xa042ae[_0x3fe531(0xcd)]=_0x16a5b9;}_0x4b6224!==undefined&&_0x4b6224!==null&&(_0xa042ae[_0x3fe531(0xcf)]=String(_0x4b6224));if(_0xa042ae[_0x3fe531(0xcd)]===undefined&&_0xa042ae[_0x3fe531(0xcf)]===undefined)throw CliErrors[_0x3fe531(0xb5)](_0x3fe531(0xc9),_0x3fe531(0xb4));return _0xa042ae;}export const roleUpdate={'service':a144_0x5d1ff0(0xbb),'command':a144_0x5d1ff0(0xce),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','risk':a144_0x5d1ff0(0xb7),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a144_0x5d1ff0(0xc2),'type':'string','required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x8aba31){readPatch(_0x8aba31);},async 'dryRun'(_0x2f07e2){const _0x5a09be=a144_0x5d1ff0,_0x1fd2a6=_0x2f07e2[_0x5a09be(0xc7)]('id'),_0x5ce9d7=readPatch(_0x2f07e2),_0x571da9=await getRoleById(_0x2f07e2[_0x5a09be(0xc5)],_0x1fd2a6);return assertCustomRole(_0x571da9,'update'),asDryRunResult({'operation':_0x5a09be(0xce),'selector':{'appCode':_0x2f07e2[_0x5a09be(0xc5)],'roleId':_0x1fd2a6,'roleName':_0x571da9['roleName']},'before':projectRole(_0x571da9),'after':projectRole({..._0x571da9,..._0x5ce9d7[_0x5a09be(0xcd)]!==undefined?{'roleName':_0x5ce9d7[_0x5a09be(0xcd)]}:{},..._0x5ce9d7[_0x5a09be(0xcf)]!==undefined?{'remark':_0x5ce9d7[_0x5a09be(0xcf)]}:{}}),'dryRun':!![],'backend':{'method':_0x5a09be(0xc6),'path':UPDATE_PATH},'warnings':[]},{'method':_0x5a09be(0xc6),'url':UPDATE_PATH});},async 'execute'(_0x514044){const _0x5b62ba=a144_0x5d1ff0,_0x2b6749=_0x514044['num']('id'),_0x4d7919=readPatch(_0x514044),_0x527c20=await getRoleById(_0x514044['appCode'],_0x2b6749);assertCustomRole(_0x527c20,_0x5b62ba(0xce)),await updateAppRole({'id':_0x2b6749,'appCode':_0x514044[_0x5b62ba(0xc5)],..._0x4d7919['roleName']!==undefined?{'roleName':_0x4d7919['roleName']}:{},..._0x4d7919[_0x5b62ba(0xcf)]!==undefined?{'remark':_0x4d7919[_0x5b62ba(0xcf)]}:{}});const _0xc9d827=await getRoleById(_0x514044['appCode'],_0x2b6749);return{'ok':!![],'data':{'operation':_0x5b62ba(0xce),'selector':{'appCode':_0x514044['appCode'],'roleId':_0x2b6749,'roleName':_0xc9d827[_0x5b62ba(0xcd)]},'before':projectRole(_0x527c20),'after':projectRole(_0xc9d827),'dryRun':![],'backend':{'method':_0x5b62ba(0xc6),'path':UPDATE_PATH},'warnings':[]},'message':_0x5b62ba(0xca)+_0xc9d827[_0x5b62ba(0xcd)]+_0x5b62ba(0xbc)+_0x2b6749+')'};}};
@@ -1 +1 @@
1
- const a145_0x3e603b=a145_0x9b7a;function a145_0x1ec5(){const _0x4a1ba0=['No\x20change:\x20user\x20','high-risk-write','user-add','roleName','POST','3350025YIqYVo','2977173WfyPmD','role','appCode','Added\x20user\x20','10339624eipwNk','6Ybgxsp','8334844NStTgm','22018qUVNHP','\x20to\x20role\x20','5ttTwyg','selector','5033889mXZFiL','5484276uEHcya','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes'];a145_0x1ec5=function(){return _0x4a1ba0;};return a145_0x1ec5();}(function(_0x339b40,_0x2acfd9){const _0x148c37=a145_0x9b7a,_0x12f29c=_0x339b40();while(!![]){try{const _0x2456b8=parseInt(_0x148c37(0xe6))/0x1*(parseInt(_0x148c37(0xe4))/0x2)+parseInt(_0x148c37(0xf1))/0x3+-parseInt(_0x148c37(0xe9))/0x4+parseInt(_0x148c37(0xf0))/0x5+parseInt(_0x148c37(0xe2))/0x6*(parseInt(_0x148c37(0xe3))/0x7)+-parseInt(_0x148c37(0xe1))/0x8+parseInt(_0x148c37(0xe8))/0x9;if(_0x2456b8===_0x2acfd9)break;else _0x12f29c['push'](_0x12f29c['shift']());}catch(_0x4410e3){_0x12f29c['push'](_0x12f29c['shift']());}}}(a145_0x1ec5,0xc445c));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a145_0x9b7a(_0xb2c0ff,_0x147b6f){_0xb2c0ff=_0xb2c0ff-0xdf;const _0x1ec5cb=a145_0x1ec5();let _0x9b7a12=_0x1ec5cb[_0xb2c0ff];return _0x9b7a12;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a145_0x3e603b(0xf2),'command':'user-add','description':a145_0x3e603b(0xea),'risk':a145_0x3e603b(0xec),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xa71373){const _0x4d6ec8=a145_0x3e603b,{mutation:_0x4d1f4f}=await prepareUserMutation(_0xa71373,_0x4d6ec8(0xed),!![]);return asDryRunResult(_0x4d1f4f,{'method':_0x4d6ec8(0xef),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x1e185e){const _0x8ff30c=a145_0x3e603b,{roleList:_0x147355,mutation:_0x36b466,changed:_0x3eb1bb}=await prepareUserMutation(_0x1e185e,_0x8ff30c(0xed),![]);return _0x3eb1bb&&await updateRoleUsers(_0x1e185e[_0x8ff30c(0xdf)],_0x147355),{'ok':!![],'data':_0x36b466,'message':_0x3eb1bb?_0x8ff30c(0xe0)+_0x36b466['selector']['userId']+_0x8ff30c(0xe5)+_0x36b466[_0x8ff30c(0xe7)][_0x8ff30c(0xee)]:_0x8ff30c(0xeb)+_0x36b466['selector']['userId']+'\x20already\x20in\x20role\x20'+_0x36b466[_0x8ff30c(0xe7)][_0x8ff30c(0xee)]};}};
1
+ const a145_0x23e15e=a145_0x4ba9;function a145_0x4ba9(_0x10298e,_0xbdd8f9){_0x10298e=_0x10298e-0x141;const _0xf4f5c5=a145_0xf4f5();let _0x4ba948=_0xf4f5c5[_0x10298e];return _0x4ba948;}(function(_0x3f4a4c,_0x241f6c){const _0x3b9b81=a145_0x4ba9,_0x482131=_0x3f4a4c();while(!![]){try{const _0x3deffd=-parseInt(_0x3b9b81(0x14d))/0x1*(parseInt(_0x3b9b81(0x147))/0x2)+-parseInt(_0x3b9b81(0x143))/0x3+parseInt(_0x3b9b81(0x153))/0x4*(-parseInt(_0x3b9b81(0x142))/0x5)+-parseInt(_0x3b9b81(0x14c))/0x6*(parseInt(_0x3b9b81(0x14a))/0x7)+-parseInt(_0x3b9b81(0x154))/0x8+-parseInt(_0x3b9b81(0x152))/0x9+parseInt(_0x3b9b81(0x155))/0xa*(parseInt(_0x3b9b81(0x144))/0xb);if(_0x3deffd===_0x241f6c)break;else _0x482131['push'](_0x482131['shift']());}catch(_0xa52ddc){_0x482131['push'](_0x482131['shift']());}}}(a145_0xf4f5,0xc6a44));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a145_0xf4f5(){const _0x157b99=['No\x20change:\x20user\x20','userId','selector','\x20to\x20role\x20','231462iOUpHN','1224708HCBVpI','6563512NYvjxy','1240bCEPeH','user-add','25DgtUWy','871980tBWNNp','427746rTnQgm','\x20already\x20in\x20role\x20','high-risk-write','520mEDFpR','role','roleName','721MCRbQV','appCode','77892qHQKaa','13ZITQML'];a145_0xf4f5=function(){return _0x157b99;};return a145_0xf4f5();}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_0x23e15e(0x148),'command':a145_0x23e15e(0x141),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a145_0x23e15e(0x146),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2723a0){const _0x4d3da2=a145_0x23e15e,{mutation:_0x5f3f1f}=await prepareUserMutation(_0x2723a0,_0x4d3da2(0x141),!![]);return asDryRunResult(_0x5f3f1f,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x1bb520){const _0xdb0dc7=a145_0x23e15e,{roleList:_0x52aca9,mutation:_0x33c521,changed:_0x40afef}=await prepareUserMutation(_0x1bb520,_0xdb0dc7(0x141),![]);return _0x40afef&&await updateRoleUsers(_0x1bb520[_0xdb0dc7(0x14b)],_0x52aca9),{'ok':!![],'data':_0x33c521,'message':_0x40afef?'Added\x20user\x20'+_0x33c521[_0xdb0dc7(0x150)][_0xdb0dc7(0x14f)]+_0xdb0dc7(0x151)+_0x33c521['selector'][_0xdb0dc7(0x149)]:_0xdb0dc7(0x14e)+_0x33c521[_0xdb0dc7(0x150)][_0xdb0dc7(0x14f)]+_0xdb0dc7(0x145)+_0x33c521[_0xdb0dc7(0x150)]['roleName']};}};
@@ -1 +1 @@
1
- function a146_0x67e0(){const _0x5d4ffe=['user-remove','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','426804ObXeYX','49dUyEvx','4231140ugAsBO','userId','appCode','18uNgjYb','1561576cjiDfz','946QFDPqd','roleName','\x20not\x20in\x20role\x20','selector','Removed\x20user\x20','381326SSwKek','153250SvFvyo','\x20from\x20role\x20','1025884ooanIB','3uHypUH','role','40678RjttNK'];a146_0x67e0=function(){return _0x5d4ffe;};return a146_0x67e0();}const a146_0x30efcf=a146_0x1ae6;(function(_0x3c8ddd,_0x27a654){const _0x4df8c=a146_0x1ae6,_0x57bf4f=_0x3c8ddd();while(!![]){try{const _0xd134e6=-parseInt(_0x4df8c(0x203))/0x1+-parseInt(_0x4df8c(0x1fd))/0x2*(-parseInt(_0x4df8c(0x201))/0x3)+-parseInt(_0x4df8c(0x200))/0x4+-parseInt(_0x4df8c(0x1f3))/0x5+-parseInt(_0x4df8c(0x1f1))/0x6*(-parseInt(_0x4df8c(0x1f2))/0x7)+-parseInt(_0x4df8c(0x1f7))/0x8*(parseInt(_0x4df8c(0x1f6))/0x9)+-parseInt(_0x4df8c(0x1fe))/0xa*(-parseInt(_0x4df8c(0x1f8))/0xb);if(_0xd134e6===_0x27a654)break;else _0x57bf4f['push'](_0x57bf4f['shift']());}catch(_0x229cbe){_0x57bf4f['push'](_0x57bf4f['shift']());}}}(a146_0x67e0,0x736cc));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a146_0x1ae6(_0x53198f,_0xa3d4c5){_0x53198f=_0x53198f-0x1f0;const _0x67e0f=a146_0x67e0();let _0x1ae621=_0x67e0f[_0x53198f];return _0x1ae621;}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_0x30efcf(0x202),'command':a146_0x30efcf(0x204),'description':a146_0x30efcf(0x1f0),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x57f59e){const _0x191ccc=a146_0x30efcf,{mutation:_0x2434dd}=await prepareUserMutation(_0x57f59e,_0x191ccc(0x204),!![]);return asDryRunResult(_0x2434dd,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x277859){const _0x393383=a146_0x30efcf,{roleList:_0x5c4a79,mutation:_0xd6de4d,changed:_0x3b2450}=await prepareUserMutation(_0x277859,_0x393383(0x204),![]);return _0x3b2450&&await updateRoleUsers(_0x277859[_0x393383(0x1f5)],_0x5c4a79),{'ok':!![],'data':_0xd6de4d,'message':_0x3b2450?_0x393383(0x1fc)+_0xd6de4d['selector'][_0x393383(0x1f4)]+_0x393383(0x1ff)+_0xd6de4d['selector'][_0x393383(0x1f9)]:'No\x20change:\x20user\x20'+_0xd6de4d[_0x393383(0x1fb)][_0x393383(0x1f4)]+_0x393383(0x1fa)+_0xd6de4d[_0x393383(0x1fb)][_0x393383(0x1f9)]};}};
1
+ const a146_0x437078=a146_0x4a8b;(function(_0x4e0602,_0x1d750b){const _0x2555e3=a146_0x4a8b,_0x5c39a1=_0x4e0602();while(!![]){try{const _0x49a72b=parseInt(_0x2555e3(0x1d8))/0x1+parseInt(_0x2555e3(0x1dc))/0x2*(-parseInt(_0x2555e3(0x1d6))/0x3)+parseInt(_0x2555e3(0x1e0))/0x4*(parseInt(_0x2555e3(0x1d4))/0x5)+-parseInt(_0x2555e3(0x1e1))/0x6*(-parseInt(_0x2555e3(0x1d3))/0x7)+-parseInt(_0x2555e3(0x1dd))/0x8*(parseInt(_0x2555e3(0x1e2))/0x9)+parseInt(_0x2555e3(0x1d7))/0xa+-parseInt(_0x2555e3(0x1ce))/0xb*(parseInt(_0x2555e3(0x1da))/0xc);if(_0x49a72b===_0x1d750b)break;else _0x5c39a1['push'](_0x5c39a1['shift']());}catch(_0x26f84d){_0x5c39a1['push'](_0x5c39a1['shift']());}}}(a146_0x5223,0xae8f5));function a146_0x4a8b(_0x38a6e5,_0x65d70d){_0x38a6e5=_0x38a6e5-0x1cc;const _0x52232f=a146_0x5223();let _0x4a8b7a=_0x52232f[_0x38a6e5];return _0x4a8b7a;}function a146_0x5223(){const _0x58f867=['126WuOJLm','high-risk-write','userId','77jOJKbS','selector','user-remove','\x20not\x20in\x20role\x20','POST','210iDdWSU','536230TNgZQN','roleName','1760295LJHclp','288760uuCpNS','896856rHkrcY','Removed\x20user\x20','3167784GhTfwC','role','2twhDAl','157736DoZzvo','appCode','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','48epnIAD','242598pwVGSn'];a146_0x5223=function(){return _0x58f867;};return a146_0x5223();}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_0x437078(0x1db),'command':a146_0x437078(0x1d0),'description':a146_0x437078(0x1df),'risk':a146_0x437078(0x1cc),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x11b8ec){const _0x8c28df=a146_0x437078,{mutation:_0x49edf0}=await prepareUserMutation(_0x11b8ec,_0x8c28df(0x1d0),!![]);return asDryRunResult(_0x49edf0,{'method':_0x8c28df(0x1d2),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x3c1a8f){const _0x131c2f=a146_0x437078,{roleList:_0x1f8a17,mutation:_0x480b33,changed:_0x465582}=await prepareUserMutation(_0x3c1a8f,'user-remove',![]);return _0x465582&&await updateRoleUsers(_0x3c1a8f[_0x131c2f(0x1de)],_0x1f8a17),{'ok':!![],'data':_0x480b33,'message':_0x465582?_0x131c2f(0x1d9)+_0x480b33[_0x131c2f(0x1cf)]['userId']+'\x20from\x20role\x20'+_0x480b33['selector'][_0x131c2f(0x1d5)]:'No\x20change:\x20user\x20'+_0x480b33['selector'][_0x131c2f(0x1cd)]+_0x131c2f(0x1d1)+_0x480b33['selector'][_0x131c2f(0x1d5)]};}};
@@ -1 +1 @@
1
- const a147_0x475758=a147_0x9f50;(function(_0x5a4d3f,_0x37d6a1){const _0xdbedad=a147_0x9f50,_0x1d9c91=_0x5a4d3f();while(!![]){try{const _0x182b32=-parseInt(_0xdbedad(0x17b))/0x1+parseInt(_0xdbedad(0x189))/0x2+parseInt(_0xdbedad(0x185))/0x3+-parseInt(_0xdbedad(0x182))/0x4*(parseInt(_0xdbedad(0x186))/0x5)+parseInt(_0xdbedad(0x181))/0x6+-parseInt(_0xdbedad(0x180))/0x7*(parseInt(_0xdbedad(0x17c))/0x8)+parseInt(_0xdbedad(0x188))/0x9;if(_0x182b32===_0x37d6a1)break;else _0x1d9c91['push'](_0x1d9c91['shift']());}catch(_0x3423f4){_0x1d9c91['push'](_0x1d9c91['shift']());}}}(a147_0x58f6,0x48135));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a147_0x58f6(){const _0x52ebb3=['Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','1526yHikLO','2035344DSdUFV','4xEFTsv','username','Resolved\x20\x22','723006wwOJCk','1644365ocdbKv','trim','4816341NyLzaS','514112xGgxYJ','read','user-resolve','nickname','flagMissing','name','313863feCVGN','15944hDXEvW','userId','Pass\x20--name\x20<nickname|username>.'];a147_0x58f6=function(){return _0x52ebb3;};return a147_0x58f6();}function a147_0x9f50(_0x5c1e40,_0x1d2c07){_0x5c1e40=_0x5c1e40-0x178;const _0x58f6c8=a147_0x58f6();let _0x9f50f2=_0x58f6c8[_0x5c1e40];return _0x9f50f2;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a147_0x475758(0x18b),'description':a147_0x475758(0x17f),'risk':a147_0x475758(0x18a),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x55d16b){const _0x4471ac=a147_0x475758;if(!_0x55d16b['str'](_0x4471ac(0x17a))[_0x4471ac(0x187)]())throw CliErrors[_0x4471ac(0x179)](_0x4471ac(0x17a),_0x4471ac(0x17e));},async 'execute'(_0xc0cb2e){const _0x137b96=a147_0x475758,_0x186f9d=_0xc0cb2e['str'](_0x137b96(0x17a))[_0x137b96(0x187)](),_0x566163=await resolveUserRef(_0x186f9d);return{'ok':!![],'data':{'user':{'userId':_0x566163['userId'],'username':_0x566163[_0x137b96(0x183)],'nickname':_0x566163[_0x137b96(0x178)],'matchedBy':_0x566163['matchedBy']}},'message':_0x137b96(0x184)+_0x186f9d+'\x22\x20→\x20userId\x20'+_0x566163[_0x137b96(0x17d)]};}};
1
+ const a147_0x954470=a147_0x18d3;(function(_0x197973,_0x360ca7){const _0x1e05b5=a147_0x18d3,_0x5f21ad=_0x197973();while(!![]){try{const _0x50d5cb=parseInt(_0x1e05b5(0x185))/0x1*(parseInt(_0x1e05b5(0x17a))/0x2)+-parseInt(_0x1e05b5(0x18c))/0x3*(-parseInt(_0x1e05b5(0x17e))/0x4)+-parseInt(_0x1e05b5(0x179))/0x5*(parseInt(_0x1e05b5(0x188))/0x6)+-parseInt(_0x1e05b5(0x17d))/0x7*(parseInt(_0x1e05b5(0x182))/0x8)+-parseInt(_0x1e05b5(0x17c))/0x9+parseInt(_0x1e05b5(0x18a))/0xa+parseInt(_0x1e05b5(0x187))/0xb*(-parseInt(_0x1e05b5(0x184))/0xc);if(_0x50d5cb===_0x360ca7)break;else _0x5f21ad['push'](_0x5f21ad['shift']());}catch(_0x51e574){_0x5f21ad['push'](_0x5f21ad['shift']());}}}(a147_0x3238,0x4a428));import{CliErrors}from'../../errors.js';function a147_0x18d3(_0x131445,_0x3e0659){_0x131445=_0x131445-0x176;const _0x3238e3=a147_0x3238();let _0x18d394=_0x3238e3[_0x131445];return _0x18d394;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a147_0x3238(){const _0x489168=['12znQTGG','2VYwMmg','str','5088347BneLSM','1567812TpGljW','userId','5159020cpWaVl','Resolved\x20\x22','3QFvIRi','role','name','matchedBy','10HZDlnD','580882tYtfzQ','nickname','1349379NUcAKF','7gkpGlI','2381804CEElIO','\x22\x20→\x20userId\x20','trim','Pass\x20--name\x20<nickname|username>.','2023640meSnXc','username'];a147_0x3238=function(){return _0x489168;};return a147_0x3238();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a147_0x954470(0x176),'command':'user-resolve','description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x52b5ff){const _0xa3e5b8=a147_0x954470;if(!_0x52b5ff[_0xa3e5b8(0x186)](_0xa3e5b8(0x177))[_0xa3e5b8(0x180)]())throw CliErrors['flagMissing']('name',_0xa3e5b8(0x181));},async 'execute'(_0x23ac50){const _0x4ff71a=a147_0x954470,_0x56c7c7=_0x23ac50[_0x4ff71a(0x186)](_0x4ff71a(0x177))[_0x4ff71a(0x180)](),_0x36a262=await resolveUserRef(_0x56c7c7);return{'ok':!![],'data':{'user':{'userId':_0x36a262[_0x4ff71a(0x189)],'username':_0x36a262[_0x4ff71a(0x183)],'nickname':_0x36a262[_0x4ff71a(0x17b)],'matchedBy':_0x36a262[_0x4ff71a(0x178)]}},'message':_0x4ff71a(0x18b)+_0x56c7c7+_0x4ff71a(0x17f)+_0x36a262[_0x4ff71a(0x189)]};}};
@@ -1 +1 @@
1
- const a148_0x45794e=a148_0x2742;(function(_0x1d5285,_0x4c6dfb){const _0x3cb027=a148_0x2742,_0x3e59b2=_0x1d5285();while(!![]){try{const _0x495741=parseInt(_0x3cb027(0x139))/0x1*(-parseInt(_0x3cb027(0x162))/0x2)+parseInt(_0x3cb027(0x146))/0x3+parseInt(_0x3cb027(0x165))/0x4+-parseInt(_0x3cb027(0x154))/0x5*(-parseInt(_0x3cb027(0x161))/0x6)+parseInt(_0x3cb027(0x142))/0x7*(parseInt(_0x3cb027(0x16c))/0x8)+parseInt(_0x3cb027(0x155))/0x9+parseInt(_0x3cb027(0x13c))/0xa*(-parseInt(_0x3cb027(0x145))/0xb);if(_0x495741===_0x4c6dfb)break;else _0x3e59b2['push'](_0x3e59b2['shift']());}catch(_0x54a769){_0x3e59b2['push'](_0x3e59b2['shift']());}}}(a148_0x1348,0x63c87));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';function a148_0x1348(){const _0x3665c2=['102912zTujhm','close','node_modules','2710412JAPqqt','--watch','push','\x0a\x20\x20Usage:\x20','log','vite\x20preview\x20exited\x20with\x20code\x20','cwd','8nhBTuW','slice','bun','utf-8','(none)','scripts','Available:\x20','build','\x20run\x20build','yarn','Enable\x20watch\x20mode\x20for\x20preview','preview','\x22\x20not\x20found\x20in\x20package.json.','boolean','pnpm','No\x20package.json\x20found\x20in\x20current\x20directory.','8owuuuS','\x20exited\x20with\x20code\x20','pnpm-lock.yaml','95610KKMLBN','\x20run\x20','parse','\x20run\x20preview\x20--watch','args','bun.lockb','3004540aZGYBb','\x20\x20\x20\x20','error','1441jGaosV','1062990KmDFom','watch','\x0a\x20\x20Available\x20scripts:\x0a','run','yarn.lock','all','join','validation','script','keys','needsUpgrade','package.json','\x20run\x20preview','Script\x20\x22','405MyFTMo','2978559bvjlAY','read','length','belowMinimum','bun.lock','Script\x20name\x20defined\x20in\x20package.json','\x20run\x20<script>\x0a','.bin','dev','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','vite','Run\x20a\x20package.json\x20script','20796EShajM'];a148_0x1348=function(){return _0x3665c2;};return a148_0x1348();}import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';function a148_0x2742(_0x58a2bc,_0x81abcc){_0x58a2bc=_0x58a2bc-0x135;const _0x134854=a148_0x1348();let _0x274222=_0x134854[_0x58a2bc];return _0x274222;}import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start',a148_0x45794e(0x15d)]);function readPackageScripts(_0xf88a70){const _0x7fbe0e=a148_0x45794e,_0x2a003d=resolve(_0xf88a70,_0x7fbe0e(0x151));if(!existsSync(_0x2a003d))return null;try{const _0x1e51ee=JSON[_0x7fbe0e(0x13e)](readFileSync(_0x2a003d,_0x7fbe0e(0x16f)));return _0x1e51ee[_0x7fbe0e(0x171)]??{};}catch{return null;}}function detectPackageManager(_0x121705){const _0x307234=a148_0x45794e;if(existsSync(resolve(_0x121705,_0x307234(0x141)))||existsSync(resolve(_0x121705,_0x307234(0x159))))return _0x307234(0x16e);if(existsSync(resolve(_0x121705,_0x307234(0x13b))))return _0x307234(0x137);if(existsSync(resolve(_0x121705,_0x307234(0x14a))))return _0x307234(0x175);return'npm';}async function versionCheck(_0x1540c5){const _0x4153f5=a148_0x45794e,_0x281461=await checkCliVersion();(_0x281461[_0x4153f5(0x150)]||_0x281461[_0x4153f5(0x158)])&&(printCliUpgradeWarning(_0x281461),assertCliVersionSupported(_0x281461));const _0x347798=await checkSdkVersion(_0x1540c5);if(_0x347798[_0x4153f5(0x150)])printSdkUpgradeWarning(_0x347798);}function spawnScript(_0x360e9f,_0x1c0185,_0x59ed8a,_0xadd849){return new Promise((_0x57b6b2,_0x14bedf)=>{const _0x26a163=a148_0x2742,_0x53fa8e=[_0x26a163(0x149),_0x1c0185,..._0x59ed8a],_0x4d3dca=spawn(_0x360e9f,_0x53fa8e,{'cwd':_0xadd849,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0xadd849,_0x26a163(0x164),_0x26a163(0x15c))+delimiter+process.env.PATH}});_0x4d3dca['on']('close',_0x233aad=>{const _0x122067=_0x26a163;if(_0x233aad===0x0||_0x233aad===null)_0x57b6b2();else _0x14bedf(new Error(_0x360e9f+_0x122067(0x13d)+_0x1c0185+_0x122067(0x13a)+_0x233aad));}),_0x4d3dca['on'](_0x26a163(0x144),_0x14bedf);});}function spawnViteBuildWatch(_0x379b68){return new Promise((_0x18f63e,_0x5a06cc)=>{const _0x5903a9=a148_0x2742,_0x23495d=spawn('vite',[_0x5903a9(0x173),_0x5903a9(0x166)],{'cwd':_0x379b68,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x379b68,_0x5903a9(0x164),_0x5903a9(0x15c))+delimiter+process.env.PATH}});_0x23495d['on'](_0x5903a9(0x163),_0x4e0962=>{const _0x4c7569=_0x5903a9;if(_0x4e0962===0x0||_0x4e0962===null)_0x18f63e();else _0x5a06cc(new Error(_0x4c7569(0x15e)+_0x4e0962));}),_0x23495d['on']('error',_0x5a06cc);});}function spawnVitePreview(_0x378f7f){return new Promise((_0x37dadd,_0x2974e4)=>{const _0x5ef364=a148_0x2742,_0x5ac4b4=spawn(_0x5ef364(0x15f),[_0x5ef364(0x177)],{'cwd':_0x378f7f,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x378f7f,_0x5ef364(0x164),_0x5ef364(0x15c))+delimiter+process.env.PATH}});_0x5ac4b4['on']('close',_0x5cb971=>{const _0x3fb294=_0x5ef364;if(_0x5cb971===0x0||_0x5cb971===null)_0x37dadd();else _0x2974e4(new Error(_0x3fb294(0x16a)+_0x5cb971));}),_0x5ac4b4['on'](_0x5ef364(0x144),_0x2974e4);});}const runFlags=[{'name':'watch','type':a148_0x45794e(0x136),'description':a148_0x45794e(0x176),'default':![]}];export const runDefinition={'service':'run','command':'run','description':a148_0x45794e(0x160),'risk':a148_0x45794e(0x156),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a148_0x45794e(0x14e),'description':a148_0x45794e(0x15a),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x35aa41=a148_0x45794e,_0x2174df=[];return _0x2174df[_0x35aa41(0x167)]('\x20\x20EXAMPLES'),_0x2174df[_0x35aa41(0x167)](_0x35aa41(0x143)+CLI_BIN_NAME+'\x20run\x20start'),_0x2174df['push'](_0x35aa41(0x143)+CLI_BIN_NAME+_0x35aa41(0x174)),_0x2174df[_0x35aa41(0x167)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x35aa41(0x152)),_0x2174df[_0x35aa41(0x167)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x35aa41(0x13f)),_0x2174df[_0x35aa41(0x14c)]('\x0a');},async 'execute'(_0x157967){const _0x31f6fb=a148_0x45794e,_0x57ea24=process[_0x31f6fb(0x16b)](),_0x10a719=_0x157967[_0x31f6fb(0x140)][0x0],_0x256238=_0x157967[_0x31f6fb(0x140)][_0x31f6fb(0x16d)](0x1),_0x20bcf4=readPackageScripts(_0x57ea24);if(!_0x20bcf4)throw CliErrors[_0x31f6fb(0x14d)](_0x31f6fb(0x138));if(!_0x10a719){const _0x5e93e8=Object[_0x31f6fb(0x14f)](_0x20bcf4);if(_0x5e93e8[_0x31f6fb(0x157)]===0x0)console[_0x31f6fb(0x169)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console['log'](_0x31f6fb(0x148));for(const _0x1e3e1f of _0x5e93e8){console[_0x31f6fb(0x169)](_0x31f6fb(0x143)+_0x1e3e1f);}console['log'](_0x31f6fb(0x168)+CLI_BIN_NAME+_0x31f6fb(0x15b));}return{'ok':!![]};}if(!_0x20bcf4[_0x10a719])throw CliErrors[_0x31f6fb(0x14d)](_0x31f6fb(0x153)+_0x10a719+_0x31f6fb(0x135),_0x31f6fb(0x172)+(Object[_0x31f6fb(0x14f)](_0x20bcf4)[_0x31f6fb(0x14c)](',\x20')||_0x31f6fb(0x170)));const _0x8cced7=detectPackageManager(_0x57ea24);VERSION_CHECK_SCRIPTS['has'](_0x10a719)&&await versionCheck(_0x57ea24);if(_0x10a719==='preview'&&_0x157967['bool'](_0x31f6fb(0x147)))return await Promise[_0x31f6fb(0x14b)]([spawnViteBuildWatch(_0x57ea24),spawnVitePreview(_0x57ea24)]),{'ok':!![]};return await spawnScript(_0x8cced7,_0x10a719,_0x256238,_0x57ea24),{'ok':!![]};}};
1
+ const a148_0x34b0b8=a148_0x573e;(function(_0x1d07c0,_0x154881){const _0x115d82=a148_0x573e,_0x403b7e=_0x1d07c0();while(!![]){try{const _0x49ca13=-parseInt(_0x115d82(0x192))/0x1*(parseInt(_0x115d82(0x15f))/0x2)+parseInt(_0x115d82(0x189))/0x3*(parseInt(_0x115d82(0x16b))/0x4)+parseInt(_0x115d82(0x181))/0x5+-parseInt(_0x115d82(0x190))/0x6+parseInt(_0x115d82(0x17d))/0x7+-parseInt(_0x115d82(0x186))/0x8+-parseInt(_0x115d82(0x168))/0x9*(parseInt(_0x115d82(0x161))/0xa);if(_0x49ca13===_0x154881)break;else _0x403b7e['push'](_0x403b7e['shift']());}catch(_0x561ff4){_0x403b7e['push'](_0x403b7e['shift']());}}}(a148_0xe33f,0x59cbf));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';function a148_0xe33f(){const _0x25ece1=['71220DDAYht','build','needsUpgrade','package.json','Available:\x20','join','\x20\x20\x20\x20','117rgSesK','log','run','4ooRJcf','utf-8','No\x20package.json\x20found\x20in\x20current\x20directory.','npm','slice','push','.bin','args','yarn.lock','preview','Script\x20\x22','\x20run\x20<script>\x0a','start','vite','node_modules','vite\x20preview\x20exited\x20with\x20code\x20','\x20run\x20preview','bun.lockb','3461073MZRfCg','\x20run\x20','bool','--watch','1511310qCkyTO','error','boolean','dev','\x0a\x20\x20Available\x20scripts:\x0a','1211920lXmVUT','length','No\x20scripts\x20defined\x20in\x20package.json.','1872324IpmtkE','keys','watch','all','parse','has','yarn','3872538KqeQna','\x20exited\x20with\x20code\x20','37Oxktqp','read','\x22\x20not\x20found\x20in\x20package.json.','pnpm-lock.yaml','bun','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','Enable\x20watch\x20mode\x20for\x20preview','(none)','\x20run\x20build','8838vovPtX','close'];a148_0xe33f=function(){return _0x25ece1;};return a148_0xe33f();}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_0x34b0b8(0x177),a148_0x34b0b8(0x184)]);function readPackageScripts(_0x2254af){const _0x2ff2a0=a148_0x34b0b8,_0x1aab91=resolve(_0x2254af,_0x2ff2a0(0x164));if(!existsSync(_0x1aab91))return null;try{const _0x4e96ee=JSON[_0x2ff2a0(0x18d)](readFileSync(_0x1aab91,_0x2ff2a0(0x16c)));return _0x4e96ee['scripts']??{};}catch{return null;}}function detectPackageManager(_0x2c4bf2){const _0x2b22dc=a148_0x34b0b8;if(existsSync(resolve(_0x2c4bf2,_0x2b22dc(0x17c)))||existsSync(resolve(_0x2c4bf2,'bun.lock')))return _0x2b22dc(0x196);if(existsSync(resolve(_0x2c4bf2,_0x2b22dc(0x195))))return'pnpm';if(existsSync(resolve(_0x2c4bf2,_0x2b22dc(0x173))))return _0x2b22dc(0x18f);return _0x2b22dc(0x16e);}async function versionCheck(_0x48a2ee){const _0x192f2f=a148_0x34b0b8,_0x2d9392=await checkCliVersion();(_0x2d9392[_0x192f2f(0x163)]||_0x2d9392['belowMinimum'])&&(printCliUpgradeWarning(_0x2d9392),assertCliVersionSupported(_0x2d9392));const _0x530457=await checkSdkVersion(_0x48a2ee);if(_0x530457[_0x192f2f(0x163)])printSdkUpgradeWarning(_0x530457);}function spawnScript(_0x201be1,_0x472f67,_0x1ed03b,_0x125f99){return new Promise((_0x463194,_0x4e6957)=>{const _0x9b0e9a=a148_0x573e,_0x12f253=[_0x9b0e9a(0x16a),_0x472f67,..._0x1ed03b],_0x310a91=spawn(_0x201be1,_0x12f253,{'cwd':_0x125f99,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x125f99,'node_modules','.bin')+delimiter+process.env.PATH}});_0x310a91['on']('close',_0x156f37=>{const _0x189ea8=_0x9b0e9a;if(_0x156f37===0x0||_0x156f37===null)_0x463194();else _0x4e6957(new Error(_0x201be1+_0x189ea8(0x17e)+_0x472f67+_0x189ea8(0x191)+_0x156f37));}),_0x310a91['on'](_0x9b0e9a(0x182),_0x4e6957);});}function spawnViteBuildWatch(_0x49476e){return new Promise((_0x923eba,_0x3a0802)=>{const _0x1c4139=a148_0x573e,_0x32c878=spawn(_0x1c4139(0x178),[_0x1c4139(0x162),_0x1c4139(0x180)],{'cwd':_0x49476e,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x49476e,_0x1c4139(0x179),_0x1c4139(0x171))+delimiter+process.env.PATH}});_0x32c878['on'](_0x1c4139(0x160),_0x16de6a=>{const _0x5ccce2=_0x1c4139;if(_0x16de6a===0x0||_0x16de6a===null)_0x923eba();else _0x3a0802(new Error(_0x5ccce2(0x197)+_0x16de6a));}),_0x32c878['on']('error',_0x3a0802);});}function a148_0x573e(_0x1bb0f7,_0x21026f){_0x1bb0f7=_0x1bb0f7-0x15f;const _0xe33f0c=a148_0xe33f();let _0x573e7d=_0xe33f0c[_0x1bb0f7];return _0x573e7d;}function spawnVitePreview(_0x5d1a5f){return new Promise((_0xfdb0d4,_0x14233d)=>{const _0x5c70ef=a148_0x573e,_0x5a697e=spawn('vite',[_0x5c70ef(0x174)],{'cwd':_0x5d1a5f,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x5d1a5f,'node_modules',_0x5c70ef(0x171))+delimiter+process.env.PATH}});_0x5a697e['on'](_0x5c70ef(0x160),_0x5ba359=>{const _0x3d8fd0=_0x5c70ef;if(_0x5ba359===0x0||_0x5ba359===null)_0xfdb0d4();else _0x14233d(new Error(_0x3d8fd0(0x17a)+_0x5ba359));}),_0x5a697e['on'](_0x5c70ef(0x182),_0x14233d);});}const runFlags=[{'name':a148_0x34b0b8(0x18b),'type':a148_0x34b0b8(0x183),'description':a148_0x34b0b8(0x198),'default':![]}];export const runDefinition={'service':'run','command':a148_0x34b0b8(0x16a),'description':'Run\x20a\x20package.json\x20script','risk':a148_0x34b0b8(0x193),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x833e8=a148_0x34b0b8,_0x1990ca=[];return _0x1990ca[_0x833e8(0x170)]('\x20\x20EXAMPLES'),_0x1990ca[_0x833e8(0x170)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20start'),_0x1990ca['push'](_0x833e8(0x167)+CLI_BIN_NAME+_0x833e8(0x19a)),_0x1990ca[_0x833e8(0x170)](_0x833e8(0x167)+CLI_BIN_NAME+_0x833e8(0x17b)),_0x1990ca[_0x833e8(0x170)](_0x833e8(0x167)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x1990ca[_0x833e8(0x166)]('\x0a');},async 'execute'(_0x970111){const _0x34ebee=a148_0x34b0b8,_0x149e95=process['cwd'](),_0x3291c8=_0x970111['args'][0x0],_0x1945d9=_0x970111[_0x34ebee(0x172)][_0x34ebee(0x16f)](0x1),_0xc5ba22=readPackageScripts(_0x149e95);if(!_0xc5ba22)throw CliErrors['validation'](_0x34ebee(0x16d));if(!_0x3291c8){const _0x379bf0=Object[_0x34ebee(0x18a)](_0xc5ba22);if(_0x379bf0[_0x34ebee(0x187)]===0x0)console[_0x34ebee(0x169)](_0x34ebee(0x188));else{console['log'](_0x34ebee(0x185));for(const _0x4cc64a of _0x379bf0){console[_0x34ebee(0x169)](_0x34ebee(0x167)+_0x4cc64a);}console['log']('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x34ebee(0x176));}return{'ok':!![]};}if(!_0xc5ba22[_0x3291c8])throw CliErrors['validation'](_0x34ebee(0x175)+_0x3291c8+_0x34ebee(0x194),_0x34ebee(0x165)+(Object[_0x34ebee(0x18a)](_0xc5ba22)[_0x34ebee(0x166)](',\x20')||_0x34ebee(0x199)));const _0x5098fa=detectPackageManager(_0x149e95);VERSION_CHECK_SCRIPTS[_0x34ebee(0x18e)](_0x3291c8)&&await versionCheck(_0x149e95);if(_0x3291c8===_0x34ebee(0x174)&&_0x970111[_0x34ebee(0x17f)](_0x34ebee(0x18b)))return await Promise[_0x34ebee(0x18c)]([spawnViteBuildWatch(_0x149e95),spawnVitePreview(_0x149e95)]),{'ok':!![]};return await spawnScript(_0x5098fa,_0x3291c8,_0x1945d9,_0x149e95),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a149_0x3bfb8a=a149_0x45c9;(function(_0x416c1d,_0x4a0ded){const _0x1691e8=a149_0x45c9,_0x3d8395=_0x416c1d();while(!![]){try{const _0x480bd3=-parseInt(_0x1691e8(0x12c))/0x1*(parseInt(_0x1691e8(0x120))/0x2)+-parseInt(_0x1691e8(0x125))/0x3+-parseInt(_0x1691e8(0x12b))/0x4*(-parseInt(_0x1691e8(0x11e))/0x5)+-parseInt(_0x1691e8(0x128))/0x6+-parseInt(_0x1691e8(0x124))/0x7*(-parseInt(_0x1691e8(0x127))/0x8)+-parseInt(_0x1691e8(0x123))/0x9*(-parseInt(_0x1691e8(0x122))/0xa)+parseInt(_0x1691e8(0x12d))/0xb;if(_0x480bd3===_0x4a0ded)break;else _0x3d8395['push'](_0x3d8395['shift']());}catch(_0x8c26be){_0x3d8395['push'](_0x3d8395['shift']());}}}(a149_0xd1a8,0x7186a));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2405ba){const _0xdb0aa8=await buildSchemaPayload();return{'ok':!![],'data':_0xdb0aa8};}function a149_0x45c9(_0x31f431,_0x1523ea){_0x31f431=_0x31f431-0x11e;const _0xd1a804=a149_0xd1a8();let _0x45c938=_0xd1a804[_0x31f431];return _0x45c938;}export const schemaDefinition={'service':a149_0x3bfb8a(0x12a),'command':a149_0x3bfb8a(0x129),'description':a149_0x3bfb8a(0x126),'risk':a149_0x3bfb8a(0x121),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a149_0x3bfb8a(0x11f),'flags':[],'execute':execute};function a149_0xd1a8(){const _0xac5d0f=['4BsyDWe','read','40XVHdRg','403272fuEbdr','77SbQIBm','2409690ZDcSVk','Export\x20machine-readable\x20command\x20schema\x20(JSON)','523504RchOYV','2376570EXkfXg','export','schema','1776784kgRWmQ','120535hYVFRb','6183661naxJaP','5ShkSPn','json'];a149_0xd1a8=function(){return _0xac5d0f;};return a149_0xd1a8();}
1
+ function a149_0x136e(_0x29456b,_0x2d9230){_0x29456b=_0x29456b-0x13c;const _0x27b551=a149_0x27b5();let _0x136e1a=_0x27b551[_0x29456b];return _0x136e1a;}const a149_0x26ff35=a149_0x136e;(function(_0x5eda7c,_0x203a86){const _0x5de47c=a149_0x136e,_0x34c760=_0x5eda7c();while(!![]){try{const _0x1fa820=parseInt(_0x5de47c(0x145))/0x1+-parseInt(_0x5de47c(0x13f))/0x2+-parseInt(_0x5de47c(0x147))/0x3+parseInt(_0x5de47c(0x13e))/0x4*(-parseInt(_0x5de47c(0x13d))/0x5)+-parseInt(_0x5de47c(0x144))/0x6+-parseInt(_0x5de47c(0x142))/0x7*(-parseInt(_0x5de47c(0x141))/0x8)+parseInt(_0x5de47c(0x143))/0x9;if(_0x1fa820===_0x203a86)break;else _0x34c760['push'](_0x34c760['shift']());}catch(_0x5b00b6){_0x34c760['push'](_0x34c760['shift']());}}}(a149_0x27b5,0x7c972));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x308683){const _0x169b5c=await buildSchemaPayload();return{'ok':!![],'data':_0x169b5c};}function a149_0x27b5(){const _0x3e7e34=['read','7847336Upeuzy','7qFuhgZ','128052yNhBKU','178008mrmnHz','963665NtLIEq','schema','231348xJIBhT','Export\x20machine-readable\x20command\x20schema\x20(JSON)','191365FbZhfO','76Rkaxeg','1229034kBCwsF'];a149_0x27b5=function(){return _0x3e7e34;};return a149_0x27b5();}export const schemaDefinition={'service':a149_0x26ff35(0x146),'command':'export','description':a149_0x26ff35(0x13c),'risk':a149_0x26ff35(0x140),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a150_0x31ba63=a150_0x2521;(function(_0x34e86a,_0x1a7639){const _0x526c5f=a150_0x2521,_0x3cbce5=_0x34e86a();while(!![]){try{const _0x2f52ec=-parseInt(_0x526c5f(0xbd))/0x1*(-parseInt(_0x526c5f(0xfa))/0x2)+-parseInt(_0x526c5f(0xb4))/0x3+-parseInt(_0x526c5f(0xf6))/0x4+parseInt(_0x526c5f(0xdb))/0x5+parseInt(_0x526c5f(0xb2))/0x6*(parseInt(_0x526c5f(0xbb))/0x7)+-parseInt(_0x526c5f(0xee))/0x8+parseInt(_0x526c5f(0xb7))/0x9;if(_0x2f52ec===_0x1a7639)break;else _0x3cbce5['push'](_0x3cbce5['shift']());}catch(_0x17ab69){_0x3cbce5['push'](_0x3cbce5['shift']());}}}(a150_0x4363,0x572d1));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(_0x184194){const _0x5bc53e=a150_0x2521;if(_0x184194==='mybatisXml')return[_0x5bc53e(0xb5),_0x5bc53e(0xe9),_0x5bc53e(0xe3),'']['join']('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x5bc53e(0xc4)]('\x0a');}export const sqlCreate={'service':a150_0x31ba63(0xd3),'command':a150_0x31ba63(0xc3),'description':a150_0x31ba63(0xeb),'risk':a150_0x31ba63(0xe0),'flags':[{'name':'name','type':a150_0x31ba63(0xe1),'description':a150_0x31ba63(0xef)},{'name':a150_0x31ba63(0xd1),'type':a150_0x31ba63(0xf1),'description':a150_0x31ba63(0xc2)},{'name':a150_0x31ba63(0xd5),'type':a150_0x31ba63(0xe1),'enum':[a150_0x31ba63(0xd3),a150_0x31ba63(0xcf)],'description':a150_0x31ba63(0xcb)}],async 'validate'(_0x36ce72){const _0x428e0f=a150_0x31ba63;if(!_0x36ce72['nonInteractive'])return;if(!_0x36ce72[_0x428e0f(0xd4)]('name')[_0x428e0f(0xb9)]())throw CliErrors[_0x428e0f(0xce)](_0x428e0f(0xe2),_0x428e0f(0xfb));const _0x3ac41f=resolveProvidedDbId(_0x36ce72);if(typeof _0x3ac41f!=='number'||!Number[_0x428e0f(0xbe)](_0x3ac41f)||_0x3ac41f<=0x0)throw CliErrors['flagMissing'](_0x428e0f(0xd1),_0x428e0f(0xb8));if(!_0x36ce72[_0x428e0f(0xd4)]('mode')[_0x428e0f(0xb9)]())throw CliErrors[_0x428e0f(0xce)]('mode',_0x428e0f(0xd0));},async 'dryRun'(_0x26cf9d){const _0x395ab6=a150_0x31ba63,_0x1f774f=loadSqlProjectConfig(_0x26cf9d[_0x395ab6(0xde)]),{sqlName:_0x38e8dc,dbId:_0x56e33d,dbName:_0x443d38,mode:_0x328be1}=await resolveSqlNewInputs(_0x26cf9d),_0x448914=buildSqlRelativePath(_0x395ab6(0xe4),_0x38e8dc,_0x443d38,_0x328be1,_0x56e33d),_0x33123e=_0x1f774f[_0x395ab6(0xf7)]+'/'+_0x448914;return{'method':_0x395ab6(0xd6),'url':_0x395ab6(0xdc),'body':{'appCode':_0x26cf9d['appCode'],'sqlName':_0x38e8dc,'dbId':_0x56e33d,'mode':_0x328be1,'localPath':_0x33123e},'description':_0x395ab6(0xc5)+_0x1f774f['sqlRootDir']};},async 'execute'(_0x30a99e){const _0x35c996=a150_0x31ba63,_0x44777b=loadSqlProjectConfig(_0x30a99e[_0x35c996(0xde)]),{sqlName:_0x59997b,dbId:_0x1ff8f8,dbName:_0x415195,mode:_0x412e80}=await resolveSqlNewInputs(_0x30a99e),_0x510a12=generateSqlTemplate(_0x412e80),_0x28990c=await createSqlQuery({'appCode':_0x30a99e['appCode'],'sqlName':_0x59997b,'dbId':_0x1ff8f8,'sqlContent':_0x510a12}),_0x25356e=ensureRemoteSqlContent(_0x28990c),_0x439446=_0x415195||await getDbName(_0x30a99e['appCode'],_0x1ff8f8)[_0x35c996(0xcc)](()=>undefined),_0x5b828c=buildSqlRelativePath(_0x28990c[_0x35c996(0xcd)],_0x28990c['sqlName'],_0x439446,_0x412e80,_0x1ff8f8),_0x1bd90f=_0x44777b[_0x35c996(0xf7)]+'/'+_0x5b828c,_0x5d0975=buildLocalSqlFileContent({'sqlCode':_0x28990c[_0x35c996(0xcd)],'sqlName':_0x28990c[_0x35c996(0xbc)],'dbId':_0x28990c[_0x35c996(0xe5)]},_0x25356e,{'dbName':_0x439446,'mode':_0x412e80,'syncedAt':new Date()['toISOString'](),'description':_0x28990c[_0x35c996(0xda)]});if(await fileExists(_0x1bd90f))throw CliErrors['validation'](_0x35c996(0xbf)+_0x1bd90f);await ensureParentDirectory(_0x1bd90f),await writeFile(_0x1bd90f,_0x5d0975,_0x35c996(0xdf));const _0x34a772=await readSqlLockFile(_0x44777b[_0x35c996(0xd8)]),{lockData:_0x1aa103,appLock:_0x358f9f}=ensureSqlLockScope(_0x34a772??createEmptySqlLock(),_0x44777b[_0x35c996(0xde)],_0x44777b[_0x35c996(0xc0)],_0x35c996(0xd7));return _0x358f9f[_0x35c996(0xe6)][_0x28990c[_0x35c996(0xcd)]]={...buildSqlLockEntry(_0x28990c,_0x25356e,computeSqlContentHash(_0x5d0975),{'dbName':_0x439446}),'path':_0x5b828c,'mode':_0x412e80},_0x358f9f[_0x35c996(0xf8)]=new Date()[_0x35c996(0xec)](),await writeSqlLockFile(_0x44777b['lockFilePath'],_0x1aa103),{'ok':!![],'data':{'id':_0x28990c['id'],'sqlCode':_0x28990c[_0x35c996(0xcd)],'sqlName':_0x28990c['sqlName'],'dbId':_0x28990c[_0x35c996(0xe5)],'path':_0x1bd90f,'mode':_0x412e80},'message':_0x35c996(0xb3)+_0x28990c['sqlCode']};}};async function resolveSqlNewInputs(_0x584f99){const _0x17c5aa=await resolveSqlNameInput(_0x584f99),{dbId:_0x2adb5b,dbName:_0x4f7dde}=await resolveDbSelection(_0x584f99),_0x68e437=await resolveSqlModeInput(_0x584f99);return{'sqlName':_0x17c5aa,'dbId':_0x2adb5b,'dbName':_0x4f7dde,'mode':_0x68e437};}async function resolveSqlNameInput(_0x4b4467){const _0x335f87=a150_0x31ba63,_0x5cdd89=_0x4b4467['str'](_0x335f87(0xe2))[_0x335f87(0xb9)]();if(_0x5cdd89)return _0x5cdd89;if(_0x4b4467[_0x335f87(0xed)])throw CliErrors[_0x335f87(0xce)](_0x335f87(0xe2),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':_0x335f87(0xd9),'validate':_0x1a2afa=>_0x1a2afa[_0x335f87(0xb9)]()?!![]:_0x335f87(0xc6)}))[_0x335f87(0xb9)]();}async function resolveDbSelection(_0x787571){const _0xae4456=a150_0x31ba63,_0x312837=resolveProvidedDbId(_0x787571);if(typeof _0x312837==='number'&&Number['isFinite'](_0x312837)&&_0x312837>0x0)return{'dbId':_0x312837,'dbName':await getDbName(_0x787571[_0xae4456(0xde)],_0x312837)[_0xae4456(0xcc)](()=>undefined)};if(_0x787571[_0xae4456(0xed)])throw CliErrors[_0xae4456(0xce)](_0xae4456(0xd1),_0xae4456(0xb8));const _0x12fe0a=await listDatabases(_0x787571['appCode'])[_0xae4456(0xcc)](()=>[]);if(_0x12fe0a[_0xae4456(0xdd)]===0x1)return{'dbId':_0x12fe0a[0x0][_0xae4456(0xe5)],'dbName':_0x12fe0a[0x0][_0xae4456(0xb6)]};if(_0x12fe0a[_0xae4456(0xdd)]>0x1){const _0x2d82d3=await select({'message':_0xae4456(0xc1),'choices':[..._0x12fe0a[_0xae4456(0xc7)](_0x260c4e=>({'name':_0x260c4e['dbName']+'\x20('+_0x260c4e[_0xae4456(0xe5)]+')','value':serializeDbSelection(_0x260c4e)})),{'name':_0xae4456(0xf0),'value':_0xae4456(0xe8)}]});if(_0x2d82d3!=='__manual__')return deserializeDbSelection(_0x2d82d3);}const _0x97a97f=await input({'message':_0xae4456(0xf2),'validate':_0x597c5a=>{const _0x3c6740=_0xae4456,_0x3b5292=_0x597c5a[_0x3c6740(0xb9)]();if(!_0x3b5292)return _0x3c6740(0xea);const _0x5e5726=Number(_0x3b5292);if(!Number[_0x3c6740(0xf5)](_0x5e5726)||_0x5e5726<=0x0)return _0x3c6740(0xf4);return!![];}});return{'dbId':Number(_0x97a97f[_0xae4456(0xb9)]())};}function a150_0x2521(_0xb7758e,_0x5f3a80){_0xb7758e=_0xb7758e-0xb2;const _0x4363c9=a150_0x4363();let _0x252150=_0x4363c9[_0xb7758e];return _0x252150;}async function resolveSqlModeInput(_0x1a7e54){const _0x4565d5=a150_0x31ba63,_0x38740d=_0x1a7e54[_0x4565d5(0xd4)]('mode')[_0x4565d5(0xb9)]();if(_0x38740d===_0x4565d5(0xd3)||_0x38740d==='mybatisXml')return _0x38740d;if(_0x1a7e54['nonInteractive'])throw CliErrors[_0x4565d5(0xce)]('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x4565d5(0xf9),'value':_0x4565d5(0xd3),'description':_0x4565d5(0xfc)},{'name':_0x4565d5(0xc9),'value':_0x4565d5(0xcf),'description':_0x4565d5(0xf3)}]});}function serializeDbSelection(_0x47be16){const _0x4a9448=a150_0x31ba63;return JSON[_0x4a9448(0xca)]({'dbId':_0x47be16[_0x4a9448(0xe5)],'dbName':_0x47be16[_0x4a9448(0xb6)]});}function deserializeDbSelection(_0x44c548){const _0x11f4e4=a150_0x31ba63;try{const _0x4d4e9d=JSON[_0x11f4e4(0xba)](_0x44c548);if(typeof _0x4d4e9d[_0x11f4e4(0xe5)]===_0x11f4e4(0xf1)&&Number[_0x11f4e4(0xbe)](_0x4d4e9d[_0x11f4e4(0xe5)]))return{'dbId':_0x4d4e9d[_0x11f4e4(0xe5)],'dbName':_0x4d4e9d[_0x11f4e4(0xb6)]};}catch{}throw CliErrors[_0x11f4e4(0xe7)](_0x11f4e4(0xc8)+_0x44c548);}function a150_0x4363(){const _0x421cc1=['Target\x20database\x20ID','create','join','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','SQL\x20名称不能为空','map','Invalid\x20database\x20selection\x20payload:\x20','MyBatis\x20XML(mybatisXml)','stringify','Local\x20SQL\x20file\x20mode','catch','sqlCode','flagMissing','mybatisXml','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','db-id','flag','sql','str','mode','POST','new','lockFilePath','请输入\x20SQL\x20名称:','description','3343945pvIXXH','/smartapi/custom/saveUserCustomSql','length','appCode','utf8','high-risk-write','string','name','</select>','<server-generated-sqlCode>','dbId','sqls','validation','__manual__','\x20\x20SELECT\x201\x20AS\x20id','dbId\x20不能为空','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','toISOString','nonInteractive','5175208bfdtMF','SQL\x20query\x20display\x20name','✎\x20手动输入\x20dbId','number','请输入目标数据库\x20dbId:','适合带动态标签的\x20MyBatis\x20XML\x20SQL','dbId\x20必须为正整数','isInteger','2662244uZwcbl','sqlRootDir','lastSync','普通\x20SQL(sql)','182CeacQD','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','27732uQNxFQ','Created\x20SQL\x20query\x20','2086131LErfGj','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','dbName','10168236azczLj','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','trim','parse','91KThLHw','sqlName','5563LHKJdP','isFinite','File\x20already\x20exists:\x20','sqlRoot','请选择目标数据库:'];a150_0x4363=function(){return _0x421cc1;};return a150_0x4363();}function resolveProvidedDbId(_0x2a6366){const _0x228f1c=a150_0x31ba63,_0x5729eb=_0x2a6366[_0x228f1c(0xd2)](_0x228f1c(0xd1));if(typeof _0x5729eb===_0x228f1c(0xf1)&&Number['isFinite'](_0x5729eb))return _0x5729eb;return undefined;}
1
+ const a150_0x33fe04=a150_0x1543;(function(_0x4bdb7a,_0x3a958c){const _0x323d0a=a150_0x1543,_0x46c7bb=_0x4bdb7a();while(!![]){try{const _0x529851=parseInt(_0x323d0a(0x121))/0x1*(-parseInt(_0x323d0a(0x12a))/0x2)+-parseInt(_0x323d0a(0x14a))/0x3+-parseInt(_0x323d0a(0x134))/0x4*(parseInt(_0x323d0a(0x124))/0x5)+parseInt(_0x323d0a(0x11c))/0x6+-parseInt(_0x323d0a(0x13e))/0x7*(-parseInt(_0x323d0a(0x11f))/0x8)+-parseInt(_0x323d0a(0x131))/0x9+parseInt(_0x323d0a(0x12f))/0xa;if(_0x529851===_0x3a958c)break;else _0x46c7bb['push'](_0x46c7bb['shift']());}catch(_0x47c8bc){_0x46c7bb['push'](_0x46c7bb['shift']());}}}(a150_0x55d8,0x1cd69));import{writeFile}from'node:fs/promises';function a150_0x55d8(){const _0x4417b4=['Created\x20SQL\x20query\x20','high-risk-write','Local\x20SQL\x20file\x20mode','dbName','4004080OlJaCo','validation','1625211utJHqp','sqlName','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','12nfSyDa','Target\x20database\x20ID','lastSync','sqlCode','flagMissing','str','dbId\x20必须为正整数','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','nonInteractive','lockFilePath','475587JksAnI','mybatisXml','appCode','description','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','<server-generated-sqlCode>','/smartapi/custom/saveUserCustomSql','sqls','dbId\x20不能为空','join','POST','map','165036iBoGZe','MyBatis\x20XML(mybatisXml)','number','parse','toISOString','string','SQL\x20名称不能为空','sql','</select>','length','new','请选择本地\x20SQL\x20模式:','SQL\x20query\x20display\x20name','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','请输入\x20SQL\x20名称:','flag','mode','sqlRootDir','catch','__manual__','1316010SQuBwS','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','db-id','8AjEoFj','dbId','170661GdOgpT','SELECT\x201\x20AS\x20id;','name','272185kLCIXZ','sqlRoot','请选择目标数据库:','isFinite','File\x20already\x20exists:\x20','trim','2rJMiVT'];a150_0x55d8=function(){return _0x4417b4;};return a150_0x55d8();}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(_0x535745){const _0x3adcd5=a150_0x1543;if(_0x535745===_0x3adcd5(0x13f))return[_0x3adcd5(0x142),'\x20\x20SELECT\x201\x20AS\x20id',_0x3adcd5(0x110),''][_0x3adcd5(0x147)]('\x0a');return[_0x3adcd5(0x122),''][_0x3adcd5(0x147)]('\x0a');}export const sqlCreate={'service':a150_0x33fe04(0x10f),'command':'create','description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a150_0x33fe04(0x12c),'flags':[{'name':a150_0x33fe04(0x123),'type':a150_0x33fe04(0x10d),'description':a150_0x33fe04(0x114)},{'name':'db-id','type':a150_0x33fe04(0x10a),'description':a150_0x33fe04(0x135)},{'name':a150_0x33fe04(0x118),'type':a150_0x33fe04(0x10d),'enum':[a150_0x33fe04(0x10f),a150_0x33fe04(0x13f)],'description':a150_0x33fe04(0x12d)}],async 'validate'(_0x60697){const _0x1cb278=a150_0x33fe04;if(!_0x60697[_0x1cb278(0x13c)])return;if(!_0x60697[_0x1cb278(0x139)](_0x1cb278(0x123))['trim']())throw CliErrors[_0x1cb278(0x138)](_0x1cb278(0x123),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x42e3c3=resolveProvidedDbId(_0x60697);if(typeof _0x42e3c3!==_0x1cb278(0x10a)||!Number[_0x1cb278(0x127)](_0x42e3c3)||_0x42e3c3<=0x0)throw CliErrors[_0x1cb278(0x138)](_0x1cb278(0x11e),_0x1cb278(0x13b));if(!_0x60697['str'](_0x1cb278(0x118))[_0x1cb278(0x129)]())throw CliErrors['flagMissing'](_0x1cb278(0x118),_0x1cb278(0x11d));},async 'dryRun'(_0x4bfcbc){const _0x569c6c=a150_0x33fe04,_0x216756=loadSqlProjectConfig(_0x4bfcbc['appCode']),{sqlName:_0x20598a,dbId:_0x24ce52,dbName:_0x1541a5,mode:_0x4b9a84}=await resolveSqlNewInputs(_0x4bfcbc),_0x305367=buildSqlRelativePath(_0x569c6c(0x143),_0x20598a,_0x1541a5,_0x4b9a84,_0x24ce52),_0x2da3df=_0x216756[_0x569c6c(0x119)]+'/'+_0x305367;return{'method':_0x569c6c(0x148),'url':_0x569c6c(0x144),'body':{'appCode':_0x4bfcbc[_0x569c6c(0x140)],'sqlName':_0x20598a,'dbId':_0x24ce52,'mode':_0x4b9a84,'localPath':_0x2da3df},'description':_0x569c6c(0x115)+_0x216756[_0x569c6c(0x119)]};},async 'execute'(_0x3acf7e){const _0x3a74cf=a150_0x33fe04,_0x391fd5=loadSqlProjectConfig(_0x3acf7e[_0x3a74cf(0x140)]),{sqlName:_0x244db6,dbId:_0x28761d,dbName:_0x46382c,mode:_0x33ff85}=await resolveSqlNewInputs(_0x3acf7e),_0x552578=generateSqlTemplate(_0x33ff85),_0x553065=await createSqlQuery({'appCode':_0x3acf7e['appCode'],'sqlName':_0x244db6,'dbId':_0x28761d,'sqlContent':_0x552578}),_0x4df0cc=ensureRemoteSqlContent(_0x553065),_0x43ba4b=_0x46382c||await getDbName(_0x3acf7e['appCode'],_0x28761d)[_0x3a74cf(0x11a)](()=>undefined),_0x4f7f05=buildSqlRelativePath(_0x553065['sqlCode'],_0x553065[_0x3a74cf(0x132)],_0x43ba4b,_0x33ff85,_0x28761d),_0x37e996=_0x391fd5[_0x3a74cf(0x119)]+'/'+_0x4f7f05,_0x2a05b0=buildLocalSqlFileContent({'sqlCode':_0x553065[_0x3a74cf(0x137)],'sqlName':_0x553065['sqlName'],'dbId':_0x553065[_0x3a74cf(0x120)]},_0x4df0cc,{'dbName':_0x43ba4b,'mode':_0x33ff85,'syncedAt':new Date()['toISOString'](),'description':_0x553065[_0x3a74cf(0x141)]});if(await fileExists(_0x37e996))throw CliErrors[_0x3a74cf(0x130)](_0x3a74cf(0x128)+_0x37e996);await ensureParentDirectory(_0x37e996),await writeFile(_0x37e996,_0x2a05b0,'utf8');const _0x10af88=await readSqlLockFile(_0x391fd5[_0x3a74cf(0x13d)]),{lockData:_0x134f49,appLock:_0x873a55}=ensureSqlLockScope(_0x10af88??createEmptySqlLock(),_0x391fd5['appCode'],_0x391fd5[_0x3a74cf(0x125)],_0x3a74cf(0x112));return _0x873a55[_0x3a74cf(0x145)][_0x553065[_0x3a74cf(0x137)]]={...buildSqlLockEntry(_0x553065,_0x4df0cc,computeSqlContentHash(_0x2a05b0),{'dbName':_0x43ba4b}),'path':_0x4f7f05,'mode':_0x33ff85},_0x873a55[_0x3a74cf(0x136)]=new Date()[_0x3a74cf(0x10c)](),await writeSqlLockFile(_0x391fd5[_0x3a74cf(0x13d)],_0x134f49),{'ok':!![],'data':{'id':_0x553065['id'],'sqlCode':_0x553065['sqlCode'],'sqlName':_0x553065[_0x3a74cf(0x132)],'dbId':_0x553065[_0x3a74cf(0x120)],'path':_0x37e996,'mode':_0x33ff85},'message':_0x3a74cf(0x12b)+_0x553065[_0x3a74cf(0x137)]};}};async function resolveSqlNewInputs(_0x452f1b){const _0x1d6505=await resolveSqlNameInput(_0x452f1b),{dbId:_0x295e43,dbName:_0x48d49b}=await resolveDbSelection(_0x452f1b),_0x41cdbf=await resolveSqlModeInput(_0x452f1b);return{'sqlName':_0x1d6505,'dbId':_0x295e43,'dbName':_0x48d49b,'mode':_0x41cdbf};}async function resolveSqlNameInput(_0x242f27){const _0x54950d=a150_0x33fe04,_0x57b0b2=_0x242f27[_0x54950d(0x139)]('name')[_0x54950d(0x129)]();if(_0x57b0b2)return _0x57b0b2;if(_0x242f27[_0x54950d(0x13c)])throw CliErrors[_0x54950d(0x138)](_0x54950d(0x123),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':_0x54950d(0x116),'validate':_0x31deff=>_0x31deff[_0x54950d(0x129)]()?!![]:_0x54950d(0x10e)}))[_0x54950d(0x129)]();}async function resolveDbSelection(_0x23e716){const _0x2958aa=a150_0x33fe04,_0x3ff1fa=resolveProvidedDbId(_0x23e716);if(typeof _0x3ff1fa===_0x2958aa(0x10a)&&Number[_0x2958aa(0x127)](_0x3ff1fa)&&_0x3ff1fa>0x0)return{'dbId':_0x3ff1fa,'dbName':await getDbName(_0x23e716[_0x2958aa(0x140)],_0x3ff1fa)['catch'](()=>undefined)};if(_0x23e716[_0x2958aa(0x13c)])throw CliErrors[_0x2958aa(0x138)]('db-id',_0x2958aa(0x13b));const _0x5e312e=await listDatabases(_0x23e716[_0x2958aa(0x140)])[_0x2958aa(0x11a)](()=>[]);if(_0x5e312e[_0x2958aa(0x111)]===0x1)return{'dbId':_0x5e312e[0x0][_0x2958aa(0x120)],'dbName':_0x5e312e[0x0]['dbName']};if(_0x5e312e[_0x2958aa(0x111)]>0x1){const _0x55577f=await select({'message':_0x2958aa(0x126),'choices':[..._0x5e312e[_0x2958aa(0x149)](_0x1f0991=>({'name':_0x1f0991['dbName']+'\x20('+_0x1f0991[_0x2958aa(0x120)]+')','value':serializeDbSelection(_0x1f0991)})),{'name':'✎\x20手动输入\x20dbId','value':'__manual__'}]});if(_0x55577f!==_0x2958aa(0x11b))return deserializeDbSelection(_0x55577f);}const _0x5ed04f=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x40b798=>{const _0x253052=_0x2958aa,_0x38f329=_0x40b798[_0x253052(0x129)]();if(!_0x38f329)return _0x253052(0x146);const _0x557ad8=Number(_0x38f329);if(!Number['isInteger'](_0x557ad8)||_0x557ad8<=0x0)return _0x253052(0x13a);return!![];}});return{'dbId':Number(_0x5ed04f['trim']())};}function a150_0x1543(_0x4a5358,_0x35569b){_0x4a5358=_0x4a5358-0x10a;const _0x55d8dd=a150_0x55d8();let _0x1543f8=_0x55d8dd[_0x4a5358];return _0x1543f8;}async function resolveSqlModeInput(_0x2b8f65){const _0x4f524c=a150_0x33fe04,_0x14de6f=_0x2b8f65[_0x4f524c(0x139)](_0x4f524c(0x118))[_0x4f524c(0x129)]();if(_0x14de6f===_0x4f524c(0x10f)||_0x14de6f===_0x4f524c(0x13f))return _0x14de6f;if(_0x2b8f65[_0x4f524c(0x13c)])throw CliErrors[_0x4f524c(0x138)](_0x4f524c(0x118),_0x4f524c(0x11d));return await select({'message':_0x4f524c(0x113),'choices':[{'name':'普通\x20SQL(sql)','value':_0x4f524c(0x10f),'description':_0x4f524c(0x133)},{'name':_0x4f524c(0x14b),'value':_0x4f524c(0x13f),'description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function serializeDbSelection(_0x48f1d9){const _0x4e68c2=a150_0x33fe04;return JSON['stringify']({'dbId':_0x48f1d9[_0x4e68c2(0x120)],'dbName':_0x48f1d9[_0x4e68c2(0x12e)]});}function deserializeDbSelection(_0x272332){const _0x44bd2b=a150_0x33fe04;try{const _0xada654=JSON[_0x44bd2b(0x10b)](_0x272332);if(typeof _0xada654['dbId']==='number'&&Number[_0x44bd2b(0x127)](_0xada654[_0x44bd2b(0x120)]))return{'dbId':_0xada654['dbId'],'dbName':_0xada654[_0x44bd2b(0x12e)]};}catch{}throw CliErrors[_0x44bd2b(0x130)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x272332);}function resolveProvidedDbId(_0x2894a2){const _0x5ba3e0=a150_0x33fe04,_0xaaf422=_0x2894a2[_0x5ba3e0(0x117)]('db-id');if(typeof _0xaaf422===_0x5ba3e0(0x10a)&&Number['isFinite'](_0xaaf422))return _0xaaf422;return undefined;}
@@ -1 +1 @@
1
- const a151_0x274b89=a151_0x3867;(function(_0x122f06,_0x5763d0){const _0x30f956=a151_0x3867,_0x1ec024=_0x122f06();while(!![]){try{const _0x5e24e4=-parseInt(_0x30f956(0x1bc))/0x1+-parseInt(_0x30f956(0x1b2))/0x2*(parseInt(_0x30f956(0x1c6))/0x3)+parseInt(_0x30f956(0x1a1))/0x4+parseInt(_0x30f956(0x1bb))/0x5+parseInt(_0x30f956(0x1ae))/0x6*(parseInt(_0x30f956(0x1aa))/0x7)+-parseInt(_0x30f956(0x1c0))/0x8+parseInt(_0x30f956(0x1a8))/0x9*(parseInt(_0x30f956(0x1c3))/0xa);if(_0x5e24e4===_0x5763d0)break;else _0x1ec024['push'](_0x1ec024['shift']());}catch(_0x475cf1){_0x1ec024['push'](_0x1ec024['shift']());}}}(a151_0x27c7,0x74570));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';function a151_0x27c7(){const _0x5744c4=['fromEntries','entries','filter','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','615885VcWZGl','475590uWICtG','trashDir','Would\x20delete\x20SQL\x20','sqlcode','5042240dStcEp','appCode','sqlRoot','80NYfXmT','startsWith','sql','387LAdeNL','1269700PRrlBR','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','lockFilePath','validation','str','toISOString','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','675522yuCbjf','lastSync','186291YdBYLL','delete','\x20(local\x20file\x20moved\x20to\x20trash)','SQL\x20lock\x20file\x20not\x20found.','186UVKxSg','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','trashedTo','remoteId','4398yqdrKU','POST','/smartapi/custom/deleteUserCustomSql','Deleted\x20','sqls'];a151_0x27c7=function(){return _0x5744c4;};return a151_0x27c7();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';function a151_0x3867(_0x44f08c,_0x407528){_0x44f08c=_0x44f08c-0x1a1;const _0x27c788=a151_0x27c7();let _0x3867c6=_0x27c788[_0x44f08c];return _0x3867c6;}import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a151_0x274b89(0x1c5),'command':a151_0x274b89(0x1ab),'description':a151_0x274b89(0x1af),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x4cf17a){const _0x1c4d8d=a151_0x274b89,_0x3dd630=loadSqlProjectConfig(_0x4cf17a[_0x1c4d8d(0x1c1)]),_0x2b8847=await readSqlLockFile(_0x3dd630['lockFilePath']);if(!_0x2b8847)throw CliErrors[_0x1c4d8d(0x1a4)](_0x1c4d8d(0x1a7));},async 'dryRun'(_0x3491d5){const _0x26cf2b=a151_0x274b89,_0x39bcda=loadSqlProjectConfig(_0x3491d5[_0x26cf2b(0x1c1)]),_0x513295=await readSqlLockFile(_0x39bcda[_0x26cf2b(0x1a3)]);if(!_0x513295)throw CliErrors[_0x26cf2b(0x1a4)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x3fe79a}=ensureSqlLockScope(_0x513295,_0x3491d5[_0x26cf2b(0x1c1)],_0x39bcda[_0x26cf2b(0x1c2)],'delete'),_0x2bdf15=_0x3491d5[_0x26cf2b(0x1a5)](_0x26cf2b(0x1bf)),_0x5463a0=_0x3fe79a['sqls'][_0x2bdf15];if(!_0x5463a0)throw CliErrors[_0x26cf2b(0x1a4)](_0x26cf2b(0x1ba)+_0x2bdf15+'\x22.');return{'method':_0x26cf2b(0x1b3),'url':_0x26cf2b(0x1b4),'body':{'sqlCode':_0x2bdf15,'id':_0x5463a0[_0x26cf2b(0x1b1)],'localPath':resolveLocalSqlFilePath(_0x39bcda,_0x2bdf15,_0x5463a0)},'description':_0x26cf2b(0x1be)+_0x2bdf15+_0x26cf2b(0x1a2)+_0x39bcda[_0x26cf2b(0x1bd)]};},async 'execute'(_0x442a0d){const _0x35c0d7=a151_0x274b89,_0x3f8f9f=loadSqlProjectConfig(_0x442a0d['appCode']),_0x5707b3=await readSqlLockFile(_0x3f8f9f[_0x35c0d7(0x1a3)]);if(!_0x5707b3)throw CliErrors[_0x35c0d7(0x1a4)](_0x35c0d7(0x1ad));const {lockData:_0x15befd,appLock:_0x5f5a6a}=ensureSqlLockScope(_0x5707b3,_0x442a0d[_0x35c0d7(0x1c1)],_0x3f8f9f[_0x35c0d7(0x1c2)],_0x35c0d7(0x1ab)),_0x1e2588=_0x442a0d[_0x35c0d7(0x1a5)](_0x35c0d7(0x1bf)),_0xc33d5b=_0x5f5a6a[_0x35c0d7(0x1b6)][_0x1e2588];if(!_0xc33d5b)throw CliErrors[_0x35c0d7(0x1a4)](_0x35c0d7(0x1ba)+_0x1e2588+'\x22.');await deleteSqlQuery({'id':_0xc33d5b[_0x35c0d7(0x1b1)],'sqlCode':_0x1e2588}),_0x5f5a6a[_0x35c0d7(0x1b6)]=Object[_0x35c0d7(0x1b7)](Object[_0x35c0d7(0x1b8)](_0x5f5a6a[_0x35c0d7(0x1b6)])[_0x35c0d7(0x1b9)](([_0x37cecc])=>_0x37cecc!==_0x1e2588)),_0x5f5a6a[_0x35c0d7(0x1a9)]=new Date()['toISOString'](),await writeSqlLockFile(_0x3f8f9f[_0x35c0d7(0x1a3)],_0x15befd);const _0x2ed34c=resolveLocalSqlFilePath(_0x3f8f9f,_0x1e2588,_0xc33d5b);let _0x439a4d;await fileExists(_0x2ed34c)&&(_0x439a4d=await moveToTrash(_0x3f8f9f['projectRoot'],_0x3f8f9f['trashDir'],_0x2ed34c),await cleanupEmptyDirectories(dirname(_0x2ed34c),_0x3f8f9f['sqlRootDir']));const _0x164c9b={'deleted':_0x1e2588,'remoteId':_0xc33d5b[_0x35c0d7(0x1b1)]};if(_0x439a4d)_0x164c9b[_0x35c0d7(0x1b0)]=_0x439a4d;return{'ok':!![],'data':_0x164c9b,'message':_0x35c0d7(0x1b5)+_0x1e2588+(_0x439a4d?_0x35c0d7(0x1ac):'')};}};async function moveToTrash(_0x185c3b,_0x3f504f,_0x4d995a){const _0x10742c=a151_0x274b89,_0x27279d=new Date()[_0x10742c(0x1a6)]()['replace'](/[:.]/g,'-'),_0x5a1580=relative(_0x185c3b,_0x4d995a),_0x66febe=join(_0x3f504f,_0x27279d,_0x5a1580);return await mkdir(dirname(_0x66febe),{'recursive':!![]}),await rename(_0x4d995a,_0x66febe),_0x66febe;}async function cleanupEmptyDirectories(_0x35d409,_0x301204){const _0x22b156=a151_0x274b89;let _0x1f2839=resolve(_0x35d409);const _0x39675f=resolve(_0x301204);while(_0x1f2839[_0x22b156(0x1c4)](''+_0x39675f+sep)||_0x1f2839===_0x39675f){if(_0x1f2839===_0x39675f)return;try{const _0x1d3ad1=await readdir(_0x1f2839);if(_0x1d3ad1['length']>0x0)return;await rmdir(_0x1f2839);}catch{return;}_0x1f2839=dirname(_0x1f2839);}}
1
+ const a151_0x20fa3e=a151_0x3a1d;(function(_0x403ef4,_0x5196fd){const _0x5c08c0=a151_0x3a1d,_0x1d6c45=_0x403ef4();while(!![]){try{const _0x598453=parseInt(_0x5c08c0(0xf2))/0x1*(parseInt(_0x5c08c0(0xd7))/0x2)+-parseInt(_0x5c08c0(0xe7))/0x3*(parseInt(_0x5c08c0(0xd6))/0x4)+-parseInt(_0x5c08c0(0xdf))/0x5+parseInt(_0x5c08c0(0xf4))/0x6*(parseInt(_0x5c08c0(0xed))/0x7)+parseInt(_0x5c08c0(0xda))/0x8*(-parseInt(_0x5c08c0(0xfa))/0x9)+parseInt(_0x5c08c0(0xe5))/0xa+parseInt(_0x5c08c0(0xe2))/0xb;if(_0x598453===_0x5196fd)break;else _0x1d6c45['push'](_0x1d6c45['shift']());}catch(_0x511a19){_0x1d6c45['push'](_0x1d6c45['shift']());}}}(a151_0x4fdd,0x3cbbc));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';function a151_0x3a1d(_0x207b83,_0x3ce6f6){_0x207b83=_0x207b83-0xd5;const _0x4fdd10=a151_0x4fdd();let _0x3a1daa=_0x4fdd10[_0x207b83];return _0x3a1daa;}import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a151_0x4fdd(){const _0x4ddf98=['fromEntries','829xCMDMt','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','6hOJdPZ','lastSync','sqlRootDir','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','sqlRoot','trashedTo','1344267vUqFMh','Would\x20delete\x20SQL\x20','entries','sqls','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','validation','lockFilePath','12aJSbUk','242rqSoJq','toISOString','\x20(local\x20file\x20moved\x20to\x20trash)','8PzywgL','trashDir','SQL\x20lock\x20file\x20not\x20found.','appCode','/smartapi/custom/deleteUserCustomSql','1426210TPQsHo','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','delete','4521165EUcvhx','remoteId','replace','4324350xTUGKy','startsWith','363021ioYAEv','high-risk-write','str','Deleted\x20','projectRoot','POST','718417RMOFKt','sqlcode','sql','length'];a151_0x4fdd=function(){return _0x4ddf98;};return a151_0x4fdd();}export const sqlDelete={'service':a151_0x20fa3e(0xef),'command':a151_0x20fa3e(0xe1),'description':a151_0x20fa3e(0xf3),'risk':a151_0x20fa3e(0xe8),'flags':[SQLCODE_FLAG],async 'validate'(_0x2aaaae){const _0x38e211=a151_0x20fa3e,_0x54b6a8=loadSqlProjectConfig(_0x2aaaae[_0x38e211(0xdd)]),_0x22554f=await readSqlLockFile(_0x54b6a8[_0x38e211(0xd5)]);if(!_0x22554f)throw CliErrors[_0x38e211(0xff)](_0x38e211(0xf7));},async 'dryRun'(_0x26499d){const _0x5e4670=a151_0x20fa3e,_0x3f566d=loadSqlProjectConfig(_0x26499d[_0x5e4670(0xdd)]),_0x2469d6=await readSqlLockFile(_0x3f566d[_0x5e4670(0xd5)]);if(!_0x2469d6)throw CliErrors[_0x5e4670(0xff)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x3e53ff}=ensureSqlLockScope(_0x2469d6,_0x26499d['appCode'],_0x3f566d[_0x5e4670(0xf8)],_0x5e4670(0xe1)),_0x1f1e6e=_0x26499d['str'](_0x5e4670(0xee)),_0xe5de3a=_0x3e53ff['sqls'][_0x1f1e6e];if(!_0xe5de3a)throw CliErrors[_0x5e4670(0xff)](_0x5e4670(0xe0)+_0x1f1e6e+'\x22.');return{'method':_0x5e4670(0xec),'url':_0x5e4670(0xde),'body':{'sqlCode':_0x1f1e6e,'id':_0xe5de3a[_0x5e4670(0xe3)],'localPath':resolveLocalSqlFilePath(_0x3f566d,_0x1f1e6e,_0xe5de3a)},'description':_0x5e4670(0xfb)+_0x1f1e6e+_0x5e4670(0xfe)+_0x3f566d[_0x5e4670(0xdb)]};},async 'execute'(_0x461557){const _0x14d53c=a151_0x20fa3e,_0x1c7ca3=loadSqlProjectConfig(_0x461557['appCode']),_0x5d540f=await readSqlLockFile(_0x1c7ca3['lockFilePath']);if(!_0x5d540f)throw CliErrors[_0x14d53c(0xff)](_0x14d53c(0xdc));const {lockData:_0x434e0f,appLock:_0x2f63c1}=ensureSqlLockScope(_0x5d540f,_0x461557[_0x14d53c(0xdd)],_0x1c7ca3[_0x14d53c(0xf8)],_0x14d53c(0xe1)),_0x11b780=_0x461557[_0x14d53c(0xe9)](_0x14d53c(0xee)),_0xfab13f=_0x2f63c1[_0x14d53c(0xfd)][_0x11b780];if(!_0xfab13f)throw CliErrors[_0x14d53c(0xff)](_0x14d53c(0xe0)+_0x11b780+'\x22.');await deleteSqlQuery({'id':_0xfab13f['remoteId'],'sqlCode':_0x11b780}),_0x2f63c1[_0x14d53c(0xfd)]=Object[_0x14d53c(0xf1)](Object[_0x14d53c(0xfc)](_0x2f63c1[_0x14d53c(0xfd)])['filter'](([_0x28ec61])=>_0x28ec61!==_0x11b780)),_0x2f63c1[_0x14d53c(0xf5)]=new Date()['toISOString'](),await writeSqlLockFile(_0x1c7ca3['lockFilePath'],_0x434e0f);const _0x4fc812=resolveLocalSqlFilePath(_0x1c7ca3,_0x11b780,_0xfab13f);let _0x2eee32;await fileExists(_0x4fc812)&&(_0x2eee32=await moveToTrash(_0x1c7ca3[_0x14d53c(0xeb)],_0x1c7ca3[_0x14d53c(0xdb)],_0x4fc812),await cleanupEmptyDirectories(dirname(_0x4fc812),_0x1c7ca3[_0x14d53c(0xf6)]));const _0x586d98={'deleted':_0x11b780,'remoteId':_0xfab13f[_0x14d53c(0xe3)]};if(_0x2eee32)_0x586d98[_0x14d53c(0xf9)]=_0x2eee32;return{'ok':!![],'data':_0x586d98,'message':_0x14d53c(0xea)+_0x11b780+(_0x2eee32?_0x14d53c(0xd9):'')};}};async function moveToTrash(_0x3848f,_0x5a2b30,_0x30c901){const _0x50a522=a151_0x20fa3e,_0x481866=new Date()[_0x50a522(0xd8)]()[_0x50a522(0xe4)](/[:.]/g,'-'),_0x5b32e6=relative(_0x3848f,_0x30c901),_0x3e1c04=join(_0x5a2b30,_0x481866,_0x5b32e6);return await mkdir(dirname(_0x3e1c04),{'recursive':!![]}),await rename(_0x30c901,_0x3e1c04),_0x3e1c04;}async function cleanupEmptyDirectories(_0x3eca96,_0x4053cd){const _0x57435b=a151_0x20fa3e;let _0x10f312=resolve(_0x3eca96);const _0x3ecbc2=resolve(_0x4053cd);while(_0x10f312[_0x57435b(0xe6)](''+_0x3ecbc2+sep)||_0x10f312===_0x3ecbc2){if(_0x10f312===_0x3ecbc2)return;try{const _0x15deb5=await readdir(_0x10f312);if(_0x15deb5[_0x57435b(0xf0)]>0x0)return;await rmdir(_0x10f312);}catch{return;}_0x10f312=dirname(_0x10f312);}}
@@ -1 +1 @@
1
- const a152_0x1e107e=a152_0x423b;(function(_0x5612ff,_0x24333f){const _0x460f8a=a152_0x423b,_0x13b00a=_0x5612ff();while(!![]){try{const _0x2d5d81=-parseInt(_0x460f8a(0xd2))/0x1*(-parseInt(_0x460f8a(0xe5))/0x2)+-parseInt(_0x460f8a(0xdb))/0x3+-parseInt(_0x460f8a(0xe1))/0x4*(-parseInt(_0x460f8a(0xe0))/0x5)+-parseInt(_0x460f8a(0xe3))/0x6*(parseInt(_0x460f8a(0xd4))/0x7)+-parseInt(_0x460f8a(0xdc))/0x8*(-parseInt(_0x460f8a(0xdf))/0x9)+-parseInt(_0x460f8a(0xe7))/0xa*(-parseInt(_0x460f8a(0xd3))/0xb)+-parseInt(_0x460f8a(0xd6))/0xc;if(_0x2d5d81===_0x24333f)break;else _0x13b00a['push'](_0x13b00a['shift']());}catch(_0x1e28b5){_0x13b00a['push'](_0x13b00a['shift']());}}}(a152_0x3b9f,0xd5709));function a152_0x423b(_0x378fa3,_0x27e89f){_0x378fa3=_0x378fa3-0xce;const _0x3b9f86=a152_0x3b9f();let _0x423b26=_0x3b9f86[_0x378fa3];return _0x423b26;}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a152_0x3b9f(){const _0x275ee6=['430TuOCbz','boolean','dbId','verbose','bool','24YaLzqq','370546WPWeML','5634895zhmBae','description','23338548enWsmV','str','sql','Return\x20full\x20raw\x20SQL\x20query\x20object','read','2218452cfbPUZ','480304geTERp','sqlCode','appCode','207zuzDGz','58570OfAHDf','244AtRYme','sqlcode','12GZVMzf','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','135388MNIzPZ','sqlName'];a152_0x3b9f=function(){return _0x275ee6;};return a152_0x3b9f();}export const sqlDetail={'service':a152_0x1e107e(0xd8),'command':'detail','description':a152_0x1e107e(0xe4),'risk':a152_0x1e107e(0xda),'flags':[SQLCODE_FLAG,{'name':a152_0x1e107e(0xd0),'type':a152_0x1e107e(0xce),'description':a152_0x1e107e(0xd9)}],async 'execute'(_0x59c657){const _0x3e500d=a152_0x1e107e,_0x4a8a77=await getSqlQueryInfo(_0x59c657['appCode'],_0x59c657[_0x3e500d(0xd7)](_0x3e500d(0xe2))),_0x25a054=_0x59c657[_0x3e500d(0xd1)](_0x3e500d(0xd0));if(_0x25a054)return{'ok':!![],'data':_0x4a8a77};const _0x5855c2=_0x4a8a77['dbId']?await getDbName(_0x59c657[_0x3e500d(0xde)],_0x4a8a77[_0x3e500d(0xcf)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x4a8a77[_0x3e500d(0xdd)],'sqlName':_0x4a8a77[_0x3e500d(0xe6)],'db':_0x5855c2?_0x5855c2+'\x20('+_0x4a8a77[_0x3e500d(0xcf)]+')':_0x4a8a77[_0x3e500d(0xcf)]??'','description':_0x4a8a77[_0x3e500d(0xd5)]??'','sqlContent':_0x4a8a77['sqlContent']??''}};}};
1
+ const a152_0x591544=a152_0x486a;(function(_0x554df4,_0x124d7a){const _0x156436=a152_0x486a,_0x1f19a9=_0x554df4();while(!![]){try{const _0x246647=-parseInt(_0x156436(0x123))/0x1*(-parseInt(_0x156436(0x128))/0x2)+-parseInt(_0x156436(0x124))/0x3*(-parseInt(_0x156436(0x121))/0x4)+parseInt(_0x156436(0x125))/0x5*(parseInt(_0x156436(0x115))/0x6)+-parseInt(_0x156436(0x120))/0x7*(-parseInt(_0x156436(0x117))/0x8)+parseInt(_0x156436(0x114))/0x9*(-parseInt(_0x156436(0x113))/0xa)+parseInt(_0x156436(0x116))/0xb*(-parseInt(_0x156436(0x112))/0xc)+-parseInt(_0x156436(0x11b))/0xd*(parseInt(_0x156436(0x11e))/0xe);if(_0x246647===_0x124d7a)break;else _0x1f19a9['push'](_0x1f19a9['shift']());}catch(_0x4a2394){_0x1f19a9['push'](_0x1f19a9['shift']());}}}(a152_0x1036,0x33072));function a152_0x486a(_0x3ed5c8,_0x172b35){_0x3ed5c8=_0x3ed5c8-0x111;const _0x10364b=a152_0x1036();let _0x486a66=_0x10364b[_0x3ed5c8];return _0x486a66;}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a152_0x1036(){const _0x16e2b5=['detail','bool','268SXcAad','sqlName','12IbmAtV','49270ZbxKwe','603TDjHvO','5034Cvnuki','2037508wknIBb','402936zIMnFU','description','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','dbId','39HtZMyw','verbose','Return\x20full\x20raw\x20SQL\x20query\x20object','982996rtdUFv','sqlcode','49ANJEDv','3972iroOtx','appCode','1827WXWGzg','39QBQgWk','1935aUapyO'];a152_0x1036=function(){return _0x16e2b5;};return a152_0x1036();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a152_0x591544(0x126),'description':a152_0x591544(0x119),'risk':'read','flags':[SQLCODE_FLAG,{'name':a152_0x591544(0x11c),'type':'boolean','description':a152_0x591544(0x11d)}],async 'execute'(_0x1238f3){const _0x333b74=a152_0x591544,_0x1b1c22=await getSqlQueryInfo(_0x1238f3[_0x333b74(0x122)],_0x1238f3['str'](_0x333b74(0x11f))),_0x221dd2=_0x1238f3[_0x333b74(0x127)]('verbose');if(_0x221dd2)return{'ok':!![],'data':_0x1b1c22};const _0x106f1d=_0x1b1c22[_0x333b74(0x11a)]?await getDbName(_0x1238f3[_0x333b74(0x122)],_0x1b1c22[_0x333b74(0x11a)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x1b1c22['sqlCode'],'sqlName':_0x1b1c22[_0x333b74(0x111)],'db':_0x106f1d?_0x106f1d+'\x20('+_0x1b1c22[_0x333b74(0x11a)]+')':_0x1b1c22[_0x333b74(0x11a)]??'','description':_0x1b1c22[_0x333b74(0x118)]??'','sqlContent':_0x1b1c22['sqlContent']??''}};}};
@@ -1 +1 @@
1
- const a153_0x35c26d=a153_0x5e11;function a153_0x5e11(_0x35e698,_0x427cdf){_0x35e698=_0x35e698-0x132;const _0x122155=a153_0x1221();let _0x5e1126=_0x122155[_0x35e698];return _0x5e1126;}(function(_0x10facc,_0x590f71){const _0x5a97b2=a153_0x5e11,_0x2ecea6=_0x10facc();while(!![]){try{const _0x4b3a48=-parseInt(_0x5a97b2(0x144))/0x1*(parseInt(_0x5a97b2(0x137))/0x2)+parseInt(_0x5a97b2(0x147))/0x3+parseInt(_0x5a97b2(0x148))/0x4*(-parseInt(_0x5a97b2(0x13b))/0x5)+parseInt(_0x5a97b2(0x149))/0x6*(-parseInt(_0x5a97b2(0x13d))/0x7)+-parseInt(_0x5a97b2(0x138))/0x8*(parseInt(_0x5a97b2(0x13a))/0x9)+-parseInt(_0x5a97b2(0x135))/0xa*(-parseInt(_0x5a97b2(0x136))/0xb)+parseInt(_0x5a97b2(0x13f))/0xc;if(_0x4b3a48===_0x590f71)break;else _0x2ecea6['push'](_0x2ecea6['shift']());}catch(_0x2dda98){_0x2ecea6['push'](_0x2ecea6['shift']());}}}(a153_0x1221,0xe4d78));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a153_0x1221(){const _0x10f925=['2090GrDozn','8874YoNTQb','88RjvAit','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','1153971nWtGKx','35PdtWrI','\x20row(s)\x20in\x20','2816107evsthY','Returned\x20','37413048TXhZUf','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','isArray','appCode','length','98rNYSQy','execError','execResult','2384658sJwHep','870456pHfpUP','6iOZdWf','string','now','exec','str','params','execSuccess','SQL\x20execution\x20failed','sqlcode','41870pxcfkB'];a153_0x1221=function(){return _0x10f925;};return a153_0x1221();}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':a153_0x35c26d(0x14c),'description':a153_0x35c26d(0x139),'risk':'read','flags':[SQLCODE_FLAG,{'name':a153_0x35c26d(0x14e),'type':a153_0x35c26d(0x14a),'description':a153_0x35c26d(0x140)}],async 'execute'(_0x168d4c){const _0x435dd3=a153_0x35c26d,_0x387738=parseJsonParams(_0x168d4c[_0x435dd3(0x14d)](_0x435dd3(0x14e))),_0x2ae152=Date[_0x435dd3(0x14b)](),_0x1b3b68=await executeSql(_0x168d4c[_0x435dd3(0x142)],_0x168d4c['str'](_0x435dd3(0x134)),_0x387738),_0x1a1cf9=Date[_0x435dd3(0x14b)]()-_0x2ae152,_0x15ae36=_0x1b3b68?.[_0x435dd3(0x146)]??_0x1b3b68,_0x450d5e=_0x1b3b68?.[_0x435dd3(0x132)]??!![];if(!_0x450d5e)return{'ok':![],'data':{'error':_0x1b3b68?.[_0x435dd3(0x145)]||'SQL\x20execution\x20failed','elapsed':_0x1a1cf9},'message':_0x435dd3(0x133)};const _0x4f00a3=Array[_0x435dd3(0x141)](_0x15ae36)?_0x15ae36:[];return{'ok':!![],'data':{'rows':_0x4f00a3,'rowCount':_0x4f00a3[_0x435dd3(0x143)],'elapsed':_0x1a1cf9},'message':_0x435dd3(0x13e)+_0x4f00a3['length']+_0x435dd3(0x13c)+_0x1a1cf9+'ms'};}};
1
+ const a153_0x440a94=a153_0x350c;function a153_0x5164(){const _0x49b0b6=['99xLuTRx','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','str','272mrQJQf','80022zRgdvH','1189567CSoVvL','Returned\x20','7260520XKYRMp','511EqaZsj','22444930hhVdZf','execError','62412ziEgca','length','params','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','exec','now','read','sql','string','execResult','43623zhXBoU','2953144EKZsqd','SQL\x20execution\x20failed','execSuccess','appCode'];a153_0x5164=function(){return _0x49b0b6;};return a153_0x5164();}(function(_0x5ded01,_0x616894){const _0x551797=a153_0x350c,_0xbb65b5=_0x5ded01();while(!![]){try{const _0x2d62ee=-parseInt(_0x551797(0xce))/0x1+parseInt(_0x551797(0xdf))/0x2+-parseInt(_0x551797(0xc9))/0x3*(-parseInt(_0x551797(0xd4))/0x4)+-parseInt(_0x551797(0xd0))/0x5+parseInt(_0x551797(0xcd))/0x6*(-parseInt(_0x551797(0xd1))/0x7)+-parseInt(_0x551797(0xcc))/0x8*(-parseInt(_0x551797(0xde))/0x9)+parseInt(_0x551797(0xd2))/0xa;if(_0x2d62ee===_0x616894)break;else _0xbb65b5['push'](_0xbb65b5['shift']());}catch(_0x129591){_0xbb65b5['push'](_0xbb65b5['shift']());}}}(a153_0x5164,0xbfc52));function a153_0x350c(_0x247617,_0x112044){_0x247617=_0x247617-0xc9;const _0x516459=a153_0x5164();let _0x350c9c=_0x516459[_0x247617];return _0x350c9c;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a153_0x440a94(0xdb),'command':a153_0x440a94(0xd8),'description':a153_0x440a94(0xca),'risk':a153_0x440a94(0xda),'flags':[SQLCODE_FLAG,{'name':a153_0x440a94(0xd6),'type':a153_0x440a94(0xdc),'description':a153_0x440a94(0xd7)}],async 'execute'(_0x3f5fe4){const _0x1b993f=a153_0x440a94,_0x39480a=parseJsonParams(_0x3f5fe4[_0x1b993f(0xcb)](_0x1b993f(0xd6))),_0xd04311=Date[_0x1b993f(0xd9)](),_0xac3c20=await executeSql(_0x3f5fe4[_0x1b993f(0xe2)],_0x3f5fe4[_0x1b993f(0xcb)]('sqlcode'),_0x39480a),_0x4f53b2=Date[_0x1b993f(0xd9)]()-_0xd04311,_0x49abbb=_0xac3c20?.[_0x1b993f(0xdd)]??_0xac3c20,_0x2142c5=_0xac3c20?.[_0x1b993f(0xe1)]??!![];if(!_0x2142c5)return{'ok':![],'data':{'error':_0xac3c20?.[_0x1b993f(0xd3)]||_0x1b993f(0xe0),'elapsed':_0x4f53b2},'message':_0x1b993f(0xe0)};const _0x13e229=Array['isArray'](_0x49abbb)?_0x49abbb:[];return{'ok':!![],'data':{'rows':_0x13e229,'rowCount':_0x13e229[_0x1b993f(0xd5)],'elapsed':_0x4f53b2},'message':_0x1b993f(0xcf)+_0x13e229[_0x1b993f(0xd5)]+'\x20row(s)\x20in\x20'+_0x4f53b2+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x4d1068,_0x4549e1){const _0x45f3df=a154_0x457f,_0x47a9f0=_0x4d1068();while(!![]){try{const _0x5882d0=-parseInt(_0x45f3df(0x8c))/0x1*(-parseInt(_0x45f3df(0x8b))/0x2)+parseInt(_0x45f3df(0x97))/0x3*(parseInt(_0x45f3df(0x91))/0x4)+parseInt(_0x45f3df(0x94))/0x5*(-parseInt(_0x45f3df(0x95))/0x6)+-parseInt(_0x45f3df(0x90))/0x7*(parseInt(_0x45f3df(0x8d))/0x8)+parseInt(_0x45f3df(0x96))/0x9*(-parseInt(_0x45f3df(0x92))/0xa)+-parseInt(_0x45f3df(0x8f))/0xb*(-parseInt(_0x45f3df(0x93))/0xc)+-parseInt(_0x45f3df(0x8e))/0xd;if(_0x5882d0===_0x4549e1)break;else _0x47a9f0['push'](_0x47a9f0['shift']());}catch(_0x51d7b2){_0x47a9f0['push'](_0x47a9f0['shift']());}}}(a154_0x31b9,0x76760));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';function a154_0x457f(_0x323473,_0x6cb72e){_0x323473=_0x323473-0x8b;const _0x31b9be=a154_0x31b9();let _0x457f96=_0x31b9be[_0x323473];return _0x457f96;}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a154_0x31b9(){const _0x278104=['18tdqttq','9ADplVU','12pnDLkA','1897054hbmfdz','1fvrqAe','440168mcVvtD','7452874mTQesw','4857875mZBpeb','91KYWkTt','625832KTGZWn','917090BamIOV','24YWjThW','986855DHsvTr'];a154_0x31b9=function(){return _0x278104;};return a154_0x31b9();}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x372ced,_0x3feed1){const _0xc6e040=a154_0x568c,_0x1fdd3d=_0x372ced();while(!![]){try{const _0x5af2c0=parseInt(_0xc6e040(0x18c))/0x1+-parseInt(_0xc6e040(0x190))/0x2+-parseInt(_0xc6e040(0x189))/0x3*(parseInt(_0xc6e040(0x18a))/0x4)+-parseInt(_0xc6e040(0x18e))/0x5*(-parseInt(_0xc6e040(0x18d))/0x6)+parseInt(_0xc6e040(0x18b))/0x7+-parseInt(_0xc6e040(0x188))/0x8+parseInt(_0xc6e040(0x18f))/0x9;if(_0x5af2c0===_0x3feed1)break;else _0x1fdd3d['push'](_0x1fdd3d['shift']());}catch(_0x26b268){_0x1fdd3d['push'](_0x1fdd3d['shift']());}}}(a154_0xb24f,0xb1912));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a154_0xb24f(){const _0xe89339=['938224nBBdUA','4878864VWLTZN','260556uUgGoj','52oXkzql','368970yqVPue','104605TLTYjC','6jVxBZO','7140305SigXUb','12149856QjsFJS'];a154_0xb24f=function(){return _0xe89339;};return a154_0xb24f();}function a154_0x568c(_0xec22da,_0x579240){_0xec22da=_0xec22da-0x188;const _0xb24fb3=a154_0xb24f();let _0x568cd6=_0xb24fb3[_0xec22da];return _0x568cd6;}import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a155_0x3aa8e4=a155_0x37bf;function a155_0x37bf(_0x367396,_0x43a3c0){_0x367396=_0x367396-0xe4;const _0x50fd15=a155_0x50fd();let _0x37bfbc=_0x50fd15[_0x367396];return _0x37bfbc;}function a155_0x50fd(){const _0x199a61=['Found\x20','840581ZTTjzK','boolean','140874yzibWg','sql','dbId','Filter\x20by\x20SQL\x20name','length','appCode','number','sqlName','string','name','list','53946LRvkxJ','1319656KEQCER','No\x20custom\x20SQL\x20queries\x20found.','paging','page','str','List\x20custom\x20SQL\x20queries','verbose','totalCount','356226RNpKuH','map','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','5110072WRQBWu','1XegROx','sqlcode','1032680yGwZro','Page\x20size','sqlCode','pagesize','bool','tableData'];a155_0x50fd=function(){return _0x199a61;};return a155_0x50fd();}(function(_0x4e55fb,_0x464104){const _0x1014fa=a155_0x37bf,_0x42a041=_0x4e55fb();while(!![]){try{const _0x1bed45=-parseInt(_0x1014fa(0xff))/0x1*(-parseInt(_0x1014fa(0xe7))/0x2)+parseInt(_0x1014fa(0xfb))/0x3+parseInt(_0x1014fa(0xf3))/0x4+parseInt(_0x1014fa(0x101))/0x5+parseInt(_0x1014fa(0xf2))/0x6+parseInt(_0x1014fa(0xe5))/0x7+-parseInt(_0x1014fa(0xfe))/0x8;if(_0x1bed45===_0x464104)break;else _0x42a041['push'](_0x42a041['shift']());}catch(_0x31285c){_0x42a041['push'](_0x42a041['shift']());}}}(a155_0x50fd,0x34b88));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a155_0x3aa8e4(0xe8),'command':a155_0x3aa8e4(0xf1),'description':a155_0x3aa8e4(0xf8),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a155_0x3aa8e4(0xf0),'type':a155_0x3aa8e4(0xef),'description':a155_0x3aa8e4(0xea)},{'name':a155_0x3aa8e4(0xf6),'type':a155_0x3aa8e4(0xed),'description':'Page\x20number','default':0x1},{'name':a155_0x3aa8e4(0x104),'type':a155_0x3aa8e4(0xed),'description':a155_0x3aa8e4(0x102)},{'name':a155_0x3aa8e4(0xf9),'type':a155_0x3aa8e4(0xe6),'description':a155_0x3aa8e4(0xfd)}],async 'execute'(_0x474b89){const _0x4489b1=a155_0x3aa8e4,_0x2a777c=await listSqlQueries(_0x474b89[_0x4489b1(0xec)],{'sqlCode':_0x474b89[_0x4489b1(0xf7)](_0x4489b1(0x100))||undefined,'sqlName':_0x474b89['str'](_0x4489b1(0xf0))||undefined,'currentPage':_0x474b89['num'](_0x4489b1(0xf6)),'pageSize':_0x474b89['num'](_0x4489b1(0x104),0x32)}),_0x4d52f3=_0x474b89[_0x4489b1(0x105)](_0x4489b1(0xf9)),_0x44bb0b=_0x2a777c[_0x4489b1(0x106)]??[],_0x5cc05f=_0x2a777c[_0x4489b1(0xf5)]?.[_0x4489b1(0xfa)]??_0x44bb0b[_0x4489b1(0xeb)];let _0x3eb559;return _0x4d52f3?_0x3eb559=_0x44bb0b:_0x3eb559=await Promise['all'](_0x44bb0b[_0x4489b1(0xfc)](async _0x4e94f8=>{const _0x2d4a63=_0x4489b1;let _0x447804;try{_0x447804=_0x4e94f8[_0x2d4a63(0xe9)]?await getDbName(_0x474b89[_0x2d4a63(0xec)],_0x4e94f8[_0x2d4a63(0xe9)]):undefined;}catch{}return{'sqlCode':_0x4e94f8[_0x2d4a63(0x103)],'sqlName':_0x4e94f8[_0x2d4a63(0xee)],'description':_0x4e94f8['description']??'','db':_0x447804?_0x447804+'\x20('+_0x4e94f8['dbId']+')':_0x4e94f8['dbId']??''};})),{'ok':!![],'data':_0x3eb559,'message':_0x44bb0b[_0x4489b1(0xeb)]===0x0?_0x4489b1(0xf4):_0x4489b1(0xe4)+_0x44bb0b[_0x4489b1(0xeb)]+'\x20SQL\x20queries\x20(total:\x20'+_0x5cc05f+').'};}};
1
+ const a155_0x1500c2=a155_0x25c0;(function(_0x4691e6,_0x54f7eb){const _0x19c02f=a155_0x25c0,_0x3b28d3=_0x4691e6();while(!![]){try{const _0x4fd6f1=-parseInt(_0x19c02f(0x14f))/0x1*(parseInt(_0x19c02f(0x144))/0x2)+-parseInt(_0x19c02f(0x142))/0x3*(parseInt(_0x19c02f(0x13d))/0x4)+-parseInt(_0x19c02f(0x13c))/0x5*(parseInt(_0x19c02f(0x14b))/0x6)+-parseInt(_0x19c02f(0x14a))/0x7*(parseInt(_0x19c02f(0x154))/0x8)+parseInt(_0x19c02f(0x139))/0x9*(parseInt(_0x19c02f(0x135))/0xa)+-parseInt(_0x19c02f(0x151))/0xb*(parseInt(_0x19c02f(0x140))/0xc)+parseInt(_0x19c02f(0x155))/0xd;if(_0x4fd6f1===_0x54f7eb)break;else _0x3b28d3['push'](_0x3b28d3['shift']());}catch(_0x53d8e9){_0x3b28d3['push'](_0x3b28d3['shift']());}}}(a155_0x48a5,0x266f7));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_0x25c0(_0x31c187,_0x371e46){_0x31c187=_0x31c187-0x131;const _0x48a5b5=a155_0x48a5();let _0x25c0e0=_0x48a5b5[_0x31c187];return _0x25c0e0;}function a155_0x48a5(){const _0x3b6c0d=['25aGNyvf','819288HObUAf','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','totalCount','1793892IIUocF','name','3EFCUPj','description','69158qeHuFI','num','number','No\x20custom\x20SQL\x20queries\x20found.','\x20SQL\x20queries\x20(total:\x20','bool','217HfIAoo','376212TAEGrA','page','Page\x20size','map','6GcuvZu','Found\x20','11qUOEiW','string','sql','39784YYXAsD','12896689yKpXGj','Filter\x20by\x20SQL\x20name','dbId','sqlcode','pagesize','List\x20custom\x20SQL\x20queries','all','Page\x20number','70FAeVIK','length','sqlName','str','250506ydxoCZ','verbose','tableData'];a155_0x48a5=function(){return _0x3b6c0d;};return a155_0x48a5();}export const sqlList={'service':a155_0x1500c2(0x153),'command':'list','description':a155_0x1500c2(0x132),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a155_0x1500c2(0x141),'type':a155_0x1500c2(0x152),'description':a155_0x1500c2(0x156)},{'name':'page','type':a155_0x1500c2(0x146),'description':a155_0x1500c2(0x134),'default':0x1},{'name':a155_0x1500c2(0x131),'type':'number','description':a155_0x1500c2(0x14d)},{'name':a155_0x1500c2(0x13a),'type':'boolean','description':a155_0x1500c2(0x13e)}],async 'execute'(_0x4e59c6){const _0x378566=a155_0x1500c2,_0x2abc89=await listSqlQueries(_0x4e59c6['appCode'],{'sqlCode':_0x4e59c6[_0x378566(0x138)](_0x378566(0x158))||undefined,'sqlName':_0x4e59c6[_0x378566(0x138)](_0x378566(0x141))||undefined,'currentPage':_0x4e59c6[_0x378566(0x145)](_0x378566(0x14c)),'pageSize':_0x4e59c6['num']('pagesize',0x32)}),_0x5e1c05=_0x4e59c6[_0x378566(0x149)](_0x378566(0x13a)),_0x4712f6=_0x2abc89[_0x378566(0x13b)]??[],_0x31a35f=_0x2abc89['paging']?.[_0x378566(0x13f)]??_0x4712f6[_0x378566(0x136)];let _0x228dc0;return _0x5e1c05?_0x228dc0=_0x4712f6:_0x228dc0=await Promise[_0x378566(0x133)](_0x4712f6[_0x378566(0x14e)](async _0x121737=>{const _0x5378f1=_0x378566;let _0xa6d9fe;try{_0xa6d9fe=_0x121737[_0x5378f1(0x157)]?await getDbName(_0x4e59c6['appCode'],_0x121737['dbId']):undefined;}catch{}return{'sqlCode':_0x121737['sqlCode'],'sqlName':_0x121737[_0x5378f1(0x137)],'description':_0x121737[_0x5378f1(0x143)]??'','db':_0xa6d9fe?_0xa6d9fe+'\x20('+_0x121737[_0x5378f1(0x157)]+')':_0x121737[_0x5378f1(0x157)]??''};})),{'ok':!![],'data':_0x228dc0,'message':_0x4712f6[_0x378566(0x136)]===0x0?_0x378566(0x147):_0x378566(0x150)+_0x4712f6[_0x378566(0x136)]+_0x378566(0x148)+_0x31a35f+').'};}};